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AAMkC,GACpBohF,EAAyB7lB,EAAWvP,KAAK,MAC/C,OACIluD,IAAAA,cAAA,WACIA,IAAAA,cAAA,WAAMyxE,GACNzxE,IAAAA,cAAA,WAAMsjF,GACJ,EAIRl1B,EAAsBluD,IACxB,MAAM,QAAEyW,GAAYzW,EAEpB,OAAKyW,SAAAA,EAASyrE,MAKVpiF,IAAAA,cAAA,YACIA,IAAAA,cAACgpB,EAAAA,eAAc,CACXpmB,KAAM,CACF6kB,MAAO,CACHsB,wBAAyBpS,EAAQyrE,QAGzCh5E,QAASlJ,EAAMkJ,QACfgL,GAAIlU,EAAMia,SACVE,SAAUna,EAAMka,eAChBF,aAAcha,EAAMga,gBAdrB,IAgBA,EAIT+oE,EAAsB/iF,IACxB,MAAM,MAAEuI,EAAK,UAAEpF,GAAcnD,EAE7B,IAAKuI,EACD,MAAO,GASX,MANsB,CAClB86E,IAAKlgF,EAAUq9E,8BACf8C,WAAYngF,EAAUo9E,+BACtBgD,KAAM,IAGWh7E,EAAM,qKC3NxB,MAAMiwC,EAAa,CACtBgrC,QAAS,IACT/qC,mBAAoB,IACpBgrC,WAAY,IACZC,mBAAoB","sources":["webpack://Msdyn365.Commerce.Online/./src/modules/checkout-billing-address/checkout-billing-address.tsx?2aa0","webpack://Msdyn365.Commerce.Online/./src/modules/checkout-shipping-address/components/checkout-shipping-cartlines-images.tsx?c635","webpack://Msdyn365.Commerce.Online/./src/modules/checkout-shipping-address/checkout-shipping-address.tsx?de3a","webpack://Msdyn365.Commerce.Online/./src/modules/checkout-billing-address/checkout-billing-address.view.tsx?b194","webpack://Msdyn365.Commerce.Online/./src/modules/checkout-shipping-address/checkout-shipping-address.view.tsx?3386","webpack://Msdyn365.Commerce.Online/./src/modules/adventureworks/views/components/product-v2.component.tsx?d155","webpack://Msdyn365.Commerce.Online/./src/modules/checkout/checkout.tsx?6737","webpack://Msdyn365.Commerce.Online/./src/modules/checkout-delivery-options/components/checkout-delivery-options.description.tsx?840c","webpack://Msdyn365.Commerce.Online/./src/modules/checkout-delivery-options/components/checkout-delivery-options.error-message.tsx?8ca3","webpack://Msdyn365.Commerce.Online/./src/modules/checkout-delivery-options/components/checkout-delivery-options.error-title.tsx?f7e7","webpack://Msdyn365.Commerce.Online/./src/modules/checkout-delivery-options/components/checkout-delivery-options.radio-button.tsx?9df9","webpack://Msdyn365.Commerce.Online/./src/modules/checkout-delivery-options/components/address-detail-item.tsx?d9a2","webpack://Msdyn365.Commerce.Online/./src/modules/checkout-delivery-options/components/checkout-cartLine-delivery-date.tsx?bd12","webpack://Msdyn365.Commerce.Online/./src/modules/checkout-delivery-options/components/checkout-cartLine-delivery-options-grp.tsx?3a15","webpack://Msdyn365.Commerce.Online/./src/modules/checkout-delivery-options/components/checkout-cartLine-delivery-options-radio.tsx?045f","webpack://Msdyn365.Commerce.Online/./src/modules/checkout-delivery-options/components/get-line-items.tsx?e389","webpack://Msdyn365.Commerce.Online/./src/modules/checkout-delivery-options/components/checkout-shipping-cartlines-images.tsx?ab7c","webpack://Msdyn365.Commerce.Online/./src/modules/checkout-delivery-options/checkout-delivery-options.tsx?6764","webpack://Msdyn365.Commerce.Online/./src/modules/checkout-gift-card/components/get-form.tsx?4540","webpack://Msdyn365.Commerce.Online/./src/modules/checkout-gift-card/components/get-item.tsx?d186","webpack://Msdyn365.Commerce.Online/./src/modules/checkout-gift-card/components/get-list.tsx?a3f3","webpack://Msdyn365.Commerce.Online/./src/modules/checkout-gift-card/components/title.tsx?3b2f","webpack://Msdyn365.Commerce.Online/./src/modules/checkout-gift-card/checkout-gift-card.tsx?8fc3","webpack://Msdyn365.Commerce.Online/./src/modules/checkout/checkout.view.tsx?e4cc","webpack://Msdyn365.Commerce.Online/./src/modules/checkout-loyalty/components/checkout-loyalty-input.tsx?cadb","webpack://Msdyn365.Commerce.Online/./src/modules/checkout-loyalty/components/checkout-loyalty-label.tsx?e02b","webpack://Msdyn365.Commerce.Online/./src/modules/checkout-loyalty/components/checkout-loyalty-text.tsx?895a","webpack://Msdyn365.Commerce.Online/./src/modules/checkout-loyalty/checkout-loyalty.tsx?8b4b","webpack://Msdyn365.Commerce.Online/./src/modules/gift-card-balance-check/components/get-form.tsx?e249","webpack://Msdyn365.Commerce.Online/./src/modules/gift-card-balance-check/components/get-item.tsx?4862","webpack://Msdyn365.Commerce.Online/./src/modules/gift-card-balance-check/gift-card-balance-check.tsx?d1f8","webpack://Msdyn365.Commerce.Online/./src/modules/quick-order-grid/components/add-to-list/add-to-cart-selected-items.tsx?de21","webpack://Msdyn365.Commerce.Online/./src/modules/quick-order-grid/components/quick-order-grid-actions.tsx?ca97","webpack://Msdyn365.Commerce.Online/./src/modules/quick-order-grid/components/quick-order-grid-drawer.tsx?8701","webpack://Msdyn365.Commerce.Online/./src/modules/quick-order-grid/components/quick-order-grid-form.tsx?5cbb","webpack://Msdyn365.Commerce.Online/./src/modules/quick-order-grid/components/quick-order-grid-product.ts?187e","webpack://Msdyn365.Commerce.Online/./src/modules/quick-order-grid/components/quick-order-grid-table/components/quick-order-grid-table-header-component.tsx?69b3","webpack://Msdyn365.Commerce.Online/./src/modules/quick-order-grid/components/quick-order-grid-table/components/quick-order-grid-table-row-component.tsx?cd92","webpack://Msdyn365.Commerce.Online/./src/modules/quick-order-grid/components/quick-order-grid-table/quick-order-grid-table-component.tsx?7cbc","webpack://Msdyn365.Commerce.Online/./src/modules/quick-order-grid/quick-order-grid.tsx?fddf","webpack://Msdyn365.Commerce.Online/./src/modules/quick-order-grid/components/utilities.ts?1806","webpack://Msdyn365.Commerce.Online/./src/modules/b2b-account-management-address/b2b-account-management-address.tsx?e47d","webpack://Msdyn365.Commerce.Online/./src/modules/b2b-checkout-billing-address/b2b-checkout-billing-address.tsx?57b6","webpack://Msdyn365.Commerce.Online/./src/modules/eve-checkout-shipping-address/components/checkout-shipping-cartlines-images.tsx?bf60","webpack://Msdyn365.Commerce.Online/./src/modules/eve-checkout-shipping-address/eve-checkout-shipping-address.tsx?fa80","webpack://Msdyn365.Commerce.Online/./src/modules/gdn-checkout-billing-address/gdn-checkout-billing-address.tsx?ab6c","webpack://Msdyn365.Commerce.Online/./src/modules/b2b-account-management-address/b2b-account-management-address.view.tsx?187b","webpack://Msdyn365.Commerce.Online/./src/modules/b2b-checkout-billing-address/b2b-checkout-billing-address.view.tsx?c8d4","webpack://Msdyn365.Commerce.Online/./src/modules/eve-checkout-shipping-address/eve-checkout-shipping-address.view.tsx?21bf","webpack://Msdyn365.Commerce.Online/./src/modules/gdn-checkout-billing-address/gdn-checkout-billing-address.props.autogenerated.ts?a053","webpack://Msdyn365.Commerce.Online/./src/modules/gdn-checkout-billing-address/gdn-checkout-billing-address.view.tsx?ede1","webpack://Msdyn365.Commerce.Online/./src/themes/gardner-theme-b2c/views/ratings-histogram.view.tsx?d36f","webpack://Msdyn365.Commerce.Online/./src/themes/gardner-theme/views/ratings-histogram.view.tsx?6aaa","webpack://Msdyn365.Commerce.Online/./src/modules/checkout-delivery-options/checkout-delivery-options.view.tsx?1e75","webpack://Msdyn365.Commerce.Online/./src/modules/checkout-gift-card/checkout-gift-card.view.tsx?d99f","webpack://Msdyn365.Commerce.Online/./src/modules/checkout-loyalty/checkout-loyalty.view.tsx?b79f","webpack://Msdyn365.Commerce.Online/./src/modules/gift-card-balance-check/gift-card-balance-check.view.tsx?a0c9","webpack://Msdyn365.Commerce.Online/./src/modules/quick-order-grid/quick-order-grid.view.tsx?f941","webpack://Msdyn365.Commerce.Online/./src/modules/adventureworks/views/cart-icon.view.tsx?7ec9","webpack://Msdyn365.Commerce.Online/./src/modules/adventureworks/views/search-result-container-v2.view.tsx?6eaa","webpack://Msdyn365.Commerce.Online/./src/modules/fabrikam/views/components/cartlineitem.component.tsx?eb8c","webpack://Msdyn365.Commerce.Online/./src/modules/checkout/components/get-line-items.tsx?92f8","webpack://Msdyn365.Commerce.Online/./src/modules/checkout/components/get-order-summary.tsx?4a81","webpack://Msdyn365.Commerce.Online/./src/checkout-errors/checkout-errors.ts?a9e0","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/modules/checkout/components/guided-form.tsx?f018","webpack://Msdyn365.Commerce.Online/./src/common/components/address-billing-heading.tsx?7bbd","webpack://Msdyn365.Commerce.Online/./src/common/components/address-error-alert.tsx?bcde","webpack://Msdyn365.Commerce.Online/./src/common/components/address-select.tsx?c1df","webpack://Msdyn365.Commerce.Online/./src/modules/checkout/components/alert.tsx?cb1e","webpack://Msdyn365.Commerce.Online/./src/modules/checkout/components/get-invoice-payment-summary.tsx?9549","webpack://Msdyn365.Commerce.Online/./src/modules/checkout/components/guided-card.tsx?58e0","webpack://Msdyn365.Commerce.Online/./src/modules/checkout/components/place-order-button.tsx?9b41","webpack://Msdyn365.Commerce.Online/./src/modules/checkout/methods/place-order.ts?5aa0","webpack://Msdyn365.Commerce.Online/./src/common/components/address-billing-checkbox.tsx?4008","webpack://Msdyn365.Commerce.Online/./src/common/components/address-ship-multiple.tsx?136d","webpack://Msdyn365.Commerce.Online/./src/common/components/address-ship-multiple-heading.tsx?5d65","webpack://Msdyn365.Commerce.Online/./src/common/components/address-ship-multiple-lines.tsx?ce68","webpack://Msdyn365.Commerce.Online/./src/modules/checkout/methods/checkout.ts?7b6b"],"sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/// \n\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport { CheckoutModule, ErrorLocation, IGiftCardExtend } from '@msdyn365-commerce/global-state';\nimport { Address, AddressPurpose, CountryRegionInfo, StateProvinceInfo } from '@msdyn365-commerce/retail-proxy';\nimport { IModuleStateProps, withModuleState, EnabledPaymentsForOBO } from '@msdyn365-commerce-modules/checkout-utilities';\nimport { getTelemetryObject, IModuleProps, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport { action, computed, observable, reaction, set } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { AutoSuggest } from '../../common/address-autosuggest';\nimport { IAutoSuggestOptions } from '../../common/address-autosuggest.data';\nimport { AddressCommon } from '../../common/address-common';\nimport { AddressFormat } from '../../common/address-format';\nimport { AddressItemType } from '../../common/address-format.data';\nimport { AddressMetaData } from '../../common/address-meta-data';\nimport { AddressOperation, AddressType, IAddressResource, IAddressResponse } from '../../common/address-module.data';\nimport { AddressAddUpdate, IAddressAddUpdateProps } from '../../common/components/address-add';\nimport { AddressBillingCheckbox } from '../../common/components/address-billing-checkbox';\nimport { AddressBillingHeading } from '../../common/components/address-billing-heading';\nimport { AddressShow, IAddressShowProps } from '../../common/components/address-show';\nimport { ICheckoutBillingAddressData } from './checkout-billing-address.data';\nimport { ICheckoutBillingAddressProps } from './checkout-billing-address.props.autogenerated';\nimport { ErrorComponent } from '../../common';\nimport { focusOnCheckoutError } from '../../checkout-errors/checkout-errors';\n\n/**\n * Props interface.\n */\nexport interface IProps extends ICheckoutBillingAddressProps, IModuleStateProps {}\n\n/**\n * Checkout billing address view state interface.\n */\nexport interface ICheckoutBillingAddressViewState {\n isShowAddress: boolean;\n isShowAddOrUpdateAddress: boolean;\n isShowSameAsShippingCheckbox: boolean;\n errorMessage?: string;\n}\n\n/**\n * Checkout billing address view props interface.\n */\nexport interface ICheckoutBillingAddressViewProps extends IProps {\n className: string;\n currentOperation: AddressOperation;\n selectedAddress?: Address;\n addUpdateAddress: Address;\n countryRegionId: string;\n stateProvinceInfo?: StateProvinceInfo[];\n validationError: object;\n addressActionResponse?: IAddressResponse;\n viewState: ICheckoutBillingAddressViewState;\n CheckoutBillingAddress: IModuleProps;\n sameAsShippingCheckbox: React.ReactNode;\n heading: React.ReactNode;\n showAddress: IAddressShowProps;\n showAddOrUpdateAddress: IAddressAddUpdateProps;\n alert?: React.ReactNode;\n checkoutErrorRef?: React.RefObject;\n}\n\n/**\n *\n * CheckoutBillingAddress component.\n * @extends {React.PureComponent>}\n */\n// @ts-expect-error\n@withModuleState\n@observer\nclass CheckoutBillingAddress extends React.Component {\n @observable private currentOperation: AddressOperation;\n\n @observable private isBillingAddressSameAsShipping: boolean;\n\n @observable private selectedAddress?: Address;\n\n @observable private addUpdateAddress: Address;\n\n @observable private countryRegionId: string = 'USA';\n\n @observable private stateProvinceInfo?: StateProvinceInfo[];\n\n @observable private validationError: object;\n\n @observable private readonly addressActionResponse?: IAddressResponse;\n\n private readonly addressCommon: AddressCommon;\n\n private addressFormat: AddressFormat;\n\n private countryRegions: CountryRegionInfo[] = [];\n\n private addressPurposes: AddressPurpose[] = [];\n\n private readonly resources: IAddressResource;\n\n private readonly defaultAddressType: number = 6; // Default to Home\n\n // private addRenderRef: React.RefObject;\n private readonly telemetryContent?: ITelemetryContent;\n\n private autoSuggest?: AutoSuggest;\n\n private readonly checkoutErrorRef: React.RefObject = React.createRef();\n\n public constructor(props: IProps) {\n super(props);\n const { context, data, resources, telemetry } = this.props;\n\n this.addUpdateAddress = {};\n this.validationError = {};\n this.isBillingAddressSameAsShipping = false;\n this.resources = resources;\n this.currentOperation = AddressOperation.List;\n this.addressPurposes = data.addressPurposes.result || [];\n this.countryRegions = data.countryRegions.result || [];\n this.stateProvinceInfo = data.countryStates.result || [];\n this.addressCommon = new AddressCommon(context, resources, telemetry);\n this.addressFormat = new AddressFormat(\n this.countryRegions,\n new AddressMetaData({ ...resources }, this._getAddressFormatExcludeList()),\n this.addressPurposes\n );\n this.telemetryContent = getTelemetryObject(\n this.props.context.request.telemetryPageName!,\n this.props.friendlyName,\n this.props.telemetry\n );\n\n this.state = {\n isShowAddress: false,\n isShowAddOrUpdateAddress: false,\n isShowSameAsShippingCheckbox: false,\n errorMessage: ''\n };\n\n // This.addRenderRef = React.createRef();\n }\n\n public async componentDidMount(): Promise {\n const {\n context: {\n telemetry,\n actionContext: {\n requestContext: { channel }\n }\n },\n config: { autoSuggestionEnabled, autoSuggestOptions }\n } = this.props;\n\n // Initializing data props\n this._dataInitialize(this.props);\n\n this.props.data.checkout.then(() => {\n this._setDefaultCountryRegionId();\n this._initModuleState();\n });\n\n reaction(\n () => this.countryRegionId,\n () => {\n this._getStateProvinces();\n }\n );\n\n reaction(\n () => this.currentOperation,\n () => {\n this._getStateProvinces();\n }\n );\n\n reaction(\n () => this.props.data.checkout.result && this.props.data.checkout.result.shippingAddress,\n shippingAddress => {\n if (this.props.moduleState.isUpdating) {\n if (shippingAddress && this.isBillingAddressSameAsShipping) {\n this.isBillingAddressSameAsShipping = true;\n this._updateCurrentOperation(AddressOperation.Show, shippingAddress);\n } else if (shippingAddress && this.isBillingAddressSameAsShipping) {\n this._updateCurrentOperation(AddressOperation.Show, shippingAddress);\n }\n }\n }\n );\n\n reaction(\n () => this.isBillingAddressRequried,\n isBillingAddressRequried => {\n if (isBillingAddressRequried) {\n if (this.props.moduleState.isDisabled) {\n this.onEdit();\n }\n } else {\n this.props.data.checkout.result?.removeBillingAddress({});\n this.props.moduleState.onDisable();\n }\n }\n );\n\n if (autoSuggestionEnabled) {\n if (channel && !channel.BingMapsApiKey) {\n telemetry.error('BingMapsApiKey is missing.');\n return;\n }\n\n if (channel && !channel.BingMapsEnabled) {\n telemetry.error('Map is disabled from HQ.');\n return;\n }\n\n const options: IAutoSuggestOptions = { ...autoSuggestOptions };\n this.autoSuggest = new AutoSuggest(\n telemetry,\n options,\n channel?.BingMapsApiKey,\n channel?.ChannelCountryRegionISOCode,\n channel?.DefaultLanguageId\n );\n\n // Customer doesn't have any address. Then add view will be loaded directly. Code for the same to handle that\n if (\n this.props.data.storeSelectorStateManager.result &&\n (this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update)\n ) {\n await this.autoSuggest._loadMapAPI(await this.props.data.storeSelectorStateManager);\n }\n\n reaction(\n () =>\n this.props.data.storeSelectorStateManager.result?.loadMapApi &&\n (this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update),\n async () => {\n await this.autoSuggest?._loadMapAPI(await this.props.data.storeSelectorStateManager);\n }\n );\n\n reaction(\n () => this.props.data.storeSelectorStateManager.result?.isMapApiLoaded,\n async () => {\n await this._attachMapAutoSuggest();\n }\n );\n }\n\n if (this.props.data.checkout.result?.shouldEnableCheckoutErrorDisplayMessaging) {\n reaction(\n () => this.props.data.checkout.result?.checkoutError,\n checkoutError => {\n if (\n checkoutError &&\n checkoutError.errorLocation === ErrorLocation.CheckoutBillingAddress &&\n checkoutError.errorMessage\n ) {\n this._setErrorMessage(checkoutError.errorMessage);\n }\n }\n );\n\n reaction(\n () => this.props.data.checkout.result?.checkoutErrorFocus,\n checkoutErrorFocus => {\n if (checkoutErrorFocus === CheckoutModule.CheckoutBillingAddress) {\n focusOnCheckoutError(this.checkoutErrorRef, this.props.context.actionContext);\n }\n }\n );\n }\n }\n\n public async componentDidUpdate(): Promise {\n if (this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update) {\n if (this.props.data.storeSelectorStateManager.result?.isMapApiLoaded) {\n await this._attachMapAutoSuggest();\n }\n } else {\n this.autoSuggest?.disposeAutoSuggest();\n }\n }\n\n public shouldComponentUpdate(\n nextProps: ICheckoutBillingAddressProps,\n nextState: ICheckoutBillingAddressViewState\n ): 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 | null {\n if (!this.isBillingAddressRequried || this._shouldHideBillingAddressForOBO) {\n return null;\n }\n\n const {\n resources,\n moduleState: { hasError }\n } = this.props;\n\n const { renderView, config } = this.props;\n\n const errorMessage = this.state.errorMessage;\n\n const viewProps = {\n ...this.props,\n currentOperation: this.currentOperation,\n selectedAddress: this.selectedAddress,\n addUpdateAddress: this.addUpdateAddress,\n countryRegionId: this.countryRegionId,\n stateProvinceInfo: this.stateProvinceInfo,\n validationError: this.validationError,\n addressActionResponse: this.addressActionResponse,\n className: config.className,\n viewState: {\n isShowAddress: this.selectedAddress && this.currentOperation === AddressOperation.Show,\n isShowAddOrUpdateAddress: this.currentOperation !== AddressOperation.Show,\n isShowSameAsShippingCheckbox: this.isCartContainsItemsForShipping && this.props.moduleState.isUpdating\n },\n CheckoutBillingAddress: {\n moduleProps: this.props,\n className: classnames('ms-checkout-billing-address', config.className)\n },\n heading: ,\n alert: hasError && errorMessage && ,\n checkoutErrorRef: this.checkoutErrorRef,\n\n sameAsShippingCheckbox: (\n \n ),\n showAddress: this._renderShowAddress(),\n showAddOrUpdateAddress: this._renderAddOrUpdateAddress()\n };\n\n return renderView(viewProps) as React.ReactElement;\n }\n\n /**\n * On suggestion selected.\n * @param result - The suggestion result.\n */\n @action\n private readonly _onSuggestionSelected = async (result: Microsoft.Maps.ISuggestionResult): Promise => {\n this._clearAddressFields();\n const address = this.addressFormat.getTranformedAddress(result, this.stateProvinceInfo);\n set(this.addUpdateAddress, { Street: '' });\n set(this.addUpdateAddress, { ZipCode: address.ZipCode });\n set(this.addUpdateAddress, { CountyName: address.CountyName });\n set(this.addUpdateAddress, { City: address.City });\n set(this.addUpdateAddress, { State: address.State });\n set(this.addUpdateAddress, { DistrictName: address.DistrictName });\n set(this.addUpdateAddress, { FullAddress: address.FullAddress });\n\n // Bing autosuggest put the complete address in the Street input box. Updating the street input box to show only street address.\n setTimeout(() => {\n set(this.addUpdateAddress, { Street: address.Street });\n }, 0);\n };\n\n /**\n * Clear address fields.\n */\n @action\n private readonly _clearAddressFields = (): void => {\n const addressFormatItem = this.addressFormat.getAddressFormat(\n this.addUpdateAddress.ThreeLetterISORegionName || this.countryRegionId\n );\n addressFormatItem.forEach(format => {\n if (this.addUpdateAddress[format.name] !== undefined && !this.autoSuggest?.excludedAddressFields.includes(format.name)) {\n this.addressFormat[format.name] = '';\n }\n });\n this._clearValidation();\n };\n\n /**\n * Clear validation.\n */\n @action\n private readonly _clearValidation = (): void => {\n this.validationError = {};\n };\n\n /**\n * On address update.\n * @param name - Name.\n * @param value - Value.\n */\n private readonly onAddressAddUpdate = (name: string, value: string) => {\n set(this.addUpdateAddress, { [name]: value });\n this.addressFormat.validateAddressFormat(this.addUpdateAddress, this.validationError, this.countryRegionId, name);\n };\n\n /**\n * Method data initialization.\n * @param props -The checkout address properties.\n */\n private readonly _dataInitialize = (props: IProps): void => {\n const { data } = props;\n\n reaction(\n () => data.countryRegions.result,\n () => {\n this.countryRegions = data.countryRegions.result ?? [];\n }\n );\n\n reaction(\n () => data.addressPurposes.result,\n () => {\n this.addressPurposes = data.addressPurposes.result ?? [];\n }\n );\n\n reaction(\n () => data.countryStates.result,\n () => {\n this.stateProvinceInfo = data.countryStates.result ?? [];\n }\n );\n };\n\n /**\n * Render add or update address function.\n * @returns - Address add update props.\n */\n private readonly _renderAddOrUpdateAddress = (): IAddressAddUpdateProps => {\n return AddressAddUpdate({\n resources: this.resources,\n addressType: AddressType.Billing,\n addressFormat: this.addressFormat.getAddressFormat(this.addUpdateAddress.ThreeLetterISORegionName ?? this.countryRegionId),\n defaultCountryRegionId: this.countryRegionId,\n defaultAddressType: this.defaultAddressType,\n selectedAddress: this.addUpdateAddress,\n validationError: this.validationError,\n addressActionResponse: this.addressActionResponse,\n dropdownDisplayData: this.addressFormat.getPrefilledAddressDropdownData(\n this.resources.addressStateDefaultSelectionText,\n this.stateProvinceInfo\n ),\n telemetryContent: this.telemetryContent,\n onInputChange: this._onAddressAddUpdateInputChange,\n onDropdownChange: this._onAddressAddUpdateDropdownChange,\n hasExternalSubmitGroup: this.props.moduleState.hasExternalSubmitGroup,\n onSave: this._onSubmitAddress,\n onCancel: this._resetView\n });\n };\n\n private _renderShowAddress(): IAddressShowProps | null {\n if (this.selectedAddress) {\n return AddressShow({\n address: this.selectedAddress,\n addressFormat: this.addressFormat.getAddressFormat(this.selectedAddress.ThreeLetterISORegionName ?? ''),\n addressPurposes: this.addressPurposes\n });\n }\n\n return null;\n }\n\n /**\n * On country region change function.\n * @param countryRegionId - Country region Id.\n */\n private readonly _onCountryChange = (countryRegionId: string) => {\n this.countryRegionId = countryRegionId;\n const twoLetterIsoRegionName = this.addressFormat.getTwoLetterISORegionName(countryRegionId);\n set(this.addUpdateAddress, { ThreeLetterISORegionName: countryRegionId });\n set(this.addUpdateAddress, { TwoLetterISORegionName: twoLetterIsoRegionName });\n this.autoSuggest?.changeAutoSuggestionCountryCode(twoLetterIsoRegionName);\n this._clearAddressFields();\n };\n\n /**\n * Gets address format for exclude list.\n * @returns - Address item type.\n */\n private readonly _getAddressFormatExcludeList = (): AddressItemType[] => {\n const { config } = this.props;\n const addressFormatExcludeList: AddressItemType[] = [];\n\n if (!config.showAddressType) {\n addressFormatExcludeList.push(AddressItemType.AddressTypeValue);\n }\n\n addressFormatExcludeList.push(AddressItemType.IsPrimary);\n\n return addressFormatExcludeList;\n };\n\n /**\n * Attach map auto suggest.\n */\n private readonly _attachMapAutoSuggest = async (): Promise => {\n const {\n data: {\n storeSelectorStateManager: { result: storeSelectorStateManager }\n }\n } = this.props;\n\n if (storeSelectorStateManager?.isMapApiLoaded) {\n this.autoSuggest?.attachAutoSuggest('#billing_addressstreet', '#billing_addressstreet_container', this._onSuggestionSelected);\n }\n };\n\n /**\n * On address add update input change.\n * @param event - The event.\n */\n private readonly _onAddressAddUpdateInputChange = (event: React.ChangeEvent): void => {\n const value = (event.target.value || '').replace(new RegExp('[<>]', 'gi'), '');\n this.onAddressAddUpdate(event.target.name, value);\n };\n\n /**\n * On address add update dropdown change.\n * @param event - The event.\n */\n private readonly _onAddressAddUpdateDropdownChange = (event: React.ChangeEvent): void => {\n this.onAddressAddUpdate(event.target.name, event.target.value);\n\n if (event.target.name === AddressItemType[AddressItemType.ThreeLetterISORegionName]) {\n this._onCountryChange(event.target.value);\n }\n };\n\n /**\n * Gets state provinces.\n */\n private readonly _getStateProvinces = (): void => {\n if (\n !this.countryRegionId ||\n !(this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update)\n ) {\n return;\n }\n\n this.addressCommon.getStateProvinces(this.countryRegionId).then((result: StateProvinceInfo[]) => {\n const stateInfo = result.some(state => state.StateId === this.addUpdateAddress.State);\n\n // Reset state if selected state not found in the list.\n if (!stateInfo) {\n set(this.addUpdateAddress, { State: '' });\n }\n this.stateProvinceInfo = result;\n });\n };\n\n /**\n * Initialize module state.\n */\n private readonly _initModuleState = (): void => {\n this.props.moduleState.init({\n status: this.isBillingAddressRequried ? 'updating' : 'disabled',\n onEdit: this.onEdit,\n onCancel: this.onCancel,\n onSubmit: this.onSubmit\n });\n\n const { billingAddress, isBillingAddressSameAsShippingAddress } = this.props.data.checkout.result ?? {};\n\n if (this.isBillingAddressRequried) {\n if (billingAddress) {\n this.isBillingAddressSameAsShipping = isBillingAddressSameAsShippingAddress ?? false;\n this._updateCurrentOperation(AddressOperation.Show, billingAddress);\n this._updateModuleState();\n } else if (this.isCartContainsItemsForShipping) {\n this.isBillingAddressSameAsShipping = true;\n this._updateCurrentOperation(AddressOperation.Show, this.shippingAddress);\n } else {\n this.isBillingAddressSameAsShipping = false;\n this._updateCurrentOperation(AddressOperation.Add);\n }\n }\n };\n\n /**\n * Sets default country region Id.\n */\n private _setDefaultCountryRegionId(): void {\n const { request } = this.props.context;\n const market = request.channel?.ChannelCountryRegionISOCode;\n\n this.countryRegionId = this.addressCommon.getDefaultCountryRegionId(this.countryRegionId, this.countryRegions, market);\n }\n\n /**\n * On change - Billing address same as shipping.\n * @param event - The event.\n */\n private readonly _onBillingAddressSameAsShippingChange = (event: React.ChangeEvent) => {\n this.isBillingAddressSameAsShipping = event.currentTarget.checked;\n\n if (this.isBillingAddressSameAsShipping && this.shippingAddress) {\n this._updateCurrentOperation(AddressOperation.Show, this.shippingAddress);\n } else {\n this._updateCurrentOperation(AddressOperation.Add, this.billingAddress);\n }\n };\n\n @computed private get isCartContainsItemsForShipping(): boolean {\n const { request } = this.props.context;\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\n const { channelDeliveryOptionConfig, featureState } = this.props.data;\n const retailMultiplePickUpOptionEnabled = featureState.result?.find(feature => feature.Name === multiplePickupStoreSwitchName)\n ?.IsEnabled;\n\n const pickupDeliveryModeCode = request.channel?.PickupDeliveryModeCode;\n const emailDeliveryModeCode = request.channel?.EmailDeliveryModeCode;\n\n // If hasInvoiceLine is true, there are only invoices no items in cart and return false here\n return this.props.data.checkout.result?.checkoutCart.hasInvoiceLine\n ? false\n : retailMultiplePickUpOptionEnabled\n ? ((this.props.data.checkout.result && this.props.data.checkout.result.checkoutCart.cart.CartLines) || []).some(cartLine =>\n cartLine.DeliveryMode && cartLine.DeliveryMode !== ''\n ? cartLine.DeliveryMode !==\n channelDeliveryOptionConfig.result?.PickupDeliveryModeCodes?.find(\n deliveryMode => deliveryMode === cartLine.DeliveryMode\n ) && cartLine.DeliveryMode !== emailDeliveryModeCode\n : cartLine\n )\n : ((this.props.data.checkout.result && this.props.data.checkout.result.checkoutCart.cart.CartLines) || []).some(cartLine =>\n cartLine.DeliveryMode && cartLine.DeliveryMode !== ''\n ? cartLine.DeliveryMode !== pickupDeliveryModeCode && cartLine.DeliveryMode !== emailDeliveryModeCode\n : cartLine\n );\n }\n\n @computed private get billingAddress(): Address | undefined {\n return this.props.data.checkout.result?.billingAddress;\n }\n\n @computed private get shippingAddress(): Address | undefined {\n return this.props.data.checkout.result?.shippingAddress;\n }\n\n @computed private get getLoyaltyAmount(): number {\n const checkoutState = this.props.data.checkout.result;\n return checkoutState?.loyaltyAmount ? checkoutState.loyaltyAmount : 0;\n }\n\n @computed private get getGiftCardTotalAmount(): number {\n const checkoutState = this.props.data.checkout.result;\n if (!checkoutState || !checkoutState.giftCardExtends) {\n return 0;\n }\n return checkoutState.giftCardExtends.reduce((count: number, giftCard: IGiftCardExtend) => {\n return count + (giftCard.Balance || 0);\n }, 0);\n }\n\n @computed private get getCustomerAccountAmount(): number {\n const checkoutState = this.props.data.checkout.result;\n const defaultAmount = 0;\n\n return checkoutState?.customerAccountAmount ?? defaultAmount;\n }\n\n @computed private get shouldPaidByCard(): boolean {\n const {\n data: { checkout },\n config\n } = this.props;\n if (!checkout.result) {\n return false;\n }\n\n const checkoutResult = checkout.result;\n const cart = checkoutResult.checkoutCart.cart;\n if (!cart || !cart.CartLines || cart.CartLines.length === 0) {\n return false;\n }\n\n const { paymentTenderType, tokenizedPaymentCard } = checkoutResult;\n const isPaidByOtherPaymentSource = config.paymenTenderType !== paymentTenderType && tokenizedPaymentCard;\n\n // Use payment card when it is not free or gift card balance + Loyalty amount can not cover the total amount\n const amountDue = (cart.TotalAmount || 0) - this.getGiftCardTotalAmount - this.getLoyaltyAmount - this.getCustomerAccountAmount;\n\n return amountDue > 0 && !isPaidByOtherPaymentSource;\n }\n\n @computed private get isBillingAddressRequried(): boolean {\n return (\n this.shouldPaidByCard &&\n (!this.props.data.checkout?.result?.isPaymentVerificationRedirection ||\n !!this.props.data.checkout?.result?.isCheckoutCallFailed)\n );\n }\n\n @computed private get _shouldHideBillingAddressForOBO(): boolean {\n return Msdyn365.isOboRequest(this.props.context.request) && EnabledPaymentsForOBO.PaymentInstrument === 0;\n }\n\n /**\n * On submit address.\n */\n private readonly _onSubmitAddress = (): void => {\n if (!this.addressFormat.validateAddressFormat(this.addUpdateAddress, this.validationError, this.countryRegionId)) {\n this.props.moduleState.setHasError(true);\n\n if (\n this.props.data.checkout.result?.shouldEnableSinglePaymentAuthorizationCheckout &&\n this.props.data.checkout.result?.isPaymentSectionContainerHasError\n ) {\n this.props.data.checkout.result.updateIsBillingAddressHasError({ newIsBillingAddressHasError: true });\n }\n\n return;\n }\n\n this._setBillingAddress(this.addUpdateAddress);\n this._updateCurrentOperation(AddressOperation.Show, this.addUpdateAddress);\n this._updateModuleState();\n };\n\n /**\n * On submit.\n */\n private readonly onSubmit = (): void => {\n switch (this.currentOperation) {\n case AddressOperation.Add:\n case AddressOperation.Update:\n this.props.telemetry.information('Billing address submit for Add or Update operation.');\n this._onSubmitAddress();\n break;\n case AddressOperation.Show:\n this.props.telemetry.information('Billing address submit for Show operation.');\n if (this.selectedAddress) {\n this._setBillingAddress(this.selectedAddress);\n this._updateCurrentOperation(AddressOperation.Show, this.selectedAddress);\n this._updateModuleState();\n }\n break;\n default:\n this.props.telemetry.error('Invalid operation');\n }\n };\n\n /**\n * On cancel.\n */\n private readonly onCancel = (): void => {\n switch (this.currentOperation) {\n case AddressOperation.Add:\n case AddressOperation.Update:\n this.props.telemetry.information('Billing address cancel for Add or Update operation.');\n this._resetView();\n this._clearAddressFields();\n break;\n case AddressOperation.Show:\n this.props.telemetry.information('Billing address cancel for Show operation.');\n this._resetView();\n break;\n default:\n this.props.telemetry.error('Invalid operation');\n }\n };\n\n /**\n * On edit.\n */\n private readonly onEdit = (): void => {\n this.props.telemetry.information('Billing address onEdit is called.');\n\n if (this.isBillingAddressSameAsShipping && this.shippingAddress && this.isCartContainsItemsForShipping) {\n this._updateCurrentOperation(AddressOperation.Show, this.shippingAddress);\n } else {\n this._updateCurrentOperation(AddressOperation.Add, this.billingAddress);\n }\n this.props.moduleState.onUpdating();\n };\n\n /**\n * Sets billing address.\n * @param address - The address.\n */\n private readonly _setBillingAddress = (address: Address): void => {\n if (this.props.data.checkout.result) {\n const newBillingAddress = { ...address };\n\n if (address.ThreeLetterISORegionName && !newBillingAddress.TwoLetterISORegionName) {\n newBillingAddress.TwoLetterISORegionName = this.addressFormat.getTwoLetterISORegionName(address.ThreeLetterISORegionName);\n }\n\n this.props.data.checkout.result.updateBillingAddress({\n newBillingAddress,\n additionalProperties: {\n isBillingAddressSameAsShippingAddress: this.isBillingAddressSameAsShipping\n }\n });\n }\n };\n\n /**\n * Reset view.\n */\n private readonly _resetView = () => {\n this._updateCurrentOperation(AddressOperation.Show, this.billingAddress);\n this._updateModuleState();\n };\n\n /**\n * Update current operation.\n * @param operation - Address operation\n * @param selectedAddress - The selected address.\n */\n private readonly _updateCurrentOperation = (operation: AddressOperation, selectedAddress?: Address) => {\n this.currentOperation = operation;\n this.selectedAddress = selectedAddress;\n\n if (this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update) {\n this.addUpdateAddress = { ...this.selectedAddress } || {};\n set(this.addUpdateAddress, {\n ThreeLetterISORegionName: this.addUpdateAddress.ThreeLetterISORegionName || this.countryRegionId\n });\n set(this.addUpdateAddress, { AddressTypeValue: this.addUpdateAddress.AddressTypeValue || this.defaultAddressType });\n }\n };\n\n /**\n * Updates the module state.\n */\n private readonly _updateModuleState = () => {\n if (this.currentOperation === AddressOperation.Show) {\n this.props.moduleState.onReady();\n } else {\n this.props.moduleState.onUpdating();\n }\n };\n\n @action\n private readonly _setErrorMessage = (errorMessage: string): void => {\n this.props.telemetry.error(errorMessage);\n this.props.moduleState.setHasError(true);\n this.props.moduleState.onUpdating();\n this.setState({\n errorMessage\n });\n };\n}\n\nexport default CheckoutBillingAddress;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IImageProps, IImageSettings, Image, IRequestContext } from '@msdyn365-commerce/core';\nimport { CartLine, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { format, isMobile, VariantType } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { ICheckoutShippingAddressResources } from '../checkout-shipping-address.props.autogenerated';\n\n/**\n * The cartline product interface.\n */\nexport interface ICartLineWithProduct {\n cartLine: CartLine;\n product?: SimpleProduct;\n}\n\n/**\n * The checkout shipping cartline interface.\n */\nexport interface ICheckoutShippingCartLineInfo {\n lineId: string;\n imageProps: IImageProps;\n quantity: number;\n shippingAddressId?: number;\n}\n\n/**\n * The checkout shipping cartline props.\n */\nexport interface ICheckoutShippingCartLinesProps {\n moduleClassName: string;\n cartLines: ICheckoutShippingCartLineInfo[];\n title: string;\n itemTitle: string;\n resources: ICheckoutShippingAddressResources;\n isMultipleAddressShippingEnabled?: boolean;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Following as per module\nexport const CheckoutPickupCartLines: React.FC = ({\n moduleClassName,\n cartLines,\n title,\n itemTitle,\n resources,\n isMultipleAddressShippingEnabled = false\n}) => {\n const context = ({\n gridSettings: {\n xs: { w: 767 },\n sm: { w: 991 },\n md: { w: 1199 },\n lg: { w: 1599 },\n xl: { w: 1600 }\n }\n } as unknown) as IRequestContext;\n const isMobileCheck = isMobile({ variant: VariantType.Browser, context });\n const isMobileView = isMobileCheck === 'xs' || isMobileCheck === 'sm';\n\n if (!ArrayExtensions.hasElements(cartLines)) {\n return null;\n }\n\n const renderShipMultiAddressView = isMultipleAddressShippingEnabled;\n const quantity = 1;\n return renderShipMultiAddressView ? (\n
{resources.headingAfterMultiSelectAddressSelect}
\n ) : (\n
\n
\n
{title}
\n
{itemTitle}
\n
\n
\n {cartLines.map((cartLine: ICheckoutShippingCartLineInfo) => {\n const isShowQty = cartLine.quantity > quantity;\n let className = `${moduleClassName}__group-images-lines-product`;\n const role = 'text';\n if (isShowQty) {\n className = classnames(className, ' product-image-wide');\n }\n return (\n
\n \n {isMobileView\n ? isShowQty && (\n \n {cartLine.quantity}\n
\n )\n : isShowQty && (\n
\n )}\n {!isMobileView && isShowQty && (\n \n {format(resources.productQuantityInfo, cartLine.quantity, cartLine.imageProps.altText)}\n \n )}\n
\n );\n })}\n \n \n );\n};\n\n/**\n * The checkout shipping cartline image settings.\n */\nexport const defaultImageSettings: IImageSettings = {\n viewports: {\n xs: { q: 'w=108&h=108&q=80&m=6&f=jpg', w: 108, h: 108 },\n lg: { q: 'w=108&h=108&q=80&m=6&f=jpg', w: 108, h: 108 },\n xl: { q: 'w=108&h=108&q=80&m=6&f=jpg', w: 108, h: 108 }\n },\n lazyload: true,\n quality: 80\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/// \n\nimport {\n Address,\n AddressPurpose,\n CartLine,\n CountryRegionInfo,\n SimpleProduct,\n StateProvinceInfo,\n TenderLine,\n TokenizedPaymentCard\n} from '@msdyn365-commerce/retail-proxy';\nimport MsDyn365 from '@msdyn365-commerce/core';\nimport { IModuleStateProps, withModuleState } from '@msdyn365-commerce-modules/checkout-utilities';\nimport {\n ArrayExtensions,\n getFallbackImageUrl,\n getSimpleProducts,\n ObjectExtensions,\n ProductInput\n} from '@msdyn365-commerce-modules/retail-actions';\nimport { format, getTelemetryObject, IModuleProps, INodeProps, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport { action, computed, observable, reaction, set } from 'mobx';\nimport { observer } from 'mobx-react';\nimport get from 'lodash/get';\nimport * as React from 'react';\n\nimport { CheckoutModule, ErrorLocation } from '@msdyn365-commerce/global-state';\nimport { AutoSuggest } from '../../common/address-autosuggest';\nimport { IAutoSuggestOptions } from '../../common/address-autosuggest.data';\nimport { AddressCommon } from '../../common/address-common';\nimport { AddressFormat } from '../../common/address-format';\nimport { AddressItemType } from '../../common/address-format.data';\nimport { AddressMetaData } from '../../common/address-meta-data';\nimport { AddressOperation, AddressType, IAddressResource, IAddressResponse } from '../../common/address-module.data';\nimport { AddressAddUpdate, IAddressAddUpdateProps } from '../../common/components/address-add';\nimport { AddressSelect, IAddressSelectProps } from '../../common/components/address-select';\nimport { AddressShow, IAddressShowProps } from '../../common/components/address-show';\nimport { ICheckoutShippingAddressData } from './checkout-shipping-address.data';\nimport { ICheckoutShippingAddressProps } from './checkout-shipping-address.props.autogenerated';\nimport {\n CheckoutPickupCartLines,\n defaultImageSettings,\n ICartLineWithProduct,\n ICheckoutShippingCartLineInfo,\n ICheckoutShippingCartLinesProps\n} from './components/checkout-shipping-cartlines-images';\nimport { ErrorComponent } from '../../common/components/address-error-alert';\nimport { focusOnCheckoutError } from '../../checkout-errors/checkout-errors';\nimport { AddressShipMultiple, IShipMultipleAddressesViewProps } from '../../common/components/address-ship-multiple';\nimport { IShipMultipleAddressesLineViewProps } from '../../common/components/address-ship-multiple-lines';\n\n/**\n * The checkout address props interface.\n */\nexport interface ICheckoutAddressProps extends ICheckoutShippingAddressProps, IModuleStateProps {}\n\n/**\n * The checkout shipping address view state.\n */\nexport interface ICheckoutShippingAddressViewState {\n isShowAddress: boolean;\n isShowAddresList: boolean;\n isShowAddOrUpdateAddress: boolean;\n isShowShipMultipleAddress?: boolean;\n}\n\n/**\n * The checkout shipping address state.\n */\nexport interface ICheckoutAddresState {\n shippingGroups: ICartLineWithProduct[];\n shippingGroupsBuffer: ICartLineWithProduct[];\n selectedShippingLines: IShipMultipleAddressesLineViewModel[];\n errorMessage?: string;\n}\n\n/**\n * The checkout shipping address view props.\n */\nexport interface ICheckoutShippingAddressViewProps extends ICheckoutAddressProps {\n className: string;\n currentOperation: AddressOperation;\n selectedAddress?: Address;\n addUpdateAddress: Address;\n addressListSelectedAddress: Address;\n countryRegionId: string;\n stateProvinceInfo?: StateProvinceInfo[];\n customerAddresses: Address[];\n validationError: object;\n addressActionResponse?: IAddressResponse;\n viewState: ICheckoutShippingAddressViewState;\n CheckoutShippingAddress: IModuleProps;\n isUpdating: boolean;\n hasError: boolean;\n showAddress: IAddressShowProps;\n showAddOrUpdateAddress: IAddressAddUpdateProps;\n cartLineImages?: React.ReactNode;\n showAddressSelect: IAddressSelectProps;\n alert?: React.ReactNode;\n checkoutErrorRef?: React.RefObject;\n showShipMultipleAddresses?: IShipMultipleAddressesViewProps;\n ProductsTable?: INodeProps;\n ProductsTableRow?: INodeProps;\n ProductsTableHeading?: React.ReactNode;\n orderLines?: IShipMultipleAddressesLineViewProps[];\n showAddOrUpdateAddressHandler?(onSaveHandler?: () => void, onCancelHandler?: () => void): IAddressAddUpdateProps;\n showAddressSelectHandler?(\n onShipMultipleAddressesHandler?: () => void,\n onAddAddressHandler?: () => void,\n onSaveHandler?: () => void,\n onCancelHandler?: () => void\n ): IAddressSelectProps;\n}\n\nexport interface IShipMultipleAddressesLineViewModel {\n isChecked: boolean;\n cartLine: CartLine;\n}\n\n/**\n * IExpressPaymentDetail interface.\n */\ninterface IExpressPaymentDetails {\n email?: string;\n tenderLine?: TenderLine;\n tokenizedPaymentCard?: TokenizedPaymentCard;\n paymentTenderType?: string;\n address?: Address;\n isExpressCheckoutAppliedInCartPage: boolean;\n isExpressAddressAppliedInCartPage?: boolean;\n}\n\ntype GridSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\n/**\n *\n * Address component.\n * @extends {React.Component>}\n */\n// @ts-expect-error\n@withModuleState\n@observer\nclass CheckoutShippingAddress extends React.Component {\n @observable private currentOperation: AddressOperation;\n\n @observable private selectedAddress?: Address;\n\n @observable private addUpdateAddress: Address;\n\n @observable private countryRegionId: string = 'USA';\n\n @observable private stateProvinceInfo?: StateProvinceInfo[];\n\n @observable private customerAddresses: Address[] = [];\n\n @observable private validationError: object;\n\n @observable private addressActionResponse?: IAddressResponse;\n\n @observable private isUpdating?: boolean;\n\n @observable private hasError?: boolean;\n\n @observable private addressListSelectedAddress: Address = {};\n\n @observable\n private _viewport: GridSize;\n\n @computed get isMobile(): boolean {\n return this._viewport === 'xs' || this._viewport === 'sm';\n }\n\n private readonly addressCommon: AddressCommon;\n\n private addressFormat!: AddressFormat;\n\n private countryRegions: CountryRegionInfo[] = [];\n\n private addressPurposes: AddressPurpose[] = [];\n\n private readonly resources: IAddressResource;\n\n private readonly defaultAddressType: number = 6; // Default to Home\n\n private readonly telemetryContent?: ITelemetryContent;\n\n private autoSuggest?: AutoSuggest;\n\n private readonly multiplePickupStoreSwitchName: string = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\n\n private retailMultiplePickUpOptionEnabled?: boolean = false;\n\n private readonly checkoutErrorRef: React.RefObject = React.createRef();\n\n public constructor(props: ICheckoutAddressProps) {\n super(props);\n this._viewport =\n props.context.request && props.context.request.device && props.context.request.device.Type === 'Mobile' ? 'xs' : 'lg';\n this._updateViewport = this._updateViewport.bind(this);\n this.state = { shippingGroups: [], shippingGroupsBuffer: [], selectedShippingLines: [] };\n const { context, data, resources, telemetry } = this.props;\n\n this.addUpdateAddress = {};\n this.resources = resources;\n this.currentOperation = AddressOperation.List;\n this.countryRegions = data.countryRegions.result || [];\n this.addressPurposes = data.addressPurposes.result || [];\n this.customerAddresses = data.address.result || [];\n this.stateProvinceInfo = data.countryStates.result || [];\n this.addressCommon = new AddressCommon(context, resources, telemetry);\n this.addressFormat = new AddressFormat(\n this.countryRegions,\n new AddressMetaData({ ...resources }, this._getAddressFormatExcludeList()),\n this.addressPurposes\n );\n this.validationError = {};\n this.retailMultiplePickUpOptionEnabled = data.featureState.result?.find(\n feature => feature.Name === this.multiplePickupStoreSwitchName\n )?.IsEnabled;\n this.telemetryContent = getTelemetryObject(\n this.props.context.request.telemetryPageName!,\n this.props.friendlyName,\n this.props.telemetry\n );\n this._updateViewport();\n }\n\n public async componentDidMount(): Promise {\n const {\n context: {\n telemetry,\n actionContext: {\n requestContext: { channel }\n }\n },\n config: { autoSuggestionEnabled, autoSuggestOptions },\n resources\n } = this.props;\n\n // Initializing data props\n this._dataInitialize(this.props);\n\n this.addressFormat = new AddressFormat(\n this.countryRegions,\n new AddressMetaData({ ...resources }, this._getAddressFormatExcludeList()),\n this.addressPurposes\n );\n\n this.props.data.checkout.then(() => {\n this._setDefaultCountryRegionId();\n this._initModuleState();\n });\n\n reaction(\n () => this.countryRegionId,\n () => {\n this._getStateProvinces();\n }\n );\n\n reaction(\n () => this.currentOperation,\n () => {\n this._getStateProvinces();\n }\n );\n\n reaction(\n () => this.props.data.checkout.result?.shippingAddressFromExpressCheckout,\n () => {\n if (!this.expressPaymentDetailsFromCartPage && this._canShip()) {\n let address = this.props.data.checkout.result?.shippingAddressFromExpressCheckout;\n\n if (address?.TwoLetterISORegionName) {\n const threeLetterIsoRegionName = this.getThreeLetterIsoRegionName(address.TwoLetterISORegionName);\n\n address = { ...address, ThreeLetterISORegionName: threeLetterIsoRegionName };\n\n if (threeLetterIsoRegionName && threeLetterIsoRegionName !== this.countryRegionId) {\n this._onCountryChange(threeLetterIsoRegionName);\n }\n }\n\n this._updateCurrentOperation(AddressOperation.Add, address);\n this._onAddressAddUpdateSubmit();\n }\n }\n );\n\n if (autoSuggestionEnabled) {\n if (channel && !channel.BingMapsApiKey) {\n telemetry.error('BingMapsApiKey is missing.');\n return;\n }\n\n if (channel && !channel.BingMapsEnabled) {\n telemetry.error('Map is disabled from HQ.');\n return;\n }\n\n const options: IAutoSuggestOptions = { ...autoSuggestOptions };\n this.autoSuggest = new AutoSuggest(\n telemetry,\n options,\n channel?.BingMapsApiKey,\n channel?.ChannelCountryRegionISOCode,\n channel?.DefaultLanguageId\n );\n\n // Customer doesn't have any address. Then add view will be loaded directly. Code for the same to handle that\n if (\n this.props.data.storeSelectorStateManager.result &&\n (this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update)\n ) {\n await this.autoSuggest._loadMapAPI(await this.props.data.storeSelectorStateManager);\n }\n\n reaction(\n () =>\n this.props.data.storeSelectorStateManager.result?.loadMapApi &&\n (this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update),\n async () => {\n await this.autoSuggest?._loadMapAPI(await this.props.data.storeSelectorStateManager);\n }\n );\n\n reaction(\n () => this.props.data.storeSelectorStateManager.result?.isMapApiLoaded,\n async () => {\n await this._attachMapAutoSuggest();\n }\n );\n }\n\n if (this.props.data.checkout.result?.shouldEnableCheckoutErrorDisplayMessaging) {\n reaction(\n () => this.props.data.checkout.result?.checkoutError,\n checkoutError => {\n if (\n checkoutError &&\n checkoutError.errorLocation === ErrorLocation.CheckoutShippingAddress &&\n checkoutError.errorMessage\n ) {\n this._setErrorMessage(checkoutError.errorMessage);\n }\n }\n );\n\n reaction(\n () => this.props.data.checkout.result?.checkoutErrorFocus,\n checkoutErrorFocus => {\n if (checkoutErrorFocus === CheckoutModule.CheckoutShippingAddress) {\n focusOnCheckoutError(this.checkoutErrorRef, this.props.context.actionContext);\n }\n }\n );\n }\n\n if (MsDyn365.isBrowser) {\n window.addEventListener('resize', this._updateViewport);\n this._updateViewport();\n }\n\n await this._initPickupGroup();\n }\n\n public async componentDidUpdate(): Promise {\n if (this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update) {\n if (this.props.data.storeSelectorStateManager.result?.isMapApiLoaded) {\n await this._attachMapAutoSuggest();\n }\n } else {\n this.autoSuggest?.disposeAutoSuggest();\n }\n }\n\n public componentWillUnmount(): void {\n if (MsDyn365.isBrowser) {\n window.removeEventListener('resize', this._updateViewport);\n }\n }\n\n public shouldComponentUpdate(nextProps: ICheckoutAddressProps, nextState: ICheckoutAddresState): 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 | null {\n if (!this._canShip()) {\n return null;\n }\n\n const {\n config,\n context,\n renderView,\n resources,\n moduleState: { hasError }\n } = this.props;\n const { headingImages, itemsText, singleItemText, errorMessageTitle } = resources;\n const { imageSettings } = config;\n\n // Line images\n const cartLines: ICheckoutShippingCartLineInfo[] = this.state.shippingGroups\n .filter(x => !ObjectExtensions.isNullOrUndefined(x.product))\n .map(line => ({\n lineId: line.cartLine.LineId ?? '',\n imageProps: {\n requestContext: context.actionContext.requestContext,\n className: 'ms-checkout-shipping-address__group-images-lines-line-image',\n altText: line.product?.Name,\n src: line.product?.PrimaryImageUrl ?? '',\n fallBackSrc: getFallbackImageUrl(\n line.product?.ItemId,\n context.actionContext.requestContext.apiSettings,\n context.request.app?.config?.OmniChannelMedia\n ),\n gridSettings: context.request.gridSettings!,\n imageSettings: imageSettings ?? defaultImageSettings,\n loadFailureBehavior: 'empty'\n },\n quantity: line.cartLine.Quantity ?? 0,\n shippingAddressId: line.cartLine.ShippingAddress?.RecordId ?? 0\n }));\n\n const numberOfCartLines = this._countItems(cartLines);\n const itemText = numberOfCartLines > 1 ? itemsText : singleItemText;\n const itemTitle = `(${format(itemText, numberOfCartLines)})`;\n\n const lineImageProps: ICheckoutShippingCartLinesProps = {\n moduleClassName: 'ms-checkout-shipping-address',\n cartLines: cartLines.filter(x => !ObjectExtensions.isNullOrUndefined(x)),\n itemTitle: itemTitle,\n title: headingImages,\n resources: this.props.resources,\n isMultipleAddressShippingEnabled: config.multipleAddressShippingEnabled\n };\n\n const cartLineImages: React.ReactNode = ;\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\n const { featureState } = this.props.data;\n const isRetailMultiplePickUpOptionEnabled = featureState.result?.find(feature => feature.Name === multiplePickupStoreSwitchName)\n ?.IsEnabled;\n\n const errorMessage = this.state.errorMessage;\n\n const viewProps = {\n ...this.props,\n currentOperation: this.currentOperation,\n selectedAddress: this.selectedAddress,\n addUpdateAddress: this.addUpdateAddress,\n addressListSelectedAddress: this.addressListSelectedAddress,\n countryRegionId: this.countryRegionId,\n stateProvinceInfo: this.stateProvinceInfo,\n customerAddresses: this.customerAddresses,\n validationError: this.validationError,\n addressActionResponse: this.addressActionResponse,\n isUpdating: this.isUpdating,\n hasError: this.hasError,\n className: config.className,\n viewState: {\n isShowAddress: this.currentOperation === AddressOperation.Show && this.selectedAddress,\n isShowAddresList: this.currentOperation === AddressOperation.List && this.customerAddresses.length > 0,\n isShowAddOrUpdateAddress:\n this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update,\n isShowShipMultipleAddress: this.currentOperation === AddressOperation.Multiple\n },\n CheckoutShippingAddress: {\n moduleProps: this.props,\n className: classnames('ms-checkout-shipping-address', config.className)\n },\n showAddress: this._renderShowAddress(),\n alert: hasError && errorMessage && ,\n checkoutErrorRef: this.checkoutErrorRef,\n\n /**\n * Show address select.\n * @param onShipMultipleAddressesHandler - On ship to multiple addresses click function.\n * @param onAddAddressHandler - On add address click function.\n * @param onSaveHandler - On save click function.\n * @param onCancelHandler - On cancel click function.\n * @returns - Renders select address.\n */\n showAddressSelectHandler: (\n onShipMultipleAddressesHandler?: () => void,\n onAddAddressHandler?: () => void,\n onSaveHandler?: () => void,\n onCancelHandler?: () => void\n ) => this._renderSelectAddress(onShipMultipleAddressesHandler, onAddAddressHandler, onSaveHandler, onCancelHandler),\n\n /**\n * Show ship multiple addresses.\n * @param onSaveHandler - On save click function.\n * @param onCancelHandler - On cancel click function.\n * @returns - Renders ship multiple addresses.\n */\n showShipMultipleAddressesHandler: (onSaveHandler?: () => void, onCancelHandler?: () => void) =>\n this._renderShipMultipleAddresses(onSaveHandler, onCancelHandler),\n showShipMultipleAddresses: this._renderShipMultipleAddresses(),\n\n /**\n * Show add/update address.\n * @param onSaveHandler - On save click function.\n * @param onCancelHandler - On cancel click function.\n * @returns - Renders add/update address.\n */\n showAddOrUpdateAddressHandler: (onSaveHandler?: () => void, onCancelHandler?: () => void) =>\n this._renderAddOrUpdateAddress(onSaveHandler, onCancelHandler),\n showAddOrUpdateAddress: this._renderAddOrUpdateAddress(),\n cartLineImages: isRetailMultiplePickUpOptionEnabled ? cartLineImages : undefined,\n showAddressSelect: this._renderSelectAddress()\n };\n\n return renderView(viewProps) as React.ReactElement;\n }\n\n public onSelect = (line: IShipMultipleAddressesLineViewModel, isChecked: boolean): void => {\n line.isChecked = isChecked;\n\n if (this.state.selectedShippingLines) {\n const updated =\n this.state.selectedShippingLines.map(shippingLine => {\n // @ts-ignore\n if (shippingLine.cartLine?.cartLine?.LineId === line.cartLine.LineId) {\n shippingLine.isChecked = isChecked;\n }\n return shippingLine;\n }) || [];\n\n this.setState({\n selectedShippingLines: updated\n });\n } else {\n console.error(`Shipping lines are invalid.`);\n }\n };\n\n public onSelectAll(isChecked: boolean): void {\n if (this.state.selectedShippingLines) {\n const updated =\n this.state.selectedShippingLines.map(shippingLine => {\n shippingLine.isChecked = isChecked;\n return shippingLine;\n }) || [];\n\n this.setState({\n selectedShippingLines: updated\n });\n } else {\n console.error(`Shipping lines are undefined.`);\n }\n }\n\n public onShippingAddressChange = (shippingLine: CartLine, event: React.ChangeEvent): void => {\n const addressRecordId = event.currentTarget.value;\n const selectedAddress = this.customerAddresses.find(address => (address.RecordId || '').toString() === addressRecordId);\n if (this.state.shippingGroups) {\n const updated = this.state.shippingGroups.map(line => {\n if (line.cartLine.LineId === shippingLine.LineId) {\n const updatedCartLine = {\n ...line.cartLine,\n ShippingAddress: selectedAddress\n };\n return {\n ...line,\n cartLine: updatedCartLine\n };\n }\n return line;\n });\n\n this.setState({\n shippingGroups: updated\n });\n }\n };\n\n public updateIndividualAddresses = (shippingLine: CartLine, event: React.ChangeEvent): void => {\n const addressRecordId = event.currentTarget.value;\n const selectedAddress = this.customerAddresses.find(address => (address.RecordId || '').toString() === addressRecordId);\n if (this.state.shippingGroups) {\n this.setState(prevState => {\n const updated = prevState.shippingGroups.map(line => {\n if (line.cartLine.LineId === shippingLine.LineId) {\n const updatedCartLine = {\n ...line.cartLine,\n ShippingAddress: selectedAddress\n };\n return {\n ...line,\n cartLine: updatedCartLine\n };\n }\n return line;\n });\n\n return {\n shippingGroups: updated\n };\n });\n }\n };\n\n public onBulkShippingAddressChange = (event: React.ChangeEvent): void => {\n if (this.state.selectedShippingLines && this.state.shippingGroups) {\n this.state.selectedShippingLines.forEach((shippingLine, index) => {\n if (shippingLine.isChecked) {\n const cartline = this.state.shippingGroups.find(\n // @ts-ignore\n line => line.cartLine.LineId === shippingLine.cartLine?.cartLine?.LineId\n );\n\n if (cartline) {\n this.updateIndividualAddresses(cartline.cartLine, event);\n }\n }\n });\n } else {\n console.error(`Shipping lines are undefined.`);\n }\n };\n\n /**\n * Initialize pickup group.\n */\n @action\n private readonly _initPickupGroup = async (): Promise => {\n const pickupCartLines: CartLine[] = this._getCartLinesforDelivery();\n const cartLines: ICartLineWithProduct[] = [];\n\n try {\n const products = await this._getProductsByCartLines(\n this.props.data.checkout.result?.checkoutCart.cart.ChannelId || 0,\n pickupCartLines\n );\n for (const line of pickupCartLines) {\n const product: SimpleProduct | undefined = products.find(x => x.RecordId === line.ProductId);\n cartLines.push({ cartLine: line, product });\n }\n this.setState({ shippingGroups: cartLines });\n this.setState({ shippingGroupsBuffer: cartLines });\n\n const initialShippingLineSelection = cartLines.map(cartLine => ({\n isChecked: false,\n cartLine: cartLine as CartLine\n }));\n this.setState({ selectedShippingLines: initialShippingLineSelection });\n } catch (error) {\n // @ts-ignore\n this.props.telemetry.error(error);\n this.setState({ shippingGroups: [] });\n this.setState({ shippingGroupsBuffer: [] });\n this.setState({ selectedShippingLines: [] });\n }\n };\n\n /**\n * On suggestion selected.\n * @param result - Suggestion result interface.\n */\n @action\n private readonly _onSuggestionSelected = async (result: Microsoft.Maps.ISuggestionResult): Promise => {\n this._clearAddressFields();\n const address = this.addressFormat.getTranformedAddress(result, this.stateProvinceInfo);\n const timeout = 0;\n set(this.addUpdateAddress, { Street: '' });\n set(this.addUpdateAddress, { ZipCode: address.ZipCode });\n set(this.addUpdateAddress, { CountyName: address.CountyName });\n set(this.addUpdateAddress, { City: address.City });\n set(this.addUpdateAddress, { State: address.State });\n set(this.addUpdateAddress, { DistrictName: address.DistrictName });\n set(this.addUpdateAddress, { FullAddress: address.FullAddress });\n\n // Bing autosuggest put the complete address in the Street input box. Updating the street input box to show only street address.\n setTimeout(() => {\n set(this.addUpdateAddress, { Street: address.Street });\n }, timeout);\n };\n\n /**\n * Method to clear address fields.\n */\n @action\n private readonly _clearAddressFields = (): void => {\n const addressFormatItem = this.addressFormat.getAddressFormat(\n this.addUpdateAddress.ThreeLetterISORegionName || this.countryRegionId\n );\n for (const formatAddress of addressFormatItem) {\n if (\n this.addUpdateAddress[formatAddress.name] !== undefined &&\n !this.autoSuggest?.excludedAddressFields.includes(formatAddress.name)\n ) {\n this.addressFormat[formatAddress.name] = '';\n }\n }\n this._clearValidation();\n };\n\n /**\n * Method to clear validation.\n */\n @action\n private readonly _clearValidation = (): void => {\n this.validationError = {};\n };\n\n public get expressPaymentDetailsFromCartPage(): IExpressPaymentDetails | null {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\n const properties =\n this.props.data.cart?.result?.cart?.ExtensionProperties?.find(property => property.Key === 'expressPaymentDetails')?.Value\n ?.StringValue ?? '';\n\n return properties ? (JSON.parse(properties) as IExpressPaymentDetails) : null;\n }\n\n /**\n * Method data initialization.\n * @param props -The checkout address properties.\n */\n private readonly _dataInitialize = (props: ICheckoutAddressProps): void => {\n const { data } = props;\n\n reaction(\n () => data.countryRegions.result,\n () => {\n this.countryRegions = data.countryRegions.result ?? [];\n }\n );\n\n reaction(\n () => data.addressPurposes.result,\n () => {\n this.addressPurposes = data.addressPurposes.result ?? [];\n }\n );\n\n reaction(\n () => data.address.result,\n () => {\n this.customerAddresses = data.address.result ?? [];\n }\n );\n\n reaction(\n () => data.countryStates.result,\n () => {\n this.stateProvinceInfo = data.countryStates.result ?? [];\n }\n );\n\n reaction(\n () => data.featureState.result,\n () => {\n this.retailMultiplePickUpOptionEnabled = data.featureState.result?.find(\n feature => feature.Name === this.multiplePickupStoreSwitchName\n )?.IsEnabled;\n }\n );\n };\n\n /**\n * Method to get cart lines for delivery.\n * @returns The cart line collection.\n */\n private readonly _getCartLinesforDelivery = (): CartLine[] => {\n return this.props.data.checkout.result?.checkoutCart.cart.CartLines?.filter(line => this._isDelivery(line)) ?? [];\n };\n\n /**\n * Method to check cart line for delivery.\n * @param line -The cart line.\n * @returns True/false as per cart line delivery mode.\n */\n private readonly _isDelivery = (line: CartLine): boolean => {\n return this._isNotPickupMode(line.DeliveryMode) && (line.FulfillmentStoreId === undefined || line.FulfillmentStoreId === '');\n };\n\n /**\n * Method to check cart line for delivery.\n * @param deliveryMode -The delivery mode.\n * @returns True/false as per cart line delivery mode.\n */\n private readonly _isNotPickupMode = (deliveryMode: string | undefined): boolean => {\n const pickupDeliveryModeCode = this.props.context.request.channel?.PickupDeliveryModeCode;\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\n const { channelDeliveryOptionConfig, featureState } = this.props.data;\n const retailMultiplePickUpOptionEnabled = featureState.result?.find(feature => feature.Name === multiplePickupStoreSwitchName)\n ?.IsEnabled;\n if (retailMultiplePickUpOptionEnabled && deliveryMode !== undefined) {\n const pickupDeliveryMode = channelDeliveryOptionConfig.result?.PickupDeliveryModeCodes?.some(\n pickupMode => pickupMode !== deliveryMode\n );\n return pickupDeliveryMode !== undefined ? pickupDeliveryMode : false;\n }\n return deliveryMode !== undefined && pickupDeliveryModeCode !== undefined && deliveryMode !== pickupDeliveryModeCode;\n };\n\n /**\n * Method to check cart line for delivery.\n * @param channelId - The channelId.\n * @param cartLines - Cart line collections.\n * @returns Collection of SimpleProduct.\n */\n private readonly _getProductsByCartLines = async (channelId: number, cartLines: CartLine[]): Promise => {\n const actionContext = this.props.context.actionContext;\n const productInputs = cartLines\n .filter(line => !ObjectExtensions.isNullOrUndefined(line.ProductId))\n .map(\n line =>\n new ProductInput(\n line.ProductId || 0,\n actionContext.requestContext.apiSettings,\n channelId,\n undefined,\n actionContext.requestContext,\n line.CatalogId || 0\n )\n );\n return getSimpleProducts(productInputs, actionContext);\n };\n\n /**\n * Method to render ship multiple addresses.\n * @param onSaveHandler -- Handles onsave functionality.\n * @param onCancelHandler -- Handles oncancel functionality.\n */\n private readonly _renderShipMultipleAddresses = (onSaveHandler?: () => void, onCancelHandler?: () => void) => {\n const { config, context } = this.props;\n const { imageSettings } = config;\n\n // Line images\n const cartlineImages: ICheckoutShippingCartLineInfo[] = this.state.shippingGroups\n .filter(x => !ObjectExtensions.isNullOrUndefined(x.product))\n .map(line => ({\n lineId: line.cartLine.LineId ?? '',\n imageProps: {\n requestContext: context.actionContext.requestContext,\n className: 'ms-checkout-shipping-address__group-images-lines-line-image',\n altText: line.product?.Name,\n src: line.product?.PrimaryImageUrl ?? '',\n fallBackSrc: getFallbackImageUrl(\n line.product?.ItemId,\n context.actionContext.requestContext.apiSettings,\n context.request.app?.config?.OmniChannelMedia\n ),\n gridSettings: context.request.gridSettings!,\n imageSettings: imageSettings ?? defaultImageSettings,\n loadFailureBehavior: 'empty'\n },\n quantity: line.cartLine.Quantity ?? 0\n }));\n\n /**\n * On Cancel Button Function.\n */\n const onCancelButtonHandler = () => {\n this._resetView();\n onCancelHandler?.();\n };\n\n return AddressShipMultiple({\n /**\n * On Save Function.\n */\n onSave: () => {\n this.onSubmit();\n onSaveHandler?.();\n },\n\n onCancel: !this.selectedAddress && !this.addressCommon.isAuthenticatedFlow() ? () => {} : onCancelButtonHandler,\n\n onSelect: this.onSelect.bind(this),\n\n onSelectAll: this.onSelectAll.bind(this),\n\n onClear: () => {\n this.onSelectAll(false);\n },\n\n onShippingAddressChange: this.onShippingAddressChange.bind(this),\n\n onBulkShippingAddressChange: this.onBulkShippingAddressChange.bind(this),\n\n /**\n * On Ship to Single Address Function.\n */\n onShipSingleAddress: () => {\n const resetSelectedShippingLines = this.state.selectedShippingLines\n ? this.state.selectedShippingLines.map(shippingLine => ({\n isChecked: false,\n cartLine: shippingLine.cartLine\n }))\n : [];\n this.setState({\n selectedShippingLines: resetSelectedShippingLines,\n shippingGroups: this.state.shippingGroupsBuffer\n });\n this._updateCurrentOperation(AddressOperation.Show, this.addressListSelectedAddress);\n this._updateModuleState();\n },\n\n hasExternalSubmitGroup: this.props.moduleState.hasExternalSubmitGroup,\n\n shippingLines: this.state.shippingGroups,\n\n shippingLineImages: cartlineImages,\n\n selectedShippingLines: this.state.selectedShippingLines ? this.state.selectedShippingLines : [],\n\n customerAddresses: this.customerAddresses,\n\n context: this.props.context,\n\n currencyCode: this.currencyCode,\n\n moduleId: this.props.id,\n\n moduleTypeName: this.props.typeName,\n\n resources: this.resources,\n\n telemetryContent: this.telemetryContent,\n\n isMobile: this.isMobile\n });\n };\n\n /**\n * Method to render add/update address.\n * @param onSaveHandler -- Handles onsave functionality.\n * @param onCancelHandler -- Handles oncancel functionality.\n * @returns Address app/update props.\n */\n private readonly _renderAddOrUpdateAddress = (onSaveHandler?: () => void, onCancelHandler?: () => void): IAddressAddUpdateProps => {\n const addressFormat =\n this.currentOperation === AddressOperation.Add && this.addressCommon.isAuthenticatedFlow()\n ? this.addressFormat\n : this.addressFormat;\n\n /**\n * On Cancel Button Function.\n */\n const onCancelButtonHandler = () => {\n this._resetView();\n onCancelHandler?.();\n };\n return AddressAddUpdate({\n isUpdating: this.isUpdating,\n resources: this.resources,\n addressType: AddressType.Shipping,\n addressFormat: addressFormat.getAddressFormat(this.addUpdateAddress.ThreeLetterISORegionName || this.countryRegionId),\n defaultCountryRegionId: this.countryRegionId,\n defaultAddressType: this.defaultAddressType,\n selectedAddress: this.addUpdateAddress,\n validationError: this.validationError,\n hasError: this.hasError,\n addressActionResponse: this.addressActionResponse,\n telemetryContent: this.telemetryContent,\n dropdownDisplayData: addressFormat.getPrefilledAddressDropdownData(\n this.resources.addressStateDefaultSelectionText,\n this.stateProvinceInfo\n ),\n onInputChange: this._onAddressAddUpdateInputChange,\n onDropdownChange: this._onAddressAddUpdateDropdownChange,\n hasExternalSubmitGroup: this.props.moduleState.hasExternalSubmitGroup,\n\n /**\n * On Save Function.\n */\n onSave: () => {\n this.onSubmit();\n onSaveHandler?.();\n },\n\n onCancel: !this.selectedAddress && !this.addressCommon.isAuthenticatedFlow() ? () => {} : onCancelButtonHandler\n });\n };\n\n /**\n * Method to render select address.\n * @param onShipMultipleAddressesHandler - To handle ship to multiple addresses button click.\n * @param onAddAddressHandler - To handle add address button click.\n * @param onSaveHandler - To handle save button click.\n * @param onCancelHandler - To handle cancel button click.\n * @returns Select address props.\n */\n private readonly _renderSelectAddress = (\n onShipMultipleAddressesHandler?: () => void,\n onAddAddressHandler?: () => void,\n onSaveHandler?: () => void,\n onCancelHandler?: () => void\n ): IAddressSelectProps => {\n /**\n * On Cancel Button Function.\n */\n const onCancelButtonHandler = () => {\n this._resetView();\n onCancelHandler?.();\n };\n return AddressSelect({\n addressFormat: this.addressFormat,\n addresses: this.customerAddresses,\n resources: this.resources,\n addressPurposes: this.addressPurposes,\n selectedAddress: this.addressListSelectedAddress,\n onAddressOptionChange: this._onAddressOptionChange,\n hasExternalSubmitGroup: this.props.moduleState.hasExternalSubmitGroup,\n telemetryContent: this.telemetryContent,\n\n /**\n * On Ship to Multiple Addresses Function.\n */\n onShipMultipleAddresses: () => {\n this._goToShipMultipleAddresses();\n onShipMultipleAddressesHandler?.();\n },\n\n /**\n * On Add Address Function.\n */\n onAddAddress: () => {\n this._goToAddAddress();\n onAddAddressHandler?.();\n },\n\n /**\n * On Save Function.\n */\n onSave: () => {\n this._onSelectAddress();\n onSaveHandler?.();\n },\n\n onCancel: !this.selectedAddress ? () => {} : onCancelButtonHandler,\n\n multipleAddressShippingEnabled: this.props.config.multipleAddressShippingEnabled\n });\n };\n\n /**\n * Method to render show address.\n * @returns Show address props.\n */\n private _renderShowAddress(): IAddressShowProps | null {\n if (this.selectedAddress) {\n return AddressShow({\n address: this.selectedAddress,\n addressFormat: this.addressFormat.getAddressFormat(this.selectedAddress.ThreeLetterISORegionName || ''),\n addressPurposes: this.addressPurposes\n });\n }\n\n return null;\n }\n\n /**\n * Method to render map auto suggest.\n */\n private readonly _attachMapAutoSuggest = async (): Promise => {\n const {\n data: {\n storeSelectorStateManager: { result: storeSelectorStateManager }\n }\n } = this.props;\n\n if (storeSelectorStateManager?.isMapApiLoaded) {\n this.autoSuggest?.attachAutoSuggest('#shipping_addressstreet', '#shipping_addressstreet_container', this._onSuggestionSelected);\n }\n };\n\n /**\n * Method gets called on address option change.\n * @param event - To get current option.\n */\n private readonly _onAddressOptionChange = (event: React.ChangeEvent) => {\n const addressRecordId = event.currentTarget.value;\n const selectedAddress = this.customerAddresses.find(address => (address.RecordId || '').toString() === addressRecordId);\n if (selectedAddress) {\n this.addressListSelectedAddress = selectedAddress;\n }\n };\n\n /**\n * Method to render map auto suggest.\n * @param name - Address name field.\n * @param value - Address name value field.\n */\n private readonly onAddressAddUpdate = (name: string, value: string | boolean) => {\n set(this.addUpdateAddress, { [name]: value });\n this.addressFormat.validateAddressFormat(this.addUpdateAddress, this.validationError, this.countryRegionId, name);\n };\n\n /**\n * Method to get called on address update change.\n * @param event - Input element.\n */\n private readonly _onAddressAddUpdateInputChange = (event: React.ChangeEvent): void => {\n if (event.target.type === 'checkbox') {\n this.onAddressAddUpdate(event.target.name, event.target.checked);\n } else {\n const value = (event.target.value || '').replace(new RegExp('[<>]', 'gi'), '');\n this.onAddressAddUpdate(event.target.name, value);\n }\n };\n\n /**\n * Method to get called on address update dropdown change.\n * @param event - Select element.\n */\n private readonly _onAddressAddUpdateDropdownChange = (event: React.ChangeEvent): void => {\n this.onAddressAddUpdate(event.target.name, event.target.value);\n\n if (event.target.name === AddressItemType[AddressItemType.ThreeLetterISORegionName]) {\n this._onCountryChange(event.target.value);\n }\n };\n\n /**\n * Method to get called on address update submit.\n */\n private readonly _onAddressAddUpdateSubmit = (): void => {\n if (!this.addressFormat.validateAddressFormat(this.addUpdateAddress, this.validationError, this.countryRegionId)) {\n return;\n }\n\n let response: Promise;\n if (this.addressCommon.isAuthenticatedFlow() && this._isNewAddress(this.addUpdateAddress)) {\n response =\n this.currentOperation === AddressOperation.Update\n ? this.addressCommon.updateCustomerAddress(this.addUpdateAddress)\n : this.addressCommon.addCustomerAddress(this.addUpdateAddress);\n } else {\n response = Promise.resolve({ address: this.addUpdateAddress });\n }\n\n this.isUpdating = true;\n this._updateModuleState();\n\n response.then(\n (result: IAddressResponse) => {\n this.isUpdating = false;\n\n if (result.address) {\n this.hasError = false;\n this._clearError();\n if (result.customerAddresses) {\n this._onAddOrUpdateSuccess({ customerAddresses: result.customerAddresses, address: result.address });\n } else {\n this._onAddOrUpdateSuccess({ address: result.address });\n }\n } else {\n this.hasError = true;\n this.addressActionResponse = result;\n this._updateModuleState();\n }\n },\n () => {\n this.hasError = true;\n this.isUpdating = false;\n this._updateModuleState();\n }\n );\n };\n\n /**\n * Method to get called on country change.\n * @param countryRegionId - Country region id.\n */\n private readonly _onCountryChange = (countryRegionId: string) => {\n this.countryRegionId = countryRegionId;\n const twoLetterIsoRegionName = this.addressFormat.getTwoLetterISORegionName(countryRegionId);\n set(this.addUpdateAddress, { ThreeLetterISORegionName: countryRegionId });\n set(this.addUpdateAddress, { TwoLetterISORegionName: twoLetterIsoRegionName });\n this.autoSuggest?.changeAutoSuggestionCountryCode(twoLetterIsoRegionName);\n this._clearAddressFields();\n };\n\n /**\n * Method to get all address format exclude list.\n * @returns Collection of address items.\n */\n private readonly _getAddressFormatExcludeList = (): AddressItemType[] => {\n const { config } = this.props;\n const addressFormatExcludeList: AddressItemType[] = [];\n\n if (!config.showAddressType) {\n addressFormatExcludeList.push(AddressItemType.AddressTypeValue);\n }\n\n addressFormatExcludeList.push(AddressItemType.IsPrimary);\n\n return addressFormatExcludeList;\n };\n\n /**\n * Method to get all state/provinces.\n */\n private readonly _getStateProvinces = (): void => {\n if (\n !this.countryRegionId ||\n !(this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update)\n ) {\n return;\n }\n\n this.addressCommon.getStateProvinces(this.countryRegionId).then((result: StateProvinceInfo[]) => {\n const stateInfo = result.some(state => state.StateId === this.addUpdateAddress.State);\n\n // Reset state if selected state not found in the list.\n if (!stateInfo) {\n set(this.addUpdateAddress, { State: '' });\n }\n\n this.stateProvinceInfo = result;\n });\n };\n\n /**\n * Method to set default country region id.\n */\n private _setDefaultCountryRegionId(): void {\n const { request } = this.props.context;\n const market = request.channel?.ChannelCountryRegionISOCode;\n this.countryRegionId = this.addressCommon.getDefaultCountryRegionId(this.countryRegionId, this.countryRegions, market);\n }\n\n /**\n * Method to get default address region id.\n * @returns - Address object from existing addresses.\n */\n private readonly _getDefaultAddress = (): Address | undefined => {\n if (this.customerAddresses) {\n const primaryAddress = this.customerAddresses.find((address: Address) => address.IsPrimary);\n return primaryAddress || (this.customerAddresses.length > 0 ? this.customerAddresses[0] : undefined);\n }\n return undefined;\n };\n\n /**\n * Method to get address from express payment details from cart page.\n * @returns - Address.\n */\n private readonly _getAddressFromCartExpressPaymentDetails = (): Address | undefined => {\n if (this.expressPaymentDetailsFromCartPage) {\n const { tokenizedPaymentCard, address, isExpressAddressAppliedInCartPage } = this.expressPaymentDetailsFromCartPage;\n\n let addressFromCartExpress: Address | undefined;\n\n if (isExpressAddressAppliedInCartPage) {\n addressFromCartExpress = address ? this.getExpressAddress(address) : undefined;\n } else {\n addressFromCartExpress = tokenizedPaymentCard ? this.getAddressFromTokenizedPaymentCard(tokenizedPaymentCard) : undefined;\n }\n\n return addressFromCartExpress;\n }\n return undefined;\n };\n\n /**\n * Get address from tokenizedPaymentCard.\n * @param tokenizedPaymentCard -- The tokenizedPaymentCard from the payment.\n * @returns The address.\n */\n private readonly getAddressFromTokenizedPaymentCard = (tokenizedPaymentCard: TokenizedPaymentCard): Address => {\n const twoLetterIsoRegionName = tokenizedPaymentCard.Country;\n\n const threeLetterIsoRegionName = twoLetterIsoRegionName ? this.getThreeLetterIsoRegionName(twoLetterIsoRegionName) : undefined;\n\n if (threeLetterIsoRegionName && threeLetterIsoRegionName !== this.countryRegionId) {\n this._onCountryChange(threeLetterIsoRegionName);\n }\n\n const address: Address = {\n TwoLetterISORegionName: twoLetterIsoRegionName,\n Name: tokenizedPaymentCard.NameOnCard,\n Street: tokenizedPaymentCard.Address1,\n StreetNumber: tokenizedPaymentCard.Address2,\n City: tokenizedPaymentCard.City,\n State: tokenizedPaymentCard.State,\n ZipCode: tokenizedPaymentCard.Zip,\n Phone: tokenizedPaymentCard.Phone,\n ThreeLetterISORegionName: threeLetterIsoRegionName,\n AddressTypeValue: this.defaultAddressType\n };\n\n return address;\n };\n\n /**\n * Get address from expressAddress.\n * @param expressAddress -- The expressAddress.\n * @returns The address.\n */\n private readonly getExpressAddress = (expressAddress: Address): Address => {\n const twoLetterIsoRegionName = expressAddress.TwoLetterISORegionName;\n\n const threeLetterIsoRegionName = twoLetterIsoRegionName ? this.getThreeLetterIsoRegionName(twoLetterIsoRegionName) : undefined;\n\n if (threeLetterIsoRegionName && threeLetterIsoRegionName !== this.countryRegionId) {\n this._onCountryChange(threeLetterIsoRegionName);\n }\n\n const address: Address = {\n ...expressAddress,\n ThreeLetterISORegionName: threeLetterIsoRegionName,\n AddressTypeValue: this.defaultAddressType\n };\n\n return address;\n };\n\n /**\n * Get three letter ISO region name from two letter ISO region name.\n * @param twoLetterIsoRegionName -- The three letter ISO region name.\n * @returns The three letter ISO region name.\n */\n private readonly getThreeLetterIsoRegionName = (twoLetterIsoRegionName: string): string | undefined => {\n const countryRegion = this.countryRegions.find(country => {\n return country.ISOCode?.toLowerCase() === twoLetterIsoRegionName.toLowerCase();\n });\n\n return countryRegion?.CountryRegionId;\n };\n\n /**\n * Method to initialize all module state.\n */\n private readonly _initModuleState = (): void => {\n this.props.moduleState.init({\n status: this._canShip() ? 'updating' : 'disabled',\n onEdit: this.onEdit,\n onCancel: this.onCancel,\n onSubmit: this.onSubmit\n });\n\n const checkoutState = this.props.data.checkout.result;\n\n if (this._canShip()) {\n let defaultAddress;\n const shippingCartLines: CartLine[] = this._getCartLinesforDelivery();\n\n if (checkoutState?.checkoutCart.cart.ShippingAddress) {\n defaultAddress = checkoutState.checkoutCart.cart.ShippingAddress;\n } else if (\n ArrayExtensions.hasElements(shippingCartLines) &&\n shippingCartLines[0].ShippingAddress !== undefined &&\n shippingCartLines[0].ShippingAddress.FullAddress !== ''\n ) {\n defaultAddress = shippingCartLines[0].ShippingAddress;\n } else if (this._getAddressFromCartExpressPaymentDetails()) {\n defaultAddress = this._getAddressFromCartExpressPaymentDetails();\n } else if (this._getDefaultAddress()) {\n defaultAddress = this._getDefaultAddress();\n } else {\n defaultAddress = checkoutState?.isExpressCheckoutApplied ? checkoutState.shippingAddressFromExpressCheckout : undefined;\n }\n\n if (defaultAddress && !this.addressCommon.isEmpty(defaultAddress)) {\n this._updateCurrentOperation(AddressOperation.Show, defaultAddress);\n this._setShippingAddress(defaultAddress);\n this._updateModuleState();\n checkoutState?.updateHasShippingAddress({ newHasShippingAddress: true });\n } else {\n this._updateCurrentOperation(AddressOperation.Add);\n checkoutState?.updateHasShippingAddress({ newHasShippingAddress: false });\n }\n }\n };\n\n /**\n * Method get called on submit address.\n */\n private readonly onSubmit = (): void => {\n switch (this.currentOperation) {\n case AddressOperation.Add:\n case AddressOperation.Update:\n this.props.telemetry.information('Shipping address submit for Add or Update operation.');\n this._onAddressAddUpdateSubmit();\n break;\n case AddressOperation.List:\n this.props.telemetry.information('Shipping address submit for List operation.');\n this._onSelectAddress();\n break;\n case AddressOperation.Multiple:\n this.setState({ shippingGroupsBuffer: this.state.shippingGroups });\n this._onSelectMultiAddress();\n const resetSelectedShippingLines = this.state.selectedShippingLines\n ? this.state.selectedShippingLines.map(shippingLine => ({\n isChecked: false,\n cartLine: shippingLine.cartLine\n }))\n : [];\n this.setState({ selectedShippingLines: resetSelectedShippingLines });\n break;\n default:\n this.props.telemetry.error('Invalid operation');\n }\n };\n\n /**\n * Method get called on cancel.\n */\n private readonly onCancel = (): void => {\n switch (this.currentOperation) {\n case AddressOperation.Add:\n case AddressOperation.Update:\n this.props.telemetry.information('Shipping address cancel for Add or Update operation.');\n this._clearAddressFields();\n if (!(!this.selectedAddress && !this.addressCommon.isAuthenticatedFlow())) {\n this._resetView();\n }\n\n break;\n case AddressOperation.List:\n this.props.telemetry.information('Shipping address cancel for List operation.');\n if (this.selectedAddress) {\n this._resetView();\n }\n break;\n case AddressOperation.Multiple:\n this.props.telemetry.information('Shipping address cancel for Multiple operation.');\n const resetSelectedShippingLines = this.state.selectedShippingLines\n ? this.state.selectedShippingLines.map(shippingLine => ({\n isChecked: false,\n cartLine: shippingLine.cartLine\n }))\n : [];\n this.setState({\n selectedShippingLines: resetSelectedShippingLines,\n shippingGroups: this.state.shippingGroupsBuffer\n });\n this._updateCurrentOperation(AddressOperation.Show, this.addressListSelectedAddress);\n this._updateModuleState();\n break;\n default:\n this.props.telemetry.error('Invalid operation');\n }\n };\n\n /**\n * Method get called on edit address.\n */\n private readonly onEdit = (): void => {\n this.props.telemetry.information('Shipping address onEdit is called.');\n\n if (this.addressCommon.isAuthenticatedFlow() && this.shippingAddress) {\n this._updateCurrentOperation(AddressOperation.List, this.shippingAddress);\n } else if (this.shippingAddress) {\n this._updateCurrentOperation(AddressOperation.Update, this.shippingAddress);\n }\n\n this._updateModuleState();\n };\n\n /**\n * Method to check if checkout cartlines are available fro shipping.\n * @returns - True/false as per the delivery mode.\n */\n private readonly _canShip = (): boolean => {\n const { checkout, channelDeliveryOptionConfig } = this.props.data;\n const { request } = this.props.context;\n const pickupDeliveryModeCode = request && request.channel && request.channel.PickupDeliveryModeCode;\n if (!checkout.result || !request.channel || checkout.result.checkoutCart.isEmpty || checkout.result.checkoutCart.hasInvoiceLine) {\n return false;\n }\n\n // @ts-expect-error: Type-checker not realizing above request.channel check\n return this.retailMultiplePickUpOptionEnabled\n ? checkout.result.checkoutCart.cart.CartLines?.some(cartLine =>\n cartLine.DeliveryMode && cartLine.DeliveryMode !== ''\n ? cartLine.DeliveryMode !==\n channelDeliveryOptionConfig.result?.PickupDeliveryModeCodes?.find(\n deliveryMode => deliveryMode === cartLine.DeliveryMode\n )\n : cartLine\n )\n : checkout.result.checkoutCart.cart.CartLines?.some(cartLine =>\n cartLine.DeliveryMode && cartLine.DeliveryMode !== '' ? cartLine.DeliveryMode !== pickupDeliveryModeCode : cartLine\n );\n };\n\n /**\n * Method get called on select address.\n */\n private readonly _onSelectAddress = () => {\n this._updateCurrentOperation(AddressOperation.Show, this.addressListSelectedAddress);\n this._setShippingAddress(this.addressListSelectedAddress);\n this._updateModuleState();\n };\n\n /**\n * Method get called on select address.\n */\n private readonly _onSelectMultiAddress = () => {\n this._updateCurrentOperation(AddressOperation.Show, this.addressListSelectedAddress);\n if (this.props.config.multipleAddressShippingEnabled) {\n this._setCartLinesShippingAddress(this.addressListSelectedAddress);\n } else {\n this._setShippingAddress(this.addressListSelectedAddress);\n }\n\n this._updateModuleState();\n };\n\n /**\n * Method get called on ship to multiple addresses.\n */\n private readonly _goToShipMultipleAddresses = () => {\n this._setDefaultCountryRegionId();\n this.setState({ shippingGroupsBuffer: this.state.shippingGroups });\n this._updateCurrentOperation(AddressOperation.Multiple);\n };\n\n /**\n * Method get called on goto add address.\n */\n private readonly _goToAddAddress = () => {\n this._setDefaultCountryRegionId();\n this._updateCurrentOperation(AddressOperation.Add);\n };\n\n /**\n * Method get called on add/update success.\n * @param response - Retail api response.\n */\n private readonly _onAddOrUpdateSuccess = (response: IAddressResponse) => {\n if (response.customerAddresses) {\n this.customerAddresses = response.customerAddresses;\n }\n\n if (response.address) {\n this._updateCurrentOperation(AddressOperation.Show, response.address);\n this._setShippingAddress(response.address);\n this._updateModuleState();\n }\n };\n\n /**\n * Method get called on set Shipping Address.\n * @param address - Retail Api address result.\n */\n private readonly _setShippingAddress = (address: Address): void => {\n if (this.props.data.checkout.result) {\n const newShippingAddress = { ...address };\n\n if (address.ThreeLetterISORegionName && !newShippingAddress.TwoLetterISORegionName) {\n newShippingAddress.TwoLetterISORegionName = this.addressFormat.getTwoLetterISORegionName(address.ThreeLetterISORegionName);\n }\n\n this.props.data.checkout.result.updateShippingAddress({ newShippingAddress });\n this.props.data.checkout.result.checkoutCart.updateShippingAddress({ newShippingAddress }).catch(error => {\n this.props.telemetry.error(error);\n });\n }\n };\n\n /**\n * Method get called on set Shipping Address.\n * @param address - Retail Api address result.\n */\n private readonly _setCartLinesShippingAddress = (address: Address): void => {\n if (this.props.data.checkout.result) {\n const newCartLinesWithShippingAddress = this.state.shippingGroups.map(shippingGroup => shippingGroup.cartLine);\n this.props.data.checkout.result.updateCartLinesShippingAddress({ newCartLinesWithShippingAddress });\n this.props.data.checkout.result.checkoutCart\n .updateCartLineShippingAddress({ updatedCartLinesObject: newCartLinesWithShippingAddress })\n .catch(error => {\n this.props.telemetry.error(error);\n });\n }\n };\n\n @computed private get shippingAddress(): Address | undefined {\n return this.props.data.checkout.result?.shippingAddress;\n }\n\n @computed get currencyCode(): string | undefined {\n return get(this.props, 'context.request.channel.Currency');\n }\n\n private _updateViewport(): void {\n this._viewport = this._getViewport();\n }\n\n private readonly _getViewport = (): GridSize => {\n const { context } = this.props;\n\n // Always render in mobile viewport on a mobile device\n if (context.request && context.request.device && context.request.device.Type === 'Mobile') {\n return 'xs';\n }\n\n if (MsDyn365.isBrowser && window.innerWidth) {\n const gridSettings = context.request.gridSettings;\n if (gridSettings) {\n if (gridSettings.xs && window.innerWidth <= gridSettings.xs.w) {\n return 'xs';\n } else if (gridSettings.sm && window.innerWidth <= gridSettings.sm.w) {\n return 'sm';\n } else if (gridSettings.md && window.innerWidth <= gridSettings.md.w) {\n return 'md';\n } else if (gridSettings.lg && window.innerWidth <= gridSettings.lg.w) {\n return 'lg';\n }\n return 'xl';\n }\n }\n\n return 'xs';\n };\n\n /**\n * Method get called on reset view.\n */\n private readonly _resetView = (): void => {\n switch (this.currentOperation) {\n case AddressOperation.Add:\n case AddressOperation.Update:\n this._updateCurrentOperation(\n this.addressCommon.isAuthenticatedFlow() ? AddressOperation.List : AddressOperation.Show,\n this.shippingAddress\n );\n break;\n case AddressOperation.Multiple:\n const resetSelectedShippingLines = this.state.selectedShippingLines\n ? this.state.selectedShippingLines.map(shippingLine => ({\n isChecked: false,\n cartLine: shippingLine.cartLine\n }))\n : [];\n this.setState({\n selectedShippingLines: resetSelectedShippingLines,\n shippingGroups: this.state.shippingGroupsBuffer\n });\n this._updateCurrentOperation(AddressOperation.Show, this.shippingAddress);\n break;\n default:\n this._updateCurrentOperation(AddressOperation.Show, this.shippingAddress);\n }\n this._updateModuleState();\n };\n\n /**\n * Update current operation.\n * @param operation - The address operation.\n * @param selectedAddress - The selected address.\n */\n private readonly _updateCurrentOperation = (operation: AddressOperation, selectedAddress?: Address) => {\n this.currentOperation = operation;\n this.selectedAddress = selectedAddress;\n\n if (this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update) {\n this.addUpdateAddress = { ...this.selectedAddress } || {};\n set(this.addUpdateAddress, {\n ThreeLetterISORegionName: this.addUpdateAddress.ThreeLetterISORegionName || this.countryRegionId\n });\n set(this.addUpdateAddress, {\n AddressTypeValue: this.addUpdateAddress.AddressTypeValue || this.defaultAddressType\n });\n } else if (this.currentOperation === AddressOperation.List) {\n this.addressListSelectedAddress = { ...this.selectedAddress } || {};\n }\n };\n\n /**\n * Update module state.\n */\n private readonly _updateModuleState = () => {\n if (this.currentOperation === AddressOperation.Show) {\n this.props.moduleState.onReady();\n } else if (this.isUpdating) {\n this.props.moduleState.onPending();\n } else {\n this.props.moduleState.onUpdating();\n }\n };\n\n /**\n * Method to check if the customer already has the address.\n * @param address - The address.\n */\n private readonly _isNewAddress = (address: Address): boolean => {\n for (const existingAddress of this.customerAddresses) {\n if (\n (address.Name ?? '') === existingAddress.Name &&\n (address.Street ?? '') === existingAddress.Street &&\n (address.StreetNumber ?? '') === existingAddress.StreetNumber &&\n (address.City ?? '') === existingAddress.City &&\n (address.State ?? '') === existingAddress.State &&\n (address.ZipCode ?? '') === existingAddress.ZipCode &&\n (address.Phone ?? '') === existingAddress.Phone &&\n (address.ThreeLetterISORegionName ?? '') === existingAddress.ThreeLetterISORegionName &&\n (address.AddressTypeValue ?? '') === existingAddress.AddressTypeValue\n ) {\n return false;\n }\n }\n\n return true;\n };\n\n @action\n private readonly _setErrorMessage = (errorMessage: string): void => {\n this.props.telemetry.error(errorMessage);\n this.props.moduleState.setHasError(true);\n this.props.moduleState.onUpdating();\n this.setState({\n errorMessage\n });\n };\n\n private readonly _clearError = (): void => {\n this.props.moduleState.setHasError(false);\n this.setState({\n errorMessage: ''\n });\n };\n\n /**\n * Returns count of products.\n * @param cartLine - The checkout shipping cart line info props.\n * @returns Number of products.\n */\n private readonly _countItems = (cartlines: ICheckoutShippingCartLineInfo[]): number => {\n return cartlines.reduce((count, line) => {\n return count + (line.quantity || 0);\n }, 0);\n };\n}\n\nexport default CheckoutShippingAddress;\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 { IAddressAddItem, IAddressAddUpdateProps } from '../../common/components/address-add';\nimport { IAddressShowItem, IAddressShowProps } from '../../common/components/address-show';\nimport { ICheckoutBillingAddressViewProps } from './checkout-billing-address';\n\n/**\n * Address show component.\n * @param param0 - Root param.\n * @param param0.AddressDetail - Address detail.\n * @param param0.items - IAddressShowItem[].\n * @returns - Address Node.\n */\nconst AddressShow: React.FC = ({ AddressDetail, items }) => {\n return (\n \n {items.map((item: IAddressShowItem) => {\n return <>{item.description};\n })}\n \n );\n};\n\n/**\n * Address Add Update Component.\n * @param param0 - Root param.\n * @param param0.AddressForm - Address form.\n * @param param0.heading - Address Heading.\n * @param param0.items - IAddressAddItem[].\n * @param param0.hasError - Boolean.\n * @param param0.error - IAddressError.\n * @param param0.isShowSaveButton - Boolean.\n * @param param0.saveButton - Save button.\n * @param param0.isShowCancelButton - Boolean.\n * @param param0.cancelButton - Cancel button.\n * @returns - AddressForm Node.\n */\nconst AddressAddUpdate: React.FC = ({\n AddressForm,\n heading,\n items,\n hasError,\n error,\n isShowSaveButton,\n saveButton,\n isShowCancelButton,\n cancelButton\n}) => {\n return (\n \n {heading}\n {items.map((item: IAddressAddItem) => {\n const { AddressItem, key, label, alert, input } = item;\n return (\n \n {label}\n {alert}\n {input}\n \n );\n })}\n {hasError && (\n \n {error.title}\n {error.message}\n \n )}\n {isShowSaveButton && saveButton}\n {isShowCancelButton && cancelButton}\n \n );\n};\n\n/**\n * Checkout Billing Address View Component.\n * @param props - Props.\n * @returns - CheckoutBillingAddress Module.\n */\nconst CheckoutBillingAddressView: React.FC = props => {\n const {\n CheckoutBillingAddress,\n checkoutErrorRef,\n alert,\n viewState,\n heading,\n sameAsShippingCheckbox,\n showAddress,\n showAddOrUpdateAddress\n } = props;\n\n return (\n \n {heading}\n {alert}\n {viewState.isShowSameAsShippingCheckbox && sameAsShippingCheckbox}\n {viewState.isShowAddress && }\n {viewState.isShowAddOrUpdateAddress && }\n \n );\n};\n\nexport default CheckoutBillingAddressView;\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 React from 'react';\n\nimport { IAddressAddItem, IAddressAddUpdateProps } from '../../common/components/address-add';\nimport { IAddressSelectItem, IAddressSelectProps } from '../../common/components/address-select';\nimport { IAddressShowItem, IAddressShowProps } from '../../common/components/address-show';\nimport { ICheckoutShippingAddressViewProps } from './checkout-shipping-address';\nimport { IShipMultipleAddressesViewProps } from '../../common/components/address-ship-multiple';\nimport { IShipMultipleAddressesLineViewProps } from '../../common/components/address-ship-multiple-lines';\n\n/**\n * Address show component.\n * @param param0 - Root param.\n * @param param0.AddressDetail - Address detail.\n * @param param0.items - IAddressShowItem[].\n * @returns - Address Node.\n */\nconst AddressShow: React.FC = ({ AddressDetail, items }) => {\n return (\n \n {items.map((item: IAddressShowItem) => {\n return <>{item.description};\n })}\n \n );\n};\n\n/**\n * Address Select Component.\n * @param param0 - Root param.\n * @param param0.SelectAddress - Select address.\n * @param param0.shipMultipleAddressesButton - Ship to multiple addresses button.\n * @param param0.addButton - Add button.\n * @param param0.items - IAddressSelectItem[].\n * @param param0.isShowSaveButton - Boolean.\n * @param param0.saveButton - Save button.\n * @param param0.isShowCancelButton - Boolean.\n * @param param0.cancelButton - Cancel button.\n * @returns - SelectAddress Node.\n */\nconst AddressSelect: React.FC = ({\n SelectAddress,\n shipMultipleAddressesButton,\n addButton,\n items,\n isShowSaveButton,\n saveButton,\n isShowCancelButton,\n cancelButton\n}) => {\n return (\n \n \n {addButton}\n {shipMultipleAddressesButton}\n \n {items.map((item: IAddressSelectItem) => {\n const SelectItem = item.SelectItem;\n return (\n \n {item.input}\n \n \n );\n })}\n {isShowSaveButton && saveButton}\n {isShowCancelButton && cancelButton}\n \n );\n};\n\n/**\n * Address Ship Multiple Component.\n * @param param0 - Root param.\n * @param param0.ShipMultipleAddress - Ship multiple address form.\n * @param param0.shipSingleAddressButton - Ship single address button.\n * @param param0.clearSelectionButton - Clear selection button.\n * @param param0.addressDropdown - Address dropdown button.\n * @param param0.ProductsTable - Products table component.\n * @param param0.ProductsTableHeading - Products table heading component.\n * @param param0.ProductsTableRow - Products table row component.\n * @param param0.shipMultipleAddressLines - Ship multiple address lines.\n * @param param0.hasError - Boolean.\n * @param param0.error - Error message.\n * @returns Address ship multiple component node.\n */\nconst AddressShipMultiple: React.FC = ({\n ShipMultipleAddress,\n shipSingleAddressButton,\n clearSelectionButton,\n addressDropdown,\n ProductsTable,\n ProductsTableHeading,\n ProductsTableRow,\n shipMultipleAddressLines,\n isShowSaveButton,\n saveButton,\n isShowCancelButton,\n cancelButton,\n isMobile\n}) => {\n if (ShipMultipleAddress && isMobile !== undefined) {\n if (!isMobile) {\n return (\n \n {shipSingleAddressButton}\n \n {clearSelectionButton}\n\n {addressDropdown}\n \n {ProductsTable && shipMultipleAddressLines && shipMultipleAddressLines.length > 0 && (\n \n {ProductsTableHeading}\n \n {shipMultipleAddressLines &&\n shipMultipleAddressLines.map((line: IShipMultipleAddressesLineViewProps) => {\n return _renderShipMultipleAddressLine(line, isMobile, ProductsTableRow);\n })}\n \n \n )}\n {isShowSaveButton && saveButton}\n {isShowCancelButton && cancelButton}\n \n );\n } else {\n return (\n \n {shipSingleAddressButton}\n {addressDropdown}\n {ProductsTable && shipMultipleAddressLines && shipMultipleAddressLines.length > 0 && (\n \n {ProductsTableHeading}\n \n {shipMultipleAddressLines &&\n shipMultipleAddressLines.map((line: IShipMultipleAddressesLineViewProps) => {\n return _renderShipMultipleAddressLine(line, isMobile, ProductsTableRow);\n })}\n \n \n )}\n {isShowSaveButton && saveButton}\n {isShowCancelButton && cancelButton}\n \n );\n }\n } else {\n return null;\n }\n};\n\n/**\n * Address Add Update Component.\n * @param param0 - Root param.\n * @param param0.AddressForm - Address form.\n * @param param0.heading - Address heading.\n * @param param0.items - IAddressAddItem[].\n * @param param0.hasError - Boolean.\n * @param param0.error - Error message.\n * @param param0.isShowSaveButton - Boolean.\n * @param param0.saveButton - Save button.\n * @param param0.isShowCancelButton - Boolean.\n * @param param0.cancelButton - Cancel button.\n * @returns Address add update component node.\n */\nconst AddressAddUpdate: React.FC = ({\n AddressForm,\n heading,\n items,\n hasError,\n error,\n isShowSaveButton,\n saveButton,\n isShowCancelButton,\n cancelButton\n}) => {\n return (\n \n {heading}\n {items.map((item: IAddressAddItem) => {\n const { AddressItem, key, label, alert, input } = item;\n return (\n \n {label}\n {alert}\n {input}\n \n );\n })}\n {hasError && (\n \n {error.title}\n {error.message}\n \n )}\n {isShowSaveButton && saveButton}\n {isShowCancelButton && cancelButton}\n \n );\n};\n\nconst _renderShipMultipleAddressLine = (\n shipMultipleAddressesLine: IShipMultipleAddressesLineViewProps,\n isMobile: boolean,\n ProductsTableRow?: INodeProps\n): JSX.Element | null => {\n if (!shipMultipleAddressesLine) {\n return null;\n }\n\n const {\n selectLine,\n productImage,\n productNumber,\n productInfo,\n productPrice,\n productQuantity,\n productAddress\n } = shipMultipleAddressesLine;\n\n if (!isMobile) {\n return (\n \n {selectLine}\n \n
{productImage}
\n
{productNumber}
\n \n {productInfo}\n {productPrice}\n {productQuantity}\n {productAddress}\n
\n );\n } else {\n return (\n \n \n {selectLine}\n \n {productImage}\n {productInfo}\n {`QTY: ${productQuantity}`}\n \n {productPrice}\n \n \n {productAddress}\n \n \n );\n }\n};\n\n/**\n * Checkout Shipping Address View Component.\n * @param props - Props.\n * @returns - CheckoutShippingAddress Module.\n */\nconst CheckoutShippingAddressView: React.FC = props => {\n const {\n CheckoutShippingAddress,\n checkoutErrorRef,\n alert,\n viewState,\n showAddress,\n showAddressSelect,\n showAddOrUpdateAddress,\n showShipMultipleAddresses,\n cartLineImages\n } = props;\n\n return (\n \n {alert}\n {!viewState.isShowShipMultipleAddress && cartLineImages}\n {viewState.isShowAddress && }\n {viewState.isShowAddresList && }\n {viewState.isShowAddOrUpdateAddress && }\n {viewState.isShowShipMultipleAddress && (\n \n )}\n \n );\n};\n\nexport default CheckoutShippingAddressView;\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 {\n IPriceComponentResources,\n ISwatchItem,\n PriceComponent,\n ProductComponentV2SwatchComponent,\n RatingComponent\n} from '@msdyn365-commerce/components';\nimport {\n getCatalogId,\n IAny,\n IComponent,\n IComponentProps,\n ICoreContext,\n IGeneric,\n IGridSettings,\n IImageData,\n IImageSettings,\n Image,\n msdyn365Commerce\n} from '@msdyn365-commerce/core';\n\nimport {\n ArrayExtensions,\n convertDimensionTypeToProductDimensionType,\n Dictionary,\n DimensionTypes,\n generateImageUrl,\n getProductPageUrlSync,\n IDimensionsApp,\n StringExtensions,\n validateCatalogId\n} from '@msdyn365-commerce-modules/retail-actions';\nimport {\n format,\n getPayloadObject,\n getTelemetryAttributes,\n ITelemetryContent,\n onTelemetryClick\n} from '@msdyn365-commerce-modules/utilities';\nimport React, { useState } from 'react';\n\n/**\n * AttributeSwatch entity interface.\n */\ninterface IAttributeSwatch {\n swatchValue?: string;\n swatchImageUrl?: string;\n swatchColorHexCode?: string;\n isDefault?: boolean;\n productImageUrls?: string[];\n extensionProperties?: ICommerceProperty[];\n}\n\n/**\n * CommerceProperty entity interface.\n */\ninterface ICommerceProperty {\n propertyKey?: string;\n value?: IExtensionPropertyValue;\n}\n\n/**\n * Extension property value entity interface.\n */\ninterface IExtensionPropertyValue {\n isBooleanValue?: boolean;\n byteValue?: number;\n dateTimeOffsetValue?: Date;\n decimalValue?: number;\n integerValue?: number;\n longValue?: number;\n stringValue?: string;\n}\n\n/**\n * ProductDimension entity interface.\n */\ninterface IProductDimension {\n dimensionTypeValue: number;\n dimensionValue?: IProductDimensionValue;\n extensionProperties?: ICommerceProperty[];\n}\n\n/**\n * ProductDimensionValue entity interface.\n */\ninterface IProductDimensionValue {\n recordId: number;\n value?: string;\n dimensionId?: string;\n colorHexCode?: string;\n imageUrl?: string;\n refinerGroup?: string;\n extensionProperties?: ICommerceProperty[];\n}\n\n/**\n * ProductSearchResult entity interface.\n */\nexport interface IProductSearchResult {\n itemId?: string;\n name?: string;\n price: number;\n primaryImageUrl?: string;\n recordId: number;\n trackingId?: string;\n averageRating?: number;\n totalRatings?: number;\n description?: string;\n basePrice?: number;\n minVariantPrice?: number;\n maxVariantPrice?: number;\n displayOrder?: number;\n attributeValues?: IAttributeValue[];\n defaultUnitOfMeasure?: string;\n masterProductId?: number;\n extensionProperties?: ICommerceProperty[];\n}\n\n/**\n * AttributeValue entity interface.\n */\ninterface IAttributeValue {\n name?: string;\n keyName?: string;\n unitOfMeasureSymbol?: string;\n dataTypeValue?: number;\n isBooleanValue?: boolean;\n dateTimeOffsetValue?: Date;\n floatValue?: number;\n integerValue?: number;\n textValue?: string;\n currencyValue?: number;\n currencyCode?: string;\n attributeValueId?: number;\n recordId?: number;\n swatches?: IAttributeSwatch[];\n extensionProperties?: ICommerceProperty[];\n}\n\nexport interface IProductComponentV2Props extends IComponentProps<{ product?: IProductSearchResult }> {\n className?: string;\n imageSettings?: IImageSettings;\n savingsText?: string;\n freePriceText?: string;\n originalPriceText?: string;\n currentPriceText?: string;\n ratingAriaLabel?: string;\n ratingCountAriaLabel?: string;\n allowBack?: boolean;\n telemetryContent?: ITelemetryContent;\n quickViewButton?: React.ReactNode;\n productComparisonButton?: React.ReactNode;\n isEnabledProductDescription?: boolean;\n isPriceMinMaxEnabled?: boolean;\n priceResources?: IPriceComponentResources;\n inventoryLabel?: string;\n dimensionAvailabilities?: IProductsDimensionsAvailabilities[];\n swatchItemAriaLabel?: string;\n}\n\nexport interface IProductComponentV2 extends IComponent {}\n\nconst PriceComponentActions = {};\n\n/**\n * Gets the product page url from the default swatch selected.\n * @param productData - Product card to be rendered.\n * @returns The default color swatch selected if any.\n */\nfunction getDefaultColorSwatchSelected(productData?: IProductSearchResult): IAttributeSwatch | null {\n if (!productData || !productData.attributeValues) {\n return null;\n }\n\n const colorAttribute = productData.attributeValues.find(\n attributeValue => attributeValue.keyName?.toLocaleLowerCase() === DimensionTypes.color\n );\n if (!colorAttribute) {\n return null;\n }\n\n const defaultSwatch = colorAttribute.swatches?.find(item => item.isDefault === true) ?? colorAttribute.swatches?.[0];\n return defaultSwatch ?? null;\n}\n\n/**\n * Gets the product image from the default swatch selected.\n * @param coreContext - Context of the module using the component.\n * @param productData - Product card to be rendered.\n * @returns The product card image url.\n */\nfunction getProductImageUrlFromDefaultColorSwatch(coreContext: ICoreContext, productData?: IProductSearchResult): string | undefined {\n const siteContext = coreContext as ICoreContext;\n const dimensionToPreSelectInProductCard = siteContext.app.config.dimensionToPreSelectInProductCard;\n if (dimensionToPreSelectInProductCard === DimensionTypes.none) {\n return productData?.primaryImageUrl;\n }\n const defaultSwatch = getDefaultColorSwatchSelected(productData);\n return defaultSwatch && ArrayExtensions.hasElements(defaultSwatch.productImageUrls)\n ? generateImageUrl(defaultSwatch.productImageUrls[0], coreContext.request.apiSettings)\n : productData?.primaryImageUrl;\n}\n\n/**\n * Updates the product url link to product details page.\n * @param productDetailsPageUrl - Product page url.\n * @param coreContext - Context of the module using the component.\n * @param queryString - Querystring to be added to the URL.\n * @returns The update product page url.\n */\nfunction updateProductUrl(productDetailsPageUrl: string, coreContext: ICoreContext, queryString: string): string {\n const sourceUrl = new URL(productDetailsPageUrl, coreContext.request.apiSettings.baseUrl);\n if (sourceUrl.search) {\n sourceUrl.search += `&${queryString}`;\n } else {\n sourceUrl.search += queryString;\n }\n\n const updatedUrl = new URL(sourceUrl.href);\n return updatedUrl.pathname + sourceUrl.search;\n}\n\n/**\n * Gets the react node for product unit of measure display.\n * @param unitOfMeasure - DefaultUnitOfMeasure property from product.\n * @returns The node representing markup for unit of measure component.\n */\nfunction renderProductUnitOfMeasure(unitOfMeasure?: string): JSX.Element | null {\n if (!unitOfMeasure) {\n return null;\n }\n return (\n
\n {unitOfMeasure}\n
\n );\n}\n\n/**\n * Gets the react node for product availability.\n * @param inventoryAvailabilityLabel - The product information.\n * @returns The node representing markup for product availability.\n */\nfunction renderProductAvailability(inventoryAvailabilityLabel: string | undefined): JSX.Element | null {\n if (!inventoryAvailabilityLabel || inventoryAvailabilityLabel === '') {\n return null;\n }\n\n return (\n
\n {inventoryAvailabilityLabel}\n
\n );\n}\n\n/**\n * Renders product comparison button similar to the quick view button.\n * @param productComparisonButton - React element of the button.\n * @param product - Current product info.\n * @param catalogId - Current catalog.\n * @returns React element for the specific product.\n */\nfunction renderProductComparisonButton(\n productComparisonButton: React.ReactNode,\n product: IProductSearchResult,\n catalogId: number\n): JSX.Element | undefined {\n validateCatalogId(catalogId);\n return React.cloneElement(productComparisonButton as React.ReactElement, { product, catalogId });\n}\n\n/**\n * Gets the product page url from the default swatch selected.\n * @param coreContext - Context of the module using the component.\n * @param productUrl - Product page url for the product card.\n * @param productData - Product card to be rendered.\n * @returns The product card image url.\n */\nfunction getProductPageUrlFromDefaultSwatch(\n coreContext: ICoreContext,\n productUrl: string,\n productData?: IProductSearchResult\n): string | undefined {\n const siteContext = coreContext as ICoreContext;\n const dimensionToPreSelectInProductCard = siteContext.app.config.dimensionToPreSelectInProductCard;\n if (dimensionToPreSelectInProductCard === DimensionTypes.none) {\n return productUrl;\n }\n\n const defaultSwatch = getDefaultColorSwatchSelected(productData);\n if (!defaultSwatch || !defaultSwatch.swatchValue) {\n return productUrl;\n }\n\n const queryString = `color=${defaultSwatch.swatchValue}`;\n return updateProductUrl(productUrl, coreContext, queryString);\n}\n\nconst ProductCardV2: React.FC = ({\n data,\n context,\n imageSettings,\n savingsText,\n freePriceText,\n originalPriceText,\n currentPriceText,\n ratingAriaLabel,\n ratingCountAriaLabel,\n allowBack,\n typeName,\n id,\n telemetryContent,\n quickViewButton,\n productComparisonButton,\n isEnabledProductDescription,\n isPriceMinMaxEnabled,\n priceResources,\n inventoryLabel,\n dimensionAvailabilities,\n swatchItemAriaLabel\n}) => {\n const product = data.product;\n\n let productUrl = getProductPageUrlSync(product?.name ?? '', product?.recordId ?? Number.MIN_VALUE, context.actionContext, undefined);\n if (allowBack) {\n productUrl = updateProductUrl(productUrl, context, 'back=true');\n }\n const productImageUrlFromSwatch = getProductImageUrlFromDefaultColorSwatch(context, product) ?? product?.primaryImageUrl;\n const productPageUrlFromSwatch = getProductPageUrlFromDefaultSwatch(context, productUrl, product) ?? productUrl;\n const [productPageUrl, setProductPageUrl] = useState(productPageUrlFromSwatch);\n const [productImageUrl, setProductImageUrl] = useState(productImageUrlFromSwatch);\n React.useEffect(() => {\n setProductPageUrl(productPageUrlFromSwatch);\n setProductImageUrl(productImageUrlFromSwatch);\n }, [productUrl, productPageUrlFromSwatch, productImageUrlFromSwatch]);\n const [selectedSwatchItems] = useState(new Dictionary());\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access -- app context is generic\n const enableStockCheck = context.app.config.enableStockCheck;\n\n /**\n * Updates the product page and Image url based on swatch selected.\n * @param coreContext - Context of the caller.\n * @param swatchItem - Dimension swatch selected.\n */\n const updatePageAndImageUrl = React.useCallback(\n (coreContext: ICoreContext, swatchItem: ISwatchItem) => {\n const dimensionType = swatchItem.dimensionType;\n selectedSwatchItems.setValue(dimensionType, swatchItem);\n if (StringExtensions.isNullOrWhitespace(swatchItem.value)) {\n return;\n }\n const queryString = `${dimensionType}=${swatchItem.value}`;\n let productPageUrlWithSwatch = '';\n if (productPageUrl.includes(dimensionType)) {\n const newUrl = new URL(productPageUrl, coreContext.request.apiSettings.baseUrl);\n newUrl.searchParams.delete(dimensionType);\n productPageUrlWithSwatch = updateProductUrl(newUrl.toString(), context, queryString);\n } else {\n productPageUrlWithSwatch = updateProductUrl(productPageUrl, context, queryString);\n }\n setProductPageUrl(productPageUrlWithSwatch);\n if (dimensionType === DimensionTypes.color) {\n const swatchProductImageUrl = ArrayExtensions.hasElements(swatchItem.productImageUrls)\n ? swatchItem.productImageUrls[0]\n : undefined;\n const newImageUrl = generateImageUrl(swatchProductImageUrl, coreContext.request.apiSettings);\n setProductImageUrl(newImageUrl);\n }\n },\n [selectedSwatchItems, context, productPageUrl]\n );\n\n if (!product) {\n return null;\n }\n\n /**\n * Checks if rendering the particular dimensions is allowed for product card.\n * @param dimensionType - Dimension to be displayed.\n * @returns Updates the state with new product page url.\n */\n function shouldDisplayDimension(dimensionType: string): boolean {\n const dimensionsContext = context as ICoreContext;\n const dimensionsToDisplayOnProductCard = dimensionsContext.app.config.dimensionsInProductCard;\n return (\n ArrayExtensions.hasElements(dimensionsToDisplayOnProductCard) &&\n !dimensionsToDisplayOnProductCard.includes(DimensionTypes.none) &&\n dimensionsToDisplayOnProductCard.includes(dimensionType.toLocaleLowerCase() as DimensionTypes)\n );\n }\n\n /**\n * Gets the react node for product dimension as swatch.\n * @param attributeValues - Attribute value property from product.\n * @returns The node representing markup for unit of measure component.\n */\n function renderProductDimensions(attributeValues?: IAttributeValue[]): JSX.Element | null {\n if (!attributeValues) {\n return null;\n }\n\n return (\n
\n {attributeValues.map((item: IAttributeValue) => {\n const dimensionTypeValue = item.keyName?.toLocaleLowerCase() ?? '';\n if (!shouldDisplayDimension(dimensionTypeValue)) {\n return null;\n }\n\n const siteContext = context as ICoreContext;\n const dimensionToPreSelectInProductCard = siteContext.app.config.dimensionToPreSelectInProductCard;\n const dimensionType = dimensionTypeValue as DimensionTypes;\n const swatches =\n item.swatches?.map(swatchItem => {\n return {\n itemId: `${item.recordId ?? ''}-${dimensionTypeValue}-${swatchItem.swatchValue ?? ''}`,\n value: swatchItem.swatchValue ?? '',\n dimensionType,\n colorHexCode: swatchItem.swatchColorHexCode,\n imageUrl: swatchItem.swatchImageUrl,\n productImageUrls: swatchItem.productImageUrls,\n isDefault: swatchItem.isDefault,\n swatchItemAriaLabel: swatchItemAriaLabel ? format(swatchItemAriaLabel, dimensionType) : '',\n isDisabled:\n enableStockCheck &&\n dimensionAvailabilities?.find(\n dimensionAvailability => dimensionAvailability.value === (swatchItem.swatchValue ?? '')\n )?.isDisabled\n };\n }) ?? [];\n if (\n dimensionToPreSelectInProductCard !== DimensionTypes.none &&\n ArrayExtensions.hasElements(swatches) &&\n !swatches.some(swatch => swatch.isDefault) &&\n dimensionType === DimensionTypes.color\n ) {\n swatches[0].isDefault = true;\n }\n return (\n \n );\n })}\n
\n );\n }\n\n function renderQuickView(quickview: React.ReactNode, item?: number): JSX.Element | undefined {\n if (quickview === null) {\n return undefined;\n }\n const selectedDimensions: IProductDimension[] = selectedSwatchItems.getValues().map(swatches => {\n return {\n dimensionTypeValue: convertDimensionTypeToProductDimensionType(swatches.dimensionType),\n dimensionValue: {\n recordId: 0,\n Value: swatches.value\n }\n };\n });\n return React.cloneElement(quickview as React.ReactElement, { selectedProductId: item, selectedDimensions });\n }\n\n // Construct telemetry attribute to render\n const payLoad = getPayloadObject('click', telemetryContent!, '', product.recordId.toString());\n\n const attribute = getTelemetryAttributes(telemetryContent!, payLoad);\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- -- Do not need type check for appsettings\n const isUnitOfMeasureEnabled = context.app.config && context.app.config.unitOfMeasureDisplayType === 'buyboxAndBrowse';\n\n return (\n <>\n {isEnabledProductDescription ? (\n \n
\n
\n {renderProductPlacementImage(\n imageSettings,\n context.request.gridSettings,\n productImageUrl,\n product.primaryImageUrl,\n product.name,\n context\n )}\n
\n
\n
{product.name}
\n {renderPrice(\n context,\n typeName,\n id,\n product.basePrice,\n product.price,\n savingsText,\n freePriceText,\n originalPriceText,\n currentPriceText,\n isPriceMinMaxEnabled,\n priceResources\n )}\n {isUnitOfMeasureEnabled && renderProductUnitOfMeasure(product.defaultUnitOfMeasure)}\n {renderDescription(product.description)}\n
\n
\n \n ) : (\n \n
\n {renderProductPlacementImage(\n imageSettings,\n context.request.gridSettings,\n productImageUrl,\n product.primaryImageUrl,\n product.name,\n context\n )}\n
\n
\n
{product.name}
\n {renderPrice(\n context,\n typeName,\n id,\n product.basePrice,\n product.price,\n savingsText,\n freePriceText,\n originalPriceText,\n currentPriceText\n )}\n {isUnitOfMeasureEnabled && renderProductUnitOfMeasure(product.defaultUnitOfMeasure)}\n
\n \n )}\n {renderProductDimensions(product.attributeValues)}\n {!context.app.config.hideRating &&\n renderRating(context, typeName, id, product.averageRating, product.totalRatings, ratingAriaLabel, ratingCountAriaLabel)}\n {renderProductAvailability(inventoryLabel)}\n {quickViewButton && renderQuickView(quickViewButton, product.recordId)}\n {productComparisonButton && renderProductComparisonButton(productComparisonButton, product, getCatalogId(context.request))}\n \n );\n};\n\nfunction renderLabel(\n name?: string,\n price?: string,\n rating?: number,\n ratingAriaLabelText?: string,\n reviewCount?: number,\n ratingCountAriaLabelText?: string\n): string {\n const reviewCountArialableText = getReviewAriaLabel(reviewCount, ratingCountAriaLabelText ?? '');\n return `${name ?? ''} ${price ?? ''} ${getRatingAriaLabel(rating, ratingAriaLabelText)}${\n reviewCountArialableText ? ` ${reviewCountArialableText}` : ''\n }`;\n}\n\nfunction renderDescription(description?: string): JSX.Element | null {\n return

{description}

;\n}\n\nfunction getRatingAriaLabel(rating?: number, ratingAriaLabel?: string): string {\n if (rating && ratingAriaLabel) {\n const roundedRating = rating.toFixed(2);\n return format(ratingAriaLabel || '', roundedRating, '5');\n }\n return '';\n}\n\nfunction getReviewAriaLabel(reviewCount?: number, ratingCountAriaLabelText?: string): string {\n if (reviewCount && ratingCountAriaLabelText) {\n return format(ratingCountAriaLabelText || '', reviewCount);\n }\n return '';\n}\n\nfunction renderRating(\n coreContext: ICoreContext,\n moduleTypeName: string,\n moduleId: string,\n avgRating?: number,\n totalRatings?: number,\n ariaLabel?: string,\n ratingCountAriaLabel?: string\n): JSX.Element | null {\n if (!avgRating) {\n return null;\n }\n\n const numberRatings = totalRatings?.toString() || undefined;\n const ratingAriaLabelText = getRatingAriaLabel(avgRating, ariaLabel);\n const ratingCountAriaLabelText = getReviewAriaLabel(Number(numberRatings), ratingCountAriaLabel);\n\n return (\n \n );\n}\n\nfunction renderPrice(\n context: ICoreContext,\n typeName: string,\n id: string,\n basePrice?: number,\n adjustedPrice?: number,\n savingsText?: string,\n freePriceText?: string,\n originalPriceText?: string,\n currentPriceText?: string,\n isPriceMinMaxEnabled?: boolean,\n priceResources?: IPriceComponentResources\n): JSX.Element | null {\n const price = {\n BasePrice: basePrice,\n AdjustedPrice: adjustedPrice,\n CustomerContextualPrice: adjustedPrice\n };\n\n return (\n \n );\n}\n\nfunction renderProductPlacementImage(\n imageSettings?: IImageSettings,\n gridSettings?: IGridSettings,\n imageUrl?: string,\n fallbackImageUrl?: string,\n altText?: string,\n context?: ICoreContext>\n): JSX.Element | null {\n if (!imageUrl || !gridSettings || !imageSettings) {\n return null;\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment -- Site level config can be of any type.\n const contextConfig = context?.app.config?.placeholderImageName;\n const emptyPlaceHolderImage = contextConfig as string;\n let fallbackImageSource = fallbackImageUrl;\n if (emptyPlaceHolderImage && fallbackImageUrl) {\n fallbackImageSource = `${fallbackImageUrl},${emptyPlaceHolderImage}`;\n }\n const img: IImageData = {\n src: imageUrl,\n altText: altText ? altText : '',\n fallBackSrc: fallbackImageSource\n };\n const imageProps = {\n gridSettings,\n imageSettings\n };\n imageProps.imageSettings.cropFocalRegion = true;\n return (\n \n );\n}\n\nexport const ProductComponentV2: React.FunctionComponent = msdyn365Commerce.createComponentOverride<\n IProductComponentV2\n>('ProductV2', { component: ProductCardV2, ...PriceComponentActions });\n\nexport default ProductComponentV2;\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 { isChannelTypeB2B } from '@msdyn365-commerce/core';\nimport { AsyncResultStatus, Cart, CartLineValidationResults } from '@msdyn365-commerce/retail-proxy';\nimport {\n updateLineDeliverySpecificationsAsync,\n validateForCheckoutAsync\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport {\n Address,\n DeliveryPreferenceType,\n LineDeliverySpecification,\n SimpleProduct,\n TokenizedPaymentCard\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { IModuleStateManager, IModuleStateProps, withModuleState } from '@msdyn365-commerce-modules/checkout-utilities';\nimport {\n ArrayExtensions,\n getAvailabilitiesForCartLineItems,\n IProductInventoryInformation,\n ProductAvailabilitiesForCartLineItems,\n validateCartLinesInventory\n} from '@msdyn365-commerce-modules/retail-actions';\nimport {\n Button,\n getPayloadObject,\n getTelemetryAttributes,\n getTelemetryObject,\n IModuleProps,\n INodeProps,\n ITelemetryContent,\n TelemetryConstant,\n Waiting\n} from '@msdyn365-commerce-modules/utilities';\nimport { ErrorCode, ErrorLocation } from '@msdyn365-commerce/global-state';\nimport classnames from 'classnames';\nimport isEmpty from 'lodash/isEmpty';\nimport { action, computed, get, reaction, when } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { ICheckoutData } from './checkout.data';\nimport { ICheckoutHeadingData, ICheckoutProps } from './checkout.props.autogenerated';\nimport AlertComponent from './components/alert';\nimport { getInvoicePaymentSummary, IInvoicePaymentSummary } from './components/get-invoice-payment-summary';\nimport { getLineItems, ILineItems } from './components/get-line-items';\nimport { getOrderSummary, IOrderSummary } from './components/get-order-summary';\nimport GuidedFormComponent from './components/guided-form';\nimport PlaceOrderButtonComponent from './components/place-order-button';\nimport placeOrder from './methods/place-order';\nimport { focusOnCheckoutError, setCheckoutErrors } from '../../checkout-errors';\nimport { AsyncResultStatusCode, IExpressPaymentDetails } from '../../common';\n\nexport * from './components/get-line-items';\nexport * from './components/get-order-summary';\n\n/**\n * Device type.\n */\ntype DeviceType = 'Mobile';\n\n/**\n * The Checkout state.\n */\ninterface ICheckoutState {\n errorMessage: string;\n isValidationPassed: boolean;\n isPlaceOrderLoading?: boolean;\n isPlaceOrderClicked?: boolean;\n}\n\n/**\n * Known action error failure states\n */\nexport const enum ActionErrorStatus {\n Timeout = 'Timeout',\n HookTimeout = 'Hook Timeout',\n ServiceUnavailable = 'Service Unavailable'\n}\n\n/**\n * The Checkout view props.\n * @extends ICheckoutProps\n */\nexport interface ICheckoutViewProps extends ICheckoutProps {\n className: string;\n canShow?: boolean;\n isEmptyCart?: boolean;\n isConsentGiven?: boolean;\n hasError?: boolean;\n isPaymentVerificationRedirection?: boolean;\n shouldEnableSinglePaymentAuthorizationCheckout?: boolean;\n cartStatus?: string;\n isMobile?: boolean;\n isEditorialMode?: boolean;\n backToShoppingUrl?: string;\n editCartLink?: string;\n hasSalesOrder: boolean;\n hasInvoiceLine?: boolean;\n\n moduleState?: IModuleStateManager;\n telemetryContent?: ITelemetryContent;\n checkoutGuidedFormHasError?: boolean;\n\n checkoutProps: IModuleProps;\n headerProps: INodeProps;\n bodyProps: INodeProps;\n mainProps: INodeProps;\n mainControlProps: INodeProps;\n sideProps: INodeProps;\n sideControlFirstProps: INodeProps;\n sideControlSecondProps: INodeProps;\n termsAndConditionsProps: INodeProps;\n\n guidedForm?: React.ReactNode;\n title?: React.ReactNode;\n loading?: React.ReactNode;\n alert?: React.ReactNode;\n orderSummary?: IOrderSummary;\n invoicePaymentSummary?: IInvoicePaymentSummary;\n lineItems?: ILineItems;\n placeOrderButton?: React.ReactNode;\n termsAndConditions?: React.ReactNode;\n keepShoppingButton?: React.ReactNode;\n orderConfirmation?: React.ReactNode;\n\n checkoutExpressPaymentContainer?: React.ReactNode;\n checkoutErrorRef?: React.RefObject;\n}\n\n/**\n * The checkout module props interface.\n */\nexport interface ICheckoutModuleProps extends ICheckoutProps, IModuleStateProps {}\n\nconst expressPaymentSectionClassName = 'msc-express-payment-container';\n\n/**\n *\n * CheckoutContainer component.\n * @extends {React.Component}\n */\n// @ts-expect-error\n@withModuleState\n@observer\nclass Checkout extends React.PureComponent {\n @computed get cartStatus(): Msdyn365.AsyncResultStatus {\n return this.props.data.checkout?.status;\n }\n\n @computed get isEmptyCart(): boolean {\n if (this.isEditorialMode) {\n // Editorial mode: Ignore empty cart\n return false;\n }\n const cart = this.props.data.checkout?.result?.checkoutCart?.cart;\n return this.cartStatus === 'SUCCESS' && !!cart && !isEmpty(cart) && (!cart.CartLines || cart.CartLines.length === 0);\n }\n\n @computed get hasError(): boolean {\n const cart = this.props.data.checkout?.result?.checkoutCart?.cart;\n return this.cartStatus === 'FAILED' || (this.cartStatus === 'SUCCESS' && (!cart || isEmpty(cart)));\n }\n\n @computed get isEditorialMode(): boolean {\n return this.props.context.request.params.isEditor;\n }\n\n @computed get canPlaceOrder(): boolean {\n const isTermsAndConditionAccepted = this.props.data.checkout.result && this.props.data.checkout.result?.isTermsAndConditionAccepted;\n\n const shouldEnableSinglePaymentAuthorizationCheckout =\n this.props.data.checkout.result?.shouldEnableSinglePaymentAuthorizationCheckout ?? false;\n\n const disableForOBO = Msdyn365.isOboRequest(this.props.context.request) && !this.isPaidOffByCustomerAccount;\n\n // If isTermsAndConditionAccepted is undefined means TermsAndCondition module is not added to page and we should able to place order.\n return (\n this.props.moduleState.isReady &&\n (isTermsAndConditionAccepted === undefined || isTermsAndConditionAccepted || shouldEnableSinglePaymentAuthorizationCheckout) &&\n (this.state.errorMessage === '' ||\n shouldEnableSinglePaymentAuthorizationCheckout ||\n (this.props.data.checkout.result?.isPaymentVerificationRedirection ?? false)) &&\n !(shouldEnableSinglePaymentAuthorizationCheckout && disableForOBO)\n );\n }\n\n @computed get isPaidOffByCustomerAccount(): boolean {\n const amountDue = this.props.data.checkout.result?.checkoutCart.cart.TotalAmount ?? 0;\n const customerAccountAmount = this.props.data.checkout.result?.customerAccountAmount ?? 0;\n\n return customerAccountAmount === amountDue;\n }\n\n @computed get isCartReady(): boolean {\n return (\n !!this.props.data.checkout.result?.checkoutCart?.cart &&\n this.props.data.customerInformation.status !== 'LOADING' &&\n this.props.data.featureState.status !== 'LOADING'\n );\n }\n\n public get expressPaymentDetailsFromCartPage(): IExpressPaymentDetails | null {\n const properties =\n this.props.data.checkout?.result?.checkoutCart?.cart?.ExtensionProperties?.find(\n property => property.Key === 'expressPaymentDetails'\n )?.Value?.StringValue ?? '';\n return properties ? (JSON.parse(properties) as IExpressPaymentDetails) : null;\n }\n\n public state: ICheckoutState = {\n errorMessage: '',\n isValidationPassed: false,\n isPlaceOrderLoading: false,\n isPlaceOrderClicked: false\n };\n\n private readonly telemetryContent: ITelemetryContent = getTelemetryObject(\n this.props.context.request.telemetryPageName!,\n this.props.friendlyName,\n this.props.telemetry\n );\n\n private readonly checkoutErrorRef: React.RefObject = React.createRef();\n\n public componentDidMount(): void {\n const {\n resources: { genericErrorMessage }\n } = this.props;\n\n when(\n () => this.asyncResultStatus !== AsyncResultStatusCode.LOADING,\n async () => {\n if (this.expressPaymentDetailsFromCartPage) {\n const {\n email,\n tenderLine,\n tokenizedPaymentCard,\n paymentTenderType: paymentTenderTypeFromCartPage,\n isExpressCheckoutAppliedInCartPage,\n isExpressAddressAppliedInCartPage,\n cardPaymentAcceptResult,\n address\n } = this.expressPaymentDetailsFromCartPage;\n\n this.props.data.checkout.result?.updateExpressCheckoutDetails({\n newEmailAddressFromExpressCheckout: email ?? '',\n newTenderLine: tenderLine,\n newTokenizedPaymentCard: tokenizedPaymentCard,\n newPaymentTenderType: paymentTenderTypeFromCartPage,\n newIsExpressCheckoutApplied: isExpressCheckoutAppliedInCartPage,\n newIsExpressAddressApplied: isExpressAddressAppliedInCartPage,\n newCardPaymentAcceptResult: cardPaymentAcceptResult\n });\n\n if (isExpressAddressAppliedInCartPage && address) {\n this.props.data.checkout.result?.updateBillingAddressFromExpressCheckout({\n newBillingAddressFromExpressCheckout: address\n });\n this.props.data.checkout.result?.updateShippingAddressFromExpressCheckout({\n newShippingAddressFromExpressCheckout: address\n });\n } else {\n void this._saveShippingAndBillingAddress(tokenizedPaymentCard);\n }\n\n this.props.data.checkout.result?.checkoutCart.updateExtensionProperties({\n newExtensionProperties: [\n {\n Key: 'expressPaymentDetails',\n Value: { StringValue: '' }\n }\n ]\n });\n }\n }\n );\n\n when(\n () => this.hasError,\n () => {\n this.setState({\n errorMessage: genericErrorMessage\n });\n this.props.context.telemetry.error('Failed to get cart');\n }\n );\n\n when(\n () => {\n return this.isEmptyCart;\n },\n () => {\n this.redirectToCartPage('Cart is empty, but no editCartLink found');\n }\n );\n\n when(\n () => this.isCartReady,\n () => {\n this.validateForCheckout();\n }\n );\n\n reaction(\n () => this.props.moduleState.isReady,\n () => {\n this.onContainerReady();\n }\n );\n\n // Reaction to call place order when isPaymentSectionContainerReady is true for new checkout flow.\n reaction(\n () => this.props.data.checkout.result?.isPaymentSectionContainerReady,\n async isReady => {\n if (\n this.props.data.checkout.result?.shouldEnableSinglePaymentAuthorizationCheckout &&\n isReady &&\n !this.props.data.checkout.result?.redirectAdditionalContext &&\n (!this.props.data.checkout.result?.isExpressCheckoutApplied ||\n this.props.data.checkout.result?.isPaymentVerificationRedirection)\n ) {\n if (!this.state.isPlaceOrderLoading) {\n this.setState({ isPlaceOrderLoading: true });\n }\n\n this.props.telemetry.information(\n 'Call onPlaceOrder as reaction when isPaymentSectionContainerReady is updated for single auth payment.'\n );\n\n await this.onPlaceOrder();\n\n // If 3D authentication redirection, don't update isPlaceOrderLoading\n if (!this.props.data.checkout.result.isPaymentVerificationRequired) {\n this.setState({ isPlaceOrderLoading: false });\n }\n }\n }\n );\n\n // Reaction to enable place order button when isPaymentSectionContainerHasError is true for new checkout flow.\n reaction(\n () => this.props.data.checkout.result?.isPaymentSectionContainerHasError,\n hasError => {\n if (this.props.data.checkout.result?.shouldEnableSinglePaymentAuthorizationCheckout && hasError) {\n this.setState({ isPlaceOrderLoading: false });\n\n this.props.telemetry.information(\n 'Enable place order button as reaction when isPaymentSectionContainerHasError is updated to true for single auth payment.'\n );\n } else {\n this.props.telemetry.information(\n 'No reaction when isPaymentSectionContainerHasError is updated to false or not single auth payment.'\n );\n }\n }\n );\n\n reaction(\n () => this.props.data.checkout.result?.isBillingAddressHasError,\n hasError => {\n if (this.props.data.checkout.result?.shouldEnableSinglePaymentAuthorizationCheckout && hasError) {\n this.setState({ isPlaceOrderLoading: false });\n\n this.props.data.checkout.result?.updateIsBillingAddressHasError({ newIsBillingAddressHasError: false });\n\n this.props.telemetry.information(\n 'Enable place order button as reaction when isBillingAddressHasError is updated to true for single auth payment.'\n );\n } else {\n this.props.telemetry.information(\n 'No reaction when isBillingAddressHasError is updated to false or not single auth payment.'\n );\n }\n }\n );\n\n // Reaction to enable place order button when redirection is true for new checkout flow.\n reaction(\n () => this.canPlaceOrder,\n async () => {\n if (this.props.data.checkout.result?.shouldEnableSinglePaymentAuthorizationCheckout && this.canPlaceOrder) {\n if (this.props.data.checkout.result?.isPaymentVerificationRedirection) {\n await this.props.data.checkout.result.updateIsPlaceOrderEnabledInRedirection({\n newIsPlaceOrderEnabledInRedirection: true\n });\n\n this.props.telemetry.information(\n 'Set isPaymentVerificationRedirection to true as reaction when canPlaceOrder is updated to true for single auth payment.'\n );\n } else {\n this.props.telemetry.information(\n 'No reaction when canPlaceOrder is updated to true but isPaymentVerificationRedirection is false for single auth payment.'\n );\n this.props.telemetry.information(\n `isOBORequest is ${Msdyn365.isOboRequest(this.props.context.request)} and canPlaceOrder is ${\n this.canPlaceOrder\n }.`\n );\n }\n } else {\n this.props.telemetry.information('No reaction when canPlaceOrder is updated to false or not single auth payment.');\n }\n }\n );\n\n // Reaction to update the error message when there is a checkout error.\n reaction(\n () => this.props.data.checkout.result?.checkoutError,\n checkoutError => {\n const checkoutErrorLocation: boolean = checkoutError?.errorLocation === ErrorLocation.Checkout;\n // If there is an Error in CheckoutPaymentInstrument module, checkout error location will be updated.\n const checkoutPaymentErrorLocation: boolean =\n checkoutError?.errorCode === ErrorCode.Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePayment\n ? checkoutError.errorLocation === ErrorLocation.CheckoutPaymentInstrument\n : checkoutErrorLocation;\n if (\n this.props.data.checkout.result?.shouldEnableCheckoutErrorDisplayMessaging &&\n checkoutError &&\n checkoutError.errorMessage &&\n (checkoutErrorLocation ? checkoutErrorLocation : checkoutPaymentErrorLocation)\n ) {\n this._setErrorMessage(checkoutError.errorMessage);\n }\n }\n );\n }\n\n public componentDidUpdate(): void {\n if (\n this.props.data.checkout.result?.shouldEnableCheckoutErrorDisplayMessaging &&\n this.props.data.checkout.result?.shouldFocusOnCheckoutError &&\n this.state.errorMessage\n ) {\n focusOnCheckoutError(this.checkoutErrorRef, this.props.context.actionContext);\n }\n }\n\n // eslint-disable-next-line complexity -- ignore the complexity.\n public render(): JSX.Element {\n const {\n moduleState,\n config: { className, checkoutHeading, disableGuidedCheckoutFlow },\n resources,\n context: {\n request: {\n user: { isAuthenticated }\n }\n }\n } = this.props;\n const { errorMessage } = this.state;\n const { backToShopping, placeOrderText, confirmPaymentText, cookieConsentRequiredMessage, genericErrorMessage } = resources;\n const checkoutClass = classnames('ms-checkout', className);\n const allCheckoutInformation = this.getSlotItems('checkoutInformation');\n\n // @ts-expect-error - check the key of slot\n const checkoutInformation = allCheckoutInformation?.filter(info => !info?.key.includes('express-payment'));\n\n // @ts-expect-error - check the key of slot\n const checkoutExpressPaymentContainer = allCheckoutInformation?.find(info => info?.key.includes('express-payment'));\n\n const isConsentGiven =\n this.props.context.request &&\n this.props.context.request.cookies &&\n this.props.context.request.cookies.isConsentGiven &&\n this.props.context.request.cookies.isConsentGiven();\n\n const isMobile =\n this.props.context.request &&\n this.props.context.request.device &&\n (this.props.context.request.device.Type as DeviceType) === 'Mobile';\n\n const backToShoppingUrl = Msdyn365.getUrlSync('home', this.props.context.actionContext) || '';\n const editCartLink = Msdyn365.getUrlSync('cart', this.props.context.actionContext) || '';\n\n const termsAndConditions =\n this.props.slots.termsAndConditions && this.props.slots.termsAndConditions.length > 0 && this.props.slots.termsAndConditions[0];\n\n const payLoad = getPayloadObject('click', this.telemetryContent, TelemetryConstant.BackToShopping);\n const backToShoppingAttributes = getTelemetryAttributes(this.telemetryContent, payLoad);\n\n const hasInvoiceLine = this.props.data.checkout && this.props.data.checkout.result?.checkoutCart.hasInvoiceLine;\n const checkoutBtnText = hasInvoiceLine ? confirmPaymentText : placeOrderText;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\n const shouldEnableSinglePaymentAuthorizationCheckout =\n this.props.data.checkout?.result?.shouldEnableSinglePaymentAuthorizationCheckout ?? false;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check null/undefined.\n const isExpressCheckoutApplied = this.props.data.checkout?.result?.isExpressCheckoutApplied ?? false;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check null/undefined.\n const hasShippingAddress = this.props.data.checkout?.result?.hasShippingAddress;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check null/undefined.\n const hasCartDeliveryMode = this.props.data.checkout?.result?.hasCartDeliveryMode;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check null/undefined.\n const hasGuestCheckoutEmail = this.props.data.checkout?.result?.hasGuestCheckoutEmail;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check null/undefined.\n const isTermsAndConditionAccepted = this.props.data.checkout?.result?.isTermsAndConditionAccepted;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check null/undefined.\n const isPaymentVerificationRedirection = this.props.data.checkout?.result?.isPaymentVerificationRedirection ?? false;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check null/undefined.\n const shouldEnableCheckoutErrorDisplayMessaging =\n this.props.data.checkout?.result?.shouldEnableCheckoutErrorDisplayMessaging ?? false;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check null/undefined.\n const shouldFocusOnCheckoutError = this.props.data.checkout?.result?.shouldFocusOnCheckoutError;\n\n let hasExpressPaymentContainer = false;\n\n if (\n typeof window !== 'undefined' &&\n (document?.getElementsByClassName(expressPaymentSectionClassName) as HTMLCollectionOf)[0]?.style.display === ''\n ) {\n hasExpressPaymentContainer = true;\n }\n\n let viewProps: ICheckoutViewProps = {\n ...this.props,\n className: checkoutClass,\n checkoutErrorRef: this.checkoutErrorRef,\n isEmptyCart: this.isEmptyCart,\n isConsentGiven,\n hasError: this.hasError,\n isPaymentVerificationRedirection: this.props.data.checkout?.result?.isPaymentVerificationRedirection,\n shouldEnableSinglePaymentAuthorizationCheckout,\n hasSalesOrder:\n this.props.data.checkout &&\n this.props.data.checkout.result !== undefined &&\n this.props.data.checkout.result.salesOrder !== undefined,\n hasInvoiceLine,\n cartStatus: this.cartStatus,\n isMobile,\n backToShoppingUrl,\n editCartLink,\n isEditorialMode: this.isEditorialMode,\n orderConfirmation:\n this.props.slots.orderConfirmation && this.props.slots.orderConfirmation.length > 0\n ? this.props.slots.orderConfirmation[0]\n : undefined,\n checkoutProps: { moduleProps: this.props, className: checkoutClass },\n headerProps: { className: 'ms-checkout__head' },\n bodyProps: { className: 'ms-checkout__body' },\n mainProps: { className: 'ms-checkout__main' },\n mainControlProps: { className: 'ms-checkout__main-control' },\n sideProps: { className: hasExpressPaymentContainer ? 'ms-checkout__has-express-side' : 'ms-checkout__side' },\n sideControlFirstProps: { className: 'ms-checkout__side-control-first' },\n sideControlSecondProps: { className: 'ms-checkout__side-control-second' },\n termsAndConditionsProps: { className: 'ms-checkout__terms-and-conditions' },\n title: checkoutHeading && this.renderMsdyn365Text(checkoutHeading),\n checkoutExpressPaymentContainer\n };\n\n if (!isConsentGiven && isAuthenticated) {\n viewProps = {\n ...viewProps,\n alert: \n };\n } else if (this.isLoading()) {\n viewProps = {\n ...viewProps,\n loading: \n };\n } else if (this.hasError) {\n viewProps = {\n ...viewProps,\n alert: \n };\n } else {\n viewProps = {\n ...viewProps,\n alert: errorMessage && ,\n canShow: true,\n guidedForm: checkoutInformation ? (\n \n ) : (\n undefined\n ),\n orderSummary: getOrderSummary(this.props),\n invoicePaymentSummary: getInvoicePaymentSummary(this.props),\n lineItems: hasInvoiceLine ? undefined : getLineItems(this.props, this.telemetryContent),\n placeOrderButton: (\n \n ),\n termsAndConditions,\n keepShoppingButton: backToShoppingUrl && (\n \n {backToShopping}\n \n ),\n moduleState,\n telemetryContent: this.telemetryContent,\n checkoutGuidedFormHasError: !!errorMessage\n };\n }\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n @computed public get asyncResultStatus(): AsyncResultStatus | undefined {\n const isLoading = Object.values(this.props.data).some(data => get(data, 'status') === AsyncResultStatusCode.LOADING);\n if (isLoading) {\n return AsyncResultStatusCode.LOADING;\n }\n\n const isSuccess = Object.values(this.props.data).every(data => get(data, 'status') === AsyncResultStatusCode.SUCCESS);\n if (isSuccess) {\n return AsyncResultStatusCode.SUCCESS;\n }\n\n const isFailed = Object.values(this.props.data).some(data => get(data, 'status') === AsyncResultStatusCode.FAILED);\n if (isFailed) {\n return AsyncResultStatusCode.FAILED;\n }\n\n return undefined;\n }\n\n /**\n * Renders heading.\n * @param checkoutHeading - The checkout heading.\n * @returns React node.\n */\n public renderMsdyn365Text(checkoutHeading: ICheckoutHeadingData): React.ReactNode {\n return (\n \n );\n }\n\n /**\n * Event handler for heading change event.\n * @param event - The content change event in heading element.\n * @returns The new heading value.\n */\n public handleCheckoutHeadingChange = (event: Msdyn365.ContentEditableEvent) =>\n (this.props.config.checkoutHeading!.text = event.target.value);\n\n /**\n * Checks if cart is loading.\n * @returns True if is loading, false otherwise.\n */\n private readonly isLoading = (): boolean => {\n return !this.cartStatus || this.cartStatus === 'LOADING' || this.isEmptyCart || !this.state.isValidationPassed;\n };\n\n /**\n * Get slot items.\n * @param key - The slot key.\n * @returns React node or undefined.\n */\n private readonly getSlotItems = (key: string): React.ReactNode[] | undefined => {\n const { slots } = this.props;\n return slots && slots[key] && slots[key].length > 0 ? slots[key] : undefined;\n };\n\n /**\n * Trigger the payment section container submit when placing order.\n */\n private readonly triggerPaymentWithPlaceOrder = async (): Promise => {\n this.setState({ isPlaceOrderLoading: true });\n\n await this.props.data.checkout.result?.updateShouldTriggerPaymentWithPlaceOrder({\n newShouldTriggerPaymentWithPlaceOrder: !this.props.data.checkout.result.shouldTriggerPaymentWithPlaceOrder\n });\n };\n\n /**\n * On place order.\n * @returns Void promise.\n */\n private readonly onPlaceOrder = async (): Promise => {\n const {\n resources: { checkoutOutOfStockErrorMessage },\n context: {\n actionContext,\n app: {\n config: { enableStockCheck = false }\n }\n },\n slots: { orderConfirmation },\n data: { checkout, products }\n } = this.props;\n\n this.props.telemetry.information('Checkout onPlaceOrder is called.');\n this.setState({ isPlaceOrderClicked: true });\n\n // If hasInvoiceLine is true, no inventory check\n if (\n !this.props.data.checkout.result?.checkoutCart.hasInvoiceLine &&\n enableStockCheck &&\n (await this.isOverMaxQuantity((await checkout).checkoutCart.cart, await products))\n ) {\n this.setState({\n errorMessage: checkoutOutOfStockErrorMessage\n });\n this.props.context.telemetry.error(checkoutOutOfStockErrorMessage);\n } else {\n const hasOrderConfirmation = orderConfirmation && orderConfirmation.length > 0;\n\n const updatedCartVersion = await this.updateCartLineEmailAddress(this.props.data.checkout.result?.guestCheckoutEmail || '');\n\n await placeOrder(\n actionContext,\n this.props.data.checkout.result,\n this.props.data.products.result,\n !hasOrderConfirmation,\n updatedCartVersion,\n this.props.data.checkout.result?.isPaymentVerificationRedirection\n ).catch(error => {\n this.handleCheckoutError(error);\n });\n\n await checkout.result?.updateIsPaymentSectionContainerReady({ newIsPaymentSectionContainerReady: false });\n }\n };\n\n /**\n * Update receipt email address for electronic cart line.\n * @param newGuestCheckoutEmail - The guest checkout email.\n * @returns The updated cart version.\n */\n private readonly updateCartLineEmailAddress = async (newGuestCheckoutEmail: string): Promise => {\n const emailDeliveryModeCode = this.props.context.request.channel?.EmailDeliveryModeCode;\n\n let electronicDeliveryInvoiceAddress: Address;\n\n const hasShippingAddress = this.props.data.checkout?.result?.hasShippingAddress;\n\n if (hasShippingAddress && this.props.config.useShippingAddressAsElectronicDeliveryInvoiceAddress) {\n electronicDeliveryInvoiceAddress = this.props.data.checkout?.result?.shippingAddress as Address;\n }\n\n const emailDeliveryCartLines = this.props.data.checkout.result?.checkoutCart.cart.CartLines?.filter(\n cartLine => cartLine.DeliveryMode && cartLine.DeliveryMode !== '' && cartLine.DeliveryMode === emailDeliveryModeCode\n );\n\n let updatedCartVersion: number | undefined;\n if (emailDeliveryCartLines && emailDeliveryCartLines.length > 0) {\n const lineDeliverySpecifications: LineDeliverySpecification[] = emailDeliveryCartLines.map(line => {\n return {\n LineId: line.LineId,\n DeliverySpecification: {\n DeliveryModeId: emailDeliveryModeCode,\n DeliveryPreferenceTypeValue: DeliveryPreferenceType.ElectronicDelivery,\n ElectronicDeliveryEmailAddress: newGuestCheckoutEmail,\n DeliveryAddress: hasShippingAddress ? electronicDeliveryInvoiceAddress : undefined\n }\n };\n });\n\n await updateLineDeliverySpecificationsAsync(\n { callerContext: this.props.context.actionContext },\n (await this.props.data.checkout).checkoutCart.cart.Id,\n lineDeliverySpecifications\n )\n .then(updatedCart => {\n updatedCartVersion = updatedCart.Version;\n })\n .catch(error => {\n this.props.context.actionContext.telemetry.exception(error);\n throw new Error('[updateLineDeliverySpecificationsAsync] Unable to update electronic delivery email address in cart');\n });\n }\n\n return updatedCartVersion;\n };\n\n /**\n * Return true if any product in the cart is over its max quantity.\n * @param cart -- The checkout cart.\n * @param products -- The checkout products.\n * @returns - Is any product in the cart is over max quantity.\n */\n private readonly isOverMaxQuantity = async (cart: Cart, products: SimpleProduct[]): Promise => {\n let isOverMaxQuantity = false;\n const emailDeliveryModeCode = this.props.context.request.channel?.EmailDeliveryModeCode;\n\n await getAvailabilitiesForCartLineItems(\n new ProductAvailabilitiesForCartLineItems(this.props.context.actionContext.requestContext.apiSettings),\n this.props.context.actionContext\n )\n .then(productInventoryInformation => {\n const productsThatShouldValidateInventory: IProductInventoryInformation[] = [];\n\n cart.CartLines?.map(cartline => {\n const cartlineProduct = products.find(product => product.RecordId === cartline.ProductId);\n\n // If product is non-stocked or cartline is electronic delivery, then no inventory check\n const isStockedItem = cartlineProduct?.Behavior?.IsStockedProduct;\n const isEmailDelivery =\n cartline.DeliveryMode && cartline.DeliveryMode !== '' ? cartline.DeliveryMode === emailDeliveryModeCode : false;\n const shouldSkipInventoryCheck = !isStockedItem || isEmailDelivery;\n if (!shouldSkipInventoryCheck && ArrayExtensions.hasElements(productInventoryInformation)) {\n const foundProductAvailability = productInventoryInformation.find(productInventory => {\n return productInventory.ProductAvailableQuantity?.ProductId! === cartline.ProductId;\n });\n if (foundProductAvailability) {\n productsThatShouldValidateInventory.push(foundProductAvailability);\n }\n }\n });\n\n const cartLinesInventoryValidation = validateCartLinesInventory(\n cart.CartLines ?? [],\n productsThatShouldValidateInventory,\n this.props.context.actionContext,\n products,\n emailDeliveryModeCode\n );\n\n // If is invalid then exceeds the available quantity\n isOverMaxQuantity = !cartLinesInventoryValidation.isValid;\n return isOverMaxQuantity;\n })\n .catch(error => {\n this.props.context.actionContext.telemetry.exception(error);\n throw new Error('[getAvailabilitiesForCartLineItems] Unable to get availabilities for products in checkout cart');\n });\n\n return isOverMaxQuantity;\n };\n\n /**\n * Gets active child in module state.\n * @returns - The module state manager collection.\n */\n private readonly getActiveChildModuleStates = (): IModuleStateManager[] => {\n const { childIds, getModule } = this.props.moduleState;\n return childIds\n .map(getModule)\n .filter((state): state is IModuleStateManager => !!state && !state.isDisabled && state.hasModuleState);\n };\n\n /**\n * On container ready.\n */\n private readonly onContainerReady = (): void => {\n this.props.telemetry.information('Checkout onContainerReady is called.');\n\n this.getActiveChildModuleStates().forEach(state => {\n state.isReady && state.onContainerReady && state.onContainerReady();\n });\n };\n\n /**\n * Redirects to cart page.\n * @param notFoundEditCartLinkMessage - Not found edit cart link message.\n */\n private readonly redirectToCartPage = (notFoundEditCartLinkMessage: string): void => {\n const editCartLink = Msdyn365.getUrlSync('cart', this.props.context.actionContext) || '';\n if (window && editCartLink) {\n window.location.assign(editCartLink);\n } else {\n this.setState({\n errorMessage: this.props.resources.genericErrorMessage\n });\n this.props.context.telemetry.error(notFoundEditCartLinkMessage);\n }\n };\n\n /**\n * Validates for checkout.\n * @param retry - Retry flag.\n */\n private readonly validateForCheckout = (retry: boolean = true): void => {\n const notFoundEditCartLinkMessage = \"Cart doesn't pass validation, but no editCartLink found\";\n const cart = this.props.data.checkout.result!.checkoutCart.cart;\n const { Id, Version } = cart;\n if (this._shouldValidateQuantityLimits()) {\n if (Version && Id) {\n validateForCheckoutAsync({ callerContext: this.props.context.actionContext, bypassCache: 'none' }, Id, Version)\n .then((result: CartLineValidationResults) => {\n if (result.ValidationFailuresByCartLines?.length !== 0) {\n this.redirectToCartPage(notFoundEditCartLinkMessage);\n } else {\n this.setState({ isValidationPassed: true });\n }\n })\n .catch(error => {\n this.props.telemetry.warning(error);\n this.props.telemetry.debug('Unable to validate Cart');\n if (retry && error.name === 'Microsoft_Dynamics_Commerce_Runtime_InvalidCartVersion') {\n const cartState = this.props.data.checkout.result?.checkoutCart;\n cartState\n ?.refreshCart({})\n .then(() => {\n this.validateForCheckout(false);\n })\n .catch((refreshError: Error) => {\n this.props.telemetry.warning(refreshError.message);\n this.props.telemetry.debug('Unable to refresh Cart');\n });\n } else {\n this.redirectToCartPage(notFoundEditCartLinkMessage);\n }\n });\n } else {\n this.redirectToCartPage(notFoundEditCartLinkMessage);\n }\n } else {\n this.setState({ isValidationPassed: true });\n }\n };\n\n @action\n private readonly _setErrorMessage = (errorMessage: string): void => {\n this.props.telemetry.error(errorMessage);\n this.props.moduleState.setHasError(true);\n this.props.moduleState.onUpdating();\n this.setState({\n errorMessage\n });\n };\n\n private readonly _shouldValidateQuantityLimits = (): boolean => {\n const featureStatuses = this.props.data.featureState.result;\n const isECommerceQuantityLimitsFeatureEnabledInHq =\n featureStatuses?.find(\n featureState => featureState.Name === 'Dynamics.AX.Application.EcommerceQuantityLimitConfigurationsFeature'\n )?.IsEnabled || false;\n\n if (isECommerceQuantityLimitsFeatureEnabledInHq) {\n return true;\n }\n\n const isOrderQuantityLimitsFeatureEnabledInHq =\n featureStatuses?.find(featureState => featureState.Name === 'Dynamics.AX.Application.RetailDefaultOrderQuantityLimitsFeature')\n ?.IsEnabled || false;\n\n if (!isOrderQuantityLimitsFeatureEnabledInHq) {\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 const customerInfo = this.props.data.customerInformation.result;\n const isB2BSite = isChannelTypeB2B(this.props.context.actionContext.requestContext);\n\n const isOrderQuantityLimitsFeatureEnabledInSiteSettings =\n defaultOrderQuantityLimitsFeatureConfig === 'all' ||\n (customerInfo &&\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && isB2BSite) ||\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !isB2BSite)));\n\n return isOrderQuantityLimitsFeatureEnabledInSiteSettings ?? false;\n } else {\n const cartConfiguration = this.props.data.cartConfiguration?.result;\n return !(cartConfiguration?.IgnoreOrderSettings ?? false);\n }\n };\n\n /**\n * Save the address as Shipping and Billing address.\n * @param tokenizedPaymentCard - Tokenized payment card.\n */\n private readonly _saveShippingAndBillingAddress = async (tokenizedPaymentCard?: TokenizedPaymentCard): Promise => {\n const checkoutState = this.props.data.checkout.result;\n\n // For Paypal, the address returned in TokenizedPaymentCard will be used as both shipping and billing address.\n if (checkoutState && tokenizedPaymentCard && tokenizedPaymentCard.Zip) {\n const address: Address = this._getAddressFromTokenizedPaymentCard(tokenizedPaymentCard);\n\n await checkoutState.updateBillingAddressFromExpressCheckout({ newBillingAddressFromExpressCheckout: address });\n await checkoutState.updateShippingAddressFromExpressCheckout({ newShippingAddressFromExpressCheckout: address });\n }\n };\n\n /**\n * Get address from tokenizedPaymentCard.\n * @param tokenizedPaymentCard -- The tokenizedPaymentCard from the payment.\n * @returns The address.\n */\n private readonly _getAddressFromTokenizedPaymentCard = (tokenizedPaymentCard: TokenizedPaymentCard): Address => {\n const address: Address = {\n TwoLetterISORegionName: tokenizedPaymentCard.Country,\n Name: tokenizedPaymentCard.NameOnCard,\n Street: tokenizedPaymentCard.Address1,\n StreetNumber: tokenizedPaymentCard.Address2,\n City: tokenizedPaymentCard.City,\n State: tokenizedPaymentCard.State,\n ZipCode: tokenizedPaymentCard.Zip,\n Phone: tokenizedPaymentCard.Phone\n };\n\n return address;\n };\n\n /**\n * Handle checkout errors.\n * @param error -- The error on checkout api failure.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private readonly handleCheckoutError = (error: any) => {\n // Here checkout failure message will be shown if there is any error in checkout api except data validation.\n const {\n resources: {\n genericErrorMessage,\n invalidCartVersionErrorMessage,\n missingRequiredCartTenderLinesErrorMessage,\n checkoutApiFailureErrorMessage,\n invoiceCheckoutApiFailureErrorMessage\n },\n context: { actionContext }\n } = this.props;\n const checkoutResult = this.props.data.checkout.result;\n const apiError = error && error.message;\n if (error?.statusCode === 500) {\n const errorMessage = checkoutApiFailureErrorMessage;\n this.setState({\n errorMessage\n });\n this.props.telemetry.exception(error);\n this.setState({ isPlaceOrderLoading: false });\n return;\n }\n if (checkoutResult && checkoutResult.shouldEnableCheckoutErrorDisplayMessaging) {\n const errorCode = error && error.name ? error.name : '';\n // apiError message will be used if errorcode resource/enums is unavailable\n setCheckoutErrors(errorCode, this.props.resources, !!checkoutResult.isExpressCheckoutApplied, actionContext, apiError);\n } else {\n let errorMessage = genericErrorMessage;\n this.setState({ isPlaceOrderClicked: false });\n\n if (error && error.name === 'Microsoft_Dynamics_Commerce_Runtime_InvalidCartVersion') {\n errorMessage = invalidCartVersionErrorMessage;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- unknown error type.\n } else if (error && error.name === 'Microsoft_Dynamics_Commerce_Runtime_MissingRequiredCartTenderLines') {\n errorMessage = missingRequiredCartTenderLinesErrorMessage;\n } else if (error && error.name === 'Microsoft_Dynamics_Commerce_Runtime_ExclusiveCouponCannotBeAppliedWithOtherCoupons') {\n // If api error is not available show generic message\n errorMessage = apiError || genericErrorMessage;\n } else {\n if (error.status === ActionErrorStatus.Timeout || error.status === ActionErrorStatus.ServiceUnavailable) {\n errorMessage = checkoutResult?.checkoutCart.hasInvoiceLine\n ? invoiceCheckoutApiFailureErrorMessage\n : checkoutApiFailureErrorMessage;\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- unknown error type.\n if (\n this.props.data.checkout.result?.shouldEnableSinglePaymentAuthorizationCheckout &&\n error.data?.AdditionalContext &&\n !this.props.data.checkout.result?.isPaymentVerificationRedirection\n ) {\n return;\n }\n\n this.setState({\n errorMessage\n });\n this.props.telemetry.exception(error);\n }\n };\n}\n\nexport default Checkout;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport * as React from 'react';\n\nexport interface ICheckoutDeliveryOptionsDescriptionProps {\n description?: string;\n className?: string;\n}\n\n/**\n * AddPaymentForm SFC.\n * @param root0\n * @param root0.description\n * @extends {React.FC}\n */\nconst CheckoutDeliveryOptionsDescription: React.FC = ({ description, className }) => {\n if (!description) {\n return null;\n }\n\n const descClassName = StringExtensions.isNullOrEmpty(className) ? 'ms-checkout-delivery-options__description' : className;\n return {description};\n};\n\nexport default CheckoutDeliveryOptionsDescription;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as React from 'react';\n\nexport interface ICheckoutDeliveryOptionsErrorMessageProps {\n message?: string;\n}\n\n/**\n * AddPaymentForm SFC.\n * @param root0\n * @param root0.message\n * @extends {React.FC}\n */\nconst CheckoutDeliveryOptionsErrorMessage: React.FC = ({ message }) => {\n if (!message) {\n return null;\n }\n\n return

{message}

;\n};\n\nexport default CheckoutDeliveryOptionsErrorMessage;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as React from 'react';\n\nexport interface ICheckoutDeliveryOptionsErrorTitleProps {\n title?: string;\n}\n\n/**\n * AddPaymentForm SFC.\n * @param root0\n * @param root0.title\n * @extends {React.FC}\n */\nconst CheckoutDeliveryOptionsErrorTitle: React.FC = ({ title }) => {\n if (!title) {\n return null;\n }\n\n return

{title}

;\n};\n\nexport default CheckoutDeliveryOptionsErrorTitle;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { getPayloadObject, getTelemetryAttributes, ITelemetryContent, TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nexport interface ICheckoutDeliveryOptionsRadioButtonProps {\n isChecked: boolean;\n value?: string;\n ariaSetSize: number;\n ariaPosInSet: number;\n ariaLabel?: string;\n telemetryContent?: ITelemetryContent;\n onChange(event: React.ChangeEvent): void;\n}\n\n/**\n * AddPaymentForm SFC.\n * @param root0\n * @param root0.isChecked\n * @param root0.value\n * @param root0.ariaSetSize\n * @param root0.ariaPosInSet\n * @param root0.ariaLabel\n * @param root0.telemetryContent\n * @param root0.onChange\n * @extends {React.FC}\n */\nconst CheckoutDeliveryOptionsRadioButton: React.FC = ({\n isChecked,\n value,\n ariaSetSize,\n ariaPosInSet,\n ariaLabel,\n telemetryContent,\n onChange\n}) => {\n if (!value) {\n return null;\n }\n\n const payLoad = getPayloadObject('click', telemetryContent!, TelemetryConstant.DeliveryOptions);\n const attributes = getTelemetryAttributes(telemetryContent!, payLoad);\n\n return (\n \n );\n};\n\nexport default CheckoutDeliveryOptionsRadioButton;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as React from 'react';\n\nexport interface IAddressDetailItem {\n isNewLine: boolean;\n isShowLabel: boolean;\n labelText: string;\n name: string;\n value: string;\n}\n\n/**\n * Address details item.\n * @param props - Configuration of the functional component.\n * @returns React functional component.\n */\nexport const AddressDetailItemFunctionComponent: React.FC = (props: IAddressDetailItem) => {\n const { labelText, value } = props;\n\n const className = `ms-checkout-delivery-options__cart-line-grp__item__header__address`;\n return (\n \n {labelText}\n {value}\n \n );\n};\n\nexport default AddressDetailItemFunctionComponent;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { DeliveryOptionsCartLineAddress } from '@msdyn365-commerce-modules/retail-actions';\nimport { getPayloadObject, getTelemetryAttributes, ITelemetryContent, TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\nimport { CartLine } from '@msdyn365-commerce/retail-proxy';\nimport React, { useState } from 'react';\n\nexport interface ICheckoutCartLineDeliveryDateProps {\n className?: string;\n isDisabled?: boolean;\n minRangeValue?: string;\n maxRangeValue?: string;\n validationErrorForRange?: string;\n fallbackPattern?: string;\n ariaLabel?: string;\n telemetryContent?: ITelemetryContent;\n disclaimerText?: string;\n heading?: string;\n checkBoxLabel?: string;\n onChangeMinValue?: void;\n id?: string;\n cartLines?: CartLine[];\n groupDeliveryOption?: DeliveryOptionsCartLineAddress;\n onChange(event: React.ChangeEvent, cartLines: CartLine[]): void;\n}\n\nconst CheckoutCartLineDeliveryDate: React.FC = ({\n className,\n isDisabled,\n fallbackPattern,\n ariaLabel,\n telemetryContent,\n onChangeMinValue,\n checkBoxLabel,\n disclaimerText,\n heading,\n cartLines,\n groupDeliveryOption,\n onChange\n}) => {\n const [selectedDate, setSelectedDate] = useState('');\n const [isDateEnabled, setIsDateEnabled] = useState(false);\n // State to store today's date\n const [minDate, setMinDate] = useState('');\n\n // Update minDate state with today's date on component mount\n useState(() => {\n const today = new Date().toISOString().split('T')[0];\n setMinDate(today);\n });\n\n const handleDateChange = (event: React.FocusEvent) => {\n const selectedValue = event.target.value;\n // Check if the selected date is allowed\n if (selectedValue >= minDate) {\n setSelectedDate(selectedValue);\n console.log('Selected date is allowed.', selectedValue);\n } else {\n console.log('Selected date is not allowed.');\n }\n\n if (groupDeliveryOption !== undefined && cartLines !== undefined) {\n const cartLinesDate: CartLine[] = [];\n groupDeliveryOption?.cartLineIds?.map(cartLineId => {\n const tempCartLine = cartLines?.find(cartLine => cartLineId === cartLine?.LineId?.toString());\n if (tempCartLine !== undefined) {\n cartLinesDate.push(tempCartLine);\n }\n });\n\n if (cartLinesDate !== undefined) {\n onChange(event, cartLinesDate);\n }\n }\n };\n\n const handleCheckboxChange = () => {\n setIsDateEnabled(!isDateEnabled);\n };\n\n const payLoad = getPayloadObject('click', telemetryContent!, TelemetryConstant.DeliveryOptions);\n const attributes = getTelemetryAttributes(telemetryContent!, payLoad);\n\n return (\n
\n
\n \n {checkBoxLabel}\n
\n {disclaimerText}\n
\n {heading}\n \n
\n
\n );\n};\n\nexport default CheckoutCartLineDeliveryDate;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { getPayloadObject, getTelemetryAttributes, ITelemetryContent, TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nexport interface ICheckoutDeliveryOptionsGrpRadioButtonProps {\n className: string;\n isChecked: boolean;\n value?: string;\n ariaSetSize: number;\n ariaPosInSet: number;\n groupName: string;\n ariaLabel?: string;\n telemetryContent?: ITelemetryContent;\n onChange(event: React.ChangeEvent): void;\n}\n\n/**\n * AddPaymentForm SFC.\n * @param root0\n * @param root0.isChecked\n * @param root0.value\n * @param root0.ariaSetSize\n * @param root0.ariaPosInSet\n * @param root0.ariaLabel\n * @param root0.telemetryContent\n * @param root0.onChange\n * @extends {React.FC}\n */\nconst CheckoutDeliveryOptionsGrpRadioButton: React.FC = ({\n className,\n isChecked,\n value,\n ariaSetSize,\n ariaPosInSet,\n ariaLabel,\n groupName,\n telemetryContent,\n onChange\n}) => {\n if (!value) {\n return null;\n }\n\n const payLoad = getPayloadObject('click', telemetryContent!, TelemetryConstant.DeliveryOptions);\n const attributes = getTelemetryAttributes(telemetryContent!, payLoad);\n const deliveryOptionRef: React.RefObject = React.createRef();\n\n return (\n \n );\n};\n\nexport default CheckoutDeliveryOptionsGrpRadioButton;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { DeliveryOptionsCartLineAddress } from '@msdyn365-commerce-modules/retail-actions';\nimport { getPayloadObject, getTelemetryAttributes, ITelemetryContent, TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\nimport { PriceComponent } from '@msdyn365-commerce/components';\nimport { CartLine, DeliveryOption } from '@msdyn365-commerce/retail-proxy';\nimport get from 'lodash/get';\nimport { IAny, ICoreContext, IGeneric } from '@msdyn365-commerce/core';\nimport DescriptionComponent from './checkout-delivery-options.description';\nimport RadioButtonComponent from './checkout-cartLine-delivery-options-grp';\n\nexport interface ICheckoutCartLineDeliveryOptionsRadioButtonProps {\n className: string;\n moduleId: string;\n ariaSetSize: number;\n priceFree: string;\n ariaPosInSet: number;\n selectedItemId: string;\n cartLines: CartLine[];\n deliveryOptions: DeliveryOption[];\n typeName: string;\n context: ICoreContext>;\n groupName: string; // Add groupName prop\n groupDeliveryOption?: DeliveryOptionsCartLineAddress;\n ariaLabel?: string;\n value?: string;\n cartLineId?: string;\n telemetryContent?: ITelemetryContent;\n onChange(event: React.ChangeEvent, cartLines: CartLine[], cartLineId?: string): void;\n}\n\n/**\n * Represents a radio button component for checkout cart line delivery options.\n * @param {Object} props - The component props.\n * @param {boolean} props.isChecked - Indicates whether the radio button is checked.\n * @param {string} props.value - The value of the radio button.\n * @param {number} props.ariaSetSize - The total number of radio buttons in the set.\n * @param {number} props.ariaPosInSet - The position of the radio button in the set.\n * @param {string} props.ariaLabel - The ARIA label for the radio button.\n * @param {string} props.telemetryContent - The telemetry content for the radio button.\n * @param {Function} props.onChange - The event handler for when the radio button is changed.\n * @returns {JSX.Element} The rendered radio button component.\n */\nconst CheckoutCartLineDeliveryOptionsRadio: React.FC = ({\n className,\n moduleId,\n ariaSetSize,\n ariaPosInSet,\n ariaLabel,\n telemetryContent,\n deliveryOptions,\n priceFree,\n selectedItemId,\n typeName,\n groupName, // Destructure groupName prop\n context,\n cartLines,\n cartLineId,\n groupDeliveryOption,\n onChange\n}) => {\n const payLoad = getPayloadObject('click', telemetryContent!, TelemetryConstant.DeliveryOptions);\n const attributes = getTelemetryAttributes(telemetryContent!, payLoad);\n console.log(attributes);\n const channelConfig = context.actionContext.requestContext.channel;\n const count = deliveryOptions.length;\n if (count === 0) {\n return null;\n }\n const cartLinesRadio: CartLine[] = [];\n if (groupDeliveryOption !== undefined && cartLines !== undefined) {\n groupDeliveryOption?.cartLineIds?.map(cartLineId => {\n const tempCartLine = cartLines?.find(cartLine => cartLineId === cartLine?.LineId?.toString());\n if (tempCartLine !== undefined) {\n cartLinesRadio.push(tempCartLine);\n }\n });\n }\n\n const changeCurrentDeliveryOption = React.useCallback(\n (event: React.ChangeEvent) => {\n if (cartLinesRadio !== undefined && cartLinesRadio.length > 0) {\n onChange(event, cartLinesRadio, undefined);\n } else {\n onChange(event, cartLines, cartLineId);\n }\n },\n [onChange, cartLinesRadio, cartLineId]\n );\n // const selectedDeliveryOptionItem = deliveryOptions.length > 0 ? deliveryOptions[0].Code || '' : ''; // By default, select first delivery\n const deliveryClassName = `${className}__radio-btn-grp`;\n const optionClassName = `${deliveryClassName}-opt`;\n const response = deliveryOptions.map((deliveryOption: DeliveryOption, index: number) => (\n
\n \n \n \n
\n ));\n\n return
{response}
;\n};\n\nexport default CheckoutCartLineDeliveryOptionsRadio;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { CartLineItemComponent } from '@msdyn365-commerce/components';\nimport { Button, getPayloadObject, getTelemetryAttributes, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport MsDyn365, * as Msdyn365 from '@msdyn365-commerce/core';\nimport { isChannelTypeB2B, TelemetryEvent } from '@msdyn365-commerce/core';\nimport { CartLine, DeliveryOption, ProductCatalog, SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { getProductUrlSync } from '@msdyn365-commerce-modules/retail-actions';\nimport React, { useState } from 'react';\nimport CheckoutCartLineDeliveryOptionsRadio from './checkout-cartLine-delivery-options-radio';\n\nexport interface ICheckoutDeliveryOptionsLineItemsProps {\n className?: string;\n moduleId: string;\n selectedItemId: string;\n context: Msdyn365.ICoreContext;\n typeName: string;\n cartLines: CartLine[];\n imageSettings: Msdyn365.IImageSettings;\n showShippingChargesForLineItems: boolean;\n resources: ICheckoutDeliveryOptionsLineItemsResources;\n deliveryOptions: DeliveryOption[];\n ariaSetSize: number;\n ariaPosInSet: number;\n telemetryContent?: ITelemetryContent;\n onChange(event: React.ChangeEvent, cartLines: CartLine[]): void;\n currencyCode?: string;\n products?: SimpleProduct[];\n catalogs?: ProductCatalog[];\n gridSettings?: Msdyn365.IGridSettings;\n cartLineId?: string;\n key?: string;\n}\n\nexport interface ICheckoutDeliveryOptionsLineItemsResources {\n quantityDisplayStringLabel: string;\n productDimensionTypeColor: string;\n productDimensionTypeSize: string;\n productDimensionTypeStyle: string;\n productDimensionTypeAmount: string;\n configString: string;\n discountStringText: string;\n shippingChargesText: string;\n priceFree: string;\n ariaLabel: string;\n changeButtonText?: string;\n deliveryMethodLabel?: string;\n}\n\nconst _getLineItemComponent = (\n context: Msdyn365.ICoreContext,\n cartLine: CartLine,\n product: SimpleProduct,\n moduleId: string,\n typeName: string,\n showShippingChargesForLineItems: boolean,\n imageSettings: Msdyn365.IImageSettings,\n resources: ICheckoutDeliveryOptionsLineItemsResources,\n currencyCode: string,\n catalogs?: ProductCatalog[],\n gridSettings?: Msdyn365.IGridSettings,\n cartLineId?: string\n): JSX.Element | undefined => {\n let productUrl = getProductUrlSync(product, context.actionContext, undefined);\n if (MsDyn365.isBrowser && isChannelTypeB2B(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\n return (\n \n );\n};\n\nconst _getProduct = (productId: number, products: SimpleProduct[]): SimpleProduct | undefined => {\n return products.find((_product: SimpleProduct) => {\n return productId === _product.RecordId;\n });\n};\n\nexport const GetLineItems: React.FC = (props: ICheckoutDeliveryOptionsLineItemsProps) => {\n const products = props.products;\n const lineClassName = props.className;\n const lineItemClassName = `${lineClassName}-item`;\n const currencyCode = props.currencyCode;\n const changeText = props.resources.changeButtonText;\n const [showDeliveryOption, setShowDeliveryOption] = useState(false);\n\n const handleClick = () => {\n setShowDeliveryOption(!showDeliveryOption);\n };\n if (!props.cartLines || props.cartLines.length === 0 || !products || products.length === 0 || currencyCode === undefined) {\n return null;\n }\n const deliveryCode = props.deliveryOptions.find(option => option.Code === props.selectedItemId);\n const payload = getPayloadObject(TelemetryEvent.UpdateInCart, props.telemetryContent!, changeText !== undefined ? changeText : '', '');\n const attributes = getTelemetryAttributes(props.telemetryContent!, payload);\n const response = props.cartLines.map(cartLine => {\n const product = cartLine.ProductId && _getProduct(cartLine.ProductId, products);\n if (!product) {\n return null;\n }\n return (\n
\n {_getLineItemComponent(\n props.context,\n cartLine,\n product,\n props.moduleId,\n props.typeName,\n props.showShippingChargesForLineItems,\n props.imageSettings,\n props.resources,\n currencyCode,\n props.catalogs,\n props.gridSettings\n )}\n
{props.resources.deliveryMethodLabel}
\n
\n {deliveryCode?.Description}\n \n
\n {showDeliveryOption ? (\n \n ) : null}\n
\n );\n });\n\n return
{response}
;\n};\nexport default GetLineItems;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IImageProps, IImageSettings, Image } from '@msdyn365-commerce/core';\nimport { CartLine, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport * as React from 'react';\n\n/**\n * The cartLine product interface.\n */\nexport interface ICartLineWithProduct {\n cartLine: CartLine;\n product?: SimpleProduct;\n}\n\n/**\n * The checkout shipping cartLine interface.\n */\nexport interface ICheckoutShippingCartLineInfo {\n lineId?: string;\n imageProps: IImageProps;\n deliveryMethodDesc?: string;\n requestDeliveryDate?: string;\n}\n\n/**\n * The checkout shipping cartLine props.\n */\nexport interface ICheckoutShippingCartLinesProps {\n moduleClassName: string;\n cartLines: ICheckoutShippingCartLineInfo[];\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Following as per module\nexport const CheckoutShippingCartLines: React.FC = ({ moduleClassName, cartLines }) => {\n if (!ArrayExtensions.hasElements(cartLines)) {\n return null;\n }\n\n return (\n
\n
\n {cartLines.map((cartLine: ICheckoutShippingCartLineInfo) => {\n const className = `${moduleClassName}__group-images-lines-product`;\n return (\n
\n \n
{cartLine.deliveryMethodDesc}
\n
\n
{cartLine.requestDeliveryDate}
\n
\n );\n })}\n
\n
\n );\n};\n\n/**\n * The checkout shipping cartLine image settings.\n */\nexport const defaultImageSettings: IImageSettings = {\n viewports: {\n xs: { q: 'w=108&h=108&q=80&m=6&f=jpg', w: 108, h: 108 },\n lg: { q: 'w=108&h=108&q=80&m=6&f=jpg', w: 108, h: 108 },\n xl: { q: 'w=108&h=108&q=80&m=6&f=jpg', w: 108, h: 108 }\n },\n lazyload: true,\n quality: 80\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 { CheckoutModule, ErrorLocation, ICheckoutState } from '@msdyn365-commerce/global-state';\nimport { Cart, ChannelDeliveryOptionConfiguration, FilterDeliveryModeOption } from '@msdyn365-commerce/retail-proxy';\nimport { getDeliveryOptionsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport {\n Address,\n CartLine,\n DeliveryOption,\n DeliveryPreferenceType,\n LineDeliverySpecification,\n SimpleProduct\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { IModuleStateProps, withModuleState } from '@msdyn365-commerce-modules/checkout-utilities';\nimport {\n GetDeliveryOptionsForCartLineAddressInput,\n getDeliveryOptionsForCartLineAddress,\n getFallbackImageUrl,\n QueryResultSettingsProxy,\n StringExtensions,\n DeliveryOptionsCartLineAddress,\n ArrayExtensions,\n ObjectExtensions\n} from '@msdyn365-commerce-modules/retail-actions';\nimport { Button, getTelemetryObject, IModuleProps, INodeProps, ITelemetryContent, Waiting } from '@msdyn365-commerce-modules/utilities';\nimport classname from 'classnames';\nimport get from 'lodash/get';\nimport { action, computed, observable, reaction, when } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\nimport groupBy from 'lodash/groupBy';\n\nimport { IImageProps, IImageSettings } from '@msdyn365-commerce/core';\nimport { ErrorComponent } from '../../common/error';\nimport { ICheckoutDeliveryOptionsData } from './checkout-delivery-options.data';\nimport {\n filterDeliveryModeOption,\n ICheckoutDeliveryOptionsProps,\n useDefaultDeliveryOption\n} from './checkout-delivery-options.props.autogenerated';\nimport DescriptionComponent from './components/checkout-delivery-options.description';\nimport ErrorMessageComponent from './components/checkout-delivery-options.error-message';\nimport ErrorTitleComponent from './components/checkout-delivery-options.error-title';\nimport RadioButtonComponent from './components/checkout-delivery-options.radio-button';\nimport { focusOnCheckoutError } from '../../checkout-errors';\nimport { AddressDetailItemFunctionComponent } from './components/address-detail-item';\nimport CheckoutCartLineDeliveryDate from './components/checkout-cartLine-delivery-date';\nimport CheckoutCartLineDeliveryOptionsRadio from './components/checkout-cartLine-delivery-options-radio';\nimport { GetLineItems } from './components/get-line-items';\nimport {\n CheckoutShippingCartLines,\n ICheckoutShippingCartLineInfo,\n ICheckoutShippingCartLinesProps,\n defaultImageSettings\n} from './components/checkout-shipping-cartlines-images';\n\nexport interface ICheckoutDeliveryOptionsModuleProps\n extends ICheckoutDeliveryOptionsProps,\n IModuleStateProps {}\n\nexport interface ICheckoutDeliveryOption {\n DeliveryOption: INodeProps;\n description?: React.ReactNode;\n price?: React.ReactNode;\n}\n\nexport interface ICartLineSelectedDeliveryOption {\n cartLineId: string;\n selectedDeliveryOption: string;\n requestDeliveryDate?: string;\n}\n\nexport interface ICheckoutDeliveryOptionEdit extends ICheckoutDeliveryOption {\n code: string;\n radioButton?: React.ReactNode;\n}\n\nexport interface ICheckoutDeliveryOptionsList {\n DeliveryOptionsList: INodeProps;\n list: ICheckoutDeliveryOptionEdit[];\n}\n\nexport interface ICheckoutDeliveryOptionsError {\n Error: INodeProps;\n title: React.ReactNode;\n message: React.ReactNode;\n}\n\nexport interface ICheckoutDeliveryOptionsViewState {\n isLoading: boolean;\n isError: boolean;\n isShowList: boolean;\n isShowSelected: boolean;\n isShowSaveButton: boolean;\n isShowEditButton: boolean;\n isShowCancelButton: boolean;\n}\n\nexport interface ICheckoutDeliveryOptionsViewProps extends ICheckoutDeliveryOptionsProps<{}> {\n CheckoutDeliveryOptions: IModuleProps;\n selectedItemId: string;\n deliveryOptionsData: DeliveryOption[];\n isLoading: boolean;\n errorMessageData: string;\n viewState: ICheckoutDeliveryOptionsViewState;\n deliveryOptions?: ICheckoutDeliveryOptionsList;\n deliveryOptionSelected?: ICheckoutDeliveryOption;\n errorMessage?: ICheckoutDeliveryOptionsError;\n waiting?: React.ReactNode;\n saveButton?: React.ReactNode;\n editButton?: React.ReactNode;\n cancelButton?: React.ReactNode;\n alert?: React.ReactNode;\n checkoutErrorRef?: React.RefObject;\n checkoutCartLineGroupDeliveryOptions?: React.ReactNode;\n enableCheckoutCartLineDeliveryOptions?: boolean;\n cartLineImages?: React.ReactNode;\n onDeliveryOptionChange(event: React.ChangeEvent): void;\n onSave(): void;\n onEdit(): void;\n onCancel(): void;\n}\n\n/**\n *\n * CheckoutDeliveryOptions component.\n * @extends {React.Component>}\n */\n// @ts-expect-error\n@withModuleState\n@observer\nclass CheckoutDeliveryOptions extends React.Component {\n @observable private selectedItemId: string = '';\n\n @observable private deliveryOptions: DeliveryOption[] = [];\n\n @observable private isLoading: boolean = false;\n\n @observable private errorMessage?: string;\n\n @observable private groupDeliveryOptions: DeliveryOptionsCartLineAddress[] = [];\n\n @observable private cartLineSelectedDeliveryOptions: ICartLineSelectedDeliveryOption[] = [];\n\n @computed private get isDataReady(): boolean {\n return (this.props.data.checkout.result && this.props.data.checkout.status) === 'SUCCESS';\n }\n\n @computed get currencyCode(): string | undefined {\n return get(this.props, 'context.request.channel.Currency');\n }\n\n public get expressPaymentDetailsFromCartPage() {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\n const properties =\n this.props.data.cart?.result?.cart?.ExtensionProperties?.find(property => property.Key === 'expressPaymentDetails')?.Value\n ?.StringValue ?? '';\n\n return properties ? JSON.parse(properties) : null;\n }\n\n public get isExpressPaymentAppliedInCartPage(): boolean {\n return this.expressPaymentDetailsFromCartPage?.isExpressCheckoutAppliedInCartPage ?? false;\n }\n\n private cartDeliveryMode?: string;\n\n private retailMultiplePickUpOptionEnabled?: boolean = false;\n\n private channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\n\n private readonly telemetryContent?: ITelemetryContent;\n\n private readonly isSelectDefaultOptionEnabled?: boolean;\n\n private readonly checkoutErrorRef: React.RefObject = React.createRef();\n\n private readonly isMultipleAddressShippingEnabled?: boolean;\n\n private readonly timeoutRetailCall: number;\n\n private cartLinesDeliveryOptions: ICartLineSelectedDeliveryOption[] = [];\n\n public constructor(props: ICheckoutDeliveryOptionsModuleProps) {\n super(props);\n this.telemetryContent = getTelemetryObject(\n this.props.context.request.telemetryPageName!,\n this.props.friendlyName,\n this.props.telemetry\n );\n this.isSelectDefaultOptionEnabled =\n this.props.config.useDefaultDeliveryOption && this.props.config.useDefaultDeliveryOption !== useDefaultDeliveryOption.none;\n this.isMultipleAddressShippingEnabled = this.props.config.multipleAddressShippingEnabled;\n this.timeoutRetailCall = this.props.config.timeoutToCallRetail !== undefined ? this.props.config.timeoutToCallRetail : 0;\n }\n\n public async componentDidMount(): Promise {\n when(\n () => this.isDataReady,\n async () => {\n if (\n (this.props.data.checkout.result?.isExpressCheckoutApplied && this.canShip()) ||\n this.isExpressPaymentAppliedInCartPage\n ) {\n await this.init();\n } else {\n // Wait for a specific time (e.g., 2000 milliseconds = 2 seconds)\n await new Promise(resolve => setTimeout(resolve, this.timeoutRetailCall));\n // Then call the init function\n await this.init();\n }\n }\n );\n\n reaction(\n () => this.props.data.checkout.result?.shippingAddress,\n async () => {\n await this.loadDeliveryOptions();\n this.props.moduleState.setIsCancellable(false);\n\n await this.props.data.checkout.result?.updateShouldCollapsePaymentSection({ newShouldCollapsePaymentSection: true });\n }\n );\n\n reaction(\n () => this.props.data.checkout.result?.cartLinesWithShippingAddress,\n async () => {\n await this.loadDeliveryOptions();\n this.props.moduleState.setIsCancellable(false);\n\n await this.props.data.checkout.result?.updateShouldCollapsePaymentSection({ newShouldCollapsePaymentSection: true });\n }\n );\n\n reaction(\n () => this.props.data.checkout.result?.isExpressCheckoutApplied,\n async isExpressCheckoutApplied => {\n if (isExpressCheckoutApplied && this.canShip() && !this.isExpressPaymentAppliedInCartPage) {\n await this.loadDeliveryOptions();\n this.props.moduleState.setIsCancellable(false);\n\n await this.props.data.checkout.result?.updateShouldCollapsePaymentSection({ newShouldCollapsePaymentSection: true });\n }\n }\n );\n\n if (this.props.data.checkout.result?.shouldEnableCheckoutErrorDisplayMessaging) {\n reaction(\n () => this.props.data.checkout.result?.checkoutError,\n checkoutError => {\n if (\n checkoutError &&\n checkoutError.errorLocation === ErrorLocation.CheckoutDeliveryOptions &&\n checkoutError.errorMessage\n ) {\n this.setError(checkoutError.errorMessage);\n }\n }\n );\n\n reaction(\n () => this.props.data.checkout.result?.checkoutErrorFocus,\n checkoutErrorFocus => {\n if (checkoutErrorFocus === CheckoutModule.CheckoutDeliveryOptions) {\n focusOnCheckoutError(this.checkoutErrorRef, this.props.context.actionContext);\n }\n }\n );\n }\n }\n\n public shouldComponentUpdate(nextProps: ICheckoutDeliveryOptionsModuleProps, nextState: ICheckoutDeliveryOptionsViewState): 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 | null {\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\n this.channelDeliveryOptionConfig = this.props.data.channelDeliveryOptionConfig?.result;\n this.retailMultiplePickUpOptionEnabled = this.props.data.featureState?.result?.find(\n feature => feature.Name === multiplePickupStoreSwitchName\n )?.IsEnabled;\n\n if (!this.canShip()) {\n this.props.context.telemetry.error('Checkout delivery options content is empty, module wont render');\n return null;\n }\n\n const {\n moduleState: { isReady, isUpdating, hasError }\n } = this.props;\n const isError = !this.isLoading && hasError;\n const isShowList = !this.isLoading && !hasError && isUpdating && !this.isSelectDefaultOptionEnabled;\n const isShowSelected = !this.isLoading && !hasError && isReady;\n const { errorMessageTitle, deliveryOptionAriaLabel } = this.props.resources;\n const cartLinesDisplay = this.getMultipleDeliveryOptionSelected();\n const lineImageProps: ICheckoutShippingCartLinesProps = {\n moduleClassName: 'ms-checkout-shipping-address',\n cartLines: cartLinesDisplay.filter(x => !ObjectExtensions.isNullOrUndefined(x))\n };\n\n const cartLineImages: React.ReactNode = ;\n\n const viewProps = {\n ...this.props,\n onDeliveryOptionChange: this.onDeliveryOptionChange,\n selectedItemId: this.selectedItemId,\n deliveryOptionsData: this.deliveryOptions,\n isLoading: this.isLoading,\n alert: this.errorMessage && ,\n errorMessageData: this.errorMessage,\n viewState: {\n isLoading: this.isLoading,\n isError,\n isShowList,\n isShowSelected,\n isShowSaveButton: isShowList && !this.props.moduleState.hasExternalSubmitGroup,\n isShowEditButton: isShowSelected && !this.props.moduleState.hasExternalSubmitGroup,\n isShowCancelButton: isShowList && !this.props.moduleState.hasExternalSubmitGroup && !!this.getSavedDeliveryOption()\n },\n CheckoutDeliveryOptions: {\n moduleProps: this.props,\n className: classname('ms-checkout-delivery-options', this.props.config.className)\n },\n deliveryOptions: {\n DeliveryOptionsList: {\n className: 'ms-checkout-delivery-options__list',\n role: 'list',\n 'aria-label': deliveryOptionAriaLabel\n },\n list: this.getDeliveryOptionList()\n },\n deliveryOptionSelected: this.getDeliveryOptionSelected(),\n errorMessage: this.getErrorMessage(),\n waiting: ,\n checkoutErrorRef: this.checkoutErrorRef,\n checkoutCartLineGroupDeliveryOptions: this.getCheckoutCartLineGroupDeliveryOptions(),\n enableCheckoutCartLineDeliveryOptions: this.isMultipleAddressShippingEnabled,\n cartLineImages,\n saveButton: this.getSaveButton(),\n editButton: this.getEditButton(),\n cancelButton: this.getCancelButton(),\n onSave: this.onSave,\n onEdit: this.onEdit,\n onCancel: this.onCancel\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n @action\n private readonly init = async (): Promise => {\n this.props.moduleState.init({\n onEdit: this.isSelectDefaultOptionEnabled ? undefined : this.onEdit,\n onCancel: this.isSelectDefaultOptionEnabled ? undefined : this.onCancel,\n onSubmit: this.isSelectDefaultOptionEnabled ? undefined : this.onSubmit,\n status:\n !(this.props.config.useDefaultDeliveryOption === useDefaultDeliveryOption.notDisplaySelectedDeliveryOption) &&\n this.canShip()\n ? 'updating'\n : 'disabled'\n });\n\n this.cartDeliveryMode = this.getSavedDeliveryOption();\n if (this.isMultipleAddressShippingEnabled) {\n this.getCartLinesSavedDeliveryOption();\n }\n await this.loadDeliveryOptions();\n };\n\n private readonly canShip = (): boolean => {\n const hasInvoice = this.props.data.checkout.result?.checkoutCart.hasInvoiceLine;\n return !hasInvoice && this.getCartLinesForShipping().length > 0;\n };\n\n private readonly isDeliveryModeExists = (deliveryMode: string | undefined): boolean => {\n if (deliveryMode) {\n if (this.deliveryOptions.find(deliveryOption => deliveryOption.Code === deliveryMode)) {\n return true;\n }\n }\n return false;\n };\n\n private readonly getDeliveryOptionSelected = (): ICheckoutDeliveryOption | null => {\n const selectedItem = this.deliveryOptions.find(deliveryOption => deliveryOption.Code === this.selectedItemId);\n if (!selectedItem) {\n this.props.context.telemetry.error('Checkout delivery options content is empty, module wont render');\n return null;\n }\n\n const { id, typeName, context } = this.props;\n const { priceFree } = this.props.resources;\n const price = get(selectedItem, 'ShippingChargeAmount', 0);\n const channelConfig = this.props.context.request.channel;\n return {\n DeliveryOption: { className: 'ms-checkout-delivery-options__option-selected' },\n description: ,\n price: (\n \n )\n };\n };\n\n private readonly getErrorMessage = (): ICheckoutDeliveryOptionsError => {\n const { errorMessageTitle } = this.props.resources;\n return {\n // @ts-expect-error\n CheckoutDeliveryOptionsError: { tag: 'span', className: 'ms-address-form__error', role: 'alert', 'aria-live': 'assertive' },\n title: ,\n message: \n };\n };\n\n private readonly getDeliveryOptionList = (): ICheckoutDeliveryOptionEdit[] => {\n const count = this.deliveryOptions.length;\n const { priceFree } = this.props.resources;\n const { id, typeName, context } = this.props;\n const channelConfig = this.props.context.request.channel;\n\n return this.deliveryOptions.map((deliveryOption: DeliveryOption, index: number) => {\n const getAriaLabelWithPrice = get(deliveryOption, 'ShippingChargeAmount', 0);\n return {\n DeliveryOption: { className: 'ms-checkout-delivery-options__option', role: 'listitem' },\n code: deliveryOption.Code || '',\n radioButton: (\n \n ),\n description: (\n \n ),\n price: (\n \n )\n };\n });\n };\n\n private readonly getSaveButton = (): React.ReactNode => {\n const { saveBtnLabel = 'Save' } = this.props.resources;\n return (\n \n {saveBtnLabel}\n \n );\n };\n\n private readonly getEditButton = (): React.ReactNode => {\n const { editBtnLabel = 'Change' } = this.props.resources;\n return (\n \n );\n };\n\n private readonly getCancelButton = (): React.ReactNode => {\n const { cancelBtnLabel = 'Cancel' } = this.props.resources;\n return (\n \n );\n };\n\n private readonly setError = (errorMessage: string): void => {\n this.props.telemetry.error(errorMessage);\n this.props.moduleState.setHasError(true);\n this.props.moduleState.onUpdating();\n this.errorMessage = errorMessage;\n };\n\n private readonly clearError = (): void => {\n this.props.moduleState.setHasError(false);\n this.errorMessage = undefined;\n };\n\n private readonly onSave = async (): Promise => {\n await this.onSubmit();\n };\n\n private readonly onEdit = async (): Promise => {\n this.props.telemetry.information('Delivery options onEdit is called.');\n\n this.clearError();\n this.onUpdating();\n await this.props.data.checkout.result?.updateShouldCollapsePaymentSection({ newShouldCollapsePaymentSection: true });\n };\n\n private readonly onSubmit = async (): Promise => {\n this.props.telemetry.information('Delivery options onSubmit is called.');\n if (this.isMultipleAddressShippingEnabled) {\n this.updateCartLinesDeliverySpecification();\n } else {\n await this.updateCartDeliverySpecification(this.selectedItemId);\n }\n await this.props.data.checkout.result?.updateShouldCollapsePaymentSection({ newShouldCollapsePaymentSection: false });\n };\n\n private readonly onCancel = async (): Promise => {\n this.props.telemetry.information('Delivery options onCancel is called.');\n\n // Reset to the saved value\n const savedDeliveryOption = this.getSavedDeliveryOption();\n if (savedDeliveryOption) {\n this.selectedItemId = savedDeliveryOption;\n this.onReady();\n\n await this.props.data.checkout.result?.updateShouldCollapsePaymentSection({ newShouldCollapsePaymentSection: false });\n } else {\n this.onUpdating();\n }\n };\n\n private readonly getSavedDeliveryOption = (): string | undefined => {\n const cartLinesForShipping = this.getCartLinesForShipping();\n return cartLinesForShipping[0] && cartLinesForShipping[0].DeliveryMode;\n };\n\n private readonly getCartLinesSavedDeliveryOption = (): void => {\n const cartLinesForShipping = this.getCartLinesForShipping();\n cartLinesForShipping.forEach(cartLine => {\n const deliveryMode = cartLine.DeliveryMode !== undefined ? cartLine.DeliveryMode : '';\n if (!cartLine.LineId || StringExtensions.isNullOrEmpty(deliveryMode)) {\n return;\n }\n const cartLineId = cartLine?.LineId;\n const existingCartLineSelectedDeliveryOption = this.cartLinesDeliveryOptions.find(\n cartLineDeliveryOption => cartLineDeliveryOption.cartLineId === cartLineId\n );\n if (existingCartLineSelectedDeliveryOption) {\n existingCartLineSelectedDeliveryOption.selectedDeliveryOption = deliveryMode;\n } else {\n if (cartLineId !== undefined) {\n this.cartLinesDeliveryOptions.push({ cartLineId, selectedDeliveryOption: deliveryMode });\n }\n }\n });\n };\n\n private readonly updateCartDeliverySpecification = async (deliveryModeId: string): Promise => {\n if (deliveryModeId.trim() === '') {\n return;\n }\n\n const { resources } = this.props;\n const checkoutState = this.props.data.checkout.result as ICheckoutState;\n const updateCartDeliverySpecificationInput = {\n deliveryModeId,\n shippingAddress: checkoutState.shippingAddress,\n channelDeliveryOptionConfig: this.retailMultiplePickUpOptionEnabled ? this.channelDeliveryOptionConfig : undefined\n };\n\n this.clearError();\n this.onPending();\n\n await checkoutState.checkoutCart\n .updateCartDeliverySpecification(updateCartDeliverySpecificationInput)\n .then(response => {\n if (response.status === 'FAILED') {\n const errorMessage = `${response.errorDetails?.LocalizedMessage}`;\n this.setError(StringExtensions.isNullOrEmpty(errorMessage) ? resources.genericErrorMessage : errorMessage);\n }\n\n this.onReady();\n this.props.moduleState.setIsCancellable(true);\n })\n .catch(() => {\n this.setError(resources.genericErrorMessage);\n });\n };\n\n @action\n private readonly updateCartLinesDeliverySpecification = async (): Promise => {\n if (!this.cartLineSelectedDeliveryOptions || !this.cartLineSelectedDeliveryOptions.length) {\n return;\n }\n const { resources } = this.props;\n let lineSpecs: LineDeliverySpecification[] = [];\n const checkoutCartLines = this.props.data.checkout.result?.checkoutCart.cart.CartLines;\n\n this.cartLineSelectedDeliveryOptions.forEach(group => {\n const address = checkoutCartLines?.find(cartLine => cartLine.LineId === group.cartLineId)?.ShippingAddress;\n const lineSpec = {\n LineId: group.cartLineId,\n DeliverySpecification: {\n DeliveryModeId: group.selectedDeliveryOption,\n DeliveryPreferenceTypeValue: DeliveryPreferenceType.ShipToAddress,\n DeliveryAddress: address\n }\n };\n lineSpecs.push(lineSpec);\n });\n\n try {\n const checkoutState = this.props.data.checkout.result as ICheckoutState;\n const response = await checkoutState.checkoutCart.updateCartLinesDeliverySpecification({\n lineDeliverySpecifications: lineSpecs\n });\n\n if (response.status === 'FAILED') {\n this.setError(resources.genericErrorMessage);\n } else {\n const cartLines = this.props.data.checkout.result?.checkoutCart.cart.CartLines;\n if (cartLines !== undefined && cartLines.length > 0) {\n cartLines?.forEach(cartLine => {\n const cartLineId = cartLine.LineId?.toString();\n const existingCartLineSelectedDeliveryOption = this.cartLineSelectedDeliveryOptions.find(\n cartLineSelectedDeliveryOption => cartLineSelectedDeliveryOption.cartLineId === cartLineId\n );\n if (existingCartLineSelectedDeliveryOption) {\n cartLine.RequestedDeliveryDate = existingCartLineSelectedDeliveryOption.requestDeliveryDate\n ? new Date(existingCartLineSelectedDeliveryOption.requestDeliveryDate)\n : undefined;\n }\n });\n await checkoutState.checkoutCart.updateCartLines({ updatedCartLinesObject: cartLines });\n }\n this.onReady();\n this.props.moduleState.setIsCancellable(true);\n }\n } catch {\n this.setError(resources.genericErrorMessage);\n }\n };\n\n private readonly getCartLinesForShipping = (): CartLine[] => {\n const { request } = this.props.context;\n const pickupDeliveryModeCode = request && request.channel && request.channel.PickupDeliveryModeCode;\n const emailDeliveryModeCode = request && request.channel && request.channel.EmailDeliveryModeCode;\n\n return this.retailMultiplePickUpOptionEnabled\n ? ((this.props.data.checkout.result && this.props.data.checkout.result.checkoutCart.cart.CartLines) || []).filter(cartLine =>\n cartLine.DeliveryMode && cartLine.DeliveryMode !== ''\n ? cartLine.DeliveryMode !==\n this.channelDeliveryOptionConfig?.PickupDeliveryModeCodes?.find(\n deliveryMode => deliveryMode === cartLine.DeliveryMode\n ) && cartLine.DeliveryMode !== emailDeliveryModeCode\n : cartLine\n )\n : ((this.props.data.checkout.result && this.props.data.checkout.result.checkoutCart.cart.CartLines) || []).filter(cartLine =>\n cartLine.DeliveryMode && cartLine.DeliveryMode !== ''\n ? cartLine.DeliveryMode !== pickupDeliveryModeCode && cartLine.DeliveryMode !== emailDeliveryModeCode\n : cartLine\n );\n };\n\n private readonly getDeliveryOptions = async (shippingAddress: Address): Promise => {\n if (!this.props.data.checkout.result) {\n return;\n }\n\n const { context, resources, config } = this.props;\n const cartState = this.props.data.checkout.result?.checkoutCart;\n const cartId = (cartState.cart as Cart).Id;\n\n if (context) {\n this.isLoading = true;\n this.deliveryOptions = [];\n this.selectedItemId = '';\n this.clearError();\n\n try {\n let originalDeliveryMode: string = '';\n const shippingCartLines = this.getCartLinesForShipping();\n const hasShippingDeliveryLines = shippingCartLines && shippingCartLines.length > 0 && shippingCartLines[0].DeliveryMode;\n if (hasShippingDeliveryLines) {\n // First store the delivery mode, so that we can restore the shipping information.\n originalDeliveryMode = shippingCartLines[0].DeliveryMode || '';\n\n // Clear the delivery information on retail server, so GetDeliveryOptions charge calculation works correctly\n const cart = cartState.cart;\n await cartState.clearCartLinesDeliveryInformation({\n cart,\n channelDeliveryOptionConfiguration: this.channelDeliveryOptionConfig\n });\n }\n\n // TODO: Check if we can move this getDeliveryOptions to checkout state\n let deliveryOptionFilter: FilterDeliveryModeOption;\n switch (config.filterDeliveryModeOption) {\n case filterDeliveryModeOption.none:\n deliveryOptionFilter = FilterDeliveryModeOption.None;\n break;\n case filterDeliveryModeOption.filterOutNonCarrierDeliveryMode:\n deliveryOptionFilter = FilterDeliveryModeOption.FilterOutNonCarrierDeliveryMode;\n break;\n default:\n deliveryOptionFilter = FilterDeliveryModeOption.FilterOutNonCarrierDeliveryMode;\n }\n const response = await getDeliveryOptionsAsync(\n {\n callerContext: context.actionContext,\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(context.actionContext)\n },\n cartId,\n shippingAddress,\n [],\n deliveryOptionFilter,\n true\n );\n\n if (hasShippingDeliveryLines) {\n await this.updateCartDeliverySpecification(originalDeliveryMode);\n }\n\n if (response && response.length > 0) {\n this.deliveryOptions = response;\n }\n } catch {\n this.setError(resources.genericErrorMessage);\n }\n\n if (this.deliveryOptions.length === 0) {\n this.setError(resources.deliveryOptionsNotFound);\n } else if (this.cartDeliveryMode && this.isDeliveryModeExists(this.cartDeliveryMode)) {\n this.selectedItemId = this.cartDeliveryMode;\n this.cartDeliveryMode = undefined;\n this.onReady();\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\n this.props.data.checkout.result?.updateHasCartDeliveryMode({ newHasCartDeliveryMode: true });\n\n if (!this.props.data.checkout.result?.isPaymentVerificationRedirection) {\n await this.props.data.checkout.result.updateShouldCollapsePaymentSection({ newShouldCollapsePaymentSection: false });\n }\n } else {\n this.onUpdating();\n this.selectedItemId = this.deliveryOptions.length > 0 ? this.deliveryOptions[0].Code || '' : ''; // By default, select first delivery\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\n this.props.data.checkout.result?.updateHasCartDeliveryMode({ newHasCartDeliveryMode: !!this.isSelectDefaultOptionEnabled });\n }\n\n this.isLoading = false;\n }\n };\n\n private readonly getStoredDeliveryOptions = async (): Promise => {\n if (!this.props.data.checkout.result) {\n return;\n }\n\n const { context } = this.props;\n const cartState = this.props.data.checkout.result.checkoutCart;\n\n if (context) {\n this.isLoading = true;\n this.deliveryOptions = [];\n this.selectedItemId = '';\n this.clearError();\n\n let originalDeliveryMode: string = '';\n const shippingCartLines = this.getCartLinesForShipping();\n const hasShippingDeliveryLines = shippingCartLines && shippingCartLines.length > 0 && shippingCartLines[0].DeliveryMode;\n if (hasShippingDeliveryLines) {\n // First store the delivery mode, so that we can restore the shipping information.\n originalDeliveryMode = shippingCartLines[0].DeliveryMode || '';\n\n // Clear the delivery information on retail server, so GetDeliveryOptions charge calculation works correctly\n const cart = cartState.cart;\n await cartState.clearCartLinesDeliveryInformation({\n cart,\n channelDeliveryOptionConfiguration: this.channelDeliveryOptionConfig\n });\n if (hasShippingDeliveryLines) {\n await this.updateCartDeliverySpecification(originalDeliveryMode);\n }\n }\n\n if (this.cartDeliveryMode) {\n this.selectedItemId = this.cartDeliveryMode;\n this.cartDeliveryMode = undefined;\n this.onReady();\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\n this.props.data.checkout.result?.updateHasCartDeliveryMode({ newHasCartDeliveryMode: true });\n\n if (!this.props.data.checkout.result.isPaymentVerificationRedirection) {\n await this.props.data.checkout.result.updateShouldCollapsePaymentSection({ newShouldCollapsePaymentSection: false });\n }\n }\n\n this.isLoading = false;\n }\n };\n\n private readonly loadDeliveryOptions = async (): Promise => {\n const { checkout } = this.props.data;\n const { result } = checkout || {};\n const { shippingAddress, cartLinesWithShippingAddress, isPaymentVerificationRedirection, isExpressCheckoutApplied } = result || {};\n const { features } = this.props.context.actionContext.requestContext || {};\n\n if (!this.canShip() || !(shippingAddress || cartLinesWithShippingAddress)) {\n return;\n }\n\n const shouldSubmit = this.isSelectDefaultOptionEnabled || isExpressCheckoutApplied || this.isExpressPaymentAppliedInCartPage;\n\n if (features?.enable_checkout_race_condition_hot_fix) {\n if (isPaymentVerificationRedirection) {\n await this.getStoredDeliveryOptions();\n } else {\n if (!isPaymentVerificationRedirection || shouldSubmit) {\n await this.loadDeliveryOptionsBasedOnAddress(shippingAddress);\n }\n }\n } else {\n if (!isPaymentVerificationRedirection || shouldSubmit) {\n await this.loadDeliveryOptionsBasedOnAddress(shippingAddress);\n }\n\n if (isPaymentVerificationRedirection) {\n await this.getStoredDeliveryOptions();\n }\n }\n\n if (shouldSubmit) {\n await this.onSubmit();\n }\n };\n\n private readonly loadDeliveryOptionsBasedOnAddress = async (shippingAddress?: Address): Promise => {\n if (this.isMultipleAddressShippingEnabled) {\n if (shippingAddress) {\n await this.getGroupDeliveryOptions(shippingAddress);\n } else {\n await this.getGroupDeliveryOptions();\n }\n } else if (shippingAddress) {\n await this.getDeliveryOptions(shippingAddress);\n }\n };\n\n private readonly onDeliveryOptionChange = (event: React.ChangeEvent) => {\n const deliveryModeId = event.currentTarget.value;\n this.selectedItemId = deliveryModeId;\n };\n\n private readonly onCartLineDeliveryOptionChange = (\n event: React.ChangeEvent,\n cartLines: CartLine[],\n cartLineId?: string\n ) => {\n const deliveryModeId = event.currentTarget.value;\n if (cartLineId !== undefined) {\n const existingCartLineSelectedDeliveryOption = this.cartLineSelectedDeliveryOptions.find(\n cartLineSelectedDeliveryOption => cartLineSelectedDeliveryOption.cartLineId === cartLineId\n );\n if (existingCartLineSelectedDeliveryOption) {\n existingCartLineSelectedDeliveryOption.selectedDeliveryOption = deliveryModeId;\n } else {\n this.cartLineSelectedDeliveryOptions.push({ cartLineId, selectedDeliveryOption: deliveryModeId });\n }\n return;\n }\n\n cartLines.forEach(cartLine => {\n if (!cartLine.LineId) {\n return;\n }\n const cartLineId = cartLine?.LineId.toString();\n const existingCartLineSelectedDeliveryOption = this.cartLineSelectedDeliveryOptions.find(\n cartLineSelectedDeliveryOption => cartLineSelectedDeliveryOption.cartLineId === cartLineId\n );\n if (existingCartLineSelectedDeliveryOption) {\n existingCartLineSelectedDeliveryOption.selectedDeliveryOption = deliveryModeId;\n } else {\n this.cartLineSelectedDeliveryOptions.push({ cartLineId, selectedDeliveryOption: deliveryModeId });\n }\n });\n };\n\n private readonly onCartLineRequestDeliveryDateChange = (event: React.ChangeEvent, cartLines: CartLine[]) => {\n const deliveryDate = event.currentTarget.value;\n cartLines.forEach(cartLine => {\n if (!cartLine.LineId) {\n return;\n }\n const cartLineId = cartLine?.LineId.toString();\n const existingCartLineSelectedDeliveryOption = this.cartLineSelectedDeliveryOptions.find(\n cartLineSelectedDeliveryOption => cartLineSelectedDeliveryOption.cartLineId === cartLineId\n );\n if (existingCartLineSelectedDeliveryOption) {\n existingCartLineSelectedDeliveryOption.requestDeliveryDate = deliveryDate;\n } else {\n const deliveryModeId = cartLine.DeliveryMode !== undefined ? cartLine.DeliveryMode : '';\n this.cartLineSelectedDeliveryOptions.push({\n cartLineId,\n selectedDeliveryOption: deliveryModeId,\n requestDeliveryDate: deliveryDate\n });\n }\n });\n };\n\n private readonly onReady = () => {\n if (!(this.props.config.useDefaultDeliveryOption === useDefaultDeliveryOption.notDisplaySelectedDeliveryOption)) {\n this.props.moduleState.onReady();\n }\n };\n\n private readonly onUpdating = () => {\n if (!(this.props.config.useDefaultDeliveryOption === useDefaultDeliveryOption.notDisplaySelectedDeliveryOption)) {\n this.props.moduleState.onUpdating();\n }\n };\n\n private readonly onPending = () => {\n if (!this.isSelectDefaultOptionEnabled) {\n this.props.moduleState.onPending();\n }\n };\n\n private readonly getCheckoutCartLineGroupDeliveryOptions = (): React.ReactNode => {\n const { resources, config } = this.props;\n const shippingCartLines = this.getCartLinesForShipping();\n if (!ArrayExtensions.hasElements(shippingCartLines) || !ArrayExtensions.hasElements(this.groupDeliveryOptions)) {\n return null;\n }\n const imageSettings = this.getImageSettings(config.imageSettings);\n const requestDeliveryDateEnabled = config.enableRequestDeliveryDate === true && this.isMultipleAddressShippingEnabled === true;\n return (\n
\n {this.groupDeliveryOptions.map((groupDeliveryOption: DeliveryOptionsCartLineAddress, index) => {\n const cartLineId = groupDeliveryOption.cartLineIds !== undefined ? groupDeliveryOption.cartLineIds[0] : '';\n const cartLine1 = shippingCartLines.find(cartLine => cartLineId === cartLine?.LineId?.toString() ?? '');\n const cartLine = shippingCartLines.filter(\n cartLine => groupDeliveryOption && (cartLineId === cartLine?.LineId?.toString() ?? '')\n );\n if (groupDeliveryOption !== undefined) {\n const selectedDeliveryOption = this.cartLineSelectedDeliveryOptions.find(\n cartLineSelectedDeliveryOption => cartLineSelectedDeliveryOption.cartLineId === cartLine[0].LineId\n )?.selectedDeliveryOption;\n return (\n
\n
\n \n
\n
\n
\n \n {resources.cartLineGroupDeliveryOptionsLabel}\n \n \n {resources.cartLineGroupDeliveryOptionsText}\n \n {requestDeliveryDateEnabled ? (\n \n ) : null}\n \n
\n {groupDeliveryOption.cartLineIds?.map(cartLineId => {\n const cartLine1 = shippingCartLines.find(\n cartLine => cartLineId === cartLine?.LineId?.toString() ?? ''\n );\n const selectedDeliveryOption1 = this.cartLineSelectedDeliveryOptions.find(\n cartLineSelectedDeliveryOption =>\n cartLineSelectedDeliveryOption.cartLineId === cartLine1?.LineId\n )?.selectedDeliveryOption;\n return (\n \n );\n })}\n
\n
\n );\n } else {\n return null;\n }\n })}\n
\n );\n };\n\n private readonly getGroupDeliveryOptions = async (shippingAddress?: Address): Promise => {\n if (!this.props.data.checkout.result) {\n return;\n }\n\n const { context, resources, config } = this.props;\n const cartState = this.props.data.checkout.result?.checkoutCart;\n\n if (context) {\n this.isLoading = true;\n this.deliveryOptions = [];\n this.selectedItemId = '';\n this.clearError();\n\n try {\n let originalDeliveryMode: string = '';\n const shippingCartLines = this.getCartLinesForShipping();\n const cartLinesForShipping: CartLine[] = [];\n if (ArrayExtensions.hasElements(shippingCartLines)) {\n const getGroupByDelivery = (items: CartLine[]) => groupBy(items, item => item.ShippingAddress?.RecordId);\n cartLinesForShipping.push(getGroupByDelivery(shippingCartLines));\n console.log('running delivery option for all lines');\n }\n const hasShippingDeliveryLines = shippingCartLines && shippingCartLines.length > 0 && shippingCartLines[0].DeliveryMode;\n const cart = cartState.cart;\n if (hasShippingDeliveryLines) {\n // First store the delivery mode, so that we can restore the shipping information.\n originalDeliveryMode = shippingCartLines[0].DeliveryMode || '';\n\n // Clear the delivery information on retail server, so GetDeliveryOptions charge calculation works correctly\n await cartState.clearCartLinesDeliveryInformation({\n cart,\n channelDeliveryOptionConfiguration: this.channelDeliveryOptionConfig\n });\n }\n\n // TODO: Check if we can move this getDeliveryOptions to checkout state\n let deliveryOptionFilter: FilterDeliveryModeOption;\n switch (config.filterDeliveryModeOption) {\n case filterDeliveryModeOption.none:\n deliveryOptionFilter = FilterDeliveryModeOption.None;\n break;\n case filterDeliveryModeOption.filterOutNonCarrierDeliveryMode:\n deliveryOptionFilter = FilterDeliveryModeOption.FilterOutNonCarrierDeliveryMode;\n break;\n default:\n deliveryOptionFilter = FilterDeliveryModeOption.FilterOutNonCarrierDeliveryMode;\n }\n let response: DeliveryOptionsCartLineAddress[] = [];\n if (shippingAddress !== undefined && shippingAddress.RecordId !== undefined) {\n const checkoutState = this.props.data.checkout.result;\n const cartLineIds = shippingCartLines.map(cartLine => (cartLine.LineId !== undefined ? cartLine.LineId : ''));\n await getDeliveryOptionsAsync(\n {\n callerContext: context.actionContext,\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(context.actionContext)\n },\n cart.Id,\n shippingAddress,\n [],\n deliveryOptionFilter,\n true\n ).then(async result => {\n if (result && result.length > 0) {\n response.push({ deliveryOptions: result, hasError: false, error: undefined, cartLineIds: cartLineIds });\n shippingCartLines?.forEach(cartLine => {\n cartLine.ShippingAddress = shippingAddress;\n });\n await checkoutState.checkoutCart.updateCartLines({ updatedCartLinesObject: shippingCartLines });\n // console.log(updateLineDeliverySpecifications());\n } else {\n response.push({\n deliveryOptions: [],\n hasError: true,\n error: 'No delivery options available',\n cartLineIds: cartLineIds\n });\n }\n });\n } else {\n const inputData = new GetDeliveryOptionsForCartLineAddressInput(deliveryOptionFilter, shippingCartLines);\n response = await getDeliveryOptionsForCartLineAddress(inputData, context.actionContext);\n }\n if (response && response.length > 0) {\n this.groupDeliveryOptions = response;\n console.log('groupDeliveryOptions');\n }\n if (this.groupDeliveryOptions.length === 0) {\n this.setError(resources.deliveryOptionsNotFound);\n } else if (this.cartLinesDeliveryOptions.length !== 0) {\n this.cartLineSelectedDeliveryOptions = this.cartLinesDeliveryOptions;\n this.cartLinesDeliveryOptions = [];\n this.onReady();\n } else {\n this.onUpdating();\n this.groupDeliveryOptions.forEach(group => {\n const selectedDeliveryOption =\n group.deliveryOptions.length > 0 && group.deliveryOptions[0].Code !== undefined\n ? group.deliveryOptions[0].Code\n : '';\n group.cartLineIds?.forEach(cartLineId => {\n const existingCartLineSelectedDeliveryOption = this.cartLineSelectedDeliveryOptions.find(\n cartLineDeliveryOption => cartLineDeliveryOption.cartLineId === cartLineId\n );\n if (existingCartLineSelectedDeliveryOption) {\n existingCartLineSelectedDeliveryOption.selectedDeliveryOption = selectedDeliveryOption;\n } else {\n this.cartLineSelectedDeliveryOptions.push({\n cartLineId,\n selectedDeliveryOption\n });\n }\n });\n });\n }\n\n if (hasShippingDeliveryLines) {\n await this.updateCartDeliverySpecification(originalDeliveryMode);\n }\n } catch {\n this.setError(resources.genericErrorMessage);\n }\n }\n this.isLoading = false;\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 private readonly getMultipleDeliveryOptionSelected = (): ICheckoutShippingCartLineInfo[] => {\n const products = this.props.data.products?.result;\n const cartLineImages: ICheckoutShippingCartLineInfo[] = [];\n\n this.cartLineSelectedDeliveryOptions.map(cartLineDeliveryOption => {\n const cartLine = this.props.data.checkout.result?.checkoutCart.cart.CartLines?.find(\n (cartLine: CartLine) => cartLine.LineId === cartLineDeliveryOption.cartLineId\n );\n if (cartLine) {\n const product = products?.find((product: SimpleProduct) => product.RecordId === cartLine.ProductId);\n const imageProps: IImageProps = {\n requestContext: this.props.context.actionContext.requestContext,\n className: 'ms-checkout-shipping-address__group-images-lines-line-image',\n altText: product?.Name,\n src: product?.PrimaryImageUrl ?? '',\n fallBackSrc: getFallbackImageUrl(\n product?.ItemId,\n this.props.context.actionContext.requestContext.apiSettings,\n this.props.context.request.app?.config?.OmniChannelMedia\n ),\n gridSettings: this.props.context.request.gridSettings!,\n imageSettings: this.props.config.imageSettings ?? defaultImageSettings,\n loadFailureBehavior: 'empty'\n };\n let deliveryModeDesc = this.deliveryOptions.find(\n deliveryOption => deliveryOption.Code === cartLineDeliveryOption.selectedDeliveryOption\n )?.Description;\n if (StringExtensions.isNullOrEmpty(deliveryModeDesc)) {\n const group = this.groupDeliveryOptions.find(group => group.cartLineIds?.includes(cartLineDeliveryOption.cartLineId));\n const deliveryOption = group?.deliveryOptions.find(\n option => option.Code === cartLineDeliveryOption.selectedDeliveryOption\n );\n deliveryModeDesc = deliveryOption?.Description;\n }\n const cartLineDisplay = {\n lineId: cartLine.LineId,\n imageProps: imageProps,\n deliveryMethodDesc: deliveryModeDesc,\n requestDeliveryDate: cartLineDeliveryOption.requestDeliveryDate\n };\n cartLineImages.push(cartLineDisplay);\n }\n });\n\n return cartLineImages;\n };\n}\n\nexport default CheckoutDeliveryOptions;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Alert, Button, INodeProps, NodeTag } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { showAdditionalFields } from '../checkout-gift-card.props.autogenerated';\n\nexport interface IGetFormInput {\n errorMessage: string;\n giftCardNumber: string;\n giftCardPin: string;\n giftCardExp: string;\n inputRef?: React.RefObject;\n inputPinRef?: React.RefObject;\n inputExpRef?: React.RefObject;\n supportExternalGiftCard?: boolean;\n additionalFields?: showAdditionalFields;\n disableAddGiftCard?: boolean;\n resources: {\n applyGiftCardButton: string;\n giftCardFormLabel: string;\n giftCardNumberLabel: string;\n giftCardPinLabel: string;\n giftCardExpLabel: string;\n giftCardAlertLabel: string;\n giftCardPinPlaceholderText: string;\n giftCardExpPlaceholderText: string;\n };\n onEnterGiftCardNumber(giftCardNumber: string): void;\n onEnterGiftCardPin(giftCardPin: string): void;\n onEnterGiftCardExp(giftCardExp: string): void;\n onApplyGiftCard(): Promise;\n}\n\nexport interface IForm {\n formProps: INodeProps;\n label: React.ReactNode;\n inputPinLabel: React.ReactNode;\n inputExpLabel: React.ReactNode;\n alert: React.ReactNode;\n inputProps: INodeProps;\n inputNumProps: INodeProps;\n inputPinProps: INodeProps;\n inputExpProps: INodeProps;\n inputNumber: React.ReactNode;\n inputPin: React.ReactNode;\n inputExp: React.ReactNode;\n applyButton: React.ReactNode;\n supportExternalGiftCard: boolean | undefined;\n showGiftCardPinInput: boolean | undefined;\n showGiftCardExpInput: boolean | undefined;\n alertFieldLabel: React.ReactNode;\n}\n\n/**\n * On Apply Function.\n * @param onApplyGiftCard -On Apply Gift Card Function.\n * @returns Call of Apply Gift Card Function.\n */\nconst onApplyHandler = (onApplyGiftCard: () => Promise) => async (event: React.SyntheticEvent): Promise => {\n event.preventDefault();\n await onApplyGiftCard();\n};\n\n/**\n * On change number Function.\n * @param onEnterGiftCardNumber -On enter gift card number Function.\n * @returns Call of on enter gift card number Function.\n */\nconst onChangeNumberHandler = (onEnterGiftCardNumber: (giftCardNumber: string) => void) => (event: React.ChangeEvent) => {\n const value = (event.target.value || '').replace(new RegExp('[<>]', 'gi'), '');\n onEnterGiftCardNumber(value);\n};\n\n/**\n * On Change pin event.\n * @param onEnterGiftCardPin -On enter gift card pin Function.\n * @returns Call of on enter gift card pin Function.\n */\nconst onChangePinHandler = (onEnterGiftCardPin: (giftCardPin: string) => void) => (event: React.ChangeEvent) => {\n const value = (event.target.value || '').replace(new RegExp('[<>]', 'gi'), '');\n onEnterGiftCardPin(value);\n};\n\n/**\n * On Change Event.\n * @param onEnterGiftCardExp -On enter gift card function.\n * @returns Call of On enter gift card function.\n */\n// Need to filter out the month and year\nconst onChangeExpHandler = (onEnterGiftCardExp: (giftCardExp: string) => void) => (event: React.ChangeEvent) => {\n const value = (event.target.value || '').replace(new RegExp('[<>]', 'gi'), '');\n onEnterGiftCardExp(value);\n};\n\nexport const getForm = (options: IGetFormInput): IForm => {\n const {\n errorMessage,\n inputRef,\n inputPinRef,\n inputExpRef,\n giftCardNumber,\n giftCardPin,\n giftCardExp,\n onEnterGiftCardNumber,\n onEnterGiftCardPin,\n onEnterGiftCardExp,\n onApplyGiftCard,\n supportExternalGiftCard,\n additionalFields,\n disableAddGiftCard,\n resources: {\n applyGiftCardButton,\n giftCardFormLabel,\n giftCardNumberLabel,\n giftCardPinLabel,\n giftCardExpLabel,\n giftCardAlertLabel,\n giftCardPinPlaceholderText,\n giftCardExpPlaceholderText\n }\n } = options;\n\n const formProps = {\n className: classnames('ms-checkout-gift-card__form', { 'is-invalid': !!errorMessage }),\n onSubmit: onApplyHandler(onApplyGiftCard),\n tag: 'form' as NodeTag\n };\n\n const label = (\n \n );\n\n const inputPinLabel = (\n \n );\n\n const inputExpLabel = (\n \n );\n\n const alertFieldLabel = (\n \n );\n\n const alert = (\n \n {errorMessage}\n \n );\n\n const inputProps = {\n className: 'ms-checkout-gift-card__input-fields'\n };\n\n const inputNumProps = {\n className: 'ms-checkout-gift-card__input-num-fields'\n };\n\n const inputPinProps = {\n className: 'ms-checkout-gift-card__input-pin-fields'\n };\n\n const inputExpProps = {\n className: 'ms-checkout-gift-card__input-exp-fields'\n };\n\n const inputNumber = (\n \n );\n\n const inputPin = (\n \n );\n\n const inputExp = (\n \n );\n\n const applyButton = (\n \n {applyGiftCardButton}\n \n );\n\n let showGiftCardPinInput = false;\n let showGiftCardExpInput = false;\n\n switch (additionalFields) {\n case showAdditionalFields.pin:\n showGiftCardPinInput = true;\n break;\n case showAdditionalFields.expirationDate:\n showGiftCardExpInput = true;\n break;\n case showAdditionalFields.pinAndExpirationDate:\n showGiftCardPinInput = true;\n showGiftCardExpInput = true;\n break;\n default:\n }\n\n return {\n formProps,\n label,\n inputPinLabel,\n inputExpLabel,\n alert,\n inputProps,\n inputNumProps,\n inputPinProps,\n inputExpProps,\n inputNumber,\n inputPin,\n inputExp,\n applyButton,\n supportExternalGiftCard,\n showGiftCardPinInput,\n showGiftCardExpInput,\n alertFieldLabel\n };\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IGiftCardExtend } from '@msdyn365-commerce/global-state';\nimport { Button, INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nexport interface IGetItemInput {\n giftCard: IGiftCardExtend;\n canRemove: boolean;\n resources: {\n enteredGiftCardLabel: string;\n giftCardAvailableBalanceLabel: string;\n removeGiftCardButton: string;\n };\n getFormattedPrice(price?: number, currencyCode?: string): string;\n onRemoveGiftCard(giftCardNumber: string): void;\n}\n\nexport interface IItem {\n itemProps: INodeProps;\n id?: string;\n selectedGiftCard: React.ReactNode;\n removeButton?: React.ReactNode;\n}\n\n/**\n * On remove function.\n * @param onRemoveGiftCard -Gift card number function.\n * @param giftCard -Gift card values.\n * @returns Call of onRemoveGiftCard function.\n */\nconst onRemoveHandler = (onRemoveGiftCard: (giftCardNumber: string) => void, giftCard: IGiftCardExtend) => (): void => {\n onRemoveGiftCard(giftCard.Id ?? '');\n};\n\n/**\n * GiftCardItem component.\n * @param root0\n * @param root0.giftCard\n * @param root0.getFormattedPrice\n * @param root0.canRemove\n * @param root0.onRemoveGiftCard\n * @param root0.resources\n * @param root0.resources.enteredGiftCardLabel\n * @param root0.resources.giftCardAvailableBalanceLabel\n * @param root0.resources.removeGiftCardButton\n * @extends {React.PureComponent}\n */\nexport const getItem = ({\n giftCard,\n getFormattedPrice,\n canRemove,\n onRemoveGiftCard,\n resources: { enteredGiftCardLabel, giftCardAvailableBalanceLabel, removeGiftCardButton }\n}: IGetItemInput): IItem => {\n const balance = getFormattedPrice(giftCard.Balance, giftCard.CardCurrencyCode);\n const giftCardLast4Digit = (giftCard.Id || '').substr(-4);\n\n const itemProps = {\n className: 'ms-checkout-gift-card__item'\n };\n\n const selectedGiftCard = (\n \n {enteredGiftCardLabel}\n {` `}\n {giftCardLast4Digit}\n {' ('}\n {giftCardAvailableBalanceLabel}\n {` `}\n {balance}\n {')'}\n \n );\n\n const removeButton = canRemove && (\n \n );\n\n return {\n itemProps,\n id: giftCard.Id,\n selectedGiftCard,\n removeButton\n };\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IGiftCardExtend } from '@msdyn365-commerce/global-state';\nimport { INodeProps } from '@msdyn365-commerce-modules/utilities';\n\nimport { getItem, IItem } from './get-item';\n\ninterface IGetListInput {\n giftCards?: IGiftCardExtend[];\n canRemove: boolean;\n resources: {\n enteredGiftCardLabel: string;\n giftCardAvailableBalanceLabel: string;\n removeGiftCardButton: string;\n };\n getFormattedPrice(price?: number, currencyCode?: string): string;\n onRemoveGiftCard(giftCardNumber: string): void;\n}\n\nexport interface IList {\n listProps: INodeProps;\n list: IItem[];\n}\n\nexport const getList = ({ giftCards, canRemove, resources, getFormattedPrice, onRemoveGiftCard }: IGetListInput): IList | undefined => {\n if (!giftCards || giftCards.length === 0) {\n return undefined;\n }\n\n const listProps = {\n className: 'ms-checkout-gift-card__list'\n };\n\n const list = giftCards.map(giftCard =>\n getItem({\n canRemove,\n getFormattedPrice,\n giftCard,\n onRemoveGiftCard,\n resources\n })\n );\n\n return {\n listProps,\n list\n };\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as React from 'react';\n\ninterface IGiftCardTitleProps {\n title: string;\n}\n\nconst GiftCardTitle: React.FC = ({ title }) => ;\n\nexport default GiftCardTitle;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { CheckoutModule, ErrorLocation, IGiftCardExtend } from '@msdyn365-commerce/global-state';\nimport {\n getGiftCardAsync,\n getTenderTypesAsync,\n resolveCardTypesAsync\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\nimport {\n CardType,\n CardTypeInfo,\n GiftCard,\n RetailOperation,\n TenderType\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { IModuleStateProps, withModuleState, EnabledPaymentsForOBO } from '@msdyn365-commerce-modules/checkout-utilities';\nimport { IModuleProps } from '@msdyn365-commerce-modules/utilities';\nimport classname from 'classnames';\nimport { computed, reaction, when } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { OPERATIONS } from '../checkout';\nimport { ICheckoutGiftCardData } from './checkout-gift-card.data';\nimport { ICheckoutGiftCardProps } from './checkout-gift-card.props.autogenerated';\nimport { getForm, IForm } from './components/get-form';\nimport { getList, IList } from './components/get-list';\nimport TitleCompoent from './components/title';\nimport { focusOnCheckoutError } from '../../checkout-errors';\n\nexport * from './components/get-form';\nexport * from './components/get-item';\nexport * from './components/get-list';\n\ninterface ICheckoutGiftCardState {\n isFetchingGiftCard: boolean;\n errorMessage: string;\n giftCardNumber: string;\n giftCardPin: string;\n giftCardExp: string;\n}\n\nenum SupportedGiftCardType {\n Internal = 'internal',\n External = 'external',\n Both = 'both'\n}\n\nexport interface ICheckoutGiftCardModuleProps extends ICheckoutGiftCardProps, IModuleStateProps {}\n\nexport interface IShowResource {\n title: React.ReactNode;\n list?: IList;\n}\n\nexport interface IAddResource {\n form: IForm;\n list?: IList;\n}\n\nexport interface ICheckoutGiftCardViewProps extends ICheckoutGiftCardProps<{}>, ICheckoutGiftCardState {\n className?: string;\n\n showGiftCard?: IShowResource;\n addGiftCard?: IAddResource;\n\n checkoutGiftCardProps: IModuleProps;\n couldPaidByGiftCard?: boolean;\n isEnabled?: boolean;\n checkoutErrorRef?: React.RefObject;\n onEdit?(): void;\n onCancel?(): void;\n onSubmit?(): void;\n enterGiftCardNumber?(giftCardNumber: string): void;\n enterGiftCardPin?(giftCardNumber: string): void;\n enterGiftCardExp?(giftCardNumber: string): void;\n removeGiftCard?(giftCardNumber: string): void;\n applyGiftCard?(): void;\n}\n\n/**\n *\n * CheckoutGiftCard component.\n * @extends {React.Component, ICheckoutGiftCardState>}\n */\n@observer\nexport class CheckoutGiftCard extends React.Component {\n public state: ICheckoutGiftCardState = {\n isFetchingGiftCard: false,\n errorMessage: '',\n giftCardNumber: '',\n giftCardPin: '',\n giftCardExp: ''\n };\n\n private readonly inputRef: React.RefObject = React.createRef();\n\n private readonly inputPinRef: React.RefObject = React.createRef();\n\n private readonly inputExpRef: React.RefObject = React.createRef();\n\n private readonly checkoutErrorRef: React.RefObject = React.createRef();\n\n @computed get isDataReady(): boolean {\n return (this.props.data.checkout.result && this.props.data.checkout.status) === 'SUCCESS';\n }\n\n @computed get getLoyaltyAmount(): number {\n const checkoutState = this.props.data.checkout.result;\n if (!checkoutState || !checkoutState.loyaltyAmount) {\n return 0;\n }\n return checkoutState.loyaltyAmount;\n }\n\n @computed get getCustomerAccountAmount(): number {\n const checkoutState = this.props.data.checkout.result;\n return checkoutState && checkoutState.customerAccountAmount ? checkoutState.customerAccountAmount : 0;\n }\n\n @computed get getGiftCardTotalAmount(): number {\n const checkoutState = this.props.data.checkout.result;\n if (!checkoutState || !checkoutState.giftCardExtends) {\n return 0;\n }\n return checkoutState.giftCardExtends.reduce((count: number, giftCard: IGiftCardExtend) => {\n const balance: number = giftCard.Balance || 0;\n return count + balance;\n }, 0);\n }\n\n @computed get disableAddGiftCard(): boolean {\n const cart = this.props.data.checkout.result ? this.props.data.checkout.result.checkoutCart.cart : undefined;\n if (!cart) {\n return true;\n }\n return (cart.TotalAmount || 0) - this.getLoyaltyAmount - this.getGiftCardTotalAmount <= 0;\n }\n\n @computed get shouldPayGiftCard(): boolean {\n const cart = this.props.data.checkout.result ? this.props.data.checkout.result.checkoutCart.cart : undefined;\n if (!cart) {\n return false;\n }\n\n // Use gift card card when loyalty points do not cover the total amount\n const amountDue = (cart.TotalAmount || 0) - this.getLoyaltyAmount - this.getCustomerAccountAmount;\n return amountDue > 0;\n }\n\n @computed get hasSelectedItem(): boolean {\n const {\n data: { checkout }\n } = this.props;\n const giftCards = checkout.result && checkout.result.giftCardExtends;\n return !!giftCards && giftCards.length > 0;\n }\n\n public componentDidMount(): void {\n when(\n () => this.isDataReady,\n () => {\n this.init();\n }\n );\n\n if (this.props.data.checkout.result?.shouldEnableCheckoutErrorDisplayMessaging) {\n reaction(\n () => this.props.data.checkout.result?.checkoutError,\n checkoutError => {\n if (checkoutError && checkoutError.errorLocation === ErrorLocation.CheckoutGiftCard && checkoutError.errorMessage) {\n this.setError(checkoutError.errorMessage);\n }\n }\n );\n\n reaction(\n () => this.props.data.checkout.result?.checkoutErrorFocus,\n checkoutErrorFocus => {\n if (checkoutErrorFocus === CheckoutModule.CheckoutGiftCard) {\n focusOnCheckoutError(this.checkoutErrorRef, this.props.context.actionContext);\n }\n }\n );\n }\n }\n\n public shouldComponentUpdate(nextProps: ICheckoutGiftCardModuleProps, nextState: ICheckoutGiftCardState): 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 | null {\n const {\n moduleState: { isReady },\n data: { checkout },\n config: { className, showAdditionalFields },\n resources\n } = this.props;\n const { errorMessage, giftCardNumber, giftCardPin, giftCardExp } = this.state;\n const giftCards = checkout.result && checkout.result.giftCardExtends;\n const additionalFields = showAdditionalFields;\n const supportedGiftCardType = this.props.context.app.config.giftCardSupported;\n\n if (!this.isEnabled() || (!this.shouldPayGiftCard && !isReady)) {\n this.props.context.telemetry.error('Checkout giftcard content is empty, module wont render');\n return null;\n }\n\n if (this.props.context.request.user.isOBORequest && EnabledPaymentsForOBO.GiftCard === 0) {\n this.props.context.telemetry.information('isOBORequest is enabled, Checkout gift card module wont render');\n return null;\n }\n\n const supportExternalGiftCard = supportedGiftCardType !== SupportedGiftCardType.Internal;\n\n const moduleClassName = classname('ms-checkout-gift-card', className, isReady ? 'show' : 'add');\n\n const viewProps: ICheckoutGiftCardViewProps = {\n ...this.props,\n ...this.state,\n className: moduleClassName,\n checkoutErrorRef: this.checkoutErrorRef,\n\n checkoutGiftCardProps: { moduleProps: this.props, className: moduleClassName },\n couldPaidByGiftCard: this.couldPaidByGiftCard(),\n isEnabled: this.isEnabled(),\n onEdit: this.onEdit,\n onCancel: this.onCancel,\n onSubmit: this.onSubmit,\n enterGiftCardNumber: this.enterGiftCardNumber,\n enterGiftCardPin: this.enterGiftCardPin,\n enterGiftCardExp: this.enterGiftCardExp,\n removeGiftCard: this.removeGiftCard,\n applyGiftCard: this.applyGiftCard,\n showGiftCard: isReady\n ? {\n title: ,\n list: getList({\n canRemove: false,\n getFormattedPrice: this.getFormattedPrice,\n giftCards: giftCards && [...giftCards], // Note: ReadOnly Checkout State GiftCard[] is not assignable to GiftCard[] type\n onRemoveGiftCard: this.removeGiftCard,\n resources\n })\n }\n : undefined,\n addGiftCard: !isReady\n ? {\n form: getForm({\n errorMessage,\n giftCardNumber,\n giftCardPin,\n giftCardExp,\n inputRef: this.inputRef,\n inputPinRef: this.inputPinRef,\n inputExpRef: this.inputExpRef,\n resources,\n onEnterGiftCardNumber: this.enterGiftCardNumber,\n onEnterGiftCardPin: this.enterGiftCardPin,\n onEnterGiftCardExp: this.enterGiftCardExp,\n onApplyGiftCard: this.applyGiftCard,\n supportExternalGiftCard,\n additionalFields,\n disableAddGiftCard: this.disableAddGiftCard\n }),\n list: getList({\n canRemove: true,\n getFormattedPrice: this.getFormattedPrice,\n giftCards: giftCards && [...giftCards], // Note: ReadOnly Checkout State GiftCard[] is not assignable to GiftCard[] type\n onRemoveGiftCard: this.removeGiftCard,\n resources\n })\n }\n : undefined\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n private readonly init = (): void => {\n this.props.moduleState.init({\n onEdit: this.onEdit,\n onCancel: this.onCancel,\n onSubmit: this.onSubmit,\n isRequired: false,\n ...(!this.isEnabled() && { status: 'disabled' })\n });\n\n const giftCards = this.props.data.checkout.result?.giftCardExtends;\n if (giftCards && giftCards.length > 0) {\n this.props.moduleState.onReady();\n } else if (this.props.data.checkout.result?.isPaymentVerificationRedirection) {\n this.props.moduleState.onSkip();\n }\n };\n\n private readonly couldPaidByGiftCard = (): boolean => {\n const cart = this.props.data.checkout.result ? this.props.data.checkout.result.checkoutCart?.cart : undefined;\n if (!cart) {\n return false;\n }\n\n // Use gift card when it is not free\n return (cart.TotalAmount || 0) > 0;\n };\n\n private readonly isEnabled = (): boolean => {\n if (\n !this.props.context.request.user.isAuthenticated &&\n this.props.context.app.config.giftCardSupported !== SupportedGiftCardType.External &&\n !this.props.config.shouldBeEnabledForGuest\n ) {\n return false;\n }\n return this.couldPaidByGiftCard();\n };\n\n private readonly onEdit = (): void => {\n this.props.telemetry.information('Payment section gift card onEdit is called.');\n\n // Show add gift card form\n this.props.moduleState.onUpdating();\n };\n\n private readonly onCancel = (): void => {\n this.props.telemetry.information('Payment section gift card onCancel is called.');\n\n this.handleCancelOrSubmit();\n };\n\n private readonly onSubmit = (): void => {\n this.props.telemetry.information('Payment section gift card onSubmit is called.');\n\n this.handleCancelOrSubmit();\n };\n\n private readonly handleCancelOrSubmit = () => {\n if (this.hasSelectedItem) {\n // Show summary screen\n this.props.moduleState.onReady();\n } else {\n // Skip the module\n this.props.moduleState.onSkip();\n }\n };\n\n private readonly getFormattedPrice = (price: number = 0, currencyCode: string = 'USD'): string => {\n return this.props.context.cultureFormatter.formatCurrency(price, currencyCode);\n };\n\n private readonly enterGiftCardNumber = (giftCardNumber: string): void => {\n this.setState({\n giftCardNumber\n });\n this.clearError();\n };\n\n private readonly enterGiftCardPin = (giftCardPin: string): void => {\n this.setState({\n giftCardPin\n });\n this.clearError();\n };\n\n private readonly enterGiftCardExp = (giftCardExp: string): void => {\n this.setState({\n giftCardExp\n });\n this.clearError();\n };\n\n private readonly setError = (errorMessage: string): void => {\n this.props.telemetry.error('Error', errorMessage);\n this.props.telemetry.debug('Error', errorMessage);\n this.props.moduleState.setHasError(true);\n this.setState({\n errorMessage\n });\n };\n\n private readonly clearError = (): void => {\n this.props.moduleState.setHasError(false);\n this.setState({\n errorMessage: ''\n });\n };\n\n private readonly removeGiftCard = async (giftCardNumber: string): Promise => {\n this.props.telemetry.information('Payment section gift card remove is called.');\n\n const checkoutState = this.props.data.checkout.result;\n if (!checkoutState) {\n return;\n }\n\n await checkoutState.removeGiftCard({ giftCardNumber });\n };\n\n private readonly applyGiftCard = async (): Promise => {\n this.props.telemetry.information('Payment section gift card apply is called.');\n\n if (this.state.isFetchingGiftCard) {\n return;\n }\n this.setState({\n isFetchingGiftCard: true\n });\n\n const checkoutState = this.props.data.checkout.result;\n const giftCardNumber = this.state.giftCardNumber.trim();\n const giftCardPin = this.state.giftCardPin.trim();\n const giftCardExp = this.state.giftCardExp.trim();\n\n const giftCardTypes = await this.getGiftCardTypes(giftCardNumber);\n const giftCardType = giftCardTypes && giftCardTypes[0];\n const isPinRequired = giftCardType && giftCardType.IsPinRequired;\n const isExpRequired = giftCardType && giftCardType.IsExpirationDateRequired;\n const tenderTypeId = giftCardType && giftCardType.PaymentMethodId;\n const giftCard = await this.getGiftCard(giftCardNumber, giftCardPin, giftCardExp, isPinRequired, isExpRequired, tenderTypeId);\n\n if (checkoutState && giftCard) {\n await checkoutState.addGiftCard({\n giftCard,\n additionalProperties: { Pin: giftCardPin, ExpirationDate: giftCardExp, TenderTypeId: tenderTypeId }\n });\n this.clearError();\n this.setState({\n giftCardNumber: '',\n giftCardPin: '',\n giftCardExp: '',\n isFetchingGiftCard: false\n });\n return Promise.resolve();\n }\n const input = this.inputRef && this.inputRef.current && this.inputRef.current.focus && (this.inputRef.current as HTMLElement);\n input && input.focus();\n this.setState({\n isFetchingGiftCard: false\n });\n this.props.telemetry.information('Payment section fetching gift card is failed.');\n };\n\n private readonly findGiftcardTenderTypes = (\n tenderTypes: TenderType[],\n operationId: RetailOperation,\n giftcardType: string\n ): string[] | undefined => {\n let matchedTenderTypes: TenderType[] | undefined;\n\n switch (giftcardType) {\n case SupportedGiftCardType.Internal:\n matchedTenderTypes = tenderTypes.filter(\n tenderType => tenderType.OperationId === operationId && tenderType.ConnectorId === ''\n );\n break;\n case SupportedGiftCardType.External:\n matchedTenderTypes = tenderTypes.filter(\n tenderType => tenderType.OperationId === operationId && tenderType.ConnectorId !== ''\n );\n break;\n default:\n throw new Error('Invalid gift card type');\n }\n\n if (matchedTenderTypes) {\n return matchedTenderTypes.map(tenderType => tenderType.TenderTypeId || '');\n }\n return;\n };\n\n private readonly getGiftCard = async (\n giftCardNumber: string,\n giftCardPin: string,\n giftCardExp: string,\n isPinRequired: boolean | undefined,\n isExpRequired: boolean | undefined,\n tenderTypeId: string | undefined\n ): Promise => {\n const {\n resources: { noBalanceError, invalidCardInfoError, invalidCardTypeError, noCardPinError, noCardExpError }\n } = this.props;\n\n const supportedGiftCardType = this.props.context.app.config.giftCardSupported;\n\n if (!tenderTypeId) {\n return undefined;\n }\n\n const tenderTypes = await getTenderTypesAsync({ callerContext: this.props.context.actionContext, queryResultSettings: {} }).catch(\n error => {\n throw error;\n }\n );\n\n if (!tenderTypes) {\n throw new Error('Fail to get gift card tender line');\n }\n const internalGiftcardTenderTypes = this.findGiftcardTenderTypes(\n tenderTypes,\n OPERATIONS.PayGiftCertificate,\n SupportedGiftCardType.Internal\n );\n const externalGiftcardTenderTypes = this.findGiftcardTenderTypes(\n tenderTypes,\n OPERATIONS.PayGiftCertificate,\n SupportedGiftCardType.External\n );\n\n switch (supportedGiftCardType) {\n case undefined:\n case SupportedGiftCardType.Internal:\n if (!internalGiftcardTenderTypes?.includes(tenderTypeId)) {\n this.setError(invalidCardTypeError);\n return undefined;\n }\n break;\n case SupportedGiftCardType.External:\n if (!externalGiftcardTenderTypes?.includes(tenderTypeId)) {\n this.setError(invalidCardTypeError);\n return undefined;\n }\n break;\n case SupportedGiftCardType.Both:\n if (!internalGiftcardTenderTypes?.includes(tenderTypeId) && !externalGiftcardTenderTypes?.includes(tenderTypeId)) {\n this.setError(invalidCardTypeError);\n return undefined;\n }\n break;\n default:\n throw new Error('Unsupported gift card type');\n }\n\n if (isPinRequired && giftCardPin === '') {\n this.setError(noCardPinError);\n return undefined;\n }\n\n if (isExpRequired && giftCardExp === '') {\n this.setError(noCardExpError);\n return undefined;\n }\n\n const month = Number.parseInt(giftCardExp.split('/')[0], 10);\n const year = Number.parseInt(giftCardExp.split('/')[1], 10);\n\n return getGiftCardAsync({ callerContext: this.props.context.actionContext }, giftCardNumber, tenderTypeId, giftCardPin, month, year)\n .then(activeGiftCard => {\n if (!activeGiftCard.Balance || activeGiftCard.Balance === 0) {\n this.setError(noBalanceError);\n return;\n }\n return activeGiftCard;\n })\n .catch(error => {\n this.setError(invalidCardInfoError);\n return undefined;\n });\n };\n\n private readonly getGiftCardTypes = async (giftCardNumber: string): Promise => {\n const {\n resources: { emptyInputError, duplicatedCodeError, invalidCodeError },\n data: { checkout }\n } = this.props;\n\n if (!giftCardNumber) {\n this.setError(emptyInputError);\n return undefined;\n }\n\n const isDuplicated = checkout.result && checkout.result.giftCardExtends.some((card: GiftCard) => card.Id === giftCardNumber);\n if (isDuplicated) {\n this.setError(duplicatedCodeError);\n return undefined;\n }\n\n return resolveCardTypesAsync({ callerContext: this.props.context.actionContext }, giftCardNumber, CardType.GiftCard)\n .then(giftCardTypes => {\n if (!giftCardTypes || giftCardTypes.length === 0 || giftCardTypes[0] === undefined) {\n this.setError(invalidCodeError);\n return;\n }\n return giftCardTypes;\n })\n .catch(error => {\n this.setError(invalidCodeError);\n return undefined;\n });\n };\n}\n\nexport default withModuleState(CheckoutGiftCard);\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Module, Node, Waiting } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport {\n ICheckoutViewProps,\n ILineItem,\n ILineItemDeliveryGroup,\n ILineItems,\n IOrderSummary,\n IPickUpAtStore,\n IEmailDelivery,\n IInvoicePaymentSummary\n} from './index';\n\nexport const PickUpAtStoreComponent: React.FC = ({ PickUpAtStore, label, location }) => (\n \n {label}\n {location}\n \n);\n\nexport const EmailDeliveryComponent: React.FC = ({ EmailDelivery, label }) => {label};\n\nexport const LineItemComponent: React.FC = ({ LineItem, item, pickUpAtStore, emailDelivery }) => (\n \n {item}\n {pickUpAtStore && }\n {emailDelivery && }\n \n);\n\nexport const LineItemGroupComponent: React.FC = ({ LineItemDeliveryGroup, LineItemList, heading, lineItems }) => (\n \n {heading}\n \n {lineItems.map(lineItem => (\n \n ))}\n \n \n);\n\nexport const LineItemGroupComponentWithMultiplePickUp: React.FC = ({\n LineItemDeliveryGroup,\n LineItemList,\n heading,\n lineItems,\n lineItemWraper,\n lineItemWraperIcon\n}) => (\n \n {lineItemWraperIcon}\n {lineItemWraper}\n {heading}\n \n {lineItems.map(lineItem => (\n \n ))}\n \n \n);\n\nexport const LineItemComponentWithMultiplePickUp: React.FC = ({ LineItem, item, pickUpAtStore, emailDelivery }) => (\n \n {item}\n {emailDelivery && }\n \n);\n\nexport const PickUpAtStoreComponentWithMultiplePickUp: React.FC = ({ PickUpAtStore, label, location }) => (\n \n {label}\n {location}\n \n);\n\nexport const LineItemsComponent: React.FC = ({\n LineItems,\n Header,\n heading,\n editLink,\n itemsForPickup,\n itemsForShip,\n itemsForEmail,\n itemsGroupWithMulitplePickupMode\n}) => (\n \n \n {heading}\n {editLink}\n \n {itemsGroupWithMulitplePickupMode === undefined && itemsForPickup && }\n {itemsGroupWithMulitplePickupMode === undefined && itemsForEmail && }\n {itemsGroupWithMulitplePickupMode === undefined && itemsForShip && }\n {itemsGroupWithMulitplePickupMode !== undefined\n ? itemsGroupWithMulitplePickupMode.map((item, index) => {\n return ;\n })\n : null}\n \n);\n\nconst OrderSummaryComponent: React.FC = ({ heading, lines }) => (\n
\n {heading}\n
\n {lines && (\n <>\n {lines.subtotal}\n {lines.shipping}\n {lines.otherCharge}\n {lines.tax}\n {lines.totalDiscounts}\n {lines.loyalty}\n {lines.customerAccount}\n {lines.giftCard}\n {lines.orderTotal}\n \n )}\n
\n
\n);\n\nconst PaymentSummaryComponent: React.FC = ({ heading, lines }) => (\n
\n {heading}\n
\n {lines && (\n <>\n {lines.invoices}\n {lines.giftCard}\n {lines.loyalty}\n {lines.orderTotal}\n \n )}\n
\n
\n);\n\nconst CheckoutView: React.FC = props => {\n const {\n isPaymentVerificationRedirection,\n shouldEnableSinglePaymentAuthorizationCheckout,\n canShow,\n checkoutProps,\n headerProps,\n hasSalesOrder,\n hasInvoiceLine,\n bodyProps,\n mainProps,\n mainControlProps,\n sideProps,\n sideControlFirstProps,\n sideControlSecondProps,\n termsAndConditionsProps,\n orderConfirmation,\n loading,\n alert,\n title,\n guidedForm,\n orderSummary,\n invoicePaymentSummary,\n lineItems,\n placeOrderButton,\n termsAndConditions,\n keepShoppingButton,\n checkoutExpressPaymentContainer,\n checkoutErrorRef\n } = props;\n\n return (\n \n {!hasSalesOrder && !checkoutExpressPaymentContainer && {title}}\n {!hasSalesOrder && isPaymentVerificationRedirection && shouldEnableSinglePaymentAuthorizationCheckout && !alert && !loading && (\n \n )}\n {!hasSalesOrder && (\n \n {loading}\n {alert}\n {canShow && (\n <>\n \n {checkoutExpressPaymentContainer}\n {checkoutExpressPaymentContainer && {title}}\n {guidedForm}\n {termsAndConditions}\n \n {placeOrderButton}\n {keepShoppingButton}\n \n \n \n {!hasInvoiceLine\n ? orderSummary && \n : invoicePaymentSummary && }\n \n {termsAndConditions}\n {placeOrderButton}\n {keepShoppingButton}\n \n {lineItems && }\n \n {termsAndConditions}\n {placeOrderButton}\n {keepShoppingButton}\n \n \n \n )}\n \n )}\n {hasSalesOrder && orderConfirmation}\n \n );\n};\n\nexport default CheckoutView;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as React from 'react';\n\nexport interface ICheckoutLoyaltyInput {\n className: string;\n type: string;\n value: string | number;\n min: number;\n max: number;\n ariaValueMax: number;\n ariaValueMin: number;\n ariaValueNow: number;\n id: string;\n step: string;\n onChange(event: React.ChangeEvent): void;\n onBlur(event: React.FocusEvent): void;\n}\n\nconst AdressInput: React.FC = ({\n className,\n type,\n value,\n min,\n max,\n step,\n ariaValueMax,\n ariaValueMin,\n ariaValueNow,\n onChange,\n onBlur,\n id\n}) => (\n \n);\n\nexport default AdressInput;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as React from 'react';\n\nexport interface ICheckoutLoyaltyLabelProps {\n className: string;\n text: string;\n htmlFor: string;\n}\n\n/**\n * AddPaymentForm SFC.\n * @param root0\n * @param root0.className\n * @param root0.text\n * @param root0.htmlFor\n * @extends {React.FC}\n */\nconst CheckoutLoyaltyLabel: React.FC = ({ className, text, htmlFor }) => {\n return (\n \n );\n};\n\nexport default CheckoutLoyaltyLabel;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as React from 'react';\n\nexport interface ICheckoutLoyaltyTextProps {\n className: string;\n text?: string;\n}\n\n/**\n * AddPaymentForm SFC.\n * @param root0\n * @param root0.className\n * @param root0.text\n * @extends {React.FC}\n */\nconst CheckoutLoyaltyText: React.FC = ({ className, text }) => {\n if (!text) {\n return null;\n }\n\n return {text};\n};\n\nexport default CheckoutLoyaltyText;\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 { callActionOrExecute } from '@msdyn365-commerce/retail-proxy';\nimport { createGetMaxLoyaltyPointsToRedeemForTransactionBalanceInput } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport { LoyaltyPointRedemptionEstimate, LoyaltyRewardPoint } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { IModuleStateProps, withModuleState, EnabledPaymentsForOBO } from '@msdyn365-commerce-modules/checkout-utilities';\nimport { GetLoyaltyTransactionEstimationInput } from '@msdyn365-commerce-modules/retail-actions';\nimport { Button, Drawer, Heading, IModuleProps, INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport { CheckoutModule, ErrorLocation } from '@msdyn365-commerce/global-state';\nimport classnames from 'classnames';\nimport { action, computed, reaction, when } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { ICheckoutLoyaltyData } from './checkout-loyalty.data';\nimport { ICheckoutLoyaltyProps } from './checkout-loyalty.props.autogenerated';\nimport InputComponent from './components/checkout-loyalty-input';\nimport LabelComponent from './components/checkout-loyalty-label';\nimport TextComponent from './components/checkout-loyalty-text';\nimport { ErrorComponent } from '../../common/error';\nimport { focusOnCheckoutError } from '../../checkout-errors';\n\nexport interface ICheckoutLoyaltyState {\n dollarsApplied: number;\n isFetchingLoyaltyCard: boolean;\n errorMessage?: string;\n}\n\nexport interface ICheckoutLoyaltyModuleProps extends ICheckoutLoyaltyProps, IModuleStateProps {}\n\nexport interface ICheckoutLoyaltyViewState {\n isShowLoyalty: boolean;\n isShowAddLoyalty: boolean;\n}\n\nexport interface ICheckoutLoyaltyShow {\n heading: React.ReactNode;\n coveredAmountText: React.ReactNode;\n amount: React.ReactNode;\n}\n\nexport interface ICheckoutLoyaltyRewardPoint {\n checkoutLoyaltyRewardPoint: INodeProps;\n key: string;\n title: React.ReactNode;\n availablePointsText: React.ReactNode;\n activePoints: React.ReactNode;\n expiringPointsText: React.ReactNode;\n expiringPoints: React.ReactNode;\n}\n\nexport interface ICheckoutLoyaltyAdd {\n heading: React.ReactNode;\n cardNumber: React.ReactNode;\n drawer: INodeProps;\n rewardPoints: ICheckoutLoyaltyRewardPoint[];\n loyaltyAmountContainer: INodeProps;\n appliedLoyaltyAmountContainer: INodeProps;\n loyaltyAmountLabel: React.ReactNode;\n loyaltyAmountInput: React.ReactNode;\n loyaltyAmountApplyButton: React.ReactNode;\n showAppliedAmount: boolean;\n loyaltyAmountAppliedText: React.ReactNode;\n loyaltyAmountAppliedPrice: React.ReactNode;\n loyaltyAmountRemoveButton: React.ReactNode;\n}\n\nexport interface ICheckoutLoyaltyViewProps extends ICheckoutLoyaltyModuleProps {\n checkoutLoyalty: IModuleProps;\n viewState: ICheckoutLoyaltyViewState;\n showLoyalty: ICheckoutLoyaltyShow;\n addLoyalty: ICheckoutLoyaltyAdd;\n alert?: React.ReactNode;\n checkoutErrorRef?: React.RefObject;\n}\n\n/**\n *\n * CheckoutLoyalty component.\n * @extends {React.Component>}\n */\n// @ts-expect-error\n\n@withModuleState\n@observer\nclass CheckoutLoyalty extends React.Component {\n private readonly _dialogToggleRef: React.RefObject | undefined;\n\n private readonly moduleClassName: string = 'ms-checkout-loyalty';\n\n private readonly _defaultLoyaltyPoints: number = 0;\n\n private readonly checkoutErrorRef: React.RefObject = React.createRef();\n\n constructor(props: ICheckoutLoyaltyModuleProps) {\n super(props);\n this._dialogToggleRef = React.createRef();\n this._applyLoyaltyPoints = this._applyLoyaltyPoints.bind(this);\n this._removeLoyaltyPoints = this._removeLoyaltyPoints.bind(this);\n this._onInputChange = this._onInputChange.bind(this);\n this._onBlur = this._onBlur.bind(this);\n this.state = { dollarsApplied: this.maxDollars, isFetchingLoyaltyCard: false };\n }\n\n @computed get shouldPayLoyalty(): boolean {\n const cart = this.props.data.checkout.result ? this.props.data.checkout.result.checkoutCart.cart : undefined;\n if (!cart) {\n return false;\n }\n\n // Use loyalty when cart is not full of free items\n const amountDue = cart.TotalAmount || 0;\n return amountDue > 0;\n }\n\n @computed get isDataReady(): boolean {\n return (\n (this.props.data.checkout.result && this.props.data.checkout.status) === 'SUCCESS' &&\n (this.props.data.loyaltyCard && this.props.data.loyaltyCard.status) !== 'LOADING' &&\n (this.props.data.loyaltyTransactionEstimation && this.props.data.loyaltyTransactionEstimation.status) !== 'LOADING'\n );\n }\n\n @computed get maxDollars(): number {\n return this.props.data.loyaltyTransactionEstimation.result &&\n this.props.data.loyaltyTransactionEstimation.result.MaxCurrencyValueOfLoyaltyPoints\n ? this.props.data.loyaltyTransactionEstimation.result.MaxCurrencyValueOfLoyaltyPoints\n : 0;\n }\n\n public async componentDidMount(): Promise {\n when(\n () => this.isDataReady,\n async () => {\n await this.init();\n }\n );\n\n reaction(\n () => this.props.data.checkout.result && this.props.data.checkout.result.checkoutCart.cart,\n async () => {\n this._updateEstimate();\n }\n );\n\n reaction(\n () => this.props.data.loyaltyCard.result,\n async () => {\n this._updateLoyalty();\n }\n );\n\n if (this.props.data.checkout.result?.shouldEnableCheckoutErrorDisplayMessaging) {\n reaction(\n () => this.props.data.checkout.result?.checkoutError,\n checkoutError => {\n if (checkoutError && checkoutError.errorLocation === ErrorLocation.CheckoutLoyalty && checkoutError.errorMessage) {\n this._setErrorMessage(checkoutError.errorMessage);\n }\n }\n );\n\n reaction(\n () => this.props.data.checkout.result?.checkoutErrorFocus,\n checkoutErrorFocus => {\n if (checkoutErrorFocus === CheckoutModule.CheckoutLoyalty) {\n focusOnCheckoutError(this.checkoutErrorRef, this.props.context.actionContext);\n }\n }\n );\n }\n }\n\n public shouldComponentUpdate(nextProps: ICheckoutLoyaltyModuleProps, nextState: ICheckoutLoyaltyState): 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 | null {\n const {\n config,\n resources,\n renderView,\n moduleState: { hasError, isReady }\n } = this.props;\n\n if (this.props.context.request.user.isOBORequest && EnabledPaymentsForOBO.Loyalty === 0) {\n this.props.context.telemetry.information('isOBORequest is enabled, Checkout loyalty module wont render');\n return null;\n }\n\n if (\n this.props.data.loyaltyCard &&\n this.props.data.loyaltyCard.result &&\n this.props.data.loyaltyCard.result.CardNumber &&\n this.shouldPayLoyalty\n ) {\n const loyaltyCard = this.props.data.loyaltyCard.result;\n const checkoutState = this.props.data.checkout.result;\n let isShowLoyalty = false;\n const errorMessage = this.state.errorMessage;\n\n if (isReady) {\n if (!checkoutState || checkoutState.loyaltyAmount === 0) {\n return null;\n }\n isShowLoyalty = true;\n }\n const channelConfig = this.props.context.request.channel;\n const viewProps = {\n ...this.props,\n checkoutErrorRef: this.checkoutErrorRef,\n viewState: {\n isShowLoyalty,\n isShowAddLoyalty: !isReady && !config.disableAddLoyaltyComponent\n },\n alert: hasError && errorMessage && ,\n checkoutLoyalty: {\n moduleProps: this.props,\n className: classnames(\n this.moduleClassName,\n { [`${this.moduleClassName}__applied`]: isShowLoyalty },\n this.props.config.className\n )\n },\n showLoyalty: {\n heading: ,\n coveredAmountText: (\n \n ),\n amount: (\n \n )\n },\n addLoyalty: {\n heading: ,\n drawer: {\n tag: Drawer,\n className: `${this.moduleClassName}__drawer`,\n toggleButtonText: this._drawerHeader(),\n openGlyph: `${this.moduleClassName}__drawer-open`,\n closeGlyph: `${this.moduleClassName}__drawer-close`,\n glyphPlacement: 'end'\n },\n cardNumber: ,\n rewardPoints:\n loyaltyCard.RewardPoints &&\n loyaltyCard.RewardPoints.map((points, index) => {\n return this._renderPointSection(points, resources.availablePointsLabel, resources.expiringLoyaltyPointsLabel);\n }),\n loyaltyAmountContainer: {\n className: `${this.moduleClassName}__amount`\n },\n appliedLoyaltyAmountContainer: {\n className: `${this.moduleClassName}__applied-amount`\n },\n loyaltyAmountLabel: (\n \n ),\n loyaltyAmountInput: (\n \n ),\n loyaltyAmountApplyButton: (\n this.maxDollars ||\n this.state.dollarsApplied <= 0 ||\n isNaN(this.state.dollarsApplied) ||\n this.state.isFetchingLoyaltyCard\n }\n >\n {this.props.resources.applyCheckoutLoyaltyPaymentText}\n \n ),\n showAppliedAmount: checkoutState && checkoutState.loyaltyAmount > 0,\n loyaltyAmountAppliedText: (\n \n ),\n loyaltyAmountAppliedPrice: (\n \n ),\n loyaltyAmountRemoveButton: (\n \n {this.props.resources.removeCheckoutLoyaltyPaymentText}\n \n )\n }\n };\n\n return renderView(viewProps) as React.ReactElement;\n }\n this.props.context.telemetry.error('Checkout loyalty content is empty, module wont render');\n return null;\n }\n\n private _drawerHeader(): JSX.Element {\n const channelConfig = this.props.context.request.channel;\n return (\n <>\n

{this.props.resources.loyaltyCoveredAmountText}

\n \n \n );\n }\n\n private _renderPointSection(\n point: LoyaltyRewardPoint,\n loyaltyCoveredAmountText: string,\n expiringLoyaltyPointsLabel: string\n ): ICheckoutLoyaltyRewardPoint {\n return {\n key: point.RewardPointId || '',\n checkoutLoyaltyRewardPoint: {\n className: `${this.moduleClassName}__program`\n },\n title: ,\n availablePointsText: ,\n activePoints: (\n \n ),\n expiringPointsText: ,\n expiringPoints: (\n \n )\n };\n }\n\n private readonly init = async (): Promise => {\n this.props.moduleState.init({\n onEdit: this.onEdit,\n onCancel: this.onCancel,\n onSubmit: this.onSubmit,\n isRequired: false,\n ...(!this.isEnabled() && { status: 'disabled' })\n });\n\n const savedLoyaltyAmount = this.props.data.checkout.result?.loyaltyAmount;\n if (savedLoyaltyAmount) {\n this.props.moduleState.onReady();\n } else if (this.props.data.checkout.result?.isPaymentVerificationRedirection) {\n this.props.moduleState.onSkip();\n } else if (\n this.props.data.loyaltyCard.result &&\n this.props.data.checkout.result &&\n this.props.data.loyaltyCard.result.CardNumber !== this.props.data.checkout.result.checkoutCart.cart.LoyaltyCardId\n ) {\n this.props.data.checkout.result.checkoutCart\n .updateLoyaltyCardId({ loyaltyCardNumber: this.props.data.loyaltyCard.result.CardNumber })\n .catch(error => {\n if (this.context.telemetry) {\n this.context.telemetry.warning(error);\n this.context.telemetry.debug('Unable to update the loyalty card');\n }\n });\n }\n };\n\n private readonly onEdit = () => {\n this.props.telemetry.information('Payment section loyalty onEdit is called.');\n\n this.props.moduleState.onUpdating();\n };\n\n private readonly onCancel = () => {\n this.props.telemetry.information('Payment section loyalty onCancel is called.');\n\n this.handleCancelOrSubmit();\n };\n\n private readonly onSubmit = () => {\n this.props.telemetry.information('Payment section loyalty onSubmit is called.');\n\n this.handleCancelOrSubmit();\n };\n\n private readonly handleCancelOrSubmit = () => {\n const checkoutState = this.props.data.checkout.result;\n if (checkoutState && checkoutState.loyaltyAmount > 0) {\n // Show summary screen\n this.props.moduleState.onReady();\n } else {\n // Skip the module\n this.props.moduleState.onSkip();\n }\n };\n\n private readonly isEnabled = () => {\n return (\n this.props.context.request.user.isAuthenticated &&\n this.props.data.loyaltyCard.result &&\n this.props.data.loyaltyCard.result.CardNumber &&\n this.shouldPayLoyalty\n );\n };\n\n private async _applyLoyaltyPoints(): Promise {\n this.props.telemetry.information('Payment section loyalty apply button onClick is called.');\n\n const checkoutState = this.props.data.checkout.result;\n\n if (!checkoutState) {\n return;\n }\n\n this._clearError();\n await checkoutState.updateLoyaltyAmount({ newAmount: Number.parseFloat(this.state.dollarsApplied.toString()) });\n this.setState({\n isFetchingLoyaltyCard: true\n });\n }\n\n private async _removeLoyaltyPoints(): Promise {\n this.props.telemetry.information('Payment section loyalty remove button onClick is called.');\n\n const checkoutState = this.props.data.checkout.result;\n\n if (!checkoutState) {\n return;\n }\n\n this._clearError();\n await checkoutState.updateLoyaltyAmount({ newAmount: 0 });\n this.setState({\n dollarsApplied: 0\n });\n }\n\n private _onInputChange(event: React.ChangeEvent): void {\n const value = event.currentTarget.value;\n this.setState({ dollarsApplied: value.length > 0 ? Number(value) : Number.parseFloat(value), isFetchingLoyaltyCard: false });\n }\n\n private _onBlur(event: React.FocusEvent): void {\n const num = Number.parseFloat(event.currentTarget.value).toFixed(2);\n const element = document.getElementById(`${this.props.id}-label`) as HTMLInputElement;\n if (element && num) {\n element.value = num;\n this.setState({ dollarsApplied: Number.parseFloat(num) });\n }\n }\n\n private _updateLoyalty(): void {\n if (this.props.moduleState.isDisabled && this.isEnabled()) {\n this._updateEstimate();\n this.props.moduleState.onUpdating();\n }\n }\n\n private _updateEstimate(): void {\n const card = this.props.data.loyaltyCard.result;\n const checkout = this.props.data.checkout.result;\n const cart = this.props.data.checkout.result ? this.props.data.checkout.result.checkoutCart.cart : undefined;\n const channelConfig = this.props.context.request.channel;\n if (card && card.CardNumber && cart && channelConfig) {\n const currencyCode = channelConfig.Currency || '';\n const loyalPointsRequest = createGetMaxLoyaltyPointsToRedeemForTransactionBalanceInput(cart.Id, card.CardNumber, currencyCode);\n\n // @ts-expect-error\n // Due to bug 23214358, this is getting improperly cached. Need to turn on cache bypass for now to work around issue\n loyalPointsRequest._query.options.bypassCache = 'get';\n\n callActionOrExecute(loyalPointsRequest, this.props.context.actionContext)\n .then(async points => {\n this.props.context.actionContext.update(\n new GetLoyaltyTransactionEstimationInput(this.props.context.request.apiSettings),\n points\n );\n const newMaxPoints = points.MaxCurrencyValueOfLoyaltyPoints ?? this._defaultLoyaltyPoints;\n\n // If points are already applied, ensure you don't apply more points than max\n if (checkout && checkout.loyaltyAmount > newMaxPoints) {\n await checkout.updateLoyaltyAmount({ newAmount: newMaxPoints });\n }\n\n this.setState({ dollarsApplied: newMaxPoints, isFetchingLoyaltyCard: false });\n })\n .catch(error => {\n this.props.context.actionContext.telemetry.exception(error);\n this.props.context.actionContext.telemetry.debug('Error getting Loyalty Point Redemption Estimate');\n });\n }\n }\n\n @action\n private readonly _setErrorMessage = (errorMessage: string): void => {\n this.props.telemetry.error(errorMessage);\n this.props.moduleState.setHasError(true);\n this.props.moduleState.onUpdating();\n this.setState({\n errorMessage\n });\n };\n\n private readonly _clearError = (): void => {\n this.props.moduleState.setHasError(false);\n this.setState({\n errorMessage: ''\n });\n };\n}\n\nexport default CheckoutLoyalty;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Alert, Button, INodeProps, NodeTag } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { showAdditionalFields } from '../gift-card-balance-check.props.autogenerated';\n\nexport interface IGetFormInput {\n errorMessage: string;\n giftCardNumber: string;\n giftCardPin: string;\n giftCardExp: string;\n inputRef?: React.RefObject;\n inputPinRef?: React.RefObject;\n inputExpRef?: React.RefObject;\n supportExternalGiftCard?: boolean;\n additionalFields?: showAdditionalFields;\n resources: {\n balanceCheckButton: string;\n giftCardFormLabel: string;\n giftCardNumberLabel: string;\n giftCardPinLabel: string;\n giftCardExpLabel: string;\n giftCardAlertLabel: string;\n giftCardPinPlaceholderText: string;\n giftCardExpPlaceholderText: string;\n };\n onEnterGiftCardNumber(giftCardNumber: string): void;\n onEnterGiftCardPin(giftCardPin: string): void;\n onEnterGiftCardExp(giftCardExp: string): void;\n onApplyGiftCard(): Promise;\n}\n\nexport interface IForm {\n formProps: INodeProps;\n label: React.ReactNode;\n inputPinLabel: React.ReactNode;\n inputExpLabel: React.ReactNode;\n alert: React.ReactNode;\n inputProps: INodeProps;\n inputNumProps: INodeProps;\n inputPinProps: INodeProps;\n inputExpProps: INodeProps;\n inputNumber: React.ReactNode;\n inputPin: React.ReactNode;\n inputExp: React.ReactNode;\n applyButton: React.ReactNode;\n supportExternalGiftCard: boolean | undefined;\n showGiftCardPinInput: boolean | undefined;\n showGiftCardExpInput: boolean | undefined;\n alertFieldLabel: React.ReactNode;\n}\n\n/**\n * On apply function.\n * @param onApplyGiftCard -On apply gift card.\n * @returns Apply gift card.\n */\nconst onApplyHandler = (onApplyGiftCard: () => Promise) => async (event: React.SyntheticEvent): Promise => {\n event.preventDefault();\n await onApplyGiftCard();\n};\n\n/**\n * On change number function.\n * @param onEnterGiftCardNumber -On enter gift card number.\n * @returns On gift card enter pin function result.\n */\nconst onChangeNumberHandler = (onEnterGiftCardNumber: (giftCardNumber: string) => void) => (event: React.ChangeEvent) => {\n const value = (event.target.value || '').replace(new RegExp('[<>]', 'gi'), '');\n onEnterGiftCardNumber(value);\n};\n\n/**\n * On change pin function.\n * @param onEnterGiftCardPin -On enter gift card pin.\n * @returns On enter gift card pin function result.\n */\nconst onChangePinHandler = (onEnterGiftCardPin: (giftCardPin: string) => void) => (event: React.ChangeEvent) => {\n const value = (event.target.value || '').replace(new RegExp('[<>]', 'gi'), '');\n onEnterGiftCardPin(value);\n};\n\n/**\n * On change exp function.\n * @param onEnterGiftCardExp -On enter gift card.\n * @returns On enter gift card function result.\n */\nconst onChangeExpHandler = (onEnterGiftCardExp: (giftCardExp: string) => void) => (event: React.ChangeEvent) => {\n const value = (event.target.value || '').replace(new RegExp('[<>]', 'gi'), '');\n onEnterGiftCardExp(value);\n};\n\nexport const getForm = (options: IGetFormInput): IForm => {\n const {\n errorMessage,\n inputRef,\n inputPinRef,\n inputExpRef,\n giftCardNumber,\n giftCardPin,\n giftCardExp,\n onEnterGiftCardNumber,\n onEnterGiftCardPin,\n onEnterGiftCardExp,\n onApplyGiftCard,\n supportExternalGiftCard,\n additionalFields,\n resources: {\n balanceCheckButton,\n giftCardFormLabel,\n giftCardNumberLabel,\n giftCardPinLabel,\n giftCardExpLabel,\n giftCardAlertLabel,\n giftCardPinPlaceholderText,\n giftCardExpPlaceholderText\n }\n } = options;\n\n const formProps = {\n className: classnames('ms-gift-card-balance-check__form', { 'is-invalid': !!errorMessage }),\n onSubmit: onApplyHandler(onApplyGiftCard),\n tag: 'form' as NodeTag\n };\n\n const label = (\n \n );\n\n const inputPinLabel = (\n \n );\n\n const inputExpLabel = (\n \n );\n\n const alertFieldLabel = (\n \n );\n\n const alert = (\n \n {errorMessage}\n \n );\n\n const inputProps = {\n className: 'ms-gift-card-balance-check__input-fields'\n };\n\n const inputNumProps = {\n className: 'ms-gift-card-balance-check__input-num-fields'\n };\n\n const inputPinProps = {\n className: 'ms-gift-card-balance-check__input-pin-fields'\n };\n\n const inputExpProps = {\n className: 'ms-gift-card-balance-check__input-exp-fields'\n };\n\n const inputNumber = (\n \n );\n\n const inputPin = (\n \n );\n\n const inputExp = (\n \n );\n\n const applyButton = (\n \n {balanceCheckButton}\n \n );\n\n let showGiftCardPinInput = false;\n let showGiftCardExpInput = false;\n\n switch (additionalFields) {\n case showAdditionalFields.pin:\n showGiftCardPinInput = true;\n break;\n case showAdditionalFields.expirationDate:\n showGiftCardExpInput = true;\n break;\n case showAdditionalFields.pinAndExpirationDate:\n showGiftCardPinInput = true;\n showGiftCardExpInput = true;\n break;\n default:\n }\n\n return {\n formProps,\n label,\n inputPinLabel,\n inputExpLabel,\n alert,\n inputProps,\n inputNumProps,\n inputPinProps,\n inputExpProps,\n inputNumber,\n inputPin,\n inputExp,\n applyButton,\n supportExternalGiftCard,\n showGiftCardPinInput,\n showGiftCardExpInput,\n alertFieldLabel\n };\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { GiftCard } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nexport interface IGetItemInput {\n giftCard: GiftCard;\n resources: {\n enteredGiftCardLabel: string;\n giftCardAvailableBalanceLabel: string;\n };\n getFormattedPrice(price?: number, currencyCode?: string): string;\n}\n\nexport interface IItem {\n itemProps: INodeProps;\n id?: string;\n selectedGiftCard: React.ReactNode;\n removeButton?: React.ReactNode;\n}\n\n/**\n * GiftCardItem component.\n * @param root0\n * @param root0.giftCard\n * @param root0.getFormattedPrice\n * @param root0.resources\n * @param root0.resources.enteredGiftCardLabel\n * @param root0.resources.giftCardAvailableBalanceLabel\n * @extends {React.PureComponent}\n */\nexport const getItem = ({\n giftCard,\n getFormattedPrice,\n resources: { enteredGiftCardLabel, giftCardAvailableBalanceLabel }\n}: IGetItemInput): IItem => {\n const balance = getFormattedPrice(giftCard.Balance, giftCard.CardCurrencyCode);\n const giftCardLast4Digit = (giftCard.Id || '').substr(-4);\n\n const itemProps = {\n className: 'ms-gift-card-balance-check__item'\n };\n\n const selectedGiftCard = (\n \n {enteredGiftCardLabel}\n {` `}\n {giftCardLast4Digit}\n {` `}({giftCardAvailableBalanceLabel}\n {` `}\n {balance})\n \n );\n\n return {\n itemProps,\n id: giftCard && giftCard.Id,\n selectedGiftCard\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 getGiftCardAsync,\n getTenderTypesAsync,\n resolveCardTypesAsync\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\nimport {\n CardType,\n CardTypeInfo,\n GiftCard,\n RetailOperation,\n TenderType\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { IModuleProps } from '@msdyn365-commerce-modules/utilities';\nimport classname from 'classnames';\nimport * as React from 'react';\n\nimport { OPERATIONS } from '../checkout';\nimport { getForm, IForm } from './components/get-form';\nimport { getItem, IItem } from './components/get-item';\nimport { IGiftCardBalanceCheckProps } from './gift-card-balance-check.props.autogenerated';\n\ninterface IGiftCardBalanceCheckState {\n isFetchingGiftCard: boolean;\n errorMessage: string;\n giftCardNumber: string;\n giftCardPin: string;\n giftCardExp: string;\n giftCard?: GiftCard;\n}\n\nenum SupportedGiftCardType {\n Internal = 'internal',\n External = 'external',\n Both = 'both'\n}\n\nexport interface IGiftCardBalanceCheckModuleProps extends IGiftCardBalanceCheckProps<{}> {}\n\nexport interface IGiftCardBalanceCheckViewProps extends IGiftCardBalanceCheckProps<{}>, IGiftCardBalanceCheckState {\n className?: string;\n\n form: IForm;\n item?: IItem;\n\n giftCardBalanceCheckProps: IModuleProps;\n\n enterGiftCardNumber?(giftCardNumber: string): void;\n enterGiftCardPin?(giftCardPin: string): void;\n enterGiftCardExp?(giftCardExp: string): void;\n applyGiftCard?(): void;\n}\n\n/**\n *\n * GiftCardBalanceCheck component.\n * @extends {React.Component}\n */\nexport class GiftCardBalanceCheck extends React.Component {\n public state: IGiftCardBalanceCheckState = {\n isFetchingGiftCard: false,\n errorMessage: '',\n giftCardNumber: '',\n giftCardPin: '',\n giftCardExp: ''\n };\n\n private readonly inputRef: React.RefObject = React.createRef();\n\n private readonly inputPinRef: React.RefObject = React.createRef();\n\n private readonly inputExpRef: React.RefObject = React.createRef();\n\n public shouldComponentUpdate(nextProps: IGiftCardBalanceCheckModuleProps, nextState: IGiftCardBalanceCheckState): 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 | null {\n const {\n config: { className, showAdditionalFields },\n resources\n } = this.props;\n const { errorMessage, giftCardNumber, giftCardPin, giftCardExp } = this.state;\n\n const supportedGiftCardType = this.props.context.app.config.giftCardSupported;\n\n if (!this._isEnabled()) {\n this.props.context.telemetry.error('Gift card balance check is not supported, module wont render');\n return null;\n }\n\n const supportExternalGiftCard = supportedGiftCardType !== SupportedGiftCardType.Internal;\n\n const moduleClassName = classname('ms-gift-card-balance-check', className);\n\n const viewProps: IGiftCardBalanceCheckViewProps = {\n ...this.props,\n ...this.state,\n className: moduleClassName,\n giftCardBalanceCheckProps: { moduleProps: this.props, className: moduleClassName },\n\n enterGiftCardNumber: this._enterGiftCardNumber,\n enterGiftCardPin: this._enterGiftCardPin,\n enterGiftCardExp: this._enterGiftCardExp,\n applyGiftCard: this._applyGiftCard,\n\n form: getForm({\n errorMessage,\n giftCardNumber,\n giftCardPin,\n giftCardExp,\n inputRef: this.inputRef,\n inputPinRef: this.inputPinRef,\n inputExpRef: this.inputExpRef,\n resources,\n supportExternalGiftCard,\n additionalFields: showAdditionalFields,\n onEnterGiftCardNumber: this._enterGiftCardNumber,\n onEnterGiftCardPin: this._enterGiftCardPin,\n onEnterGiftCardExp: this._enterGiftCardExp,\n onApplyGiftCard: this._applyGiftCard\n }),\n item:\n this.state.giftCard &&\n getItem({\n giftCard: this.state.giftCard,\n getFormattedPrice: this._getFormattedPrice,\n resources\n })\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n private readonly _isEnabled = (): boolean => {\n if (\n !this.props.context.request.user.isAuthenticated &&\n this.props.context.app.config.giftCardSupported !== SupportedGiftCardType.External &&\n !this.props.config.shouldBeEnabledForGuest\n ) {\n return false;\n }\n return true;\n };\n\n private readonly _getFormattedPrice = (price: number = 0, currencyCode: string = 'USD'): string => {\n return this.props.context.cultureFormatter.formatCurrency(price, currencyCode);\n };\n\n private readonly _enterGiftCardNumber = (giftCardNumber: string): void => {\n this.setState({\n giftCardNumber\n });\n this._clearError();\n };\n\n private readonly _enterGiftCardPin = (giftCardPin: string): void => {\n this.setState({\n giftCardPin\n });\n this._clearError();\n };\n\n private readonly _enterGiftCardExp = (giftCardExp: string): void => {\n this.setState({\n giftCardExp\n });\n this._clearError();\n };\n\n private readonly _clearError = (): void => {\n this.setState({\n errorMessage: ''\n });\n };\n\n private readonly _setError = (errorMessage: string): void => {\n this.props.telemetry.error('Error', errorMessage);\n this.props.telemetry.debug('Error', errorMessage);\n this.setState({\n errorMessage\n });\n };\n\n private readonly _applyGiftCard = async (): Promise => {\n if (this.state.isFetchingGiftCard) {\n return;\n }\n this.setState({\n isFetchingGiftCard: true\n });\n\n const giftCardNumber = this.state.giftCardNumber.trim();\n const giftCardPin = this.state.giftCardPin.trim();\n const giftCardExp = this.state.giftCardExp.trim();\n\n const giftCardTypes = await this._getGiftCardTypes(giftCardNumber);\n const giftCardType = giftCardTypes && giftCardTypes[0];\n const isPinRequired = giftCardType && giftCardType.IsPinRequired;\n const isExpRequired = giftCardType && giftCardType.IsExpirationDateRequired;\n const tenderTypeId = giftCardType && giftCardType.PaymentMethodId;\n const giftCard = await this._getGiftCard(giftCardNumber, giftCardPin, giftCardExp, isPinRequired, isExpRequired, tenderTypeId);\n\n if (giftCard) {\n this._clearError();\n this.setState({\n giftCardNumber: '',\n giftCardPin: '',\n giftCardExp: '',\n isFetchingGiftCard: false,\n giftCard\n });\n return Promise.resolve();\n }\n const input = this.inputRef && this.inputRef.current && this.inputRef.current.focus && (this.inputRef.current as HTMLElement);\n input && input.focus();\n this.setState({\n isFetchingGiftCard: false,\n giftCard: undefined\n });\n };\n\n private readonly _findGiftcardTenderTypes = (\n tenderTypes: TenderType[],\n operationId: RetailOperation,\n giftcardType: string\n ): string[] | undefined => {\n let matchedTenderTypes: TenderType[] | undefined;\n\n switch (giftcardType) {\n case SupportedGiftCardType.Internal:\n matchedTenderTypes = tenderTypes.filter(\n tenderType => tenderType.OperationId === operationId && tenderType.ConnectorId === ''\n );\n break;\n case SupportedGiftCardType.External:\n matchedTenderTypes = tenderTypes.filter(\n tenderType => tenderType.OperationId === operationId && tenderType.ConnectorId !== ''\n );\n break;\n default:\n throw new Error('Invalid gift card type');\n }\n\n if (matchedTenderTypes) {\n return matchedTenderTypes.map(tenderType => tenderType.TenderTypeId || '');\n }\n return;\n };\n\n private readonly _getGiftCard = async (\n giftCardNumber: string,\n giftCardPin: string,\n giftCardExp: string,\n isPinRequired: boolean | undefined,\n isExpRequired: boolean | undefined,\n tenderTypeId: string | undefined\n ): Promise => {\n const {\n resources: { invalidCardTypeError, noBalanceError, invalidCardInfoError, noCardPinError, noCardExpError }\n } = this.props;\n\n const supportedGiftCardType = this.props.context.app.config.giftCardSupported;\n\n if (!tenderTypeId) {\n return undefined;\n }\n\n const tenderTypes = await getTenderTypesAsync({ callerContext: this.props.context.actionContext, queryResultSettings: {} }).catch(\n error => {\n throw error;\n }\n );\n\n if (!tenderTypes) {\n throw new Error('Fail to get gift card tender line');\n }\n\n const internalGiftcardTenderTypes = this._findGiftcardTenderTypes(\n tenderTypes,\n OPERATIONS.PayGiftCertificate,\n SupportedGiftCardType.Internal\n );\n const externalGiftcardTenderTypes = this._findGiftcardTenderTypes(\n tenderTypes,\n OPERATIONS.PayGiftCertificate,\n SupportedGiftCardType.External\n );\n\n switch (supportedGiftCardType) {\n case undefined:\n case SupportedGiftCardType.Internal:\n if (!internalGiftcardTenderTypes?.includes(tenderTypeId)) {\n this._setError(invalidCardTypeError);\n return undefined;\n }\n break;\n case SupportedGiftCardType.External:\n if (!externalGiftcardTenderTypes?.includes(tenderTypeId)) {\n this._setError(invalidCardTypeError);\n return undefined;\n }\n break;\n case SupportedGiftCardType.Both:\n if (!internalGiftcardTenderTypes?.includes(tenderTypeId) && !externalGiftcardTenderTypes?.includes(tenderTypeId)) {\n this._setError(invalidCardTypeError);\n return undefined;\n }\n break;\n default:\n throw new Error('Unsupported gift card type');\n }\n\n if (!this.props.context.request.user.isAuthenticated && internalGiftcardTenderTypes?.includes(tenderTypeId)) {\n this._setError(invalidCardTypeError);\n return undefined;\n }\n\n if (isPinRequired && giftCardPin === '') {\n this._setError(noCardPinError);\n return undefined;\n }\n\n if (isExpRequired && giftCardExp === '') {\n this._setError(noCardExpError);\n return undefined;\n }\n\n const month = Number.parseInt(giftCardExp.split('/')[0], 10);\n const year = Number.parseInt(giftCardExp.split('/')[1], 10);\n\n return getGiftCardAsync({ callerContext: this.props.context.actionContext }, giftCardNumber, tenderTypeId, giftCardPin, month, year)\n .then(activeGiftCard => {\n if (!activeGiftCard.Balance || activeGiftCard.Balance === 0) {\n this._setError(noBalanceError);\n return;\n }\n return activeGiftCard;\n })\n .catch(error => {\n this._setError(invalidCardInfoError);\n return undefined;\n });\n };\n\n private readonly _getGiftCardTypes = async (giftCardNumber: string): Promise => {\n const {\n resources: { emptyInputError, invalidCodeError }\n } = this.props;\n\n if (!giftCardNumber) {\n this._setError(emptyInputError);\n return undefined;\n }\n\n return resolveCardTypesAsync({ callerContext: this.props.context.actionContext }, giftCardNumber, CardType.GiftCard)\n .then(giftCardTypes => {\n if (!giftCardTypes || giftCardTypes.length === 0 || giftCardTypes[0] === undefined) {\n this._setError(invalidCodeError);\n return;\n }\n return giftCardTypes;\n })\n .catch(error => {\n this._setError(invalidCodeError);\n return undefined;\n });\n };\n}\n\nexport default GiftCardBalanceCheck;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { AddToCartComponent, IAddToCartFailureResult, IAddToCartResources, OrderDetailsProduct } from '@msdyn365-commerce/components';\nimport { getUrlSync, IComponentProps, ICoreContext } from '@msdyn365-commerce/core';\nimport { SalesLine } from '@msdyn365-commerce/retail-proxy';\nimport { QuickOrderTemplate } from '@msdyn365-commerce-modules/retail-actions';\nimport React from 'react';\n\n/**\n * The data on which the component should operate.\n */\nexport interface IAddToCartSelectedData {\n quickOrderTemplate: QuickOrderTemplate | undefined;\n}\n\n/**\n * The resources needed to render a buy selected component.\n */\nexport interface IAddToCartSelectedResources {\n quickOrderGridBuySelectedButtonText?: string;\n quickOrderGridBuySelectedButtonAriaLabel?: string;\n quickOrderGridBuySelectedAddingToCartErrorNotificationTitle?: string;\n quickOrderGridBuySelectedAddingToCartErrorNotificationCloseAriaLabel?: string;\n quickOrderGridGoToCartText?: string;\n quickOrderGridDialogCloseText?: string;\n quickOrderGridSingleItemText?: string;\n quickOrderGridMultiLineItemFormatText?: string;\n quickOrderGridMultiLinesFormatText?: string;\n quickOrderGridHeaderMessageText?: string;\n addedQuantityText?: string;\n originalPriceText?: string;\n currentPriceText?: string;\n freePriceText?: string;\n}\n\n/**\n * Configuration of a buy selected component.\n */\nexport interface IAddToCartSelectedProps extends IComponentProps {\n className: string;\n context: ICoreContext;\n\n resources: IAddToCartSelectedResources;\n\n isIcon?: boolean;\n onError?(result: IAddToCartFailureResult): void;\n}\n\n/**\n * Get the dialog strings.\n * @param props - The buy selected props.\n * @returns The add to cart resources.\n */\nexport const getDialogStrings = (props: IAddToCartSelectedProps): IAddToCartResources => {\n return {\n goToCartText: props.resources.quickOrderGridGoToCartText ?? '',\n continueShoppingText: props.resources.quickOrderGridDialogCloseText ?? '',\n closeNotificationLabel: props.resources.quickOrderGridBuySelectedAddingToCartErrorNotificationCloseAriaLabel ?? '',\n headerItemOneText: props.resources.quickOrderGridSingleItemText ?? '',\n headerItemFormatText: props.resources.quickOrderGridMultiLineItemFormatText ?? '',\n headerLinesFormatText: props.resources.quickOrderGridMultiLinesFormatText ?? '',\n headerMessageText: props.resources.quickOrderGridHeaderMessageText ?? '',\n freePriceText: props.resources.freePriceText ?? '',\n originalPriceText: props.resources.originalPriceText ?? '',\n currentPriceText: props.resources.currentPriceText ?? '',\n addedQuantityText: props.resources.addedQuantityText ?? '',\n buyAgainNotificationTitle: props.resources.quickOrderGridBuySelectedAddingToCartErrorNotificationTitle ?? '',\n buyAgainNotificationCloseAriaLabel: props.resources.quickOrderGridBuySelectedAddingToCartErrorNotificationCloseAriaLabel ?? ''\n };\n};\n\n/**\n * Get the dialog strings.\n * @param quickOrder - The buy selected props.\n * @returns The add to cart resources.\n */\nexport const getOrderDetails = (quickOrder: QuickOrderTemplate): OrderDetailsProduct[] => {\n const orderDetails: OrderDetailsProduct[] = [];\n for (const quickLine of quickOrder.quickOrderTemplateLines) {\n const quantity = quickLine.productListLine.Quantity;\n const salesLine: SalesLine = {\n Quantity: quantity\n };\n const products = new OrderDetailsProduct(salesLine, quickLine.fullProduct?.ProductDetails);\n orderDetails.push(products);\n }\n return orderDetails;\n};\n\n/**\n * Renders a button which adds given products to the cart.\n * @param props - Configuration of the component.\n * @returns A react element or null if no products were given.\n */\nexport const AddToCartProductListComponent: React.FC = (props: IAddToCartSelectedProps): JSX.Element | null => {\n const {\n data: { quickOrderTemplate }\n } = props;\n\n if (quickOrderTemplate?.quickOrderTemplateLines[0].fullProduct?.ProductDetails === undefined) {\n return null;\n }\n const quantity = quickOrderTemplate.quickOrderTemplateLines[0].productListLine.Quantity;\n const buttonLabel = props.resources.quickOrderGridBuySelectedButtonText;\n const buttonAriaLabel = props.resources.quickOrderGridBuySelectedButtonAriaLabel;\n const dialogStrings: IAddToCartResources = getDialogStrings(props);\n const shouldSkipSiteSettings: boolean = true;\n const orderDetailProducts = getOrderDetails(quickOrderTemplate);\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 { IComponentProps, ICoreContext } from '@msdyn365-commerce/core';\nimport { QuickOrderTemplate } from '@msdyn365-commerce-modules/retail-actions';\nimport { Alert, Button, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { AddToCartProductListComponent } from './add-to-list';\nimport { IQuickOrderGridActionsViewProps, IQuickOrderGridState } from './utilities';\n\n/**\n * Interface for quick order grid action data.\n */\nexport interface IQuickOrderGridActionsData {\n quickOrderTemplate: QuickOrderTemplate | undefined;\n}\n\n/**\n * Interface for quick order grid action props.\n */\nexport interface IQuickOrderGridActionsProps extends IComponentProps {\n context: ICoreContext;\n telemetryContent?: ITelemetryContent;\n moduleClassName: string;\n typeName: string;\n handlers: {\n removeProductList(productListId: string): void;\n onErrorMessage(message: string): void;\n };\n quickOrderGridState: IQuickOrderGridState;\n resources: {\n quickOrderGridDeleteButtonText: string;\n quickOrderGridBuySelectedButtonText?: string;\n quickOrderGridBuySelectedButtonAriaLabel?: string;\n quickOrderGridBuySelectedAddingToCartErrorNotificationTitle?: string;\n quickOrderGridBuySelectedAddingToCartErrorNotificationCloseAriaLabel?: string;\n quickOrderGridGoToCartText?: string;\n quickOrderGridDialogCloseText?: string;\n quickOrderGridSingleItemText?: string;\n quickOrderGridMultiLineItemFormatText?: string;\n quickOrderGridMultiLinesFormatText?: string;\n quickOrderGridHeaderMessageText?: string;\n addedQuantityText?: string;\n originalPriceText?: string;\n currentPriceText?: string;\n freePriceText?: string;\n };\n}\n\n/**\n * Remove ProductList Action.\n * @param props -Quick order grid action props.\n */\nconst removeQuickOrderList = (props: IQuickOrderGridActionsProps): void => {\n const {\n data: { quickOrderTemplate },\n handlers\n } = props;\n const { removeProductList } = handlers;\n // eslint-disable-next-line @typescript-eslint/prefer-optional-chain -- Need to check data.\n if (quickOrderTemplate && quickOrderTemplate.productList.Id) {\n removeProductList(quickOrderTemplate.productList.Id);\n }\n};\n\n/**\n * Get Addtobag Button.\n * @param props -Order template action props.\n * @returns QuickOrderGrid actions view props.\n */\nconst getQuickOrderGridAddToCartDialog = (props: IQuickOrderGridActionsProps): React.ReactNode => {\n const {\n data: { quickOrderTemplate },\n context,\n moduleClassName,\n resources,\n typeName\n } = props;\n const buttonId = 'quick-order-grid';\n return (\n {\n if (result.cartActionResult?.errorDetails?.LocalizedMessage) {\n props.handlers.onErrorMessage(result.cartActionResult.errorDetails.LocalizedMessage);\n }\n }}\n />\n );\n};\n\n/**\n * Remove Quick order grid action.\n * @param props -Quick order grid action props.\n * @returns Remove order template.\n */\nconst removeActionHandler = (props: IQuickOrderGridActionsProps) => () => {\n removeQuickOrderList(props);\n};\n\n/**\n * Quick order grid action view.\n * @param props -Quick Order Grid template action props.\n * @returns QuickOrderGrid actions view props.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Name needs to be this.\nexport const QuickOrderGridActionsView = (props: IQuickOrderGridActionsProps): IQuickOrderGridActionsViewProps => {\n const { moduleClassName, quickOrderGridState, resources } = props;\n const { quickOrderGridDeleteButtonText } = resources;\n\n const userMessageNode = quickOrderGridState.topStateMessage ? (\n \n \n {quickOrderGridState.topStateMessage.messageText}\n \n ) : (\n undefined\n );\n\n return {\n addProductListToBag: getQuickOrderGridAddToCartDialog(props),\n removeProductList: (\n \n ),\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 { Button, Collapse, ICollapseProps } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { IQuickOrderGridDrawerProps } from './quick-order-grid-drawer-props';\n\n/**\n * Interface for drawer state.\n */\nexport interface IQuickOrderGridDrawerState {\n isOpen: boolean;\n}\n\n/**\n * Placement of glyph.\n */\nexport type GlyphPlacement = 'start' | 'end';\n\n/**\n * Quick Order Grid Drawer - This is a full width uncontrolled collapse where the button glyph changes\n * when the drawer is open and closed.\n */\nexport class QuickOrderGridDrawer extends React.Component {\n private readonly _drawerOpenGlyph: string;\n\n private readonly _drawerCloseGlyph: string;\n\n private readonly _drawerGlyphClass: string;\n\n private _isManuallyToggled: boolean;\n\n public constructor(props: IQuickOrderGridDrawerProps) {\n super(props);\n this._isManuallyToggled = false;\n this.state = { isOpen: props.collapseProps?.isOpen ?? false };\n this._drawerGlyphClass = classnames('drawer__glyph', this.props.toggleGlyphClassName ? this.props.toggleGlyphClassName : '');\n const closeGlyph = this.props.closeGlyph ? this.props.closeGlyph : '';\n if (this.props.isAnimateGlyph) {\n this._drawerOpenGlyph = classnames(this._drawerGlyphClass, this.props.openGlyph ? this.props.openGlyph : closeGlyph);\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, closeGlyph);\n }\n }\n\n /**\n * Method to call on click of drawer button.\n * @param event - Product DeliveryOption List.\n */\n public toggle = (event: React.MouseEvent | React.KeyboardEvent): void => {\n event.preventDefault();\n this._isManuallyToggled = true;\n if (this.props.onToggle) {\n this.setState(previousState => ({ isOpen: !previousState.isOpen }));\n this.props.onToggle(this.state);\n } else {\n this.setState(previousState => ({ isOpen: !previousState.isOpen }));\n }\n };\n\n public shouldComponentUpdate(nextProps: IQuickOrderGridDrawerProps, nextState: IQuickOrderGridDrawerState): 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: ICollapseProps = { ...this.props.collapseProps };\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 }\n collapseProps.children = this.props.children;\n const drawerClass = classnames('drawer', this.props.className);\n const drawerButtonClassName = `${this.props.className ? this.props.className : ''}__button`;\n this._isManuallyToggled = false;\n return (\n
\n \n {this._generateDrawerButtonInnerMarkup(collapseProps.isOpen, drawerClass)}\n \n \n
\n );\n }\n\n private _generateDrawerButtonInnerMarkup(isCollapseState: boolean, drawerClass: string): JSX.Element {\n const drawerButtonTextClass = classnames(\n 'drawer__buttontext',\n this.props.toggleButtonClassName ? this.props.toggleButtonClassName : ''\n );\n const headingDrawerClass = `${drawerClass}-heading`;\n const descriptionDrawerClass = `${drawerClass}-description`;\n return (\n <>\n

{this.props.moduleHeadingText}

\n {this.props.moduleDescriptionText}\n {this._generateGlyphMarkup('drawer__glyph__end', isCollapseState)}\n \n );\n }\n\n private _generateGlyphMarkup(location: string, isCollapseState: boolean): JSX.Element {\n let glyphClass = isCollapseState ? this._drawerOpenGlyph : this._drawerCloseGlyph;\n glyphClass = `${glyphClass} ${location}`;\n return ;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Alert, Button } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IQuickOrderGridState } from './utilities';\n\n/**\n * Interface quick order grid form props.\n */\nexport interface IQuickOrderGridFormProps {\n isAddtoListDisabled: boolean | undefined;\n productTextInput: React.RefObject;\n quantityTextInput: React.RefObject;\n maxChars: number;\n minQuantity?: number;\n maxQuantity?: number;\n moduleClassName: string;\n ariaLabelQuantity: string;\n ariaLabelProduct: string;\n ariaLabelAddtoCart: string;\n quickOrderGridState: IQuickOrderGridState;\n handleInputChange(query: string): void;\n handleQuantityChange(query: string): void;\n handleAddProductListClick(): Promise;\n}\n\n/**\n * Interface quick order grid form view props.\n */\nexport interface IQuickOrderGridFormViewProps {\n product: React.ReactNode;\n quantity: React.ReactNode;\n addToListBtn: 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\n/**\n * Quick order grid form component.\n * @param props -Component form props.\n * @returns Quick order gridp view props..\n */\nexport const QuickOrderGridFormComponent = (props: IQuickOrderGridFormProps): IQuickOrderGridFormViewProps => {\n const {\n moduleClassName,\n productTextInput,\n quantityTextInput,\n quickOrderGridState,\n maxChars,\n minQuantity,\n maxQuantity,\n isAddtoListDisabled,\n ariaLabelQuantity,\n ariaLabelProduct,\n ariaLabelAddtoCart,\n handleQuantityChange,\n handleInputChange,\n handleAddProductListClick\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 addToListNode = (\n
\n \n {ariaLabelAddtoCart}\n \n
\n );\n\n const userMessageNode = quickOrderGridState.stateMessage ? (\n \n \n {quickOrderGridState.stateMessage.messageText}\n \n ) : (\n undefined\n );\n\n return {\n product: productNode,\n addToListBtn: addToListNode,\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 { QuickOrderTemplateLine } from '@msdyn365-commerce-modules/retail-actions';\nimport { observable } from 'mobx';\n\n/**\n * Represents a product for quick order grid.\n */\nexport class QuickOrderGridProduct {\n @observable\n public isSelected: boolean;\n\n public readonly productLine: QuickOrderTemplateLine;\n\n public constructor(productLine: QuickOrderTemplateLine) {\n this.productLine = productLine;\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 grid table header resources.\n */\nexport interface IQuickOrderGridTableHeaderResources {\n quickOrderGridProductNumberText: string;\n quickOrderGridProductText: string;\n quickOrderGridUnitPriceText: string;\n quickOrderGridUnitOfMeasureText: string;\n quickOrderGridQuantityText: string;\n quickOrderGridActionsText: string;\n}\n\n/**\n * Interface for quick order grid table props.\n */\nexport interface IQuickOrderGridTableHeaderProps extends IComponentProps {\n context: ICoreContext;\n className: string;\n\n isMobile: boolean;\n resources: IQuickOrderGridTableHeaderResources;\n}\n\n/**\n * Interface for quick order grid table header component.\n */\nexport interface IQuickOrderGridTableHeaderComponent extends IComponent {}\n\n/**\n * Get the quick order grid header cells for desktop.\n * @param props -- The quick order grid table header props.\n * @returns The list of cells for quick order grid header component in desktop version.\n */\nconst QuickOrderGridDesktopHeaderCellsComponent: React.FC = (props: IQuickOrderGridTableHeaderProps) => {\n const { resources } = props;\n const columnWithNumberClassName = `${props.className}__row__column-with-number`;\n return (\n <>\n \n \n \n {resources.quickOrderGridProductNumberText}\n {resources.quickOrderGridProductText}\n {resources.quickOrderGridUnitPriceText}\n {resources.quickOrderGridUnitOfMeasureText}\n {resources.quickOrderGridQuantityText}\n {resources.quickOrderGridActionsText}\n \n );\n};\n\n/**\n * Get the quick order grid header cells for mobile.\n * @param props -- The quick order grid table header props.\n * @returns The quick order grid header component in desktop version.\n */\nconst QuickOrderGridMobileHeaderCellsComponent: React.FC = (props: IQuickOrderGridTableHeaderProps) => {\n const { resources } = props;\n return (\n <>\n \n {resources.quickOrderGridProductNumberText}\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 QuickOrderGridTableHeaderComponent: React.FC = (props: IQuickOrderGridTableHeaderProps) => {\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 { PriceComponent } from '@msdyn365-commerce/components';\nimport MsDyn365, { IComponentProps, ICoreContext, IImageSettings, Image } from '@msdyn365-commerce/core';\nimport { ProductListLine, ProductPrice } from '@msdyn365-commerce/retail-proxy';\nimport { getFallbackImageUrl, getProductPageUrlSync, ObjectExtensions, StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { Button, IncrementalQuantity, isMobile, VariantType } from '@msdyn365-commerce-modules/utilities';\nimport React, { useState } from 'react';\n\nimport { QuickOrderGridProduct } from '../../quick-order-grid-product';\nimport { IQuickOrderGridRowCallbacks } from '../../utilities';\n\n/**\n * Data required to render each quick order grid row.\n */\nexport interface IQuickOrderGridTableRowData {\n product: QuickOrderGridProduct;\n}\n\n/**\n * Resources for quick order grid table rows.\n */\nexport interface IQuickOrderGridTableRowResources {\n quickOrderGridQuantityMobileText: string;\n quickOrderGridProductDimensionsSeparator: string;\n quickOrderGridViewDetailsButtonText: string;\n quickOrderGridViewDetailsButtonAriaLabel: string;\n quickOrderGridRemoveItemButtonAriaLabel: string;\n quickOrderGridInputQuantityAriaLabel: string;\n quickOrderGridDecrementButtonAriaLabel: string;\n quickOrderGridIncrementButtonAriaLabel: string;\n originalPriceText: string;\n currentPriceText: string;\n freePriceText: string;\n}\n\n/**\n * Interface for quick order grid table props.\n */\nexport interface IQuickOrderGridTableRowProps extends IComponentProps {\n context: ICoreContext;\n className: string;\n productListLine: ProductListLine;\n price?: ProductPrice;\n moduleId: string;\n moduleTypeName: string;\n min: number;\n max: number;\n quantity: number;\n imageSettings?: IImageSettings;\n isMobile: boolean;\n resources: IQuickOrderGridTableRowResources;\n index: number;\n callbacks: IQuickOrderGridRowCallbacks;\n}\n\n/**\n * The default image settings for quick order grid 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 grid row.\n * @param props - Quick order table row props.\n * @returns React element.\n */\nconst QuickOrderGridTableRowProductImageComponent: React.FC = (props: IQuickOrderGridTableRowProps) => {\n const product = props.data.product.productLine.fullProduct?.ProductDetails;\n const fallbackImageUrl = getFallbackImageUrl(\n 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\nlet setShowPreviousActions: React.Dispatch> | undefined;\n\n/**\n * Renders product price.\n * @param props - Props for price component.\n * @returns React element.\n */\nconst renderProductPrice = (props: IQuickOrderGridTableRowProps): JSX.Element | null => {\n const { context, moduleId, moduleTypeName, resources } = props;\n const price = props.price;\n\n if (price) {\n return (\n \n );\n }\n return null;\n};\n\n/**\n * Renders product price.\n * @param props - Props for price component.\n * @returns React element.\n */\nconst renderUnitOfMeasure = (props: IQuickOrderGridTableRowProps): JSX.Element | null => {\n const price = props.price;\n\n if (price) {\n return (\n
\n {StringExtensions.isNullOrEmpty(props.productListLine.UnitOfMeasure) || price.UnitOfMeasure}\n
\n );\n }\n return null;\n};\n\n/**\n * On Change function.\n * @param onChangeQuantity -On change quantity function.\n * @param itemKey -String.\n * @param props -Order template line props.\n * @returns Set change quantity.\n */\nconst onChangeHandler = (\n onChangeQuantity: (\n orderTemplateLineId: string | undefined,\n quantity: number,\n props?: IQuickOrderGridTableRowProps | undefined\n ) => boolean,\n itemKey: string | undefined,\n props: IQuickOrderGridTableRowProps\n) => (newValue: number) => {\n onChangeQuantity(itemKey, newValue, props);\n return true;\n};\n\n/**\n * On Change function.\n * @param onRemoveItem -On change quantity function.\n * @param quickOrderGridProductKey -QuickOrderGridp Product.\n * @param props -Order template line props.\n * @returns Set change quantity.\n */\nconst onRemoveHandler = (\n onRemoveItem: (quickOrderGridProduct: QuickOrderGridProduct, props?: IQuickOrderGridTableRowProps | undefined) => void,\n quickOrderGridProductKey: QuickOrderGridProduct,\n props: IQuickOrderGridTableRowProps\n) => () => {\n onRemoveItem(quickOrderGridProductKey, props);\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 QuickOrderGridExtraActionsPopupComponent: React.FC = (\n props: IQuickOrderGridTableRowProps\n): JSX.Element | null => {\n const {\n resources: { quickOrderGridViewDetailsButtonAriaLabel, quickOrderGridViewDetailsButtonText }\n } = props;\n const product = props.data.product.productLine.fullProduct?.ProductDetails;\n const [shouldShowActions, setShowActions] = useState(false);\n let productUrl = '';\n if (product === undefined) {\n return null;\n }\n if (!StringExtensions.isNullOrWhitespace(product.Name) && !ObjectExtensions.isNullOrUndefined(product.RecordId)) {\n productUrl = getProductPageUrlSync(product.Name!, product.RecordId, props.context.actionContext);\n }\n\n const onClickViewDetails = React.useCallback(() => {\n if (MsDyn365.isBrowser) {\n window.location.href = productUrl;\n }\n }, [productUrl]);\n\n const toggle = React.useCallback(() => {\n const shouldShowActionsNewValue = !shouldShowActions;\n if (shouldShowActionsNewValue) {\n if (setShowPreviousActions) {\n setShowPreviousActions(false);\n }\n setShowActions(shouldShowActionsNewValue);\n setShowPreviousActions = setShowActions;\n } else {\n setShowPreviousActions = undefined;\n setShowActions(shouldShowActionsNewValue);\n }\n }, [shouldShowActions, setShowActions]);\n\n if (StringExtensions.isNullOrWhitespace(productUrl)) {\n return null;\n }\n\n const className = `${props.className}__extra-actions-cell`;\n const actionsContainerClassName = `${className}__actions-container`;\n\n return (\n
\n \n \n {props.resources.quickOrderGridRemoveItemButtonAriaLabel}\n \n
\n )}\n \n );\n};\n\n/**\n * Renders quick order grid table rows for desktop view.\n * @param props - Configuration for the rows.\n * @returns A react node with a list of quick order grid rows for desktop view.\n */\nexport const QuickOrderGridDesktopTableRowCellComponent: React.FC = (props: IQuickOrderGridTableRowProps) => {\n const product = props.data.product.productLine.fullProduct?.ProductDetails;\n const productListLine = props.data.product.productLine.productListLine;\n const { min, max, quantity } = props;\n const columnWithNumberClassName = `${props.className}__column-with-number`;\n if (product !== undefined) {\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.quickOrderGridProductDimensionsSeparator)}\n \n
\n \n {renderProductPrice(props)}\n {renderUnitOfMeasure(props)}\n \n \n \n \n \n \n \n );\n }\n\n return null;\n};\n\n/**\n * Renders rows for mobile view.\n * @param props - Configuration for the rows.\n * @returns A react node with a list of quick order grid rows for mobile view.\n */\nexport const QuickOrderGridMobileTableRowCellComponent: React.FC = (props: IQuickOrderGridTableRowProps) => {\n const product = props.data.product.productLine.fullProduct?.ProductDetails;\n const productListLine = props.data.product.productLine.productListLine;\n const { min, max, quantity } = props;\n if (product !== undefined) {\n return (\n <>\n \n \n \n \n
\n {product.RecordId}\n \n \n \n
\n \n \n \n \n \n );\n }\n return null;\n};\n\n/**\n * Quick order table row component.\n * @param props - Configuration of the component.\n * @returns React node for the row.\n */\nexport const QuickOrderGridTableRowComponent: React.FC = (props: IQuickOrderGridTableRowProps) => {\n const rowClassName = `${props.className}__row`;\n const isMobileView = isMobile({ variant: VariantType.Viewport, context: props.context.request }) === 'xs';\n let headerCells: JSX.Element;\n if (isMobileView) {\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 MsDyn365, { IComponent, IComponentProps, ICoreContext, IImageSettings } from '@msdyn365-commerce/core';\nimport React from 'react';\n\nimport { ObjectExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { QuickOrderGridProduct } from '../quick-order-grid-product';\nimport { IQuickOrderGridRowCallbacks } from '../utilities';\nimport {\n IQuickOrderGridTableHeaderResources,\n IQuickOrderGridTableRowResources,\n QuickOrderGridTableHeaderComponent,\n QuickOrderGridTableRowComponent\n} from './components';\n\n/**\n * Quick order table data interface.\n */\ninterface IQuickOrderGridTableData {\n quickOrderGridProducts: QuickOrderGridProduct[];\n isOrderQuantityLimitsFeatureEnabled: boolean;\n}\n\n/**\n * Quick order table resources.\n */\nexport interface IQuickOrderGridTableResources extends IQuickOrderGridTableHeaderResources, IQuickOrderGridTableRowResources {}\n\n/**\n * Quick order table props.\n */\nexport interface IQuickOrderGridTableProps extends IComponentProps {\n context: ICoreContext;\n className: string;\n moduleId: string;\n moduleTypeName: string;\n\n resources: IQuickOrderGridTableResources;\n isMobileView: boolean;\n imageSettings?: IImageSettings;\n callBacks: IQuickOrderGridRowCallbacks;\n}\n\n/**\n * Quick order table component.\n */\nexport interface IQuickOrderGridTableComponent extends IComponent {}\n\n/**\n * The quick order table.\n * @param props -- The quick order table props.\n * @returns The quick order table element.\n */\nexport const QuickOrderGridTableComponent: React.FC = (props: IQuickOrderGridTableProps) => {\n const [isMobile, setIsMobile] = React.useState(props.isMobileView);\n const quickOrderGridProducts = props.data.quickOrderGridProducts;\n const isOrderQuantityLimitsFeatureEnabled = props.data.isOrderQuantityLimitsFeatureEnabled;\n\n /**\n * Update the view port.\n */\n const updateViewport = () => {\n setIsMobile(props.isMobileView);\n };\n\n if (MsDyn365.isBrowser) {\n window.addEventListener('resize', updateViewport);\n }\n\n const headerClassName = `${props.className}__header`;\n const rowClassName = `${props.className}__row`;\n\n return (\n \n \n {quickOrderGridProducts.map((quickOrderProduct, index) => {\n let quantity = quickOrderProduct.productLine.productListLine.Quantity!;\n const product = quickOrderProduct.productLine.fullProduct;\n let min: number = 1;\n let max: number = 10;\n const behavior = product?.ProductDetails?.Behavior;\n if (isOrderQuantityLimitsFeatureEnabled && !ObjectExtensions.isNullOrUndefined(behavior)) {\n if (behavior.MinimumQuantity && behavior.MinimumQuantity > 0) {\n min = behavior.MinimumQuantity;\n }\n if (behavior.MaximumQuantity && behavior.MaximumQuantity > 0) {\n max = behavior.MaximumQuantity;\n }\n quantity = Math.max(quantity, min);\n }\n const price = quickOrderProduct.productLine.fullProduct?.ProductPrice;\n return (\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 {\n getProductConfigure,\n IProductDimensionCallbacks,\n IProductDimensionConfigureResources,\n IProductDimensionConfigureViewProps\n} from '@msdyn365-commerce/components';\nimport {\n ProductDimension,\n ProductDimensionType,\n ProductDimensionValue,\n ProductListsDataActions,\n ProductListType,\n SimpleProduct\n} from '@msdyn365-commerce/retail-proxy';\nimport {\n addItemToProductListAction,\n AddItemToProductListInput,\n ArrayExtensions,\n createProductList,\n CreateProductListInput,\n FinitePromiseQueue,\n FinitePromiseQueueError,\n getDimensionsForSelectedVariant,\n GetDimensionsForSelectedVariantInput,\n getScanResult,\n GetScanResultInput,\n getSelectedVariant,\n IDimensionForSelectedVariant,\n IPromiseQueue,\n ObjectExtensions,\n QuickOrderTemplate,\n QuickOrderTemplateLine,\n SelectedVariantInput,\n StringExtensions\n} from '@msdyn365-commerce-modules/retail-actions';\nimport {\n getTelemetryObject,\n Heading,\n IModuleProps,\n INodeProps,\n isMobile,\n ITelemetryContent,\n VariantType\n} from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport { debounce } from 'lodash';\nimport { computed } from 'mobx';\nimport * as React from 'react';\n\nimport { getCatalogId } from '@msdyn365-commerce/core';\nimport { ActiveProductListInput } from './actions';\nimport {\n EcommerceQuantityLimitConfigurationsFeatureName,\n IQuickOrderGridActionsProps,\n IQuickOrderGridActionsViewProps,\n IQuickOrderGridRowCallbacks,\n IQuickOrderGridState,\n QuickOrderGridActionsView,\n QuickOrderGridDrawer,\n QuickOrderGridFormComponent,\n QuickOrderGridProduct,\n QuickOrderGridTableComponent,\n RetailDefaultOrderQuantityLimitsFeatureName\n} from './components';\nimport { IQuickOrderGridData } from './quick-order-grid.data';\nimport { IQuickOrderGridProps, IQuickOrderGridResources } from './quick-order-grid.props.autogenerated';\n\n/**\n * QuickOrder Grid View props.\n */\nexport interface IQuickOrderGridViewProps extends IQuickOrderGridProps {\n header: JSX.Element;\n actions?: INodeProps;\n isB2bCustomer?: boolean;\n isQuickOrderGridFormExpanded: boolean;\n contentProps: INodeProps;\n drawer: INodeProps;\n loading?: React.ReactNode;\n quickOrderGridForm: INodeProps;\n quickOrderGridFormProductContent: INodeProps;\n quickOrderGridFormMsgContent: INodeProps;\n quickOrderGridProps: IModuleProps;\n form: React.ReactNode;\n configure?: IProductDimensionConfigureViewProps;\n isMobileView: boolean;\n container?: JSX.Element;\n orderActions?: IQuickOrderGridActionsViewProps | null;\n bulkPurchase?: React.ReactNode;\n}\n\n/**\n * QuickOrder Grid View port.\n */\nexport type GridSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\n/**\n * QuickOrderGrid component.\n * @extends {React.PureComponent>}\n */\nclass QuickOrderGrid extends React.PureComponent, IQuickOrderGridState> {\n private readonly _productTextInput: React.RefObject;\n\n private readonly _quantityInput: React.RefObject;\n\n private readonly _waitTime: number = 500;\n\n private readonly _dimensionUpdateQueueMaxLength: number = 2;\n\n private readonly _errorCssClass: string = 'danger';\n\n private readonly _errorCssGlyphClass: string = 'fas fa-exclamation-triangle';\n\n private readonly _quickOrderGridFormClass: string;\n\n private readonly _quickOrderGridFormProductContent: string;\n\n private readonly _quickOrderGridFormMsgContent: string;\n\n private readonly _telemetryContent: ITelemetryContent;\n\n private readonly _dimensionUpdateQueue: IPromiseQueue = new FinitePromiseQueue(this._dimensionUpdateQueueMaxLength);\n\n private _dimensions: { [id: number]: string } = {};\n\n private _initializedDimensions: Set = new Set();\n\n private readonly _cssClassNameConfigure: string = 'ms-quick-order_grid__content-form-main';\n\n private readonly _className: string = 'ms-quick-order-grid';\n\n // @ts-expect-error: Debouce needs to be used as type.\n private _cancellabelDebounce: debounce;\n\n private _isOrderQuantityLimitsFeatureEnabled: boolean = false;\n\n private _isChannelLimitsFeatureEnabled: boolean = false;\n\n private _applyDefaultOrderSettingsForCartLine: boolean = false;\n\n private readonly _quickOrderGridCallbacks: IProductDimensionCallbacks = {\n initializeDimension: (initializedDimension: string): void => {\n if (initializedDimension) {\n this._initializedDimensions.add(initializedDimension);\n }\n },\n /**\n * Get Dropdown name.\n * @param selectedDimensionId - Dimension type.\n * @param selectedDimensionValueId - Resources.\n * @returns Dropdown name.\n */\n dimensionSelectedAsync: async (selectedDimensionId: number, selectedDimensionValueId: string): Promise => {\n this._dimensions[selectedDimensionId] = selectedDimensionValueId;\n // Only trigger _updateDimensions when all dimensions are initialized\n if (this._initializedDimensions.size === this.state.productDimensions?.length) {\n return this._dimensionUpdateQueue\n .enqueue(async () => {\n return this._updateDimensions();\n })\n .catch((error: string) => {\n // Ignore discarded processes.\n if (error !== FinitePromiseQueueError.ProcessWasDiscardedFromTheQueue) {\n throw new Error(error);\n }\n });\n }\n },\n\n /**\n * Get Dropdown name.\n * @param dimensionType - Dimension type.\n * @param resources - Resources.\n * @returns Dropdown name.\n */\n getDropdownName: (dimensionType: number, resources: IProductDimensionConfigureResources): string => {\n return this._getDropdownName(dimensionType, resources);\n },\n\n /**\n * Method to call on dimension change.\n * @param isUpdatingDimension - Flag to update dimension.\n */\n changeUpdatingDimension: (isUpdatingDimension: boolean): void => {\n this.setState({ isUpdatingDimension });\n }\n };\n\n private readonly _quickOrderGridRowCallbacks: IQuickOrderGridRowCallbacks = {\n /**\n * Method to call remove button.\n * @param line - Grid row product.\n */\n onRemoveItem: (line: QuickOrderGridProduct): void => {\n this._removeItemRowFromTable(line.productLine);\n },\n\n /**\n * Method to call on change quantity button.\n * @param productListLineId - Grid row product list line id.\n * @param quantity - Product quantity.\n * @returns - Falg to get confirmation for action.\n */\n onChangeQuantity: (productListLineId: string | undefined, quantity: number): boolean => {\n return this._changeRowQuantity(productListLineId, quantity);\n }\n };\n\n public constructor(props: IQuickOrderGridProps) {\n super(props);\n this._productTextInput = React.createRef();\n this._quantityInput = React.createRef();\n\n this._telemetryContent = getTelemetryObject(\n this.props.context.request.telemetryPageName!,\n this.props.friendlyName,\n this.props.telemetry\n );\n this.state = {\n isQuickOrderGridFormExpanded: false,\n min: 0,\n max: 10,\n quantity: 1,\n productResponse: undefined,\n productDimensions: undefined,\n productDimensionErrorState: {\n configureErrors: {}\n },\n isMobile: this.isMobile,\n products: [],\n isUpdatingDimension: false,\n productListId: ''\n };\n\n this._quickOrderGridFormClass = 'ms-quick-order-grid__content-form';\n this._quickOrderGridFormProductContent = 'ms-quick-order-grid__content-form-main';\n this._quickOrderGridFormMsgContent = 'ms-quick-order-grid__content-form-msg';\n\n this._isOrderQuantityLimitsFeatureEnabled =\n this.props.data.featureState.result?.find(featureState => featureState.Name === RetailDefaultOrderQuantityLimitsFeatureName)\n ?.IsEnabled ?? false;\n\n this._isChannelLimitsFeatureEnabled =\n this.props.data.featureState.result?.find(featureState => featureState.Name === EcommerceQuantityLimitConfigurationsFeatureName)\n ?.IsEnabled ?? false;\n\n const cartConfiguration = this.props.data.cartConfiguration;\n this._applyDefaultOrderSettingsForCartLine = cartConfiguration?.result?.ValidateDefaultOrderSettingsPerLine ?? false;\n }\n\n @computed public get isMobile(): boolean {\n const size = isMobile({ variant: VariantType.Viewport, context: this.props.context.request });\n return size === 'xs';\n }\n\n public render(): JSX.Element | null {\n const { data } = this.props;\n if (!data.customerInformation.result) {\n return null;\n }\n const quickOrderTemplate = data.quickOrderTemplate;\n\n if (quickOrderTemplate?.result !== undefined) {\n this.setState({\n products: quickOrderTemplate.result.quickOrderTemplateLines,\n productListId: quickOrderTemplate.result.productList.Id\n });\n }\n const { className = '', maxQuantity } = this.props.config;\n const customerInfo = this.props.data.customerInformation.result;\n const {\n quickOrderGridModuleHeading,\n quickOrderGridModuleDescription,\n quickOrderGridAddtogrid,\n quickOrderGridProductQuantityInputLabel,\n quickOrderGridProductInputLabel,\n quickOrderGridProductDimensionTypeColor,\n quickOrderGridProductDimensionTypeConfiguration,\n quickOrderGridSelectDimensionFormatString,\n quickOrderGridProductDimensionTypeSize,\n quickOrderGridProductDimensionTypeStyle,\n quickOrderGridProductDimensionTypeAmount,\n quickOrderGridModulePageHeading\n } = this.props.resources;\n\n const productConfigureResources: IProductDimensionConfigureResources = {\n selectDimensionFormatString: quickOrderGridSelectDimensionFormatString,\n productDimensionTypeColor: quickOrderGridProductDimensionTypeColor,\n productDimensionTypeConfiguration: quickOrderGridProductDimensionTypeConfiguration,\n productDimensionTypeSize: quickOrderGridProductDimensionTypeSize,\n productDimensionTypeStyle: quickOrderGridProductDimensionTypeStyle,\n productDimensionTypeAmount: quickOrderGridProductDimensionTypeAmount\n };\n\n const { isQuickOrderGridFormExpanded, productDimensionErrorState, productResponse, productDimensions } = this.state;\n\n const headerClassName = `${this._className}__header`;\n\n const header = (\n
\n \n
\n );\n\n const viewProps: IQuickOrderGridViewProps = {\n ...(this.props as IQuickOrderGridProps),\n\n quickOrderGridProps: { className: classnames('ms-quick-order-grid', className), moduleProps: this.props },\n contentProps: { className: 'ms-quick-order-grid__content' },\n isB2bCustomer: customerInfo?.IsB2b,\n header,\n actions: {\n className: `${this._className}-action-bar`,\n tag: 'div'\n },\n drawer: {\n tag: QuickOrderGridDrawer,\n className: `${this._className}__drawer`,\n collapseProps: { isOpen: this.state.isQuickOrderGridFormExpanded },\n moduleHeadingText: quickOrderGridModuleHeading,\n moduleDescriptionText: quickOrderGridModuleDescription,\n requestContext: this.props.context.request,\n telemetryContent: this._telemetryContent\n },\n bulkPurchase: this._renderBulkPurchase(),\n quickOrderGridForm: {\n className: `${this._quickOrderGridFormClass} ${isQuickOrderGridFormExpanded ? 'qo-show' : 'qo-hide'}`\n },\n quickOrderGridFormProductContent: {\n className: this._quickOrderGridFormProductContent\n },\n quickOrderGridFormMsgContent: {\n className: this._quickOrderGridFormMsgContent\n },\n form: QuickOrderGridFormComponent({\n productTextInput: this._productTextInput,\n quantityTextInput: this._quantityInput,\n isAddtoListDisabled: !productResponse,\n ariaLabelAddtoCart: quickOrderGridAddtogrid,\n ariaLabelProduct: quickOrderGridProductInputLabel,\n ariaLabelQuantity: quickOrderGridProductQuantityInputLabel,\n maxChars: 50,\n minQuantity: this.state.min ?? 0,\n maxQuantity: this.state.max ?? maxQuantity,\n moduleClassName: this._className,\n quickOrderGridState: this.state,\n handleInputChange: this._handleInputChange,\n handleQuantityChange: this._handleQuantityChange,\n handleAddProductListClick: this._addItemToProductListLine\n }),\n configure:\n productResponse && productDimensions\n ? getProductConfigure(\n this._cssClassNameConfigure,\n this.props.context,\n this.props.friendlyName,\n this.props.telemetry,\n quickOrderGridSelectDimensionFormatString,\n productConfigureResources,\n this._quickOrderGridCallbacks,\n productResponse,\n productDimensions,\n productDimensionErrorState\n )\n : undefined,\n isQuickOrderGridFormExpanded: this.state.isQuickOrderGridFormExpanded,\n isMobileView: this.state.isMobile,\n container: ArrayExtensions.hasElements(this.state.products) ? this._renderListContainer() : undefined,\n orderActions: this._renderQuickOrderGridActions(quickOrderTemplate?.result)\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n private _renderQuickOrderGridActions(quickOrderTemplate: QuickOrderTemplate | undefined): IQuickOrderGridActionsViewProps | null {\n const { typeName, context, resources } = this.props;\n const {\n quickOrderGridDeleteButtonText,\n quickOrderGridBuySelectedButtonText,\n quickOrderGridBuySelectedButtonAriaLabel,\n quickOrderGridBuySelectedAddingToCartErrorNotificationTitle,\n quickOrderGridBuySelectedAddingToCartErrorNotificationCloseAriaLabel,\n quickOrderGridGoToCartText,\n quickOrderGridDialogCloseText,\n quickOrderGridSingleItemText,\n quickOrderGridMultiLineItemFormatText,\n quickOrderGridMultiLinesFormatText,\n quickOrderGridHeaderMessageText,\n addedQuantityText,\n originalPriceText,\n currentPriceText,\n freePriceText\n } = resources;\n if (ArrayExtensions.hasElements(quickOrderTemplate?.quickOrderTemplateLines)) {\n const quickOrderGridActions: IQuickOrderGridActionsProps = {\n data: { quickOrderTemplate },\n moduleClassName: this._className,\n id: 'quick-order-grid',\n typeName,\n context,\n handlers: {\n removeProductList: this._removeProductList,\n onErrorMessage: (message: string) =>\n this.setState({\n topStateMessage: {\n messageText: message,\n statusCssString: this._errorCssClass,\n messageGlyph: this._errorCssGlyphClass,\n isOpen: true\n }\n })\n },\n quickOrderGridState: this.state,\n resources: {\n quickOrderGridDeleteButtonText,\n quickOrderGridBuySelectedButtonText,\n quickOrderGridBuySelectedButtonAriaLabel,\n quickOrderGridBuySelectedAddingToCartErrorNotificationTitle,\n quickOrderGridBuySelectedAddingToCartErrorNotificationCloseAriaLabel,\n quickOrderGridGoToCartText,\n quickOrderGridDialogCloseText,\n quickOrderGridSingleItemText,\n quickOrderGridMultiLineItemFormatText,\n quickOrderGridMultiLinesFormatText,\n quickOrderGridHeaderMessageText,\n addedQuantityText,\n originalPriceText,\n currentPriceText,\n freePriceText\n }\n };\n\n return QuickOrderGridActionsView(quickOrderGridActions);\n }\n return null;\n }\n\n /**\n * Renders bulk purchase module.\n * @returns Bulk purchase module react node.\n */\n private _renderBulkPurchase(): React.ReactNode {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Temporary switch for the feature which is under development.\n if (!this.props.context.app.config.isBulkPurchaseEnabled) {\n return null;\n }\n\n if (!ArrayExtensions.hasElements(this.props.slots.bulkPurchaseSlots)) {\n return null;\n }\n\n const containerClass = `${this._className}__bulk-purchase`;\n return (\n
\n {React.cloneElement(this.props.slots.bulkPurchaseSlots[0] as React.ReactElement, {\n productDimensions: this.state.productDimensions\n })}\n
\n );\n }\n\n /**\n * Render list container.\n * @returns JSX element.\n */\n private _renderListContainer(): JSX.Element {\n const containerClass = `${this._className}__table-content`;\n return
{this._renderQuickOrderTable(this._className)}
;\n }\n\n /**\n * Initial the products on quick order.\n * @returns List of quick order products or undefined.\n */\n private _initQuickOrderGridProducts(): QuickOrderGridProduct[] {\n const products: QuickOrderTemplateLine[] = this.state.products;\n\n const quickOrderGridProduct: QuickOrderGridProduct[] = products.map((product: QuickOrderTemplateLine) => {\n return new QuickOrderGridProduct(product);\n });\n\n return ArrayExtensions.validValues(quickOrderGridProduct);\n }\n\n /**\n * Method to call on clear button.\n */\n private readonly _removeProductList = () => {\n const { context, data, telemetry, resources } = this.props;\n const { quickOrderTemplate } = data;\n const userToken = context.request.user.isAuthenticated && context.request.user.token;\n if (userToken && quickOrderTemplate && quickOrderTemplate.result) {\n ProductListsDataActions.deleteAsync({ callerContext: context.actionContext }, quickOrderTemplate.result.productList)\n .then(() => {\n window.location.reload();\n })\n .catch((error: string) => {\n telemetry.warning('[quick-order-grid] Unable to delete product list.');\n telemetry.error(error);\n this._updateStatusState(\n resources.quickOrderGridDeleteProductListFailedText,\n this._errorCssClass,\n this._errorCssGlyphClass,\n true\n );\n });\n } else {\n telemetry.warning('[quick-order-grid] Failed to delete product list. Product List was not found');\n }\n };\n\n /**\n * Initial the products on quick order.\n * @param className - Class name.\n * @returns JSX element.\n */\n private _renderQuickOrderTable(className: string): JSX.Element {\n const tableClassName = `${className}__table-list`;\n\n return (\n \n );\n }\n\n private _updateQuantitiesInState(product: SimpleProduct): void {\n const min: number = this._getMinQuantityForCartLineItem(this._isOrderQuantityLimitsFeatureEnabled, product);\n const max: number = this._getMaxQuantityForCartLineItem(\n this._isChannelLimitsFeatureEnabled || this._isOrderQuantityLimitsFeatureEnabled,\n product\n );\n let quantity: number = this._getQuantity(\n this._isOrderQuantityLimitsFeatureEnabled,\n this._applyDefaultOrderSettingsForCartLine,\n product\n );\n quantity = Math.max(quantity, min);\n\n this.setState({\n min,\n max,\n quantity\n });\n }\n\n private _getMinQuantityForCartLineItem(isOrderQuantityLimitsFeatureEnabled: boolean, product: SimpleProduct): number {\n if (\n isOrderQuantityLimitsFeatureEnabled &&\n this._getIgnoreOrderSettings() &&\n product?.Behavior?.MinimumQuantity &&\n product.Behavior.MinimumQuantity > 0\n ) {\n return product.Behavior.MinimumQuantity;\n }\n\n return 1;\n }\n\n private _getMaxQuantityForCartLineItem(isQuantityLimitsFeatureEnabled: boolean, product: SimpleProduct): number {\n if (\n isQuantityLimitsFeatureEnabled &&\n this._getIgnoreOrderSettings() &&\n product?.Behavior?.MaximumQuantity &&\n product.Behavior.MaximumQuantity > 0\n ) {\n return product.Behavior.MaximumQuantity;\n }\n\n return this.props.context.app.config.maxQuantityForCartLineItem;\n }\n\n /**\n * Retrieves the value of the IgnoreOrderSettings property from the cart configuration.\n * If the property is not present, it defaults to false.\n * @returns {boolean} The value of the IgnoreOrderSettings property.\n */\n private _getIgnoreOrderSettings(): boolean {\n const cartConfiguration = this.props.data.cartConfiguration;\n return !(cartConfiguration?.result?.IgnoreOrderSettings ?? false);\n }\n\n private _getQuantity(\n isOrderQuantityLimitsFeatureEnabled: boolean,\n applyDefaultOrderSettingsForCartLine: boolean,\n product: SimpleProduct\n ): number {\n let defaultQuantity = 1;\n\n if (!isOrderQuantityLimitsFeatureEnabled || !applyDefaultOrderSettingsForCartLine) {\n return defaultQuantity;\n }\n\n if (product?.Behavior?.DefaultQuantity && product.Behavior.DefaultQuantity > 0) {\n defaultQuantity = product.Behavior.DefaultQuantity;\n }\n\n return defaultQuantity;\n }\n\n /**\n * Method to called on product input change.\n * @param query - Product inventory info.\n */\n private readonly _handleInputChange = (query: string): void => {\n const queryMinLength = 4;\n if (!query || query.length > queryMinLength) {\n this.setState({ quantity: 0, productDimensions: [], productResponse: undefined });\n this._updateStatusState('', '', '', false);\n }\n if (this._cancellabelDebounce) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call -- existing code.\n this._cancellabelDebounce.cancel();\n }\n\n const { telemetry, context } = this.props;\n const zeroNumber = 0;\n if (!StringExtensions.isNullOrEmpty(query)) {\n this._cancellabelDebounce = debounce(() => {\n getScanResult(\n new GetScanResultInput(\n context.actionContext.requestContext.apiSettings,\n query,\n context.actionContext.requestContext.apiSettings.channelId\n ),\n this.props.context.actionContext\n )\n .then(results => {\n this.setState({\n productResponse: results?.Product,\n productDimensions: results?.ProductDimensionFull,\n isQuickOrderGridFormExpanded: true\n });\n if (results?.Product) {\n this._updateQuantitiesInState(results.Product);\n }\n })\n .catch((error: Error) => {\n telemetry.exception(error);\n telemetry.debug('Unable to get scan results');\n });\n }, this._waitTime);\n\n setTimeout(() => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call -- Existing code.\n this._cancellabelDebounce();\n }, zeroNumber);\n this.setState({ isQuickOrderGridFormExpanded: true });\n } else {\n this.setState({ productResponse: undefined, isQuickOrderGridFormExpanded: true });\n }\n };\n\n /**\n * Method to called on quantity change.\n * @param value - Quantity value.\n */\n private readonly _handleQuantityChange = (value: string): void => {\n let currentValue = Number.parseInt(value, 10);\n const inputElement = this._quantityInput.current instanceof HTMLInputElement && this._quantityInput.current;\n const quantityChangeDebounceTimeout = 200;\n let minimumQuantity = 0;\n let needToUpdateUIValue: boolean = false;\n if (this._isOrderQuantityLimitsFeatureEnabled && !ObjectExtensions.isNullOrUndefined(this.state.productResponse?.Behavior)) {\n const behavior = this.state.productResponse!.Behavior;\n minimumQuantity = behavior?.MinimumQuantity ?? 0;\n const newCurrentValue = Math.max(currentValue, minimumQuantity);\n if (newCurrentValue !== currentValue) {\n needToUpdateUIValue = true;\n }\n currentValue = newCurrentValue;\n }\n\n this.setState({ quantity: currentValue }, () => {\n debounce(() => {\n if (needToUpdateUIValue && !Number.isNaN(this.state.quantity) && inputElement) {\n inputElement.setAttribute('aria-valuenow', currentValue.toString());\n inputElement.value = currentValue.toString();\n }\n }, quantityChangeDebounceTimeout)();\n });\n };\n\n /**\n * Method to get dropdwon name.\n * @param dimensionType - Dimension Type.\n * @param resources - String resources.\n * @returns Dropdwon label.\n */\n private readonly _getDropdownName = (dimensionType: number, resources: IProductDimensionConfigureResources): string => {\n const isGiftCard = this.state.productResponse?.IsGiftCard;\n\n switch (dimensionType) {\n case ProductDimensionType.Color: // ProductDimensionType.Color\n return resources.productDimensionTypeColor;\n case ProductDimensionType.Configuration: // ProductDimensionType.Configuration\n return resources.productDimensionTypeConfiguration;\n case ProductDimensionType.Size: // ProductDimensionType.Size\n return resources.productDimensionTypeSize;\n case ProductDimensionType.Style: // ProductDimensionType.Style\n return isGiftCard ? resources.productDimensionTypeAmount : resources.productDimensionTypeStyle;\n default:\n return '';\n }\n };\n\n /**\n * Method to update dimension and product in UI.\n */\n private readonly _updateDimensions = async (): Promise => {\n const {\n context: {\n actionContext,\n request: {\n apiSettings: { channelId }\n }\n }\n } = this.props;\n const { productDimensions, productResponse } = this.state;\n const hasProductDimensions = ArrayExtensions.hasElements(productDimensions);\n if (!productResponse || !hasProductDimensions) {\n return;\n }\n\n const dimensionsToUpdate: { [id: number]: string } = { ...this._dimensions };\n this.setState({ isUpdatingDimension: true });\n\n // Step 1: Update state to indicate which dimensions are selected\n if (this.state.productDimensionErrorState.otherError) {\n // eslint-disable-next-line react/no-access-state-in-setstate -- existing code.\n const clearOtherErrorState = { ...this.state.productDimensionErrorState };\n clearOtherErrorState.otherError = undefined;\n this.setState({ productDimensionErrorState: clearOtherErrorState });\n }\n\n // Step 2: Clear any errors indicating the dimension wasn't selected\n for (const dimensionKey of Object.keys(dimensionsToUpdate)) {\n if (this.state.productDimensionErrorState.configureErrors[dimensionKey]) {\n // eslint-disable-next-line react/no-access-state-in-setstate -- existing code.\n const errorState = { ...this.state.productDimensionErrorState };\n errorState.configureErrors[dimensionKey] = undefined;\n\n this.setState({ productDimensionErrorState: errorState });\n }\n }\n\n // Step 3, Build the actually selected dimensions, prioritizing the information in state\n // over the information in data\n const mappedDimensions = productDimensions\n ?.map(dimension => {\n return {\n DimensionTypeValue: dimension.DimensionTypeValue,\n DimensionValue:\n this._updateDimensionValue(dimension, dimensionsToUpdate[dimension.DimensionTypeValue]) ?? dimension.DimensionValue,\n ExtensionProperties: dimension.ExtensionProperties\n };\n })\n .filter(dimension => {\n return dimension.DimensionValue;\n });\n\n // Step 4. Use these dimensions hydrate the product. Wrap this in a promise\n // so that places like add to cart can await it\n // eslint-disable-next-line no-async-promise-executor -- existing code\n const selectedProduct = new Promise(async resolve => {\n const newProduct = await getSelectedVariant(\n new SelectedVariantInput(\n productResponse.MasterProductId ? productResponse.MasterProductId : productResponse.RecordId,\n channelId,\n mappedDimensions,\n undefined,\n this.props.context.request\n ),\n actionContext\n );\n if (newProduct) {\n await getDimensionsForSelectedVariant(\n new GetDimensionsForSelectedVariantInput(\n newProduct.MasterProductId ? newProduct.MasterProductId : newProduct.RecordId,\n channelId,\n mappedDimensions,\n this.props.context.request\n ),\n actionContext\n );\n }\n\n resolve(newProduct);\n });\n\n const variantProduct = await selectedProduct;\n this.setState({ productResponse: variantProduct !== null ? variantProduct : undefined });\n };\n\n /**\n * Method to get updated dimension value.\n * @param productDimensionFull - Product dimension full.\n * @param newValueId - New Dimension value.\n * @returns Dimension Value.\n */\n private readonly _updateDimensionValue = (\n productDimensionFull: IDimensionForSelectedVariant,\n newValueId: string | undefined\n ): ProductDimensionValue | undefined => {\n if (newValueId && productDimensionFull.DimensionValues) {\n return productDimensionFull.DimensionValues.find(dimension => dimension.RecordId === +newValueId);\n }\n\n return undefined;\n };\n\n /**\n * Method to get dropdwon name.\n * @param dimensionTypeValue - Dimension Type.\n * @param resources - String resources.\n * @param isGiftCard - Flag to check if its a giftcard product.\n * @returns Dropdwon error label.\n */\n private readonly _getDimensionErrorString = (\n dimensionTypeValue: number,\n resources: IQuickOrderGridResources,\n isGiftCard?: boolean\n ): string => {\n const amountErrorMessage = resources.quickOrderGridproductDimensionTypeAmountErrorMessage;\n\n switch (dimensionTypeValue) {\n case ProductDimensionType.Color: // ProductDimensionType.Color\n return resources.quickOrderGridproductDimensionTypeColorErrorMessage;\n case ProductDimensionType.Configuration: // ProductDimensionType.Configuration\n return resources.quickOrderGridproductDimensionTypeConfigurationErrorMessage;\n case ProductDimensionType.Size: // ProductDimensionType.Size\n return resources.quickOrderGridproductDimensionTypeSizeErrorMessage;\n case ProductDimensionType.Style: // ProductDimensionType.Style\n return isGiftCard ? amountErrorMessage : resources.quickOrderGridproductDimensionTypeStyleErrorMessage;\n default:\n return '';\n }\n };\n\n /**\n * Initial the products on quick order.\n * @param productResponse - Simple Product.\n * @param quantity - Product Quantity.\n * @returns Flag to validate productlistline.\n */\n private readonly _validateCart = (productResponse: SimpleProduct, quantity: number): boolean => {\n // eslint-disable-next-line @typescript-eslint/prefer-optional-chain -- existing code\n const missingDimensions = productResponse.Dimensions?.filter(\n dimension => !(dimension.DimensionValue && dimension.DimensionValue.Value)\n );\n const minimumQuantity = 0;\n if (ArrayExtensions.hasElements(missingDimensions)) {\n const userMessage = this._getConfigureErrors(missingDimensions, false);\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- existing code\n if (this.state.productDimensionErrorState.configureErrors) {\n // eslint-disable-next-line react/no-access-state-in-setstate -- existing code\n const errorState = { ...this.state.productDimensionErrorState };\n errorState.configureErrors = userMessage;\n\n this.setState({ productDimensionErrorState: errorState });\n return false;\n }\n }\n\n if (quantity <= minimumQuantity) {\n const resources = this.props.resources;\n this._updateStatusState(resources.quickOrderGridWrongQuantityErrorMsg, this._errorCssClass, this._errorCssGlyphClass, true);\n return false;\n }\n return true;\n };\n\n /**\n * Initial the products on quick order.\n * @param result - Simple Product.\n * @param isGiftCard - Product Quantity.\n * @returns Flag to validate cart.\n */\n private _getConfigureErrors(\n result: ProductDimension[] | undefined,\n isGiftCard?: boolean\n ): { [configureId: string]: string | undefined } {\n if (!result) {\n return {};\n }\n const dimensions: { [configureId: string]: string | undefined } = {};\n const resources = this.props.resources;\n for (const dimension of result) {\n dimensions[dimension.DimensionTypeValue] = this._getDimensionErrorString(dimension.DimensionTypeValue, resources, isGiftCard);\n }\n return dimensions;\n }\n\n /**\n * Method to call on quantity change in row.\n * @param itemKey - Product Key.\n * @param quantity - Product quantity.\n * @returns Flag to update status.\n */\n private readonly _changeRowQuantity = (itemKey: string | undefined, quantity: number): boolean => {\n const { context, data, telemetry } = this.props;\n const { quickOrderTemplate } = data;\n if (quickOrderTemplate?.result) {\n const quickOrderTemplateLinesData = quickOrderTemplate.result.quickOrderTemplateLines;\n if (ArrayExtensions.hasElements(quickOrderTemplateLinesData)) {\n const orderLineIndex = quickOrderTemplateLinesData.findIndex(\n (lines: QuickOrderTemplateLine) => lines.productListLine.LineId === itemKey\n );\n const newProductListLine = { ...quickOrderTemplateLinesData[orderLineIndex] };\n if (quickOrderTemplateLinesData[orderLineIndex].productListLine.Quantity === quantity) {\n return true;\n }\n const previousQuantity = newProductListLine.productListLine.Quantity;\n newProductListLine.productListLine.Quantity = quantity;\n const { fullProduct, ...line } = newProductListLine;\n\n ProductListsDataActions.updateProductListLinesAsync(\n { callerContext: context.actionContext },\n quickOrderTemplate.result.productList.Id,\n [line.productListLine]\n )\n .then(list => {\n if (ArrayExtensions.hasElements(list)) {\n const newLine = list.find(lines => lines.LineId === itemKey);\n quickOrderTemplateLinesData[orderLineIndex].productListLine = newLine!;\n const updatedLines = [...quickOrderTemplateLinesData];\n updatedLines[orderLineIndex] = { fullProduct, productListLine: newLine! };\n const updatedProductList = { ...quickOrderTemplate.result, ProductListLines: updatedLines };\n context.actionContext.update(\n new ActiveProductListInput(context.actionContext.requestContext),\n updatedProductList\n );\n return true;\n }\n\n return false;\n })\n .catch((error: Error) => {\n telemetry.warning('[quick-order-grid] Unable to update product quantity.');\n telemetry.error(error.message);\n const userMessage = 'Failed to update quantity value.';\n newProductListLine.productListLine.Quantity = previousQuantity;\n this._updateStatusState(userMessage, this._errorCssClass, this._errorCssGlyphClass, true);\n return false;\n });\n }\n return false;\n }\n\n return false;\n };\n\n /**\n * Method to call on remove item from table.\n * @param line - Order Template Line.\n */\n private readonly _removeItemRowFromTable = (line: QuickOrderTemplateLine): void => {\n const { context, data, telemetry } = this.props;\n const { quickOrderTemplate } = data;\n\n if (quickOrderTemplate?.result) {\n const userToken = context.request.user.isAuthenticated && context.request.user.token;\n if (userToken) {\n ProductListsDataActions.removeProductListLinesAsync(\n { callerContext: context.actionContext },\n line.productListLine.ProductListId!,\n [line.productListLine]\n )\n .then(() => {\n window.location.reload(false);\n })\n .catch((error: Error) => {\n telemetry.warning('[quick-order-grid] Unable remove item from product list grid');\n telemetry.error(error.message);\n });\n } else {\n telemetry.warning('[quick-order-grid] Unable remove items from product list grid user token was not found');\n }\n }\n };\n\n private readonly _isChannelMultipleCatalogsFeatureEnabled = (): boolean => {\n let isMultipleCatalogFeatureEnabledInHq = false;\n if (this.props.data.featureState) {\n isMultipleCatalogFeatureEnabledInHq =\n this.props.data.featureState.result?.find(\n feature => feature.Name === 'Dynamics.AX.Application.ChannelMultipleCatalogsFeature'\n )?.IsEnabled || false;\n }\n return isMultipleCatalogFeatureEnabledInHq;\n };\n\n /**\n * Method to call on add item from form.\n */\n private readonly _addItemToProductListLine = async (): Promise => {\n const {\n context: { actionContext },\n resources,\n telemetry\n } = this.props;\n const {\n quickOrderGridAddedToGridSuccessMessage,\n quickOrderGridAddedToGridFailureMessage,\n quickOrderGridAddedToGridDuplicateError\n } = resources;\n const { productResponse, quantity, productListId } = this.state;\n // get the current catalog id.\n const catalogId = getCatalogId(this.props.context.request);\n\n this._updateStatusState('', '', '', false);\n\n if (productResponse !== undefined && this._validateCart(productResponse, quantity)) {\n if (StringExtensions.isNullOrWhitespace(productListId)) {\n await this._createProductList();\n }\n\n if (StringExtensions.isNullOrWhitespace(this.state.productListId)) {\n this._updateStatusState(quickOrderGridAddedToGridFailureMessage, this._errorCssClass, this._errorCssGlyphClass, true);\n return;\n }\n const input = new AddItemToProductListInput(\n this.state.productListId,\n productResponse.RecordId,\n quantity,\n productResponse.DefaultUnitOfMeasure ?? 'ea',\n this._isChannelMultipleCatalogsFeatureEnabled(),\n catalogId\n );\n\n await addItemToProductListAction(input, actionContext)\n .then(result => {\n if (result.ProductListId) {\n this._updateStatusState(quickOrderGridAddedToGridSuccessMessage, 'success', 'fas fa-check', true);\n window.location.reload();\n this.setState({});\n }\n })\n .catch((error: Error) => {\n telemetry.debug('[quick-order-grid] Error trying to Update Grid Line from the quick order grid');\n if (error.name === 'Microsoft_Dynamics_Commerce_Runtime_DuplicateObject') {\n this._updateStatusState(\n quickOrderGridAddedToGridDuplicateError,\n this._errorCssClass,\n this._errorCssGlyphClass,\n true\n );\n } else {\n this._updateStatusState(\n quickOrderGridAddedToGridFailureMessage,\n this._errorCssClass,\n this._errorCssGlyphClass,\n true\n );\n }\n });\n }\n };\n\n /**\n * Method to create product list.\n * @returns - ProductListId.\n */\n private _createProductList = async (): Promise => {\n const {\n context: { actionContext },\n telemetry,\n resources\n } = this.props;\n const { productListId } = this.state;\n const { quickOrderGridAddedToGridFailureMessage } = resources;\n\n if (StringExtensions.isNullOrWhitespace(productListId)) {\n const input = new CreateProductListInput('', ProductListType.QuickOrder);\n\n await createProductList(input, actionContext)\n .then(result => {\n if (!StringExtensions.isNullOrWhitespace(result.Id)) {\n this.setState({ productListId: result.Id });\n return result.Id;\n }\n return '';\n })\n .catch((error: Error) => {\n telemetry.debug('[quick-order-grid] Error on creating productlist from quick order grid');\n telemetry.error(error.message);\n this._updateStatusState(quickOrderGridAddedToGridFailureMessage, this._errorCssClass, this._errorCssGlyphClass, true);\n return '';\n });\n return '';\n }\n\n return productListId;\n };\n\n /**\n * Method to create product list.\n * @param messageText - Message Text.\n * @param statusCssString - Css class names.\n * @param messageGlyph - Glyph string.\n * @param isOpen - Flag to show.\n */\n private readonly _updateStatusState = (messageText: string, statusCssString: string, messageGlyph: string, isOpen: boolean): void => {\n this.setState({\n // eslint-disable-next-line react/no-unused-state -- Showing user message in Form component.\n stateMessage: {\n messageText,\n statusCssString,\n messageGlyph,\n isOpen\n }\n });\n };\n}\nexport default QuickOrderGrid;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IErrorState } from '@msdyn365-commerce/components';\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { IDimensionForSelectedVariant, OrderTemplateLine } from '@msdyn365-commerce-modules/retail-actions';\n\nimport { QuickOrderGridProduct } from './quick-order-grid-product';\n\n/**\n * QuickOrderGrid state message Interface.\n */\nexport interface IQuickOrderGridStateMessage {\n isOpen: boolean;\n messageGlyph: string;\n messageText: string;\n statusCssString: string;\n}\n\n/**\n * QuickOrderGrid state Interface.\n */\nexport interface IQuickOrderGridState {\n isQuickOrderGridFormExpanded: boolean;\n isUpdatingDimension?: boolean;\n productResponse: SimpleProduct | undefined;\n productDimensions: IDimensionForSelectedVariant[] | undefined;\n min: number | undefined;\n max: number | undefined;\n quantity: number;\n stateMessage?: IQuickOrderGridStateMessage;\n topStateMessage?: IQuickOrderGridStateMessage;\n productDimensionErrorState: IErrorState;\n isMobile: boolean;\n products: OrderTemplateLine[];\n productListId: string;\n}\n\n/**\n * QuickOrder Grid Row view.\n */\nexport interface IQuickOrderGridRowViewModel extends OrderTemplateLine {\n isChecked: boolean;\n}\n\n/**\n * Interface for quick order callbacks.\n */\nexport interface IQuickOrderGridRowCallbacks {\n onRemoveItem(line: QuickOrderGridProduct): void;\n onChangeQuantity(orderTemplateLineId: string | undefined, quantity: number): boolean;\n}\n\n/**\n * Interface for quick order grid action view props.\n */\nexport interface IQuickOrderGridActionsViewProps {\n addProductListToBag: React.ReactNode;\n removeProductList?: React.ReactNode;\n userMessage?: React.ReactNode;\n}\n\nexport const RetailDefaultOrderQuantityLimitsFeatureName: string = 'Dynamics.AX.Application.RetailDefaultOrderQuantityLimitsFeature';\n\nexport const EcommerceQuantityLimitConfigurationsFeatureName: string =\n 'Dynamics.AX.Application.EcommerceQuantityLimitConfigurationsFeature';\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 Msdyn365 from '@msdyn365-commerce/core';\r\nimport { Address, AddressPurpose, CountryRegionInfo, StateProvinceInfo } from '@msdyn365-commerce/retail-proxy';\r\nimport { format as formatNotification, getTelemetryObject, IModuleProps, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport { action, observable, reaction, set } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\n\r\nimport { AutoSuggest } from '@msdyn365-commerce-modules/address';\r\nimport { IAutoSuggestOptions } from '@msdyn365-commerce-modules/address';\r\nimport { AddressCommon } from '@msdyn365-commerce-modules/address';\r\nimport { AddressFormat } from '@msdyn365-commerce-modules/address';\r\nimport { AddressItemType } from '@msdyn365-commerce-modules/address';\r\nimport { AddressMetaData } from '@msdyn365-commerce-modules/address';\r\nimport { AddressOperation, AddressType, IAddressResource, IAddressResponse } from '@msdyn365-commerce-modules/address';\r\nimport { AddressAddUpdate, IAddressAddUpdateProps } from '@msdyn365-commerce-modules/address';\r\nimport { AddressList, IAddressListProps } from '@msdyn365-commerce-modules/address';\r\nimport { IB2bAccountManagementAddressData } from './b2b-account-management-address.data';\r\nimport { IB2bAccountManagementAddressProps } from './b2b-account-management-address.props.autogenerated';\r\n\r\n/**\r\n * Account management address view state interface.\r\n */\r\nexport interface IAccountManagementAddressViewState {\r\n isShowAddresList: boolean;\r\n isShowAddOrUpdateAddress: boolean;\r\n}\r\n\r\n/**\r\n * Account management address view state interface.\r\n */\r\nexport interface IAccountManagementAddressViewProps\r\n extends React.Component> {\r\n className: string;\r\n currentOperation: AddressOperation;\r\n selectedAddress?: Address;\r\n addUpdateAddress: Address;\r\n countryRegionId: string;\r\n stateProvinceInfo?: StateProvinceInfo[];\r\n customerAddresses: Address[];\r\n validationError: object;\r\n addressActionResponse?: IAddressResponse;\r\n viewState: IAccountManagementAddressViewState;\r\n AccountAddressManagement: IModuleProps;\r\n isUpdating: boolean;\r\n showAddressList: IAddressListProps;\r\n showAddOrUpdateAddress: IAddressAddUpdateProps;\r\n screenReaderNotification: React.ReactNode;\r\n shouldRenderEditAddressButton: boolean;\r\n}\r\n\r\n/**\r\n *\r\n * Address component.\r\n * @extends {React.Component>}\r\n */\r\n@observer\r\nclass AccountManagementAddress extends React.Component> {\r\n @observable private currentOperation: AddressOperation;\r\n\r\n @observable private selectedAddress?: Address;\r\n\r\n @observable private countryRegionId: string = 'USA';\r\n\r\n @observable private stateProvinceInfo?: StateProvinceInfo[];\r\n\r\n @observable private customerAddresses: Address[];\r\n\r\n @observable private addUpdateAddress: Address;\r\n\r\n @observable private validationError: object;\r\n\r\n @observable private addressActionResponse?: IAddressResponse;\r\n\r\n @observable private isUpdating?: boolean;\r\n\r\n @observable private hasError?: boolean;\r\n\r\n @observable private removeAddressData?: Address;\r\n\r\n private readonly addressCommon: AddressCommon;\r\n\r\n private addressFormat: AddressFormat;\r\n\r\n private countryRegions: CountryRegionInfo[] = [];\r\n\r\n private addressPurposes: AddressPurpose[] = [];\r\n\r\n private readonly resources: IAddressResource;\r\n\r\n private readonly defaultAddressType: number = 6; // Default to Home\r\n\r\n private readonly telemetryContent: ITelemetryContent;\r\n\r\n private autoSuggest?: AutoSuggest;\r\n\r\n public constructor(props: IB2bAccountManagementAddressProps) {\r\n super(props);\r\n const { context, data, resources, telemetry } = this.props;\r\n\r\n this.resources = resources;\r\n this.currentOperation = AddressOperation.List;\r\n this.countryRegions = data.countryRegions.result || [];\r\n this.addressPurposes = data.addressPurposes.result || [];\r\n this.customerAddresses = data.address.result || [];\r\n this.addUpdateAddress = {};\r\n this.validationError = {};\r\n this.addressCommon = new AddressCommon(context, resources, telemetry);\r\n this.addressFormat = new AddressFormat(\r\n this.countryRegions,\r\n new AddressMetaData({ ...resources }, this._getAddressFormatExcludeList()),\r\n // Filter out the Invoice address for the add/update form\r\n this.addressPurposes.filter((address: AddressPurpose) => address.AddressType !== 1)\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 }\r\n\r\n /**\r\n * On Suggestion Selected Function.\r\n * @param result - Microsoft.Maps.ISuggestionResult.\r\n */\r\n @action\r\n private readonly _onSuggestionSelected = async (result: Microsoft.Maps.ISuggestionResult): Promise => {\r\n this._clearAddressFields();\r\n const address = this.addressFormat.getTranformedAddress(result, this.stateProvinceInfo);\r\n set(this.addUpdateAddress, { Street: '' });\r\n set(this.addUpdateAddress, { ZipCode: address.ZipCode });\r\n set(this.addUpdateAddress, { CountyName: address.CountyName });\r\n set(this.addUpdateAddress, { City: address.City });\r\n set(this.addUpdateAddress, { State: address.State });\r\n set(this.addUpdateAddress, { DistrictName: address.DistrictName });\r\n set(this.addUpdateAddress, { FullAddress: address.FullAddress });\r\n\r\n // Bing autosuggest put the complete address in the Street input box. Updating the street input box to show only street address.\r\n setTimeout(() => {\r\n set(this.addUpdateAddress, { Street: address.Street });\r\n }, 0);\r\n };\r\n\r\n /**\r\n * Clear Address Fields.\r\n */\r\n @action\r\n private readonly _clearAddressFields = (): void => {\r\n const addressFormatItem = this.addressFormat.getAddressFormat(\r\n this.addUpdateAddress.ThreeLetterISORegionName || this.countryRegionId\r\n );\r\n addressFormatItem.forEach(format => {\r\n if (this.addUpdateAddress[format.name] !== undefined && !this.autoSuggest?.excludedAddressFields.includes(format.name)) {\r\n this.addressFormat[format.name] = '';\r\n }\r\n });\r\n this._clearValidation();\r\n };\r\n\r\n /**\r\n * Clear Validation Function.\r\n */\r\n @action\r\n private readonly _clearValidation = (): void => {\r\n this.validationError = {};\r\n };\r\n\r\n public async componentDidMount(): Promise {\r\n const {\r\n context: {\r\n telemetry,\r\n actionContext: {\r\n requestContext: { channel }\r\n }\r\n },\r\n config: { autoSuggestionEnabled, autoSuggestOptions }\r\n } = this.props;\r\n\r\n // Initializing data props\r\n this._dataInitialize(this.props);\r\n\r\n void this.props.data.countryRegions.then(() => {\r\n this._setDefaultCountryRegionId();\r\n });\r\n\r\n reaction(\r\n () => this.countryRegionId,\r\n () => {\r\n this._getStateProvinces();\r\n }\r\n );\r\n\r\n reaction(\r\n () => this.currentOperation,\r\n () => {\r\n this._getStateProvinces();\r\n }\r\n );\r\n\r\n if (autoSuggestionEnabled) {\r\n if (channel && !channel.BingMapsApiKey) {\r\n telemetry.error('BingMapsApiKey is missing.');\r\n return;\r\n }\r\n\r\n if (channel && !channel.BingMapsEnabled) {\r\n telemetry.error('Map is disabled from HQ.');\r\n return;\r\n }\r\n\r\n const options: IAutoSuggestOptions = { ...autoSuggestOptions };\r\n this.autoSuggest = new AutoSuggest(\r\n telemetry,\r\n options,\r\n channel?.BingMapsApiKey,\r\n channel?.ChannelCountryRegionISOCode,\r\n channel?.DefaultLanguageId\r\n );\r\n\r\n reaction(\r\n () =>\r\n this.props.data.storeSelectorStateManager.result?.loadMapApi !== undefined &&\r\n (this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update),\r\n async () => {\r\n await this.autoSuggest?._loadMapAPI(await this.props.data.storeSelectorStateManager);\r\n }\r\n );\r\n\r\n reaction(\r\n () => {\r\n this.props.data.storeSelectorStateManager.result?.isMapApiLoaded;\r\n },\r\n async () => {\r\n if (this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update) {\r\n await this._attachMapAutoSuggest();\r\n }\r\n }\r\n );\r\n }\r\n }\r\n\r\n /**\r\n * Component did mount function.\r\n */\r\n public async componentDidUpdate(): Promise {\r\n if (this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update) {\r\n if (this.props.data.storeSelectorStateManager.result?.isMapApiLoaded) {\r\n await this._attachMapAutoSuggest();\r\n }\r\n } else {\r\n this.autoSuggest?.disposeAutoSuggest();\r\n }\r\n }\r\n\r\n /**\r\n * Should component update function.\r\n * @param nextProps - Account management address props.\r\n * @param nextState - Next state.\r\n * @returns - True if component should update, false otherwise.\r\n */\r\n public shouldComponentUpdate(\r\n nextProps: IB2bAccountManagementAddressProps,\r\n nextState: IAccountManagementAddressViewState\r\n ): boolean {\r\n if (this.state === nextState && this.props.data === nextProps.data) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n public render(): JSX.Element {\r\n const { renderView, config } = this.props;\r\n\r\n const viewProps = {\r\n ...this.props,\r\n currentOperation: this.currentOperation,\r\n selectedAddress: this.selectedAddress,\r\n addUpdateAddress: this.addUpdateAddress,\r\n countryRegionId: this.countryRegionId,\r\n stateProvinceInfo: this.stateProvinceInfo,\r\n customerAddresses: this.customerAddresses,\r\n validationError: this.validationError,\r\n addressActionResponse: this.addressActionResponse,\r\n isUpdating: this.isUpdating,\r\n hasError: this.hasError,\r\n className: config.className,\r\n viewState: {\r\n isShowAddresList: this.currentOperation === AddressOperation.List,\r\n isShowAddOrUpdateAddress: this.currentOperation !== AddressOperation.List\r\n },\r\n AccountAddressManagement: {\r\n moduleProps: this.props,\r\n className: classnames('ms-account-management-address', config.className)\r\n },\r\n showAddressList: this._renderListAddress(),\r\n showAddOrUpdateAddress: this._renderAddOrUpdateAddress(),\r\n screenReaderNotification: this.removeAddressData ? this._renderScreenReaderRemoveText(this.removeAddressData) : null,\r\n shouldRenderEditAddressButton: this.props.config.enableEditAddress\r\n };\r\n\r\n return renderView(viewProps) as React.ReactElement;\r\n }\r\n\r\n /**\r\n * Method data initialization.\r\n * @param props -The account management props.\r\n */\r\n private readonly _dataInitialize = (props: IB2bAccountManagementAddressProps): void => {\r\n const { data } = props;\r\n\r\n reaction(\r\n () => data.countryRegions.result,\r\n () => {\r\n this.countryRegions = data.countryRegions.result ?? [];\r\n }\r\n );\r\n\r\n reaction(\r\n () => data.addressPurposes.result,\r\n () => {\r\n this.addressPurposes = data.addressPurposes.result ?? [];\r\n }\r\n );\r\n\r\n reaction(\r\n () => data.address.result,\r\n () => {\r\n this.customerAddresses = data.address.result ?? [];\r\n }\r\n );\r\n };\r\n\r\n /**\r\n * Render Add Or Update Address Function.\r\n * @returns - AddressAddUpdate.\r\n */\r\n private readonly _renderAddOrUpdateAddress = (): IAddressAddUpdateProps => {\r\n return AddressAddUpdate({\r\n isUpdating: this.isUpdating,\r\n resources: this.resources,\r\n addressType: AddressType.Shipping,\r\n addressFormat: this.addressFormat.getAddressFormat(this.addUpdateAddress.ThreeLetterISORegionName || this.countryRegionId),\r\n defaultCountryRegionId: this.countryRegionId,\r\n defaultAddressType: this.defaultAddressType,\r\n selectedAddress: this.addUpdateAddress,\r\n validationError: this.validationError,\r\n addressActionResponse: this.addressActionResponse,\r\n dropdownDisplayData: this.addressFormat.getPrefilledAddressDropdownData(\r\n this.resources.addressStateDefaultSelectionText,\r\n this.stateProvinceInfo\r\n ),\r\n telemetryContent: this.telemetryContent,\r\n onInputChange: this._onAddressAddUpdateInputChange,\r\n onDropdownChange: this._onAddressAddUpdateDropdownChange,\r\n onSave: this._onAddressAddUpdateSubmit,\r\n onCancel: this._resetView\r\n });\r\n };\r\n\r\n /**\r\n * Render List Address Function.\r\n * @returns - AddressList.\r\n */\r\n private readonly _renderListAddress = (): IAddressListProps => {\r\n const { config } = this.props;\r\n\r\n /**\r\n * Render Address ttitle.\r\n * @param event - Msdyn365.ContentEditableEvent.\r\n */\r\n const handleLineItemHeadingChange = (event: Msdyn365.ContentEditableEvent) => {\r\n config.heading!.text = event.target.value;\r\n };\r\n const heading = config.heading && {\r\n text: config.heading.text,\r\n headingTag: config.heading.tag\r\n };\r\n\r\n return AddressList({\r\n isUpdating: this.isUpdating,\r\n selectedAddress: this.selectedAddress,\r\n addressFormat: this.addressFormat,\r\n addresses: this.customerAddresses,\r\n addressPurposes: this.addressPurposes,\r\n resources: this.resources,\r\n heading,\r\n primaryAddressSectionHeading: config.primaryAddressSectionHeading,\r\n otherAddressSectionHeading: config.otherAddressSectionHeading,\r\n contextRequest: this.props.context.request,\r\n telemetryContent: this.telemetryContent,\r\n handleLineItemHeadingChange,\r\n onEditAddress: this._goToEditAddress,\r\n onRemoveAddress: this._onRemoveAddress,\r\n onAddAddress: this._goToAddAddress,\r\n onUpdatePrimaryAddress: this._onSubmitUpdatePrimaryAddress\r\n });\r\n };\r\n\r\n /**\r\n * Attach Map Auto Suggest Function.\r\n */\r\n private readonly _attachMapAutoSuggest = async (): Promise => {\r\n const {\r\n data: {\r\n storeSelectorStateManager: { result: storeSelectorStateManager }\r\n }\r\n } = this.props;\r\n\r\n if (storeSelectorStateManager?.isMapApiLoaded) {\r\n this.autoSuggest?.attachAutoSuggest('#shipping_addressstreet', '#shipping_addressstreet_container', this._onSuggestionSelected);\r\n }\r\n };\r\n\r\n /**\r\n * On Address Add Update Function.\r\n * @param name - String.\r\n * @param value - String | Boolean | Number.\r\n */\r\n private readonly onAddressAddUpdate = (name: string, value: string | boolean | number) => {\r\n set(this.addUpdateAddress, { [name]: value });\r\n this.addressFormat.validateAddressFormat(this.addUpdateAddress, this.validationError, this.countryRegionId, name);\r\n };\r\n\r\n /**\r\n * On Address Add Update Input Change.\r\n * @param event - Input Change Event.\r\n */\r\n private readonly _onAddressAddUpdateInputChange = (event: React.ChangeEvent): void => {\r\n if (event.target.type === 'checkbox') {\r\n this.onAddressAddUpdate(event.target.name, event.target.checked);\r\n } else {\r\n const value = (event.target.value || '').replace(new RegExp('[<>]', 'gi'), '');\r\n this.onAddressAddUpdate(event.target.name, value);\r\n }\r\n };\r\n\r\n /**\r\n * On Address Add Update Dropdown Change.\r\n * @param event - Dropdown Change Event.\r\n */\r\n private readonly _onAddressAddUpdateDropdownChange = (event: React.ChangeEvent): void => {\r\n if (event.target.name === AddressItemType[AddressItemType.AddressTypeValue]) {\r\n this.onAddressAddUpdate(event.target.name, +event.target.value);\r\n } else {\r\n this.onAddressAddUpdate(event.target.name, event.target.value);\r\n }\r\n if (event.target.name === AddressItemType[AddressItemType.ThreeLetterISORegionName]) {\r\n this._onCountryChange(event.target.value);\r\n }\r\n };\r\n\r\n /**\r\n * On Address Update Function.\r\n * @param response - Promise.\r\n * @param onSuccess - IAddressResponse.\r\n */\r\n private readonly _onAddressUpdate = (response: Promise, onSuccess: (response: IAddressResponse) => void): void => {\r\n this.isUpdating = true;\r\n response.then(\r\n (result: IAddressResponse) => {\r\n if (result.address) {\r\n this.hasError = false;\r\n onSuccess(result);\r\n } else {\r\n this.hasError = true;\r\n this.addressActionResponse = result;\r\n }\r\n this.isUpdating = false;\r\n },\r\n () => {\r\n this.hasError = true;\r\n this.isUpdating = false;\r\n }\r\n );\r\n };\r\n\r\n /**\r\n * On Address Add Update Submit Function.\r\n */\r\n private readonly _onAddressAddUpdateSubmit = (): void => {\r\n if (!this.addressFormat.validateAddressFormat(this.addUpdateAddress, this.validationError, this.countryRegionId)) {\r\n return;\r\n }\r\n let response: Promise;\r\n if (this.addressCommon.isAuthenticatedFlow()) {\r\n response =\r\n this.currentOperation === AddressOperation.Update\r\n ? this.addressCommon.updateCustomerAddress(this.addUpdateAddress)\r\n : this.addressCommon.addCustomerAddress(this.addUpdateAddress);\r\n } else {\r\n response = Promise.resolve({ address: this.addUpdateAddress });\r\n }\r\n\r\n this._onAddressUpdate(response, this._onAddOrUpdateSuccess);\r\n };\r\n\r\n /**\r\n * On Country Change Function.\r\n * @param countryRegionId - String.\r\n */\r\n private readonly _onCountryChange = (countryRegionId: string) => {\r\n this.countryRegionId = countryRegionId;\r\n const twoLetterISORegionName = this.addressFormat.getTwoLetterISORegionName(countryRegionId);\r\n set(this.addUpdateAddress, { ThreeLetterISORegionName: countryRegionId });\r\n set(this.addUpdateAddress, { TwoLetterISORegionName: twoLetterISORegionName });\r\n this.autoSuggest?.changeAutoSuggestionCountryCode(twoLetterISORegionName);\r\n this._clearAddressFields();\r\n };\r\n\r\n /**\r\n * Get Address Format Exclude List Function.\r\n * @returns - Address Format Exclude List.\r\n */\r\n private readonly _getAddressFormatExcludeList = (): AddressItemType[] => {\r\n const { config } = this.props;\r\n const addressFormatExcludeList: AddressItemType[] = [];\r\n\r\n if (!config.showAddressType) {\r\n addressFormatExcludeList.push(AddressItemType.AddressTypeValue);\r\n }\r\n\r\n addressFormatExcludeList.push(AddressItemType.IsPrimary);\r\n\r\n return addressFormatExcludeList;\r\n };\r\n\r\n /**\r\n * Get State Provinces Function.\r\n */\r\n private readonly _getStateProvinces = (): void => {\r\n if (\r\n !this.countryRegionId ||\r\n !(this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update)\r\n ) {\r\n return;\r\n }\r\n\r\n void this.addressCommon.getStateProvinces(this.countryRegionId).then((result: StateProvinceInfo[]) => {\r\n const stateInfo = result.some(state => state.StateId === this.addUpdateAddress.State);\r\n\r\n // Reset state if selected state not found in the list.\r\n if (!stateInfo) {\r\n set(this.addUpdateAddress, { State: '' });\r\n }\r\n this.stateProvinceInfo = result;\r\n });\r\n };\r\n\r\n private _setDefaultCountryRegionId(): void {\r\n const { request } = this.props.context;\r\n const market = request && request.channel && request.channel.ChannelCountryRegionISOCode;\r\n\r\n this.countryRegionId = this.addressCommon.getDefaultCountryRegionId(this.countryRegionId, this.countryRegions, market);\r\n }\r\n\r\n /**\r\n * Update CurrentOperation Function.\r\n * @param operation - AddressOperation.\r\n */\r\n private readonly _updateCurrentOperation = (operation: AddressOperation) => {\r\n this.currentOperation = operation;\r\n this._clearAddressFields();\r\n };\r\n\r\n /**\r\n * On Submit Update Primary Address Function.\r\n * @param address - Address.\r\n */\r\n private readonly _onSubmitUpdatePrimaryAddress = (address: Address): void => {\r\n this.selectedAddress = address;\r\n const response = this.addressCommon.updateCustomerPrimaryAddress(address);\r\n this._onAddressUpdate(response, this._onUpdatePrimaryAddressSuccess);\r\n };\r\n\r\n /**\r\n * Go To Edit Address Function.\r\n * @param address - Address.\r\n */\r\n private readonly _goToEditAddress = (address: Address): void => {\r\n this.addUpdateAddress = { ...address };\r\n this.countryRegionId = this.addUpdateAddress.ThreeLetterISORegionName || 'USA';\r\n this._updateCurrentOperation(AddressOperation.Update);\r\n };\r\n\r\n /**\r\n * On Remove Address Function.\r\n * @param address - Address.\r\n */\r\n private readonly _onRemoveAddress = (address: Address): void => {\r\n address.Deactivate = true;\r\n this.removeAddressData = address;\r\n const response = this.addressCommon.updateCustomerAddress(address);\r\n this._onAddressUpdate(response, this._onAddOrUpdateSuccess);\r\n };\r\n\r\n /**\r\n * Renders Notification screen reader text for removed address.\r\n * @param address - Address input.\r\n * @returns Notification for removed address.\r\n */\r\n private readonly _renderScreenReaderRemoveText = (address: Address): React.ReactNode => {\r\n const notification = formatNotification(this.resources.removeAddressNotification!, `${address.Name!}`);\r\n return (\r\n
\r\n {notification}\r\n
\r\n );\r\n };\r\n\r\n /**\r\n * Go To Add Address Function.\r\n */\r\n private readonly _goToAddAddress = (): void => {\r\n this.addUpdateAddress = {};\r\n this._setDefaultCountryRegionId();\r\n set(this.addUpdateAddress, { ThreeLetterISORegionName: this.countryRegionId });\r\n set(this.addUpdateAddress, { AddressTypeValue: this.defaultAddressType });\r\n this._setDefaultCountryRegionId();\r\n this._updateCurrentOperation(AddressOperation.Add);\r\n };\r\n\r\n /**\r\n * On Add Or Update Success Function.\r\n * @param response - IAddressResponse.\r\n */\r\n private readonly _onAddOrUpdateSuccess = (response: IAddressResponse): void => {\r\n if (response.customerAddresses) {\r\n this.customerAddresses = response.customerAddresses;\r\n }\r\n this._resetView();\r\n };\r\n\r\n /**\r\n * On Update Primary Address Success Function.\r\n * @param response - IAddressResponse.\r\n */\r\n private readonly _onUpdatePrimaryAddressSuccess = (response: IAddressResponse): void => {\r\n if (response.customerAddresses) {\r\n this.customerAddresses = response.customerAddresses;\r\n }\r\n };\r\n\r\n /**\r\n * Reset view function.\r\n */\r\n private readonly _resetView = (): void => {\r\n this.selectedAddress = undefined;\r\n this._updateCurrentOperation(AddressOperation.List);\r\n };\r\n}\r\n\r\nexport default AccountManagementAddress;\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 { IGiftCardExtend } from '@msdyn365-commerce/global-state';\r\nimport { Address, AddressPurpose, CountryRegionInfo, StateProvinceInfo } from '@msdyn365-commerce/retail-proxy';\r\nimport { IModuleStateProps, withModuleState } from '@msdyn365-commerce-modules/checkout-utilities';\r\nimport { IModuleProps } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport { computed, observable, reaction, set } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\n\r\nimport {\r\n AddressBillingHeading,\r\n AddressCommon,\r\n AddressFormat,\r\n AddressItemType,\r\n AddressMetaData,\r\n AddressOperation,\r\n AddressShow,\r\n IAddressAddUpdateProps,\r\n IAddressResponse,\r\n IAddressShowProps\r\n} from '@msdyn365-commerce-modules/address';\r\nimport { IB2bCheckoutBillingAddressData } from './b2b-checkout-billing-address.data';\r\nimport { IB2bCheckoutBillingAddressProps } from './b2b-checkout-billing-address.props.autogenerated';\r\n\r\n/**\r\n * Props interface.\r\n */\r\nexport interface IProps extends IB2bCheckoutBillingAddressProps, IModuleStateProps {}\r\n\r\nexport interface ICheckoutState {\r\n errorMessage: string | undefined;\r\n}\r\n\r\n/**\r\n * Checkout billing address view state interface.\r\n */\r\nexport interface ICheckoutBillingAddressViewState {\r\n isShowAddress: boolean;\r\n isError: boolean;\r\n}\r\n\r\n/**\r\n * Checkout billing address view props interface.\r\n */\r\nexport interface ICheckoutBillingAddressViewProps extends IProps {\r\n className: string;\r\n currentOperation: AddressOperation;\r\n selectedAddress?: Address;\r\n addUpdateAddress: Address;\r\n countryRegionId: string;\r\n stateProvinceInfo?: StateProvinceInfo[];\r\n validationError: object;\r\n addressActionResponse?: IAddressResponse;\r\n viewState: ICheckoutBillingAddressViewState;\r\n CheckoutBillingAddress: IModuleProps;\r\n sameAsShippingCheckbox: React.ReactNode;\r\n heading: React.ReactNode;\r\n showAddress: IAddressShowProps;\r\n showAddOrUpdateAddress: IAddressAddUpdateProps;\r\n error: React.ReactNode;\r\n}\r\n\r\n/**\r\n *\r\n * CheckoutBillingAddress component.\r\n * @extends {React.PureComponent>}\r\n */\r\n// @ts-expect-error\r\n@withModuleState\r\n@observer\r\nclass CheckoutBillingAddress extends React.Component {\r\n @observable private currentOperation: AddressOperation;\r\n\r\n @observable private isBillingAddressSameAsShipping: boolean;\r\n\r\n @observable private selectedAddress?: Address;\r\n\r\n @observable private addUpdateAddress: Address;\r\n\r\n @observable private countryRegionId: string = 'USA';\r\n\r\n @observable private stateProvinceInfo?: StateProvinceInfo[];\r\n\r\n @observable private validationError: object;\r\n\r\n @observable private readonly addressActionResponse?: IAddressResponse;\r\n\r\n private readonly addressCommon: AddressCommon;\r\n\r\n private addressFormat: AddressFormat;\r\n\r\n private countryRegions: CountryRegionInfo[] = [];\r\n\r\n private addressPurposes: AddressPurpose[] = [];\r\n\r\n private addresses: Address[];\r\n\r\n private readonly defaultAddressType: number = 6; // Default to Home\r\n\r\n public constructor(props: IProps) {\r\n super(props);\r\n this.state = { errorMessage: undefined };\r\n const { context, data, resources, telemetry } = this.props;\r\n\r\n this.addUpdateAddress = {};\r\n this.validationError = {};\r\n this.isBillingAddressSameAsShipping = false;\r\n this.currentOperation = AddressOperation.List;\r\n this.addressPurposes = data.addressPurposes.result || [];\r\n this.addresses = data.address.result || [];\r\n this.countryRegions = data.countryRegions.result || [];\r\n this.stateProvinceInfo = data.countryStates.result || [];\r\n this.addressCommon = new AddressCommon(context, resources, telemetry);\r\n this.addressFormat = new AddressFormat(\r\n this.countryRegions,\r\n new AddressMetaData({ ...resources }, this._getAddressFormatExcludeList()),\r\n this.addressPurposes\r\n );\r\n }\r\n\r\n public async componentDidMount(): Promise {\r\n // Initializing data props\r\n\r\n this._dataInitialize(this.props);\r\n\r\n void this.props.data.checkout.then(() => {\r\n this._setDefaultCountryRegionId();\r\n this._initModuleState();\r\n });\r\n\r\n reaction(\r\n () => this.countryRegionId,\r\n () => {\r\n this._getStateProvinces();\r\n }\r\n );\r\n\r\n reaction(\r\n () => this.currentOperation,\r\n () => {\r\n this._getStateProvinces();\r\n }\r\n );\r\n\r\n reaction(\r\n () => this.props.data.checkout.result && this.props.data.checkout.result.shippingAddress,\r\n shippingAddress => {\r\n if (this.props.moduleState.isUpdating) {\r\n if (shippingAddress && this.isBillingAddressSameAsShipping) {\r\n this._updateCurrentOperation(AddressOperation.Show, shippingAddress);\r\n } else if (shippingAddress && this.isBillingAddressSameAsShipping) {\r\n this._updateCurrentOperation(AddressOperation.Show, shippingAddress);\r\n }\r\n }\r\n }\r\n );\r\n\r\n reaction(\r\n () => this.isBillingAddressRequried,\r\n isBillingAddressRequried => {\r\n if (!isBillingAddressRequried) {\r\n this.props.data.checkout.result?.removeBillingAddress({});\r\n this.props.moduleState.onDisable();\r\n }\r\n }\r\n );\r\n }\r\n\r\n public shouldComponentUpdate(nextProps: IProps, nextState: ICheckoutState): boolean {\r\n if (this.state === nextState && this.props.data === nextProps.data) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n if (!this.isBillingAddressRequried) {\r\n return null;\r\n }\r\n\r\n const { resources } = this.props;\r\n const { renderView, config } = this.props;\r\n\r\n const viewProps = {\r\n ...this.props,\r\n currentOperation: this.currentOperation,\r\n selectedAddress: this.props.moduleState.hasError ? undefined : this.selectedAddress,\r\n addUpdateAddress: this.props.moduleState.hasError ? undefined : this.addUpdateAddress,\r\n countryRegionId: this.countryRegionId,\r\n stateProvinceInfo: this.stateProvinceInfo,\r\n validationError: this.validationError,\r\n addressActionResponse: this.addressActionResponse,\r\n className: config.className,\r\n viewState: {\r\n isShowAddress: this.selectedAddress && this.currentOperation === AddressOperation.Show && !this.props.moduleState.hasError,\r\n isError: this.props.moduleState.hasError\r\n },\r\n CheckoutBillingAddress: {\r\n moduleProps: this.props,\r\n className: classnames('ms-checkout-billing-address', config.className)\r\n },\r\n heading: ,\r\n showAddress: this._renderShowAddress(),\r\n error: this.renderErrorMessage()\r\n };\r\n\r\n return renderView(viewProps) as React.ReactElement;\r\n }\r\n\r\n /**\r\n * Method data initialization.\r\n * @param props -The checkout address properties.\r\n */\r\n private readonly _dataInitialize = (props: IProps): void => {\r\n const { data } = props;\r\n\r\n reaction(\r\n () => data.countryRegions.result,\r\n () => {\r\n this.countryRegions = data.countryRegions.result ?? [];\r\n }\r\n );\r\n\r\n reaction(\r\n () => data.addressPurposes.result,\r\n () => {\r\n this.addressPurposes = data.addressPurposes.result ?? [];\r\n }\r\n );\r\n\r\n reaction(\r\n () => data.countryStates.result,\r\n () => {\r\n this.stateProvinceInfo = data.countryStates.result ?? [];\r\n }\r\n );\r\n\r\n reaction(\r\n () => data.address.result,\r\n () => {\r\n this.addresses = data.address.result ?? [];\r\n }\r\n );\r\n\r\n this._setBillingAddress();\r\n };\r\n\r\n private _renderShowAddress(): IAddressShowProps | null {\r\n if (this.selectedAddress) {\r\n return AddressShow({\r\n address: this.selectedAddress,\r\n addressFormat: this.addressFormat.getAddressFormat(this.selectedAddress.ThreeLetterISORegionName ?? ''),\r\n addressPurposes: this.addressPurposes\r\n });\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Gets address format for exclude list.\r\n * @returns - Address item type.\r\n */\r\n private readonly _getAddressFormatExcludeList = (): AddressItemType[] => {\r\n const { config } = this.props;\r\n const addressFormatExcludeList: AddressItemType[] = [];\r\n\r\n if (!config.showAddressType) {\r\n addressFormatExcludeList.push(AddressItemType.AddressTypeValue);\r\n }\r\n\r\n addressFormatExcludeList.push(AddressItemType.IsPrimary);\r\n\r\n return addressFormatExcludeList;\r\n };\r\n\r\n /**\r\n * Gets state provinces.\r\n */\r\n private readonly _getStateProvinces = (): void => {\r\n if (\r\n !this.countryRegionId ||\r\n !(this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update)\r\n ) {\r\n return;\r\n }\r\n\r\n void this.addressCommon.getStateProvinces(this.countryRegionId).then((result: StateProvinceInfo[]) => {\r\n const stateInfo = result.some(state => state.StateId === this.addUpdateAddress.State);\r\n\r\n // Reset state if selected state not found in the list.\r\n if (!stateInfo) {\r\n set(this.addUpdateAddress, { State: '' });\r\n }\r\n this.stateProvinceInfo = result;\r\n });\r\n };\r\n\r\n /**\r\n * Initialize module state.\r\n */\r\n private readonly _initModuleState = (): void => {\r\n this.props.moduleState.init({\r\n status: this.isBillingAddressRequried ? 'updating' : 'disabled'\r\n });\r\n\r\n const { billingAddress, isBillingAddressSameAsShippingAddress } = this.props.data.checkout.result ?? {};\r\n\r\n if (this.isBillingAddressRequried) {\r\n if (billingAddress) {\r\n this.isBillingAddressSameAsShipping = isBillingAddressSameAsShippingAddress ?? false;\r\n this._updateCurrentOperation(AddressOperation.Show, billingAddress);\r\n this._updateModuleState();\r\n } else if (this.isCartContainsItemsForShipping) {\r\n this.isBillingAddressSameAsShipping = false;\r\n this._updateCurrentOperation(AddressOperation.Show, undefined);\r\n\r\n const {\r\n resources: { noBillingErrorMessage }\r\n } = this.props;\r\n\r\n this.setError(noBillingErrorMessage, true);\r\n } else {\r\n this.isBillingAddressSameAsShipping = false;\r\n this._updateCurrentOperation(AddressOperation.Add);\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Sets default country region Id.\r\n */\r\n private _setDefaultCountryRegionId(): void {\r\n const { request } = this.props.context;\r\n const market = request.channel?.ChannelCountryRegionISOCode;\r\n\r\n this.countryRegionId = this.addressCommon.getDefaultCountryRegionId(this.countryRegionId, this.countryRegions, market);\r\n }\r\n\r\n @computed private get isCartContainsItemsForShipping(): boolean {\r\n const { request } = this.props.context;\r\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\r\n const { channelDeliveryOptionConfig, featureState } = this.props.data;\r\n const retailMultiplePickUpOptionEnabled = featureState.result?.find(feature => feature.Name === multiplePickupStoreSwitchName)\r\n ?.IsEnabled;\r\n\r\n const pickupDeliveryModeCode = request.channel?.PickupDeliveryModeCode;\r\n const emailDeliveryModeCode = request.channel?.EmailDeliveryModeCode;\r\n\r\n // If hasInvoiceLine is true, there are only invoices no items in cart and return false here\r\n return this.props.data.checkout.result?.checkoutCart.hasInvoiceLine\r\n ? false\r\n : retailMultiplePickUpOptionEnabled\r\n ? ((this.props.data.checkout.result && this.props.data.checkout.result.checkoutCart.cart.CartLines) || []).some(cartLine =>\r\n cartLine.DeliveryMode && cartLine.DeliveryMode !== ''\r\n ? cartLine.DeliveryMode !==\r\n channelDeliveryOptionConfig.result?.PickupDeliveryModeCodes?.find(\r\n deliveryMode => deliveryMode === cartLine.DeliveryMode\r\n ) && cartLine.DeliveryMode !== emailDeliveryModeCode\r\n : cartLine\r\n )\r\n : ((this.props.data.checkout.result && this.props.data.checkout.result.checkoutCart.cart.CartLines) || []).some(cartLine =>\r\n cartLine.DeliveryMode && cartLine.DeliveryMode !== ''\r\n ? cartLine.DeliveryMode !== pickupDeliveryModeCode && cartLine.DeliveryMode !== emailDeliveryModeCode\r\n : cartLine\r\n );\r\n }\r\n\r\n @computed private get getLoyaltyAmount(): number {\r\n const checkoutState = this.props.data.checkout.result;\r\n return checkoutState?.loyaltyAmount ? checkoutState.loyaltyAmount : 0;\r\n }\r\n\r\n @computed private get getGiftCardTotalAmount(): number {\r\n const checkoutState = this.props.data.checkout.result;\r\n if (!checkoutState || !checkoutState.giftCardExtends) {\r\n return 0;\r\n }\r\n return checkoutState.giftCardExtends.reduce((count: number, giftCard: IGiftCardExtend) => {\r\n return count + (giftCard.Balance || 0);\r\n }, 0);\r\n }\r\n\r\n @computed private get getCustomerAccountAmount(): number {\r\n const checkoutState = this.props.data.checkout.result;\r\n const defaultAmount = 0;\r\n\r\n return checkoutState?.customerAccountAmount ?? defaultAmount;\r\n }\r\n\r\n @computed private get shouldPaidByCard(): boolean {\r\n const {\r\n data: { checkout },\r\n config\r\n } = this.props;\r\n if (!checkout.result) {\r\n return false;\r\n }\r\n\r\n const checkoutResult = checkout.result;\r\n const cart = checkoutResult.checkoutCart.cart;\r\n if (!cart || !cart.CartLines || cart.CartLines.length === 0) {\r\n return false;\r\n }\r\n\r\n const { paymentTenderType, tokenizedPaymentCard } = checkoutResult;\r\n const isPaidByOtherPaymentSource = config.paymenTenderType !== paymentTenderType && tokenizedPaymentCard;\r\n\r\n // Use payment card when it is not free or gift card balance + Loyalty amount can not cover the total amount\r\n const amountDue = (cart.TotalAmount || 0) - this.getGiftCardTotalAmount - this.getLoyaltyAmount - this.getCustomerAccountAmount;\r\n\r\n return amountDue > 0 && !isPaidByOtherPaymentSource;\r\n }\r\n\r\n @computed private get isBillingAddressRequried(): boolean {\r\n return this.shouldPaidByCard;\r\n }\r\n\r\n private readonly setError = (errorMessage: string | undefined, hasError: boolean): void => {\r\n this.props.moduleState.setHasError(hasError);\r\n this.setState({ errorMessage });\r\n };\r\n\r\n private renderErrorMessage = (): React.ReactNode => (\r\n
\r\n

{this.state.errorMessage}

\r\n
\r\n );\r\n\r\n /**\r\n * Sets billing address.\r\n * @param address - The address.\r\n */\r\n private readonly _setBillingAddress = (): void => {\r\n if (this.props.data.checkout.result) {\r\n const addressTypeId = 1;\r\n const addressCount = this.addresses.filter((address: Address) => address.AddressTypeValue === addressTypeId).length;\r\n\r\n // Only set billing address if there is one Invoice address\r\n if (addressCount === 1) {\r\n const address = this.addresses.find(address => address.AddressTypeValue === addressTypeId);\r\n this.selectedAddress = address ? address : this.selectedAddress;\r\n\r\n const newBillingAddress: Address = { ...address };\r\n\r\n if (address?.ThreeLetterISORegionName && !newBillingAddress.TwoLetterISORegionName) {\r\n newBillingAddress.TwoLetterISORegionName = this.addressFormat.getTwoLetterISORegionName(\r\n address?.ThreeLetterISORegionName\r\n );\r\n }\r\n\r\n void this.props.data.checkout.result.updateBillingAddress({\r\n newBillingAddress,\r\n additionalProperties: {\r\n isBillingAddressSameAsShippingAddress: this.isBillingAddressSameAsShipping\r\n }\r\n });\r\n\r\n this.setError(undefined, false);\r\n } else {\r\n // Remove the billing address and set appropriate error message\r\n this.selectedAddress = undefined;\r\n void this.props.data.checkout.result.removeBillingAddress({\r\n additionalProperties: {\r\n isBillingAddressSameAsShippingAddress: false\r\n }\r\n });\r\n\r\n const {\r\n resources: { noBillingErrorMessage, multipleBillingErrorMessage }\r\n } = this.props;\r\n\r\n this.setError(addressCount === 0 ? noBillingErrorMessage : multipleBillingErrorMessage, true);\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Update current operation.\r\n * @param operation - Address operation\r\n * @param selectedAddress - The selected address.\r\n */\r\n private readonly _updateCurrentOperation = (operation: AddressOperation, selectedAddress?: Address) => {\r\n this.currentOperation = operation;\r\n this.selectedAddress = selectedAddress;\r\n\r\n if (this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update) {\r\n this.addUpdateAddress = { ...this.selectedAddress } || {};\r\n set(this.addUpdateAddress, {\r\n ThreeLetterISORegionName: this.addUpdateAddress.ThreeLetterISORegionName || this.countryRegionId\r\n });\r\n set(this.addUpdateAddress, { AddressTypeValue: this.addUpdateAddress.AddressTypeValue || this.defaultAddressType });\r\n }\r\n };\r\n\r\n /**\r\n * Updates the module state.\r\n */\r\n private readonly _updateModuleState = () => {\r\n if (this.currentOperation === AddressOperation.Show) {\r\n this.props.moduleState.onReady();\r\n } else {\r\n this.props.moduleState.onUpdating();\r\n }\r\n };\r\n}\r\n\r\nexport default CheckoutBillingAddress;\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 { IImageProps, IImageSettings, Image, IRequestContext } from '@msdyn365-commerce/core';\r\nimport { CartLine, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { format, isMobile, VariantType } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport * as React from 'react';\r\n\r\nimport { IEveCheckoutShippingAddressResources } from '../eve-checkout-shipping-address.props.autogenerated';\r\n\r\n/**\r\n * The cartline product interface.\r\n */\r\nexport interface ICartLineWithProduct {\r\n cartLine: CartLine;\r\n product?: SimpleProduct;\r\n}\r\n\r\n/**\r\n * The checkout shipping cartline interface.\r\n */\r\nexport interface ICheckoutShippingCartLineInfo {\r\n lineId: string;\r\n imageProps: IImageProps;\r\n quantity: number;\r\n}\r\n\r\n/**\r\n * The checkout shipping cartline props.\r\n */\r\nexport interface ICheckoutShippingCartLinesProps {\r\n moduleClassName: string;\r\n cartLines: ICheckoutShippingCartLineInfo[];\r\n title: string;\r\n itemTitle: string;\r\n resources: IEveCheckoutShippingAddressResources;\r\n}\r\n\r\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Following as per module\r\nexport const CheckoutPickupCartLines: React.FC = ({\r\n moduleClassName,\r\n cartLines,\r\n title,\r\n itemTitle,\r\n resources\r\n}) => {\r\n const context = ({\r\n gridSettings: {\r\n xs: { w: 767 },\r\n sm: { w: 991 },\r\n md: { w: 1199 },\r\n lg: { w: 1599 },\r\n xl: { w: 1600 }\r\n }\r\n } as unknown) as IRequestContext;\r\n const isMobileCheck = isMobile({ variant: VariantType.Browser, context });\r\n const isMobileView = isMobileCheck === 'xs' || isMobileCheck === 'sm';\r\n\r\n if (!ArrayExtensions.hasElements(cartLines)) {\r\n return null;\r\n }\r\n const quantity = 1;\r\n return (\r\n
\r\n
\r\n
{title}
\r\n
{itemTitle}
\r\n
\r\n
\r\n {cartLines.map((cartLine: ICheckoutShippingCartLineInfo) => {\r\n const isShowQty = cartLine.quantity > quantity;\r\n let className = `${moduleClassName}__group-images-lines-product`;\r\n const role = 'text';\r\n if (isShowQty) {\r\n className = classnames(className, ' product-image-wide');\r\n }\r\n return (\r\n
\r\n \r\n {isMobileView\r\n ? isShowQty && (\r\n \r\n {cartLine.quantity}\r\n
\r\n )\r\n : isShowQty && (\r\n
\r\n )}\r\n {!isMobileView && isShowQty && (\r\n \r\n {format(resources.productQuantityInfo, cartLine.quantity, cartLine.imageProps.altText)}\r\n \r\n )}\r\n
\r\n );\r\n })}\r\n \r\n \r\n );\r\n};\r\n\r\n/**\r\n * The checkout shipping cartline image settings.\r\n */\r\nexport const defaultImageSettings: IImageSettings = {\r\n viewports: {\r\n xs: { q: 'w=108&h=108&q=80&m=6&f=jpg', w: 108, h: 108 },\r\n lg: { q: 'w=108&h=108&q=80&m=6&f=jpg', w: 108, h: 108 },\r\n xl: { q: 'w=108&h=108&q=80&m=6&f=jpg', w: 108, h: 108 }\r\n },\r\n lazyload: true,\r\n quality: 80\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 Address,\r\n AddressPurpose,\r\n CartLine,\r\n CountryRegionInfo,\r\n SimpleProduct,\r\n StateProvinceInfo,\r\n TenderLine,\r\n TokenizedPaymentCard\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport { IModuleStateProps, withModuleState } from '@msdyn365-commerce-modules/checkout-utilities';\r\nimport { getFallbackImageUrl, getSimpleProducts, ObjectExtensions, ProductInput } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { format, getTelemetryObject, IModuleProps, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport { action, computed, observable, reaction, set } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\n\r\nimport { AutoSuggest } from '@msdyn365-commerce-modules/address';\r\nimport { IAutoSuggestOptions } from '@msdyn365-commerce-modules/address';\r\nimport { AddressCommon } from '@msdyn365-commerce-modules/address';\r\nimport { AddressFormat } from '@msdyn365-commerce-modules/address';\r\nimport { AddressItemType } from '@msdyn365-commerce-modules/address';\r\nimport { AddressMetaData } from '@msdyn365-commerce-modules/address';\r\nimport { AddressOperation, AddressType, IAddressResource, IAddressResponse } from '@msdyn365-commerce-modules/address';\r\nimport { AddressAddUpdate, IAddressAddUpdateProps } from '@msdyn365-commerce-modules/address';\r\nimport { AddressSelect, IAddressSelectProps } from '@msdyn365-commerce-modules/address';\r\nimport { AddressShow, IAddressShowProps } from '@msdyn365-commerce-modules/address';\r\nimport { IEveCheckoutShippingAddressData } from './eve-checkout-shipping-address.data';\r\nimport { IEveCheckoutShippingAddressProps } from './eve-checkout-shipping-address.props.autogenerated';\r\nimport {\r\n CheckoutPickupCartLines,\r\n defaultImageSettings,\r\n ICartLineWithProduct,\r\n ICheckoutShippingCartLineInfo,\r\n ICheckoutShippingCartLinesProps\r\n} from './components/checkout-shipping-cartlines-images';\r\n\r\n/**\r\n * The checkout address props interface.\r\n */\r\nexport interface ICheckoutAddressProps extends IEveCheckoutShippingAddressProps, IModuleStateProps {}\r\n\r\n/**\r\n * The checkout shipping address view state.\r\n */\r\nexport interface ICheckoutShippingAddressViewState {\r\n isShowAddress: boolean;\r\n isShowAddresList: boolean;\r\n isShowAddOrUpdateAddress: boolean;\r\n}\r\n\r\n/**\r\n * The checkout shipping address state.\r\n */\r\nexport interface ICheckoutAddresState {\r\n shippingGroups: ICartLineWithProduct[];\r\n}\r\n\r\n/**\r\n * The checkout shipping address view props.\r\n */\r\nexport interface ICheckoutShippingAddressViewProps extends ICheckoutAddressProps {\r\n className: string;\r\n currentOperation: AddressOperation;\r\n selectedAddress?: Address;\r\n addUpdateAddress: Address;\r\n addressListSelectedAddress: Address;\r\n countryRegionId: string;\r\n stateProvinceInfo?: StateProvinceInfo[];\r\n customerAddresses: Address[];\r\n validationError: object;\r\n addressActionResponse?: IAddressResponse;\r\n viewState: ICheckoutShippingAddressViewState;\r\n CheckoutShippingAddress: IModuleProps;\r\n isUpdating: boolean;\r\n hasError: boolean;\r\n showAddress: IAddressShowProps;\r\n showAddOrUpdateAddress: IAddressAddUpdateProps;\r\n cartLineImages?: React.ReactNode;\r\n showAddressSelect: IAddressSelectProps;\r\n showAddOrUpdateAddressHandler?(onSaveHandler?: () => void, onCancelHandler?: () => void): IAddressAddUpdateProps;\r\n showAddressSelectHandler?(\r\n onAddAddressHandler?: () => void,\r\n onSaveHandler?: () => void,\r\n onCancelHandler?: () => void\r\n ): IAddressSelectProps;\r\n}\r\n\r\n/**\r\n * IExpressPaymentDetail interface.\r\n */\r\ninterface IExpressPaymentDetails {\r\n email?: string;\r\n tenderLine?: TenderLine;\r\n tokenizedPaymentCard?: TokenizedPaymentCard;\r\n paymentTenderType?: string;\r\n address?: Address;\r\n isExpressCheckoutAppliedInCartPage: boolean;\r\n isExpressAddressAppliedInCartPage?: boolean;\r\n}\r\n\r\n/**\r\n *\r\n * Address component.\r\n * @extends {React.Component>}\r\n */\r\n// @ts-expect-error\r\n@withModuleState\r\n@observer\r\nclass CheckoutShippingAddress extends React.Component {\r\n @observable private currentOperation: AddressOperation;\r\n\r\n @observable private selectedAddress?: Address;\r\n\r\n @observable private addUpdateAddress: Address;\r\n\r\n @observable private countryRegionId: string = 'USA';\r\n\r\n @observable private stateProvinceInfo?: StateProvinceInfo[];\r\n\r\n @observable private customerAddresses: Address[] = [];\r\n\r\n @observable private validationError: object;\r\n\r\n @observable private addressActionResponse?: IAddressResponse;\r\n\r\n @observable private isUpdating?: boolean;\r\n\r\n @observable private hasError?: boolean;\r\n\r\n @observable private addressListSelectedAddress: Address = {};\r\n\r\n private readonly addressCommon: AddressCommon;\r\n\r\n private addressFormat!: AddressFormat;\r\n\r\n private countryRegions: CountryRegionInfo[] = [];\r\n\r\n private addressPurposes: AddressPurpose[] = [];\r\n\r\n private readonly resources: IAddressResource;\r\n\r\n private readonly defaultAddressType: number = 6; // Default to Home\r\n\r\n private readonly telemetryContent?: ITelemetryContent;\r\n\r\n private autoSuggest?: AutoSuggest;\r\n\r\n private readonly multiplePickupStoreSwitchName: string = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\r\n\r\n private retailMultiplePickUpOptionEnabled?: boolean = false;\r\n\r\n public constructor(props: ICheckoutAddressProps) {\r\n super(props);\r\n this.state = { shippingGroups: [] };\r\n const { context, data, resources, telemetry } = this.props;\r\n\r\n this.addUpdateAddress = {};\r\n this.resources = resources;\r\n this.currentOperation = AddressOperation.List;\r\n this.countryRegions = data.countryRegions.result || [];\r\n this.addressPurposes = data.addressPurposes.result || [];\r\n this.customerAddresses = data.address.result || [];\r\n this.stateProvinceInfo = data.countryStates.result || [];\r\n this.addressCommon = new AddressCommon(context, resources, telemetry);\r\n this.addressFormat = new AddressFormat(\r\n this.countryRegions,\r\n new AddressMetaData({ ...resources }, this._getAddressFormatExcludeList()),\r\n this.addressPurposes\r\n );\r\n this.validationError = {};\r\n this.retailMultiplePickUpOptionEnabled = data.featureState.result?.find(\r\n feature => feature.Name === this.multiplePickupStoreSwitchName\r\n )?.IsEnabled;\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 }\r\n\r\n /**\r\n * Initialize pickup group.\r\n */\r\n @action\r\n private readonly _initPickupGroup = async (): Promise => {\r\n const pickupCartLines: CartLine[] = this._getCartLinesforDelivery();\r\n const cartLines: ICartLineWithProduct[] = [];\r\n\r\n try {\r\n const products = await this._getProductsByCartLines(\r\n this.props.data.checkout.result?.checkoutCart.cart.ChannelId || 0,\r\n pickupCartLines\r\n );\r\n for (const line of pickupCartLines) {\r\n const product: SimpleProduct | undefined = products.find(x => x.RecordId === line.ProductId);\r\n cartLines.push({ cartLine: line, product });\r\n }\r\n this.setState({ shippingGroups: cartLines });\r\n } catch (error) {\r\n this.props.telemetry.error(error as string);\r\n this.setState({ shippingGroups: [] });\r\n }\r\n };\r\n\r\n /**\r\n * On suggestion selected.\r\n * @param result - Suggestion result interface.\r\n */\r\n @action\r\n private readonly _onSuggestionSelected = async (result: Microsoft.Maps.ISuggestionResult): Promise => {\r\n this._clearAddressFields();\r\n const address = this.addressFormat.getTranformedAddress(result, this.stateProvinceInfo);\r\n const timeout = 0;\r\n set(this.addUpdateAddress, { Street: '' });\r\n set(this.addUpdateAddress, { ZipCode: address.ZipCode });\r\n set(this.addUpdateAddress, { CountyName: address.CountyName });\r\n set(this.addUpdateAddress, { City: address.City });\r\n set(this.addUpdateAddress, { State: address.State });\r\n set(this.addUpdateAddress, { DistrictName: address.DistrictName });\r\n set(this.addUpdateAddress, { FullAddress: address.FullAddress });\r\n\r\n // Bing autosuggest put the complete address in the Street input box. Updating the street input box to show only street address.\r\n setTimeout(() => {\r\n set(this.addUpdateAddress, { Street: address.Street });\r\n }, timeout);\r\n };\r\n\r\n /**\r\n * Method to clear address fields.\r\n */\r\n @action\r\n private readonly _clearAddressFields = (): void => {\r\n const addressFormatItem = this.addressFormat.getAddressFormat(\r\n this.addUpdateAddress.ThreeLetterISORegionName || this.countryRegionId\r\n );\r\n for (const formatAddress of addressFormatItem) {\r\n if (\r\n this.addUpdateAddress[formatAddress.name] !== undefined &&\r\n !this.autoSuggest?.excludedAddressFields.includes(formatAddress.name)\r\n ) {\r\n this.addressFormat[formatAddress.name] = '';\r\n }\r\n }\r\n this._clearValidation();\r\n };\r\n\r\n /**\r\n * Method to clear validation.\r\n */\r\n @action\r\n private readonly _clearValidation = (): void => {\r\n this.validationError = {};\r\n };\r\n\r\n public get expressPaymentDetailsFromCartPage(): IExpressPaymentDetails | null {\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\r\n const properties =\r\n this.props.data.cart?.result?.cart?.ExtensionProperties?.find(property => property.Key === 'expressPaymentDetails')?.Value\r\n ?.StringValue ?? '';\r\n\r\n return properties ? (JSON.parse(properties) as IExpressPaymentDetails) : null;\r\n }\r\n\r\n public async componentDidMount(): Promise {\r\n const {\r\n context: {\r\n telemetry,\r\n actionContext: {\r\n requestContext: { channel }\r\n }\r\n },\r\n config: { autoSuggestionEnabled, autoSuggestOptions },\r\n resources\r\n } = this.props;\r\n\r\n // Initializing data props\r\n this._dataInitialize(this.props);\r\n\r\n this.addressFormat = new AddressFormat(\r\n this.countryRegions,\r\n new AddressMetaData({ ...resources }, this._getAddressFormatExcludeList()),\r\n this.addressPurposes\r\n );\r\n\r\n this.props.data.checkout.then(() => {\r\n this._setDefaultCountryRegionId();\r\n this._initModuleState();\r\n });\r\n\r\n reaction(\r\n () => this.countryRegionId,\r\n () => {\r\n this._getStateProvinces();\r\n }\r\n );\r\n\r\n reaction(\r\n () => this.currentOperation,\r\n () => {\r\n this._getStateProvinces();\r\n }\r\n );\r\n\r\n reaction(\r\n () => this.props.data.checkout.result?.shippingAddressFromExpressCheckout,\r\n () => {\r\n if (!this.expressPaymentDetailsFromCartPage && this._canShip()) {\r\n let address = this.props.data.checkout.result?.shippingAddressFromExpressCheckout;\r\n\r\n if (address?.TwoLetterISORegionName) {\r\n const threeLetterIsoRegionName = this.getThreeLetterIsoRegionName(address.TwoLetterISORegionName);\r\n\r\n address = { ...address, ThreeLetterISORegionName: threeLetterIsoRegionName };\r\n\r\n if (threeLetterIsoRegionName && threeLetterIsoRegionName !== this.countryRegionId) {\r\n this._onCountryChange(threeLetterIsoRegionName);\r\n }\r\n }\r\n\r\n this._updateCurrentOperation(AddressOperation.Add, address);\r\n this._onAddressAddUpdateSubmit();\r\n }\r\n }\r\n );\r\n\r\n if (autoSuggestionEnabled) {\r\n if (channel && !channel.BingMapsApiKey) {\r\n telemetry.error('BingMapsApiKey is missing.');\r\n return;\r\n }\r\n\r\n if (channel && !channel.BingMapsEnabled) {\r\n telemetry.error('Map is disabled from HQ.');\r\n return;\r\n }\r\n\r\n const options: IAutoSuggestOptions = { ...autoSuggestOptions };\r\n this.autoSuggest = new AutoSuggest(\r\n telemetry,\r\n options,\r\n channel?.BingMapsApiKey,\r\n channel?.ChannelCountryRegionISOCode,\r\n channel?.DefaultLanguageId\r\n );\r\n\r\n // Customer doesn't have any address. Then add view will be loaded directly. Code for the same to handle that\r\n if (\r\n this.props.data.storeSelectorStateManager.result &&\r\n (this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update)\r\n ) {\r\n await this.autoSuggest._loadMapAPI(await this.props.data.storeSelectorStateManager);\r\n }\r\n\r\n reaction(\r\n () =>\r\n this.props.data.storeSelectorStateManager.result?.loadMapApi &&\r\n (this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update),\r\n async () => {\r\n await this.autoSuggest?._loadMapAPI(await this.props.data.storeSelectorStateManager);\r\n }\r\n );\r\n\r\n reaction(\r\n () => this.props.data.storeSelectorStateManager.result?.isMapApiLoaded,\r\n async () => {\r\n await this._attachMapAutoSuggest();\r\n }\r\n );\r\n }\r\n await this._initPickupGroup();\r\n }\r\n\r\n public async componentDidUpdate(): Promise {\r\n if (this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update) {\r\n if (this.props.data.storeSelectorStateManager.result?.isMapApiLoaded) {\r\n await this._attachMapAutoSuggest();\r\n }\r\n } else {\r\n this.autoSuggest?.disposeAutoSuggest();\r\n }\r\n }\r\n\r\n public shouldComponentUpdate(nextProps: ICheckoutAddressProps, nextState: ICheckoutAddresState): boolean {\r\n if (this.state === nextState && this.props.data === nextProps.data) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n if (!this._canShip()) {\r\n return null;\r\n }\r\n\r\n const { config, context, renderView, resources } = this.props;\r\n const { headingImages, itemsText, singleItemText } = resources;\r\n const { imageSettings } = config;\r\n\r\n // Line images\r\n const cartlines: ICheckoutShippingCartLineInfo[] = this.state.shippingGroups\r\n .filter(x => !ObjectExtensions.isNullOrUndefined(x.product))\r\n .map(line => ({\r\n lineId: line.cartLine.LineId ?? '',\r\n imageProps: {\r\n requestContext: context.actionContext.requestContext,\r\n className: 'ms-checkout-shipping-address__group-images-lines-line-image',\r\n altText: line.product?.Name,\r\n src: line.product?.PrimaryImageUrl ?? '',\r\n fallBackSrc: getFallbackImageUrl(line.product?.ItemId, context.actionContext.requestContext.apiSettings),\r\n gridSettings: context.request.gridSettings!,\r\n imageSettings: imageSettings ?? defaultImageSettings,\r\n loadFailureBehavior: 'empty'\r\n },\r\n quantity: line.cartLine.Quantity ?? 0\r\n }));\r\n\r\n const quantity = 1;\r\n const itemText = cartlines.length > quantity ? itemsText : singleItemText;\r\n\r\n const lineImageProps: ICheckoutShippingCartLinesProps = {\r\n moduleClassName: 'ms-checkout-shipping-address',\r\n cartLines: cartlines.filter(x => !ObjectExtensions.isNullOrUndefined(x)),\r\n itemTitle: `(${format(itemText, cartlines.length)})`,\r\n title: headingImages,\r\n resources: this.props.resources\r\n };\r\n\r\n const cartLineImages: React.ReactNode = ;\r\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\r\n const { featureState } = this.props.data;\r\n const isRetailMultiplePickUpOptionEnabled = featureState.result?.find(feature => feature.Name === multiplePickupStoreSwitchName)\r\n ?.IsEnabled;\r\n\r\n const viewProps = {\r\n ...this.props,\r\n currentOperation: this.currentOperation,\r\n selectedAddress: this.selectedAddress,\r\n addUpdateAddress: this.addUpdateAddress,\r\n addressListSelectedAddress: this.addressListSelectedAddress,\r\n countryRegionId: this.countryRegionId,\r\n stateProvinceInfo: this.stateProvinceInfo,\r\n customerAddresses: this.customerAddresses,\r\n validationError: this.validationError,\r\n addressActionResponse: this.addressActionResponse,\r\n isUpdating: this.isUpdating,\r\n hasError: this.hasError,\r\n className: config.className,\r\n viewState: {\r\n isShowAddress: this.currentOperation === AddressOperation.Show && this.selectedAddress,\r\n isShowAddresList: this.currentOperation === AddressOperation.List && this.customerAddresses.length > 0,\r\n isShowAddOrUpdateAddress:\r\n this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update\r\n },\r\n CheckoutShippingAddress: {\r\n moduleProps: this.props,\r\n className: classnames('ms-checkout-shipping-address', config.className)\r\n },\r\n showAddress: this._renderShowAddress(),\r\n\r\n /**\r\n * Show address select.\r\n * @param onAddAddressHandler - On add address click function.\r\n * @param onSaveHandler - On save click function.\r\n * @param onCancelHandler - On cancel click function.\r\n * @returns - Renders select address.\r\n */\r\n showAddressSelectHandler: (onAddAddressHandler?: () => void, onSaveHandler?: () => void, onCancelHandler?: () => void) =>\r\n this._renderSelectAddress(onAddAddressHandler, onSaveHandler, onCancelHandler),\r\n\r\n /**\r\n * Show add/update address.\r\n * @param onSaveHandler - On save click function.\r\n * @param onCancelHandler - On cancel click function.\r\n * @returns - Renders select address.\r\n */\r\n showAddOrUpdateAddressHandler: (onSaveHandler?: () => void, onCancelHandler?: () => void) =>\r\n this._renderAddOrUpdateAddress(onSaveHandler, onCancelHandler),\r\n showAddOrUpdateAddress: this._renderAddOrUpdateAddress(),\r\n cartLineImages: isRetailMultiplePickUpOptionEnabled ? cartLineImages : undefined,\r\n showAddressSelect: this._renderSelectAddress()\r\n };\r\n\r\n return renderView(viewProps) as React.ReactElement;\r\n }\r\n\r\n /**\r\n * Method data initialization.\r\n * @param props -The checkout address properties.\r\n */\r\n private readonly _dataInitialize = (props: ICheckoutAddressProps): void => {\r\n const { data } = props;\r\n\r\n reaction(\r\n () => data.countryRegions.result,\r\n () => {\r\n this.countryRegions = data.countryRegions.result ?? [];\r\n }\r\n );\r\n\r\n reaction(\r\n () => data.addressPurposes.result,\r\n () => {\r\n this.addressPurposes = data.addressPurposes.result ?? [];\r\n }\r\n );\r\n\r\n reaction(\r\n () => data.address.result,\r\n () => {\r\n this.customerAddresses = data.address.result ?? [];\r\n }\r\n );\r\n\r\n reaction(\r\n () => data.countryStates.result,\r\n () => {\r\n this.stateProvinceInfo = data.countryStates.result ?? [];\r\n }\r\n );\r\n\r\n reaction(\r\n () => data.featureState.result,\r\n () => {\r\n this.retailMultiplePickUpOptionEnabled = data.featureState.result?.find(\r\n feature => feature.Name === this.multiplePickupStoreSwitchName\r\n )?.IsEnabled;\r\n }\r\n );\r\n };\r\n\r\n /**\r\n * Method to get cart lines for delivery.\r\n * @returns The cart line collection.\r\n */\r\n private readonly _getCartLinesforDelivery = (): CartLine[] => {\r\n return this.props.data.checkout.result?.checkoutCart.cart.CartLines?.filter(line => this._isDelivery(line)) ?? [];\r\n };\r\n\r\n /**\r\n * Method to check cart line for delivery.\r\n * @param line -The cart line.\r\n * @returns True/false as per cart line delivery mode.\r\n */\r\n private readonly _isDelivery = (line: CartLine): boolean => {\r\n return this._isNotPickupMode(line.DeliveryMode) && (line.FulfillmentStoreId === undefined || line.FulfillmentStoreId === '');\r\n };\r\n\r\n /**\r\n * Method to check cart line for delivery.\r\n * @param deliveryMode -The delivery mode.\r\n * @returns True/false as per cart line delivery mode.\r\n */\r\n private readonly _isNotPickupMode = (deliveryMode: string | undefined): boolean => {\r\n const pickupDeliveryModeCode = this.props.context.request.channel?.PickupDeliveryModeCode;\r\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\r\n const { channelDeliveryOptionConfig, featureState } = this.props.data;\r\n const retailMultiplePickUpOptionEnabled = featureState.result?.find(feature => feature.Name === multiplePickupStoreSwitchName)\r\n ?.IsEnabled;\r\n if (retailMultiplePickUpOptionEnabled && deliveryMode !== undefined) {\r\n const pickupDeliveryMode = channelDeliveryOptionConfig.result?.PickupDeliveryModeCodes?.some(\r\n pickupMode => pickupMode !== deliveryMode\r\n );\r\n return pickupDeliveryMode !== undefined ? pickupDeliveryMode : false;\r\n }\r\n return deliveryMode !== undefined && pickupDeliveryModeCode !== undefined && deliveryMode !== pickupDeliveryModeCode;\r\n };\r\n\r\n /**\r\n * Method to check cart line for delivery.\r\n * @param channelId - The channelId.\r\n * @param cartLines - Cart line collections.\r\n * @returns Collection of SimpleProduct.\r\n */\r\n private readonly _getProductsByCartLines = async (channelId: number, cartLines: CartLine[]): Promise => {\r\n const actionContext = this.props.context.actionContext;\r\n const productInputs = cartLines\r\n .filter(line => !ObjectExtensions.isNullOrUndefined(line.ProductId))\r\n .map(\r\n line =>\r\n new ProductInput(\r\n line.ProductId || 0,\r\n actionContext.requestContext.apiSettings,\r\n channelId,\r\n undefined,\r\n actionContext.requestContext\r\n )\r\n );\r\n return getSimpleProducts(productInputs, actionContext);\r\n };\r\n\r\n /**\r\n * Method to render add/update address.\r\n * @param onSaveHandler -- Handles onsave functionality.\r\n * @param onCancelHandler -- Handles oncancel functionality.\r\n * @returns Address app/update props.\r\n */\r\n private readonly _renderAddOrUpdateAddress = (onSaveHandler?: () => void, onCancelHandler?: () => void): IAddressAddUpdateProps => {\r\n const addressFormat =\r\n this.currentOperation === AddressOperation.Add && this.addressCommon.isAuthenticatedFlow()\r\n ? this.addressFormat\r\n : this.addressFormat;\r\n\r\n /**\r\n * On Cancel Button Function.\r\n */\r\n const onCancelButtonHandler = () => {\r\n this._resetView();\r\n onCancelHandler?.();\r\n };\r\n return AddressAddUpdate({\r\n isUpdating: this.isUpdating,\r\n resources: this.resources,\r\n addressType: AddressType.Shipping,\r\n addressFormat: addressFormat.getAddressFormat(this.addUpdateAddress.ThreeLetterISORegionName || this.countryRegionId),\r\n defaultCountryRegionId: this.countryRegionId,\r\n defaultAddressType: this.defaultAddressType,\r\n selectedAddress: this.addUpdateAddress,\r\n validationError: this.validationError,\r\n hasError: this.hasError,\r\n addressActionResponse: this.addressActionResponse,\r\n telemetryContent: this.telemetryContent,\r\n dropdownDisplayData: addressFormat.getPrefilledAddressDropdownData(\r\n this.resources.addressStateDefaultSelectionText,\r\n this.stateProvinceInfo\r\n ),\r\n onInputChange: this._onAddressAddUpdateInputChange,\r\n onDropdownChange: this._onAddressAddUpdateDropdownChange,\r\n hasExternalSubmitGroup: this.props.moduleState.hasExternalSubmitGroup,\r\n\r\n /**\r\n * On Save Function.\r\n */\r\n onSave: () => {\r\n this.onSubmit();\r\n onSaveHandler?.();\r\n },\r\n\r\n onCancel: !this.selectedAddress && !this.addressCommon.isAuthenticatedFlow() ? () => {} : onCancelButtonHandler\r\n });\r\n };\r\n\r\n /**\r\n * Method to render select address.\r\n * @param onAddAddressHandler - To handle add address button click.\r\n * @param onSaveHandler - To handle save button click.\r\n * @param onCancelHandler - To handle cancel button click.\r\n * @returns Select address props.\r\n */\r\n private readonly _renderSelectAddress = (\r\n onAddAddressHandler?: () => void,\r\n onSaveHandler?: () => void,\r\n onCancelHandler?: () => void\r\n ): IAddressSelectProps => {\r\n /**\r\n * On Cancel Button Function.\r\n */\r\n const onCancelButtonHandler = () => {\r\n this._resetView();\r\n onCancelHandler?.();\r\n };\r\n return AddressSelect({\r\n addressFormat: this.addressFormat,\r\n addresses: this.customerAddresses,\r\n resources: this.resources,\r\n addressPurposes: this.addressPurposes,\r\n selectedAddress: this.addressListSelectedAddress,\r\n onAddressOptionChange: this._onAddressOptionChange,\r\n hasExternalSubmitGroup: this.props.moduleState.hasExternalSubmitGroup,\r\n telemetryContent: this.telemetryContent,\r\n\r\n /**\r\n * On Add Address Function.\r\n */\r\n onAddAddress: () => {\r\n this._goToAddAddress();\r\n onAddAddressHandler?.();\r\n },\r\n\r\n /**\r\n * On Save Function.\r\n */\r\n onSave: () => {\r\n this._onSelectAddress();\r\n onSaveHandler?.();\r\n },\r\n\r\n onCancel: !this.selectedAddress ? () => {} : onCancelButtonHandler\r\n });\r\n };\r\n\r\n /**\r\n * Method to render show address.\r\n * @returns Show address props.\r\n */\r\n private _renderShowAddress(): IAddressShowProps | null {\r\n if (this.selectedAddress) {\r\n return AddressShow({\r\n address: this.selectedAddress,\r\n addressFormat: this.addressFormat.getAddressFormat(this.selectedAddress.ThreeLetterISORegionName || ''),\r\n addressPurposes: this.addressPurposes\r\n });\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Method to render map auto suggest.\r\n */\r\n private readonly _attachMapAutoSuggest = async (): Promise => {\r\n const {\r\n data: {\r\n storeSelectorStateManager: { result: storeSelectorStateManager }\r\n }\r\n } = this.props;\r\n\r\n if (storeSelectorStateManager?.isMapApiLoaded) {\r\n this.autoSuggest?.attachAutoSuggest('#shipping_addressstreet', '#shipping_addressstreet_container', this._onSuggestionSelected);\r\n }\r\n };\r\n\r\n /**\r\n * Method gets called on address option change.\r\n * @param event - To get current option.\r\n */\r\n private readonly _onAddressOptionChange = (event: React.ChangeEvent) => {\r\n const addressRecordId = event.currentTarget.value;\r\n const selectedAddress = this.customerAddresses.find(address => (address.RecordId || '').toString() === addressRecordId);\r\n if (selectedAddress) {\r\n this.addressListSelectedAddress = selectedAddress;\r\n }\r\n };\r\n\r\n /**\r\n * Method to render map auto suggest.\r\n * @param name - Address name field.\r\n * @param value - Address name value field.\r\n */\r\n private readonly onAddressAddUpdate = (name: string, value: string | boolean) => {\r\n set(this.addUpdateAddress, { [name]: value });\r\n this.addressFormat.validateAddressFormat(this.addUpdateAddress, this.validationError, this.countryRegionId, name);\r\n };\r\n\r\n /**\r\n * Method to get called on address update change.\r\n * @param event - Input element.\r\n */\r\n private readonly _onAddressAddUpdateInputChange = (event: React.ChangeEvent): void => {\r\n if (event.target.type === 'checkbox') {\r\n this.onAddressAddUpdate(event.target.name, event.target.checked);\r\n } else {\r\n const value = (event.target.value || '').replace(new RegExp('[<>]', 'gi'), '');\r\n this.onAddressAddUpdate(event.target.name, value);\r\n }\r\n };\r\n\r\n /**\r\n * Method to get called on address update dropdown change.\r\n * @param event - Select element.\r\n */\r\n private readonly _onAddressAddUpdateDropdownChange = (event: React.ChangeEvent): void => {\r\n this.onAddressAddUpdate(event.target.name, event.target.value);\r\n\r\n if (event.target.name === AddressItemType[AddressItemType.ThreeLetterISORegionName]) {\r\n this._onCountryChange(event.target.value);\r\n }\r\n };\r\n\r\n /**\r\n * Method to get called on address update submit.\r\n */\r\n private readonly _onAddressAddUpdateSubmit = (): void => {\r\n if (!this.addressFormat.validateAddressFormat(this.addUpdateAddress, this.validationError, this.countryRegionId)) {\r\n return;\r\n }\r\n\r\n let response: Promise;\r\n if (this.addressCommon.isAuthenticatedFlow() && this._isNewAddress(this.addUpdateAddress)) {\r\n response =\r\n this.currentOperation === AddressOperation.Update\r\n ? this.addressCommon.updateCustomerAddress(this.addUpdateAddress)\r\n : this.addressCommon.addCustomerAddress(this.addUpdateAddress);\r\n } else {\r\n response = Promise.resolve({ address: this.addUpdateAddress });\r\n }\r\n\r\n this.isUpdating = true;\r\n this._updateModuleState();\r\n\r\n response.then(\r\n (result: IAddressResponse) => {\r\n this.isUpdating = false;\r\n let newAddress = (result.customerAddresses || []).find(\r\n add =>\r\n this.addUpdateAddress.Name === add.Name &&\r\n this.addUpdateAddress.Street === add.Street &&\r\n this.addUpdateAddress.State === add.State &&\r\n this.addUpdateAddress.City === add.City &&\r\n this.addUpdateAddress.ZipCode === add.ZipCode\r\n );\r\n if (!newAddress) {\r\n newAddress = result.address;\r\n newAddress = { ...newAddress, ...this.addUpdateAddress };\r\n }\r\n\r\n if (result.address) {\r\n this.hasError = false;\r\n if (result.customerAddresses) {\r\n this._onAddOrUpdateSuccess({ customerAddresses: result.customerAddresses, address: newAddress });\r\n } else {\r\n this._onAddOrUpdateSuccess({ address: newAddress });\r\n }\r\n } else {\r\n this.hasError = true;\r\n this.addressActionResponse = result;\r\n this._updateModuleState();\r\n }\r\n },\r\n () => {\r\n this.hasError = true;\r\n this.isUpdating = false;\r\n this._updateModuleState();\r\n }\r\n );\r\n };\r\n\r\n /**\r\n * Method to get called on country change.\r\n * @param countryRegionId - Country region id.\r\n */\r\n private readonly _onCountryChange = (countryRegionId: string) => {\r\n this.countryRegionId = countryRegionId;\r\n const twoLetterIsoRegionName = this.addressFormat.getTwoLetterISORegionName(countryRegionId);\r\n set(this.addUpdateAddress, { ThreeLetterISORegionName: countryRegionId });\r\n set(this.addUpdateAddress, { TwoLetterISORegionName: twoLetterIsoRegionName });\r\n this.autoSuggest?.changeAutoSuggestionCountryCode(twoLetterIsoRegionName);\r\n this._clearAddressFields();\r\n };\r\n\r\n /**\r\n * Method to get all address format exclude list.\r\n * @returns Collection of address items.\r\n */\r\n private readonly _getAddressFormatExcludeList = (): AddressItemType[] => {\r\n const { config } = this.props;\r\n const addressFormatExcludeList: AddressItemType[] = [];\r\n\r\n if (!config.showAddressType) {\r\n addressFormatExcludeList.push(AddressItemType.AddressTypeValue);\r\n }\r\n\r\n addressFormatExcludeList.push(AddressItemType.IsPrimary);\r\n\r\n return addressFormatExcludeList;\r\n };\r\n\r\n /**\r\n * Method to get all state/provinces.\r\n */\r\n private readonly _getStateProvinces = (): void => {\r\n if (\r\n !this.countryRegionId ||\r\n !(this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update)\r\n ) {\r\n return;\r\n }\r\n\r\n this.addressCommon.getStateProvinces(this.countryRegionId).then((result: StateProvinceInfo[]) => {\r\n const stateInfo = result.some(state => state.StateId === this.addUpdateAddress.State);\r\n\r\n // Reset state if selected state not found in the list.\r\n if (!stateInfo) {\r\n set(this.addUpdateAddress, { State: '' });\r\n }\r\n\r\n this.stateProvinceInfo = result;\r\n });\r\n };\r\n\r\n /**\r\n * Method to set default country region id.\r\n */\r\n private _setDefaultCountryRegionId(): void {\r\n const { request } = this.props.context;\r\n const market = request.channel?.ChannelCountryRegionISOCode;\r\n this.countryRegionId = this.addressCommon.getDefaultCountryRegionId(this.countryRegionId, this.countryRegions, market);\r\n }\r\n\r\n /**\r\n * Method to get default address region id.\r\n * @returns - Address object from existing addresses.\r\n */\r\n private readonly _getDefaultAddress = (): Address | undefined => {\r\n if (this.customerAddresses) {\r\n const primaryAddress = this.customerAddresses.find((address: Address) => address.IsPrimary);\r\n return primaryAddress || (this.customerAddresses.length > 0 ? this.customerAddresses[0] : undefined);\r\n }\r\n return undefined;\r\n };\r\n\r\n /**\r\n * Method to get address from express payment details from cart page.\r\n * @returns - Address.\r\n */\r\n private readonly _getAddressFromCartExpressPaymentDetails = (): Address | undefined => {\r\n if (this.expressPaymentDetailsFromCartPage) {\r\n const { tokenizedPaymentCard, address, isExpressAddressAppliedInCartPage } = this.expressPaymentDetailsFromCartPage;\r\n\r\n let addressFromCartExpress: Address | undefined;\r\n\r\n if (isExpressAddressAppliedInCartPage) {\r\n addressFromCartExpress = address ? this.getExpressAddress(address) : undefined;\r\n } else {\r\n addressFromCartExpress = tokenizedPaymentCard ? this.getAddressFromTokenizedPaymentCard(tokenizedPaymentCard) : undefined;\r\n }\r\n\r\n return addressFromCartExpress;\r\n }\r\n return undefined;\r\n };\r\n\r\n /**\r\n * Get address from tokenizedPaymentCard.\r\n * @param tokenizedPaymentCard -- The tokenizedPaymentCard from the payment.\r\n * @returns The address.\r\n */\r\n private readonly getAddressFromTokenizedPaymentCard = (tokenizedPaymentCard: TokenizedPaymentCard): Address => {\r\n const twoLetterIsoRegionName = tokenizedPaymentCard.Country;\r\n\r\n const threeLetterIsoRegionName = twoLetterIsoRegionName ? this.getThreeLetterIsoRegionName(twoLetterIsoRegionName) : undefined;\r\n\r\n if (threeLetterIsoRegionName && threeLetterIsoRegionName !== this.countryRegionId) {\r\n this._onCountryChange(threeLetterIsoRegionName);\r\n }\r\n\r\n const address: Address = {\r\n TwoLetterISORegionName: twoLetterIsoRegionName,\r\n Name: tokenizedPaymentCard.NameOnCard,\r\n Street: tokenizedPaymentCard.Address1,\r\n StreetNumber: tokenizedPaymentCard.Address2,\r\n City: tokenizedPaymentCard.City,\r\n State: tokenizedPaymentCard.State,\r\n ZipCode: tokenizedPaymentCard.Zip,\r\n Phone: tokenizedPaymentCard.Phone,\r\n ThreeLetterISORegionName: threeLetterIsoRegionName,\r\n AddressTypeValue: this.defaultAddressType\r\n };\r\n\r\n return address;\r\n };\r\n\r\n /**\r\n * Get address from expressAddress.\r\n * @param expressAddress -- The expressAddress.\r\n * @returns The address.\r\n */\r\n private readonly getExpressAddress = (expressAddress: Address): Address => {\r\n const twoLetterIsoRegionName = expressAddress.TwoLetterISORegionName;\r\n\r\n const threeLetterIsoRegionName = twoLetterIsoRegionName ? this.getThreeLetterIsoRegionName(twoLetterIsoRegionName) : undefined;\r\n\r\n if (threeLetterIsoRegionName && threeLetterIsoRegionName !== this.countryRegionId) {\r\n this._onCountryChange(threeLetterIsoRegionName);\r\n }\r\n\r\n const address: Address = {\r\n ...expressAddress,\r\n ThreeLetterISORegionName: threeLetterIsoRegionName,\r\n AddressTypeValue: this.defaultAddressType\r\n };\r\n\r\n return address;\r\n };\r\n\r\n /**\r\n * Get three letter ISO region name from two letter ISO region name.\r\n * @param twoLetterIsoRegionName -- The three letter ISO region name.\r\n * @returns The three letter ISO region name.\r\n */\r\n private readonly getThreeLetterIsoRegionName = (twoLetterIsoRegionName: string): string | undefined => {\r\n const countryRegion = this.countryRegions.find(country => {\r\n return country.ISOCode?.toLowerCase() === twoLetterIsoRegionName.toLowerCase();\r\n });\r\n\r\n return countryRegion?.CountryRegionId;\r\n };\r\n\r\n /**\r\n * Method to initialize all module state.\r\n */\r\n private readonly _initModuleState = (): void => {\r\n this.props.moduleState.init({\r\n status: this._canShip() ? 'updating' : 'disabled',\r\n onEdit: this.onEdit,\r\n onCancel: this.onCancel,\r\n onSubmit: this.onSubmit\r\n });\r\n\r\n const checkoutState = this.props.data.checkout.result;\r\n\r\n if (this._canShip()) {\r\n let defaultAddress;\r\n\r\n if (checkoutState?.checkoutCart.cart.ShippingAddress) {\r\n defaultAddress = checkoutState.checkoutCart.cart.ShippingAddress;\r\n } else if (this._getAddressFromCartExpressPaymentDetails()) {\r\n defaultAddress = this._getAddressFromCartExpressPaymentDetails();\r\n } else if (this._getDefaultAddress()) {\r\n defaultAddress = this._getDefaultAddress();\r\n } else {\r\n defaultAddress = checkoutState?.isExpressCheckoutApplied ? checkoutState.shippingAddressFromExpressCheckout : undefined;\r\n }\r\n\r\n if (defaultAddress && !this.addressCommon.isEmpty(defaultAddress)) {\r\n this._updateCurrentOperation(AddressOperation.Show, defaultAddress);\r\n this._setShippingAddress(defaultAddress);\r\n this._updateModuleState();\r\n checkoutState?.updateHasShippingAddress({ newHasShippingAddress: true });\r\n } else {\r\n this._updateCurrentOperation(AddressOperation.Add);\r\n checkoutState?.updateHasShippingAddress({ newHasShippingAddress: false });\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Method get called on submit address.\r\n */\r\n private readonly onSubmit = (): void => {\r\n switch (this.currentOperation) {\r\n case AddressOperation.Add:\r\n case AddressOperation.Update:\r\n this._onAddressAddUpdateSubmit();\r\n break;\r\n case AddressOperation.List:\r\n this._onSelectAddress();\r\n break;\r\n default:\r\n this.props.telemetry.error('Invalid operation');\r\n }\r\n };\r\n\r\n /**\r\n * Method get called on cancel.\r\n */\r\n private readonly onCancel = (): void => {\r\n switch (this.currentOperation) {\r\n case AddressOperation.Add:\r\n case AddressOperation.Update:\r\n this._clearAddressFields();\r\n if (!(!this.selectedAddress && !this.addressCommon.isAuthenticatedFlow())) {\r\n this._resetView();\r\n }\r\n\r\n break;\r\n case AddressOperation.List:\r\n if (this.selectedAddress) {\r\n this._resetView();\r\n }\r\n break;\r\n default:\r\n this.props.telemetry.error('Invalid operation');\r\n }\r\n };\r\n\r\n /**\r\n * Method get called on edit address.\r\n */\r\n private readonly onEdit = (): void => {\r\n if (this.addressCommon.isAuthenticatedFlow() && this.shippingAddress) {\r\n this._updateCurrentOperation(AddressOperation.List, this.shippingAddress);\r\n } else if (this.shippingAddress) {\r\n this._updateCurrentOperation(AddressOperation.Update, this.shippingAddress);\r\n }\r\n\r\n this._updateModuleState();\r\n };\r\n\r\n /**\r\n * Method to check if checkout cartlines are available fro shipping.\r\n * @returns - True/false as per the delivery mode.\r\n */\r\n private readonly _canShip = (): boolean => {\r\n const { checkout, channelDeliveryOptionConfig } = this.props.data;\r\n const { request } = this.props.context;\r\n const pickupDeliveryModeCode = request && request.channel && request.channel.PickupDeliveryModeCode;\r\n const emailDeliveryModeCode = request && request.channel && request.channel.EmailDeliveryModeCode;\r\n if (!checkout.result || !request.channel || checkout.result.checkoutCart.isEmpty || checkout.result.checkoutCart.hasInvoiceLine) {\r\n return false;\r\n }\r\n\r\n // @ts-expect-error: Type-checker not realizing above request.channel check\r\n return this.retailMultiplePickUpOptionEnabled\r\n ? checkout.result.checkoutCart.cart.CartLines?.some(cartLine =>\r\n cartLine.DeliveryMode && cartLine.DeliveryMode !== ''\r\n ? cartLine.DeliveryMode !==\r\n channelDeliveryOptionConfig.result?.PickupDeliveryModeCodes?.find(\r\n deliveryMode => deliveryMode === cartLine.DeliveryMode\r\n ) && cartLine.DeliveryMode !== emailDeliveryModeCode\r\n : cartLine\r\n )\r\n : checkout.result.checkoutCart.cart.CartLines?.some(cartLine =>\r\n cartLine.DeliveryMode && cartLine.DeliveryMode !== ''\r\n ? cartLine.DeliveryMode !== pickupDeliveryModeCode && cartLine.DeliveryMode !== emailDeliveryModeCode\r\n : cartLine\r\n );\r\n };\r\n\r\n /**\r\n * Method get called on select address.\r\n */\r\n private readonly _onSelectAddress = () => {\r\n this._updateCurrentOperation(AddressOperation.Show, this.addressListSelectedAddress);\r\n this._setShippingAddress(this.addressListSelectedAddress);\r\n this._updateModuleState();\r\n };\r\n\r\n /**\r\n * Method get called on goto add address.\r\n */\r\n private readonly _goToAddAddress = () => {\r\n this._setDefaultCountryRegionId();\r\n this._updateCurrentOperation(AddressOperation.Add);\r\n };\r\n\r\n /**\r\n * Method get called on add/update success.\r\n * @param response - Retail api response.\r\n */\r\n private readonly _onAddOrUpdateSuccess = (response: IAddressResponse) => {\r\n if (response.customerAddresses) {\r\n this.customerAddresses = response.customerAddresses;\r\n }\r\n\r\n if (response.address) {\r\n this._updateCurrentOperation(AddressOperation.Show, response.address);\r\n this._setShippingAddress(response.address);\r\n this._updateModuleState();\r\n }\r\n };\r\n\r\n /**\r\n * Method get called on set Shipping Address.\r\n * @param address - Retail Api address result.\r\n */\r\n private readonly _setShippingAddress = (address: Address): void => {\r\n if (this.props.data.checkout.result) {\r\n const newShippingAddress = { ...address };\r\n\r\n if (address.ThreeLetterISORegionName && !newShippingAddress.TwoLetterISORegionName) {\r\n newShippingAddress.TwoLetterISORegionName = this.addressFormat.getTwoLetterISORegionName(address.ThreeLetterISORegionName);\r\n }\r\n\r\n this.props.data.checkout.result.updateShippingAddress({ newShippingAddress });\r\n this.props.data.checkout.result.checkoutCart.updateShippingAddress({ newShippingAddress }).catch(error => {\r\n this.props.telemetry.error(error);\r\n });\r\n }\r\n };\r\n\r\n @computed private get shippingAddress(): Address | undefined {\r\n return this.props.data.checkout.result?.shippingAddress;\r\n }\r\n\r\n /**\r\n * Method get called on reset view.\r\n */\r\n private readonly _resetView = (): void => {\r\n switch (this.currentOperation) {\r\n case AddressOperation.Add:\r\n case AddressOperation.Update:\r\n this._updateCurrentOperation(\r\n this.addressCommon.isAuthenticatedFlow() ? AddressOperation.List : AddressOperation.Show,\r\n this.shippingAddress\r\n );\r\n break;\r\n default:\r\n this._updateCurrentOperation(AddressOperation.Show, this.shippingAddress);\r\n }\r\n this._updateModuleState();\r\n };\r\n\r\n /**\r\n * Update current operation.\r\n * @param operation - The address operation.\r\n * @param selectedAddress - The selected address.\r\n */\r\n private readonly _updateCurrentOperation = (operation: AddressOperation, selectedAddress?: Address) => {\r\n this.currentOperation = operation;\r\n this.selectedAddress = selectedAddress;\r\n\r\n if (this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update) {\r\n this.addUpdateAddress = { ...this.selectedAddress } || {};\r\n set(this.addUpdateAddress, {\r\n ThreeLetterISORegionName: this.addUpdateAddress.ThreeLetterISORegionName || this.countryRegionId\r\n });\r\n set(this.addUpdateAddress, {\r\n AddressTypeValue: this.addUpdateAddress.AddressTypeValue || this.defaultAddressType\r\n });\r\n } else if (this.currentOperation === AddressOperation.List) {\r\n this.addressListSelectedAddress = { ...this.selectedAddress } || {};\r\n }\r\n };\r\n\r\n /**\r\n * Update module state.\r\n */\r\n private readonly _updateModuleState = () => {\r\n if (this.currentOperation === AddressOperation.Show) {\r\n this.props.moduleState.onReady();\r\n } else if (this.isUpdating) {\r\n this.props.moduleState.onPending();\r\n } else {\r\n this.props.moduleState.onUpdating();\r\n }\r\n };\r\n\r\n /**\r\n * Method to check if the customer already has the address.\r\n * @param address - The address.\r\n */\r\n private readonly _isNewAddress = (address: Address): boolean => {\r\n for (const existingAddress of this.customerAddresses) {\r\n if (\r\n (address.Name ?? '') === existingAddress.Name &&\r\n (address.Street ?? '') === existingAddress.Street &&\r\n (address.StreetNumber ?? '') === existingAddress.StreetNumber &&\r\n (address.City ?? '') === existingAddress.City &&\r\n (address.State ?? '') === existingAddress.State &&\r\n (address.ZipCode ?? '') === existingAddress.ZipCode &&\r\n (address.Phone ?? '') === existingAddress.Phone &&\r\n (address.ThreeLetterISORegionName ?? '') === existingAddress.ThreeLetterISORegionName &&\r\n (address.AddressTypeValue ?? '') === existingAddress.AddressTypeValue\r\n ) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n };\r\n}\r\n\r\nexport default CheckoutShippingAddress;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/// \r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { CheckoutModule, ErrorLocation, IGiftCardExtend } from '@msdyn365-commerce/global-state';\r\nimport { Address, AddressPurpose, CountryRegionInfo, StateProvinceInfo } from '@msdyn365-commerce/retail-proxy';\r\nimport { IModuleStateProps, withModuleState, EnabledPaymentsForOBO } from '@msdyn365-commerce-modules/checkout-utilities';\r\nimport {\r\n getPayloadObject,\r\n getTelemetryAttributes,\r\n getTelemetryObject,\r\n IModuleProps,\r\n ITelemetryContent\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport { action, computed, observable, reaction, set } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\n\r\nimport { AutoSuggest, IAddressShowProps } from '@msdyn365-commerce-modules/address';\r\nimport { IAutoSuggestOptions } from '@msdyn365-commerce-modules/address';\r\nimport { AddressCommon } from '@msdyn365-commerce-modules/address';\r\nimport { AddressFormat } from '@msdyn365-commerce-modules/address';\r\nimport { AddressItemType } from '@msdyn365-commerce-modules/address';\r\nimport { AddressMetaData } from '@msdyn365-commerce-modules/address';\r\nimport { AddressOperation, AddressType, IAddressResource, IAddressResponse } from '@msdyn365-commerce-modules/address';\r\nimport { AddressAddUpdate, IAddressAddUpdateProps } from '@msdyn365-commerce-modules/address';\r\n// import { AddressBillingCheckbox } from '@msdyn365-commerce-modules/address';\r\nimport { AddressBillingHeading } from '@msdyn365-commerce-modules/address';\r\nimport { AddressShow } from '@msdyn365-commerce-modules/address';\r\nimport { IGdnCheckoutBillingAddressData } from './gdn-checkout-billing-address.data';\r\nimport { IGdnCheckoutBillingAddressProps } from './gdn-checkout-billing-address.props.autogenerated';\r\nimport { ErrorComponent } from '@msdyn365-commerce-modules/address';\r\nimport { focusOnCheckoutError } from '@msdyn365-commerce-modules/address';\r\n\r\n/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nexport interface IAddressBillingCheckbox {\r\n isChecked: boolean;\r\n value: string;\r\n ariaLabel: string;\r\n text: string;\r\n telemetryContent?: ITelemetryContent;\r\n onChange(event: React.ChangeEvent): void;\r\n}\r\n\r\nexport interface IAdressInput {\r\n id?: string;\r\n name?: string;\r\n className: string;\r\n type: string;\r\n value: string;\r\n maxLength?: number;\r\n autoFocus?: boolean;\r\n additionalAddributes?: object;\r\n telemetryContent?: ITelemetryContent;\r\n onChange(event: React.ChangeEvent): void;\r\n}\r\n\r\n/**\r\n * Props interface.\r\n */\r\nexport interface IProps extends IGdnCheckoutBillingAddressProps, IModuleStateProps {}\r\n\r\n/**\r\n * Checkout billing address view state interface.\r\n */\r\n\r\nexport interface ICheckoutBillingAddressViewState {\r\n isShowAddress: boolean;\r\n isShowAddOrUpdateAddress: boolean;\r\n isShowRadioButtons: boolean;\r\n errorMessage?: string;\r\n selectedBillingOption: string;\r\n}\r\n\r\n/**\r\n * Checkout billing address view props interface.\r\n */\r\nexport interface ICheckoutBillingAddressViewProps extends IProps {\r\n className: string;\r\n currentOperation: AddressOperation;\r\n selectedAddress?: Address;\r\n addUpdateAddress: Address;\r\n countryRegionId: string;\r\n stateProvinceInfo?: StateProvinceInfo[];\r\n validationError: object;\r\n addressActionResponse?: IAddressResponse;\r\n viewState: ICheckoutBillingAddressViewState;\r\n CheckoutBillingAddress: IModuleProps;\r\n sameAsShippingRadioButton: React.ReactNode;\r\n primaryAccountAddressRadioButton: React.ReactNode;\r\n newAddressRadioButton: React.ReactNode;\r\n heading: React.ReactNode;\r\n showAddress: IAddressShowProps;\r\n showAddOrUpdateAddress: IAddressAddUpdateProps;\r\n alert?: React.ReactNode;\r\n checkoutErrorRef?: React.RefObject;\r\n selectedBillingAddressOption: string;\r\n}\r\n\r\nexport interface IAddressShowItem {\r\n key: string;\r\n description: React.ReactNode;\r\n}\r\n\r\nexport enum BillingAddressOption {\r\n SameAsShipping = 'sameAsShipping',\r\n PrimaryAccount = 'primaryAccount',\r\n NewAddress = 'newAddress'\r\n}\r\n\r\n/**\r\n *\r\n * CheckoutBillingAddress component.\r\n * @extends {React.PureComponent>}\r\n */\r\n// @ts-expect-error\r\n@withModuleState\r\n@observer\r\nclass CheckoutBillingAddress extends React.Component {\r\n @observable private currentOperation: AddressOperation;\r\n\r\n @observable private isBillingAddressSameAsShipping: boolean;\r\n\r\n @observable private isPrimaryAccountAddress: boolean;\r\n\r\n @observable private isAddNewAddress: boolean;\r\n\r\n @observable private selectedAddress?: Address;\r\n\r\n @observable private addUpdateAddress: Address;\r\n\r\n @observable private countryRegionId: string = 'USA';\r\n\r\n @observable private stateProvinceInfo?: StateProvinceInfo[];\r\n\r\n @observable private validationError: object;\r\n\r\n @observable private readonly addressActionResponse?: IAddressResponse;\r\n\r\n private readonly addressCommon: AddressCommon;\r\n\r\n private addressFormat: AddressFormat;\r\n\r\n private countryRegions: CountryRegionInfo[] = [];\r\n\r\n private addressPurposes: AddressPurpose[] = [];\r\n\r\n private readonly resources: IAddressResource;\r\n\r\n private readonly defaultAddressType: number = 6;\r\n\r\n // private addRenderRef: React.RefObject;\r\n private readonly telemetryContent?: ITelemetryContent;\r\n\r\n private autoSuggest?: AutoSuggest;\r\n\r\n private readonly checkoutErrorRef: React.RefObject = React.createRef();\r\n\r\n public constructor(props: IProps) {\r\n super(props);\r\n const { context, data, resources, telemetry } = this.props;\r\n\r\n this.addUpdateAddress = {};\r\n this.validationError = {};\r\n this.isBillingAddressSameAsShipping = false;\r\n this.isAddNewAddress = false;\r\n this.isPrimaryAccountAddress = false;\r\n this.resources = resources;\r\n this.currentOperation = AddressOperation.List;\r\n this.addressPurposes = data.addressPurposes.result || [];\r\n this.countryRegions = data.countryRegions.result || [];\r\n this.stateProvinceInfo = data.countryStates.result || [];\r\n this.addressCommon = new AddressCommon(context, resources, telemetry);\r\n this.addressFormat = new AddressFormat(\r\n this.countryRegions,\r\n new AddressMetaData({ ...resources }, this._getAddressFormatExcludeList()),\r\n this.addressPurposes\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\r\n this.state = {\r\n isShowAddress: false,\r\n isShowAddOrUpdateAddress: false,\r\n isShowRadioButtons: false,\r\n errorMessage: '',\r\n selectedBillingOption: ''\r\n };\r\n\r\n // This.addRenderRef = React.createRef();\r\n }\r\n\r\n public async componentDidMount(): Promise {\r\n const {\r\n context: {\r\n telemetry,\r\n actionContext: {\r\n requestContext: { channel }\r\n }\r\n },\r\n config: { autoSuggestionEnabled, autoSuggestOptions }\r\n } = this.props;\r\n\r\n const initialBillingOption = this.props.config.billingAddressOption || BillingAddressOption.SameAsShipping;\r\n\r\n this.setState({ selectedBillingOption: initialBillingOption }, () => {\r\n this._onBillingAddressOptionChange({\r\n currentTarget: { value: initialBillingOption }\r\n } as React.ChangeEvent);\r\n });\r\n\r\n // Initializing data props\r\n this._dataInitialize(this.props);\r\n\r\n this.props.data.checkout.then(() => {\r\n this._setDefaultCountryRegionId();\r\n this._initModuleState();\r\n });\r\n\r\n reaction(\r\n () => this.countryRegionId,\r\n () => {\r\n this._getStateProvinces();\r\n }\r\n );\r\n\r\n reaction(\r\n () => this.currentOperation,\r\n () => {\r\n this._getStateProvinces();\r\n }\r\n );\r\n\r\n reaction(\r\n () => this.props.data.checkout.result?.shippingAddress,\r\n shippingAddress => {\r\n if (shippingAddress && this.isBillingAddressSameAsShipping) {\r\n this.isBillingAddressSameAsShipping = true;\r\n this.isAddNewAddress = false;\r\n this.isPrimaryAccountAddress = false;\r\n this._updateCurrentOperation(AddressOperation.Show, shippingAddress);\r\n } else if (this.getPrimaryAddress && this.isPrimaryAccountAddress) {\r\n this._updateCurrentOperation(AddressOperation.Show, this.getPrimaryAddress);\r\n this.isBillingAddressSameAsShipping = false;\r\n this.isAddNewAddress = false;\r\n this.isPrimaryAccountAddress = true;\r\n } else if (this.isAddNewAddress) {\r\n this.isBillingAddressSameAsShipping = false;\r\n this.isAddNewAddress = true;\r\n this.isPrimaryAccountAddress = false;\r\n this._updateCurrentOperation(AddressOperation.Update, this.billingAddress);\r\n }\r\n }\r\n );\r\n\r\n reaction(\r\n () => this.isBillingAddressRequried,\r\n isBillingAddressRequried => {\r\n if (isBillingAddressRequried) {\r\n if (this.props.moduleState.isDisabled) {\r\n this.onEdit();\r\n }\r\n } else {\r\n this.props.data.checkout.result?.removeBillingAddress({});\r\n this.props.moduleState.onDisable();\r\n }\r\n }\r\n );\r\n\r\n if (autoSuggestionEnabled) {\r\n if (channel && !channel.BingMapsApiKey) {\r\n telemetry.error('BingMapsApiKey is missing.');\r\n return;\r\n }\r\n\r\n if (channel && !channel.BingMapsEnabled) {\r\n telemetry.error('Map is disabled from HQ.');\r\n return;\r\n }\r\n\r\n const options: IAutoSuggestOptions = { ...autoSuggestOptions };\r\n this.autoSuggest = new AutoSuggest(\r\n telemetry,\r\n options,\r\n channel?.BingMapsApiKey,\r\n channel?.ChannelCountryRegionISOCode,\r\n channel?.DefaultLanguageId\r\n );\r\n\r\n // Customer doesn't have any address. Then add view will be loaded directly. Code for the same to handle that\r\n if (\r\n this.props.data.storeSelectorStateManager.result &&\r\n (this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update)\r\n ) {\r\n await this.autoSuggest._loadMapAPI(await this.props.data.storeSelectorStateManager);\r\n }\r\n\r\n reaction(\r\n () =>\r\n this.props.data.storeSelectorStateManager.result?.loadMapApi &&\r\n (this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update),\r\n async () => {\r\n await this.autoSuggest?._loadMapAPI(await this.props.data.storeSelectorStateManager);\r\n }\r\n );\r\n\r\n reaction(\r\n () => this.props.data.storeSelectorStateManager.result?.isMapApiLoaded,\r\n async () => {\r\n await this._attachMapAutoSuggest();\r\n }\r\n );\r\n }\r\n\r\n if (this.props.data.checkout.result?.shouldEnableCheckoutErrorDisplayMessaging) {\r\n reaction(\r\n () => this.props.data.checkout.result?.checkoutError,\r\n checkoutError => {\r\n if (\r\n checkoutError &&\r\n checkoutError.errorLocation === ErrorLocation.CheckoutBillingAddress &&\r\n checkoutError.errorMessage\r\n ) {\r\n this._setErrorMessage(checkoutError.errorMessage);\r\n }\r\n }\r\n );\r\n\r\n reaction(\r\n () => this.props.data.checkout.result?.checkoutErrorFocus,\r\n checkoutErrorFocus => {\r\n if (checkoutErrorFocus === CheckoutModule.CheckoutBillingAddress) {\r\n focusOnCheckoutError(this.checkoutErrorRef, this.props.context.actionContext);\r\n }\r\n }\r\n );\r\n }\r\n }\r\n\r\n public async componentDidUpdate(): Promise {\r\n if (this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update) {\r\n if (this.props.data.storeSelectorStateManager.result?.isMapApiLoaded) {\r\n await this._attachMapAutoSuggest();\r\n }\r\n } else {\r\n this.autoSuggest?.disposeAutoSuggest();\r\n }\r\n }\r\n\r\n public shouldComponentUpdate(\r\n nextProps: IGdnCheckoutBillingAddressProps,\r\n nextState: ICheckoutBillingAddressViewState\r\n ): boolean {\r\n if (this.state === nextState && this.props.data === nextProps.data) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n /**\r\n * Address input.\r\n * @param props - Configuration of the functional component.\r\n * @returns React functional component.\r\n */\r\n public AddressInputFunctionComponent: React.FC = (props: IAdressInput) => {\r\n const {\r\n id: itemId,\r\n name,\r\n className,\r\n type,\r\n value,\r\n maxLength,\r\n additionalAddributes,\r\n autoFocus: shouldUseAutoFocus,\r\n telemetryContent,\r\n onChange\r\n } = props;\r\n\r\n const payLoad = getPayloadObject('click', telemetryContent!, name!);\r\n const attributes = getTelemetryAttributes(telemetryContent!, payLoad);\r\n return (\r\n \r\n );\r\n };\r\n\r\n public AddressBillingCheckbox: React.FC = ({\r\n isChecked,\r\n value,\r\n ariaLabel,\r\n text,\r\n telemetryContent,\r\n onChange\r\n }) => {\r\n const additionalAttributes = {\r\n checked: isChecked,\r\n 'aria-checked': isChecked\r\n };\r\n\r\n return (\r\n \r\n );\r\n };\r\n\r\n public render(): JSX.Element | null {\r\n if (!this.isBillingAddressRequried || this._shouldHideBillingAddressForOBO) {\r\n return null;\r\n }\r\n\r\n const {\r\n resources,\r\n moduleState: { hasError }\r\n } = this.props;\r\n\r\n const { renderView, config } = this.props;\r\n\r\n const errorMessage = this.state.errorMessage;\r\n const selectedBillingAddressOption = this.state.selectedBillingOption;\r\n\r\n const viewProps = {\r\n ...this.props,\r\n currentOperation: this.currentOperation,\r\n selectedAddress: this.selectedAddress,\r\n selectedBillingAddressOption: selectedBillingAddressOption,\r\n addUpdateAddress: this.addUpdateAddress,\r\n countryRegionId: this.countryRegionId,\r\n stateProvinceInfo: this.stateProvinceInfo,\r\n validationError: this.validationError,\r\n addressActionResponse: this.addressActionResponse,\r\n className: config.className,\r\n viewState: {\r\n isShowAddress: this.selectedAddress && this.currentOperation === AddressOperation.Show,\r\n isShowAddOrUpdateAddress: this.currentOperation !== AddressOperation.Show,\r\n isShowRadioButtons: this.isCartContainsItemsForShipping && this.props.moduleState.isUpdating\r\n },\r\n CheckoutBillingAddress: {\r\n moduleProps: this.props,\r\n className: classnames('ms-checkout-billing-address', config.className)\r\n },\r\n heading: ,\r\n alert: hasError && errorMessage && ,\r\n checkoutErrorRef: this.checkoutErrorRef,\r\n\r\n sameAsShippingRadioButton: (\r\n \r\n ),\r\n primaryAccountAddressRadioButton: this.getPrimaryAddress ? (\r\n \r\n ) : null,\r\n newAddressRadioButton: (\r\n \r\n ),\r\n showAddress: this._renderShowAddress(),\r\n showAddOrUpdateAddress: this._renderAddOrUpdateAddress()\r\n };\r\n\r\n return renderView(viewProps) as React.ReactElement;\r\n }\r\n\r\n /**\r\n * On suggestion selected.\r\n * @param result - The suggestion result.\r\n */\r\n @action\r\n private readonly _onSuggestionSelected = async (result: Microsoft.Maps.ISuggestionResult): Promise => {\r\n this._clearAddressFields();\r\n const address = this.addressFormat.getTranformedAddress(result, this.stateProvinceInfo);\r\n set(this.addUpdateAddress, { Street: '' });\r\n set(this.addUpdateAddress, { ZipCode: address.ZipCode });\r\n set(this.addUpdateAddress, { CountyName: address.CountyName });\r\n set(this.addUpdateAddress, { City: address.City });\r\n set(this.addUpdateAddress, { State: address.State });\r\n set(this.addUpdateAddress, { DistrictName: address.DistrictName });\r\n set(this.addUpdateAddress, { FullAddress: address.FullAddress });\r\n\r\n // Bing autosuggest put the complete address in the Street input box. Updating the street input box to show only street address.\r\n setTimeout(() => {\r\n set(this.addUpdateAddress, { Street: address.Street });\r\n }, 0);\r\n };\r\n\r\n /**\r\n * Clear address fields.\r\n */\r\n @action\r\n private readonly _clearAddressFields = (): void => {\r\n const addressFormatItem = this.addressFormat.getAddressFormat(\r\n this.addUpdateAddress.ThreeLetterISORegionName || this.countryRegionId\r\n );\r\n addressFormatItem.forEach(format => {\r\n // @ts-ignore\r\n if (this.addUpdateAddress[format.name] !== undefined && !this.autoSuggest?.excludedAddressFields.includes(format.name)) {\r\n // @ts-ignore\r\n this.addressFormat[format.name] = '';\r\n }\r\n });\r\n this._clearValidation();\r\n };\r\n\r\n /**\r\n * Clear validation.\r\n */\r\n @action\r\n private readonly _clearValidation = (): void => {\r\n this.validationError = {};\r\n };\r\n\r\n /**\r\n * On address update.\r\n * @param name - Name.\r\n * @param value - Value.\r\n */\r\n private readonly onAddressAddUpdate = (name: string, value: string) => {\r\n set(this.addUpdateAddress, { [name]: value });\r\n this.addressFormat.validateAddressFormat(this.addUpdateAddress, this.validationError, this.countryRegionId, name);\r\n };\r\n\r\n /**\r\n * Method data initialization.\r\n * @param props -The checkout address properties.\r\n */\r\n private readonly _dataInitialize = (props: IProps): void => {\r\n const { data } = props;\r\n\r\n reaction(\r\n () => data.countryRegions.result,\r\n () => {\r\n this.countryRegions = data.countryRegions.result ?? [];\r\n }\r\n );\r\n\r\n reaction(\r\n () => data.addressPurposes.result,\r\n () => {\r\n this.addressPurposes = data.addressPurposes.result ?? [];\r\n }\r\n );\r\n\r\n reaction(\r\n () => data.countryStates.result,\r\n () => {\r\n this.stateProvinceInfo = data.countryStates.result ?? [];\r\n }\r\n );\r\n };\r\n\r\n /**\r\n * Render add or update address function.\r\n * @returns - Address add update props.\r\n */\r\n private readonly _renderAddOrUpdateAddress = (): IAddressAddUpdateProps => {\r\n return AddressAddUpdate({\r\n resources: this.resources,\r\n addressType: AddressType.Billing,\r\n addressFormat: this.addressFormat.getAddressFormat(this.addUpdateAddress.ThreeLetterISORegionName ?? this.countryRegionId),\r\n defaultCountryRegionId: this.countryRegionId,\r\n defaultAddressType: this.defaultAddressType,\r\n selectedAddress: this.addUpdateAddress,\r\n validationError: this.validationError,\r\n addressActionResponse: this.addressActionResponse,\r\n dropdownDisplayData: this.addressFormat.getPrefilledAddressDropdownData(\r\n this.resources.addressStateDefaultSelectionText,\r\n this.stateProvinceInfo\r\n ),\r\n telemetryContent: this.telemetryContent,\r\n onInputChange: this._onAddressAddUpdateInputChange,\r\n onDropdownChange: this._onAddressAddUpdateDropdownChange,\r\n hasExternalSubmitGroup: this.props.moduleState.hasExternalSubmitGroup,\r\n onSave: this._onSubmitAddress,\r\n onCancel: this._resetView\r\n });\r\n };\r\n\r\n private _renderShowAddress(): IAddressShowProps | null {\r\n if (this.selectedAddress) {\r\n return AddressShow({\r\n address: this.selectedAddress,\r\n addressFormat: this.addressFormat.getAddressFormat(this.selectedAddress.ThreeLetterISORegionName ?? ''),\r\n addressPurposes: this.addressPurposes\r\n });\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * On country region change function.\r\n * @param countryRegionId - Country region Id.\r\n */\r\n private readonly _onCountryChange = (countryRegionId: string) => {\r\n this.countryRegionId = countryRegionId;\r\n const twoLetterIsoRegionName = this.addressFormat.getTwoLetterISORegionName(countryRegionId);\r\n set(this.addUpdateAddress, { ThreeLetterISORegionName: countryRegionId });\r\n set(this.addUpdateAddress, { TwoLetterISORegionName: twoLetterIsoRegionName });\r\n this.autoSuggest?.changeAutoSuggestionCountryCode(twoLetterIsoRegionName);\r\n this._clearAddressFields();\r\n };\r\n\r\n /**\r\n * Gets address format for exclude list.\r\n * @returns - Address item type.\r\n */\r\n private readonly _getAddressFormatExcludeList = (): AddressItemType[] => {\r\n const { config } = this.props;\r\n const addressFormatExcludeList: AddressItemType[] = [];\r\n\r\n if (!config.showAddressType) {\r\n addressFormatExcludeList.push(AddressItemType.AddressTypeValue);\r\n }\r\n\r\n addressFormatExcludeList.push(AddressItemType.IsPrimary);\r\n\r\n return addressFormatExcludeList;\r\n };\r\n\r\n /**\r\n * Attach map auto suggest.\r\n */\r\n private readonly _attachMapAutoSuggest = async (): Promise => {\r\n const {\r\n data: {\r\n storeSelectorStateManager: { result: storeSelectorStateManager }\r\n }\r\n } = this.props;\r\n\r\n if (storeSelectorStateManager?.isMapApiLoaded) {\r\n this.autoSuggest?.attachAutoSuggest('#billing_addressstreet', '#billing_addressstreet_container', this._onSuggestionSelected);\r\n }\r\n };\r\n\r\n /**\r\n * On address add update input change.\r\n * @param event - The event.\r\n */\r\n private readonly _onAddressAddUpdateInputChange = (event: React.ChangeEvent): void => {\r\n const value = (event.target.value || '').replace(new RegExp('[<>]', 'gi'), '');\r\n this.onAddressAddUpdate(event.target.name, value);\r\n };\r\n\r\n /**\r\n * On address add update dropdown change.\r\n * @param event - The event.\r\n */\r\n private readonly _onAddressAddUpdateDropdownChange = (event: React.ChangeEvent): void => {\r\n this.onAddressAddUpdate(event.target.name, event.target.value);\r\n\r\n if (event.target.name === AddressItemType[AddressItemType.ThreeLetterISORegionName]) {\r\n this._onCountryChange(event.target.value);\r\n }\r\n };\r\n\r\n /**\r\n * Gets state provinces.\r\n */\r\n private readonly _getStateProvinces = (): void => {\r\n if (\r\n !this.countryRegionId ||\r\n !(this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update)\r\n ) {\r\n return;\r\n }\r\n\r\n this.addressCommon.getStateProvinces(this.countryRegionId).then((result: StateProvinceInfo[]) => {\r\n const stateInfo = result.some(state => state.StateId === this.addUpdateAddress.State);\r\n\r\n // Reset state if selected state not found in the list.\r\n if (!stateInfo) {\r\n set(this.addUpdateAddress, { State: '' });\r\n }\r\n this.stateProvinceInfo = result;\r\n });\r\n };\r\n\r\n /**\r\n * Initialize module state.\r\n */\r\n private readonly _initModuleState = (): void => {\r\n this.props.moduleState.init({\r\n status: this.isBillingAddressRequried ? 'updating' : 'disabled',\r\n onEdit: this.onEdit,\r\n onCancel: this.onCancel,\r\n onSubmit: this.onSubmit\r\n });\r\n\r\n const { billingAddress, isBillingAddressSameAsShippingAddress } = this.props.data.checkout.result ?? {};\r\n\r\n if (this.isBillingAddressRequried) {\r\n if (billingAddress) {\r\n this.isBillingAddressSameAsShipping = isBillingAddressSameAsShippingAddress ?? false;\r\n this._updateCurrentOperation(AddressOperation.Show, billingAddress);\r\n this._updateModuleState();\r\n } else if (this.isCartContainsItemsForShipping) {\r\n this.isBillingAddressSameAsShipping = true;\r\n this._updateCurrentOperation(AddressOperation.Show, this.shippingAddress);\r\n } else {\r\n this.isBillingAddressSameAsShipping = false;\r\n this._updateCurrentOperation(AddressOperation.Add);\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Sets default country region Id.\r\n */\r\n private _setDefaultCountryRegionId(): void {\r\n const { request } = this.props.context;\r\n const market = request.channel?.ChannelCountryRegionISOCode;\r\n\r\n this.countryRegionId = this.addressCommon.getDefaultCountryRegionId(this.countryRegionId, this.countryRegions, market);\r\n }\r\n\r\n /**\r\n * On change - Billing address same as shipping.\r\n * @param event - The event.\r\n */\r\n private _onBillingAddressOptionChange = (event: React.ChangeEvent) => {\r\n const selectedOption = event.currentTarget.value;\r\n this.setState({ selectedBillingOption: selectedOption });\r\n\r\n // Reset flags\r\n this.isBillingAddressSameAsShipping = false;\r\n this.isAddNewAddress = false;\r\n this.isPrimaryAccountAddress = false;\r\n\r\n if (selectedOption === BillingAddressOption.SameAsShipping && this.shippingAddress) {\r\n this._updateCurrentOperation(AddressOperation.Show, this.shippingAddress);\r\n this.isBillingAddressSameAsShipping = true;\r\n } else if (selectedOption === BillingAddressOption.NewAddress) {\r\n this._updateCurrentOperation(AddressOperation.Add, this.billingAddress);\r\n this.isAddNewAddress = true;\r\n } else if (selectedOption === BillingAddressOption.PrimaryAccount) {\r\n const primaryAddress = this.getPrimaryAddress;\r\n if (!primaryAddress) {\r\n return;\r\n }\r\n if (primaryAddress) {\r\n this._updateCurrentOperation(AddressOperation.Show, primaryAddress);\r\n this.selectedAddress = primaryAddress;\r\n this.isPrimaryAccountAddress = true;\r\n } else {\r\n console.error('No primary address found.');\r\n }\r\n }\r\n };\r\n\r\n @computed private get isCartContainsItemsForShipping(): boolean {\r\n const { request } = this.props.context;\r\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\r\n const { channelDeliveryOptionConfig, featureState } = this.props.data;\r\n const retailMultiplePickUpOptionEnabled = featureState.result?.find(feature => feature.Name === multiplePickupStoreSwitchName)\r\n ?.IsEnabled;\r\n\r\n const pickupDeliveryModeCode = request.channel?.PickupDeliveryModeCode;\r\n const emailDeliveryModeCode = request.channel?.EmailDeliveryModeCode;\r\n\r\n // If hasInvoiceLine is true, there are only invoices no items in cart and return false here\r\n return this.props.data.checkout.result?.checkoutCart.hasInvoiceLine\r\n ? false\r\n : retailMultiplePickUpOptionEnabled\r\n ? ((this.props.data.checkout.result && this.props.data.checkout.result.checkoutCart.cart.CartLines) || []).some(cartLine =>\r\n cartLine.DeliveryMode && cartLine.DeliveryMode !== ''\r\n ? cartLine.DeliveryMode !==\r\n channelDeliveryOptionConfig.result?.PickupDeliveryModeCodes?.find(\r\n deliveryMode => deliveryMode === cartLine.DeliveryMode\r\n ) && cartLine.DeliveryMode !== emailDeliveryModeCode\r\n : cartLine\r\n )\r\n : ((this.props.data.checkout.result && this.props.data.checkout.result.checkoutCart.cart.CartLines) || []).some(cartLine =>\r\n cartLine.DeliveryMode && cartLine.DeliveryMode !== ''\r\n ? cartLine.DeliveryMode !== pickupDeliveryModeCode && cartLine.DeliveryMode !== emailDeliveryModeCode\r\n : cartLine\r\n );\r\n }\r\n\r\n @computed private get billingAddress(): Address | undefined {\r\n return this.props.data.checkout.result?.billingAddress;\r\n }\r\n\r\n @computed private get shippingAddress(): Address | undefined {\r\n return this.props.data.checkout.result?.shippingAddress;\r\n }\r\n\r\n @computed private get getLoyaltyAmount(): number {\r\n const checkoutState = this.props.data.checkout.result;\r\n return checkoutState?.loyaltyAmount ? checkoutState.loyaltyAmount : 0;\r\n }\r\n\r\n @computed private get getGiftCardTotalAmount(): number {\r\n const checkoutState = this.props.data.checkout.result;\r\n if (!checkoutState || !checkoutState.giftCardExtends) {\r\n return 0;\r\n }\r\n return checkoutState.giftCardExtends.reduce((count: number, giftCard: IGiftCardExtend) => {\r\n return count + (giftCard.Balance || 0);\r\n }, 0);\r\n }\r\n\r\n @computed\r\n private get getPrimaryAddress(): Address | undefined {\r\n return this.props.data.address.result?.find((address: Address) => address.IsPrimary);\r\n }\r\n\r\n @computed private get getCustomerAccountAmount(): number {\r\n const checkoutState = this.props.data.checkout.result;\r\n const defaultAmount = 0;\r\n\r\n return checkoutState?.customerAccountAmount ?? defaultAmount;\r\n }\r\n\r\n @computed private get shouldPaidByCard(): boolean {\r\n const {\r\n data: { checkout },\r\n config\r\n } = this.props;\r\n if (!checkout.result) {\r\n return false;\r\n }\r\n\r\n const checkoutResult = checkout.result;\r\n const cart = checkoutResult.checkoutCart.cart;\r\n if (!cart || !cart.CartLines || cart.CartLines.length === 0) {\r\n return false;\r\n }\r\n\r\n const { paymentTenderType, tokenizedPaymentCard } = checkoutResult;\r\n const isPaidByOtherPaymentSource = config.paymenTenderType !== paymentTenderType && tokenizedPaymentCard;\r\n\r\n // Use payment card when it is not free or gift card balance + Loyalty amount can not cover the total amount\r\n const amountDue = (cart.TotalAmount || 0) - this.getGiftCardTotalAmount - this.getLoyaltyAmount - this.getCustomerAccountAmount;\r\n\r\n return amountDue > 0 && !isPaidByOtherPaymentSource;\r\n }\r\n\r\n @computed private get isBillingAddressRequried(): boolean {\r\n return (\r\n this.shouldPaidByCard &&\r\n (!this.props.data.checkout?.result?.isPaymentVerificationRedirection ||\r\n !!this.props.data.checkout?.result?.isCheckoutCallFailed)\r\n );\r\n }\r\n\r\n @computed private get _shouldHideBillingAddressForOBO(): boolean {\r\n return Msdyn365.isOboRequest(this.props.context.request) && EnabledPaymentsForOBO.PaymentInstrument === 0;\r\n }\r\n\r\n /**\r\n * On submit address.\r\n */\r\n private readonly _onSubmitAddress = (): void => {\r\n if (!this.addressFormat.validateAddressFormat(this.addUpdateAddress, this.validationError, this.countryRegionId)) {\r\n this.props.moduleState.setHasError(true);\r\n\r\n if (\r\n this.props.data.checkout.result?.shouldEnableSinglePaymentAuthorizationCheckout &&\r\n this.props.data.checkout.result?.isPaymentSectionContainerHasError\r\n ) {\r\n this.props.data.checkout.result.updateIsBillingAddressHasError({ newIsBillingAddressHasError: true });\r\n }\r\n\r\n return;\r\n }\r\n\r\n this._setBillingAddress(this.addUpdateAddress);\r\n this._updateCurrentOperation(AddressOperation.Show, this.addUpdateAddress);\r\n this._updateModuleState();\r\n };\r\n\r\n /**\r\n * On submit.\r\n */\r\n private readonly onSubmit = (): void => {\r\n switch (this.currentOperation) {\r\n case AddressOperation.Add:\r\n case AddressOperation.Update:\r\n this.props.telemetry.information('Billing address submit for Add or Update operation.');\r\n this._onSubmitAddress();\r\n break;\r\n case AddressOperation.Show:\r\n this.props.telemetry.information('Billing address submit for Show operation.');\r\n if (this.selectedAddress) {\r\n this._setBillingAddress(this.selectedAddress);\r\n this._updateCurrentOperation(AddressOperation.Show, this.selectedAddress);\r\n this._updateModuleState();\r\n }\r\n break;\r\n default:\r\n this.props.telemetry.error('Invalid operation');\r\n }\r\n };\r\n\r\n /**\r\n * On cancel.\r\n */\r\n private readonly onCancel = (): void => {\r\n switch (this.currentOperation) {\r\n case AddressOperation.Add:\r\n case AddressOperation.Update:\r\n this.props.telemetry.information('Billing address cancel for Add or Update operation.');\r\n this._resetView();\r\n this._clearAddressFields();\r\n break;\r\n case AddressOperation.Show:\r\n this.props.telemetry.information('Billing address cancel for Show operation.');\r\n this._resetView();\r\n break;\r\n default:\r\n this.props.telemetry.error('Invalid operation');\r\n }\r\n };\r\n\r\n /**\r\n * On edit.\r\n */\r\n private readonly onEdit = (): void => {\r\n this.props.telemetry.information('Billing address onEdit is called.');\r\n\r\n if (this.isBillingAddressSameAsShipping && this.shippingAddress && this.isCartContainsItemsForShipping) {\r\n this._updateCurrentOperation(AddressOperation.Show, this.shippingAddress);\r\n } else if (this.isPrimaryAccountAddress && this.getPrimaryAddress) {\r\n this._updateCurrentOperation(AddressOperation.Show, this.selectedAddress);\r\n } else {\r\n this._updateCurrentOperation(AddressOperation.Add, this.billingAddress);\r\n }\r\n this.props.moduleState.onUpdating();\r\n };\r\n\r\n /**\r\n * Sets billing address.\r\n * @param address - The address.\r\n */\r\n private readonly _setBillingAddress = (address: Address): void => {\r\n if (this.props.data.checkout.result) {\r\n const newBillingAddress = { ...address };\r\n\r\n if (address.ThreeLetterISORegionName && !newBillingAddress.TwoLetterISORegionName) {\r\n newBillingAddress.TwoLetterISORegionName = this.addressFormat.getTwoLetterISORegionName(address.ThreeLetterISORegionName);\r\n }\r\n\r\n this.props.data.checkout.result.updateBillingAddress({\r\n newBillingAddress,\r\n additionalProperties: {\r\n isBillingAddressSameAsShippingAddress: this.isBillingAddressSameAsShipping\r\n }\r\n });\r\n }\r\n };\r\n\r\n /**\r\n * Reset view.\r\n */\r\n private readonly _resetView = () => {\r\n this._updateCurrentOperation(AddressOperation.Show, this.billingAddress);\r\n this._updateModuleState();\r\n };\r\n\r\n /**\r\n * Update current operation.\r\n * @param operation - Address operation\r\n * @param selectedAddress - The selected address.\r\n */\r\n private readonly _updateCurrentOperation = (operation: AddressOperation, selectedAddress?: Address) => {\r\n this.currentOperation = operation;\r\n this.selectedAddress = selectedAddress;\r\n\r\n if (this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update) {\r\n this.addUpdateAddress = this.selectedAddress ? { ...this.selectedAddress } : {};\r\n set(this.addUpdateAddress, {\r\n ThreeLetterISORegionName: this.addUpdateAddress.ThreeLetterISORegionName || this.countryRegionId\r\n });\r\n set(this.addUpdateAddress, { AddressTypeValue: this.addUpdateAddress.AddressTypeValue || this.defaultAddressType });\r\n }\r\n };\r\n\r\n /**\r\n * Updates the module state.\r\n */\r\n private readonly _updateModuleState = () => {\r\n if (this.currentOperation === AddressOperation.Show) {\r\n this.props.moduleState.onReady();\r\n } else {\r\n this.props.moduleState.onUpdating();\r\n }\r\n };\r\n\r\n @action\r\n private readonly _setErrorMessage = (errorMessage: string): void => {\r\n this.props.telemetry.error(errorMessage);\r\n this.props.moduleState.setHasError(true);\r\n this.props.moduleState.onUpdating();\r\n this.setState({\r\n errorMessage\r\n });\r\n };\r\n}\r\n\r\nexport default CheckoutBillingAddress;\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 { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport {\r\n IAddressAddItem,\r\n IAddressAddUpdateProps\r\n} from '@msdyn365-commerce-modules/address/src/modules/account-management-address/../../common/components/address-add';\r\nimport {\r\n IAddressList,\r\n IAddressListItem,\r\n IAddressListProps\r\n} from '@msdyn365-commerce-modules/address/src/modules/account-management-address/../../common/components/address-list';\r\nimport {\r\n IAddressShowItem,\r\n IAddressShowProps\r\n} from '@msdyn365-commerce-modules/address/src/modules/account-management-address/../../common/components/address-show';\r\nimport { IAccountManagementAddressViewProps } from './b2b-account-management-address';\r\n// import { IAccountManagementAddressViewProps } from '@msdyn365-commerce-modules/address/src/modules/account-management-address/./account-management-address';\r\n// import { AddressDetailItemComponent } from '@msdyn365-commerce-modules/address/src/common/components/address-detail-item';\r\n\r\ninterface IAddressListPropsExt extends IAddressListProps {\r\n shouldRenderEditAddressButton: boolean;\r\n}\r\n\r\ninterface IAddressListExt extends IAddressList {\r\n shouldRenderEditAddressButton: boolean;\r\n}\r\n\r\n/**\r\n * Address show component.\r\n * @param param0 - Root param.\r\n * @param param0.AddressDetail - Address detail.\r\n * @param param0.items - IAddressShowItem[].\r\n * @returns - Address Node.\r\n */\r\nconst AddressShow: React.FC = ({ AddressDetail, items }) => {\r\n return (\r\n \r\n {items.map((item: IAddressShowItem) => {\r\n return <>{item.description};\r\n })}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * Address List Component.\r\n * @param param0 - Root param.\r\n * @param param0.List - Address list.\r\n * @param param0.isShowList - Boolean.\r\n * @param param0.heading - Address heading.\r\n * @param param0.items - IAddressListItem[].\r\n * @returns - AddressListComponent Node.\r\n */\r\nconst AddressList: React.FC = ({ List, isShowList, heading, items, shouldRenderEditAddressButton }) => {\r\n if (!isShowList) {\r\n return null;\r\n }\r\n\r\n return (\r\n \r\n {heading}\r\n {items.map((item: IAddressListItem) => {\r\n const { Item, key, error, showItems, isShowPrimaryButton, primaryButton, editButton, removeButton } = item;\r\n const { Error, isShowError, title, message } = error;\r\n\r\n // const component = showItems.items.find(address => address.key === \"AddressTypeValue\")?.description;\r\n\r\n return (\r\n \r\n \r\n {isShowError && (\r\n \r\n {title}\r\n {message}\r\n \r\n )}\r\n {isShowPrimaryButton && primaryButton}\r\n
\r\n {shouldRenderEditAddressButton && editButton}\r\n {removeButton}\r\n
\r\n
\r\n );\r\n })}\r\n
\r\n );\r\n};\r\n\r\n/**\r\n * Address Lists Component.\r\n * @param param0 - Root param.\r\n * @param param0.ListAddress - List address.\r\n * @param param0.heading - List heading.\r\n * @param param0.isShowEmptyListMessage - Boolean.\r\n * @param param0.emptyListMessage - Empty list message.\r\n * @param param0.addButton - Add button.\r\n * @param param0.primaryAddressList - Primary address.\r\n * @param param0.otherAddressList - Other address.\r\n * @returns Address Lists Component Node.\r\n */\r\nconst AddressLists: React.FC = ({\r\n ListAddress,\r\n heading,\r\n isShowEmptyListMessage,\r\n emptyListMessage,\r\n addButton,\r\n primaryAddressList,\r\n otherAddressList,\r\n shouldRenderEditAddressButton\r\n}) => {\r\n return (\r\n \r\n {heading}\r\n {isShowEmptyListMessage && emptyListMessage}\r\n {addButton}\r\n \r\n \r\n \r\n );\r\n};\r\n\r\n/**\r\n * AddressAddUpdateComponent.\r\n * @param param0 - Root param.\r\n * @param param0.AddressForm - Address form.\r\n * @param param0.heading - Address heading.\r\n * @param param0.items - IAddressAddItem[].\r\n * @param param0.hasError - Boolean.\r\n * @param param0.error - Error message.\r\n * @param param0.isShowSaveButton - Boolean.\r\n * @param param0.saveButton - Save button.\r\n * @param param0.isShowCancelButton - Boolean.\r\n * @param param0.cancelButton - Cancel button.\r\n * @returns Address add update component node.\r\n */\r\nconst AddressAddUpdate: React.FC = ({\r\n AddressForm,\r\n heading,\r\n items,\r\n hasError,\r\n error,\r\n isShowSaveButton,\r\n saveButton,\r\n isShowCancelButton,\r\n cancelButton\r\n}) => {\r\n return (\r\n \r\n {heading}\r\n {items.map((item: IAddressAddItem) => {\r\n const { AddressItem, key, label, alert, input } = item;\r\n return (\r\n \r\n {label}\r\n {alert}\r\n {input}\r\n \r\n );\r\n })}\r\n {hasError && (\r\n \r\n {error.title}\r\n {error.message}\r\n \r\n )}\r\n {isShowSaveButton && saveButton}\r\n {isShowCancelButton && cancelButton}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * Account Management Address View Component.\r\n * @param props - Props.\r\n * @returns - AccountAddressManagement Module.\r\n */\r\nconst AccountManagementAddressView: React.FC = props => {\r\n const {\r\n AccountAddressManagement,\r\n viewState,\r\n showAddressList,\r\n showAddOrUpdateAddress,\r\n screenReaderNotification,\r\n shouldRenderEditAddressButton\r\n } = props;\r\n\r\n console.log(shouldRenderEditAddressButton);\r\n // Remove buttons from Invoice address\r\n const invoiceAddressId = 1;\r\n const addressId = props.customerAddresses.slice().find(address => address.AddressTypeValue === invoiceAddressId)?.RecordId;\r\n const invoiceAddress = showAddressList.otherAddressList.items.find(address => address.key === addressId);\r\n if (invoiceAddress) {\r\n invoiceAddress.editButton = undefined;\r\n invoiceAddress.primaryButton = undefined;\r\n invoiceAddress.removeButton = undefined;\r\n }\r\n\r\n return (\r\n \r\n {viewState.isShowAddresList && (\r\n \r\n )}\r\n {viewState.isShowAddOrUpdateAddress && }\r\n {screenReaderNotification}\r\n \r\n );\r\n};\r\n\r\nexport default AccountManagementAddressView;\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 { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport {\r\n IAddressShowItem,\r\n IAddressShowProps\r\n} from '@msdyn365-commerce-modules/address/src/modules/checkout-billing-address/../../common/components/address-show';\r\nimport { ICheckoutBillingAddressViewProps } from './b2b-checkout-billing-address';\r\n\r\n/**\r\n * Address show component.\r\n * @param param0 - Root param.\r\n * @param param0.AddressDetail - Address detail.\r\n * @param param0.items - IAddressShowItem[].\r\n * @returns - Address Node.\r\n */\r\nconst AddressShow: React.FC = ({ AddressDetail, items }) => {\r\n return (\r\n \r\n {items.map((item: IAddressShowItem) => {\r\n return <>{item.description};\r\n })}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * Checkout Billing Address View Component.\r\n * @param props - Props.\r\n * @returns - CheckoutBillingAddress Module.\r\n */\r\nconst CheckoutBillingAddressView: React.FC = props => {\r\n const { CheckoutBillingAddress, viewState, showAddress, error } = props;\r\n\r\n return (\r\n \r\n {viewState.isShowAddress && }\r\n {viewState.isError && error}\r\n \r\n );\r\n};\r\n\r\nexport default CheckoutBillingAddressView;\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 { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { IAddressAddItem, IAddressAddUpdateProps } from '@msdyn365-commerce-modules/address';\r\nimport { IAddressSelectItem, IAddressSelectProps } from '@msdyn365-commerce-modules/address';\r\nimport { IAddressShowItem, IAddressShowProps } from '@msdyn365-commerce-modules/address';\r\nimport { ICheckoutShippingAddressViewProps } from './eve-checkout-shipping-address';\r\n\r\n/**\r\n * Address show component.\r\n * @param param0 - Root param.\r\n * @param param0.AddressDetail - Address detail.\r\n * @param param0.items - IAddressShowItem[].\r\n * @returns - Address Node.\r\n */\r\nconst AddressShow: React.FC = ({ AddressDetail, items }) => {\r\n return (\r\n \r\n {items.map((item: IAddressShowItem) => {\r\n return <>{item.description};\r\n })}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * Address Select Component.\r\n * @param param0 - Root param.\r\n * @param param0.SelectAddress - Select address.\r\n * @param param0.addButton - Add button.\r\n * @param param0.items - IAddressSelectItem[].\r\n * @param param0.isShowSaveButton - Boolean.\r\n * @param param0.saveButton - Save button.\r\n * @param param0.isShowCancelButton - Boolean.\r\n * @param param0.cancelButton - Cancel button.\r\n * @returns - SelectAddress Node.\r\n */\r\nconst AddressSelect: React.FC = ({\r\n SelectAddress,\r\n addButton,\r\n items,\r\n isShowSaveButton,\r\n saveButton,\r\n isShowCancelButton,\r\n cancelButton\r\n}) => {\r\n return (\r\n \r\n {addButton}\r\n {items.map((item: IAddressSelectItem) => {\r\n const SelectItem = item.SelectItem;\r\n return (\r\n \r\n {item.input}\r\n \r\n \r\n );\r\n })}\r\n {isShowSaveButton && saveButton}\r\n {isShowCancelButton && cancelButton}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * Address Add Update Component.\r\n * @param param0 - Root param.\r\n * @param param0.AddressForm - Address form.\r\n * @param param0.heading - Address heading.\r\n * @param param0.items - IAddressAddItem[].\r\n * @param param0.hasError - Boolean.\r\n * @param param0.error - Error message.\r\n * @param param0.isShowSaveButton - Boolean.\r\n * @param param0.saveButton - Save button.\r\n * @param param0.isShowCancelButton - Boolean.\r\n * @param param0.cancelButton - Cancel button.\r\n * @returns Address add update component node.\r\n */\r\nconst AddressAddUpdate: React.FC = ({\r\n AddressForm,\r\n heading,\r\n items,\r\n hasError,\r\n error,\r\n isShowSaveButton,\r\n saveButton,\r\n isShowCancelButton,\r\n cancelButton\r\n}) => {\r\n return (\r\n \r\n {heading}\r\n {items.map((item: IAddressAddItem) => {\r\n const { AddressItem, key, label, alert, input } = item;\r\n return (\r\n \r\n {label}\r\n {alert}\r\n {input}\r\n \r\n );\r\n })}\r\n {hasError && (\r\n \r\n {error.title}\r\n {error.message}\r\n \r\n )}\r\n {isShowSaveButton && saveButton}\r\n {isShowCancelButton && cancelButton}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * Checkout Shipping Address View Component.\r\n * @param props - Props.\r\n * @returns - CheckoutShippingAddress Module.\r\n */\r\nconst CheckoutShippingAddressView: React.FC = props => {\r\n const { CheckoutShippingAddress, viewState, showAddress, showAddressSelect, showAddOrUpdateAddress, cartLineImages } = props;\r\n\r\n return (\r\n \r\n {cartLineImages}\r\n {viewState.isShowAddress && }\r\n {viewState.isShowAddresList && }\r\n {viewState.isShowAddOrUpdateAddress && }\r\n \r\n );\r\n};\r\n\r\nexport default CheckoutShippingAddressView;\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 * IGdnCheckoutBillingAddress contentModule 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\n\r\nexport const enum billingAddressOption {\r\n sameAsShipping = 'sameAsShipping',\r\n primaryAccount = 'primaryAccount',\r\n newAddress = 'newAddress'\r\n}\r\n\r\nexport interface IGdnCheckoutBillingAddressConfig extends Msdyn365.IModuleConfig {\r\n heading?: IHeadingData;\r\n billingAddressOption?: billingAddressOption;\r\n showAddressType?: boolean;\r\n paymenTenderType?: string;\r\n autoSuggestionEnabled?: boolean;\r\n autoSuggestOptions?: IAutoSuggestOptionsData;\r\n className?: string;\r\n clientRender?: boolean;\r\n}\r\n\r\nexport interface IGdnCheckoutBillingAddressResources {\r\n addressChangeCheckboxAriaLabel: string;\r\n addressBillingAddressHeading: string;\r\n addressSameAsShippingAddressAriaLabel: string;\r\n addressSameAsShippingAddressText: string;\r\n addressAddButtonText: string;\r\n addressAddButtonAriaLabel: string;\r\n addressAddNewButtonText: string;\r\n addressAddNewButtonAriaLabel: string;\r\n addressPrimaryButtonText: string;\r\n addressPrimaryButtonAriaLabel: string;\r\n addressEditButtonText: string;\r\n addressEditButtonAriaLabel: string;\r\n addressRemoveButtonText: string;\r\n addressRemoveButtonAriaLabel: string;\r\n addressSaveButtonText: string;\r\n addressSaveButtonAriaLabel: string;\r\n addressCancelButtonText: string;\r\n addressCancelButtonAriaLabel: string;\r\n addressStateDefaultSelectionText: string;\r\n addressNameLabel: string;\r\n addressNameRequiredErrorMessage: string;\r\n addressPhoneLabel: string;\r\n addressPhoneRequiredErrorMessage: string;\r\n addressPhoneFormatErrorMessage: string;\r\n addressZipCodeLabel: string;\r\n addressAddressTypeValueLabel: string;\r\n addressZipCodeRequiredErrorMessage: string;\r\n addressCityLabel: string;\r\n addressCityRequiredErrorMessage: string;\r\n addressCountyLabel: string;\r\n addressCountyRequiredErrorMessage: string;\r\n addressStateLabel: string;\r\n addressStateRequiredErrorMessage: string;\r\n addressThreeLetterISORegionNameLabel: string;\r\n addressThreeLetterISORegionNameRequiredErrorMessage: string;\r\n addressStreetLabel: string;\r\n addressStreetRequiredErrorMessage: string;\r\n addressDistrictLabel: string;\r\n addressDistrictNameLabel: string;\r\n addressDistrictRequiredErrorMessage: string;\r\n addressStreetNumberLabel: string;\r\n addressStreetNumberRequiredErrorMessage: string;\r\n addressBuildingComplimentLabel: string;\r\n addressBuildingComplimentRequiredErrorMessage: string;\r\n addressPostboxLabel: string;\r\n addressPostboxRequiredErrorMessage: string;\r\n addressHouseRULabel: string;\r\n addressHouseRURequiredErrorMessage: string;\r\n addressFlatRULabel: string;\r\n addressFlatRURequiredErrorMessage: string;\r\n addressCountryOKSMCodeRULabel: string;\r\n addressCountryOKSMCodeRURequiredErrorMessage: string;\r\n addressErrorMessageTitle: string;\r\n addressGenericErrorMessage: string;\r\n addressEmptyListAddressMessage: string;\r\n errorMessageTitle: string;\r\n addNewAddressText: string;\r\n usePrimaryAccountAddressAsBillingAddressText: string;\r\n addNewAddressAriaLabel: string;\r\n usePrimaryAccountAddressAsBillingAddressAriaLabel: string;\r\n}\r\n\r\nexport const enum HeadingTag {\r\n h1 = 'h1',\r\n h2 = 'h2',\r\n h3 = 'h3',\r\n h4 = 'h4',\r\n h5 = 'h5',\r\n h6 = 'h6'\r\n}\r\n\r\nexport interface IHeadingData {\r\n text: string;\r\n tag?: HeadingTag;\r\n}\r\n\r\nexport interface IAutoSuggestOptionsData {\r\n maxResults?: number;\r\n}\r\n\r\nexport interface IGdnCheckoutBillingAddressProps extends Msdyn365.IModule {\r\n resources: IGdnCheckoutBillingAddressResources;\r\n config: IGdnCheckoutBillingAddressConfig;\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { INodeProps, Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { IAddressAddItem, IAddressError } from '@msdyn365-commerce-modules/address';\r\nimport { IAddressShowItem } from '@msdyn365-commerce-modules/address';\r\nimport { ICheckoutBillingAddressViewProps } from './gdn-checkout-billing-address';\r\nimport { billingAddressOption } from './gdn-checkout-billing-address.props.autogenerated';\r\n\r\nexport interface IAddressShowProps {\r\n AddressDetail: INodeProps;\r\n items: IAddressShowItem[];\r\n addressBillingAddressHeading: string;\r\n selectedBillingAddressOption: string;\r\n}\r\n\r\nexport interface IAddressAddUpdateProps {\r\n AddressForm: INodeProps;\r\n heading: React.ReactNode;\r\n items: IAddressAddItem[];\r\n hasError: boolean;\r\n error: IAddressError;\r\n isShowSaveButton: boolean;\r\n saveButton: React.ReactNode;\r\n isShowCancelButton: boolean;\r\n cancelButton: React.ReactNode;\r\n addressBillingAddressHeading: string;\r\n selectedBillingAddressOption: string;\r\n}\r\n\r\nenum billingAddressOptions {\r\n sameAsShipping = 'Same as Shipping Address',\r\n primaryAccount = 'Primary Account Address',\r\n newAddress = 'New Address'\r\n}\r\n\r\n/**\r\n * Address show component.\r\n * @param param0 - Root param.\r\n * @param param0.AddressDetail - Address detail.\r\n * @param param0.items - IAddressShowItem[].\r\n * @param param0.addressBillingAddressHeading - The heading text for the billing address section.\r\n * @param param0.selectedBillingAddressOption - The selected billing address option, which must be a key of billingAddressOptions.\r\n * @returns - Address Node.\r\n */\r\nconst AddressShow: React.FC = ({ AddressDetail, items, addressBillingAddressHeading, selectedBillingAddressOption }) => {\r\n return (\r\n \r\n

\r\n {addressBillingAddressHeading} ({billingAddressOptions[selectedBillingAddressOption as keyof typeof billingAddressOptions]})\r\n

\r\n {items.map((item: IAddressShowItem) => {\r\n return <>{item.description};\r\n })}\r\n
\r\n );\r\n};\r\n\r\n/**\r\n * Address Add Update Component.\r\n * @param param0 - Root param.\r\n * @param param0.AddressForm - Address form.\r\n * @param param0.heading - Address Heading.\r\n * @param param0.items - IAddressAddItem[].\r\n * @param param0.hasError - Boolean.\r\n * @param param0.error - IAddressError.\r\n * @param param0.isShowSaveButton - Boolean.\r\n * @param param0.saveButton - Save button.\r\n * @param param0.isShowCancelButton - Boolean.\r\n * @param param0.cancelButton - Cancel button.\r\n * @returns - AddressForm Node.\r\n */\r\nconst AddressAddUpdate: React.FC = ({\r\n AddressForm,\r\n heading,\r\n items,\r\n hasError,\r\n error,\r\n isShowSaveButton,\r\n saveButton,\r\n isShowCancelButton,\r\n cancelButton,\r\n selectedBillingAddressOption,\r\n addressBillingAddressHeading\r\n}) => {\r\n return (\r\n \r\n

\r\n {' '}\r\n {addressBillingAddressHeading} ({billingAddressOptions[selectedBillingAddressOption as keyof typeof billingAddressOptions]})\r\n

\r\n {heading}\r\n {items.map((item: IAddressAddItem) => {\r\n const { AddressItem, key, label, alert, input } = item;\r\n return (\r\n \r\n {label}\r\n {alert}\r\n {input}\r\n \r\n );\r\n })}\r\n {hasError && (\r\n \r\n {error.title}\r\n {error.message}\r\n \r\n )}\r\n {isShowSaveButton && saveButton}\r\n {isShowCancelButton && cancelButton}\r\n
\r\n );\r\n};\r\n\r\n/**\r\n * Checkout Billing Address View Component.\r\n * @param props - Props.\r\n * @returns - CheckoutBillingAddress Module.\r\n */\r\nconst CheckoutBillingAddressView: React.FC = props => {\r\n const {\r\n CheckoutBillingAddress,\r\n checkoutErrorRef,\r\n alert,\r\n viewState,\r\n // heading,\r\n sameAsShippingRadioButton,\r\n showAddress,\r\n showAddOrUpdateAddress,\r\n newAddressRadioButton,\r\n primaryAccountAddressRadioButton,\r\n resources,\r\n selectedBillingAddressOption,\r\n config\r\n } = props;\r\n const { addressBillingAddressHeading } = resources;\r\n\r\n const customShowAddressProps = {\r\n ...showAddress,\r\n addressBillingAddressHeading,\r\n selectedBillingAddressOption\r\n };\r\n\r\n const customUpdateAddressProps = {\r\n ...showAddOrUpdateAddress,\r\n addressBillingAddressHeading,\r\n selectedBillingAddressOption\r\n };\r\n\r\n const radioButtons = [\r\n { option: billingAddressOption.sameAsShipping, component: sameAsShippingRadioButton },\r\n { option: billingAddressOption.primaryAccount, component: primaryAccountAddressRadioButton },\r\n { option: billingAddressOption.newAddress, component: newAddressRadioButton }\r\n ];\r\n\r\n const orderedRadioButtons = radioButtons\r\n .sort((a, b) => {\r\n if (a.option === config.billingAddressOption) {\r\n return -1;\r\n }\r\n if (b.option === config.billingAddressOption) {\r\n return 1;\r\n }\r\n return 0;\r\n })\r\n .map(button => button.component);\r\n\r\n return (\r\n \r\n {alert}\r\n {viewState.isShowRadioButtons && orderedRadioButtons}\r\n {viewState.isShowAddress && }\r\n {viewState.isShowAddOrUpdateAddress && }\r\n \r\n );\r\n};\r\n\r\nexport default CheckoutBillingAddressView;\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 { RatingComponent } from '@msdyn365-commerce/components';\r\nimport { ICoreContext } from '@msdyn365-commerce/core';\r\nimport { IHistogramItemViewProps,\r\n IRatingsHistogramData,\r\n IRatingsHistogramViewProps } from '@msdyn365-commerce-modules/ratings-reviews';\r\nimport { format, Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { IRatingsHistogramProps, IRatingsHistogramResources } from '../definition-extensions/ratings-histogram.ext.props.autogenerated';\r\n\r\n/**\r\n * Histogram item.\r\n * @param props - Histogram Item ViewProps.\r\n * @returns Histogram Item node.\r\n */\r\nconst histogramItem = (props: IHistogramItemViewProps) => {\r\n return (\r\n \r\n {props.starLabel}\r\n {props.bar}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * Average ratings.\r\n * @param data - Props data.\r\n * @param context - Histogram Item ViewProps.\r\n * @param typeName - Histogram Item ViewProps.\r\n * @param componentId - Histogram Item ViewProps.\r\n * @param resources - Module resource strings.\r\n * @returns Average ratings.\r\n */\r\nconst averageRating = (data: IRatingsHistogramData, context: ICoreContext, typeName: string, componentId: string, resources: IRatingsHistogramResources) => {\r\n const defaultAverageRating: number = 0;\r\n const reviewsCount = data.ratingsSummary.result?.reviewsCount ?? defaultAverageRating;\r\n const reviewsCountString = resources.numberOfReviewsString ? format(resources.numberOfReviewsString, reviewsCount) : `${reviewsCount} reviews`;\r\n\r\n return (\r\n
\r\n
\r\n {data.ratingsSummary.result?.averageRating}\r\n
\r\n
\r\n \r\n
\r\n
\r\n {reviewsCountString}\r\n
\r\n
\r\n );\r\n};\r\n\r\n/**\r\n * Histogram view.\r\n * @param props - Ratings HistogramV iewProps.\r\n * @returns Histogram view module.\r\n */\r\nconst RatingsHistogramView: React.FC> = props => {\r\n const { heading, histogramItems, histogramProps, moduleProps, data, resources } = props;\r\n const context = props.context;\r\n const typeName = props.typeName;\r\n const moduleId = props.id;\r\n\r\n return (\r\n \r\n {heading}\r\n
\r\n {averageRating(data, context, typeName, moduleId, resources)}\r\n \r\n {histogramItems.map(item => {\r\n return histogramItem(item);\r\n })}\r\n \r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default RatingsHistogramView;\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 { RatingComponent } from '@msdyn365-commerce/components';\r\nimport { ICoreContext } from '@msdyn365-commerce/core';\r\nimport { IHistogramItemViewProps,\r\n IRatingsHistogramData,\r\n IRatingsHistogramViewProps } from '@msdyn365-commerce-modules/ratings-reviews';\r\nimport { format, Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { IRatingsHistogramProps, IRatingsHistogramResources } from '../definition-extensions/ratings-histogram.ext.props.autogenerated';\r\n\r\n/**\r\n * Histogram item.\r\n * @param props - Histogram Item ViewProps.\r\n * @returns Histogram Item node.\r\n */\r\nconst histogramItem = (props: IHistogramItemViewProps) => {\r\n return (\r\n \r\n {props.starLabel}\r\n {props.bar}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * Average ratings.\r\n * @param data - Props data.\r\n * @param context - Histogram Item ViewProps.\r\n * @param typeName - Histogram Item ViewProps.\r\n * @param componentId - Histogram Item ViewProps.\r\n * @param resources - Module resource strings.\r\n * @returns Average ratings.\r\n */\r\nconst averageRating = (data: IRatingsHistogramData, context: ICoreContext, typeName: string, componentId: string, resources: IRatingsHistogramResources) => {\r\n const defaultAverageRating: number = 0;\r\n const reviewsCount = data.ratingsSummary.result?.reviewsCount ?? defaultAverageRating;\r\n const reviewsCountString = resources.numberOfReviewsString ? format(resources.numberOfReviewsString, reviewsCount) : `${reviewsCount} reviews`;\r\n\r\n return (\r\n
\r\n
\r\n {data.ratingsSummary.result?.averageRating}\r\n
\r\n
\r\n \r\n
\r\n
\r\n {reviewsCountString}\r\n
\r\n
\r\n );\r\n};\r\n\r\n/**\r\n * Histogram view.\r\n * @param props - Ratings HistogramV iewProps.\r\n * @returns Histogram view module.\r\n */\r\nconst RatingsHistogramView: React.FC> = props => {\r\n const { heading, histogramItems, histogramProps, moduleProps, data, resources } = props;\r\n const context = props.context;\r\n const typeName = props.typeName;\r\n const moduleId = props.id;\r\n\r\n return (\r\n \r\n {heading}\r\n
\r\n {averageRating(data, context, typeName, moduleId, resources)}\r\n \r\n {histogramItems.map(item => {\r\n return histogramItem(item);\r\n })}\r\n \r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default RatingsHistogramView;\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 {\n ICheckoutDeliveryOption,\n ICheckoutDeliveryOptionEdit,\n ICheckoutDeliveryOptionsList,\n ICheckoutDeliveryOptionsViewProps\n} from './checkout-delivery-options';\n\nconst DeliveryOptionList: React.FC = ({ DeliveryOptionsList, list }) => {\n if (!list || list.length === 0) {\n return null;\n }\n\n return (\n \n {list.map((deliveryOption: ICheckoutDeliveryOptionEdit) => {\n return (\n \n {deliveryOption.radioButton}\n {deliveryOption.description}\n {deliveryOption.price}\n \n );\n })}\n \n );\n};\n\nconst DeliveryOptionSelected: React.FC = ({ DeliveryOption, description, price }) => {\n return (\n \n {description}\n {price}\n \n );\n};\n\nconst CheckoutDeliveryOptionsView: React.FC = props => {\n const {\n CheckoutDeliveryOptions,\n enableCheckoutCartLineDeliveryOptions,\n checkoutErrorRef,\n viewState,\n deliveryOptions,\n deliveryOptionSelected,\n alert,\n waiting,\n saveButton,\n editButton,\n cancelButton,\n checkoutCartLineGroupDeliveryOptions,\n cartLineImages\n } = props;\n\n return (\n // TODO: All wrapper div should be provided by viewProps. Once SDK provide the sln, update markup.\n \n {viewState.isLoading && waiting}\n {viewState.isError && alert}\n {viewState.isShowList && deliveryOptions && !enableCheckoutCartLineDeliveryOptions && (\n \n )}\n {viewState.isShowList && enableCheckoutCartLineDeliveryOptions && checkoutCartLineGroupDeliveryOptions}\n {viewState.isShowSelected && enableCheckoutCartLineDeliveryOptions && cartLineImages}\n {viewState.isShowSelected && deliveryOptionSelected && }\n {viewState.isShowSaveButton && saveButton}\n {viewState.isShowEditButton && editButton}\n {viewState.isShowCancelButton && cancelButton}\n \n );\n};\n\nexport default CheckoutDeliveryOptionsView;\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 { IAddResource, ICheckoutGiftCardViewProps, IForm, IItem, IList, IShowResource } from './checkout-gift-card';\n\nexport const From: React.FC = ({\n formProps,\n label,\n inputPinLabel,\n inputExpLabel,\n alert,\n inputProps,\n inputNumProps,\n inputPinProps,\n inputExpProps,\n inputNumber,\n inputPin,\n inputExp,\n applyButton,\n supportExternalGiftCard,\n showGiftCardPinInput,\n showGiftCardExpInput,\n alertFieldLabel\n}) => (\n \n {alert}\n {supportExternalGiftCard ? (\n \n \n {label}\n {inputNumber}\n \n {showGiftCardPinInput && (\n \n {inputPinLabel}\n {inputPin}\n \n )}\n {showGiftCardExpInput && (\n \n {inputExpLabel}\n {inputExp}\n \n )}\n {(showGiftCardPinInput || showGiftCardExpInput) && alertFieldLabel}\n \n ) : (\n <>\n {label}\n {inputNumber}\n \n )}\n {applyButton}\n \n);\n\nexport const SelectedGiftCard: React.FC = ({ itemProps, selectedGiftCard, removeButton }) => (\n \n {selectedGiftCard}\n {removeButton}\n \n);\n\nexport const GiftCardList: React.FC = ({ listProps, list }) => (\n \n {list.map(({ id, ...item }) => (\n \n ))}\n \n);\n\nexport const AddResource: React.FC = ({ form, list }) => (\n <>\n {form && }\n {list && }\n \n);\n\nexport const ShowResource: React.FC = ({ title, list }) => (\n <>\n {title}\n {list && }\n \n);\n\nconst CheckoutGiftCardView: React.FC = props => {\n const { checkoutGiftCardProps, checkoutErrorRef, showGiftCard, addGiftCard } = props;\n return (\n \n {showGiftCard && }\n {addGiftCard && }\n \n );\n};\n\nexport default CheckoutGiftCardView;\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 { ICheckoutLoyaltyAdd, ICheckoutLoyaltyRewardPoint, ICheckoutLoyaltyShow, ICheckoutLoyaltyViewProps } from './checkout-loyalty';\n\nconst AddCheckoutLoyalty: React.FC = ({\n heading,\n cardNumber,\n drawer,\n rewardPoints,\n loyaltyAmountContainer,\n appliedLoyaltyAmountContainer,\n loyaltyAmountLabel,\n loyaltyAmountInput,\n loyaltyAmountApplyButton,\n showAppliedAmount,\n loyaltyAmountAppliedText,\n loyaltyAmountAppliedPrice,\n loyaltyAmountRemoveButton\n}) => {\n return (\n <>\n {heading}\n {cardNumber}\n \n {rewardPoints.map((rewardPoint: ICheckoutLoyaltyRewardPoint) => {\n return (\n \n {rewardPoint.title}\n {rewardPoint.availablePointsText}\n {rewardPoint.activePoints}\n {rewardPoint.expiringPointsText}\n {rewardPoint.expiringPoints}\n \n );\n })}\n \n \n {loyaltyAmountLabel}\n {loyaltyAmountInput}\n {loyaltyAmountApplyButton}\n {showAppliedAmount && (\n \n {loyaltyAmountAppliedText}\n {loyaltyAmountAppliedPrice}\n {loyaltyAmountRemoveButton}\n \n )}\n \n \n );\n};\n\nconst ShowCheckoutLoyalty: React.FC = ({ heading, coveredAmountText, amount }) => {\n return (\n <>\n {heading}\n {coveredAmountText}\n {amount}\n \n );\n};\n\nconst CheckoutLoyaltyView: React.FC = props => {\n const { checkoutLoyalty, checkoutErrorRef, alert, viewState, showLoyalty, addLoyalty } = props;\n\n return (\n \n {alert}\n {viewState.isShowLoyalty && }\n {viewState.isShowAddLoyalty && }\n \n );\n};\n\nexport default CheckoutLoyaltyView;\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 { IForm, IItem, IGiftCardBalanceCheckViewProps } from './index';\n\nexport const Form: React.FC = ({\n formProps,\n label,\n inputPinLabel,\n inputExpLabel,\n alert,\n inputProps,\n inputNumProps,\n inputPinProps,\n inputExpProps,\n inputNumber,\n inputPin,\n inputExp,\n applyButton,\n supportExternalGiftCard,\n showGiftCardPinInput,\n showGiftCardExpInput,\n alertFieldLabel\n}) => (\n \n {alert}\n {supportExternalGiftCard ? (\n \n \n {label}\n {inputNumber}\n \n {showGiftCardPinInput && (\n \n {inputPinLabel}\n {inputPin}\n \n )}\n {showGiftCardExpInput && (\n \n {inputExpLabel}\n {inputExp}\n \n )}\n {(showGiftCardPinInput || showGiftCardExpInput) && alertFieldLabel}\n \n ) : (\n <>\n {label}\n {inputNumber}\n \n )}\n {applyButton}\n \n);\n\nexport const Item: React.FC = ({ itemProps, selectedGiftCard }) => {selectedGiftCard};\n\nconst GiftCardBalanceCheckView: React.FC = props => {\n const { giftCardBalanceCheckProps, form, item } = props;\n return (\n \n {form &&
}\n {item && }\n \n );\n};\n\nexport default GiftCardBalanceCheckView;\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 { IQuickOrderGridViewProps, IQuickOrderGridFormViewProps } from './index';\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 \n {heading}\n {errors}\n {select}\n \n );\n};\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 {dropdowns.map(renderConfigureDropdown)};\n }\n return null;\n};\n\n/**\n * Render product dimension/configure container.\n * @param form -- Form props.\n * @param isMobileView -- Flag to check mobile view.\n * @param quickOrderForm - Form component container.\n * @param quickOrderProductContent - Form product component.\n * @param quickOrderMessageContent - Form user message component.\n * @param configure - Product Dimension component.\n * @returns Jsx element of quick order form component.\n */\nconst renderForm = (\n form: IQuickOrderGridFormViewProps,\n isMobileView: boolean,\n quickOrderForm: INodeProps,\n quickOrderProductContent: INodeProps,\n quickOrderMessageContent: INodeProps,\n configure?: IProductDimensionConfigureViewProps\n) => {\n return isMobileView ? (\n \n \n {form.product}\n {renderConfigure(configure)}\n {form.quantity}\n {form.userMessage}\n {form.addToListBtn}\n \n \n ) : (\n \n {form.userMessage}\n \n {form.product}\n {renderConfigure(configure)}\n {form.quantity}\n {form.addToListBtn}\n \n \n );\n};\n\n/**\n * Retrieves current sort criteria.\n * @param props - QuickOrder Grid view props.\n * @returns - Render View.\n */\nconst quickOrderGridView: React.FC = props => {\n const {\n quickOrderGridProps,\n contentProps,\n form,\n quickOrderGridForm,\n drawer,\n configure,\n quickOrderGridFormProductContent,\n quickOrderGridFormMsgContent,\n isMobileView,\n header,\n container,\n actions,\n orderActions\n } = props;\n\n return (\n \n {header}\n {actions && (\n \n {orderActions?.userMessage}\n {orderActions?.addProductListToBag}\n {orderActions?.removeProductList}\n \n )}\n \n \n {renderForm(\n form as IQuickOrderGridFormViewProps,\n isMobileView,\n quickOrderGridForm,\n quickOrderGridFormProductContent,\n quickOrderGridFormMsgContent,\n configure\n )}\n {props.bulkPurchase}\n \n \n {container}\n \n );\n};\n\nexport default quickOrderGridView;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { AddToCartBehavior } from '@msdyn365-commerce/components';\nimport MsDyn365, { getUrlSync } from '@msdyn365-commerce/core';\nimport { ICartIconViewProps, ICartViewProps, IFlyoutCartLineItemViewProps } from '@msdyn365-commerce-modules/cart';\nimport { Button, getPayloadObject, INodeProps, KeyCodes, Modal, Node, onTelemetryClick } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport React from 'react';\n\nimport { ICartIconProps as ICartIconExtensionProps } from '../definition-extensions/cart-icon.ext.props.autogenerated';\n\n/**\n * ICartIconViewState: Interface for Cart Icon View State.\n */\ninterface ICartIconViewState {\n isModalOpen: boolean;\n}\n\n/**\n * Render Cart lines.\n * @param cartLines - Flyout cart line view props.\n * @param props - Cart icon view props.-\n * @returns JSX Element.\n */\nconst renderCartlines = (cartLines: IFlyoutCartLineItemViewProps[] | undefined, props: ICartIconViewProps): JSX.Element[] | null => {\n if (!cartLines) {\n props.context.telemetry.error('Cartlines content is empty, module wont render');\n return null;\n }\n\n return cartLines.map((cartLine, index) => {\n const cartLineIndex = index;\n return (\n \n {cartLine.cartline}\n {cartLine.storeLocation}\n {cartLine.remove}\n \n );\n });\n};\n\n/**\n * Initiate total price.\n * @param props - Cart icon view props.\n * @returns JSX Element.\n */\nconst renderTotalPrice = (props: ICartIconViewProps & ICartIconExtensionProps<{}>): JSX.Element | null => {\n const cart = props.data.cart.result ?? undefined;\n const price = cart && !cart.hasInvoiceLine && (cart.cart.TotalAmount || undefined);\n const totalPrice = price\n ? props.context.cultureFormatter.formatCurrency(price)\n : props.context.cultureFormatter.formatCurrency(props.resources.emptyPrice);\n return cart && !cart.hasInvoiceLine ? (\n
\n \n {props.resources.totalPriceFormatString}\n {totalPrice}\n \n
\n ) : (\n <>\n );\n};\n\n/**\n * Initiate subtotal message.\n * @param props - Cart icon view props.\n * @returns JSX Element.\n */\nconst renderSubtotalMessage = (props: ICartIconViewProps & ICartIconExtensionProps<{}>): JSX.Element | null => {\n const cart = props.data.cart.result ?? undefined;\n return cart && !cart.hasInvoiceLine ?

{props.resources.subTotalMessage}

: null;\n};\n\n/**\n *\n * CartIconView component.\n * @extends {React.PureComponent}\n */\nexport class CartIconView extends React.PureComponent<\n ICartViewProps & ICartIconViewProps & ICartIconExtensionProps<{}>,\n ICartIconViewState\n> {\n private isAutoDisplayTriggered: boolean;\n\n private readonly cartIconRef: React.RefObject = React.createRef();\n\n public constructor(props: ICartViewProps & ICartIconViewState & ICartIconViewProps & ICartIconExtensionProps<{}>) {\n super(props);\n this.isAutoDisplayTriggered = false;\n this.state = {\n isModalOpen: false\n };\n }\n\n public componentDidMount(): void {\n if (MsDyn365.isBrowser) {\n window.addEventListener('keydown', this._escFunction, false);\n }\n }\n\n public componentWillUnmount(): void {\n if (MsDyn365.isBrowser) {\n window.removeEventListener('keydown', this._escFunction, false);\n }\n }\n\n /**\n * Render Cart Item count.\n * @returns JSX Element.\n */\n public render(): JSX.Element | null {\n const cart = this.props.data.cart.result ?? undefined;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- check config.\n const shouldShowMiniCart =\n cart?.isProductAddedToCart && this.props.context.app.config.addToCartBehavior === AddToCartBehavior.showMiniCart;\n if (shouldShowMiniCart) {\n if (!this.isAutoDisplayTriggered) {\n // First time trigger auto mini cart.\n this.setState({ isModalOpen: true });\n this.isAutoDisplayTriggered = true;\n } else if (!this.state.isModalOpen) {\n // If modal is closed, reset the flag.\n this.isAutoDisplayTriggered = false;\n }\n }\n return (\n \n \n \n \n {this.props.flyoutTitle}\n {this._renderCartItemCount(this.props)}\n {this._renderCartCloseIcon()}\n \n \n {this.props.data.cart.result?.isEmpty ? this.props.slots.emptyCart : null}\n {this.props.checkoutBlockedDueToUnavailableFunds}\n {renderCartlines(this.props.cartlines, this.props)}\n \n \n {this.props.slots.promoContentItem}\n {renderTotalPrice(this.props)}\n {renderSubtotalMessage(this.props)}\n {this.props.checkoutAsSignInUserButton}\n {this.props.checkoutAsGuestButton}\n {this.props.data.cart.result?.isEmpty ? null : this.props.goToCartButton}\n \n {this.props.data.cart.result?.isEmpty ? (\n \n {this.props.resources.continueShoppingButtonTitle}\n \n ) : null}\n \n \n \n \n );\n }\n\n /**\n * Initiate modal container.\n * @returns Inode props.\n */\n private readonly _modalContainer = (): INodeProps => {\n return {\n tag: Modal,\n placement: 'bottom-end',\n hideArrow: true,\n className: 'ms-cart-icon__minicartmodal-container',\n wrapClassName: 'ms-cart-icon__minicartmodal',\n isOpen: this.state.isModalOpen,\n toggle: this.closeModal\n };\n };\n\n /**\n * Initiate open modal.\n */\n private readonly _openModal = (): void => {\n const payLoad = getPayloadObject('click', this.props.telemetryContent!, 'cart-icon', '');\n onTelemetryClick(this.props.telemetryContent!, payLoad, 'cart-icon');\n this.setState({\n isModalOpen: true\n });\n };\n\n /**\n * Initiate close modal.\n */\n private readonly closeModal = (): void => {\n this.cartIconRef.current?.focus();\n this.setState({\n isModalOpen: false\n });\n };\n\n /**\n * Initiate cart close Icon.\n * @returns JSX Element.\n */\n private readonly _renderCartCloseIcon = (): JSX.Element | null => {\n return \n
{choiceSummary}
\n
\n {sortByOptions && !isRecoSearchPage && renderSort(sortByOptions)}\n
\n \n {refineMenu && isExpanded && renderRefiner(refineMenu)}\n \n {refineMenu && isExpanded && renderRefinerFooter(refineMenu, toggle, resources)}\n \n \n\n \n {errorMessage}\n {props.config.enableProdutDescription ? renderProducts(props) : renderProductCards(props)}\n {pagination}\n \n \n \n );\n};\n\n/**\n * Render Search result Modal.\n * @param modalProps - The Search Result Modal view props.\n * @param refineMenu - The Refine Menu view props.\n * @param sortByDropDown - The Sort by view props.\n * @param isRecoSearchPage - The recomandation search page flag.\n * @returns The JSX Element.\n */\nconst createSearchResultModal = (\n modalProps: ISearchResultV2ModalViewProps,\n refineMenu: IRefineMenuViewProps,\n sortByDropDown?: ISortByViewProps,\n isRecoSearchPage?: string\n): JSX.Element => {\n return React.cloneElement(\n modalProps.modal,\n {},\n modalProps.modalHeader,\n createModalBody(modalProps, refineMenu, sortByDropDown, isRecoSearchPage),\n modalProps.modalFooter\n );\n};\n\n/**\n * Render Refiner Mobile.\n * @param props - The Refine Menu view props.\n * @returns The JSX Element.\n */\nconst renderRefinerMobile = (props: IRefineMenuViewProps): JSX.Element | null => {\n const { refiners, refineMenuContainer, refinerSectionContainer } = props;\n if (refiners) {\n return (\n \n \n {refiners.map((submenu, index) => (\n {submenu}\n ))}\n \n \n );\n }\n return null;\n};\n\n/**\n * Render Search result Body.\n * @param props - The Search Result Modal view props.\n * @param refineMenu - The Refine Menu view props.\n * @param sortByDropDown - The Sort by view props.\n * @param isRecoSearchPage - The recomandation search page flag.\n * @returns The JSX Element.\n */\nconst createModalBody = (\n props: ISearchResultV2ModalViewProps,\n refineMenu: IRefineMenuViewProps,\n sortByDropDown?: ISortByViewProps,\n isRecoSearchPage?: string\n): JSX.Element | null => {\n if (sortByDropDown) {\n return React.cloneElement(props.modalBody, {}, renderSort(sortByDropDown, isRecoSearchPage), renderRefinerMobile(refineMenu));\n }\n return null;\n};\n\n/**\n * Render Refiner.\n * @param props - The Refine Menu view props.\n * @returns The JSX Element.\n */\nconst renderRefiner = (props: IRefineMenuViewProps): JSX.Element | null => {\n const { refiners, refineMenuContainer, refinerSectionContainer } = props;\n if (refiners) {\n return (\n \n \n {refiners.map((submenu, index) => (\n {submenu}\n ))}\n \n \n );\n }\n return null;\n};\n\n/**\n * Render Refiner Footer.\n * @param props - The Refine Menu view props.\n * @param handler - The Refine menu toggle function.\n * @param resources - Resources to get the done text and aria label.\n * @returns The JSX Element.\n */\nconst renderRefinerFooter = (\n props: IRefineMenuViewProps,\n handler: MouseEventHandler,\n resources: ISearchResultContainerV2Resources\n): JSX.Element | null => {\n const { refiners } = props;\n if (refiners) {\n return (\n \n \n {resources.doneText}\n \n \n );\n }\n return null;\n};\n\n/**\n * Render sort by drop down.\n * @param props - The sort by view props.\n * @param isRecoSearchPage - The recomandation search page flag.\n * @returns The JSX Element.\n */\nconst renderSort = (props: ISortByViewProps, isRecoSearchPage?: string): JSX.Element | null => {\n const { sortingContainer, sortByDropDown } = props;\n if (sortByDropDown && !isRecoSearchPage) {\n return {sortByDropDown};\n }\n return null;\n};\n\n/**\n * Render Title.\n * @param props - The title view props.\n * @returns The JSX Element.\n */\nconst renderTitle = (props: ITitleViewProps): JSX.Element | null => {\n const { title, titleContainer } = props;\n if (title) {\n return (\n \n \n {title.titlePrefix}\n {title.titleText}\n \n \n );\n }\n return null;\n};\n\nexport default SearchResultContainerView;\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, { IComponentProps, IGridSettings, IImageSettings, Image } from '@msdyn365-commerce/core';\nimport { ICartState } from '@msdyn365-commerce/global-state';\nimport { ChannelDeliveryOptionConfiguration, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { CartLine, ProductCatalog, SalesLine } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { ArrayExtensions, 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 priceEditorResources?: ICartLinePriceEditorResources;\n salesAgreementPricePrompt?: string;\n}\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 {\n /**\n * The flag to change the quantity component from intractable 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 index.\n */\n lineIndex?: number;\n\n /**\n * Quantity onChange callback.\n */\n quantityOnChange?(cartLine: CartLine, newQuantity: number, lineIndex?: number): boolean;\n priceCurrency?: string;\n}\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 = (props: ICartLineProps) => {\n const catalogId = props.data.cartLine.CatalogId;\n validateCatalogId(catalogId);\n\n if (!props.context.request.user.isB2b || !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
{catalog.Name}
;\n};\n\nconst CartLineItemFunctions = {\n renderProductDimensions: (Product: SimpleProduct, DimensionStrings: IDimensionStrings) => {\n if (!Product || !Product.Dimensions) {\n return [];\n }\n\n return Product.Dimensions.map(productDimension => {\n if (productDimension.DimensionTypeValue === 1) {\n return (\n
\n \n {DimensionStrings.colorString}:\n {productDimension.DimensionValue && productDimension.DimensionValue.Value}\n \n
\n );\n }\n\n if (productDimension.DimensionTypeValue === 2) {\n return (\n
\n \n {DimensionStrings.configString}:\n {productDimension.DimensionValue && productDimension.DimensionValue.Value}\n \n
\n );\n }\n\n if (productDimension.DimensionTypeValue === 3) {\n return (\n
\n \n {DimensionStrings.sizeString}:\n {productDimension.DimensionValue && productDimension.DimensionValue.Value}\n \n
\n );\n }\n\n if (productDimension.DimensionTypeValue === 4) {\n return (\n
\n \n {Product.IsGiftCard ? DimensionStrings.amountString : DimensionStrings.styleString}:\n {productDimension.DimensionValue && productDimension.DimensionValue.Value}\n \n
\n );\n }\n return null;\n });\n },\n\n renderDiscountLines: (props: ICartLineProps) => {\n if (!props.data.cartLine.DiscountLines || props.data.cartLine.DiscountLines.length === 0) {\n return null;\n }\n\n return props.data.cartLine.DiscountLines.map((discountLine, index) => {\n return (\n
\n \n {discountLine.OfferName ? discountLine.OfferName : ''}:{` ${props.resources.discountStringText || 'Discount'} `}\n \n \n \n \n {` (${discountLine.EffectivePercentage !== undefined ? discountLine.EffectivePercentage : ''}%)`}\n
\n );\n });\n },\n renderInventoryLabel: (props: ICartLineProps) => {\n if (!props.inventoryInformationLabel) {\n return null;\n }\n const inventoryCssName = props.inventoryLabelClassName\n ? `msc-cart-line__product-inventory-label ${props.inventoryLabelClassName}`\n : 'msc-cart-line__product-inventory-label';\n return {props.inventoryInformationLabel};\n },\n\n /**\n * Gets the react node for product unit of measure display.\n * @param props - Icartline props.\n * @returns The node representing markup for unit of measure component.\n */\n renderUnitOfMeasure: (props: ICartLineProps) => {\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 const product = props.data.product;\n if (!product || !product.DefaultUnitOfMeasure) {\n return undefined;\n }\n\n return (\n
\n {product.DefaultUnitOfMeasure}\n
\n );\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 (shippingChargeLines.length === 0) {\n return undefined;\n }\n\n const freightFee = shippingChargeLines.reduce((chargeTotal, chargeLine) => {\n return chargeTotal + (chargeLine.CalculatedAmount || 0);\n }, 0);\n\n const priceComponent = (\n \n );\n return (\n <>\n \n {priceComponent}\n \n );\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 &&\n otherCharges.map((otherCharge, key) => {\n return otherCharge && otherCharge.CalculatedAmount ? (\n
\n \n \n \n \n
\n ) : (\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 if (props.data.cartLine.SalesAgreementLineRecordId === 0) {\n return null;\n }\n return
{props.resources.salesAgreementPricePrompt}
;\n }\n};\n\n// eslint-disable-next-line no-redeclare\nconst CartLine: React.FC = (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 imageSettings = props.imageSettings;\n if (imageSettings) {\n imageSettings.cropFocalRegion = true;\n }\n const renderDisountLines = CartLineItemFunctions.renderDiscountLines(props);\n const renderInventoryLabel = CartLineItemFunctions.renderInventoryLabel(props);\n const renderUnitOfMeasure = CartLineItemFunctions.renderUnitOfMeasure(props);\n const renderShippingLabel = CartLineItemFunctions.renderShippingLabel(props);\n const renderOtherCharges = CartLineItemFunctions.renderOtherCharges(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\n const onChange = (newValue: number): boolean => {\n if (props.quantityOnChange) {\n return props.quantityOnChange(props.data.cartLine, newValue, props.lineIndex);\n }\n return true;\n };\n\n const _generateErrorMessage = (): JSX.Element | null => {\n if (props.errorMessage) {\n return (\n
\n \n {props.errorMessage}\n
\n );\n }\n\n return null;\n };\n\n const _generateQuantityandPrice = (): JSX.Element[] | null => {\n const nodes = [];\n if (props.isOutOfStock) {\n return null;\n }\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
\n
{resources.quantityDisplayString}
\n \n
\n );\n } else {\n nodes.push(\n
\n \n {props.data.cartLine.Quantity}\n
\n );\n }\n }\n\n nodes.push(\n
\n \n {(props.data.cartLine.DiscountAmount && props.data.cartLine.DiscountAmount > 0 && (\n <>\n \n {` ${props.resources.discountStringText || 'Discount'} `}\n \n \n \n )) ||\n null}\n
\n );\n\n return nodes;\n };\n\n return (\n <>\n
\n
\n \n
\n
\n
\n \n {MsDyn365.isBrowser ? (\n \n {productName}\n \n ) : null}\n {ArrayExtensions.hasElements(productDimensions) ? (\n
{productDimensions}
\n ) : (\n ''\n )}\n {renderUnitOfMeasure}\n
\n \n
\n {renderDisountLines}\n {renderInventoryLabel}\n {props.showShippingChargesForLineItems &&
{renderShippingLabel}
}\n {renderOtherCharges}\n {renderSalesAgreementPrompt}\n
\n {_generateQuantityandPrice()}\n {props.data.cartLine.IsInvoiceLine && props.data.cartState && props.resources.priceEditorResources && (\n \n )}\n
\n
\n {_generateErrorMessage()}\n \n );\n};\n\nexport default CartLine;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { CartLineItemComponent } from '@msdyn365-commerce/components';\nimport MsDyn365, * as Msdyn365 from '@msdyn365-commerce/core';\nimport { isChannelTypeB2B } from '@msdyn365-commerce/core';\nimport { CartLine, OrgUnitLocation, SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { getProductUrlSync, StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport {\n Button,\n getPayloadObject,\n getTelemetryAttributes,\n INodeProps,\n ITelemetryContent,\n TelemetryConstant\n} from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport get from 'lodash/get';\nimport groupBy from 'lodash/groupBy';\nimport * as React from 'react';\n\nimport { ICheckoutData } from '../checkout.data';\nimport { ICheckoutProps } from '../checkout.props.autogenerated';\n\ntype deliveryType = 'pickup' | 'ship' | 'email';\n\nexport interface IPickUpAtStore {\n PickUpAtStore: INodeProps;\n label: React.ReactNode;\n location: React.ReactNode;\n}\n\nexport interface IEmailDelivery {\n EmailDelivery: INodeProps;\n label: React.ReactNode;\n}\n\nexport interface ILineItem {\n LineId: string;\n LineItem: INodeProps;\n item?: React.ReactNode;\n pickUpAtStore?: IPickUpAtStore;\n emailDelivery?: IEmailDelivery;\n}\n\nexport interface ILineItemDeliveryGroup {\n LineItemDeliveryGroup: INodeProps;\n LineItemList: INodeProps;\n heading: React.ReactNode;\n lineItemWraper?: React.ReactNode;\n lineItemWraperIcon?: React.ReactNode;\n lineItems: ILineItem[];\n}\n\nexport interface ILineItems {\n LineItems: INodeProps;\n Header: INodeProps;\n heading: React.ReactNode;\n editLink: React.ReactNode;\n itemsForPickup?: ILineItemDeliveryGroup;\n itemsForShip?: ILineItemDeliveryGroup;\n itemsForEmail?: ILineItemDeliveryGroup;\n itemsGroupWithMulitplePickupMode?: ILineItemDeliveryGroup[];\n}\n\nexport const getLineItems = (input: ICheckoutProps, telemetryContent?: ITelemetryContent): ILineItems | undefined => {\n const pickupDeliveryModeCode = get(input, 'context.request.channel.PickupDeliveryModeCode');\n const emailDeliveryModeCode = get(input, 'context.request.channel.EmailDeliveryModeCode');\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\n const { channelDeliveryOptionConfig, featureState } = input.data;\n const retailMultiplePickUpOptionEnabled = featureState?.result?.find(feature => feature.Name === multiplePickupStoreSwitchName)\n ?.IsEnabled;\n\n const _getDeliveryLocation = (cartLine: CartLine): string => {\n const orgUnitLocations = get(input, 'data.orgUnitLocations.result');\n if (!cartLine.FulfillmentStoreId || !orgUnitLocations) {\n return '';\n }\n\n const locationMatch = (orgUnitLocations || []).find((location: OrgUnitLocation): boolean => {\n return location.OrgUnitNumber === cartLine.FulfillmentStoreId;\n });\n\n return locationMatch && locationMatch.OrgUnitName;\n };\n\n const _getProduct = (productId: number): SimpleProduct | undefined => {\n const products = get(input, 'data.products.result') || [];\n return products.find((_product: SimpleProduct) => {\n return productId === _product.RecordId;\n });\n };\n\n const _getLineItemComponent = (cartLine: CartLine): JSX.Element | undefined => {\n const product = cartLine.ProductId && _getProduct(cartLine.ProductId);\n const {\n id,\n typeName,\n context,\n config: { imageSettings, showShippingChargesForLineItems },\n resources: {\n quantityDisplayString,\n productDimensionTypeColor,\n productDimensionTypeSize,\n productDimensionTypeStyle,\n productDimensionTypeAmount,\n configString,\n inputQuantityAriaLabel,\n discountStringText,\n shippingCharges\n },\n context: {\n request: { gridSettings }\n }\n } = input;\n const catalogs = input.data.catalogs?.result;\n if (!product) {\n return;\n }\n\n let productUrl = getProductUrlSync(product, context.actionContext, undefined);\n if (MsDyn365.isBrowser && isChannelTypeB2B(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 const currencyCode = get(input, 'context.request.channel.Currency');\n return (\n \n );\n };\n\n const _getPickUpAtStoreComponents = (pickupDeliveryLocation: string): IPickUpAtStore => {\n const {\n resources: { pickUpAtStoreWithLocationText }\n } = input;\n\n return {\n PickUpAtStore: { className: 'ms-checkout__pick-up-at-store' },\n label: {pickUpAtStoreWithLocationText},\n location:
{pickupDeliveryLocation}
\n };\n };\n\n const _getEmailDeliveryComponents = (): IEmailDelivery => {\n const {\n resources: { emailDeliveryText }\n } = input;\n\n return {\n EmailDelivery: { className: 'ms-checkout__email-delivery' },\n label: {emailDeliveryText}\n };\n };\n\n const _getLineItemsComponents = (items: CartLine[]): ILineItem[] => {\n return items.map(cartLine => {\n const pickupDeliveryLocation = _getDeliveryLocation(cartLine);\n const isPickUp = _getCartPickDeliveryMode(cartLine);\n const isEmailDelivery =\n cartLine.DeliveryMode && cartLine.DeliveryMode !== '' ? cartLine.DeliveryMode === emailDeliveryModeCode : false;\n return {\n LineId: cartLine.LineId || '',\n LineItem: { className: 'ms-checkout__line-item' },\n item: _getLineItemComponent(cartLine),\n pickUpAtStore: isPickUp ? _getPickUpAtStoreComponents(pickupDeliveryLocation) : undefined,\n emailDelivery: isEmailDelivery ? _getEmailDeliveryComponents() : undefined\n };\n });\n };\n\n const _getCartPickDeliveryMode = (cartLineItem: CartLine): boolean => {\n return !StringExtensions.isNullOrWhitespace(cartLineItem.DeliveryMode)\n ? retailMultiplePickUpOptionEnabled\n ? cartLineItem.DeliveryMode ===\n channelDeliveryOptionConfig?.result?.PickupDeliveryModeCodes?.find(\n deliveryMode => deliveryMode === cartLineItem.DeliveryMode\n )\n : cartLineItem.DeliveryMode === pickupDeliveryModeCode\n : false;\n };\n\n const _getCartShipDeliveryMode = (cartLineItem: CartLine): boolean => {\n return !StringExtensions.isNullOrWhitespace(cartLineItem.DeliveryMode)\n ? retailMultiplePickUpOptionEnabled\n ? cartLineItem.DeliveryMode !==\n channelDeliveryOptionConfig?.result?.PickupDeliveryModeCodes?.find(\n deliveryMode => deliveryMode === cartLineItem.DeliveryMode\n )\n : cartLineItem.DeliveryMode !== pickupDeliveryModeCode\n : false;\n };\n\n const _getGroupTitleComponent = (count: number, type: deliveryType): string => {\n const {\n resources: { itemLabel, itemsLabel, inStorePickUpLabel, shippingCountCheckoutLineItem }\n } = input;\n\n let emailDeliveryModeDesc: string = '';\n\n input.data.deliveryOptions.result?.find(productDeliveryOptions => {\n emailDeliveryModeDesc = emailDeliveryModeDesc\n ? emailDeliveryModeDesc\n : productDeliveryOptions.DeliveryOptions?.find(deliveryOption => deliveryOption.Code === emailDeliveryModeCode)\n ?.Description!;\n });\n\n const suffix = count > 1 ? itemsLabel : itemLabel;\n const title =\n type === 'ship'\n ? shippingCountCheckoutLineItem\n : type === 'pickup'\n ? inStorePickUpLabel\n : `${emailDeliveryModeDesc} (${count} ${suffix})`;\n return title.replace('{count}', count.toString()).replace('{suffix}', suffix);\n };\n\n const _countItems = (items: CartLine[]): number => {\n return items.reduce((count, item) => {\n return count + (item.Quantity || 0);\n }, 0);\n };\n\n const _filterItemsByDiliveryType = (type: deliveryType): CartLine[] => {\n const cart = get(input, 'data.checkout.result.checkoutCart.cart');\n if (type === 'ship') {\n return cart.CartLines.filter((cartLine: CartLine) =>\n cartLine.DeliveryMode && cartLine.DeliveryMode !== ''\n ? _getCartShipDeliveryMode(cartLine) && cartLine.DeliveryMode !== emailDeliveryModeCode\n : cartLine\n );\n } else if (type === 'pickup') {\n return cart.CartLines.filter((cartLine: CartLine) =>\n cartLine.DeliveryMode && cartLine.DeliveryMode !== '' ? _getCartPickDeliveryMode(cartLine) : null\n );\n }\n return cart.CartLines.filter((cartLine: CartLine) => cartLine.DeliveryMode === emailDeliveryModeCode);\n };\n\n const _getLineItemsByDeliveryType = (type: deliveryType): ILineItemDeliveryGroup | undefined => {\n if ((pickupDeliveryModeCode === '' || pickupDeliveryModeCode === undefined) && (type === 'pickup' || type === 'email')) {\n return;\n }\n\n const items = _filterItemsByDiliveryType(type);\n\n if (items.length === 0) {\n return undefined;\n }\n\n const count = _countItems(items);\n const title = _getGroupTitleComponent(count, type);\n\n return {\n LineItemDeliveryGroup: { className: classnames('ms-checkout__line-items-delivery-group', type) },\n LineItemList: { className: 'ms-checkout__line-items-list' },\n heading:
{title}
,\n lineItems: _getLineItemsComponents(items)\n };\n };\n\n const _getLineItems = (): ILineItems | undefined => {\n const {\n context,\n config: { lineItemsHeading },\n data: { products },\n resources: { editCartText }\n } = input;\n\n const payLoad = getPayloadObject('click', telemetryContent!, TelemetryConstant.EditCart);\n const attribute = getTelemetryAttributes(telemetryContent!, payLoad);\n const cart = get(input, 'data.checkout.result.checkoutCart.cart');\n const groupClass = retailMultiplePickUpOptionEnabled ? ' multiple-pickup-enabled' : '';\n if (!cart || !cart.CartLines || cart.CartLines.length === 0 || !products) {\n return undefined;\n }\n\n return {\n LineItems: { className: `ms-checkout__line-items${groupClass}` },\n Header: { className: 'ms-checkout__line-items-header' },\n heading: lineItemsHeading && lineItemsHeading.text && (\n \n ),\n editLink: (\n \n {editCartText}\n \n ),\n itemsForPickup: _getLineItemsByDeliveryType('pickup'),\n itemsForShip: _getLineItemsByDeliveryType('ship'),\n itemsForEmail: _getLineItemsByDeliveryType('email'),\n itemsGroupWithMulitplePickupMode: retailMultiplePickUpOptionEnabled\n ? _getLineItemsByDeliveryTypeWithMulitplePickupMode()\n : undefined\n };\n };\n\n const handleLineItemHeadingChange = (event: Msdyn365.ContentEditableEvent) => {\n const {\n config: { lineItemsHeading }\n } = input;\n if (lineItemsHeading) {\n lineItemsHeading.text = event.target.value;\n }\n };\n\n const _getGroupTitleComponentWithMultiplePickUp = (\n count: number,\n type: deliveryType,\n deliveryMode?: string,\n fulFillmentStoreId?: string\n ): string => {\n const {\n resources: { itemLabel, itemsLabel }\n } = input;\n\n let emailDeliveryModeDesc: string = '';\n let pickupDeliveryModeDesc: string = '';\n\n input.data.deliveryOptions.result?.find(productDeliveryOptions => {\n emailDeliveryModeDesc = emailDeliveryModeDesc\n ? emailDeliveryModeDesc\n : productDeliveryOptions.DeliveryOptions?.find(deliveryOption => deliveryOption.Code === emailDeliveryModeCode)\n ?.Description!;\n });\n\n input.data.deliveryOptions.result?.find(productDeliveryOptions => {\n pickupDeliveryModeDesc = pickupDeliveryModeDesc\n ? pickupDeliveryModeDesc\n : productDeliveryOptions.DeliveryOptions?.find(deliveryOption => deliveryOption.Code === deliveryMode)?.Description!;\n });\n\n const pickupTitle: string = `${pickupDeliveryModeDesc}, ${fulFillmentStoreId}`;\n const suffix = count > 1 ? itemsLabel : itemLabel;\n const title =\n type === 'ship'\n ? `(${count} ${suffix})`\n : type === 'pickup'\n ? `${pickupTitle} (${count} ${suffix})`\n : `${emailDeliveryModeDesc} (${count} ${suffix})`;\n return title.replace('{count}', count.toString()).replace('{suffix}', suffix);\n };\n\n const _filterItemsByMultiplePickupMode = (): CartLine[][] => {\n const cart = get(input, 'data.checkout.result.checkoutCart.cart');\n const getGroupByStorePickup = (items: CartLine[]) => groupBy(items, item => item.FulfillmentStoreId);\n const getGroupByDelivery = (items: CartLine[]) => groupBy(items, item => item.DeliveryMode);\n const groupDelivery = getGroupByDelivery(cart.CartLines);\n const cartLinesGroup: CartLine[] = [];\n const cartLinesGrp: CartLine[][] = [];\n\n // 1) Group by store and pick up mode\n Object.entries(groupDelivery).forEach(([deliveryMode, groupByDeliveryType]) => {\n // @ts-expect-error\n groupDelivery[deliveryMode] = getGroupByStorePickup(groupByDeliveryType);\n cartLinesGroup.push(getGroupByStorePickup(groupByDeliveryType));\n });\n\n Object.keys(cartLinesGroup).forEach(key => {\n const cartLines = cartLinesGroup[key];\n Object.keys(cartLines).forEach(index => {\n const cartLine = cartLines[index];\n cartLinesGrp.push(cartLine);\n });\n });\n\n return cartLinesGrp;\n };\n\n const _getLineItemsByDeliveryTypeWithMulitplePickupMode = (): ILineItemDeliveryGroup[] | undefined => {\n if (pickupDeliveryModeCode === '' || pickupDeliveryModeCode === undefined) {\n return;\n }\n\n const {\n resources: { multiplePickUpLabel, shippingLable }\n } = input;\n\n const items = _filterItemsByMultiplePickupMode();\n\n if (items.length === 0) {\n return undefined;\n }\n\n const lineItemDeliveryGroup: ILineItemDeliveryGroup[] = [];\n items.map(item => {\n const count = _countItems(item);\n const cartLine = item[0];\n const pickupDeliveryLocation = _getDeliveryLocation(cartLine);\n const type: deliveryType =\n cartLine.FulfillmentStoreId && cartLine.DeliveryMode\n ? 'pickup'\n : cartLine.FulfillmentStoreId === '' &&\n cartLine.DeliveryMode === emailDeliveryModeCode &&\n !StringExtensions.isNullOrEmpty(emailDeliveryModeCode)\n ? 'email'\n : 'ship';\n const title = _getGroupTitleComponentWithMultiplePickUp(count, type, cartLine.DeliveryMode, pickupDeliveryLocation);\n const groupTitle = type === 'pickup' ? multiplePickUpLabel : type === 'ship' ? shippingLable : 'email';\n const iconClass = `ms-checkout__line-items-group-title-multiple-pickup-${type}icon`;\n lineItemDeliveryGroup.push({\n LineItemDeliveryGroup: { className: classnames('ms-checkout__line-items-delivery-group multiple-pickup', type) },\n LineItemList: { className: 'ms-checkout__line-items-list' },\n lineItemWraperIcon:
,\n lineItemWraper:
{groupTitle}
,\n heading:
{title}
,\n lineItems: _getLineItemsComponents(item)\n });\n });\n\n return lineItemDeliveryGroup;\n };\n\n return _getLineItems();\n};\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 { IOrderSummaryLines, OrderSummary } from '@msdyn365-commerce-modules/order-summary-utilities';\nimport { INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport get from 'lodash/get';\nimport * as React from 'react';\n\nimport { ICheckoutData } from '../checkout.data';\nimport { ICheckoutProps } from '../checkout.props.autogenerated';\n\nexport interface IOrderSummary {\n orderSummaryProps: INodeProps;\n heading?: React.ReactNode;\n lines?: IOrderSummaryLines;\n}\nexport const getOrderSummary = (input: ICheckoutProps): IOrderSummary => {\n const {\n config: { orderSummaryHeading },\n data: { checkout },\n resources: {\n subTotalLabel,\n shippingLabel,\n taxLabel,\n orderTotalLabel,\n loyaltyLabel,\n giftcardLabel,\n totalDiscountsLabel,\n freeText,\n toBeCalculatedText,\n otherCharges,\n customerAccountLabel\n },\n context,\n typeName,\n id,\n telemetry\n } = input;\n\n const checkoutState = get(checkout, 'result');\n const cart = get(checkout, 'result.checkoutCart.cart');\n const showLineItems = cart.CartLines && cart.CartLines.length > 0;\n const channelConfiguration = context.request.channel!;\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\n const { channelDeliveryOptionConfig, featureState } = input.data;\n const retailMultiplePickUpOptionEnabled = featureState?.result?.find(feature => feature.Name === multiplePickupStoreSwitchName)\n ?.IsEnabled;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- app configs are of generic type\n const isShowOrHideTaxEnabled = context.request.app.config.isEnableShowOrHideSalesTaxECommerceEnabled === true;\n\n const handleOrderSummaryHeadingChange = (event: Msdyn365.ContentEditableEvent) => {\n const {\n config: { orderSummaryHeading }\n } = input;\n if (orderSummaryHeading) {\n orderSummaryHeading.text = event.target.value;\n }\n };\n\n return {\n orderSummaryProps: { className: 'ms-checkout-guest-profile__selected-item' },\n heading: orderSummaryHeading && orderSummaryHeading.text && (\n \n ),\n lines: showLineItems\n ? OrderSummary({\n checkoutState,\n cart,\n subTotalLabel,\n shippingLabel,\n taxLabel,\n orderTotalLabel,\n loyaltyLabel,\n giftcardLabel,\n totalDiscountsLabel,\n freeText,\n toBeCalculatedText,\n context,\n typeName,\n id,\n channelConfiguration,\n telemetry,\n otherChargeLabel: otherCharges,\n retailMultiplePickUpOptionEnabled,\n channelDeliveryOptionConfig: channelDeliveryOptionConfig?.result,\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- existing property.\n isTaxIncludedInPrice: cart.IsTaxIncludedInPrice,\n isShowTaxBreakup: isShowOrHideTaxEnabled,\n customerAccountLabel\n })\n : undefined\n };\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 { CheckoutModule, getCheckoutState, ICheckoutState } from '@msdyn365-commerce/global-state/';\n\nexport async function focusOnCheckoutError(checkoutErrorRef: React.RefObject, ctx: IActionContext): Promise {\n const checkoutState: ICheckoutState = await getCheckoutState(ctx).catch((error: Error) => {\n ctx.telemetry.exception(error);\n throw error;\n });\n\n checkoutErrorRef.current && checkoutErrorRef.current.scrollIntoView();\n await checkoutState.updateCheckoutErrorFocus({ newCheckoutErrorFocus: CheckoutModule.None });\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, 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 = ({\n price,\n label,\n context,\n id,\n typeName,\n toBeCalculatedText,\n freeText,\n cssLabel\n}) => {\n return (\n

\n {label}\n {price || price === 0 ? (\n \n ) : (\n {toBeCalculatedText}\n )}\n

\n );\n};\n\nconst _buildPaymentSummarySection = (\n props: IInvoiceSummaryProps,\n price: number | undefined,\n label: string,\n cssLabel: string\n): React.ReactNode => {\n return (\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 = ({\n price,\n label,\n context,\n id,\n typeName,\n toBeCalculatedText,\n freeText,\n cssLabel,\n priceCurrency\n}) => {\n return (\n

\n {label}\n {price || price === 0 ? (\n \n ) : (\n {toBeCalculatedText}\n )}\n

\n );\n};\n\nconst _buildOrderSummarySection = (\n props: IOrderSummaryProps,\n price: number | undefined,\n cssLabel: string,\n label: string = ''\n): React.ReactNode => {\n return (\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 { IModuleStateManager } from '@msdyn365-commerce-modules/checkout-utilities';\nimport { Heading } from '@msdyn365-commerce-modules/data-types';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport { ICoreContext } from '@msdyn365-commerce/core';\nimport get from 'lodash/get';\nimport { computed } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport GuidedCard from './guided-card';\n\nexport interface ICheckoutGuidedFormProps {\n items: React.ReactNode[];\n moduleState: IModuleStateManager;\n disableGuidedCheckoutFlow?: boolean;\n isMobile?: boolean;\n isEditor?: boolean;\n resource: {\n checkoutStepTitleFormat: string;\n saveBtnLabel: string;\n changeBtnLabel: string;\n cancelBtnLabel: string;\n saveAndContinueBtnLabel: string;\n };\n requestContext?: ICoreContext;\n telemetryContent?: ITelemetryContent;\n isPaymentVerificationRedirection?: boolean;\n shouldEnableSinglePaymentAuthorizationCheckout?: boolean;\n hasError?: boolean;\n hasShippingAddress?: boolean | undefined;\n hasCartDeliveryMode?: boolean | undefined;\n hasGuestCheckoutEmail?: boolean | undefined;\n isTermsAndConditionAccepted?: boolean | undefined;\n shouldEnableCheckoutErrorDisplayMessaging?: boolean;\n shouldFocusOnCheckoutError?: boolean | undefined;\n}\n\ninterface ICheckoutGuidedFormState {\n currentStep: number;\n}\n\nconst paymentInstrumentModuleId = 'payment-instrument';\n\n/**\n *\n * CheckoutGuidedForm component.\n * @extends {React.Component}\n */\n@observer\nclass CheckoutGuidedForm extends React.PureComponent {\n @computed public get hasMissingInfo(): boolean {\n if (\n this.props.hasShippingAddress === false ||\n this.props.hasCartDeliveryMode === false ||\n this.props.hasGuestCheckoutEmail === false ||\n this.props.isTermsAndConditionAccepted === false\n ) {\n return true;\n }\n\n return false;\n }\n\n @computed public get hasOrderError(): boolean {\n for (const item of this.props.items) {\n const childId = this.getId(item);\n const state = this.props.moduleState.getModule(childId);\n\n const isPaymentSectionContainer = ArrayExtensions.hasElements(\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\n state.childIds?.filter(currentId => currentId?.includes(paymentInstrumentModuleId))\n );\n\n if (!isPaymentSectionContainer && !state.isDisabled && state.hasError) {\n return true;\n }\n }\n\n return false;\n }\n\n public state: ICheckoutGuidedFormState = {\n currentStep: 0\n };\n\n public componentDidMount(): void {\n /**\n * Append child modules.\n */\n const childIds = this.props.items.map((item: React.ReactNode) => get(item, 'props.id'));\n this.props.moduleState.init({ childIds });\n }\n\n public render(): JSX.Element | null {\n const { moduleState, items, resource } = this.props;\n if (!items || !moduleState) {\n return null;\n }\n\n const shouldCollapseAfterRedirect =\n this.props.isPaymentVerificationRedirection &&\n this.props.shouldEnableSinglePaymentAuthorizationCheckout &&\n !this.props.hasError &&\n !this.hasMissingInfo &&\n !this.hasOrderError;\n\n let previousModuleHasError = false;\n const childModule = this._enableAfterModule();\n return (\n
\n {items.map((item: React.ReactNode) => {\n const childId = this.getId(item);\n const step = this.getStep(childId);\n const title = this.getHeading(item);\n const state = this.props.moduleState.getModule(childId);\n const {\n isReady,\n isPending,\n isUpdating,\n isDisabled,\n isCancelAllowed,\n onEdit,\n onCancel,\n onSubmit,\n hasModuleState,\n hasInitialized,\n hasError\n } = state || ({} as IModuleStateManager);\n\n let shouldFocus =\n !!this.props.shouldEnableCheckoutErrorDisplayMessaging &&\n !!this.props.shouldFocusOnCheckoutError &&\n !previousModuleHasError &&\n hasError;\n previousModuleHasError = previousModuleHasError || shouldFocus;\n\n return (\n \n {React.cloneElement(item as React.ReactElement, { enableControl: true })}\n \n );\n })}\n
\n );\n }\n\n private readonly getEnabledModules = (): string[] => {\n const {\n moduleState: { childIds, getModule }\n } = this.props;\n return childIds.filter((childId: string) => {\n const state = getModule(childId);\n return !!state && !state.isDisabled;\n });\n };\n\n /**\n * Check if it is a section container with payment module.\n * @param moduleId -- The id of the module.\n * @returns If it is a section container with payment module.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private readonly _enableAfterModule = (): string => {\n const childIds: string[] = this.props.items.map((item: React.ReactNode) => get(item, 'props.id')).filter(Boolean);\n let id: string = '';\n for (let i = 0; i < childIds.length - 1; i++) {\n const childId = childIds[i];\n const nextChildId = childIds[i + 1];\n if (this._isPaymentSectionContainer(childId) && nextChildId) {\n id = nextChildId;\n }\n }\n return id;\n };\n\n /**\n * Check if it is a section container with payment module.\n * @param moduleId -- The id of the module.\n * @returns If it is a section container with payment module.\n */\n private readonly _isPaymentSectionContainer = (moduleId: string): boolean => {\n const sectionState = this.props.moduleState.getModule(moduleId);\n const isPaymentSectionContainer = ArrayExtensions.hasElements(\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\n sectionState.childIds?.filter(currentId => currentId?.includes(paymentInstrumentModuleId))\n );\n\n if (isPaymentSectionContainer) {\n return true;\n }\n return false;\n };\n\n private readonly getStep = (id: string): number => {\n return this.getEnabledModules().indexOf(id);\n };\n\n private readonly getId = (item: React.ReactNode): string => {\n return get(item, 'props.id') || '';\n };\n\n private readonly getHeading = (item: React.ReactNode): Heading => {\n return get(item, 'props.config.heading') || '';\n };\n\n private readonly isExpanded = (step: number, moduleChildId: string, childId: string): boolean => {\n if (this.props.isEditor) {\n // Editorial mode: Expand all the drawers\n return true;\n }\n if (this.props.shouldEnableSinglePaymentAuthorizationCheckout && moduleChildId === childId) {\n return true;\n }\n return step > -1 && step <= this.state.currentStep;\n };\n\n private readonly isActive = (step: number): boolean => {\n return step === this.state.currentStep;\n };\n\n private readonly isVisted = (step: number): boolean => {\n return step > -1 && step < this.state.currentStep;\n };\n\n private readonly onNext = (): void => {\n this.setState({\n currentStep: this.state.currentStep + 1\n });\n };\n}\n\nexport default CheckoutGuidedForm;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as React from 'react';\n\nexport interface IAddressBillingHeading {\n text: string;\n}\n\nexport const AddressBillingHeading: React.FC = ({ text }) => (\n

{text}

\n);\n\nexport default IAddressBillingHeading;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as React from 'react';\n\n/**\n * The payment error.\n */\nexport interface IPaymentError {\n title: string;\n message: string;\n className?: string;\n}\n\n/**\n * The payment error.\n * @param param0 - First param.\n * @param param0.title - Title.\n * @param param0.message - Message.\n * @param param0.className - ClassName.\n * @returns React node.\n */\nexport const ErrorComponent: React.FC = ({ title, message, className = 'ms-checkout-payment-instrument' }) => (\n
\n

{title}

\n

{message}

\n
\n);\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Address, AddressPurpose } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { format, INodeProps, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { AddressFormat } from '../address-format';\nimport { IAddressResource } from '../address-module.data';\nimport AddressButtonComponent from './address-button';\nimport AddressInputComponent from './address-input';\nimport { AddressShow, IAddressShowProps } from './address-show';\n\nexport interface IAddressSelectInputProps {\n hasExternalSubmitGroup?: boolean;\n addressFormat: AddressFormat;\n addresses: Address[];\n addressPurposes: AddressPurpose[];\n resources: IAddressResource;\n selectedAddress: Address;\n telemetryContent?: ITelemetryContent;\n onAddressOptionChange(event: React.ChangeEvent): void;\n onShipMultipleAddresses?(): void;\n onAddAddress(): void;\n onSave(): void;\n onCancel(): void;\n multipleAddressShippingEnabled?: boolean;\n}\n\nexport interface IAddressSelectItem {\n key: number;\n SelectItem: INodeProps;\n input: React.ReactNode;\n showItems: IAddressShowProps;\n}\n\nexport interface IAddressSelectProps {\n SelectAddress: INodeProps;\n shipMultipleAddressesButton?: React.ReactNode;\n addButton: React.ReactNode;\n items: IAddressSelectItem[];\n isShowSaveButton: boolean;\n saveButton: React.ReactNode;\n isShowCancelButton: boolean;\n cancelButton: React.ReactNode;\n}\n\nconst getInput = (index: number, address: Address, props: IAddressSelectInputProps): React.ReactNode => {\n const { addresses, onAddressOptionChange, selectedAddress, resources, addressPurposes } = props;\n const addressTypeDescription = address.AddressTypeValue\n ? addressPurposes.find(purpose => purpose.AddressType === address.AddressTypeValue)?.Description || ''\n : '';\n const ichecked = address.RecordId === selectedAddress.RecordId;\n const additionalAttributes = {\n checked: ichecked,\n 'aria-checked': ichecked,\n 'aria-setsize': addresses.length,\n 'aria-posinset': index + 1,\n 'aria-label': format(resources.addressChangeCheckboxAriaLabel, addressTypeDescription)\n };\n\n return (\n \n );\n};\n\nconst getAddressSelectItems = (props: IAddressSelectInputProps): IAddressSelectItem[] => {\n const { addresses, addressFormat, addressPurposes } = props;\n\n return addresses.map((address, index) => {\n return {\n key: address.RecordId || 0,\n SelectItem: { className: 'msc-address-select__item' },\n input: getInput(index, address, props),\n showItems: AddressShow({\n addressFormat: addressFormat.getAddressFormat(address.ThreeLetterISORegionName || ''),\n address,\n addressPurposes\n })\n };\n });\n};\n\nexport const AddressSelect = (props: IAddressSelectInputProps): IAddressSelectProps => {\n const {\n resources,\n onCancel,\n onSave,\n onAddAddress,\n onShipMultipleAddresses,\n hasExternalSubmitGroup,\n multipleAddressShippingEnabled\n } = props;\n\n return {\n SelectAddress: { className: 'msc-address-select' },\n addButton: (\n
\n \n
\n ),\n shipMultipleAddressesButton: multipleAddressShippingEnabled && onShipMultipleAddresses && (\n \n ),\n isShowSaveButton: !hasExternalSubmitGroup,\n saveButton: (\n \n ),\n isShowCancelButton: !hasExternalSubmitGroup,\n cancelButton: (\n \n ),\n items: getAddressSelectItems(props)\n };\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as React from 'react';\n\ninterface IAlertProps {\n message: string;\n}\n\nconst CheckoutAlert: React.FC = ({ message }) => (\n

\n {message}\n

\n);\n\nexport default CheckoutAlert;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IInvoiceSummaryLines, InvoiceSummary } from '@msdyn365-commerce-modules/invoice-payment-summary';\nimport get from 'lodash/get';\nimport * as React from 'react';\n\nimport { ICheckoutData } from '../checkout.data';\nimport { ICheckoutProps } from '../checkout.props.autogenerated';\n\nexport interface IInvoicePaymentSummary {\n heading?: React.ReactNode;\n lines?: IInvoiceSummaryLines;\n}\nexport const getInvoicePaymentSummary = (input: ICheckoutProps): IInvoicePaymentSummary => {\n const {\n data: { checkout },\n resources: { totalAmountLabel, invoiceLabel, invoiceSummaryTitle },\n context,\n typeName,\n id,\n telemetry\n } = input;\n\n const checkoutCart = get(checkout, 'result.checkoutCart');\n const cart = get(checkout, 'result.checkoutCart.cart');\n\n return {\n heading:

{invoiceSummaryTitle}

,\n lines: checkoutCart?.hasInvoiceLine\n ? InvoiceSummary({\n orderTotalLabel: totalAmountLabel,\n invoiceLabel,\n cart,\n context,\n typeName,\n telemetry,\n id,\n checkoutState: checkout.result\n })\n : undefined\n };\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IModuleStateManager } from '@msdyn365-commerce-modules/checkout-utilities';\nimport { Heading as HeadingType } from '@msdyn365-commerce-modules/data-types';\nimport {\n Button,\n getPayloadObject,\n getTelemetryAttributes,\n IPayLoad,\n ITelemetryContent,\n TelemetryConstant\n} from '@msdyn365-commerce-modules/utilities';\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport classname from 'classnames';\nimport get from 'lodash/get';\nimport * as React from 'react';\nimport { focusOnCheckoutError, setCheckoutErrorFocus } from '../../../checkout-errors';\n\nexport interface ICheckoutGuidedCardProps {\n id?: string;\n step: number;\n title?: HeadingType;\n disabled?: boolean; // Module is not available\n isActive?: boolean; // Step === currentStep\n isVisted?: boolean; // Step < currentStep\n isExpanded?: boolean;\n isReady?: boolean;\n isPending?: boolean;\n isUpdating?: boolean;\n isSubmitting?: boolean;\n isCancelAllowed?: boolean;\n isMobile?: boolean;\n hasInitialized?: boolean;\n hasControlGroup?: boolean;\n shouldFocus?: boolean;\n children: React.ReactNode;\n moduleState?: IModuleStateManager;\n actionContext?: IActionContext;\n resource: {\n checkoutStepTitleFormat: string;\n saveBtnLabel: string;\n changeBtnLabel: string;\n cancelBtnLabel: string;\n saveAndContinueBtnLabel: string;\n };\n telemetryContent?: ITelemetryContent;\n onEdit?(): void;\n onCancel?(): void;\n onSubmit?(): void;\n onNext(): void;\n}\n\n/**\n *\n * CheckoutGuidedCard component.\n * @extends {React.Component}\n */\nclass CheckoutGuidedCard extends React.PureComponent {\n private readonly editButtonRef: React.RefObject = React.createRef();\n\n private readonly formCardRef: React.RefObject = React.createRef();\n\n private readonly payLoad: IPayLoad;\n\n constructor(props: ICheckoutGuidedCardProps) {\n super(props);\n this.payLoad = getPayloadObject('click', props.telemetryContent!, '');\n }\n\n public componentDidUpdate(prevProps: ICheckoutGuidedCardProps): void {\n /**\n * Move to next step when current step is ready.\n */\n const { isActive, isReady, onNext, isVisted, onEdit, shouldFocus, children, moduleState, actionContext } = this.props;\n\n // Move to next step after completing the current step\n if (isActive && isReady) {\n onNext();\n }\n\n // Set the focus to Edit button once edit button appear\n // (It happens when current step switch to isReady status)\n const prevCanEdit = prevProps.isReady && prevProps.isVisted && !!prevProps.onEdit;\n const canEdit = isReady && isVisted && !!onEdit;\n if (!prevCanEdit && canEdit) {\n this.focusOnEditButton();\n this.scrollToTitle();\n }\n\n // Set the focus to the first focusable element\n // (It happens when current step switch to isUpdating status)\n if (prevProps.isReady && !isReady) {\n this.focusOnFirstFocusableElement();\n }\n\n // Set the focus for the checkout error\n if (shouldFocus && actionContext) {\n const childrenModules = this._getModules(children);\n\n // Set the focus for the module within the checkout section container\n if (childrenModules.length > 0) {\n for (const childModule of childrenModules) {\n const childId = this._getId(childModule);\n const childState = moduleState?.getModule(childId);\n\n if (childState?.hasError) {\n setCheckoutErrorFocus(childId, actionContext);\n return;\n }\n }\n } else {\n focusOnCheckoutError(this.formCardRef, actionContext);\n }\n }\n }\n\n public render(): JSX.Element | null {\n const {\n title,\n disabled,\n isExpanded,\n isActive,\n isVisted,\n children,\n isReady,\n isPending,\n isUpdating,\n hasInitialized,\n hasControlGroup,\n onEdit,\n resource\n } = this.props;\n const { changeBtnLabel } = resource;\n\n this.payLoad.contentAction.etext = TelemetryConstant.CheckoutChange;\n const changeBtnAttributes = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\n const canEdit = hasControlGroup && isReady && isVisted && onEdit;\n\n return (\n \n
\n {this.getTitle()}\n\n {canEdit && (\n \n {changeBtnLabel}\n \n )}\n
\n\n \n
{children}
\n\n {this.renderFooder()}\n
\n \n );\n }\n\n private readonly renderFooder = (): JSX.Element | null => {\n const { isVisted, isReady, isSubmitting, isCancelAllowed, hasControlGroup, onCancel, onSubmit, resource } = this.props;\n const { saveBtnLabel, cancelBtnLabel, saveAndContinueBtnLabel } = resource;\n\n const canSubmit = !isReady && onSubmit;\n const canCancel = !isReady && isVisted && isCancelAllowed && onCancel;\n\n if (!hasControlGroup || (!canSubmit && !canCancel)) {\n return null;\n }\n\n this.payLoad.contentAction.etext = isVisted ? TelemetryConstant.Save : TelemetryConstant.SaveContinue;\n const saveBtnAttributes = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\n this.payLoad.contentAction.etext = TelemetryConstant.Cancel;\n const cancelBtnAttributes = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\n\n return (\n
\n {canSubmit && (\n \n {isVisted && isCancelAllowed ? saveBtnLabel : saveAndContinueBtnLabel}\n \n )}\n {canCancel && (\n \n {cancelBtnLabel}\n \n )}\n
\n );\n };\n\n private readonly focusOnFirstFocusableElement = (): void => {\n const node = this.formCardRef.current as HTMLElement;\n const focussableElements = `\n a:not([disabled]),\n button:not([disabled]),\n input[type=submit]:not([disabled]),\n input[type=checkbox]:not([disabled]),\n input[type=text]:not([disabled]),\n input[type=radio]:not([disabled]),\n input[type=password]:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n [tabindex]:not([disabled]):not([tabindex=\"-1\"])\n `;\n\n const child = node && node.querySelector && (node.querySelector(focussableElements) as HTMLElement);\n child && child.focus && child.focus();\n };\n\n private readonly focusOnEditButton = (): void => {\n // Focus on edit button\n const editButton =\n this.editButtonRef &&\n this.editButtonRef.current &&\n this.editButtonRef.current.focus &&\n (this.editButtonRef.current as HTMLElement);\n editButton && editButton.focus();\n };\n\n private readonly scrollToTitle = (): void => {\n // Scroll window to the title of the step that was just completed only in mobile viewport\n const formCard = this.props.isMobile && this.formCardRef && this.formCardRef.current && (this.formCardRef.current as HTMLElement);\n formCard && formCard.scrollIntoView();\n };\n\n private readonly getTitle = (): JSX.Element => {\n const { step, title } = this.props;\n const { headingTag: Tag = 'h2', text = '' } = title || {};\n return (\n \n \n {step + 1}. {` `}\n \n {text && {text}}\n \n );\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private readonly _getModules = (item: React.ReactNode): any[] => {\n return get(item, 'props.modules.primary') || [];\n };\n\n private readonly _getId = (item: React.ReactNode): string => {\n return get(item, 'id') || '';\n };\n}\n\nexport default CheckoutGuidedCard;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { TelemetryEvent } from '@msdyn365-commerce/core';\nimport { Button, getPayloadObject, getTelemetryAttributes, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport React, { useState } from 'react';\n\ninterface ICheckoutPlaceOrderButtonProps {\n canPlaceOrder: boolean;\n checkoutBtnText: string;\n telemetryContent?: ITelemetryContent;\n shouldEnableSinglePaymentAuthorizationCheckout?: boolean;\n isPlaceOrderLoading?: boolean;\n isExpressCheckoutApplied?: boolean;\n isPaymentVerificationRedirection?: boolean;\n placeOrder(): Promise;\n}\n\nconst buttonsStates: React.Dispatch>[] = [];\n\n/**\n * On place order function.\n * @param isBusy -Check is busy.\n * @param canPlaceOrder -Check can place order.\n * @param placeOrder -Place order function.\n * @returns Set state of button.\n */\nconst onPlaceOrderHandler = (isBusy: boolean, canPlaceOrder: boolean, placeOrder: () => Promise) => async () => {\n if (isBusy || !canPlaceOrder) {\n return;\n }\n buttonsStates.map(buttonSetState => {\n buttonSetState(true);\n return true;\n });\n await placeOrder();\n};\n\nconst CheckoutPlaceOrderButton: React.FC = ({\n checkoutBtnText,\n canPlaceOrder,\n placeOrder,\n telemetryContent,\n shouldEnableSinglePaymentAuthorizationCheckout,\n isPlaceOrderLoading,\n isExpressCheckoutApplied,\n isPaymentVerificationRedirection\n}) => {\n const [isBusy, setIsBusy] = useState(false);\n buttonsStates.push(setIsBusy);\n const payload = getPayloadObject(TelemetryEvent.Purchase, telemetryContent!, checkoutBtnText, '');\n const attributes = getTelemetryAttributes(telemetryContent!, payload);\n\n if (shouldEnableSinglePaymentAuthorizationCheckout && (!isExpressCheckoutApplied || isPaymentVerificationRedirection)) {\n return (\n \n {checkoutBtnText}\n \n );\n }\n\n return (\n \n {checkoutBtnText}\n \n );\n};\n\nexport default CheckoutPlaceOrderButton;\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 { ICheckoutState } from '@msdyn365-commerce/global-state';\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { PlaceOrder } from '../../../common/place-order';\n\nexport default async (\n ctx: IActionContext,\n checkoutState: ICheckoutState | undefined,\n orderedProducts: SimpleProduct[] | undefined,\n redirect: boolean,\n updatedCartVersion?: number,\n isPaymentVerificationRedirection?: boolean\n) => {\n return PlaceOrder(ctx, checkoutState, orderedProducts, redirect, updatedCartVersion, isPaymentVerificationRedirection);\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport AddressInputComponent from './address-input';\n\nexport interface IAddressBillingCheckbox {\n isChecked: boolean;\n value: string;\n ariaLabel: string;\n text: string;\n telemetryContent?: ITelemetryContent;\n onChange(event: React.ChangeEvent): void;\n}\n\nexport const AddressBillingCheckbox: React.FC = ({\n isChecked,\n value,\n ariaLabel,\n text,\n telemetryContent,\n onChange\n}) => {\n const additionalAttributes = {\n checked: isChecked,\n 'aria-checked': isChecked\n };\n\n return (\n \n );\n};\nexport default AddressBillingCheckbox;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as React from 'react';\nimport { INodeProps, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport { ICoreContext } from '@msdyn365-commerce/core';\nimport { Address, CartLine } from '@msdyn365-commerce/retail-proxy';\nimport AddressButtonComponent from './address-button';\nimport { IShipMultipleAddressesTableHeadingProps, ShipMultipleAddressesTableHeading } from './address-ship-multiple-heading';\nimport { IAddressResource } from '../address-module.data';\nimport {\n IShipMultipleAddressesLineProps,\n IShipMultipleAddressesLineViewProps,\n ShipMultipleAddressesLineView\n} from './address-ship-multiple-lines';\nimport { IShipMultipleAddressesLineViewModel } from '../../modules/checkout-shipping-address';\nimport { ICartLineWithProduct, ICheckoutShippingCartLineInfo } from '../../modules/checkout-shipping-address/components';\n\nexport interface IAddressShipMultipleInputProps {\n context: ICoreContext;\n hasExternalSubmitGroup?: boolean;\n moduleId: string;\n moduleTypeName: string;\n currencyCode: string | undefined;\n resources: IAddressResource;\n shippingLines: ICartLineWithProduct[];\n shippingLineImages: ICheckoutShippingCartLineInfo[];\n selectedShippingLines: IShipMultipleAddressesLineViewModel[];\n customerAddresses: Address[];\n onSelect(line: IShipMultipleAddressesLineViewModel, isChecked: boolean): void;\n onSelectAll(isChecked: boolean): void;\n onClear(): void;\n onShippingAddressChange(shippingLine: CartLine, event: React.ChangeEvent): void;\n onBulkShippingAddressChange(event: React.ChangeEvent): void;\n onShipSingleAddress(): void;\n onSave(): void;\n onCancel(): void;\n isMobile: boolean;\n telemetryContent?: ITelemetryContent;\n}\n\nexport interface IShipMultipleAddressesViewProps {\n ShipMultipleAddress?: INodeProps;\n shipSingleAddressButton?: React.ReactNode;\n clearSelectionButton?: React.ReactNode;\n addressDropdown?: React.ReactNode;\n ProductsTable?: INodeProps;\n ProductsTableHeading?: React.ReactNode;\n ProductsTableRow?: INodeProps;\n shipMultipleAddressLines?: IShipMultipleAddressesLineViewProps[];\n isShowSaveButton?: boolean;\n saveButton?: React.ReactNode;\n isShowCancelButton?: boolean;\n cancelButton?: React.ReactNode;\n isMobile?: boolean;\n}\n\nexport const AddressShipMultiple = (props: IAddressShipMultipleInputProps): IShipMultipleAddressesViewProps => {\n const {\n context,\n currencyCode,\n hasExternalSubmitGroup,\n moduleId,\n moduleTypeName,\n shippingLines,\n shippingLineImages,\n selectedShippingLines,\n customerAddresses,\n isMobile,\n onSelect,\n onSelectAll,\n onClear,\n onShippingAddressChange,\n onBulkShippingAddressChange,\n onShipSingleAddress,\n onSave,\n onCancel,\n resources\n } = props;\n\n const { unavailableProductErrorMessage, outOfStockProductErrorMessage } = props.resources;\n\n const shipMultipleAddressLines: IShipMultipleAddressesLineViewModel[] = [];\n\n for (const line of shippingLines) {\n shipMultipleAddressLines.push({\n isChecked: false,\n cartLine: line.cartLine\n });\n }\n\n function _renderProductListHeader(): React.ReactNode {\n const headers: IShipMultipleAddressesTableHeadingProps = {\n selectAllRowsText: resources.addressSelectAllRowsText,\n productNumber: resources.addressProductNumberText!,\n productName: resources.addressProductText!,\n productUnitPrice: resources.addressProductUnitPriceText!,\n productQuantity: resources.addressProductQuantityText!,\n productAddress: resources.addressProductAddressText,\n clickHandler: (isChecked: boolean) => {\n onSelectAll(isChecked);\n },\n isAllSelected: selectedShippingLines && selectedShippingLines.every(line => line.isChecked),\n isMobile: isMobile,\n clearSelectionButton: (\n !line.isChecked)\n }}\n />\n )\n };\n\n return ;\n }\n\n function _renderShipMultipleAddressLines(): IShipMultipleAddressesLineViewProps[] {\n return shippingLines.map((line, index) => {\n const currentLineProps: IShipMultipleAddressesLineProps = {\n shipMultipleAddressesLine: {\n isChecked: (selectedShippingLines && selectedShippingLines[index] && selectedShippingLines[index].isChecked) || false,\n cartLine: line.cartLine\n },\n shippingLineImage: shippingLineImages[index],\n product: line.product ? line.product : undefined,\n price: line.product?.Price,\n context,\n quantity: line.cartLine?.Quantity!,\n moduleId: moduleId,\n moduleTypeName: moduleTypeName,\n currencyCode: currencyCode,\n customerAddresses: customerAddresses,\n isMobile: isMobile,\n onSelect: onSelect,\n onShippingAddressChange: onShippingAddressChange,\n resources: {\n unavailableProductErrorMessage,\n outOfStockProductErrorMessage\n }\n };\n\n return ShipMultipleAddressesLineView({ ...currentLineProps })!;\n });\n }\n\n return {\n ShipMultipleAddress: { className: 'msc-address-select' },\n shipSingleAddressButton: (\n \n ),\n clearSelectionButton: (\n !line.isChecked)\n }}\n />\n ),\n addressDropdown: (\n onBulkShippingAddressChange(e)}\n defaultValue={''}\n disabled={selectedShippingLines.every(line => !line.isChecked)}\n >\n \n {customerAddresses?.map((address: Address, index: number) => (\n \n ))}\n \n ),\n ProductsTable: {\n className: `ms-address-select__table`,\n tag: 'table',\n role: 'grid'\n },\n ProductsTableRow: {\n className: `ms-address-select-table-line`,\n tag: 'tr'\n },\n ProductsTableHeading: _renderProductListHeader(),\n shipMultipleAddressLines: _renderShipMultipleAddressLines(),\n isShowSaveButton: !hasExternalSubmitGroup,\n saveButton: (\n \n ),\n isShowCancelButton: !hasExternalSubmitGroup,\n cancelButton: (\n \n ),\n isMobile: isMobile\n };\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as React from 'react';\n\nexport interface IShipMultipleAddressesTableHeadingProps {\n selectAllRowsText?: string;\n productNumber: string;\n productName: string;\n productUnitPrice: string;\n productQuantity: string;\n clickHandler(isChecked: boolean): void;\n productImage?: string;\n productAddress?: string;\n isAllSelected: boolean;\n isMobile: boolean;\n clearSelectionButton: React.ReactNode;\n}\n\nexport interface IShipMultipleAddressesTableHeadingState {\n isChecked: boolean;\n}\n\nexport interface IShipMultipleAddressesTableShortHeading {\n productNumber: string;\n productActions: string;\n}\n\n/**\n * Ship multiple addresses table heading.\n */\nexport class ShipMultipleAddressesTableHeading extends React.PureComponent {\n public state: IShipMultipleAddressesTableHeadingState = {\n isChecked: false\n };\n\n private readonly componentClassName: string = 'ms-table';\n\n public getOnChange = () => (event: React.ChangeEvent) => {\n this.setState(\n {\n isChecked: !this.state.isChecked\n },\n () => {\n this.props.clickHandler(this.state.isChecked);\n }\n );\n };\n\n public render(): JSX.Element {\n if (!this.props.isMobile) {\n return (\n \n \n \n \n \n {this.props.productNumber}\n {{this.props.productName}}\n {\n \n {this.props.productUnitPrice}\n \n }\n {\n \n {this.props.productQuantity}\n \n }\n {{this.props.productAddress}}\n \n \n );\n } else {\n return (\n \n \n \n \n\n {/* Clear Selection Button */}\n
\n {this.props.clearSelectionButton}\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 React from 'react';\nimport { PriceComponent } from '@msdyn365-commerce/components';\nimport { Address, CartLine, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { ICoreContext, IImageSettings, Image } from '@msdyn365-commerce/core';\nimport { IShipMultipleAddressesLineViewModel } from '../../modules/checkout-shipping-address';\nimport { ICheckoutShippingCartLineInfo } from '../../modules/checkout-shipping-address/components';\n\nexport interface IShipMultipleAddressesLineProps extends CartLine {\n shipMultipleAddressesLine: IShipMultipleAddressesLineViewModel;\n shippingLineImage: ICheckoutShippingCartLineInfo;\n price?: number;\n context: ICoreContext;\n product?: SimpleProduct;\n imageSettings?: IImageSettings;\n quantity: number;\n moduleId: string;\n moduleTypeName: string;\n currencyCode: string | undefined;\n customerAddresses: Address[];\n error?: string;\n isMobile: boolean;\n onSelect(line: IShipMultipleAddressesLineViewModel, isChecked: boolean): void;\n onShippingAddressChange(shippingLine: CartLine, event: React.ChangeEvent): void;\n resources: {\n unavailableProductErrorMessage?: string;\n outOfStockProductErrorMessage?: string;\n };\n}\n\nexport interface IShipMultipleAddressesLineViewProps {\n key?: string;\n productImage?: React.ReactNode;\n productPrice?: React.ReactNode;\n productCurrencyCode?: React.ReactNode;\n productName?: string;\n productNumber?: React.ReactNode;\n productInfo?: React.ReactNode;\n productLabel?: React.ReactNode;\n productUnitOfMeasure?: React.ReactNode;\n productQuantity?: number;\n productListId?: string;\n productAddress?: React.ReactNode;\n selectLine?: React.ReactNode;\n popUp?: JSX.Element;\n productAddressPopup?: JSX.Element | null | undefined;\n isMobile?: boolean;\n}\n\n/**\n * On Select line function.\n * @param shipMultipleAddressesLine - Ship multiple addresses line.\n * @param input - Ship multiple addresses line props.\n * @returns Set on select shipping line.\n */\nconst onSelectLineHandler = (shipMultipleAddressesLine: IShipMultipleAddressesLineViewModel, input: IShipMultipleAddressesLineProps) => (\n event: React.ChangeEvent\n) => {\n shipMultipleAddressesLine.isChecked = !shipMultipleAddressesLine.isChecked;\n\n input.onSelect(shipMultipleAddressesLine, event.target.checked);\n};\n\nexport const ShipMultipleAddressesLineView = (input: IShipMultipleAddressesLineProps): IShipMultipleAddressesLineViewProps | null => {\n const { customerAddresses, shipMultipleAddressesLine, shippingLineImage, product, context, onShippingAddressChange } = input;\n\n console.log('ShipMultipleAddressesLineView rendering');\n\n if (!product) {\n return null;\n }\n\n const { ItemId } = product;\n const { Quantity, ShippingAddress } = shipMultipleAddressesLine.cartLine;\n\n return {\n selectLine: (\n \n ),\n productImage: renderProductImage(\n '',\n context,\n product.Name!,\n shippingLineImage.imageProps.fallBackSrc,\n shippingLineImage.imageProps.src\n ),\n productInfo: renderProductInfo(input),\n productPrice: renderProductPrice(input),\n productNumber: product && (\n <>\n
{ItemId}
\n {input.error !== 'NONE' ?
{renderProductError(input)}
: undefined}\n \n ),\n productQuantity: Quantity,\n productAddress: (\n onShippingAddressChange(shipMultipleAddressesLine.cartLine, e)}\n value={ShippingAddress?.RecordId}\n >\n {customerAddresses?.map((address: Address, index: number) => (\n \n {address.FullAddress}\n \n ))}\n \n )\n };\n};\n\nconst renderProductImage = (\n className: string,\n context: ICoreContext,\n heading: string,\n image?: string,\n fallbackImage?: string\n): JSX.Element | null => {\n const defaultImageSettings: IImageSettings = {\n viewports: {\n xs: { q: 'w=64&h=64&m=6', w: 0, h: 0 },\n lg: { q: 'w=64&h=64&m=6', w: 0, h: 0 },\n xl: { q: 'w=64&h=64&m=6', w: 0, h: 0 }\n },\n lazyload: true\n };\n\n return (\n \n );\n};\n\nconst renderProductDimensions = (props: IShipMultipleAddressesLineProps): (string | undefined)[] => {\n const { product } = props;\n if (!product || !product.Dimensions) {\n return [];\n }\n return product.Dimensions.map(dimension => {\n if (!dimension.DimensionValue || !dimension.DimensionValue.Value) {\n return undefined;\n }\n return dimension.DimensionValue.Value;\n });\n};\n\nconst renderProductInfo = (props: IShipMultipleAddressesLineProps): React.ReactNode | undefined => {\n const { product } = props;\n const name = product?.Name;\n const dimensions = renderProductDimensions(props);\n if (!product) {\n return [];\n }\n const productName =
{name}
;\n const dimensionsLine: string = dimensions.join(', ');\n return (\n
\n
{productName}
\n
{dimensionsLine}
\n
\n );\n};\n\nconst renderProductPrice = (props: IShipMultipleAddressesLineProps): React.ReactNode | undefined => {\n const { product } = props;\n\n if (!product?.Price) {\n return null;\n }\n\n return (\n \n \n \n );\n};\n\nconst renderProductError = (props: IShipMultipleAddressesLineProps) => {\n const { error, resources } = props;\n\n if (!error) {\n return '';\n }\n\n const errorMessages = {\n OOS: resources.outOfStockProductErrorMessage,\n UNASSORTED: resources.unavailableProductErrorMessage,\n NONE: ''\n };\n\n return errorMessages[error];\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 { SalesOrder } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { CartCheckout } from '../../../common/checkout';\n\nexport const OPERATIONS = {\n PayCard: 201,\n PayGiftCertificate: 214,\n PayLoyalty: 207,\n PayCustomerAccount: 202\n};\n\nexport default async (\n ctx: IActionContext,\n updatedCartVersion?: number,\n isPaymentVerificationRedirection?: boolean\n): Promise => {\n return CartCheckout(ctx, updatedCartVersion, isPaymentVerificationRedirection);\n};\n"],"names":["CheckoutBillingAddress","React","constructor","props","super","countryRegionId","countryRegions","addressPurposes","defaultAddressType","checkoutErrorRef","_onSuggestionSelected","async","this","_clearAddressFields","address","addressFormat","getTranformedAddress","result","stateProvinceInfo","set","addUpdateAddress","Street","ZipCode","CountyName","City","State","DistrictName","FullAddress","setTimeout","getAddressFormat","ThreeLetterISORegionName","forEach","format","_this$autoSuggest","undefined","name","autoSuggest","excludedAddressFields","includes","_clearValidation","validationError","onAddressAddUpdate","value","validateAddressFormat","_dataInitialize","data","reaction","_data$countryRegions$","_data$addressPurposes","countryStates","_data$countryStates$r","_renderAddOrUpdateAddress","_this$addUpdateAddres","AddressAddUpdate","resources","addressType","AddressType","Billing","defaultCountryRegionId","selectedAddress","addressActionResponse","dropdownDisplayData","getPrefilledAddressDropdownData","addressStateDefaultSelectionText","telemetryContent","onInputChange","_onAddressAddUpdateInputChange","onDropdownChange","_onAddressAddUpdateDropdownChange","hasExternalSubmitGroup","moduleState","onSave","_onSubmitAddress","onCancel","_resetView","_onCountryChange","_this$autoSuggest2","twoLetterIsoRegionName","getTwoLetterISORegionName","TwoLetterISORegionName","changeAutoSuggestionCountryCode","_getAddressFormatExcludeList","config","addressFormatExcludeList","showAddressType","push","AddressItemType","AddressTypeValue","IsPrimary","_attachMapAutoSuggest","storeSelectorStateManager","_this$autoSuggest3","isMapApiLoaded","attachAutoSuggest","event","target","replace","RegExp","_getStateProvinces","currentOperation","AddressOperation","Add","Update","addressCommon","getStateProvinces","then","some","state","StateId","_initModuleState","_this$props$data$chec","init","status","isBillingAddressRequried","onEdit","onSubmit","billingAddress","isBillingAddressSameAsShippingAddress","checkout","isBillingAddressSameAsShipping","_updateCurrentOperation","Show","_updateModuleState","isCartContainsItemsForShipping","shippingAddress","_onBillingAddressSameAsShippingChange","currentTarget","checked","_this$props$data$chec2","_this$props$data$chec3","setHasError","shouldEnableSinglePaymentAuthorizationCheckout","isPaymentSectionContainerHasError","updateIsBillingAddressHasError","newIsBillingAddressHasError","_setBillingAddress","telemetry","information","error","onUpdating","newBillingAddress","_objectSpread","updateBillingAddress","additionalProperties","operation","onReady","_setErrorMessage","errorMessage","setState","context","List","AddressCommon","AddressFormat","AddressMetaData","getTelemetryObject","request","telemetryPageName","friendlyName","isShowAddress","isShowAddOrUpdateAddress","isShowSameAsShippingCheckbox","_this$props$data$chec5","actionContext","requestContext","channel","autoSuggestionEnabled","autoSuggestOptions","_setDefaultCountryRegionId","isUpdating","_this$props$data$chec4","isDisabled","removeBillingAddress","onDisable","BingMapsApiKey","BingMapsEnabled","options","AutoSuggest","ChannelCountryRegionISOCode","DefaultLanguageId","_loadMapAPI","_this$props$data$stor","loadMapApi","_this$autoSuggest4","_this$props$data$stor2","shouldEnableCheckoutErrorDisplayMessaging","_this$props$data$chec6","checkoutError","errorLocation","ErrorLocation","_this$props$data$chec7","checkoutErrorFocus","CheckoutModule","focusOnCheckoutError","_this$props$data$stor3","_this$autoSuggest5","disposeAutoSuggest","shouldComponentUpdate","nextProps","nextState","render","_shouldHideBillingAddressForOBO","hasError","renderView","className","viewState","moduleProps","classnames","heading","AddressBillingHeading","Object","assign","text","addressBillingAddressHeading","alert","ErrorComponent","title","errorMessageTitle","message","sameAsShippingCheckbox","AddressBillingCheckbox","isChecked","type","ariaLabel","addressSameAsShippingAddressAriaLabel","addressSameAsShippingAddressText","onChange","showAddress","_renderShowAddress","showAddOrUpdateAddress","_this$selectedAddress","AddressShow","_request$channel","market","getDefaultCountryRegionId","_featureState$result","_request$channel2","_request$channel3","_this$props$data$chec8","channelDeliveryOptionConfig","featureState","retailMultiplePickUpOptionEnabled","find","feature","Name","IsEnabled","pickupDeliveryModeCode","PickupDeliveryModeCode","emailDeliveryModeCode","EmailDeliveryModeCode","checkoutCart","hasInvoiceLine","cart","CartLines","cartLine","_channelDeliveryOptio","DeliveryMode","PickupDeliveryModeCodes","deliveryMode","_this$props$data$chec9","_this$props$data$chec10","getLoyaltyAmount","checkoutState","loyaltyAmount","getGiftCardTotalAmount","giftCardExtends","reduce","count","giftCard","Balance","getCustomerAccountAmount","_checkoutState$custom","customerAccountAmount","shouldPaidByCard","checkoutResult","length","paymentTenderType","tokenizedPaymentCard","isPaidByOtherPaymentSource","paymenTenderType","TotalAmount","_this$props$data$chec11","_this$props$data$chec12","isPaymentVerificationRedirection","isCheckoutCallFailed","Msdyn365","EnabledPaymentsForOBO","PaymentInstrument","__decorate","observable","action","computed","withModuleState","observer","CheckoutPickupCartLines","_ref","moduleClassName","cartLines","itemTitle","isMultipleAddressShippingEnabled","isMobileCheck","isMobile","variant","VariantType","Browser","gridSettings","xs","w","sm","md","lg","xl","isMobileView","ArrayExtensions","hasElements","headingAfterMultiSelectAddressSelect","map","isShowQty","quantity","key","lineId","Image","imageProps","role","productQuantityInfo","altText","id","defaultImageSettings","viewports","q","h","lazyload","quality","CheckoutShippingAddress","_data$featureState$re2","customerAddresses","addressListSelectedAddress","multiplePickupStoreSwitchName","onSelect","line","selectedShippingLines","updated","shippingLine","_shippingLine$cartLin","LineId","console","onShippingAddressChange","addressRecordId","RecordId","toString","shippingGroups","updatedCartLine","ShippingAddress","updateIndividualAddresses","prevState","onBulkShippingAddressChange","index","cartline","_shippingLine$cartLin2","_initPickupGroup","pickupCartLines","_getCartLinesforDelivery","products","_getProductsByCartLines","ChannelId","product","x","ProductId","shippingGroupsBuffer","initialShippingLineSelection","addressFormatItem","formatAddress","_data$address$result","_data$featureState$re","filter","_isDelivery","_isNotPickupMode","FulfillmentStoreId","_this$props$context$r","pickupDeliveryMode","pickupMode","channelId","productInputs","ObjectExtensions","isNullOrUndefined","ProductInput","apiSettings","CatalogId","getSimpleProducts","_renderShipMultipleAddresses","onSaveHandler","onCancelHandler","imageSettings","cartlineImages","_line$cartLine$LineId","_line$product","_line$product$Primary","_line$product2","_line$product3","_context$request$app","_line$cartLine$Quanti","src","PrimaryImageUrl","fallBackSrc","getFallbackImageUrl","ItemId","app","OmniChannelMedia","loadFailureBehavior","Quantity","AddressShipMultiple","isAuthenticatedFlow","onCancelButtonHandler","bind","onSelectAll","onClear","onShipSingleAddress","resetSelectedShippingLines","shippingLines","shippingLineImages","currencyCode","moduleId","moduleTypeName","typeName","Shipping","_renderSelectAddress","onShipMultipleAddressesHandler","onAddAddressHandler","AddressSelect","addresses","onAddressOptionChange","_onAddressOptionChange","onShipMultipleAddresses","_goToShipMultipleAddresses","onAddAddress","_goToAddAddress","_onSelectAddress","multipleAddressShippingEnabled","_onAddressAddUpdateSubmit","response","_isNewAddress","updateCustomerAddress","addCustomerAddress","Promise","resolve","_clearError","_onAddOrUpdateSuccess","_getDefaultAddress","_getAddressFromCartExpressPaymentDetails","expressPaymentDetailsFromCartPage","isExpressAddressAppliedInCartPage","addressFromCartExpress","getExpressAddress","getAddressFromTokenizedPaymentCard","Country","threeLetterIsoRegionName","getThreeLetterIsoRegionName","NameOnCard","Address1","StreetNumber","Address2","Zip","Phone","expressAddress","countryRegion","country","_country$ISOCode","ISOCode","toLowerCase","CountryRegionId","_canShip","defaultAddress","shippingCartLines","isExpressCheckoutApplied","shippingAddressFromExpressCheckout","isEmpty","_setShippingAddress","updateHasShippingAddress","newHasShippingAddress","Multiple","_onSelectMultiAddress","_checkout$result$chec","_checkout$result$chec2","_channelDeliveryOptio2","_setCartLinesShippingAddress","newShippingAddress","updateShippingAddress","catch","newCartLinesWithShippingAddress","shippingGroup","updateCartLinesShippingAddress","updateCartLineShippingAddress","updatedCartLinesObject","_getViewport","device","Type","MsDyn365","isBrowser","window","innerWidth","onPending","existingAddress","_address$Name","_address$Street","_address$StreetNumber","_address$City","_address$State","_address$ZipCode","_address$Phone","_address$ThreeLetterI","_address$AddressTypeV","_countItems","cartlines","_viewport","_updateViewport","_address","addEventListener","componentWillUnmount","removeEventListener","_featureState$result2","headingImages","itemsText","singleItemText","_line$cartLine$LineId2","_line$product4","_line$product$Primary2","_line$product5","_line$product6","_context$request$app2","_line$cartLine$Quanti2","_line$cartLine$Shippi","_line$cartLine$Shippi2","shippingAddressId","numberOfCartLines","itemText","lineImageProps","cartLineImages","isRetailMultiplePickUpOptionEnabled","isShowAddresList","isShowShipMultipleAddress","showAddressSelectHandler","showShipMultipleAddressesHandler","showShipMultipleAddresses","showAddOrUpdateAddressHandler","showAddressSelect","_this$props$data$cart","_this$props$data$cart2","properties","ExtensionProperties","property","Key","Value","StringValue","JSON","parse","get","AddressDetail","items","Node","item","description","_ref2","AddressForm","isShowSaveButton","saveButton","isShowCancelButton","cancelButton","AddressItem","label","input","AddressError","Module","ref","SelectAddress","shipMultipleAddressesButton","addButton","SelectItem","showItems","_ref3","ShipMultipleAddress","shipSingleAddressButton","clearSelectionButton","addressDropdown","ProductsTable","ProductsTableHeading","ProductsTableRow","shipMultipleAddressLines","_renderShipMultipleAddressLine","_ref4","shipMultipleAddressesLine","selectLine","productImage","productNumber","productInfo","productPrice","productQuantity","productAddress","style","position","top","verticalAlign","colSpan","width","display","marginTop","textAlign","getDefaultColorSwatchSelected","productData","_colorAttribute$swatc","_colorAttribute$swatc2","_colorAttribute$swatc3","attributeValues","colorAttribute","attributeValue","_attributeValue$keyNa","keyName","toLocaleLowerCase","DimensionTypes","color","defaultSwatch","swatches","isDefault","updateProductUrl","productDetailsPageUrl","coreContext","queryString","sourceUrl","URL","baseUrl","search","href","pathname","renderProductUnitOfMeasure","unitOfMeasure","renderLabel","price","rating","ratingAriaLabelText","reviewCount","ratingCountAriaLabelText","reviewCountArialableText","getReviewAriaLabel","getRatingAriaLabel","ratingAriaLabel","roundedRating","toFixed","renderPrice","basePrice","adjustedPrice","savingsText","freePriceText","originalPriceText","currentPriceText","isPriceMinMaxEnabled","priceResources","BasePrice","AdjustedPrice","CustomerContextualPrice","PriceComponent","renderProductPlacementImage","imageUrl","fallbackImageUrl","_context$app$config","contextConfig","placeholderImageName","fallbackImageSource","img","cropFocalRegion","bypassHideOnFailure","ProductComponentV2","msdyn365Commerce","createComponentOverride","component","_product$name","_product$recordId","_getProductImageUrlFr","_getProductPageUrlFro","ratingCountAriaLabel","allowBack","quickViewButton","productComparisonButton","isEnabledProductDescription","inventoryLabel","dimensionAvailabilities","swatchItemAriaLabel","productUrl","getProductPageUrlSync","recordId","Number","MIN_VALUE","productImageUrlFromSwatch","dimensionToPreSelectInProductCard","none","primaryImageUrl","productImageUrls","generateImageUrl","getProductImageUrlFromDefaultColorSwatch","productPageUrlFromSwatch","swatchValue","getProductPageUrlFromDefaultSwatch","productPageUrl","setProductPageUrl","useState","productImageUrl","setProductImageUrl","selectedSwatchItems","Dictionary","enableStockCheck","updatePageAndImageUrl","swatchItem","dimensionType","setValue","StringExtensions","isNullOrWhitespace","productPageUrlWithSwatch","newUrl","searchParams","delete","swatchProductImageUrl","newImageUrl","payLoad","getPayloadObject","attribute","getTelemetryAttributes","isUnitOfMeasureEnabled","unitOfMeasureDisplayType","onClick","onTelemetryClick","cultureFormatter","formatCurrency","averageRating","totalRatings","defaultUnitOfMeasure","_item$keyName$toLocal","_item$keyName","_item$swatches$map","_item$swatches","dimensionTypeValue","dimensionsToDisplayOnProductCard","dimensionsInProductCard","shouldDisplayDimension","_item$recordId","_swatchItem$swatchVal","_swatchItem$swatchVal2","_dimensionAvailabilit","itemId","colorHexCode","swatchColorHexCode","swatchImageUrl","dimensionAvailability","_swatchItem$swatchVal3","swatch","ProductComponentV2SwatchComponent","onSelectDimension","hideRating","avgRating","numberRatings","RatingComponent","ratingCount","readOnly","renderRating","inventoryAvailabilityLabel","quickview","selectedDimensions","getValues","convertDimensionTypeToProductDimensionType","dimensionValue","selectedProductId","renderQuickView","catalogId","validateCatalogId","renderProductComparisonButton","getCatalogId","Checkout","_this","isValidationPassed","isPlaceOrderLoading","isPlaceOrderClicked","handleCheckoutHeadingChange","checkoutHeading","isLoading","cartStatus","isEmptyCart","getSlotItems","slots","triggerPaymentWithPlaceOrder","updateShouldTriggerPaymentWithPlaceOrder","newShouldTriggerPaymentWithPlaceOrder","shouldTriggerPaymentWithPlaceOrder","onPlaceOrder","checkoutOutOfStockErrorMessage","orderConfirmation","isOverMaxQuantity","_checkout$result","hasOrderConfirmation","updatedCartVersion","updateCartLineEmailAddress","guestCheckoutEmail","placeOrder","handleCheckoutError","updateIsPaymentSectionContainerReady","newIsPaymentSectionContainerReady","electronicDeliveryInvoiceAddress","hasShippingAddress","useShippingAddressAsElectronicDeliveryInvoiceAddress","emailDeliveryCartLines","lineDeliverySpecifications","DeliverySpecification","DeliveryModeId","DeliveryPreferenceTypeValue","DeliveryPreferenceType","ElectronicDelivery","ElectronicDeliveryEmailAddress","newGuestCheckoutEmail","DeliveryAddress","updateLineDeliverySpecificationsAsync","callerContext","Id","updatedCart","Version","exception","Error","_this$props$context$r2","getAvailabilitiesForCartLineItems","ProductAvailabilitiesForCartLineItems","productInventoryInformation","_cart$CartLines","_cart$CartLines2","productsThatShouldValidateInventory","_cartlineProduct$Beha","cartlineProduct","isStockedItem","Behavior","IsStockedProduct","isEmailDelivery","foundProductAvailability","productInventory","_productInventory$Pro","ProductAvailableQuantity","cartLinesInventoryValidation","validateCartLinesInventory","isValid","getActiveChildModuleStates","childIds","getModule","hasModuleState","onContainerReady","isReady","redirectToCartPage","notFoundEditCartLinkMessage","editCartLink","location","genericErrorMessage","validateForCheckout","retry","arguments","_shouldValidateQuantityLimits","validateForCheckoutAsync","bypassCache","_result$ValidationFai","ValidationFailuresByCartLines","warning","debug","cartState","refreshCart","refreshError","_featureStatuses$find","_featureStatuses$find2","_featureStatuses$find3","featureStatuses","_this$props$context","defaultOrderQuantityLimitsFeatureConfig","platform","enableDefaultOrderQuantityLimits","customerInfo","customerInformation","isB2BSite","isChannelTypeB2B","isOrderQuantityLimitsFeatureEnabledInSiteSettings","_cartConfiguration$Ig","cartConfiguration","IgnoreOrderSettings","_saveShippingAndBillingAddress","_getAddressFromTokenizedPaymentCard","updateBillingAddressFromExpressCheckout","newBillingAddressFromExpressCheckout","updateShippingAddressFromExpressCheckout","newShippingAddressFromExpressCheckout","invalidCartVersionErrorMessage","missingRequiredCartTenderLinesErrorMessage","checkoutApiFailureErrorMessage","invoiceCheckoutApiFailureErrorMessage","apiError","statusCode","errorCode","setCheckoutErrors","_error$data","AdditionalContext","isEditorialMode","_this$props$data$chec13","params","isEditor","canPlaceOrder","_this$props$data$chec14","_this$props$data$chec15","_this$props$data$chec16","_this$props$data$chec17","_this$props$data$chec18","isTermsAndConditionAccepted","disableForOBO","isPaidOffByCustomerAccount","_this$props$data$chec19","_this$props$data$chec20","_this$props$data$chec21","_this$props$data$chec22","amountDue","isCartReady","_this$props$data$chec23","_this$props$data$chec24","_this$props$data$chec25","componentDidMount","when","asyncResultStatus","AsyncResultStatusCode","LOADING","_this$props$data$chec26","_this$props$data$chec29","email","tenderLine","paymentTenderTypeFromCartPage","isExpressCheckoutAppliedInCartPage","cardPaymentAcceptResult","_this$props$data$chec27","_this$props$data$chec28","updateExpressCheckoutDetails","newEmailAddressFromExpressCheckout","newTenderLine","newTokenizedPaymentCard","newPaymentTenderType","newIsExpressCheckoutApplied","newIsExpressAddressApplied","newCardPaymentAcceptResult","updateExtensionProperties","newExtensionProperties","_this$props$data$chec30","isPaymentSectionContainerReady","_this$props$data$chec31","_this$props$data$chec32","_this$props$data$chec33","_this$props$data$chec34","redirectAdditionalContext","isPaymentVerificationRequired","_this$props$data$chec35","_this$props$data$chec36","_this$props$data$chec37","isBillingAddressHasError","_this$props$data$chec38","_this$props$data$chec39","_this$props$data$chec40","_this$props$data$chec41","updateIsPlaceOrderEnabledInRedirection","newIsPlaceOrderEnabledInRedirection","_this$props$data$chec42","_this$props$data$chec43","checkoutErrorLocation","checkoutPaymentErrorLocation","ErrorCode","Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePayment","CheckoutPaymentInstrument","componentDidUpdate","_this$props$data$chec44","_this$props$data$chec45","shouldFocusOnCheckoutError","_this$props$data$chec46","_this$props$data$chec47","_this$props$data$chec48","_this$props$data$chec49","_this$props$data$chec50","_this$props$data$chec51","_this$props$data$chec52","_this$props$data$chec53","_this$props$data$chec54","_this$props$data$chec55","_this$props$data$chec56","_this$props$data$chec57","_this$props$data$chec58","_this$props$data$chec59","_document","_this$props$data$chec60","disableGuidedCheckoutFlow","user","isAuthenticated","backToShopping","placeOrderText","confirmPaymentText","cookieConsentRequiredMessage","checkoutClass","allCheckoutInformation","checkoutInformation","info","checkoutExpressPaymentContainer","isConsentGiven","cookies","backToShoppingUrl","termsAndConditions","TelemetryConstant","BackToShopping","backToShoppingAttributes","checkoutBtnText","hasCartDeliveryMode","hasGuestCheckoutEmail","hasExpressPaymentContainer","document","getElementsByClassName","viewProps","hasSalesOrder","salesOrder","checkoutProps","headerProps","bodyProps","mainProps","mainControlProps","sideProps","sideControlFirstProps","sideControlSecondProps","termsAndConditionsProps","renderMsdyn365Text","AlertComponent","loading","Waiting","_this$props$data$chec61","_this$props$data$chec62","canShow","guidedForm","GuidedFormComponent","resource","orderSummary","getOrderSummary","invoicePaymentSummary","getInvoicePaymentSummary","lineItems","getLineItems","placeOrderButton","PlaceOrderButtonComponent","keepShoppingButton","Button","disabled","checkoutGuidedFormHasError","values","every","SUCCESS","FAILED","tag","editProps","descClassName","isNullOrEmpty","ariaSetSize","ariaPosInSet","DeliveryOptions","attributes","contentAction","etext","AddressDetailItemFunctionComponent","labelText","fallbackPattern","onChangeMinValue","checkBoxLabel","disclaimerText","groupDeliveryOption","selectedDate","setSelectedDate","isDateEnabled","setIsDateEnabled","minDate","setMinDate","today","Date","toISOString","split","handleCheckboxChange","selectedValue","log","_groupDeliveryOption$","cartLinesDate","cartLineIds","cartLineId","tempCartLine","_cartLine$LineId","min","pattern","groupName","deliveryOptionRef","deliveryOptions","priceFree","selectedItemId","channelConfig","cartLinesRadio","changeCurrentDeliveryOption","deliveryClassName","optionClassName","deliveryOption","RadioButtonComponent","Code","Description","DescriptionComponent","Currency","GetLineItems","lineClassName","lineItemClassName","changeText","changeButtonText","showDeliveryOption","setShowDeliveryOption","handleClick","deliveryCode","option","payload","TelemetryEvent","UpdateInCart","_getProduct","productId","_product","_getLineItemComponent","showShippingChargesForLineItems","catalogs","getProductUrlSync","_cartLine$CatalogId","fullUrl","CartLineItemComponent","sizeString","productDimensionTypeSize","colorString","productDimensionTypeColor","styleString","productDimensionTypeStyle","amountString","productDimensionTypeAmount","quantityDisplayString","quantityDisplayStringLabel","configString","inputQuantityAriaLabel","discountStringText","shippingChargesText","salesAgreementPricePrompt","isQuantityEditable","priceCurrency","deliveryMethodLabel","CheckoutCartLineDeliveryOptionsRadio","CheckoutShippingCartLines","deliveryMethodDesc","requestDeliveryDate","CheckoutDeliveryOptions","groupDeliveryOptions","cartLineSelectedDeliveryOptions","cartLinesDeliveryOptions","isSelectDefaultOptionEnabled","useDefaultDeliveryOption","canShip","cartDeliveryMode","getSavedDeliveryOption","getCartLinesSavedDeliveryOption","loadDeliveryOptions","getCartLinesForShipping","isDeliveryModeExists","getDeliveryOptionSelected","selectedItem","DeliveryOption","getErrorMessage","CheckoutDeliveryOptionsError","ErrorTitleComponent","ErrorMessageComponent","getDeliveryOptionList","getAriaLabelWithPrice","code","radioButton","onDeliveryOptionChange","getSaveButton","saveBtnLabel","getEditButton","editBtnLabel","getCancelButton","cancelBtnLabel","setError","clearError","updateShouldCollapsePaymentSection","newShouldCollapsePaymentSection","updateCartLinesDeliverySpecification","updateCartDeliverySpecification","savedDeliveryOption","cartLinesForShipping","existingCartLineSelectedDeliveryOption","cartLineDeliveryOption","selectedDeliveryOption","deliveryModeId","trim","updateCartDeliverySpecificationInput","_response$errorDetail","errorDetails","LocalizedMessage","setIsCancellable","lineSpecs","checkoutCartLines","group","_checkoutCartLines$fi","lineSpec","ShipToAddress","cartLineSelectedDeliveryOption","RequestedDeliveryDate","updateCartLines","_unused","_this$channelDelivery","getDeliveryOptions","cartId","originalDeliveryMode","hasShippingDeliveryLines","clearCartLinesDeliveryInformation","channelDeliveryOptionConfiguration","deliveryOptionFilter","filterDeliveryModeOption","FilterDeliveryModeOption","None","FilterOutNonCarrierDeliveryMode","getDeliveryOptionsAsync","queryResultSettings","QueryResultSettingsProxy","getPagingFromInputDataOrDefaultValue","_unused2","deliveryOptionsNotFound","updateHasCartDeliveryMode","newHasCartDeliveryMode","getStoredDeliveryOptions","cartLinesWithShippingAddress","features","shouldSubmit","isExpressPaymentAppliedInCartPage","enable_checkout_race_condition_hot_fix","loadDeliveryOptionsBasedOnAddress","getGroupDeliveryOptions","onCartLineDeliveryOptionChange","onCartLineRequestDeliveryDateChange","deliveryDate","getCheckoutCartLineGroupDeliveryOptions","getImageSettings","requestDeliveryDateEnabled","enableRequestDeliveryDate","cartLine1","_cartLine$LineId2","_cartLine$LineId3","_this$cartLineSelecte","_cartLine1$ShippingAd","_cartLine1$ShippingAd2","isNewLine","isShowLabel","cartLineGroupShippingAddressLabel","cartLineGroupDeliveryOptionsLabel","cartLineGroupDeliveryOptionsText","CheckoutCartLineDeliveryDate","cartLineGroupDeliveryRequestDeliveryDateText","cartLineGroupDeliveryRequestDeliveryDateDisclaimerText","cartLineGroupDeliveryRequestDeliveryDate","_this$cartLineSelecte2","_this$props$data$prod","_this$props$data$cata","_cartLine$LineId4","selectedDeliveryOption1","shippingChargesString","getGroupByDelivery","groupBy","_item$ShippingAddress","inputData","GetDeliveryOptionsForCartLineAddressInput","getDeliveryOptionsForCartLineAddress","_group$cartLineIds","_unused3","getMultipleDeliveryOptionSelected","_this$props$data$prod2","_product$PrimaryImage","_this$props$config$im","_this$deliveryOptions","deliveryModeDesc","_group$cartLineIds2","cartLineDisplay","timeoutRetailCall","timeoutToCallRetail","isDataReady","_this$expressPaymentD","_this$expressPaymentD2","_this$props$data$chan","_this$props$data$feat","isError","isShowList","isShowSelected","deliveryOptionAriaLabel","deliveryOptionsData","errorMessageData","isShowEditButton","classname","DeliveryOptionsList","list","deliveryOptionSelected","waiting","checkoutCartLineGroupDeliveryOptions","enableCheckoutCartLineDeliveryOptions","editButton","onApplyHandler","onApplyGiftCard","preventDefault","onChangeNumberHandler","onEnterGiftCardNumber","onChangePinHandler","onEnterGiftCardPin","onChangeExpHandler","onEnterGiftCardExp","getForm","inputRef","inputPinRef","inputExpRef","giftCardNumber","giftCardPin","giftCardExp","supportExternalGiftCard","additionalFields","disableAddGiftCard","applyGiftCardButton","giftCardFormLabel","giftCardNumberLabel","giftCardPinLabel","giftCardExpLabel","giftCardAlertLabel","giftCardPinPlaceholderText","giftCardExpPlaceholderText","formProps","inputPinLabel","inputExpLabel","alertFieldLabel","Alert","assertive","fade","includeAlertClass","isOpen","inputNumber","inputPin","placeholder","inputExp","applyButton","showGiftCardPinInput","showGiftCardExpInput","inputProps","inputNumProps","inputPinProps","inputExpProps","onRemoveHandler","onRemoveGiftCard","_giftCard$Id","getItem","getFormattedPrice","canRemove","enteredGiftCardLabel","giftCardAvailableBalanceLabel","removeGiftCardButton","balance","CardCurrencyCode","giftCardLast4Digit","substr","selectedGiftCard","removeButton","itemProps","getList","giftCards","listProps","SupportedGiftCardType","CheckoutGiftCard","isFetchingGiftCard","isRequired","isEnabled","onSkip","couldPaidByGiftCard","giftCardSupported","External","shouldBeEnabledForGuest","handleCancelOrSubmit","hasSelectedItem","enterGiftCardNumber","enterGiftCardPin","enterGiftCardExp","removeGiftCard","applyGiftCard","giftCardTypes","getGiftCardTypes","giftCardType","isPinRequired","IsPinRequired","isExpRequired","IsExpirationDateRequired","tenderTypeId","PaymentMethodId","getGiftCard","addGiftCard","Pin","ExpirationDate","TenderTypeId","current","focus","findGiftcardTenderTypes","tenderTypes","operationId","giftcardType","matchedTenderTypes","Internal","tenderType","OperationId","ConnectorId","noBalanceError","invalidCardInfoError","invalidCardTypeError","noCardPinError","noCardExpError","supportedGiftCardType","getTenderTypesAsync","internalGiftcardTenderTypes","OPERATIONS","PayGiftCertificate","externalGiftcardTenderTypes","Both","month","parseInt","year","getGiftCardAsync","activeGiftCard","emptyInputError","duplicatedCodeError","invalidCodeError","card","resolveCardTypesAsync","CardType","GiftCard","shouldPayGiftCard","showAdditionalFields","isOBORequest","checkoutGiftCardProps","showGiftCard","TitleCompoent","form","PickUpAtStoreComponent","PickUpAtStore","EmailDeliveryComponent","EmailDelivery","LineItemComponent","LineItem","pickUpAtStore","emailDelivery","LineItemGroupComponent","LineItemDeliveryGroup","LineItemList","lineItem","LineItemGroupComponentWithMultiplePickUp","_ref5","lineItemWraper","lineItemWraperIcon","LineItemComponentWithMultiplePickUp","_ref6","PickUpAtStoreComponentWithMultiplePickUp","_ref7","LineItemsComponent","_ref8","LineItems","Header","editLink","itemsForPickup","itemsForShip","itemsForEmail","itemsGroupWithMulitplePickupMode","OrderSummaryComponent","_ref9","lines","subtotal","shipping","otherCharge","tax","totalDiscounts","loyalty","customerAccount","orderTotal","PaymentSummaryComponent","_ref10","invoices","max","step","ariaValueMax","ariaValueMin","ariaValueNow","onBlur","htmlFor","CheckoutLoyalty","_defaultLoyaltyPoints","loyaltyCard","CardNumber","LoyaltyCardId","updateLoyaltyCardId","loyaltyCardNumber","shouldPayLoyalty","_dialogToggleRef","_applyLoyaltyPoints","_removeLoyaltyPoints","_onInputChange","_onBlur","dollarsApplied","maxDollars","isFetchingLoyaltyCard","loyaltyTransactionEstimation","MaxCurrencyValueOfLoyaltyPoints","_updateEstimate","_updateLoyalty","Loyalty","isShowLoyalty","isShowAddLoyalty","disableAddLoyaltyComponent","checkoutLoyalty","showLoyalty","Heading","headingTag","loyaltyHeadingText","coveredAmountText","TextComponent","loyaltyCoveredAmountText","amount","addLoyalty","drawer","Drawer","toggleButtonText","_drawerHeader","openGlyph","closeGlyph","glyphPlacement","cardNumber","rewardPoints","RewardPoints","points","_renderPointSection","availablePointsLabel","expiringLoyaltyPointsLabel","loyaltyAmountContainer","appliedLoyaltyAmountContainer","loyaltyAmountLabel","LabelComponent","payWithLoyaltyAmountLabel","loyaltyAmountInput","InputComponent","loyaltyAmountApplyButton","applyCheckoutLoyaltyPaymentText","isNaN","showAppliedAmount","loyaltyAmountAppliedText","loyaltyAmountAppliedPrice","loyaltyAmountRemoveButton","removeCheckoutLoyaltyPaymentText","innerRef","point","RewardPointId","checkoutLoyaltyRewardPoint","availablePointsText","activePoints","ActivePoints","expiringPointsText","expiringPoints","PointsExpiringSoon","updateLoyaltyAmount","newAmount","parseFloat","num","element","getElementById","loyalPointsRequest","createGetMaxLoyaltyPointsToRedeemForTransactionBalanceInput","_query","callActionOrExecute","_points$MaxCurrencyVa","update","GetLoyaltyTransactionEstimationInput","newMaxPoints","balanceCheckButton","GiftCardBalanceCheck","_isEnabled","_getFormattedPrice","_enterGiftCardNumber","_enterGiftCardPin","_enterGiftCardExp","_setError","_applyGiftCard","_getGiftCardTypes","_getGiftCard","_findGiftcardTenderTypes","giftCardBalanceCheckProps","AddToCartProductListComponent","_quickOrderTemplate$q","_quickOrderTemplate$q2","quickOrderTemplate","quickOrderTemplateLines","fullProduct","ProductDetails","productListLine","buttonLabel","quickOrderGridBuySelectedButtonText","buttonAriaLabel","quickOrderGridBuySelectedButtonAriaLabel","dialogStrings","_props$resources$quic","_props$resources$quic2","_props$resources$quic3","_props$resources$quic4","_props$resources$quic5","_props$resources$quic6","_props$resources$quic7","_props$resources$free","_props$resources$orig","_props$resources$curr","_props$resources$adde","_props$resources$quic8","_props$resources$quic9","goToCartText","quickOrderGridGoToCartText","continueShoppingText","quickOrderGridDialogCloseText","closeNotificationLabel","quickOrderGridBuySelectedAddingToCartErrorNotificationCloseAriaLabel","headerItemOneText","quickOrderGridSingleItemText","headerItemFormatText","quickOrderGridMultiLineItemFormatText","headerLinesFormatText","quickOrderGridMultiLinesFormatText","headerMessageText","quickOrderGridHeaderMessageText","addedQuantityText","buyAgainNotificationTitle","quickOrderGridBuySelectedAddingToCartErrorNotificationTitle","buyAgainNotificationCloseAriaLabel","getDialogStrings","orderDetailProducts","quickOrder","orderDetails","quickLine","_quickLine$fullProduc","salesLine","OrderDetailsProduct","getOrderDetails","AddToCartComponent","addToCartText","outOfStockText","addToCartArialLabel","navigationUrl","getUrlSync","shouldSkipSiteSettings","orderDetailsProducts","onError","getQuickOrderGridAddToCartDialog","_result$cartActionRes","cartActionResult","handlers","onErrorMessage","removeActionHandler","removeProductList","productList","removeQuickOrderList","QuickOrderGridDrawer","_props$collapseProps$","_props$collapseProps","toggle","_isManuallyToggled","onToggle","previousState","collapseProps","_drawerGlyphClass","toggleGlyphClassName","isAnimateGlyph","_drawerOpenGlyph","_drawerCloseGlyph","children","drawerClass","drawerButtonClassName","toggleButtonProps","block","_generateDrawerButtonInnerMarkup","Collapse","isCollapseState","drawerButtonTextClass","toggleButtonClassName","headingDrawerClass","descriptionDrawerClass","moduleHeadingText","moduleDescriptionText","_generateGlyphMarkup","glyphClass","QuickOrderGridFormComponent","productTextInput","quantityTextInput","quickOrderGridState","maxChars","minQuantity","maxQuantity","isAddtoListDisabled","ariaLabelQuantity","ariaLabelProduct","ariaLabelAddtoCart","handleQuantityChange","handleInputChange","handleAddProductListClick","onInputChangeFunction","onQuantityInputChange","onQuantityChangeFunction","productNode","quantityNode","maxLength","addToListBtn","userMessage","stateMessage","statusCssString","messageGlyph","messageText","QuickOrderGridProduct","productLine","isSelected","QuickOrderGridDesktopHeaderCellsComponent","columnWithNumberClassName","quickOrderGridProductNumberText","quickOrderGridProductText","quickOrderGridUnitPriceText","quickOrderGridUnitOfMeasureText","quickOrderGridQuantityText","quickOrderGridActionsText","QuickOrderGridMobileHeaderCellsComponent","QuickOrderGridTableHeaderComponent","rowClassName","headerCells","QuickOrderGridTableRowProductImageComponent","_props$data$product$p","_props$context$reques","_props$imageSettings","containerClassName","setShowPreviousActions","onChangeHandler","onChangeQuantity","itemKey","newValue","onRemoveItem","quickOrderGridProductKey","QuickOrderGridExtraActionsPopupComponent","_props$data$product$p2","quickOrderGridViewDetailsButtonAriaLabel","quickOrderGridViewDetailsButtonText","shouldShowActions","setShowActions","onClickViewDetails","shouldShowActionsNewValue","actionsContainerClassName","quickOrderGridRemoveItemButtonAriaLabel","QuickOrderGridDesktopTableRowCellComponent","_props$data$product$p3","_product$Dimensions","_productListLine$Line","Dimensions","dimension","_dimension$DimensionV","DimensionValue","join","quickOrderGridProductDimensionsSeparator","renderProductPrice","UnitOfMeasure","renderUnitOfMeasure","IncrementalQuantity","currentCount","quickOrderGridInputQuantityAriaLabel","decrementButtonAriaLabel","quickOrderGridDecrementButtonAriaLabel","incrementButtonAriaLabel","quickOrderGridIncrementButtonAriaLabel","isGiftCard","IsGiftCard","callbacks","QuickOrderGridMobileTableRowCellComponent","_props$data$product$p4","_productListLine$Line2","QuickOrderGridTableRowComponent","Viewport","QuickOrderGridTableComponent","setIsMobile","quickOrderGridProducts","isOrderQuantityLimitsFeatureEnabled","updateViewport","headerClassName","quickOrderProduct","_product$ProductDetai","_quickOrderProduct$pr","_quickOrderProduct$pr2","behavior","MinimumQuantity","MaximumQuantity","Math","ProductPrice","callBacks","QuickOrderGrid","_this$props$data$feat2","_this$props$data$feat3","_this$props$data$feat4","_this$props$data$feat5","_cartConfiguration$re","_cartConfiguration$re2","_waitTime","_dimensionUpdateQueueMaxLength","_errorCssClass","_errorCssGlyphClass","_dimensionUpdateQueue","FinitePromiseQueue","_dimensions","_initializedDimensions","Set","_cssClassNameConfigure","_className","_isOrderQuantityLimitsFeatureEnabled","_isChannelLimitsFeatureEnabled","_applyDefaultOrderSettingsForCartLine","_quickOrderGridCallbacks","initializeDimension","initializedDimension","add","dimensionSelectedAsync","selectedDimensionId","selectedDimensionValueId","_this$state$productDi","size","productDimensions","enqueue","_updateDimensions","FinitePromiseQueueError","ProcessWasDiscardedFromTheQueue","getDropdownName","_getDropdownName","changeUpdatingDimension","isUpdatingDimension","_quickOrderGridRowCallbacks","_removeItemRowFromTable","productListLineId","_changeRowQuantity","_removeProductList","token","ProductListsDataActions","reload","_updateStatusState","quickOrderGridDeleteProductListFailedText","_handleInputChange","query","productResponse","_cancellabelDebounce","cancel","isQuickOrderGridFormExpanded","_debounce","getScanResult","GetScanResultInput","results","Product","ProductDimensionFull","_updateQuantitiesInState","_handleQuantityChange","_this$state$productRe","currentValue","inputElement","_quantityInput","HTMLInputElement","minimumQuantity","needToUpdateUIValue","_behavior$MinimumQuan","newCurrentValue","setAttribute","_this$state$productRe2","ProductDimensionType","Color","Configuration","productDimensionTypeConfiguration","Size","Style","hasProductDimensions","dimensionsToUpdate","productDimensionErrorState","otherError","clearOtherErrorState","dimensionKey","keys","configureErrors","errorState","mappedDimensions","_this$_updateDimensio","DimensionTypeValue","_updateDimensionValue","selectedProduct","newProduct","getSelectedVariant","SelectedVariantInput","MasterProductId","getDimensionsForSelectedVariant","GetDimensionsForSelectedVariantInput","variantProduct","productDimensionFull","newValueId","DimensionValues","_getDimensionErrorString","amountErrorMessage","quickOrderGridproductDimensionTypeAmountErrorMessage","quickOrderGridproductDimensionTypeColorErrorMessage","quickOrderGridproductDimensionTypeConfigurationErrorMessage","quickOrderGridproductDimensionTypeSizeErrorMessage","quickOrderGridproductDimensionTypeStyleErrorMessage","_validateCart","_productResponse$Dime","missingDimensions","_getConfigureErrors","quickOrderGridWrongQuantityErrorMsg","quickOrderTemplateLinesData","orderLineIndex","findIndex","newProductListLine","previousQuantity","_objectWithoutProperties","_excluded","newLine","updatedLines","updatedProductList","ProductListLines","ActiveProductListInput","ProductListId","_isChannelMultipleCatalogsFeatureEnabled","isMultipleCatalogFeatureEnabledInHq","_addItemToProductListLine","quickOrderGridAddedToGridSuccessMessage","quickOrderGridAddedToGridFailureMessage","quickOrderGridAddedToGridDuplicateError","productListId","_productResponse$Defa","_createProductList","AddItemToProductListInput","DefaultUnitOfMeasure","addItemToProductListAction","CreateProductListInput","ProductListType","QuickOrder","createProductList","_productTextInput","_telemetryContent","_quickOrderGridFormClass","_quickOrderGridFormProductContent","_quickOrderGridFormMsgContent","ValidateDefaultOrderSettingsPerLine","_this$state$min","_this$state$max","quickOrderGridModuleHeading","quickOrderGridModuleDescription","quickOrderGridAddtogrid","quickOrderGridProductQuantityInputLabel","quickOrderGridProductInputLabel","quickOrderGridProductDimensionTypeColor","quickOrderGridProductDimensionTypeConfiguration","quickOrderGridSelectDimensionFormatString","quickOrderGridProductDimensionTypeSize","quickOrderGridProductDimensionTypeStyle","quickOrderGridProductDimensionTypeAmount","quickOrderGridModulePageHeading","productConfigureResources","selectDimensionFormatString","header","quickOrderGridProps","contentProps","isB2bCustomer","IsB2b","actions","bulkPurchase","_renderBulkPurchase","quickOrderGridForm","quickOrderGridFormProductContent","quickOrderGridFormMsgContent","configure","getProductConfigure","container","_renderListContainer","orderActions","_renderQuickOrderGridActions","quickOrderGridDeleteButtonText","userMessageNode","topStateMessage","addProductListToBag","QuickOrderGridActionsView","isBulkPurchaseEnabled","bulkPurchaseSlots","containerClass","_renderQuickOrderTable","_initQuickOrderGridProducts","quickOrderGridProduct","validValues","tableClassName","_getMinQuantityForCartLineItem","_getMaxQuantityForCartLineItem","_getQuantity","_product$Behavior","_getIgnoreOrderSettings","isQuantityLimitsFeatureEnabled","_product$Behavior2","maxQuantityForCartLineItem","_cartConfiguration$re3","_cartConfiguration$re4","applyDefaultOrderSettingsForCartLine","_product$Behavior3","defaultQuantity","DefaultQuantity","dimensions","AccountManagementAddress","_renderListAddress","AddressList","primaryAddressSectionHeading","otherAddressSectionHeading","contextRequest","handleLineItemHeadingChange","onEditAddress","_goToEditAddress","onRemoveAddress","_onRemoveAddress","onUpdatePrimaryAddress","_onSubmitUpdatePrimaryAddress","_onAddressUpdate","onSuccess","twoLetterISORegionName","updateCustomerPrimaryAddress","_onUpdatePrimaryAddressSuccess","Deactivate","removeAddressData","_renderScreenReaderRemoveText","notification","formatNotification","removeAddressNotification","AccountAddressManagement","showAddressList","screenReaderNotification","shouldRenderEditAddressButton","enableEditAddress","noBillingErrorMessage","renderErrorMessage","addressTypeId","addressCount","multipleBillingErrorMessage","newAddress","BillingAddressOption","AddressInputFunctionComponent","additionalAddributes","autoFocus","shouldUseAutoFocus","additionalAttributes","_onBillingAddressOptionChange","selectedOption","selectedBillingOption","isAddNewAddress","isPrimaryAccountAddress","SameAsShipping","NewAddress","PrimaryAccount","primaryAddress","getPrimaryAddress","isShowRadioButtons","initialBillingOption","billingAddressOption","selectedBillingAddressOption","sameAsShippingRadioButton","primaryAccountAddressRadioButton","usePrimaryAccountAddressAsBillingAddressAriaLabel","usePrimaryAccountAddressAsBillingAddressText","newAddressRadioButton","addNewAddressAriaLabel","addNewAddressText","_this$props$data$addr","Item","isShowPrimaryButton","primaryButton","isShowError","AddressLists","ListAddress","isShowEmptyListMessage","emptyListMessage","primaryAddressList","otherAddressList","_props$customerAddres","addressId","slice","invoiceAddress","HeadingTag","billingAddressOptions","customShowAddressProps","customUpdateAddressProps","orderedRadioButtons","sameAsShipping","primaryAccount","sort","a","b","button","histogramItems","histogramProps","componentId","_data$ratingsSummary$","_data$ratingsSummary$2","_data$ratingsSummary$3","_data$ratingsSummary$4","_data$ratingsSummary$5","_data$ratingsSummary$6","reviewsCount","ratingsSummary","reviewsCountString","numberOfReviewsString","averageRatingAriaLabel","buttonProps","starLabel","bar","histogramItem","DeliveryOptionList","DeliveryOptionSelected","From","SelectedGiftCard","GiftCardList","AddResource","ShowResource","AddCheckoutLoyalty","rewardPoint","ShowCheckoutLoyalty","Form","renderConfigureDropdown","dropdown","containerProps","labelContainerProps","errors","select","renderConfigure","dropdowns","renderForm","quickOrderForm","quickOrderProductContent","quickOrderMessageContent","CartIconView","cartIconRef","_modalContainer","Modal","placement","hideArrow","wrapClassName","isModalOpen","closeModal","_openModal","_this$cartIconRef$cur","_renderCartCloseIcon","_renderCartItemCount","cartItemCount","totalItemsInCart","_escFunction","keyCode","KeyCodes","Escape","isAutoDisplayTriggered","_this$props$data$cart3","_this$props$data$cart4","isProductAddedToCart","addToCartBehavior","AddToCartBehavior","showMiniCart","miniCartWrapper","renderModuleAttributes","cartIcon","flyoutTitle","emptyCart","checkoutBlockedDueToUnavailableFunds","CartlinesWrapper","cartLineIndex","miniCartItemWrapper","storeLocation","remove","promoContentItem","_props$data$cart$resu","totalPrice","emptyPrice","totalPriceFormatString","renderTotalPrice","_props$data$cart$resu2","subTotalMessage","renderSubtotalMessage","checkoutAsSignInUserButton","checkoutAsGuestButton","goToCartButton","continueShoppingButtonTitle","renderCartlines","DescriptionInterval","renderProductCards","productsContainer","getInventoryLabel","channelInventoryConfigurationId","inventoryAttribute","textValue","renderProductCardsDescription","_props$data$products$","_props$data$featureSt","productsDimensionAvailabilities","breadCrumbType","breadcrumbType","isAllowBack","allowBackNavigation","quickviewslot","quickView","isPriceMinMaxFeatureState","priceRangeSeparator","masterProductId","renderProducts","_data$products$result","_data$products$result2","listPageState","activeProducts","productDescriptionInterval","productDescriptionIntervalRemainder0","productDescriptionIntervalRemainder9","renderTitleCount","titleContainer","titleCount","configureStickyFilter","isStickyHeader","headerContainer","querySelector","headerHeight","offsetHeight","bannerHeights","headerElement","defaultContainer","refinerElement","documentElement","scrollTop","classList","clientHeight","removeAttribute","createSearchResultModal","modalProps","refineMenu","sortByDropDown","isRecoSearchPage","modal","modalHeader","createModalBody","modalFooter","modalBody","renderSort","refiners","refineMenuContainer","refinerSectionContainer","submenu","renderRefinerMobile","renderRefiner","renderRefinerFooter","handler","doneAriaLabel","tabIndex","doneText","sortingContainer","renderTitle","titlePrefix","titleText","_props$context$action","searchResultContainer","pagination","productSectionContainer","choiceSummary","modalToggle","searchResultModal","titleViewProps","sortByOptions","categoryNavContainer","refineAndProductSectionContainer","featureSearchContainer","similarLookProduct","useStickyFilter","stickyFilterSetup","enableStickyHeader","isExpanded","setIsExpanded","wrapperRefiner","refinerRefernce","handleClickOutside","contains","useOutsideClick","recommendation","enableProdutDescription","filterText","CatalogLabelComponent","isB2b","catalog","CartLineItemFunctions","renderProductDimensions","DimensionStrings","productDimension","DiscountLines","discountLine","OfferId","OfferName","isSalesLine","PeriodicDiscount","EffectiveAmount","EffectivePercentage","inventoryInformationLabel","inventoryCssName","inventoryLabelClassName","IsInvoiceLine","hasShippingMethod","shippingChargeLines","ChargeLines","chargeLine","IsShipping","freightFee","chargeTotal","CalculatedAmount","priceComponent","_cartline$ChargeLines","otherCharges","chargeline","SalesAgreementLineRecordId","_props$context$reques2","_props$primaryImageUr","destructDimensionStrings","renderDisountLines","renderInventoryLabel","renderShippingLabel","renderOtherCharges","renderSalesAgreementPrompt","productAttribute","productName","imgeClassName","quantityOnChange","lineIndex","NetAmountWithAllInclusiveTax","GrossAmount","ExtendedPrice","NetPrice","salesAgreementLineId","_generateQuantityandPrice","nodes","isOutOfStock","currentQuantity","isCartStateReady","classNames","DiscountAmount","priceEditorResources","CartLinePriceEditor","_getDeliveryLocation","orgUnitLocations","locationMatch","OrgUnitNumber","OrgUnitName","_input$data$catalogs","shippingCharges","_getPickUpAtStoreComponents","pickupDeliveryLocation","pickUpAtStoreWithLocationText","_getEmailDeliveryComponents","emailDeliveryText","_getLineItemsComponents","isPickUp","_getCartPickDeliveryMode","cartLineItem","_filterItemsByDiliveryType","_getLineItemsByDeliveryType","_getGroupTitleComponent","_input$data$deliveryO","itemLabel","itemsLabel","inStorePickUpLabel","shippingCountCheckoutLineItem","emailDeliveryModeDesc","productDeliveryOptions","_productDeliveryOptio","suffix","lineItemsHeading","_getLineItemsByDeliveryTypeWithMulitplePickupMode","multiplePickUpLabel","shippingLable","_filterItemsByMultiplePickupMode","getGroupByStorePickup","groupDelivery","cartLinesGroup","cartLinesGrp","entries","groupByDeliveryType","lineItemDeliveryGroup","_getGroupTitleComponentWithMultiplePickUp","fulFillmentStoreId","_input$data$deliveryO2","_input$data$deliveryO3","pickupDeliveryModeDesc","_productDeliveryOptio2","_productDeliveryOptio3","groupTitle","iconClass","_getLineItems","editCartText","EditCart","groupClass","orderSummaryHeading","subTotalLabel","shippingLabel","taxLabel","orderTotalLabel","loyaltyLabel","giftcardLabel","totalDiscountsLabel","freeText","toBeCalculatedText","customerAccountLabel","showLineItems","channelConfiguration","isShowOrHideTaxEnabled","isEnableShowOrHideSalesTaxECommerceEnabled","orderSummaryProps","OrderSummary","otherChargeLabel","isTaxIncludedInPrice","IsTaxIncludedInPrice","isShowTaxBreakup","ctx","getCheckoutState","scrollIntoView","updateCheckoutErrorFocus","newCheckoutErrorFocus","InvoiceSummaryLine","cssLabel","_buildPaymentSummarySection","_computedLoyaltyAmount","InvoiceSummary","invoiceLines","reactNodes","invoiceLine","InvoiceAmount","invoiceLabel","InvoiceId","giftCardAmount","_computeGiftCardAmount","giftCardTotalValue","giftCardCounter","totalAmountAfterGiftCard","OrderSummaryLine","_buildOrderSummarySection","getDeliveryMode","featureSate","dM","SubtotalAmount","SubtotalAmountWithoutTax","TaxAmount","TaxOnNonShippingCharges","OtherChargeAmount","hasDeliveryMethod","getDeliveryConfiguration","deliveryModes","taxOnShippingCharge","TaxOnShippingCharge","shippingChargeAmount","ShippingChargeAmount","otherChargeAmount","taxOnNonShippingCharges","isTaxGreaterThanZero","otherChargeAmountTotal","subtotalAmountActual","paymentInstrumentModuleId","CheckoutGuidedForm","currentStep","getEnabledModules","childId","_enableAfterModule","Boolean","i","nextChildId","_isPaymentSectionContainer","_sectionState$childId","sectionState","currentId","getStep","indexOf","getId","getHeading","moduleChildId","isActive","isVisted","onNext","hasMissingInfo","hasOrderError","_state$childIds","shouldCollapseAfterRedirect","previousModuleHasError","childModule","_this$props$requestCo","isPending","isCancelAllowed","hasInitialized","shouldFocus","GuidedCard","isSubmitting","hasControlGroup","enableControl","getInput","_addressPurposes$find","addressTypeDescription","purpose","ichecked","addressChangeCheckboxAriaLabel","AddressInputComponent","getAddressSelectItems","AddressButtonComponent","addressAddNewButtonText","addressAddButtonText","addressAddNewButtonAriaLabel","addressAddButtonAriaLabel","addressShipMultipleText","addressShipMultipleAriaLabel","addressSaveButtonText","addressSaveButtonAriaLabel","addressCancelButtonText","addressCancelButtonAriaLabel","totalAmountLabel","invoiceSummaryTitle","CheckoutGuidedCard","editButtonRef","formCardRef","renderFooder","saveAndContinueBtnLabel","canSubmit","canCancel","Save","SaveContinue","saveBtnAttributes","Cancel","cancelBtnAttributes","focusOnFirstFocusableElement","node","child","focusOnEditButton","scrollToTitle","formCard","getTitle","Tag","_getModules","_getId","prevProps","childrenModules","childState","setCheckoutErrorFocus","changeBtnLabel","CheckoutChange","changeBtnAttributes","canEdit","active","expanded","closed","visted","hidden","initialized","ready","pending","updating","buttonsStates","onPlaceOrderHandler","isBusy","buttonSetState","setIsBusy","Purchase","orderedProducts","redirect","PlaceOrder","unavailableProductErrorMessage","outOfStockProductErrorMessage","addressShipSingleText","addressShipSingleAriaLabel","clearSelectionButtonText","clearSelectionButtonAriaLabel","chooseAddressForSelectedItemsText","chooseAddressForSelectedItemsAriaLabel","e","defaultValue","noAddressSelectedAriaLabel","headers","selectAllRowsText","addressSelectAllRowsText","addressProductNumberText","addressProductText","productUnitPrice","addressProductUnitPriceText","addressProductQuantityText","addressProductAddressText","clickHandler","isAllSelected","ShipMultipleAddressesTableHeading","_renderProductListHeader","_line$cartLine","currentLineProps","shippingLineImage","Price","ShipMultipleAddressesLineView","componentClassName","getOnChange","scope","maxWidth","paddingLeft","border","left","transform","onSelectLineHandler","renderProductImage","renderProductInfo","renderProductError","image","fallbackImage","_context$actionContex","_context$request","dimensionsLine","OOS","UNASSORTED","NONE","PayCard","PayLoyalty","PayCustomerAccount"],"sourceRoot":""}