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UO,SAAS8oB,EACZhjB,EACAyO,EACApkB,EACAstB,GAEA,MAAMqrE,EAAuB34F,QAAAA,EAAestB,aAAS,EAATA,EAAWpB,KAAK/sB,YAE5D,QAAkB4B,IAAd4U,GAA2B1W,EAAAA,gBAAgBC,YAAYklB,GACvD,OAAOA,EAAShjB,MAAKsO,IAAU,IAAA2hB,EAC3B,OAAO1b,IAAcjG,EAAQG,WAA4B,QAAhBwhB,EAAA3hB,EAAQ4jB,gBAAQ,IAAAjC,OAAA,EAAhBA,EAAkBunE,uBAAwBD,CAAoB,GAKnH,mEC7Cc,SAAU5iB,EAA+BrmE,EAA8BsmE,GACjF,MAAMC,EAAavmE,EAAQotC,oBACX,IAAAo5B,EAAhB,OAAID,IACqD,QAA9CC,EAAAD,EAAW70E,MAAKuV,GAAMA,EAAGw/D,MAAQH,WAAa,IAAAE,GAAO,QAAPA,EAA9CA,EAAgD3gE,aAAK,IAAA2gE,OAAA,EAArDA,EAAuDE,cAE3D,IACX","sources":["webpack://Msdyn365.Commerce.Online/./src/themes/gardner-theme/views/components/inventory-breakdown.component.tsx?0b96","webpack://Msdyn365.Commerce.Online/./src/modules/bulk-purchase/bulk-purchase.tsx?9fd5","webpack://Msdyn365.Commerce.Online/./src/modules/ratings-histogram/ratings-histogram.tsx?f6bc","webpack://Msdyn365.Commerce.Online/./src/modules/ratings-histogram/ratings-histogram.view.tsx?5bff","webpack://Msdyn365.Commerce.Online/./src/components/LoginToViewPricing.component.tsx?4d0c","webpack://Msdyn365.Commerce.Online/./src/themes/gardner-theme/views/components/product.component.tsx?a667","webpack://Msdyn365.Commerce.Online/./src/themes/gardner-theme/views/components/addToCart.component.tsx?89c0","webpack://Msdyn365.Commerce.Online/./src/themes/gardner-theme-b2c/views/components/product.component.tsx?7a8d","webpack://Msdyn365.Commerce.Online/./src/themes/gardner-theme-b2c/views/components/addToCart.component.tsx?25ed","webpack://Msdyn365.Commerce.Online/./src/modules/active-image-utilities/active-product.tsx?69b2","webpack://Msdyn365.Commerce.Online/./src/modules/active-image-utilities/additional-content.tsx?6946","webpack://Msdyn365.Commerce.Online/./src/modules/active-image-utilities/image-mapper.tsx?dd86","webpack://Msdyn365.Commerce.Online/./src/modules/active-image/active-image.tsx?00d3","webpack://Msdyn365.Commerce.Online/./src/modules/cart/actions/get-pickup-options-for-cartlines.ts?acad","webpack://Msdyn365.Commerce.Online/./src/modules/cart/components/cart-pick-up-in-store.tsx?dca8","webpack://Msdyn365.Commerce.Online/./src/modules/cart/components/cart-line-items.tsx?f6b2","webpack://Msdyn365.Commerce.Online/./src/modules/cart/components/cart-line-groups.tsx?f076","webpack://Msdyn365.Commerce.Online/./src/modules/cart/utils/get-promotion-in-cart.ts?4195","webpack://Msdyn365.Commerce.Online/./src/modules/cart/cart.tsx?d4e4","webpack://Msdyn365.Commerce.Online/./src/modules/cart/components/cart-line-items-promotion.tsx?80d9","webpack://Msdyn365.Commerce.Online/./src/modules/product-collection/product-collection.tsx?4008","webpack://Msdyn365.Commerce.Online/./src/modules/quick-order/components/quick-order-drawer.tsx?f8b4","webpack://Msdyn365.Commerce.Online/./src/modules/quick-order/components/quick-order-form.tsx?eb54","webpack://Msdyn365.Commerce.Online/./src/modules/quick-order/components/quick-order-product.ts?7702","webpack://Msdyn365.Commerce.Online/./src/modules/quick-order/components/quick-order-table/components/quick-order-table-header-component.tsx?49e7","webpack://Msdyn365.Commerce.Online/./src/modules/quick-order/components/quick-order-table/components/quick-order-table-row-component.tsx?e487","webpack://Msdyn365.Commerce.Online/./src/modules/quick-order/components/quick-order-table/quick-order-table-component.tsx?46c1","webpack://Msdyn365.Commerce.Online/./src/modules/quick-order/quick-order.tsx?ef21","webpack://Msdyn365.Commerce.Online/./src/search-state.ts?dd10","webpack://Msdyn365.Commerce.Online/./src/modules/search/actions/get-auto-suggest-suggestions.ts?4735","webpack://Msdyn365.Commerce.Online/./src/modules/search/components/search.categorysuggest.tsx?c65d","webpack://Msdyn365.Commerce.Online/./src/modules/search/components/search.form.tsx?25a5","webpack://Msdyn365.Commerce.Online/./src/modules/search/components/search.keywordsuggest.tsx?297c","webpack://Msdyn365.Commerce.Online/./src/modules/search/components/search.label.tsx?0c17","webpack://Msdyn365.Commerce.Online/./src/modules/search/components/search.productsuggest.tsx?2af9","webpack://Msdyn365.Commerce.Online/./src/modules/search/search.tsx?72fb","webpack://Msdyn365.Commerce.Online/./src/modules/social-share-item/social-share-item.tsx?bbcb","webpack://Msdyn365.Commerce.Online/./src/modules/video-player/components/additional-content.tsx?b368","webpack://Msdyn365.Commerce.Online/./src/modules/video-player/video-player.tsx?53e5","webpack://Msdyn365.Commerce.Online/./src/modules/eve-search-result-container/components/utilities.ts?71e1","webpack://Msdyn365.Commerce.Online/./src/modules/eve-search-result-container/components/choice-summary.tsx?92a7","webpack://Msdyn365.Commerce.Online/./src/modules/eve-search-result-container/components/error-message.tsx?5da8","webpack://Msdyn365.Commerce.Online/./src/modules/eve-search-result-container/components/feature-search-result-item.tsx?5dcb","webpack://Msdyn365.Commerce.Online/./src/modules/eve-search-result-container/components/link.tsx?3ec2","webpack://Msdyn365.Commerce.Online/./src/modules/eve-search-result-container/components/modal.tsx?793f","webpack://Msdyn365.Commerce.Online/./src/modules/eve-search-result-container/components/product-search-result-items.tsx?7848","webpack://Msdyn365.Commerce.Online/./src/modules/eve-search-result-container/components/range-refine-item.tsx?cc5e","webpack://Msdyn365.Commerce.Online/./src/modules/eve-search-result-container/components/refine-item.tsx?ac45","webpack://Msdyn365.Commerce.Online/./src/modules/eve-search-result-container/components/refine-submenu.tsx?49ea","webpack://Msdyn365.Commerce.Online/./src/modules/eve-search-result-container/components/separator.tsx?fa0e","webpack://Msdyn365.Commerce.Online/./src/modules/eve-search-result-container/components/title.tsx?1fda","webpack://Msdyn365.Commerce.Online/./src/modules/eve-search-result-container/eve-search-result-container.props.autogenerated.ts?22c3","webpack://Msdyn365.Commerce.Online/./src/modules/eve-search-result-container/eve-search-result-container.tsx?578c","webpack://Msdyn365.Commerce.Online/./src/modules/eve-search-result-container/eve-search-result-container.view.tsx?c38c","webpack://Msdyn365.Commerce.Online/./src/themes/gardner-theme-b2c/views/cart-icon.view.tsx?3413","webpack://Msdyn365.Commerce.Online/./src/themes/gardner-theme-b2c/views/search-result-container.view.tsx?87ee","webpack://Msdyn365.Commerce.Online/./src/themes/gardner-theme/views/cart-icon.view.tsx?be14","webpack://Msdyn365.Commerce.Online/./src/themes/gardner-theme/views/search-result-container.view.tsx?c8d6","webpack://Msdyn365.Commerce.Online/./src/modules/active-image/active-image.view.tsx?a935","webpack://Msdyn365.Commerce.Online/./src/modules/bulk-purchase/bulk-purchase.view.tsx?feac","webpack://Msdyn365.Commerce.Online/./src/modules/cart/cart.view.tsx?d8c2","webpack://Msdyn365.Commerce.Online/./src/modules/product-collection/product-collection.view.tsx?5d36","webpack://Msdyn365.Commerce.Online/./src/modules/quick-order/quick-order.view.tsx?a96d","webpack://Msdyn365.Commerce.Online/./src/modules/search/search.view.tsx?1505","webpack://Msdyn365.Commerce.Online/./src/modules/social-share-item/social-share-item.view.tsx?2d3e","webpack://Msdyn365.Commerce.Online/./src/modules/video-player/video-player.view.tsx?fedb","webpack://Msdyn365.Commerce.Online/./src/modules/adventureworks/views/ratings-histogram.view.tsx?bb5b","webpack://Msdyn365.Commerce.Online/./src/themes/gardner-theme-b2c/views/components/cartlineitem.component.tsx?767d","webpack://Msdyn365.Commerce.Online/./src/themes/gardner-theme-b2c/views/components/promocode.component.tsx?5a9f","webpack://Msdyn365.Commerce.Online/./src/themes/gardner-theme/views/components/cartlineitem.component.tsx?4855","webpack://Msdyn365.Commerce.Online/./src/themes/gardner-theme/views/components/promocode.component.tsx?6892","webpack://Msdyn365.Commerce.Online/./src/modules/fabrikam/views/components/promocode.component.tsx?d9d6","webpack://Msdyn365.Commerce.Online/./src/modules/adventureworks/views/components/cartlineitem.component.tsx?ccc2","webpack://Msdyn365.Commerce.Online/./src/themes/gardner-theme/models/SupersessionKey.ts?818f","webpack://Msdyn365.Commerce.Online/./src/validate-cart.ts?cd50","webpack://Msdyn365.Commerce.Online/./src/modules/ratings-histogram/component/components.tsx?f324","webpack://Msdyn365.Commerce.Online/./src/utils/cartAttributeManager.ts?36c3","webpack://Msdyn365.Commerce.Online/./src/invoice-summary-lineitem.tsx?5f61","webpack://Msdyn365.Commerce.Online/./src/order-summary-lineitem.tsx?8a98","webpack://Msdyn365.Commerce.Online/./src/Common/get-product.ts?0a21","webpack://Msdyn365.Commerce.Online/./src/themes/gardner-theme/models/getProductSupersessionProperty.ts?8b55"],"sourcesContent":["import React from 'react';\r\nimport getExtensionPropertyValueByKey, { CommercePropertyValueEnum } from '../../../../utils/getExtensionPropertyValueByKey';\r\nimport { SupersessionKey } from '../../models/SupersessionKey';\r\nimport { CommerceProperty } from '@msdyn365-commerce/retail-proxy';\r\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\n\r\nexport interface IWarehouseMapping {\r\n warehouseId: string;\r\n warehouseName: string;\r\n}\r\n\r\ninterface IInventoryBreakdownComponentProps {\r\n extensionProperties: CommerceProperty[] | undefined;\r\n itemId: string;\r\n canBackorder: boolean;\r\n canChangeWarehouse?: boolean;\r\n onWarehouseChange?: (whId: string) => void;\r\n allowableText: string;\r\n alternateText: string;\r\n productQuantity?: number | undefined;\r\n setShouldShowQtyMessage?: React.Dispatch>;\r\n warehouseMappings: IWarehouseMapping[];\r\n}\r\n\r\nexport type WarehouseInventoryType = {\r\n WarehouseId: string;\r\n IsAllowable: boolean;\r\n Available: number;\r\n Name: string;\r\n};\r\n\r\nexport const InventoryBreakdownComponent: React.FC = props => {\r\n const { extensionProperties, canChangeWarehouse, onWarehouseChange, productQuantity, warehouseMappings } = props;\r\n const [warehouseData, setWarehouseData] = React.useState([]);\r\n const [hasError, setHasError] = React.useState(false);\r\n\r\n const handleSelectWarehouseClick = (e: React.MouseEvent, warehouseId: string) => {\r\n e.preventDefault();\r\n if (onWarehouseChange) {\r\n onWarehouseChange(warehouseId);\r\n }\r\n };\r\n\r\n const shouldDisableWarehouseSelect = (warehouse: WarehouseInventoryType) => {\r\n if (ArrayExtensions.hasElements(warehouseData) && warehouse.WarehouseId === warehouseData[0].WarehouseId) {\r\n return false;\r\n }\r\n const anyWarehouseHasSufficientQty = warehouseData.some(wh => wh.Available >= (productQuantity ?? 0));\r\n props.setShouldShowQtyMessage?.(!anyWarehouseHasSufficientQty);\r\n return warehouse.Available <= 0 || warehouse.Available < productQuantity!;\r\n };\r\n\r\n const renderWarehouseSelectLink = (warehouse: WarehouseInventoryType) => {\r\n if (shouldDisableWarehouseSelect(warehouse)) {\r\n return

Unavailable

;\r\n }\r\n return (\r\n handleSelectWarehouseClick(e, warehouse.WarehouseId)}\r\n >\r\n Select Warehouse\r\n \r\n );\r\n };\r\n React.useEffect(() => {\r\n try {\r\n const warehouseJsonData = getExtensionPropertyValueByKey(\r\n extensionProperties,\r\n SupersessionKey.InventoryBreakdown,\r\n CommercePropertyValueEnum.string\r\n ) as string;\r\n const data = JSON.parse(warehouseJsonData) as WarehouseInventoryType[];\r\n setWarehouseData(data || []);\r\n setHasError(false);\r\n } catch {\r\n setHasError(true);\r\n }\r\n }, [extensionProperties]);\r\n\r\n const allowableText = props.allowableText || '-------------------';\r\n const alternateText = props.alternateText || 'Alternate Warehouse';\r\n\r\n //TODO\r\n // if selected warehouse doesnt contain enough stock, display the expected to ship from multiple warehouse message.\r\n\r\n const getWarehouseFriendlyName = (warehouseId: string) => {\r\n return warehouseMappings?.find(mapping => mapping.warehouseId === warehouseId)?.warehouseName;\r\n };\r\n\r\n const formatWarehouseName = (name: string) => {\r\n return name.replace(/gardner\\s*/i, '');\r\n };\r\n\r\n // const mergedWarehouses =\r\n // warehouseMappings && warehouseMappings.length > 0\r\n // ? [\r\n // ...warehouseData.map(wh => ({\r\n // WarehouseId: wh.WarehouseId,\r\n // Name: getWarehouseFriendlyName(wh.WarehouseId) ?? wh.Name,\r\n // Available: wh.Available,\r\n // IsAllowable: wh.IsAllowable\r\n // })),\r\n // ...warehouseMappings\r\n // .filter(mapping => !warehouseData.some(wh => wh.WarehouseId === mapping.warehouseId))\r\n // .map(mapping => ({\r\n // WarehouseId: mapping.warehouseId,\r\n // Name: mapping.warehouseName,\r\n // Available: 0,\r\n // IsAllowable: false\r\n // }))\r\n // ]\r\n // : warehouseData.map(wh => ({\r\n // WarehouseId: wh.WarehouseId,\r\n // Name: formatWarehouseName(wh.Name),\r\n // Available: wh.Available,\r\n // IsAllowable: wh.IsAllowable\r\n // }));\r\n\r\n return (\r\n
\r\n {hasError ?

Inventory unavailable, please try again later

: null}\r\n {warehouseData.length ? (\r\n \r\n \r\n \r\n \r\n \r\n \r\n {canChangeWarehouse ? \r\n \r\n \r\n {warehouseData.map(wh => (\r\n \r\n \r\n \r\n \r\n {canChangeWarehouse ? : undefined}\r\n \r\n ))}\r\n \r\n
WarehouseAvailable : undefined}\r\n
\r\n {getWarehouseFriendlyName(wh.WarehouseId) ?? formatWarehouseName(wh.Name)} - {wh.WarehouseId}\r\n {wh.Available}{wh.IsAllowable ? allowableText : alternateText}{renderWarehouseSelectLink(wh)}
\r\n ) : (\r\n
\r\n

No Inventory Data Available

\r\n
\r\n )}\r\n
\r\n );\r\n};\r\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IProductDimensionsWithAvailabilitiesFull } from '@msdyn365-commerce/commerce-entities';\nimport { ProductDimensionsMatrix } from '@msdyn365-commerce/components';\nimport { RichTextComponent } from '@msdyn365-commerce/core';\nimport { ICoreContext, getCatalogId } from '@msdyn365-commerce/core-internal';\nimport { ArrayExtensions, IDimensionsApp, validateCatalogId } from '@msdyn365-commerce-modules/retail-actions';\nimport { Alert, Button, Collapse, IModuleProps, isMobile, VariantType } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { FeatureState } from '@msdyn365-commerce/retail-proxy';\nimport { IBulkPurchaseData } from './bulk-purchase.data';\nimport { IBulkPurchaseProps } from './bulk-purchase.props.autogenerated';\n\n/**\n * Additional optional props for the bulk purchase.\n */\nexport interface IBulkPurchaseExtendedProps extends IBulkPurchaseProps {\n productDimensions?: IProductDimensionsWithAvailabilitiesFull[];\n}\n\n/**\n * View for the bulk purchase module.\n */\nexport interface IBulkPurchaseViewProps extends IBulkPurchaseProps {\n container: IModuleProps;\n content: React.ReactElement;\n}\n\n/**\n * BulkPurchase state message Interface.\n */\nexport interface IBulkPurchaseStateMessage {\n isOpen: boolean;\n messageGlyph: string;\n messageText: string;\n statusCssString: string;\n}\n\n/**\n * View for the bulk purchase module.\n */\nexport interface IBulkPurchaseState {\n isExpanded: boolean;\n stateMessage?: IBulkPurchaseStateMessage;\n}\n\n/**\n * Bulk-purchase module.\n */\nexport class BulkPurchase extends React.PureComponent {\n public static readonly className = 'ms-bulk-purchase';\n private readonly _errorCssClass: string = 'danger';\n private readonly _errorCssGlyphClass: string = 'fas fa-exclamation-triangle';\n private readonly collapseRef: React.RefObject = React.createRef();\n\n public constructor(props: IBulkPurchaseExtendedProps) {\n super(props);\n\n this.state = {\n isExpanded: false\n };\n }\n\n public render(): React.ReactElement | null {\n const hasDimensionsInProps = ArrayExtensions.hasElements(this.props.productDimensions);\n const hasDimensionsInData = ArrayExtensions.hasElements(this.props.data.productDimensions?.result);\n if (!hasDimensionsInProps && !hasDimensionsInData) {\n return null;\n }\n\n const viewProps: IBulkPurchaseViewProps = {\n ...this.props,\n container: {\n moduleProps: this.props,\n className: classnames(BulkPurchase.className, this.props.config.className)\n },\n content: this._renderCollapseContent(`${BulkPurchase.className}__content`)\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n private _renderCollapseContent(className: string): React.ReactElement {\n return (\n
\n {this._renderCollapseButton(`${className}__collapse-button`)}\n {this._renderCollapse(`${className}__collapse`)}\n
\n );\n }\n\n private _renderCollapseButton(className: string): React.ReactElement {\n return (\n \n {this.props.resources.bulkPurchaseHeaderTitle}\n \n );\n }\n\n /**\n *This function is being used to handel variant change dropdown.\n */\n private _dimensionDropDownChange = () => {\n this.collapseRef.current?.reEvaluateHeight();\n };\n\n private _renderCollapse(className: string): React.ReactElement {\n return (\n \n {this._renderMainContent(`${className}__main-content`)}\n \n );\n }\n\n private _renderMainContent(className: string): React.ReactElement {\n const isMobileDevice = isMobile({ variant: VariantType.Viewport, context: this.props.context.request }) === 'xs';\n\n const userMessageNode = this.state.stateMessage ? (\n \n \n {this.state.stateMessage.messageText}\n \n ) : (\n undefined\n );\n\n return (\n
\n {!isMobileDevice && (\n
\n \n
\n )}\n {userMessageNode}\n {this._renderMatrix(`${className}__matrix-container`)}\n
\n );\n }\n\n private _renderMatrix(className: string): React.ReactElement {\n const hasDimensionsInProps = ArrayExtensions.hasElements(this.props.productDimensions);\n const channelMultipleCatalogsFeature = 'Dynamics.AX.Application.ChannelMultipleCatalogsFeature';\n const { featureState } = this.props.data;\n const isMultipleCatalogsFeatureEnabled =\n featureState?.result?.find((item: FeatureState) => item.Name === channelMultipleCatalogsFeature)?.IsEnabled || false;\n const catalogId = getCatalogId(this.props.context.request);\n validateCatalogId(catalogId);\n return (\n }\n data={{\n dimensions: hasDimensionsInProps ? this.props.productDimensions! : this.props.data.productDimensions!.result!,\n orderTemplates: this.props.data.orderTemplates?.result,\n customerInformation: this.props.data.customerInformation?.result\n }}\n resources={this.props.resources}\n dimensionOnChange={this._dimensionDropDownChange}\n onErrorMessage={this._onErrorMessage}\n isMultipleCatalogFeatureEnabledInHq={isMultipleCatalogsFeatureEnabled}\n catalogId={catalogId}\n />\n );\n }\n\n private _onErrorMessage = (errorMessage: string) => {\n this.setState({\n stateMessage: {\n messageText: errorMessage,\n statusCssString: this._errorCssClass,\n messageGlyph: this._errorCssGlyphClass,\n isOpen: true\n }\n });\n };\n\n /**\n * Callback which toggles collapse mode.\n */\n private readonly _toggleCollapse = () => {\n this.setState(state => ({\n isExpanded: !state.isExpanded\n }));\n };\n}\n\nexport default BulkPurchase;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { RatingComponent } from '@msdyn365-commerce/components';\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport { format, IModuleProps, INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport classname from 'classnames';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { createRatingsReviewsStateInput } from '../../actions/ratings-reviews-state-data-action';\nimport { AverageRatingNumber, HistogramItems, IHistogramItemViewProps, TotalReviews } from './component/components';\nimport { IRatingsHistogramData } from './ratings-histogram.data';\nimport { IRatingsHistogramProps } from './ratings-histogram.props.autogenerated';\n\nexport interface IRatingsHistogramViewProps extends IRatingsHistogramProps {\n className: string;\n histogramItems: IHistogramItemViewProps[];\n moduleProps: IModuleProps;\n heading: React.ReactNode;\n averageRating: React.ReactNode;\n averageNumber: React.ReactNode;\n totalReviews: React.ReactNode;\n histogramProps: INodeProps;\n ratingsSummaryProps: INodeProps;\n callbacks: IRatingsHistogramCallbacks;\n}\n\nexport interface IRatingsHistogramCallbacks {\n selectFilterBy(stars: number): void;\n}\n\n/**\n * RatingsHistogram component.\n * @extends {React.Component>}\n */\n@observer\nclass RatingsHistogram extends React.PureComponent> {\n constructor(props: IRatingsHistogramProps) {\n super(props);\n this.selectFilterBy = this.selectFilterBy.bind(this);\n }\n\n public render(): JSX.Element | null {\n const { resources } = this.props;\n const { className, heading } = this.props.config;\n const {\n ratingsSummary: { result: ratingsSummary }\n } = this.props.data;\n const ratingCount = ratingsSummary && ratingsSummary.totalRatingsCount ? `${ratingsSummary.totalRatingsCount}` : '0';\n\n const completeClass = classname('ms-ratings-histogram', className);\n const viewProps: IRatingsHistogramViewProps = {\n ...this.props,\n className: completeClass,\n callbacks: {\n selectFilterBy: this.selectFilterBy\n },\n moduleProps: {\n moduleProps: this.props,\n className: completeClass\n },\n histogramItems: ratingsSummary\n ? HistogramItems({\n ratingsSummary,\n resources: { ...resources },\n locale: this.props.context.request.locale,\n onClick: this.selectFilterBy\n })\n : [],\n averageRating: ratingsSummary && (\n \n ),\n averageNumber: ratingsSummary && ,\n totalReviews: ratingsSummary && ,\n ratingsSummaryProps: { className: 'ms-ratings-histogram__summary' },\n heading: heading && (\n \n ),\n histogramProps: { className: 'ms-ratings-histogram__histogram' }\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n public handleHeadingChange = (event: Msdyn365.ContentEditableEvent) => (this.props.config.heading!.text = event.target.value);\n\n public selectFilterBy(stars: number): void {\n const filterKey = `${stars}`;\n this.props.context.actionContext.update(createRatingsReviewsStateInput({ filterKey }), { filterKey });\n }\n}\n\nexport default RatingsHistogram;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IHistogramItemViewProps } from './component/components';\nimport { IRatingsHistogramViewProps } from './ratings-histogram';\n\nconst RatingsHistogramView: React.FC = props => {\n const { heading, histogramItems, histogramProps, moduleProps } = props;\n\n return (\n \n {heading}\n \n {histogramItems.map(item => {\n return histogramItem(item);\n })}\n \n \n );\n};\n\nconst histogramItem = (props: IHistogramItemViewProps) => {\n return (\n \n {props.starLabel}\n {props.bar}\n {props.percentage}\n \n );\n};\n\nexport default RatingsHistogramView;\n","import React from 'react';\r\nimport { IRequestContext } from '@msdyn365-commerce/core';\r\nexport const LoginToViewPricingComponent = (\r\n context: IRequestContext,\r\n loginText: string,\r\n priceComponent: JSX.Element,\r\n shouldBlockPricing: boolean,\r\n className: string = 'login-to-view-pricing'\r\n): JSX.Element => {\r\n const {\r\n user: { signInUrl, isAuthenticated }\r\n } = context;\r\n\r\n if (isAuthenticated) {\r\n return priceComponent;\r\n } else if (!isAuthenticated && !shouldBlockPricing) {\r\n return priceComponent;\r\n } else {\r\n return (\r\n
\r\n {loginText}\r\n
\r\n );\r\n }\r\n};\r\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 { ISwatchItem, PriceComponent, ProductComponentSwatchComponent, RatingComponent } from '@msdyn365-commerce/components';\r\nimport { IPriceComponentResources } from './price.component';\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} from '@msdyn365-commerce/core';\r\nimport { AttributeSwatch, AttributeValue, ProductDimension, ProductPrice, ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n ArrayExtensions,\r\n convertDimensionTypeToProductDimensionType,\r\n Dictionary,\r\n DimensionTypes,\r\n generateImageUrl,\r\n getProductPageUrlSync,\r\n IDimensionsApp,\r\n StringExtensions\r\n} 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 React, { useState } from 'react';\r\nimport { LoginToViewPricingComponent } from '../../../../components/LoginToViewPricing.component';\r\n\r\nexport interface IProductComponentProps extends IComponentProps<{ product?: ProductSearchResult }> {\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 isEnabledProductDescription?: boolean;\r\n isPriceMinMaxEnabled?: boolean;\r\n priceResources?: IPriceComponentResources;\r\n inventoryLabel?: string;\r\n dimensionAvailabilities?: IProductsDimensionsAvailabilities[];\r\n setAvailabilityModalProduct?: React.Dispatch>;\r\n}\r\n\r\nexport interface IProductComponent extends IComponent {}\r\n\r\nconst PriceComponentActions = {};\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(\r\n attributeValue => attributeValue.KeyName?.toLocaleLowerCase() === DimensionTypes.color\r\n );\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)\r\n ? generateImageUrl(defaultSwatch.ProductImageUrls[0], coreContext.request.apiSettings)\r\n : 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 unit of measure display.\r\n * @param unitOfMeasure - DefaultUnitOfMeasure property from product.\r\n * @returns The node representing markup for unit of measure component.\r\n */\r\nfunction renderProductUnitOfMeasure(unitOfMeasure?: string): JSX.Element | null {\r\n if (!unitOfMeasure) {\r\n return null;\r\n }\r\n return (\r\n
\r\n {unitOfMeasure}\r\n
\r\n );\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 {inventoryAvailabilityLabel}\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(\r\n coreContext: ICoreContext,\r\n productUrl: string,\r\n productData?: ProductSearchResult\r\n): 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 isEnabledProductDescription,\r\n isPriceMinMaxEnabled,\r\n priceResources,\r\n inventoryLabel,\r\n dimensionAvailabilities,\r\n setAvailabilityModalProduct\r\n}) => {\r\n const product = data.product;\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(\r\n (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)\r\n ? swatchItem.productImageUrls[0]\r\n : undefined;\r\n const newImageUrl = generateImageUrl(swatchProductImageUrl, coreContext.request.apiSettings);\r\n setProductImageUrl(newImageUrl);\r\n }\r\n },\r\n [selectedSwatchItems, context, productPageUrl]\r\n );\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 (\r\n 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 /**\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 {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 =\r\n 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:\r\n enableStockCheck &&\r\n dimensionAvailabilities?.find(\r\n dimensionAvailability => dimensionAvailability.value === (swatchItem.SwatchValue ?? '')\r\n )?.isDisabled\r\n };\r\n }) ?? [];\r\n if (\r\n dimensionToPreSelectInProductCard !== DimensionTypes.none &&\r\n ArrayExtensions.hasElements(swatches) &&\r\n !swatches.some(swatch => swatch.isDefault) &&\r\n dimensionType === DimensionTypes.color\r\n ) {\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 function renderQuickView(quickview: React.ReactNode, item?: number): 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 });\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\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- -- Do not need type check for appsettings\r\n const isUnitOfMeasureEnabled = context.app.config && context.app.config.unitOfMeasureDisplayType === 'buyboxAndBrowse';\r\n return (\r\n <>\r\n {isEnabledProductDescription ? (\r\n \r\n
\r\n
\r\n {renderProductPlacementImage(\r\n imageSettings,\r\n context.request.gridSettings,\r\n productImageUrl,\r\n product.PrimaryImageUrl,\r\n product.Name,\r\n context\r\n )}\r\n
\r\n
\r\n
{product.Name}
\r\n {renderPrice(\r\n context,\r\n typeName,\r\n id,\r\n product.BasePrice,\r\n product.Price,\r\n savingsText,\r\n freePriceText,\r\n originalPriceText,\r\n currentPriceText,\r\n isPriceMinMaxEnabled,\r\n priceResources\r\n )}\r\n Check Availability\r\n {isUnitOfMeasureEnabled && renderProductUnitOfMeasure(product.DefaultUnitOfMeasure)}\r\n {renderDescription(product.Description)}\r\n
\r\n
\r\n \r\n ) : (\r\n <>\r\n \r\n
\r\n {renderProductPlacementImage(\r\n imageSettings,\r\n context.request.gridSettings,\r\n productImageUrl,\r\n product.PrimaryImageUrl,\r\n product.Name,\r\n context\r\n )}\r\n
\r\n
\r\n
{product.Name}
\r\n {renderPrice(\r\n context,\r\n typeName,\r\n id,\r\n product.BasePrice,\r\n product.Price,\r\n savingsText,\r\n freePriceText,\r\n originalPriceText,\r\n currentPriceText,\r\n isPriceMinMaxEnabled,\r\n priceResources\r\n )}\r\n {isUnitOfMeasureEnabled && renderProductUnitOfMeasure(product.DefaultUnitOfMeasure)}\r\n
\r\n \r\n {setAvailabilityModalProduct && (\r\n

setAvailabilityModalProduct(product.RecordId)}>\r\n Check Availability\r\n

\r\n )}\r\n \r\n )}\r\n {renderProductDimensions(product.AttributeValues)}\r\n {!context.app.config.hideRating &&\r\n renderRating(context, typeName, id, product.AverageRating, product.TotalRatings, ratingAriaLabel, ratingCountAriaLabel)}\r\n {renderProductAvailability(inventoryLabel)}\r\n {quickViewButton && renderQuickView(quickViewButton, product.RecordId)}\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\r\n): string {\r\n const reviewCountArialableText = getReviewAriaLabel(reviewCount, ratingCountAriaLabelText ?? '');\r\n return `${name ?? ''} ${price ?? ''} ${getRatingAriaLabel(rating, ratingAriaLabelText)}${\r\n reviewCountArialableText ? ` ${reviewCountArialableText}` : ''\r\n }`;\r\n}\r\n\r\nfunction 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 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(\r\n coreContext: ICoreContext,\r\n moduleTypeName: string,\r\n moduleId: string,\r\n avgRating?: number,\r\n totalRatings?: number,\r\n ariaLabel?: string,\r\n ratingCountAriaLabel?: string\r\n): 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(\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 isPriceMinMaxEnabled?: boolean,\r\n priceResources?: IPriceComponentResources\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 const priceComponent = (\r\n \r\n );\r\n //console.log(priceResources);\r\n return LoginToViewPricingComponent(context.request, priceResources?.loginToViewPricingText || '', priceComponent, true);\r\n}\r\n\r\nfunction renderProductPlacementImage(\r\n imageSettings?: IImageSettings,\r\n gridSettings?: IGridSettings,\r\n imageUrl?: string,\r\n fallbackImageUrl?: string,\r\n altText?: string,\r\n context?: ICoreContext\r\n): 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\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 React from 'react';\r\n\r\ninterface IAddToCartListComponentProps {\r\n productId: number\r\n onAddToCart(id: number, quantity: number): void;\r\n addToCartButtonText: string\r\n}\r\n\r\nexport const AddToCartListComponent: React.FC = ({productId, onAddToCart, addToCartButtonText}) => {\r\n\r\n const [ quantity , setQuantity ] = React.useState(1);\r\n\r\n const handleQuantityChange = (e: React.ChangeEvent) => {\r\n setQuantity(e.target.valueAsNumber);\r\n }\r\n const handleAddToCart = () => onAddToCart(productId, quantity);\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n )\r\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 { ISwatchItem, PriceComponent, ProductComponentSwatchComponent, RatingComponent } from '@msdyn365-commerce/components';\r\nimport { IPriceComponentResources } from './price.component';\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} from '@msdyn365-commerce/core';\r\nimport {\r\n AttributeSwatch,\r\n AttributeValue,\r\n ProductDimension,\r\n ProductPrice,\r\n ProductSearchResult,\r\n ProductWarehouseInventoryAvailability\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n ArrayExtensions,\r\n convertDimensionTypeToProductDimensionType,\r\n Dictionary,\r\n DimensionTypes,\r\n generateImageUrl,\r\n getProductPageUrlSync,\r\n IDimensionsApp,\r\n StringExtensions\r\n} 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 React, { useState } from 'react';\r\n// import { LoginToViewPricingComponent } from \"../../../../components/LoginToViewPricing.component\";\r\n\r\nexport interface IProductComponentProps extends IComponentProps<{ product?: ProductSearchResult }> {\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 isEnabledProductDescription?: boolean;\r\n isPriceMinMaxEnabled?: boolean;\r\n priceResources?: IPriceComponentResources;\r\n inventoryLabel?: string;\r\n dimensionAvailabilities?: IProductsDimensionsAvailabilities[];\r\n estimatedAvailabilites?: ProductWarehouseInventoryAvailability[];\r\n}\r\n\r\nexport interface IProductComponent extends IComponent {}\r\n\r\nconst PriceComponentActions = {};\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(\r\n attributeValue => attributeValue.KeyName?.toLocaleLowerCase() === DimensionTypes.color\r\n );\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)\r\n ? generateImageUrl(defaultSwatch.ProductImageUrls[0], coreContext.request.apiSettings)\r\n : 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 unit of measure display.\r\n * @param unitOfMeasure - DefaultUnitOfMeasure property from product.\r\n * @returns The node representing markup for unit of measure component.\r\n */\r\nfunction renderProductUnitOfMeasure(unitOfMeasure?: string): JSX.Element | null {\r\n if (!unitOfMeasure) {\r\n return null;\r\n }\r\n return (\r\n
\r\n {unitOfMeasure}\r\n
\r\n );\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 {inventoryAvailabilityLabel}\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(\r\n coreContext: ICoreContext,\r\n productUrl: string,\r\n productData?: ProductSearchResult\r\n): 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 isEnabledProductDescription,\r\n isPriceMinMaxEnabled,\r\n priceResources,\r\n inventoryLabel,\r\n dimensionAvailabilities,\r\n estimatedAvailabilites\r\n}) => {\r\n const product = data.product;\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(\r\n (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)\r\n ? swatchItem.productImageUrls[0]\r\n : undefined;\r\n const newImageUrl = generateImageUrl(swatchProductImageUrl, coreContext.request.apiSettings);\r\n setProductImageUrl(newImageUrl);\r\n }\r\n },\r\n [selectedSwatchItems, context, productPageUrl]\r\n );\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 (\r\n 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 /**\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 {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 =\r\n 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:\r\n enableStockCheck &&\r\n dimensionAvailabilities?.find(\r\n dimensionAvailability => dimensionAvailability.value === (swatchItem.SwatchValue ?? '')\r\n )?.isDisabled\r\n };\r\n }) ?? [];\r\n if (\r\n dimensionToPreSelectInProductCard !== DimensionTypes.none &&\r\n ArrayExtensions.hasElements(swatches) &&\r\n !swatches.some(swatch => swatch.isDefault) &&\r\n dimensionType === DimensionTypes.color\r\n ) {\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 function renderQuickView(quickview: React.ReactNode, item?: number): 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 });\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\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- -- Do not need type check for appsettings\r\n const isUnitOfMeasureEnabled = context.app.config && context.app.config.unitOfMeasureDisplayType === 'buyboxAndBrowse';\r\n const invenLabel = estimatedAvailabilites?.find(pr => pr.ProductId === product.RecordId)?.TotalAvailableInventoryLevelLabel || '';\r\n return (\r\n <>\r\n {isEnabledProductDescription ? (\r\n \r\n
\r\n
\r\n {renderProductPlacementImage(\r\n imageSettings,\r\n context.request.gridSettings,\r\n productImageUrl,\r\n product.PrimaryImageUrl,\r\n product.Name,\r\n context\r\n )}\r\n
\r\n
\r\n
{product.Name}
\r\n {renderPrice(\r\n context,\r\n typeName,\r\n id,\r\n product.BasePrice,\r\n product.Price,\r\n savingsText,\r\n freePriceText,\r\n originalPriceText,\r\n currentPriceText,\r\n isPriceMinMaxEnabled,\r\n priceResources\r\n )}\r\n

{estimatedAvailabilites && invenLabel}

\r\n {isUnitOfMeasureEnabled && renderProductUnitOfMeasure(product.DefaultUnitOfMeasure)}\r\n {renderDescription(product.Description)}\r\n
\r\n
\r\n \r\n ) : (\r\n \r\n
\r\n {renderProductPlacementImage(\r\n imageSettings,\r\n context.request.gridSettings,\r\n productImageUrl,\r\n product.PrimaryImageUrl,\r\n product.Name,\r\n context\r\n )}\r\n
\r\n
\r\n
{product.Name}
\r\n

SKU: {product.ItemId}

\r\n {renderPrice(\r\n context,\r\n typeName,\r\n id,\r\n product.BasePrice,\r\n product.Price,\r\n savingsText,\r\n freePriceText,\r\n originalPriceText,\r\n currentPriceText,\r\n isPriceMinMaxEnabled,\r\n priceResources\r\n )}\r\n

{estimatedAvailabilites && invenLabel}

\r\n
VIEW DETAILS
\r\n {isUnitOfMeasureEnabled && renderProductUnitOfMeasure(product.DefaultUnitOfMeasure)}\r\n
\r\n \r\n )}\r\n {renderProductDimensions(product.AttributeValues)}\r\n {!context.app.config.hideRating &&\r\n renderRating(context, typeName, id, product.AverageRating, product.TotalRatings, ratingAriaLabel, ratingCountAriaLabel)}\r\n {renderProductAvailability(inventoryLabel)}\r\n {quickViewButton && renderQuickView(quickViewButton, product.RecordId)}\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\r\n): string {\r\n const reviewCountArialableText = getReviewAriaLabel(reviewCount, ratingCountAriaLabelText ?? '');\r\n return `${name ?? ''} ${price ?? ''} ${getRatingAriaLabel(rating, ratingAriaLabelText)}${\r\n reviewCountArialableText ? ` ${reviewCountArialableText}` : ''\r\n }`;\r\n}\r\n\r\nfunction 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 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(\r\n coreContext: ICoreContext,\r\n moduleTypeName: string,\r\n moduleId: string,\r\n avgRating?: number,\r\n totalRatings?: number,\r\n ariaLabel?: string,\r\n ratingCountAriaLabel?: string\r\n): 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(\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 isPriceMinMaxEnabled?: boolean,\r\n priceResources?: IPriceComponentResources\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 const priceComponent = (\r\n \r\n );\r\n console.log(priceResources);\r\n return priceComponent;\r\n // return (\r\n // LoginToViewPricingComponent(\r\n // context.request,\r\n // priceResources?.loginToViewPricingText || '',\r\n // priceComponent,\r\n // true\r\n // )\r\n // );\r\n}\r\n\r\nfunction renderProductPlacementImage(\r\n imageSettings?: IImageSettings,\r\n gridSettings?: IGridSettings,\r\n imageUrl?: string,\r\n fallbackImageUrl?: string,\r\n altText?: string,\r\n context?: ICoreContext\r\n): 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\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 React from 'react';\r\n\r\ninterface IAddToCartListComponentProps {\r\n productId: number\r\n onAddToCart(id: number, quantity: number): void;\r\n addToCartButtonText: string\r\n}\r\n\r\nexport const AddToCartListComponent: React.FC = ({productId, onAddToCart, addToCartButtonText}) => {\r\n\r\n const [ quantity , setQuantity ] = React.useState(1);\r\n\r\n const handleQuantityChange = (e: React.ChangeEvent) => {\r\n setQuantity(e.target.valueAsNumber);\r\n }\r\n const handleAddToCart = () => onAddToCart(productId, quantity);\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n )\r\n}","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { PriceComponent, RatingComponent } from '@msdyn365-commerce/components';\nimport {\n IComponent,\n IComponentProps,\n ICoreContext,\n IGridSettings,\n IImageData,\n IImageSettings,\n Image,\n IRequestContext\n} from '@msdyn365-commerce/core';\nimport { ProductPrice, ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\nimport { format } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\n/**\n * IActiveProductProps interface.\n */\nexport interface IActiveProductProps extends IComponentProps<{ product?: ProductSearchResult }> {\n className?: string;\n imageSettings?: IImageSettings;\n savingsText?: string;\n freePriceText?: string;\n originalPriceText?: string;\n currentPriceText?: string;\n ratingAriaLabel?: string;\n}\n\n/**\n * IActiveProduct interface.\n */\nexport interface IActiveProduct extends IComponent {}\n\n/**\n * RenderDescription function.\n * @param description - Product description string.\n * @returns - Returns JSX.Element | null.\n */\nfunction renderDescription(description?: string): JSX.Element | null {\n return

{description}

;\n}\n\n/**\n * GetRatingAriaLabel function.\n * @param rating - Product rating number.\n * @param ratingAriaLabel - Product rating aria label.\n * @returns - Returns string.\n */\nfunction getRatingAriaLabel(rating?: number, ratingAriaLabel?: string): string {\n const numberTwo: number = 2;\n if (rating && ratingAriaLabel) {\n const roundedRating = rating.toFixed(numberTwo);\n return format(ratingAriaLabel || '', roundedRating, '5');\n }\n return '';\n}\n\n/**\n * RenderRating function.\n * @param context - The core context.\n * @param typeName - The type name of the module.\n * @param ratingId - The rating id.\n * @param avgRating - The average rating.\n * @param totalRatings - The total ratings.\n * @param ariaLabel - The rating aria label.\n * @returns - Returns JSX.Element | null.\n */\nfunction renderRating(\n context: ICoreContext,\n typeName: string,\n ratingId: string,\n avgRating?: number,\n totalRatings?: number,\n ariaLabel?: string\n): JSX.Element | null {\n if (!avgRating) {\n return null;\n }\n\n const numberRatings = totalRatings?.toString() ?? undefined;\n const ratingAriaLabel = getRatingAriaLabel(avgRating, ariaLabel);\n\n return (\n \n );\n}\n\n/**\n * RenderPrice function.\n * @param context - The core context.\n * @param typeName - The type name of the module.\n * @param productId - The product id.\n * @param basePrice - The base price of the product.\n * @param adjustedPrice - The adjusted price of the product.\n * @param savingsText - The savings text of the product.\n * @param freePriceText - The free price text.\n * @param originalPriceText - The original price text.\n * @returns - Returns JSX.Element | null.\n */\nfunction renderPrice(\n context: ICoreContext,\n typeName: string,\n productId: string,\n basePrice?: number,\n adjustedPrice?: number,\n savingsText?: string,\n freePriceText?: string,\n originalPriceText?: string\n): JSX.Element | null {\n const price: ProductPrice = {\n BasePrice: basePrice,\n AdjustedPrice: adjustedPrice,\n CustomerContextualPrice: adjustedPrice\n };\n\n return (\n \n );\n}\n\n/**\n * RenderProductPlacementImage function.\n * @param requestContext - RequestContext.\n * @param imageSettings - The product image settings.\n * @param gridSettings - The viewport gird settings.\n * @param imageUrl - The product image url.\n * @param altText - The product image alt text.\n * @returns - Returns JSX.Element | null.\n */\nfunction renderProductPlacementImage(\n requestContext: IRequestContext,\n imageSettings?: IImageSettings,\n gridSettings?: IGridSettings,\n imageUrl?: string,\n altText?: string\n): JSX.Element | null {\n if (!imageUrl || !gridSettings || !imageSettings) {\n return null;\n }\n const imgData: IImageData = {\n src: imageUrl,\n altText: altText ? altText : ''\n };\n const imageProps = {\n gridSettings,\n imageSettings\n };\n imageProps.imageSettings.cropFocalRegion = true;\n return ;\n}\n\n/**\n * ActiveProduct constant.\n * @param props - The active product props.\n * @param props.data - The product search result data.\n * @param props.context - The core context.\n * @param props.imageSettings - The prodcut image settings.\n * @param props.savingsText - The product savings text.\n * @param props.freePriceText - The free price text.\n * @param props.originalPriceText - The original price text.\n * @param props.ratingAriaLabel - The product rating aria label.\n * @param props.typeName - The type name of the module.\n * @param props.id - The id of the product.\n * @returns - Returns JSX.Element | null.\n */\nexport const ActiveProductComponent: React.FC = ({\n data,\n context,\n imageSettings,\n savingsText,\n freePriceText,\n originalPriceText,\n ratingAriaLabel,\n typeName,\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Do not need naming convention check for library prameters\n id\n}) => {\n const product = data.product;\n if (!product) {\n return null;\n }\n\n return (\n <>\n
\n
\n {renderProductPlacementImage(\n context.actionContext.requestContext,\n imageSettings,\n context.request.gridSettings,\n product.PrimaryImageUrl,\n product.Name\n )}\n
\n
\n

{product.Name}

\n {renderPrice(context, typeName, id, product.BasePrice, product.Price, savingsText, freePriceText, originalPriceText)}\n {renderDescription(product.Description)}\n {!context.app.config.hideRating &&\n renderRating(context, typeName, id, product.AverageRating, product.TotalRatings, ratingAriaLabel)}\n
\n
\n \n );\n};\n\nexport default ActiveProductComponent;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport { INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\n/**\n * ILinksData: Interface for\n * Additional content.\n */\ninterface ILinksData {\n linkText?: string;\n linkUrl: Msdyn365.ILinkData;\n ariaLabel?: string;\n isOpenInNewTab?: boolean;\n}\n\n/**\n * IAdditionalContentData: Interface for\n * Active content.\n */\ninterface IAdditionalContentData {\n heading?: string;\n subtext?: string;\n links?: ILinksData[];\n}\n\n/**\n * IActiveImageAdditionalContentProps: Interface for\n * Active Image Additional Content Component props.\n */\nexport interface IActiveImageAdditionalContentProps {\n requestContext: Msdyn365.IRequestContext;\n additionalContent: IAdditionalContentData | undefined;\n handleAdditionalTextChange(event: Msdyn365.ContentEditableEvent): void;\n handleAdditionalParagraphChange(event: Msdyn365.ContentEditableEvent): void;\n handleAdditionalLinkTextChange(linkIndex: number, event: Msdyn365.ContentEditableEvent): void;\n}\n\n/**\n * IActiveImageAdditionalContentViewProps: Interface for\n * Active Image Additional Content view props.\n */\nexport interface IActiveImageAdditionalContentViewProps {\n additionalContentNode: INodeProps;\n heading: React.ReactNode;\n text: React.ReactNode;\n links: React.ReactNode;\n additionalContentContainer: INodeProps;\n additionalContentItemLinks: INodeProps;\n}\n\n/**\n * Renders additional content heading.\n * @param additionalContentHeading - Additional content heading.\n * @param props - Active Image Additional content component props.\n * @returns Heading Node.\n */\nconst renderHeading = (additionalContentHeading: string, props: IActiveImageAdditionalContentProps) => {\n const requestContext = props.requestContext;\n return (\n {\n props.handleAdditionalTextChange(event);\n },\n requestContext\n }}\n />\n );\n};\n\n/**\n * Renders additional content heading.\n * @param additionalContentParagraphText - Additional content paragraph text.\n * @param props - Active Image Additional content component props.\n * @returns Paragraph Node.\n */\nconst renderParagraph = (additionalContentParagraphText: string, props: IActiveImageAdditionalContentProps) => {\n const requestContext = props.requestContext;\n return (\n {\n props.handleAdditionalTextChange(event);\n },\n requestContext\n }}\n />\n );\n};\n\n/**\n * Renders additional content heading.\n * @param ctaLink - Additional content link.\n * @param props - Active Image Additional content component props.\n * @param linkIndex - Additional content link index.\n * @returns Link Node.\n */\nconst renderLinks = (ctaLink: ILinksData, props: IActiveImageAdditionalContentProps, linkIndex: number) => {\n const editableLink: Msdyn365.ILinksData = {\n ariaLabel: ctaLink.ariaLabel,\n className: 'msc-active-image__details__additional-content__cta__links',\n linkText: ctaLink.linkText,\n linkUrl: ctaLink.linkUrl.destinationUrl,\n openInNewTab: ctaLink.isOpenInNewTab,\n role: 'button'\n };\n const requestContext = props.requestContext;\n return (\n {\n props.handleAdditionalLinkTextChange(linkIndex, event);\n },\n requestContext\n }}\n />\n );\n};\n\n/**\n * Create node for each additonal content item.\n * @param item - Active Image additonal content item props.\n * @param props - Active Image Additional content component props.\n * @returns IActiveImageAdditionalContentItemViewProps.\n */\nconst assembleNode = (item: IAdditionalContentData, props: IActiveImageAdditionalContentProps): IActiveImageAdditionalContentViewProps => {\n const headingNode = item.heading && renderHeading(item.heading, props);\n const paragraphNode = item.subtext && renderParagraph(item.subtext, props);\n const linksNode = item.links?.map((ctaLink: ILinksData, index: number) => {\n return renderLinks(ctaLink, props, index);\n });\n\n return {\n additionalContentNode: { className: 'msc-active-image__details__additional-content' },\n heading: headingNode,\n text: paragraphNode,\n links: linksNode,\n additionalContentContainer: { className: 'msc-active-image__details__additional-content__container' },\n additionalContentItemLinks: { className: 'msc-active-image__details__additional__content__cta' }\n };\n};\n\n/**\n * ActiveImageAdditionalContent component.\n * @param props - Active Image Additional content component props.\n * @returns Active Image Additional content view props.\n */\nexport const activeImageAdditionalContent = (\n props: IActiveImageAdditionalContentProps\n): IActiveImageAdditionalContentViewProps | undefined => {\n const { additionalContent } = props;\n if (!additionalContent) {\n return undefined;\n }\n\n return assembleNode(additionalContent, props);\n};\n\nexport default activeImageAdditionalContent;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport MsDyn365, { IImageData, Image, IRequestContext } from '@msdyn365-commerce/core';\nimport { ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\nimport React from 'react';\n\n/**\n * @type AreaEvent for active points\n */\ntype AreaEvent = Event | React.MouseEvent | React.FocusEvent;\n\n/**\n * @interface IRgbColor\n * @description - The IRgbColor interface contract.\n */\nexport interface IRgbColor {\n rValue: number;\n gValue: number;\n bValue: number;\n}\n\n/**\n * @interface IArea\n * @description - The IArea interface contract.\n */\nexport interface IArea {\n areaId: string;\n coords: number[];\n href?: string;\n center?: number[];\n primaryImageUrl?: string;\n productUrl: string;\n productSearchResult?: ProductSearchResult;\n}\n\n/**\n * @interface IArea\n * @description - The IArea interface contract.\n */\nexport interface IAreaMap {\n name: string;\n areas: IArea[];\n}\n\n/**\n * @enum CanvasCalculations\n * @description - The canvas calculations enum.\n */\nexport enum CanvasCalculations {\n defaultWidth = 0,\n defaultHeight = 0,\n defaultPositionX = 0,\n defaultPositionY = 0,\n defaultScale = 1,\n halfDivisor = 2,\n doubleMultiplier = 2,\n buttonHeight = 30,\n buttonPadding = 30,\n paddingAdjustment = 3,\n expandAnimationStartWidth = 10,\n expandAnimationEndWidth = 40,\n collapseAnimationStartWidth = 40,\n collapseAnimationEndWidth = 8,\n expandRadius = 12,\n collapseRadius = 8,\n rotation = 1.57,\n startAngle = 0,\n endAngle = 7,\n clearMargin = 50,\n clearHeight = 100,\n clearWidth = 100,\n textFadeInStartValue = 0,\n textFadeOutStartValue = 0.5,\n textFadeInterval = 0.01\n}\n\n/**\n * @enum CanvasStyles\n * @description - The canvas styles enum.\n */\nexport enum CanvasStyles {\n color = '#FFFFFF',\n buttonTextClor = '#000000'\n}\n\n/**\n * @enum\n * @description - The canvas styles enum.\n */\nexport interface IImageMapperResources {\n buttonText?: string;\n altText?: string;\n}\n\n/**\n * @interface IImageMapperProps\n * @description - The IImageMapperProps interface contract.\n */\nexport interface IImageMapperProps {\n imageData: IImageData;\n areaMap: IAreaMap;\n viewPort: string;\n requestContext: IRequestContext;\n color?: string;\n buttonTextClor?: string;\n width?: number;\n imgWidth?: number;\n activeImageRefs: React.RefObject;\n imageMapperResources?: IImageMapperResources;\n onLoad?(): void;\n onClick?(area: IArea, index: number, event: AreaEvent): void;\n onFocus?(area: IArea, index: number, event: AreaEvent): void;\n onMouseEnter?(area: IArea, index: number, event: AreaEvent): void;\n onMouseLeave?(area: IArea, index: number, event: AreaEvent): void;\n}\n\n/**\n * ImageMapper.\n */\nexport class ImageMapper extends React.Component {\n private readonly _backgroundImage: React.RefObject;\n\n private readonly _container: React.RefObject;\n\n private readonly _canvas: React.RefObject;\n\n private _isDesktopViewPort: boolean = false;\n\n private _context: CanvasRenderingContext2D | null | undefined = null;\n\n public constructor(props: IImageMapperProps) {\n super(props);\n this._backgroundImage = React.createRef();\n this._container = React.createRef();\n this._canvas = React.createRef();\n }\n\n /**\n * ComponentDidMount method.\n */\n public componentDidMount(): void {\n const { viewPort } = this.props;\n this.initCanvas();\n this._isDesktopViewPort = viewPort === 'lg' || viewPort === 'xl';\n this.renderAreas();\n this._context = null;\n }\n\n /**\n * ComponentDidUpdate method.\n */\n public componentDidUpdate(): void {\n const { viewPort } = this.props;\n this.initCanvas();\n this._isDesktopViewPort = viewPort === 'lg' || viewPort === 'xl';\n }\n\n /**\n * ShouldComponentUpdate method.\n * @param nextProps - Next props.\n * @returns Returns boolean.\n */\n public shouldComponentUpdate(nextProps: IImageMapperProps): boolean {\n let shouldRender = false;\n if (nextProps !== this.props) {\n shouldRender = true;\n }\n return shouldRender;\n }\n\n /**\n * GetActiveImageWidth method - Gets the active image width.\n * @returns Returns number | undefined.\n */\n public getActiveImageWidth = (): number | undefined => {\n if (MsDyn365.isBrowser) {\n const activeImageReferenceValue = this.props.activeImageRefs;\n if (activeImageReferenceValue.current !== null) {\n return activeImageReferenceValue.current.clientWidth;\n }\n }\n return undefined;\n };\n\n /**\n * GetActiveImageHeight method - Gets the active image height.\n * @returns Returns number | undefined.\n */\n public getActiveImageHeight = (): number | undefined => {\n if (MsDyn365.isBrowser) {\n const activeImageReferenceValue = this.props.activeImageRefs;\n if (activeImageReferenceValue.current !== null) {\n return activeImageReferenceValue.current.clientHeight;\n }\n }\n return undefined;\n };\n\n /**\n * ConvertHexToRgb method - This method takes color in HEX format and returns IRgbColor color object.\n * @param hexColor -The color hex value.\n * @returns -Returns IRgbColor object.\n */\n public convertHexToRgb = (hexColor: string): IRgbColor => {\n // RegEx used to execute the conversion of the hex color to rgb value.\n const regEx = new RegExp('^#?([a-f\\\\d]{2})([a-f\\\\d]{2})([a-f\\\\d]{2})$', 'u');\n\n // RegEx.exec method executes a search for a match in a specified string. Returns a result array, or null.\n const result = regEx.exec(hexColor);\n const defaultValue = 0;\n return result\n ? {\n rValue: Number.parseInt(result[1], 16),\n gValue: Number.parseInt(result[2], 16),\n bValue: Number.parseInt(result[3], 16)\n }\n : {\n rValue: defaultValue,\n gValue: defaultValue,\n bValue: defaultValue\n };\n };\n\n /**\n * ApplyFadingTransition method - Applys fading transition to button text.\n * @param text -The button text.\n * @param coords -The coordinates.\n * @param rgbColor -The RGB color object.\n * @param alpha -The alpha value of the button text.\n */\n public applyFadingTransition = (text: string, coords: number[], rgbColor: IRgbColor, alpha: number): void => {\n const halfDivisor: number = CanvasCalculations.halfDivisor;\n const context = this._canvas.current?.getContext('2d') ?? this._context;\n if (context && this._isDesktopViewPort) {\n const buttonPadding = CanvasCalculations.buttonPadding;\n const paddingAdjustment = CanvasCalculations.paddingAdjustment;\n const buttonWidth = context.measureText(text).width + buttonPadding;\n context.fillStyle = `rgba(${rgbColor.rValue}, ${rgbColor.gValue}, ${rgbColor.bValue}, ${alpha} )`;\n if (MsDyn365.isBrowser && document.body.parentElement && document.body.parentElement.getAttribute('dir') === 'rtl') {\n context.fillText(text, coords[0] + buttonWidth / halfDivisor - buttonPadding / halfDivisor, coords[1] + paddingAdjustment);\n } else {\n context.fillText(text, coords[0] - buttonWidth / halfDivisor + buttonPadding / halfDivisor, coords[1] + paddingAdjustment);\n }\n }\n };\n\n /**\n * Draw button method - Draws button and contains fixed hight, padding values.\n * @param text -The button text.\n * @param coords -The coordinates.\n */\n public drawButton = (text: string, coords: number[]): void => {\n const { color = CanvasStyles.color, buttonTextClor = CanvasStyles.buttonTextClor } = this.props;\n const halfDivisor: number = CanvasCalculations.halfDivisor;\n const context = this._canvas.current?.getContext('2d') ?? this._context;\n if (context && this._isDesktopViewPort) {\n const buttonHeight = CanvasCalculations.buttonHeight;\n const buttonPadding = CanvasCalculations.buttonPadding;\n const paddingAdjustment = CanvasCalculations.paddingAdjustment;\n const buttonWidth = context.measureText(text).width + buttonPadding;\n const buttonPositionX = coords[0] - buttonWidth / halfDivisor;\n const buttonPositionY = coords[1] - buttonHeight / halfDivisor;\n const arcsize = buttonHeight / halfDivisor;\n\n context.beginPath();\n context.moveTo(buttonPositionX + arcsize, buttonPositionY);\n context.lineTo(buttonPositionX + buttonWidth - arcsize, buttonPositionY);\n context.arcTo(\n buttonPositionX + buttonWidth,\n buttonPositionY,\n buttonPositionX + buttonWidth,\n buttonPositionY + arcsize,\n arcsize\n );\n context.lineTo(buttonPositionX + buttonWidth, buttonPositionY + buttonHeight - arcsize);\n context.arcTo(\n buttonPositionX + buttonWidth,\n buttonPositionY + buttonHeight,\n buttonPositionX + buttonWidth - arcsize,\n buttonPositionY + buttonHeight,\n arcsize\n );\n context.lineTo(buttonPositionX + arcsize, buttonPositionY + buttonHeight);\n context.arcTo(buttonPositionX, buttonPositionY + buttonHeight, buttonPositionX, buttonPositionY - arcsize, arcsize);\n context.lineTo(buttonPositionX, buttonPositionY + arcsize);\n context.arcTo(buttonPositionX, buttonPositionY, buttonPositionX + arcsize, buttonPositionY, arcsize);\n context.lineTo(buttonPositionX + arcsize, buttonPositionY);\n context.stroke();\n context.closePath();\n context.fillStyle = color;\n context.fill();\n context.fillStyle = buttonTextClor;\n if (MsDyn365.isBrowser && document.body.parentElement && document.body.parentElement.getAttribute('dir') === 'rtl') {\n context.fillText(text, coords[0] + buttonWidth / halfDivisor - buttonPadding / halfDivisor, coords[1] + paddingAdjustment);\n } else {\n context.fillText(text, coords[0] - buttonWidth / halfDivisor + buttonPadding / halfDivisor, coords[1] + paddingAdjustment);\n }\n }\n };\n\n /**\n * ExpandAnimation method - Shows expand animation and contains fixed values to draw the circle and ellipse shapes.\n * @param coords -Coordinates.\n */\n public expandAnimation = (coords: number[]): void => {\n const { color = CanvasStyles.color, buttonTextClor = CanvasStyles.buttonTextClor } = this.props;\n const buttonText = this.props.imageMapperResources?.buttonText;\n let animationStartWidth = CanvasCalculations.expandAnimationStartWidth;\n const pointPositionX = coords[0];\n const pointPositionY = coords[1];\n const animationEndWidth = CanvasCalculations.expandAnimationEndWidth;\n const radius = CanvasCalculations.expandRadius;\n const rotation = CanvasCalculations.rotation;\n const startAngle = CanvasCalculations.startAngle;\n const endAngle = CanvasCalculations.endAngle;\n let textFadeInValue = CanvasCalculations.textFadeInStartValue;\n const buttonTextClorInRgb = this.convertHexToRgb(buttonTextClor.toLocaleLowerCase());\n\n /**\n * Animate method - Reders expand animation.\n */\n const animate = () => {\n const context = this._canvas.current?.getContext('2d') ?? this._context;\n if (!context) {\n return;\n }\n context.beginPath();\n context.ellipse(pointPositionX, pointPositionY, radius, animationStartWidth, rotation, startAngle, endAngle);\n context.fillStyle = color;\n context.fill();\n context.fillStyle = color;\n if (buttonText) {\n if (animationStartWidth < animationEndWidth) {\n requestAnimationFrame(animate);\n this.applyFadingTransition(buttonText, coords, buttonTextClorInRgb, textFadeInValue);\n textFadeInValue += CanvasCalculations.textFadeInterval;\n animationStartWidth++;\n } else {\n this.drawButton(buttonText, [pointPositionX, pointPositionY]);\n }\n }\n };\n\n if (this._isDesktopViewPort) {\n animate();\n }\n };\n\n /**\n * CollapseAnimation method - Shows collapse animation and contains fixed values to draw the circle and ellipse shapes.\n * @param coords -Coordinates.\n */\n public collapseAnimation = (coords: number[]): void => {\n const { color = CanvasStyles.color, buttonTextClor = CanvasStyles.buttonTextClor } = this.props;\n const buttonText = this.props.imageMapperResources?.buttonText;\n let animationStartWidth = CanvasCalculations.collapseAnimationStartWidth;\n const pointPositionX = coords[0];\n const pointPositionY = coords[1];\n const animationEndWidth = CanvasCalculations.collapseAnimationEndWidth;\n const rotation = CanvasCalculations.rotation;\n const clearMargin = CanvasCalculations.clearMargin;\n const clearHeight = CanvasCalculations.clearHeight;\n const clearWidth = CanvasCalculations.clearWidth;\n const radius = CanvasCalculations.collapseRadius;\n const startAngle = CanvasCalculations.startAngle;\n const endAngle = CanvasCalculations.endAngle;\n let textFadeOutValue = CanvasCalculations.textFadeOutStartValue;\n const buttonTextClorInRgb = this.convertHexToRgb(buttonTextClor.toLocaleLowerCase());\n\n /**\n * Animate method - Renders collapse animation.\n */\n const animate = () => {\n const context = this._canvas.current?.getContext('2d') ?? this._context;\n if (!context) {\n return;\n }\n context.beginPath();\n context.clearRect(pointPositionX - clearMargin, pointPositionY - clearMargin, clearWidth, clearHeight);\n context.ellipse(pointPositionX, pointPositionY, radius, animationStartWidth, rotation, startAngle, endAngle);\n context.fillStyle = color;\n context.fill();\n if (animationEndWidth < animationStartWidth && buttonText) {\n requestAnimationFrame(animate);\n this.applyFadingTransition(buttonText, coords, buttonTextClorInRgb, textFadeOutValue);\n textFadeOutValue -= CanvasCalculations.textFadeInterval;\n animationStartWidth--;\n }\n };\n\n if (this._isDesktopViewPort) {\n animate();\n }\n };\n\n /**\n * DrawCircle method - Renders active points.\n * @param coords -Coordinates.\n */\n public drawCircle = (coords: number[]): void => {\n const { color = CanvasStyles.color, viewPort } = this.props;\n const doubleMultiplier: number = CanvasCalculations.doubleMultiplier;\n const startAngle: number = CanvasCalculations.startAngle;\n const context = this._canvas.current?.getContext('2d') ?? this._context;\n const radius = viewPort === 'xs' || viewPort === 'sm' ? coords[2] * doubleMultiplier : coords[2];\n if (!context) {\n return;\n }\n context.fillStyle = color;\n context.beginPath();\n context.strokeStyle = color;\n context.arc(coords[0], coords[1], radius, startAngle, Math.PI * doubleMultiplier);\n context.closePath();\n context.stroke();\n context.fill();\n };\n\n /**\n * ScaleCoords method - To scale the active point coordinates based on the window size.\n * @param coords -Coordinates.\n * @returns -Returns number[].\n */\n public scaleCoords = (coords: number[]): number[] => {\n const { imgWidth } = this.props;\n const defaultWidth: number = CanvasCalculations.defaultWidth;\n const defaultScale: number = CanvasCalculations.defaultScale;\n\n // Calculate scale based on current 'width' and the original 'imgWidth'\n const width = this.getActiveImageWidth();\n const scale = width && imgWidth && imgWidth > defaultWidth ? width / imgWidth : defaultScale;\n return coords.map(coord => coord * scale);\n };\n\n /**\n * RenderPrefilledAreas method - To render active points in case of events.\n */\n public renderPrefilledAreas = (): void => {\n const { areaMap } = this.props;\n areaMap.areas.map(area => {\n this.drawCircle(this.scaleCoords(area.coords));\n return null;\n });\n };\n\n /**\n * ComputeCenter method - To re-calculate the center of active point based on window size.\n * @param area -IArea.\n * @returns -Returns number[].\n */\n public computeCenter = (area: IArea): number[] => {\n const scaledCoords = this.scaleCoords(area.coords);\n return [scaledCoords[0], scaledCoords[1]];\n };\n\n /**\n * HandleHoverOn method - To handle mouse hover on event.\n * @param area -IArea.\n */\n public handleHoverOn = (area: IArea): void => {\n if (area.center && this._canvas.current) {\n this.drawCircle(this.scaleCoords(area.coords));\n this.expandAnimation(area.center);\n }\n };\n\n /**\n * HandleHoverOff method - To handle mouse hover off event.\n * @param area -IArea.\n */\n public handleHoverOff = (area: IArea): void => {\n if (this._canvas.current) {\n const context = this._canvas.current.getContext('2d') ?? this._context;\n const canvasPositionX: number = CanvasCalculations.defaultPositionX;\n const canvasPositionY: number = CanvasCalculations.defaultPositionY;\n\n if (!context) {\n return;\n }\n context.clearRect(canvasPositionX, canvasPositionY, this._canvas.current.width, this._canvas.current.height);\n this.renderPrefilledAreas();\n if (area.center) {\n this.collapseAnimation(area.center);\n }\n }\n };\n\n /**\n * Click method - Mouse click event.\n * @param area -IArea.\n * @param index - Number.\n * @returns - Void.\n */\n public click = (area: IArea, index: number) => (event: AreaEvent): void => {\n const { onClick } = this.props;\n if (onClick) {\n event.preventDefault();\n onClick(area, index, event);\n }\n };\n\n /**\n * HoverOn method - Mouse hover on event.\n * @param area -IArea.\n * @param index - Number.\n * @returns - Void.\n */\n public hoverOn = (area: IArea, index: number) => (event: AreaEvent): void => {\n const { onMouseEnter } = this.props;\n this.handleHoverOn(area);\n if (onMouseEnter) {\n onMouseEnter(area, index, event);\n }\n };\n\n /**\n * HoverOff method - Mouse hover off event.\n * @param area - IArea.\n * @param index - Number.\n * @returns - Void.\n */\n public hoverOff = (area: IArea, index: number) => (event: AreaEvent): void => {\n const { onMouseLeave } = this.props;\n\n this.handleHoverOff(area);\n\n if (onMouseLeave) {\n onMouseLeave(area, index, event);\n }\n };\n\n /**\n * RenderAreas method - Renders active points at given coordinates.\n * @returns -Returns JSX.Element[].\n */\n public renderAreas = (): JSX.Element[] => {\n const { areaMap, viewPort } = this.props;\n const buttonText = this.props.imageMapperResources?.buttonText ? this.props.imageMapperResources.buttonText : '';\n const altText = this.props.imageMapperResources?.altText ? this.props.imageMapperResources.altText : '';\n const doubleMultiplier: number = CanvasCalculations.doubleMultiplier;\n\n return areaMap.areas.map((area, index) => {\n const scaledCoords = this.scaleCoords(area.coords);\n const xsRadius = area.coords[2] * doubleMultiplier;\n if (viewPort === 'xs') {\n scaledCoords[2] = xsRadius;\n }\n const center = this.computeCenter(area);\n const extendedArea = { ...area, scaledCoords, center };\n const areaKey = `area-${index}`;\n const altTextWithProductName = altText\n .replace('{buttonText}', buttonText ? buttonText : '')\n .replace('{productName}', area.productSearchResult?.Name ? area.productSearchResult.Name : '');\n return (\n \n );\n });\n };\n\n /**\n * InitCanvas method - To render the canvas.\n */\n public initCanvas = (): void => {\n if (!this._canvas.current || !this._backgroundImage.current || !this._container.current) {\n return;\n }\n\n const { color, onLoad } = this.props;\n const defaultWidth: number = CanvasCalculations.defaultWidth;\n const defaultHeight: number = CanvasCalculations.defaultHeight;\n\n const canvasWidth = this.getActiveImageWidth() ?? defaultWidth;\n const canvasHeight = this.getActiveImageHeight() ?? defaultHeight;\n\n this._canvas.current.width = canvasWidth;\n this._canvas.current.height = canvasHeight;\n this._container.current.style.width = `${canvasWidth}px`;\n\n const context = this._canvas.current.getContext('2d') ?? this._context;\n if (!context) {\n return;\n }\n context.fillStyle = color ?? '';\n\n if (onLoad) {\n onLoad();\n }\n\n this.renderPrefilledAreas();\n };\n\n /**\n * Render method - To render the image mapper component with active image, canvas and active points.\n * @returns -Returns JSX.Element | null.\n */\n public render(): JSX.Element | null {\n const { imageData, areaMap, requestContext } = this.props;\n\n return (\n
\n \n \n \n {this.renderAreas()}\n \n
\n );\n }\n}\n\nexport default ImageMapper;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as MsDyn365 from '@msdyn365-commerce/core';\nimport { ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\nimport { ArrayExtensions, getProductPageUrlSync } from '@msdyn365-commerce-modules/retail-actions';\nimport {\n getPayloadObject,\n getTelemetryAttributes,\n getTelemetryObject,\n IModuleProps,\n INodeProps,\n isMobile,\n ITelemetryContent,\n VariantType\n} from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport {\n activeImageAdditionalContent,\n ActiveProductComponent,\n IActiveImageAdditionalContentViewProps,\n IArea,\n IAreaMap,\n IImageMapperProps,\n ImageMapper\n} from '../active-image-utilities';\nimport { IActiveImageData } from './active-image.data';\nimport { IActiveImageProps } from './active-image.props.autogenerated';\n\n/**\n * @type AreaEvent for active points\n */\ntype AreaEvent = Event | React.MouseEvent | React.FocusEvent;\n\n/**\n * @interface IActiveImageViewProps\n * @classdesc - The IActiveImageViewProps interface contract.\n */\nexport interface IActiveImageViewProps extends IActiveImageProps<{}>, IImageMapperProps {\n activePointContainer: IModuleProps;\n activePointDetailsContainer: INodeProps;\n imageMapper: React.ReactNode;\n overlay: React.ReactNode;\n productCard: React.ReactNode;\n title?: React.ReactNode;\n text?: React.ReactNode;\n links?: React.ReactNode;\n detailsContainer?: INodeProps;\n detailsContainerCta?: INodeProps;\n additionalContent?: IActiveImageAdditionalContentViewProps;\n productCardleftPosition: number;\n productCardtopPosition: number;\n handleAdditionalText?(event: MsDyn365.ContentEditableEvent): void;\n handleAdditionalParagraph?(event: MsDyn365.ContentEditableEvent): void;\n handleAdditionalLinkText?(event: MsDyn365.ContentEditableEvent): void;\n}\n\n/**\n * @interface IActiveImageLinksData\n * @classdesc - The IActiveImageLinksData interface contract.\n */\nexport interface IActiveImageLinksData {\n linkText?: string;\n linkUrl: MsDyn365.ILinkData;\n ariaLabel?: string;\n willOpenInNewTab?: boolean;\n}\n\n/**\n * @interface IActiveImageState\n * @classdesc - The IActiveImageState interface contract.\n */\ninterface IActiveImageState {\n clientWidth: number;\n area: IArea | null;\n viewport: string;\n overlayClass: string;\n}\n\n/**\n * @enum ActiveImageConstants\n * @description - The active image constants enum.\n */\nexport enum ActiveImageConstants {\n timeoutInterval = 200,\n enterKey = 'Enter',\n escKey = 'Escape'\n}\n\n/**\n *\n * ActiveImage class.\n * @extends {React.PureComponent & IImageMapperProps, IActiveImageState>}\n */\nexport class ActiveImage extends React.PureComponent & IImageMapperProps, IActiveImageState> {\n private readonly _telemetryContent: ITelemetryContent;\n\n private _isDesktopViewPort: boolean;\n\n private readonly _defaultProductCardWidth: number = 315;\n\n private readonly _defaultProdutCardHight: number = 490;\n\n private readonly _activePoints: IArea[] = [];\n\n private readonly _activeImageRefs: React.RefObject;\n\n private readonly _activeImageClass: string;\n\n private readonly _productCardDivRef: React.RefObject;\n\n public constructor(props: IActiveImageProps & IImageMapperProps) {\n super(props);\n this._telemetryContent = getTelemetryObject(\n this.props.context.request.telemetryPageName!,\n this.props.friendlyName,\n this.props.telemetry\n );\n const viewport = isMobile({ variant: VariantType.Browser, context: this.props.context.request });\n this._activeImageClass = `msc-active-image-${this.getActiveImageId()}`;\n this.state = {\n clientWidth: 0,\n area: null,\n viewport,\n overlayClass: ''\n };\n this._isDesktopViewPort = viewport === 'lg' || viewport === 'xl';\n this._activeImageRefs = React.createRef();\n this._productCardDivRef = React.createRef();\n }\n\n public componentDidMount(): void {\n if (MsDyn365.msdyn365Commerce.isBrowser) {\n window.addEventListener('resize', this.updateClientWidth);\n document.addEventListener('keydown', this.keyDown, false);\n document.addEventListener('mousedown', this._handleOutsideClick);\n }\n setTimeout(() => {\n this.updateClientWidth();\n }, ActiveImageConstants.timeoutInterval);\n\n if (MsDyn365.msdyn365Commerce.isBrowser && this._activeImageRefs.current) {\n const images: HTMLCollectionOf = this._activeImageRefs.current.getElementsByClassName(\n 'msc-thumbnail_image msc-active-image-img'\n );\n if (ArrayExtensions.hasElements(Array.from(images))) {\n images[0].removeAttribute('usemap');\n }\n }\n }\n\n /**\n * AddActivePoints method - To handle add Active Points.\n * @param area - IArea.\n * @param product - ProductSearchResult.\n * @param coords - Coords.\n * @param productUrl - String.\n */\n public addActivePoints = (area: IArea | undefined, product: ProductSearchResult, coords: number[], productUrl: string): void => {\n if (!area) {\n this._activePoints.push({\n areaId: product.RecordId.toString(),\n coords,\n primaryImageUrl: product.PrimaryImageUrl ?? '',\n productUrl,\n productSearchResult: product\n });\n }\n };\n\n /**\n * ComponentWillUnmount method.\n */\n public componentWillUnmount(): void {\n if (MsDyn365.msdyn365Commerce.isBrowser) {\n window.removeEventListener('resize', this.updateClientWidth);\n document.removeEventListener('keydown', (this.keyDown as unknown) as EventListener, false);\n document.removeEventListener('mousedown', this._handleOutsideClick, false);\n }\n }\n\n /**\n * UpdateClientWidth method to update client width in state.\n */\n public updateClientWidth = (): void => {\n const viewport = isMobile({ variant: VariantType.Browser, context: this.props.context.request });\n this.setState({ clientWidth: this.getActiveImageWidth(), viewport });\n this._isDesktopViewPort = viewport === 'lg' || viewport === 'xl';\n };\n\n /**\n * Render method.\n * @returns - Returns JSX.Element | null.\n */\n public render(): JSX.Element | null {\n const viewProps: IActiveImageViewProps = {\n ...(this.props as IImageMapperProps & IActiveImageProps<{}>),\n activePointContainer: {\n moduleProps: this.props,\n className: classnames('msc-active-image', this._activeImageClass, this.props.config.className)\n },\n activePointDetailsContainer: {\n tag: 'div',\n className: classnames('msc-active-image-wrapper', this._activeImageClass, this.props.config.className),\n ref: this._activeImageRefs\n },\n imgWidth: this.props.config.canvasWidth,\n imageMapper: this.renderImageMapper(),\n overlay: this.renderOverlay(),\n productCard: this.renderProductCard(),\n productCardleftPosition: this.getProductCardPositionX(),\n productCardtopPosition: this.getProductCardPositionY(),\n title: this.renderActiveImageDetailsHeading(),\n text: this.renderActiveImageDetailsParagraph(),\n links: this.renderActiveImageDetailsLinks(),\n detailsContainer: { className: 'msc-active-image__details' },\n detailsContainerCta: { className: 'msc-active-image__details__cta' },\n additionalContent: activeImageAdditionalContent({\n requestContext: this.props.context.request,\n additionalContent: this.props.config.additionalContent,\n handleAdditionalTextChange: this.handleAdditionalTextChange,\n handleAdditionalParagraphChange: this.handleAdditionalParagraphChange,\n handleAdditionalLinkTextChange: this.handleAdditionalLinkTextChange\n }),\n handleAdditionalText: this.handleAdditionalTextChange,\n handleAdditionalParagraph: this.handleAdditionalParagraphChange,\n handleAdditionalLinkText: this.handleAdditionalTextChange\n };\n\n return this.props.renderView(viewProps);\n }\n\n /**\n * RenderImageMapper method - To render image mapper.\n * @returns - Returns React.ReactNode | null.\n */\n public renderImageMapper = (): React.ReactNode | null => {\n const { config, context } = this.props;\n const defaultPosition: number = 0;\n const defaultLength: number = 0;\n const productResults = this.props.data.products.result;\n if (config.activePoints && productResults) {\n for (const product of productResults) {\n for (const configProduct of config.activePoints) {\n if (product.ItemId === configProduct.itemId) {\n const productUrl = getProductPageUrlSync(product.Name ?? '', product.RecordId, context.actionContext, undefined);\n const coords = [\n configProduct.xPosition ?? defaultPosition,\n configProduct.yPosition ?? defaultPosition,\n configProduct.radius ?? defaultPosition\n ];\n const area = this._activePoints.find(activePoint => JSON.stringify(activePoint.coords) === JSON.stringify(coords));\n this.addActivePoints(area, product, coords, productUrl);\n }\n }\n }\n }\n const mappedArea: IAreaMap = {\n name: `map-${this._activeImageClass}`,\n areas: this._activePoints.length > defaultLength ? this._activePoints : []\n };\n\n // If image is null, we want to render the placeholder SVG - by passing image data with empty src\n return (\n \n );\n };\n\n /**\n * EnterArea method - To handle mouse enter event.\n * @param area - Active point area.\n * @param index - Active point index.\n * @param event - Active point AreaEvent.\n */\n public enterArea = (area: IArea, index: number, event: AreaEvent): void => {\n this.setState({ area, overlayClass: 'msc-active-image-overlay' });\n if (this.props.onMouseEnter) {\n this.props.onMouseEnter(area, index, event);\n }\n if (event.type.toLocaleLowerCase() === 'click' && this._isDesktopViewPort) {\n window.open(area.productUrl, '_self');\n }\n };\n\n /**\n * LeaveArea method - To handle mouse leave event.\n */\n public leaveArea = (): void => {\n if (this._isDesktopViewPort) {\n this.resetState();\n }\n };\n\n /**\n * ResetState method - To reset the state for area and overlayclass.\n */\n public resetState = (): void => {\n this.setState({ area: null, overlayClass: '' });\n };\n\n /**\n * RenderProductComponent method - To render the product card with product information.\n * @returns - Returns React.ReactNode.\n */\n public renderProductComponent = (): React.ReactNode => {\n if (this.state.area?.productSearchResult) {\n const baseImageUrl: string = this.props.context.request.apiSettings.baseImageUrl;\n const imageUrl: string = this.state.area.primaryImageUrl ?? '';\n const primaryImageUrl: string = `${baseImageUrl}${imageUrl}`;\n const product: ProductSearchResult = this.state.area.productSearchResult;\n product.PrimaryImageUrl = primaryImageUrl;\n\n return (\n \n );\n }\n return React.Fragment;\n };\n\n /**\n * RenderProductCard method - To render product cards.\n * @returns - Returns React.ReactNode.\n */\n public renderProductCard = (): React.ReactNode => {\n const { area } = this.state;\n\n return (\n <>\n {area?.center && (\n
\n
\n {!this._isDesktopViewPort &&
\n
\n )}\n \n );\n };\n\n /**\n * RenderOverlay method - To render overlay for non desktop viewports.\n * @returns - Returns React.ReactNode.\n */\n public renderOverlay = (): React.ReactNode => {\n return <>{!this._isDesktopViewPort &&
};\n };\n\n /**\n * GetProductCardPositionX method - Provides product card x position to the left or right of active point based on available space.\n * For xs, sm and md viewports it provides x position for the center alignment.\n * @returns - Returns number.\n */\n public getProductCardPositionX = (): number => {\n const defaultImageSettings = this.getDefaultImageSettings();\n const productImageSettingsWidth = this.props.config.productImageSettings?.viewports\n ? this.props.config.productImageSettings.viewports.lg?.w\n : defaultImageSettings.viewports.lg?.w;\n const defaultPositionX: number = 0;\n const halfDivisor: number = 2;\n const productCardWidth: number = productImageSettingsWidth ? productImageSettingsWidth : this._defaultProductCardWidth;\n const { area, clientWidth, viewport } = this.state;\n const pointPositionX = area?.center?.[0] ?? clientWidth / halfDivisor;\n const leftAllignPosition = pointPositionX - productCardWidth - productCardWidth / halfDivisor;\n const rightAllignPosition = pointPositionX + productCardWidth / halfDivisor;\n let position: number = (clientWidth - productCardWidth) / halfDivisor;\n if (viewport !== 'xs' && viewport !== 'sm' && viewport !== 'md') {\n if (leftAllignPosition < defaultPositionX) {\n position = rightAllignPosition;\n } else {\n position = leftAllignPosition;\n }\n }\n return position;\n };\n\n /**\n * GetProductCardPositionY method - Provides product card y position in center with respect to active point.\n * For xs, sm and md viewports it provides y position for the center alignment.\n * @returns - Returns number.\n */\n public getProductCardPositionY = (): number => {\n const defaultImageSettings = this.getDefaultImageSettings();\n const productImageSettingsHeight = this.props.config.productImageSettings?.viewports\n ? this.props.config.productImageSettings.viewports.lg?.h\n : defaultImageSettings.viewports.lg?.h;\n const halfDivisor: number = 2;\n const { area, viewport } = this.state;\n const produtCardHight: number = productImageSettingsHeight ? productImageSettingsHeight : this._defaultProdutCardHight;\n const pointPositionY = (this.getActiveImageHeight() - produtCardHight) / halfDivisor;\n let position: number = pointPositionY;\n if (viewport !== 'xs' && viewport !== 'sm' && viewport !== 'md') {\n position = (area?.center?.[1] ?? this.getActiveImageHeight() / halfDivisor) - produtCardHight / halfDivisor;\n }\n return position;\n };\n\n /**\n * GetDefaultImageSettings method.\n * @returns MsDyn365.IImageSettings.\n */\n public getDefaultImageSettings = (): MsDyn365.IImageSettings => {\n const defaultImageSettings: MsDyn365.IImageSettings = {\n viewports: {\n xs: { q: 'w=275&h=275&m=6', w: 275, h: 275 },\n lg: { q: 'w=275&h=275&m=6', w: 275, h: 275 },\n xl: { q: 'w=275&h=275&m=6', w: 275, h: 275 }\n },\n lazyload: true\n };\n\n return defaultImageSettings;\n };\n\n /**\n * KeyDown method - To handle keydown event.\n * @param event - KeyboardEvent.\n */\n public keyDown = (event: KeyboardEvent): void => {\n if (event.key === ActiveImageConstants.enterKey) {\n const target: HTMLElement = event.target as HTMLElement;\n if (target.nodeName === 'AREA') {\n const area: HTMLAreaElement = target as HTMLAreaElement;\n if (area.href) {\n window.open(area.href, '_self');\n }\n }\n }\n if (event.key === ActiveImageConstants.escKey) {\n this.resetState();\n }\n };\n\n /**\n * GetActiveImageWidth method - To get active image width.\n * @returns Returns number.\n */\n public getActiveImageWidth = (): number => {\n const defaultWidth: number = 0;\n if (MsDyn365.msdyn365Commerce.isBrowser) {\n const activeImageReferenceValue = this._activeImageRefs;\n if (activeImageReferenceValue.current !== null) {\n return activeImageReferenceValue.current.clientWidth;\n }\n }\n return defaultWidth;\n };\n\n /**\n * GetActiveImageHeight method - To get active image height.\n * @returns Returns number.\n */\n public getActiveImageHeight = (): number => {\n const defaultHeight: number = 0;\n if (MsDyn365.msdyn365Commerce.isBrowser) {\n const activeImageReferenceValue = this._activeImageRefs;\n if (activeImageReferenceValue.current !== null) {\n return activeImageReferenceValue.current.clientHeight;\n }\n }\n return defaultHeight;\n };\n\n /**\n * HandleLinkTextChange method - To handle link text change event.\n * @param linkIndex - The link index.\n * @param event - The dialog that is allowed to remain open.\n */\n public handleLinkTextChange(linkIndex: number, event: MsDyn365.ContentEditableEvent): void {\n if (this.props.config.links && this.props.config.links[Number(linkIndex)]) {\n this.props.config.links[Number(linkIndex)].linkText = event.target.value;\n }\n }\n\n /**\n * HandleTextChange method - To handle text change event.\n * @param event - The dialog that is allowed to remain open.\n */\n public handleTextChange = (event: MsDyn365.ContentEditableEvent): void => {\n this.props.config.heading!.text = event.target.value;\n };\n\n /**\n * HandleParagraphChange method - To handle paragraph change event.\n * @param event - The dialog that is allowed to remain open.\n */\n public handleParagraphChange = (event: MsDyn365.ContentEditableEvent): void => {\n this.props.config.paragraph = event.target.value;\n };\n\n /**\n * HandleAdditionalTextChange method - To handle additional text change event.\n * @param event - The dialog that is allowed to remain open.\n */\n public handleAdditionalTextChange(event: MsDyn365.ContentEditableEvent): void {\n if (this.props.config.additionalContent) {\n this.props.config.additionalContent.heading = event.target.value;\n }\n }\n\n /**\n * HandleAdditionalLinkTextChange method - To handle additional link text change event.\n * @param linkIndex - The link index.\n * @param event - The dialog that is allowed to remain open.\n */\n public handleAdditionalLinkTextChange(linkIndex: number, event: MsDyn365.ContentEditableEvent): void {\n const additionalContent = this.props.config.additionalContent ?? {};\n if (additionalContent.links) {\n additionalContent.links[Number(linkIndex)].linkText = event.target.value;\n }\n }\n\n /**\n * HandleAdditionalParagraphChange method - To handle additional paragraph change event.\n * @param event - The dialog that is allowed to remain open.\n */\n public handleAdditionalParagraphChange(event: MsDyn365.ContentEditableEvent): void {\n if (this.props.config.additionalContent) {\n this.props.config.additionalContent.subtext = event.target.value;\n }\n }\n\n /**\n * RenderActiveImageDetailsLinks method - To render active image details links.\n * @returns - React node.\n */\n public renderActiveImageDetailsLinks = (): React.ReactNode[] | undefined => {\n const { links } = this.props.config;\n const payLoad = getPayloadObject('click', this._telemetryContent, '');\n\n return links?.map((linkData: IActiveImageLinksData, index: number) => {\n payLoad.contentAction.etext = linkData.linkText;\n const attributes = getTelemetryAttributes(this._telemetryContent, payLoad);\n const linkId = index;\n const editableLink: MsDyn365.ILinksData = {\n ariaLabel: linkData.ariaLabel,\n className: 'msc-active-image__details__cta__link',\n linkText: linkData.linkText,\n linkUrl: linkData.linkUrl.destinationUrl,\n openInNewTab: linkData.willOpenInNewTab,\n role: 'button',\n additionalProperties: attributes\n };\n\n return (\n {\n this.handleLinkTextChange(index, event);\n },\n requestContext: this.props.context.request\n }}\n />\n );\n });\n };\n\n /**\n * RenderActiveImageDetailsHeading method - To render active image details heading.\n * @returns - React.ReactNode | undefined.\n */\n public renderActiveImageDetailsHeading = (): React.ReactNode | undefined => {\n const { heading } = this.props.config;\n\n return (\n heading && (\n \n )\n );\n };\n\n /**\n * RenderActiveImageDetailsParagraph method - To render active image details paragraph.\n * @returns - React.ReactNode | undefined.\n */\n public renderActiveImageDetailsParagraph = (): React.ReactNode | undefined => {\n const { paragraph } = this.props.config;\n\n return (\n paragraph && (\n \n )\n );\n };\n\n /**\n * GetActiveImageId - To get active image id from src.\n * @returns - String.\n */\n public getActiveImageId = (): string => {\n const { activeImage } = this.props.config;\n let activeImageId: string = '';\n if (activeImage?.src) {\n const activeImageSource = activeImage.src.split('/');\n const decrementOne: number = 1;\n const activeImageIdPart = activeImageSource[activeImageSource.length - decrementOne].split('?');\n activeImageId = activeImageIdPart[0] ?? '';\n }\n return activeImageId;\n };\n\n /**\n * Handle outside click method - To handle outside click of the active image product.\n * @param event - Mouse event.\n */\n private readonly _handleOutsideClick = (event: MouseEvent) => {\n if (this._productCardDivRef.current?.contains(event.target as Node)) {\n return;\n }\n this.resetState();\n };\n}\nexport default ActiveImage;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n IAction,\n IActionContext,\n IActionInput,\n IAny,\n ICommerceApiSettings,\n ICreateActionContext,\n IGeneric\n} from '@msdyn365-commerce/core';\nimport { getCartState } from '@msdyn365-commerce/global-state';\nimport { ProductDeliveryOptions, ProductsDataActions } from '@msdyn365-commerce/retail-proxy';\nimport {\n ArrayExtensions,\n ActiveCartProductsInput,\n QueryResultSettingsProxy,\n buildCacheKey,\n getActiveCartProductsAction\n} from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * Input class for pickup delivery options for items in cart.\n */\nexport class ProductPickUpOptionsForCartLineItems implements IActionInput {\n public readonly apiSettings: ICommerceApiSettings;\n\n public constructor(apiSettings: ICommerceApiSettings) {\n this.apiSettings = apiSettings;\n }\n\n /**\n * Get Cache Key.\n * @returns - Cache key string.\n */\n public getCacheKey = (): string => buildCacheKey('ActiveCartLineItemsPickUpOptions', this.apiSettings);\n\n /**\n * Get Cachetype Name.\n * @returns - Cache name string.\n */\n public getCacheObjectType = (): string => 'ActiveCartLineItemsPickUpOptions';\n\n /**\n * Get Cachetype.\n * @returns - CacheType enum.\n */\n public dataCacheType = (): CacheType => 'none';\n}\n\n/**\n * CreateInput method for the GetPickUpOptionCartLineItems method.\n * @param inputData - The input data passed to the createInput method.\n * @returns - Input for data action.\n */\nconst createInput = (inputData: ICreateActionContext>) => {\n return new ProductPickUpOptionsForCartLineItems(inputData.requestContext.apiSettings);\n};\n\n/**\n * The action method for the GetPickUpOptionCartLineItems data action.\n * @param input - The action input.\n * @param context - The action context.\n * @returns - Order Template object.\n */\nexport async function getPickUpOptionsForCartLineItems(\n input: ProductPickUpOptionsForCartLineItems,\n context: IActionContext\n): Promise {\n // If no input is provided fail out\n if (!input.apiSettings.channelId) {\n throw new Error('[getPickUpOptionsForCartLineItems]No valid Input was provided, failing');\n }\n const cartState = await getCartState(context);\n const cart = cartState.cart;\n const products = await getActiveCartProductsAction(new ActiveCartProductsInput(), context);\n const filterOption = 4;\n const response: ProductDeliveryOptions[] = [];\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- existing code.\n if (cart === undefined || !ArrayExtensions.hasElements(products)) {\n return Promise.resolve(response);\n }\n\n const pickupoptions = await ProductsDataActions.getDeliveryOptionsAsync(\n {\n callerContext: context,\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(context)\n },\n products.map(product => product.RecordId),\n {},\n filterOption\n );\n\n return pickupoptions;\n}\n\n/**\n * The GetPickupOptionCartLineItems Data Action\n * Returns pickup options.\n */\nexport const getPickUpOptionsForCartLineItemsDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/retail-actions/get-pickup-options-for-cartlines',\n action: getPickUpOptionsForCartLineItems as IAction,\n input: createInput\n});\n\nexport default getPickUpOptionsForCartLineItemsDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ICartState } from '@msdyn365-commerce/global-state';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport {\n CartLine,\n ChannelDeliveryOptionConfiguration,\n DeliveryOption,\n OrgUnitLocation,\n ProductDeliveryOptions,\n SimpleProduct\n} from '@msdyn365-commerce/retail-proxy';\nimport { IStoreSelectorStateManager } from '@msdyn365-commerce-modules/bopis-utilities';\nimport { INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nexport interface IPickUpInStoreViewProps {\n callbacks: {\n toggleBopis(isBopisSelected: boolean): void;\n };\n defaultComponent?: React.ReactNode;\n orgUnitName?: string;\n isBopisSelected: boolean;\n ContainerProps: INodeProps;\n deliveryOption?: string;\n}\n\nexport interface IPickUpInStoreProps {\n cartline: CartLine;\n product: SimpleProduct;\n shipitText: string;\n pickUpInStoreText: string;\n changeStoreText: string;\n cartState: ICartState | undefined;\n storeSelectorStateManager: IStoreSelectorStateManager | undefined;\n orgUnitLocations?: OrgUnitLocation[] | undefined;\n deliveryOptions?: ProductDeliveryOptions;\n pickupDeliveryModeCode?: string;\n storeSelectorModuleId?: string;\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\n retailMulitplePickupFeatureState?: boolean;\n locationChangedHandler(): void;\n}\n\nexport const PickUpInStore = (props: IPickUpInStoreProps): IPickUpInStoreViewProps | undefined => {\n const _onLocationChangedCallback = async (\n orgUnitLocation: OrgUnitLocation,\n cartState: ICartState | undefined,\n cartline: CartLine,\n deliveryMode?: string\n ) => {\n if (!cartState) {\n return Promise.resolve();\n }\n return cartState\n .updateCartLinePickupLocation({ cartLineId: cartline.LineId!, location: orgUnitLocation, deliveryMode })\n .then(result => {\n if (result.status === 'SUCCESS') {\n props.locationChangedHandler();\n }\n })\n .catch(error => {});\n };\n\n const _toggleBOPIS = (isBopisSelected: boolean) => {\n const { storeSelectorStateManager, product, cartline, cartState, storeSelectorModuleId } = props;\n\n if (isBopisSelected) {\n if (!storeSelectorStateManager) {\n return;\n }\n storeSelectorStateManager\n .openDialog({\n id: storeSelectorModuleId,\n product,\n alreadySelectedLocation: {\n OrgUnitNumber: cartline.FulfillmentStoreId\n },\n deliveryOptions: props.deliveryOptions,\n onLocationSelected: async (orgUnitLocation, deliveryMode: string | undefined) => {\n return _onLocationChangedCallback(orgUnitLocation, cartState, cartline, deliveryMode);\n }\n })\n .catch(error => {});\n } else {\n if (!cartState) {\n return;\n }\n cartline.DeliveryMode = '';\n cartline.FulfillmentStoreId = '';\n cartline.ShippingAddress = {};\n cartState\n .clearCartLinePickupLocation({ cartLineId: cartline.LineId! })\n .then(result => {\n if (result.status === 'SUCCESS') {\n props.locationChangedHandler();\n }\n })\n .catch(error => {});\n }\n };\n\n const _getOrgUnitName = (fulfillmentStoreId: string | undefined, orgUnitLocations: OrgUnitLocation[] | undefined) => {\n if (!orgUnitLocations || !fulfillmentStoreId || orgUnitLocations.length === 0) {\n return '';\n }\n\n const foundLocation = orgUnitLocations.find(orgUnitLocation => {\n return orgUnitLocation.OrgUnitNumber === fulfillmentStoreId;\n });\n\n if (foundLocation) {\n return foundLocation.OrgUnitName;\n }\n return fulfillmentStoreId;\n };\n\n const _renderShippingMethod = (\n cartLine: CartLine,\n shipItText: string,\n pickupInStoretext: string,\n changeStoreText: string,\n orgUnitLocations: OrgUnitLocation[] | undefined\n ): JSX.Element => {\n const orgUnitName = _getOrgUnitName(cartLine.FulfillmentStoreId, orgUnitLocations);\n const bopisSelected = !!cartLine.FulfillmentStoreId;\n\n const toggleBOPIS = (isBopisSelected: boolean) => {\n return () => {\n _toggleBOPIS(isBopisSelected);\n };\n };\n\n return (\n <>\n \n \n {cartLine.FulfillmentStoreId ? (\n
\n {orgUnitName}\n \n
\n ) : null}\n \n );\n };\n\n const _getDeliveryOption = (pickupStore: IPickUpInStoreProps, deliveryOptions: ProductDeliveryOptions) => {\n const delivery = deliveryOptions?.DeliveryOptions?.find(option => option.Code === pickupStore.pickupDeliveryModeCode);\n return delivery?.Description;\n };\n\n /**\n * Method to check if we have atleast one common delivery code between product and channel.\n * @param productdeliveryOptions - Product DeliveryOption List.\n * @param storePickUpOptionList - Channel DeliveryOption List.\n * @returns Boolean flag.\n */\n const matchDeliveryOptions = (\n productdeliveryOptions: DeliveryOption[] | undefined,\n storePickUpOptionList: string[] | undefined\n ): boolean => {\n const deliveryOption: string[] = [];\n productdeliveryOptions?.map(delivery => {\n const pickup = storePickUpOptionList?.find(deliveryCode => deliveryCode === delivery.Code);\n if (pickup) {\n deliveryOption.push(pickup);\n }\n return deliveryOption;\n });\n\n return ArrayExtensions.hasElements(deliveryOption);\n };\n\n // If no delivery options present on the product, or none of the delivery options\n // match the PickupDeliveryModeCode, that means the item cannot be used for BOPIS\n if (!props.deliveryOptions || !props.deliveryOptions.DeliveryOptions) {\n return undefined;\n }\n\n if (props.retailMulitplePickupFeatureState && props.channelDeliveryOptionConfig) {\n if (!matchDeliveryOptions(props.deliveryOptions.DeliveryOptions, props.channelDeliveryOptionConfig?.PickupDeliveryModeCodes)) {\n return undefined;\n }\n } else if (\n !props.pickupDeliveryModeCode ||\n !props.deliveryOptions.DeliveryOptions.find(option => option.Code === props.pickupDeliveryModeCode)\n ) {\n return undefined;\n }\n\n return {\n callbacks: {\n toggleBopis: _toggleBOPIS\n },\n defaultComponent: _renderShippingMethod(\n props.cartline,\n props.shipitText,\n props.pickUpInStoreText,\n props.changeStoreText,\n props.orgUnitLocations\n ),\n orgUnitName: _getOrgUnitName(props.cartline.FulfillmentStoreId, props.orgUnitLocations),\n isBopisSelected: !!props.cartline.FulfillmentStoreId,\n deliveryOption: _getDeliveryOption(props, props.deliveryOptions),\n ContainerProps: {\n className: 'msc-cart-line__bopis-container'\n }\n };\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n AddToOrderTemplateComponent,\n AddToWishlistComponent,\n CartLineItemComponent,\n IAddToOrderTemplateDialogResources,\n ICartlineResourceString,\n IDuplicateItemsWhenAddingToOrderTemplateDialogResources,\n IItemAddedToOrderTemplateDialogResources,\n IOrderTemplateNameDialogResources,\n IWishlistActionSuccessResult\n} from '@msdyn365-commerce/components';\nimport MsDyn365, {\n IAny,\n ICoreContext,\n IGeneric,\n IGridSettings,\n IImageSettings,\n ITelemetry,\n TelemetryEvent,\n isChannelTypeB2B\n} from '@msdyn365-commerce/core';\nimport { ICartState } from '@msdyn365-commerce/global-state';\nimport {\n AsyncResult,\n CartLine,\n CartLineValidationResultsByLineId,\n ChannelDeliveryOptionConfiguration,\n CommerceList,\n Customer,\n OrgUnitLocation,\n ProductDeliveryOptions,\n SimpleProduct\n} from '@msdyn365-commerce/retail-proxy';\nimport { ProductCatalog, ProductDimensionType, ReleasedProductType } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { IStoreSelectorStateManager } from '@msdyn365-commerce-modules/bopis-utilities';\nimport {\n ArrayExtensions,\n getInvoiceDetailsPageUrlSync,\n getProductUrlSync,\n IProductInventoryInformation,\n isCartLineItemPickUpType,\n ObjectExtensions,\n OrderTemplate,\n StringExtensions\n} from '@msdyn365-commerce-modules/retail-actions';\nimport { Button, getPayloadObject, getTelemetryAttributes, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { getProductByProductId, getProductByProductIdAndWarehouse } from '../../../Common/get-product';\nimport { IPickUpInStoreViewProps, PickUpInStore } from './cart-pick-up-in-store';\n\nexport interface ICartLineItemsProps {\n cartlines: CartLine[];\n cartlinesErrors: CartLineValidationResultsByLineId;\n cartState: ICartState | undefined;\n orgUnitLocations: OrgUnitLocation[] | undefined;\n resources: ICartlineResourceString;\n productAvailabilites: IProductInventoryInformation[] | undefined;\n products: SimpleProduct[] | undefined;\n productDeliveryOptions: ProductDeliveryOptions[] | undefined;\n pickupDeliveryModeCode?: string;\n catalogs?: ProductCatalog[];\n retailMulitplePickupFeatureState?: boolean;\n\n /* GridSettings for the product image in cartline */\n gridSettings: IGridSettings;\n\n /* ImageSettings for the product image in cartline */\n imageSettings: IImageSettings;\n id: string;\n typeName: string;\n context: ICoreContext>;\n telemetry: ITelemetry;\n removeButtonText: string;\n addToWishlistButtonText: string;\n removeFromWishlistButtonText: string;\n shipItText: string;\n pickitUpText: string;\n changeStoreText: string;\n outOfStockText: string;\n outOfRangeOneText: string;\n outOfRangeFormatText: string;\n storeSelectorStateManager: IStoreSelectorStateManager | undefined;\n isStockCheckEnabled: boolean;\n wishlists: CommerceList[] | undefined;\n defaultWishlistName: string;\n maxCartlineQuantity: number;\n includeErrors?: boolean;\n showShippingChargesForLineItems?: boolean;\n telemetryContent?: ITelemetryContent;\n isQuantityLimitsFeatureEnabled: boolean;\n hasInvoiceLine?: boolean;\n storeSelectorModuleId?: string;\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\n\n addToOrderTemplateDialogResources: IAddToOrderTemplateDialogResources;\n createOrderTemplateDialogResources: IOrderTemplateNameDialogResources;\n itemAddedToOrderTemplateDialogResources: IItemAddedToOrderTemplateDialogResources;\n duplicateItemsWhenAddingToOrderTemplateDialogResources: IDuplicateItemsWhenAddingToOrderTemplateDialogResources;\n\n addToOrderTemplateButtonText: string;\n addToOrderTemplateButtonTooltip: string;\n addToOrderTemplateMessage: string;\n addItemToOrderTemplateError: string;\n orderTemplates: OrderTemplate[] | undefined;\n customerInformation: Customer | undefined;\n shouldIgnoreWarehouse: boolean | undefined;\n productAvailability?: AsyncResult;\n productPickUpOptions?: ProductDeliveryOptions[] | undefined;\n isMultipleCatalogFeatureEnabledInHq: boolean;\n catalogId?: number;\n\n removeItemClickHandler(cartlineToRemove: CartLine): void;\n moveToWishlistSuccessHandler(result: IWishlistActionSuccessResult, cartlineId: CartLine): void;\n updateCartLinesQuantitySuccessHandler(cartline: CartLine, quantity: number, lineIndex?: number): boolean;\n locationChangedHandler(): void;\n}\n\nexport interface ICartlinesViewProps {\n cartline: React.ReactNode;\n pickUpInStore?: IPickUpInStoreViewProps;\n remove: React.ReactNode;\n addToWishlist: React.ReactNode | undefined;\n addToOrderTemplate: React.ReactNode | undefined;\n\n error?: string;\n cartlineId?: string;\n hasError?: boolean;\n data?: {\n product?: SimpleProduct;\n cartline: CartLine;\n };\n}\n\nconst _getCartItemAvailableQuantity = (\n isStockCheckEnabled: boolean,\n productAvailability: IProductInventoryInformation | undefined\n): number => {\n if (\n !isStockCheckEnabled ||\n !productAvailability ||\n !productAvailability.ProductAvailableQuantity ||\n !productAvailability.IsProductAvailable ||\n !productAvailability.ProductAvailableQuantity.AvailableQuantity\n ) {\n return 0;\n }\n\n return productAvailability.ProductAvailableQuantity.AvailableQuantity;\n};\n\nconst _getCartItemMaxQuantity = (\n maxQuantityByConfig: number,\n isStockCheckEnabled: boolean,\n availableQuantityInStock: number,\n isQuantityLimitsFeatureEnabled: boolean,\n maxByQuantityLimitsFeature: number\n) => {\n if (isQuantityLimitsFeatureEnabled) {\n let maxByQuantityLimitsFeatureResult = maxByQuantityLimitsFeature;\n\n // If max by feature in not defined when feature is on then we suggest that there no max by feature\n // and consider available qty if stock check enabled and max from config in site settings.\n if (!maxByQuantityLimitsFeature) {\n maxByQuantityLimitsFeatureResult = maxQuantityByConfig || 10;\n }\n\n return isStockCheckEnabled\n ? maxByQuantityLimitsFeatureResult < availableQuantityInStock\n ? maxByQuantityLimitsFeatureResult\n : availableQuantityInStock\n : maxByQuantityLimitsFeatureResult;\n }\n if (isStockCheckEnabled) {\n return availableQuantityInStock < maxQuantityByConfig ? availableQuantityInStock : maxQuantityByConfig;\n }\n return maxQuantityByConfig;\n};\n\nconst _getErrorMessage = (\n availableQuantityInStock: number,\n currentQuantity: number,\n props: ICartLineItemsProps,\n shouldSkipStockCheck: boolean,\n cartLine: CartLine,\n lineId: string | undefined,\n foundProductAvailability?: IProductInventoryInformation\n): string | undefined => {\n const finalErrorMessages: string[] = [];\n\n const isLoadingDeliveryOptions = props.productAvailability?.status === 'LOADING';\n if (isLoadingDeliveryOptions) {\n return undefined;\n }\n // check availability passed as prop for each cartline\n if (props.productAvailabilites && ArrayExtensions.hasElements(props.productAvailabilites)) {\n if (foundProductAvailability === undefined) {\n finalErrorMessages.push(props.outOfStockText);\n return finalErrorMessages.toString();\n }\n }\n if (props.includeErrors && props.isStockCheckEnabled && !shouldSkipStockCheck) {\n if (availableQuantityInStock <= 0) {\n finalErrorMessages.push(props.outOfStockText);\n } else if (availableQuantityInStock < currentQuantity) {\n if (availableQuantityInStock === 1) {\n finalErrorMessages.push(props.outOfRangeOneText);\n } else {\n finalErrorMessages.push(props.outOfRangeFormatText.replace('{numLeft}', availableQuantityInStock.toString()));\n }\n }\n }\n\n // Server-side validation\n const checkForErrors = props.cartlinesErrors.ValidationResultsPairs;\n const errorsFoundByLineId = checkForErrors?.filter(index => index.LineId === lineId);\n if (errorsFoundByLineId !== undefined) {\n for (const i of errorsFoundByLineId) {\n if (ArrayExtensions.hasElements(i.ValidationFailures)) {\n i.ValidationFailures.forEach(validation => {\n if (validation.ErrorContext !== undefined) {\n finalErrorMessages.push(validation.ErrorContext);\n }\n });\n }\n }\n }\n\n if (ArrayExtensions.hasElements(finalErrorMessages)) {\n return finalErrorMessages.join(' ');\n }\n\n return undefined;\n};\n\n/**\n * On Remove Click functionality.\n * @param removeItemClickHandler -Remove item click function.\n * @param cartline -CartLine.\n * @returns Remove change value.\n */\nconst onRemoveClickFunction = (removeItemClickHandler: (cartlineToRemove: CartLine) => void, cartline: CartLine) => () => {\n removeItemClickHandler(cartline);\n};\n\n// eslint-disable-next-line complexity -- Auto-suppressed.\nconst _assembleNode = (\n cartline: CartLine,\n product: SimpleProduct | undefined,\n props: ICartLineItemsProps,\n index: number,\n foundProductAvailability?: IProductInventoryInformation,\n productPickUpOptions?: ProductDeliveryOptions\n): ICartlinesViewProps => {\n const {\n imageSettings,\n gridSettings,\n id,\n typeName,\n context,\n resources,\n removeButtonText,\n removeItemClickHandler,\n moveToWishlistSuccessHandler,\n addToOrderTemplateButtonText,\n addToOrderTemplateButtonTooltip,\n addToOrderTemplateDialogResources,\n createOrderTemplateDialogResources,\n itemAddedToOrderTemplateDialogResources,\n duplicateItemsWhenAddingToOrderTemplateDialogResources,\n addToWishlistButtonText,\n removeFromWishlistButtonText,\n orderTemplates,\n customerInformation,\n wishlists,\n defaultWishlistName,\n storeSelectorModuleId,\n isMultipleCatalogFeatureEnabledInHq\n } = props;\n\n const isAuthenticated = context.request.user.isAuthenticated;\n const nameOfWishlist = wishlists && wishlists.length > 0 && wishlists[0].Name ? wishlists[0].Name : defaultWishlistName;\n const availableQuantityInStock = _getCartItemAvailableQuantity(props.isStockCheckEnabled, foundProductAvailability);\n\n const maxQuantity =\n product &&\n _getCartItemMaxQuantity(\n props.maxCartlineQuantity,\n props.isStockCheckEnabled,\n availableQuantityInStock,\n props.isQuantityLimitsFeatureEnabled,\n product?.Behavior?.MaximumQuantity || 0\n );\n\n // Skip stock check if the cart line is a service item or an invoice line\n const shouldSkipStockCheck = product?.ItemTypeValue === ReleasedProductType.Service || !!cartline.IsInvoiceLine;\n\n const errorMessage = ObjectExtensions.isNullOrUndefined(maxQuantity)\n ? undefined\n : _getErrorMessage(\n availableQuantityInStock,\n cartline.Quantity!,\n props,\n shouldSkipStockCheck,\n cartline,\n cartline.LineId,\n foundProductAvailability\n );\n\n const onRemoveClickHandler = onRemoveClickFunction(removeItemClickHandler, cartline);\n\n const payload = getPayloadObject(TelemetryEvent.RemoveFromCart, props.telemetryContent!, removeButtonText, '');\n const attributes = getTelemetryAttributes(props.telemetryContent!, payload);\n\n const inventoryLbl = foundProductAvailability?.StockLevelLabel;\n const inventoryCode = foundProductAvailability\n ? `ms-cart-line__inventory-code-${foundProductAvailability.StockLevelCode?.toLowerCase()}`\n : undefined;\n const productDimension = 4;\n const customPriceDimensionType = productDimension as ProductDimensionType.Style;\n const isCustomPriceSelected =\n product?.Dimensions?.find(dimension => dimension.DimensionTypeValue === customPriceDimensionType)?.DimensionValue?.Value ===\n 'Custom';\n\n let productUrl: string | undefined;\n if (product) {\n productUrl = getProductUrlSync(product, props.context.actionContext, undefined);\n\n if (MsDyn365.isBrowser && isChannelTypeB2B(props.context.actionContext.requestContext)) {\n const fullUrl = new URL(productUrl, window.location.href);\n fullUrl.searchParams.set('catalogid', `${cartline.CatalogId ?? 0}`);\n productUrl = fullUrl.href;\n }\n } else {\n productUrl = getInvoiceDetailsPageUrlSync(cartline.Description || '', props.context.actionContext);\n }\n\n return {\n data: {\n product,\n cartline\n },\n cartlineId: cartline.LineId,\n error: errorMessage,\n hasError:\n (!shouldSkipStockCheck && props.isStockCheckEnabled ? cartline.Quantity! > (maxQuantity ?? 0) : false) ||\n (!ObjectExtensions.isNullOrUndefined(errorMessage) && !StringExtensions.isNullOrEmpty(errorMessage)),\n cartline: (\n \n ),\n pickUpInStore: product\n ? PickUpInStore({\n storeSelectorModuleId,\n cartState: props.cartState,\n cartline,\n product,\n shipitText: props.shipItText,\n pickUpInStoreText: props.pickitUpText,\n changeStoreText: props.changeStoreText,\n storeSelectorStateManager: props.storeSelectorStateManager,\n orgUnitLocations: props.orgUnitLocations,\n deliveryOptions: productPickUpOptions,\n pickupDeliveryModeCode:\n cartline.DeliveryMode !== (undefined || '') ? cartline.DeliveryMode : props.pickupDeliveryModeCode,\n retailMulitplePickupFeatureState: props.retailMulitplePickupFeatureState,\n channelDeliveryOptionConfig: props.channelDeliveryOptionConfig,\n locationChangedHandler: props.locationChangedHandler\n })\n : undefined,\n remove: (\n \n ),\n addToWishlist:\n isAuthenticated && product && !isCustomPriceSelected ? (\n \n ) : (\n undefined\n ),\n addToOrderTemplate:\n isAuthenticated && orderTemplates && product ? (\n \n ) : (\n undefined\n )\n };\n};\n\nexport const assembleCartlines = (\n cartlines: CartLine[],\n products: SimpleProduct[] | undefined,\n props: ICartLineItemsProps\n): ICartlinesViewProps[] | null => {\n const reactNodes: ICartlinesViewProps[] = [];\n\n cartlines.map((cartline, index) => {\n let product;\n if (props.isQuantityLimitsFeatureEnabled) {\n // When feature is enabled the same products could have different quantity limits in Behavior so we need\n // to check productId and WarehouseId for identification.\n product = getProductByProductIdAndWarehouse(cartline.ProductId, products, cartline.WarehouseId, props.cartState);\n } else {\n product = getProductByProductId(cartline.ProductId, products);\n }\n let foundProductAvailability;\n\n // check if cartlineitem is pickup item\n const isPickUpItem = isCartLineItemPickUpType(\n cartline,\n props.retailMulitplePickupFeatureState,\n props.channelDeliveryOptionConfig,\n props.pickupDeliveryModeCode\n );\n if (props.productAvailabilites && ArrayExtensions.hasElements(props.productAvailabilites)) {\n foundProductAvailability = props.productAvailabilites.find(productAvailability => {\n if (!props.shouldIgnoreWarehouse && isPickUpItem) {\n // check warehouse only if siteBuilder setting is not \"Based on aggregate for shipping and pickup warehouses\" and cartlineitem is pickupitem\n return (\n productAvailability.ProductAvailableQuantity?.ProductId === cartline.ProductId &&\n productAvailability.InventLocationId?.toUpperCase() === cartline.WarehouseId?.toUpperCase()\n );\n }\n return productAvailability.ProductAvailableQuantity.ProductId === cartline.ProductId;\n });\n }\n\n let productPickUpOptions;\n if (props.productPickUpOptions !== undefined && ArrayExtensions.hasElements(props.productPickUpOptions)) {\n productPickUpOptions = props.productPickUpOptions.find(deliveryOption => {\n return deliveryOption && deliveryOption.ProductId === cartline.ProductId;\n });\n }\n reactNodes.push(_assembleNode(cartline, product, props, index, foundProductAvailability, productPickUpOptions));\n });\n\n return reactNodes;\n};\n\n/**\n * CartLineItems component.\n * @param props\n */\nexport const CartLineItems = (props: ICartLineItemsProps) => {\n const { products, cartlines } = props;\n return assembleCartlines(cartlines, products, props);\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { CartLine, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport groupBy from 'lodash/groupBy';\n\nimport { assembleCartlines, ICartLineItemsProps, ICartlinesViewProps } from './cart-line-items';\n\nconst _assembleGroupCartlines = (\n cartlines: CartLine[],\n products: SimpleProduct[] | undefined,\n props: ICartLineItemsProps\n): ICartlinesViewProps[][] | null => {\n const reactNodes: ICartlinesViewProps[][] = [];\n if (!products || products.length === 0) {\n props.context.telemetry.error('Products content is empty, module wont render');\n return null;\n }\n\n const getGroupByStorePickup = (items: CartLine[]) => groupBy(items, item => item.FulfillmentStoreId);\n const getGroupByDelivery = (items: CartLine[]) => groupBy(items, item => item.DeliveryMode);\n const groupDelivery = getGroupByDelivery(cartlines);\n const cartLinesGroup: CartLine[] = [];\n\n // 1) Group by store and pick up mode\n Object.entries(groupDelivery).forEach(([deliveryType, groupByDeliveryType]) => {\n // @ts-expect-error\n groupDelivery[deliveryType] = getGroupByStorePickup(groupByDeliveryType);\n cartLinesGroup.push(getGroupByStorePickup(groupByDeliveryType));\n });\n\n // 2) Create cartlines group\n Object.keys(cartLinesGroup).forEach(key => {\n const cartLines = cartLinesGroup[key];\n Object.keys(cartLines).forEach(index => {\n const cartLine = cartLines[index];\n const carLineViewProps = assembleCartlines(cartLine, products, props);\n if (carLineViewProps !== null) {\n reactNodes.push(carLineViewProps);\n }\n });\n });\n\n return reactNodes;\n};\n\nconst _assembleGroupInvoiceCartlines = (\n cartLines: CartLine[],\n products: SimpleProduct[] | undefined,\n props: ICartLineItemsProps\n): ICartlinesViewProps[][] | null => {\n const reactNodes: ICartlinesViewProps[][] = [];\n if (cartLines && cartLines.length > 0) {\n // Create invoice cartLines group\n const carLineViewProps = assembleCartlines(cartLines, products, props);\n if (carLineViewProps !== null) {\n reactNodes.push(carLineViewProps);\n }\n }\n return reactNodes;\n};\n\n/**\n * CartLine Group component.\n * @param props\n */\nexport const CartLineGroupItems = (props: ICartLineItemsProps) => {\n const { products, cartlines, hasInvoiceLine } = props;\n return hasInvoiceLine\n ? _assembleGroupInvoiceCartlines(cartlines, products, props)\n : _assembleGroupCartlines(cartlines, products, props);\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { CartPromotionLine } from '@msdyn365-commerce/retail-proxy';\nimport { getPromotionOptionsForCartLineItems, PromotionOptionsForCartLineItems } from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * IPromotionData entity interface.\n */\nexport interface IPromotionData {\n promotionOptions?: CartPromotionLine[];\n}\n\n/**\n * Calls the Retail API and returns a promotion data.\n * @param ctx\n */\nexport async function getPromotionData(ctx: IActionContext): Promise {\n const promotionData: IPromotionData = {};\n\n await getPromotionOptionsForCartLineItems(new PromotionOptionsForCartLineItems(ctx.requestContext.apiSettings), ctx)\n .then(promotionOptions => {\n if (promotionOptions) {\n promotionData.promotionOptions = promotionOptions;\n }\n })\n .catch(error => {\n ctx.telemetry.exception(error);\n return {};\n });\n\n return promotionData;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n IAddToOrderTemplateDialogResources,\n IDuplicateItemsWhenAddingToOrderTemplateDialogResources,\n IItemAddedToOrderTemplateDialogResources,\n ILinesAddedToOrderTemplateDialogResources,\n IOrderTemplateNameDialogResources,\n IWishlistActionSuccessResult,\n PromoCodeComponent,\n SaveCartToOrderTemplateComponent\n} from '@msdyn365-commerce/components';\nimport MsDyn365, { getCatalogId, getUrlSync, IImageSettings, isChannelTypeB2B } from '@msdyn365-commerce/core';\nimport { ICartActionResult, ICartState } from '@msdyn365-commerce/global-state';\nimport { AsyncResult, CartLine, CartLineValidationResultsByLineId, LineValidationResult } from '@msdyn365-commerce/retail-proxy';\nimport { FeatureState, ProductDeliveryOptions, ReleasedProductType } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { cartLineQuantityUpdatedAsync, validateCartAsync } from '@msdyn365-commerce-modules/cart-utilities';\nimport { IInvoiceSummaryLines, InvoiceSummary } from '@msdyn365-commerce-modules/invoice-payment-summary';\nimport { IOrderSummaryLines, OrderSummary } from '@msdyn365-commerce-modules/order-summary-utilities';\nimport {\n ActiveCartProductsInput,\n ArrayExtensions,\n getActiveCartProductsAction,\n ICartLineInventoryValidationResult,\n ObjectExtensions,\n validateCartLinesInventory,\n ProductPickUpOptionsForCartLineItems,\n validateCatalogId\n} from '@msdyn365-commerce-modules/retail-actions';\nimport {\n Alert,\n Button,\n getPayloadObject,\n getTelemetryAttributes,\n getTelemetryObject,\n INodeProps,\n IPayLoad,\n ITelemetryContent,\n TelemetryConstant,\n Waiting,\n updateMaxQuantityForCartLineItem,\n urlCheck\n} from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport { reaction } from 'mobx';\nimport { observer } from 'mobx-react';\nimport React from 'react';\nimport { getPickUpOptionsForCartLineItems } from './actions/get-pickup-options-for-cartlines';\n\nimport { ICartData } from './cart.data';\nimport { ICartProps, ICartResources } from './cart.props.autogenerated';\nimport { CartLineGroupItems } from './components/cart-line-groups';\nimport { CartLineItems, ICartlinesViewProps } from './components/cart-line-items';\nimport { cartPromotions, ICartLineItemViewProps } from './components/cart-line-items-promotion';\nimport { getPromotionData, IPromotionData } from './utils/get-promotion-in-cart';\n\n/**\n * Cart view props interface.\n */\nexport interface ICartViewProps extends ICartProps {\n className: string;\n title?: React.ReactNode;\n CartlinesWrapper: INodeProps;\n cartlines?: ICartlinesViewProps[];\n cartLinesGroup?: ICartlinesViewProps[][];\n cart: ICartState | undefined;\n orderSummaryHeading: React.ReactNode;\n orderSummaryLineitems?: IOrderSummaryLines;\n invoiceSummaryLineitems?: IInvoiceSummaryLines;\n OrderSummaryWrapper: INodeProps;\n OrderSummaryItems: INodeProps;\n OrderSummaryErrors?: IOrderSummaryErrors;\n checkoutAsGuestButton: React.ReactNode;\n checkoutAsSignInUserButton: React.ReactNode;\n storeSelector?: React.ReactNode;\n expressCheckoutButton?: React.ReactNode[];\n ExpressCheckoutSectionWrapper: INodeProps;\n backToShoppingButton: React.ReactNode;\n waitingComponent: React.ReactNode;\n promotionOptions?: ICartLineItemViewProps;\n promoCode: React.ReactNode;\n cartLoadingStatus: string;\n cartDataResult: boolean;\n multiplePickUpEnabled?: boolean;\n createTemplateFromCartButton: React.ReactNode;\n telemetryContent?: ITelemetryContent;\n checkoutBlockedDueToUnavailableFunds?: React.ReactNode;\n removeItemClickHandler(cartlineToRemove: CartLine): void;\n moveToWishlistSuccessHandler(result: IWishlistActionSuccessResult, cartlineId: CartLine): void;\n}\n\n/**\n * Order summary errors interface.\n */\nexport interface IOrderSummaryErrors {\n Wrapper: INodeProps;\n header: React.ReactNode;\n errors: React.ReactNode[];\n}\n\n/**\n * Cart component state interface.\n */\ninterface ICartComponentState {\n showPromotionDialog: boolean;\n cartlinesErrors: CartLineValidationResultsByLineId;\n promotionData: IPromotionData;\n isCartValid: boolean;\n productPickUpOptions?: ProductDeliveryOptions[];\n}\n\n/**\n * Cart component.\n * @extends {React.PureComponent>}\n */\n@observer\nclass Cart extends React.Component> {\n public state: ICartComponentState;\n\n private readonly telemetryContent: ITelemetryContent;\n\n private readonly payLoad: IPayLoad;\n\n private isQuantityLimitsFeatureEnabled: boolean = false;\n\n private _isMounted: boolean = false;\n\n private readonly promotionPopupId: string = 'cart-promotion-popup';\n\n public constructor(props: ICartProps) {\n super(props);\n this.telemetryContent = getTelemetryObject(\n this.props.context.request.telemetryPageName!,\n this.props.friendlyName,\n this.props.telemetry\n );\n this.payLoad = getPayloadObject('click', this.telemetryContent, '');\n this.promotionLinkClick = this.promotionLinkClick.bind(this);\n this.promotionCloseButtonclick = this.promotionCloseButtonclick.bind(this);\n\n this.state = {\n showPromotionDialog: false,\n promotionData: {},\n isCartValid: true,\n productPickUpOptions: undefined,\n cartlinesErrors: {}\n };\n }\n\n /**\n * Component did mount function.\n */\n public async componentDidMount(): Promise {\n this._isMounted = true;\n const {\n config,\n context: { actionContext }\n } = this.props;\n\n this.isQuantityLimitsFeatureEnabled =\n (await this.getOrderQuantityLimitsFeatureFlag()) || (await this._isChannelLimitsFeatureEnabled());\n if (this.isQuantityLimitsFeatureEnabled) {\n await this.validateCart();\n }\n\n if (config.showAvailablePromotions) {\n if (this._isMounted && this.props.data.cart.result?.cart.CartLines) {\n this.setState({ promotionData: await getPromotionData(actionContext) });\n }\n\n reaction(\n () => this.props.data.cart.result?.cart.CartLines,\n async () => {\n if (this._isMounted) {\n this.setState({ promotionData: await getPromotionData(actionContext) });\n }\n }\n );\n }\n reaction(\n () => this.props.data.cart.result?.cart.CartLines,\n async () => {\n if (this._isMounted) {\n const input = new ProductPickUpOptionsForCartLineItems(actionContext.requestContext.apiSettings);\n this.setState({ productPickUpOptions: await getPickUpOptionsForCartLineItems(input, actionContext) });\n }\n }\n );\n }\n\n /**\n * Component will unmount function.\n */\n public componentWillUnmount(): void {\n this._isMounted = false;\n }\n\n /**\n * Should component update function.\n * @param nextProps - Next props.\n * @param nextState - Next state.\n * @returns True if component should update, false otherwise.\n */\n public shouldComponentUpdate(nextProps: ICartProps, nextState: ICartComponentState): boolean {\n if (this.state === nextState && this.props.data === nextProps.data) {\n return false;\n }\n return true;\n }\n\n /* eslint-disable complexity -- Disabling complexity for render method */\n public render(): JSX.Element | null {\n const {\n data: {\n cart: { result: cart },\n products: { result: products }\n },\n context: {\n request: {\n user: { isAuthenticated, signInUrl }\n }\n },\n resources\n } = this.props;\n\n const guestCheckoutUrl = getUrlSync('checkout', this.props.context.actionContext) || '';\n const backToShoppingUrl = getUrlSync('home', this.props.context.actionContext) || '';\n const checkoutURL = this.getCheckoutURL(isAuthenticated, guestCheckoutUrl, signInUrl || '');\n const isCartEmpty = cart && cart.cart.CartLines && cart.cart.CartLines.length === 0;\n const cartLines = this._getCartLines();\n const emailDeliveryModeCode = this.props.context.request.channel?.EmailDeliveryModeCode;\n const validInventoryAcrossCartLines = validateCartLinesInventory(\n cart?.cart.CartLines ?? [],\n this.props.data.productAvailabilites.result ?? [],\n this.props.context.actionContext,\n products ?? [],\n emailDeliveryModeCode\n );\n\n const hasError =\n !validInventoryAcrossCartLines?.isValid ||\n (!validInventoryAcrossCartLines && !this.state.isCartValid) ||\n (cartLines ? cartLines.some(cartline => cartline.hasError) : false);\n const RetailMultiplePickupFeatureState = this.props.data.featureState.result?.find(\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature'\n );\n const multiplePickUpEnabled = RetailMultiplePickupFeatureState?.IsEnabled;\n const channelMultipleCatalogsFeature = 'Dynamics.AX.Application.ChannelMultipleCatalogsFeature';\n const { featureState } = this.props.data;\n const isMultipleCatalogsFeatureEnabled =\n featureState.result?.find((item: FeatureState) => item.Name === channelMultipleCatalogsFeature)?.IsEnabled || false;\n const currentCatalogId = getCatalogId(this.props.context.request);\n validateCatalogId(currentCatalogId);\n const cartLinesGroup = cart?.hasInvoiceLine || multiplePickUpEnabled ? this.getCartLinesGroup() : null;\n this.payLoad.contentAction.etext = TelemetryConstant.Checkout;\n const checkoutBySignInAttributes = getTelemetryAttributes(this.telemetryContent, this.payLoad);\n this.payLoad.contentAction.etext = TelemetryConstant.GuestCheckout;\n const checkoutByGuestAttributes = getTelemetryAttributes(this.telemetryContent, this.payLoad);\n this.payLoad.contentAction.etext = TelemetryConstant.BackToShopping;\n const backtoShoppingAttributes = getTelemetryAttributes(this.telemetryContent, this.payLoad);\n\n // If there's inventory issues across multiple cart lines then update the error and display as part of the order summary\n if (validInventoryAcrossCartLines && !validInventoryAcrossCartLines.isValid) {\n if (multiplePickUpEnabled && cartLinesGroup !== null) {\n for (const cartLineGroup of cartLinesGroup) {\n this._updateCartLineErrorForInvalidInventory(cartLineGroup, validInventoryAcrossCartLines);\n }\n }\n\n this._updateCartLineErrorForInvalidInventory(cartLines, validInventoryAcrossCartLines);\n }\n\n const viewProps = {\n ...this.props,\n className: classnames('ms-cart'),\n title:

{resources.cartTitle}

,\n cart: this.props.data.cart.result,\n CartlinesWrapper: { className: 'msc-cartline-wraper' },\n OrderSummaryWrapper: { className: cart?.hasInvoiceLine ? 'msc-invoice-summary-wrapper' : 'msc-order-summary-wrapper' },\n OrderSummaryItems: { className: cart?.hasInvoiceLine ? 'msc-invoice-summary__items' : 'msc-order-summary__items' },\n cartlines: cartLines,\n cartLinesGroup,\n promoCode: this._getPromoCode(),\n promotionOptions: this._getPromotions(),\n context: this.props.context,\n typeName: this.props.typeName,\n telemetry: this.props.telemetry,\n id: this.props.id,\n multiplePickUpEnabled,\n removePromoAriaLabelFormat: resources.removePromoAriaLabelFormat,\n orderSummaryHeading: ArrayExtensions.hasElements(cart?.cart.CartLines) ? (\n cart?.hasInvoiceLine ? (\n

{resources.invoiceSummaryTitle}

\n ) : (\n

{resources.orderSummaryTitle}

\n )\n ) : null,\n orderSummaryLineitems: this._getOrderSummaryLineItems(),\n invoiceSummaryLineitems: this._getInvoiceSummaryLineItems(),\n checkoutAsSignInUserButton: !isCartEmpty ? (\n \n {resources.checkoutButtonTitle}\n \n ) : null,\n checkoutAsGuestButton:\n !isCartEmpty && !isAuthenticated && this.props.config.showGuestCheckoutButton ? (\n \n {resources.guestCheckoutButtonTitle}\n \n ) : null,\n expressCheckoutButton: !isCartEmpty ? this.props.slots.paymentExpress : null,\n ExpressCheckoutSectionWrapper: { className: 'msc-express-payment-container-in-cart-page' },\n backToShoppingButton: (\n \n {resources.backToShoppingButtonTitle}\n \n ),\n createTemplateFromCartButton:\n this._displayAddCartToTemplate() && products ? (\n \n ) : null,\n checkoutBlockedDueToUnavailableFunds: null,\n storeSelector:\n this.props.slots.storeSelector && this.props.slots.storeSelector.length > 0 ? this.props.slots.storeSelector[0] : null,\n removeItemClickHandler: this.removeItemFromCartHandler,\n moveToWishlistSuccessHandler: this.moveToWishlistSuccessHandler,\n waitingComponent: ,\n cartLoadingStatus: this.props.data.cart.status === 'FAILED' ? this.props.resources.cartLoadingErrorMessage : null,\n cartDataResult: this.props.data.cart.result && this.props.data.cart.result.isEmpty,\n OrderSummaryErrors: this._getOrderSummaryErrors(cartLines),\n telemetryContent: this.telemetryContent\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n /* eslint-enable complexity -- Disabling complexity for render method */\n\n /**\n * Promotion click event handler.\n * @param event - The mouse event.\n */\n private readonly promotionLinkClick = (event: React.MouseEvent) => {\n this.setState({\n showPromotionDialog: !this.state.showPromotionDialog\n });\n };\n\n /**\n * Promotion close button click.\n */\n private readonly promotionCloseButtonclick = () => {\n this._hidePromotionDialog();\n };\n\n /**\n * Hide promotion dialog.\n */\n private _hidePromotionDialog(): void {\n this.setState({\n showPromotionDialog: false\n });\n }\n\n /**\n * Display add to cart template.\n * @returns True if should display, false otherwise.\n */\n private _displayAddCartToTemplate(): boolean {\n const cart = this.props.data.cart?.result;\n if (ObjectExtensions.isNullOrUndefined(cart) || cart.hasInvoiceLine) {\n return false;\n }\n\n if (\n isChannelTypeB2B(this.props.context.actionContext.requestContext) &&\n this.props.data.orderTemplates.result &&\n ArrayExtensions.hasElements(cart.cart?.CartLines) &&\n this.props.data.customerInformation.result\n ) {\n return true;\n }\n\n return false;\n }\n\n /**\n * Get promotions.\n * @returns React node with the promotions.\n */\n private _getPromotions(): React.ReactNode {\n return (\n this.props.config.showAvailablePromotions &&\n cartPromotions({\n id: this.promotionPopupId,\n showPromotionPopup: this.state.showPromotionDialog,\n onSeeAllClick: this.promotionLinkClick,\n onCloseButtonClick: this.promotionCloseButtonclick,\n promotions: this.state.promotionData.promotionOptions,\n resources: {\n promotionStringHeading: this.props.resources.promotionStringHeading,\n promotionLinkText: this.props.resources.promotionLinkText,\n promotionPopupHeading: this.props.resources.promotionPopupHeading,\n promotionCloseButtonAriaLabel: this.props.resources.promotionCloseButtonAriaLabel\n }\n })\n );\n }\n\n /**\n * Add error message in cart line in case the quantity exceeds the current inventory.\n * @param cartLines - The cart lines.\n * @param cartLineInventoryValidationResult - The cart line inventory result.\n */\n private _updateCartLineErrorForInvalidInventory(\n cartLines: ICartlinesViewProps[] | null,\n cartLineInventoryValidationResult: ICartLineInventoryValidationResult\n ) {\n const { resources } = this.props;\n\n if (\n ArrayExtensions.hasElements(cartLines) &&\n !cartLineInventoryValidationResult.isValid &&\n ArrayExtensions.hasElements(cartLineInventoryValidationResult.productIdWithErrors)\n ) {\n for (const productIdWithError of cartLineInventoryValidationResult.productIdWithErrors) {\n const cartLine = cartLines?.find(element => element.data?.cartline.ProductId === productIdWithError);\n if (cartLine) {\n cartLine.error = resources.outOfStockErrorMessage;\n cartLine.hasError = true;\n }\n }\n }\n }\n\n /**\n * Get order summary errors.\n * @param cartLines - The cart lines.\n * @returns Order summary errors.\n */\n private _getOrderSummaryErrors(cartLines: ICartlinesViewProps[] | null): IOrderSummaryErrors | undefined {\n const allErrors =\n (cartLines &&\n cartLines\n .map(cartline => {\n // Check if the product is service or not by product type\n const isServiceItem = cartline.data?.product?.ItemTypeValue === ReleasedProductType.Service;\n\n if (!isServiceItem && cartline.error) {\n const fullError =\n cartline.data && cartline.data.product?.Name\n ? `${cartline.data.product.Name}: ${cartline.error}`\n : cartline.error;\n\n return (\n
\n {fullError}\n
\n );\n }\n\n return null;\n })\n .filter((line): line is JSX.Element => !!line)) ||\n [];\n\n return {\n Wrapper: {\n tag: Alert,\n className: 'msc-alert',\n isOpen: allErrors.length > 0,\n color: 'danger',\n assertive: true,\n 'aria-label': this.props.resources.outOfStockErrorMessageHeader\n },\n header: (\n \n ),\n errors: allErrors\n };\n }\n\n /**\n * Gets invoice summary line items.\n * @returns Invoice summary lines.\n */\n private _getInvoiceSummaryLineItems(): IInvoiceSummaryLines | undefined {\n const {\n data: {\n cart: { result: cart }\n },\n telemetry,\n resources\n } = this.props;\n\n return cart?.hasInvoiceLine\n ? InvoiceSummary({\n orderTotalLabel: resources.totalAmountLabel,\n invoiceLabel: resources.invoiceLabel,\n cart: cart.cart,\n context: this.props.context,\n typeName: this.props.typeName,\n telemetry,\n id: this.props.id\n })\n : undefined;\n }\n\n /**\n * Gets order summary line items.\n * @returns Order summary lines.\n */\n private _getOrderSummaryLineItems(): IOrderSummaryLines | undefined {\n const {\n data: {\n cart: { result: cart },\n channelDeliveryOptionConfig\n },\n telemetry,\n resources\n } = this.props;\n\n const channelConfiguration = this.props.context && this.props.context.request && this.props.context.request.channel;\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\n const featureState = this.props?.data?.featureState;\n const retailMultiplePickUpOptionEnabled = featureState?.result?.find(item => item.Name === multiplePickupStoreSwitchName)\n ?.IsEnabled;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- app configs are of generic type\n const isShowOrHideTaxEnabled = this.props.context.request.app.config?.isEnableShowOrHideSalesTaxECommerceEnabled === true;\n\n return channelConfiguration && ArrayExtensions.hasElements(cart?.cart.CartLines) && !cart?.hasInvoiceLine\n ? OrderSummary({\n cart: cart!.cart,\n subTotalLabel: resources.itemsWithCountLabel,\n shippingLabel: resources.estimatedShippingLabel,\n otherChargeLabel: resources.otherCharges,\n taxLabel: resources.estimatedTaxLabel,\n orderTotalLabel: resources.orderTotal,\n totalDiscountsLabel: resources.totalDiscountsLabel,\n context: this.props.context,\n typeName: this.props.typeName,\n id: this.props.id,\n toBeCalculatedText: resources.yetToBeCalculatedText,\n freeText: resources.priceFree,\n channelConfiguration,\n retailMultiplePickUpOptionEnabled,\n channelDeliveryOptionConfig: channelDeliveryOptionConfig?.result,\n telemetry,\n isTaxIncludedInPrice: cart!.cart.IsTaxIncludedInPrice,\n isShowTaxBreakup: isShowOrHideTaxEnabled\n })\n : undefined;\n }\n\n /**\n * Gets promo code.\n * @returns React node with the promo code.\n */\n private _getPromoCode(): React.ReactNode {\n const {\n data: {\n cart: { result: cart }\n },\n resources\n } = this.props;\n\n return (\n cart && (\n \n )\n );\n }\n\n /**\n * Generate add to order template dialog resources.\n * @param resources - The resources.\n * @returns IAddToOrderTemplateDialogResources.\n */\n private _generateAddToOrderTemplateDialogResources(resources: ICartResources): IAddToOrderTemplateDialogResources {\n return {\n addToOrderTemplateHeader: resources.addToOrderTemplateHeader,\n\n noOrderTemplatesMessage: resources.noOrderTemplatesMessage,\n noOrderTemplatesDescription: resources.noOrderTemplatesDescription,\n\n createAnOrderTemplateButtonText: resources.createAnOrderTemplateButtonText,\n createNewOrderTemplateButtonText: resources.createNewOrderTemplateButtonText,\n cancelOrderTemplateCreationButtonText: resources.cancelOrderTemplateCreationButtonText,\n\n selectTemplatesText: resources.selectTemplatesText,\n addToTemplateButtonText: resources.addToTemplateButtonText,\n lineItemsText: resources.lineItemsText\n };\n }\n\n /**\n * Generate item added to order template dialog resources.\n * @param resources - The resources.\n * @returns IItemAddedToOrderTemplateDialogResources.\n */\n private _generateItemAddedToOrderTemplateDialogResources(resources: ICartResources): IItemAddedToOrderTemplateDialogResources {\n return {\n viewOrderTemplateButtonText: resources.viewOrderTemplateButtonText,\n continueShoppingButtonText: resources.continueShoppingButtonText,\n itemAddedToOrderTemplateHeaderItemOneText: resources.itemAddedToOrderTemplateHeaderItemOneText,\n itemAddedToOrderTemplateHeaderItemFormatText: resources.itemAddedToOrderTemplateHeaderItemFormatText,\n itemAddedToOrderTemplateHeaderMessageText: resources.itemAddedToOrderTemplateHeaderMessageText,\n freePriceText: resources.freePriceText,\n originalPriceText: resources.originalPriceText,\n currentPriceText: resources.currentPriceText\n };\n }\n\n /**\n * Generate lines added to order template dialog resources.\n * @param resources - The resources.\n * @returns ILinesAddedToOrderTemplateDialogResources.\n */\n private _generateLinesAddedToOrderTemplateDialogResources(resources: ICartResources): ILinesAddedToOrderTemplateDialogResources {\n return {\n viewOrderTemplateButtonText: resources.viewOrderTemplateButtonText,\n continueShoppingButtonText: resources.continueShoppingButtonText,\n linesAddedToOrderTemplateHeaderItemsOneText: resources.linesAddedToOrderTemplateHeaderItemsOneText,\n linesAddedToOrderTemplateHeaderItemsFormatText: resources.linesAddedToOrderTemplateHeaderItemsFormatText,\n linesAddedToOrderTemplateHeaderLinesOneText: resources.linesAddedToOrderTemplateHeaderLinesOneText,\n linesAddedToOrderTemplateHeaderLinesFormatText: resources.linesAddedToOrderTemplateHeaderLinesFormatText,\n linesAddedToOrderTemplateHeaderMessageText: resources.linesAddedToOrderTemplateHeaderMessageText,\n linesAddedToOrderTemplateCustomPriceAlertMessageText: resources.linesAddedToOrderTemplateCustomPriceAlertMessageText\n };\n }\n\n /**\n * Generate duplicate items when adding to order template dialog resources.\n * @param resources - The resources.\n * @returns IDuplicateItemsWhenAddingToOrderTemplateDialogResources.\n */\n private _generateDuplicateItemsWhenAddingToOrderTemplateDialogResources(\n resources: ICartResources\n ): IDuplicateItemsWhenAddingToOrderTemplateDialogResources {\n return {\n duplicatedProductsHeader: resources.duplicatedProductsHeader,\n duplicatedProductsDescription: resources.duplicatedProductsDescription,\n updateQuantityButtonText: resources.updateQuantityButtonText,\n cancelDuplicateItemsButtonText: resources.cancelDuplicateItemsButtonText\n };\n }\n\n /**\n * Generate order template name dialog resources.\n * @param resources - The resources.\n * @returns IOrderTemplateNameDialogResources.\n */\n private _generateOrderTemplateNameDialogResources(resources: ICartResources): IOrderTemplateNameDialogResources {\n return {\n orderTemplateHeaderLabel: resources.createOrderTemplateHeader,\n orderTemplateTitleLabel: resources.orderTemplateTitle,\n orderTemplateNameAriaLabel: resources.orderTemplateNameAriaLabel,\n orderTemplateDescription: resources.createOrderTemplateDescription,\n\n defaultOrderTemplateName: resources.defaultOrderTemplateName,\n\n orderTemplateButtonLabel: resources.createOrderTemplateButtonText,\n orderTemplateCancelButtonLabel: resources.cancelNewOrderTemplateCreationButtonText\n };\n }\n\n /**\n * Gets the cart lines view props.\n * @returns ICartlinesViewProps [].\n */\n private _getCartLines(): ICartlinesViewProps[] | null {\n const {\n data: {\n cart: { result: cart },\n wishlists: { result: wishlists },\n orderTemplates: { result: orderTemplates },\n customerInformation: { result: customerInformation }\n },\n context: {\n request: { channel: { PickupDeliveryModeCode } = { PickupDeliveryModeCode: undefined } }\n },\n config,\n telemetry,\n resources,\n modules\n } = this.props;\n\n const imageSettings = this.getImageSettings(config.imageSettings);\n\n const RetailMultiplePickupFeatureState = this.props.data.featureState.result?.find(\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature'\n );\n const multiplePickUpEnabled = RetailMultiplePickupFeatureState?.IsEnabled;\n\n const cartlinesErrors: CartLineValidationResultsByLineId = this.state.cartlinesErrors;\n let storeSelectorId: string = '';\n if (modules && Object.keys(modules).length > 0 && modules.storeSelector && modules.storeSelector.length > 0) {\n storeSelectorId = modules.storeSelector[0].id;\n }\n const channelMultipleCatalogsFeature = 'Dynamics.AX.Application.ChannelMultipleCatalogsFeature';\n const isMultipleCatalogsFeatureEnabled =\n this.props.data.featureState.result?.find((item: FeatureState) => item.Name === channelMultipleCatalogsFeature)?.IsEnabled ||\n false;\n return ArrayExtensions.hasElements(cart?.cart.CartLines)\n ? CartLineItems({\n cartlines: cart!.cart.CartLines,\n storeSelectorModuleId: storeSelectorId,\n cartlinesErrors,\n products: this.props.data.products.result,\n productAvailabilites: this.props.data.productAvailabilites.result,\n productDeliveryOptions: this.props.data.deliveryOptions.result,\n catalogs: this.props.data.catalogs?.result,\n imageSettings,\n isStockCheckEnabled: this.props.context.app.config.enableStockCheck || false,\n maxCartlineQuantity: updateMaxQuantityForCartLineItem(this.props.context.app.config.maxQuantityForCartLineItem),\n shouldIgnoreWarehouse: this.props.context.app.config.warehouseAggregation === 'multiple',\n gridSettings: this.props.context.request.gridSettings!,\n context: this.props.context,\n typeName: this.props.typeName,\n id: this.props.id,\n retailMulitplePickupFeatureState: multiplePickUpEnabled,\n resources: {\n sizeString: resources.productDimensionTypeSize,\n colorString: resources.productDimensionTypeColor,\n configString: resources.productDimensionTypeConfiguration,\n styleString: resources.productDimensionTypeStyle,\n amountString: resources.productDimensionTypeAmount,\n quantityDisplayString: resources.quantityDisplayText,\n inputQuantityAriaLabel: resources.inputQuantityAriaLabel,\n decrementButtonAriaLabel: resources.decrementButtonAriaLabel,\n incrementButtonAriaLabel: resources.incrementButtonAriaLabel,\n discountStringText: resources.discountStringText,\n originalPriceText: resources.originalPriceText,\n currentPriceText: resources.currentPriceText,\n shippingChargesText: resources.shippingCharges,\n salesAgreementPricePrompt: resources.salesAgreementPricePrompt,\n priceEditorResources: {\n ...resources\n }\n },\n telemetry,\n addToWishlistButtonText: resources.addToWishlistButtonText,\n removeFromWishlistButtonText: resources.removeFromWishlistButtonText,\n removeButtonText: resources.removeCartButtonText,\n shipItText: resources.shipInsteadDisplayText,\n pickitUpText: resources.pickItUpDisplayText,\n changeStoreText: resources.changeStoreDisplayText,\n storeSelectorStateManager: this.props.data.storeSelectorStateManager.result,\n outOfStockText: resources.outOfStockErrorMessage,\n outOfRangeOneText: resources.errorMessageOutOfRangeOneLeft,\n outOfRangeFormatText: resources.errorMessageOutOfRangeFormat,\n cartState: this.props.data.cart.result,\n orgUnitLocations: this.props.data.orgUnitLocations.result,\n removeItemClickHandler: this.removeItemFromCartHandler,\n moveToWishlistSuccessHandler: this.moveToWishlistSuccessHandler,\n updateCartLinesQuantitySuccessHandler: this.updateCartlineQuantity,\n locationChangedHandler: this.fulfillmentStoreIdUpdated,\n wishlists,\n defaultWishlistName: resources.defaultWishlistName,\n pickupDeliveryModeCode: PickupDeliveryModeCode,\n includeErrors: config.showOutOfStockErrors,\n showShippingChargesForLineItems: config.showShippingChargesForLineItems,\n telemetryContent: this.telemetryContent,\n isQuantityLimitsFeatureEnabled: this.isQuantityLimitsFeatureEnabled,\n\n addToOrderTemplateDialogResources: this._generateAddToOrderTemplateDialogResources(resources),\n createOrderTemplateDialogResources: this._generateOrderTemplateNameDialogResources(resources),\n itemAddedToOrderTemplateDialogResources: this._generateItemAddedToOrderTemplateDialogResources(resources),\n duplicateItemsWhenAddingToOrderTemplateDialogResources: this._generateDuplicateItemsWhenAddingToOrderTemplateDialogResources(\n resources\n ),\n\n addToOrderTemplateButtonText: resources.addToOrderTemplateButtonText,\n addToOrderTemplateButtonTooltip: resources.addToOrderTemplateButtonTooltip,\n addToOrderTemplateMessage: resources.addToOrderTemplateMessage,\n addItemToOrderTemplateError: resources.addItemToOrderTemplateError,\n orderTemplates,\n customerInformation,\n productAvailability: this.props.data.productAvailabilites,\n isMultipleCatalogFeatureEnabledInHq: isMultipleCatalogsFeatureEnabled || false\n })\n : null;\n }\n\n /**\n * Gets the checkout URL.\n * @param isAuthenticated - Is authenticated flag.\n * @param guestCheckoutUrl - Guest checkout URL.\n * @param signInUrl -The sign in URL.\n * @returns The checkout URL.\n */\n private getCheckoutURL(isAuthenticated: boolean, guestCheckoutUrl: string, signInUrl: string): string {\n if (isAuthenticated) {\n return guestCheckoutUrl;\n }\n\n const isAbsoluteUrl = urlCheck(guestCheckoutUrl);\n let returnURL = guestCheckoutUrl;\n if (MsDyn365.isBrowser && !isAbsoluteUrl) {\n returnURL = `${window.location.origin}${guestCheckoutUrl}`;\n }\n\n return `${signInUrl}${!signInUrl.includes('?') ? '?' : '&'}ru=${returnURL}`;\n }\n\n /**\n * Gets the image settings.\n * @param imageSettings - Image settings.\n * @returns IImageSettings.\n */\n private readonly getImageSettings = (imageSettings: IImageSettings | undefined): IImageSettings => {\n return (\n imageSettings || {\n viewports: {\n xs: { q: 'w=80&h=94&m=6', w: 0, h: 0 },\n sm: { q: 'w=148&h=174&m=6', w: 0, h: 0 },\n lg: { q: 'w=148&h=174&m=6', w: 0, h: 0 }\n },\n lazyload: true\n }\n );\n };\n\n /**\n * Remove item from cart handler.\n * @param cartlineToRemove - The cart line to remove.\n */\n private readonly removeItemFromCartHandler = (cartlineToRemove: CartLine) => {\n if (this.props.data.cart.result) {\n const input = {\n cartLineIds: [cartlineToRemove.LineId!.toString()]\n };\n this.props.data.cart.result\n .removeCartLines(input)\n .then(() => {\n this.validateCart().catch(error => {\n this.props.telemetry.warning(error);\n this.props.telemetry.debug('Unable to validate Cart');\n });\n })\n .catch(error => {\n this.props.telemetry.warning(error);\n this.props.telemetry.debug('Unable to Remove Cart Line');\n });\n }\n };\n\n /**\n * Move to wish list handler.\n * @param result - The wish list action success result.\n * @param cartline - The cart line.\n */\n private readonly moveToWishlistSuccessHandler = (result: IWishlistActionSuccessResult, cartline?: CartLine) => {\n if (result.status === 'ADDED' && cartline) {\n this.removeItemFromCartHandler(cartline);\n }\n };\n\n /**\n * Updates the cart line quantity.\n * @param cartlineToUpdate - The cart line.\n * @param quantity - The quantity.\n * @param lineIndex - The line index.\n * @returns True if the cart line was updated, false otherwise.\n */\n private readonly updateCartlineQuantity = (cartlineToUpdate: CartLine, quantity: number, lineIndex?: number): boolean => {\n cartLineQuantityUpdatedAsync(\n this.isQuantityLimitsFeatureEnabled,\n this.props.data.cart.result,\n this.props.telemetry,\n this.props.data.products.result,\n cartlineToUpdate,\n quantity\n )\n .then((cartActionResult: ICartActionResult | undefined): boolean => {\n if (cartActionResult?.status === 'SUCCESS') {\n this.validateCart().catch(error => {\n this.props.telemetry.warning((error as Error).message);\n this.props.telemetry.debug('Unable to validate Cart');\n });\n this.setState({\n cartlinesErrors: {}\n });\n return true;\n }\n\n if (!ObjectExtensions.isNullOrUndefined(cartActionResult)) {\n // Show update line error message.\n const lineUpdateFailure: LineValidationResult = {\n LineId: ObjectExtensions.isNullOrUndefined(cartlineToUpdate.LineId) ? '0' : cartlineToUpdate.LineId,\n ValidationFailures: [\n {\n ErrorContext: ArrayExtensions.hasElements(cartActionResult.validationResults)\n ? cartActionResult.validationResults[0].ErrorContext\n : '',\n LocalizedMessage: cartActionResult.errorDetails?.LocalizedMessage\n }\n ]\n };\n\n this.setState({\n cartlinesErrors: { ValidationResultsPairs: [lineUpdateFailure] }\n });\n }\n\n return false;\n })\n .catch(() => {\n return false;\n });\n\n return false;\n };\n\n /**\n * Fulfillment store id is updated.\n */\n private readonly fulfillmentStoreIdUpdated = () => {\n if (this.isQuantityLimitsFeatureEnabled) {\n // Refresh products (in props.data) based on latest cart.\n getActiveCartProductsAction(new ActiveCartProductsInput(), this.props.context.actionContext)\n .then(async () => this.validateCart())\n .catch((error: Error) => {\n this.props.telemetry.warning(error.message);\n this.props.telemetry.debug('Unable to validate Cart');\n });\n }\n };\n\n /**\n * Validates cart.\n * @returns Void promise.\n */\n private async validateCart(): Promise {\n if (!this.isQuantityLimitsFeatureEnabled) {\n this.setState({ cartlinesErrors: {}, isCartValid: true });\n return AsyncResult.resolve();\n }\n\n const {\n data: { cart },\n telemetry,\n context\n } = this.props;\n\n const validationResults: CartLineValidationResultsByLineId | undefined = await validateCartAsync(cart, telemetry, context, true);\n\n if (validationResults) {\n const isValid = !ArrayExtensions.hasElements(validationResults.ValidationResultsPairs);\n this.setState({\n cartlinesErrors: validationResults,\n isCartValid: isValid\n });\n } else {\n this.setState({ cartlinesErrors: {}, isCartValid: true });\n }\n\n return AsyncResult.resolve();\n }\n\n /**\n * Get order quantity limit feature flag.\n * @returns True if flag is enabled, false otherwise.\n */\n private async getOrderQuantityLimitsFeatureFlag(): Promise {\n const featureStatuses = await this.props.data.featureState;\n\n try {\n const isQuantityLimitsFeatureEnabledInHq =\n featureStatuses.find(\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailDefaultOrderQuantityLimitsFeature'\n )?.IsEnabled || false;\n if (!isQuantityLimitsFeatureEnabledInHq) {\n return false;\n }\n } catch (error) {\n this.props.telemetry.warning(error);\n this.props.telemetry.debug('Unable to get feature states');\n return false;\n }\n\n const useSiteBuilderSettings = featureStatuses?.find(\n featureState => featureState.Name === 'RevertToSiteBuilderOrderQuantityLimitsSettings'\n )?.IsEnabled;\n\n if (useSiteBuilderSettings) {\n const defaultOrderQuantityLimitsFeatureConfig = this.props.context?.request?.app?.platform?.enableDefaultOrderQuantityLimits;\n if (defaultOrderQuantityLimitsFeatureConfig === 'none') {\n return false;\n }\n\n if (defaultOrderQuantityLimitsFeatureConfig === 'all') {\n return true;\n }\n\n try {\n const customerInfo = await this.props.data.customerInformation;\n return (\n !!customerInfo &&\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b))\n );\n } catch (error) {\n this.props.telemetry.warning(error);\n this.props.telemetry.debug('Unable to get customer info');\n return false;\n }\n } else {\n const cartConfiguration = await this.props.data.cartConfiguration;\n return !(cartConfiguration?.IgnoreOrderSettings ?? false);\n }\n }\n\n private async _isChannelLimitsFeatureEnabled(): Promise {\n const featureStatuses = await this.props.data.featureState;\n\n const isChannelLimitsFeatureEnabledInHq = featureStatuses?.find(\n featureState => featureState.Name === 'Dynamics.AX.Application.EcommerceQuantityLimitConfigurationsFeature'\n )?.IsEnabled;\n\n return isChannelLimitsFeatureEnabledInHq ?? false;\n }\n\n /**\n * Gets the cart lines group.\n * @returns ICartlinesViewProps [][].\n */\n private getCartLinesGroup(): ICartlinesViewProps[][] | null {\n const {\n data: {\n cart: { result: cart },\n wishlists: { result: wishlists },\n orderTemplates: { result: orderTemplates },\n customerInformation: { result: customerInformation }\n },\n context: {\n request: { channel: { PickupDeliveryModeCode } = { PickupDeliveryModeCode: undefined } }\n },\n config,\n telemetry,\n resources,\n modules\n } = this.props;\n\n const imageSettings = this.getImageSettings(config.imageSettings);\n const cartlinesErrors: CartLineValidationResultsByLineId = this.state.cartlinesErrors;\n let storeSelectorId: string = '';\n if (modules && Object.keys(modules).length > 0 && modules.storeSelector && modules.storeSelector.length > 0) {\n storeSelectorId = modules.storeSelector[0].id;\n }\n\n const RetailMultiplePickupFeatureState = this.props.data.featureState.result?.find(\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature'\n );\n const multiplePickUpEnabled = RetailMultiplePickupFeatureState?.IsEnabled;\n const { featureState } = this.props.data;\n const channelMultipleCatalogsFeature = 'Dynamics.AX.Application.ChannelMultipleCatalogsFeature';\n const isMultipleCatalogsFeatureEnabled =\n featureState.result?.find((item: FeatureState) => item.Name === channelMultipleCatalogsFeature)?.IsEnabled || false;\n return this.props.data.products &&\n (cart?.hasInvoiceLine || this.props.data.products.result) &&\n cart &&\n cart.cart.CartLines &&\n cart.cart.CartLines.length > 0 &&\n this.props.data.channelDeliveryOptionConfig?.result\n ? CartLineGroupItems({\n cartlines: cart.cart.CartLines,\n storeSelectorModuleId: storeSelectorId,\n cartlinesErrors,\n products: this.props.data.products.result,\n productAvailabilites: this.props.data.productAvailabilites.result,\n productDeliveryOptions: this.props.data.deliveryOptions.result,\n catalogs: this.props.data.catalogs?.result,\n imageSettings,\n isStockCheckEnabled: this.props.context.app.config.enableStockCheck || false,\n hasInvoiceLine: cart?.hasInvoiceLine || false,\n maxCartlineQuantity: updateMaxQuantityForCartLineItem(this.props.context.app.config.maxQuantityForCartLineItem),\n gridSettings: this.props.context.request.gridSettings!,\n context: this.props.context,\n retailMulitplePickupFeatureState: multiplePickUpEnabled,\n typeName: this.props.typeName,\n id: this.props.id,\n resources: {\n sizeString: resources.productDimensionTypeSize,\n colorString: resources.productDimensionTypeColor,\n configString: resources.productDimensionTypeConfiguration,\n styleString: resources.productDimensionTypeStyle,\n amountString: resources.productDimensionTypeAmount,\n quantityDisplayString: resources.quantityDisplayText,\n inputQuantityAriaLabel: resources.inputQuantityAriaLabel,\n decrementButtonAriaLabel: resources.decrementButtonAriaLabel,\n incrementButtonAriaLabel: resources.incrementButtonAriaLabel,\n discountStringText: resources.discountStringText,\n originalPriceText: resources.originalPriceText,\n currentPriceText: resources.currentPriceText,\n shippingChargesText: resources.shippingCharges,\n salesAgreementPricePrompt: resources.salesAgreementPricePrompt,\n priceEditorResources: {\n ...resources\n }\n },\n telemetry,\n addToWishlistButtonText: resources.addToWishlistButtonText,\n removeFromWishlistButtonText: resources.removeFromWishlistButtonText,\n removeButtonText: resources.removeCartButtonText,\n shipItText: resources.shipInsteadDisplayText,\n pickitUpText: resources.pickItUpDisplayText,\n changeStoreText: resources.changeStoreDisplayText,\n storeSelectorStateManager: this.props.data.storeSelectorStateManager.result,\n outOfStockText: resources.outOfStockErrorMessage,\n outOfRangeOneText: resources.errorMessageOutOfRangeOneLeft,\n outOfRangeFormatText: resources.errorMessageOutOfRangeFormat,\n cartState: this.props.data.cart.result,\n orgUnitLocations: this.props.data.orgUnitLocations.result,\n removeItemClickHandler: this.removeItemFromCartHandler,\n moveToWishlistSuccessHandler: this.moveToWishlistSuccessHandler,\n updateCartLinesQuantitySuccessHandler: this.updateCartlineQuantity,\n locationChangedHandler: this.fulfillmentStoreIdUpdated,\n wishlists,\n defaultWishlistName: resources.defaultWishlistName,\n pickupDeliveryModeCode: PickupDeliveryModeCode,\n includeErrors: config.showOutOfStockErrors,\n showShippingChargesForLineItems: config.showShippingChargesForLineItems,\n telemetryContent: this.telemetryContent,\n isQuantityLimitsFeatureEnabled: this.isQuantityLimitsFeatureEnabled,\n\n addToOrderTemplateDialogResources: this._generateAddToOrderTemplateDialogResources(resources),\n createOrderTemplateDialogResources: this._generateOrderTemplateNameDialogResources(resources),\n itemAddedToOrderTemplateDialogResources: this._generateItemAddedToOrderTemplateDialogResources(resources),\n duplicateItemsWhenAddingToOrderTemplateDialogResources: this._generateDuplicateItemsWhenAddingToOrderTemplateDialogResources(\n resources\n ),\n\n addToOrderTemplateButtonText: resources.addToOrderTemplateButtonText,\n addToOrderTemplateButtonTooltip: resources.addToOrderTemplateButtonTooltip,\n addToOrderTemplateMessage: resources.addToOrderTemplateMessage,\n addItemToOrderTemplateError: resources.addItemToOrderTemplateError,\n orderTemplates,\n customerInformation,\n channelDeliveryOptionConfig: this.props.data.channelDeliveryOptionConfig?.result,\n shouldIgnoreWarehouse: this.props.context.app.config.warehouseAggregation === 'multiple',\n productAvailability: this.props.data.productAvailabilites,\n productPickUpOptions: this.state.productPickUpOptions || this.props.data.cartLinesPickUpOptions?.result,\n isMultipleCatalogFeatureEnabledInHq: isMultipleCatalogsFeatureEnabled || false\n })\n : null;\n }\n}\n\nexport default Cart;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { CartPromotionLine } from '@msdyn365-commerce/retail-proxy';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { INodeProps, Modal, ModalBody, ModalFooter, ModalHeader } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\nexport interface ICartLineItemPromotion {\n id: string;\n showPromotionPopup: boolean;\n promotions: CartPromotionLine[] | undefined;\n resources: ICartLineItemPromotionResourceString;\n onSeeAllClick(event: React.MouseEvent): void;\n onCloseButtonClick(): void;\n}\n\nexport interface ICartLineItemViewProps {\n promotionMessageWrapper: INodeProps;\n promotionMessage: React.ReactNode;\n promotionSeeAllLink: React.ReactElement;\n promotionDialog: React.ReactNode;\n}\n\nexport interface ICartLineItemPromotionResourceString {\n promotionLinkText: string;\n promotionStringHeading: string;\n promotionPopupHeading: string;\n promotionCloseButtonAriaLabel: string;\n}\n\nexport const cartPromotions = (props: ICartLineItemPromotion): ICartLineItemViewProps | undefined => {\n const {\n id,\n showPromotionPopup,\n promotions,\n resources: { promotionLinkText, promotionPopupHeading },\n onCloseButtonClick,\n onSeeAllClick\n } = props;\n\n if (!ArrayExtensions.hasElements(promotions)) {\n return;\n }\n\n const titleId = `${id}_title`;\n const className = 'msc-cart__promotion';\n return {\n promotionMessageWrapper: {\n className: 'msc-cart__promotion'\n },\n promotionMessage: (\n <>\n \n {props.resources.promotionStringHeading}\n \n ),\n promotionSeeAllLink: (\n \n {` `}\n {promotionLinkText} {` `}\n \n ),\n promotionDialog: (\n \n \n
\n {promotionPopupHeading}\n
\n
\n \n
    \n {promotions.map(_promotion => {\n return (\n
  • \n {_promotion.Promotion?.OfferName} {` `}\n
  • \n );\n })}\n
\n
\n \n
\n )\n };\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IProductsDimensionsAvailabilities } from '@msdyn365-commerce/commerce-entities';\nimport { IPriceComponentResources, ProductComponent } from '@msdyn365-commerce/components';\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport { getCatalogId, getUrlSync, ICoreContext } from '@msdyn365-commerce/core';\nimport { ProductPrice, ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\nimport {\n ArrayExtensions,\n DimensionAvailabilitiesForProductSearchResultInput,\n DimensionTypes,\n DimensionSwatchDisplayTypes,\n getDimensionAvailabilitiesForProductSearchResultAction,\n getPriceForProductSearchResult,\n IDimensionsApp,\n ObjectExtensions,\n PriceForProductSearchResultInput,\n ProductPriceForSelectedProductsInput,\n validateCatalogId,\n getProductPriceForSelectedProducts\n} from '@msdyn365-commerce-modules/retail-actions';\nimport {\n Button,\n getTelemetryObject,\n IComponentNodeProps,\n IModuleProps,\n INodeProps,\n ISingleSlideCarouselProps,\n ITelemetryContent,\n NodeTag,\n SingleSlideCarousel\n} from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { IProductCollectionData } from './product-collection.data';\nimport { IProductCollectionProps, layout } from './product-collection.props.autogenerated';\n\nexport interface IProductCollectionViewProps extends IProductCollectionProps {\n heading?: React.ReactNode;\n ProductCollectionContainer: IModuleProps;\n SingleSlideCarouselComponentProps: INodeProps;\n GridComponentProps: INodeProps;\n products: IProductComponentViewProps[];\n isCarousel: boolean;\n productPrices?: ProductPrice[];\n seeAllButton?: React.ReactNode;\n}\n\nexport interface IProductComponentViewProps {\n ProductContainer: INodeProps;\n productComponent: React.ReactNode;\n}\nexport interface IProductComponentState {\n products: ProductSearchResult[];\n productPrices: ProductPrice[];\n productsDimensionAvailabilities?: IProductsDimensionsAvailabilities[][];\n}\n\n/**\n * ProductCollection component.\n */\nclass ProductCollection extends React.PureComponent, IProductComponentState> {\n private readonly telemetryContent: ITelemetryContent;\n\n private readonly productPrices: ProductPrice[];\n\n constructor(props: IProductCollectionProps) {\n super(props);\n this.productPrices = [];\n this.state = {\n products: this.props.config.productCollection.products || [],\n productPrices: this.productPrices || []\n };\n this.telemetryContent = getTelemetryObject(\n this.props.context.request.telemetryPageName!,\n this.props.friendlyName,\n this.props.telemetry\n );\n }\n\n public async componentDidMount(): Promise {\n if (this.props.config.enableAffiliationBasedPricing && this.props.context.actionContext.requestContext.user.isAuthenticated) {\n await this._getActivePrice();\n }\n }\n\n public render(): JSX.Element | null {\n const { heading, className, shouldDisplaySeeAllButton } = this.props.config;\n const { resources } = this.props;\n const recommendation = this.props.config.productCollection.recommendationListId;\n const discountIds = this.props.config.productCollection.discountIds;\n\n // Initialize state in case if the products were not found during initial module render\n // eslint-disable-next-line @typescript-eslint/no-floating-promises -- Initialize data if not there.\n this.initProductState(this.props.config.productCollection);\n\n const products = this.state.products;\n const productPrices = this.state.productPrices;\n\n const isCarousel = this.props.config.layout === layout.carousel;\n const headingLabel = heading ? heading.text : '';\n const headingComponent = heading && (\n \n );\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- product check for safety.\n const updatedProducts = products?.map((item: ProductSearchResult, index: number) => {\n const getProductData = this._getProduct(\n item,\n index,\n productPrices ? productPrices.find(p => p.ProductId === item.RecordId) : undefined\n );\n return !ObjectExtensions.isNullOrUndefined(getProductData) ? getProductData : undefined;\n });\n\n const productCollectionViewProps = {\n ...this.props,\n heading: headingComponent,\n SingleSlideCarouselComponentProps: {\n tag: SingleSlideCarousel,\n className: '',\n flipperPrevLabel: `${headingLabel} ${resources.flipperPrevious}`,\n flipperNextLabel: `${headingLabel} ${resources.flipperNext}`,\n parentId: this.props.id,\n telemetryContent: this.telemetryContent\n } as IComponentNodeProps,\n ProductCollectionContainer: {\n moduleProps: this.props,\n className: classnames('ms-product-collection', className)\n },\n GridComponentProps: {\n tag: 'ul' as NodeTag,\n className: 'ms-product-collection__items'\n },\n isCarousel,\n\n products:\n ArrayExtensions.hasElements(updatedProducts) &&\n updatedProducts.filter(item => {\n return item !== undefined;\n }),\n productPrices: this.productPrices,\n seeAllButton:\n (recommendation || discountIds) &&\n shouldDisplaySeeAllButton &&\n (ArrayExtensions.hasElements(updatedProducts) || this.props.config.productCollection.listType === 'promotional')\n ? this._getSeeAllButton(headingLabel, recommendation, discountIds)\n : undefined,\n resources: resources\n };\n return this.props.renderView(productCollectionViewProps) as React.ReactElement;\n }\n\n public handleHeadingChange = (event: Msdyn365.ContentEditableEvent) => (this.props.config.heading!.text = event.target.value);\n\n /**\n * Get products dimension availabilities.\n * @param products - Products.\n * @returns Promise.\n */\n private readonly _getProductsDimensionsAvailabilities = async (products: ProductSearchResult[]): Promise => {\n const context = this.props.context as ICoreContext;\n const dimensionsToDisplayOnProductCard = context.app.config.dimensionsInProductCard;\n const dimensionsToDisplayAsSwatch = context.app.config.dimensionsAsSwatchType;\n const validProducts = ArrayExtensions.validValues(products);\n if (\n ArrayExtensions.hasElements(validProducts) &&\n ArrayExtensions.hasElements(dimensionsToDisplayOnProductCard) &&\n !dimensionsToDisplayOnProductCard.includes(DimensionTypes.none) &&\n ArrayExtensions.hasElements(dimensionsToDisplayAsSwatch) &&\n !dimensionsToDisplayAsSwatch.includes(DimensionTypes.none)\n ) {\n const productsDimensionAvailabilities = await getDimensionAvailabilitiesForProductSearchResultAction(\n new DimensionAvailabilitiesForProductSearchResultInput(\n validProducts,\n this.props.context as ICoreContext,\n DimensionSwatchDisplayTypes.productCard\n ),\n this.props.context.actionContext\n );\n\n if (ArrayExtensions.hasElements(productsDimensionAvailabilities)) {\n this.setState({ productsDimensionAvailabilities });\n }\n }\n };\n\n /**\n * Helper method to initialize products state.\n * @param productCollection - List of products.\n */\n private readonly initProductState = async (productCollection: Msdyn365.IProductList) => {\n let products = this.state.products;\n let productPrices = this.state.productPrices;\n const productCollectionProducts = productCollection.products;\n if (!ArrayExtensions.hasElements(products) && ArrayExtensions.hasElements(productCollectionProducts)) {\n products = productCollectionProducts;\n this.setState({ products });\n } else if (\n ArrayExtensions.hasElements(products) &&\n ArrayExtensions.hasElements(productCollectionProducts) &&\n !ArrayExtensions.equals(products, productCollectionProducts)\n ) {\n products = productCollectionProducts;\n this.setState({ products });\n } else if (productCollectionProducts === undefined && ArrayExtensions.hasElements(this.state.products)) {\n products = [];\n this.setState({ products: products });\n }\n\n if (Msdyn365.msdyn365Commerce.isBrowser && !ArrayExtensions.hasElements(this.state.productsDimensionAvailabilities)) {\n await this._getProductsDimensionsAvailabilities(products);\n }\n\n if (this.props.config.productCollection.listType === 'promotional') {\n productPrices = await getProductPriceForSelectedProducts(\n new ProductPriceForSelectedProductsInput(products.filter(p => !p.IsMasterProduct).map(p => p.RecordId)),\n this.props.context.actionContext\n );\n\n this.setState({ productPrices: productPrices });\n }\n };\n\n private readonly _getProduct = (\n product: ProductSearchResult,\n index: number,\n productPrice?: ProductPrice\n ): IProductComponentViewProps | null => {\n if (!product || !product.Name) {\n this.props.telemetry.trace('[product-collection] Product or product name is null');\n return null;\n }\n const telemetryContent = getTelemetryObject(\n this.props.context.request.telemetryPageName!,\n this.props.friendlyName,\n this.props.telemetry\n );\n const { imageSettings, allowBackNavigation } = this.props.config;\n const resources = this.props.resources;\n const breaCrumbType = this.props.context.app.config.breadcrumbType;\n const allowBack = allowBackNavigation && (breaCrumbType === 'back' || breaCrumbType === 'categoryAndBack');\n const quickviewSlot =\n this.props.slots && this.props.slots.quickview && this.props.slots.quickview.length > 0 ? this.props.slots.quickview[0] : null;\n const productComparisonButtonSlot = ArrayExtensions.hasElements(this.props.slots.productComparisonButton)\n ? this.props.slots.productComparisonButton[0]\n : null;\n\n const reviewCount = 1;\n const reviewTotalRatings = Number(product.TotalRatings);\n const reviewCountAriaLabelValue =\n reviewTotalRatings > reviewCount ? resources.ratingCountAriaLabel : resources.ratingCountAriaLabelSingleUser;\n const isPriceMinMaxEnabled = this.props.data.featureState.result?.find(\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailSearchPriceRangeFeature'\n );\n const priceResources: IPriceComponentResources = {\n priceRangeSeparator: resources.priceRangeSeparator\n };\n return {\n ProductContainer: {\n tag: 'li' as NodeTag,\n className: 'ms-product-collection__item',\n role: 'listitem',\n key: index\n },\n productComponent: (\n \n ArrayExtensions.hasElements(dimensionAvailability) &&\n dimensionAvailability[0].masterProductId === (product.MasterProductId ?? product.RecordId)\n )}\n />\n )\n };\n };\n\n /**\n * Get the active price for products.\n */\n private readonly _getActivePrice = async (): Promise => {\n const productsList = this.state.products;\n const products = await getPriceForProductSearchResult(\n new PriceForProductSearchResultInput(productsList),\n this.props.context.actionContext\n );\n if (Msdyn365.msdyn365Commerce.isBrowser) {\n await this._getProductsDimensionsAvailabilities(products);\n }\n\n this.setState({ products });\n };\n\n /**\n * Get the see all button.\n * @param headingLabel - Heading label.\n * @param recommendation - Recommendation.\n * @param discountIds - Discount Ids.\n * @returns IProductComponentSeeAllViewProps - Product component see all view props.\n */\n private readonly _getSeeAllButton = (headingLabel: string, recommendation?: string, discountIds?: string[]): React.ReactNode => {\n if (!Msdyn365.msdyn365Commerce.isBrowser) {\n return null;\n }\n\n if (!recommendation && !discountIds) {\n return null;\n }\n\n const catalogId = getCatalogId(this.props.context.request);\n validateCatalogId(catalogId);\n const searchPageLink = getUrlSync('search', this.props.context.actionContext);\n if (!searchPageLink) {\n return null;\n }\n\n const url = new URL(searchPageLink, window.location.href);\n\n if (discountIds) {\n // see all button for promotion page\n url.searchParams.set('discountIds', discountIds.toString());\n url.searchParams.set('title', headingLabel);\n url.searchParams.set('catalogid', `${catalogId}`);\n } else if (recommendation) {\n // See all button for recommendation\n url.searchParams.set('recommendation', recommendation);\n url.searchParams.set('title', headingLabel);\n url.searchParams.set('catalogid', `${catalogId}`);\n }\n\n return (\n \n {this.props.resources.seeAllButtonText}\n \n );\n };\n}\n\nexport default ProductCollection;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Button, Collapse, ICollapseProps } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { IQuickOrderDrawerProps } from './quick-order-drawer-props';\n\nexport interface IQuickOrderDrawerState {\n isOpen: boolean;\n}\n\nexport type GlyphPlacement = 'start' | 'end';\n\n/**\n * Quick Order Drawer - This is a full width uncontrolled collapse where the button glyph changes\n * when the drawer is open and closed.\n */\n\nexport default class QuickOrderDrawer extends React.Component {\n public state: IQuickOrderDrawerState;\n\n private readonly drawerOpenGlyph: string;\n\n private readonly drawerCloseGlyph: string;\n\n private readonly drawerGlyphClass: string;\n\n private isManuallyToggled: boolean;\n\n constructor(props: IQuickOrderDrawerProps) {\n super(props);\n this._toggle = this._toggle.bind(this);\n this.isManuallyToggled = false;\n this.state = { isOpen: (props.collapseProps && props.collapseProps.isOpen) || false };\n this.drawerGlyphClass = classnames('drawer__glyph', this.props.toggleGlyphClassName ? this.props.toggleGlyphClassName : '');\n\n if (this.props.animateGlyph) {\n this.drawerOpenGlyph = classnames(\n this.drawerGlyphClass,\n this.props.openGlyph ? this.props.openGlyph : this.props.closeGlyph ? this.props.closeGlyph : ''\n );\n this.drawerCloseGlyph = this.drawerOpenGlyph;\n } else {\n this.drawerOpenGlyph = classnames(this.drawerGlyphClass, this.props.openGlyph ? this.props.openGlyph : '');\n this.drawerCloseGlyph = classnames(this.drawerGlyphClass, this.props.closeGlyph ? this.props.closeGlyph : '');\n }\n }\n\n public shouldComponentUpdate(nextProps: IQuickOrderDrawerProps, nextState: IQuickOrderDrawerState): boolean {\n if (this.state === nextState && this.props === nextProps) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element {\n const collapseProps = { ...this.props.collapseProps } as ICollapseProps;\n\n // If the drawer is manually toggled by pressing the button, then we use the internal state\n if (collapseProps.isOpen === undefined || this.isManuallyToggled) {\n collapseProps.isOpen = this.state.isOpen;\n } else {\n // eslint-disable-next-line react/no-direct-mutation-state\n this.state.isOpen = collapseProps.isOpen;\n }\n collapseProps.children = this.props.children;\n const drawerClass = classnames('drawer', this.props.className ? this.props.className : '');\n this.isManuallyToggled = false;\n return (\n
\n \n {this._generateDrawerButtonInnerMarkup(collapseProps.isOpen)}\n \n \n
\n );\n }\n\n private _generateDrawerButtonInnerMarkup(collapseState: boolean): JSX.Element {\n const drawerButtonTextClass = classnames(\n 'drawer__buttontext',\n this.props.toggleButtonClassName ? this.props.toggleButtonClassName : ''\n );\n return (\n <>\n

{this.props.moduleHeadingText}

\n \n {this.props.moduleDescriptionText}\n \n {this._generateGlyphMarkup('drawer__glyph__end', collapseState)}\n \n );\n }\n\n private _generateGlyphMarkup(location: string, collapseState: boolean): JSX.Element {\n let glyphClass = collapseState ? this.drawerOpenGlyph : this.drawerCloseGlyph;\n glyphClass = `${glyphClass} ${location}`;\n return ;\n }\n\n private _toggle(e: React.MouseEvent | React.KeyboardEvent): void {\n e.preventDefault();\n this.setState({ isOpen: !this.state.isOpen });\n this.isManuallyToggled = true;\n if (this.props.onToggle) {\n this.props.onToggle(this.state);\n }\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Alert, Button } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IQuickOrderState } from '../quick-order';\n\nexport interface IQuickOrderFormProps {\n disableAddtoCart: boolean | undefined;\n productTextInput: React.RefObject;\n quantityTextInput: React.RefObject;\n maxChars: number;\n maxQuantity?: number;\n ariaLabelQuantity: string;\n ariaLabelProduct: string;\n ariaLabelAddtoCart: string;\n addQuantityPlaceholderText: string;\n quickOrderState: IQuickOrderState;\n handleInputChange(query: string): void;\n handleQuantityChange(query: string): void;\n handleAddToCartClick(): Promise;\n}\n\nexport interface IQuickOrderFormViewProps {\n product: React.ReactNode;\n quantity: React.ReactNode;\n addToCartBtn: React.ReactNode;\n userMessage?: React.ReactNode;\n}\n\n/**\n * On Input Change functionality.\n * @param handleInputChange -Input change function.\n * @returns Input change value.\n */\nconst onInputChangeFunction = (handleInputChange: (query: string) => void) => (event: React.ChangeEvent) => {\n handleInputChange(event.target.value || '');\n};\n\n/**\n * On Quantity Change functionality.\n * @param handleQuantityChange -Quantity change function.\n * @returns Quantity change value.\n */\nconst onQuantityChangeFunction = (handleQuantityChange: (query: string) => void) => (event: React.ChangeEvent) => {\n handleQuantityChange(event.target.value || '');\n};\n\nexport const QuickOrderFormComponent = (props: IQuickOrderFormProps): IQuickOrderFormViewProps => {\n const {\n productTextInput,\n quantityTextInput,\n quickOrderState,\n maxChars,\n maxQuantity,\n disableAddtoCart,\n ariaLabelQuantity,\n ariaLabelProduct,\n ariaLabelAddtoCart,\n addQuantityPlaceholderText,\n handleQuantityChange,\n handleInputChange,\n handleAddToCartClick\n } = props;\n\n const onInputChange = onInputChangeFunction(handleInputChange);\n\n const onQuantityInputChange = onQuantityChangeFunction(handleQuantityChange);\n\n const productNode = (\n
\n

\n {ariaLabelProduct}\n

\n \n
\n );\n\n const quantityNode = (\n
\n

\n {ariaLabelQuantity}\n

\n \n
\n );\n\n const addtoCartNode = (\n
\n \n {ariaLabelAddtoCart}\n \n
\n );\n\n const userMessageNode =\n quickOrderState && quickOrderState.stateMessage ? (\n \n \n {quickOrderState.stateMessage.messageText}\n \n ) : (\n undefined\n );\n\n return {\n product: productNode,\n addToCartBtn: addtoCartNode,\n quantity: quantityNode,\n userMessage: userMessageNode\n };\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { CartLine, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { observable } from 'mobx';\n\n/**\n * Represents a product for quick order.\n */\nexport class QuickOrderProduct {\n @observable\n public isSelected: boolean;\n\n public readonly cartLine: CartLine;\n\n public readonly simpleProduct: SimpleProduct;\n\n public constructor(cartLine: CartLine, simpleProduct: SimpleProduct) {\n this.cartLine = cartLine;\n this.simpleProduct = simpleProduct;\n this.isSelected = false;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IComponent, IComponentProps, ICoreContext } from '@msdyn365-commerce/core';\nimport classnames from 'classnames';\nimport React from 'react';\n\n/**\n * Interface for quick order table header resources.\n */\nexport interface IQuickOrderTableHeaderResources {\n quickOrderProductNumberText: string;\n quickOrderProductText: string;\n quickOrderUnitPriceText: string;\n quickOrderUnitOfMeasureText: string;\n quickOrderQuantityText: string;\n quickOrderTotalText: string;\n quickOrderActionsText: string;\n}\n\n/**\n * Interface for quick order table props.\n */\nexport interface IQuickOrderTableHeaderProps extends IComponentProps {\n context: ICoreContext;\n className: string;\n\n isMobile: boolean;\n resources: IQuickOrderTableHeaderResources;\n}\n\n/**\n * Interface for quick order table header component.\n */\nexport interface IQuickOrderTableHeaderComponent extends IComponent {}\n\n/**\n * Get the quick order header cells for desktop.\n * @param props -- The quick order table header props.\n * @returns The list of cells for quick order header component in desktop version.\n */\nconst QuickOrderDesktopHeaderCellsComponent: React.FC = (props: IQuickOrderTableHeaderProps) => {\n const { resources } = props;\n const columnWithNumberClassName = `${props.className}__row__column-with-number`;\n return (\n <>\n \n \n \n {resources.quickOrderProductNumberText}\n {resources.quickOrderProductText}\n {resources.quickOrderUnitPriceText}\n {resources.quickOrderUnitOfMeasureText}\n {resources.quickOrderQuantityText}\n {resources.quickOrderTotalText}\n {resources.quickOrderActionsText}\n \n );\n};\n\n/**\n * Get the quick order header cells for mobile.\n * @param props -- The quick order table header props.\n * @returns The quick order header component in desktop version.\n */\nconst QuickOrderMobileHeaderCellsComponent: React.FC = (props: IQuickOrderTableHeaderProps) => {\n const { resources } = props;\n return (\n <>\n \n {resources.quickOrderProductNumberText}\n \n \n );\n};\n\n/**\n * Quick order table header component.\n * @param props - Configuration of the component.\n * @returns React node with the header.\n */\nexport const QuickOrderTableHeaderComponent: React.FC = (props: IQuickOrderTableHeaderProps) => {\n const rowClassName = `${props.className}__row`;\n\n let headerCells: JSX.Element;\n if (props.isMobile) {\n headerCells = ;\n } else {\n headerCells = ;\n }\n\n return (\n \n {headerCells}\n \n );\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IComponentProps, ICoreContext, IImageSettings, Image } from '@msdyn365-commerce/core';\nimport { CartLine, format, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { getFallbackImageUrl, getProductPageUrlSync, ObjectExtensions, StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { Button, IncrementalQuantity } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\n/**\n * Data required to render each quick order row.\n */\nexport interface IQuickOrderTableRowData {\n cartLine: CartLine;\n product: SimpleProduct;\n}\n\n/**\n * Resources for quick order table rows.\n */\nexport interface IQuickOrderTableRowResources {\n quickOrderQuantityMobileText: string;\n quickOrderProductDimensionsSeparator: string;\n quickOrderViewDetailsButtonText: string;\n quickOrderViewDetailsButtonAriaLabel: string;\n quickOrderRemoveItemButtonAriaLabel: string;\n quickOrderInputQuantityAriaLabel: string;\n quickOrderDecrementButtonAriaLabel: string;\n quickOrderIncrementButtonAriaLabel: string;\n}\n\n/**\n * Interface for quick order table props.\n */\nexport interface IQuickOrderTableRowProps extends IComponentProps {\n context: ICoreContext;\n className: string;\n\n imageSettings?: IImageSettings;\n isMobile: boolean;\n resources: IQuickOrderTableRowResources;\n}\n\n/**\n * The default image settings for quick order table row.\n */\nconst defaultImageSettings: IImageSettings = {\n viewports: {\n xs: { q: 'w=80&h=80&m=6', w: 0, h: 0 },\n lg: { q: 'w=147&h=147&m=6', w: 0, h: 0 }\n },\n lazyload: true,\n cropFocalRegion: true\n};\n\n/**\n * Renders product image for quick order row.\n * @param props - Quick order table row props.\n * @returns React element.\n */\nconst QuickOrderTableRowProductImageComponent: React.FC = (props: IQuickOrderTableRowProps) => {\n const fallbackImageUrl = getFallbackImageUrl(\n props.data.product.ItemId,\n props.context.actionContext.requestContext.apiSettings,\n props.context.request.app?.config?.OmniChannelMedia\n );\n\n const containerClassName = `${props.className}__product-image-container`;\n\n return (\n
\n \n
\n );\n};\n\n/**\n * Renders actions popup for the mobile view.\n * @param props - Configuration for popup.\n * @returns A react node with actions..\n */\nconst QuickOrderExtraActionsPopupComponent: React.FC = (props: IQuickOrderTableRowProps): JSX.Element | null => {\n const product: SimpleProduct = props.data.product;\n\n let productUrl = '';\n if (!StringExtensions.isNullOrWhitespace(product.Name) && !ObjectExtensions.isNullOrUndefined(product.RecordId)) {\n productUrl = getProductPageUrlSync(product.Name!, product.RecordId, props.context.actionContext);\n }\n\n if (StringExtensions.isNullOrWhitespace(productUrl)) {\n return null;\n }\n\n const className = `${props.className}__extra-actions-cell`;\n\n return (\n
\n
\n );\n};\n\n/**\n * Renders quick order table rows for desktop view.\n * @param props - Configuration for the rows.\n * @returns A react node with a list of quick order rows for desktop view.\n */\nexport const QuickOrderDesktopTableRowCellComponent: React.FC = (props: IQuickOrderTableRowProps) => {\n const product: SimpleProduct = props.data.product;\n const cartLine: CartLine = props.data.cartLine;\n const columnWithNumberClassName = `${props.className}__column-with-number`;\n\n let productUrl = '';\n if (!StringExtensions.isNullOrWhitespace(product.Name) && !ObjectExtensions.isNullOrUndefined(product.RecordId)) {\n productUrl = getProductPageUrlSync(product.Name!, product.RecordId, props.context.actionContext);\n }\n\n return (\n <>\n \n \n \n {product.ItemId}\n \n
\n \n {product.Name}\n \n \n {product.Dimensions?.map(dimension => dimension.DimensionValue?.Value)\n .filter(dimensionValue => !StringExtensions.isNullOrWhitespace(dimensionValue))\n .join(props.resources.quickOrderProductDimensionsSeparator)}\n \n
\n \n {cartLine.Price}\n {cartLine.UnitOfMeasureSymbol}\n \n \n \n {cartLine.TotalAmount}\n \n \n
\n );\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { PriceComponent } from '@msdyn365-commerce/components';\nimport { getRichTextHtml, IActionContext, IImageSettings, Image, ITelemetry } from '@msdyn365-commerce/core';\nimport { SearchSuggestion } from '@msdyn365-commerce/retail-proxy';\nimport { getProductPageUrlSync, ObjectExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport {\n getPayloadObject,\n getTelemetryAttributes,\n INodeProps,\n IPayLoad,\n ITelemetryContent,\n NodeTag\n} from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { ISearchData } from '../search.data';\nimport { ISearchProps } from '../search.props.autogenerated';\n\n/**\n * Search product suggest resources.\n */\nexport interface ISearchProductSuggestResources {\n freePriceText: string;\n}\n\nexport interface ISearchProductSuggestProps {\n searchProductSuggestClass: string;\n searchPageURL: string;\n searchQsp: string | undefined;\n hitPrefix: string;\n hitSuffix: string;\n autoSuggestProps: ISearchProps;\n searchText: string;\n suggestions: SearchSuggestion[] | undefined;\n telemetry: ITelemetry;\n moduleType: string;\n moduleId: string;\n telemetryContent?: ITelemetryContent;\n resources?: ISearchProductSuggestResources;\n}\n\nexport interface ISearchProductViewProps {\n title: React.ReactNode;\n items: ISearchProductItemViewProps[];\n}\n\nexport interface ISearchProductItemViewProps {\n text: React.ReactNode;\n thumbnail: React.ReactNode;\n price: React.ReactNode;\n LiProduct: INodeProps;\n AProduct: INodeProps;\n id: string | undefined;\n}\n\nlet payLoad: IPayLoad;\nlet telemetryContent: ITelemetryContent | undefined;\n\n/**\n * ProductSuggestionsComponent.\n * @param props\n */\nexport const ProductSuggestionsComponent = (props: ISearchProductSuggestProps): ISearchProductViewProps | undefined => {\n const {\n suggestions,\n hitSuffix,\n hitPrefix,\n autoSuggestProps: {\n context: { actionContext },\n resources: { productSuggestionHeading }\n },\n moduleType,\n moduleId\n } = props;\n const reactNodes: ISearchProductItemViewProps[] = [];\n telemetryContent = props.telemetryContent;\n payLoad = getPayloadObject('click', props.telemetryContent!, '');\n\n suggestions?.map(item => {\n reactNodes.push(_assembleNode(item, hitPrefix, hitSuffix, actionContext, props, moduleType, moduleId));\n });\n\n const titleNode = _renderTitle(productSuggestionHeading);\n\n return { title: titleNode, items: reactNodes };\n};\n\nconst _renderTitle = (productSuggestionHeading: string) => {\n const productAutoSuggestionHeading = productSuggestionHeading ? productSuggestionHeading : 'Go to products';\n\n return
  • {productAutoSuggestionHeading}
  • ;\n};\n\nconst _assembleNode = (\n item: SearchSuggestion,\n hitPrefix: string,\n hitSuffix: string,\n actionContext: IActionContext,\n props: ISearchProductSuggestProps,\n moduleType: string,\n moduleId: string\n): ISearchProductItemViewProps => {\n const altText =\n item.Value && item.Value.replace(new RegExp(`[${hitPrefix}]`, 'gi'), '').replace(new RegExp(`[${hitSuffix}]`, 'gi'), '');\n\n const price = item.Value3?.Value?.DecimalValue;\n return {\n text: _getHighlightedText(item.Value ? item.Value : '', hitPrefix, hitSuffix),\n thumbnail: _renderThumbnail(item, altText ? altText : '', props),\n price: !ObjectExtensions.isNullOrUndefined(price) && _renderPrice(price, price, moduleId, moduleType, props),\n LiProduct: _getLiWrapper(),\n AProduct: _getAWrapper(item, hitPrefix, hitSuffix, actionContext, props),\n id: item.Id\n };\n};\n\nconst _getLiWrapper = () => {\n return {\n className: 'msc-autoSuggest__productResults-item',\n tag: 'li' as NodeTag\n };\n};\n\nconst _getAWrapper = (\n item: SearchSuggestion,\n hitPrefix: string,\n hitSuffix: string,\n actionContext: IActionContext,\n props: ISearchProductSuggestProps\n) => {\n const {\n autoSuggestProps: { context }\n } = props;\n const ariaLabel =\n item.Value && item.Value.replace(new RegExp(`[${hitPrefix}]`, 'gi'), '').replace(new RegExp(`[${hitSuffix}]`, 'gi'), '');\n\n payLoad.contentAction.recid = item.Id;\n const attribute = getTelemetryAttributes(telemetryContent!, payLoad);\n const productPrice = context.cultureFormatter.formatCurrency(item.Value3!.Value!.DecimalValue!);\n\n return {\n className: 'msc-autoSuggest__productResults-item',\n tag: 'a' as NodeTag,\n 'aria-label': `${ariaLabel!} ${productPrice}`,\n href: _generateLink(item, hitPrefix, hitSuffix, actionContext),\n ...attribute\n };\n};\n\nconst _generateLink = (suggestion: SearchSuggestion, hitPrefix: string, hitSuffix: string, actionContext: IActionContext) => {\n const formattedLink = (suggestion.Value as string)\n .replace(new RegExp(`[${hitPrefix}]`, 'gi'), '')\n .replace(new RegExp(`[${hitSuffix}]`, 'gi'), '');\n return suggestion.Value && suggestion.Id\n ? getProductPageUrlSync(formattedLink, (suggestion.Id as unknown) as number, actionContext, undefined)\n : '';\n};\n\nconst _getHighlightedText = (suggestion: string, hitPrefix: string, hitSuffix: string): JSX.Element => {\n const formattedText = suggestion\n .replace(new RegExp(`[${hitPrefix}]`, 'gi'), '')\n .replace(new RegExp(`[${hitSuffix}]`, 'gi'), '');\n\n return (\n // eslint-disable-next-line react/no-danger\n \n );\n};\n\nconst _renderPrice = (\n adjustedPrice: number,\n basePrice: number,\n moduleId: string,\n moduleType: string,\n props: ISearchProductSuggestProps\n): JSX.Element | null => {\n const {\n autoSuggestProps: { context }\n } = props;\n\n return (\n \n );\n};\n\nconst _renderThumbnail = (suggestion: SearchSuggestion, altText: string, props: ISearchProductSuggestProps): JSX.Element | null => {\n const {\n autoSuggestProps: {\n context: {\n request: { gridSettings }\n },\n config: { imageSettings }\n }\n } = props;\n if (imageSettings) {\n imageSettings.cropFocalRegion = true;\n }\n\n if (!suggestion || !suggestion.ImageUrl) {\n props.telemetry.error('Search suggestion content is empty, module wont render.');\n return null;\n }\n\n const defaultImageSettings: IImageSettings = {\n viewports: {\n xs: { q: 'w=40&h=40&m=6', w: 0, h: 0 },\n lg: { q: 'w=40&h=40&m=6', w: 0, h: 0 },\n xl: { q: 'w=40&h=40&m=6', w: 0, h: 0 }\n },\n lazyload: true,\n cropFocalRegion: true\n };\n\n return (\n \n );\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Autosuggestions } from '@msdyn365-commerce/commerce-entities';\nimport MsDyn365, { getCatalogId, getUrlSync } from '@msdyn365-commerce/core';\nimport { ProductRefiner, ProductRefinerSource, ProductsDataActions } from '@msdyn365-commerce/retail-proxy';\nimport { ArrayExtensions, ObjectExtensions, Random, validateCatalogId } from '@msdyn365-commerce-modules/retail-actions';\nimport { createSearchStateInput } from '@msdyn365-commerce-modules/search-utilities';\nimport { getTelemetryObject, IModuleProps, INodeProps, ITelemetryContent, KeyCodes } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport { debounce } from 'lodash';\nimport { Spinner, SpinnerSize } from 'office-ui-fabric-react';\nimport * as React from 'react';\n\nimport getSearchSuggestionsAction, { AutoSuggestInput, SuggestionType } from './actions/get-auto-suggest-suggestions';\nimport {\n CategorySuggestionsComponent,\n FormComponent,\n ISearchCategoryViewProps,\n ISearchKeywordViewProps,\n ISearchProductViewProps,\n KeywordSuggestionsComponent,\n LabelComponent,\n ProductSuggestionsComponent\n} from './components';\nimport { ISearchData } from './search.data';\nimport { ISearchProps, ISuggestionTypeCriterionData, SuggestionTypeCriterionSuggestionType } from './search.props.autogenerated';\n\nexport interface ISearchState {\n isSearchFormExpanded: boolean;\n searchText: string;\n searchKeywordSuggestClass: string;\n searchProductSuggestClass: string;\n searchCategorySuggestClass: string;\n suggestions: Autosuggestions | undefined;\n searchRefiners?: ProductRefiner[] | undefined;\n autoSuggestAriaLabel: string;\n isInitialState: boolean;\n isLoadingAutoSuggest?: boolean;\n}\n\nexport interface ISearchViewProps extends ISearchProps {\n Search: IModuleProps;\n AutoSuggestAriaLabel: INodeProps;\n AutoSuggestAriaLabelText: string;\n searchText: string;\n AutoSuggest: INodeProps;\n KeywordSuggest: INodeProps;\n ProductSuggest: INodeProps;\n CategorySuggest: INodeProps;\n SearchForm: INodeProps;\n FormWrapper: INodeProps;\n UlKeyword: INodeProps;\n UlProduct: INodeProps;\n UlCategory: INodeProps;\n label: React.ReactNode;\n form: React.ReactNode;\n autosuggestKeyword?: ISearchKeywordViewProps;\n autosuggestProduct?: ISearchProductViewProps;\n autosuggestCategory?: ISearchCategoryViewProps;\n callbacks: {\n handleCancelSearchChange(): void;\n handleCancelSearchFocused?(): void;\n };\n isSearchFormExpanded: boolean;\n isLoadingAutoSuggest?: boolean;\n isLoadingNode?: React.ReactNode;\n}\n\n/**\n *\n * Search module.\n * @extends {React.Component, ISearchState>}\n */\nclass Search extends React.Component, ISearchState> {\n private readonly searchTextInput: React.RefObject;\n\n private readonly searchCollapsedLabel: React.RefObject;\n\n private readonly formReference: React.RefObject;\n\n private readonly maxChars: number;\n\n private readonly topResultsCount?: number;\n\n private readonly hitPrefix: string = '{';\n\n private readonly hitSuffix: string = '}';\n\n private readonly waitTime: number = 500;\n\n private readonly autoSuggestResultScreenReaderDiv: React.RefObject;\n\n private readonly autoSuggestResultDiv: React.RefObject;\n\n private readonly searchFormClass: string;\n\n private readonly searchLabelClass: string;\n\n private readonly telemetryContent: ITelemetryContent;\n\n private loadSuggestionsRequestId?: string;\n\n private inputSuggestionType: ISuggestionTypeCriterionData[];\n\n // @ts-expect-error\n private cancellabelDebounce: debounce;\n\n public constructor(props: ISearchProps) {\n super(props);\n this.searchTextInput = React.createRef();\n this.searchCollapsedLabel = React.createRef();\n this.autoSuggestResultScreenReaderDiv = React.createRef();\n this.autoSuggestResultDiv = React.createRef();\n this.formReference = React.createRef();\n this.state = {\n isSearchFormExpanded: false,\n searchText: '',\n searchKeywordSuggestClass: 'ms-search__autoSuggest__keyword',\n searchProductSuggestClass: 'ms-search__autoSuggest__product',\n searchCategorySuggestClass: 'ms-search__autoSuggest__category',\n suggestions: undefined,\n searchRefiners: undefined,\n autoSuggestAriaLabel: '',\n isInitialState: true,\n isLoadingAutoSuggest: false\n };\n this.maxChars =\n (this.props.context &&\n this.props.context.app &&\n this.props.context.app.config &&\n this.props.context.app.config.searchInputMaxLength) ||\n 50;\n\n this.inputSuggestionType = [];\n this.topResultsCount = this.props.config && this.props.config.topResultsCount ? this.props.config.topResultsCount : 5;\n this.searchFormClass = 'ms-search__form';\n this.searchLabelClass = 'ms-search__label';\n this.telemetryContent = getTelemetryObject(\n this.props.context.request.telemetryPageName!,\n this.props.friendlyName,\n this.props.telemetry\n );\n\n this._initSuggestionTypes();\n }\n\n public async componentDidMount(): Promise {\n document.body && document.body.addEventListener('mousedown', this._focusOutTarget);\n window && window.addEventListener('keyup', this._keyup);\n }\n\n public componentWillUnmount(): void {\n document.body && document.body.removeEventListener('mousedown', this._focusOutTarget, false);\n window && window.removeEventListener('keyup', this._keyup, false);\n }\n\n public componentDidUpdate(): void {\n const {\n config: { hideSearchLabel }\n } = this.props;\n const { isSearchFormExpanded, isInitialState } = this.state;\n\n if (!this.props.context.request.params.isEditor) {\n if (!hideSearchLabel && isSearchFormExpanded) {\n this.searchTextInput && this.searchTextInput.current && this.searchTextInput.current.focus();\n } else if (!isInitialState) {\n this.searchCollapsedLabel && this.searchCollapsedLabel.current && this.searchCollapsedLabel.current.focus();\n }\n }\n }\n\n public shouldComponentUpdate(nextProps: ISearchProps, nextState: ISearchState): boolean {\n if (this.state === nextState && this.props === nextProps) {\n return false;\n }\n return true;\n }\n\n // eslint-disable-next-line complexity -- ignore complexity.\n public render(): JSX.Element {\n const {\n context,\n resources: { searchtext, searchLabelArialLabel, cancelBtnAriaLabel, searchBtnAriaLabel, submitBtnAriaLabel },\n config: { hideSearchLabel, disableSubmitSearch, searchplaceholderText, shouldShowFullCategoryPath, className = '' }\n } = this.props;\n\n const {\n isSearchFormExpanded,\n searchText,\n searchKeywordSuggestClass,\n searchProductSuggestClass,\n searchCategorySuggestClass,\n suggestions,\n searchRefiners,\n isLoadingAutoSuggest\n } = this.state;\n\n const searchQsp = (context && context.app && context.app.config && context.app.config.searchQueryStringParameter) || 'q';\n const searchPageURL = getUrlSync('search', context && context.actionContext) || '';\n const searchURL = this._appendQueryParams(searchPageURL, searchText, searchQsp);\n const searchPlaceholder = searchplaceholderText && searchplaceholderText.length > 0 ? searchplaceholderText : 'Search in Fabrikam';\n\n const keywordSuggestions = suggestions?.AllSearchResults?.filter(\n suggestion => suggestion.SuggestionType === SuggestionType.Keyword || suggestion.SuggestionType === SuggestionType.None\n );\n const productSuggestions = suggestions?.AllSearchResults?.filter(\n suggestion => suggestion.SuggestionType === SuggestionType.Product\n );\n const categoryRefiners = searchRefiners?.find(refiner => {\n return refiner.SourceValue === ProductRefinerSource.Category;\n });\n const categorySuggestions = suggestions?.AllSearchResults?.filter(suggestion => {\n if (suggestion.SuggestionType !== SuggestionType.Category) {\n return false;\n }\n const refiner = categoryRefiners?.Values?.find(item => {\n return `${item.RefinerRecordId ?? 0}` === suggestion.Id;\n });\n\n return !ObjectExtensions.isNullOrUndefined(refiner);\n });\n\n const viewProps: ISearchViewProps = {\n ...(this.props as ISearchProps),\n\n Search: {\n moduleProps: this.props,\n className: `${classnames('ms-search', className)} ${disableSubmitSearch ? 'no-submit' : 'with-submit'}`\n },\n AutoSuggestAriaLabel: {\n tag: 'div',\n className: 'msc-autoSuggest__screen-reader',\n 'aria-live': 'assertive',\n ref: this.autoSuggestResultScreenReaderDiv\n },\n AutoSuggestAriaLabelText: this.state.autoSuggestAriaLabel,\n searchText: this.state.searchText,\n AutoSuggest: {\n ref: this.autoSuggestResultDiv,\n className: 'ms-search__autoSuggest'\n },\n KeywordSuggest: {\n className: searchKeywordSuggestClass\n },\n ProductSuggest: {\n className: searchProductSuggestClass\n },\n CategorySuggest: {\n className: searchCategorySuggestClass\n },\n SearchForm: {\n className: `${this.searchFormClass} ${isSearchFormExpanded ? 'bx-show' : 'bx-hide'}`\n },\n FormWrapper: {\n tag: 'form',\n ref: this.formReference,\n className: 'ms-search__searchForm',\n 'aria-label': 'Search',\n name: 'searchForm',\n role: 'search',\n action: searchURL,\n autoComplete: 'off',\n onSubmit: this._handleSubmit\n },\n UlKeyword: {\n tag: 'ul',\n className: classnames('msc-autoSuggest__keywordResults-items', className)\n },\n UlProduct: {\n tag: 'ul',\n className: classnames('msc-autoSuggest__productResults-items', className)\n },\n UlCategory: {\n tag: 'ul',\n className: classnames('msc-autoSuggest__categoryResults-items', className)\n },\n label: LabelComponent({\n isSearchFormExpanded,\n searchLabelClass: `${this.searchLabelClass} ${isSearchFormExpanded ? 'bx-hide' : 'bx-show'}`,\n searchtext,\n searchLabelArialLabel,\n searchCollapsedLabel: this.searchCollapsedLabel,\n hideSearchLabel,\n handleCancelSearchChange: this._handleCancelSearchChange,\n telemetryContent: this.telemetryContent\n }),\n form: FormComponent({\n ariaLabelCancel: cancelBtnAriaLabel,\n ariaLabelSearch: searchBtnAriaLabel,\n ariaLabelSubmit: submitBtnAriaLabel,\n hideSearchLabel,\n searchTextInput: this.searchTextInput,\n disableSubmitSearch,\n handleInputChange: this._handleInputChange,\n handleCancelSearchChange: this._handleCancelSearchChange,\n maxChars: this.maxChars,\n searchQsp,\n searchPlaceholder,\n query: searchText\n }),\n autosuggestKeyword:\n searchText &&\n searchText.length > 0 &&\n (isLoadingAutoSuggest || (keywordSuggestions && ArrayExtensions.hasElements(keywordSuggestions)))\n ? KeywordSuggestionsComponent({\n searchKeywordSuggestClass,\n searchPageURL,\n searchQsp,\n hitPrefix: this.hitPrefix,\n hitSuffix: this.hitSuffix,\n autoSuggestProps: this.props,\n searchText,\n suggestions: keywordSuggestions,\n telemetryContent: this.telemetryContent\n })\n : undefined,\n autosuggestProduct:\n searchText &&\n searchText.length > 0 &&\n (isLoadingAutoSuggest || (productSuggestions && ArrayExtensions.hasElements(productSuggestions)))\n ? ProductSuggestionsComponent({\n searchProductSuggestClass,\n searchPageURL,\n searchQsp,\n hitPrefix: this.hitPrefix,\n hitSuffix: this.hitSuffix,\n autoSuggestProps: this.props,\n searchText,\n suggestions: productSuggestions,\n telemetry: this.props.telemetry,\n moduleType: this.props.typeName,\n moduleId: this.props.id,\n telemetryContent: this.telemetryContent,\n resources: this.props.resources\n })\n : undefined,\n autosuggestCategory:\n searchText &&\n searchText.length > 0 &&\n (isLoadingAutoSuggest || (categorySuggestions && ArrayExtensions.hasElements(categorySuggestions)))\n ? CategorySuggestionsComponent({\n searchCategorySuggestClass,\n searchPageURL,\n searchQsp,\n hitPrefix: this.hitPrefix,\n hitSuffix: this.hitSuffix,\n autoSuggestProps: this.props,\n searchText,\n suggestions: categorySuggestions,\n searchRefiners,\n telemetryContent: this.telemetryContent,\n shouldShowFullPath: shouldShowFullCategoryPath\n })\n : undefined,\n callbacks: {\n handleCancelSearchChange: this._handleCancelSearchChange,\n handleCancelSearchFocused: this._handleCancelSearchFocused\n },\n isSearchFormExpanded: this.state.isSearchFormExpanded,\n isLoadingAutoSuggest,\n isLoadingNode: this._isLoadingNode()\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n private _initSuggestionTypes() {\n const suggestionTypes = this.props.config.suggestionTypeCriterion;\n\n const suggestions = ArrayExtensions.unique(ArrayExtensions.validValues(suggestionTypes));\n if (!ArrayExtensions.hasElements(suggestions)) {\n this.inputSuggestionType = [\n { SuggestionType: SuggestionTypeCriterionSuggestionType.keyword },\n { SuggestionType: SuggestionTypeCriterionSuggestionType.product },\n { SuggestionType: SuggestionTypeCriterionSuggestionType.scopedCategory }\n ];\n return;\n }\n\n const validSuggestions = suggestions.filter(suggestion => suggestion.SuggestionType);\n if (ArrayExtensions.hasElements(validSuggestions)) {\n this.inputSuggestionType = validSuggestions;\n return;\n }\n\n this.inputSuggestionType = [];\n }\n\n /**\n * Function to create the ReactNode for loading Autosuggest result.\n * @returns ReachNode for loading Autosuggest result.\n */\n private readonly _isLoadingNode = (): React.ReactNode => {\n const loadingText = this.props.resources.autoSuggestResultLoadingMessage;\n return ;\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private readonly _focusOutTarget = (e: any): void => {\n const { suggestions } = this.state;\n\n if (suggestions && suggestions.AllSearchResults && e.target.closest('.ms-search') === null) {\n this._clearAutoSuggestState();\n }\n };\n\n private readonly _keyup = (e: KeyboardEvent): void => {\n const { suggestions } = this.state;\n\n if (suggestions && suggestions.AllSearchResults && e.keyCode === KeyCodes.Escape) {\n this._clearAutoSuggestState();\n } else if (this.state.isSearchFormExpanded && e.keyCode === KeyCodes.Escape) {\n if (this.state.isSearchFormExpanded) {\n this.setState({ isSearchFormExpanded: false });\n }\n }\n\n if (\n !(\n (this.formReference.current && this.formReference.current.contains((e.target as unknown) as Node)) ||\n (this.autoSuggestResultDiv.current && this.autoSuggestResultDiv.current.contains((e.target as unknown) as Node))\n )\n ) {\n if (suggestions && suggestions.AllSearchResults) {\n this._clearAutoSuggestState();\n }\n\n if (this.state.isSearchFormExpanded) {\n this.setState({ isSearchFormExpanded: false });\n }\n }\n };\n\n private readonly _clearAutoSuggestState = (): void => {\n const {\n context: { actionContext },\n data: { searchState }\n } = this.props;\n\n if (this.searchTextInput.current && this.searchTextInput.current.value.length > 0) {\n searchState.searchText = '';\n searchState.defaultBasicSearchUrl = '';\n searchState.searchQueryStringParameter = '';\n actionContext ? actionContext.update(createSearchStateInput(searchState), searchState) : null;\n this.searchTextInput.current.value = '';\n }\n\n this.setState({ searchText: '', suggestions: undefined, searchRefiners: undefined });\n };\n\n private async _getSearchSuggestions(loadSuggestionsRequestId: string, query: string) {\n try {\n const searchSuggestions = await getSearchSuggestionsAction(\n new AutoSuggestInput(query, this.topResultsCount, this._getSuggestionType(), this.hitPrefix, this.hitSuffix),\n this.props.context.actionContext\n );\n if (loadSuggestionsRequestId !== this.loadSuggestionsRequestId) {\n return undefined;\n }\n return searchSuggestions;\n } catch (error) {\n if (loadSuggestionsRequestId !== this.loadSuggestionsRequestId) {\n return undefined;\n }\n this.setState({ suggestions: undefined, searchRefiners: undefined, autoSuggestAriaLabel: this._setAutoSuggestResultCount() });\n this.props.telemetry.exception(error);\n this.props.telemetry.debug('Unable to get auto suggest results');\n return undefined;\n }\n }\n\n private async _updateSearchRefiners(loadSuggestionsRequestId: string, query: string, suggestions: Autosuggestions | undefined) {\n try {\n const refiners = await this._getSearchRefiners(query);\n if (loadSuggestionsRequestId !== this.loadSuggestionsRequestId) {\n return;\n }\n this.setState({\n suggestions,\n searchRefiners: refiners,\n autoSuggestAriaLabel: this._setAutoSuggestResultCount(suggestions),\n isLoadingAutoSuggest: false\n });\n } catch (error) {\n if (loadSuggestionsRequestId !== this.loadSuggestionsRequestId) {\n return;\n }\n this.setState({ suggestions, searchRefiners: undefined, autoSuggestAriaLabel: this._setAutoSuggestResultCount(suggestions) });\n this.props.telemetry.exception(error);\n this.props.telemetry.debug('Unable to get refiners results');\n }\n }\n\n private _loadSuggestions(query: string) {\n this.cancellabelDebounce = debounce(async () => {\n this.setState({ isLoadingAutoSuggest: true });\n const loadSuggestionsRequestId = Random.Guid.generateGuid();\n this.loadSuggestionsRequestId = loadSuggestionsRequestId;\n const searchSuggestions = await this._getSearchSuggestions(loadSuggestionsRequestId, query);\n await this._updateSearchRefiners(loadSuggestionsRequestId, query, searchSuggestions);\n }, this.waitTime);\n\n setTimeout(() => {\n this.cancellabelDebounce();\n }, 0);\n }\n\n private readonly _handleInputChange = (query: string): void => {\n if (!query || query.length <= this.maxChars) {\n this.setState({ searchText: query });\n }\n\n if (this.cancellabelDebounce) {\n this.cancellabelDebounce.cancel();\n }\n\n const {\n context,\n data: { searchState }\n } = this.props;\n\n if (context) {\n if (query && query.length > 0) {\n if (query.length > this.maxChars) {\n return;\n }\n\n if (ArrayExtensions.hasElements(this.inputSuggestionType)) {\n this._loadSuggestions(query);\n }\n\n searchState.searchText = query;\n } else {\n this.setState({ suggestions: undefined, searchRefiners: undefined });\n searchState.searchText = '';\n }\n context.actionContext.update(createSearchStateInput(searchState), searchState);\n }\n };\n\n private _getSuggestionType(): string {\n const distinctSuggestionTypes: string[] = this.inputSuggestionType.map(\n suggestionTypeItem => suggestionTypeItem.SuggestionType!.charAt(0).toUpperCase() + suggestionTypeItem.SuggestionType!.slice(1)\n );\n return distinctSuggestionTypes.join(',');\n }\n\n private async _getSearchRefiners(searchText: string): Promise {\n const { actionContext: ctx } = this.props.context;\n const catalogId = getCatalogId(ctx.requestContext);\n validateCatalogId(catalogId);\n return ProductsDataActions.getProductSearchRefinersAsync(\n { callerContext: ctx },\n {\n SearchCondition: searchText,\n Context: {\n ChannelId: +ctx.requestContext.apiSettings.channelId,\n CatalogId: catalogId\n }\n }\n );\n }\n\n private readonly _handleSubmit = (\n e: React.MouseEvent | React.KeyboardEvent | React.FormEvent\n ): void => {\n const {\n config: { disableSubmitSearch },\n context: {\n actionContext,\n app: {\n config: { searchQueryStringParameter }\n }\n }\n } = this.props;\n\n const query = this.searchTextInput.current && this.searchTextInput.current.value;\n e.preventDefault();\n\n if (!query || (query && query.length === 0) || disableSubmitSearch) {\n this.searchTextInput && this.searchTextInput.current && this.searchTextInput.current.focus();\n } else {\n const searchQsp = searchQueryStringParameter || 'q';\n const searchURL = this._appendQueryParams(getUrlSync('search', actionContext) || '', query, searchQsp);\n document.location.href = searchURL;\n }\n };\n\n private readonly _handleCancelSearchChange = (): void => {\n const { isSearchFormExpanded, suggestions } = this.state;\n\n if (!isSearchFormExpanded) {\n this.setState({\n isSearchFormExpanded: true,\n searchText: '',\n isInitialState: false\n });\n } else {\n if (suggestions && suggestions.AllSearchResults) {\n this._clearAutoSuggestState();\n }\n this.setState({ isSearchFormExpanded: false });\n }\n };\n\n private readonly _handleCancelSearchFocused = (): void => {\n const { suggestions } = this.state;\n if (!(suggestions && suggestions.AllSearchResults)) {\n this._clearAutoSuggestState();\n this.setState({ isSearchFormExpanded: false });\n }\n };\n\n private readonly _appendQueryParams = (route: string, query: string, qsp: string): string => {\n if (!MsDyn365.isBrowser) {\n return '';\n }\n\n const queryUrl = new URL(route, window.location.href);\n if (qsp && query) {\n queryUrl.searchParams.set(qsp, query);\n }\n\n return queryUrl.href;\n };\n\n private readonly _setAutoSuggestResultCount = (result?: Autosuggestions) => {\n if (this.autoSuggestResultScreenReaderDiv.current !== null) {\n const ariaLiveRegion = this.autoSuggestResultScreenReaderDiv.current;\n const suggestResultString = this.props.resources.autoSuggestFoundMessage;\n const emptyResultString = this.props.resources.noAutoSuggestionMessage;\n ariaLiveRegion.innerText =\n result && result.AllSearchResults && result.AllSearchResults.length > 0 ? suggestResultString : emptyResultString;\n ariaLiveRegion.setAttribute('aria-live', 'assertive');\n return ariaLiveRegion.innerText;\n }\n return '';\n };\n}\n\nexport default Search;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { SocialMedia, SocialMediaComponent } from '@msdyn365-commerce/components';\nimport MsDyn365 from '@msdyn365-commerce/core';\nimport { IModuleProps } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { ISocialShareItemConfig, ISocialShareItemProps, socialMedia } from './social-share-item.props.autogenerated';\n\nexport interface ISocialShareItemViewProps extends ISocialShareItemProps {\n SocialShareItemElement: React.ReactNode | null;\n SocialShareItem: IModuleProps;\n}\n\n/**\n *\n * SocialShareItem component.\n * @extends {React.PureComponent>}\n */\nclass SocialShareItem extends React.PureComponent> {\n constructor(props: ISocialShareItemProps) {\n super(props);\n\n this._getSocialShareItem = this._getSocialShareItem.bind(this);\n }\n\n public render(): JSX.Element | null {\n const viewprops = {\n ...this.props,\n SocialShareItem: {\n moduleProps: this.props,\n className: 'ms-social-share-item'\n },\n SocialShareItemElement: this._getSocialShareItem()\n };\n\n return this.props.renderView(viewprops) as React.ReactElement;\n }\n\n private _getSocialShareItem(): React.ReactNode | null {\n const src = this.props.config.icon;\n if (MsDyn365.isBrowser) {\n switch (this.props.config.socialMedia) {\n case socialMedia.facebook:\n return (\n \n );\n case socialMedia.twitter:\n return (\n \n );\n case socialMedia.pinterest:\n return (\n \n );\n case socialMedia.linkedin:\n return (\n \n );\n case socialMedia.mail:\n return (\n \n );\n default:\n return null;\n }\n }\n return null;\n }\n}\n\nexport default SocialShareItem;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport { INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IAdditionalContentData, ILinksData } from '../video-player.props.autogenerated';\n\n/**\n * IVideoPlayerAdditionalContentProps: Interface for\n * Video Player Additional Content Component props.\n */\nexport interface IVideoPlayerAdditionalContentProps {\n requestContext: Msdyn365.IRequestContext;\n additionalContent: IAdditionalContentData | undefined;\n handleAdditionalTextChange(event: Msdyn365.ContentEditableEvent): void;\n handleAdditionalParagraphChange(event: Msdyn365.ContentEditableEvent): void;\n handleAdditionalLinkTextChange(linkIndex: number, event: Msdyn365.ContentEditableEvent): void;\n}\n\n/**\n * IVideoPlayerAdditionalContentProps: Interface for\n * Video Player Additional Content view props.\n */\nexport interface IVideoPlayerAdditionalContentViewProps {\n additionalContentNode: INodeProps;\n additionalContentItems?: IVideoPlayerAdditionalContentItemViewProps;\n}\n\n/**\n * IVideoPlayerAdditionalContentProps: Interface for\n * Video Player Additional Content Item view props.\n */\nexport interface IVideoPlayerAdditionalContentItemViewProps {\n heading: React.ReactNode;\n text: React.ReactNode;\n links: React.ReactNode;\n additionalContentItemContainer: INodeProps;\n additionalContentItemLinks: INodeProps;\n}\n\n/**\n * Renders additional content heading.\n * @param additionalContentHeading - Additional content heading.\n * @param props - Video Player Additional content component props.\n * @returns Heading Node.\n */\nconst renderHeading = (additionalContentHeading: string, props: IVideoPlayerAdditionalContentProps) => {\n const requestContext = props.requestContext;\n return (\n {\n props.handleAdditionalTextChange(event);\n },\n requestContext\n }}\n />\n );\n};\n\n/**\n * Renders additional content heading.\n * @param additionalContentParagraphText - Additional content paragraph text.\n * @param props - Video Player Additional content component props.\n * @returns Paragraph Node.\n */\nconst renderParagraph = (additionalContentParagraphText: string, props: IVideoPlayerAdditionalContentProps) => {\n const requestContext = props.requestContext;\n return (\n {\n props.handleAdditionalParagraphChange(event);\n },\n requestContext\n }}\n />\n );\n};\n\n/**\n * Renders additional content heading.\n * @param ctaLink - Additional content link.\n * @param props - Video Player Additional content component props.\n * @param linkIndex - Additional content link index.\n * @returns Link Node.\n */\nconst renderLinks = (ctaLink: ILinksData, props: IVideoPlayerAdditionalContentProps, linkIndex: number) => {\n const editableLink: Msdyn365.ILinksData = {\n ariaLabel: ctaLink.ariaLabel,\n className: 'ms-video-player__details__additional-content__cta__links',\n linkText: ctaLink.linkText,\n linkUrl: ctaLink.linkUrl.destinationUrl,\n openInNewTab: ctaLink.openInNewTab,\n role: 'link'\n };\n const requestContext = props.requestContext;\n return (\n {\n props.handleAdditionalLinkTextChange(linkIndex, event);\n },\n requestContext\n }}\n />\n );\n};\n\n/**\n * Create node for each additonal content item.\n * @param item - Video Player additonal content item props.\n * @param props - Video Player Additional content component props.\n * @returns IVideoPlayerAdditionalContentItemViewProps.\n */\nconst getAdditionalContentItems = (\n item: IAdditionalContentData,\n props: IVideoPlayerAdditionalContentProps\n): IVideoPlayerAdditionalContentItemViewProps => {\n const headingNode = item.heading && renderHeading(item.heading, props);\n const paragraphNode = item.subtext && renderParagraph(item.subtext, props);\n const linksNode = item.links?.map((ctaLink: ILinksData, index: number) => {\n return renderLinks(ctaLink, props, index);\n });\n\n return {\n heading: headingNode,\n text: paragraphNode,\n links: linksNode,\n additionalContentItemContainer: { className: 'ms-video-player__details__additional-content__container' },\n additionalContentItemLinks: { className: 'ms-video-player__details__additional-content__cta' }\n };\n};\n\n/**\n * VideoPlayerAdditionalContent component.\n * @param props - Video Player Additional content component props.\n * @returns Video Player Additional content view props.\n */\nexport const videoPlayerAdditionalContent = (\n props: IVideoPlayerAdditionalContentProps\n): IVideoPlayerAdditionalContentViewProps | undefined => {\n const { additionalContent } = props;\n if (!additionalContent) {\n return undefined;\n }\n\n const reactNodes: IVideoPlayerAdditionalContentItemViewProps = getAdditionalContentItems(additionalContent, props);\n return {\n additionalContentNode: { className: 'ms-video-player__details__additional-content' },\n additionalContentItems: reactNodes\n };\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IPlayerData, IPlayerOptions, IPlayerResources, IVideoMetadata, Player } from '@msdyn365-commerce/components';\nimport * as MsDyn365 from '@msdyn365-commerce/core';\nimport {\n getPayloadObject,\n getTelemetryAttributes,\n getTelemetryObject,\n INodeProps,\n isMobile,\n ITelemetryContent,\n VariantType\n} from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IVideoPlayerAdditionalContentViewProps, videoPlayerAdditionalContent } from './components/additional-content';\nimport { ILinksData, IVideoPlayerConfig, IVideoPlayerProps } from './video-player.props.autogenerated';\n\nexport interface IVideoPlayerViewProps extends IVideoPlayerProps<{}> {\n player: React.ReactNode;\n title?: React.ReactNode;\n text?: React.ReactNode;\n links?: React.ReactNode;\n detailsContainer?: INodeProps;\n detailsContainerCta?: INodeProps;\n additionalContent?: IVideoPlayerAdditionalContentViewProps;\n handleText?(): void;\n handleParagraph?(): void;\n handleAdditionalText?(): void;\n handleAdditionalParagraph?(): void;\n handleLink?(): void;\n handleAdditionalLink?(): void;\n}\n\n/**\n *\n * VideoPlayer component.\n * @extends {React.PureComponent>}\n */\nclass VideoPlayer extends React.PureComponent> {\n private readonly telemetryContent: ITelemetryContent;\n\n private readonly isMobileDevice: boolean;\n\n public constructor(props: IVideoPlayerProps) {\n super(props);\n this.isMobileDevice = isMobile({ variant: VariantType.Viewport, context: this.props.context.request }) === 'xs';\n this.telemetryContent = getTelemetryObject(\n this.props.context.request.telemetryPageName!,\n this.props.friendlyName,\n this.props.telemetry\n );\n }\n\n public render(): JSX.Element {\n const options = {\n ...this.props.config,\n isMobileDevice: this.isMobileDevice\n };\n const video: MsDyn365.IVideoData = this.props.config.video;\n const playerResources: IPlayerResources = {\n playAriaLabel: this.props.resources.playLabel,\n pauseAriaLabel: this.props.resources.pauseLabel,\n playingAriaLabel: this.props.resources.playingLabel,\n pausedAriaLabel: this.props.resources.pausedLabel,\n muteAriaLabel: this.props.resources.muteLabel,\n unMuteAriaLabel: this.props.resources.unMuteLabel,\n fullScreenAriaLabel: this.props.resources.fullScreenLabel,\n exitFullScreenAriaLabel: this.props.resources.exitFullScreenLabel,\n seekBarLabel: this.props.resources.seekBarLabel,\n videoTimeDurationLabel: this.props.resources.videoTimeDurationLabel,\n closedCaptionLabel: this.props.resources.closedCaptionLabel\n };\n const videoMetaData: IVideoMetadata = {};\n\n if (video) {\n videoMetaData.videoId = video.id;\n videoMetaData.title = video.title;\n videoMetaData.duration = video.playTime;\n\n if (video.thumbnail) {\n videoMetaData.posterframeUrl = video.thumbnail.src;\n }\n\n if (video._links?.binaryReferences) {\n videoMetaData.videoBinaryReferences = video._links.binaryReferences;\n }\n }\n const videoPlayerData: IPlayerData = { options: options as IPlayerOptions, metaData: videoMetaData };\n const viewProps = {\n // Context for telemetry and raw data for C1 to do customization\n // Including computed data, state data and methods\n ...this.props,\n\n player: (\n \n \n \n ),\n title: this._getVideoDetailsHeading(),\n text: this._getVideoDetailsParagraph(),\n links: this._getVideoDetailsLinks(),\n detailsContainer: { className: 'ms-video-player__details' },\n detailsContainerCTA: { className: 'ms-video-player__details__cta' },\n additionalContent: videoPlayerAdditionalContent({\n requestContext: this.props.context.request,\n additionalContent: this.props.config.additionalContent,\n handleAdditionalTextChange: this.handleAdditionalTextChange,\n handleAdditionalParagraphChange: this.handleAdditionalParagraphChange,\n handleAdditionalLinkTextChange: this.handleAdditionalLinkTextChange\n }),\n handleText: this.handleTextChange,\n handleParagraph: this.handleParagraphChange,\n handleAdditionalText: this.handleAdditionalTextChange,\n handleAdditionalParagraph: this.handleAdditionalParagraphChange,\n handleLink: this.handleLinkTextChange,\n handleAdditionalLink: this.handleAdditionalTextChange\n };\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n /**\n * Handle link text change.\n * @param linkIndex - The link index.\n * @param event - The dialog that is allowed to remain open.\n */\n public handleLinkTextChange(linkIndex: number, event: MsDyn365.ContentEditableEvent): void {\n if (this.props.config.links && this.props.config.links[Number(linkIndex)]) {\n this.props.config.links[Number(linkIndex)].linkText = event.target.value;\n }\n }\n\n /**\n * Handle text change.\n * @param event - The dialog that is allowed to remain open.\n */\n public handleTextChange = (event: MsDyn365.ContentEditableEvent): void => {\n this.props.config.heading!.text = event.target.value;\n };\n\n /**\n * Handle paragraph change.\n * @param event - The dialog that is allowed to remain open.\n */\n public handleParagraphChange = (event: MsDyn365.ContentEditableEvent): void => {\n this.props.config.paragraph = event.target.value;\n };\n\n /**\n * Handle additional text change.\n * @param event - The dialog that is allowed to remain open.\n */\n public handleAdditionalTextChange(event: MsDyn365.ContentEditableEvent): void {\n if (this.props.config.additionalContent) {\n this.props.config.additionalContent.heading = event.target.value;\n }\n }\n\n /**\n * Handle additional link text change.\n * @param linkIndex - The link index.\n * @param event - The dialog that is allowed to remain open.\n */\n public handleAdditionalLinkTextChange(linkIndex: number, event: MsDyn365.ContentEditableEvent): void {\n const additionalContent = this.props.config.additionalContent ?? {};\n if (additionalContent.links) {\n additionalContent.links[Number(linkIndex)].linkText = event.target.value;\n }\n }\n\n /**\n * Handle additional paragraph change.\n * @param event - The dialog that is allowed to remain open.\n */\n public handleAdditionalParagraphChange(event: MsDyn365.ContentEditableEvent): void {\n if (this.props.config.additionalContent) {\n this.props.config.additionalContent.subtext = event.target.value;\n }\n }\n\n /**\n * Get video details links.\n * @returns - React node.\n */\n private _getVideoDetailsLinks(): React.ReactNode[] | undefined {\n const { links } = this.props.config;\n const payLoad = getPayloadObject('click', this.telemetryContent, '');\n\n return links?.map((linkData: ILinksData, index: number) => {\n payLoad.contentAction.etext = linkData.linkText;\n const attributes = getTelemetryAttributes(this.telemetryContent, payLoad);\n const linkId = index;\n const editableLink: MsDyn365.ILinksData = {\n ariaLabel: linkData.ariaLabel,\n className: 'ms-video-player__details__cta__link',\n linkText: linkData.linkText,\n linkUrl: linkData.linkUrl.destinationUrl,\n openInNewTab: linkData.openInNewTab,\n role: 'button',\n additionalProperties: attributes\n };\n\n return (\n {\n this.handleLinkTextChange(index, event);\n },\n requestContext: this.props.context.request\n }}\n />\n );\n });\n }\n\n private _getVideoDetailsHeading(): React.ReactNode | undefined {\n const { heading } = this.props.config;\n\n return (\n heading && (\n \n )\n );\n }\n\n private _getVideoDetailsParagraph(): React.ReactNode | undefined {\n const { paragraph } = this.props.config;\n\n return (\n paragraph && (\n \n )\n );\n }\n}\n\nexport default VideoPlayer;\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { ITelemetry } from '@msdyn365-commerce/core';\r\nimport { AttributeDataType, ProductRefinerValue, RefinerType } from '@msdyn365-commerce/retail-proxy';\r\n\r\nimport { IRefineItemToggleNotification } from './refine-item-toggle-notification';\r\n\r\n/**\r\n * Types of product refiner values.\r\n * @deprecated This will be removed soon. Please, use `AttributeDataType` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { AttributeDataType } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\nexport enum ProductRefinerValueDataTypeValue {\r\n /**\r\n * Range slider is used for selections like price.\r\n * @deprecated This will be removed soon. Please, use `AttributeDataType` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { AttributeDataType } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\n Range = 1,\r\n\r\n /**\r\n * Range input is a different way to specify ranges and can be expressed with input boxes\r\n * as well as a set of discrete single-select type values.\r\n * @deprecated This will be removed soon. Please, use `AttributeDataType` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { AttributeDataType } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\n RangeInput = 4,\r\n\r\n /**\r\n * This is a discrete list item, either multi-select or single-select.\r\n * @deprecated This will be removed soon. Please, use `AttributeDataType` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { AttributeDataType } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\n List = 5,\r\n\r\n /**\r\n * Boolean types allows only single-select.\r\n * @deprecated This will be removed soon. Please, use `AttributeDataType` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { AttributeDataType } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\n Boolean = 6\r\n}\r\n\r\n/**\r\n * Types of product refiners.\r\n * @deprecated This will be removed soon. Please, use `RefinerType` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { RefinerType } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\nexport enum ProductRefinerTypeValue {\r\n /**\r\n * Refiner values are single-select.\r\n * @deprecated This will be removed soon. Please, use `RefinerType` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { RefinerType } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\n Single = 0,\r\n\r\n /**\r\n * Refiner values are multi-select.\r\n * @deprecated This will be removed soon. Please, use `RefinerType` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { RefinerType } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\n Multi = 1\r\n}\r\n\r\n/**\r\n * ProductRefinerSource enum type.\r\n * @deprecated This will be removed soon. Please, use `ProductRefinerSource` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { ProductRefinerSource } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\nexport enum ProductRefinerSource {\r\n /**\r\n * The None member.\r\n * @deprecated This will be removed soon. Please, use `ProductRefinerSource` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { ProductRefinerSource } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\n None = 0,\r\n\r\n /**\r\n * The Attribute member.\r\n * @deprecated This will be removed soon. Please, use `ProductRefinerSource` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { ProductRefinerSource } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\n Attribute = 1,\r\n\r\n /**\r\n * The Category member.\r\n * @deprecated This will be removed soon. Please, use `ProductRefinerSource` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { ProductRefinerSource } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\n Category = 2,\r\n\r\n /**\r\n * The Price member.\r\n * @deprecated This will be removed soon. Please, use `ProductRefinerSource` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { ProductRefinerSource } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\n Price = 3,\r\n\r\n /**\r\n * The Rating member.\r\n * @deprecated This will be removed soon. Please, use `ProductRefinerSource` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { ProductRefinerSource } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\n Rating = 4\r\n}\r\n\r\n/**\r\n * Checks if the data type value corresponds to a slider.\r\n * @param dataTypeValue\r\n */\r\nexport function isRangeType(dataTypeValue: number | undefined): boolean {\r\n return (\r\n dataTypeValue === AttributeDataType.Currency ||\r\n dataTypeValue === AttributeDataType.Decimal ||\r\n dataTypeValue === AttributeDataType.Integer\r\n );\r\n}\r\n\r\n/**\r\n * Find the refinement criterion associated with this product refiner value.\r\n * @param productRefinerValue Product refiner value to match.\r\n * @param refinementCriteria Selected refinement criteria.\r\n */\r\nexport function findMatchingRefinementCriterion(\r\n productRefinerValue: ProductRefinerValue,\r\n refinementCriteria: ProductRefinerValue[]\r\n): ProductRefinerValue | undefined {\r\n // If the value is a range, then match only on data type value; otherwise match on item string\r\n return refinementCriteria.find((refinementCriterion: ProductRefinerValue) =>\r\n isMatchingRefinementCriterion(productRefinerValue, refinementCriterion)\r\n );\r\n}\r\n\r\n/**\r\n * Find the refinement criterion associated with this product refiner value.\r\n * @param productRefinerValue Product refiner value to match.\r\n * @param refinementCriteria Selected refinement criteria.\r\n * @param refinementCriterion\r\n */\r\nexport function isMatchingRefinementCriterion(productRefinerValue: ProductRefinerValue, refinementCriterion: ProductRefinerValue): boolean {\r\n // If the value is a range, then match only on data type value; otherwise match on item string\r\n return (\r\n refinementCriterion.RefinerRecordId === productRefinerValue.RefinerRecordId &&\r\n refinementCriterion.RefinerSourceValue === productRefinerValue.RefinerSourceValue &&\r\n refinementCriterion.DataTypeValue === productRefinerValue.DataTypeValue &&\r\n (isRangeType(refinementCriterion.DataTypeValue) ||\r\n refinementCriterion.LeftValueBoundString === productRefinerValue.LeftValueBoundString)\r\n );\r\n}\r\n\r\nexport function getUpdatedRefinementCriteria(\r\n itemToggleNotification: IRefineItemToggleNotification,\r\n currentRefinementCriteria: ProductRefinerValue[]\r\n): ProductRefinerValue[] {\r\n const updatedRefinementCriteria: ProductRefinerValue[] = [];\r\n let toggledItemFound = false;\r\n currentRefinementCriteria.forEach((selectedCriterion: ProductRefinerValue) => {\r\n if (isMatchingRefinementCriterion(itemToggleNotification.productRefinerValue, selectedCriterion)) {\r\n toggledItemFound = true;\r\n if (itemToggleNotification.isSelecting) {\r\n const next = {\r\n ...selectedCriterion,\r\n LeftValueBoundString:\r\n (itemToggleNotification.rangeStart !== undefined && `${itemToggleNotification.rangeStart}`) ||\r\n selectedCriterion.LeftValueBoundString,\r\n RightValueBoundString:\r\n (itemToggleNotification.rangeEnd !== undefined && `${itemToggleNotification.rangeEnd}`) ||\r\n selectedCriterion.RightValueBoundString\r\n };\r\n updatedRefinementCriteria.push(next);\r\n } // Else the item is being de-selected, so omit it from the refinement criteria\r\n } else {\r\n // Keep existing criterion because it is not in the item toggle notification\r\n updatedRefinementCriteria.push(selectedCriterion);\r\n }\r\n });\r\n\r\n if (!toggledItemFound) {\r\n const next = {\r\n ...itemToggleNotification.productRefinerValue,\r\n LeftValueBoundString:\r\n (itemToggleNotification.rangeStart !== undefined && `${itemToggleNotification.rangeStart}`) ||\r\n itemToggleNotification.productRefinerValue.LeftValueBoundString,\r\n RightValueBoundString:\r\n (itemToggleNotification.rangeEnd !== undefined && `${itemToggleNotification.rangeEnd}`) ||\r\n itemToggleNotification.productRefinerValue.RightValueBoundString\r\n };\r\n updatedRefinementCriteria.push(next);\r\n\r\n // If single select, then deselect any others in the parent refiner group\r\n if (\r\n (itemToggleNotification.productRefinerValue.DataTypeValue === AttributeDataType.Text ||\r\n itemToggleNotification.productRefinerValue.DataTypeValue === AttributeDataType.TrueFalse) &&\r\n itemToggleNotification.parentProductRefinerHierarchy.RefinerTypeValue === RefinerType.SingleSelect\r\n ) {\r\n itemToggleNotification.parentProductRefinerHierarchy.Values.forEach((child: ProductRefinerValue) => {\r\n if (child.RefinerRecordId === next.RefinerRecordId && child.LeftValueBoundString === next.LeftValueBoundString) {\r\n // Do nothing\r\n } else {\r\n const matchingIndex = updatedRefinementCriteria.findIndex((criterion: ProductRefinerValue) =>\r\n isMatchingRefinementCriterion(child, criterion)\r\n );\r\n if (matchingIndex > -1) {\r\n updatedRefinementCriteria.splice(matchingIndex, 1);\r\n }\r\n }\r\n });\r\n }\r\n }\r\n\r\n return updatedRefinementCriteria;\r\n}\r\n\r\nexport function formatPrice(\r\n amount: string | undefined,\r\n currency: string | undefined,\r\n locale: string | undefined,\r\n telemetry: ITelemetry\r\n): string {\r\n if (!amount || !currency) {\r\n telemetry.trace(`[refine-menu.utilities.formatPrice] could not format price for ${amount} ${currency}`);\r\n return amount || '';\r\n }\r\n const priceAmount = (amount && Number(amount)) || 0;\r\n let result: string;\r\n\r\n try {\r\n result = new Intl.NumberFormat(locale, {\r\n style: 'currency',\r\n currencyDisplay: 'symbol',\r\n currency,\r\n minimumFractionDigits: 0\r\n }).format(priceAmount);\r\n } catch (error) {\r\n result = `${priceAmount} ${currency}`;\r\n telemetry.warning(`[refine-menu.utilities.formatPrice] Failed to format price for ${result}: ${error}`);\r\n }\r\n\r\n return result;\r\n}\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\r\nimport { ProductRefinerValue } from '@msdyn365-commerce/retail-proxy';\r\nimport { getPayloadObject, getTelemetryAttributes, IPayLoad } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport { computed } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\n\r\nimport { ProductListInventoryFilteringOptions } from '../actions';\r\nimport { IChoiceSummaryProps } from './choice-summary.props';\r\nimport { isMatchingRefinementCriterion, isRangeType } from './utilities';\r\n\r\ninterface IRefinerMap {\r\n key: string;\r\n value: ProductRefinerValue;\r\n}\r\n\r\n/**\r\n * ChoiceSummary component.\r\n */\r\n@observer\r\nexport default class ChoiceSummary extends React.PureComponent {\r\n private readonly closeButtonGlyph: string = 'msi-close-btn';\r\n\r\n private readonly payLoad: IPayLoad;\r\n\r\n @computed get selectedRefinersMap(): IRefinerMap[] {\r\n let { selectedChoices } = this.props;\r\n const { channelInventoryConfigurationId, refinerHierarchy } = this.props;\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- app configs are of generic type\r\n if (this.props.context?.app.config.productListInventoryDisplay === ProductListInventoryFilteringOptions.HideOOS) {\r\n selectedChoices = selectedChoices.filter(choice => {\r\n const parent = refinerHierarchy.find(\r\n (hierarchy: IProductRefinerHierarchy) =>\r\n !!hierarchy.Values.find((value: ProductRefinerValue) => isMatchingRefinementCriterion(value, choice))\r\n );\r\n return parent && parent.RecordId !== channelInventoryConfigurationId;\r\n });\r\n }\r\n return selectedChoices.map((selectedRefiner: ProductRefinerValue) => {\r\n return {\r\n key: this._getKeyForRefinerValue(selectedRefiner),\r\n value: selectedRefiner\r\n } as IRefinerMap;\r\n });\r\n }\r\n\r\n constructor(props: Readonly) {\r\n super(props);\r\n this.payLoad = getPayloadObject('click', this.props.telemetryContent!, '');\r\n }\r\n\r\n public render(): JSX.Element {\r\n const { clearAllText, label, classNames, choiceAriaLabel, closeAriaLabel } = this.props;\r\n const items = this.selectedRefinersMap;\r\n this.payLoad.contentAction.etext = clearAllText;\r\n const clearAllAttributes = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\r\n return (\r\n
    \r\n {items.length > 0 && label && {label}}\r\n
      \r\n {items.map((item: IRefinerMap) => {\r\n this.payLoad.contentAction.etext = item.key;\r\n const attribute = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\r\n\r\n return (\r\n
    • \r\n \r\n {item.key}\r\n \r\n \r\n
    • \r\n );\r\n })}\r\n
    \r\n {items.length > 0 && clearAllText && (\r\n \r\n {clearAllText}\r\n \r\n )}\r\n
    \r\n );\r\n }\r\n\r\n private _getKeyForRefinerValue(productRefinerValue: ProductRefinerValue): string {\r\n const { choiceFormat, choiceRangeValueFormat, refinerHierarchy, telemetry } = this.props;\r\n const overallFormat = choiceFormat || '{1}';\r\n const rangeFormat = choiceRangeValueFormat;\r\n let refinerName = '';\r\n if (refinerHierarchy && refinerHierarchy.find) {\r\n const parent = refinerHierarchy.find(\r\n (hierarchy: IProductRefinerHierarchy) =>\r\n !!hierarchy.Values.find((value: ProductRefinerValue) => isMatchingRefinementCriterion(value, productRefinerValue))\r\n );\r\n\r\n if (!parent) {\r\n telemetry.warning('[choice-summary] could not find parent of selected refiner value');\r\n } else {\r\n refinerName = parent.KeyName || '';\r\n }\r\n }\r\n\r\n let refinerValueName: string;\r\n if (isRangeType(productRefinerValue.DataTypeValue)) {\r\n refinerValueName = rangeFormat\r\n .replace('{0}', this._formatPrice(productRefinerValue.LeftValueBoundString, productRefinerValue.UnitText))\r\n .replace('{1}', this._formatPrice(productRefinerValue.RightValueBoundString, productRefinerValue.UnitText));\r\n } else {\r\n refinerValueName = productRefinerValue.LeftValueBoundLocalizedString || productRefinerValue.LeftValueBoundString || '';\r\n }\r\n\r\n return overallFormat.replace('{0}', refinerName).replace('{1}', refinerValueName);\r\n }\r\n\r\n private _formatPrice(amount: string | undefined, currency: string | undefined): string {\r\n if (!amount || !currency) {\r\n this.props.telemetry.trace('[choice-summary] could not format price');\r\n return amount || '';\r\n }\r\n let result = amount;\r\n\r\n try {\r\n result = this.props.context!.cultureFormatter.formatCurrency(Number(amount), currency);\r\n } catch (error) {\r\n this.props.telemetry.warning(`Failed to format price for ${result}: ${error}`);\r\n }\r\n\r\n return result;\r\n }\r\n\r\n private readonly _onClick = (e: React.MouseEvent): void => {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n\r\n const target = e.currentTarget as HTMLElement;\r\n const clearAll = target.getAttribute('class')!.includes('choice-summary__clear-all');\r\n const selectedRefiner = clearAll ? undefined : this._getSelectedRefinerChoice(target);\r\n\r\n if (this.props.onChoiceClicked) {\r\n this.props.onChoiceClicked({\r\n clearAll,\r\n itemClicked: target,\r\n choiceClicked: selectedRefiner,\r\n nextItemToFocus: target.nextSibling as HTMLElement\r\n });\r\n }\r\n };\r\n\r\n private _getSelectedRefinerChoice(itemClicked: HTMLElement): ProductRefinerValue | undefined {\r\n const result = this.selectedRefinersMap.find(\r\n selected => (itemClicked.textContent && itemClicked.textContent.trim()) === selected.key\r\n );\r\n return (result && result.value) || undefined;\r\n }\r\n}\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport * as React from 'react';\r\n\r\ninterface IErrorMessage {\r\n text?: string;\r\n}\r\n\r\nexport const ErrorMessage: React.FC = ({ text }) => {\r\n return (\r\n \r\n
    {text}
    \r\n
    \r\n );\r\n};\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { ICoreContext, IGridSettings, IImageData, IImageSettings, Image, IRequestContext } from '@msdyn365-commerce/core';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { getFallbackImageUrl, getProductPageUrlSync } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getPayloadObject, getTelemetryAttributes, ITelemetryContent, onTelemetryClick } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { IEveSearchResultContainerResources } from '../eve-search-result-container.props.autogenerated';\r\n\r\n// Import { IComponent, IComponentProps, ICoreContext, IGridSettings, IImageData, IImageSettings, Image, msdyn365Commerce } from '@msdyn365-commerce/core';\r\n\r\ninterface IFeatureSearchResultItem {\r\n product: SimpleProduct | null;\r\n context: ICoreContext;\r\n resources: IEveSearchResultContainerResources;\r\n imageSettings?: IImageSettings;\r\n moduleType: string;\r\n moduleId: string;\r\n telemetryContent?: ITelemetryContent;\r\n recommendation?: string;\r\n}\r\n\r\nexport const FeatureSearchResultItem: React.FC = ({\r\n product,\r\n context,\r\n imageSettings,\r\n resources,\r\n telemetryContent,\r\n recommendation\r\n}) => {\r\n if (product === null) {\r\n return null;\r\n }\r\n\r\n const productName = product.Name;\r\n const productRecordId = product && product.RecordId ? product.RecordId : 0;\r\n const productUrl = getProductPageUrlSync(product.Name || '', productRecordId, context && context.actionContext, undefined);\r\n const fallbackImage = getFallbackImageUrl(product.ItemId, context.actionContext.requestContext.apiSettings);\r\n const heading =\r\n recommendation && recommendation === 'descriptions' ? resources.featureSimilarDescriptionTitle : resources.featureSimilarLooksTitle;\r\n\r\n // Construct telemetry attribute to render\r\n const payLoad = getPayloadObject('click', telemetryContent!, productName!, productRecordId.toString());\r\n\r\n const attribute = getTelemetryAttributes(telemetryContent!, payLoad);\r\n return (\r\n
    \r\n \r\n
    \r\n {renderProductPlacementImage(\r\n imageSettings,\r\n context.request.gridSettings,\r\n product.PrimaryImageUrl,\r\n product.Name,\r\n fallbackImage,\r\n context.actionContext.requestContext\r\n )}\r\n
    \r\n \r\n
    \r\n

    {heading}

    \r\n {renderProductTitle(product?.Name)}\r\n
    \r\n
    \r\n );\r\n};\r\n\r\nfunction renderProductPlacementImage(\r\n imageSettings?: IImageSettings,\r\n gridSettings?: IGridSettings,\r\n imageUrl?: string,\r\n altText?: string,\r\n fallbackImage?: string,\r\n context?: IRequestContext\r\n): 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 };\r\n const imageProps = {\r\n gridSettings,\r\n imageSettings,\r\n fallBackSrc: fallbackImage\r\n };\r\n return ;\r\n}\r\n\r\nfunction renderProductTitle(title?: string): JSX.Element | null {\r\n return

    {title}

    ;\r\n}\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport * as React from 'react';\r\n\r\ninterface ILink {\r\n className?: string;\r\n text?: string;\r\n href?: string;\r\n ariaLabel?: string;\r\n}\r\n\r\nexport const Link: React.FC = ({ text, className, href, ariaLabel }) => (\r\n \r\n {' '}\r\n {text}{' '}\r\n \r\n);\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { Button, Modal, ModalBody, ModalFooter, ModalHeader } from '@msdyn365-commerce-modules/utilities';\r\nimport React from 'react';\r\n\r\nexport interface ISearchResultModalViewProps {\r\n modal: React.ReactElement;\r\n modalHeader: React.ReactElement;\r\n modalFooter: React.ReactElement;\r\n modalBody: React.ReactElement;\r\n}\r\n\r\ninterface IModalToggleProps {\r\n innerRef: React.RefObject | undefined;\r\n id: string;\r\n text: string;\r\n ariaLabel: string;\r\n onClick(): void;\r\n}\r\n\r\nexport interface ISearchResultModalResources {\r\n modalTitle: string;\r\n modalCloseButtonText: string;\r\n}\r\n\r\nexport interface ISearchResultModalProps {\r\n resources: ISearchResultModalResources;\r\n isOpen: boolean;\r\n returnRef: React.RefObject | undefined;\r\n onModalToggle(): void;\r\n}\r\n\r\nexport const ModalToggle: React.FC = (props: IModalToggleProps) => {\r\n const { text, onClick, ariaLabel, innerRef, id } = props;\r\n return (\r\n \r\n );\r\n};\r\n\r\nexport const SearchResultModal = (props: ISearchResultModalProps): ISearchResultModalViewProps => {\r\n return {\r\n modal: modalNode(props),\r\n modalHeader: modalHeaderNode(props),\r\n modalFooter: modalFooterNode(props),\r\n modalBody: \r\n };\r\n};\r\n\r\nconst modalNode = (props: ISearchResultModalProps) => {\r\n return (\r\n \r\n );\r\n};\r\n\r\nconst modalHeaderNode = (props: ISearchResultModalProps) => {\r\n return {props.resources.modalTitle};\r\n};\r\n\r\nconst modalFooterNode = (props: ISearchResultModalProps) => {\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { IProductsDimensionsAvailabilities } from '@msdyn365-commerce/commerce-entities';\r\nimport { IPriceComponentResources, ProductComponent } from '@msdyn365-commerce/components';\r\nimport { ICoreContext, IImageSettings } from '@msdyn365-commerce/core';\r\nimport { ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\r\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { IEveSearchResultContainerResources } from '../eve-search-result-container.props.autogenerated';\r\n\r\ninterface IProductSearchResultItems {\r\n products: ProductSearchResult[];\r\n context: ICoreContext;\r\n resources: IEveSearchResultContainerResources;\r\n imageSettings?: IImageSettings;\r\n moduleType: string;\r\n moduleId: string;\r\n allowBackNavigation?: boolean;\r\n telemetryContent: ITelemetryContent;\r\n quickviewSlot?: {} | null | undefined;\r\n channelInventoryConfigurationId?: number;\r\n isPriceMinMaxEnabled?: boolean;\r\n productsDimensionAvailabilities?: IProductsDimensionsAvailabilities[][];\r\n}\r\n\r\n/**\r\n * Returns the product inventory label.\r\n * @param channelInventoryConfigurationId - The channel configuration Id.\r\n * @param product - The product.\r\n * @returns The inventory label.\r\n */\r\nexport function getInventoryLabel(channelInventoryConfigurationId: number | undefined, product: ProductSearchResult): string | undefined {\r\n if (!channelInventoryConfigurationId || !ArrayExtensions.hasElements(product.AttributeValues)) {\r\n return undefined;\r\n }\r\n const inventoryAttribute = product.AttributeValues.find(attribute => attribute.RecordId === channelInventoryConfigurationId);\r\n if (inventoryAttribute) {\r\n return inventoryAttribute.TextValue;\r\n }\r\n return undefined;\r\n}\r\n\r\nexport const ProductSearchResultItems: React.FC = ({\r\n products,\r\n context,\r\n imageSettings,\r\n resources,\r\n moduleType,\r\n moduleId,\r\n allowBackNavigation,\r\n telemetryContent,\r\n quickviewSlot,\r\n channelInventoryConfigurationId,\r\n isPriceMinMaxEnabled,\r\n productsDimensionAvailabilities\r\n}) => {\r\n const priceResources: IPriceComponentResources = {\r\n priceRangeSeparator: resources.priceRangeSeparator\r\n };\r\n return (\r\n
      \r\n {products.map((product: ProductSearchResult, index: number) => (\r\n
    • \r\n \r\n ArrayExtensions.hasElements(dimensionAvailability) &&\r\n dimensionAvailability[0].masterProductId === product.MasterProductId\r\n )}\r\n />\r\n
    • \r\n ))}\r\n
    \r\n );\r\n};\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { ISliderLabel, ISliderThumbProps, Slider } from '@msdyn365-commerce-modules/utilities';\r\nimport debounce from 'lodash/debounce';\r\nimport { computed } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\n\r\nimport { IRefineItemProps, IRefineItemState } from './refine-item';\r\n\r\ntype InputType = 'Min' | 'Max';\r\n\r\nexport type RangeRefineItemType = 'slider' | 'input';\r\n\r\n/**\r\n * Range refine item properties.\r\n */\r\nexport interface IRangeRefineItemProps extends IRefineItemProps {\r\n rangeType: RangeRefineItemType;\r\n minValueSliderThumbAriaLabel?: string;\r\n maxValueSliderThumbAriaLabel?: string;\r\n sliderKey?: string;\r\n}\r\n\r\n/**\r\n * Range refine item state.\r\n */\r\nexport interface IRangeRefineItemState extends IRefineItemState {\r\n validationErrorMin: string | undefined;\r\n validationErrorMax: string | undefined;\r\n selectedMin: string | undefined;\r\n selectedMax: string | undefined;\r\n touchedMin: boolean;\r\n touchedMax: boolean;\r\n sliderId: string;\r\n minValue: string | undefined;\r\n maxValue: string | undefined;\r\n labels: ISliderLabel[];\r\n sliderThumbs: ISliderThumbProps[];\r\n}\r\n\r\n/**\r\n * RangeRefineItem component (controlled by RefineSubmenu).\r\n */\r\n@observer\r\nexport default class RangeRefineItem extends React.Component {\r\n private readonly _formattedPriceReverseLookup: Map = new Map();\r\n\r\n private readonly minInput: React.RefObject;\r\n\r\n private readonly maxInput: React.RefObject;\r\n\r\n @computed get currencyCode(): string {\r\n return this.props.productRefinerValue.UnitText || '';\r\n }\r\n\r\n public constructor(props: IRangeRefineItemProps) {\r\n super(props);\r\n this._onRangeUpdate = this._onRangeUpdate.bind(this);\r\n this._onRangeUpdateEnd = this._onRangeUpdateEnd.bind(this);\r\n this._handleRangeTooltipText = this._handleRangeTooltipText.bind(this);\r\n this._changeMin = this._changeMin.bind(this);\r\n this._changeMax = this._changeMax.bind(this);\r\n this._finishChangeMin = this._finishChangeMin.bind(this);\r\n this._finishChangeMax = this._finishChangeMax.bind(this);\r\n\r\n this.minInput = React.createRef();\r\n this.maxInput = React.createRef();\r\n\r\n const { selectedRefinementCriterion } = this.props;\r\n const initialMin = selectedRefinementCriterion?.LeftValueBoundString ?? '0';\r\n const initialMax = selectedRefinementCriterion?.RightValueBoundString;\r\n const sliderId = `slider_${String(this.props.parentProductRefinerHierarchy.RecordId)}_${String(\r\n this.props.productRefinerValue.RefinerRecordId\r\n )}`;\r\n const minValue = this.props.productRefinerValue.LeftValueBoundString;\r\n const maxValue = this.props.productRefinerValue.RightValueBoundString;\r\n const minPrice = this._formatPrice(minValue);\r\n const maxPrice = this._formatPrice(maxValue);\r\n const labels: ISliderLabel[] = this.getLabels(sliderId, minPrice, maxPrice);\r\n const selectedMin =\r\n this.props.selectedRefinementCriterion?.LeftValueBoundString ?? this.props.productRefinerValue.LeftValueBoundString ?? '0';\r\n const selectedMax =\r\n this.props.selectedRefinementCriterion?.RightValueBoundString ??\r\n this.props.productRefinerValue.RightValueBoundString ??\r\n maxValue;\r\n const selectedMinPrice = this._formatPrice(selectedMin);\r\n const selectedMaxPrice = this._formatPrice(selectedMax);\r\n const sliderKeyString = this.props.sliderKey ? `_${String(this.props.sliderKey)}` : '';\r\n const sliderThumbs: ISliderThumbProps[] = this.getSliderThumbs(\r\n sliderId,\r\n sliderKeyString,\r\n selectedMin,\r\n selectedMinPrice,\r\n selectedMax,\r\n selectedMaxPrice,\r\n maxPrice\r\n );\r\n this.state = {\r\n isChecked: false,\r\n validationErrorMin: undefined,\r\n validationErrorMax: undefined,\r\n selectedMin: initialMin,\r\n selectedMax: initialMax,\r\n touchedMin: false,\r\n touchedMax: false,\r\n sliderId,\r\n minValue,\r\n maxValue,\r\n labels,\r\n sliderThumbs\r\n };\r\n }\r\n\r\n public shouldComponentUpdate(nextProps: IRangeRefineItemProps, nextState: IRangeRefineItemState): boolean {\r\n if (this.state === nextState && this.props === nextProps) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n public componentDidUpdate(previousProps: IRangeRefineItemProps): void {\r\n if (previousProps !== this.props) {\r\n this.updateSliderProps();\r\n }\r\n }\r\n\r\n public render(): JSX.Element | undefined {\r\n const { productRefinerValue, parentProductRefinerHierarchy, refineItemCommonProps } = this.props;\r\n\r\n if (!productRefinerValue || !parentProductRefinerHierarchy) {\r\n refineItemCommonProps.telemetry.error(\r\n 'Cannot render refine value range without productRefinerValue and parentProductRefinerHierarchy'\r\n );\r\n return undefined;\r\n }\r\n\r\n if (this.props.rangeType === 'input') {\r\n return this._renderInputFields();\r\n }\r\n\r\n return this._renderSlider();\r\n }\r\n\r\n /**\r\n * Function to update slider props.\r\n */\r\n private updateSliderProps(): void {\r\n const sliderId = `slider_${String(this.props.parentProductRefinerHierarchy.RecordId)}_${String(\r\n this.props.productRefinerValue.RefinerRecordId\r\n )}`;\r\n const minValue = this.props.productRefinerValue.LeftValueBoundString;\r\n const maxValue = this.props.productRefinerValue.RightValueBoundString;\r\n const minPrice = this._formatPrice(minValue);\r\n const maxPrice = this._formatPrice(maxValue);\r\n const labels: ISliderLabel[] = this.getLabels(sliderId, minPrice, maxPrice);\r\n const selectedMin =\r\n this.props.selectedRefinementCriterion?.LeftValueBoundString ?? this.props.productRefinerValue.LeftValueBoundString ?? '0';\r\n const selectedMax =\r\n this.props.selectedRefinementCriterion?.RightValueBoundString ??\r\n this.props.productRefinerValue.RightValueBoundString ??\r\n maxValue;\r\n const selectedMinPrice = this._formatPrice(selectedMin);\r\n const selectedMaxPrice = this._formatPrice(selectedMax);\r\n const sliderKeyString = this.props.sliderKey ? `_${String(this.props.sliderKey)}` : '';\r\n const sliderThumbs: ISliderThumbProps[] = this.getSliderThumbs(\r\n sliderId,\r\n sliderKeyString,\r\n selectedMin,\r\n selectedMinPrice,\r\n selectedMax,\r\n selectedMaxPrice,\r\n maxPrice\r\n );\r\n this.setState({ sliderId, minValue, maxValue, labels, sliderThumbs });\r\n }\r\n\r\n /**\r\n * Function to create the labels for slider.\r\n * @param sliderId - Slider element id for the DOM.\r\n * @param minPrice - Slider min value.\r\n * @param maxPrice - Slider max value.\r\n * @returns Array labels.\r\n */\r\n private readonly getLabels = (sliderId: string, minPrice: string, maxPrice: string): ISliderLabel[] => {\r\n return [\r\n {\r\n labelId: `${sliderId}_start`,\r\n labelString: `${minPrice}`,\r\n labelPositioning: 'start'\r\n },\r\n {\r\n labelId: `${sliderId}_end`,\r\n labelString: `${maxPrice}`,\r\n labelPositioning: 'end'\r\n }\r\n ];\r\n };\r\n\r\n /**\r\n * Function to create the slider thumbs for slider.\r\n * @param sliderId - Slider element id for the DOM.\r\n * @param sliderKey - Unique key for slider.\r\n * @param selectedMin - Slider selected min value.\r\n * @param selectedMinPrice - Slider selected min price.\r\n * @param selectedMax - Slider selected max value.\r\n * @param selectedMaxPrice - Slider selected max price..\r\n * @param maxPrice - Slider max price..\r\n * @returns Slider Thumb Props.\r\n */\r\n private readonly getSliderThumbs = (\r\n sliderId: string,\r\n sliderKey: string,\r\n selectedMin: string,\r\n selectedMinPrice: string,\r\n selectedMax: string | undefined,\r\n selectedMaxPrice: string,\r\n maxPrice: string\r\n ): ISliderThumbProps[] => {\r\n const sliderThumbDefaultValue = 0;\r\n return [\r\n {\r\n id: `${sliderId}${sliderKey}_slider_thumb_start`,\r\n value: (selectedMin && Number(selectedMin)) || sliderThumbDefaultValue,\r\n ariaLabel: `${this.props.minValueSliderThumbAriaLabel ?? ''} ${this.currencyCode}`,\r\n ariaValueText: `${selectedMinPrice}`\r\n },\r\n {\r\n id: `${sliderId}${sliderKey}_slider_thumb_end`,\r\n value: Number(selectedMax) || Number(maxPrice),\r\n ariaLabel: `${this.props.maxValueSliderThumbAriaLabel ?? ''} ${this.currencyCode}`,\r\n ariaValueText: `${selectedMaxPrice}`\r\n }\r\n ];\r\n };\r\n\r\n private _renderInputFields(): JSX.Element | undefined {\r\n const { isDisabled, parentProductRefinerHierarchy, refineItemCommonProps } = this.props;\r\n const { selectedMin, selectedMax, touchedMin, touchedMax, validationErrorMin, validationErrorMax } = this.state;\r\n\r\n const rangeAriaLabel = (refineItemCommonProps.rangeNameFormat || '{0}').replace('{0}', parentProductRefinerHierarchy.KeyName || '');\r\n const formAttrs = {\r\n 'aria-label': rangeAriaLabel,\r\n 'aria-disabled': isDisabled\r\n };\r\n\r\n // To enable price formatting of selected fields, this is the approach:\r\n // initial value: min=0 formatted as price, max=undefined\r\n // onFocus/onChange: convert to number (unformat) and mark as touched to indicate value is being edited\r\n // onBlur: validate and format entered value as price\r\n const minInputClassName = `ms-refine-submenu__input-range refine-submenu__input-range-min ${\r\n validationErrorMin ? 'refine-submenu__input-range--error' : ''\r\n }`;\r\n const maxInputClassName = `ms-refine-submenu__input-range refine-submenu__input-range-max ${\r\n validationErrorMax ? 'refine-submenu__input-range--error' : ''\r\n }`;\r\n const minLabelClassName = 'ms-refine-submenu__input-range-label refine-submenu__input-range-label-min';\r\n const maxLabelClassName = 'ms-refine-submenu__input-range-label refine-submenu__input-range-label-max';\r\n const formattedSelectedMin = this._getFormattedSelectedValue(selectedMin, touchedMin, validationErrorMin);\r\n const formattedSelectedMax = this._getFormattedSelectedValue(selectedMax, touchedMax, validationErrorMax);\r\n return (\r\n
    \r\n \r\n \r\n {validationErrorMin && (\r\n \r\n {validationErrorMin}\r\n \r\n )}\r\n {validationErrorMax && validationErrorMin !== validationErrorMax && (\r\n \r\n {validationErrorMax}\r\n \r\n )}\r\n
    \r\n );\r\n }\r\n\r\n private _renderSlider(): JSX.Element | undefined {\r\n const { isDisabled, sliderKey } = this.props;\r\n const ariaAttributes = {\r\n 'aria-disabled': isDisabled\r\n };\r\n\r\n return (\r\n \r\n );\r\n }\r\n\r\n private _changeMin(event: React.FocusEvent): void {\r\n this._changeValue(event, 'Min');\r\n }\r\n\r\n private _changeMax(event: React.FocusEvent): void {\r\n this._changeValue(event, 'Max');\r\n }\r\n\r\n private _changeValue(event: React.FocusEvent, inputType: InputType): void {\r\n const selectedKey = `selected${inputType}`;\r\n const touchedKey = `touched${inputType}`;\r\n this.setState({\r\n [selectedKey]: this._getInputWithoutFormatting(event.currentTarget.value),\r\n [touchedKey]: true\r\n });\r\n }\r\n\r\n private _finishChangeMin(event: React.FocusEvent): boolean {\r\n const selectedMinValue = this._getInputWithoutFormatting(event.currentTarget.value);\r\n this.setState({\r\n selectedMin: selectedMinValue,\r\n minTouched: false\r\n });\r\n const minInput = Number(selectedMinValue);\r\n const {\r\n onToggle,\r\n parentProductRefinerHierarchy,\r\n productRefinerValue,\r\n refineItemCommonProps,\r\n selectedRefinementCriterion\r\n } = this.props;\r\n const max = (selectedRefinementCriterion && selectedRefinementCriterion.RightValueBoundString) || undefined;\r\n\r\n const maxNum = max ? Number(max) : undefined;\r\n\r\n if (isNaN(minInput)) {\r\n this.setState({ validationErrorMin: refineItemCommonProps.validationErrorNaN });\r\n this._focus('Min');\r\n return false;\r\n }\r\n\r\n if (this._validateRange(minInput, maxNum)) {\r\n onToggle({\r\n parentProductRefinerHierarchy,\r\n productRefinerValue,\r\n isSelecting: true,\r\n rangeStart: minInput,\r\n rangeEnd: maxNum\r\n });\r\n return true;\r\n }\r\n this._focus('Min');\r\n\r\n return false;\r\n }\r\n\r\n private _finishChangeMax(event: React.FocusEvent): boolean {\r\n const selectedMaxValue = this._getInputWithoutFormatting(event.currentTarget.value);\r\n this.setState({\r\n selectedMax: selectedMaxValue,\r\n maxTouched: false\r\n });\r\n const maxInput = Number(selectedMaxValue);\r\n const {\r\n onToggle,\r\n parentProductRefinerHierarchy,\r\n productRefinerValue,\r\n refineItemCommonProps,\r\n selectedRefinementCriterion\r\n } = this.props;\r\n const min = (selectedRefinementCriterion && selectedRefinementCriterion.LeftValueBoundString) || '0';\r\n\r\n const minNum = Number(min);\r\n\r\n if (isNaN(maxInput)) {\r\n this.setState({ validationErrorMax: refineItemCommonProps.validationErrorNaN });\r\n this._focus('Max');\r\n return false;\r\n }\r\n\r\n if (this._validateRange(minNum, maxInput)) {\r\n if (productRefinerValue) {\r\n onToggle({\r\n parentProductRefinerHierarchy,\r\n productRefinerValue,\r\n isSelecting: true,\r\n rangeStart: minNum,\r\n rangeEnd: maxInput\r\n });\r\n } else {\r\n this._focus('Max');\r\n }\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n private _focus(inputType: InputType): void {\r\n const ref = inputType === 'Max' ? this.maxInput : this.minInput;\r\n\r\n setTimeout(() => {\r\n if (ref && ref.current) {\r\n ref.current.focus();\r\n }\r\n }, 50);\r\n }\r\n\r\n private _getFormattedSelectedValue(\r\n selected: string | undefined,\r\n touched: boolean,\r\n validationError: string | undefined\r\n ): string | undefined {\r\n if (touched || validationError || selected === undefined) {\r\n return selected;\r\n }\r\n return this._formatPrice(selected);\r\n }\r\n\r\n private _validateRange(min: number, max: number | undefined): boolean {\r\n const { refineItemCommonProps } = this.props;\r\n if (max === undefined) {\r\n return true;\r\n }\r\n\r\n if (min > max) {\r\n this.setState({\r\n validationErrorMin: refineItemCommonProps.validationErrorRange,\r\n validationErrorMax: refineItemCommonProps.validationErrorRange\r\n });\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n private _formatPrice(amount: string | undefined): string {\r\n const result = this.props.context.cultureFormatter.formatCurrency(Number(amount), this.currencyCode);\r\n return result;\r\n }\r\n\r\n private _getInputWithoutFormatting(input: string): string {\r\n // First try to cast raw input to a number\r\n const inputAsNum = Number(input);\r\n if (!isNaN(inputAsNum)) {\r\n return input;\r\n }\r\n\r\n // Otherwise try a reverse lookup and fall back to the raw input if all else fails\r\n const reverseLookupResult = this._formattedPriceReverseLookup.get(input);\r\n return reverseLookupResult || input;\r\n }\r\n\r\n // NOTE: Fix types once Shared Components build pipeline bug fixed\r\n private _onRangeUpdate(sliderChangeNotification: any): void {\r\n // Need to filter out mousemove events as these cause errors after the menu updates and slider re-renders\r\n if (sliderChangeNotification.eventType !== 'mousemove') {\r\n const { onToggle, parentProductRefinerHierarchy, productRefinerValue } = this.props;\r\n if (productRefinerValue && sliderChangeNotification) {\r\n onToggle({\r\n parentProductRefinerHierarchy,\r\n productRefinerValue,\r\n isSelecting: true,\r\n rangeStart: sliderChangeNotification.firstThumbValue,\r\n rangeEnd: sliderChangeNotification.secondThumbValue\r\n });\r\n\r\n this._focusOnSliderThumb(sliderChangeNotification);\r\n }\r\n }\r\n }\r\n\r\n private _onRangeUpdateEnd(sliderChangeNotification: any): void {\r\n const { onToggle, parentProductRefinerHierarchy, productRefinerValue } = this.props;\r\n if (productRefinerValue && sliderChangeNotification) {\r\n onToggle({\r\n parentProductRefinerHierarchy,\r\n productRefinerValue,\r\n isSelecting: true,\r\n rangeStart: sliderChangeNotification.firstThumbValue,\r\n rangeEnd: sliderChangeNotification.secondThumbValue\r\n });\r\n\r\n this._focusOnSliderThumb(sliderChangeNotification);\r\n }\r\n }\r\n\r\n private _focusOnSliderThumb(sliderChangeNotification: any): void {\r\n if (sliderChangeNotification.id) {\r\n const element = document.getElementById(`${sliderChangeNotification.id}range`);\r\n if (element) {\r\n setTimeout(() => {\r\n element.focus();\r\n }, 0);\r\n }\r\n }\r\n }\r\n\r\n private _handleRangeTooltipText(tooltip: number): string {\r\n return this._formatPrice(`${tooltip}`);\r\n }\r\n}\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\r\nimport { RatingComponent, SwatchComponent } from '@msdyn365-commerce/components';\r\nimport { IAny, ICoreContext, IGeneric } from '@msdyn365-commerce/core';\r\nimport { ProductRefinerSource, ProductRefinerValue, RefinerType } from '@msdyn365-commerce/retail-proxy';\r\nimport { checkIfShouldDisplayAsSwatch, DimensionTypes, IDimensionsApp, StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { format, getPayloadObject, getTelemetryAttributes, IPayLoad, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { IRefineItemCommonProps } from './refine-item.props.common';\r\nimport { IRefineItemToggleNotification } from './refine-item-toggle-notification';\r\n\r\n/**\r\n * RefineItem properties.\r\n */\r\nexport interface IRefineItemProps {\r\n parentProductRefinerHierarchy: IProductRefinerHierarchy;\r\n productRefinerValue: ProductRefinerValue;\r\n selectedRefinementCriterion: ProductRefinerValue | undefined;\r\n selectedRefinerValues?: ProductRefinerValue[];\r\n refineItemCommonProps: IRefineItemCommonProps;\r\n isDisabled: boolean;\r\n context: ICoreContext>;\r\n moduleId: string;\r\n moduleTypeName: string;\r\n index?: number;\r\n productCountAriaLabel?: string;\r\n singleProductCountAriaLabel?: string;\r\n refineItemAriaLabel?: string;\r\n refineItemsAriaLabel?: string;\r\n isMobileView?: boolean;\r\n\r\n /**\r\n * The telemetry content\r\n */\r\n telemetryContent?: ITelemetryContent;\r\n onToggle(notfication: Readonly): void;\r\n urlBuilder(refiner: IRefineItemToggleNotification): string;\r\n}\r\n\r\n/**\r\n * Refine item state.\r\n */\r\nexport interface IRefineItemState extends React.ComponentState {\r\n isChecked: boolean;\r\n renderingError?: object;\r\n}\r\n\r\n/**\r\n * Single-select and multi-select refine item component (controlled by RefineSubmenu).\r\n */\r\nexport default class RefineItem extends React.Component {\r\n private readonly anchorType: React.RefObject;\r\n\r\n private readonly payLoad: IPayLoad;\r\n\r\n public constructor(props: IRefineItemProps) {\r\n super(props);\r\n this._onClick = this._onClick.bind(this);\r\n this.state = {\r\n isChecked: !!this.props.selectedRefinementCriterion\r\n };\r\n this.anchorType = React.createRef();\r\n this.payLoad = getPayloadObject('click', this.props.telemetryContent!, '');\r\n }\r\n\r\n public shouldComponentUpdate(nextProps: IRefineItemProps, nextState: IRefineItemState): boolean {\r\n if (this.state === nextState && this.props === nextProps) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n public render(): JSX.Element | undefined {\r\n const {\r\n isDisabled,\r\n refineItemCommonProps,\r\n parentProductRefinerHierarchy,\r\n productRefinerValue,\r\n selectedRefinementCriterion,\r\n productCountAriaLabel,\r\n singleProductCountAriaLabel,\r\n index,\r\n children,\r\n onToggle,\r\n context,\r\n telemetryContent,\r\n refineItemAriaLabel,\r\n refineItemsAriaLabel,\r\n ...attrs\r\n } = this.props;\r\n if (!productRefinerValue) {\r\n refineItemCommonProps.telemetry.error('[refine-item] Cannot render refineItem without productRefinerValue');\r\n return undefined;\r\n }\r\n if (!productRefinerValue.LeftValueBoundString) {\r\n refineItemCommonProps.telemetry.warning(\r\n `[refine-item] RefineItem without LeftValueBoundString: ${JSON.stringify(productRefinerValue)}`\r\n );\r\n }\r\n const isSingleSelect = parentProductRefinerHierarchy.RefinerTypeValue === RefinerType.SingleSelect;\r\n let itemTypeClassName = isSingleSelect ? 'single-select' : 'multi-select';\r\n itemTypeClassName = `ms-refine-submenu-item ${itemTypeClassName}`;\r\n const inputType = isSingleSelect ? 'radio' : 'checkbox';\r\n const isChecked = !!selectedRefinementCriterion;\r\n itemTypeClassName = isChecked ? `${itemTypeClassName}-checked` : itemTypeClassName;\r\n if (parentProductRefinerHierarchy.SourceValue === ProductRefinerSource.Rating) {\r\n return this._renderRating(\r\n productRefinerValue,\r\n parentProductRefinerHierarchy,\r\n isChecked,\r\n context,\r\n index,\r\n telemetryContent,\r\n productCountAriaLabel,\r\n singleProductCountAriaLabel\r\n );\r\n }\r\n this.payLoad.contentAction.etext = productRefinerValue.LeftValueBoundLocalizedString ?? productRefinerValue.LeftValueBoundString;\r\n const attribute = getTelemetryAttributes(telemetryContent!, this.payLoad);\r\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- Replace with actual value for empty string.\r\n const productText = productRefinerValue.LeftValueBoundLocalizedString || productRefinerValue.LeftValueBoundString || '';\r\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- Replace with actual value for empty string.\r\n const productCount = productRefinerValue.Count || 0;\r\n let refineMenuItemAriaLabel;\r\n if (productCount === 1) {\r\n refineMenuItemAriaLabel = refineItemAriaLabel\r\n ? format(refineItemAriaLabel, parentProductRefinerHierarchy.KeyName, productText)\r\n : '';\r\n } else {\r\n refineMenuItemAriaLabel = refineItemsAriaLabel\r\n ? format(refineItemsAriaLabel, parentProductRefinerHierarchy.KeyName, productText, productCount)\r\n : '';\r\n }\r\n return (\r\n
  • \r\n \r\n {this._renderSwatch()}\r\n \r\n \r\n
  • \r\n );\r\n }\r\n\r\n private _renderSwatch(): JSX.Element | null {\r\n const productRefinerValue = this.props.productRefinerValue;\r\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- Replace with actual value for empty string.\r\n const text = productRefinerValue.LeftValueBoundLocalizedString || productRefinerValue.LeftValueBoundString || '';\r\n\r\n const dimensionType = (this.props.parentProductRefinerHierarchy.KeyName?.toLocaleLowerCase() ?? '') as DimensionTypes;\r\n const hasColor = !StringExtensions.isNullOrWhitespace(productRefinerValue.SwatchColorHexCode);\r\n const hasImage = !StringExtensions.isNullOrWhitespace(productRefinerValue.SwatchImageUrl);\r\n const hasValidSwatch = hasColor || hasImage;\r\n const shouldDisplayAsSwatch =\r\n hasValidSwatch && checkIfShouldDisplayAsSwatch(dimensionType, this.props.context as ICoreContext);\r\n const swatchItems = shouldDisplayAsSwatch\r\n ? [\r\n {\r\n itemId: `${productRefinerValue.RefinerRecordId ?? ''}-${dimensionType}-${text}`,\r\n value: text,\r\n dimensionType,\r\n colorHexCode: productRefinerValue.SwatchColorHexCode,\r\n imageUrl: productRefinerValue.SwatchImageUrl\r\n }\r\n ]\r\n : undefined;\r\n\r\n if (!swatchItems) {\r\n return null;\r\n }\r\n\r\n return (\r\n \r\n );\r\n }\r\n\r\n private _getRefinerUrl(): string {\r\n const { urlBuilder, parentProductRefinerHierarchy, productRefinerValue, selectedRefinementCriterion } = this.props;\r\n\r\n if (productRefinerValue) {\r\n return urlBuilder({\r\n parentProductRefinerHierarchy,\r\n productRefinerValue,\r\n isSelecting: !selectedRefinementCriterion\r\n });\r\n }\r\n\r\n return '';\r\n }\r\n\r\n private readonly _onClick = (e: React.MouseEvent): void => {\r\n e.preventDefault();\r\n\r\n const { parentProductRefinerHierarchy, productRefinerValue, selectedRefinementCriterion } = this.props;\r\n if (productRefinerValue) {\r\n this.props.onToggle({\r\n parentProductRefinerHierarchy,\r\n productRefinerValue,\r\n isSelecting: !selectedRefinementCriterion\r\n });\r\n\r\n setTimeout(() => {\r\n this.anchorType.current && this.anchorType.current.focus();\r\n }, 0);\r\n }\r\n };\r\n\r\n private _renderRating(\r\n productRefinerValue: ProductRefinerValue,\r\n parentProductRefinerHierarchy: IProductRefinerHierarchy,\r\n isChecked: boolean,\r\n context: ICoreContext,\r\n index?: number,\r\n telemetryContent?: ITelemetryContent,\r\n ratingUserCountAriaLabel?: string,\r\n ratingSingleUserCountAriaLabel?: string\r\n ): JSX.Element | undefined {\r\n if (productRefinerValue.LeftValueBoundString) {\r\n this.payLoad.contentAction.etext = productRefinerValue.LeftValueBoundLocalizedString;\r\n const attribute = getTelemetryAttributes(telemetryContent!, this.payLoad);\r\n const refinerRating = Number.parseInt(productRefinerValue.LeftValueBoundString, 10);\r\n const ratingRefiner = this.props.selectedRefinerValues?.find(\r\n value => value.DataTypeValue === productRefinerValue.DataTypeValue\r\n );\r\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- Replace with actual value for empty string.\r\n const selectedRating = Number.parseInt(ratingRefiner?.LeftValueBoundString || '0', 10);\r\n const defaultChkProductCount = 1;\r\n let ratingComponentClass: string = 'ms-rating-component';\r\n if (refinerRating > selectedRating) {\r\n ratingComponentClass = `${ratingComponentClass}__up`;\r\n } else if (refinerRating < selectedRating) {\r\n ratingComponentClass = `${ratingComponentClass}__down`;\r\n } else {\r\n ratingComponentClass = `${ratingComponentClass}__current`;\r\n }\r\n const productCountAriaLabelValue =\r\n productRefinerValue.Count !== undefined && productRefinerValue.Count === defaultChkProductCount\r\n ? ratingSingleUserCountAriaLabel && format(ratingSingleUserCountAriaLabel, productRefinerValue.Count)\r\n : ratingUserCountAriaLabel && format(ratingUserCountAriaLabel, productRefinerValue.Count);\r\n return (\r\n \r\n \r\n \r\n \r\n {productRefinerValue.Count !== undefined && `(${productRefinerValue.Count})`}\r\n \r\n \r\n \r\n );\r\n }\r\n return undefined;\r\n }\r\n}\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\r\nimport { IAny, ICoreContext, IGeneric } from '@msdyn365-commerce/core';\r\nimport { DisplayTemplate, ProductRefinerSource, ProductRefinerValue, RefinerType } from '@msdyn365-commerce/retail-proxy';\r\nimport { Button, Collapse, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport RangeRefineItem, { RangeRefineItemType } from './range-refine-item';\r\nimport RefineItem from './refine-item';\r\nimport { IRefineItemCommonProps } from './refine-item.props.common';\r\nimport { IRefineItemToggleNotification } from './refine-item-toggle-notification';\r\nimport { findMatchingRefinementCriterion, isRangeType } from './utilities';\r\n\r\n/**\r\n * Properties associated with the RefineSubmenu component.\r\n */\r\nexport interface IRefineSubmenuProps {\r\n tempRangeTypeTODO: RangeRefineItemType;\r\n minValueSliderThumbAriaLabel?: string;\r\n maxValueSliderThumbAriaLabel?: string;\r\n productRefinerHierarchy: IProductRefinerHierarchy;\r\n selectedRefinerValues: ProductRefinerValue[];\r\n refineItemCommonProps: IRefineItemCommonProps;\r\n isDisabled: boolean;\r\n isExpandedOnInitialLoad: boolean;\r\n context: ICoreContext>;\r\n moduleId: string;\r\n moduleTypeName: string;\r\n productCountAriaLabel?: string;\r\n singleProductCountAriaLabel?: string;\r\n refineItemAriaLabel?: string;\r\n refineItemsAriaLabel?: string;\r\n isMobile?: boolean;\r\n\r\n /**\r\n * The telemetry content\r\n */\r\n telemetryContent?: ITelemetryContent;\r\n onUpdateRefiners(notfication: Readonly): void;\r\n urlBuilder(refiner: IRefineItemToggleNotification): string;\r\n}\r\n\r\n/**\r\n * Refine submenu state.\r\n */\r\nexport interface IRefineSubmenuState extends React.ComponentState {\r\n expanded: boolean;\r\n}\r\n\r\n/**\r\n *\r\n * The RefineSubmenu component renders the submenu category and child items.\r\n * This computed observes the stateful category hierarchy object.\r\n * @extends {React.PureComponent}\r\n */\r\nclass RefineSubmenu extends React.Component {\r\n constructor(props: IRefineSubmenuProps) {\r\n super(props);\r\n\r\n this._onToggleItem = this._onToggleItem.bind(this);\r\n this._onToggleSubmenu = this._onToggleSubmenu.bind(this);\r\n\r\n const isExpanded = this.props.isExpandedOnInitialLoad;\r\n\r\n // If (this.props.productRefinerHierarchy.DataTypeValue === ProductRefinerValueDataTypeValue.Range) {\r\n // isExpanded = true;\r\n // }\r\n\r\n this.state = {\r\n expanded: isExpanded\r\n };\r\n }\r\n\r\n public shouldComponentUpdate(nextProps: IRefineSubmenuProps, nextState: IRefineSubmenuState): boolean {\r\n if (this.state === nextState && this.props === nextProps) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const { productRefinerHierarchy, refineItemCommonProps } = this.props;\r\n\r\n if (!productRefinerHierarchy) {\r\n refineItemCommonProps.telemetry.error('Cannot render submenu without refiner hierarchy data');\r\n }\r\n\r\n if (productRefinerHierarchy.SourceValue === ProductRefinerSource.Rating && this.props.context.app.config.hideRating) {\r\n return null;\r\n }\r\n return (\r\n
    \r\n \r\n {productRefinerHierarchy.KeyName}\r\n \r\n \r\n {this._renderChildItems(productRefinerHierarchy)}\r\n \r\n
    \r\n );\r\n }\r\n\r\n private _renderChildItems(productRefinerHierarchy: IProductRefinerHierarchy): JSX.Element | null {\r\n if (isRangeType(productRefinerHierarchy.DataTypeValue)) {\r\n return this._renderRange(productRefinerHierarchy);\r\n }\r\n return this._renderSingleMultiSelect(productRefinerHierarchy);\r\n }\r\n\r\n private _renderSingleMultiSelect(productRefinerHierarchy: IProductRefinerHierarchy): JSX.Element | null {\r\n const {\r\n isDisabled,\r\n refineItemCommonProps,\r\n selectedRefinerValues,\r\n context,\r\n productCountAriaLabel,\r\n singleProductCountAriaLabel,\r\n refineItemAriaLabel,\r\n refineItemsAriaLabel,\r\n isMobile\r\n } = this.props;\r\n const isSingleSelect =\r\n productRefinerHierarchy.RefinerTypeValue === RefinerType.SingleSelect &&\r\n productRefinerHierarchy.SourceValue === ProductRefinerSource.Rating;\r\n const role = isSingleSelect ? { role: 'listbox' } : undefined;\r\n const refinerValuesList = productRefinerHierarchy.Values || [];\r\n const listItems = refinerValuesList.map((child: ProductRefinerValue, index: number) => {\r\n if (!child) {\r\n refineItemCommonProps.telemetry.error(\r\n `[refine-submenu] Could not render refine item for refiner ${productRefinerHierarchy.RecordId} (${productRefinerHierarchy.KeyName})`\r\n );\r\n return null;\r\n }\r\n\r\n const selectedRefinementCriterion = findMatchingRefinementCriterion(child, selectedRefinerValues);\r\n\r\n return (\r\n \r\n refinerValuesList.find(value => value.RefinerRecordId === selectedValue.RefinerRecordId)\r\n )}\r\n refineItemCommonProps={refineItemCommonProps}\r\n onToggle={this._onToggleItem}\r\n urlBuilder={this.props.urlBuilder}\r\n isDisabled={isDisabled}\r\n key={index}\r\n index={index}\r\n context={context}\r\n moduleId={this.props.moduleId}\r\n moduleTypeName={this.props.moduleTypeName}\r\n telemetryContent={this.props.telemetryContent}\r\n productCountAriaLabel={productCountAriaLabel}\r\n refineItemAriaLabel={refineItemAriaLabel}\r\n refineItemsAriaLabel={refineItemsAriaLabel}\r\n singleProductCountAriaLabel={singleProductCountAriaLabel}\r\n isMobileView={isMobile}\r\n />\r\n );\r\n });\r\n return (\r\n \r\n {listItems}\r\n \r\n );\r\n }\r\n\r\n private _getRangeType(productRefinerHierarchy: IProductRefinerHierarchy): 'input' | 'slider' {\r\n if (\r\n productRefinerHierarchy.DisplayTemplateValue === DisplayTemplate.Range ||\r\n productRefinerHierarchy.DisplayTemplateValue === DisplayTemplate.Slider ||\r\n productRefinerHierarchy.DisplayTemplateValue === DisplayTemplate.SliderWithBars\r\n ) {\r\n return 'slider';\r\n }\r\n return 'input';\r\n }\r\n\r\n private _renderRange(productRefinerHierarchy: IProductRefinerHierarchy): JSX.Element | null {\r\n const {\r\n isDisabled,\r\n refineItemCommonProps,\r\n selectedRefinerValues,\r\n context,\r\n minValueSliderThumbAriaLabel,\r\n maxValueSliderThumbAriaLabel\r\n } = this.props;\r\n const submenuClassNamePrefix = 'ms-refine-submenu__item list-group-item refine-submenu__item';\r\n const refinerValuesList = productRefinerHierarchy.Values || [];\r\n const listItems = refinerValuesList.map((child: ProductRefinerValue, index: number) => {\r\n if (!child) {\r\n refineItemCommonProps.telemetry.error(\r\n `Could not render refine item for refiner ${productRefinerHierarchy.RecordId} (${productRefinerHierarchy.KeyName})`\r\n );\r\n return null;\r\n }\r\n\r\n const selectedRefinementCriterion = findMatchingRefinementCriterion(child, selectedRefinerValues);\r\n\r\n const rangeType = this._getRangeType(productRefinerHierarchy);\r\n const key = selectedRefinementCriterion\r\n ? `${selectedRefinementCriterion.LeftValueBoundString}-${selectedRefinementCriterion.RightValueBoundString}`\r\n : `not-selected-${index}`;\r\n return (\r\n
  • \r\n \r\n
  • \r\n );\r\n });\r\n return
      {listItems}
    ;\r\n }\r\n\r\n private _onToggleItem(itemToggleNotification: IRefineItemToggleNotification): void {\r\n this.props.onUpdateRefiners(itemToggleNotification);\r\n }\r\n\r\n private _onToggleSubmenu(): void {\r\n this.setState(prevState => ({\r\n expanded: !prevState.expanded\r\n }));\r\n }\r\n}\r\n\r\nexport default RefineSubmenu;\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport * as React from 'react';\r\n\r\ninterface ISeparator {\r\n separator: string;\r\n}\r\n\r\nexport const Separator: React.FC = ({ separator }) => {separator} ;\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport * as React from 'react';\r\n\r\ninterface ITitle {\r\n className: string;\r\n text: string;\r\n}\r\n\r\nexport const Title: React.FC = ({ text, className }) => {text} ;\r\n","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All rights reserved. See License.txt in the project root for license information.\r\n * IEveSearchResultContainer containerModule Interface Properties\r\n * THIS FILE IS AUTO-GENERATED - MANUAL MODIFICATIONS WILL BE LOST\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport * as React from 'react';\r\n\r\nexport const enum expandRefinersCount {\r\n all = 'all',\r\n one = 'one',\r\n two = 'two',\r\n three = 'three',\r\n four = 'four'\r\n}\r\n\r\nexport interface IEveSearchResultContainerConfig extends Msdyn365.IModuleConfig {\r\n itemsPerPage?: number;\r\n allowBackNavigation?: boolean;\r\n imageSettings?: Msdyn365.IImageSettings;\r\n expandRefinersCount?: expandRefinersCount;\r\n disableHierarchy?: boolean;\r\n includeAttributes?: boolean;\r\n enableAffiliationBasedPricing?: boolean;\r\n updateRefinerPanel?: boolean;\r\n className?: string;\r\n clientRender?: boolean;\r\n enableProdutDescription?: boolean;\r\n listView?: boolean;\r\n onlyShowPriceWhenAuthenticated?: boolean;\r\n}\r\n\r\nexport interface IEveSearchResultContainerResources {\r\n noResultsForRefinersText: string;\r\n resultCategoryNotFoundText: string;\r\n resultSearchNotFoundText: string;\r\n paginationAriaLabel: string;\r\n priceFree: string;\r\n priceRangeSeparator: string;\r\n originalPriceText: string;\r\n currentPriceText: string;\r\n ratingAriaLabel: string;\r\n flipperNext: string;\r\n flipperPrevious: string;\r\n searchTextPrefix: string;\r\n numberOfProducts: string;\r\n oneProduct: string;\r\n categoryLinkAriaLabel: string;\r\n sortByDropdownLabel: string;\r\n sortByOptionNameAsc: string;\r\n sortByOptionNameDesc: string;\r\n sortByOptionPriceAsc: string;\r\n sortByOptionPriceDesc: string;\r\n sortByOptionRatingDesc: string;\r\n sortByOptionBestSelling: string;\r\n sortByOptionNewScore: string;\r\n sortByOptionTrendingScore: string;\r\n sortByOptionRelevanceDesc: string;\r\n placeholderTextMax: string;\r\n minLabel: string;\r\n maxLabel: string;\r\n rangeNameFormat: string;\r\n validationErrorNotNumber: string;\r\n validationErrorNotRange: string;\r\n clearAllText: string;\r\n choiceSummaryLabel: string;\r\n choiceFormat: string;\r\n choiceRangeValueFormat: string;\r\n choiceAriaLabel: string;\r\n closeAriaLabel: string;\r\n modalTitle: string;\r\n modalCloseButtonText: string;\r\n minValueSliderThumbAriaLabel: string;\r\n maxValueSliderThumbAriaLabel: string;\r\n featureSimilarLooksTitle: string;\r\n featureSimilarDescriptionTitle: string;\r\n productCountAriaLabel: string;\r\n singleProductCountAriaLabel: string;\r\n swatchItemAriaLabel: string;\r\n refineItemsAriaLabel: string;\r\n refineItemAriaLabel: string;\r\n filterText: string;\r\n partNoHeading: string;\r\n descriptionHeading: string;\r\n availabilityHeading: string;\r\n listPriceHeading: string;\r\n yourPriceHeading: string;\r\n loginToViewPricing: string;\r\n goToCartText: string;\r\n continueShoppingText: string;\r\n addToCartModalHeading: string;\r\n addToCartText: string;\r\n courseInCartText: string;\r\n invoiceInCartText: string;\r\n productEligibilityText: string;\r\n}\r\n\r\nexport interface IEveSearchResultContainerProps extends Msdyn365.IModule {\r\n resources: IEveSearchResultContainerResources;\r\n config: IEveSearchResultContainerConfig;\r\n slots: {\r\n quickview: React.ReactNode[];\r\n };\r\n}\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport {\r\n CategoryHierarchy as CategoryHierarchyData,\r\n IProductRefinerHierarchy,\r\n IProductsDimensionsAvailabilities\r\n} from '@msdyn365-commerce/commerce-entities';\r\nimport MsDyn365, { getCatalogId, ICoreContext } from '@msdyn365-commerce/core';\r\nimport { format, ProductPrice, ProductRefinerValue, SortColumn, TextValueTranslation } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n ArrayExtensions,\r\n DimensionAvailabilitiesForProductSearchResultInput,\r\n DimensionTypes,\r\n getDimensionAvailabilitiesForProductSearchResultAction,\r\n getPriceForProductSearchResult,\r\n IDimensionsApp,\r\n PriceForProductSearchResultInput\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n getTelemetryObject,\r\n ILabeledDropdownOnChangeNotification,\r\n ILabeledDropdownOption,\r\n IModuleProps,\r\n INodeProps,\r\n isMobile,\r\n ITelemetryContent,\r\n LabeledDropdown,\r\n UncontrolledPagination,\r\n VariantType\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport { computed, observable, reaction, transaction, action } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\n\r\nimport {\r\n buildListPageUrl,\r\n getCollectionProducts,\r\n getCollectionRefinersAction,\r\n getCurrentUrl,\r\n GetFullProductsByCollectionInput,\r\n IFullProductsSearchResultsWithCount,\r\n parseQueryParam,\r\n ProductListInventoryFilteringOptions,\r\n RefinersByCollectionInput,\r\n sortOptions\r\n} from './actions';\r\nimport { hydrateRefinersFromUrl } from './actions/url-utils';\r\nimport {\r\n ErrorMessage,\r\n FeatureSearchResultItem,\r\n getUpdatedRefinementCriteria,\r\n IChoiceSummaryClickNotification,\r\n IRefineItemCommonProps,\r\n IRefineItemToggleNotification,\r\n ISearchResultModalViewProps,\r\n isMatchingRefinementCriterion,\r\n Link,\r\n ModalToggle,\r\n ProductSearchResultItems,\r\n SearchResultModal,\r\n Separator,\r\n Title\r\n} from './components';\r\nimport ChoiceSummary from './components/choice-summary';\r\nimport RefineSubmenu from './components/refine-submenu';\r\nimport { ListPageState } from './list-page-state';\r\nimport { IEveSearchResultContainerData } from './eve-search-result-container.data';\r\nimport { expandRefinersCount, IEveSearchResultContainerProps } from './eve-search-result-container.props.autogenerated';\r\n\r\nexport interface ISearchResultContainerViewProps extends IEveSearchResultContainerProps {\r\n products?: React.ReactNode;\r\n className?: string;\r\n SearchResultContainer: IModuleProps;\r\n TitleViewProps: ITitleViewProps;\r\n categoryHierarchy: ICategoryHierarchyViewProps;\r\n pagination?: React.ReactNode;\r\n ProductsContainer: INodeProps;\r\n ProductSectionContainer: INodeProps;\r\n refineMenu: IRefineMenuViewProps;\r\n sortByOptions: ISortByViewProps;\r\n choiceSummary?: React.ReactNode;\r\n modalToggle: React.ReactNode;\r\n searchResultModal: ISearchResultModalViewProps;\r\n isMobile: boolean;\r\n CategoryNavContainer: INodeProps;\r\n RefineAndProductSectionContainer: INodeProps;\r\n errorMessage: React.ReactNode;\r\n FeatureSearchContainer: INodeProps;\r\n similarLookProduct?: React.ReactNode;\r\n productPrices?: ProductPrice[];\r\n}\r\n\r\nexport interface ITitleViewProps {\r\n TitleContainer: INodeProps;\r\n title: ISearchResultTitle;\r\n}\r\n\r\nexport interface IRefineMenuViewProps {\r\n RefineMenuContainer: INodeProps;\r\n RefinerSectionContainer: INodeProps;\r\n refiners?: React.ReactNode[];\r\n}\r\n\r\nexport interface ICategoryHierarchyViewProps {\r\n categoryHierarchyList?: React.ReactNode[];\r\n categoryHierarchySeparator?: React.ReactNode;\r\n CategoryHierarchyContainer: INodeProps;\r\n}\r\n\r\nexport interface ISortByViewProps {\r\n SortingContainer: INodeProps;\r\n sortByDropDown?: React.ReactNode;\r\n}\r\n\r\nexport type GridSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\r\n\r\n/**\r\n * Title component for search result container.\r\n */\r\nexport interface ISearchResultTitle {\r\n titlePrefix?: React.ReactNode;\r\n titleText?: React.ReactNode;\r\n titleCount?: React.ReactNode;\r\n}\r\n\r\nexport interface ISearchResultContainerState {\r\n sortingState: ISortByCollectionState;\r\n modalIsOpen: boolean;\r\n refiners: IProductRefinerHierarchy[];\r\n productsDimensionAvailabilities?: IProductsDimensionsAvailabilities[][];\r\n}\r\n\r\ninterface ISortByCollectionState {\r\n selectedSortByOption: ILabeledDropdownOption;\r\n pending: boolean;\r\n}\r\n\r\n/**\r\n *\r\n * SearchResultContainer component.\r\n * @extends {React.PureComponent>}\r\n */\r\n@observer\r\nexport default class SearchResultContainer extends React.PureComponent<\r\n IEveSearchResultContainerProps,\r\n ISearchResultContainerState\r\n> {\r\n @computed get isMobile(): boolean {\r\n return this._viewport === 'xs' || this._viewport === 'sm';\r\n }\r\n\r\n private readonly sortByDropdownOptions: ILabeledDropdownOption[] = [\r\n { key: sortOptions.sortByOptionRelevanceDesc, value: this.props.resources.sortByOptionRelevanceDesc },\r\n { key: sortOptions.sortByOptionNameAsc, value: this.props.resources.sortByOptionNameAsc },\r\n { key: sortOptions.sortByOptionNameDesc, value: this.props.resources.sortByOptionNameDesc },\r\n { key: sortOptions.sortByOptionPriceAsc, value: this.props.resources.sortByOptionPriceAsc },\r\n { key: sortOptions.sortByOptionPriceDesc, value: this.props.resources.sortByOptionPriceDesc },\r\n { key: sortOptions.sortByOptionRatingDesc, value: this.props.resources.sortByOptionRatingDesc },\r\n { key: sortOptions.sortByOptionBestSelling, value: this.props.resources.sortByOptionBestSelling },\r\n { key: sortOptions.sortByOptionNewScore, value: this.props.resources.sortByOptionNewScore },\r\n { key: sortOptions.sortByOptionTrendingScore, value: this.props.resources.sortByOptionTrendingScore }\r\n ];\r\n\r\n private readonly _refineItemCommonProps: IRefineItemCommonProps;\r\n\r\n private readonly _pageType: string | undefined = this.props.context.request.urlTokens.pageType;\r\n\r\n @observable\r\n private _viewport: GridSize = 'lg';\r\n\r\n private readonly _modalToggleRef: React.RefObject;\r\n\r\n private readonly _sortAndFilterContainerRef: React.RefObject;\r\n\r\n private expandrefinerCount: number | undefined = 0;\r\n\r\n private readonly telemetryContent: ITelemetryContent;\r\n\r\n private readonly productPrices: ProductPrice[];\r\n\r\n private readonly defaultPageNumber = 0;\r\n\r\n private readonly catalogId = getCatalogId(this.props.context.request);\r\n\r\n private isListPageStateUpdated: boolean = false;\r\n\r\n public constructor(props: IEveSearchResultContainerProps, state: ISearchResultContainerState) {\r\n super(props);\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Check required.\r\n this._viewport = props.context.request?.device?.Type === 'Mobile' ? 'xs' : 'lg';\r\n this._modalToggleRef = React.createRef();\r\n this._sortAndFilterContainerRef = React.createRef();\r\n this._toggleModal = this._toggleModal.bind(this);\r\n this._updateViewport = this._updateViewport.bind(this);\r\n this.productPrices = [];\r\n this.state = {\r\n sortingState: {\r\n pending: false,\r\n selectedSortByOption: this.sortByDropdownOptions[0]\r\n },\r\n modalIsOpen: false,\r\n refiners: []\r\n };\r\n const { placeholderTextMax, minLabel, maxLabel, rangeNameFormat } = this.props.resources;\r\n\r\n const locale = this.props.context.request.locale;\r\n const telemetry = this.props.telemetry;\r\n const validationErrorNaN = this.props.resources.validationErrorNotNumber;\r\n const validationErrorRange = this.props.resources.validationErrorNotRange;\r\n this._refineItemCommonProps = {\r\n telemetry,\r\n locale,\r\n placeholderTextMax,\r\n minLabel,\r\n maxLabel,\r\n rangeNameFormat,\r\n validationErrorNaN,\r\n validationErrorRange\r\n };\r\n this.telemetryContent = getTelemetryObject(\r\n this.props.context.request.telemetryPageName!,\r\n this.props.friendlyName,\r\n this.props.telemetry\r\n );\r\n this._updateViewport();\r\n }\r\n\r\n public static getFriendlyName(locale: string, nameTranslations?: TextValueTranslation[]): string | undefined {\r\n let nameTranslation: TextValueTranslation | undefined;\r\n if (locale && nameTranslations && ArrayExtensions.hasElements(nameTranslations)) {\r\n nameTranslation = nameTranslations.find(item => item.Language!.toLowerCase() === locale.toLowerCase());\r\n }\r\n\r\n return nameTranslation?.Text;\r\n }\r\n\r\n public async componentDidMount(): Promise {\r\n if (MsDyn365.isBrowser && window.addEventListener) {\r\n window.addEventListener('resize', this._updateViewport);\r\n this._updateViewport();\r\n }\r\n\r\n const listPageState = await this.props.data.listPageState;\r\n const products = await this.props.data.products;\r\n\r\n this._updateListPageState(listPageState, products);\r\n\r\n // Initialize reaction based on listPageState properties\r\n reaction(\r\n () => {\r\n return [\r\n listPageState.activeFilters?.length,\r\n listPageState.currentPageNumber,\r\n ArrayExtensions.hasElements(listPageState.sortingCritera?.Columns)\r\n ];\r\n },\r\n async () => {\r\n const newListPageState = await this.props.data.listPageState;\r\n const input = new GetFullProductsByCollectionInput(\r\n newListPageState.pageType,\r\n this.props.context.request.apiSettings,\r\n {\r\n Paging: {\r\n Top: this.props.config.itemsPerPage,\r\n Skip: Math.max(newListPageState.pageSize * (newListPageState.currentPageNumber ?? 0), 0)\r\n },\r\n count: true,\r\n Sorting: newListPageState.sortingCritera ?? {}\r\n },\r\n newListPageState.activeFilters ?? [],\r\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- RecordId is string. Check required.\r\n +(this.props.context.request.urlTokens.recordId || 0),\r\n\r\n // eslint-disable-next-line max-len -- existing code\r\n this.props.context.request.query?.q\r\n ? this.props.context.request.query.q\r\n : JSON.stringify({\r\n ProductId: this.props.context.request.query?.productId,\r\n Recommendation: this.props.context.request.query?.recommendation\r\n }),\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Required check.\r\n !!this.props?.config?.includeAttributes,\r\n this.props.config.updateRefinerPanel,\r\n this.props.context.request.locale,\r\n this.catalogId\r\n );\r\n\r\n const productResults = await getCollectionProducts(input, this.props.context.actionContext);\r\n\r\n newListPageState.totalProductCount = productResults.count;\r\n newListPageState.activeProducts = productResults.products;\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- check is required.\r\n if (\r\n this.props.config.enableAffiliationBasedPricing &&\r\n this.props.context.actionContext.requestContext?.user?.isAuthenticated\r\n ) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises -- Call api to retrieve the availabilities data without blocking the UI.\r\n this._getActivePrice();\r\n }\r\n\r\n if (this.props.config.updateRefinerPanel) {\r\n const refinerInput = new RefinersByCollectionInput(\r\n newListPageState.pageType,\r\n this.props.context.request.apiSettings,\r\n {\r\n Paging: {\r\n Top: this.props.config.itemsPerPage,\r\n Skip: Math.max(\r\n newListPageState.pageSize * (newListPageState.currentPageNumber ?? this.defaultPageNumber),\r\n this.defaultPageNumber\r\n )\r\n },\r\n count: true,\r\n Sorting: newListPageState.sortingCritera ?? {}\r\n },\r\n newListPageState.activeFilters ?? [],\r\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- RecordId is string. Check required.\r\n +(this.props.context.request.urlTokens.recordId || 0),\r\n this.props.context.request.query?.q\r\n ? this.props.context.request.query.q\r\n : this.props.context.request.query?.productId,\r\n false,\r\n this.props.config.updateRefinerPanel,\r\n undefined,\r\n this.catalogId\r\n );\r\n\r\n const refiners = await getCollectionRefinersAction(refinerInput, this.props.context.actionContext);\r\n this.setState({ refiners });\r\n }\r\n }\r\n );\r\n\r\n if (\r\n this.props.config.enableAffiliationBasedPricing &&\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Condition required.\r\n this.props.context.actionContext.requestContext?.user?.isAuthenticated\r\n ) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises -- Call api to retrieve the availabilities data without blocking the UI.\r\n this._getActivePrice();\r\n }\r\n\r\n const context = this.props.context as ICoreContext;\r\n const dimensionsToDisplayOnProductCard = context.app.config.dimensionsInProductCard;\r\n const dimensionsToDisplayAsSwatch = context.app.config.dimensionsAsSwatchType;\r\n if (\r\n ArrayExtensions.hasElements(dimensionsToDisplayOnProductCard) &&\r\n !dimensionsToDisplayOnProductCard.includes(DimensionTypes.none) &&\r\n ArrayExtensions.hasElements(dimensionsToDisplayAsSwatch) &&\r\n !dimensionsToDisplayAsSwatch.includes(DimensionTypes.none) &&\r\n this.props.config.includeAttributes\r\n ) {\r\n await this._getProductsDimensionsAvailabilities();\r\n }\r\n }\r\n\r\n public componentWillUnmount(): void {\r\n if (MsDyn365.isBrowser && window.removeEventListener) {\r\n window.removeEventListener('resize', this._updateViewport);\r\n }\r\n }\r\n\r\n public render(): JSX.Element {\r\n const {\r\n config: { imageSettings, className },\r\n resources,\r\n data: { listPageState, products: productCollection, featureProduct }\r\n } = this.props;\r\n\r\n if (!this.isListPageStateUpdated && listPageState.result && productCollection.result) {\r\n this._updateListPageState(listPageState.result, productCollection.result);\r\n this.isListPageStateUpdated = true;\r\n }\r\n\r\n const products = (this.props.data.listPageState.result && this.props.data.listPageState.result.activeProducts) || [];\r\n const searchProduct = listPageState.result?.featureProduct ?? featureProduct.result ?? null;\r\n let errorText = '';\r\n if (!ArrayExtensions.hasElements(products)) {\r\n errorText = this._pageType === 'Category' ? resources.resultCategoryNotFoundText : resources.resultSearchNotFoundText;\r\n }\r\n const productsComponent = this._getProducts();\r\n const featureComponent = (\r\n \r\n );\r\n\r\n const searchResultContainerViewProps = {\r\n ...this.props,\r\n products: productsComponent,\r\n TitleViewProps: this._getCollectionTitle(),\r\n categoryHierarchy: !this.props.config.disableHierarchy && this._getCategoryHierarchy(),\r\n refineMenu: this._getRefineMenu(),\r\n className: classnames('ms-search-result-container', className),\r\n SearchResultContainer: {\r\n moduleProps: this.props,\r\n className: classnames('ms-search-result-container', className)\r\n },\r\n sortByOptions: this.props.data.listPageState.result?.totalProductCount !== 0 ? this._getSortingDropDown() : null,\r\n pagination: this._getPagination(),\r\n ProductsContainer: { className: 'ms-search-result-container__Products' },\r\n ProductSectionContainer: { className: 'ms-search-result-container__product-section' },\r\n CategoryNavContainer: { className: 'ms-search-result-container__category-nav-section' },\r\n RefineAndProductSectionContainer: { className: 'ms-search-result-container__refine-product-section' },\r\n choiceSummary: this._getChoiceSummary(),\r\n modalToggle:\r\n this.props.data.listPageState.result?.totalProductCount !== 0 ? (\r\n \r\n ) : null,\r\n searchResultModal: this._getSearchResultModal(),\r\n isMobile: this.isMobile,\r\n errorMessage: errorText && ,\r\n FeatureSearchContainer: { className: 'ms-feature-search-result' },\r\n similarLookProduct: searchProduct ? featureComponent : null,\r\n productPrices: this.productPrices\r\n };\r\n return this.props.renderView(searchResultContainerViewProps) as React.ReactElement;\r\n }\r\n\r\n /**\r\n * Update the list page state with initial data.\r\n * @param listPageState -- List page State.\r\n * @param products -- Products.\r\n */\r\n @action\r\n private readonly _updateListPageState = (listPageState: ListPageState, products: IFullProductsSearchResultsWithCount): void => {\r\n let querySorting: SortColumn[] = [];\r\n const defaultPageNumber: number = 10;\r\n\r\n if (this._pageType === 'Category') {\r\n listPageState.pageType = 'Category';\r\n } else {\r\n listPageState.pageType = 'Search';\r\n }\r\n\r\n if (this.props.context.request.query?.sorting) {\r\n querySorting = JSON.parse(decodeURIComponent(this.props.context.request.query.sorting)) as SortColumn[];\r\n }\r\n\r\n listPageState.currentPageNumber =\r\n (this.props.context.request.query &&\r\n +this.props.context.request.query.skip / (this.props.config.itemsPerPage ?? defaultPageNumber)) ||\r\n 0;\r\n listPageState.sortingCritera = { Columns: querySorting };\r\n listPageState.pageSize = this.props.config.itemsPerPage ?? defaultPageNumber;\r\n\r\n // let didSetActiveProductsInSearch = false;\r\n // if (listPageState.pageType === 'Search') {\r\n // const searchTerm = this.props.context.request.query && this.props.context.request.query['search'];\r\n\r\n // if (searchTerm) {\r\n // const match = products.products.find(pr => pr.ItemId?.toLowerCase() === searchTerm.toLowerCase());\r\n // if (match) {\r\n // listPageState.activeProducts = [\r\n // match,\r\n // ...products.products.filter(pr => pr.ItemId?.toLowerCase() !== searchTerm.toLowerCase())\r\n // ];\r\n // didSetActiveProductsInSearch = true;\r\n // }\r\n // }\r\n // }\r\n // if (!didSetActiveProductsInSearch) {\r\n // listPageState.activeProducts = products.products;\r\n // }\r\n\r\n listPageState.totalProductCount = products.count;\r\n listPageState.activeFilters = hydrateRefinersFromUrl(this.props.context.request);\r\n if (this.props.context.request.query?.productId) {\r\n const featureProduct = this.props.data.featureProduct.result;\r\n if (featureProduct) {\r\n listPageState.featureProduct = featureProduct;\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Get products dimension availabilities.\r\n * @returns Void.\r\n */\r\n private readonly _getProductsDimensionsAvailabilities = async (): Promise => {\r\n const productsList = this.props.data.listPageState.result?.activeProducts ?? [];\r\n\r\n const productsDimensionAvailabilities = await getDimensionAvailabilitiesForProductSearchResultAction(\r\n new DimensionAvailabilitiesForProductSearchResultInput(productsList, this.props.context as ICoreContext),\r\n this.props.context.actionContext\r\n );\r\n\r\n if (ArrayExtensions.hasElements(productsDimensionAvailabilities)) {\r\n this.setState({ productsDimensionAvailabilities });\r\n }\r\n };\r\n\r\n /**\r\n * Get the active price for the products.\r\n */\r\n private readonly _getActivePrice = async (): Promise => {\r\n const productsList = this.props.data.listPageState.result?.activeProducts ?? [];\r\n const products = await getPriceForProductSearchResult(\r\n new PriceForProductSearchResultInput(productsList),\r\n this.props.context.actionContext\r\n );\r\n\r\n const listPageState = await this.props.data.listPageState;\r\n listPageState.activeProducts = products;\r\n };\r\n\r\n private readonly _getSearchResultModal = (): ISearchResultModalViewProps => {\r\n const { resources } = this.props;\r\n return SearchResultModal({\r\n resources: {\r\n modalCloseButtonText: resources.modalCloseButtonText,\r\n modalTitle: resources.modalTitle\r\n },\r\n isOpen: this.state.modalIsOpen,\r\n returnRef: this._modalToggleRef,\r\n onModalToggle: this._toggleModal\r\n });\r\n };\r\n\r\n private readonly _getCollectionTitle = (): ITitleViewProps => {\r\n const { data, context, resources } = this.props;\r\n\r\n let collectionTitle: string | undefined = '';\r\n if (context && context.request && context.request.query && context.request.query.q) {\r\n collectionTitle = `\"${context.request.query.q}\"`;\r\n } else {\r\n collectionTitle =\r\n (data.category.result &&\r\n SearchResultContainer.getFriendlyName(context.request.locale, data.category.result.NameTranslations)) ||\r\n (data.category.result && data.category.result.Name);\r\n }\r\n let productCountText = '';\r\n let productCountNumber: number | undefined;\r\n if (data.listPageState && data.listPageState.result && data.listPageState.result.totalProductCount !== undefined) {\r\n productCountNumber = data.listPageState.result.totalProductCount;\r\n } else if (data.products && data.products.result) {\r\n productCountNumber = data.products.result.count;\r\n }\r\n\r\n if (productCountNumber && productCountNumber !== 0) {\r\n productCountText =\r\n productCountNumber !== 1\r\n ? format(this.props.resources.numberOfProducts, productCountNumber)\r\n : this.props.resources.oneProduct;\r\n } else {\r\n productCountText = format(this.props.resources.numberOfProducts, 0);\r\n }\r\n const pageName = context.request.telemetryPageName ? `result-count-${context.request.telemetryPageName.toLowerCase()}` : '';\r\n const titlePrefix = ;\r\n const titleText = collectionTitle && <Title className='ms-search-result__collection-title-text' text={collectionTitle} />;\r\n const titleCount = <Title className='ms-search-result__collection-title-count' text={productCountText} />;\r\n\r\n return {\r\n TitleContainer: { className: `ms-search-result-container__title ${pageName}` },\r\n title: {\r\n titlePrefix,\r\n titleText,\r\n titleCount\r\n }\r\n };\r\n };\r\n\r\n private readonly _getCategoryHierarchy = (): ICategoryHierarchyViewProps => {\r\n const { data } = this.props;\r\n const categoryHierarchy = data.categoryHierarchy.result;\r\n const categoryLinks =\r\n categoryHierarchy &&\r\n categoryHierarchy.map((value: CategoryHierarchyData, index: number) => {\r\n return (\r\n <Link\r\n key={index}\r\n text={value.Name}\r\n ariaLabel={`${this.props.resources.categoryLinkAriaLabel} ${value.Name}`}\r\n href={value.Url}\r\n />\r\n );\r\n });\r\n const categoryLinkSeparator = <Separator separator='/' />;\r\n\r\n return {\r\n CategoryHierarchyContainer: { tag: 'nav', className: 'ms-search-result-container__category-hierarchy' },\r\n categoryHierarchyList: categoryLinks,\r\n categoryHierarchySeparator: categoryLinkSeparator\r\n };\r\n };\r\n\r\n private readonly _getSortingDropDown = (): ISortByViewProps => {\r\n const { resources } = this.props;\r\n const activeDropdown = this._getCurrentlySelectedOption() || this.state.sortingState.selectedSortByOption;\r\n let dropdownOptions = this._getAllSortByOptions();\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- App config settings are of \"any\" value.\r\n if (this.props.context.app.config.hideRating) {\r\n dropdownOptions = dropdownOptions.filter(dropdownOption => dropdownOption.key !== sortOptions.sortByOptionRatingDesc);\r\n }\r\n\r\n const dropdown = (\r\n <LabeledDropdown\r\n labelClassname='reviews-list-sort-by'\r\n labelText={resources.sortByDropdownLabel}\r\n dropdownId='categorySortByDropdown'\r\n dropdownClassname='reviews-list-dropdown'\r\n toggleColor='link'\r\n dropdownOptions={dropdownOptions}\r\n selectedOption={activeDropdown}\r\n onSelectOption={this._updateSortByDropdown}\r\n ref={this._sortAndFilterContainerRef}\r\n />\r\n );\r\n return {\r\n SortingContainer: { className: 'ms-search-result-container__Sort-by-category' },\r\n sortByDropDown: dropdown\r\n };\r\n };\r\n\r\n private readonly _getPagination = (): React.ReactNode => {\r\n const { config, context, data, resources } = this.props;\r\n const listPageState = data.listPageState.result;\r\n const fullUrl = getCurrentUrl(context.request);\r\n const itemsPerPage = config.itemsPerPage || 10;\r\n // eslint-disable-next-line max-len -- existing code\r\n const skipCount = listPageState?.currentPageNumber\r\n ? listPageState.currentPageNumber * (this.props.config.itemsPerPage || 10)\r\n : (this.props.context.request.query && +this.props.context.request.query.skip) || 0;\r\n const totalItems = listPageState?.totalProductCount || 0;\r\n const previousText = resources.flipperPrevious;\r\n const nextText = resources.flipperNext;\r\n\r\n if (totalItems <= itemsPerPage) {\r\n return null;\r\n }\r\n return (\r\n <UncontrolledPagination\r\n className='ms-search-result-container__pagination'\r\n role='navigation'\r\n aria-label={resources.paginationAriaLabel}\r\n url={fullUrl.href}\r\n qsp='skip'\r\n items={totalItems}\r\n itemsPerPage={itemsPerPage}\r\n startingItem={skipCount}\r\n previousText={this._renderPrev(previousText)}\r\n nextText={this._renderNext(nextText)}\r\n previousAriaLabel={previousText}\r\n nextAriaLabel={nextText}\r\n telemetryContent={this.telemetryContent}\r\n />\r\n );\r\n };\r\n\r\n private readonly _getRefineMenu = (): IRefineMenuViewProps => {\r\n const { data, context, config } = this.props;\r\n const tempRangeTypeTODO = context.request.query && context.request.query.inputRange ? 'input' : 'slider';\r\n const validRefiners =\r\n this.props.config.updateRefinerPanel && ArrayExtensions.hasElements(this.state.refiners)\r\n ? this.state.refiners.filter(refiner => {\r\n return ArrayExtensions.hasElements(refiner.Values) && !this._shouldHideFromRefiners(refiner);\r\n })\r\n : data.refiners.result &&\r\n data.refiners.result.filter(refiner => {\r\n return ArrayExtensions.hasElements(refiner.Values) && !this._shouldHideFromRefiners(refiner);\r\n });\r\n\r\n const activeRefiners = (data.listPageState.result && data.listPageState.result.activeFilters) || [];\r\n\r\n this._getexpandRefinerCount(validRefiners && validRefiners.length, config.expandRefinersCount);\r\n const expandedRefiners = this.expandrefinerCount;\r\n const subMenus =\r\n validRefiners &&\r\n validRefiners.map((productRefinerHierarchy: IProductRefinerHierarchy, index: number) => {\r\n return (\r\n <RefineSubmenu\r\n productRefinerHierarchy={productRefinerHierarchy}\r\n selectedRefinerValues={activeRefiners}\r\n refineItemCommonProps={this._refineItemCommonProps}\r\n minValueSliderThumbAriaLabel={this.props.resources.minValueSliderThumbAriaLabel}\r\n maxValueSliderThumbAriaLabel={this.props.resources.maxValueSliderThumbAriaLabel}\r\n key={index}\r\n onUpdateRefiners={this._onUpdateRefiners}\r\n urlBuilder={this._buildRefinerUrl}\r\n isDisabled={false}\r\n isExpandedOnInitialLoad={!!(expandedRefiners && expandedRefiners > index)}\r\n tempRangeTypeTODO={tempRangeTypeTODO}\r\n context={context}\r\n moduleId={this.props.id}\r\n moduleTypeName={this.props.typeName}\r\n telemetryContent={this.telemetryContent}\r\n productCountAriaLabel={this.props.resources.productCountAriaLabel}\r\n refineItemAriaLabel={this.props.resources.refineItemAriaLabel}\r\n refineItemsAriaLabel={this.props.resources.refineItemsAriaLabel}\r\n singleProductCountAriaLabel={this.props.resources.singleProductCountAriaLabel}\r\n isMobile={this.isMobile}\r\n />\r\n );\r\n });\r\n\r\n return {\r\n RefineMenuContainer: { className: 'ms-search-result-container__refine-menu' },\r\n RefinerSectionContainer: { className: 'ms-search-result-container__refiner-section' },\r\n refiners: subMenus\r\n };\r\n };\r\n\r\n /**\r\n * Should hide from refiners.\r\n * @param refiner - The refiner.\r\n * @returns ShouldHideFromRefiners.\r\n */\r\n private readonly _shouldHideFromRefiners = (refiner: IProductRefinerHierarchy): boolean => {\r\n // Always hide sortable attribute since it's just for sorting products in Azure search, not for customers\r\n return (\r\n refiner.RecordId === this.props.data.products.result?.inventoryAwareSortableAttributeId ||\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- app configs are of generic type\r\n (this.props.context.app.config.productListInventoryDisplay === ProductListInventoryFilteringOptions.HideOOS &&\r\n refiner.RecordId === this.props.data.products.result?.channelInventoryConfigurationId)\r\n );\r\n };\r\n\r\n private readonly _getChoiceSummary = (): React.ReactNode => {\r\n const { resources, data, telemetry } = this.props;\r\n const selectedRefiners = (data.listPageState.result && data.listPageState.result.activeFilters) || [];\r\n return (\r\n <ChoiceSummary\r\n classNames='ms-choice-summary-by-category'\r\n clearAllText={resources.clearAllText}\r\n label={resources.choiceSummaryLabel}\r\n closeAriaLabel={resources.closeAriaLabel}\r\n selectedChoices={selectedRefiners}\r\n // @ts-expect-error: NOTE Type-unsafe line below, null refinersByCategoryHierarchy case not handled\r\n refinerHierarchy={data.refiners.result}\r\n choiceFormat={resources.choiceFormat}\r\n choiceRangeValueFormat={resources.choiceRangeValueFormat}\r\n telemetry={telemetry}\r\n onChoiceClicked={this._onChoiceClicked}\r\n urlBuilder={this._buildRefinerUrlForChoiceSummary}\r\n choiceAriaLabel={resources.choiceAriaLabel}\r\n telemetryContent={this.telemetryContent}\r\n context={this.props.context}\r\n channelInventoryConfigurationId={this.props.data.products.result?.channelInventoryConfigurationId}\r\n />\r\n );\r\n };\r\n\r\n /**\r\n * Get Active products.\r\n * @returns - JSX Elements.\r\n */\r\n private readonly _getProducts = (): JSX.Element => {\r\n const {\r\n config: { imageSettings, allowBackNavigation: shouldAllowBackNavigation }\r\n } = this.props;\r\n const { resources } = this.props;\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- Reading config value.\r\n const breadCrumbType: string = this.props.context.app.config.breadcrumbType;\r\n const shouldAllowBack = shouldAllowBackNavigation && (breadCrumbType === 'back' || breadCrumbType === 'categoryAndBack');\r\n\r\n const products = (this.props.data.listPageState.result && this.props.data.listPageState.result.activeProducts) || [];\r\n const quickviewSlot = this.props.slots?.quickview?.[0];\r\n\r\n const isPriceMinMaxFeatureState = this.props.data.featureState.result?.find(\r\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailSearchPriceRangeFeature'\r\n );\r\n return (\r\n <ProductSearchResultItems\r\n products={products}\r\n context={this.props.context}\r\n imageSettings={imageSettings}\r\n resources={resources}\r\n moduleType={this.props.typeName}\r\n moduleId={this.props.id}\r\n allowBackNavigation={shouldAllowBack}\r\n telemetryContent={this.telemetryContent}\r\n quickviewSlot={quickviewSlot}\r\n channelInventoryConfigurationId={this.props.data.products.result?.channelInventoryConfigurationId}\r\n isPriceMinMaxEnabled={isPriceMinMaxFeatureState?.IsEnabled}\r\n productsDimensionAvailabilities={this.state.productsDimensionAvailabilities}\r\n />\r\n );\r\n };\r\n\r\n private readonly _updateSortByDropdown = (notification: ILabeledDropdownOnChangeNotification): void => {\r\n const {\r\n context: { request: requestContext, actionContext }\r\n } = this.props;\r\n\r\n if (!requestContext || !actionContext || !this.props.data.listPageState.result) {\r\n // eslint-disable-next-line max-len -- existing code\r\n const error = `[sort-by-category] cannot sort without context: ${!requestContext ? 'requestContext ' : ''} ${\r\n !actionContext ? 'actionContext ' : ''\r\n } could not be found`;\r\n this.props.telemetry.warning(error);\r\n return;\r\n }\r\n\r\n window.history.pushState(\r\n {},\r\n '',\r\n buildListPageUrl(\r\n getCurrentUrl(this.props.context.request),\r\n undefined,\r\n [this._getSortColumnFromSelectedOption(notification.selectedOption)],\r\n undefined\r\n )\r\n );\r\n transaction(() => {\r\n this.props.data.listPageState.result!.currentPageNumber = 0;\r\n this.props.data.listPageState.result!.sortingCritera = {\r\n Columns: [this._getSortColumnFromSelectedOption(notification.selectedOption)]\r\n };\r\n });\r\n };\r\n\r\n private readonly _getSortColumnFromSelectedOption = (option: ILabeledDropdownOption): SortColumn => {\r\n const { data } = this.props;\r\n\r\n if (!data.searchConfiguration.result) {\r\n return {};\r\n }\r\n\r\n const mappedConfiguration = data.searchConfiguration.result.find(searchConfiguration => {\r\n return searchConfiguration.key === option.key;\r\n });\r\n\r\n if (mappedConfiguration) {\r\n return mappedConfiguration.sortColumn;\r\n }\r\n\r\n return {};\r\n };\r\n\r\n /**\r\n * Retrieves current sort criteria.\r\n * @returns Sort criteria column which is currently active or undefined if it's not specified.\r\n */\r\n private readonly _getSortCriteriaColumn = (): SortColumn | undefined => {\r\n const sortCriteria = this.props.data.listPageState.result?.sortingCritera;\r\n if (ArrayExtensions.hasElements(sortCriteria?.Columns)) {\r\n return sortCriteria!.Columns[0];\r\n }\r\n\r\n const queryColumns = parseQueryParam<SortColumn[]>('sorting', this.props.context.request);\r\n if (ArrayExtensions.hasElements(queryColumns)) {\r\n return queryColumns[0];\r\n }\r\n\r\n return undefined;\r\n };\r\n\r\n /**\r\n * Retrieves dropdown options.\r\n * @returns All dropdown options.\r\n */\r\n private readonly _getAllSortByOptions = (): ILabeledDropdownOption[] => {\r\n const searchConfiguration = this.props.data.searchConfiguration.result;\r\n\r\n if (!searchConfiguration) {\r\n return [];\r\n }\r\n\r\n const mappedSearchConfiguration = this.sortByDropdownOptions.filter(mappedSearchConfig =>\r\n searchConfiguration.find(item => mappedSearchConfig.key === item.key)\r\n );\r\n\r\n return ArrayExtensions.validValues(mappedSearchConfiguration);\r\n };\r\n\r\n /**\r\n * Retrieves current selected dropdown option based on the sort criteria.\r\n * @returns Current dropdown option.\r\n */\r\n private readonly _getCurrentlySelectedOption = (): ILabeledDropdownOption | undefined => {\r\n const activeSortColumn = this._getSortCriteriaColumn();\r\n\r\n const searchConfiguration = this.props.data.searchConfiguration.result;\r\n\r\n if (!activeSortColumn || !searchConfiguration) {\r\n return undefined;\r\n }\r\n\r\n const activeMappedConfig = searchConfiguration.find(\r\n mappedSearchConfig =>\r\n mappedSearchConfig.sortColumn.ColumnName === activeSortColumn.ColumnName &&\r\n mappedSearchConfig.sortColumn.IsDescending === activeSortColumn.IsDescending\r\n );\r\n if (!activeMappedConfig) {\r\n return undefined;\r\n }\r\n\r\n return this.sortByDropdownOptions.find(dropdownOption => dropdownOption.key === activeMappedConfig.key);\r\n };\r\n\r\n private readonly _onUpdateRefiners = (itemToggleNotification: IRefineItemToggleNotification): void => {\r\n const {\r\n context: { request: requestContext, actionContext }\r\n } = this.props;\r\n\r\n if (!requestContext || !actionContext || !this.props.data.listPageState.result) {\r\n const error = `Refine menu cannot refine search criteria: \r\n ${!requestContext ? 'requestContext ' : ''} ${!actionContext ? 'actionContext ' : ''} could not be found`;\r\n this.props.telemetry.warning(error);\r\n return;\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Server side the list PageState will not be called.\r\n const updatedRefinementCriteria = getUpdatedRefinementCriteria(\r\n itemToggleNotification,\r\n this.props.data.listPageState.result?.activeFilters || []\r\n );\r\n\r\n window.history.pushState({}, '', buildListPageUrl(getCurrentUrl(this.props.context.request), updatedRefinementCriteria));\r\n transaction(() => {\r\n this.props.data.listPageState.result!.currentPageNumber = 0;\r\n this.props.data.listPageState.result!.activeFilters = updatedRefinementCriteria;\r\n });\r\n };\r\n\r\n private readonly _buildRefinerUrl = (itemToggleNotification: IRefineItemToggleNotification): string => {\r\n if (this.props.data.listPageState.result) {\r\n const newRefinementCriteria = getUpdatedRefinementCriteria(\r\n itemToggleNotification,\r\n this.props.data.listPageState.result.activeFilters || []\r\n );\r\n\r\n return buildListPageUrl(getCurrentUrl(this.props.context.request), newRefinementCriteria);\r\n }\r\n this.props.telemetry.warning('[buildRefinerQueryString]List Page State Not available, unable to build refiner URL');\r\n return '';\r\n };\r\n\r\n private readonly _onChoiceClicked = (notification: IChoiceSummaryClickNotification): void => {\r\n const { data, telemetry } = this.props;\r\n\r\n if (!data.listPageState.result) {\r\n telemetry.warning('[choice-summary-by-category._onChoiceClicked]ListPageState unavailable, unable to update refiners.');\r\n return;\r\n }\r\n\r\n let currentRefinementCriteria = (data.listPageState.result && data.listPageState.result.activeFilters) || [];\r\n\r\n if (!notification.clearAll) {\r\n const selectedChoice = notification.choiceClicked;\r\n if (!selectedChoice) {\r\n telemetry.warning('[choice-summary-by-category._onChoiceClicked] Choice could not be determined');\r\n return;\r\n }\r\n currentRefinementCriteria = currentRefinementCriteria.filter(\r\n (selectedCriterion: ProductRefinerValue) => !isMatchingRefinementCriterion(selectedChoice, selectedCriterion)\r\n );\r\n } else {\r\n currentRefinementCriteria = [];\r\n\r\n // Set focus to sort and filter\r\n const dropdownElementId = this._sortAndFilterContainerRef.current && this._sortAndFilterContainerRef.current.props.dropdownId;\r\n const dropdownElement = dropdownElementId && document.getElementById(dropdownElementId);\r\n setTimeout(() => {\r\n dropdownElement && dropdownElement.focus();\r\n }, 50);\r\n }\r\n\r\n const fullUrl = getCurrentUrl(this.props.context.request);\r\n window.history.pushState({}, '', buildListPageUrl(fullUrl, currentRefinementCriteria));\r\n data.listPageState.result.currentPageNumber = 0;\r\n data.listPageState.result.activeFilters = currentRefinementCriteria;\r\n };\r\n\r\n private readonly _buildRefinerUrlForChoiceSummary = (selectedRefiner: ProductRefinerValue, isClearAll: boolean): string => {\r\n const { data, telemetry } = this.props;\r\n const fullUrl = getCurrentUrl(this.props.context.request);\r\n\r\n if (!data.listPageState.result) {\r\n telemetry.warning('[choice-summary-by-category._buildRefinerUrl]ListPageState unavailable, unable to create refiner URL.');\r\n return fullUrl.href;\r\n }\r\n\r\n let currentRefinementCriteria = (data.listPageState.result && data.listPageState.result.activeFilters) || [];\r\n\r\n if (!isClearAll) {\r\n if (!selectedRefiner) {\r\n telemetry.warning('[choice-summary-by-category._buildRefinerUrl] URL for Choice could not be determined');\r\n return fullUrl.href;\r\n }\r\n currentRefinementCriteria = currentRefinementCriteria.filter(\r\n (selectedCriterion: ProductRefinerValue) => !isMatchingRefinementCriterion(selectedRefiner, selectedCriterion)\r\n );\r\n } else {\r\n currentRefinementCriteria = [];\r\n }\r\n\r\n return buildListPageUrl(fullUrl, currentRefinementCriteria);\r\n };\r\n\r\n private _getViewport(): GridSize {\r\n if (MsDyn365.isBrowser) {\r\n return isMobile({ variant: VariantType.Browser, context: this.props.context.request });\r\n }\r\n return isMobile({ variant: VariantType.Viewport, context: this.props.context.request });\r\n }\r\n\r\n private _toggleModal(): void {\r\n this.setState({\r\n modalIsOpen: !this.state.modalIsOpen\r\n });\r\n }\r\n\r\n private _updateViewport(): void {\r\n this._viewport = this._getViewport();\r\n\r\n if (this.state.modalIsOpen && !this.isMobile) {\r\n this._toggleModal();\r\n }\r\n }\r\n\r\n private readonly _getexpandRefinerCount = (validRefiners?: number, refinerCount?: expandRefinersCount): void => {\r\n switch (refinerCount) {\r\n case expandRefinersCount.all:\r\n this.expandrefinerCount = validRefiners;\r\n break;\r\n case expandRefinersCount.one:\r\n this.expandrefinerCount = 1;\r\n break;\r\n case expandRefinersCount.two:\r\n this.expandrefinerCount = 2;\r\n break;\r\n case expandRefinersCount.three:\r\n this.expandrefinerCount = 3;\r\n break;\r\n case expandRefinersCount.four:\r\n this.expandrefinerCount = 4;\r\n break;\r\n default:\r\n this.expandrefinerCount = 0;\r\n }\r\n };\r\n\r\n /**\r\n * Renders a Pagination previous text.\r\n * @param paginationPreviousText - Pagination previous text from resources.\r\n * @returns Previous text and flipper icon.\r\n */\r\n private readonly _renderPrev = (paginationPreviousText: string) => {\r\n return (\r\n <div className='msc-pagination__prev'>\r\n <span className='ms-search-result__pagination-left' aria-hidden='true' />\r\n <span className='prev-text'>{paginationPreviousText}</span>\r\n </div>\r\n );\r\n };\r\n\r\n /**\r\n * Renders a Pagination next text.\r\n * @param paginationNextText - Pagination next text from resources.\r\n * @returns Next text and flipper icon.\r\n */\r\n private readonly _renderNext = (paginationNextText: string) => {\r\n return (\r\n <div className='msc-pagination__next'>\r\n <span className='next-text'>{paginationNextText}</span>\r\n <span className='ms-search-result__pagination-right' aria-hidden='true' />\r\n </div>\r\n );\r\n };\r\n}\r\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 { IPriceComponentResources } from '../../themes/gardner-theme/views/components/price.component';\r\nimport { ProductPrice, ProductSearchResult, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { ArrayExtensions, getProductPageUrlSync } from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n ICategoryHierarchyViewProps,\r\n IRefineMenuViewProps,\r\n ISearchResultContainerViewProps,\r\n ISearchResultModalViewProps,\r\n ISortByViewProps,\r\n ITitleViewProps\r\n} from '@msdyn365-commerce-modules/search-result-container';\r\nimport { Button, getTelemetryObject, IPopupProps, Module, Node, Popup } from '@msdyn365-commerce-modules/utilities';\r\nimport React, { PropsWithChildren, useState } from 'react';\r\nimport { ISearchResultContainerProps } from '../../themes/gardner-theme/definition-extensions/search-result-container.ext.props.autogenerated';\r\nimport { ProductComponent } from '../../themes/gardner-theme/views/components/product.component';\r\nimport { getUrlSync, IGridSettings, IImageData, IImageProps, IImageSettings, Image, IRequestContext } from '@msdyn365-commerce/core';\r\nimport { AddToCartListComponent } from '../../themes/gardner-theme/views/components/addToCart.component';\r\nimport { IProductSearchResultExtensionData } from '../../themes/gardner-theme/views/product-result-container.data';\r\nimport Table from 'reactstrap/lib/Table';\r\nimport { LoginToViewPricingComponent } from '../../components/LoginToViewPricing.component';\r\nimport { SupersessionKey } from '../../themes/gardner-theme/models/SupersessionKey';\r\nimport { CommercePropertyValueEnum } from '../../modules/allowable-freight/utils/CommercePropertyValueEnum';\r\nimport getExtensionPropertyValueByKey from '../../utils/getExtensionPropertyValueByKey';\r\nimport { EligibleItems } from '../../modules/eve-quick-order/eve-quick-order';\r\nimport GetProductEligibilityAction, { GetProductEligibilityInput } from '../../actions/get-product-eligibility.action';\r\n/**\r\n * DescriptionInterval.\r\n */\r\nenum DescriptionInterval {\r\n productDescriptionInterval = 14,\r\n productDescriptionIntervalRemainder0 = 0,\r\n productDescriptionIntervalRemainder9 = 9\r\n}\r\n\r\n/**\r\n * Render Clear button for mobile viewport.\r\n * @param props - The view props.\r\n * @returns The JSX Element.\r\n */\r\nconst renderProductCards = (\r\n props: PropsWithChildren<ISearchResultContainerViewProps & ISearchResultContainerProps<{}>>\r\n): JSX.Element | null => {\r\n const products = props.data.listPageState.result?.activeProducts;\r\n if (!products || !ArrayExtensions.hasElements(products)) {\r\n return null;\r\n }\r\n return (\r\n <Node {...props.ProductsContainer}>\r\n {props.errorMessage}\r\n <ul className='list-unstyled'>\r\n {products.map((product: ProductSearchResult, index: number) => renderProductCardsDescription(props, product, index, false))}\r\n </ul>\r\n </Node>\r\n );\r\n};\r\n\r\n/**\r\n * Returns the product inventory label.\r\n * @param channelInventoryConfigurationId - The channel configuration Id.\r\n * @param product - The product.\r\n * @returns The inventory label.\r\n */\r\nfunction getInventoryLabel(channelInventoryConfigurationId: number | undefined, product: ProductSearchResult): string | undefined {\r\n if (!channelInventoryConfigurationId || !ArrayExtensions.hasElements(product.AttributeValues)) {\r\n return undefined;\r\n }\r\n const inventoryAttribute = product.AttributeValues.find(attribute => attribute.RecordId === channelInventoryConfigurationId);\r\n if (inventoryAttribute) {\r\n return inventoryAttribute.TextValue;\r\n }\r\n return undefined;\r\n}\r\n\r\n/**\r\n * Render Clear button for mobile viewport.\r\n * @param props - The view props.\r\n * @param product - The product item data.\r\n * @param index - The index of each product item.\r\n * @param isEnabledProductDescription - The flag for showing Product desription tile.\r\n * @returns The JSX Element.\r\n */\r\nconst renderProductCardsDescription = (\r\n props: PropsWithChildren<ISearchResultContainerViewProps & ISearchResultContainerProps<{}>>,\r\n product: ProductSearchResult,\r\n index: number,\r\n isEnabledProductDescription?: boolean\r\n): JSX.Element | null => {\r\n const { config, context, resources } = props;\r\n const telemetryContent = getTelemetryObject(props.context.request.telemetryPageName!, props.friendlyName, props.telemetry);\r\n const breadCrumbType = props.context.app.config.breadcrumbType;\r\n const isAllowBack = props.config.allowBackNavigation && (breadCrumbType === 'back' || breadCrumbType === 'categoryAndBack');\r\n const classname = isEnabledProductDescription\r\n ? 'ms-product-search-result__item product__description'\r\n : 'ms-product-search-result__item';\r\n const quickviewslot = ArrayExtensions.hasElements(props.slots.quickview) ? props.slots.quickview[0] : undefined;\r\n const channelInventoryConfigurationId = props.data.products.result?.channelInventoryConfigurationId;\r\n // @ts-ignore\r\n const isPriceMinMaxFeatureState = props.data.featureState.result?.find(\r\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailSearchPriceRangeFeature'\r\n );\r\n const priceResources: IPriceComponentResources = {\r\n priceRangeSeparator: resources.priceRangeSeparator,\r\n loginToViewPricingText: resources.loginToViewPricing\r\n };\r\n return (\r\n <li className={classname} key={index}>\r\n <ProductComponent\r\n context={context}\r\n telemetryContent={telemetryContent}\r\n imageSettings={config.imageSettings}\r\n freePriceText={resources.priceFree}\r\n originalPriceText={resources.originalPriceText}\r\n currentPriceText={resources.currentPriceText}\r\n ratingAriaLabel={resources.ratingAriaLabel}\r\n allowBack={isAllowBack}\r\n id={props.id}\r\n typeName={props.typeName}\r\n data={{ product }}\r\n quickViewButton={quickviewslot}\r\n isEnabledProductDescription={isEnabledProductDescription}\r\n inventoryLabel={getInventoryLabel(channelInventoryConfigurationId, product)}\r\n isPriceMinMaxEnabled={isPriceMinMaxFeatureState?.IsEnabled}\r\n priceResources={priceResources}\r\n />\r\n </li>\r\n );\r\n};\r\n\r\n/**\r\n * Render Clear button for mobile viewport.\r\n * @param props - The view props.\r\n * @returns The JSX Element.\r\n */\r\nconst renderProducts = (\r\n props: PropsWithChildren<ISearchResultContainerViewProps & ISearchResultContainerProps<{}>>\r\n): JSX.Element | null => {\r\n const products = props.data.listPageState.result?.activeProducts;\r\n if (!products || !ArrayExtensions.hasElements(products)) {\r\n return null;\r\n }\r\n const productDescriptionInterval: number = DescriptionInterval.productDescriptionInterval;\r\n const productDescriptionIntervalRemainder0: number = DescriptionInterval.productDescriptionIntervalRemainder0;\r\n const productDescriptionIntervalRemainder9: number = DescriptionInterval.productDescriptionIntervalRemainder9;\r\n return (\r\n <Node {...props.ProductsContainer}>\r\n {props.errorMessage}\r\n <ul className='list-unstyled'>\r\n {products.map((product: ProductSearchResult, index: number) =>\r\n index % productDescriptionInterval === productDescriptionIntervalRemainder0 ||\r\n index % productDescriptionInterval === productDescriptionIntervalRemainder9\r\n ? renderProductCardsDescription(props, product, index, true)\r\n : renderProductCardsDescription(props, product, index, false)\r\n )}\r\n </ul>\r\n </Node>\r\n );\r\n};\r\n\r\n/**\r\n * Render Title Count.\r\n * @param props - The title view props.\r\n * @returns The JSX Element.\r\n */\r\nconst renderTitleCount = (props: ITitleViewProps): JSX.Element | null => {\r\n const { title, TitleContainer } = props;\r\n return (\r\n <>\r\n <Node {...TitleContainer}>{title.titleCount}</Node>\r\n Not finding what you are looking for?\r\n </>\r\n );\r\n};\r\n\r\n/**\r\n * Render Category Hierarchy.\r\n * @param props - The category hierarchy view props.\r\n * @returns The JSX Element.\r\n */\r\nconst renderCategoryHierarchy = (props: ICategoryHierarchyViewProps): JSX.Element | null => {\r\n const { CategoryHierarchyContainer, categoryHierarchyList, categoryHierarchySeparator } = props;\r\n if (categoryHierarchyList) {\r\n return (\r\n <Node {...CategoryHierarchyContainer}>\r\n {categoryHierarchyList.map((category, index) => (\r\n <React.Fragment key={index}>\r\n {category}\r\n {categoryHierarchyList && categoryHierarchyList[index + 1] && categoryHierarchySeparator}\r\n </React.Fragment>\r\n ))}\r\n </Node>\r\n );\r\n }\r\n\r\n return null;\r\n};\r\n\r\n/**\r\n * Render the category page items.\r\n * @param props - The view props.\r\n * @returns The search Result container module view.\r\n */\r\nconst SearchResultContainerView: React.FC<ISearchResultContainerViewProps &\r\n ISearchResultContainerProps<IProductSearchResultExtensionData>> = props => {\r\n const {\r\n SearchResultContainer,\r\n pagination,\r\n ProductSectionContainer,\r\n choiceSummary,\r\n isMobile,\r\n modalToggle,\r\n searchResultModal,\r\n TitleViewProps,\r\n refineMenu,\r\n categoryHierarchy,\r\n sortByOptions,\r\n CategoryNavContainer,\r\n RefineAndProductSectionContainer,\r\n FeatureSearchContainer,\r\n similarLookProduct,\r\n errorMessage,\r\n productPrices,\r\n context: {\r\n request,\r\n cultureFormatter,\r\n actionContext,\r\n actionContext: {\r\n requestContext: {\r\n gridSettings,\r\n user: { isAuthenticated }\r\n }\r\n }\r\n },\r\n resources: {\r\n filterText,\r\n partNoHeading,\r\n descriptionHeading,\r\n availabilityHeading,\r\n listPriceHeading,\r\n yourPriceHeading,\r\n loginToViewPricing,\r\n goToCartText,\r\n continueShoppingText,\r\n addToCartModalHeading,\r\n addToCartText\r\n },\r\n data: { cart, listPageState: productSearchResults },\r\n config: { enableProdutDescription, listView, imageSettings }\r\n } = props;\r\n\r\n const [eligbilityList, setEligbilityList] = useState<EligibleItems>([]);\r\n\r\n const getProductEligibility = async (): Promise<void> => {\r\n const itemIds = props.data.products?.result?.products.map(p => p.ItemId!) || [];\r\n if (!itemIds.length) {\r\n return;\r\n }\r\n\r\n // const addressId: string = props.context.request.cookies.getCheckoutCartCookie();\r\n const input = new GetProductEligibilityInput(itemIds, false, cart?.result?.cart?.Id || '', null, null, null);\r\n const eligibilityData = await GetProductEligibilityAction(input, props.context.actionContext);\r\n const list: EligibleItems = [];\r\n\r\n eligibilityData.forEach((i: any) => {\r\n const id = getExtensionPropertyValueByKey(i.ExtensionProperties, 'ItemId', CommercePropertyValueEnum.string);\r\n list.push({\r\n ItemId: String(id),\r\n IsEligible: i.IsEligible\r\n });\r\n });\r\n setEligbilityList(list);\r\n // getProductEligibilityAsync({ callerContext: props.context.actionContext }, itemIds, 0, addressId?.split(':')[1] || '').then(\r\n // (result: any) => {\r\n // const list: EligibleItems = [];\r\n //\r\n // result.forEach((i: any) => {\r\n // const id = getExtensionPropertyValueByKey(i.ExtensionProperties, 'ItemId', CommercePropertyValueEnum.string);\r\n // list.push({\r\n // ItemId: String(id),\r\n // IsEligible: i.IsEligible\r\n // });\r\n // });\r\n // setEligbilityList(list);\r\n // }\r\n // );\r\n };\r\n\r\n React.useEffect(() => {\r\n if (isAuthenticated) {\r\n void getProductEligibility();\r\n }\r\n }, [props.data]);\r\n\r\n const [isExpanded, setIsExpanded] = useState<boolean>(false);\r\n const [modalOpen, setModalOpen] = React.useState<boolean>(false);\r\n const [addedProduct, setAddedProduct] = React.useState<SimpleProduct | undefined>(undefined);\r\n const [productPricing, setProductPricing] = React.useState<ProductPrice | undefined>(undefined);\r\n const toggle = () => {\r\n setIsExpanded(!isExpanded);\r\n };\r\n\r\n const isRecoSearchPage = props.context.actionContext.requestContext.query?.recommendation;\r\n\r\n const setModalProps = (product: SimpleProduct, price: ProductPrice): IPopupProps => {\r\n return {\r\n modalOpen: modalOpen,\r\n context: props.context,\r\n className: 'list-view__modal',\r\n gridSettings,\r\n imageSettings,\r\n priceComponent: props.component,\r\n id: '1',\r\n productQuantity: 1,\r\n navigationUrl: getUrlSync('cart', actionContext),\r\n setModalOpen: value => setModalOpen(value),\r\n typeName: 'Add To Cart',\r\n data: { product, price },\r\n dialogStrings: {\r\n goToCartText: goToCartText,\r\n currentPriceText: '',\r\n continueShoppingText: continueShoppingText,\r\n freePriceText: '',\r\n headerItemOneText: addToCartModalHeading,\r\n headerItemFormatText: '',\r\n originalPriceText: '',\r\n headerMessageText: ''\r\n }\r\n };\r\n };\r\n\r\n const handleAddToCart = (productId: number, quantity: number) => {\r\n const foundProduct = productSearchResults.result?.activeProducts.find(pr => pr.RecordId === productId);\r\n if (!foundProduct) {\r\n return;\r\n }\r\n const product: SimpleProduct = {\r\n BasePrice: foundProduct.BasePrice || foundProduct.Price,\r\n AdjustedPrice: foundProduct.Price,\r\n Name: foundProduct.Name,\r\n RecordId: foundProduct.RecordId,\r\n ItemId: foundProduct.ItemId,\r\n ProductTypeValue: 1,\r\n Price: foundProduct.Price\r\n };\r\n setAddedProduct(product);\r\n setProductPricing(getProductPrice(productPrices, product.RecordId));\r\n cart.result\r\n ?.addProductToCart({\r\n product,\r\n count: quantity,\r\n catalogId: 0\r\n })\r\n .then(response => {\r\n if (response.status === 'SUCCESS' && props.app.config.addToCartBehavior === 'showModal') {\r\n setModalOpen(true);\r\n }\r\n });\r\n };\r\n\r\n const getProductSupersessionProperty = (product: ProductSearchResult, extensionKey: SupersessionKey) => {\r\n const properties = product.ExtensionProperties;\r\n if (properties) {\r\n return properties.find(pr => pr.Key === extensionKey)?.Value?.StringValue || null;\r\n }\r\n return null;\r\n };\r\n\r\n const renderAddtoCartButton = (pr: ProductSearchResult, courseId: any, courseInCartText: string) => {\r\n if (isAuthenticated) {\r\n if (courseId) {\r\n return (\r\n <td>\r\n <div className='eduerrors'>{courseInCartText}</div>\r\n </td>\r\n );\r\n }\r\n\r\n if (props.data.cart.result?.hasInvoiceLine) {\r\n return (\r\n <td>\r\n <div className='eduerrors'>{props.resources.invoiceInCartText}</div>\r\n </td>\r\n );\r\n } else {\r\n const item: any = eligbilityList.find(i => i.ItemId === pr.ItemId);\r\n\r\n return item?.IsEligible ? (\r\n <AddToCartListComponent productId={pr.RecordId} onAddToCart={handleAddToCart} addToCartButtonText={addToCartText} />\r\n ) : (\r\n <td colSpan={2} style={{ textAlign: 'right' }}>\r\n {item?.ItemId ? props.resources.productEligibilityText : ' '}\r\n </td>\r\n );\r\n }\r\n }\r\n return null;\r\n };\r\n\r\n const _renderProductsListView = () => {\r\n const { courseInCartText } = props.resources;\r\n let courseId: string | number | boolean | null | undefined;\r\n const cart = props.data.cart.result?.cart;\r\n const cartlines = cart?.CartLines;\r\n if (cartlines && cartlines.length) {\r\n courseId = getExtensionPropertyValueByKey(cartlines[0].ExtensionProperties, 'CourseId', CommercePropertyValueEnum.string);\r\n }\r\n return (\r\n <Table className={'list-view__table'}>\r\n <thead>\r\n <tr>\r\n <th />\r\n <th>{partNoHeading}</th>\r\n <th>{descriptionHeading}</th>\r\n <th>{availabilityHeading}</th>\r\n <th>{listPriceHeading}</th>\r\n <th>{yourPriceHeading}</th>\r\n {isAuthenticated ? (\r\n <>\r\n <th>Quantity</th>\r\n <th />\r\n </>\r\n ) : null}\r\n </tr>\r\n </thead>\r\n <tbody>\r\n {productSearchResults.result?.activeProducts.map(pr => {\r\n // const pricing = getProductPrice(productPrices, pr.RecordId);\r\n // const inventoryLabel = getInventoryLabel(configurationObject?.result?.channelInventoryConfigurationId, pr);\r\n const priceComponent = <span>{cultureFormatter.formatCurrency(pr.Price)}</span>;\r\n return (\r\n <tr key={pr.RecordId}>\r\n <td>\r\n {renderProductPlacementImage(\r\n imageSettings,\r\n gridSettings,\r\n `/Products/${pr.ItemId}_000_001.png`,\r\n pr.PrimaryImageUrl,\r\n pr.Name,\r\n request\r\n )}\r\n </td>\r\n <td>\r\n <a href={getProductPageUrlSync(pr.Name!, pr.RecordId, actionContext)}>{pr.ItemId}</a>\r\n <br />\r\n {getProductSupersessionProperty(pr, SupersessionKey.SupersededId) ? (\r\n <p className={'supersession-text'}>\r\n Superseded From: {getProductSupersessionProperty(pr, SupersessionKey.SupersededId)}\r\n </p>\r\n ) : null}\r\n </td>\r\n <td>\r\n {pr.Name}\r\n <br />\r\n {getProductSupersessionProperty(pr, SupersessionKey.SupersededName) ? (\r\n <p className={'supersession-text'}>\r\n Superseded From: {getProductSupersessionProperty(pr, SupersessionKey.SupersededName)}\r\n </p>\r\n ) : null}\r\n </td>\r\n <td>{getProductSupersessionProperty(pr, SupersessionKey.Inventory)}</td>\r\n <td>{LoginToViewPricingComponent(props.context.request, loginToViewPricing, priceComponent, true)}</td>\r\n <td>{!isAuthenticated ? null : cultureFormatter.formatCurrency(pr.Price)}</td>\r\n {renderAddtoCartButton(pr, courseId, courseInCartText)}\r\n </tr>\r\n );\r\n })}\r\n </tbody>\r\n </Table>\r\n );\r\n };\r\n\r\n if (isMobile) {\r\n return (\r\n <Module {...SearchResultContainer}>\r\n {similarLookProduct ? null : (\r\n <Node {...CategoryNavContainer}>\r\n {renderCategoryHierarchy(categoryHierarchy)}\r\n {renderTitle(TitleViewProps)}\r\n {renderTitleCount(TitleViewProps)}\r\n </Node>\r\n )}\r\n {choiceSummary}\r\n <Node className='msc-sort-filter-wrapper'>{modalToggle}</Node>\r\n {createSearchResultModal(searchResultModal, refineMenu, sortByOptions, isRecoSearchPage)}\r\n <Node {...FeatureSearchContainer}>{similarLookProduct}</Node>\r\n {errorMessage}\r\n {enableProdutDescription ? renderProducts(props) : renderProductCards(props)}\r\n {pagination}\r\n </Module>\r\n );\r\n }\r\n return (\r\n <Module {...SearchResultContainer}>\r\n {/* @ts-ignore */}\r\n {modalOpen && addedProduct ? <Popup {...setModalProps(addedProduct, productPricing)} /> : null}\r\n {similarLookProduct ? null : (\r\n <Node {...CategoryNavContainer}>\r\n {categoryHierarchy && renderCategoryHierarchy(categoryHierarchy)}\r\n {TitleViewProps && renderTitle(TitleViewProps)}\r\n {TitleViewProps && renderTitleCount(TitleViewProps)}\r\n </Node>\r\n )}\r\n <Node {...FeatureSearchContainer}>{similarLookProduct}</Node>\r\n <Node {...RefineAndProductSectionContainer}>\r\n <Node className='ms-refiner-heading'>\r\n <Node className='ms-refiner-heading_title'>\r\n <Button\r\n className={isExpanded ? 'ms-refine-filter__toggle_expanded' : 'ms-refine-filter__toggle_collapsed'}\r\n aria-label='Filter'\r\n onClick={toggle}\r\n aria-expanded={isExpanded}\r\n tabIndex={0}\r\n >\r\n {filterText}\r\n </Button>\r\n <div className='ms-search-result-wrapper-title-choice-summary'>{choiceSummary}</div>\r\n <div className='ms-search-result-wrapper-sort-by-category'>\r\n {sortByOptions && !isRecoSearchPage && renderSort(sortByOptions)}\r\n </div>\r\n </Node>\r\n {refineMenu && isExpanded && renderRefiner(refineMenu)}\r\n </Node>\r\n <Node {...ProductSectionContainer}>\r\n {errorMessage}\r\n {/*{enableProdutDescription ? renderProducts(props) : renderProductCards(props)}*/}\r\n {listView ? _renderProductsListView() : enableProdutDescription ? renderProducts(props) : renderProductCards(props)}\r\n {pagination}\r\n </Node>\r\n </Node>\r\n </Module>\r\n );\r\n};\r\n\r\n/**\r\n * Render Search result Modal.\r\n * @param modalProps - The Search Result Modal view props.\r\n * @param refineMenu - The Refine Menu view props.\r\n * @param sortByDropDown - The Sort by view props.\r\n * @param isRecoSearchPage - The recomandation search page flag.\r\n * @returns The JSX Element.\r\n */\r\nconst createSearchResultModal = (\r\n modalProps: ISearchResultModalViewProps,\r\n refineMenu: IRefineMenuViewProps,\r\n sortByDropDown: ISortByViewProps,\r\n isRecoSearchPage?: string\r\n): JSX.Element => {\r\n return React.cloneElement(\r\n modalProps.modal,\r\n {},\r\n modalProps.modalHeader,\r\n createModalBody(modalProps, refineMenu, sortByDropDown, isRecoSearchPage),\r\n modalProps.modalFooter\r\n );\r\n};\r\n\r\n/**\r\n * Render Refiner Mobile.\r\n * @param props - The Refine Menu view props.\r\n * @returns The JSX Element.\r\n */\r\nconst renderRefinerMobile = (props: IRefineMenuViewProps): JSX.Element | null => {\r\n const { refiners, RefineMenuContainer, RefinerSectionContainer } = props;\r\n if (refiners) {\r\n return (\r\n <Node {...RefinerSectionContainer}>\r\n <Node {...RefineMenuContainer}>\r\n {refiners.map((submenu, index) => (\r\n <React.Fragment key={index}>{submenu}</React.Fragment>\r\n ))}\r\n </Node>\r\n </Node>\r\n );\r\n }\r\n return null;\r\n};\r\n\r\n/**\r\n * Render Search result Body.\r\n * @param props - The Search Result Modal view props.\r\n * @param refineMenu - The Refine Menu view props.\r\n * @param sortByDropDown - The Sort by view props.\r\n * @param isRecoSearchPage - The recomandation search page flag.\r\n * @returns The JSX Element.\r\n */\r\nconst createModalBody = (\r\n props: ISearchResultModalViewProps,\r\n refineMenu: IRefineMenuViewProps,\r\n sortByDropDown: ISortByViewProps,\r\n isRecoSearchPage?: string\r\n): JSX.Element | null => {\r\n if (sortByDropDown) {\r\n return React.cloneElement(props.modalBody, {}, renderSort(sortByDropDown, isRecoSearchPage), renderRefinerMobile(refineMenu));\r\n }\r\n return null;\r\n};\r\n\r\n/**\r\n * Render Refiner.\r\n * @param props - The Refine Menu view props.\r\n * @returns The JSX Element.\r\n */\r\nconst renderRefiner = (props: IRefineMenuViewProps): JSX.Element | null => {\r\n const { refiners, RefineMenuContainer, RefinerSectionContainer } = props;\r\n if (refiners) {\r\n return (\r\n <Node {...RefinerSectionContainer}>\r\n <Node {...RefineMenuContainer}>\r\n {refiners.map((submenu, index) => (\r\n <React.Fragment key={index}>{submenu}</React.Fragment>\r\n ))}\r\n </Node>\r\n </Node>\r\n );\r\n }\r\n return null;\r\n};\r\n\r\n/**\r\n * Render sort by drop down.\r\n * @param props - The sort by view props.\r\n * @param isRecoSearchPage - The recomandation search page flag.\r\n * @returns The JSX Element.\r\n */\r\nconst renderSort = (props: ISortByViewProps, isRecoSearchPage?: string): JSX.Element | null => {\r\n const { SortingContainer, sortByDropDown } = props;\r\n if (sortByDropDown && !isRecoSearchPage) {\r\n return <Node {...SortingContainer}>{sortByDropDown}</Node>;\r\n }\r\n return null;\r\n};\r\n\r\n/**\r\n * Render Title.\r\n * @param props - The title view props.\r\n * @returns The JSX Element.\r\n */\r\nconst renderTitle = (props: ITitleViewProps): JSX.Element | null => {\r\n const { title, TitleContainer } = props;\r\n if (title) {\r\n return (\r\n <Node {...TitleContainer}>\r\n <Node tag='h1' className=''>\r\n {title.titlePrefix}\r\n {title.titleText}\r\n </Node>\r\n </Node>\r\n );\r\n }\r\n return null;\r\n};\r\n\r\nconst renderProductPlacementImage = (\r\n productCardimageSettings?: IImageSettings,\r\n gridSettings?: IGridSettings,\r\n imageUrl?: string,\r\n fallbackImageUrl?: string,\r\n altText?: string,\r\n requestContext?: IRequestContext\r\n): JSX.Element | null => {\r\n if (!imageUrl || !gridSettings || !productCardimageSettings) {\r\n return null;\r\n }\r\n if (productCardimageSettings) {\r\n productCardimageSettings.viewports = {\r\n lg: { h: 100, w: 100, q: '80' },\r\n md: { h: 100, w: 100, q: '80' },\r\n sm: { h: 100, w: 100, q: '80' },\r\n xs: { h: 100, w: 100, q: '80' }\r\n };\r\n }\r\n const image: IImageData = {\r\n src: imageUrl,\r\n altText: altText ? altText : '',\r\n fallBackSrc: fallbackImageUrl\r\n };\r\n const imageProps: IImageProps = { gridSettings };\r\n\r\n imageProps.gridSettings = gridSettings;\r\n imageProps.imageSettings = productCardimageSettings;\r\n imageProps.imageSettings.cropFocalRegion = true;\r\n return <Image {...image} {...imageProps} loadFailureBehavior='empty' requestContext={requestContext} className={'eve-listview__img'} />;\r\n};\r\n\r\nconst getProductPrice = (pricing: ProductPrice[] | undefined, productRecId: number): ProductPrice | undefined => {\r\n if (!pricing) {\r\n return undefined;\r\n }\r\n return pricing.find(pr => pr.ProductId === productRecId);\r\n};\r\n\r\nexport default SearchResultContainerView;\r\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 { AddToCartBehavior } from '@msdyn365-commerce/components';\r\nimport MsDyn365, { getUrlSync, IDictionary, TelemetryEvent } from '@msdyn365-commerce/core';\r\n// @ts-ignore\r\nimport { ICartIconViewProps, ICartViewProps, IFlyoutCartLineItemViewProps } from '@msdyn365-commerce-modules/cart';\r\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { Button, getPayloadObject, INodeProps, KeyCodes, Modal, Node, onTelemetryClick,getTelemetryAttributes, getTelemetryObject,\r\n ITelemetryContent, TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport React from 'react';\r\nimport { validateCartAsync } from '@msdyn365-commerce-modules/cart-utilities';\r\n\r\nimport { ICartIconProps as ICartIconExtensionProps } from '../definition-extensions/cart-icon.ext.props.autogenerated';\r\n\r\n/**\r\n * ICartIconViewState: Interface for Cart Icon View State.\r\n */\r\ninterface ICartIconViewState {\r\n isModalOpen: boolean;\r\n isCartValid: boolean;\r\n isQuantityLimitsFeatureEnabled: boolean;\r\n}\r\n\r\n/**\r\n * Render Cart lines.\r\n * @param cartLines - Flyout cart line view props.\r\n * @param props - Cart icon view props.\r\n * @returns JSX Element.\r\n */\r\nconst renderCartlines = (cartLines: IFlyoutCartLineItemViewProps[] | undefined, props: ICartIconViewProps): JSX.Element[] | null => {\r\n if (!cartLines) {\r\n props.context.telemetry.error('Cartlines content is empty, module wont render');\r\n return null;\r\n }\r\n return cartLines.map((cartLine, index) => {\r\n const cartLineIndex = index;\r\n return (\r\n <Node {...props.miniCartItemWrapper} key={cartLineIndex}>\r\n <Node className={classnames(cartLine.storeLocation ? 'msc-cart-line__set-net-price' : '')} >\r\n {cartLine.cartline}\r\n </Node>\r\n {cartLine.remove}\r\n {cartLine.storeLocation}\r\n </Node>\r\n );\r\n });\r\n};\r\n\r\n/**\r\n * Initiate total price.\r\n * @param props - Cart icon view props.\r\n * @returns JSX Element.\r\n */\r\nconst renderTotalPrice = (props: ICartIconViewProps & ICartIconExtensionProps<{}>): JSX.Element | null => {\r\n const cart = props.data.cart.result ?? undefined;\r\n const price = cart && !cart.hasInvoiceLine && (cart.cart.TotalAmount || undefined);\r\n const totalPrice = price ? props.context.cultureFormatter.formatCurrency(price) : props.context.cultureFormatter.formatCurrency(props.resources.emptyPrice);\r\n return (\r\n <div className='ms-cart-icon__subTotalText'>\r\n <span className='ms-cart-icon__subTotalPriceText'>\r\n {props.resources.totalPriceFormatString?.replace('{price}' , '')}\r\n <span className='ms-cart-icon__subTotalPrice'>\r\n {totalPrice}\r\n </span>\r\n </span>\r\n </div>\r\n );\r\n};\r\n\r\n/**\r\n *\r\n * CartIconView component.\r\n * @extends {React.PureComponent<ICartIconViewProps>}\r\n */\r\nexport class CartIconView extends React.PureComponent<ICartViewProps & ICartIconViewProps & ICartIconExtensionProps<{}>, ICartIconViewState> {\r\n\r\n private isAutoDisplayTriggered: boolean;\r\n private readonly checkoutByGuestAttributes: IDictionary<string> | undefined;\r\n private lastValidatedCartVersion: number | undefined;\r\n private readonly telemetryContent: ITelemetryContent;\r\n\r\n public constructor(props: ICartViewProps & ICartIconViewState & ICartIconViewProps & ICartIconExtensionProps<{}>) {\r\n super(props);\r\n this.isAutoDisplayTriggered = false;\r\n this.state = {\r\n isModalOpen: false,\r\n isCartValid: true,\r\n isQuantityLimitsFeatureEnabled: false\r\n };\r\n this.telemetryContent = getTelemetryObject(this.props.context.request.telemetryPageName!, this.props.friendlyName, this.props.telemetry);\r\n const payload = getPayloadObject(TelemetryEvent.CheckOut, this.telemetryContent, TelemetryConstant.Checkout);\r\n payload.contentAction.etext = TelemetryConstant.GuestCheckout;\r\n this.checkoutByGuestAttributes = getTelemetryAttributes(this.telemetryContent, payload);\r\n }\r\n\r\n public componentDidMount(): void {\r\n if (MsDyn365.isBrowser) {\r\n window.addEventListener('keydown', this._escFunction, false);\r\n }\r\n this._validateCart();\r\n }\r\n\r\n public componentDidUpdate(): void {\r\n this._validateCart();\r\n }\r\n\r\n public componentWillUnmount(): void {\r\n if (MsDyn365.isBrowser) {\r\n window.removeEventListener('keydown', this._escFunction, false);\r\n }\r\n }\r\n\r\n private _removeCommentFromCartLine(): void {\r\n const cartState = this.props.data.cart.result || undefined;\r\n\r\n if (cartState) {\r\n if ((!cartState.cart.CartLines || cartState.cart.CartLines?.length === 0) && cartState.cart.Comment) {\r\n const _clonedCart = { ...cartState.cart };\r\n _clonedCart.Comment = \"\";\r\n\r\n void cartState.updateCart({newCartObject: _clonedCart});\r\n }\r\n }\r\n }\r\n\r\n private _renderGuestCheckout(hasError: boolean,guestCheckoutUrl: string) {\r\n return(\r\n <Button\r\n disabled={hasError} className='ms-cart-icon__btn-checkout' href={guestCheckoutUrl}\r\n title={this.props.resources.guestCheckoutButtonTitle} {...this.checkoutByGuestAttributes}>\r\n {this.props.resources.guestCheckoutButtonTitle}\r\n </Button>\r\n );\r\n }\r\n\r\n private _validateCart(): void {\r\n const {\r\n data: { cart }\r\n } = this.props;\r\n const cartVersion = cart.result?.cart?.Version ?? undefined;\r\n if (this.lastValidatedCartVersion === cartVersion) {\r\n return;\r\n }\r\n\r\n this.lastValidatedCartVersion = cartVersion; // This field is populated to block concurrent requests\r\n validateCartAsync(cart, this.props.telemetry, this.props.context)\r\n .then((result) => {\r\n this.setState({ isCartValid: !ArrayExtensions.hasElements(result?.ValidationResultsPairs) });\r\n })\r\n .catch(() => {\r\n this.setState({ isCartValid: false });\r\n });\r\n }\r\n\r\n /**\r\n * Render Cart Item count.\r\n * @returns JSX Element.\r\n */\r\n public render(): JSX.Element | null {\r\n this._removeCommentFromCartLine();\r\n const cart = this.props.data.cart.result ?? undefined;\r\n const cartlines = this.props.cartlines;\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- check config.\r\n const shouldShowMiniCart = cart?.isProductAddedToCart && this.props.context.app.config.addToCartBehavior === AddToCartBehavior.showMiniCart;\r\n const guestCheckoutUrl = getUrlSync('checkout', this.props.context.actionContext) || '';\r\n const hasError = !this.state.isCartValid || (cartlines ? cartlines.some(cartline => cartline.hasError) : false);\r\n if (shouldShowMiniCart) {\r\n if (!this.isAutoDisplayTriggered) {\r\n // First time trigger auto mini cart.\r\n this.setState({ isModalOpen: true });\r\n this.isAutoDisplayTriggered = true;\r\n } else if (!this.state.isModalOpen) {\r\n // If modal is closed, reset the flag.\r\n this.isAutoDisplayTriggered = false;\r\n }\r\n }\r\n return (\r\n <Node{...this.props.miniCartWrapper} {...this.props.renderModuleAttributes(this.props)}>\r\n <button\r\n onClick={this._openModal} className='ms-cart-icon-wrapper msc-btn'>\r\n {this.props.cartIcon}\r\n </button>\r\n <Node{...this._modalContainer()}>\r\n <Node className='ms-cart-icon__header msc-modal__header'>\r\n {this.props.flyoutTitle}\r\n {this._renderCartItemCount(this.props)}\r\n {this._renderCartCloseIcon()}\r\n </Node>\r\n <Node className='ms-cart-icon__body msc-modal__body'>\r\n {this.props.data.cart.result?.isEmpty ? this.props.slots.emptyCart : null}\r\n <Node {...this.props.CartlinesWrapper}>\r\n {renderCartlines(cartlines, this.props)}\r\n </Node>\r\n </Node>\r\n <Node className='ms-cart-icon__footer msc-modal__footer'>\r\n {this.props.slots.promoContentItem}\r\n {renderTotalPrice(this.props)}\r\n <p className='ms-cart-icon__subtotal-message'>\r\n {this.props.resources.subTotalMessage}\r\n </p>\r\n {/* {this.props.checkoutAsSignInUserButton} */}\r\n {/* {this.props.checkoutAsGuestButton} */}\r\n {cartlines && cartlines.length > 0 ? this._renderGuestCheckout(hasError, guestCheckoutUrl) : null}\r\n\r\n {this.props.data.cart.result?.isEmpty ? null : this.props.goToCartButton}\r\n <Node className='ms-cart-icon__btn-section'>\r\n {\r\n this.props.data.cart.result?.isEmpty ? <Button\r\n className='ms-cart-icon__btn-backtoshopping'\r\n href={getUrlSync('home', this.props.context.actionContext)}\r\n >\r\n {this.props.resources.continueShoppingButtonTitle}\r\n </Button> : null\r\n }\r\n </Node>\r\n </Node>\r\n </Node>\r\n </Node>\r\n );\r\n }\r\n\r\n /**\r\n * Initiate modal container.\r\n * @returns Inode props.\r\n */\r\n private readonly _modalContainer = (): INodeProps => {\r\n return {\r\n tag: Modal,\r\n placement: 'bottom-end',\r\n hideArrow: true,\r\n className: 'ms-cart-icon__minicartmodal-container',\r\n wrapClassName: 'ms-cart-icon__minicartmodal',\r\n isOpen: this.state.isModalOpen,\r\n toggle: this.closeModal\r\n };\r\n };\r\n\r\n /**\r\n * Initiate open modal.\r\n */\r\n private readonly _openModal = (): void => {\r\n const payLoad = getPayloadObject('click', this.props.telemetryContent!, 'cart-icon', '');\r\n onTelemetryClick(this.props.telemetryContent!, payLoad, 'cart-icon');\r\n this.setState({\r\n isModalOpen: true\r\n });\r\n };\r\n\r\n /**\r\n * Initiate close modal.\r\n */\r\n private readonly closeModal = (): void => {\r\n this.setState({\r\n isModalOpen: false\r\n });\r\n\r\n };\r\n\r\n /**\r\n * Initiate cart close Icon.\r\n * @returns JSX Element.\r\n */\r\n private readonly _renderCartCloseIcon = (): JSX.Element | null => {\r\n return (\r\n <Button\r\n className='ms-cart-icon__btn-close'\r\n aria-label='Close' onClick={this.closeModal} />\r\n );\r\n };\r\n\r\n /**\r\n * Render Cart Item count.\r\n * @param props - Cart icon view props.\r\n * @returns JSX Element.\r\n */\r\n private readonly _renderCartItemCount = (props: ICartIconViewProps & ICartIconExtensionProps<{}>): JSX.Element | null => {\r\n let cartItemCount;\r\n const defaultCartItemCount: number = 0;\r\n const defaultCartItemCountOne: number = 1;\r\n\r\n if (ArrayExtensions.hasElements(props.cartlines)) {\r\n if (props.cartlines.length === defaultCartItemCountOne) {\r\n cartItemCount = `${defaultCartItemCountOne} ${props.resources.item}`;\r\n } else {\r\n cartItemCount = `${props.cartlines.length} ${props.resources.items}`;\r\n }\r\n } else {\r\n cartItemCount = `${defaultCartItemCount} ${props.resources.items}`;\r\n }\r\n return (\r\n <Node className='ms-cart-icon__count' tabIndex='0'>\r\n {cartItemCount}\r\n </Node>\r\n );\r\n };\r\n\r\n /**\r\n * Handle escape click to close modal.\r\n * @param event - On press of any key.\r\n */\r\n private readonly _escFunction = (event: KeyboardEvent) => {\r\n if (event.keyCode === KeyCodes.Escape && this.state.isModalOpen) {\r\n this.closeModal();\r\n }\r\n };\r\n\r\n}\r\n\r\nexport default CartIconView;\r\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 { IPriceComponentResources } from './components/price.component';\r\nimport { ProductPrice, ProductSearchResult, ProductWarehouseInventoryAvailability, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n ArrayExtensions,\r\n createInventoryAvailabilitySearchCriteria,\r\n getProductPageUrlSync\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n ICategoryHierarchyViewProps,\r\n IRefineMenuViewProps,\r\n ISearchResultContainerViewProps,\r\n ISearchResultModalViewProps,\r\n ISortByViewProps,\r\n ITitleViewProps\r\n} from '@msdyn365-commerce-modules/search-result-container';\r\nimport { Button, getTelemetryObject, IPopupProps, Module, Node, Popup } from '@msdyn365-commerce-modules/utilities';\r\nimport React, { PropsWithChildren, useState } from 'react';\r\nimport { _getGlobalState } from 'mobx';\r\nimport { ISearchResultContainerProps } from '../definition-extensions/search-result-container.ext.props.autogenerated';\r\nimport { ProductComponent } from './components/product.component';\r\nimport { getUrlSync, IGridSettings, IImageData, IImageProps, IImageSettings, Image, IRequestContext } from '@msdyn365-commerce/core';\r\nimport { AddToCartListComponent } from './components/addToCart.component';\r\nimport { IProductSearchResultExtensionData } from './product-result-container.data';\r\nimport { getInventoryLevelRangesAsync } from '../../../actions/DataActionExtension.g';\r\nimport { SupersessionKey } from '../../gardner-theme/models/SupersessionKey';\r\nimport getProductSupersessionProperty from '../../gardner-theme/models/getProductSupersessionProperty';\r\nimport { IItemInventoryLevelProfileEntity, IProfileDataMap } from '../../../actions/DataServiceEntities.g';\r\nimport Table from 'reactstrap/lib/Table';\r\nimport { getEstimatedAvailabilityAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\n// import { LoginToViewPricingComponent } from \"../../../components/LoginToViewPricing.component\";\r\nimport { Tooltip } from 'reactstrap';\r\n/**\r\n * DescriptionInterval.\r\n */\r\nenum DescriptionInterval {\r\n productDescriptionInterval = 14,\r\n productDescriptionIntervalRemainder0 = 0,\r\n productDescriptionIntervalRemainder9 = 9\r\n}\r\n\r\n/**\r\n * Render Clear button for mobile viewport.\r\n * @param props - The view props.\r\n * @returns The JSX Element.\r\n */\r\nconst renderProductCards = (\r\n props: PropsWithChildren<ISearchResultContainerViewProps & ISearchResultContainerProps<{}>>,\r\n estimatedAvailabilites: ProductWarehouseInventoryAvailability[]\r\n): JSX.Element | null => {\r\n const products = props.data.listPageState.result?.activeProducts;\r\n if (!products || !ArrayExtensions.hasElements(products)) {\r\n return null;\r\n }\r\n return (\r\n <Node {...props.ProductsContainer}>\r\n {props.errorMessage}\r\n <ul className='list-unstyled'>\r\n {products.map((product: ProductSearchResult, index: number) =>\r\n renderProductCardsDescription(props, product, index, estimatedAvailabilites, false)\r\n )}\r\n </ul>\r\n </Node>\r\n );\r\n};\r\n\r\n/**\r\n * Returns the product inventory label.\r\n * @param channelInventoryConfigurationId - The channel configuration Id.\r\n * @param product - The product.\r\n * @returns The inventory label.\r\n */\r\nfunction getInventoryLabel(channelInventoryConfigurationId: number | undefined, product: ProductSearchResult): string | undefined {\r\n if (!channelInventoryConfigurationId || !ArrayExtensions.hasElements(product.AttributeValues)) {\r\n return undefined;\r\n }\r\n const inventoryAttribute = product.AttributeValues.find(attribute => attribute.RecordId === channelInventoryConfigurationId);\r\n\r\n if (inventoryAttribute) {\r\n return inventoryAttribute.TextValue;\r\n }\r\n\r\n return undefined;\r\n}\r\n\r\n/**\r\n * Render Clear button for mobile viewport.\r\n * @param props - The view props.\r\n * @param product - The product item data.\r\n * @param index - The index of each product item.\r\n * @param isEnabledProductDescription - The flag for showing Product desription tile.\r\n * @returns The JSX Element.\r\n */\r\nconst renderProductCardsDescription = (\r\n props: PropsWithChildren<ISearchResultContainerViewProps & ISearchResultContainerProps<{}>>,\r\n product: ProductSearchResult,\r\n index: number,\r\n estimatedAvailabilites: ProductWarehouseInventoryAvailability[],\r\n isEnabledProductDescription?: boolean\r\n): JSX.Element | null => {\r\n const { config, context, resources } = props;\r\n const telemetryContent = getTelemetryObject(props.context.request.telemetryPageName!, props.friendlyName, props.telemetry);\r\n const breadCrumbType = props.context.app.config.breadcrumbType;\r\n const isAllowBack = props.config.allowBackNavigation && (breadCrumbType === 'back' || breadCrumbType === 'categoryAndBack');\r\n const classname = isEnabledProductDescription\r\n ? 'ms-product-search-result__item product__description'\r\n : 'ms-product-search-result__item';\r\n const quickviewslot = ArrayExtensions.hasElements(props.slots.quickview) ? props.slots.quickview[0] : undefined;\r\n const channelInventoryConfigurationId = props.data.products.result?.channelInventoryConfigurationId;\r\n\r\n // @ts-ignore\r\n const isPriceMinMaxFeatureState = props.data.featureState.result?.find(\r\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailSearchPriceRangeFeature'\r\n );\r\n const priceResources: IPriceComponentResources = {\r\n priceRangeSeparator: resources.priceRangeSeparator,\r\n loginToViewPricingText: resources.loginToViewPricing\r\n };\r\n return (\r\n <li className={classname} key={index}>\r\n <ProductComponent\r\n context={context}\r\n telemetryContent={telemetryContent}\r\n imageSettings={config.imageSettings}\r\n freePriceText={resources.priceFree}\r\n originalPriceText={resources.originalPriceText}\r\n currentPriceText={resources.currentPriceText}\r\n ratingAriaLabel={resources.ratingAriaLabel}\r\n allowBack={isAllowBack}\r\n id={props.id}\r\n typeName={props.typeName}\r\n data={{ product }}\r\n quickViewButton={quickviewslot}\r\n isEnabledProductDescription={isEnabledProductDescription}\r\n inventoryLabel={getInventoryLabel(channelInventoryConfigurationId, product)}\r\n isPriceMinMaxEnabled={isPriceMinMaxFeatureState?.IsEnabled}\r\n priceResources={priceResources}\r\n estimatedAvailabilites={estimatedAvailabilites}\r\n />\r\n </li>\r\n );\r\n};\r\n\r\n/**\r\n * Render Clear button for mobile viewport.\r\n * @param props - The view props.\r\n * @returns The JSX Element.\r\n */\r\nconst renderProducts = (\r\n props: PropsWithChildren<ISearchResultContainerViewProps & ISearchResultContainerProps<{}>>,\r\n estimatedAvailabilites: ProductWarehouseInventoryAvailability[]\r\n): JSX.Element | null => {\r\n const products = props.data.listPageState.result?.activeProducts;\r\n if (!products || !ArrayExtensions.hasElements(products)) {\r\n return null;\r\n }\r\n const productDescriptionInterval: number = DescriptionInterval.productDescriptionInterval;\r\n const productDescriptionIntervalRemainder0: number = DescriptionInterval.productDescriptionIntervalRemainder0;\r\n const productDescriptionIntervalRemainder9: number = DescriptionInterval.productDescriptionIntervalRemainder9;\r\n return (\r\n <Node {...props.ProductsContainer}>\r\n {props.errorMessage}\r\n <ul className='list-unstyled'>\r\n {products.map((product: ProductSearchResult, index: number) =>\r\n index % productDescriptionInterval === productDescriptionIntervalRemainder0 ||\r\n index % productDescriptionInterval === productDescriptionIntervalRemainder9\r\n ? renderProductCardsDescription(props, product, index, estimatedAvailabilites, true)\r\n : renderProductCardsDescription(props, product, index, estimatedAvailabilites, false)\r\n )}\r\n </ul>\r\n </Node>\r\n );\r\n};\r\n\r\n/**\r\n * Render Title Count.\r\n * @param props - The title view props.\r\n * @returns The JSX Element.\r\n */\r\nconst renderTitleCount = (props: ITitleViewProps): JSX.Element | null => {\r\n const { title, TitleContainer } = props;\r\n return <Node {...TitleContainer}>{title.titleCount}</Node>;\r\n};\r\n\r\n/**\r\n * Render Category Hierarchy.\r\n * @param props - The category hierarchy view props.\r\n * @returns The JSX Element.\r\n */\r\nconst renderCategoryHierarchy = (props: ICategoryHierarchyViewProps): JSX.Element | null => {\r\n const { CategoryHierarchyContainer, categoryHierarchyList, categoryHierarchySeparator } = props;\r\n if (categoryHierarchyList) {\r\n return (\r\n <Node {...CategoryHierarchyContainer}>\r\n {categoryHierarchyList.map((category, index) => (\r\n <React.Fragment key={index}>\r\n {category}\r\n {categoryHierarchyList && categoryHierarchyList[index + 1] && categoryHierarchySeparator}\r\n </React.Fragment>\r\n ))}\r\n </Node>\r\n );\r\n }\r\n\r\n return null;\r\n};\r\n\r\nfunction boNote(text: string | undefined, inventoryCode: string, RecordId: number) {\r\n const [isToolTipOpen, setIsToolTipOpen] = React.useState<boolean>(false);\r\n const toggleTooltip = () => setIsToolTipOpen(!isToolTipOpen);\r\n\r\n if (inventoryCode !== 'BO') {\r\n return null;\r\n }\r\n\r\n return (\r\n <>\r\n <a\r\n href='javascript:void(0)'\r\n className='readMore-toolTip'\r\n id={`tooltip-${RecordId}`}\r\n data-toggle='tooltip'\r\n onClick={toggleTooltip}\r\n />\r\n\r\n <Tooltip className='qo-tooltip' placement='top' isOpen={isToolTipOpen} target={`tooltip-${RecordId}`} toggle={toggleTooltip}>\r\n {text}\r\n </Tooltip>\r\n </>\r\n );\r\n}\r\n\r\n/**\r\n * Render the category page items.\r\n * @param props - The view props.\r\n * @returns The search Result container module view.\r\n */\r\nconst SearchResultContainerView: React.FC<ISearchResultContainerViewProps &\r\n ISearchResultContainerProps<IProductSearchResultExtensionData>> = props => {\r\n const {\r\n SearchResultContainer,\r\n pagination,\r\n ProductSectionContainer,\r\n choiceSummary,\r\n isMobile,\r\n modalToggle,\r\n searchResultModal,\r\n TitleViewProps,\r\n refineMenu,\r\n categoryHierarchy,\r\n sortByOptions,\r\n CategoryNavContainer,\r\n RefineAndProductSectionContainer,\r\n FeatureSearchContainer,\r\n similarLookProduct,\r\n errorMessage,\r\n productPrices,\r\n context: {\r\n request,\r\n cultureFormatter,\r\n actionContext,\r\n actionContext: {\r\n requestContext: {\r\n gridSettings,\r\n user: { isAuthenticated }\r\n }\r\n }\r\n },\r\n resources: {\r\n filterText,\r\n partNoHeading,\r\n descriptionHeading,\r\n availabilityHeading,\r\n quantityHeading,\r\n // listPriceHeading,\r\n yourPriceHeading,\r\n // loginToViewPricing,\r\n goToCartText,\r\n continueShoppingText,\r\n addToCartModalHeading,\r\n addToCartText\r\n },\r\n data: { cart, listPageState: productSearchResults, products: configurationObject },\r\n config: { enableProdutDescription, listView, imageSettings }\r\n } = props;\r\n\r\n const [areInventoryRangesChecked, setAreInventoryRangesChecked] = useState<boolean>(false);\r\n const [inventoryRangesList, setInventoryRangesList] = useState<IProfileDataMap[]>([]);\r\n const [estimatedAvailabilites, setEstimatedAvailabilites] = React.useState<ProductWarehouseInventoryAvailability[]>([]);\r\n\r\n const getInvProfs = async (): Promise<void> => {\r\n if (areInventoryRangesChecked) {\r\n return;\r\n }\r\n const itemIds = props.data.products?.result?.products.map(p => p.ItemId!) || [];\r\n const resp = await getInventoryLevelRangesAsync({ callerContext: props.context.actionContext }, itemIds);\r\n setAreInventoryRangesChecked(true);\r\n setInventoryRangesList(resp);\r\n };\r\n\r\n const getEsimatedAvailability = async (): Promise<void> => {\r\n const itemIds = Array.from(new Set(props.data.products?.result?.products.map((product: any) => product.RecordId)));\r\n const searchCriteria = createInventoryAvailabilitySearchCriteria(props.context.actionContext, itemIds, true);\r\n const response = await getEstimatedAvailabilityAsync({ callerContext: props.context.actionContext }, searchCriteria);\r\n setEstimatedAvailabilites(response.ProductWarehouseInventoryAvailabilities ?? []);\r\n };\r\n\r\n React.useEffect(() => {\r\n if (isAuthenticated || !props.config.onlyShowPriceWhenAuthenticated) {\r\n void getInvProfs();\r\n void getEsimatedAvailability();\r\n }\r\n }, [props.data.products]);\r\n\r\n const [isExpanded, setIsExpanded] = useState<boolean>(false);\r\n const [modalOpen, setModalOpen] = React.useState<boolean>(false);\r\n const [addedProduct, setAddedProduct] = React.useState<SimpleProduct | undefined>(undefined);\r\n const [productPricing, setProductPricing] = React.useState<ProductPrice | undefined>(undefined);\r\n const toggle = () => {\r\n setIsExpanded(!isExpanded);\r\n };\r\n const isRecoSearchPage = props.context.actionContext.requestContext.query?.recommendation;\r\n\r\n const setModalProps = (product: SimpleProduct, price: ProductPrice): IPopupProps => {\r\n return {\r\n modalOpen: modalOpen,\r\n context: props.context,\r\n className: 'list-view__modal',\r\n gridSettings,\r\n imageSettings,\r\n priceComponent: props.component,\r\n id: '1',\r\n productQuantity: 1,\r\n navigationUrl: getUrlSync('cart', actionContext),\r\n setModalOpen: value => setModalOpen(value),\r\n typeName: 'Add To Cart',\r\n data: { product, price },\r\n dialogStrings: {\r\n goToCartText: goToCartText,\r\n currentPriceText: '',\r\n continueShoppingText: continueShoppingText,\r\n freePriceText: '',\r\n headerItemOneText: addToCartModalHeading,\r\n headerItemFormatText: '',\r\n originalPriceText: '',\r\n headerMessageText: ''\r\n }\r\n };\r\n };\r\n\r\n const handleAddToCart = (productId: number, quantity: number) => {\r\n const foundProduct = productSearchResults.result?.activeProducts.find(pr => pr.RecordId === productId);\r\n if (!foundProduct) {\r\n return;\r\n }\r\n const product: SimpleProduct = {\r\n BasePrice: foundProduct.BasePrice || foundProduct.Price,\r\n AdjustedPrice: foundProduct.Price,\r\n Name: foundProduct.Name,\r\n RecordId: foundProduct.RecordId,\r\n ItemId: foundProduct.ItemId,\r\n ProductTypeValue: 1,\r\n Price: foundProduct.Price\r\n };\r\n setAddedProduct(product);\r\n setProductPricing(getProductPrice(productPrices, product.RecordId));\r\n cart.result\r\n ?.addProductToCart({\r\n product,\r\n count: quantity,\r\n catalogId: 0\r\n })\r\n .then(response => {\r\n if (response.status === 'SUCCESS' && props.app.config.addToCartBehavior === 'showModal') {\r\n setModalOpen(true);\r\n }\r\n });\r\n };\r\n\r\n // const getProductSupersessionProperty = (product: ProductSearchResult, extensionKey: SupersessionKey) => {\r\n // const properties = product.ExtensionProperties;\r\n // if (properties) {\r\n // return properties.find(pr => pr.Key === extensionKey)?.Value?.StringValue || null;\r\n // }\r\n // return null;\r\n // }\r\n\r\n const renderAddtoCartButton = (pr: ProductSearchResult) => {\r\n if (isAuthenticated || !props.config.onlyShowPriceWhenAuthenticated) {\r\n const currentInvString = getProductSupersessionProperty(pr, SupersessionKey.Inventory) || '0';\r\n const currentInventory = parseInt(currentInvString, 10);\r\n let invProfOos: IItemInventoryLevelProfileEntity | undefined;\r\n inventoryRangesList.map(ir => {\r\n const tempInvRange = ir.Profile?.find(p => p.ItemId === pr.ItemId && p.Code === 'OOS');\r\n if (tempInvRange) {\r\n invProfOos = tempInvRange;\r\n }\r\n });\r\n\r\n const OosUpperBound =\r\n invProfOos?.hasOwnProperty('UpperBoundInclusive') && invProfOos?.UpperBoundInclusive !== undefined\r\n ? invProfOos.UpperBoundInclusive\r\n : 0;\r\n const isOutOfStock = currentInventory <= OosUpperBound;\r\n\r\n return !isOutOfStock ? (\r\n <AddToCartListComponent productId={pr.RecordId} onAddToCart={handleAddToCart} addToCartButtonText={addToCartText} />\r\n ) : (\r\n <>\r\n <td></td>\r\n <td>\r\n <div className='list-view__prod-unavail'>{props.resources.productUnavailableText}</div>\r\n </td>\r\n </>\r\n );\r\n }\r\n return null;\r\n };\r\n\r\n const getInventory = (ItemId: number): { Inventorylabel: string; Inventorycode: string } => {\r\n const product = estimatedAvailabilites.find(product => product.ProductId === ItemId);\r\n\r\n return {\r\n Inventorylabel: product?.TotalAvailableInventoryLevelLabel || '',\r\n Inventorycode: product?.TotalAvailableInventoryLevelCode || ''\r\n };\r\n };\r\n\r\n const _renderProductsListView = () => {\r\n return (\r\n <Table className={'list-view__table'}>\r\n <thead>\r\n <tr>\r\n <th />\r\n <th>{partNoHeading}</th>\r\n <th>{descriptionHeading}</th>\r\n <th>{availabilityHeading}</th>\r\n {/* <th>{listPriceHeading}</th> */}\r\n <th>{yourPriceHeading}</th>\r\n {isAuthenticated || !props.config.onlyShowPriceWhenAuthenticated ? (\r\n <>\r\n <th>{quantityHeading}</th>\r\n <th />\r\n </>\r\n ) : null}\r\n </tr>\r\n </thead>\r\n <tbody>\r\n {productSearchResults.result?.activeProducts.map(pr => {\r\n // const pricing = getProductPrice(productPrices, pr.RecordId);\r\n const label = getInventoryLabel(configurationObject?.result?.channelInventoryConfigurationId, pr);\r\n console.log(label);\r\n\r\n const { Inventorylabel, Inventorycode } = getInventory(pr.RecordId!);\r\n\r\n // const priceComponent = <span>{cultureFormatter.formatCurrency(pr.Price)}</span>;\r\n\r\n return (\r\n <tr key={pr.RecordId}>\r\n <td>\r\n {renderProductPlacementImage(\r\n imageSettings,\r\n gridSettings,\r\n pr.PrimaryImageUrl,\r\n pr.PrimaryImageUrl,\r\n pr.Name,\r\n request\r\n )}\r\n </td>\r\n <td>\r\n <a href={getProductPageUrlSync(pr.Name!, pr.RecordId, actionContext)}>{pr.ItemId}</a>\r\n </td>\r\n <td>{pr.Name}</td>\r\n <td>\r\n {Inventorylabel} {boNote(props.config.backOrderShippingText, Inventorycode, pr.RecordId)}\r\n </td>\r\n\r\n {/* <td>\r\n {LoginToViewPricingComponent(props.context.request, loginToViewPricing,\r\n priceComponent, props.config.onlyShowPriceWhenAuthenticated ?? false)}</td> */}\r\n <td>\r\n {isAuthenticated || !props.config.onlyShowPriceWhenAuthenticated\r\n ? cultureFormatter.formatCurrency(pr.Price)\r\n : null}\r\n </td>\r\n {renderAddtoCartButton(pr)}\r\n {/* {isAuthenticated || !props.config.onlyShowPriceWhenAuthenticated ? (<AddToCartListComponent productId={pr.RecordId} onAddToCart={handleAddToCart}\r\n addToCartButtonText={addToCartText} />) : null} */}\r\n </tr>\r\n );\r\n })}\r\n </tbody>\r\n </Table>\r\n );\r\n };\r\n\r\n const showFilterDropdown = props.config.showFilterDropdown;\r\n const showSortDropdown = props.config.showSortDropdown;\r\n\r\n if (isMobile) {\r\n return (\r\n <Module {...SearchResultContainer}>\r\n {similarLookProduct ? null : (\r\n <Node {...CategoryNavContainer}>\r\n {renderCategoryHierarchy(categoryHierarchy)}\r\n {renderTitle(TitleViewProps)}\r\n {renderTitleCount(TitleViewProps)}\r\n </Node>\r\n )}\r\n {choiceSummary}\r\n <Node className='msc-sort-filter-wrapper'>{showFilterDropdown && showSortDropdown && modalToggle}</Node>\r\n {createSearchResultModal(searchResultModal, refineMenu, sortByOptions, isRecoSearchPage)}\r\n <Node {...FeatureSearchContainer}>{similarLookProduct}</Node>\r\n {errorMessage}\r\n\r\n {enableProdutDescription\r\n ? renderProducts(props, estimatedAvailabilites)\r\n : renderProductCards(props, estimatedAvailabilites)}\r\n {pagination}\r\n </Module>\r\n );\r\n }\r\n\r\n return (\r\n <Module {...SearchResultContainer}>\r\n {/* @ts-ignore */}\r\n {modalOpen && addedProduct ? <Popup {...setModalProps(addedProduct, productPricing)} /> : null}\r\n {similarLookProduct ? null : (\r\n <Node {...CategoryNavContainer}>\r\n {categoryHierarchy && renderCategoryHierarchy(categoryHierarchy)}\r\n {TitleViewProps && renderTitle(TitleViewProps)}\r\n {TitleViewProps && renderTitleCount(TitleViewProps)}\r\n </Node>\r\n )}\r\n <Node {...FeatureSearchContainer}>{similarLookProduct}</Node>\r\n <Node {...RefineAndProductSectionContainer}>\r\n {(showFilterDropdown || showSortDropdown) && (\r\n <Node className='ms-refiner-heading'>\r\n <Node className='ms-refiner-heading_title'>\r\n {showFilterDropdown && (\r\n <Button\r\n className={isExpanded ? 'ms-refine-filter__toggle_expanded' : 'ms-refine-filter__toggle_collapsed'}\r\n aria-label='Filter'\r\n onClick={toggle}\r\n aria-expanded={isExpanded}\r\n tabIndex={0}\r\n >\r\n {filterText}\r\n </Button>\r\n )}\r\n <div className='ms-search-result-wrapper-title-choice-summary'>{choiceSummary}</div>\r\n {showSortDropdown && (\r\n <div className='ms-search-result-wrapper-sort-by-category'>\r\n {sortByOptions && !isRecoSearchPage && renderSort(sortByOptions)}\r\n </div>\r\n )}\r\n </Node>\r\n {refineMenu && isExpanded && renderRefiner(refineMenu)}\r\n </Node>\r\n )}\r\n <Node {...ProductSectionContainer}>\r\n {errorMessage}\r\n {/*{enableProdutDescription ? renderProducts(props) : renderProductCards(props)}*/}\r\n {listView\r\n ? _renderProductsListView()\r\n : enableProdutDescription\r\n ? renderProducts(props, estimatedAvailabilites)\r\n : renderProductCards(props, estimatedAvailabilites)}\r\n {pagination}\r\n </Node>\r\n </Node>\r\n </Module>\r\n );\r\n};\r\n\r\n/**\r\n * Render Search result Modal.\r\n * @param modalProps - The Search Result Modal view props.\r\n * @param refineMenu - The Refine Menu view props.\r\n * @param sortByDropDown - The Sort by view props.\r\n * @param isRecoSearchPage - The recomandation search page flag.\r\n * @returns The JSX Element.\r\n */\r\nconst createSearchResultModal = (\r\n modalProps: ISearchResultModalViewProps,\r\n refineMenu: IRefineMenuViewProps,\r\n sortByDropDown: ISortByViewProps,\r\n isRecoSearchPage?: string\r\n): JSX.Element => {\r\n return React.cloneElement(\r\n modalProps.modal,\r\n {},\r\n modalProps.modalHeader,\r\n createModalBody(modalProps, refineMenu, sortByDropDown, isRecoSearchPage),\r\n modalProps.modalFooter\r\n );\r\n};\r\n\r\n/**\r\n * Render Refiner Mobile.\r\n * @param props - The Refine Menu view props.\r\n * @returns The JSX Element.\r\n */\r\nconst renderRefinerMobile = (props: IRefineMenuViewProps): JSX.Element | null => {\r\n const { refiners, RefineMenuContainer, RefinerSectionContainer } = props;\r\n if (refiners) {\r\n return (\r\n <Node {...RefinerSectionContainer}>\r\n <Node {...RefineMenuContainer}>\r\n {refiners.map((submenu, index) => (\r\n <React.Fragment key={index}>{submenu}</React.Fragment>\r\n ))}\r\n </Node>\r\n </Node>\r\n );\r\n }\r\n return null;\r\n};\r\n\r\n/**\r\n * Render Search result Body.\r\n * @param props - The Search Result Modal view props.\r\n * @param refineMenu - The Refine Menu view props.\r\n * @param sortByDropDown - The Sort by view props.\r\n * @param isRecoSearchPage - The recomandation search page flag.\r\n * @returns The JSX Element.\r\n */\r\nconst createModalBody = (\r\n props: ISearchResultModalViewProps,\r\n refineMenu: IRefineMenuViewProps,\r\n sortByDropDown: ISortByViewProps,\r\n isRecoSearchPage?: string\r\n): JSX.Element | null => {\r\n if (sortByDropDown) {\r\n return React.cloneElement(props.modalBody, {}, renderSort(sortByDropDown, isRecoSearchPage), renderRefinerMobile(refineMenu));\r\n }\r\n return null;\r\n};\r\n\r\n/**\r\n * Render Refiner.\r\n * @param props - The Refine Menu view props.\r\n * @returns The JSX Element.\r\n */\r\nconst renderRefiner = (props: IRefineMenuViewProps): JSX.Element | null => {\r\n const { refiners, RefineMenuContainer, RefinerSectionContainer } = props;\r\n if (refiners) {\r\n return (\r\n <Node {...RefinerSectionContainer}>\r\n <Node {...RefineMenuContainer}>\r\n {refiners.map((submenu, index) => (\r\n <React.Fragment key={index}>{submenu}</React.Fragment>\r\n ))}\r\n </Node>\r\n </Node>\r\n );\r\n }\r\n return null;\r\n};\r\n\r\n/**\r\n * Render sort by drop down.\r\n * @param props - The sort by view props.\r\n * @param isRecoSearchPage - The recomandation search page flag.\r\n * @returns The JSX Element.\r\n */\r\nconst renderSort = (props: ISortByViewProps, isRecoSearchPage?: string): JSX.Element | null => {\r\n const { SortingContainer, sortByDropDown } = props;\r\n if (sortByDropDown && !isRecoSearchPage) {\r\n return <Node {...SortingContainer}>{sortByDropDown}</Node>;\r\n }\r\n return null;\r\n};\r\n\r\n/**\r\n * Render Title.\r\n * @param props - The title view props.\r\n * @returns The JSX Element.\r\n */\r\nconst renderTitle = (props: ITitleViewProps): JSX.Element | null => {\r\n const { title, TitleContainer } = props;\r\n if (title) {\r\n return (\r\n <Node {...TitleContainer}>\r\n <Node tag='h1' className=''>\r\n {title.titlePrefix}\r\n {title.titleText}\r\n </Node>\r\n </Node>\r\n );\r\n }\r\n return null;\r\n};\r\n\r\nconst renderProductPlacementImage = (\r\n productCardimageSettings?: IImageSettings,\r\n gridSettings?: IGridSettings,\r\n imageUrl?: string,\r\n fallbackImageUrl?: string,\r\n altText?: string,\r\n requestContext?: IRequestContext\r\n): JSX.Element | null => {\r\n if (!imageUrl || !gridSettings || !productCardimageSettings) {\r\n return null;\r\n }\r\n if (productCardimageSettings) {\r\n productCardimageSettings.viewports = {\r\n lg: { h: 100, w: 100, q: '80' },\r\n md: { h: 100, w: 100, q: '80' },\r\n sm: { h: 100, w: 100, q: '80' },\r\n xs: { h: 100, w: 100, q: '80' }\r\n };\r\n }\r\n const image: IImageData = {\r\n src: imageUrl,\r\n altText: altText ? altText : '',\r\n fallBackSrc: fallbackImageUrl\r\n };\r\n const imageProps: IImageProps = { gridSettings };\r\n\r\n imageProps.gridSettings = gridSettings;\r\n imageProps.imageSettings = productCardimageSettings;\r\n imageProps.imageSettings.cropFocalRegion = true;\r\n return <Image {...image} {...imageProps} loadFailureBehavior='empty' requestContext={requestContext} className={'eve-listview__img'} />;\r\n};\r\n\r\nconst getProductPrice = (pricing: ProductPrice[] | undefined, productRecId: number): ProductPrice | undefined => {\r\n if (!pricing) {\r\n return undefined;\r\n }\r\n return pricing.find(pr => pr.ProductId === productRecId);\r\n};\r\n\r\nexport default SearchResultContainerView;\r\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 { AddToCartBehavior } from '@msdyn365-commerce/components';\r\nimport MsDyn365, { getUrlSync } from '@msdyn365-commerce/core';\r\n// @ts-ignore\r\nimport { ICartIconViewProps, ICartViewProps, IFlyoutCartLineItemViewProps } from '@mdsdyn365-commerce-modules/cart';\r\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { Button, getPayloadObject, INodeProps, KeyCodes, Modal, Node, onTelemetryClick } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport React from 'react';\r\n\r\nimport { ICartIconProps as ICartIconExtensionProps } from '../definition-extensions/cart-icon.ext.props.autogenerated';\r\nimport { readAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CustomersDataActions.g';\r\nimport { Address, AttributeTextValue, Cart } from '@msdyn365-commerce/retail-proxy';\r\nimport { CartLine, CommerceProperty } from '@msdyn365-commerce/retail-proxy';\r\nimport { CommercePropertyValueEnum } from '../../../modules/allowable-freight/utils/CommercePropertyValueEnum';\r\nimport { ICartState } from '@msdyn365-commerce/global-state';\r\nimport { removeWarehouseAttributes } from '../../../utils/cartAttributeManager';\r\n/**\r\n * ICartIconViewState: Interface for Cart Icon View State.\r\n */\r\ninterface ICartIconViewState {\r\n isModalOpen: boolean;\r\n isAddressCheckComplete: boolean;\r\n isErrModalOpen: boolean;\r\n iProductsPresentVersion: number;\r\n shouldShowMiniCart: boolean;\r\n}\r\n\r\n// const renderInvoiceInCartMsg = (resources: ICartIconResources): JSX.Element | null => {\r\n// return <Node className={classnames('msc-cart-line__set-net-price')}>{resources.invoiceInCartMessage}</Node>;\r\n// };\r\n\r\nconst _removeItemFromCartHandler = (props: ICartIconViewProps & ICartIconExtensionProps<{}>, cartlineToRemove: CartLine) => {\r\n const cart = props.data.cart.result ?? undefined;\r\n if (cart) {\r\n const input = {\r\n cartLineIds: [cartlineToRemove.LineId!.toString()]\r\n };\r\n cart.removeCartLines(input).catch((error: unknown) => {\r\n if (error instanceof Error) {\r\n props.telemetry.warning(error.message);\r\n props.telemetry.debug('Unable to Remove Cart Line');\r\n } else {\r\n props.telemetry.warning('An unknown error occurred');\r\n props.telemetry.debug('Unable to Remove Cart Line');\r\n }\r\n });\r\n }\r\n};\r\n\r\nconst renderInvoiceCartLine = (\r\n cartLine: CartLine,\r\n props: ICartIconViewProps & ICartIconExtensionProps<{}>\r\n): IFlyoutCartLineItemViewProps => {\r\n return (\r\n <div className='msc-cart-line'>\r\n <div className='msc-cart-line__content'>\r\n <div className='msc-cart-line__product'>\r\n {MsDyn365.isBrowser ? <a className='msc-cart-line__product-title'>Invoice {cartLine.InvoiceId}</a> : null}\r\n <div className='msc-cart-line__product__invoice-terms'></div>\r\n </div>\r\n\r\n <div className='msc-cart-line__product-savings'>\r\n <span className={classnames('msc-price', props.className)}>\r\n <span className='msc-cart-line__product-savings-actual'>\r\n <span className='msc-price__actual' itemProp='price'>\r\n {props.context.cultureFormatter.formatCurrency(cartLine.Price)}\r\n </span>\r\n </span>\r\n </span>\r\n </div>\r\n </div>\r\n <Button\r\n className='msc-cart-line__remove-item'\r\n // onClick={props.removeItemClickHandler}\r\n onClick={e => _removeItemFromCartHandler(props, cartLine)}\r\n title={props.resources.removeCartButtonText}\r\n {...props.removeCartItemAttribute}\r\n >\r\n {props.resources.removeCartButtonText}\r\n </Button>\r\n\r\n {/* <div className='msc-price__actual'>{props.context.cultureFormatter.formatCurrency(cartLine.Price)}</div> */}\r\n </div>\r\n );\r\n};\r\n\r\n/**\r\n * Render Cart lines.\r\n * @param cartLines - Flyout cart line view props.\r\n * @param props - Cart icon view props.\r\n * @returns JSX Element.\r\n */\r\nconst renderCartlines = (\r\n cartLines: IFlyoutCartLineItemViewProps[] | undefined,\r\n props: ICartIconViewProps & ICartIconExtensionProps<{}>\r\n): JSX.Element[] | null => {\r\n // if (props.data.cart.result?.hasInvoiceLine) {\r\n // return [<Node {...props.miniCartItemWrapper}>{renderInvoiceInCartMsg(props.resources)}</Node>];\r\n // }\r\n const cart = props.data.cart.result ?? undefined;\r\n if (cart?.hasInvoiceLine) {\r\n const invoiceCartLines = cart.cart.CartLines;\r\n return invoiceCartLines.map((cartLine: CartLine, index: number) => {\r\n const cartLineIndex = index;\r\n return (\r\n <Node {...props.miniCartItemWrapper} key={cartLineIndex}>\r\n <Node className={classnames('')}>{renderInvoiceCartLine(cartLine, props)}</Node>\r\n {/* {cartLine.remove}\r\n {cartLine.storeLocation} */}\r\n </Node>\r\n );\r\n });\r\n }\r\n\r\n if (!cartLines) {\r\n props.context.telemetry.error('Cartlines content is empty, module wont render');\r\n return null;\r\n }\r\n\r\n if (MsDyn365.isBrowser) {\r\n document.addEventListener('UPDATE_CART', (data: any) => {\r\n if (data.detail.Products?.length) {\r\n const cartState = props.data.cart.result;\r\n cartState?.removeCartLines({ cartLineIds: data.detail.Products.map((p: any) => p.LineId) });\r\n }\r\n });\r\n }\r\n\r\n return cartLines.map((cartLine, index) => {\r\n const cartLineIndex = index;\r\n return (\r\n <Node {...props.miniCartItemWrapper} key={cartLineIndex}>\r\n <Node className={classnames(cartLine.storeLocation ? 'msc-cart-line__set-net-price' : '')}>{cartLine.cartline}</Node>\r\n {cartLine.remove}\r\n {cartLine.storeLocation}\r\n </Node>\r\n );\r\n });\r\n};\r\n\r\n/**\r\n * Initiate total price.\r\n * @param props - Cart icon view props.\r\n * @returns JSX Element.\r\n */\r\nconst renderTotalPrice = (props: ICartIconViewProps & ICartIconExtensionProps<{}>): JSX.Element | null => {\r\n const cart = props.data.cart.result ?? undefined;\r\n const price = cart && !cart.hasInvoiceLine && (cart.cart.TotalAmount || undefined);\r\n const subtotal = !price && cart && cart.cart && cart.cart.SubtotalAmount ? cart.cart.SubtotalAmount : undefined;\r\n const totalPrice = price\r\n ? props.context.cultureFormatter.formatCurrency(price)\r\n : subtotal\r\n ? props.context.cultureFormatter.formatCurrency(subtotal)\r\n : props.context.cultureFormatter.formatCurrency(props.resources.emptyPrice);\r\n return (\r\n <div className='ms-cart-icon__subTotalText'>\r\n <span className='ms-cart-icon__subTotalPriceText'>\r\n {props.resources.totalPriceFormatString?.replace('{price}', '')}\r\n <span className='ms-cart-icon__subTotalPrice'>{totalPrice}</span>\r\n </span>\r\n </div>\r\n );\r\n};\r\n\r\n/**\r\n *\r\n * CartIconView component.\r\n * @extends {React.PureComponent<ICartIconViewProps>}\r\n */\r\nexport class CartIconView extends React.PureComponent<\r\n ICartViewProps & ICartIconViewProps & ICartIconExtensionProps<{}>,\r\n ICartIconViewState\r\n> {\r\n private isAutoDisplayTriggered: boolean;\r\n private isErrAutoDisplayTriggered: boolean;\r\n private ALLOWABLE_FREIGHT_ATTRIBUTE_KEY = 'AllowableFreightAmount';\r\n private INVOICE_AMOUNT_ATTRIBUTE_KEY = 'InvoiceAmountDue';\r\n\r\n public constructor(props: ICartViewProps & ICartIconViewState & ICartIconViewProps & ICartIconExtensionProps<{}>) {\r\n super(props);\r\n this.isAutoDisplayTriggered = false;\r\n this.isErrAutoDisplayTriggered = false;\r\n this.state = {\r\n isModalOpen: false,\r\n isAddressCheckComplete: false,\r\n isErrModalOpen: false,\r\n iProductsPresentVersion: 0,\r\n shouldShowMiniCart: false\r\n };\r\n }\r\n\r\n public componentDidMount(): void {\r\n if (MsDyn365.isBrowser) {\r\n window.addEventListener('keydown', this._escFunction, false);\r\n document.addEventListener('INVOICE_ADDED', this.handleInvoiceAdded, false);\r\n }\r\n }\r\n\r\n public componentWillUnmount(): void {\r\n if (MsDyn365.isBrowser) {\r\n window.removeEventListener('keydown', this._escFunction, false);\r\n document.removeEventListener('INVOICE_ADDED', this.handleInvoiceAdded, false);\r\n }\r\n }\r\n\r\n private getAllowableFreightAttIdx = (): number => {\r\n return (\r\n this.props.data.cart.result?.cart.AttributeValues?.findIndex(\r\n (attribute: AttributeTextValue) => attribute.Name === this.ALLOWABLE_FREIGHT_ATTRIBUTE_KEY\r\n ) ?? -1\r\n );\r\n };\r\n\r\n private getInvoiceAmountDueAttIdx = (): number => {\r\n return (\r\n this.props.data.cart.result?.cart.AttributeValues?.findIndex(\r\n (attribute: AttributeTextValue) => attribute.Name === this.INVOICE_AMOUNT_ATTRIBUTE_KEY\r\n ) ?? -1\r\n );\r\n };\r\n\r\n // private getCouponCodeAttIdx = (): number => {\r\n // return (\r\n // this.props.data.cart.result?.cart.AttributeValues?.findIndex(\r\n // (attribute: AttributeTextValue) => attribute.Name === 'coupon-code'\r\n // ) ?? -1\r\n // );\r\n // };\r\n\r\n private _removeCommentFromCartLine(): void {\r\n const cartState: ICartState = this.props.data.cart.result || undefined;\r\n\r\n if (cartState) {\r\n const _clonedCart: Cart = { ...cartState.cart };\r\n let isUpdatedNeeded: boolean = false;\r\n\r\n if ((!cartState.cart.CartLines || cartState.cart.CartLines.length === 0) && cartState.cart.Comment) {\r\n _clonedCart.Comment = '';\r\n isUpdatedNeeded = true;\r\n }\r\n\r\n const cartLines: CartLine[] | undefined = cartState.cart.CartLines;\r\n const hasInvoiceLines = cartLines?.some(line => line.IsInvoiceLine);\r\n\r\n // const couponCodeIdx = this.getCouponCodeAttIdx();\r\n // if (couponCodeIdx !== -1 && hasInvoiceLines) {\r\n // const attributeArr: AttributeTextValue[] = _clonedCart.AttributeValues || [];\r\n // attributeArr[couponCodeIdx] = {\r\n // '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.AttributeTextValue',\r\n // Name: 'coupon-code',\r\n // ExtensionProperties: [],\r\n // TextValue: ' ',\r\n // TextValueTranslations: []\r\n // } as AttributeTextValue;\r\n\r\n // _clonedCart.AttributeValues = attributeArr;\r\n // isUpdatedNeeded = true;\r\n // }\r\n\r\n const allowableFreightIdx = this.getAllowableFreightAttIdx();\r\n if (allowableFreightIdx !== -1) {\r\n const attributeArr: AttributeTextValue[] = _clonedCart.AttributeValues || [];\r\n let freightData: { invoiceId: string; amount: number }[] = JSON.parse(attributeArr[allowableFreightIdx].TextValue || '[]');\r\n\r\n if (!hasInvoiceLines) {\r\n attributeArr.splice(allowableFreightIdx, 1);\r\n isUpdatedNeeded = true;\r\n } else {\r\n const updatedFreightData = freightData.filter(item => cartLines?.some(line => line.InvoiceId === item.invoiceId));\r\n\r\n if (updatedFreightData.length !== freightData.length) {\r\n attributeArr[allowableFreightIdx] = {\r\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.AttributeTextValue',\r\n Name: this.ALLOWABLE_FREIGHT_ATTRIBUTE_KEY,\r\n ExtensionProperties: [],\r\n TextValue: JSON.stringify(updatedFreightData),\r\n TextValueTranslations: []\r\n } as AttributeTextValue;\r\n\r\n _clonedCart.AttributeValues = attributeArr;\r\n isUpdatedNeeded = true;\r\n }\r\n }\r\n }\r\n\r\n const invoiceAmountDueIdx = this.getInvoiceAmountDueAttIdx();\r\n if (invoiceAmountDueIdx !== -1) {\r\n const attributeArr: AttributeTextValue[] = _clonedCart.AttributeValues || [];\r\n let invoiceData: { invoiceId: string; amountDue: number }[] = JSON.parse(\r\n attributeArr[invoiceAmountDueIdx].TextValue || '[]'\r\n );\r\n\r\n if (!hasInvoiceLines) {\r\n attributeArr.splice(invoiceAmountDueIdx, 1);\r\n isUpdatedNeeded = true;\r\n } else {\r\n const updatedInvoiceData = invoiceData.filter(item => cartLines?.some(line => line.InvoiceId === item.invoiceId));\r\n\r\n if (updatedInvoiceData.length !== invoiceData.length) {\r\n attributeArr[invoiceAmountDueIdx] = {\r\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.AttributeTextValue',\r\n Name: this.INVOICE_AMOUNT_ATTRIBUTE_KEY,\r\n ExtensionProperties: [],\r\n TextValue: JSON.stringify(updatedInvoiceData),\r\n TextValueTranslations: []\r\n } as AttributeTextValue;\r\n\r\n _clonedCart.AttributeValues = attributeArr;\r\n isUpdatedNeeded = true;\r\n }\r\n }\r\n }\r\n\r\n if (isUpdatedNeeded) {\r\n void cartState.updateCart({ newCartObject: _clonedCart });\r\n }\r\n }\r\n }\r\n\r\n private async getAddresses(): Promise<Address | undefined> {\r\n if (this.props.context.request.user.isAuthenticated) {\r\n const customer = await readAsync(\r\n { callerContext: this.props.context.actionContext },\r\n this.props.context.request.user.customerAccountNumber!\r\n );\r\n if (customer) {\r\n return customer.Addresses?.find(add => add.IsPrimary);\r\n }\r\n }\r\n return undefined;\r\n }\r\n\r\n private async handleCartAddress(): Promise<void> {\r\n const cartState = this.props.data.cart.result;\r\n if (cartState) {\r\n this.setState({ isAddressCheckComplete: true });\r\n const hasAddress = !!cartState.cart.ShippingAddress;\r\n // console.log(hasAddress, 'has address')\r\n if (!hasAddress) {\r\n const primaryAddress = await this.getAddresses();\r\n // console.log(primaryAddress, 'primary address')\r\n\r\n if (!!primaryAddress) {\r\n void (await cartState.updateShippingAddress({ newShippingAddress: primaryAddress }));\r\n }\r\n }\r\n }\r\n }\r\n\r\n private getExtensionPropertyValueByKey = (\r\n properties: CommerceProperty[] | undefined,\r\n key: string,\r\n valueType: CommercePropertyValueEnum\r\n ) => {\r\n const property = properties?.find(p => p.Key === key)?.Value;\r\n\r\n // eslint-disable-next-line security/detect-object-injection\r\n const val = property ? property[valueType] : null;\r\n return val;\r\n };\r\n\r\n // private _removeWarehouseAttribute = async () => {\r\n // const cartState: ICartState = this.props.data.cart.result || undefined;\r\n // const authorizedWarehouseAccounts: string[] = this.props.context.app.config.authorizedWarehouseAccounts || [];\r\n // const isAlternateWarehouseFeatureEnabled: boolean = this.props.context.app.config.enableAlternateWarehouseFeature;\r\n // const customerAccNum = this.props.context.request.user.customerAccountNumber;\r\n // const hasAccess = isAlternateWarehouseFeatureEnabled || (customerAccNum && authorizedWarehouseAccounts.includes(customerAccNum));\r\n\r\n // if (hasAccess || !cartState) {\r\n // return;\r\n // }\r\n\r\n // let changesMade = false;\r\n // const updatedCartLines = cartState.cart.CartLines?.map(cartline => {\r\n // let needsUpdate = false;\r\n // const updatedAttributes = cartline.AttributeValues?.map((attr: AttributeTextValue) => {\r\n // if (attr.Name === 'IsWarehouseOverride' && attr.TextValue !== 'false') {\r\n // needsUpdate = true;\r\n // return { ...attr, TextValue: 'false' };\r\n // } else if (attr.Name === 'WarehouseId' && attr.TextValue !== '') {\r\n // needsUpdate = true;\r\n // return { ...attr, TextValue: '' };\r\n // }\r\n // return attr;\r\n // });\r\n\r\n // if (needsUpdate) {\r\n // changesMade = true;\r\n // return { ...cartline, AttributeValues: updatedAttributes };\r\n // }\r\n // return cartline;\r\n // });\r\n\r\n // if (!changesMade || !updatedCartLines) {\r\n // return;\r\n // }\r\n\r\n // try {\r\n // await cartState.updateCartLines({ updatedCartLinesObject: updatedCartLines ?? [] });\r\n // } catch (e) {\r\n // console.error('Error removing warehouse attributes', e);\r\n // }\r\n // };\r\n\r\n /**\r\n * Render Cart Item count.\r\n * @returns JSX Element.\r\n */\r\n public render(): JSX.Element | null {\r\n this._removeCommentFromCartLine();\r\n // this._removeWarehouseAttribute();\r\n const cart: ICartState = this.props.data.cart.result ?? undefined;\r\n const authorizedWarehouseAccounts = this.props.context.app.config.authorizedWarehouseAccounts || [];\r\n const isAlternateWarehouseFeatureEnabled = this.props.context.app.config.enableAlternateWarehouseFeature ?? false;\r\n removeWarehouseAttributes(\r\n cart,\r\n authorizedWarehouseAccounts,\r\n isAlternateWarehouseFeatureEnabled,\r\n this.props.context.request.user.customerAccountNumber\r\n );\r\n\r\n let iProductsPresent = this.getExtensionPropertyValueByKey(\r\n cart?.cart?.ExtensionProperties,\r\n 'not-eligible',\r\n CommercePropertyValueEnum.string\r\n );\r\n // console.log(iProductsPresent)\r\n // console.log(this.state.iProductsPresentVersion, !!this.state.iProductsPresentVersion)\r\n if (!this.isErrAutoDisplayTriggered && typeof iProductsPresent === 'string' && iProductsPresent !== '[]') {\r\n this.setState({ isErrModalOpen: true, iProductsPresentVersion: cart?.cart.Version || 0 });\r\n this.isErrAutoDisplayTriggered = true;\r\n } else if (!this.state.isErrModalOpen && cart?.cart.Version !== this.state.iProductsPresentVersion) {\r\n this.isErrAutoDisplayTriggered = false;\r\n }\r\n\r\n if (this.state.isErrModalOpen) {\r\n this.isAutoDisplayTriggered = true;\r\n }\r\n\r\n let ippContent;\r\n\r\n if (!!iProductsPresent) {\r\n try {\r\n ippContent = (\r\n <>\r\n <p>{this.props.resources.ineligibleProductsText}</p>\r\n {(JSON.parse(iProductsPresent as string) as CartLine[]).map(r => (\r\n <li>\r\n {r.Barcode}: {r.Description}\r\n </li>\r\n ))}\r\n </>\r\n );\r\n } catch (err) {}\r\n }\r\n\r\n if (cart && !this.state.isAddressCheckComplete) {\r\n this.handleCartAddress();\r\n }\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- check config.\r\n const shouldShowMiniCart =\r\n (this.state.shouldShowMiniCart || cart?.isProductAddedToCart) &&\r\n this.props.context.app.config.addToCartBehavior === AddToCartBehavior.showMiniCart;\r\n this.props.removeItemClickHandler;\r\n\r\n if (shouldShowMiniCart) {\r\n if (!this.isAutoDisplayTriggered) {\r\n // First time trigger auto mini cart.\r\n this.setState({ isModalOpen: true });\r\n this.isAutoDisplayTriggered = true;\r\n } else if (!this.state.isModalOpen) {\r\n // If modal is closed, reset the flag.\r\n this.isAutoDisplayTriggered = false;\r\n }\r\n }\r\n\r\n // Resolving ticket 8253: Remove \"Checkout\" option; only allow \"Go to Shopping Cart\".\r\n\r\n const itemCount = this.props.data.cart.result?.cart.CartLines.length || 0;\r\n const goToCartButtonText = this.props.resources.goToCartButtonTitleNew.replace('{count}', itemCount.toString());\r\n\r\n return (\r\n <Node {...this.props.miniCartWrapper} {...this.props.renderModuleAttributes(this.props)}>\r\n <button onClick={this._openModal} className='ms-cart-icon-wrapper msc-btn'>\r\n {this.props.cartIcon}\r\n </button>\r\n <Node {...this._modalErrContainer()}>{ippContent && ippContent}</Node>\r\n <Node {...this._modalContainer()}>\r\n <Node className='ms-cart-icon__header msc-modal__header'>\r\n {this.props.flyoutTitle}\r\n {this._renderCartItemCount(this.props)}\r\n {this._renderCartCloseIcon()}\r\n </Node>\r\n <Node className='ms-cart-icon__body msc-modal__body'>\r\n {this.props.slots.allowableFreight}\r\n {this.props.data.cart.result?.isEmpty ? this.props.slots.emptyCart : null}\r\n <Node {...this.props.CartlinesWrapper}>{renderCartlines(this.props.cartlines, this.props)}</Node>\r\n </Node>\r\n <Node className='ms-cart-icon__footer msc-modal__footer'>\r\n {this.props.slots.promoContentItem}\r\n {renderTotalPrice(this.props)}\r\n <p className='ms-cart-icon__subtotal-message'>{this.props.resources.subTotalMessage}</p>\r\n {/* {this.props.checkoutAsSignInUserButton}\r\n {this.props.checkoutAsGuestButton} */}\r\n\r\n {this.props.data.cart.result?.isEmpty ? null : (\r\n <Button\r\n className='ms-cart-icon__btn-gotocart'\r\n href={this.props.goToCartButton.props.href}\r\n title={goToCartButtonText}\r\n {...this.props.goToCartButton.props}\r\n >\r\n {goToCartButtonText}\r\n </Button>\r\n )}\r\n <Node className='ms-cart-icon__btn-section'>\r\n {this.props.data.cart.result?.isEmpty ? (\r\n <Button\r\n className='ms-cart-icon__btn-backtoshopping'\r\n href={getUrlSync('home', this.props.context.actionContext)}\r\n >\r\n {this.props.resources.continueShoppingButtonTitle}\r\n </Button>\r\n ) : null}\r\n </Node>\r\n </Node>\r\n </Node>\r\n </Node>\r\n );\r\n }\r\n\r\n /**\r\n * Initiate modal container.\r\n * @returns Inode props.\r\n */\r\n private readonly _modalContainer = (): INodeProps => {\r\n return {\r\n tag: Modal,\r\n placement: 'bottom-end',\r\n hideArrow: true,\r\n className: 'ms-cart-icon__minicartmodal-container',\r\n wrapClassName: 'ms-cart-icon__minicartmodal',\r\n isOpen: this.state.isModalOpen,\r\n toggle: this.closeModal\r\n };\r\n };\r\n\r\n /**\r\n * Initiate open modal.\r\n */\r\n private readonly _openModal = (): void => {\r\n const payLoad = getPayloadObject('click', this.props.telemetryContent!, 'cart-icon', '');\r\n onTelemetryClick(this.props.telemetryContent!, payLoad, 'cart-icon');\r\n this.setState({\r\n isModalOpen: true\r\n });\r\n };\r\n\r\n private readonly _modalErrContainer = (): INodeProps => {\r\n return {\r\n tag: Modal,\r\n placement: 'bottom-end',\r\n hideArrow: true,\r\n className: 'ms-cart-icon__minicarterrmodal-container',\r\n wrapClassName: 'ms-cart-icon__minicarterrmodal',\r\n isOpen: this.state.isErrModalOpen,\r\n toggle: this.closeErrModal\r\n };\r\n };\r\n\r\n private readonly closeErrModal = (): void => {\r\n this.setState({\r\n isErrModalOpen: false\r\n });\r\n\r\n this.isAutoDisplayTriggered = true;\r\n };\r\n\r\n /**\r\n * Initiate close modal.\r\n */\r\n private readonly closeModal = (): void => {\r\n this.setState({\r\n isModalOpen: false,\r\n shouldShowMiniCart: false\r\n });\r\n };\r\n\r\n /**\r\n * Initiate cart close Icon.\r\n * @returns JSX Element.\r\n */\r\n private readonly _renderCartCloseIcon = (): JSX.Element | null => {\r\n return <Button className='ms-cart-icon__btn-close' aria-label='Close' onClick={this.closeModal} />;\r\n };\r\n\r\n /**\r\n * Render Cart Item count.\r\n * @param props - Cart icon view props.\r\n * @returns JSX Element.\r\n */\r\n private readonly _renderCartItemCount = (props: ICartIconViewProps & ICartIconExtensionProps<{}>): JSX.Element | null => {\r\n let cartItemCount;\r\n const defaultCartItemCount: number = 0;\r\n const defaultCartItemCountOne: number = 1;\r\n\r\n const cart = props.data.cart.result ?? undefined;\r\n\r\n if (ArrayExtensions.hasElements(props.cartlines)) {\r\n if (props.cartlines.length === defaultCartItemCountOne) {\r\n cartItemCount = `${defaultCartItemCountOne} ${props.resources.item}`;\r\n } else {\r\n cartItemCount = `${props.cartlines.length} ${props.resources.items}`;\r\n }\r\n } else if (cart?.hasInvoiceLine && cart.cart.CartLines) {\r\n cartItemCount =\r\n cart.cart.CartLines.length == 1\r\n ? `${cart.cart.CartLines.length} ${props.resources.item}`\r\n : `${cart.cart.CartLines.length} ${props.resources.items}`;\r\n } else {\r\n cartItemCount = `${defaultCartItemCount} ${props.resources.items}`;\r\n }\r\n return (\r\n <Node className='ms-cart-icon__count' tabIndex='0'>\r\n {cartItemCount}\r\n </Node>\r\n );\r\n };\r\n\r\n /**\r\n * Handle escape click to close modal.\r\n * @param event - On press of any key.\r\n */\r\n private readonly _escFunction = (event: KeyboardEvent) => {\r\n if (event.keyCode === KeyCodes.Escape && this.state.isModalOpen) {\r\n this.closeModal();\r\n }\r\n };\r\n\r\n private handleInvoiceAdded = (data: any) => {\r\n this.setState({ shouldShowMiniCart: true });\r\n };\r\n}\r\n\r\nexport default CartIconView;\r\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 { IPriceComponentResources } from './components/price.component';\r\nimport { ProductPrice, ProductSearchResult, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { ArrayExtensions, getProductPageUrlSync } from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n ICategoryHierarchyViewProps,\r\n IRefineMenuViewProps,\r\n ISearchResultContainerViewProps,\r\n ISearchResultModalViewProps,\r\n ISortByViewProps,\r\n ITitleViewProps\r\n} from '@msdyn365-commerce-modules/search-result-container';\r\nimport MsDyn365, { RichTextComponent } from '@msdyn365-commerce/core';\r\nimport {\r\n Button,\r\n getTelemetryObject,\r\n IPopupProps,\r\n Modal,\r\n ModalBody,\r\n ModalHeader,\r\n Module,\r\n Node,\r\n Popup\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport React, { PropsWithChildren, useState } from 'react';\r\nimport { ISearchResultContainerProps } from '../definition-extensions/search-result-container.ext.props.autogenerated';\r\nimport { ProductComponent } from './components/product.component';\r\nimport { getUrlSync, IGridSettings, IImageData, IImageProps, IImageSettings, Image, IRequestContext } from '@msdyn365-commerce/core';\r\nimport { AddToCartListComponent } from './components/addToCart.component';\r\nimport { IProductSearchResultExtensionData } from './product-result-container.data';\r\nimport Table from 'reactstrap/lib/Table';\r\nimport { LoginToViewPricingComponent } from '../../../components/LoginToViewPricing.component';\r\nimport { SupersessionKey } from '../models/SupersessionKey';\r\nimport { CommercePropertyValueEnum } from '../../../modules/allowable-freight/utils/CommercePropertyValueEnum';\r\nimport { getInventoryLevelRangesAsync } from '../../../actions/DataActionExtension.g';\r\nimport { IItemInventoryLevelProfileEntity, IProfileDataMap } from '../../../actions/DataServiceEntities.g';\r\nimport getExtensionPropertyValueByKey from '../../../utils/getExtensionPropertyValueByKey';\r\nimport { EligibleItems } from '../../../modules/eve-quick-order/eve-quick-order';\r\nimport GetProductEligibilityAction, { GetProductEligibilityInput } from '../../../actions/get-product-eligibility.action';\r\nimport { InventoryBreakdownComponent } from './components/inventory-breakdown.component';\r\nimport { Tooltip } from 'reactstrap';\r\nimport getProductSupersessionProperty from '../models/getProductSupersessionProperty';\r\n/**\r\n * DescriptionInterval.\r\n */\r\nenum DescriptionInterval {\r\n productDescriptionInterval = 14,\r\n productDescriptionIntervalRemainder0 = 0,\r\n productDescriptionIntervalRemainder9 = 9\r\n}\r\n\r\n/**\r\n * Render Clear button for mobile viewport.\r\n * @param props - The view props.\r\n * @returns The JSX Element.\r\n */\r\nconst renderProductCards = (\r\n props: PropsWithChildren<ISearchResultContainerViewProps & ISearchResultContainerProps<{}>>,\r\n eligbilityList: EligibleItems,\r\n isAuthenticated: boolean,\r\n inventoryRangesList: IProfileDataMap[],\r\n hasInvoice: boolean,\r\n courseId: any,\r\n setAvailabilityModalProduct?: React.Dispatch<React.SetStateAction<number>>\r\n): JSX.Element | null => {\r\n const products = props.data.listPageState.result?.activeProducts;\r\n if (!products || !ArrayExtensions.hasElements(products)) {\r\n return null;\r\n }\r\n const canAddToCart = (pr: ProductSearchResult): boolean => {\r\n if (!isAuthenticated) {\r\n return false;\r\n }\r\n\r\n const item: any = eligbilityList.find(i => i.ItemId === pr.ItemId);\r\n const currentInvString = getProductSupersessionProperty(pr, SupersessionKey.Inventory) || '0';\r\n const currentInventory = parseInt(currentInvString, 10);\r\n let invProfOos: IItemInventoryLevelProfileEntity | undefined;\r\n\r\n inventoryRangesList.forEach(ir => {\r\n const tempInvRange = ir.Profile?.find(p => p.ItemId === pr.ItemId && p.Code === 'OOS');\r\n if (tempInvRange) {\r\n invProfOos = tempInvRange;\r\n }\r\n });\r\n\r\n const OosUpperBound = invProfOos?.UpperBoundInclusive !== undefined ? invProfOos.UpperBoundInclusive : 0;\r\n const isOutOfStock = currentInventory <= OosUpperBound;\r\n\r\n return item?.IsEligible && !isOutOfStock && !hasInvoice && !courseId;\r\n };\r\n\r\n return (\r\n <Node {...props.ProductsContainer}>\r\n {props.errorMessage}\r\n <ul className='list-unstyled'>\r\n {products.map((product: ProductSearchResult, index: number) => {\r\n const canAddItemToCart = canAddToCart(product);\r\n return renderProductCardsDescription(\r\n props,\r\n product,\r\n index,\r\n canAddItemToCart ? setAvailabilityModalProduct : undefined,\r\n false\r\n );\r\n })}\r\n </ul>\r\n </Node>\r\n );\r\n};\r\n\r\n/**\r\n * Returns the product inventory label.\r\n * @param channelInventoryConfigurationId - The channel configuration Id.\r\n * @param product - The product.\r\n * @returns The inventory label.\r\n */\r\nfunction getInventoryLabel(channelInventoryConfigurationId: number | undefined, product: ProductSearchResult): string | undefined {\r\n if (!channelInventoryConfigurationId || !ArrayExtensions.hasElements(product.AttributeValues)) {\r\n return undefined;\r\n }\r\n const inventoryAttribute = product.AttributeValues.find(attribute => attribute.RecordId === channelInventoryConfigurationId);\r\n if (inventoryAttribute) {\r\n return inventoryAttribute.TextValue;\r\n }\r\n return undefined;\r\n}\r\n\r\n/**\r\n * Render Clear button for mobile viewport.\r\n * @param props - The view props.\r\n * @param product - The product item data.\r\n * @param index - The index of each product item.\r\n * @param isEnabledProductDescription - The flag for showing Product desription tile.\r\n * @returns The JSX Element.\r\n */\r\nconst renderProductCardsDescription = (\r\n props: PropsWithChildren<ISearchResultContainerViewProps & ISearchResultContainerProps<{}>>,\r\n product: ProductSearchResult,\r\n index: number,\r\n setAvailabilityModalProduct?: React.Dispatch<React.SetStateAction<number>>,\r\n isEnabledProductDescription?: boolean\r\n): JSX.Element | null => {\r\n const { config, context, resources } = props;\r\n const telemetryContent = getTelemetryObject(props.context.request.telemetryPageName!, props.friendlyName, props.telemetry);\r\n const breadCrumbType = props.context.app.config.breadcrumbType;\r\n const isAllowBack = props.config.allowBackNavigation && (breadCrumbType === 'back' || breadCrumbType === 'categoryAndBack');\r\n const classname = isEnabledProductDescription\r\n ? 'ms-product-search-result__item product__description'\r\n : 'ms-product-search-result__item';\r\n const quickviewslot = ArrayExtensions.hasElements(props.slots.quickview) ? props.slots.quickview[0] : undefined;\r\n const channelInventoryConfigurationId = props.data.products.result?.channelInventoryConfigurationId;\r\n // @ts-ignore\r\n const isPriceMinMaxFeatureState = props.data.featureState.result?.find(\r\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailSearchPriceRangeFeature'\r\n );\r\n const priceResources: IPriceComponentResources = {\r\n priceRangeSeparator: resources.priceRangeSeparator,\r\n loginToViewPricingText: resources.loginToViewPricing\r\n };\r\n return (\r\n <li className={classname} key={index}>\r\n <ProductComponent\r\n context={context}\r\n telemetryContent={telemetryContent}\r\n imageSettings={config.imageSettings}\r\n freePriceText={resources.priceFree}\r\n originalPriceText={resources.originalPriceText}\r\n currentPriceText={resources.currentPriceText}\r\n ratingAriaLabel={resources.ratingAriaLabel}\r\n allowBack={isAllowBack}\r\n id={props.id}\r\n typeName={props.typeName}\r\n data={{ product }}\r\n quickViewButton={quickviewslot}\r\n isEnabledProductDescription={isEnabledProductDescription}\r\n inventoryLabel={getInventoryLabel(channelInventoryConfigurationId, product)}\r\n isPriceMinMaxEnabled={isPriceMinMaxFeatureState?.IsEnabled}\r\n priceResources={priceResources}\r\n setAvailabilityModalProduct={setAvailabilityModalProduct}\r\n />\r\n </li>\r\n );\r\n};\r\n\r\n/**\r\n * Render Clear button for mobile viewport.\r\n * @param props - The view props.\r\n * @returns The JSX Element.\r\n */\r\nconst renderProducts = (\r\n props: PropsWithChildren<ISearchResultContainerViewProps & ISearchResultContainerProps<{}>>,\r\n eligbilityList: EligibleItems,\r\n isAuthenticated: boolean,\r\n inventoryRangesList: IProfileDataMap[],\r\n hasInvoice: boolean,\r\n courseId: any,\r\n setAvailabilityModalProduct?: React.Dispatch<React.SetStateAction<number>>\r\n): JSX.Element | null => {\r\n const products = props.data.listPageState.result?.activeProducts;\r\n if (!products || !ArrayExtensions.hasElements(products)) {\r\n return null;\r\n }\r\n if (!products || !ArrayExtensions.hasElements(products)) {\r\n return null;\r\n }\r\n const canAddToCart = (pr: ProductSearchResult): boolean => {\r\n if (!isAuthenticated) {\r\n return false;\r\n }\r\n\r\n const item: any = eligbilityList.find(i => i.ItemId === pr.ItemId);\r\n const currentInvString = getProductSupersessionProperty(pr, SupersessionKey.Inventory) || '0';\r\n const currentInventory = parseInt(currentInvString, 10);\r\n let invProfOos: IItemInventoryLevelProfileEntity | undefined;\r\n\r\n inventoryRangesList.forEach(ir => {\r\n const tempInvRange = ir.Profile?.find(p => p.ItemId === pr.ItemId && p.Code === 'OOS');\r\n if (tempInvRange) {\r\n invProfOos = tempInvRange;\r\n }\r\n });\r\n\r\n const OosUpperBound = invProfOos?.UpperBoundInclusive !== undefined ? invProfOos.UpperBoundInclusive : 0;\r\n const isOutOfStock = currentInventory <= OosUpperBound;\r\n\r\n return item?.IsEligible && !isOutOfStock && !hasInvoice && !courseId;\r\n };\r\n const productDescriptionInterval: number = DescriptionInterval.productDescriptionInterval;\r\n const productDescriptionIntervalRemainder0: number = DescriptionInterval.productDescriptionIntervalRemainder0;\r\n const productDescriptionIntervalRemainder9: number = DescriptionInterval.productDescriptionIntervalRemainder9;\r\n return (\r\n <Node {...props.ProductsContainer}>\r\n {props.errorMessage}\r\n <ul className='list-unstyled'>\r\n {products.map((product: ProductSearchResult, index: number) => {\r\n const canAddItemToCart = canAddToCart(product);\r\n return index % productDescriptionInterval === productDescriptionIntervalRemainder0 ||\r\n index % productDescriptionInterval === productDescriptionIntervalRemainder9\r\n ? renderProductCardsDescription(\r\n props,\r\n product,\r\n index,\r\n canAddItemToCart ? setAvailabilityModalProduct : undefined,\r\n true\r\n )\r\n : renderProductCardsDescription(\r\n props,\r\n product,\r\n index,\r\n canAddItemToCart ? setAvailabilityModalProduct : undefined,\r\n false\r\n );\r\n })}\r\n </ul>\r\n </Node>\r\n );\r\n};\r\n\r\nconst renderExpandOrRefineResults = (\r\n props:\r\n | React.PropsWithChildren<ISearchResultContainerViewProps & ISearchResultContainerProps<IProductSearchResultExtensionData>>\r\n | undefined\r\n) => {\r\n if (MsDyn365.isBrowser && typeof window !== 'undefined') {\r\n const url = new URL(window.location.href);\r\n\r\n // Check if 'find-products' exists in the URL\r\n if (url.href.includes('find-products')) {\r\n return null;\r\n }\r\n\r\n const query = url.searchParams.get('q');\r\n\r\n if (!query) {\r\n return undefined;\r\n }\r\n const trimmedQuery = query.trim();\r\n\r\n const hasMultipleTerms = /\\s|-/g.test(trimmedQuery);\r\n\r\n if (!hasMultipleTerms) {\r\n return undefined;\r\n }\r\n\r\n let link;\r\n if (!url.searchParams.has('expand') && hasMultipleTerms) {\r\n // Render \"Expand\" link only if multiple terms are present\r\n url.searchParams.append('expand', 'true');\r\n link = <a href={url?.toString() || '#'}>{props?.resources.expandResultsText}</a>;\r\n } else {\r\n if (url.searchParams.has('skip')) {\r\n url.searchParams.delete('skip');\r\n }\r\n url.searchParams.delete('expand');\r\n link = <a href={url?.toString() || '#'}>{props?.resources.refineResultsText}</a>;\r\n }\r\n\r\n return (\r\n <span>\r\n {props?.resources.notFindingText} {link}\r\n </span>\r\n );\r\n }\r\n return undefined;\r\n};\r\n\r\n/**\r\n * Render Title Count.\r\n * @param props - The title view props.\r\n * @returns The JSX Element.\r\n */\r\nconst renderTitleCount = (\r\n titleProps: ITitleViewProps,\r\n enableSearchWrap: boolean,\r\n props:\r\n | React.PropsWithChildren<ISearchResultContainerViewProps & ISearchResultContainerProps<IProductSearchResultExtensionData>>\r\n | undefined\r\n): JSX.Element | null => {\r\n const { title, TitleContainer } = titleProps;\r\n return (\r\n <Node {...TitleContainer}>\r\n {title.titleCount}\r\n {enableSearchWrap ? renderExpandOrRefineResults(props) : undefined}\r\n </Node>\r\n );\r\n};\r\n\r\n/**\r\n * Render Category Hierarchy.\r\n * @param props - The category hierarchy view props.\r\n * @returns The JSX Element.\r\n */\r\nconst renderCategoryHierarchy = (props: ICategoryHierarchyViewProps): JSX.Element | null => {\r\n const { CategoryHierarchyContainer, categoryHierarchyList, categoryHierarchySeparator } = props;\r\n if (categoryHierarchyList) {\r\n return (\r\n <Node {...CategoryHierarchyContainer}>\r\n {categoryHierarchyList.map((category, index) => (\r\n <React.Fragment key={index}>\r\n {category}\r\n {categoryHierarchyList && categoryHierarchyList[index + 1] && categoryHierarchySeparator}\r\n </React.Fragment>\r\n ))}\r\n </Node>\r\n );\r\n }\r\n\r\n return null;\r\n};\r\n\r\n/**\r\n * Render the category page items.\r\n * @param props - The view props.\r\n * @returns The search Result container module view.\r\n */\r\nconst SearchResultContainerView: React.FC<ISearchResultContainerViewProps &\r\n ISearchResultContainerProps<IProductSearchResultExtensionData>> = props => {\r\n const {\r\n SearchResultContainer,\r\n pagination,\r\n ProductSectionContainer,\r\n choiceSummary,\r\n isMobile,\r\n modalToggle,\r\n searchResultModal,\r\n TitleViewProps,\r\n refineMenu,\r\n categoryHierarchy,\r\n sortByOptions,\r\n CategoryNavContainer,\r\n RefineAndProductSectionContainer,\r\n FeatureSearchContainer,\r\n similarLookProduct,\r\n errorMessage,\r\n productPrices,\r\n context: {\r\n request,\r\n cultureFormatter,\r\n actionContext,\r\n actionContext: {\r\n requestContext: {\r\n gridSettings,\r\n user: { isAuthenticated }\r\n }\r\n }\r\n },\r\n resources: {\r\n filterText,\r\n partNoHeading,\r\n descriptionHeading,\r\n availabilityHeading,\r\n quantityHeading,\r\n listPriceHeading,\r\n yourPriceHeading,\r\n // loginToViewPricing,\r\n loginToViewPricingAndAvailabilityText,\r\n supersededFromText,\r\n priceAndAvailabilityHeading,\r\n goToCartText,\r\n continueShoppingText,\r\n addToCartModalHeading,\r\n addToCartText\r\n },\r\n data: { cart, listPageState: productSearchResults, manufacturerCodes },\r\n config: { enableProdutDescription, listView, imageSettings }\r\n } = props;\r\n\r\n const [activeProducts, setActiveProducts] = React.useState<ProductSearchResult[]>([]);\r\n\r\n // Fix for issue 8251: Boost relevance of Part Number matches\r\n // This change prioritizes matched products by ItemId and manufacturer codes\r\n // to improve search relevance and address the issue of items flipping\r\n\r\n React.useEffect(() => {\r\n if (request.query) {\r\n const searchTerm = request.query['q'];\r\n const codes = manufacturerCodes?.result as any;\r\n\r\n const matchedProducts: ProductSearchResult[] = [];\r\n const unmatchedProducts: ProductSearchResult[] = [];\r\n\r\n productSearchResults.result?.activeProducts.forEach(p => {\r\n let matched = false;\r\n\r\n // Check for direct match by ItemId\r\n if (\r\n searchTerm &&\r\n (p.ItemId?.toLowerCase() === searchTerm.toLowerCase() ||\r\n p.ItemId?.substring(3, p.ItemId.length).toLowerCase() === searchTerm.toLowerCase())\r\n ) {\r\n matched = true;\r\n } else {\r\n // Check for manufacturer code match\r\n for (let i = 0; i < codes.manufacturerCodes.length; i++) {\r\n if (codes.manufacturerCodes[i].GDNManufacturerCode + searchTerm === p.ItemId) {\r\n matched = true;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if (matched) {\r\n matchedProducts.push(p);\r\n } else {\r\n unmatchedProducts.push(p);\r\n }\r\n });\r\n setActiveProducts([...matchedProducts, ...unmatchedProducts]);\r\n }\r\n }, [request.query, manufacturerCodes, productSearchResults.result]);\r\n\r\n const [eligbilityList, setEligbilityList] = useState<EligibleItems>([]);\r\n const [isEligibilityChecked, setEligibilityChecked] = useState<boolean>(false);\r\n const [areInventoryRangesChecked, setAreInventoryRangesChecked] = useState<boolean>(false);\r\n const [inventoryRangesList, setInventoryRangesList] = useState<IProfileDataMap[]>([]);\r\n\r\n const getProductEligibility = async (): Promise<void> => {\r\n if (isEligibilityChecked) {\r\n return;\r\n }\r\n const itemIds = props.data.products?.result?.products.map(p => p.ItemId!) || [];\r\n if (!itemIds.length) {\r\n return;\r\n }\r\n const cart = props.data.cart.result?.cart;\r\n // if (!cart) {\r\n // return;\r\n // }\r\n const input = new GetProductEligibilityInput(itemIds, false, cart?.Id || '', null, null, null);\r\n const eligibilityData = await GetProductEligibilityAction(input, props.context.actionContext);\r\n setEligibilityChecked(true);\r\n let list: EligibleItems = [];\r\n\r\n eligibilityData.forEach((i: any) => {\r\n const id = getExtensionPropertyValueByKey(i.ExtensionProperties, 'ItemId', CommercePropertyValueEnum.string);\r\n list.push({\r\n ItemId: String(id),\r\n IsEligible: i.IsEligible,\r\n IsAssorted: true\r\n });\r\n });\r\n setEligbilityList(list);\r\n void getInvProfs();\r\n };\r\n\r\n const getInvProfs = async (): Promise<void> => {\r\n if (areInventoryRangesChecked) {\r\n return;\r\n }\r\n const itemIds = props.data.products?.result?.products.map(p => p.ItemId!) || [];\r\n const resp = await getInventoryLevelRangesAsync({ callerContext: props.context.actionContext }, itemIds);\r\n setAreInventoryRangesChecked(true);\r\n setInventoryRangesList(resp);\r\n };\r\n\r\n // Determines whether the alternate warehouse feature should be displayed for the user.\r\n const [shouldDisplayAlternateWarehouseFeature, setShouldDisplayAlternateWarehouseFeature] = React.useState(false);\r\n\r\n // List of customer account numbers that are authorized to use the alternate warehouse feature.\r\n const authorizedWarehouseAccounts: string[] = props.context.app.config.authorizedWarehouseAccounts || [];\r\n\r\n // Configuration flag to enable or disable the alternate warehouse feature.\r\n const isAlternateWarehouseFeatureEnabled: boolean = props.context.app.config.enableAlternateWarehouseFeature;\r\n\r\n React.useEffect(() => {\r\n if (isAlternateWarehouseFeatureEnabled) {\r\n setShouldDisplayAlternateWarehouseFeature(true);\r\n } else {\r\n const customerAccNum = props.context.request.user.customerAccountNumber;\r\n if (customerAccNum && authorizedWarehouseAccounts.includes(customerAccNum)) {\r\n setShouldDisplayAlternateWarehouseFeature(true);\r\n }\r\n }\r\n }, []);\r\n\r\n React.useEffect(() => {\r\n if (isAuthenticated) {\r\n void getProductEligibility();\r\n }\r\n }, [props.data.products]);\r\n\r\n const [isExpanded, setIsExpanded] = useState<boolean>(false);\r\n const [modalOpen, setModalOpen] = React.useState<boolean>(false);\r\n const [addedProduct, setAddedProduct] = React.useState<SimpleProduct | undefined>(undefined);\r\n const [productPricing, setProductPricing] = React.useState<ProductPrice | undefined>(undefined);\r\n const [availabilityModalProduct, setAvailabilityModalProduct] = React.useState<number>(0);\r\n const toggle = () => {\r\n setIsExpanded(!isExpanded);\r\n };\r\n\r\n const isRecoSearchPage = props.context.actionContext.requestContext.query?.recommendation;\r\n\r\n const setModalProps = (product: SimpleProduct, price: ProductPrice): IPopupProps => {\r\n return {\r\n modalOpen: modalOpen,\r\n context: props.context,\r\n className: 'list-view__modal',\r\n gridSettings,\r\n imageSettings,\r\n priceComponent: props.component,\r\n id: '1',\r\n productQuantity: 1,\r\n navigationUrl: getUrlSync('cart', actionContext),\r\n setModalOpen: value => setModalOpen(value),\r\n typeName: 'Add To Cart',\r\n data: { product, price },\r\n dialogStrings: {\r\n goToCartText: goToCartText,\r\n currentPriceText: '',\r\n continueShoppingText: continueShoppingText,\r\n freePriceText: '',\r\n headerItemOneText: addToCartModalHeading,\r\n headerItemFormatText: '',\r\n originalPriceText: '',\r\n headerMessageText: ''\r\n }\r\n };\r\n };\r\n\r\n const handleAddToCart = (productId: number, quantity: number) => {\r\n const foundProduct = activeProducts.find(pr => pr.RecordId === productId);\r\n if (!foundProduct) {\r\n return;\r\n }\r\n const product: SimpleProduct = {\r\n BasePrice: foundProduct.BasePrice || foundProduct.Price,\r\n AdjustedPrice: foundProduct.Price,\r\n Name: foundProduct.Name,\r\n RecordId: foundProduct.RecordId,\r\n ItemId: foundProduct.ItemId,\r\n ProductTypeValue: 1,\r\n Price: foundProduct.Price\r\n };\r\n setAddedProduct(product);\r\n setProductPricing(getProductPrice(productPrices, product.RecordId));\r\n cart.result\r\n ?.addProductToCart({\r\n product,\r\n count: quantity\r\n })\r\n .then(response => {\r\n if (response.status === 'SUCCESS' && props.app.config.addToCartBehavior === 'showModal') {\r\n setModalOpen(true);\r\n }\r\n });\r\n };\r\n\r\n const getProductSupersessionProperty = (product: ProductSearchResult, extensionKey: SupersessionKey) => {\r\n const properties = product.ExtensionProperties;\r\n if (properties) {\r\n return properties.find(pr => pr.Key === extensionKey)?.Value?.StringValue || null;\r\n }\r\n return null;\r\n };\r\n\r\n const renderAddtoCartButton = (pr: ProductSearchResult, courseId: any, courseInCartText: string) => {\r\n if (isAuthenticated) {\r\n const item: any = eligbilityList.find(i => i.ItemId === pr.ItemId);\r\n\r\n const currentInvString = getProductSupersessionProperty(pr, SupersessionKey.Inventory) || '0';\r\n const currentInventory = parseInt(currentInvString, 10);\r\n let invProfOos: IItemInventoryLevelProfileEntity | undefined;\r\n inventoryRangesList.map(ir => {\r\n const tempInvRange = ir.Profile?.find(p => p.ItemId === pr.ItemId && p.Code === 'OOS');\r\n if (tempInvRange) {\r\n invProfOos = tempInvRange;\r\n }\r\n });\r\n\r\n const OosUpperBound =\r\n invProfOos?.hasOwnProperty('UpperBoundInclusive') && invProfOos?.UpperBoundInclusive !== undefined\r\n ? invProfOos.UpperBoundInclusive\r\n : 0;\r\n const isOutOfStock = currentInventory <= OosUpperBound;\r\n\r\n if (item?.IsEligible && !isOutOfStock) {\r\n if (props.data.cart.result?.hasInvoiceLine) {\r\n return (\r\n <td>\r\n <div className='eduerrors'>{props.resources.invoiceInCartText}</div>\r\n </td>\r\n );\r\n }\r\n if (courseId) {\r\n return (\r\n <td>\r\n <div className='eduerrors'>{courseInCartText}</div>\r\n </td>\r\n );\r\n }\r\n return <AddToCartListComponent productId={pr.RecordId} onAddToCart={handleAddToCart} addToCartButtonText={addToCartText} />;\r\n } else {\r\n return (\r\n <td colSpan={2} style={{ textAlign: 'right' }}>\r\n {item?.ItemId ? props.resources.productEligibilityText : ' '}\r\n </td>\r\n );\r\n }\r\n }\r\n return null;\r\n };\r\n\r\n const renderAvailabilityModal = () => {\r\n const allProducts = props.data.products.result?.products;\r\n const modalProduct = allProducts?.find(p => p.RecordId === availabilityModalProduct);\r\n return (\r\n <Modal\r\n className='alternate-warehouse__modal_content'\r\n isOpen={availabilityModalProduct !== 0}\r\n toggle={() => setAvailabilityModalProduct(0)}\r\n >\r\n <ModalHeader className='alternate-warehouse__modal__header' toggle={() => setAvailabilityModalProduct(0)}>\r\n Warehouse Availability\r\n </ModalHeader>\r\n <ModalBody className='alternate-warehouse__modal__body'>\r\n {/* <p>VIEW ONLY. An alternate warehouse can be selected during checkout on the order review page.</p> */}\r\n <RichTextComponent text={props.context.app.config.warehouseAvailabilityReadOnlyMessage} />\r\n <p className='item-info top-margin'>\r\n <strong>Item:</strong> {modalProduct?.ItemId!}\r\n </p>\r\n\r\n <InventoryBreakdownComponent\r\n extensionProperties={modalProduct?.ExtensionProperties}\r\n itemId={modalProduct?.ItemId!}\r\n canBackorder={true}\r\n allowableText={props.context.app.allowableFreightWarehouseLabel}\r\n alternateText={props.context.app.preferredWarehouseLabel}\r\n warehouseMappings={props.context.app.config.alternateWarehouseMappings}\r\n />\r\n\r\n <p className='note'>\r\n {/* <strong>Note:</strong> Shipments for items sourced from an Alternate Warehouse will be charged Gardner Preferred\r\n rates. See{' '}\r\n <a href='#' className='freight-link'>\r\n Freight Policy\r\n </a>{' '}\r\n for details. */}\r\n <RichTextComponent text={props.context.app.config.pdpWarehouseSelectionNote} />\r\n </p>\r\n </ModalBody>\r\n </Modal>\r\n );\r\n };\r\n\r\n const _renderInventoryClickIcon = (id: number, isAddToCartButton: boolean) => {\r\n const [tooltipOpen, setTooltipOpen] = React.useState(false);\r\n\r\n // const warehouseJsonData = getExtensionPropertyValueByKey(\r\n // extensionProperties,\r\n // SupersessionKey.InventoryBreakdown,\r\n // CommercePropertyValueEnum.string\r\n // ) as string;\r\n\r\n // const data = JSON.parse(warehouseJsonData) as WarehouseInventoryType[];\r\n // const isPrimaryWarehouseInStock = data?.[0]?.Available > 0;\r\n\r\n if (!shouldDisplayAlternateWarehouseFeature || !isAddToCartButton) {\r\n return null;\r\n }\r\n\r\n const toggleTooltip = () => {\r\n setTooltipOpen(!tooltipOpen);\r\n };\r\n return (\r\n <div>\r\n <span\r\n id={'Tooltip-' + id}\r\n onClick={() => {\r\n setTooltipOpen(false);\r\n setAvailabilityModalProduct(id);\r\n }}\r\n data-toggle='tooltip'\r\n >\r\n <svg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 30 30'>\r\n <path d='M15,3C8.373,3,3,8.373,3,15c0,6.627,5.373,12,12,12s12-5.373,12-12C27,8.373,21.627,3,15,3z M16,21h-2v-7h2V21z M15,11.5 c-0.828,0-1.5-0.672-1.5-1.5s0.672-1.5,1.5-1.5s1.5,0.672,1.5,1.5S15.828,11.5,15,11.5z'></path>\r\n </svg>\r\n </span>\r\n <Tooltip isOpen={tooltipOpen} target={'Tooltip-' + id} toggle={toggleTooltip} placement='right' className='custom-tooltip'>\r\n Check availability\r\n </Tooltip>\r\n </div>\r\n );\r\n };\r\n\r\n let courseId: string | number | boolean | null | undefined;\r\n let cartObj = props.data.cart.result?.cart;\r\n let cartlines = cartObj?.CartLines;\r\n if (cartlines && cartlines.length) {\r\n courseId = getExtensionPropertyValueByKey(cartlines[0].ExtensionProperties, 'CourseId', CommercePropertyValueEnum.string);\r\n }\r\n const _renderProductsListView = () => {\r\n const { courseInCartText } = props.resources;\r\n return (\r\n <Table className={'list-view__table'}>\r\n <thead>\r\n <tr>\r\n <th />\r\n <th>{partNoHeading}</th>\r\n <th>{descriptionHeading}</th>\r\n {isAuthenticated ? <th>{availabilityHeading}</th> : null}\r\n <th>{listPriceHeading}</th>\r\n <th>{isAuthenticated ? yourPriceHeading : priceAndAvailabilityHeading}</th>\r\n {isAuthenticated ? (\r\n <>\r\n <th>{quantityHeading}</th>\r\n <th />\r\n </>\r\n ) : null}\r\n </tr>\r\n </thead>\r\n <tbody>\r\n {productSearchResults.result?.activeProducts.map(pr => {\r\n // const pricing = getProductPrice(productPrices, pr.RecordId);\r\n // const inventoryLabel = getInventoryLabel(configurationObject?.result?.channelInventoryConfigurationId, pr);\r\n const priceComponent = <span>{cultureFormatter.formatCurrency(pr.BasePrice || pr.Price)}</span>;\r\n const addToCartButton = renderAddtoCartButton(pr, courseId, courseInCartText);\r\n const isAddToCartButton = React.isValidElement(addToCartButton) && addToCartButton.type === AddToCartListComponent;\r\n return (\r\n <tr key={pr.RecordId}>\r\n <td>\r\n {renderProductPlacementImage(\r\n imageSettings,\r\n gridSettings,\r\n `/Products/${pr.ItemId}_000_001.png`,\r\n pr.PrimaryImageUrl,\r\n pr.Name,\r\n request\r\n )}\r\n </td>\r\n <td>\r\n <a href={getProductPageUrlSync(pr.Name!, pr.RecordId, actionContext)}>{pr.ItemId}</a>\r\n <br />\r\n {getProductSupersessionProperty(pr, SupersessionKey.SupersededId) ? (\r\n <p className={'supersession-text'}>\r\n {supersededFromText} {getProductSupersessionProperty(pr, SupersessionKey.SupersededId)}\r\n </p>\r\n ) : null}\r\n </td>\r\n <td>\r\n {pr.Name}\r\n <br />\r\n {getProductSupersessionProperty(pr, SupersessionKey.SupersededName) ? (\r\n <p className={'supersession-text'}>\r\n {supersededFromText} {getProductSupersessionProperty(pr, SupersessionKey.SupersededName)}\r\n </p>\r\n ) : null}\r\n </td>\r\n {isAuthenticated ? (\r\n <td className={'centered-cell'}>\r\n <div className='availability-modal'>\r\n {getProductSupersessionProperty(pr, SupersessionKey.Inventory)}\r\n {_renderInventoryClickIcon(pr.RecordId, isAddToCartButton)}{' '}\r\n </div>\r\n </td>\r\n ) : null}\r\n <td>{priceComponent}</td>\r\n {/* {LoginToViewPricingComponent(props.context.request, loginToViewPricing, XXX\r\n priceComponent, props.config.onlyShowPriceWhenAuthenticated ?? true)}</td> */}\r\n\r\n <td>\r\n {LoginToViewPricingComponent(\r\n props.context.request,\r\n loginToViewPricingAndAvailabilityText,\r\n <>{cultureFormatter.formatCurrency(pr.Price)}</>,\r\n isAuthenticated || !props.config.onlyShowPriceWhenAuthenticated\r\n )}\r\n {/* {(isAuthenticated || !props.config.onlyShowPriceWhenAuthenticated) ? cultureFormatter.formatCurrency(pr.Price) : null} */}\r\n </td>\r\n {addToCartButton}\r\n </tr>\r\n );\r\n })}\r\n </tbody>\r\n </Table>\r\n );\r\n };\r\n\r\n const showFilterDropdown = props.config.showFilterDropdown;\r\n const showSortDropdown = props.config.showSortDropdown;\r\n\r\n const enableSearchWrap = props.context.app.config.enableSearchWrap;\r\n if (isMobile) {\r\n return (\r\n <Module {...SearchResultContainer}>\r\n {similarLookProduct ? null : (\r\n <Node {...CategoryNavContainer}>\r\n {renderCategoryHierarchy(categoryHierarchy)}\r\n {renderTitle(TitleViewProps)}\r\n {renderTitleCount(TitleViewProps, enableSearchWrap, props)}\r\n </Node>\r\n )}\r\n {choiceSummary}\r\n <Node className='msc-sort-filter-wrapper'>{showFilterDropdown && showSortDropdown && modalToggle}</Node>\r\n {createSearchResultModal(searchResultModal, refineMenu, sortByOptions, isRecoSearchPage)}\r\n <Node {...FeatureSearchContainer}>{similarLookProduct}</Node>\r\n {errorMessage}\r\n {enableProdutDescription\r\n ? renderProducts(\r\n props,\r\n eligbilityList,\r\n isAuthenticated,\r\n inventoryRangesList,\r\n props.data.cart.result?.hasInvoiceLine || false,\r\n courseId,\r\n setAvailabilityModalProduct\r\n )\r\n : renderProductCards(\r\n props,\r\n eligbilityList,\r\n isAuthenticated,\r\n inventoryRangesList,\r\n props.data.cart.result?.hasInvoiceLine || false,\r\n courseId,\r\n setAvailabilityModalProduct\r\n )}\r\n {pagination}\r\n {renderAvailabilityModal()}\r\n </Module>\r\n );\r\n }\r\n\r\n return (\r\n <Module {...SearchResultContainer}>\r\n {/* @ts-ignore */}\r\n {modalOpen && addedProduct ? <Popup {...setModalProps(addedProduct, productPricing)} /> : null}\r\n {similarLookProduct ? null : (\r\n <Node {...CategoryNavContainer}>\r\n {categoryHierarchy && renderCategoryHierarchy(categoryHierarchy)}\r\n {TitleViewProps && renderTitle(TitleViewProps)}\r\n {TitleViewProps && renderTitleCount(TitleViewProps, enableSearchWrap, props)}\r\n </Node>\r\n )}\r\n <Node {...FeatureSearchContainer}>{similarLookProduct}</Node>\r\n <Node {...RefineAndProductSectionContainer}>\r\n {(showFilterDropdown || showSortDropdown) && (\r\n <Node className='ms-refiner-heading'>\r\n <Node className='ms-refiner-heading_title'>\r\n {showFilterDropdown && (\r\n <Button\r\n className={isExpanded ? 'ms-refine-filter__toggle_expanded' : 'ms-refine-filter__toggle_collapsed'}\r\n aria-label='Filter'\r\n onClick={toggle}\r\n aria-expanded={isExpanded}\r\n tabIndex={0}\r\n >\r\n {filterText}\r\n </Button>\r\n )}\r\n <div className='ms-search-result-wrapper-title-choice-summary'>{choiceSummary}</div>\r\n {showSortDropdown && (\r\n <div className='ms-search-result-wrapper-sort-by-category'>\r\n {sortByOptions && !isRecoSearchPage && renderSort(sortByOptions)}\r\n </div>\r\n )}\r\n </Node>\r\n {refineMenu && isExpanded && renderRefiner(refineMenu)}\r\n </Node>\r\n )}\r\n <Node {...ProductSectionContainer}>\r\n {errorMessage}\r\n {/* {enableProdutDescription ? renderProducts(props) : renderProductCards(props)} */}\r\n {listView\r\n ? _renderProductsListView()\r\n : enableProdutDescription\r\n ? renderProducts(\r\n props,\r\n eligbilityList,\r\n isAuthenticated,\r\n inventoryRangesList,\r\n props.data.cart.result?.hasInvoiceLine || false,\r\n courseId,\r\n setAvailabilityModalProduct\r\n )\r\n : renderProductCards(\r\n props,\r\n eligbilityList,\r\n isAuthenticated,\r\n inventoryRangesList,\r\n props.data.cart.result?.hasInvoiceLine || false,\r\n courseId,\r\n setAvailabilityModalProduct\r\n )}\r\n {pagination}\r\n </Node>\r\n </Node>\r\n {renderAvailabilityModal()}\r\n </Module>\r\n );\r\n};\r\n\r\n/**\r\n * Render Search result Modal.\r\n * @param modalProps - The Search Result Modal view props.\r\n * @param refineMenu - The Refine Menu view props.\r\n * @param sortByDropDown - The Sort by view props.\r\n * @param isRecoSearchPage - The recomandation search page flag.\r\n * @returns The JSX Element.\r\n */\r\nconst createSearchResultModal = (\r\n modalProps: ISearchResultModalViewProps,\r\n refineMenu: IRefineMenuViewProps,\r\n sortByDropDown: ISortByViewProps,\r\n isRecoSearchPage?: string\r\n): JSX.Element => {\r\n return React.cloneElement(\r\n modalProps.modal,\r\n {},\r\n modalProps.modalHeader,\r\n createModalBody(modalProps, refineMenu, sortByDropDown, isRecoSearchPage),\r\n modalProps.modalFooter\r\n );\r\n};\r\n\r\n/**\r\n * Render Refiner Mobile.\r\n * @param props - The Refine Menu view props.\r\n * @returns The JSX Element.\r\n */\r\nconst renderRefinerMobile = (props: IRefineMenuViewProps): JSX.Element | null => {\r\n const { refiners, RefineMenuContainer, RefinerSectionContainer } = props;\r\n if (refiners) {\r\n return (\r\n <Node {...RefinerSectionContainer}>\r\n <Node {...RefineMenuContainer}>\r\n {refiners.map((submenu, index) => (\r\n <React.Fragment key={index}>{submenu}</React.Fragment>\r\n ))}\r\n </Node>\r\n </Node>\r\n );\r\n }\r\n return null;\r\n};\r\n\r\n/**\r\n * Render Search result Body.\r\n * @param props - The Search Result Modal view props.\r\n * @param refineMenu - The Refine Menu view props.\r\n * @param sortByDropDown - The Sort by view props.\r\n * @param isRecoSearchPage - The recomandation search page flag.\r\n * @returns The JSX Element.\r\n */\r\nconst createModalBody = (\r\n props: ISearchResultModalViewProps,\r\n refineMenu: IRefineMenuViewProps,\r\n sortByDropDown: ISortByViewProps,\r\n isRecoSearchPage?: string\r\n): JSX.Element | null => {\r\n if (sortByDropDown) {\r\n return React.cloneElement(props.modalBody, {}, renderSort(sortByDropDown, isRecoSearchPage), renderRefinerMobile(refineMenu));\r\n }\r\n return null;\r\n};\r\n\r\n/**\r\n * Render Refiner.\r\n * @param props - The Refine Menu view props.\r\n * @returns The JSX Element.\r\n */\r\nconst renderRefiner = (props: IRefineMenuViewProps): JSX.Element | null => {\r\n const { refiners, RefineMenuContainer, RefinerSectionContainer } = props;\r\n if (refiners) {\r\n return (\r\n <Node {...RefinerSectionContainer}>\r\n <Node {...RefineMenuContainer}>\r\n {refiners.map((submenu, index) => (\r\n <React.Fragment key={index}>{submenu}</React.Fragment>\r\n ))}\r\n </Node>\r\n </Node>\r\n );\r\n }\r\n return null;\r\n};\r\n\r\n/**\r\n * Render sort by drop down.\r\n * @param props - The sort by view props.\r\n * @param isRecoSearchPage - The recomandation search page flag.\r\n * @returns The JSX Element.\r\n */\r\nconst renderSort = (props: ISortByViewProps, isRecoSearchPage?: string): JSX.Element | null => {\r\n const { SortingContainer, sortByDropDown } = props;\r\n if (sortByDropDown && !isRecoSearchPage) {\r\n return <Node {...SortingContainer}>{sortByDropDown}</Node>;\r\n }\r\n return null;\r\n};\r\n\r\n/**\r\n * Render Title.\r\n * @param props - The title view props.\r\n * @returns The JSX Element.\r\n */\r\nconst renderTitle = (props: ITitleViewProps): JSX.Element | null => {\r\n const { title, TitleContainer } = props;\r\n if (title) {\r\n return (\r\n <Node {...TitleContainer}>\r\n <Node tag='h1' className=''>\r\n {title.titlePrefix}\r\n {title.titleText}\r\n </Node>\r\n </Node>\r\n );\r\n }\r\n return null;\r\n};\r\n\r\nconst renderProductPlacementImage = (\r\n productCardimageSettings?: IImageSettings,\r\n gridSettings?: IGridSettings,\r\n imageUrl?: string,\r\n fallbackImageUrl?: string,\r\n altText?: string,\r\n requestContext?: IRequestContext\r\n): JSX.Element | null => {\r\n if (!imageUrl || !gridSettings || !productCardimageSettings) {\r\n return null;\r\n }\r\n if (productCardimageSettings) {\r\n productCardimageSettings.viewports = {\r\n lg: { h: 100, w: 100, q: '80' },\r\n md: { h: 100, w: 100, q: '80' },\r\n sm: { h: 100, w: 100, q: '80' },\r\n xs: { h: 100, w: 100, q: '80' }\r\n };\r\n }\r\n const image: IImageData = {\r\n src: imageUrl,\r\n altText: altText ? altText : '',\r\n fallBackSrc: fallbackImageUrl\r\n };\r\n const imageProps: IImageProps = { gridSettings };\r\n\r\n imageProps.gridSettings = gridSettings;\r\n imageProps.imageSettings = productCardimageSettings;\r\n imageProps.imageSettings.cropFocalRegion = true;\r\n return <Image {...image} {...imageProps} loadFailureBehavior='empty' requestContext={requestContext} className={'eve-listview__img'} />;\r\n};\r\n\r\nconst getProductPrice = (pricing: ProductPrice[] | undefined, productRecId: number): ProductPrice | undefined => {\r\n if (!pricing) {\r\n return undefined;\r\n }\r\n return pricing.find(pr => pr.ProductId === productRecId);\r\n};\r\n\r\nexport default SearchResultContainerView;\r\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IActiveImageAdditionalContentViewProps } from '../active-image-utilities';\nimport { IActiveImageViewProps } from './active-image';\n\n/**\n * Render Additional Content.\n * @param additionalContent - Additional content view props.\n * @returns JSX Element.\n */\nconst renderAdditionalContent = (additionalContent: IActiveImageAdditionalContentViewProps) => {\n return (\n <Node {...additionalContent.additionalContentNode}>\n {additionalContent.heading}\n <Node {...additionalContent.additionalContentContainer}>\n {additionalContent.text}\n <Node {...additionalContent.additionalContentItemLinks}>{additionalContent.links}</Node>\n </Node>\n </Node>\n );\n};\n\n/**\n * Render View.\n * @param props - The view props.\n * @returns -The JSX Element.\n */\nexport const activeImageView: React.FC<IActiveImageViewProps> = props => {\n return (\n <Module {...props.activePointContainer}>\n <Node {...props.activePointDetailsContainer}>\n {props.imageMapper}\n <Node {...props.detailsContainer} className={props.detailsContainer ? props.detailsContainer.className : ''}>\n {props.title}\n {props.text}\n {props.additionalContent && renderAdditionalContent(props.additionalContent)}\n <Node {...props.detailsContainerCta} className={props.detailsContainerCta ? props.detailsContainerCta.className : ''}>\n {props.links}\n </Node>\n </Node>\n </Node>\n <Node\n className='msc-active-image-product-card-container'\n style={{ top: `${props.productCardtopPosition}px`, left: `${props.productCardleftPosition}px` }}\n >\n {props.overlay}\n {props.productCard}\n </Node>\n </Module>\n );\n};\n\nexport default activeImageView;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Module } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IBulkPurchaseViewProps } from './bulk-purchase';\n\n/**\n * Bulk purchase view.\n * @param props - Bulk purchase view props.\n * @returns React node with a module.\n */\nexport const BulkPurchaseViewComponent: React.FC<IBulkPurchaseViewProps> = props => {\n return <Module {...props.container}>{props.content}</Module>;\n};\n\nexport default BulkPurchaseViewComponent;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport MsDyn365 from '@msdyn365-commerce/core';\nimport { IInvoiceSummaryLines } from '@msdyn365-commerce-modules/invoice-payment-summary';\nimport { IOrderSummaryLines } from '@msdyn365-commerce-modules/order-summary-utilities';\nimport { ArrayExtensions, StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { INodeProps, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { ICartViewProps, IOrderSummaryErrors } from './cart';\nimport { ICartlinesViewProps } from './components/cart-line-items';\nimport { ICartLineItemViewProps } from './components/cart-line-items-promotion';\n\nconst _renderCartlines = (\n cartLines: ICartlinesViewProps[] | undefined,\n cartEmptyText: string,\n CartlinesWrapper: INodeProps,\n storeSelector: React.ReactNode | undefined,\n backToShoppingButton: React.ReactNode,\n waitingComponent: React.ReactNode,\n cartLoadingStatus: string,\n cartDataResult: boolean\n): JSX.Element[] | JSX.Element => {\n if (cartLoadingStatus) {\n return <>{cartLoadingStatus}</>;\n }\n if (cartLines) {\n return cartLines.map(cartLine => {\n return (\n <div className='msc-cart-lines-item' key={`${cartLine.cartlineId ?? ''}-${MsDyn365.isBrowser.toString()}`}>\n {cartLine.cartline}\n {storeSelector && cartLine.pickUpInStore ? (\n <Node {...cartLine.pickUpInStore.ContainerProps}>{cartLine.pickUpInStore.defaultComponent}</Node>\n ) : null}\n {cartLine.addToOrderTemplate ? (\n <Node className='msc-cart-line__extra-actions'>\n {cartLine.remove}\n {cartLine.addToWishlist}\n {cartLine.addToOrderTemplate}\n </Node>\n ) : (\n <>\n {cartLine.remove}\n {cartLine.addToWishlist}\n </>\n )}\n </div>\n );\n });\n }\n return cartDataResult ? (\n <div className='msc-cart__empty-cart'>\n <p className='msc-cart-line'>{cartEmptyText}</p>\n {backToShoppingButton}\n </div>\n ) : (\n <>{waitingComponent}</>\n );\n};\n\n/**\n * Method will render error block.\n * @param errorData -The order summary errors interface.\n * @returns Jsx element.\n */\nconst _renderErrorBlock = (errorData: IOrderSummaryErrors | undefined): JSX.Element | null => {\n if (!errorData || !ArrayExtensions.hasElements(errorData.errors)) {\n return null;\n }\n return (\n <Node {...errorData.Wrapper}>\n {errorData.header}\n {errorData.errors}\n </Node>\n );\n};\n\n/**\n * Method will render invoice summary lines.\n * @param invoiceSummaryLines -The invoicesummary lines interface.\n * @param OrderSummaryItems -The order summary items props.\n * @param props -The cartview props.\n * @returns Jsx element.\n */\nconst _renderInvoiceSummarylines = (\n invoiceSummaryLines: IInvoiceSummaryLines | undefined,\n OrderSummaryItems: INodeProps,\n props: ICartViewProps\n): JSX.Element | null => {\n if (!invoiceSummaryLines) {\n props.context.telemetry.error('InvoiceSummary content is empty, module wont render');\n return null;\n }\n return (\n <Node {...OrderSummaryItems}>\n {invoiceSummaryLines.invoices}\n {invoiceSummaryLines.giftCard}\n {invoiceSummaryLines.loyalty}\n {invoiceSummaryLines.orderTotal}\n </Node>\n );\n};\n\n/**\n * Method will render order summary lines.\n * @param orderSummaryLines -The ordersummary lines interface.\n * @param OrderSummaryItems -The order summary items props.\n * @param props -The cartview props.\n * @returns Jsx element.\n */\nconst _renderOrderSummarylines = (\n orderSummaryLines: IOrderSummaryLines | undefined,\n OrderSummaryItems: INodeProps,\n props: ICartViewProps\n): JSX.Element | null => {\n if (!orderSummaryLines) {\n props.context.telemetry.error('OrderSummary content is empty, module wont render');\n return null;\n }\n return (\n <Node {...OrderSummaryItems}>\n {props.promoCode}\n {orderSummaryLines.subtotal}\n {orderSummaryLines.shipping}\n {orderSummaryLines.otherCharge}\n {orderSummaryLines.tax}\n {orderSummaryLines.totalDiscounts ? orderSummaryLines.totalDiscounts : null}\n {orderSummaryLines.orderTotal}\n </Node>\n );\n};\n\n/**\n * Method will render cart promotions.\n * @param promotions -The cartline item view props.\n * @returns Jsx element.\n */\nconst _renderPromotions = (promotions: ICartLineItemViewProps): JSX.Element | undefined => {\n return (\n <>\n <Node {...promotions.promotionMessageWrapper}>\n {promotions.promotionMessage}\n {promotions.promotionSeeAllLink}\n {promotions.promotionDialog}\n </Node>\n </>\n );\n};\n\n/**\n * Method will render cartlines group title.\n * @param cartLine -The cartline view props.\n * @param titleSeparate -The title separate.\n * @returns Jsx element.\n */\nconst renderCartLinesGroupTitle = (cartLine: ICartlinesViewProps, titleSeparate: string) => {\n const isBopisSelected: boolean | undefined = cartLine.pickUpInStore?.isBopisSelected;\n return (\n <>\n <Node className='msc-cart-lines-group-wraper__bopis-heading-title'>\n {isBopisSelected ? (\n <p className='msc-cart-lines-group-wraper__bopis-heading-title-st'>\n {cartLine.pickUpInStore?.deliveryOption}\n {titleSeparate}\n {cartLine.pickUpInStore?.orgUnitName}\n </p>\n ) : null}\n </Node>\n </>\n );\n};\n\n/**\n * Method will render cartlines groups header title.\n * @param pickUpText -The pickup text for group.\n * @param shippingText -The shipping text for group.\n * @param emailShippingText -The email shipping text for group.\n * @param titleSeparate -The title separator.\n * @param cartLine -The cartline view props.\n * @param emailDeliveryModeCode -The email delivery code from channel.\n * @returns Jsx element.\n */\nconst renderCartLinesGroupHeader = (\n pickUpText: string,\n shippingText: string,\n emailShippingText: string,\n titleSeparate: string,\n cartLine: ICartlinesViewProps,\n emailDeliveryModeCode?: string\n) => {\n const isBopisSelected: boolean | undefined = cartLine.pickUpInStore?.isBopisSelected;\n let groupTitle: string;\n\n groupTitle = isBopisSelected ? pickUpText : shippingText;\n if (!StringExtensions.isNullOrEmpty(emailDeliveryModeCode)) {\n groupTitle = cartLine.data && cartLine.data.cartline.DeliveryMode === emailDeliveryModeCode ? emailShippingText : groupTitle;\n }\n\n return (\n <>\n <div className='msc-cart-lines-group-wraper__bopis-heading'>\n <p className={`msc-cart-lines-group-wraper__bopis-heading-${groupTitle.toLowerCase()}-icon`} />\n <p className={`msc-cart-lines-group-wraper__bopis-heading-${groupTitle.toLowerCase()}`}>{groupTitle}</p>\n {renderCartLinesGroupTitle(cartLine, titleSeparate)}\n </div>\n </>\n );\n};\n\n/**\n * Method will render cartlines in groups.\n * @param props -The cartline.\n * @returns Jsx element.\n */\nconst renderCartLinesGroup = (props: ICartViewProps): JSX.Element | undefined => {\n if (props.cartLinesGroup && ArrayExtensions.hasElements(props.cartLinesGroup)) {\n return (\n <div className='msc-cart-lines-group'>\n {props.cartLinesGroup.map(cartlines => {\n return (\n <div key={cartlines[0].cartlineId} className='msc-cart-lines-group-wraper'>\n {renderCartLinesGroupHeader(\n props.resources.pickUpText,\n props.resources.shippingText,\n props.resources.emailshippingText,\n props.resources.titleSeparate,\n cartlines[0],\n props.context.actionContext.requestContext.channel?.EmailDeliveryModeCode\n )}\n {_renderCartlines(\n cartlines,\n props.resources.emptyCartText,\n props.CartlinesWrapper,\n props.storeSelector,\n props.backToShoppingButton,\n props.waitingComponent,\n props.cartLoadingStatus,\n props.cartDataResult\n )}\n </div>\n );\n })}\n </div>\n );\n }\n return props.cartDataResult ? (\n <div className='msc-cartline-wraper'>\n <div className='msc-cart__empty-cart'>\n <p className='msc-cart-line'>{props.resources.emptyCartText}</p>\n {props.backToShoppingButton}\n </div>\n </div>\n ) : (\n <>{props.waitingComponent}</>\n );\n};\n\nconst CartView: React.FC<ICartViewProps> = (props: ICartViewProps) => (\n <div className={props.className} id={props.id} {...props.renderModuleAttributes(props)}>\n {props.title}\n {!props.cart?.hasInvoiceLine && props.promotionOptions && _renderPromotions(props.promotionOptions)}\n {props.multiplePickUpEnabled ? (\n renderCartLinesGroup(props)\n ) : (\n <Node {...props.CartlinesWrapper}>\n {_renderCartlines(\n props.cartlines,\n props.resources.emptyCartText,\n props.CartlinesWrapper,\n props.storeSelector,\n props.backToShoppingButton,\n props.waitingComponent,\n props.cartLoadingStatus,\n props.cartDataResult\n )}\n </Node>\n )}\n {props.orderSummaryHeading && (\n <Node {...props.OrderSummaryWrapper}>\n {props.orderSummaryHeading}\n {props.cart?.hasInvoiceLine\n ? _renderInvoiceSummarylines(props.invoiceSummaryLineitems, props.OrderSummaryItems, props)\n : _renderOrderSummarylines(props.orderSummaryLineitems, props.OrderSummaryItems, props)}\n {_renderErrorBlock(props.OrderSummaryErrors)}\n {props.checkoutAsSignInUserButton}\n {props.checkoutAsGuestButton}\n {props.expressCheckoutButton && ArrayExtensions.hasElements(props.expressCheckoutButton) ? (\n <Node {...props.ExpressCheckoutSectionWrapper}>{props.expressCheckoutButton}</Node>\n ) : null}\n {props.backToShoppingButton}\n {props.createTemplateFromCartButton}\n </Node>\n )}\n {props.storeSelector}\n </div>\n);\n\nexport default CartView;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { INodeProps, Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IProductCollectionViewProps, IProductComponentViewProps } from './product-collection';\nimport { IProductCollectionResources } from './product-collection.props.autogenerated';\n\nconst ProductCollectionView: React.FC<IProductCollectionViewProps> = props => {\n const {\n heading,\n ProductCollectionContainer,\n products,\n SingleSlideCarouselComponentProps,\n GridComponentProps,\n isCarousel,\n seeAllButton,\n resources\n } = props;\n\n if (products) {\n return (\n <Module {...ProductCollectionContainer}>\n {heading}\n {seeAllButton}\n {isCarousel ? _renderCarousel(SingleSlideCarouselComponentProps, products) : _renderGrid(GridComponentProps, products)}\n </Module>\n );\n }\n\n // If no products are retrieved and the list type is promotional, still render the module to keep the entry of promotion page\n if (props.config.productCollection.listType === 'promotional') {\n return (\n <Module {...ProductCollectionContainer}>\n {heading}\n {seeAllButton}\n {_renderNoProduct(resources)}\n </Module>\n );\n }\n props.context.telemetry.error('Product collection content is empty, module wont render.');\n return null;\n};\n\nconst _renderCarousel = (carouselContainer: INodeProps, items: IProductComponentViewProps[]): JSX.Element => {\n return <Node {...carouselContainer}>{items && items.map(_renderProduct)}</Node>;\n};\n\nconst _renderGrid = (gridContainer: INodeProps, items: IProductComponentViewProps[]): JSX.Element => {\n return <Node {...gridContainer}>{items && items.map(_renderProduct)}</Node>;\n};\n\nconst _renderNoProduct = (resources: IProductCollectionResources): JSX.Element => {\n return (\n <Node className={''}>\n <p>{resources.noProductToRenderText}</p>\n </Node>\n );\n};\n\nconst _renderProduct = (product: IProductComponentViewProps): JSX.Element => {\n const { ProductContainer, productComponent } = product;\n\n return <Node {...ProductContainer}>{productComponent}</Node>;\n};\n\nexport default ProductCollectionView;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IProductDimensionConfigureDropdownViewProps, IProductDimensionConfigureViewProps } from '@msdyn365-commerce/components';\nimport { INodeProps, Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IQuickOrderFormViewProps, IQuickOrderViewProps } from './index';\n\n/**\n * Render product dimension/configure container.\n * @param configure -- Product dimension configuration.\n * @returns Container to have dimension dropdown.\n */\nconst renderConfigure = (configure?: IProductDimensionConfigureViewProps): JSX.Element | null => {\n if (configure !== undefined) {\n const { containerProps, dropdowns } = configure;\n\n return <Node {...containerProps}>{dropdowns.map(renderConfigureDropdown)}</Node>;\n }\n return null;\n};\n\n/**\n * Render product dimension/configure dropdown.\n * @param dropdown -- Product dimension drop down.\n * @returns Dropdown.\n */\nconst renderConfigureDropdown = (dropdown: IProductDimensionConfigureDropdownViewProps): JSX.Element => {\n const { containerProps, labelContainerProps, heading, errors, select } = dropdown;\n\n return (\n <Node {...containerProps}>\n <Node {...labelContainerProps}>{heading}</Node>\n {errors}\n {select}\n </Node>\n );\n};\n\nconst renderForm = (\n form: IQuickOrderFormViewProps,\n isMobileView: boolean,\n quickOrderForm: INodeProps,\n quickOrderProductContent: INodeProps,\n quickOrderMsgContent: INodeProps,\n configure?: IProductDimensionConfigureViewProps\n) => {\n return isMobileView ? (\n <Node {...quickOrderForm}>\n <Node {...quickOrderProductContent}>\n {form.product}\n {renderConfigure(configure)}\n {form.quantity}\n <Node {...quickOrderMsgContent}>{form.userMessage}</Node>\n {form.addToCartBtn}\n </Node>\n </Node>\n ) : (\n <Node {...quickOrderForm}>\n <Node {...quickOrderMsgContent}>{form.userMessage}</Node>\n <Node {...quickOrderProductContent}>\n {form.product}\n {renderConfigure(configure)}\n {form.quantity}\n {form.addToCartBtn}\n </Node>\n </Node>\n );\n};\n\nconst quickOrderView: React.FC<IQuickOrderViewProps> = props => {\n const {\n quickOrderProps,\n contentProps,\n form,\n quickOrderForm,\n drawer,\n configure,\n quickOrderFormProductContent,\n quickOrderFormMsgContent,\n quickOrderList,\n isMobileView\n } = props;\n\n return (\n <Module {...quickOrderProps}>\n <Node {...drawer}>\n <Node {...contentProps}>\n {renderForm(\n form as IQuickOrderFormViewProps,\n isMobileView,\n quickOrderForm,\n quickOrderFormProductContent,\n quickOrderFormMsgContent,\n configure\n )}\n </Node>\n </Node>\n\n {quickOrderList}\n </Module>\n );\n};\nexport default quickOrderView;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { INodeProps, Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { ISearchCategoryViewProps, ISearchFormViewProps, ISearchKeywordViewProps, ISearchProductViewProps } from './components';\nimport { ISearchViewProps } from './search';\n\nconst SearchView: React.FC<ISearchViewProps> = props => {\n const {\n Search,\n AutoSuggestAriaLabel,\n AutoSuggestAriaLabelText,\n searchText,\n AutoSuggest,\n KeywordSuggest,\n ProductSuggest,\n CategorySuggest,\n UlKeyword,\n UlProduct,\n UlCategory,\n form,\n autosuggestCategory,\n autosuggestKeyword,\n autosuggestProduct,\n SearchForm,\n FormWrapper,\n label,\n isLoadingAutoSuggest,\n isLoadingNode\n } = props;\n\n return (\n <Module {...Search}>\n {label}\n {_renderForm(form as ISearchFormViewProps, SearchForm, FormWrapper)}\n <Node {...AutoSuggest}>\n {searchText && searchText.length > 0 ? <Node {...AutoSuggestAriaLabel}>{AutoSuggestAriaLabelText}</Node> : ''}\n {_renderKeywordSuggestions(KeywordSuggest, UlKeyword, autosuggestKeyword, isLoadingAutoSuggest, isLoadingNode)}\n {_renderProductSuggestions(ProductSuggest, UlProduct, autosuggestProduct, isLoadingAutoSuggest, isLoadingNode)}\n {_renderCategorySuggestions(CategorySuggest, UlCategory, autosuggestCategory, isLoadingAutoSuggest, isLoadingNode)}\n </Node>\n </Module>\n );\n};\n\nconst _renderForm = (form: ISearchFormViewProps, SearchForm: INodeProps, FormWrapper: INodeProps) => {\n return (\n <Node {...SearchForm}>\n <Node {...FormWrapper}>\n {form.input}\n {form.cancelBtn}\n {form.submitBtn}\n </Node>\n </Node>\n );\n};\n\nconst _renderKeywordSuggestions = (\n KeywordSuggest: INodeProps,\n UlKeyword: INodeProps,\n keywordSuggestions?: ISearchKeywordViewProps,\n isLoadingAutoSuggest?: boolean,\n isLoadingNode?: React.ReactNode\n) => {\n return (\n keywordSuggestions && (\n <Node {...KeywordSuggest}>\n <Node {...UlKeyword}>\n {isLoadingAutoSuggest && isLoadingNode}\n {!isLoadingAutoSuggest &&\n keywordSuggestions.text.map(text => {\n return text;\n })}\n </Node>\n </Node>\n )\n );\n};\n\nconst _renderProductSuggestions = (\n ProductSuggest: INodeProps,\n UlProduct: INodeProps,\n productSuggestions?: ISearchProductViewProps,\n isLoadingAutoSuggest?: boolean,\n isLoadingNode?: React.ReactNode\n) => {\n return (\n productSuggestions && (\n <Node {...ProductSuggest}>\n <Node {...UlProduct}>\n {productSuggestions.title}\n {isLoadingAutoSuggest && isLoadingNode}\n {!isLoadingAutoSuggest &&\n productSuggestions.items.map((item, index) => {\n return (\n <Node {...item.LiProduct} key={item.id || index}>\n <Node {...item.AProduct}>\n {item.thumbnail}\n {item.text}\n {item.price}\n </Node>\n </Node>\n );\n })}\n </Node>\n </Node>\n )\n );\n};\n\nconst _renderCategorySuggestions = (\n CategorySuggest: INodeProps,\n UlCategory: INodeProps,\n categorySuggestions?: ISearchCategoryViewProps,\n isLoadingAutoSuggest?: boolean,\n isLoadingNode?: React.ReactNode\n) => {\n return (\n categorySuggestions && (\n <Node {...CategorySuggest}>\n <Node {...UlCategory}>\n {categorySuggestions.title}\n {isLoadingAutoSuggest && isLoadingNode}\n {!isLoadingAutoSuggest &&\n categorySuggestions.text.map(text => {\n return text;\n })}\n </Node>\n </Node>\n )\n );\n};\n\nexport default SearchView;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Module } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\nimport { ISocialShareItemViewProps } from './social-share-item';\n\nexport const SocialShareItemView: React.FC<ISocialShareItemViewProps> = props => {\n const { SocialShareItem, SocialShareItemElement } = props;\n\n if (!SocialShareItemElement) {\n props.context.telemetry.error('Social media is not valid, module wont render');\n return null;\n }\n return <Module {...SocialShareItem}>{SocialShareItemElement}</Module>;\n};\n\nexport default SocialShareItemView;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IVideoPlayerAdditionalContentViewProps, IVideoPlayerViewProps } from './index';\n\n/**\n * Render Additional Content.\n * @param additionalContent - Additional content view props.\n * @returns JSX Element.\n */\nconst renderAdditionalContent = (additionalContent: IVideoPlayerAdditionalContentViewProps) => {\n if (additionalContent.additionalContentItems) {\n return (\n <Node {...additionalContent.additionalContentNode}>\n <>\n {additionalContent.additionalContentItems.heading}\n <Node {...additionalContent.additionalContentItems.additionalContentItemContainer}>\n {additionalContent.additionalContentItems.text}\n <Node {...additionalContent.additionalContentItems.additionalContentItemLinks}>\n {additionalContent.additionalContentItems.links}\n </Node>\n </Node>\n </>\n </Node>\n );\n }\n\n return null;\n};\n\nconst VideoPlayerView: React.FC<IVideoPlayerViewProps> = props => {\n return (\n <div id={props.id} className='ms-video-player' {...props.renderModuleAttributes(props)}>\n {props.player}\n <Node {...props.detailsContainer} className={props.detailsContainer ? props.detailsContainer.className : ''}>\n {props.title}\n {props.text}\n {props.additionalContent && renderAdditionalContent(props.additionalContent)}\n <Node {...props.detailsContainerCta} className={props.detailsContainerCta ? props.detailsContainerCta.className : ''}>\n {props.links}\n </Node>\n </Node>\n </div>\n );\n};\n\nexport default VideoPlayerView;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { RatingComponent } from '@msdyn365-commerce/components';\nimport { ICoreContext } from '@msdyn365-commerce/core';\nimport { IHistogramItemViewProps, IRatingsHistogramData, IRatingsHistogramViewProps } from '@msdyn365-commerce-modules/ratings-reviews';\nimport { format, Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IRatingsHistogramProps, IRatingsHistogramResources } from '../definition-extensions/ratings-histogram.ext.props.autogenerated';\n\n/**\n * Histogram item.\n * @param props - Histogram Item ViewProps.\n * @returns Histogram Item node.\n */\nconst histogramItem = (props: IHistogramItemViewProps) => {\n return (\n <Node {...props.buttonProps}>\n {props.starLabel}\n {props.bar}\n </Node>\n );\n};\n\n/**\n * Average ratings.\n * @param data - Props data.\n * @param context - Histogram Item ViewProps.\n * @param typeName - Histogram Item ViewProps.\n * @param componentId - Histogram Item ViewProps.\n * @param resources - Module resource strings.\n * @returns Average ratings.\n */\nconst averageRating = (\n data: IRatingsHistogramData,\n context: ICoreContext,\n typeName: string,\n componentId: string,\n resources: IRatingsHistogramResources\n) => {\n const defaultAverageRating: number = 0;\n const reviewsCount = data.ratingsSummary.result?.reviewsCount ?? defaultAverageRating;\n const reviewsCountString = resources.numberOfReviewsString\n ? format(resources.numberOfReviewsString, reviewsCount)\n : `${reviewsCount} reviews`;\n\n return (\n <div className='ms-ratings-histogram__ratings'>\n <div className='ms-ratings-histogram__ratings__heading'>{data.ratingsSummary.result?.averageRating}</div>\n <div>\n <RatingComponent\n context={context}\n id={componentId}\n typeName={typeName}\n avgRating={data.ratingsSummary.result?.averageRating ?? defaultAverageRating}\n readOnly\n ariaLabel={format(resources.averageRatingAriaLabel, data.ratingsSummary.result?.averageRating, '5')}\n data={{}}\n />\n </div>\n <div className='ms-ratings-histogram__ratings__reviews'>{reviewsCountString}</div>\n </div>\n );\n};\n\n/**\n * Histogram view.\n * @param props - Ratings HistogramV iewProps.\n * @returns Histogram view module.\n */\nconst RatingsHistogramView: React.FC<IRatingsHistogramViewProps & IRatingsHistogramProps<{}>> = props => {\n const { heading, histogramItems, histogramProps, moduleProps, data, resources } = props;\n const context = props.context;\n const typeName = props.typeName;\n const moduleId = props.id;\n\n return (\n <Module {...moduleProps}>\n {heading}\n <div className='ms-ratings-histogram__container'>\n {averageRating(data, context, typeName, moduleId, resources)}\n <Node {...histogramProps}>\n {histogramItems.map(item => {\n return histogramItem(item);\n })}\n </Node>\n </div>\n </Module>\n );\n};\n\nexport default RatingsHistogramView;\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 { CartLinePriceEditor, ICartLinePriceEditorResources, PriceComponent } from '@msdyn365-commerce/components';\r\nimport { IComponentProps, IGridSettings, IImageSettings, Image } from '@msdyn365-commerce/core';\r\nimport { ICartState } from '@msdyn365-commerce/global-state';\r\nimport { ChannelDeliveryOptionConfiguration, ProductDimensionType, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { CartLine, DiscountLine, DiscountLineType, SalesLine } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport { ArrayExtensions, getFallbackImageUrl } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getPayloadObject, getTelemetryAttributes, IncrementalQuantity, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport classNames from 'classnames';\r\nimport * as React from 'react';\r\n\r\n/**\r\n * ICartlineResourceString: Interface for specifying the\r\n * resource strings that the component needs.\r\n */\r\nexport interface ICartlineResourceString {\r\n\r\n /** Display string for discount label. */\r\n discountStringText: string;\r\n\r\n /** String for size key. */\r\n sizeString: string;\r\n\r\n /** String for color key. */\r\n colorString: string;\r\n\r\n /** String associated with the configuration product dimension. */\r\n configString: string;\r\n\r\n /** String for style key. */\r\n styleString: string;\r\n\r\n /** String for amount key. */\r\n amountString?: string;\r\n\r\n /** Display string for quantity label. */\r\n quantityDisplayString: string;\r\n\r\n /** Display string for quantity label. */\r\n inputQuantityAriaLabel: string;\r\n\r\n /** Aria label for the decrement button in quantity component. */\r\n decrementButtonAriaLabel: string;\r\n\r\n /** Aria label for the increment button in quantity component. */\r\n incrementButtonAriaLabel: string;\r\n\r\n /** Original text screenreader. */\r\n originalPriceText: string;\r\n\r\n /** Current text screenreader. */\r\n currentPriceText: string;\r\n\r\n /** Shipping Charges Text. */\r\n shippingChargesText: string;\r\n\r\n /** Price Editor Charges Text. */\r\n priceEditorResources?: ICartLinePriceEditorResources;\r\n}\r\n\r\n/**\r\n * Represents cart line data interface.\r\n */\r\ninterface ICartLineData {\r\n cartLine: CartLine | SalesLine;\r\n cartState?: ICartState;\r\n product?: SimpleProduct;\r\n}\r\n\r\n/**\r\n * ICartLineProps: The props required to render cartLineitem.\r\n */\r\nexport interface ICartLineProps extends IComponentProps<ICartLineData> {\r\n\r\n /** The flag to change the quantity component from interactible to static. */\r\n disableQuantityInteractivity?: boolean;\r\n\r\n /** The primary image url. */\r\n primaryImageUrl?: string;\r\n\r\n /** The product url. */\r\n productUrl?: string;\r\n\r\n /** GridSettings for the product image in cartLine. */\r\n gridSettings: IGridSettings;\r\n\r\n /** ImageSettings for the product image in cartLine. */\r\n imageSettings: IImageSettings;\r\n\r\n /** Boolean flag to indicate if the item is out of stock. */\r\n isOutOfStock?: boolean;\r\n\r\n /** Flag to make quantity section editable. */\r\n isQuantityEditable?: boolean;\r\n\r\n /** Max quantity for line item. */\r\n maxQuantity?: number;\r\n\r\n /** Current quantity for line item. */\r\n currentQuantity?: number;\r\n\r\n /** Resource string for the component. */\r\n resources: ICartlineResourceString;\r\n\r\n /** SalesLine flag. */\r\n isSalesLine?: boolean;\r\n\r\n /** Error message to show in place of quantity. */\r\n errorMessage?: string;\r\n\r\n /** Inventory information label. */\r\n inventoryInformationLabel?: string;\r\n\r\n /** Inventory information class name. */\r\n inventoryLabelClassName?: string;\r\n\r\n /** Flag to show/hide shipping charges for line items. */\r\n showShippingChargesForLineItems?: boolean;\r\n\r\n /** Boolean flag to indicate if cart state status is ready. */\r\n isCartStateReady?: boolean;\r\n\r\n /** Chanel Delivery Option configuration is from api. */\r\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\r\n\r\n /** The telemetry content. */\r\n telemetryContent?: ITelemetryContent;\r\n\r\n /** Quantity onChange callback. */\r\n quantityOnChange?(cartLine: CartLine, newQuantity: number): boolean;\r\n}\r\n\r\n/**\r\n * Represents dimensions strings.\r\n */\r\ninterface IDimensionStrings {\r\n\r\n /** String for size key. */\r\n sizeString: string;\r\n\r\n /** String for color key. */\r\n colorString: string;\r\n\r\n /** String associated with the configuration product dimension. */\r\n configString: string;\r\n\r\n /** String for style key. */\r\n styleString: string;\r\n\r\n /** String for amount key. */\r\n amountString?: string;\r\n}\r\n\r\nconst cartLineItemFunctions = {\r\n\r\n /**\r\n * Render product dimensions.\r\n * @param product - Product data.\r\n * @param dimensionStrings - Dimension strings interface.\r\n * @returns JSX Element.\r\n */\r\n renderProductDimensions: (product: SimpleProduct, dimensionStrings: IDimensionStrings) => {\r\n if (!product.Dimensions) {\r\n return [];\r\n }\r\n\r\n return product.Dimensions.map(productDimension => {\r\n\r\n if (productDimension.DimensionTypeValue === ProductDimensionType.Color) {\r\n return (\r\n <div key={`${product.RecordId}ProductDimensions1`} className='msc-cart-line__product-variant-item'>\r\n <span className='msc-cart-line__product-variant-color'>\r\n {dimensionStrings.colorString}\r\n {': '}\r\n <span className='name'>\r\n {productDimension.DimensionValue?.Value}\r\n </span>\r\n </span>\r\n </div>\r\n );\r\n }\r\n\r\n if (productDimension.DimensionTypeValue === ProductDimensionType.Configuration) {\r\n return (\r\n <div key={`${product.RecordId}ProductDimensions2`} className='msc-cart-line__product-variant-item'>\r\n <span className='msc-cart-line__product-configuration'>\r\n {dimensionStrings.configString}\r\n {': '}\r\n <span className='name'>\r\n {productDimension.DimensionValue?.Value}\r\n </span>\r\n </span>\r\n </div>\r\n );\r\n }\r\n\r\n if (productDimension.DimensionTypeValue === ProductDimensionType.Size) {\r\n return (\r\n <div key={`${product.RecordId}ProductDimensions3`} className='msc-cart-line__product-variant-item'>\r\n <span className='msc-cart-line__product-variant-size'>\r\n {dimensionStrings.sizeString}\r\n {': '}\r\n <span className='name'>\r\n {productDimension.DimensionValue?.Value}\r\n </span>\r\n </span>\r\n </div>\r\n );\r\n }\r\n\r\n if (productDimension.DimensionTypeValue === ProductDimensionType.Style) {\r\n return (\r\n <div key={`${product.RecordId}ProductDimensions4`} className='msc-cart-line__product-variant-item'>\r\n <span className='msc-cart-line__product-variant-style'>\r\n {product.IsGiftCard ? dimensionStrings.amountString : dimensionStrings.styleString}\r\n {': '}\r\n <span className='name'>\r\n {productDimension.DimensionValue?.Value}\r\n </span>\r\n </span>\r\n </div>\r\n );\r\n }\r\n return null;\r\n });\r\n },\r\n\r\n /**\r\n * Gets the react node for product unit of price display.\r\n * @param props - The cart line props.\r\n * @returns The node representing markup for unit of measure component.\r\n */\r\n renderProductUnitPrice: (props: ICartLineProps) => {\r\n if (!props.data.cartLine.Price) {\r\n return null;\r\n }\r\n const zeroQuantity: number = 0;\r\n return (\r\n <div className='msc-cart-line__product-unit-price'>\r\n <span>\r\n <PriceComponent\r\n data={props.data.cartLine.Quantity && props.data.cartLine.Quantity > zeroQuantity ? {\r\n price: {\r\n CustomerContextualPrice: props.data.cartLine.Price\r\n }\r\n } : {\r\n price: {\r\n CustomerContextualPrice: props.data.cartLine.Price\r\n }\r\n }}\r\n context={props.context}\r\n id={props.id}\r\n typeName={props.typeName}\r\n />\r\n </span>\r\n </div>\r\n );\r\n },\r\n\r\n /**\r\n * Render discount lines.\r\n * @param props - The cart line props.\r\n * @returns JSX element.\r\n */\r\n renderDiscountLines: (props: ICartLineProps) => {\r\n\r\n if (!props.data.cartLine.DiscountLines || !ArrayExtensions.hasElements(props.data.cartLine.DiscountLines)) {\r\n return null;\r\n }\r\n\r\n /**\r\n * Get the updated discount percentage.\r\n * @param discountLine - The discount line.\r\n * @param cartLine - The cart line.\r\n * @returns The updated discount percentage.\r\n */\r\n const discountPercent = (discountLine: DiscountLine, cartLine: CartLine): number => {\r\n const numberZero = 0;\r\n const decimalPrecision = 2;\r\n const fullPercentage = 100;\r\n let updatedPercent: number = discountLine.Percentage ?? numberZero;\r\n\r\n if ((discountLine.Percentage === numberZero ||\r\n (discountLine.DiscountLineTypeValue && discountLine.DiscountLineTypeValue === DiscountLineType.TenderTypeDiscount)) &&\r\n cartLine.Price && cartLine.Price > numberZero && cartLine.Quantity && cartLine.Quantity !== numberZero) {\r\n const effectiveAmount = discountLine.EffectiveAmount ?? numberZero;\r\n updatedPercent = Number(((effectiveAmount / (cartLine.Price * cartLine.Quantity)) * fullPercentage).toFixed(decimalPrecision));\r\n }\r\n\r\n return updatedPercent;\r\n };\r\n\r\n return props.data.cartLine.DiscountLines.map((discountLine, index) => {\r\n return (\r\n <div key={discountLine.OfferId ?? index} className='msc-cart-line__product-discount'>\r\n <span>\r\n {discountLine.OfferName ? discountLine.OfferName : ''}\r\n </span>\r\n <span className='msc-cart-line-item-product-discount-price'>\r\n <PriceComponent\r\n data={props.isSalesLine ? {\r\n price: {\r\n // @ts-expect-error -- Auto suppressed.\r\n CustomerContextualPrice: props.data.cartLine.PeriodicDiscount\r\n }\r\n } : {\r\n price: {\r\n CustomerContextualPrice: discountLine.EffectiveAmount,\r\n BasePrice: discountLine.EffectiveAmount\r\n }\r\n }}\r\n context={props.context}\r\n id={props.id}\r\n typeName={props.typeName}\r\n />\r\n </span>\r\n <span className='msc-cart-line__product-discount-percentage'>\r\n {` (${discountLine.Percentage !== undefined ? discountPercent(discountLine, props.data.cartLine) : ''}%)`}\r\n </span>\r\n </div>\r\n );\r\n });\r\n },\r\n\r\n /**\r\n * Render inventory label.\r\n * @param props - The cart line props.\r\n * @returns JSX element.\r\n */\r\n renderInventoryLabel: (props: ICartLineProps) => {\r\n const inventoryCssName = props.inventoryLabelClassName ? (\r\n `msc-cart-line__product-inventory-label ${props.inventoryLabelClassName}`) : 'msc-cart-line__product-inventory-label';\r\n\r\n return (\r\n <p className={inventoryCssName}>\r\n {props.inventoryInformationLabel}\r\n </p>\r\n );\r\n },\r\n\r\n /**\r\n * Render shipping label.\r\n * @param props - The cart line props.\r\n * @returns JSX element.\r\n */\r\n renderShippingLabel: (props: ICartLineProps) => {\r\n const pickupDeliveryModeCode = props.context.request.channel?.PickupDeliveryModeCode;\r\n const channelDeliveryOptionConfig = props.channelDeliveryOptionConfig;\r\n const cartline = props.data.cartLine;\r\n let hasShippingMethod = false;\r\n if (channelDeliveryOptionConfig !== undefined) {\r\n hasShippingMethod = !!(cartline.DeliveryMode && channelDeliveryOptionConfig.PickupDeliveryModeCodes?.some(\r\n deliveryMode => deliveryMode !== cartline.DeliveryMode));\r\n } else {\r\n hasShippingMethod = !!(cartline.DeliveryMode && cartline.DeliveryMode !== pickupDeliveryModeCode);\r\n }\r\n if (!hasShippingMethod) {\r\n return undefined;\r\n }\r\n\r\n const shippingChargeLines = (cartline.ChargeLines ?? []).filter(chargeLine => chargeLine.IsShipping);\r\n\r\n if (!ArrayExtensions.hasElements(shippingChargeLines)) {\r\n return undefined;\r\n }\r\n\r\n const defaultCharge: number = 0;\r\n const freightFee = shippingChargeLines.reduce((chargeTotal, chargeLine) => {\r\n return chargeTotal + (chargeLine.CalculatedAmount ?? defaultCharge);\r\n }, defaultCharge);\r\n\r\n const priceComponent = (\r\n <PriceComponent\r\n data={{\r\n price: {\r\n CustomerContextualPrice: freightFee\r\n }\r\n }}\r\n freePriceText='Free'\r\n context={props.context}\r\n id={props.id}\r\n typeName={props.typeName}\r\n className='msc-cart-line__freight-actual'\r\n />\r\n );\r\n return (\r\n <>\r\n <label className='msc-cart-line__freight-label'>\r\n {`${props.resources.shippingChargesText}:`}\r\n </label>\r\n <span className='shipping-value'>\r\n {priceComponent}\r\n </span>\r\n </>\r\n );\r\n },\r\n\r\n /**\r\n * Render other charges.\r\n * @param props - The cart line props.\r\n * @returns JSX element.\r\n */\r\n renderOtherCharges: (props: ICartLineProps) => {\r\n const cartline = props.data.cartLine;\r\n const otherCharges = cartline.ChargeLines?.filter((chargeline) => !chargeline.IsShipping);\r\n\r\n return otherCharges?.map((otherCharge, index) => {\r\n const itemIndex = index;\r\n return otherCharge.CalculatedAmount ? (\r\n <div className='msc-cart-line__other-charges' key={itemIndex}>\r\n <label className='msc-cart-line__other-charges-label'>\r\n {`${String(otherCharge.Description)}:`}\r\n </label>\r\n <span className='other-charge-value'>\r\n <PriceComponent\r\n data={{\r\n price: {\r\n CustomerContextualPrice: otherCharge.CalculatedAmount\r\n }\r\n }}\r\n context={props.context}\r\n id={props.id}\r\n typeName={props.typeName}\r\n className='msc-cart-line__other-charges-actual'\r\n />\r\n </span>\r\n </div>\r\n ) : '';\r\n }) ?? undefined;\r\n }\r\n};\r\n\r\n/**\r\n * Render cartline component.\r\n * @param props - The cart line props.\r\n * @returns JSX element.\r\n */\r\nconst CartLine: React.FC<ICartLineProps> = (props: ICartLineProps) => {\r\n const { isSalesLine, productUrl, resources } = props;\r\n const { product, cartLine } = props.data;\r\n\r\n const destructDimensionStrings = {\r\n sizeString: resources.sizeString,\r\n colorString: resources.colorString,\r\n styleString: resources.styleString,\r\n configString: resources.configString,\r\n amountString: resources.amountString\r\n };\r\n\r\n const fallbackImageUrl = product && getFallbackImageUrl(product.ItemId, props.context.actionContext.requestContext.apiSettings);\r\n const productDimensions = product && cartLineItemFunctions.renderProductDimensions(product, destructDimensionStrings);\r\n const renderProductUnitPrice = cartLineItemFunctions.renderProductUnitPrice(props);\r\n const imageSettings = props.imageSettings;\r\n if (imageSettings) {\r\n imageSettings.cropFocalRegion = true;\r\n }\r\n const renderDiscountLines = cartLineItemFunctions.renderDiscountLines(props);\r\n const renderInventoryLabel = cartLineItemFunctions.renderInventoryLabel(props);\r\n const renderShippingLabel = cartLineItemFunctions.renderShippingLabel(props);\r\n const renderOtherCharges = cartLineItemFunctions.renderOtherCharges(props);\r\n const payLoad = getPayloadObject('click', props.telemetryContent!, '', product?.RecordId.toString());\r\n const productAttribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\r\n const productName = product?.Name ?? cartLine.Description;\r\n const imgeClassName = props.data.cartLine.IsInvoiceLine ? 'msc-cart-line__invoice-image' : 'msc-cart-line__product-image';\r\n const cartLineContentClassName = props.data.cartLine.IsInvoiceLine ? 'msc-cart-line__invoice-content' : 'msc-cart-line__content';\r\n\r\n /**\r\n * Render other charges.\r\n * @param newValue - The cart line props.\r\n * @returns Boolean.\r\n */\r\n const onChange = (newValue: number): boolean => {\r\n if (props.quantityOnChange) {\r\n return props.quantityOnChange(props.data.cartLine, newValue);\r\n }\r\n return true;\r\n };\r\n\r\n /**\r\n * Generate error message.\r\n * @returns JSX element.\r\n */\r\n const generateErrorMessage = (): JSX.Element | null => {\r\n if (props.errorMessage) {\r\n return (\r\n <div className='msc-alert__header'>\r\n <span className='msi-exclamation-triangle' />\r\n <span>\r\n {props.errorMessage}\r\n </span>\r\n </div>\r\n );\r\n }\r\n\r\n return null;\r\n };\r\n\r\n /**\r\n * Render Saving component.\r\n * @returns JSX element.\r\n */\r\n // const renderSaving = (): JSX.Element | null => {\r\n\r\n // if (!props.data.cartLine.DiscountAmount) {\r\n // return null;\r\n // }\r\n // const discountAmountZero: number = 0;\r\n\r\n // if (props.data.cartLine.DiscountAmount > discountAmountZero) {\r\n // return (\r\n // <>\r\n // <span className='msc-cart-line__product-savings-label'>\r\n // {`${props.resources.discountStringText || 'Discount'}`}\r\n // </span>\r\n // <PriceComponent\r\n // data={props.isSalesLine ? {\r\n // price: {\r\n // // @ts-expect-error -- Auto suppressed.\r\n // CustomerContextualPrice: props.data.cartLine.PeriodicDiscount\r\n // }\r\n // } : {\r\n // price: {\r\n // CustomerContextualPrice: props.data.cartLine.DiscountAmountWithoutTax,\r\n // BasePrice: props.data.cartLine.DiscountAmount\r\n // }\r\n // }}\r\n // context={props.context}\r\n // id={props.id}\r\n // typeName={props.typeName}\r\n // className='msc-cart-line__product-savings-text'\r\n // />\r\n // </>\r\n // );\r\n // }\r\n // return null;\r\n // };\r\n\r\n /**\r\n * Gets the react node for product unit of measure display.\r\n * @returns The node representing markup for unit of measure component.\r\n */\r\n const renderUnitOfMeasure = () => {\r\n\r\n if (props.data.cartLine.IsInvoiceLine) {\r\n return null;\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Do not need type check for appsettings\r\n if (!props.context.app.config.unitOfMeasureDisplayType || props.context.app.config.unitOfMeasureDisplayType === 'none') {\r\n return undefined;\r\n }\r\n\r\n if (!product || !product.DefaultUnitOfMeasure) {\r\n return undefined;\r\n }\r\n\r\n return (\r\n <div className='msc-cart-line__product-unit-of-measure'>\r\n <span>\r\n {product.DefaultUnitOfMeasure}\r\n </span>\r\n </div>\r\n );\r\n };\r\n\r\n /**\r\n * Generate quantity and price component.\r\n * @returns JSX element.\r\n */\r\n const generateQuantityAndPrice = (): JSX.Element[] | null => {\r\n const nodes = [];\r\n const defaultMaxQuantity: number = 10;\r\n const singleQuantity: number = 1;\r\n const unitOfMeasure = renderUnitOfMeasure();\r\n // No quantity selector for invoice line\r\n if (!props.data.cartLine.IsInvoiceLine) {\r\n if (props.data.product && props.isQuantityEditable) {\r\n nodes.push(\r\n <div className='msc-cart-line__product-quantity'>\r\n <div className='msc-cart-line__product-quantity-label'>\r\n {resources.quantityDisplayString}\r\n </div>\r\n\r\n {generateErrorMessage()}\r\n\r\n <IncrementalQuantity\r\n id={`msc-cart-line__quantity_${props.data.product.RecordId}-\r\n ${String(props.data.cartLine.DeliveryMode)}-${String(props.data.cartLine.LineId)}`}\r\n max={props.maxQuantity ?? defaultMaxQuantity}\r\n currentCount={props.currentQuantity}\r\n onChange={onChange}\r\n inputQuantityAriaLabel={resources.inputQuantityAriaLabel}\r\n decrementButtonAriaLabel={resources.decrementButtonAriaLabel}\r\n incrementButtonAriaLabel={resources.incrementButtonAriaLabel}\r\n key={props.data.cartLine.LineId}\r\n disabled={!props.isCartStateReady}\r\n isGiftCard={props.data.product.IsGiftCard ?? props.isOutOfStock}\r\n telemetryContent={props.telemetryContent}\r\n />\r\n {unitOfMeasure}\r\n </div>\r\n );\r\n } else {\r\n nodes.push(\r\n <div className={classNames('msc-cart-line__quantity', { 'single-quantity': props.data.cartLine.Quantity === singleQuantity })}>\r\n {unitOfMeasure}\r\n <label className='quantity-label'>\r\n {resources.quantityDisplayString}\r\n {': '}\r\n </label>\r\n\r\n {generateErrorMessage()}\r\n\r\n <span className='quantity-value'>\r\n {props.data.cartLine.Quantity}\r\n </span>\r\n </div>\r\n );\r\n }\r\n }\r\n\r\n nodes.push(\r\n <div className='msc-cart-line__product-savings'>\r\n <PriceComponent\r\n data={isSalesLine ? {\r\n price: {\r\n // @ts-expect-error -- Auto suppressed.\r\n CustomerContextualPrice: props.data.cartLine.NetAmount,\r\n BasePrice: props.data.cartLine.Price\r\n }\r\n } : {\r\n price: {\r\n CustomerContextualPrice: props.data.cartLine.NetAmountWithoutTax,\r\n BasePrice: props.data.cartLine.NetPrice\r\n }\r\n }}\r\n context={props.context}\r\n id={props.id}\r\n typeName={props.typeName}\r\n className='msc-cart-line__product-savings-actual'\r\n originalPriceText={resources.originalPriceText}\r\n currentPriceText={resources.currentPriceText}\r\n />\r\n {/* {\r\n renderSaving()\r\n } */}\r\n {props.isOutOfStock ? renderInventoryLabel : null}\r\n </div>\r\n );\r\n\r\n return nodes;\r\n };\r\n\r\n return (\r\n <div className='msc-cart-line'>\r\n <a className={imgeClassName} href={productUrl} aria-label={productName}>\r\n <Image\r\n requestContext={props.context.actionContext.requestContext}\r\n aria-hidden='true'\r\n src={props.primaryImageUrl ?? 'empty'} fallBackSrc={fallbackImageUrl} altText={productName}\r\n gridSettings={props.gridSettings} imageSettings={imageSettings} loadFailureBehavior='empty' />\r\n </a>\r\n <div className={cartLineContentClassName}>\r\n <div className='msc-cart-line__product'>\r\n <a className='msc-cart-line__product-title' href={productUrl} {...productAttribute} >\r\n {productName}\r\n </a>\r\n {ArrayExtensions.hasElements(productDimensions) ? <div className='msc-cart-line__product-variants'>\r\n {productDimensions}\r\n </div> : ''}\r\n <div className='msc-cart-line__product-price'>\r\n <PriceComponent\r\n data={isSalesLine ? {\r\n price: {\r\n // @ts-expect-error -- Auto suppressed.\r\n CustomerContextualPrice: props.data.cartLine.NetAmount,\r\n BasePrice: props.data.cartLine.Price\r\n }\r\n } : {\r\n price: {\r\n CustomerContextualPrice: props.data.cartLine.NetAmountWithoutTax,\r\n BasePrice: props.data.cartLine.NetPrice\r\n }\r\n }}\r\n context={props.context}\r\n id={props.id}\r\n typeName={props.typeName}\r\n className='msc-cart-line__product-discount-value'\r\n />\r\n {renderUnitOfMeasure()}\r\n </div>\r\n {renderProductUnitPrice}\r\n {renderInventoryLabel}\r\n {renderDiscountLines}\r\n {props.showShippingChargesForLineItems && <div className='msc-cart-line__freight'>\r\n {renderShippingLabel}\r\n </div>}\r\n {renderOtherCharges}\r\n </div>\r\n {\r\n generateQuantityAndPrice()\r\n }\r\n {\r\n props.data.cartLine.IsInvoiceLine && props.data.cartState && props.resources.priceEditorResources && <CartLinePriceEditor\r\n className='msc-cart-line__price-editor-container'\r\n context={props.context}\r\n resources={props.resources.priceEditorResources}\r\n cartState={props.data.cartState}\r\n cartLine={props.data.cartLine}\r\n />\r\n }\r\n </div>\r\n </div>\r\n );\r\n};\r\n\r\nexport default CartLine;\r\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 { IComponent, IComponentProps } from '@msdyn365-commerce/core';\r\nimport { ICartState } from '@msdyn365-commerce/global-state';\r\nimport { Coupon } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { Button, format, getPayloadObject, getTelemetryAttributes, IPayLoad, ITelemetryContent, TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\n/**\r\n * IPromoCodeProps: Interface for promo code component.\r\n */\r\nexport interface IPromoCodeProps extends IComponentProps<{}> {\r\n cart: ICartState | undefined;\r\n promoCodeHeadingText: string;\r\n appliedPromoCodeHeadingText: string;\r\n removePromoAriaLabelFormat: string;\r\n promoPlaceholderText: string;\r\n promoCodeApplyButtonText: string;\r\n collapseTimeOut: number;\r\n removePromoText: string;\r\n invalidPromoCodeErrorText: string;\r\n failedToAddPromoCodeErrorText: string;\r\n duplicatePromoCodeErrorText: string;\r\n failedToRemovePromoCodeErrorText: string;\r\n\r\n /** The telemetry content. */\r\n telemetryContent?: ITelemetryContent;\r\n promoCodeApplyCallback?(): void;\r\n}\r\n\r\n/**\r\n * IPromoCodeProps: Interface for promo code component.\r\n */\r\nexport interface IPromoCodeComponent extends IComponent<IPromoCodeProps> { }\r\n\r\n/**\r\n * IPromoCodeProps: Interface for promo code state.\r\n */\r\ninterface IPromoCodeState {\r\n promoCodeInputValue: string;\r\n error: string;\r\n canApply: boolean;\r\n}\r\n\r\n/**\r\n *\r\n * The PromoCode component renders the promocode section.\r\n * @extends {React.PureComponent<IRefineSubmenuProps>}\r\n */\r\nclass PromoCode extends React.PureComponent<IPromoCodeProps, IPromoCodeState> {\r\n\r\n private readonly payLoad: IPayLoad;\r\n\r\n public constructor(props: IPromoCodeProps) {\r\n super(props);\r\n this.payLoad = getPayloadObject('click', this.props.telemetryContent!, TelemetryConstant.ApplyPromoCode);\r\n this.state = {\r\n promoCodeInputValue: '',\r\n error: '',\r\n canApply: false\r\n };\r\n }\r\n\r\n public render(): JSX.Element {\r\n return (\r\n <div>\r\n <div className='msc-promo-code-heading'>\r\n {this.props.promoCodeHeadingText}\r\n </div>\r\n {this._renderForm(this.props.promoPlaceholderText, this.props.promoCodeApplyButtonText, this.props.cart)}\r\n <p className={this.state.error ? 'msc-alert-danger' : ''} aria-live='assertive'>\r\n {this.state.error}\r\n </p>\r\n {this._renderAppliedPromoCode(this.props)}\r\n </div>\r\n );\r\n }\r\n\r\n /**\r\n * On input change method.\r\n * @param event - Change event.\r\n */\r\n private readonly _onInputChangeHandler = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n const error = event.target.value === '' ? '' : this.state.error;\r\n this.setState({\r\n promoCodeInputValue: event.target.value, error,\r\n canApply: !!event.target.value\r\n });\r\n };\r\n\r\n /**\r\n * Apply promo code method.\r\n * @param cartState - Cart state interface.\r\n */\r\n private readonly _applyPromotion = (cartState: ICartState | undefined) => {\r\n if (!cartState) {\r\n return;\r\n }\r\n const appliedPromo = this.state.promoCodeInputValue;\r\n\r\n cartState.addPromoCode({ promoCode: appliedPromo })\r\n .then(result => {\r\n if (result.status === 'SUCCESS') {\r\n // Show success text\r\n this.setState({ promoCodeInputValue: '', error: '', canApply: false });\r\n } else if (result.substatus === 'ALREADYADDED') {\r\n this.setState({ error: this.props.duplicatePromoCodeErrorText });\r\n } else {\r\n this.setState({ error: this.props.invalidPromoCodeErrorText });\r\n }\r\n })\r\n .catch(() => {\r\n this.setState({ error: this.props.failedToAddPromoCodeErrorText });\r\n });\r\n };\r\n\r\n /**\r\n * On submit action.\r\n * @param cartState - Cart state.\r\n * @returns Apply promotion.\r\n */\r\n private readonly _onSubmitHandler = (cartState: ICartState | undefined) => (event: React.FormEvent<HTMLFormElement>) => {\r\n event.preventDefault();\r\n this._applyPromotion(cartState);\r\n };\r\n\r\n /**\r\n * On apply promotion.\r\n * @param cartState - Cart state.\r\n * @returns Apply promotion.\r\n */\r\n private readonly applyPromotionHandler = (cartState: ICartState | undefined) => () => {\r\n this._applyPromotion(cartState);\r\n };\r\n\r\n /**\r\n * Renders promo code form.\r\n * @param promoPlaceholderText - Promo code input box placeholder string.\r\n * @param promoCodeApplyButtonText - Promo code button text string.\r\n * @param cartState - Cart state interface.\r\n * @returns Promo code form.\r\n */\r\n private readonly _renderForm = (promoPlaceholderText: string, promoCodeApplyButtonText: string, cartState: ICartState | undefined) => {\r\n\r\n const attributes = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\r\n\r\n return (\r\n <form onSubmit={this._onSubmitHandler(cartState)} className='msc-promo-code__form-container'>\r\n <div className='msc-promo-code__group'>\r\n <input\r\n className='msc-promo-code__input-box'\r\n onChange={this._onInputChangeHandler}\r\n value={this.state.promoCodeInputValue}\r\n placeholder={promoPlaceholderText}\r\n />\r\n <Button\r\n title={promoCodeApplyButtonText}\r\n className='msc-promo-code__apply-btn btn'\r\n onClick={this.applyPromotionHandler(cartState)}\r\n disabled={!this.state.canApply}\r\n {...attributes}\r\n />\r\n </div>\r\n </form>\r\n );\r\n };\r\n\r\n /**\r\n * Remove promo code method.\r\n * @param cartState - Cart state interface.\r\n * @param event - Mouse event.\r\n */\r\n private readonly _removePromotion = (cartState: ICartState | undefined, event: React.MouseEvent) => {\r\n if (!cartState) {\r\n return;\r\n }\r\n const code = event.currentTarget.getAttribute('data-value') ?? '';\r\n cartState.removePromoCodes({\r\n promoCodes: [code]\r\n })\r\n .then(result => {\r\n if (result.status === 'SUCCESS') {\r\n this.setState({ error: '' });\r\n }\r\n })\r\n .catch(() => {\r\n this.setState({ error: this.props.failedToRemovePromoCodeErrorText });\r\n });\r\n\r\n };\r\n\r\n /**\r\n * Renders applied promo code form.\r\n * @param props - Promo code component props.\r\n * @returns Applied promo code.\r\n */\r\n private readonly _renderAppliedPromoCode = (props: IPromoCodeProps) => {\r\n if (!props.cart || !props.cart.cart.Coupons || !ArrayExtensions.hasElements(props.cart.cart.Coupons)) {\r\n return;\r\n }\r\n\r\n /**\r\n * On remove promotion action.\r\n * @param event - Mouse event.\r\n */\r\n const removePromotionHandler = (event: React.MouseEvent<HTMLElement>) => {\r\n this._removePromotion(props.cart, event);\r\n };\r\n\r\n return (\r\n <>\r\n {\r\n props.cart.cart.Coupons.map((coupon: Coupon) => {\r\n const ariaLabel = props.removePromoAriaLabelFormat ? format(props.removePromoAriaLabelFormat, props.removePromoText, coupon.Code) : '';\r\n\r\n return (\r\n <div key={coupon.Code} className='msc-promo-code__line-container'>\r\n <div className='msc-promo-code__line-value'>\r\n {'Code '}\r\n <span className='msc-promo-code__line-value-code'>\r\n {coupon.Code}\r\n </span>\r\n {'Applied '}\r\n\r\n </div>\r\n <Button\r\n title={props.removePromoText}\r\n className='msc-promo-code__line__btn-remove'\r\n onClick={removePromotionHandler}\r\n data-value={coupon.Code}\r\n aria-label={ariaLabel}\r\n />\r\n </div>\r\n );\r\n })\r\n }\r\n </>\r\n );\r\n };\r\n}\r\n\r\nexport default PromoCode;\r\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 { ICartLinePriceEditorResources, PriceComponent } from '@msdyn365-commerce/components';\r\nimport { IComponentProps, IGridSettings, IImageSettings, Image } from '@msdyn365-commerce/core';\r\nimport { ICartState } from '@msdyn365-commerce/global-state';\r\nimport { ChannelDeliveryOptionConfiguration, ProductDimensionType, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport {\r\n CartLine,\r\n CommerceProperty,\r\n DiscountLine,\r\n DiscountLineType,\r\n SalesLine\r\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport { ArrayExtensions, getFallbackImageUrl } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getPayloadObject, getTelemetryAttributes, IncrementalQuantity, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport classNames from 'classnames';\r\nimport * as React from 'react';\r\nimport { CommercePropertyValueEnum } from '../../../../modules/allowable-freight/utils/CommercePropertyValueEnum';\r\nimport { IWarehouseMapping, WarehouseInventoryType } from './inventory-breakdown.component';\r\nimport getExtensionPropertyValueByKey from '../../../../utils/getExtensionPropertyValueByKey';\r\n\r\n/**\r\n * ICartlineResourceString: Interface for specifying the\r\n * resource strings that the component needs.\r\n */\r\nexport interface ICartlineResourceString {\r\n /** Display string for discount label. */\r\n discountStringText: string;\r\n\r\n /** String for size key. */\r\n sizeString: string;\r\n\r\n /** String for color key. */\r\n colorString: string;\r\n\r\n /** String associated with the configuration product dimension. */\r\n configString: string;\r\n\r\n /** String for style key. */\r\n styleString: string;\r\n\r\n /** String for amount key. */\r\n amountString?: string;\r\n\r\n /** Display string for quantity label. */\r\n quantityDisplayString: string;\r\n\r\n /** Display string for quantity label. */\r\n inputQuantityAriaLabel: string;\r\n\r\n /** Aria label for the decrement button in quantity component. */\r\n decrementButtonAriaLabel: string;\r\n\r\n /** Aria label for the increment button in quantity component. */\r\n incrementButtonAriaLabel: string;\r\n\r\n /** Original text screenreader. */\r\n originalPriceText: string;\r\n\r\n /** Current text screenreader. */\r\n currentPriceText: string;\r\n\r\n /** Shipping Charges Text. */\r\n shippingChargesText: string;\r\n\r\n /** Price Editor Charges Text. */\r\n priceEditorResources?: ICartLinePriceEditorResources;\r\n}\r\n\r\n/**\r\n * Represents cart line data interface.\r\n */\r\ninterface ICartLineData {\r\n cartLine: CartLine | SalesLine;\r\n cartState?: ICartState;\r\n product?: SimpleProduct;\r\n}\r\n\r\n/**\r\n * ICartLineProps: The props required to render cartLineitem.\r\n */\r\nexport interface ICartLineProps extends IComponentProps<ICartLineData> {\r\n /** The flag to change the quantity component from interactible to static. */\r\n disableQuantityInteractivity?: boolean;\r\n\r\n /** The primary image url. */\r\n primaryImageUrl?: string;\r\n\r\n /** The product url. */\r\n productUrl?: string;\r\n\r\n /** GridSettings for the product image in cartLine. */\r\n gridSettings: IGridSettings;\r\n\r\n /** ImageSettings for the product image in cartLine. */\r\n imageSettings: IImageSettings;\r\n\r\n /** Boolean flag to indicate if the item is out of stock. */\r\n isOutOfStock?: boolean;\r\n\r\n /** Flag to make quantity section editable. */\r\n isQuantityEditable?: boolean;\r\n\r\n /** Max quantity for line item. */\r\n maxQuantity?: number;\r\n\r\n /** Current quantity for line item. */\r\n currentQuantity?: number;\r\n\r\n /** Resource string for the component. */\r\n resources: ICartlineResourceString;\r\n\r\n /** SalesLine flag. */\r\n isSalesLine?: boolean;\r\n\r\n /** Error message to show in place of quantity. */\r\n errorMessage?: string;\r\n\r\n /** Inventory information label. */\r\n inventoryInformationLabel?: string;\r\n\r\n /** Inventory information class name. */\r\n inventoryLabelClassName?: string;\r\n\r\n /** Flag to show/hide shipping charges for line items. */\r\n showShippingChargesForLineItems?: boolean;\r\n\r\n /** Boolean flag to indicate if cart state status is ready. */\r\n isCartStateReady?: boolean;\r\n\r\n /** Chanel Delivery Option configuration is from api. */\r\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\r\n\r\n /** The telemetry content. */\r\n telemetryContent?: ITelemetryContent;\r\n\r\n /** Quantity onChange callback. */\r\n quantityOnChange?(cartLine: CartLine, newQuantity: number): boolean;\r\n\r\n /** Expected shipping warehouse */\r\n warehouse: WarehouseInventoryType | undefined;\r\n\r\n /** Whether the displayed cartline is on cartpage or mini cart */\r\n isCartView: string;\r\n\r\n /** Whether the current warehouse is altered or not */\r\n isAlternateWarehouse: boolean;\r\n\r\n /** Whether alternate warehouse selection should be disabled due to applied coupon codes. */\r\n isAlternateWarehouseSelectionDisabled: boolean;\r\n\r\n /** Number of warehouses for availabilities */\r\n numOfWarehouse: number | undefined;\r\n\r\n /** Determines whether the alternate warehouse feature should be displayed for the user. */\r\n shouldDisplayAlternateWarehouseFeature: boolean;\r\n\r\n /** Primary warehouse */\r\n primaryWarehouse: WarehouseInventoryType | undefined;\r\n\r\n /** Whether warehouse has changed to primary warehouse due to insufficient stock */\r\n hasWarehouseChanged: boolean | undefined;\r\n\r\n /** Whether to enforce primary warehouse availability before selecting an alternate warehouse. */\r\n // enforcePrimaryWarehouseAvailability: boolean;\r\n\r\n /** Function to set product for availability modal */\r\n selectProductForAvailability: (cartlineId: string) => void;\r\n}\r\n\r\n/**\r\n * Represents dimensions strings.\r\n */\r\ninterface IDimensionStrings {\r\n /** String for size key. */\r\n sizeString: string;\r\n\r\n /** String for color key. */\r\n colorString: string;\r\n\r\n /** String associated with the configuration product dimension. */\r\n configString: string;\r\n\r\n /** String for style key. */\r\n styleString: string;\r\n\r\n /** String for amount key. */\r\n amountString?: string;\r\n}\r\n\r\nconst cartLineItemFunctions = {\r\n /**\r\n * Render product dimensions.\r\n * @param product - Product data.\r\n * @param dimensionStrings - Dimension strings interface.\r\n * @returns JSX Element.\r\n */\r\n renderProductDimensions: (product: SimpleProduct, dimensionStrings: IDimensionStrings) => {\r\n if (!product.Dimensions) {\r\n return [];\r\n }\r\n\r\n return product.Dimensions.map(productDimension => {\r\n if (productDimension.DimensionTypeValue === ProductDimensionType.Color) {\r\n return (\r\n <div key={`${product.RecordId}ProductDimensions1`} className='msc-cart-line__product-variant-item'>\r\n <span className='msc-cart-line__product-variant-color'>\r\n {dimensionStrings.colorString}\r\n {': '}\r\n <span className='name'>{productDimension.DimensionValue?.Value}</span>\r\n </span>\r\n </div>\r\n );\r\n }\r\n\r\n if (productDimension.DimensionTypeValue === ProductDimensionType.Configuration) {\r\n return (\r\n <div key={`${product.RecordId}ProductDimensions2`} className='msc-cart-line__product-variant-item'>\r\n <span className='msc-cart-line__product-configuration'>\r\n {dimensionStrings.configString}\r\n {': '}\r\n <span className='name'>{productDimension.DimensionValue?.Value}</span>\r\n </span>\r\n </div>\r\n );\r\n }\r\n\r\n if (productDimension.DimensionTypeValue === ProductDimensionType.Size) {\r\n return (\r\n <div key={`${product.RecordId}ProductDimensions3`} className='msc-cart-line__product-variant-item'>\r\n <span className='msc-cart-line__product-variant-size'>\r\n {dimensionStrings.sizeString}\r\n {': '}\r\n <span className='name'>{productDimension.DimensionValue?.Value}</span>\r\n </span>\r\n </div>\r\n );\r\n }\r\n\r\n if (productDimension.DimensionTypeValue === ProductDimensionType.Style) {\r\n return (\r\n <div key={`${product.RecordId}ProductDimensions4`} className='msc-cart-line__product-variant-item'>\r\n <span className='msc-cart-line__product-variant-style'>\r\n {product.IsGiftCard ? dimensionStrings.amountString : dimensionStrings.styleString}\r\n {': '}\r\n <span className='name'>{productDimension.DimensionValue?.Value}</span>\r\n </span>\r\n </div>\r\n );\r\n }\r\n return null;\r\n });\r\n },\r\n //\r\n //\r\n /**\r\n * Gets the react node for product unit of price display.\r\n * @param props - The cart line props.\r\n * @returns The node representing markup for unit of measure component.\r\n */\r\n renderProductUnitPrice: (props: ICartLineProps) => {\r\n if (!props.data.cartLine.Price) {\r\n return null;\r\n }\r\n const zeroQuantity: number = 0;\r\n return (\r\n <div className='msc-cart-line__product-unit-price'>\r\n <span>\r\n <PriceComponent\r\n data={\r\n props.data.cartLine.Quantity && props.data.cartLine.Quantity > zeroQuantity\r\n ? {\r\n price: {\r\n CustomerContextualPrice: props.data.cartLine.Price\r\n }\r\n }\r\n : {\r\n price: {\r\n CustomerContextualPrice: props.data.cartLine.Price\r\n }\r\n }\r\n }\r\n context={props.context}\r\n id={props.id}\r\n typeName={props.typeName}\r\n />\r\n </span>\r\n </div>\r\n );\r\n },\r\n\r\n /**\r\n * Render discount lines.\r\n * @param props - The cart line props.\r\n * @returns JSX element.\r\n */\r\n renderDiscountLines: (props: ICartLineProps) => {\r\n if (!props.data.cartLine.DiscountLines || !ArrayExtensions.hasElements(props.data.cartLine.DiscountLines)) {\r\n return null;\r\n }\r\n\r\n /**\r\n * Get the updated discount percentage.\r\n * @param discountLine - The discount line.\r\n * @param cartLine - The cart line.\r\n * @returns The updated discount percentage.\r\n */\r\n const discountPercent = (discountLine: DiscountLine, cartLine: CartLine): number => {\r\n const numberZero = 0;\r\n const decimalPrecision = 2;\r\n const fullPercentage = 100;\r\n let updatedPercent: number = discountLine.Percentage ?? numberZero;\r\n\r\n if (\r\n (discountLine.Percentage === numberZero ||\r\n (discountLine.DiscountLineTypeValue && discountLine.DiscountLineTypeValue === DiscountLineType.TenderTypeDiscount)) &&\r\n cartLine.Price &&\r\n cartLine.Price > numberZero &&\r\n cartLine.Quantity &&\r\n cartLine.Quantity !== numberZero\r\n ) {\r\n const effectiveAmount = discountLine.EffectiveAmount ?? numberZero;\r\n updatedPercent = Number(\r\n ((effectiveAmount / (cartLine.Price * cartLine.Quantity)) * fullPercentage).toFixed(decimalPrecision)\r\n );\r\n }\r\n\r\n return updatedPercent;\r\n };\r\n\r\n return props.data.cartLine.DiscountLines.map((discountLine, index) => {\r\n return (\r\n <div key={discountLine.OfferId ?? index} className='msc-cart-line__product-discount'>\r\n <span>{discountLine.OfferName ? discountLine.OfferName : ''}</span>\r\n <span className='msc-cart-line-item-product-discount-price'>\r\n <PriceComponent\r\n data={\r\n props.isSalesLine\r\n ? {\r\n price: {\r\n // @ts-expect-error -- Auto suppressed.\r\n CustomerContextualPrice: props.data.cartLine.PeriodicDiscount\r\n }\r\n }\r\n : {\r\n price: {\r\n CustomerContextualPrice: discountLine.EffectiveAmount,\r\n BasePrice: discountLine.EffectiveAmount\r\n }\r\n }\r\n }\r\n context={props.context}\r\n id={props.id}\r\n typeName={props.typeName}\r\n />\r\n </span>\r\n <span className='msc-cart-line__product-discount-percentage'>\r\n {` (${discountLine.Percentage !== undefined ? discountPercent(discountLine, props.data.cartLine) : ''}%)`}\r\n </span>\r\n </div>\r\n );\r\n });\r\n },\r\n\r\n /**\r\n * Render inventory label.\r\n * @param props - The cart line props.\r\n * @returns JSX element.\r\n */\r\n renderInventoryLabel: (props: ICartLineProps) => {\r\n const {\r\n context: {\r\n request: {\r\n app: {\r\n routes: {\r\n cart: { destinationUrl }\r\n }\r\n },\r\n canonicalUrl\r\n }\r\n }\r\n } = props;\r\n const inventoryCssName = props.inventoryLabelClassName\r\n ? `msc-cart-line__product-inventory-label ${props.inventoryLabelClassName}`\r\n : 'msc-cart-line__product-inventory-label';\r\n const currPage = canonicalUrl?.substring(canonicalUrl.lastIndexOf('/'));\r\n const isCartPage = currPage === destinationUrl;\r\n const handleLinkClick = (e: React.MouseEvent) => {\r\n e.preventDefault();\r\n props.selectProductForAvailability(props.data.cartLine.LineId!);\r\n };\r\n const isInvoiceLine = props.data.cartLine.IsInvoiceLine;\r\n\r\n /** REMOVE ENFORCING PRIMARY WAREHOUSE. IF ADDED IN FUTURE, NEED ERROR HANDLING, AND ADD THE BELOW CONFIG TO APP.SETTINGS.JSON */\r\n /**\r\n \"enforcePrimaryWarehouseAvailability\": {\r\n \"friendlyName\": \"Restrict Alternate Warehouse Selection\",\r\n \"description\": \"Allow alternate warehouse selection only when the entire requested quantity is unavailable in the primary warehouse.\",\r\n \"type\": \"boolean\",\r\n \"default\": true\r\n } */\r\n // const [isPrimaryWarehouseEnforced, setIsPrimaryWarehouseEnforced] = React.useState(true);\r\n // React.useEffect(() => {\r\n // const shouldEnforcePrimaryWarehouse =\r\n // props.enforcePrimaryWarehouseAvailability && (props.currentQuantity ?? 0) <= (props.primaryWarehouse?.Available ?? 0);\r\n // setIsPrimaryWarehouseEnforced(shouldEnforcePrimaryWarehouse);\r\n // }, [props.enforcePrimaryWarehouseAvailability, props.currentQuantity, props.primaryWarehouse?.Available]);\r\n\r\n const hasWarehouseChanged = getExtensionPropertyValueByKey(\r\n props.data.cartLine.ExtensionProperties,\r\n 'HasWarehouseChanged',\r\n CommercePropertyValueEnum.boolean\r\n );\r\n\r\n const warehouseMappings: IWarehouseMapping[] = props.context.app.config.alternateWarehouseMappings;\r\n\r\n const getWarehouseNameFromMappings = (warehouseId: string | undefined) => {\r\n return warehouseMappings.find(mapping => mapping.warehouseId === warehouseId)?.warehouseName;\r\n };\r\n\r\n return !isInvoiceLine ? (\r\n <div className='msc-cart-line__product__alternate-warehouse'>\r\n <p className={inventoryCssName}>{props.inventoryInformationLabel}</p>\r\n {props.shouldDisplayAlternateWarehouseFeature && props.isCartView && props.numOfWarehouse && (\r\n <>\r\n {hasWarehouseChanged && !props.isAlternateWarehouseSelectionDisabled && !props.isAlternateWarehouse && (\r\n <p className='warehouse-changed'>\r\n <Msdyn365.RichTextComponent text={props.context.app.config.warehouseChangedLabel} />\r\n </p>\r\n )}\r\n <p className='warehouse-info'>\r\n {/* {(props.currentQuantity && (props.currentQuantity) > (props.warehouse?.Available ?? 0))} */}\r\n {props.isAlternateWarehouse ? <span>Alternate warehouse selected:</span> : 'Expected to ship from'}{' '}\r\n {getWarehouseNameFromMappings(props.warehouse?.WarehouseId) ?? props.warehouse?.Name}\r\n </p>\r\n\r\n {isCartPage &&\r\n (props.isAlternateWarehouseSelectionDisabled ? (\r\n <p className='promotion-message'>Alternate warehouse selection is not available for this promotion.</p>\r\n ) : props.numOfWarehouse && props.numOfWarehouse === 1 ? (\r\n <p className='no-warehouse'>This item is not available in any other warehouse.</p>\r\n ) : (\r\n // !isPrimaryWarehouseEnforced &&\r\n <a href='javascript:void(0)' className='gdn-inventory-link' onClick={handleLinkClick}>\r\n Check alternate warehouse inventory\r\n </a>\r\n ))}\r\n </>\r\n )}\r\n </div>\r\n ) : null;\r\n },\r\n\r\n /**\r\n * Render shipping label.\r\n * @param props - The cart line props.\r\n * @returns JSX element.\r\n */\r\n renderShippingLabel: (props: ICartLineProps) => {\r\n const pickupDeliveryModeCode = props.context.request.channel?.PickupDeliveryModeCode;\r\n const channelDeliveryOptionConfig = props.channelDeliveryOptionConfig;\r\n const cartline = props.data.cartLine;\r\n let hasShippingMethod = false;\r\n if (channelDeliveryOptionConfig !== undefined) {\r\n hasShippingMethod = !!(\r\n cartline.DeliveryMode &&\r\n channelDeliveryOptionConfig.PickupDeliveryModeCodes?.some(deliveryMode => deliveryMode !== cartline.DeliveryMode)\r\n );\r\n } else {\r\n hasShippingMethod = !!(cartline.DeliveryMode && cartline.DeliveryMode !== pickupDeliveryModeCode);\r\n }\r\n if (!hasShippingMethod) {\r\n return undefined;\r\n }\r\n\r\n const shippingChargeLines = (cartline.ChargeLines ?? []).filter(chargeLine => chargeLine.IsShipping);\r\n\r\n if (!ArrayExtensions.hasElements(shippingChargeLines)) {\r\n return undefined;\r\n }\r\n\r\n const defaultCharge: number = 0;\r\n const freightFee = shippingChargeLines.reduce((chargeTotal, chargeLine) => {\r\n return chargeTotal + (chargeLine.CalculatedAmount ?? defaultCharge);\r\n }, defaultCharge);\r\n\r\n const priceComponent = (\r\n <PriceComponent\r\n data={{\r\n price: {\r\n CustomerContextualPrice: freightFee\r\n }\r\n }}\r\n freePriceText='Free'\r\n context={props.context}\r\n id={props.id}\r\n typeName={props.typeName}\r\n className='msc-cart-line__freight-actual'\r\n />\r\n );\r\n return (\r\n <>\r\n <label className='msc-cart-line__freight-label'>{`${props.resources.shippingChargesText}:`}</label>\r\n <span className='shipping-value'>{priceComponent}</span>\r\n </>\r\n );\r\n },\r\n\r\n /**\r\n * Render other charges.\r\n * @param props - The cart line props.\r\n * @returns JSX element.\r\n */\r\n renderOtherCharges: (props: ICartLineProps) => {\r\n const cartline = props.data.cartLine;\r\n const otherCharges = cartline.ChargeLines?.filter(chargeline => !chargeline.IsShipping);\r\n\r\n return (\r\n otherCharges?.map((otherCharge, index) => {\r\n const itemIndex = index;\r\n return otherCharge.CalculatedAmount ? (\r\n <div className='msc-cart-line__other-charges' key={itemIndex}>\r\n <label className='msc-cart-line__other-charges-label'>{`${String(otherCharge.Description)}:`}</label>\r\n <span className='other-charge-value'>\r\n <PriceComponent\r\n data={{\r\n price: {\r\n CustomerContextualPrice: otherCharge.CalculatedAmount\r\n }\r\n }}\r\n context={props.context}\r\n id={props.id}\r\n typeName={props.typeName}\r\n className='msc-cart-line__other-charges-actual'\r\n />\r\n </span>\r\n </div>\r\n ) : (\r\n ''\r\n );\r\n }) ?? undefined\r\n );\r\n }\r\n};\r\n\r\n/**\r\n * Render cartline component.\r\n * @param props - The cart line props.\r\n * @returns JSX element.\r\n */\r\nconst CartLine: React.FC<ICartLineProps> = (props: ICartLineProps) => {\r\n const { isSalesLine, productUrl, resources } = props;\r\n const { product, cartLine } = props.data;\r\n const destructDimensionStrings = {\r\n sizeString: resources.sizeString,\r\n colorString: resources.colorString,\r\n styleString: resources.styleString,\r\n configString: resources.configString,\r\n amountString: resources.amountString\r\n };\r\n\r\n const IsInvoiceLine = cartLine.IsInvoiceLine;\r\n\r\n const fallbackImageUrl = product && getFallbackImageUrl(product.ItemId, props.context.actionContext.requestContext.apiSettings);\r\n const productDimensions = product && cartLineItemFunctions.renderProductDimensions(product, destructDimensionStrings);\r\n const renderProductUnitPrice = cartLineItemFunctions.renderProductUnitPrice(props);\r\n const imageSettings = props.imageSettings;\r\n if (imageSettings) {\r\n imageSettings.cropFocalRegion = true;\r\n }\r\n const renderDiscountLines = cartLineItemFunctions.renderDiscountLines(props);\r\n const renderInventoryLabel = cartLineItemFunctions.renderInventoryLabel(props);\r\n const renderShippingLabel = cartLineItemFunctions.renderShippingLabel(props);\r\n const renderOtherCharges = cartLineItemFunctions.renderOtherCharges(props);\r\n const payLoad = getPayloadObject('click', props.telemetryContent!, '', product?.RecordId.toString());\r\n const productAttribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\r\n const productName = product?.Name ?? cartLine.Description;\r\n const imgeClassName = props.data.cartLine.IsInvoiceLine ? 'msc-cart-line__invoice-image' : 'msc-cart-line__product-image';\r\n const cartLineContentClassName = props.data.cartLine.IsInvoiceLine ? 'msc-cart-line__invoice-content' : 'msc-cart-line__content';\r\n\r\n /**\r\n * Render other charges.\r\n * @param newValue - The cart line props.\r\n * @returns Boolean.\r\n */\r\n const onChange = (newValue: number): boolean => {\r\n if (props.quantityOnChange) {\r\n return props.quantityOnChange(props.data.cartLine, newValue);\r\n }\r\n return true;\r\n };\r\n\r\n /**\r\n * Generate error message.\r\n * @returns JSX element.\r\n */\r\n const generateErrorMessage = (): JSX.Element | null => {\r\n if (props.errorMessage) {\r\n return (\r\n <div className='msc-alert__header'>\r\n <span className='msi-exclamation-triangle' />\r\n <span>{props.errorMessage}</span>\r\n </div>\r\n );\r\n }\r\n\r\n return null;\r\n };\r\n\r\n /**\r\n * Gets the react node for product unit of measure display.\r\n * @returns The node representing markup for unit of measure component.\r\n */\r\n const renderUnitOfMeasure = () => {\r\n if (props.data.cartLine.IsInvoiceLine) {\r\n return null;\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Do not need type check for appsettings\r\n if (!props.context.app.config.unitOfMeasureDisplayType || props.context.app.config.unitOfMeasureDisplayType === 'none') {\r\n return undefined;\r\n }\r\n\r\n if (!product || !product.DefaultUnitOfMeasure) {\r\n return undefined;\r\n }\r\n\r\n return (\r\n <div className='msc-cart-line__product-unit-of-measure'>\r\n <span>{product.DefaultUnitOfMeasure}</span>\r\n </div>\r\n );\r\n };\r\n\r\n const getExtensionPropertyValueByKey = (\r\n properties: CommerceProperty[] | undefined,\r\n key: string,\r\n valueType: CommercePropertyValueEnum\r\n ) => {\r\n const property = properties?.find(p => p.Key === key)?.Value;\r\n\r\n // eslint-disable-next-line security/detect-object-injection\r\n const val = property ? property[valueType] : null;\r\n return val;\r\n };\r\n\r\n /**\r\n * Generate quantity and price component.\r\n * @returns JSX element.\r\n */\r\n const generateQuantityAndPrice = (): JSX.Element[] | null => {\r\n const nodes = [];\r\n const defaultMaxQuantity: number = 10;\r\n const singleQuantity: number = 1;\r\n const unitOfMeasure = renderUnitOfMeasure();\r\n const courseId = getExtensionPropertyValueByKey(\r\n props.data.cartLine.ExtensionProperties,\r\n 'CourseId',\r\n CommercePropertyValueEnum.string\r\n );\r\n // No quantity selector for invoice line or for courseId\r\n if (\r\n !props.data.cartLine.IsInvoiceLine &&\r\n !courseId // hide for courses\r\n ) {\r\n if (props.data.product && props.isQuantityEditable) {\r\n nodes.push(\r\n <div className='msc-cart-line__product-quantity'>\r\n <div className='msc-cart-line__product-quantity-label'>{resources.quantityDisplayString}</div>\r\n\r\n {generateErrorMessage()}\r\n\r\n <IncrementalQuantity\r\n id={`msc-cart-line__quantity_${props.data.product.RecordId}-\r\n ${String(props.data.cartLine.DeliveryMode)}-${String(props.data.cartLine.LineId)}`}\r\n max={props.maxQuantity ?? defaultMaxQuantity}\r\n currentCount={props.currentQuantity}\r\n onChange={onChange}\r\n inputQuantityAriaLabel={resources.inputQuantityAriaLabel}\r\n decrementButtonAriaLabel={resources.decrementButtonAriaLabel}\r\n incrementButtonAriaLabel={resources.incrementButtonAriaLabel}\r\n key={props.data.cartLine.LineId}\r\n disabled={!props.isCartStateReady}\r\n isGiftCard={props.data.product.IsGiftCard ?? props.isOutOfStock}\r\n telemetryContent={props.telemetryContent}\r\n />\r\n {unitOfMeasure}\r\n </div>\r\n );\r\n } else {\r\n nodes.push(\r\n <div\r\n className={classNames('msc-cart-line__quantity', {\r\n 'single-quantity': props.data.cartLine.Quantity === singleQuantity\r\n })}\r\n >\r\n {unitOfMeasure}\r\n <label className='quantity-label'>\r\n {resources.quantityDisplayString}\r\n {': '}\r\n </label>\r\n\r\n {generateErrorMessage()}\r\n\r\n <span className='quantity-value'>{props.data.cartLine.Quantity}</span>\r\n </div>\r\n );\r\n }\r\n }\r\n\r\n nodes.push(\r\n <div className='msc-cart-line__product-savings'>\r\n <PriceComponent\r\n data={\r\n isSalesLine\r\n ? {\r\n price: {\r\n // @ts-expect-error -- Auto suppressed.\r\n CustomerContextualPrice: props.data.cartLine.NetAmount,\r\n BasePrice: props.data.cartLine.Price\r\n }\r\n }\r\n : {\r\n price: {\r\n CustomerContextualPrice: props.data.cartLine.NetAmountWithoutTax,\r\n BasePrice: props.data.cartLine.NetPrice\r\n }\r\n }\r\n }\r\n context={props.context}\r\n id={props.id}\r\n typeName={props.typeName}\r\n className='msc-cart-line__product-savings-actual'\r\n originalPriceText={resources.originalPriceText}\r\n currentPriceText={resources.currentPriceText}\r\n />\r\n {props.isOutOfStock ? renderInventoryLabel : null}\r\n </div>\r\n );\r\n\r\n return nodes;\r\n };\r\n\r\n return (\r\n <div className='msc-cart-line'>\r\n <a className={imgeClassName} href={productUrl} aria-label={productName}>\r\n <Image\r\n requestContext={props.context.actionContext.requestContext}\r\n aria-hidden='true'\r\n src={props.primaryImageUrl ?? 'empty'}\r\n fallBackSrc={fallbackImageUrl}\r\n altText={productName}\r\n gridSettings={props.gridSettings}\r\n imageSettings={imageSettings}\r\n loadFailureBehavior='empty'\r\n />\r\n </a>\r\n <div className={cartLineContentClassName}>\r\n <div className='msc-cart-line__product'>\r\n <a className='msc-cart-line__product-title' href={productUrl} {...productAttribute}>\r\n {product?.ItemId || null}\r\n {!IsInvoiceLine && '-'}\r\n {productName}\r\n </a>\r\n {/* <div className='msc-cart-line__product__invoice-terms'>\r\n <span>Terms</span>\r\n <span>Allowable Freight by 15th</span>\r\n </div> */}\r\n {ArrayExtensions.hasElements(productDimensions) ? (\r\n <div className='msc-cart-line__product-variants'>{productDimensions}</div>\r\n ) : (\r\n ''\r\n )}\r\n <div className='msc-cart-line__product-price'>\r\n <PriceComponent\r\n data={\r\n isSalesLine\r\n ? {\r\n price: {\r\n // @ts-expect-error -- Auto suppressed.\r\n CustomerContextualPrice: props.data.cartLine.NetAmount,\r\n BasePrice: props.data.cartLine.Price\r\n }\r\n }\r\n : {\r\n price: {\r\n CustomerContextualPrice: props.data.cartLine.NetAmountWithoutTax,\r\n BasePrice: props.data.cartLine.NetPrice\r\n }\r\n }\r\n }\r\n context={props.context}\r\n id={props.id}\r\n typeName={props.typeName}\r\n className='msc-cart-line__product-discount-value'\r\n />\r\n {renderUnitOfMeasure()}\r\n </div>\r\n {renderProductUnitPrice}\r\n {renderInventoryLabel}\r\n {renderDiscountLines}\r\n {props.showShippingChargesForLineItems && <div className='msc-cart-line__freight'>{renderShippingLabel}</div>}\r\n {renderOtherCharges}\r\n </div>\r\n {generateQuantityAndPrice()}\r\n {props.data.cartLine.IsInvoiceLine && (\r\n <div className='msc-cart-line__invoice'>\r\n <p className='invoice-amount-label'>Payment Amount</p>\r\n <p className='invoice-price'>\r\n {props.data.cartLine.Price ? props.context.cultureFormatter.formatCurrency(props.data.cartLine.Price) : 'N/A'}\r\n </p>\r\n </div>\r\n )}\r\n </div>\r\n </div>\r\n );\r\n};\r\n\r\nexport default CartLine;\r\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 { IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\r\nimport { ICartState } from '@msdyn365-commerce/global-state';\r\nimport { Coupon } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport { Button, format, getPayloadObject, getTelemetryAttributes, IPayLoad, ITelemetryContent, TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { PriceComponent } from '@msdyn365-commerce/components';\r\nimport { addAttributeToCart, removeAttributeFromCart } from \"../../../../utils/cartAttributeManager\";\r\nimport { ICouponCodeMapData } from '../../definition-extensions/cart.ext.props.autogenerated';\r\n\r\nexport interface IPromoCodeProps extends IComponentProps<{}> {\r\n cart: ICartState | undefined;\r\n promoCodeHeadingText: string;\r\n appliedPromoCodeHeadingText: string;\r\n removePromoAriaLabelFormat: string;\r\n promoPlaceholderText: string;\r\n promoCodeApplyButtonText: string;\r\n collapseTimeOut: number;\r\n removePromoText: string;\r\n invalidPromoCodeErrorText: string;\r\n failedToAddPromoCodeErrorText: string;\r\n duplicatePromoCodeErrorText: string;\r\n failedToRemovePromoCodeErrorText: string;\r\n couponMapping: ICouponCodeMapData[];\r\n /**\r\n * The telemetry content\r\n */\r\n telemetryContent?: ITelemetryContent;\r\n promoCodeApplyCallback?(): void;\r\n}\r\n\r\nexport interface IPromoCodeComponent extends IComponent<IPromoCodeProps> { }\r\n\r\nconst PromoCodeComponentActions = {};\r\n\r\ninterface IPromoCodeState {\r\n isCollapseOpen: boolean;\r\n promoCodeInputValue: string;\r\n error: string;\r\n canApply: boolean;\r\n}\r\n\r\n/**\r\n *\r\n * The PromoCode component renders the promocode section.\r\n * @extends {React.PureComponent<IRefineSubmenuProps>}\r\n */\r\nclass PromoCode extends React.Component<IPromoCodeProps, IPromoCodeState> {\r\n private readonly COUPON_ATTRIBUTE_KEY = 'coupon-code';\r\n private readonly payLoad: IPayLoad;\r\n\r\n constructor(props: IPromoCodeProps, state: IPromoCodeState) {\r\n super(props);\r\n this.payLoad = getPayloadObject('click', this.props.telemetryContent!, TelemetryConstant.ApplyPromoCode);\r\n this.state = {\r\n isCollapseOpen: false,\r\n promoCodeInputValue: '',\r\n error: '',\r\n canApply: false\r\n };\r\n }\r\n\r\n public shouldComponentUpdate(nextProps: IPromoCodeProps): boolean {\r\n if (this.props.appliedPromoCodeHeadingText !== nextProps.appliedPromoCodeHeadingText) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n public formatDate(date: Date) {\r\n const year = date.getFullYear();\r\n const month = String(date.getMonth() + 1).padStart(2, '0'); // Months are zero-based\r\n const day = String(date.getDate()).padStart(2, '0');\r\n return `${year}-${month}-${day}`;\r\n }\r\n\r\n public getMondayOfCurrentWeek() {\r\n const today = new Date();\r\n const day = today.getDay();\r\n const diff = today.getDate() - day + (day === 0 ? -6 : 1); // adjust when day is Sunday\r\n const monday = new Date(today.setDate(diff));\r\n return monday;\r\n }\r\n\r\n public getCouponCodeMap = (enteredCode: string) => {\r\n const foundCode = this.props.couponMapping.find(c => c.fromCouponCode?.toUpperCase() === enteredCode.toUpperCase());\r\n if (foundCode) { \r\n const mondaysDate = this.formatDate(this.getMondayOfCurrentWeek());\r\n const coupon = foundCode.toCouponCode?.find(tcc => tcc.date === mondaysDate)?.code;\r\n return coupon;\r\n }\r\n return null;\r\n }\r\n\r\n public render(): JSX.Element {\r\n return (\r\n <div>\r\n <div className='msc-promo-code-heading'>\r\n {this.props.promoCodeHeadingText}\r\n </div>\r\n {this._renderForm(this.props.promoPlaceholderText, this.props.promoCodeApplyButtonText, this.props.cart)}\r\n <p className={this.state.error ? 'msc-alert-danger' : ''} aria-live='assertive'>\r\n {this.state.error}\r\n </p>\r\n {this._renderAppliedPromoCode(this.props)}\r\n </div>\r\n );\r\n }\r\n\r\n private readonly _onInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n const error = e.target.value === '' ? '' : this.state.error;\r\n this.setState({\r\n promoCodeInputValue: e.target.value, error,\r\n canApply: !!e.target.value\r\n });\r\n };\r\n\r\n private readonly _applyPromotion = (cartState: ICartState | undefined) => {\r\n if (!cartState || !cartState.cart) {\r\n return;\r\n }\r\n const appliedPromo = this.state.promoCodeInputValue;\r\n const promoCode = this.getCouponCodeMap(appliedPromo)\r\n cartState.addPromoCode({ promoCode: promoCode || appliedPromo })\r\n .then(result => {\r\n if (result.status === 'SUCCESS') {\r\n // Show success text\r\n this.setState({ promoCodeInputValue: '', error: '', canApply: false });\r\n const _cart = addAttributeToCart(this.COUPON_ATTRIBUTE_KEY, appliedPromo, cartState.cart);\r\n void cartState.updateCart({newCartObject: _cart})\r\n } else if (result.substatus === 'ALREADYADDED') {\r\n this.setState({ error: this.props.duplicatePromoCodeErrorText });\r\n } else {\r\n this.setState({ error: this.props.invalidPromoCodeErrorText });\r\n }\r\n })\r\n .catch(error => {\r\n this.setState({ error: this.props.failedToAddPromoCodeErrorText });\r\n });\r\n };\r\n\r\n private readonly _renderForm = (promoPlaceholderText: string, promoCodeApplyButtonText: string, cartState: ICartState | undefined) => {\r\n const _onSubmit = (event: React.FormEvent<HTMLFormElement>) => {\r\n event.preventDefault(); this._applyPromotion(cartState);\r\n };\r\n const _applyPromotion = (event: React.MouseEvent<HTMLElement>) => {\r\n this._applyPromotion(cartState);\r\n };\r\n const attributes = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\r\n\r\n return (\r\n <form onSubmit={_onSubmit} className='msc-promo-code__form-container'>\r\n <div className='msc-promo-code__group'>\r\n <input\r\n className='msc-promo-code__input-box'\r\n aria-label={promoPlaceholderText}\r\n onChange={this._onInputChange}\r\n value={this.state.promoCodeInputValue}\r\n placeholder={promoPlaceholderText}\r\n />\r\n <Button\r\n title={promoCodeApplyButtonText}\r\n className='msc-promo-code__apply-btn btn'\r\n onClick={_applyPromotion}\r\n disabled={!this.state.canApply}\r\n {...attributes}\r\n >\r\n {promoCodeApplyButtonText}\r\n </Button>\r\n </div>\r\n </form>\r\n );\r\n };\r\n\r\n private readonly _removePromotion = (cartState: ICartState | undefined, event: React.MouseEvent) => {\r\n if (!cartState) {\r\n return;\r\n }\r\n const code = event.currentTarget.getAttribute('data-value') || '';\r\n cartState.removePromoCodes({\r\n promoCodes: [code]\r\n })\r\n .then(result => {\r\n if (result.status === 'SUCCESS') {\r\n const _cart = removeAttributeFromCart(this.COUPON_ATTRIBUTE_KEY, cartState.cart);\r\n void cartState.updateCart({newCartObject: _cart, additionalProperties: { AttributeValues: _cart.AttributeValues || [] }});\r\n this.setState({ error: '' });\r\n\r\n }\r\n })\r\n .catch(() => {\r\n this.setState({ error: this.props.failedToRemovePromoCodeErrorText });\r\n });\r\n\r\n };\r\n\r\n private readonly _calculateDiscount = (code: string, cartState: ICartState | undefined) => {\r\n if (!cartState || !cartState.cart || !cartState.cart.CartLines || cartState.cart.CartLines.length === 0 || !code) {\r\n return;\r\n }\r\n let discountAmount = 0;\r\n for (const line of cartState.cart.CartLines) {\r\n if (line.DiscountLines) {\r\n for (const discountLine of line.DiscountLines) {\r\n if (discountLine.DiscountCode === code) {\r\n discountAmount += discountLine.DiscountCost!;\r\n }\r\n }\r\n }\r\n }\r\n return discountAmount * -1;\r\n };\r\n\r\n private readonly _renderAppliedPromoCode = (props: IPromoCodeProps) => {\r\n if (!props.cart || !props.cart.cart || !props.cart.cart.Coupons || !(props.cart.cart.Coupons.length > 0)) {\r\n return;\r\n }\r\n\r\n const _removePromotion = (event: React.MouseEvent<HTMLElement>) => {\r\n this._removePromotion(props.cart, event);\r\n };\r\n let totalCouponDiscountAmount = 0;\r\n for (const coupon of props.cart.cart.Coupons) {\r\n const discountAmount = this._calculateDiscount(coupon.Code ?? '', props.cart);\r\n if (discountAmount) {\r\n totalCouponDiscountAmount += discountAmount;\r\n }\r\n }\r\n\r\n return (\r\n <>\r\n <div className='msc-promo-code__discount'>\r\n <div className='msc-promo-code__discount-heading'>\r\n {this.props.appliedPromoCodeHeadingText}\r\n </div>\r\n <PriceComponent\r\n data={{\r\n price: {\r\n CustomerContextualPrice: totalCouponDiscountAmount\r\n\r\n }\r\n }}\r\n context={props.context}\r\n id={props.id}\r\n typeName={props.typeName}\r\n className='msc-promo-code__discount-value'\r\n />\r\n </div>\r\n {\r\n props.cart.cart.Coupons.map((coupon: Coupon) => {\r\n const ariaLabel = props.removePromoAriaLabelFormat ? format(props.removePromoAriaLabelFormat, props.removePromoText, coupon.Code) : '';\r\n\r\n return (\r\n <div key={coupon.Code} className='msc-promo-code__line-container'>\r\n <div className='msc-promo-code__line-value'>\r\n {coupon.Code}\r\n {' '}\r\n (\r\n <PriceComponent\r\n data={{\r\n price: {\r\n CustomerContextualPrice: this._calculateDiscount(coupon.Code || '', props.cart)\r\n\r\n }\r\n }}\r\n context={props.context}\r\n id={props.id}\r\n typeName={props.typeName}\r\n className='msc-promo-code__line-discount-value'\r\n />\r\n )\r\n </div>\r\n <Button\r\n title={props.removePromoText}\r\n className='msc-promo-code__line__btn-remove'\r\n onClick={_removePromotion}\r\n data-value={coupon.Code}\r\n aria-label={ariaLabel}\r\n >\r\n {props.removePromoText}\r\n </Button>\r\n </div>\r\n );\r\n })\r\n }\r\n </>\r\n );\r\n };\r\n}\r\n\r\n// @ts-expect-error\r\nexport const PromoCodeComponent: React.FunctionComponent<IPromoCodeProps> = msdyn365Commerce.createComponentOverride<IPromoCodeComponent>(\r\n 'PromoCode',\r\n { component: PromoCode, ...PromoCodeComponentActions }\r\n);\r\n\r\n\r\nexport default PromoCodeComponent;\r\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { PriceComponent } from '@msdyn365-commerce/components';\nimport { IComponentProps } from '@msdyn365-commerce/core';\nimport { ICartState } from '@msdyn365-commerce/global-state';\nimport { Coupon } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport {\n Button,\n format,\n getPayloadObject,\n getTelemetryAttributes,\n IPayLoad,\n ITelemetryContent,\n TelemetryConstant\n} from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nexport interface IPromoCodeProps extends IComponentProps<{}> {\n cart: ICartState | undefined;\n promoCodeHeadingText: string;\n appliedPromoCodeHeadingText: string;\n removePromoAriaLabelFormat: string;\n promoPlaceholderText: string;\n promoCodeApplyButtonText: string;\n collapseTimeOut: number;\n removePromoText: string;\n invalidPromoCodeErrorText: string;\n failedToAddPromoCodeErrorText: string;\n duplicatePromoCodeErrorText: string;\n failedToRemovePromoCodeErrorText: string;\n\n /**\n * The telemetry content\n */\n telemetryContent?: ITelemetryContent;\n promoCodeApplyCallback?(): void;\n}\n\ninterface IPromoCodeState {\n isCollapseOpen: boolean;\n promoCodeInputValue: string;\n error: string;\n canApply: boolean;\n}\n\n/**\n *\n * The PromoCode component renders the promocode section.\n * @extends {React.PureComponent<IRefineSubmenuProps>}\n */\nclass PromoCode extends React.Component<IPromoCodeProps, IPromoCodeState> {\n private readonly payLoad: IPayLoad;\n\n constructor(props: IPromoCodeProps, state: IPromoCodeState) {\n super(props);\n this.payLoad = getPayloadObject('click', this.props.telemetryContent!, TelemetryConstant.ApplyPromoCode);\n this.state = {\n isCollapseOpen: false,\n promoCodeInputValue: '',\n error: '',\n canApply: false\n };\n }\n\n public shouldComponentUpdate(nextProps: IPromoCodeProps, nextState: IPromoCodeState): boolean {\n if (this.state === nextState && this.props.data === nextProps.data) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element {\n return (\n <div>\n <div className='msc-promo-code-heading'>{this.props.promoCodeHeadingText}</div>\n {this._renderForm(this.props.promoPlaceholderText, this.props.promoCodeApplyButtonText, this.props.cart)}\n <p className={this.state.error ? 'msc-alert-danger' : ''} aria-live='assertive'>\n {this.state.error}\n </p>\n {this._renderAppliedPromoCode(this.props)}\n </div>\n );\n }\n\n private readonly _onInputChangeHandler = (e: React.ChangeEvent<HTMLInputElement>) => {\n const error = e.target.value === '' ? '' : this.state.error;\n this.setState({\n promoCodeInputValue: e.target.value.trim(),\n error,\n canApply: !!e.target.value\n });\n };\n\n private readonly _applyPromotion = (cartState: ICartState | undefined) => {\n if (!cartState || !cartState.cart) {\n return;\n }\n const appliedPromo = this.state.promoCodeInputValue;\n\n cartState\n .addPromoCode({ promoCode: appliedPromo })\n .then(result => {\n if (result.status === 'SUCCESS') {\n // Show success text\n this.setState({ promoCodeInputValue: '', error: '', canApply: false });\n } else if (result.substatus === 'ALREADYADDED') {\n this.setState({ error: this.props.duplicatePromoCodeErrorText });\n } else {\n this.setState({ error: this.props.invalidPromoCodeErrorText });\n }\n })\n .catch(error => {\n this.setState({ error: this.props.failedToAddPromoCodeErrorText });\n });\n };\n\n /**\n * On Submit function.\n * @param cartState -Cartstate.\n * @returns Apply promotion.\n */\n private readonly _onSubmitHandler = (cartState: ICartState | undefined) => (event: React.FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n this._applyPromotionHandler(cartState);\n };\n\n /**\n * On apply promotion function.\n * @param cartState -Cartstate.\n * @returns Apply promotion.\n */\n private readonly _applyPromotionHandler = (cartState: ICartState | undefined) => () => {\n this._applyPromotion(cartState);\n };\n\n private readonly _renderForm = (promoPlaceholderText: string, promoCodeApplyButtonText: string, cartState: ICartState | undefined) => {\n const attributes = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\n\n return (\n <form onSubmit={this._onSubmitHandler(cartState)} className='msc-promo-code__form-container'>\n <div className='msc-promo-code__group'>\n <input\n className='msc-promo-code__input-box'\n onChange={this._onInputChangeHandler}\n value={this.state.promoCodeInputValue}\n placeholder={promoPlaceholderText}\n />\n <Button\n title={promoCodeApplyButtonText}\n className='msc-promo-code__apply-btn btn'\n onClick={this._applyPromotionHandler(cartState)}\n disabled={!this.state.canApply}\n {...attributes}\n >\n {promoCodeApplyButtonText}\n </Button>\n </div>\n </form>\n );\n };\n\n private readonly _removePromotion = (cartState: ICartState | undefined, event: React.MouseEvent) => {\n if (!cartState) {\n return;\n }\n const code = event.currentTarget.getAttribute('data-value') || '';\n cartState\n .removePromoCodes({\n promoCodes: [code]\n })\n .then(result => {\n if (result.status === 'SUCCESS') {\n this.setState({ error: '' });\n }\n })\n .catch(() => {\n this.setState({ error: this.props.failedToRemovePromoCodeErrorText });\n });\n };\n\n private readonly _calculateDiscount = (code: string, cartState: ICartState | undefined) => {\n if (!cartState || !cartState.cart || !cartState.cart.CartLines || cartState.cart.CartLines.length === 0 || !code) {\n return;\n }\n let discountAmount = 0;\n for (const line of cartState.cart.CartLines) {\n if (line.DiscountLines) {\n for (const discountLine of line.DiscountLines) {\n if (discountLine.DiscountCode === code) {\n discountAmount += discountLine.DiscountCost!;\n }\n }\n }\n }\n return discountAmount * -1;\n };\n\n private readonly _renderAppliedPromoCode = (props: IPromoCodeProps) => {\n if (!props.cart || !props.cart.cart || !props.cart.cart.Coupons || props.cart.cart.Coupons.length === 0) {\n return;\n }\n\n const removePromotionHandler = (event: React.MouseEvent<HTMLElement>) => {\n this._removePromotion(props.cart, event);\n };\n\n const promoCodTotalDiscount = props.cart.cart.Coupons.reduce((count: number, coupon: Coupon) => {\n return count + (this._calculateDiscount(coupon.Code || '', props.cart) || 0);\n }, 0);\n\n return (\n <>\n <div className='msc-promo-code__discount'>\n <div className='msc-promo-code__discount-heading'>{this.props.appliedPromoCodeHeadingText}</div>\n <PriceComponent\n data={{\n price: {\n CustomerContextualPrice: promoCodTotalDiscount\n }\n }}\n context={props.context}\n id={props.id}\n typeName={props.typeName}\n className='msc-promo-code__discount-value'\n />\n </div>\n {props.cart.cart.Coupons.map((coupon: Coupon) => {\n const ariaLabel = props.removePromoAriaLabelFormat\n ? format(props.removePromoAriaLabelFormat, props.removePromoText, coupon.Code)\n : '';\n\n return (\n <div key={coupon.Code} className='msc-promo-code__line-container'>\n <div className='msc-promo-code__line-value'>\n {coupon.Code}{' '}\n <PriceComponent\n data={{\n price: {\n CustomerContextualPrice: this._calculateDiscount(coupon.Code || '', props.cart)\n }\n }}\n context={props.context}\n id={props.id}\n typeName={props.typeName}\n className='msc-promo-code__line-discount-value'\n />\n </div>\n <Button\n title={props.removePromoText}\n className='msc-promo-code__line__btn-remove'\n onClick={removePromotionHandler}\n data-value={coupon.Code}\n aria-label={ariaLabel}\n >\n {props.removePromoText}\n </Button>\n </div>\n );\n })}\n </>\n );\n };\n}\n\nexport default PromoCode;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { CartLinePriceEditor, ICartLinePriceEditorResources, PriceComponent } from '@msdyn365-commerce/components';\nimport MsDyn365, {\n IComponentProps,\n IGridSettings,\n IImageSettings,\n Image,\n isChannelTypeB2B,\n msdyn365Commerce\n} from '@msdyn365-commerce/core';\nimport { ICartState } from '@msdyn365-commerce/global-state';\nimport {\n CartLine,\n ChannelDeliveryOptionConfiguration,\n DiscountLine,\n DiscountLineType,\n ProductCatalog,\n ProductDimensionType,\n SalesLine,\n SimpleProduct\n} from '@msdyn365-commerce/retail-proxy';\nimport { ArrayExtensions, StringExtensions, getFallbackImageUrl, validateCatalogId } from '@msdyn365-commerce-modules/retail-actions';\nimport { getPayloadObject, getTelemetryAttributes, IncrementalQuantity, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport classNames from 'classnames';\nimport * as React from 'react';\n\n/**\n * ICartlineResourceString: Interface for specifying the\n * resource strings that the component needs.\n */\nexport interface ICartlineResourceString {\n /**\n * Display string for discount label.\n */\n discountStringText: string;\n\n /**\n * String for size key.\n */\n sizeString: string;\n\n /**\n * String for color key.\n */\n colorString: string;\n\n /**\n * String associated with the configuration product dimension.\n */\n configString: string;\n\n /**\n * String for style key.\n */\n styleString: string;\n\n /**\n * String for amount key.\n */\n amountString?: string;\n\n /**\n * Display string for quantity label.\n */\n quantityDisplayString: string;\n\n /**\n * Display string for quantity label.\n */\n inputQuantityAriaLabel: string;\n\n /**\n * Aria label for the decrement button in quantity component.\n */\n decrementButtonAriaLabel: string;\n\n /**\n * Aria label for the increment button in quantity component.\n */\n incrementButtonAriaLabel: string;\n\n /**\n * Original text screenreader.\n */\n originalPriceText: string;\n\n /**\n * Current text screenreader.\n */\n currentPriceText: string;\n\n /**\n * Shipping Charges Text.\n */\n shippingChargesText: string;\n\n /**\n * Price Editor Charges Text.\n */\n priceEditorResources?: ICartLinePriceEditorResources;\n\n /**\n * Sales agreement price prompt text.\n */\n salesAgreementPricePrompt?: string;\n\n /**\n * Shipping text.\n */\n shippingText?: string;\n\n /**\n * Confirmed Ship Date Label.\n */\n confirmedShipDateLabel?: string;\n\n /**\n * Request Delivery Date Label.\n */\n requestDeliveryDateLabel?: string;\n}\n\n/**\n * Represents cart line data interface.\n */\ninterface ICartLineData {\n cartLine: CartLine | SalesLine;\n cartState?: ICartState;\n product?: SimpleProduct;\n catalogs?: ProductCatalog[];\n}\n\n/**\n * ICartLineProps: The props required to render cartLineitem.\n */\nexport interface ICartLineProps extends IComponentProps<ICartLineData> {\n /**\n * The flag to change the quantity component from interactible to static.\n */\n disableQuantityInteractivity?: boolean;\n\n /**\n * The primary image url.\n */\n primaryImageUrl?: string;\n\n /**\n * The product url.\n */\n productUrl?: string;\n\n /**\n * GridSettings for the product image in cartLine.\n */\n gridSettings: IGridSettings;\n\n /**\n * ImageSettings for the product image in cartLine.\n */\n imageSettings: IImageSettings;\n\n /**\n * Boolean flag to indicate if the item is out of stock.\n */\n isOutOfStock?: boolean;\n\n /**\n * Flag to make quantity section editable.\n */\n isQuantityEditable?: boolean;\n\n /**\n * Max quantity for line item.\n */\n maxQuantity?: number;\n\n /**\n * Current quantity for line item.\n */\n currentQuantity?: number;\n\n /**\n * Resource string for the component.\n */\n resources: ICartlineResourceString;\n\n /**\n * SalesLine flag.\n */\n isSalesLine?: boolean;\n\n /**\n * Error message to show in place of quantity.\n */\n errorMessage?: string;\n\n /**\n * Inventory information label.\n */\n inventoryInformationLabel?: string;\n\n /**\n * Inventory information class name.\n */\n inventoryLabelClassName?: string;\n\n /**\n * Flag to show/hide shipping charges for line items.\n */\n showShippingChargesForLineItems?: boolean;\n\n /**\n * Boolean flag to indicate if cart state status is ready.\n */\n isCartStateReady?: boolean;\n\n /**\n * Chanel Delivery Option configuration is from api.\n */\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\n\n /**\n * The telemetry content.\n */\n telemetryContent?: ITelemetryContent;\n\n /**\n * The cart line delivery location.\n */\n deliveryLocation?: string;\n\n /**\n * Quantity onChange callback.\n */\n quantityOnChange?(cartLine: CartLine, newQuantity: number): boolean;\n priceCurrency?: string;\n\n /**\n * Sales line confirmed ship date.\n */\n confirmedShipDate?: string;\n\n /**\n * Sales line request delivery date.\n */\n requestDeliveryDate?: string;\n}\n\n/**\n * Represents dimensions strings.\n */\ninterface IDimensionStrings {\n /**\n * String for size key.\n */\n sizeString: string;\n\n /**\n * String for color key.\n */\n colorString: string;\n\n /**\n * String associated with the configuration product dimension.\n */\n configString: string;\n\n /**\n * String for style key.\n */\n styleString: string;\n\n /**\n * String for amount key.\n */\n amountString?: string;\n}\n\n/**\n * Renders catalog label for the cart line.\n * @param props - Cart line props.\n * @returns Catalog label.\n */\nconst CatalogLabelComponent: React.FC<ICartLineProps> = (props: ICartLineProps) => {\n const catalogId = props.data.cartLine.CatalogId;\n validateCatalogId(catalogId);\n\n if (!isChannelTypeB2B(props.context.actionContext.requestContext) || !catalogId || !ArrayExtensions.hasElements(props.data.catalogs)) {\n return null;\n }\n\n const catalog = props.data.catalogs.find(item => item.RecordId === catalogId);\n\n if (!catalog || !catalog.Name) {\n return null;\n }\n\n return <div className='msc-cart-line__catalog-label'>{catalog.Name}</div>;\n};\n\nconst cartLineItemFunctions = {\n /**\n * Render product dimensions.\n * @param product - Product data.\n * @param dimensionStrings - Dimension strings interface.\n * @returns JSX Element.\n */\n renderProductDimensions: (product: SimpleProduct, dimensionStrings: IDimensionStrings) => {\n if (!product.Dimensions) {\n return [];\n }\n\n return product.Dimensions.map(productDimension => {\n if (productDimension.DimensionTypeValue === ProductDimensionType.Color) {\n return (\n <div key={`${product.RecordId}ProductDimensions1`} className='msc-cart-line__product-variant-item'>\n <span className='msc-cart-line__product-variant-color'>\n {dimensionStrings.colorString}\n {': '}\n <span className='name'>{productDimension.DimensionValue?.Value}</span>\n </span>\n </div>\n );\n }\n\n if (productDimension.DimensionTypeValue === ProductDimensionType.Configuration) {\n return (\n <div key={`${product.RecordId}ProductDimensions2`} className='msc-cart-line__product-variant-item'>\n <span className='msc-cart-line__product-configuration'>\n {dimensionStrings.configString}\n {': '}\n <span className='name'>{productDimension.DimensionValue?.Value}</span>\n </span>\n </div>\n );\n }\n\n if (productDimension.DimensionTypeValue === ProductDimensionType.Size) {\n return (\n <div key={`${product.RecordId}ProductDimensions3`} className='msc-cart-line__product-variant-item'>\n <span className='msc-cart-line__product-variant-size'>\n {dimensionStrings.sizeString}\n {': '}\n <span className='name'>{productDimension.DimensionValue?.Value}</span>\n </span>\n </div>\n );\n }\n\n if (productDimension.DimensionTypeValue === ProductDimensionType.Style) {\n return (\n <div key={`${product.RecordId}ProductDimensions4`} className='msc-cart-line__product-variant-item'>\n <span className='msc-cart-line__product-variant-style'>\n {product.IsGiftCard ? dimensionStrings.amountString : dimensionStrings.styleString}\n {': '}\n <span className='name'>{productDimension.DimensionValue?.Value}</span>\n </span>\n </div>\n );\n }\n return null;\n });\n },\n\n /**\n * Gets the react node for product unit of price display.\n * @param props - The cart line props.\n * @returns The node representing markup for unit of measure component.\n */\n renderProductUnitPrice: (props: ICartLineProps) => {\n if (!props.data.cartLine.Price) {\n return null;\n }\n const zeroQuantity: number = 0;\n return (\n <div className='msc-cart-line__product-unit-price'>\n <span>\n <PriceComponent\n data={\n props.data.cartLine.Quantity && props.data.cartLine.Quantity > zeroQuantity\n ? {\n price: {\n CustomerContextualPrice: props.data.cartLine.Price\n }\n }\n : {\n price: {\n CustomerContextualPrice: props.data.cartLine.Price\n }\n }\n }\n context={props.context}\n id={props.id}\n typeName={props.typeName}\n currencyCode={props.priceCurrency}\n />\n </span>\n </div>\n );\n },\n\n /**\n * Render discount lines.\n * @param props - The cart line props.\n * @returns JSX element.\n */\n renderDiscountLines: (props: ICartLineProps) => {\n if (!props.data.cartLine.DiscountLines || !ArrayExtensions.hasElements(props.data.cartLine.DiscountLines)) {\n return null;\n }\n\n /**\n * Get the updated discount percentage.\n * @param discountLine - The discount line.\n * @param cartLine - The cart line.\n * @returns The updated discount percentage.\n */\n const discountPercent = (discountLine: DiscountLine, cartLine: CartLine): number => {\n const numberZero = 0;\n const decimalPrecision = 2;\n const fullPercentage = 100;\n let updatedPercent: number = discountLine.Percentage ?? numberZero;\n\n if (\n (discountLine.Percentage === numberZero ||\n (discountLine.DiscountLineTypeValue && discountLine.DiscountLineTypeValue === DiscountLineType.TenderTypeDiscount)) &&\n cartLine.Price &&\n cartLine.Price > numberZero &&\n cartLine.Quantity &&\n cartLine.Quantity !== numberZero\n ) {\n const effectiveAmount = discountLine.EffectiveAmount ?? numberZero;\n updatedPercent = Number(\n ((effectiveAmount / (cartLine.Price * cartLine.Quantity)) * fullPercentage).toFixed(decimalPrecision)\n );\n }\n\n return updatedPercent;\n };\n\n return props.data.cartLine.DiscountLines.map((discountLine, index) => {\n return (\n <div key={discountLine.OfferId ?? index} className='msc-cart-line__product-discount'>\n <span>{discountLine.OfferName ? discountLine.OfferName : ''}</span>\n <span className='msc-cart-line-item-product-discount-price'>\n <PriceComponent\n data={\n props.isSalesLine\n ? {\n price: {\n // @ts-expect-error -- Auto suppressed.\n CustomerContextualPrice: props.data.cartLine.PeriodicDiscount\n }\n }\n : {\n price: {\n CustomerContextualPrice: discountLine.EffectiveAmount,\n BasePrice: discountLine.EffectiveAmount\n }\n }\n }\n context={props.context}\n id={props.id}\n typeName={props.typeName}\n currencyCode={props.priceCurrency}\n />\n </span>\n <span className='msc-cart-line__product-discount-percentage'>\n {` (${discountLine.Percentage !== undefined ? discountPercent(discountLine, props.data.cartLine) : ''}%)`}\n </span>\n </div>\n );\n });\n },\n\n /**\n * Render inventory label.\n * @param props - The cart line props.\n * @returns JSX element.\n */\n renderInventoryLabel: (props: ICartLineProps) => {\n const inventoryCssName = props.inventoryLabelClassName\n ? `msc-cart-line__product-inventory-label ${props.inventoryLabelClassName}`\n : 'msc-cart-line__product-inventory-label';\n\n return <p className={inventoryCssName}>{props.inventoryInformationLabel}</p>;\n },\n\n /**\n * Render shipping label.\n * @param props - The cart line props.\n * @returns JSX element.\n */\n renderShippingLabel: (props: ICartLineProps) => {\n const pickupDeliveryModeCode = props.context.request.channel?.PickupDeliveryModeCode;\n const channelDeliveryOptionConfig = props.channelDeliveryOptionConfig;\n const cartline = props.data.cartLine;\n let hasShippingMethod = false;\n if (channelDeliveryOptionConfig !== undefined) {\n hasShippingMethod = !!(\n cartline.DeliveryMode &&\n channelDeliveryOptionConfig.PickupDeliveryModeCodes?.some(deliveryMode => deliveryMode !== cartline.DeliveryMode)\n );\n } else {\n hasShippingMethod = !!(cartline.DeliveryMode && cartline.DeliveryMode !== pickupDeliveryModeCode);\n }\n if (!hasShippingMethod) {\n return undefined;\n }\n\n const shippingChargeLines = (cartline.ChargeLines ?? []).filter(chargeLine => chargeLine.IsShipping);\n\n if (!ArrayExtensions.hasElements(shippingChargeLines)) {\n return undefined;\n }\n\n const defaultCharge: number = 0;\n const freightFee = shippingChargeLines.reduce((chargeTotal, chargeLine) => {\n return chargeTotal + (chargeLine.CalculatedAmount ?? defaultCharge);\n }, defaultCharge);\n\n const priceComponent = (\n <PriceComponent\n data={{\n price: {\n CustomerContextualPrice: freightFee\n }\n }}\n freePriceText='Free'\n context={props.context}\n id={props.id}\n typeName={props.typeName}\n className='msc-cart-line__freight-actual'\n currencyCode={props.priceCurrency}\n />\n );\n return (\n <>\n <label className='msc-cart-line__freight-label'>{`${props.resources.shippingChargesText}:`}</label>\n <span className='shipping-value'>{priceComponent}</span>\n </>\n );\n },\n\n /**\n * Render other charges.\n * @param props - The cart line props.\n * @returns JSX element.\n */\n renderOtherCharges: (props: ICartLineProps) => {\n const cartline = props.data.cartLine;\n const otherCharges = cartline.ChargeLines?.filter(chargeline => !chargeline.IsShipping);\n\n return (\n otherCharges?.map((otherCharge, index) => {\n const itemIndex = index;\n return otherCharge.CalculatedAmount ? (\n <div className='msc-cart-line__other-charges' key={itemIndex}>\n <label className='msc-cart-line__other-charges-label'>{`${String(otherCharge.Description)}:`}</label>\n <span className='other-charge-value'>\n <PriceComponent\n data={{\n price: {\n CustomerContextualPrice: otherCharge.CalculatedAmount\n }\n }}\n context={props.context}\n id={props.id}\n typeName={props.typeName}\n className='msc-cart-line__other-charges-actual'\n currencyCode={props.priceCurrency}\n />\n </span>\n </div>\n ) : (\n ''\n );\n }) ?? undefined\n );\n },\n\n /**\n * Render the sales agreement prompt.\n * @param props - The ICartLineProps.\n * @returns The JSX.Element.\n */\n renderSalesAgreementPrompt: (props: ICartLineProps): JSX.Element | null => {\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers -- We use 0 to indicate no sales agreement applied on the cart line.\n if (props.data.cartLine.SalesAgreementLineRecordId === 0) {\n return null;\n }\n return <div className='msc-cart-line__sales-agreement-prompt'>{props.resources.salesAgreementPricePrompt}</div>;\n },\n\n renderConfirmedShipDate: (props: ICartLineProps) => {\n if (!props.isSalesLine || props.confirmedShipDate === undefined || StringExtensions.isNullOrEmpty(props.confirmedShipDate)) {\n return null;\n }\n return (\n <div className='msc-cart-line__confirmed-ship-date'>\n <span className='msc-cart-line__confirmed-ship-date-label'>{props.resources.confirmedShipDateLabel}</span>\n <span className='msc-cart-line__confirmed-ship-date-value'>{props.confirmedShipDate}</span>\n </div>\n );\n },\n\n renderRequestDeliveryDate: (props: ICartLineProps) => {\n if (!props.isSalesLine || props.requestDeliveryDate === undefined || StringExtensions.isNullOrEmpty(props.requestDeliveryDate)) {\n return null;\n }\n return (\n <div className='msc-cart-line__request-delivery-date'>\n <span className='msc-cart-line__request-delivery-date-label'>{props.resources.requestDeliveryDateLabel}</span>\n <span className='msc-cart-line__request-delivery-date-value'>{props.requestDeliveryDate}</span>\n </div>\n );\n }\n};\n\n/**\n * Render cartline component.\n * @param props - The cart line props.\n * @returns JSX element.\n */\n// eslint-disable-next-line no-redeclare\nconst CartLine: React.FC<ICartLineProps> = (props: ICartLineProps) => {\n const { isSalesLine, productUrl, resources } = props;\n const { product, cartLine } = props.data;\n\n const destructDimensionStrings = {\n sizeString: resources.sizeString,\n colorString: resources.colorString,\n styleString: resources.styleString,\n configString: resources.configString,\n amountString: resources.amountString\n };\n\n const fallbackImageUrl =\n product &&\n getFallbackImageUrl(\n product.ItemId,\n props.context.actionContext.requestContext.apiSettings,\n props.context.request.app?.config?.OmniChannelMedia\n );\n const productDimensions = product && cartLineItemFunctions.renderProductDimensions(product, destructDimensionStrings);\n const renderProductUnitPrice = cartLineItemFunctions.renderProductUnitPrice(props);\n const imageSettings = props.imageSettings;\n if (imageSettings) {\n imageSettings.cropFocalRegion = true;\n }\n const renderDiscountLines = cartLineItemFunctions.renderDiscountLines(props);\n const renderInventoryLabel = cartLineItemFunctions.renderInventoryLabel(props);\n const renderShippingLabel = cartLineItemFunctions.renderShippingLabel(props);\n const renderOtherCharges = cartLineItemFunctions.renderOtherCharges(props);\n const renderConfirmedShipDate = cartLineItemFunctions.renderConfirmedShipDate(props);\n const renderRequestDeliveryDate = cartLineItemFunctions.renderRequestDeliveryDate(props);\n const renderSalesAgreementPrompt = cartLineItemFunctions.renderSalesAgreementPrompt(props);\n const payLoad = getPayloadObject('click', props.telemetryContent!, '', product?.RecordId.toString());\n const productAttribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\n const productName = product?.Name ?? cartLine.Description;\n const imgeClassName = props.data.cartLine.IsInvoiceLine ? 'msc-cart-line__invoice-image' : 'msc-cart-line__product-image';\n const cartLineContentClassName = props.data.cartLine.IsInvoiceLine ? 'msc-cart-line__invoice-content' : 'msc-cart-line__content';\n\n /**\n * Render other charges.\n * @param newValue - The cart line props.\n * @returns Boolean.\n */\n const onChange = (newValue: number): boolean => {\n if (props.quantityOnChange) {\n return props.quantityOnChange(props.data.cartLine, newValue);\n }\n return true;\n };\n\n /**\n * Generate error message.\n * @returns JSX element.\n */\n const generateErrorMessage = (): JSX.Element | null => {\n if (props.errorMessage) {\n return (\n <div className='msc-alert__header'>\n <span className='msi-exclamation-triangle' />\n <span>{props.errorMessage}</span>\n </div>\n );\n }\n\n return null;\n };\n\n /**\n * Render Saving component.\n * @returns JSX element.\n */\n const renderSaving = (): JSX.Element | null => {\n if (!props.data.cartLine.DiscountAmount) {\n return null;\n }\n const discountAmountZero: number = 0;\n\n if (props.data.cartLine.DiscountAmount > discountAmountZero) {\n return (\n <>\n <span className='msc-cart-line__product-savings-label'>{`${props.resources.discountStringText || 'Discount'}`}</span>\n <PriceComponent\n data={\n props.isSalesLine\n ? {\n price: {\n // @ts-expect-error -- Auto suppressed.\n CustomerContextualPrice: props.data.cartLine.PeriodicDiscount\n }\n }\n : {\n price: {\n CustomerContextualPrice: props.data.cartLine.DiscountAmount,\n BasePrice: props.data.cartLine.DiscountAmount\n }\n }\n }\n context={props.context}\n id={props.id}\n typeName={props.typeName}\n className='msc-cart-line__product-savings-text'\n currencyCode={props.priceCurrency}\n />\n </>\n );\n }\n return null;\n };\n\n /**\n * Gets the react node for product unit of measure display.\n * @returns The node representing markup for unit of measure component.\n */\n const renderUnitOfMeasure = () => {\n if (props.data.cartLine.IsInvoiceLine) {\n return null;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Do not need type check for appsettings\n if (!props.context.app.config.unitOfMeasureDisplayType || props.context.app.config.unitOfMeasureDisplayType === 'none') {\n return undefined;\n }\n\n if (!product || !product.DefaultUnitOfMeasure) {\n return undefined;\n }\n\n return (\n <div className='msc-cart-line__product-unit-of-measure'>\n <span>{product.DefaultUnitOfMeasure}</span>\n </div>\n );\n };\n\n /**\n * Generate quantity and price component.\n * @returns JSX element.\n */\n const generateQuantityAndPrice = (): JSX.Element[] | null => {\n const nodes = [];\n const defaultMaxQuantity: number = 10;\n const singleQuantity: number = 1;\n const unitOfMeasure = renderUnitOfMeasure();\n\n // No quantity selector for invoice line\n if (!props.data.cartLine.IsInvoiceLine) {\n if (props.data.product && props.isQuantityEditable) {\n nodes.push(\n <div className='msc-cart-line__product-quantity'>\n <div className='msc-cart-line__product-quantity-label'>{resources.quantityDisplayString}</div>\n\n {generateErrorMessage()}\n\n <IncrementalQuantity\n id={`msc-cart-line__quantity_${props.data.product.RecordId}-\n ${String(props.data.cartLine.DeliveryMode)}-${String(props.data.cartLine.LineId)}`}\n max={props.maxQuantity ?? defaultMaxQuantity}\n currentCount={props.currentQuantity}\n onChange={onChange}\n inputQuantityAriaLabel={resources.inputQuantityAriaLabel}\n decrementButtonAriaLabel={resources.decrementButtonAriaLabel}\n incrementButtonAriaLabel={resources.incrementButtonAriaLabel}\n key={props.data.cartLine.LineId}\n disabled={!props.isCartStateReady}\n isGiftCard={props.data.product.IsGiftCard ?? props.isOutOfStock}\n telemetryContent={props.telemetryContent}\n />\n {unitOfMeasure}\n </div>\n );\n } else {\n nodes.push(\n <div\n className={classNames('msc-cart-line__quantity', {\n 'single-quantity': props.data.cartLine.Quantity === singleQuantity\n })}\n >\n {unitOfMeasure}\n <label className='quantity-label' htmlFor='quantity'>\n {resources.quantityDisplayString}\n {': '}\n </label>\n\n {generateErrorMessage()}\n\n <span className='quantity-value'>{props.data.cartLine.Quantity}</span>\n </div>\n );\n }\n }\n\n nodes.push(\n <div className='msc-cart-line__product-savings'>\n <PriceComponent\n data={\n isSalesLine\n ? {\n price: {\n CustomerContextualPrice: (props.data.cartLine as SalesLine).NetAmountWithAllInclusiveTax,\n BasePrice: (props.data.cartLine as SalesLine).GrossAmount\n }\n }\n : {\n price: {\n CustomerContextualPrice: (props.data.cartLine as CartLine).ExtendedPrice,\n BasePrice: props.data.cartLine.NetPrice\n }\n }\n }\n context={props.context}\n id={props.id}\n typeName={props.typeName}\n className='msc-cart-line__product-savings-actual'\n originalPriceText={resources.originalPriceText}\n currentPriceText={resources.currentPriceText}\n currencyCode={props.priceCurrency}\n />\n {renderSaving()}\n {props.isOutOfStock ? renderInventoryLabel : null}\n </div>\n );\n\n return nodes;\n };\n\n const _renderStoreLocation = (): JSX.Element | null => {\n if (cartLine && cartLine.FulfillmentStoreId) {\n return (\n <div className='msc-cart-line__content__bopis-method'>\n <span className='pick-up'>{props.deliveryLocation}</span>\n </div>\n );\n } else {\n return (\n <div className='msc-cart-line__content__bopis-method'>\n <span className='shipping'>{props.deliveryLocation}</span>\n </div>\n );\n }\n };\n\n return (\n <div className='msc-cart-line'>\n {MsDyn365.isBrowser ? (\n <a className={imgeClassName} href={productUrl} aria-label={productName} role='link'>\n <Image\n requestContext={props.context.actionContext.requestContext}\n aria-hidden='true'\n src={props.primaryImageUrl ?? 'empty'}\n fallBackSrc={fallbackImageUrl}\n altText={productName}\n gridSettings={props.gridSettings}\n imageSettings={imageSettings}\n loadFailureBehavior='empty'\n />\n </a>\n ) : null}\n <div className={cartLineContentClassName}>\n <div className='msc-cart-line__product'>\n <CatalogLabelComponent {...props} />\n {MsDyn365.isBrowser ? (\n <a className='msc-cart-line__product-title' href={productUrl} {...productAttribute}>\n {productName}\n </a>\n ) : null}\n {ArrayExtensions.hasElements(productDimensions) ? (\n <div className='msc-cart-line__product-variants'>{productDimensions}</div>\n ) : (\n ''\n )}\n <div className='msc-cart-line__product-price'>\n <PriceComponent\n data={\n isSalesLine\n ? {\n price: {\n CustomerContextualPrice: (props.data.cartLine as SalesLine).NetAmountWithAllInclusiveTax,\n BasePrice: (props.data.cartLine as SalesLine).GrossAmount\n }\n }\n : {\n price: {\n CustomerContextualPrice: (props.data.cartLine as CartLine).ExtendedPrice,\n BasePrice: props.data.cartLine.NetPrice\n }\n }\n }\n context={props.context}\n id={props.id}\n typeName={props.typeName}\n className='msc-cart-line__product-discount-value'\n currencyCode={props.priceCurrency}\n />\n {renderConfirmedShipDate}\n {renderRequestDeliveryDate}\n {renderUnitOfMeasure()}\n </div>\n {renderProductUnitPrice}\n {renderInventoryLabel}\n {renderDiscountLines}\n {props.showShippingChargesForLineItems && <div className='msc-cart-line__freight'>{renderShippingLabel}</div>}\n {renderOtherCharges}\n {renderSalesAgreementPrompt}\n </div>\n {generateQuantityAndPrice()}\n {renderSalesAgreementPrompt}\n {props.data.cartLine.IsInvoiceLine && props.data.cartState && props.resources.priceEditorResources && (\n <CartLinePriceEditor\n className='msc-cart-line__price-editor-container'\n context={props.context}\n resources={props.resources.priceEditorResources}\n cartState={props.data.cartState}\n cartLine={props.data.cartLine}\n />\n )}\n {_renderStoreLocation()}\n </div>\n </div>\n );\n};\n\n// @ts-expect-error\nexport const CartLineItemComponent: React.FunctionComponent<ICartLineProps> = msdyn365Commerce.createComponentOverride<ICartline>(\n 'CartLineItem',\n {\n component: CartLine,\n ...cartLineItemFunctions\n }\n);\n\nexport default CartLineItemComponent;\n","export enum SupersessionKey {\r\n SupersededId = 'superseded-from-id',\r\n SupersededName = 'superseded-from-name',\r\n Inventory = 'inventory',\r\n InventoryBreakdown = \"InventoryByWarehouse\"\r\n}\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<ICartState>,\n telemetry: ITelemetry,\n propsContext: ICoreContext,\n shouldRetry: boolean = true\n): Promise<CartLineValidationResultsByLineId | undefined> {\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<boolean> {\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<ICartActionResult | undefined> {\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","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { RatingsSummary } from '@msdyn365-commerce/commerce-entities';\nimport { format, INodeProps, Progress } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\nexport interface IHistogramItemsProps {\n ratingsSummary: RatingsSummary;\n resources: IHistogramItemsResources;\n locale: string;\n onClick(stars: number): void;\n}\n\nexport interface IHistogramItemsResources {\n barItemAriaLabel: string;\n}\n\nexport interface IHistogramItemViewProps {\n starLabel: React.ReactElement;\n bar: React.ReactElement;\n percentage: React.ReactElement;\n buttonProps: INodeProps;\n}\n\n/**\n * CartLineItems component.\n */\n\nexport const HistogramItems = (props: IHistogramItemsProps): IHistogramItemViewProps[] => {\n const { ratingsSummary } = props;\n const totalRatingsCount: number = ratingsSummary.totalRatingsCount || 0;\n if (totalRatingsCount === 0) {\n return [];\n }\n return [\n renderItem(props, 5, ratingsSummary.star5Count, totalRatingsCount),\n renderItem(props, 4, ratingsSummary.star4Count, totalRatingsCount),\n renderItem(props, 3, ratingsSummary.star3Count, totalRatingsCount),\n renderItem(props, 2, ratingsSummary.star2Count, totalRatingsCount),\n renderItem(props, 1, ratingsSummary.star1Count, totalRatingsCount)\n ];\n};\n\nconst renderItem = (props: IHistogramItemsProps, stars: number, count?: number, totalCount?: number): IHistogramItemViewProps => {\n count = count || 0;\n totalCount = totalCount || 0;\n const percentage = totalCount === 0 ? 0 : count / totalCount;\n const formattedPercent = new Intl.NumberFormat(props.locale, { style: 'percent' }).format(percentage);\n const ariaLabel = format(props.resources.barItemAriaLabel, stars, formattedPercent);\n\n return {\n starLabel: (\n <span aria-hidden='true' className='ms-ratings-histogram__star'>\n {stars}\n </span>\n ),\n percentage: (\n <span aria-hidden='true' className='ms-ratings-histogram__percentage'>\n {formattedPercent}\n </span>\n ),\n bar: <Progress value={percentage * 100} max={100} ariaLabel={ariaLabel} className='ms-ratings-histogram__bar' />,\n buttonProps: {\n tag: 'button',\n className: 'ms-ratings-histogram__item',\n onClick: () => {\n props.onClick(stars);\n }\n }\n };\n};\n\nexport const AverageRatingNumber: React.FC<{ summary: RatingsSummary }> = (props: { summary: RatingsSummary }) => {\n return (\n <p className='ms-ratings-histogram__average'>\n {props.summary.averageRating}\n {` `}/ 5\n </p>\n );\n};\n\nexport const TotalReviews: React.FC<{ summary: RatingsSummary }> = (props: { summary: RatingsSummary }) => {\n return <p className='ms-ratings-histogram__total'>{props.summary.totalRatingsCount}</p>;\n};\n","import { AttributeTextValue, Cart } from '@msdyn365-commerce/retail-proxy';\r\nimport { AttributeTextValueClass } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport { ICartState } from '@msdyn365-commerce/global-state';\r\n\r\nconst addAttributeToCart = (attrKey: string, attrValue: string, cart: Cart): Cart => {\r\n const _cart = { ...cart };\r\n const attributeArray = _cart.AttributeValues || [];\r\n const attributeObj = {\r\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.AttributeTextValue',\r\n Name: attrKey,\r\n ExtensionProperties: [],\r\n TextValue: attrValue,\r\n TextValueTranslations: []\r\n };\r\n const attrIdx = attributeArray.findIndex(a => a.Name?.toUpperCase() === attrKey.toUpperCase());\r\n\r\n //Update existing attribute if there.\r\n if (attrIdx > -1) {\r\n (attributeArray[attrIdx] as AttributeTextValueClass).TextValue = attrValue;\r\n } else {\r\n attributeArray.push(attributeObj);\r\n }\r\n\r\n _cart.AttributeValues = attributeArray;\r\n\r\n return _cart;\r\n};\r\n\r\nconst removeAttributeFromCart = (attrKey: string, cart: Cart): Cart => {\r\n const _cart = { ...cart };\r\n const attributeArray = _cart.AttributeValues || [];\r\n const attrIdx = attributeArray.findIndex(a => a.Name?.toUpperCase() === attrKey.toUpperCase());\r\n\r\n //We can't remove attribute values for some reason, so we'll just set the value to ''\r\n if (attrIdx > -1) {\r\n (attributeArray[attrIdx] as AttributeTextValueClass).TextValue = '';\r\n }\r\n _cart.AttributeValues = attributeArray;\r\n return _cart;\r\n};\r\n\r\nconst removeWarehouseAttributes = async (\r\n cart: ICartState,\r\n authorizedWarehouseAccounts: string[],\r\n isAlternateWarehouseFeatureEnabled: boolean,\r\n customerAccNum: string | undefined\r\n): Promise<void> => {\r\n if (!cart || !cart.cart || !cart.cart.CartLines) {\r\n return;\r\n }\r\n\r\n const cartlines = cart.cart.CartLines;\r\n if (cartlines.length === 0 || cart.hasInvoiceLine) {\r\n return;\r\n }\r\n const hasAccess = isAlternateWarehouseFeatureEnabled || (customerAccNum && authorizedWarehouseAccounts.includes(customerAccNum));\r\n\r\n if (hasAccess) {\r\n return;\r\n }\r\n\r\n let changesMade = false;\r\n const updatedCartLines = cartlines.map(cartline => {\r\n let needsUpdate = false;\r\n const updatedAttributes = cartline.AttributeValues?.map((attr: AttributeTextValue) => {\r\n if (attr.Name === 'IsWarehouseOverride' && attr.TextValue !== 'false') {\r\n needsUpdate = true;\r\n return { ...attr, TextValue: 'false' };\r\n } else if (attr.Name === 'WarehouseId' && attr.TextValue !== '') {\r\n needsUpdate = true;\r\n return { ...attr, TextValue: '' };\r\n }\r\n return attr;\r\n });\r\n\r\n if (needsUpdate) {\r\n changesMade = true;\r\n return { ...cartline, AttributeValues: updatedAttributes };\r\n }\r\n return cartline;\r\n });\r\n\r\n if (!changesMade) {\r\n return;\r\n }\r\n\r\n try {\r\n await cart.updateCartLines({ updatedCartLinesObject: updatedCartLines });\r\n } catch (e) {\r\n console.error('Error removing warehouse attributes', e);\r\n }\r\n};\r\n\r\nexport { addAttributeToCart, removeAttributeFromCart, removeWarehouseAttributes };\r\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { PriceComponent } from '@msdyn365-commerce/components';\nimport { ICoreContext, ITelemetry } from '@msdyn365-commerce/core';\nimport { ICheckoutState, IGiftCardExtend } from '@msdyn365-commerce/global-state';\nimport { Cart, CartLine } from '@msdyn365-commerce/retail-proxy';\nimport { format } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nexport interface IInvoiceSummaryProps {\n orderTotalLabel: string;\n invoiceLabel: string;\n loyaltyLabel?: string;\n giftcardLabel?: string;\n context: ICoreContext;\n telemetry: ITelemetry;\n cart: Cart;\n id: string;\n typeName: string;\n freeText?: string;\n toBeCalculatedText?: string;\n checkoutState?: ICheckoutState;\n}\n\nexport interface IInvoiceSummaryLines {\n orderTotal: React.ReactNode;\n invoices: React.ReactNode;\n giftCard?: React.ReactNode;\n loyalty?: React.ReactNode;\n}\n\ninterface IInvoiceSummaryLineProps {\n label: string;\n context: ICoreContext;\n telemetry: ITelemetry;\n price?: number;\n freeText?: string;\n toBeCalculatedText?: string;\n id: string;\n typeName: string;\n cssLabel: string;\n}\n\nconst InvoiceSummaryLine: React.FC<IInvoiceSummaryLineProps> = ({\n price,\n label,\n context,\n id,\n typeName,\n toBeCalculatedText,\n freeText,\n cssLabel\n}) => {\n return (\n <p className={`msc-invoice-summary__line-${cssLabel}`}>\n <span className=\"msc-invoice-summary__label\">{label}</span>\n {price || price === 0 ? (\n <PriceComponent\n data={{\n price: { CustomerContextualPrice: price }\n }}\n freePriceText={freeText}\n context={context}\n id={id}\n typeName={typeName}\n className=\"msc-invoice-summary__value\"\n />\n ) : (\n <span className=\"msc-invoice-summary__value\">{toBeCalculatedText}</span>\n )}\n </p>\n );\n};\n\nconst _buildPaymentSummarySection = (\n props: IInvoiceSummaryProps,\n price: number | undefined,\n label: string,\n cssLabel: string\n): React.ReactNode => {\n return (\n <InvoiceSummaryLine\n price={price}\n label={label}\n context={props.context}\n id={props.id}\n typeName={props.typeName}\n toBeCalculatedText={props.toBeCalculatedText}\n freeText={props.freeText}\n telemetry={props.telemetry}\n cssLabel={cssLabel}\n />\n );\n};\n\nconst _computedLoyaltyAmount = (checkoutState: ICheckoutState): number => {\n return (checkoutState && checkoutState.loyaltyAmount) || 0;\n};\n\nconst _computeGiftCardAmount = (checkoutState: ICheckoutState, cart: Cart): number => {\n const giftCardCounter = (count: number, giftCard: IGiftCardExtend) => {\n return count + (giftCard.Balance || 0);\n };\n const giftCardTotalValue = (checkoutState.giftCardExtends || []).reduce(giftCardCounter, 0);\n const amount = (cart.TotalAmount || 0) - _computedLoyaltyAmount(checkoutState);\n return Math.min(giftCardTotalValue, amount);\n};\n\nexport const InvoiceSummary = (props: IInvoiceSummaryProps) => {\n const { TotalAmount, CartLines } = props.cart;\n const invoiceLines = CartLines?.filter(cartLine => cartLine.IsInvoiceLine);\n const reactNodes: IInvoiceSummaryLines = {\n invoices: invoiceLines?.map((invoiceLine: CartLine) => {\n return _buildPaymentSummarySection(\n props,\n invoiceLine.InvoiceAmount,\n format(props.invoiceLabel, invoiceLine.InvoiceId),\n 'invoice'\n );\n }),\n orderTotal: _buildPaymentSummarySection(props, TotalAmount, props.orderTotalLabel, 'total')\n };\n\n if (props.checkoutState) {\n const giftCardAmount = _computeGiftCardAmount(props.checkoutState, props.cart);\n const loyaltyAmount = _computedLoyaltyAmount(props.checkoutState);\n const totalAmountAfterGiftCard = (TotalAmount || 0) - giftCardAmount - loyaltyAmount;\n\n if (loyaltyAmount > 0) {\n reactNodes.loyalty = _buildPaymentSummarySection(props, -loyaltyAmount, props.loyaltyLabel || 'Loyalty amount', 'loyalty');\n }\n\n if (giftCardAmount > 0) {\n reactNodes.giftCard = _buildPaymentSummarySection(\n props,\n -giftCardAmount,\n props.giftcardLabel || 'Gift card amount',\n 'gift-card'\n );\n }\n\n reactNodes.orderTotal = _buildPaymentSummarySection(\n { ...props, freeText: undefined },\n totalAmountAfterGiftCard,\n props.orderTotalLabel,\n 'total'\n );\n }\n\n return reactNodes;\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { PriceComponent } from '@msdyn365-commerce/components';\nimport { ICoreContext, ITelemetry } from '@msdyn365-commerce/core';\nimport { ICheckoutState, IGiftCardExtend } from '@msdyn365-commerce/global-state';\nimport { Cart, ChannelConfiguration, ChannelDeliveryOptionConfiguration } from '@msdyn365-commerce/retail-proxy';\nimport * as React from 'react';\n\nexport interface IOrderSummaryProps {\n subTotalLabel: string;\n shippingLabel: string;\n taxLabel: string;\n orderTotalLabel: string;\n loyaltyLabel?: string;\n giftcardLabel?: string;\n totalDiscountsLabel: string;\n context: ICoreContext;\n telemetry: ITelemetry;\n cart: Cart;\n channelConfiguration: ChannelConfiguration;\n id: string;\n typeName: string;\n otherChargeLabel?: string;\n freeText?: string;\n toBeCalculatedText?: string;\n checkoutState?: ICheckoutState;\n retailMultiplePickUpOptionEnabled?: boolean;\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\n isTaxIncludedInPrice?: boolean;\n isShowTaxBreakup?: boolean;\n customerAccountLabel?: string;\n}\n\nexport interface IOrderSummaryLines {\n subtotal: React.ReactNode;\n shipping?: React.ReactNode;\n otherCharge?: React.ReactNode;\n tax: React.ReactNode;\n orderTotal: React.ReactNode;\n totalDiscounts?: React.ReactNode;\n giftCard?: React.ReactNode;\n loyalty?: React.ReactNode;\n customerAccount?: React.ReactNode;\n}\n\ninterface IOrderSummaryLineProps {\n label: string;\n context: ICoreContext;\n telemetry: ITelemetry;\n price?: number;\n freeText?: string;\n toBeCalculatedText?: string;\n id: string;\n typeName: string;\n cssLabel: string;\n priceCurrency?: string;\n}\n\ninterface IShippingOrderLine {\n cart: Cart;\n channelConfiguration: ChannelConfiguration;\n canShip?: boolean;\n hasDeliveryMethod?: boolean;\n hasShippingMethod?: boolean;\n freightFee?: number;\n}\n\nconst OrderSummaryLine: React.FC<IOrderSummaryLineProps> = ({\n price,\n label,\n context,\n id,\n typeName,\n toBeCalculatedText,\n freeText,\n cssLabel,\n priceCurrency\n}) => {\n return (\n <p className={`msc-order-summary__line-${cssLabel}`}>\n <span className=\"msc-order-summary__label\">{label}</span>\n {price || price === 0 ? (\n <PriceComponent\n data={{\n price: { CustomerContextualPrice: price }\n }}\n freePriceText={freeText}\n context={context}\n id={id}\n typeName={typeName}\n className=\"msc-order-summary__value\"\n currencyCode={priceCurrency}\n />\n ) : (\n <span className=\"msc-order-summary__value\">{toBeCalculatedText}</span>\n )}\n </p>\n );\n};\n\nconst _buildOrderSummarySection = (\n props: IOrderSummaryProps,\n price: number | undefined,\n cssLabel: string,\n label: string = ''\n): React.ReactNode => {\n return (\n <OrderSummaryLine\n price={price}\n label={label}\n context={props.context}\n id={props.id}\n typeName={props.typeName}\n toBeCalculatedText={props.toBeCalculatedText}\n freeText={props.freeText}\n telemetry={props.telemetry}\n cssLabel={cssLabel}\n priceCurrency={props.channelConfiguration.Currency}\n />\n );\n};\n\nconst _computedLoyaltyAmount = (checkoutState: ICheckoutState): number => {\n return (checkoutState && checkoutState.loyaltyAmount) || 0;\n};\n\nconst _computedCustomerAccountAmount = (checkoutState: ICheckoutState): number => {\n return (checkoutState && checkoutState.customerAccountAmount) || 0;\n};\n\nconst _computeGiftCardAmount = (checkoutState: ICheckoutState, cart: Cart): number => {\n const giftCardCounter = (count: number, giftCard: IGiftCardExtend) => {\n return count + (giftCard.Balance || 0);\n };\n const giftCardTotalValue = (checkoutState.giftCardExtends || []).reduce(giftCardCounter, 0);\n const amount = (cart.TotalAmount || 0) - _computedLoyaltyAmount(checkoutState);\n return Math.min(giftCardTotalValue, amount);\n};\n\nconst getDeliveryConfiguration = (\n cart: Cart,\n channelConfiguration: ChannelConfiguration,\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration,\n retailMultiplePickUpOptionEnabled?: boolean,\n isTaxIncludedInPrice?: boolean,\n isShowTaxBreakup?: boolean\n): IShippingOrderLine => {\n const pickupDeliveryModeCode = channelConfiguration && channelConfiguration.PickupDeliveryModeCode;\n const emailDeliveryModeCode = channelConfiguration && channelConfiguration.EmailDeliveryModeCode;\n const cartLines = cart.CartLines || [];\n const deliveryModes = cartLines.map(cartLine => cartLine.DeliveryMode);\n const taxOnShippingCharge = cart.TaxOnShippingCharge !== undefined ? cart.TaxOnShippingCharge : 0;\n const shippingChargeAmount = cart.ShippingChargeAmount !== undefined ? cart.ShippingChargeAmount : 0;\n\n // isTaxIncludedInPrice isShowTaxBreakup useProperties\n // False False/True shippingChargeAmount\n // True True shippingChargeAmount\n // True false shippingChargeAmount + taxOnShippingCharge\n // if either of isTaxIncludedInPrice or isShowTaxBreakup is undefined then we will execute old logic\n let freightFee: number | undefined = 0;\n if (isTaxIncludedInPrice === undefined || isShowTaxBreakup === undefined) {\n freightFee = cart.ShippingChargeAmount;\n } else {\n freightFee = isTaxIncludedInPrice && !isShowTaxBreakup ? shippingChargeAmount + taxOnShippingCharge : cart.ShippingChargeAmount;\n }\n const canShip = deliveryModes.some(\n deliveryMode =>\n !(\n deliveryMode !== '' &&\n (deliveryMode ===\n getDeliveryMode(deliveryMode, retailMultiplePickUpOptionEnabled, channelDeliveryOptionConfig, pickupDeliveryModeCode) ||\n deliveryMode === emailDeliveryModeCode)\n )\n );\n const hasDeliveryMethod = deliveryModes.some(deliveryMode => !!deliveryMode && deliveryMode !== emailDeliveryModeCode);\n const hasShippingMethod = deliveryModes.some(\n deliveryMode =>\n !!deliveryMode &&\n deliveryMode !==\n getDeliveryMode(deliveryMode, retailMultiplePickUpOptionEnabled, channelDeliveryOptionConfig, pickupDeliveryModeCode) &&\n deliveryMode !== emailDeliveryModeCode\n );\n return {\n canShip,\n hasDeliveryMethod,\n hasShippingMethod,\n freightFee\n } as IShippingOrderLine;\n};\n\nconst getDeliveryMode = (\n deliveryMode?: string,\n featureSate: boolean = false,\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration,\n pickupDeliveryMode?: string\n) => {\n if (!featureSate) {\n return pickupDeliveryMode;\n }\n return channelDeliveryOptionConfig?.PickupDeliveryModeCodes?.find(dM => dM === deliveryMode);\n};\n\n// eslint-disable-next-line complexity\nexport const OrderSummary = (props: IOrderSummaryProps) => {\n const {\n SubtotalAmount,\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Existing Property.\n SubtotalAmountWithoutTax,\n TaxAmount,\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Existing Property.\n TaxOnNonShippingCharges,\n DiscountAmount = 0,\n TotalAmount,\n OtherChargeAmount\n } = props.cart;\n\n const { canShip, hasDeliveryMethod, hasShippingMethod, freightFee } = getDeliveryConfiguration(\n props.cart,\n props.channelConfiguration,\n props.channelDeliveryOptionConfig,\n props.retailMultiplePickUpOptionEnabled,\n props.isTaxIncludedInPrice,\n props.isShowTaxBreakup\n );\n\n let reactNodes: IOrderSummaryLines;\n // if either of isTaxIncludedInPrice or isShowTaxBreakup is undefined then we will execute old logic\n if (props.isTaxIncludedInPrice === undefined || props.isShowTaxBreakup === undefined) {\n reactNodes = {\n subtotal: _buildOrderSummarySection(props, SubtotalAmount, 'sub-total', props.subTotalLabel),\n tax: _buildOrderSummarySection(props, hasDeliveryMethod ? TaxAmount : undefined, 'tax-amount', props.taxLabel),\n orderTotal: _buildOrderSummarySection(props, TotalAmount, 'total', props.orderTotalLabel),\n otherCharge:\n (OtherChargeAmount && _buildOrderSummarySection(props, OtherChargeAmount, 'other-charges', props.otherChargeLabel)) ||\n undefined\n };\n } else {\n const otherChargeAmount = OtherChargeAmount !== undefined ? OtherChargeAmount : 0;\n const taxOnNonShippingCharges = TaxOnNonShippingCharges !== undefined ? TaxOnNonShippingCharges : 0;\n const isTaxGreaterThanZero = TaxAmount !== undefined && TaxAmount > 0;\n // isTaxIncludedInPrice isShowTaxBreakup useProperties\n // False False/True otherChargeAmount\n // True True otherChargeAmount\n // True false otherChargeAmount+TaxOnNonShippingCharges\n\n const otherChargeAmountTotal =\n props.isTaxIncludedInPrice && !props.isShowTaxBreakup ? otherChargeAmount + taxOnNonShippingCharges : otherChargeAmount;\n\n const subtotalAmountActual = props.isTaxIncludedInPrice && props.isShowTaxBreakup ? SubtotalAmountWithoutTax : SubtotalAmount;\n\n reactNodes = {\n subtotal: _buildOrderSummarySection(props, subtotalAmountActual, 'sub-total', props.subTotalLabel),\n tax: props.isShowTaxBreakup\n ? _buildOrderSummarySection(\n props,\n hasDeliveryMethod || isTaxGreaterThanZero ? TaxAmount : undefined,\n 'tax-amount',\n props.taxLabel\n )\n : '',\n orderTotal: _buildOrderSummarySection(props, TotalAmount, 'total', props.orderTotalLabel),\n otherCharge:\n (OtherChargeAmount && _buildOrderSummarySection(props, otherChargeAmountTotal, 'other-charges', props.otherChargeLabel)) ||\n undefined\n };\n }\n if (canShip) {\n reactNodes.shipping = _buildOrderSummarySection(props, hasShippingMethod ? freightFee : undefined, 'shipping', props.shippingLabel);\n }\n if (props.checkoutState) {\n const giftCardAmount = _computeGiftCardAmount(props.checkoutState, props.cart);\n const loyaltyAmount = _computedLoyaltyAmount(props.checkoutState);\n const customerAccountAmount = _computedCustomerAccountAmount(props.checkoutState);\n const totalAmountAfterGiftCard = (TotalAmount || 0) - giftCardAmount - loyaltyAmount - customerAccountAmount;\n\n if (loyaltyAmount > 0) {\n reactNodes.loyalty = _buildOrderSummarySection(props, -loyaltyAmount, 'loyalty', props.loyaltyLabel || 'Loyalty amount');\n }\n\n if (giftCardAmount > 0) {\n reactNodes.giftCard = _buildOrderSummarySection(props, -giftCardAmount, 'gift-card', props.giftcardLabel || 'Gift card amount');\n }\n\n if (customerAccountAmount > 0) {\n reactNodes.customerAccount = _buildOrderSummarySection(\n props,\n -customerAccountAmount,\n 'customer-credit-amount',\n props.customerAccountLabel || 'Customer Credit amount'\n );\n }\n\n reactNodes.orderTotal = _buildOrderSummarySection(\n { ...props, freeText: undefined },\n totalAmountAfterGiftCard,\n 'total',\n props.orderTotalLabel\n );\n }\n\n if (DiscountAmount > 0) {\n reactNodes.totalDiscounts = _buildOrderSummarySection(props, -DiscountAmount, 'total-discounts', props.totalDiscountsLabel);\n }\n\n return reactNodes;\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ICartState } from '@msdyn365-commerce/global-state';\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * Find the product in array of products considering product id.\n * @param productId - The searched product id.\n * @param products - The array of products in which search is executed.\n * @returns - The found product.\n */\nexport function getProductByProductId(productId: number | undefined, products?: SimpleProduct[]): SimpleProduct | undefined {\n if (productId !== undefined && ArrayExtensions.hasElements(products)) {\n return products.find(product => {\n return productId === product.RecordId;\n });\n }\n\n return undefined;\n}\n\n/**\n * Find the product in array of products considering product id and product behavior's warehouse.\n * @param productId - The searched product id.\n * @param products - The array of products in which search is executed.\n * @param warehouseId - Warehouse id of cartLine.\n * @param cartState - The cart start in case cart line has no warehouse.\n * @returns - The found product.\n */\nexport function getProductByProductIdAndWarehouse(\n productId: number | undefined,\n products?: SimpleProduct[],\n warehouseId?: string,\n cartState?: ICartState\n): SimpleProduct | undefined {\n const targetWarehouseValue = warehouseId ?? cartState?.cart.WarehouseId;\n\n if (productId !== undefined && ArrayExtensions.hasElements(products)) {\n return products.find(product => {\n return productId === product.RecordId && product.Behavior?.InventoryLocationId === targetWarehouseValue;\n });\n }\n\n return undefined;\n}\n","import { ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\r\nimport { SupersessionKey } from './SupersessionKey';\r\n\r\nexport default function getProductSupersessionProperty(product: ProductSearchResult, extensionKey: SupersessionKey) {\r\n const properties = product.ExtensionProperties;\r\n if (properties) {\r\n return properties.find(pr => pr.Key === extensionKey)?.Value?.StringValue || null;\r\n }\r\n return null;\r\n}\r\n"],"names":["InventoryBreakdownComponent","props","extensionProperties","canChangeWarehouse","onWarehouseChange","productQuantity","warehouseMappings","warehouseData","setWarehouseData","React","hasError","setHasError","renderWarehouseSelectLink","warehouse","_props$setShouldShowQ","ArrayExtensions","hasElements","WarehouseId","anyWarehouseHasSufficientQty","some","wh","Available","setShouldShowQtyMessage","call","shouldDisableWarehouseSelect","className","href","onClick","e","handleSelectWarehouseClick","warehouseId","preventDefault","warehouseJsonData","getExtensionPropertyValueByKey","SupersessionKey","InventoryBreakdown","CommercePropertyValueEnum","string","data","JSON","parse","_unused","allowableText","alternateText","length","undefined","map","_getWarehouseFriendly","_warehouseMappings$fi","key","find","mapping","warehouseName","Name","replace","IsAllowable","BulkPurchase","constructor","super","_errorCssClass","_errorCssGlyphClass","collapseRef","_dimensionDropDownChange","_this$collapseRef$cur","this","current","reEvaluateHeight","_onErrorMessage","errorMessage","setState","stateMessage","messageText","statusCssString","messageGlyph","isOpen","_toggleCollapse","state","isExpanded","render","_this$props$data$prod","hasDimensionsInProps","productDimensions","hasDimensionsInData","result","viewProps","_objectSpread","container","moduleProps","classnames","config","content","_renderCollapseContent","renderView","_renderCollapseButton","_renderCollapse","Button","title","resources","bulkPurchaseHeaderTitle","Collapse","ref","_renderMainContent","isMobileDevice","isMobile","variant","VariantType","Viewport","context","request","userMessageNode","Alert","color","RichTextComponent","text","bulkPurchaseDescriptionText","_renderMatrix","_featureState$result","_this$props$data$orde","_this$props$data$cust","featureState","isMultipleCatalogsFeatureEnabled","item","IsEnabled","catalogId","getCatalogId","validateCatalogId","ProductDimensionsMatrix","dimensions","orderTemplates","customerInformation","dimensionOnChange","onErrorMessage","isMultipleCatalogFeatureEnabledInHq","RatingsHistogram","handleHeadingChange","event","heading","target","value","selectFilterBy","bind","ratingsSummary","ratingCount","totalRatingsCount","completeClass","classname","callbacks","histogramItems","HistogramItems","locale","averageRating","RatingComponent","avgRating","ariaLabel","format","averageRatingAriaLabel","readOnly","hideCount","id","typeName","averageNumber","AverageRatingNumber","summary","totalReviews","TotalReviews","ratingsSummaryProps","Msdyn365","tag","editProps","onEdit","requestContext","histogramProps","stars","filterKey","actionContext","update","createRatingsReviewsStateInput","__decorate","observer","histogramItem","Node","Object","assign","buttonProps","starLabel","bar","percentage","Module","LoginToViewPricingComponent","loginText","priceComponent","shouldBlockPricing","arguments","user","signInUrl","isAuthenticated","getDefaultColorSwatchSelected","productData","_colorAttribute$Swatc","_colorAttribute$Swatc2","_colorAttribute$Swatc3","AttributeValues","colorAttribute","attributeValue","_attributeValue$KeyNa","KeyName","toLocaleLowerCase","DimensionTypes","defaultSwatch","Swatches","IsDefault","updateProductUrl","productDetailsPageUrl","coreContext","queryString","sourceUrl","URL","apiSettings","baseUrl","search","pathname","renderProductUnitOfMeasure","unitOfMeasure","renderLabel","name","price","rating","ratingAriaLabelText","reviewCount","ratingCountAriaLabelText","reviewCountArialableText","getReviewAriaLabel","getRatingAriaLabel","ratingAriaLabel","roundedRating","toFixed","renderPrice","basePrice","adjustedPrice","savingsText","freePriceText","originalPriceText","currentPriceText","isPriceMinMaxEnabled","priceResources","BasePrice","AdjustedPrice","CustomerContextualPrice","PriceComponent","loginToViewPricingText","renderProductPlacementImage","imageSettings","gridSettings","imageUrl","fallbackImageUrl","altText","img","src","fallBackSrc","imageProps","cropFocalRegion","Image","loadFailureBehavior","ProductComponent","msdyn365Commerce","createComponentOverride","component","_ref","_product$Name","_product$RecordId","_getProductImageUrlFr","_getProductPageUrlFro","ratingCountAriaLabel","allowBack","telemetryContent","quickViewButton","isEnabledProductDescription","inventoryLabel","dimensionAvailabilities","setAvailabilityModalProduct","product","productUrl","getProductPageUrlSync","RecordId","Number","MIN_VALUE","productImageUrlFromSwatch","app","dimensionToPreSelectInProductCard","none","PrimaryImageUrl","ProductImageUrls","generateImageUrl","getProductImageUrlFromDefaultColorSwatch","productPageUrlFromSwatch","SwatchValue","getProductPageUrlFromDefaultSwatch","productPageUrl","setProductPageUrl","useState","productImageUrl","setProductImageUrl","selectedSwatchItems","Dictionary","enableStockCheck","updatePageAndImageUrl","swatchItem","dimensionType","setValue","StringExtensions","isNullOrWhitespace","productPageUrlWithSwatch","includes","newUrl","searchParams","delete","toString","swatchProductImageUrl","productImageUrls","newImageUrl","payLoad","getPayloadObject","attribute","getTelemetryAttributes","isUnitOfMeasureEnabled","unitOfMeasureDisplayType","onTelemetryClick","cultureFormatter","formatCurrency","Price","AverageRating","TotalRatings","DefaultUnitOfMeasure","description","Description","attributeValues","_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","swatch","ProductComponentSwatchComponent","onSelectDimension","hideRating","moduleTypeName","moduleId","totalRatings","numberRatings","renderRating","inventoryAvailabilityLabel","quickview","selectedDimensions","getValues","DimensionTypeValue","convertDimensionTypeToProductDimensionType","DimensionValue","Value","selectedProductId","renderQuickView","AddToCartListComponent","productId","onAddToCart","addToCartButtonText","quantity","setQuantity","type","min","max","onChange","valueAsNumber","handleAddToCart","console","log","_estimatedAvailabilit","estimatedAvailabilites","invenLabel","pr","ProductId","TotalAvailableInventoryLevelLabel","ItemId","ratingId","_totalRatings$toStrin","ActiveProductComponent","imgData","assembleNode","_item$links","headingNode","renderHeading","additionalContentHeading","handleAdditionalTextChange","paragraphNode","subtext","renderParagraph","additionalContentParagraphText","linksNode","links","ctaLink","index","renderLinks","linkIndex","editableLink","linkText","linkUrl","destinationUrl","openInNewTab","isOpenInNewTab","role","link","onTextChange","handleAdditionalLinkTextChange","additionalContentNode","additionalContentContainer","additionalContentItemLinks","activeImageAdditionalContent","additionalContent","CanvasCalculations","CanvasStyles","ImageMapper","_isDesktopViewPort","_context","getActiveImageWidth","MsDyn365","isBrowser","activeImageReferenceValue","activeImageRefs","clientWidth","getActiveImageHeight","clientHeight","convertHexToRgb","hexColor","RegExp","exec","rValue","parseInt","gValue","bValue","applyFadingTransition","coords","rgbColor","alpha","_this$_canvas$current","_this$_canvas$current2","halfDivisor","_canvas","getContext","buttonPadding","paddingAdjustment","buttonWidth","measureText","width","fillStyle","document","body","parentElement","getAttribute","fillText","drawButton","_this$_canvas$current3","_this$_canvas$current4","buttonTextClor","buttonHeight","buttonPositionX","buttonPositionY","arcsize","beginPath","moveTo","lineTo","arcTo","stroke","closePath","fill","expandAnimation","_this$props$imageMapp","buttonText","imageMapperResources","animationStartWidth","expandAnimationStartWidth","pointPositionX","pointPositionY","animationEndWidth","expandAnimationEndWidth","radius","expandRadius","rotation","startAngle","endAngle","textFadeInValue","textFadeInStartValue","buttonTextClorInRgb","animate","_this$_canvas$current5","_this$_canvas$current6","ellipse","requestAnimationFrame","textFadeInterval","collapseAnimation","_this$props$imageMapp2","collapseAnimationStartWidth","collapseAnimationEndWidth","clearMargin","clearHeight","clearWidth","collapseRadius","textFadeOutValue","textFadeOutStartValue","_this$_canvas$current7","_this$_canvas$current8","clearRect","drawCircle","_this$_canvas$current9","_this$_canvas$current10","viewPort","doubleMultiplier","strokeStyle","arc","Math","PI","scaleCoords","imgWidth","defaultWidth","defaultScale","scale","coord","renderPrefilledAreas","areaMap","areas","area","computeCenter","scaledCoords","handleHoverOn","center","handleHoverOff","_this$_canvas$current11","canvasPositionX","defaultPositionX","canvasPositionY","defaultPositionY","height","click","hoverOn","onMouseEnter","hoverOff","onMouseLeave","renderAreas","_this$props$imageMapp3","_this$props$imageMapp4","_area$productSearchRe","xsRadius","extendedArea","areaKey","altTextWithProductName","productSearchResult","shape","join","onFocus","onBlur","tabIndex","alt","initCanvas","_this$getActiveImageW","_this$getActiveImageH","_this$_canvas$current12","_backgroundImage","_container","onLoad","defaultHeight","canvasWidth","canvasHeight","style","componentDidMount","componentDidUpdate","shouldComponentUpdate","nextProps","shouldRender","_requestContext$gridS","imageData","useMap","ActiveImageConstants","ActiveImage","_defaultProductCardWidth","_defaultProdutCardHight","_activePoints","addActivePoints","_product$PrimaryImage","push","areaId","primaryImageUrl","updateClientWidth","viewport","Browser","renderImageMapper","_this$props$config$ac","productResults","products","activePoints","configProduct","_configProduct$xPosit","_configProduct$yPosit","_configProduct$radius","xPosition","yPosition","activePoint","stringify","mappedArea","_activeImageClass","enterArea","leaveArea","activeImage","_activeImageRefs","altTextForSeeMoreButtonWithProductName","seeMoreButtonText","overlayClass","window","open","resetState","renderProductComponent","_this$state$area","_this$state$area$prim","_product$ItemId","baseImageUrl","productImageSettings","renderProductCard","_productCardDivRef","renderOverlay","getProductCardPositionX","_this$props$config$pr","_this$props$config$pr2","_defaultImageSettings","_area$center$","_area$center","defaultImageSettings","getDefaultImageSettings","productImageSettingsWidth","viewports","lg","w","productCardWidth","leftAllignPosition","position","getProductCardPositionY","_this$props$config$pr3","_this$props$config$pr4","_defaultImageSettings2","productImageSettingsHeight","h","produtCardHight","_area$center$2","_area$center2","xs","q","xl","lazyload","keyDown","enterKey","nodeName","escKey","handleTextChange","handleParagraphChange","paragraph","renderActiveImageDetailsLinks","_telemetryContent","linkData","contentAction","etext","attributes","linkId","willOpenInNewTab","additionalProperties","handleLinkTextChange","renderActiveImageDetailsHeading","_heading$tag","renderActiveImageDetailsParagraph","getActiveImageId","activeImageId","_activeImageIdPart$","activeImageSource","split","decrementOne","_handleOutsideClick","_this$_productCardDiv","contains","getTelemetryObject","telemetryPageName","friendlyName","telemetry","addEventListener","setTimeout","timeoutInterval","images","getElementsByClassName","Array","from","removeAttribute","componentWillUnmount","removeEventListener","activePointContainer","activePointDetailsContainer","imageMapper","overlay","productCard","productCardleftPosition","productCardtopPosition","detailsContainer","detailsContainerCta","handleAdditionalParagraphChange","handleAdditionalText","handleAdditionalParagraph","handleAdditionalLinkText","_this$props$config$ad","ProductPickUpOptionsForCartLineItems","getCacheKey","buildCacheKey","getCacheObjectType","dataCacheType","async","getPickUpOptionsForCartLineItems","input","channelId","Error","cart","getCartState","getActiveCartProductsAction","ActiveCartProductsInput","response","Promise","resolve","ProductsDataActions","callerContext","queryResultSettings","QueryResultSettingsProxy","getPagingFromInputDataOrDefaultValue","createObservableDataAction","action","inputData","PickUpInStore","_toggleBOPIS","isBopisSelected","storeSelectorStateManager","cartline","cartState","storeSelectorModuleId","openDialog","alreadySelectedLocation","OrgUnitNumber","FulfillmentStoreId","deliveryOptions","onLocationSelected","orgUnitLocation","deliveryMode","updateCartLinePickupLocation","cartLineId","LineId","location","then","status","locationChangedHandler","catch","error","_onLocationChangedCallback","DeliveryMode","ShippingAddress","clearCartLinePickupLocation","_getOrgUnitName","fulfillmentStoreId","orgUnitLocations","foundLocation","OrgUnitName","DeliveryOptions","_props$channelDeliver","retailMulitplePickupFeatureState","channelDeliveryOptionConfig","matchDeliveryOptions","productdeliveryOptions","storePickUpOptionList","deliveryOption","delivery","pickup","deliveryCode","Code","PickupDeliveryModeCodes","pickupDeliveryModeCode","option","toggleBopis","defaultComponent","_renderShippingMethod","cartLine","shipItText","pickupInStoretext","changeStoreText","orgUnitName","bopisSelected","toggleBOPIS","checked","shipitText","pickUpInStoreText","_getDeliveryOption","pickupStore","_deliveryOptions$Deli","ContainerProps","_assembleNode","foundProductAvailability","productPickUpOptions","_product$Behavior","_foundProductAvailabi","_product$Dimensions","_props$cartState","_context$request$chan","removeButtonText","removeItemClickHandler","moveToWishlistSuccessHandler","addToOrderTemplateButtonText","addToOrderTemplateButtonTooltip","addToOrderTemplateDialogResources","createOrderTemplateDialogResources","itemAddedToOrderTemplateDialogResources","duplicateItemsWhenAddingToOrderTemplateDialogResources","addToWishlistButtonText","removeFromWishlistButtonText","wishlists","defaultWishlistName","nameOfWishlist","availableQuantityInStock","isStockCheckEnabled","productAvailability","ProductAvailableQuantity","IsProductAvailable","AvailableQuantity","_getCartItemAvailableQuantity","maxQuantity","_getCartItemMaxQuantity","maxQuantityByConfig","isQuantityLimitsFeatureEnabled","maxByQuantityLimitsFeature","maxByQuantityLimitsFeatureResult","maxCartlineQuantity","Behavior","MaximumQuantity","shouldSkipStockCheck","ItemTypeValue","ReleasedProductType","Service","IsInvoiceLine","ObjectExtensions","isNullOrUndefined","_getErrorMessage","currentQuantity","lineId","_props$productAvailab","finalErrorMessages","productAvailabilites","outOfStockText","includeErrors","outOfRangeOneText","outOfRangeFormatText","checkForErrors","cartlinesErrors","ValidationResultsPairs","errorsFoundByLineId","filter","i","ValidationFailures","forEach","validation","ErrorContext","Quantity","onRemoveClickHandler","onRemoveClickFunction","payload","TelemetryEvent","RemoveFromCart","inventoryLbl","StockLevelLabel","inventoryCode","StockLevelCode","toLowerCase","isCustomPriceSelected","Dimensions","dimension","getProductUrlSync","isChannelTypeB2B","_cartline$CatalogId","fullUrl","set","CatalogId","getInvoiceDetailsPageUrlSync","cartlineId","isNullOrEmpty","CartLineItemComponent","catalogs","isOutOfStock","lineIndex","isQuantityEditable","quantityOnChange","updateCartLinesQuantitySuccessHandler","inventoryInformationLabel","inventoryLabelClassName","isCartStateReady","showShippingChargesForLineItems","priceCurrency","channel","Currency","pickUpInStore","pickitUpText","remove","addToWishlist","AddToWishlistComponent","showButtonText","showStatusMessage","showRemoveButton","showButtonTooltip","ariaRole","onSuccess","addToOrderTemplate","AddToOrderTemplateComponent","shouldShowButtonFailedTooltip","disableButton","disableTooltip","assembleCartlines","cartlines","reactNodes","getProductByProductIdAndWarehouse","getProductByProductId","isPickUpItem","isCartLineItemPickUpType","_productAvailability$","_productAvailability$2","_cartline$WarehouseId","shouldIgnoreWarehouse","InventLocationId","toUpperCase","CartLineGroupItems","hasInvoiceLine","_assembleGroupInvoiceCartlines","cartLines","carLineViewProps","_assembleGroupCartlines","getGroupByStorePickup","items","groupBy","groupDelivery","cartLinesGroup","entries","deliveryType","groupByDeliveryType","keys","getPromotionData","ctx","promotionData","getPromotionOptionsForCartLineItems","PromotionOptionsForCartLineItems","promotionOptions","exception","Cart","_isMounted","promotionPopupId","promotionLinkClick","showPromotionDialog","promotionCloseButtonclick","_hidePromotionDialog","getImageSettings","sm","removeItemFromCartHandler","cartlineToRemove","cartLineIds","removeCartLines","validateCart","warning","debug","updateCartlineQuantity","cartlineToUpdate","cartLineQuantityUpdatedAsync","cartActionResult","message","_cartActionResult$err","lineUpdateFailure","validationResults","LocalizedMessage","errorDetails","fulfillmentStoreIdUpdated","isCartValid","_this$props$data$cart","getOrderQuantityLimitsFeatureFlag","_isChannelLimitsFeatureEnabled","showAvailablePromotions","CartLines","reaction","_this$props$data$cart2","_this$props$data$cart3","nextState","_this$props$context$r","_cart$cart$CartLines","_this$props$data$feat","guestCheckoutUrl","getUrlSync","backToShoppingUrl","checkoutURL","getCheckoutURL","isCartEmpty","_getCartLines","emailDeliveryModeCode","EmailDeliveryModeCode","validInventoryAcrossCartLines","validateCartLinesInventory","isValid","RetailMultiplePickupFeatureState","multiplePickUpEnabled","currentCatalogId","getCartLinesGroup","TelemetryConstant","Checkout","checkoutBySignInAttributes","GuestCheckout","checkoutByGuestAttributes","BackToShopping","backtoShoppingAttributes","cartLineGroup","_updateCartLineErrorForInvalidInventory","cartTitle","CartlinesWrapper","OrderSummaryWrapper","OrderSummaryItems","promoCode","_getPromoCode","_getPromotions","removePromoAriaLabelFormat","orderSummaryHeading","invoiceSummaryTitle","orderSummaryTitle","orderSummaryLineitems","_getOrderSummaryLineItems","invoiceSummaryLineitems","_getInvoiceSummaryLineItems","checkoutAsSignInUserButton","disabled","checkoutButtonTitle","checkoutAsGuestButton","showGuestCheckoutButton","guestCheckoutButtonTitle","expressCheckoutButton","slots","paymentExpress","ExpressCheckoutSectionWrapper","backToShoppingButton","backToShoppingButtonTitle","createTemplateFromCartButton","_displayAddCartToTemplate","SaveCartToOrderTemplateComponent","_generateAddToOrderTemplateDialogResources","_generateOrderTemplateNameDialogResources","linesAddedToOrderTemplateDialogResources","_generateLinesAddedToOrderTemplateDialogResources","_generateDuplicateItemsWhenAddingToOrderTemplateDialogResources","createOrderTemplateFromCartButton","createOrderTemplateFromCartButtonTooltip","checkoutBlockedDueToUnavailableFunds","storeSelector","waitingComponent","Waiting","cartLoadingStatus","cartLoadingErrorMessage","cartDataResult","isEmpty","OrderSummaryErrors","_getOrderSummaryErrors","_this$props$data$cart4","_cart$cart","showPromotionPopup","promotions","promotionLinkText","promotionPopupHeading","onCloseButtonClick","onSeeAllClick","titleId","promotionMessageWrapper","promotionMessage","promotionStringHeading","promotionSeeAllLink","promotionDialog","Modal","toggle","ModalHeader","ModalBody","_promotion","_promotion$Promotion","Promotion","OfferName","ModalFooter","cartPromotions","promotionCloseButtonAriaLabel","cartLineInventoryValidationResult","productIdWithErrors","productIdWithError","element","_element$data","outOfStockErrorMessage","allErrors","_cartline$data","_cartline$data$produc","fullError","line","Wrapper","assertive","outOfStockErrorMessageHeader","header","errors","InvoiceSummary","orderTotalLabel","totalAmountLabel","invoiceLabel","_this$props","_featureState$result2","_this$props$context$r2","channelConfiguration","retailMultiplePickUpOptionEnabled","isShowOrHideTaxEnabled","isEnableShowOrHideSalesTaxECommerceEnabled","OrderSummary","subTotalLabel","itemsWithCountLabel","shippingLabel","estimatedShippingLabel","otherChargeLabel","otherCharges","taxLabel","estimatedTaxLabel","orderTotal","totalDiscountsLabel","toBeCalculatedText","yetToBeCalculatedText","freeText","priceFree","isTaxIncludedInPrice","IsTaxIncludedInPrice","isShowTaxBreakup","PromoCodeComponent","promoCodeHeadingText","promoPlaceholderText","promoCodeApplyButtonText","appliedPromoCodeHeadingText","collapseTimeOut","removePromoText","invalidPromoCodeErrorText","failedToAddPromoCodeErrorText","failedToRemovePromoCodeErrorText","duplicatePromoCodeErrorText","duplicatePromotionErrorText","addToOrderTemplateHeader","noOrderTemplatesMessage","noOrderTemplatesDescription","createAnOrderTemplateButtonText","createNewOrderTemplateButtonText","cancelOrderTemplateCreationButtonText","selectTemplatesText","addToTemplateButtonText","lineItemsText","_generateItemAddedToOrderTemplateDialogResources","viewOrderTemplateButtonText","continueShoppingButtonText","itemAddedToOrderTemplateHeaderItemOneText","itemAddedToOrderTemplateHeaderItemFormatText","itemAddedToOrderTemplateHeaderMessageText","linesAddedToOrderTemplateHeaderItemsOneText","linesAddedToOrderTemplateHeaderItemsFormatText","linesAddedToOrderTemplateHeaderLinesOneText","linesAddedToOrderTemplateHeaderLinesFormatText","linesAddedToOrderTemplateHeaderMessageText","linesAddedToOrderTemplateCustomPriceAlertMessageText","duplicatedProductsHeader","duplicatedProductsDescription","updateQuantityButtonText","cancelDuplicateItemsButtonText","orderTemplateHeaderLabel","createOrderTemplateHeader","orderTemplateTitleLabel","orderTemplateTitle","orderTemplateNameAriaLabel","orderTemplateDescription","createOrderTemplateDescription","defaultOrderTemplateName","orderTemplateButtonLabel","createOrderTemplateButtonText","orderTemplateCancelButtonLabel","cancelNewOrderTemplateCreationButtonText","_this$props$data$feat2","_this$props$data$feat3","_this$props$data$cata","PickupDeliveryModeCode","modules","storeSelectorId","CartLineItems","productDeliveryOptions","updateMaxQuantityForCartLineItem","maxQuantityForCartLineItem","warehouseAggregation","sizeString","productDimensionTypeSize","colorString","productDimensionTypeColor","configString","productDimensionTypeConfiguration","styleString","productDimensionTypeStyle","amountString","productDimensionTypeAmount","quantityDisplayString","quantityDisplayText","inputQuantityAriaLabel","decrementButtonAriaLabel","incrementButtonAriaLabel","discountStringText","shippingChargesText","shippingCharges","salesAgreementPricePrompt","priceEditorResources","removeCartButtonText","shipInsteadDisplayText","pickItUpDisplayText","changeStoreDisplayText","errorMessageOutOfRangeOneLeft","errorMessageOutOfRangeFormat","showOutOfStockErrors","addToOrderTemplateMessage","addItemToOrderTemplateError","isAbsoluteUrl","urlCheck","returnURL","origin","AsyncResult","validateCartAsync","_featureStatuses$find2","featureStatuses","_featureStatuses$find","_cartConfiguration$Ig","cartConfiguration","IgnoreOrderSettings","_this$props$context","defaultOrderQuantityLimitsFeatureConfig","platform","enableDefaultOrderQuantityLimits","customerInfo","IsB2b","_featureStatuses$find3","isChannelLimitsFeatureEnabledInHq","_this$props$data$feat4","_featureState$result3","_this$props$data$chan","_this$props$data$cata2","_this$props$data$chan2","_this$props$data$cart5","cartLinesPickUpOptions","ProductCollection","_getProductsDimensionsAvailabilities","dimensionsToDisplayAsSwatch","dimensionsAsSwatchType","validProducts","validValues","productsDimensionAvailabilities","getDimensionAvailabilitiesForProductSearchResultAction","DimensionAvailabilitiesForProductSearchResultInput","DimensionSwatchDisplayTypes","initProductState","productPrices","productCollectionProducts","productCollection","equals","listType","getProductPriceForSelectedProducts","ProductPriceForSelectedProductsInput","p","IsMasterProduct","_getProduct","productPrice","_this$state$productsD","trace","allowBackNavigation","breaCrumbType","breadcrumbType","quickviewSlot","productComparisonButtonSlot","productComparisonButton","reviewCountAriaLabelValue","ratingCountAriaLabelSingleUser","priceRangeSeparator","ProductContainer","productComponent","_product$MasterProduc","masterProductId","MasterProductId","_getActivePrice","productsList","getPriceForProductSearchResult","PriceForProductSearchResultInput","_getSeeAllButton","headingLabel","recommendation","discountIds","searchPageLink","url","seeAllButtonText","enableAffiliationBasedPricing","shouldDisplaySeeAllButton","recommendationListId","isCarousel","layout","headingComponent","updatedProducts","getProductData","productCollectionViewProps","SingleSlideCarouselComponentProps","SingleSlideCarousel","flipperPrevLabel","flipperPrevious","flipperNextLabel","flipperNext","parentId","ProductCollectionContainer","GridComponentProps","seeAllButton","QuickOrderDrawer","_toggle","isManuallyToggled","collapseProps","drawerGlyphClass","toggleGlyphClassName","animateGlyph","drawerOpenGlyph","openGlyph","closeGlyph","drawerCloseGlyph","children","drawerClass","toggleButtonProps","block","_generateDrawerButtonInnerMarkup","collapseState","drawerButtonTextClass","toggleButtonClassName","moduleHeadingText","moduleDescriptionText","_generateGlyphMarkup","glyphClass","onToggle","QuickOrderFormComponent","productTextInput","quantityTextInput","quickOrderState","maxChars","disableAddtoCart","ariaLabelQuantity","ariaLabelProduct","ariaLabelAddtoCart","addQuantityPlaceholderText","handleQuantityChange","handleInputChange","handleAddToCartClick","onInputChange","onInputChangeFunction","onQuantityInputChange","onQuantityChangeFunction","productNode","quantityNode","pattern","maxLength","placeholder","addToCartBtn","userMessage","QuickOrderProduct","simpleProduct","isSelected","observable","QuickOrderDesktopHeaderCellsComponent","columnWithNumberClassName","quickOrderProductNumberText","quickOrderProductText","quickOrderUnitPriceText","quickOrderUnitOfMeasureText","quickOrderQuantityText","quickOrderTotalText","quickOrderActionsText","QuickOrderMobileHeaderCellsComponent","QuickOrderTableHeaderComponent","rowClassName","headerCells","QuickOrderTableRowProductImageComponent","_props$context$reques","_props$data$product$P","_props$imageSettings","getFallbackImageUrl","OmniChannelMedia","containerClassName","QuickOrderExtraActionsPopupComponent","QuickOrderDesktopTableRowCellComponent","_cartLine$LineId","_dimension$DimensionV","dimensionValue","quickOrderProductDimensionsSeparator","UnitOfMeasureSymbol","IncrementalQuantity","currentCount","quickOrderInputQuantityAriaLabel","quickOrderDecrementButtonAriaLabel","quickOrderIncrementButtonAriaLabel","isGiftCard","IsGiftCard","TotalAmount","quickOrderRemoveItemButtonAriaLabel","QuickOrderMobileTableRowCellComponent","quickOrderQuantityMobileText","QuickOrderTableRowComponent","QuickOrderTableComponent","setIsMobile","isMobileView","quickOrderProducts","updateViewport","headerClassName","quickOrderProduct","QuickOrder","waitTime","dimensionUpdateQueue","FinitePromiseQueue","initializedDimensions","Set","cssClassNameConfigure","quickOrderCallbacks","initializeDimension","initializedDimension","add","dimensionSelectedAsync","selectedDimensionId","selectedDimensionValueId","_this$state$productDi","size","enqueue","_updateDimensions","FinitePromiseQueueError","ProcessWasDiscardedFromTheQueue","getDropdownName","_getDropdownName","changeUpdatingDimension","isUpdatingDimension","_handleInputChange","query","productText","productResponse","inputQuantityText","quantityInput","HTMLInputElement","cancellableDebounce","cancel","isQuickOrderFormExpanded","_debounce","getScanResult","GetScanResultInput","results","Product","ProductDimensionFull","_addItemToCart","quickOrderAddedToCartSuccessMessage","quickOrderAddedToCartFailureMessage","_validateCart","_this$props$context$a","getDeliveryOptionsAsync","defaultDeliveryOption","productAvailableQuantity","_updateAvailability","shouldValidateQuantityLimits","_shouldValidateQuantityLimits","addProductToCartInput","count","availableQuantity","orderQuantityLimitsFeatureIsEnabled","isAddEmailDeliveryItemToCart","addProductToCart","inputProductText","substatus","maxQtyLimitReachedMessage","_getMaxQtyMessage","_result$errorDetails","isOrderQuantityLimitsFeatureEnabledInSiteSettings","_getConcatenatedMaxQtyMessage","quickOrderMaxQuantityLimitText","quickOrderAlreadyItemQuantityText","_handleQuantityChange","currentValue","inputElement","isNaN","setAttribute","_updateDimensionValue","productDimensionFull","newValueId","DimensionValues","_this$state$productRe","dimensionsToUpdate","productDimensionErrorState","otherError","clearOtherErrorState","configureErrors","errorState","mappedDimensions","ExtensionProperties","selectedProduct","reject","newProduct","getSelectedVariant","SelectedVariantInput","getDimensionsForSelectedVariant","GetDimensionsForSelectedVariantInput","variantProduct","newAvailableQuantity","getProductAvailabilitiesForSelectedVariant","ProductAvailabilitiesForSelectedVariantInput","productAvailable","_getDimensionErrorString","quickOrderproductDimensionTypeColorErrorMessage","quickOrderproductDimensionTypeConfigurationErrorMessage","quickOrderproductDimensionTypeSizeErrorMessage","quickOrderproductDimensionTypeAmountErrorMessage","quickOrderproductDimensionTypeStyleErrorMessage","_updateProductAvailability","_productResponse$Dime","missingDimensions","_getConfigureErrors","quickOrderWrongQuantityErrorMsg","quickOrderOutofStockErrorMsg","device","Type","quickOrderFormClass","quickOrderFormProductContent","quickOrderFormMsgContent","quickOrderModuleHeading","quickOrderModuleDescription","quickOrderAddtobag","quickOrderProductQuantityInputLabel","quickOrderProductInputLabel","quickOrderProductDimensionTypeColor","quickOrderProductDimensionTypeConfiguration","quickOrderSelectDimensionFormatString","quickOrderProductDimensionTypeSize","quickOrderProductDimensionTypeStyle","quickOrderProductDimensionTypeAmount","quickAddQuantityPlaceholderText","productConfigureResources","selectDimensionFormatString","quickOrderProps","contentProps","isB2B","drawer","quickOrderForm","quickOrderList","_renderQuickOrderTable","form","configure","getProductConfigure","_initQuickOrderProducts","tableClassName","productInventoryInfo","_cart$result","maxQuantityForLineItem","addedQuantity","_item$ItemId","_this$state$productRe2","minInventory","computed","SearchState","SuggestionType","ProductListInventoryFilteringOptions","AutoSuggestInput","searchText","top","suggestionType","hitPrefix","hitSuffix","searchQuery","topResultsCount","_getAutoSuggest","autosuggest","_ctx$requestContext$a","productSearchCriteria","SearchCondition","Context","ChannelId","productListInventoryDisplay","HideOOS","inventoryRefinerValue","getInventorySortableRefinerValue","channelInventoryConfiguration","isInStock","ProductAvailabilitySortableAttributeRecordId","RefinerRecordId","DataTypeValue","AttributeDataType","TrueFalse","LeftValueBoundString","RightValueBoundString","UnitText","RowNumber","Count","RefinerSourceValue","ProductRefinerSource","Attribute","getInventoryConfigurationAsync","Refinement","searchCriteria","ProductSearchCriteria","HitPrefix","HitSuffix","searchSuggestions","getSearchSuggestionsAsync","Paging","Top","ImageUrl","AllSearchResults","autoSuggestPromises","all","CategorySuggestionsComponent","suggestions","autoSuggestProps","categorySuggestionHeading","_renderTitle","categoryAutoSuggestionHeading","shouldShowFullPath","splitValue","pop","Id","_generateLink","_getHighlightedText","suggestion","_getCategoryLink","_categoryRefiners$Val","searchPageURL","searchQsp","searchRefiners","queryUrl","categoryRefiners","refiners","SourceValue","Category","refiner","Values","encodedRefiner","compressRefiners","formattedText","dangerouslySetInnerHTML","getRichTextHtml","compressedRefinerKeys","compressedRefiners","compressedRefiner","refinerKey","FormComponent","searchPlaceholder","hideSearchLabel","searchTextInput","disableSubmitSearch","handleCancelSearchChange","ariaLabelCancel","ariaLabelSearch","ariaLabelSubmit","inputNode","submitBtnNode","cancelBtn","submitBtn","KeywordSuggestionsComponent","formattedLink","LabelComponent","searchLabelClass","searchLabelArialLabel","isSearchFormExpanded","searchtext","searchCollapsedLabel","innerRef","ProductSuggestionsComponent","productSuggestionHeading","moduleType","productAutoSuggestionHeading","_item$Value","Value3","DecimalValue","thumbnail","_renderThumbnail","_renderPrice","LiProduct","_getLiWrapper","AProduct","_getAWrapper","recid","_props$resources","Search","_isLoadingNode","loadingText","autoSuggestResultLoadingMessage","Spinner","label","SpinnerSize","medium","labelPosition","_focusOutTarget","closest","_clearAutoSuggestState","_keyup","keyCode","KeyCodes","Escape","formReference","autoSuggestResultDiv","searchState","defaultBasicSearchUrl","searchQueryStringParameter","createSearchStateInput","cancellabelDebounce","inputSuggestionType","_loadSuggestions","_handleSubmit","focus","searchURL","_appendQueryParams","_handleCancelSearchChange","isInitialState","_handleCancelSearchFocused","route","qsp","_setAutoSuggestResultCount","autoSuggestResultScreenReaderDiv","ariaLiveRegion","suggestResultString","autoSuggestFoundMessage","emptyResultString","noAutoSuggestionMessage","innerText","searchKeywordSuggestClass","searchProductSuggestClass","searchCategorySuggestClass","autoSuggestAriaLabel","isLoadingAutoSuggest","searchInputMaxLength","searchFormClass","_initSuggestionTypes","params","isEditor","_suggestions$AllSearc","_suggestions$AllSearc2","_suggestions$AllSearc3","cancelBtnAriaLabel","searchBtnAriaLabel","submitBtnAriaLabel","searchplaceholderText","shouldShowFullCategoryPath","keywordSuggestions","Keyword","None","productSuggestions","categorySuggestions","_item$RefinerRecordId","AutoSuggestAriaLabel","AutoSuggestAriaLabelText","AutoSuggest","KeywordSuggest","ProductSuggest","CategorySuggest","SearchForm","FormWrapper","autoComplete","onSubmit","UlKeyword","UlProduct","UlCategory","autosuggestKeyword","autosuggestProduct","autosuggestCategory","handleCancelSearchFocused","isLoadingNode","suggestionTypes","suggestionTypeCriterion","unique","validSuggestions","loadSuggestionsRequestId","getSearchSuggestionsAction","_getSuggestionType","_getSearchRefiners","Random","Guid","generateGuid","_getSearchSuggestions","_updateSearchRefiners","suggestionTypeItem","charAt","slice","SocialShareItem","_getSocialShareItem","viewprops","SocialShareItemElement","icon","socialMedia","SocialMediaComponent","SocialMedia","Facebook","postUrl","Twitter","Pinterest","Linkedin","Mail","getAdditionalContentItems","additionalContentItemContainer","videoPlayerAdditionalContent","additionalContentItems","VideoPlayer","options","video","playerResources","playAriaLabel","playLabel","pauseAriaLabel","pauseLabel","playingAriaLabel","playingLabel","pausedAriaLabel","pausedLabel","muteAriaLabel","muteLabel","unMuteAriaLabel","unMuteLabel","fullScreenAriaLabel","fullScreenLabel","exitFullScreenAriaLabel","exitFullScreenLabel","seekBarLabel","videoTimeDurationLabel","closedCaptionLabel","videoMetaData","_video$_links","videoId","duration","playTime","posterframeUrl","_links","binaryReferences","videoBinaryReferences","videoPlayerData","metaData","player","Player","playerData","_getVideoDetailsHeading","_getVideoDetailsParagraph","_getVideoDetailsLinks","detailsContainerCTA","handleText","handleParagraph","handleLink","handleAdditionalLink","ProductRefinerValueDataTypeValue","ProductRefinerTypeValue","isRangeType","dataTypeValue","Decimal","Integer","findMatchingRefinementCriterion","productRefinerValue","refinementCriteria","refinementCriterion","isMatchingRefinementCriterion","getUpdatedRefinementCriteria","itemToggleNotification","currentRefinementCriteria","updatedRefinementCriteria","toggledItemFound","selectedCriterion","isSelecting","next","rangeStart","rangeEnd","Text","parentProductRefinerHierarchy","RefinerTypeValue","RefinerType","SingleSelect","child","matchingIndex","findIndex","criterion","splice","ChoiceSummary","closeButtonGlyph","_onClick","stopPropagation","currentTarget","clearAll","selectedRefiner","_getSelectedRefinerChoice","onChoiceClicked","itemClicked","choiceClicked","nextItemToFocus","nextSibling","selectedRefinersMap","selectedChoices","channelInventoryConfigurationId","refinerHierarchy","choice","parent","hierarchy","_getKeyForRefinerValue","clearAllText","classNames","choiceAriaLabel","closeAriaLabel","clearAllAttributes","urlBuilder","choiceFormat","choiceRangeValueFormat","overallFormat","rangeFormat","refinerValueName","refinerName","_formatPrice","LeftValueBoundLocalizedString","amount","currency","selected","textContent","trim","ErrorMessage","FeatureSearchResultItem","productName","productRecordId","fallbackImage","featureSimilarDescriptionTitle","featureSimilarLooksTitle","Link","ModalToggle","modalNode","autoFocus","applicationNode","returnFocusRef","returnRef","onModalToggle","zIndex","modalHeaderNode","modalTitle","modalFooterNode","modalCloseButtonText","getInventoryLabel","inventoryAttribute","TextValue","ProductSearchResultItems","swatchItemAriaLabel","RangeRefineItem","_selectedRefinementCr","_this$props$selectedR","_this$props$selectedR2","_ref2","_this$props$selectedR3","_this$props$selectedR4","_formattedPriceReverseLookup","Map","getLabels","sliderId","minPrice","maxPrice","labelId","labelString","labelPositioning","getSliderThumbs","sliderKey","selectedMin","selectedMinPrice","selectedMax","selectedMaxPrice","_this$props$minValueS","_this$props$maxValueS","minValueSliderThumbAriaLabel","currencyCode","ariaValueText","maxValueSliderThumbAriaLabel","_onRangeUpdate","_onRangeUpdateEnd","_handleRangeTooltipText","_changeMin","_changeMax","_finishChangeMin","_finishChangeMax","minInput","maxInput","selectedRefinementCriterion","initialMin","initialMax","String","minValue","maxValue","labels","sliderKeyString","sliderThumbs","isChecked","validationErrorMin","validationErrorMax","touchedMin","touchedMax","previousProps","updateSliderProps","refineItemCommonProps","rangeType","_renderInputFields","_renderSlider","_ref3","_this$props$selectedR5","_this$props$selectedR6","_ref4","_this$props$selectedR7","_this$props$selectedR8","formAttrs","rangeNameFormat","minInputClassName","maxInputClassName","formattedSelectedMin","_getFormattedSelectedValue","formattedSelectedMax","minLabel","maxLabel","placeholderTextMax","ariaAttributes","Slider","inForm","step","orientation","showLabels","showTooltip","onChangeEnd","debounce","handleTooltipText","_changeValue","inputType","selectedKey","touchedKey","_getInputWithoutFormatting","selectedMinValue","minTouched","maxNum","validationErrorNaN","_focus","_validateRange","selectedMaxValue","maxTouched","minNum","touched","validationError","validationErrorRange","inputAsNum","get","sliderChangeNotification","eventType","firstThumbValue","secondThumbValue","_focusOnSliderThumb","getElementById","tooltip","RefineItem","anchorType","_productRefinerValue$","productCountAriaLabel","singleProductCountAriaLabel","refineItemAriaLabel","refineItemsAriaLabel","attrs","_objectWithoutProperties","_excluded","isSingleSelect","itemTypeClassName","Rating","_renderRating","productCount","refineMenuItemAriaLabel","_getRefinerUrl","_renderSwatch","_this$props$parentPro","_this$props$parentPro2","_productRefinerValue$2","hasColor","hasImage","swatchItems","checkIfShouldDisplayAsSwatch","SwatchComponent","list","isSelectionEnabled","isRefineItem","ratingUserCountAriaLabel","ratingSingleUserCountAriaLabel","_productRefinerValue$3","refinerRating","ratingRefiner","selectedRefinerValues","selectedRating","defaultChkProductCount","ratingComponentClass","productCountAriaLabelValue","RefineSubmenu","_onToggleItem","_onToggleSubmenu","isExpandedOnInitialLoad","expanded","productRefinerHierarchy","timeout","_renderChildItems","_renderRange","_renderSingleMultiSelect","refinerValuesList","listItems","selectedValue","_getRangeType","DisplayTemplateValue","DisplayTemplate","Range","SliderWithBars","onUpdateRefiners","prevState","Separator","separator","Title","expandRefinersCount","SearchResultContainer","SearchResultContainer_1","sortByDropdownOptions","sortOptions","sortByOptionRelevanceDesc","sortByOptionNameAsc","sortByOptionNameDesc","sortByOptionPriceAsc","sortByOptionPriceDesc","sortByOptionRatingDesc","sortByOptionBestSelling","sortByOptionNewScore","sortByOptionTrendingScore","_pageType","urlTokens","pageType","_viewport","expandrefinerCount","defaultPageNumber","isListPageStateUpdated","_updateListPageState","listPageState","_this$props$config$it","_this$props$config$it2","querySorting","sorting","decodeURIComponent","currentPageNumber","skip","itemsPerPage","sortingCritera","Columns","pageSize","totalProductCount","activeFilters","hydrateRefinersFromUrl","featureProduct","_this$props$data$list","_this$props$data$list2","activeProducts","_this$props$data$list3","_this$props$data$list4","_getSearchResultModal","modal","modalHeader","modalFooter","modalBody","SearchResultModal","modalIsOpen","_modalToggleRef","_toggleModal","_getCollectionTitle","collectionTitle","category","getFriendlyName","NameTranslations","productCountNumber","productCountText","numberOfProducts","oneProduct","TitleContainer","titlePrefix","searchTextPrefix","titleText","titleCount","_getCategoryHierarchy","categoryHierarchy","CategoryHierarchyContainer","categoryHierarchyList","categoryLinkAriaLabel","Url","categoryHierarchySeparator","_getSortingDropDown","activeDropdown","_getCurrentlySelectedOption","sortingState","selectedSortByOption","dropdownOptions","_getAllSortByOptions","dropdownOption","SortingContainer","sortByDropDown","LabeledDropdown","labelClassname","labelText","sortByDropdownLabel","dropdownId","dropdownClassname","toggleColor","selectedOption","onSelectOption","_updateSortByDropdown","_sortAndFilterContainerRef","_getPagination","getCurrentUrl","skipCount","totalItems","previousText","nextText","UncontrolledPagination","paginationAriaLabel","startingItem","_renderPrev","_renderNext","previousAriaLabel","nextAriaLabel","_getRefineMenu","tempRangeTypeTODO","inputRange","validRefiners","updateRefinerPanel","_shouldHideFromRefiners","activeRefiners","_getexpandRefinerCount","expandedRefiners","RefineMenuContainer","RefinerSectionContainer","_refineItemCommonProps","_onUpdateRefiners","_buildRefinerUrl","_this$props$data$prod2","inventoryAwareSortableAttributeId","_getChoiceSummary","_this$props$data$prod3","selectedRefiners","choiceSummaryLabel","_onChoiceClicked","_buildRefinerUrlForChoiceSummary","_getProducts","_this$props$slots","_this$props$data$prod4","shouldAllowBackNavigation","breadCrumbType","shouldAllowBack","isPriceMinMaxFeatureState","notification","history","pushState","buildListPageUrl","_getSortColumnFromSelectedOption","transaction","searchConfiguration","mappedConfiguration","sortColumn","_getSortCriteriaColumn","_this$props$data$list5","sortCriteria","queryColumns","parseQueryParam","mappedSearchConfiguration","mappedSearchConfig","activeSortColumn","activeMappedConfig","ColumnName","IsDescending","_this$props$data$list6","newRefinementCriteria","dropdownElementId","dropdownElement","selectedChoice","isClearAll","refinerCount","one","two","three","four","paginationPreviousText","paginationNextText","_updateViewport","pending","validationErrorNotNumber","validationErrorNotRange","static","nameTranslations","_nameTranslation","nameTranslation","Language","_this$props$context$a2","_listPageState$active","_listPageState$sortin","_newListPageState$cur","_newListPageState$sor","_newListPageState$act","_this$props$context$r3","_this$props$context$r4","_this$props$context$r5","newListPageState","GetFullProductsByCollectionInput","Skip","Sorting","recordId","Recommendation","includeAttributes","getCollectionProducts","_newListPageState$cur2","_newListPageState$sor2","_newListPageState$act2","_this$props$context$r6","_this$props$context$r7","refinerInput","RefinersByCollectionInput","getCollectionRefinersAction","_listPageState$result","_listPageState$result2","_this$props$context$r8","_this$props$data$list7","_this$props$data$list8","searchProduct","errorText","resultCategoryNotFoundText","resultSearchNotFoundText","productsComponent","featureComponent","searchResultContainerViewProps","TitleViewProps","disableHierarchy","refineMenu","sortByOptions","pagination","ProductsContainer","ProductSectionContainer","CategoryNavContainer","RefineAndProductSectionContainer","choiceSummary","modalToggle","searchResultModal","FeatureSearchContainer","similarLookProduct","_getViewport","DescriptionInterval","renderProductCards","_props$data$listPageS","renderProductCardsDescription","_props$data$products$","_props$data$featureSt","isAllowBack","quickviewslot","loginToViewPricing","renderProducts","_props$data$listPageS2","productDescriptionInterval","productDescriptionIntervalRemainder0","productDescriptionIntervalRemainder9","renderTitleCount","renderCategoryHierarchy","createSearchResultModal","modalProps","isRecoSearchPage","createModalBody","renderSort","submenu","renderRefinerMobile","renderRefiner","renderTitle","productCardimageSettings","md","image","getProductPrice","pricing","productRecId","_props$context$action","filterText","partNoHeading","descriptionHeading","availabilityHeading","listPriceHeading","yourPriceHeading","goToCartText","continueShoppingText","addToCartModalHeading","addToCartText","productSearchResults","enableProdutDescription","listView","eligbilityList","setEligbilityList","_props$data$products","itemIds","GetProductEligibilityInput","eligibilityData","GetProductEligibilityAction","IsEligible","getProductEligibility","setIsExpanded","modalOpen","setModalOpen","addedProduct","setAddedProduct","productPricing","setProductPricing","_productSearchResults","_cart$result2","foundProduct","ProductTypeValue","addToCartBehavior","getProductSupersessionProperty","extensionKey","properties","_properties$find","Key","StringValue","Popup","navigationUrl","dialogStrings","headerItemOneText","headerItemFormatText","headerMessageText","_renderProductsListView","_props$data$cart$resu2","_productSearchResults2","courseInCartText","courseId","Table","SupersededId","SupersededName","Inventory","renderAddtoCartButton","_props$data$cart$resu","invoiceInCartText","colSpan","textAlign","productEligibilityText","setModalProps","CartIconView","_modalContainer","placement","hideArrow","wrapClassName","isModalOpen","closeModal","_openModal","_renderCartCloseIcon","_renderCartItemCount","cartItemCount","_escFunction","isAutoDisplayTriggered","CheckOut","_removeCommentFromCartLine","_cartState$cart$CartL","Comment","_clonedCart","updateCart","newCartObject","_renderGuestCheckout","_cart$result$cart$Ver","cartVersion","Version","lastValidatedCartVersion","shouldShowMiniCart","isProductAddedToCart","AddToCartBehavior","showMiniCart","miniCartWrapper","renderModuleAttributes","cartIcon","flyoutTitle","emptyCart","cartLineIndex","miniCartItemWrapper","storeLocation","promoContentItem","_props$resources$tota","totalPrice","emptyPrice","totalPriceFormatString","renderTotalPrice","subTotalMessage","goToCartButton","continueShoppingButtonTitle","renderCartlines","quantityHeading","configurationObject","areInventoryRangesChecked","setAreInventoryRangesChecked","inventoryRangesList","setInventoryRangesList","setEstimatedAvailabilites","onlyShowPriceWhenAuthenticated","resp","getInventoryLevelRangesAsync","getInvProfs","_props$data$products2","_response$ProductWare","createInventoryAvailabilitySearchCriteria","getEstimatedAvailabilityAsync","ProductWarehouseInventoryAvailabilities","getEsimatedAvailability","showFilterDropdown","showSortDropdown","_configurationObject$","Inventorylabel","Inventorycode","TotalAvailableInventoryLevelCode","getInventory","isToolTipOpen","setIsToolTipOpen","toggleTooltip","Tooltip","boNote","backOrderShippingText","_invProfOos","_invProfOos2","currentInvString","currentInventory","invProfOos","ir","_ir$Profile","tempInvRange","Profile","hasOwnProperty","UpperBoundInclusive","productUnavailableText","renderInvoiceCartLine","InvoiceId","itemProp","_removeItemFromCartHandler","removeCartItemAttribute","ALLOWABLE_FREIGHT_ATTRIBUTE_KEY","INVOICE_AMOUNT_ATTRIBUTE_KEY","getAllowableFreightAttIdx","getInvoiceAmountDueAttIdx","valueType","property","_modalErrContainer","isErrModalOpen","closeErrModal","_props$data$cart$resu4","handleInvoiceAdded","isErrAutoDisplayTriggered","isAddressCheckComplete","iProductsPresentVersion","isUpdatedNeeded","hasInvoiceLines","allowableFreightIdx","attributeArr","freightData","updatedFreightData","invoiceId","TextValueTranslations","invoiceAmountDueIdx","invoiceData","updatedInvoiceData","customer","readAsync","customerAccountNumber","_customer$Addresses","Addresses","IsPrimary","primaryAddress","getAddresses","updateShippingAddress","newShippingAddress","_this$props$data$cart6","_this$props$data$cart7","_this$props$data$cart8","_this$props$data$cart9","authorizedWarehouseAccounts","isAlternateWarehouseFeatureEnabled","enableAlternateWarehouseFeature","removeWarehouseAttributes","ippContent","iProductsPresent","ineligibleProductsText","r","Barcode","err","handleCartAddress","itemCount","goToCartButtonText","goToCartButtonTitleNew","allowableFreight","_data$detail$Products","detail","Products","_props$data$cart$resu3","subtotal","SubtotalAmount","hasInvoice","canAddItemToCart","canAddToCart","_ir$Profile2","titleProps","enableSearchWrap","trimmedQuery","hasMultipleTerms","test","has","append","expandResultsText","refineResultsText","notFindingText","renderExpandOrRefineResults","_props$data$cart$resu6","_props$data$cart$resu7","loginToViewPricingAndAvailabilityText","supersededFromText","priceAndAvailabilityHeading","manufacturerCodes","setActiveProducts","searchTerm","codes","matchedProducts","unmatchedProducts","_p$ItemId","_p$ItemId2","matched","substring","GDNManufacturerCode","isEligibilityChecked","setEligibilityChecked","shouldDisplayAlternateWarehouseFeature","setShouldDisplayAlternateWarehouseFeature","customerAccNum","IsAssorted","availabilityModalProduct","renderAvailabilityModal","_props$data$products$2","allProducts","modalProduct","warehouseAvailabilityReadOnlyMessage","canBackorder","allowableFreightWarehouseLabel","preferredWarehouseLabel","alternateWarehouseMappings","pdpWarehouseSelectionNote","cartObj","_props$data$cart$resu5","addToCartButton","_invProfOos3","_invProfOos4","_ir$Profile3","isAddToCartButton","_renderInventoryClickIcon","tooltipOpen","setTooltipOpen","xmlns","viewBox","d","activeImageView","left","BulkPurchaseViewComponent","_renderCartlines","cartEmptyText","_cartLine$cartlineId","renderCartLinesGroupHeader","pickUpText","shippingText","emailShippingText","titleSeparate","_cartLine$pickUpInSto4","groupTitle","renderCartLinesGroupTitle","_cartLine$pickUpInSto","_cartLine$pickUpInSto2","_cartLine$pickUpInSto3","_props$cart","_props$cart2","errorData","emailshippingText","emptyCartText","renderCartLinesGroup","_renderInvoiceSummarylines","invoiceSummaryLines","invoices","giftCard","loyalty","_renderOrderSummarylines","orderSummaryLines","shipping","otherCharge","tax","totalDiscounts","_renderCarousel","carouselContainer","_renderProduct","_renderGrid","gridContainer","_renderNoProduct","noProductToRenderText","renderConfigure","containerProps","dropdowns","renderConfigureDropdown","dropdown","labelContainerProps","select","renderForm","quickOrderProductContent","quickOrderMsgContent","_renderForm","_renderKeywordSuggestions","_renderProductSuggestions","_renderCategorySuggestions","SocialShareItemView","componentId","_data$ratingsSummary$","_data$ratingsSummary$2","_data$ratingsSummary$3","_data$ratingsSummary$4","_data$ratingsSummary$5","_data$ratingsSummary$6","reviewsCount","reviewsCountString","numberOfReviewsString","cartLineItemFunctions","renderProductDimensions","dimensionStrings","productDimension","_productDimension$Dim","_productDimension$Dim2","_productDimension$Dim3","_productDimension$Dim4","ProductDimensionType","Color","Configuration","Size","Style","DiscountLines","discountLine","_discountLine$OfferId","OfferId","isSalesLine","PeriodicDiscount","EffectiveAmount","Percentage","discountPercent","_discountLine$Percent","updatedPercent","DiscountLineTypeValue","DiscountLineType","TenderTypeDiscount","_discountLine$Effecti","effectiveAmount","inventoryCssName","_cartline$ChargeLines","hasShippingMethod","_channelDeliveryOptio","shippingChargeLines","ChargeLines","chargeLine","IsShipping","freightFee","reduce","chargeTotal","_chargeLine$Calculate","CalculatedAmount","_cartline$ChargeLines2","_otherCharges$map","chargeline","itemIndex","_props$primaryImageUr","destructDimensionStrings","renderProductUnitPrice","renderDiscountLines","renderInventoryLabel","renderShippingLabel","renderOtherCharges","productAttribute","imgeClassName","cartLineContentClassName","newValue","generateErrorMessage","renderUnitOfMeasure","NetAmount","NetAmountWithoutTax","NetPrice","generateQuantityAndPrice","nodes","_props$maxQuantity","_props$data$product$I","CartLinePriceEditor","PromoCode","_onInputChangeHandler","promoCodeInputValue","canApply","_applyPromotion","appliedPromo","addPromoCode","_onSubmitHandler","applyPromotionHandler","_removePromotion","_event$currentTarget$","code","removePromoCodes","promoCodes","_renderAppliedPromoCode","Coupons","removePromotionHandler","coupon","ApplyPromoCode","_getWarehouseNameFrom","_props$warehouse","_props$warehouse2","routes","canonicalUrl","isCartPage","lastIndexOf","isInvoiceLine","hasWarehouseChanged","boolean","isCartView","numOfWarehouse","isAlternateWarehouseSelectionDisabled","isAlternateWarehouse","warehouseChangedLabel","selectProductForAvailability","COUPON_ATTRIBUTE_KEY","getCouponCodeMap","enteredCode","foundCode","couponMapping","c","_c$fromCouponCode","fromCouponCode","_foundCode$toCouponCo","mondaysDate","formatDate","getMondayOfCurrentWeek","toCouponCode","tcc","date","_onInputChange","_cart","addAttributeToCart","removeAttributeFromCart","_calculateDiscount","discountAmount","DiscountCode","DiscountCost","totalCouponDiscountAmount","_coupon$Code","isCollapseOpen","getFullYear","getMonth","padStart","getDate","today","Date","day","getDay","diff","setDate","_applyPromotionHandler","promoCodTotalDiscount","CatalogLabelComponent","catalog","renderSalesAgreementPrompt","SalesAgreementLineRecordId","renderConfirmedShipDate","confirmedShipDate","confirmedShipDateLabel","renderRequestDeliveryDate","requestDeliveryDate","requestDeliveryDateLabel","_props$context$reques2","NetAmountWithAllInclusiveTax","GrossAmount","ExtendedPrice","htmlFor","DiscountAmount","deliveryLocation","propsContext","cartResult","shouldRetry","_validationResult$Val","validationResult","CartsDataActions","bypassCache","ValidationResultsByLineId","refreshCart","refreshError","validateError","cartLineToUpdate","isUsingDefaultOrderSettingsMax","_modifiedProduct$Beha2","modifiedProduct","newQuantity","updateLineResult","updateCartLineQuantity","renderItem","star5Count","star4Count","star3Count","star2Count","star1Count","totalCount","formattedPercent","Intl","NumberFormat","barItemAriaLabel","Progress","attrKey","attrValue","attributeArray","attributeObj","attrIdx","a","_a$Name","_a$Name2","changesMade","updatedCartLines","_cartline$AttributeVa","needsUpdate","updatedAttributes","attr","updateCartLines","updatedCartLinesObject","InvoiceSummaryLine","cssLabel","_buildPaymentSummarySection","_computedLoyaltyAmount","checkoutState","loyaltyAmount","invoiceLines","invoiceLine","InvoiceAmount","giftCardAmount","_computeGiftCardAmount","giftCardTotalValue","giftCardExtends","giftCardCounter","Balance","totalAmountAfterGiftCard","loyaltyLabel","giftcardLabel","OrderSummaryLine","_buildOrderSummarySection","getDeliveryMode","featureSate","pickupDeliveryMode","dM","SubtotalAmountWithoutTax","TaxAmount","TaxOnNonShippingCharges","OtherChargeAmount","canShip","hasDeliveryMethod","getDeliveryConfiguration","deliveryModes","taxOnShippingCharge","TaxOnShippingCharge","shippingChargeAmount","ShippingChargeAmount","otherChargeAmount","taxOnNonShippingCharges","isTaxGreaterThanZero","otherChargeAmountTotal","subtotalAmountActual","customerAccountAmount","customerAccount","customerAccountLabel","targetWarehouseValue","InventoryLocationId"],"sourceRoot":""}