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AAA,EAAAA,GAAa/X,GACrC,GAAImY,QAAmC1U,IAAtB0U,EAAUlW,KAAKC,GAC5B,OAAI8R,GAAgBA,EAAarO,SAAWwS,EAAUlW,KAAK0D,SAAWqO,EAAarO,QAAUwS,EAAUlW,KAAK0D,QACjG9E,QAAQC,QAAQkT,IAGpBkO,EAAAA,EAAAA,WAAU,CAAErc,cAAe7F,GAAOmY,EAAUlW,KAAKC,GAAI,GACvD4D,MAAK7D,IACFjC,EAAIZ,eAAeoV,QAAQ2N,sBAAsBlgB,EAAMya,GAChDza,KAEV8D,OAAMC,IACHhG,EAAIiG,UAAUD,MAAM,sBACpBhG,EAAIiG,UAAUiX,UAAUlX,OAWpCjG,MAzDiBsY,GACV,IAAI0J,EAAqB1J,EAAUjZ,eAAeD","sources":["webpack://Msdyn365.Commerce.Online/../../src/index.ts?0e3e","webpack://Msdyn365.Commerce.Online/./src/data-actions/global-state-data-action.ts?901a","webpack://Msdyn365.Commerce.Online/./src/global-state/i-global-state.ts?6850","webpack://Msdyn365.Commerce.Online/./src/cart-state/base-cart-state.ts?592c","webpack://Msdyn365.Commerce.Online/./src/cart-state/add-invoices-to-cart.ts?cb4a","webpack://Msdyn365.Commerce.Online/./src/cart-state/add-order-invoice-to-cart.ts?d6f8","webpack://Msdyn365.Commerce.Online/./src/cart-state/update-receipt-email.ts?a0ea","webpack://Msdyn365.Commerce.Online/./src/checkout-state/checkout-state-storage.ts?b049","webpack://Msdyn365.Commerce.Online/./src/checkout-state/base-checkout-state.ts?a438","webpack://Msdyn365.Commerce.Online/./src/data-actions/checkout-state-data-action.ts?ad58","webpack://Msdyn365.Commerce.Online/./src/data-actions/cart-state-data-action.ts?5695","webpack://Msdyn365.Commerce.Online/./src/data-actions/get-cart-state.ts?4428","webpack://Msdyn365.Commerce.Online/./src/data-actions/get-cart-state-data-action.ts?9f8e","webpack://Msdyn365.Commerce.Online/./src/data-actions/get-checkout-state.ts?61f7","webpack://Msdyn365.Commerce.Online/./src/state-interfaces/checkout-state-enums.ts?13e8","webpack://Msdyn365.Commerce.Online/./src/cart-state/add-product-to-cart.ts?85ba","webpack://Msdyn365.Commerce.Online/./src/cart-state/add-promo-code.ts?2e69","webpack://Msdyn365.Commerce.Online/./src/global-state/global-state.ts?008e","webpack://Msdyn365.Commerce.Online/./src/cart-state/clear-cart-line-delivery-mode.ts?86b9","webpack://Msdyn365.Commerce.Online/./src/cart-state/clear-cart-lines-delivery-information.ts?527a","webpack://Msdyn365.Commerce.Online/./src/cart-state/get-or-create-active-cart.ts?26ce","webpack://Msdyn365.Commerce.Online/./src/cart-state/refresh-cart.ts?3943","webpack://Msdyn365.Commerce.Online/./src/cart-state/remove-all-promo-codes.ts?1bb2","webpack://Msdyn365.Commerce.Online/./src/cart-state/remove-cart-lines.ts?2e16","webpack://Msdyn365.Commerce.Online/./src/cart-state/remove-promo-codes.ts?ffc1","webpack://Msdyn365.Commerce.Online/./src/cart-state/set-invoice-line-price.ts?9cb9","webpack://Msdyn365.Commerce.Online/./src/cart-state/update-cart.ts?8850","webpack://Msdyn365.Commerce.Online/./src/cart-state/update-cart-line-delivery-specifications.ts?6d68","webpack://Msdyn365.Commerce.Online/./src/cart-state/update-cart-line-quantity.ts?a037","webpack://Msdyn365.Commerce.Online/./src/cart-state/update-loyalty-card-id.ts?c304","webpack://Msdyn365.Commerce.Online/./src/cart-state/update-shipping-address.ts?4d06","webpack://Msdyn365.Commerce.Online/./src/cart-state/update-cart-lines.ts?cd2f","webpack://Msdyn365.Commerce.Online/./src/checkout-state/base-checkout-cart-state.ts?509c","webpack://Msdyn365.Commerce.Online/./src/data-actions/get-checkout-cart.ts?2235"],"sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport msdyn365Commerce from '@msdyn365-commerce/core-internal';\nimport { ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\n\nexport * from '@msdyn365-commerce/core-internal';\nexport { ITelemetry, LogLevel, TelemetryEvent, TelemetryEventContent } from '@msdyn365-commerce/telemetry-internal';\nexport {\n ActionContext,\n buildHydratedMockActionContext,\n createDataAction,\n createObservableDataAction,\n createDataActionHook,\n getCatalogName,\n getMediaLocationsForProductAction,\n MediaLocationsInput,\n MediaLocationType,\n getAdditionalMediaLocationsForProductAction,\n getCustomerActionDataAction,\n GetCustomerInput,\n createGetCustomerInput\n} from '@msdyn365-commerce/action-internal';\nexport * from '@msdyn365-commerce/retail-proxy/dist/async-result';\nexport * from '@msdyn365-commerce/retail-proxy/dist/data-types';\n// Workaround to export ProudctList type found in retail-proxy to add additional typed properties so that users dont have to\n// update their retail-proxy to take advantage of these new typed properties\nexport interface IProductList {\n products: ProductSearchResult[];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n listMetadata: any;\n listType: string;\n recommendationListId: string;\n discountIds?: string[];\n}\n\nexport default msdyn365Commerce;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n getCatalogId,\n IAction,\n IActionContext,\n IActionInput,\n ICommerceApiSettings,\n ICreateActionContext,\n IObservableAction,\n IRequestContext\n} from '@msdyn365-commerce/core';\n\nimport { createGlobalState, GlobalStateConstructor, IGlobalState } from '../global-state/i-global-state';\n\nexport declare type GlobalStateType = 'CARTSTATE' | 'CHECKOUTSTATE';\n\n/**\n * Shared class that handles global state inputs.\n */\nexport class GlobalStateInput implements IActionInput {\n public readonly stateConstructor: GlobalStateConstructor;\n\n public readonly key: GlobalStateType;\n\n public readonly catalogId?: number;\n\n private readonly apiSettings: ICommerceApiSettings;\n\n public constructor(\n key: GlobalStateType,\n stateConstructor: GlobalStateConstructor,\n apiSettings: ICommerceApiSettings,\n requestContext?: IRequestContext\n ) {\n this.apiSettings = apiSettings;\n this.stateConstructor = stateConstructor;\n this.key = key;\n\n if (requestContext) {\n this.catalogId = getCatalogId(requestContext);\n }\n }\n\n public getCacheKey = () => `Key:${this.key}-ChannelId:${this.apiSettings.channelId}-CatalogId:${this.catalogId ?? 0}`;\n\n public getCacheObjectType = () => this.key;\n\n public dataCacheType = (): CacheType => 'instance';\n}\n\nexport async function getState(input: GlobalStateInput, ctx: IActionContext): Promise {\n const globalStateObject = createGlobalState(input.stateConstructor, ctx);\n\n await globalStateObject.initialize();\n\n return globalStateObject;\n}\n\nexport default function createGlobalStateDataAction(\n key: GlobalStateType,\n stateConstructor: GlobalStateConstructor\n): IObservableAction {\n return createObservableDataAction({\n action: >getState,\n input: (args: ICreateActionContext) => {\n return new GlobalStateInput(key, stateConstructor, args.requestContext.apiSettings, args.requestContext);\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 { IActionContext } from '@msdyn365-commerce/core';\n\nexport declare type GlobalStateStatus = 'READY' | 'UPDATING' | 'ERROR';\n\nexport type GlobalStateConstructor = new (actionContext: IActionContext) => T;\n\nexport function createGlobalState(ctor: GlobalStateConstructor, actionContext: IActionContext): T {\n return new ctor(actionContext);\n}\n\nexport interface IGlobalState {\n readonly status: GlobalStateStatus;\n\n initialize(): Promise;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { getCatalogId, IActionContext } from '@msdyn365-commerce/core';\nimport {\n Address,\n Cart,\n CartLine,\n ChannelDeliveryOptionConfiguration,\n OrgUnitLocation,\n SimpleProduct\n} from '@msdyn365-commerce/retail-proxy';\nimport {\n AttributeValueBase,\n CommerceProperty,\n LineDeliverySpecification,\n Note,\n ReleasedProductType\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { action, computed, observable } from 'mobx';\n\nimport { GlobalState } from '../global-state/global-state';\nimport { ICartActionResult, ICartState } from '../state-interfaces/i-cart-state';\nimport addInvoicesToCartInternal from './add-invoices-to-cart';\nimport addOrderInvoiceToCartInternal from './add-order-invoice-to-cart';\nimport addProductToCartInternal, { addProductsToCartInternal } from './add-product-to-cart';\nimport addPromoCodeInternal from './add-promo-code';\nimport { ICartActionResultWithCart } from './cart-action-result';\nimport clearCartLineDeliveryModeInternal from './clear-cart-line-delivery-mode';\nimport clearCartLinesDeliveryInformation from './clear-cart-lines-delivery-information';\nimport getOrCreateActiveCart from './get-or-create-active-cart';\nimport refreshCartInternal from './refresh-cart';\nimport removeAllPromoCodesInternal from './remove-all-promo-codes';\nimport removeCartLineInternal from './remove-cart-lines';\nimport removePromoCodesInternal from './remove-promo-codes';\nimport setInvoiceLinePriceInternal from './set-invoice-line-price';\nimport updateCart from './update-cart';\nimport updateCartLineDeliverySpecificationsInternal from './update-cart-line-delivery-specifications';\nimport updateCartLineQuantityInternal from './update-cart-line-quantity';\nimport updateLoyaltyCardIdInternal from './update-loyalty-card-id';\nimport updateReceiptEmail from './update-receipt-email';\nimport updateShippingAddress from './update-shipping-address';\nimport updateCartLinesInternal from './update-cart-lines';\nimport { IActionStatus } from '../global-state';\n\n/**\n * Cart state information.\n */\nexport class BaseCartState extends GlobalState implements ICartState {\n @observable protected _cart: Cart;\n\n @computed public get cart(): Readonly {\n return this._cart;\n }\n\n @observable protected _attributeValues: AttributeValueBase[];\n\n @computed public get attributeValues(): AttributeValueBase[] {\n return this._attributeValues;\n }\n\n @observable protected _extensionProperties: CommerceProperty[];\n\n @computed public get extensionProperties(): CommerceProperty[] {\n return this._extensionProperties;\n }\n\n @computed public get totalItemsInCart(): number {\n if (this._cart.CartLines) {\n return this._cart.CartLines.map(cartLine => cartLine.Quantity || 1).reduce((total, num) => total + num, 0);\n }\n\n return 0;\n }\n\n @observable protected _isProductAddedToCart: boolean;\n\n @computed public get isProductAddedToCart(): boolean {\n return this._isProductAddedToCart;\n }\n\n @computed public get isEmpty(): boolean {\n return !(this._cart.CartLines && this._cart.CartLines.length > 0);\n }\n\n @computed public get hasInvoiceLine(): boolean {\n return !!(this._cart.CartLines && this._cart.CartLines.some(cartline => cartline.IsInvoiceLine === true));\n }\n\n private _operationQueue: Promise = Promise.resolve();\n\n constructor(actionContext: IActionContext) {\n super(actionContext);\n this._cart = {};\n this._attributeValues = [];\n this._extensionProperties = [];\n this._isProductAddedToCart = false;\n }\n\n /**\n * Refreshes the cart by getting it from the server.\n *\n * Other actions should keep cart up to date so shouldn't need to call this\n * outside of initialization but still might be scenarios where a manual\n * refresh is needed.\n * @param input - Input.\n * @param input.additionalProperties - Additional properties.\n * @returns - The cart action result.\n */\n @action\n public async refreshCart(input: { additionalProperties?: object }): Promise {\n return this._doAsyncAction(async () => {\n const newCart = await refreshCartInternal(this.cart.Id, this.actionContext);\n\n if (newCart) {\n this._cart = newCart;\n\n return { status: 'SUCCESS' };\n }\n\n return { status: 'FAILED' };\n });\n }\n\n /**\n * Adds the specified product to the current cart. If product is already in cart\n * will update its cart line, otherwise will add a new cart line to the cart.\n * @param input - The input.\n * @param input.product - The product to add to the cart.\n * @param input.count - How many copies of the product to add.\n * @param input.location - The org unit location, used for BuyOnlinePickupInStore scenarios\n * (If you want item to simply be shipped, leave this parameter undefined).\n * @param input.additionalProperties - Additional properties.\n * @param input.availableQuantity - Available quantity.\n * @param input.enableStockCheck - Is stock check enabled.\n * @param input.isAddEmailDeliveryItemToCart - Is add email delivery item to cart.\n * @param input.isPriceKeyedIn - Is price keyed in.\n * @param input.customPrice - Custom price.\n * @param input.deliveryMode - Delivery mode.\n * @param input.shouldSkipSiteSettings - Should skip site settings.\n * @param input.catalogId - Should skip site settings.\n * @returns Cart action result.\n */\n @action\n public async addProductToCart(input: {\n product: SimpleProduct;\n count?: number;\n location?: OrgUnitLocation;\n additionalProperties?: object;\n availableQuantity?: number;\n enableStockCheck?: boolean;\n isAddEmailDeliveryItemToCart?: boolean;\n isPriceKeyedIn?: boolean;\n customPrice?: number;\n deliveryMode?: string;\n shouldSkipSiteSettings?: boolean;\n catalogId?: number;\n retailMultiplePickupModeEnabled?: boolean;\n }): Promise {\n return this._doAsyncAction(async () => {\n const cartLine: CartLine = {\n CatalogId: input.catalogId ?? getCatalogId(this.actionContext.requestContext),\n Description: input.product.Description,\n\n // TODO: Investigate this value and what it represents\n EntryMethodTypeValue: 3,\n ItemId: input.product.ItemId,\n ProductId: input.product.RecordId,\n Quantity: input.count || 1,\n TrackingId: '',\n UnitOfMeasureSymbol: input.product.DefaultUnitOfMeasure,\n IsPriceKeyedIn: input.isPriceKeyedIn,\n IsGiftCardLine: input.product.IsGiftCard,\n Price: input.customPrice ? input.customPrice : input.product.Price\n };\n\n if (input.location) {\n if (!this.actionContext.requestContext.channel) {\n return { status: 'FAILED' };\n }\n\n // If curbside pick is not available use the default one\n if (input.deliveryMode !== undefined) {\n cartLine.DeliveryMode = input.deliveryMode;\n } else {\n cartLine.DeliveryMode = input.retailMultiplePickupModeEnabled\n ? undefined\n : this.actionContext.requestContext.channel.PickupDeliveryModeCode;\n }\n\n cartLine.FulfillmentStoreId = input.location.OrgUnitNumber;\n cartLine.WarehouseId = input.location.InventoryLocationId;\n cartLine.ShippingAddress = this._buildAddressFromOrgUnitLocation(input.location);\n }\n\n if (input.isAddEmailDeliveryItemToCart) {\n if (!this.actionContext.requestContext.channel) {\n return { status: 'FAILED' };\n }\n\n cartLine.DeliveryMode = this.actionContext.requestContext.channel.EmailDeliveryModeCode;\n }\n\n // Check if the product is service or not by product type\n const isAddServiceItemToCart = input.product.ItemTypeValue === ReleasedProductType.Service;\n\n // @ts-expect-error\n const validateQuantity: boolean = !!input.additionalProperties?.validateQuantity;\n return this._doCartOperationWithRetry(() =>\n addProductToCartInternal(\n this.cart,\n cartLine,\n this.actionContext,\n validateQuantity,\n input.availableQuantity,\n input.enableStockCheck,\n isAddServiceItemToCart,\n input.shouldSkipSiteSettings\n )\n );\n });\n }\n\n /**\n * Adds the specified product to the current cart. If product is already in cart\n * will update its cart line, otherwise will add a new cart line to the cart.\n * @param input - Input.\n * @param input.product - Product.\n * @param input.count - Count.\n * @param input.location - Location.\n * @param input.additionalProperties - Additional properties.\n * @param input.availableQuantity - Available quantity.\n * @param input.enableStockCheck - Enable stock check.\n * @param input.isAddEmailDeliveryItemToCart - Is add email delivery item to cart.\n * @param input.isPriceKeyedIn - Is price keyed in.\n * @param input.customPrice - Custom price.\n * @param input.deliveryMode - Delivery mode.\n * @returns Cart action result.\n */\n @action\n public async addProductsToCart(\n input: {\n product: SimpleProduct;\n count?: number;\n location?: OrgUnitLocation;\n additionalProperties?: object;\n availableQuantity?: number;\n enableStockCheck?: boolean;\n isAddEmailDeliveryItemToCart?: boolean;\n isPriceKeyedIn?: boolean;\n customPrice?: number;\n deliveryMode?: string;\n catalogId?: number;\n retailMultiplePickupModeEnabled?: boolean;\n }[]\n ): Promise {\n return this._doAsyncAction(async () => {\n const internalInput: {\n cartLineToAdd: CartLine;\n availableQuantity?: number;\n isStockCheckEnabled?: boolean;\n isAddServiceItemToCart?: boolean;\n }[] = [];\n\n for (const inputItem of input) {\n const cartLine: CartLine = {\n CatalogId: inputItem.catalogId ?? getCatalogId(this.actionContext.requestContext),\n Description: inputItem.product.Description,\n\n // TODO: Investigate this value and what it represents\n EntryMethodTypeValue: 3,\n ItemId: inputItem.product.ItemId,\n ProductId: inputItem.product.RecordId,\n Quantity: inputItem.count || 1,\n TrackingId: '',\n UnitOfMeasureSymbol: inputItem.product.DefaultUnitOfMeasure,\n IsPriceKeyedIn: inputItem.isPriceKeyedIn,\n IsGiftCardLine: inputItem.product.IsGiftCard,\n Price: inputItem.customPrice ? inputItem.customPrice : inputItem.product.Price\n };\n\n if (inputItem.location) {\n if (!this.actionContext.requestContext.channel) {\n return { status: 'FAILED' };\n }\n\n // If curbside pick is not available use the default one\n if (inputItem.deliveryMode !== undefined) {\n cartLine.DeliveryMode = inputItem.deliveryMode;\n } else {\n cartLine.DeliveryMode = inputItem.retailMultiplePickupModeEnabled\n ? undefined\n : this.actionContext.requestContext.channel.PickupDeliveryModeCode;\n }\n\n cartLine.FulfillmentStoreId = inputItem.location.OrgUnitNumber;\n cartLine.WarehouseId = inputItem.location.InventoryLocationId;\n cartLine.ShippingAddress = this._buildAddressFromOrgUnitLocation(inputItem.location);\n }\n\n if (inputItem.isAddEmailDeliveryItemToCart) {\n cartLine.DeliveryMode = this.actionContext.requestContext.channel?.EmailDeliveryModeCode;\n }\n\n // Check if the product is service or not by product type\n const PRODUCTASSERVICE = 2 as ReleasedProductType.Service;\n const isAddServiceItemToCart = inputItem.product.ItemTypeValue === PRODUCTASSERVICE;\n\n internalInput.push({\n cartLineToAdd: cartLine,\n availableQuantity: inputItem.availableQuantity,\n isStockCheckEnabled: inputItem.enableStockCheck,\n isAddServiceItemToCart\n });\n }\n\n return this._doCartOperationWithRetry(() => addProductsToCartInternal(this.cart, this.actionContext, internalInput));\n });\n }\n\n /**\n * Adds the specified invoices to the current cart.\n * @param input - The input.\n * @param input.invoiceIds - Invoice Ids.\n * @param input.additionalProperties - Additional properties.\n * @returns Cart action result.\n */\n @action\n public async addInvoicesToCart(input: { invoiceIds: string[]; additionalProperties?: object }): Promise {\n return this._doAsyncAction(async () => {\n return this._doCartOperationWithRetry(() => addInvoicesToCartInternal(this.cart, input.invoiceIds, this.actionContext));\n });\n }\n\n /**\n * Adds the specified order invoice to the current cart.\n * @param input - Input.\n * @param input.invoiceId - Invoice id.\n * @param input.lineDescription - Line description.\n * @param input.additionalProperties - Additional properties.\n * @returns Cart action result.\n */\n @action\n public async addOrderInvoiceToCart(input: {\n invoiceId: string;\n lineDescription: string;\n additionalProperties?: object;\n }): Promise {\n return this._doAsyncAction(async () => {\n return this._doCartOperationWithRetry(() =>\n addOrderInvoiceToCartInternal(this.cart, input.invoiceId, input.lineDescription, this.actionContext)\n );\n });\n }\n\n /**\n * Sets price for the given cart line with an invoice. Used to complete partial invoice payments.\n * @param input - Input for the operation.\n * @param input.cartLineId - The cart line with the invoice for which to update the price.\n * @param input.price - The new value of price of the invoice.\n * @returns The cart action result.\n */\n @action public async setInvoiceLinePrice(input: { cartLineId: string | null; price: number }): Promise {\n return this._doAsyncAction(async () => {\n return this._doCartOperationWithRetry(async () =>\n setInvoiceLinePriceInternal(this.cart, input.cartLineId, input.price, this.actionContext)\n );\n });\n }\n\n /**\n * Removes the cart lines with the provided ids from the cart.\n * @param input - Input.\n * @param input.cartLineIds - Cart line ids.\n * @param input.additionalProperties - Additional properties.\n * @returns The cart action result.\n */\n @action\n public async removeCartLines(input: { cartLineIds: string[]; additionalProperties?: object }): Promise {\n return this._doAsyncAction(async () => {\n return this._doCartOperationWithRetry(() => removeCartLineInternal(this.cart, input.cartLineIds, this.actionContext));\n });\n }\n\n /**\n * Clears the pickup location information from the provided cart line,\n * resulting in it getting shipped to the customer.\n * @param input - Input.\n * @param input.cartLineId - Cart line id.\n * @param input.additionalProperties - Additional properties.\n * @returns The cart action result.\n */\n @action\n public async clearCartLinePickupLocation(input: { cartLineId: string; additionalProperties?: object }): Promise {\n return this._doAsyncAction(async () => {\n return this._doCartOperationWithRetry(() => clearCartLineDeliveryModeInternal(this.cart, input.cartLineId, this.actionContext));\n });\n }\n\n /**\n * Clears the delivery mode, and other information for the shipping cart lines.\n * @param input - Input.\n * @param input.additionalProperties - Additional properties.\n * @param input.channelDeliveryOptionConfiguration -- Channel delivery option configuration.\n * @returns The cart action result.\n */\n @action\n public async clearCartLinesDeliveryInformation(input: {\n additionalProperties?: object;\n channelDeliveryOptionConfiguration?: ChannelDeliveryOptionConfiguration;\n }): Promise {\n return this._doAsyncAction(async () => {\n return this._doCartOperationWithRetry(() =>\n clearCartLinesDeliveryInformation(this.cart, this.actionContext, input.channelDeliveryOptionConfiguration)\n );\n });\n }\n\n /**\n * Marks the provided cart line for pickup in store, with the provided location as\n * the pickup location.\n * @param input - Input.\n * @param input.cartLineId - Cart line id.\n * @param input.location - Location.\n * @param input.additionalProperties - Additional properties.\n * @param input.deliveryMode - Delivery mode.\n * @returns The cart action result.\n */\n @action\n public async updateCartLinePickupLocation(input: {\n cartLineId: string;\n location: OrgUnitLocation;\n additionalProperties?: object;\n deliveryMode?: string;\n }): Promise {\n return this._doAsyncAction(async () => {\n if (!this.actionContext.requestContext.channel) {\n return { status: 'FAILED' };\n }\n\n const cartLineDeliverySpecification = {\n LineId: input.cartLineId,\n DeliverySpecification: {\n DeliveryModeId:\n input.deliveryMode !== undefined\n ? input.deliveryMode\n : this.actionContext.requestContext.channel.PickupDeliveryModeCode,\n DeliveryPreferenceTypeValue: 2, // Pick up in store\n PickUpStoreId: input.location.OrgUnitNumber,\n DeliveryAddress: this._buildAddressFromOrgUnitLocation(input.location)\n }\n };\n\n return this._doCartOperationWithRetry(() =>\n updateCartLineDeliverySpecificationsInternal(this.cart, [cartLineDeliverySpecification], this.actionContext)\n );\n });\n }\n\n /**\n * Marks the provided cart line for pickup in store, with the provided location as\n * the pickup location.\n * @param input - Input.\n * @param input.cartLineId - Cart line id.\n * @param input.location - Location.\n * @param input.additionalProperties - Additional properties.\n * @param input.deliveryMode - Delivery mode.\n * @returns The cart action result.\n */\n @action\n public async updateCartLineDeliverySpecification(input: {\n cartLineId: string;\n additionalProperties?: object;\n deliveryMode?: string;\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\n }): Promise {\n return this._doAsyncAction(async () => {\n if (!this.actionContext.requestContext.channel) {\n return { status: 'FAILED' };\n }\n\n const cartLineDeliverySpecification = {\n LineId: input.cartLineId,\n DeliverySpecification: {\n DeliveryModeId:\n input.deliveryMode !== undefined\n ? input.deliveryMode\n : this.actionContext.requestContext.channel.PickupDeliveryModeCode,\n DeliveryPreferenceTypeValue: 2 // Pick up in store\n }\n };\n\n return this._doCartOperationWithRetry(() =>\n updateCartLineDeliverySpecificationsInternal(this.cart, [cartLineDeliverySpecification], this.actionContext)\n );\n });\n }\n\n /**\n * Updates cart line pick up date.\n * @param input - The cart line.\n * @param input.lineDeliverySpecifications - Line delivery specifications.\n * @returns The cart action result.\n */\n @action\n public async updateCartLinePickupDateTimeslot(input: {\n lineDeliverySpecifications: LineDeliverySpecification[];\n }): Promise {\n return this._doAsyncAction(async () => {\n return this._doCartOperationWithRetry(() =>\n updateCartLineDeliverySpecificationsInternal(this.cart, input.lineDeliverySpecifications, this.actionContext)\n );\n });\n }\n\n /**\n * Updates the delivery mode for items in the cart with the desired delivery mode, preserving BOPIS status for stuff already marked as BOPIS.\n * @param input - The input.\n * @param input.deliveryModeId - Delivery mode id.\n * @param input.shippingAddress - Shipping address.\n * @param input.additionalProperties - Additional properties.\n * @param input.channelDeliveryOptionConfig - Channel delivery option configuration.\n * @returns The cart action result.\n */\n @action\n public async updateCartDeliverySpecification(input: {\n deliveryModeId: string;\n shippingAddress: Address | undefined;\n additionalProperties?: object;\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\n }): Promise {\n return this._doAsyncAction(async () => {\n if (input.deliveryModeId.trim() === '') {\n return { status: 'FAILED', substatus: 'EMPTYINPUT' };\n }\n\n const pickupDeliveryModeCode =\n this.actionContext.requestContext.channel && this.actionContext.requestContext.channel.PickupDeliveryModeCode;\n const emailDeliveryModeCode =\n this.actionContext.requestContext.channel && this.actionContext.requestContext.channel.EmailDeliveryModeCode;\n let cartLinesForShipping: CartLine[] = [];\n\n cartLinesForShipping =\n input.channelDeliveryOptionConfig !== undefined\n ? (this.cart.CartLines || []).filter(cartLine =>\n cartLine.DeliveryMode && cartLine.DeliveryMode !== ''\n ? cartLine.DeliveryMode !==\n input.channelDeliveryOptionConfig?.PickupDeliveryModeCodes?.find(\n deliveryMode => deliveryMode === cartLine.DeliveryMode\n ) && cartLine.DeliveryMode !== emailDeliveryModeCode\n : cartLine\n )\n : (this.cart.CartLines || []).filter(cartLine =>\n cartLine.DeliveryMode && cartLine.DeliveryMode !== ''\n ? cartLine.DeliveryMode !== pickupDeliveryModeCode && cartLine.DeliveryMode !== emailDeliveryModeCode\n : cartLine\n );\n\n if (cartLinesForShipping.length > 0) {\n const deliverySpecifications = cartLinesForShipping.map(cartLine => {\n return {\n LineId: cartLine.LineId,\n DeliverySpecification: {\n DeliveryModeId: input.deliveryModeId,\n DeliveryPreferenceTypeValue: 1, // Ship\n DeliveryAddress: input.shippingAddress\n }\n };\n });\n\n return this._doCartOperationWithRetry(() =>\n updateCartLineDeliverySpecificationsInternal(this.cart, deliverySpecifications, this.actionContext)\n );\n }\n\n return { status: 'FAILED', substatus: 'NOCONTENT' };\n });\n }\n\n /**\n * Updates the quantity of the cart line.\n * @param input - The input.\n * @param input.cartLineId - Cart line id.\n * @param input.newQuantity - New quantity.\n * @param input.additionalProperties - Additional properties.\n * @returns The cart action result.\n */\n @action\n public async updateCartLineQuantity(input: {\n cartLineId: string;\n newQuantity: number;\n additionalProperties?: object;\n }): Promise {\n return this._doAsyncAction(async () => {\n return this._doCartOperationWithRetry(() =>\n updateCartLineQuantityInternal(\n this.cart,\n input.cartLineId,\n input.newQuantity,\n this.actionContext,\n\n // @ts-expect-error\n input.additionalProperties?.isUsingDefaultOrderSettingsMax\n )\n );\n });\n }\n\n /**\n * Updates cart line pick up date.\n * @param input - The cart line.\n * @param input.lineDeliverySpecifications - Line delivery specifications.\n * @returns The cart action result.\n */\n @action\n public async updateCartLinesDeliverySpecification(input: {\n lineDeliverySpecifications: LineDeliverySpecification[];\n }): Promise {\n return this._doAsyncAction(async () => {\n return this._doCartOperationWithRetry(() =>\n updateCartLineDeliverySpecificationsInternal(this.cart, input.lineDeliverySpecifications, this.actionContext)\n );\n });\n }\n\n /**\n * Updates the loyalty card ID on the card.\n * @param input - The input.\n * @param input.loyaltyCardNumber - The loyalty card id to use.\n * @param input.additionalProperties - Additional properties.\n * @returns The cart action result.\n */\n @action\n public async updateLoyaltyCardId(input: {\n loyaltyCardNumber: string | undefined;\n additionalProperties?: object;\n }): Promise {\n if (!input.loyaltyCardNumber) {\n return { status: 'FAILED', substatus: 'EMPTYINPUT' };\n }\n\n return this._doAsyncAction(async () => {\n return this._doCartOperationWithRetry(() =>\n updateLoyaltyCardIdInternal(this.cart, input.loyaltyCardNumber!, this.actionContext)\n );\n });\n }\n\n /**\n * Adds promo code to the cart.\n * @param input - The input.\n * @param input.promoCode - The promo code to add.\n * @param input.additionalProperties - Additional properties.\n * @returns The cart action result.\n */\n @action\n public addPromoCode(input: { promoCode: string; additionalProperties?: object }): Promise {\n return this._doAsyncAction(async () => {\n return this._doCartOperationWithRetry(() => addPromoCodeInternal(this.cart, input.promoCode, this.actionContext));\n });\n }\n\n /**\n * Removes promo codes from the cart.\n * @param input - The input.\n * @param input.promoCodes - The promo codes to remove.\n * @param input.additionalProperties - Additional properties.\n * @returns The cart action result.\n */\n @action\n public removePromoCodes(input: { promoCodes: string[]; additionalProperties?: object }): Promise {\n return this._doAsyncAction(async () => {\n return this._doCartOperationWithRetry(() => removePromoCodesInternal(this.cart, input.promoCodes, this.actionContext));\n });\n }\n\n /**\n * Removes all promo code from the cart.\n * @param input - The input.\n * @param input.additionalProperties - Additional properties.\n * @returns The cart action result.\n */\n @action\n public removeAllPromoCodes(input: { additionalProperties?: object }): Promise {\n return this._doAsyncAction(async () => {\n return this._doCartOperationWithRetry(() => removeAllPromoCodesInternal(this.cart, this.actionContext));\n });\n }\n\n /**\n * Updates receipt email.\n * @param input - The input.\n * @param input.newEmail - The receipt email.\n * @param input.customerReference - The customer reference.\n * @param input.customerRequisition - The customer requisition.\n * @param input.note - The note.\n * @param input.additionalProperties - Additional properties.\n * @returns The cart action result.\n */\n @action\n public async updateReceiptEmail(input: {\n newEmail: string;\n customerReference?: string;\n customerRequisition?: string;\n note?: Note;\n additionalProperties?: object;\n }): Promise {\n return this._doAsyncAction(async () => {\n return this._doCartOperationWithRetry(() =>\n updateReceiptEmail(\n this.cart,\n input.newEmail,\n this.actionContext,\n input.customerReference,\n input.customerRequisition,\n input.note\n )\n );\n });\n }\n\n /**\n * Updates shipping address.\n * @param input - The input.\n * @param input.newShippingAddress - The shipping address.\n * @param input.additionalProperties - The additional properties.\n * @returns ICartActionResult.\n */\n @action\n public async updateShippingAddress(input: {\n newShippingAddress: Address;\n additionalProperties?: { [key: string]: unknown };\n }): Promise {\n return this._doAsyncAction(async () => {\n return this._doCartOperationWithRetry(async () =>\n updateShippingAddress(this.cart, input.newShippingAddress, this.actionContext)\n );\n });\n }\n\n /**\n * Updates the attribute values.\n * @param input - The input.\n * @param input.newAttributeValues - The new attribute values to update.\n * @param input.additionalProperties - The additional properties.\n * @returns ICartActionResult.\n */\n @action\n public async updateAttributeValues(input: {\n newAttributeValues: AttributeValueBase[];\n additionalProperties?: object;\n }): Promise {\n this._attributeValues = input.newAttributeValues;\n const newCartObject: Cart = {\n Id: this.cart.Id,\n AttributeValues: input.newAttributeValues\n };\n return this.updateCart({ newCartObject });\n }\n\n /**\n * Updates the extension properties.\n * @param input - The input.\n * @param input.newExtensionProperties - The new extension properties.\n * @param input.additionalProperties - The additional properties.\n * @returns ICartActionResult.\n */\n @action\n public async updateExtensionProperties(input: {\n newExtensionProperties: CommerceProperty[];\n additionalProperties?: object;\n }): Promise {\n this._extensionProperties = input.newExtensionProperties;\n const newCartObject: Cart = {\n Id: this.cart.Id,\n ExtensionProperties: input.newExtensionProperties\n };\n return this.updateCart({ newCartObject });\n }\n\n /**\n * Updates cart object.\n * @param input - The input.\n * @param input.newCartObject - The new cart object.\n * @param input.additionalProperties - Additional properties.\n * @returns Promise of cart action result.\n */\n @action\n public async updateCart(input: { newCartObject: Cart; additionalProperties?: object }): Promise {\n return this._doAsyncAction(async () => {\n return this._doCartOperationWithRetry(() => updateCart(this.cart, input.newCartObject, this.actionContext));\n });\n }\n\n /**\n * Updates cartLines objects in cart.\n * @param input - The input.\n * @param input.updatedCartLinesObject - updated cartline.\n * @returns ICartActionResult.\n */\n @action\n public async updateCartLines(input: { updatedCartLinesObject: CartLine[] }): Promise {\n return this._doAsyncAction(async () => {\n return this._doCartOperationWithRetry(() =>\n updateCartLinesInternal(this.cart, input.updatedCartLinesObject, this.actionContext)\n );\n // eslint-disable-next-line max-lines\n });\n }\n\n /**\n * Updates cartLines objects in cart.\n * @param input - The input.\n * @param input.updatedCartLinesObject - updated cartline.\n * @returns ICartActionResult.\n */\n @action\n public async updateCartLineShippingAddress(input: { updatedCartLinesObject: CartLine[] }): Promise {\n return this._doAsyncAction(async () => {\n return this._doCartOperationWithRetry(() =>\n updateCartLinesInternal(this.cart, input.updatedCartLinesObject, this.actionContext)\n );\n });\n }\n\n /**\n * Initialize function.\n */\n public async initialize(): Promise {\n if (this.isInitialized) {\n return;\n }\n\n const newCart = await getOrCreateActiveCart(this.actionContext);\n\n if (newCart) {\n this._cart = newCart;\n this._status = 'READY';\n } else {\n this._status = 'ERROR';\n }\n\n this.isInitialized = true;\n }\n\n /**\n * Validates inventory across cart lines.\n * @param callback - Callback function.\n * @returns ICartActionResult.\n */\n private async _doCartOperationWithRetry(callback: () => Promise): Promise {\n const actionContext = this.actionContext;\n const requestContext = actionContext.requestContext;\n if (requestContext.features && requestContext.features.enable_checkout_race_condition_hot_fix) {\n // Enqueue the operation\n const operationPromise = this._operationQueue.then(\n async (): Promise => {\n let callbackResult: ICartActionResultWithCart;\n\n try {\n // First attempt to execute the callback\n callbackResult = await callback();\n\n if (callbackResult.status !== 'SUCCESS') {\n // If it fails, refresh the cart and retry\n const refreshCartResult = await this.refreshCart({});\n if (refreshCartResult.status === 'SUCCESS') {\n callbackResult = await callback();\n }\n }\n\n // Update cart if operation was successful\n if (callbackResult.status === 'SUCCESS' && callbackResult.cart) {\n this._cart = callbackResult.cart;\n }\n\n // Set the product added flag based on substatus\n this._isProductAddedToCart = callbackResult.status === 'SUCCESS' && callbackResult.substatus === 'PRODUCTADDED';\n\n return {\n status: callbackResult.status,\n substatus: callbackResult.substatus,\n errorDetails: callbackResult.errorDetails,\n validationResults: callbackResult.validationResults\n };\n } catch (error) {\n // Handle any unexpected errors\n const exception: IActionStatus = 'FAILED';\n\n return {\n status: exception, // Cast to correct type\n substatus: undefined, // Provide a valid substatus\n errorDetails: {}, // Cast to correct type\n validationResults: [] // Provide a valid empty array\n };\n }\n }\n );\n\n // Update the operation queue\n this._operationQueue = operationPromise.then(() => undefined);\n\n // Wait for the operation to complete and return its result\n return operationPromise;\n } else {\n let callbackResult = await callback();\n\n if (callbackResult.status === 'SUCCESS') {\n if (callbackResult.cart) {\n this._cart = callbackResult.cart;\n }\n } else {\n const refreshCartResult = await this.refreshCart({});\n\n if (refreshCartResult.status === 'SUCCESS') {\n callbackResult = await callback();\n\n if (callbackResult.status === 'SUCCESS') {\n if (callbackResult.cart) {\n this._cart = callbackResult.cart;\n }\n }\n }\n }\n\n if (callbackResult.status === 'SUCCESS' && callbackResult.substatus && callbackResult.substatus === 'PRODUCTADDED') {\n this._isProductAddedToCart = true;\n } else {\n this._isProductAddedToCart = false;\n }\n\n return {\n status: callbackResult.status,\n substatus: callbackResult.substatus,\n errorDetails: callbackResult.errorDetails,\n validationResults: callbackResult.validationResults\n };\n }\n }\n\n /**\n * Build address from org unit location.\n * @param location - The location.\n * @returns Address.\n */\n private _buildAddressFromOrgUnitLocation(location: OrgUnitLocation): Address {\n return {\n RecordId: location.PostalAddressId,\n Name: location.OrgUnitName,\n FullAddress: location.Address,\n Street: location.Street,\n StreetNumber: location.StreetNumber,\n City: location.City,\n DistrictName: location.DistrictName,\n BuildingCompliment: location.BuildingCompliment,\n Postbox: location.Postbox,\n ThreeLetterISORegionName: location.Country,\n ZipCode: location.Zip,\n County: location.County,\n CountyName: location.CountyName,\n State: location.State,\n StateName: location.StateName\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 { IActionContext } from '@msdyn365-commerce/core';\nimport { Cart, CartsDataActions, CommerceException } from '@msdyn365-commerce/retail-proxy';\n\nimport { ICartActionResultWithCart } from './cart-action-result';\n\nexport default async function addInvoicesToCartInternal(\n cart: Readonly,\n invoiceIds: string[],\n actionContext: IActionContext\n): Promise {\n if (!invoiceIds || invoiceIds.length === 0) {\n actionContext.telemetry.trace('Invoice ids are empty, unable to add invoices to cart.');\n return { cart, status: 'FAILED', substatus: 'EMPTYINPUT' };\n }\n\n if (cart.Version) {\n return CartsDataActions.addInvoicesAsync({ callerContext: actionContext }, cart.Id, invoiceIds)\n .then(newCart => {\n return { cart: newCart, status: 'SUCCESS' };\n })\n .catch(error => {\n actionContext.telemetry.trace(error);\n actionContext.telemetry.trace('Unable to add invoices to cart');\n\n // Error object comes from API and doesn't have type definitions yet.\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- No type definition for error.\n const errorDetails: CommerceException = error.data;\n const errorResult: ICartActionResultWithCart = { cart: undefined, status: 'FAILED', errorDetails };\n return errorResult;\n });\n }\n actionContext.telemetry.warning('Unable to add invoices, Cart Version could not be found');\n\n return { cart: undefined, status: 'FAILED', substatus: 'NOCARTVERSION' };\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 { addOrderInvoiceAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport { Cart } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\n\nimport { ICartActionResultWithCart } from './cart-action-result';\n\nexport default async function addOrderInvoiceToCartInternal(\n cart: Readonly,\n invoiceId: string,\n lineDescription: string,\n actionContext: IActionContext\n): Promise {\n if (!invoiceId || invoiceId === '') {\n actionContext.telemetry.trace('Invoice id is empty, unable to add invoice to cart.');\n return { cart, status: 'FAILED', substatus: 'EMPTYINPUT' };\n }\n\n if (cart.Version) {\n return addOrderInvoiceAsync({ callerContext: actionContext }, cart.Id, invoiceId, lineDescription)\n .then(newCart => {\n return { cart: newCart, status: 'SUCCESS' };\n })\n .catch(error => {\n actionContext.telemetry.trace(error);\n actionContext.telemetry.trace('Unable to add order invoice to cart');\n\n const resultWithCart: ICartActionResultWithCart = {\n cart: undefined,\n status: 'FAILED',\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing error type.\n errorDetails: { LocalizedMessage: error.message }\n };\n\n return resultWithCart;\n });\n }\n actionContext.telemetry.warning('Unable to add order invoice, Cart Version could not be found');\n\n return { cart: undefined, status: 'FAILED', substatus: 'NOCARTVERSION' };\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 { updateAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport { Cart, Note } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\n\nimport { ICartActionResultWithCart } from './cart-action-result';\n\nexport default async function updateReceiptEmail(\n cart: Readonly,\n email: string,\n actionContext: IActionContext,\n customerReference?: string,\n customerRequisition?: string,\n note?: Note\n): Promise {\n if (!cart) {\n return { cart: undefined, status: 'FAILED', substatus: 'EMPTYCART' };\n }\n\n const updatedCart: Cart = {\n Id: cart.Id,\n ReceiptEmail: email,\n Comment: customerReference,\n CustomerRequisition: customerRequisition,\n Notes: note !== undefined ? [note] : undefined\n };\n\n return updateAsync({ callerContext: actionContext }, updatedCart)\n .then(newCart => {\n return { cart: newCart, status: 'SUCCESS' };\n })\n .catch(error => {\n actionContext.telemetry.warning(error);\n actionContext.telemetry.debug('Unable to add receipt email to the cart');\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing error type.\n return { cart: undefined, status: 'FAILED', errorDetails: { LocalizedMessage: error.message } };\n });\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nexport enum CheckoutStorageKey {\n BillingAddress = 'BillingAddress',\n GiftCard = 'GiftCard',\n LoyaltyCardNumber = 'LoyaltyCardNumber',\n LoyaltyAmount = 'LoyaltyAmount',\n TermsAndCondition = 'TermsAndCondition',\n CheckoutGenericData = 'Checkout-Generic-Data',\n PaymentTenderType = 'PaymentTenderType',\n RedirectPaymentConnectorId = 'RedirectPaymentConnectorId',\n IsExpressCheckoutApplied = 'IsExpressCheckoutApplied'\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 {\n Address,\n AttributeValueBase,\n CardPaymentAcceptResult,\n CartLine,\n CommerceProperty,\n GiftCard,\n Note,\n SalesOrder,\n SimpleProduct,\n TenderLine,\n TokenizedPaymentCard\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport get from 'lodash/get';\nimport { action, computed, observable } from 'mobx';\n\nimport { GlobalState } from '../global-state/global-state';\nimport { CheckoutModule } from '../state-interfaces';\nimport { ICartState } from '../state-interfaces/i-cart-state';\nimport {\n ICheckoutActionResult,\n ICheckoutGenericData,\n ICheckoutState,\n IGiftCardExtend,\n ICheckoutError\n} from '../state-interfaces/i-checkout-state';\nimport { BaseCheckoutCartState } from './base-checkout-cart-state';\nimport { CheckoutStorageKey } from './checkout-state-storage';\n\n/**\n * State information related to what is needed to succesfully perform a checkout.\n */\nexport class BaseCheckoutState extends GlobalState implements ICheckoutState {\n @observable protected _checkoutCart: ICartState;\n\n @computed public get checkoutCart(): ICartState {\n return this._checkoutCart;\n }\n\n @observable protected _salesOrder?: SalesOrder;\n\n @computed public get salesOrder(): Readonly {\n return this._salesOrder;\n }\n\n @observable protected _attributeValues: AttributeValueBase[];\n\n @computed public get attributeValues(): Readonly {\n return this._attributeValues;\n }\n\n @observable protected _extensionProperties: CommerceProperty[];\n\n @computed public get extensionProperties(): Readonly {\n return this._extensionProperties;\n }\n\n @observable protected _orderedProducts?: SimpleProduct[];\n\n @computed public get orderedProducts(): Readonly {\n return this._orderedProducts;\n }\n\n @observable protected _tokenizedPaymentCard?: TokenizedPaymentCard;\n\n @computed public get tokenizedPaymentCard(): Readonly {\n return this._tokenizedPaymentCard;\n }\n\n @observable protected _tenderLine?: TenderLine;\n\n @computed public get tenderLine(): Readonly {\n return this._tenderLine;\n }\n\n @observable protected _billingAddress?: Address;\n\n @computed public get billingAddress(): Readonly
{\n return this._billingAddress;\n }\n\n @observable protected _isBillingAddressSameAsShippingAddress?: boolean;\n\n @computed public get isBillingAddressSameAsShippingAddress(): Readonly {\n return this._isBillingAddressSameAsShippingAddress;\n }\n\n @observable protected _shippingAddress?: Address;\n\n @computed public get shippingAddress(): Readonly
{\n return this._shippingAddress;\n }\n\n @observable protected _cartLinesWithShippingAddress?: CartLine[];\n\n @computed public get cartLinesWithShippingAddress(): Readonly {\n return this._cartLinesWithShippingAddress;\n }\n\n @observable protected _hasShippingAddress?: boolean;\n\n @computed public get hasShippingAddress(): Readonly {\n return this._hasShippingAddress;\n }\n\n @observable protected _hasCartDeliveryMode?: boolean;\n\n @computed public get hasCartDeliveryMode(): Readonly {\n return this._hasCartDeliveryMode;\n }\n\n @observable protected _cardPrefix?: string;\n\n @computed public get cardPrefix(): Readonly {\n return this._cardPrefix;\n }\n\n @observable protected _paymentTenderType?: string;\n\n @computed public get paymentTenderType(): Readonly {\n return this._paymentTenderType;\n }\n\n /**\n * @deprecated Use giftCardExtends method.\n */\n @computed public get giftCards(): Readonly {\n return this.giftCardExtends;\n }\n\n @observable protected _giftCardExtends: IGiftCardExtend[] = [];\n\n @computed public get giftCardExtends(): Readonly {\n return this._giftCardExtends;\n }\n\n @observable protected _loyaltyCardNumber?: string;\n\n @computed public get loyaltyCardNumber(): Readonly {\n return this._loyaltyCardNumber;\n }\n\n @observable protected _loyaltyAmount: number = 0;\n\n @computed public get loyaltyAmount(): Readonly {\n return this._loyaltyAmount;\n }\n\n @observable protected _guestCheckoutEmail: string = '';\n\n @computed public get guestCheckoutEmail(): Readonly {\n return this._guestCheckoutEmail;\n }\n\n @observable protected _hasGuestCheckoutEmail?: boolean;\n\n @computed public get hasGuestCheckoutEmail(): Readonly {\n return this._hasGuestCheckoutEmail;\n }\n\n @observable protected _isTermsAndConditionAccepted?: boolean;\n\n @computed public get isTermsAndConditionAccepted(): Readonly {\n return this._isTermsAndConditionAccepted;\n }\n\n @observable protected _isTermsAndConditionChecked?: boolean;\n\n @computed public get isTermsAndConditionChecked(): Readonly {\n return this._isTermsAndConditionChecked;\n }\n\n @observable protected _shouldEnableSinglePaymentAuthorizationCheckout?: boolean;\n\n @computed public get shouldEnableSinglePaymentAuthorizationCheckout(): Readonly {\n return this._shouldEnableSinglePaymentAuthorizationCheckout;\n }\n\n @observable protected _shouldEnableCheckoutErrorDisplayMessaging?: boolean;\n\n @computed public get shouldEnableCheckoutErrorDisplayMessaging(): Readonly {\n return this._shouldEnableCheckoutErrorDisplayMessaging;\n }\n\n @observable protected _shouldCollapsePaymentSection?: boolean;\n\n @computed public get shouldCollapsePaymentSection(): Readonly {\n return this._shouldCollapsePaymentSection;\n }\n\n @observable protected _shouldTriggerPaymentWithPlaceOrder?: boolean;\n\n @computed public get shouldTriggerPaymentWithPlaceOrder(): Readonly {\n return this._shouldTriggerPaymentWithPlaceOrder;\n }\n\n @observable protected _isPaymentSectionContainerReady?: boolean;\n\n @computed public get isPaymentSectionContainerReady(): Readonly {\n return this._isPaymentSectionContainerReady;\n }\n\n @observable protected _cardPaymentAcceptResult?: CardPaymentAcceptResult;\n\n @computed public get cardPaymentAcceptResult(): Readonly {\n return this._cardPaymentAcceptResult;\n }\n\n @observable protected _isPaymentSectionContainerHasError?: boolean;\n\n @computed public get isPaymentSectionContainerHasError(): Readonly {\n return this._isPaymentSectionContainerHasError;\n }\n\n @observable protected _redirectAdditionalContext?: string;\n\n @computed public get redirectAdditionalContext(): Readonly {\n return this._redirectAdditionalContext;\n }\n\n @observable protected _redirectPaymentConnectorId?: string;\n\n @computed public get redirectPaymentConnectorId(): Readonly {\n return this._redirectPaymentConnectorId;\n }\n\n @observable protected _checkoutErrorPaymentConnectorId?: string;\n\n @computed public get checkoutErrorPaymentConnectorId(): Readonly {\n return this._checkoutErrorPaymentConnectorId;\n }\n\n @observable protected _isPlaceOrderEnabledInRedirection?: boolean;\n\n @computed public get isPlaceOrderEnabledInRedirection(): Readonly {\n return this._isPlaceOrderEnabledInRedirection;\n }\n\n @observable protected _isPaymentVerificationRequired?: boolean;\n\n @computed public get isPaymentVerificationRequired(): Readonly {\n return this._isPaymentVerificationRequired;\n }\n\n @observable protected _isCheckoutCallFailed?: boolean;\n\n @computed public get isCheckoutCallFailed(): Readonly {\n return this._isCheckoutCallFailed;\n }\n\n @observable protected _customerAccountAmount: number = 0;\n\n @computed public get customerAccountAmount(): Readonly {\n return this._customerAccountAmount;\n }\n\n @observable protected _shouldEnableExpressCheckoutInCheckout?: boolean;\n\n @computed public get shouldEnableExpressCheckoutInCheckout(): Readonly {\n return this._shouldEnableExpressCheckoutInCheckout;\n }\n\n @observable protected _shouldEnableExpressCheckoutInCart?: boolean;\n\n @computed public get shouldEnableExpressCheckoutInCart(): Readonly {\n return this._shouldEnableExpressCheckoutInCart;\n }\n\n @observable protected _shippingAddressFromExpressCheckout?: Address;\n\n @computed public get shippingAddressFromExpressCheckout(): Readonly
{\n return this._shippingAddressFromExpressCheckout;\n }\n\n @observable protected _emailAddressFromExpressCheckout: string = '';\n\n @computed public get emailAddressFromExpressCheckout(): Readonly {\n return this._emailAddressFromExpressCheckout;\n }\n\n @observable protected _billingAddressFromExpressCheckout?: Address;\n\n @computed public get billingAddressFromExpressCheckout(): Readonly
{\n return this._billingAddressFromExpressCheckout;\n }\n\n @observable protected _isExpressCheckoutApplied?: boolean;\n\n @computed public get isExpressCheckoutApplied(): Readonly {\n return this._isExpressCheckoutApplied;\n }\n\n @observable protected _isExpressAddressApplied?: boolean;\n\n @computed public get isExpressAddressApplied(): Readonly {\n return this._isExpressAddressApplied;\n }\n\n @observable protected _isExpressCheckoutAppliedInCartPage?: boolean;\n\n @computed public get isExpressCheckoutAppliedInCartPage(): Readonly {\n return this._isExpressCheckoutAppliedInCartPage;\n }\n\n @observable protected _isExpressPaymentModulesReady?: CommerceProperty[];\n\n @computed public get isExpressPaymentModulesReady(): Readonly {\n return this._isExpressPaymentModulesReady;\n }\n\n @computed public get isPaymentVerificationRedirection(): Readonly {\n const { requestFormData, query } = this.actionContext.requestContext;\n return !!(query && query.pv === '1' && (requestFormData || query.redirectResult));\n }\n\n @observable protected _checkoutError?: ICheckoutError;\n\n @computed public get checkoutError(): Readonly {\n return this._checkoutError;\n }\n\n @observable protected _isBillingAddressHasError?: boolean;\n\n @computed public get isBillingAddressHasError(): Readonly {\n return this._isBillingAddressHasError;\n }\n\n @observable protected _checkoutErrorFocus?: CheckoutModule;\n\n @computed public get checkoutErrorFocus(): Readonly {\n return this._checkoutErrorFocus;\n }\n\n @observable protected _shouldFocusOnCheckoutError?: boolean;\n\n @computed public get shouldFocusOnCheckoutError(): Readonly {\n return this._shouldFocusOnCheckoutError;\n }\n\n @observable protected _checkoutGenericData: object = {};\n\n constructor(actionContext: IActionContext) {\n super(actionContext);\n this._checkoutCart = new BaseCheckoutCartState(actionContext);\n this._attributeValues = [];\n this._extensionProperties = [];\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Do not need type check for app settings.\n this._shouldEnableSinglePaymentAuthorizationCheckout = actionContext.requestContext.app.config\n .shouldEnableSinglePaymentAuthorizationCheckout as boolean;\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Do not need type check for app settings.\n this._shouldEnableCheckoutErrorDisplayMessaging = actionContext.requestContext.app.config\n .shouldEnableCheckoutErrorDisplayMessaging as boolean;\n }\n\n @action\n public updateSalesOrder(input: {\n newSalesOrder: SalesOrder;\n newOrderedProducts: SimpleProduct[];\n additionalProperties?: object;\n }): Promise {\n this._salesOrder = input.newSalesOrder;\n this._orderedProducts = input.newOrderedProducts;\n this._attributeValues = input.newSalesOrder.AttributeValues || [];\n this._extensionProperties = input.newSalesOrder.ExtensionProperties || [];\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public async updateAttributeValues(input: {\n newAttributeValues: AttributeValueBase[];\n additionalProperties?: object;\n }): Promise {\n this._attributeValues = input.newAttributeValues;\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public async updateExtensionProperties(input: {\n newExtensionProperties: CommerceProperty[];\n additionalProperties?: object;\n }): Promise {\n this._extensionProperties = input.newExtensionProperties;\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public updateTokenizedPaymentCard(input: {\n newTokenizedPaymentCard?: TokenizedPaymentCard;\n additionalProperties?: object;\n }): Promise {\n this._tokenizedPaymentCard = input.newTokenizedPaymentCard;\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public updateTenderLine(input: { newTenderLine?: TenderLine; additionalProperties?: object }): Promise {\n this._tenderLine = input.newTenderLine;\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public async updateShippingAddress(input: {\n newShippingAddress: Address;\n additionalProperties?: object;\n }): Promise {\n this._shippingAddress = input.newShippingAddress;\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public async updateCartLinesShippingAddress(input: {\n newCartLinesWithShippingAddress: CartLine[];\n additionalProperties?: object;\n }): Promise {\n this._cartLinesWithShippingAddress = input.newCartLinesWithShippingAddress;\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public async updateHasShippingAddress(\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n input: { newHasShippingAddress: boolean; additionalProperties?: { [key: string]: unknown } }\n ): Promise {\n this._hasShippingAddress = input.newHasShippingAddress;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateHasCartDeliveryMode(\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n input: { newHasCartDeliveryMode: boolean; additionalProperties?: { [key: string]: unknown } }\n ): Promise {\n this._hasCartDeliveryMode = input.newHasCartDeliveryMode;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateTermsAndConditionsAcceptance(input: {\n newIsTermsAndConditionAccepted: boolean;\n additionalProperties?: object;\n }): Promise {\n this._isTermsAndConditionAccepted = input.newIsTermsAndConditionAccepted;\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public async updateIsTermsAndConditionsChecked(\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n input: { newIsTermsAndConditionChecked: boolean; additionalProperties?: { [key: string]: unknown } }\n ): Promise {\n this._isTermsAndConditionChecked = input.newIsTermsAndConditionChecked;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateShouldCollapsePaymentSection(\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n input: { newShouldCollapsePaymentSection: boolean; additionalProperties?: { [key: string]: unknown } }\n ): Promise {\n this._shouldCollapsePaymentSection = input.newShouldCollapsePaymentSection;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateShouldTriggerPaymentWithPlaceOrder(\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n input: { newShouldTriggerPaymentWithPlaceOrder: boolean; additionalProperties?: { [key: string]: unknown } }\n ): Promise {\n this._shouldTriggerPaymentWithPlaceOrder = input.newShouldTriggerPaymentWithPlaceOrder;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateIsPaymentSectionContainerReady(\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n input: { newIsPaymentSectionContainerReady: boolean; additionalProperties?: { [key: string]: unknown } }\n ): Promise {\n this._isPaymentSectionContainerReady = input.newIsPaymentSectionContainerReady;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateCardPaymentAcceptResult(input: {\n newCardPaymentAcceptResult: CardPaymentAcceptResult;\n additionalProperties?: { [key: string]: unknown };\n }): Promise {\n this._cardPaymentAcceptResult = input.newCardPaymentAcceptResult;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateIsPaymentSectionContainerHasError(\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n input: { newIsPaymentSectionContainerHasError: boolean; additionalProperties?: { [key: string]: unknown } }\n ): Promise {\n this._isPaymentSectionContainerHasError = input.newIsPaymentSectionContainerHasError;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateRedirectAdditionalContext(input: {\n newRedirectAdditionalContext: string;\n additionalProperties?: { [key: string]: unknown };\n }): Promise {\n this._redirectAdditionalContext = input.newRedirectAdditionalContext;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateRedirectPaymentConnectorId(input: {\n newRedirectPaymentConnectorId: string;\n additionalProperties?: { [key: string]: unknown };\n }): Promise {\n this._redirectPaymentConnectorId = input.newRedirectPaymentConnectorId;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateCheckoutErrorPaymentConnectorId(input: {\n newCheckoutErrorPaymentConnectorId: string;\n additionalProperties?: { [key: string]: unknown };\n }): Promise {\n this._checkoutErrorPaymentConnectorId = input.newCheckoutErrorPaymentConnectorId;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateIsCheckoutCallFailed(\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n input: { newIsCheckoutCallFailed: boolean; additionalProperties?: { [key: string]: unknown } }\n ): Promise {\n this._isCheckoutCallFailed = input.newIsCheckoutCallFailed;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateIsPlaceOrderEnabledInRedirection(\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n input: { newIsPlaceOrderEnabledInRedirection: boolean; additionalProperties?: { [key: string]: unknown } }\n ): Promise {\n this._isPlaceOrderEnabledInRedirection = input.newIsPlaceOrderEnabledInRedirection;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateIsPaymentVerificationRequired(\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n input: { newIsPaymentVerificationRequired: boolean; additionalProperties?: { [key: string]: unknown } }\n ): Promise {\n this._isPaymentVerificationRequired = input.newIsPaymentVerificationRequired;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public updateBillingAddress(input: { newBillingAddress: Address; additionalProperties?: object }): Promise {\n this._billingAddress = input.newBillingAddress;\n\n // @ts-expect-error\n this._isBillingAddressSameAsShippingAddress = input.additionalProperties?.isBillingAddressSameAsShippingAddress || false;\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public removeBillingAddress(input: { additionalProperties?: object }): Promise {\n this._billingAddress = undefined;\n this._isBillingAddressSameAsShippingAddress = undefined;\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public updatePaymentTenderType(input: {\n newPaymentTenderType?: string;\n additionalProperties?: object;\n }): Promise {\n this._paymentTenderType = input.newPaymentTenderType;\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public updateCardPrefix(input: { newCardPrefix: string; additionalProperties?: object }): Promise {\n this._cardPrefix = input.newCardPrefix;\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public removeGiftCard(input: { giftCardNumber: string; additionalProperties?: object }): Promise {\n this._giftCardExtends = this._giftCardExtends.filter(giftCard => giftCard.Id !== input.giftCardNumber);\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public removeGiftCardExtend(input: { giftCardNumber: string; additionalProperties?: object }): Promise {\n this._giftCardExtends = this._giftCardExtends.filter(giftCard => giftCard.Id !== input.giftCardNumber);\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public addGiftCard(input: { giftCard: GiftCard; additionalProperties?: object }): Promise {\n // @ts-expect-error\n const { Pin, ExpirationDate, TenderTypeId } = input.additionalProperties || {};\n\n const gitCardExtend = { ...input.giftCard, ...{ Pin, ExpirationDate, TenderTypeId } };\n\n this._giftCardExtends = [gitCardExtend, ...this._giftCardExtends];\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public addGiftCardExtend(input: { giftCard: IGiftCardExtend; additionalProperties?: object }): Promise {\n this._giftCardExtends = [input.giftCard, ...this._giftCardExtends];\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public updateLoyaltyCardNumber(input: { newLoyaltyCardNumber: string; additionalProperties?: object }): Promise {\n this._loyaltyCardNumber = input.newLoyaltyCardNumber;\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public updateLoyaltyAmount(input: { newAmount: number; additionalProperties?: object }): Promise {\n this._loyaltyAmount = Number(input.newAmount.toFixed(2));\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public async updateGuestCheckoutEmail(input: {\n newGuestCheckoutEmail: string;\n customerReference?: string;\n customerRequisition?: string;\n note?: Note;\n additionalProperties?: object;\n }): Promise {\n this._guestCheckoutEmail = input.newGuestCheckoutEmail;\n const emailOnCart = this.checkoutCart.cart.ReceiptEmail;\n const customerReqOnCart = this.checkoutCart.cart.CustomerRequisition;\n const customerRefOnCart = this.checkoutCart.cart.Comment;\n const noteOnCart = this.checkoutCart.cart.Notes;\n const noteInput = input?.note;\n if (\n emailOnCart !== input.newGuestCheckoutEmail ||\n customerRefOnCart !== input.customerReference ||\n customerReqOnCart !== input.customerRequisition ||\n (noteOnCart !== undefined && noteOnCart[0]?.Description) !== (noteInput !== undefined && noteInput[0]?.Description)\n ) {\n await this.checkoutCart.updateReceiptEmail({\n newEmail: input.newGuestCheckoutEmail,\n customerReference: input.customerReference,\n customerRequisition: input.customerRequisition,\n note: input.note\n });\n }\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n /**\n * Updates cartLines objects in cart.\n * @param input - The input.\n * @param input.updatedCartLinesObject - updated cartline.\n * @returns ICartActionResult.\n */\n @action\n public async updateCartLines(input: { updatedCartLinesObject: CartLine[] }): Promise {\n await this.checkoutCart.updateCartLines({ updatedCartLinesObject: input.updatedCartLinesObject });\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public async updateHasGuestCheckoutEmail(\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n input: {\n newHasGuestCheckoutEmail: boolean;\n customerReference?: string;\n customerRequisition?: string;\n note?: Note;\n additionalProperties?: { [key: string]: unknown };\n }\n ): Promise {\n this._hasGuestCheckoutEmail = input.newHasGuestCheckoutEmail;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public removeCheckoutCartId(input: { additionalProperties?: object }): Promise {\n this.actionContext.requestContext.cookies.removeCheckoutCartCookie();\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public saveDataInStorage(input: { additionalProperties?: object }): Promise {\n const { sessionStorage } = this.actionContext.requestContext;\n\n // Add all local data to session storage\n if (this.billingAddress) {\n sessionStorage.setCheckoutCartData(CheckoutStorageKey.BillingAddress, {\n billingAddress: this.billingAddress,\n isBillingAddressSameAsShippingAddress: this.isBillingAddressSameAsShippingAddress\n });\n }\n\n if (this.giftCardExtends && this.giftCardExtends.length > 0) {\n sessionStorage.setCheckoutCartData(CheckoutStorageKey.GiftCard, this.giftCardExtends);\n }\n\n if (this.loyaltyCardNumber) {\n sessionStorage.setCheckoutCartData(CheckoutStorageKey.LoyaltyCardNumber, { loyaltyCardNumber: this.loyaltyCardNumber });\n }\n\n if (this.loyaltyAmount) {\n sessionStorage.setCheckoutCartData(CheckoutStorageKey.LoyaltyAmount, { loyaltyAmount: this.loyaltyAmount });\n }\n\n if (this.isTermsAndConditionAccepted) {\n sessionStorage.setCheckoutCartData(CheckoutStorageKey.TermsAndCondition, {\n isTermsAndConditionAccepted: this.isTermsAndConditionAccepted\n });\n }\n\n if (this.paymentTenderType) {\n window.sessionStorage.setItem(CheckoutStorageKey.PaymentTenderType, this.paymentTenderType);\n }\n\n if (this.redirectPaymentConnectorId) {\n window.sessionStorage.setItem(CheckoutStorageKey.RedirectPaymentConnectorId, this.redirectPaymentConnectorId);\n }\n\n if (this.isExpressCheckoutApplied) {\n window.sessionStorage.setItem(CheckoutStorageKey.IsExpressCheckoutApplied, this.isExpressCheckoutApplied.toString());\n }\n\n // Save generic data with SaveDataBeforeRedirect value true\n const filtered = Object.keys(this._checkoutGenericData).reduce((filteredData: object, key: string) => {\n if (this._checkoutGenericData[key].SaveDataBeforeRedirect) {\n filteredData[key] = this._checkoutGenericData[key];\n }\n return filteredData;\n }, {});\n\n if (Object.keys(filtered).length > 0) {\n sessionStorage.setCheckoutCartData(CheckoutStorageKey.CheckoutGenericData, { checkoutGenericData: filtered });\n }\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public updateCustomerAccountAmount(input: { newAmount: number; additionalProperties?: object }): Promise {\n this._customerAccountAmount = Number(input.newAmount.toFixed(2));\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public async updateBillingAddressFromExpressCheckout(input: {\n newBillingAddressFromExpressCheckout: Address;\n additionalProperties?: { [key: string]: unknown };\n }): Promise {\n this._billingAddressFromExpressCheckout = input.newBillingAddressFromExpressCheckout;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateShippingAddressFromExpressCheckout(input: {\n newShippingAddressFromExpressCheckout: Address;\n additionalProperties?: { [key: string]: unknown };\n }): Promise {\n this._shippingAddressFromExpressCheckout = input.newShippingAddressFromExpressCheckout;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateEmailAddressFromExpressCheckout(input: {\n newEmailAddressFromExpressCheckout: string;\n additionalProperties?: { [key: string]: unknown };\n }): Promise {\n this._emailAddressFromExpressCheckout = input.newEmailAddressFromExpressCheckout;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateShouldEnableExpressCheckoutInCheckout(\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n input: { newShouldEnableExpressCheckoutInCheckout: boolean; additionalProperties?: { [key: string]: unknown } }\n ): Promise {\n this._shouldEnableExpressCheckoutInCheckout = input.newShouldEnableExpressCheckoutInCheckout;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateShouldEnableExpressCheckoutInCart(\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n input: { newShouldEnableExpressCheckoutInCart: boolean; additionalProperties?: { [key: string]: unknown } }\n ): Promise {\n this._shouldEnableExpressCheckoutInCart = input.newShouldEnableExpressCheckoutInCart;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateIsExpressCheckoutApplied(\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n input: { newIsExpressCheckoutApplied: boolean; additionalProperties?: { [key: string]: unknown } }\n ): Promise {\n this._isExpressCheckoutApplied = input.newIsExpressCheckoutApplied;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateIsExpressAddressApplied(\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n input: { newIsExpressAddressApplied: boolean; additionalProperties?: { [key: string]: unknown } }\n ): Promise {\n this._isExpressAddressApplied = input.newIsExpressAddressApplied;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateIsExpressCheckoutAppliedInCartPage(\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n input: { newIsExpressCheckoutAppliedInCartPage: boolean; additionalProperties?: { [key: string]: unknown } }\n ): Promise {\n this._isExpressCheckoutAppliedInCartPage = input.newIsExpressCheckoutAppliedInCartPage;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateIsBillingAddressHasError(\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n input: { newIsBillingAddressHasError: boolean; additionalProperties?: { [key: string]: unknown } }\n ): Promise {\n this._isBillingAddressHasError = input.newIsBillingAddressHasError;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateIsExpressPaymentModulesReady(\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n input: {\n newIsExpressPaymentModulesReady: CommerceProperty[];\n additionalProperties?: { [key: string]: unknown };\n }\n ): Promise {\n this._isExpressPaymentModulesReady = input.newIsExpressPaymentModulesReady;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateExpressCheckoutDetails(input: {\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n newIsExpressCheckoutApplied: boolean;\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n newIsExpressAddressApplied?: boolean;\n newCardPaymentAcceptResult?: CardPaymentAcceptResult;\n newEmailAddressFromExpressCheckout: string;\n newTenderLine?: TenderLine;\n newPaymentTenderType?: string;\n newTokenizedPaymentCard?: TokenizedPaymentCard;\n additionalProperties?: { [key: string]: unknown };\n }): Promise {\n this._isExpressCheckoutApplied = input.newIsExpressCheckoutApplied;\n\n if (input.newIsExpressAddressApplied !== undefined) {\n this._isExpressAddressApplied = input.newIsExpressAddressApplied;\n }\n\n if (input.newCardPaymentAcceptResult !== undefined) {\n this._cardPaymentAcceptResult = input.newCardPaymentAcceptResult;\n }\n\n if (input.newPaymentTenderType !== undefined) {\n this._paymentTenderType = input.newPaymentTenderType;\n }\n\n if (input.newTokenizedPaymentCard !== undefined) {\n this._tokenizedPaymentCard = input.newTokenizedPaymentCard;\n }\n\n if (input.newTenderLine !== undefined) {\n this._tenderLine = input.newTenderLine;\n }\n\n if (input.newEmailAddressFromExpressCheckout) {\n this._emailAddressFromExpressCheckout = input.newEmailAddressFromExpressCheckout;\n }\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateCheckoutError(input: {\n newCheckoutError: ICheckoutError;\n additionalProperties?: { [key: string]: unknown };\n }): Promise {\n this._checkoutError = input.newCheckoutError;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public setCheckoutGenericData(input: {\n key: string;\n checkoutGenericData: ICheckoutGenericData;\n additionalProperties?: object;\n }): Promise {\n this._checkoutGenericData[input.key] = input.checkoutGenericData;\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public getCheckoutGenericData(input: { key: string }): ICheckoutGenericData | undefined {\n return this._checkoutGenericData[input.key];\n }\n\n @action\n public async updateCheckoutErrorFocus(\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n input: { newCheckoutErrorFocus: CheckoutModule; additionalProperties?: { [key: string]: unknown } }\n ): Promise {\n this._checkoutErrorFocus = input.newCheckoutErrorFocus;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateShouldFocusOnCheckoutError(\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n input: { newShouldFocusOnCheckoutError: boolean; additionalProperties?: { [key: string]: unknown } }\n ): Promise {\n this._shouldFocusOnCheckoutError = input.newShouldFocusOnCheckoutError;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n public async initialize(): Promise {\n if (this.isInitialized) {\n return;\n }\n\n await this._checkoutCart.initialize();\n\n this.setInitialData();\n this.isInitialized = true;\n this._status = 'READY';\n this._attributeValues = [];\n this._extensionProperties = [];\n }\n\n @action\n private cleanCheckoutData(input: { additionalProperties?: object }): Promise {\n this.actionContext.requestContext.sessionStorage.removeCheckoutCartData();\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n private setInitialData() {\n const { sessionStorage } = this.actionContext.requestContext;\n\n if (this.isPaymentVerificationRedirection) {\n const billingAddress = sessionStorage.getCheckoutCartData(CheckoutStorageKey.BillingAddress);\n const giftCard = sessionStorage.getCheckoutCartData(CheckoutStorageKey.GiftCard);\n\n this._billingAddress = get(billingAddress, 'billingAddress');\n this._isBillingAddressSameAsShippingAddress = get(billingAddress, 'isBillingAddressSameAsShippingAddress');\n this._giftCardExtends = (giftCard && Array.isArray(giftCard) ? giftCard : []) as IGiftCardExtend[];\n this._loyaltyCardNumber = get(sessionStorage.getCheckoutCartData(CheckoutStorageKey.LoyaltyCardNumber), 'loyaltyCardNumber');\n this._loyaltyAmount = get(sessionStorage.getCheckoutCartData(CheckoutStorageKey.LoyaltyAmount), 'loyaltyAmount');\n this._isTermsAndConditionAccepted = get(\n sessionStorage.getCheckoutCartData(CheckoutStorageKey.TermsAndCondition),\n 'isTermsAndConditionAccepted'\n );\n this._checkoutGenericData =\n get(sessionStorage.getCheckoutCartData(CheckoutStorageKey.CheckoutGenericData), 'checkoutGenericData') || {};\n this._paymentTenderType = window.sessionStorage.getItem(CheckoutStorageKey.PaymentTenderType) ?? undefined;\n this._redirectPaymentConnectorId = window.sessionStorage.getItem(CheckoutStorageKey.RedirectPaymentConnectorId) as string;\n this._isExpressCheckoutApplied = (window.sessionStorage.getItem(CheckoutStorageKey.IsExpressCheckoutApplied) as string)\n ? true\n : false;\n }\n\n this.cleanCheckoutData({});\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { BaseCheckoutState } from '../checkout-state/base-checkout-state';\nimport { ICheckoutState } from '../state-interfaces/i-checkout-state';\nimport createGlobalStateDataAction from './global-state-data-action';\n\nexport default createGlobalStateDataAction('CHECKOUTSTATE', BaseCheckoutState);\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { BaseCartState } from '../cart-state/base-cart-state';\nimport { ICartState } from '../state-interfaces/i-cart-state';\nimport createGlobalStateDataAction from './global-state-data-action';\n\nexport default createGlobalStateDataAction('CARTSTATE', BaseCartState);\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { AsyncResult, IActionContext } from '@msdyn365-commerce/core';\n\nimport { BaseCartState } from '../cart-state/base-cart-state';\nimport { ICartState } from '../state-interfaces/i-cart-state';\nimport cartStateDataAction from './cart-state-data-action';\nimport { GlobalStateInput } from './global-state-data-action';\n\nexport function getCartState(ctx: IActionContext): AsyncResult {\n return cartStateDataAction(\n new GlobalStateInput('CARTSTATE', BaseCartState, ctx.requestContext.apiSettings, ctx.requestContext),\n ctx\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 CacheType,\n createObservableDataAction,\n getCatalogId,\n IAction,\n IActionContext,\n IActionInput,\n ICommerceApiSettings,\n ICreateActionContext,\n IRequestContext\n} from '@msdyn365-commerce/core';\nimport { Cart } from '@msdyn365-commerce/retail-proxy';\n\nimport { ICartState } from '../state-interfaces';\nimport { getCartState } from './get-cart-state';\n\n/**\n * Input class for getCart data action.\n */\nexport class GetCartStateDataInput implements IActionInput {\n private readonly apiSettings: ICommerceApiSettings;\n\n private readonly catalogId?: number;\n\n constructor(apiSettings: ICommerceApiSettings, requestContext?: IRequestContext) {\n this.apiSettings = apiSettings;\n if (requestContext) {\n this.catalogId = getCatalogId(requestContext);\n }\n }\n\n public getCacheKey = () => `GetCart-ChannelId:${this.apiSettings.channelId}-CatalogId:${this.catalogId ?? 0}`;\n\n public getCacheObjectType = () => 'Cart';\n\n public dataCacheType = (): CacheType => 'none';\n}\n\nconst createInput = (inputData: ICreateActionContext) => {\n return new GetCartStateDataInput(inputData.requestContext.apiSettings, inputData.requestContext);\n};\n\n/**\n * Data action to copy the cart for actions.\n * @param input\n * @param ctx\n */\nexport async function getCartStateData(input: GetCartStateDataInput, ctx: IActionContext): Promise {\n const cartState = await getCartState(ctx);\n if (cartState && cartState.cart.Id !== undefined) {\n return cartState;\n }\n\n return undefined;\n}\n\nexport default createObservableDataAction({\n id: '@msdyn365-commerce/global-state/get-cart-state-data',\n action: >getCartStateData,\n input: createInput\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { AsyncResult, IActionContext } from '@msdyn365-commerce/core';\n\nimport { BaseCheckoutState } from '../checkout-state/base-checkout-state';\nimport { ICheckoutState } from '../state-interfaces/i-checkout-state';\nimport checkoutStateDataAction from './checkout-state-data-action';\nimport { GlobalStateInput } from './global-state-data-action';\n\nexport function getCheckoutState(ctx: IActionContext): AsyncResult {\n return checkoutStateDataAction(\n new GlobalStateInput('CHECKOUTSTATE', BaseCheckoutState, ctx.requestContext.apiSettings, ctx.requestContext),\n ctx\n );\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nexport enum ErrorCode {\n ActionError = 'ActionError',\n Microsoft_Dynamics_Commerce_Runtime_BlockedLoyaltyCard = 'Microsoft_Dynamics_Commerce_Runtime_BlockedLoyaltyCard',\n Microsoft_Dynamics_Commerce_Runtime_CustomerAccountLimitSignDifferentFromAmountDue = 'Microsoft_Dynamics_Commerce_Runtime_CustomerAccountLimitSignDifferentFromAmountDue',\n Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsAvailableCreditLimit = 'Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsAvailableCreditLimit',\n Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsCustomerAccountFloorLimit = 'Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsCustomerAccountFloorLimit',\n Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsTotalAmountForCarryOutAndReturnItems = 'Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsTotalAmountForCarryOutAndReturnItems',\n Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentForCustomerWithoutAllowOnAccount = 'Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentForCustomerWithoutAllowOnAccount',\n Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentNotAllowedForOpenInvoices = 'Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentNotAllowedForOpenInvoices',\n Microsoft_Dynamics_Commerce_Runtime_FraudRisk = 'Microsoft_Dynamics_Commerce_Runtime_FraudRisk',\n Microsoft_Dynamics_Commerce_Runtime_GiftCardBalanceInquiryFailed = 'Microsoft_Dynamics_Commerce_Runtime_GiftCardBalanceInquiryFailed',\n Microsoft_Dynamics_Commerce_Runtime_GiftCardCurrencyMismatch = 'Microsoft_Dynamics_Commerce_Runtime_GiftCardCurrencyMismatch',\n Microsoft_Dynamics_Commerce_Runtime_InvalidCartVersion = 'Microsoft_Dynamics_Commerce_Runtime_InvalidCartVersion',\n Microsoft_Dynamics_Commerce_Runtime_InvalidLoyaltyCardNumber = 'Microsoft_Dynamics_Commerce_Runtime_InvalidLoyaltyCardNumber',\n Microsoft_Dynamics_Commerce_Runtime_InvalidPaymentRequest = 'Microsoft_Dynamics_Commerce_Runtime_InvalidPaymentRequest',\n Microsoft_Dynamics_Commerce_Runtime_MissingRequiredCartTenderLines = 'Microsoft_Dynamics_Commerce_Runtime_MissingRequiredCartTenderLines',\n Microsoft_Dynamics_Commerce_Runtime_MultipleCustomerAccountPaymentsNotAllowed = ' Microsoft_Dynamics_Commerce_Runtime_MultipleCustomerAccountPaymentsNotAllowed',\n Microsoft_Dynamics_Commerce_Runtime_NoMoreThanOneLoyaltyTender = 'Microsoft_Dynamics_Commerce_Runtime_NoMoreThanOneLoyaltyTender',\n Microsoft_Dynamics_Commerce_Runtime_NoResponseFromGatewayForGiftCardBalanceInquiry = 'Microsoft_Dynamics_Commerce_Runtime_NoResponseFromGatewayForGiftCardBalanceInquiry',\n Microsoft_Dynamics_Commerce_Runtime_NoTenderLoyaltyCard = 'Microsoft_Dynamics_Commerce_Runtime_NoTenderLoyaltyCard',\n Microsoft_Dynamics_Commerce_Runtime_NotEnoughRewardPoints = 'Microsoft_Dynamics_Commerce_Runtime_NotEnoughRewardPoints',\n Microsoft_Dynamics_Commerce_Runtime_PaymentAlreadyVoided = 'Microsoft_Dynamics_Commerce_Runtime_PaymentAlreadyVoided',\n Microsoft_Dynamics_Commerce_Runtime_PaymentAmountExceedsGiftBalance = 'Microsoft_Dynamics_Commerce_Runtime_PaymentAmountExceedsGiftBalance',\n Microsoft_Dynamics_Commerce_Runtime_PaymentRequiresMerchantProperties = 'Microsoft_Dynamics_Commerce_Runtime_PaymentRequiresMerchantProperties',\n Microsoft_Dynamics_Commerce_Runtime_PaymentUsingUnauthorizedAccount = 'Microsoft_Dynamics_Commerce_Runtime_PaymentUsingUnauthorizedAccount',\n Microsoft_Dynamics_Commerce_Runtime_RefundAmountMoreThanAllowed = 'Microsoft_Dynamics_Commerce_Runtime_RefundAmountMoreThanAllowed',\n Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePayment = 'Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePayment',\n Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePaymentCardAdditionalContextRequired = 'Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePaymentCardAdditionalContextRequired',\n Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePaymentCardTypeMissingOrNotSupported = 'Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePaymentCardTypeMissingOrNotSupported',\n Microsoft_Dynamics_Commerce_Runtime_UnableToCancelPayment = 'Microsoft_Dynamics_Commerce_Runtime_UnableToCancelPayment',\n Microsoft_Dynamics_Commerce_Runtime_UnableToReadCardTokenInfo = 'Microsoft_Dynamics_Commerce_Runtime_UnableToReadCardTokenInfo',\n Microsoft_Dynamics_Commerce_Runtime_UnableToRetrieveCardPaymentAcceptResult = 'Microsoft_Dynamics_Commerce_Runtime_UnableToRetrieveCardPaymentAcceptResult'\n}\n\nexport enum ErrorMessageResource {\n blockedLoyaltyCardErrorMessage = 'blockedLoyaltyCardErrorMessage',\n checkoutTimeoutErrorMessage = 'checkoutTimeoutErrorMessage',\n customerAccountLimitSignDifferentFromAmountDueErrorMessage = 'customerAccountLimitSignDifferentFromAmountDueErrorMessage',\n customerAccountPaymentExceedsAvailableCreditLimitErrorMessage = 'customerAccountPaymentExceedsAvailableCreditLimitErrorMessage',\n customerAccountPaymentExceedsCustomerAccountFloorLimitErrorMessage = 'customerAccountPaymentExceedsCustomerAccountFloorLimitErrorMessage',\n customerAccountPaymentExceedsTotalAmountForCarryOutAndReturnItemsErrorMessage = 'customerAccountPaymentExceedsTotalAmountForCarryOutAndReturnItemsErrorMessage',\n customerAccountPaymentForCustomerWithoutAllowOnAccountErrorMessage = 'customerAccountPaymentForCustomerWithoutAllowOnAccountErrorMessage',\n customerAccountPaymentNotAllowedForOpenInvoicesErrorMessage = 'customerAccountPaymentNotAllowedForOpenInvoicesErrorMessage',\n fraudRiskErrorMessage = 'fraudRiskErrorMessage',\n giftCardBalanceInquiryFailedErrorMessage = 'giftCardBalanceInquiryFailedErrorMessage',\n giftCardCurrencyMismatchErrorMessage = 'giftCardCurrencyMismatchErrorMessage',\n invalidCartVersionErrorMessage = 'invalidCartVersionErrorMessage',\n invalidLoyaltyCardNumberErrorMessage = 'invalidLoyaltyCardNumberErrorMessage',\n invalidPaymentRequestConsoleErrorMessage = 'invalidPaymentRequestConsoleErrorMessage',\n invalidPaymentRequestErrorMessage = 'invalidPaymentRequestErrorMessage',\n missingRequiredCartTenderLinesErrorMessage = 'missingRequiredCartTenderLinesErrorMessage',\n multipleCustomerAccountPaymentsNotAllowedErrorMessage = 'multipleCustomerAccountPaymentsNotAllowedErrorMessage',\n noMoreThanOneLoyaltyTenderErrorMessage = 'noMoreThanOneLoyaltyTenderErrorMessage',\n noResponseFromGatewayForGiftCardBalanceInquiryErrorMessage = 'noResponseFromGatewayForGiftCardBalanceInquiryErrorMessage',\n noTenderLoyaltyCardErrorMessage = 'noTenderLoyaltyCardErrorMessage',\n notEnoughRewardPointsErrorMessage = 'notEnoughRewardPointsErrorMessage',\n paymentAlreadyVoidedErrorMessage = 'paymentAlreadyVoidedErrorMessage',\n paymentAmountExceedsGiftBalanceErrorMessage = 'paymentAmountExceedsGiftBalanceErrorMessage',\n paymentRequiresMerchantPropertiesConsoleErrorMessage = 'paymentRequiresMerchantPropertiesConsoleErrorMessage',\n paymentRequiresMerchantPropertiesErrorMessage = 'paymentRequiresMerchantPropertiesErrorMessage',\n paymentUsingUnauthorizedAccountErrorMessage = 'paymentUsingUnauthorizedAccountErrorMessage',\n refundAmountMoreThanAllowedErrorMessage = 'refundAmountMoreThanAllowedErrorMessage',\n unableToAuthorizePaymentCardAdditionalContextRequiredErrorMessage = 'unableToAuthorizePaymentCardAdditionalContextRequiredErrorMessage',\n unableToAuthorizePaymentCardTypeMissingOrNotSupportedErrorMessage = 'unableToAuthorizePaymentCardTypeMissingOrNotSupportedErrorMessage',\n unableToAuthorizePaymentErrorMessage = 'unableToAuthorizePaymentErrorMessage',\n unableToCancelPaymentErrorMessage = 'unableToCancelPaymentErrorMessage',\n unableToReadCardTokenInfoErrorMessage = 'unableToReadCardTokenInfoErrorMessage',\n unableToRetrieveCardPaymentAcceptResultErrorMessage = 'unableToRetrieveCardPaymentAcceptResultErrorMessage'\n}\n\nexport enum ErrorLocation {\n Checkout,\n CheckoutBillingAddress,\n CheckoutCustomerAccountPayment,\n CheckoutDeliveryOptions,\n CheckoutExpress,\n CheckoutGiftCard,\n CheckoutGuestProfile,\n CheckoutLoyalty,\n CheckoutPaymentInstrument,\n CheckoutPickup,\n CheckoutShippingAddress,\n CheckoutTermsAndConditions,\n Console,\n GiftCardBalanceCheck\n}\n\nexport enum CheckoutModule {\n CheckoutBillingAddress = 'checkout-billing-address',\n CheckoutCustomerAccountPayment = 'checkout-customer-account-payment',\n CheckoutDeliveryOptions = 'checkout-delivery-options',\n CheckoutExpress = 'checkout-express',\n CheckoutGiftCard = 'checkout-gift-card',\n CheckoutGuestProfile = 'checkout-guest-profile',\n CheckoutLoyalty = 'checkout-loyalty',\n CheckoutPaymentInstrument = 'checkout-payment-instrument',\n CheckoutPickup = 'checkout-pickup',\n CheckoutShippingAddress = 'checkout-shipping-address',\n CheckoutTermsAndConditions = 'checkout-terms-and-conditions',\n None = 'none'\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 { addCartLinesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport { Cart, CartLine } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\n\nimport { ICartActionResultWithCart } from './cart-action-result';\n\nconst quantityErrors: string[] = [\n 'Microsoft_Dynamics_Commerce_Runtime_AddingItem_ExceedsMaximumQuantity',\n 'Microsoft_Dynamics_Commerce_Runtime_UpdatingItem_ExceedsMaximumQuantity',\n 'Microsoft_Dynamics_Commerce_Runtime_AddingItem_QuantityExceedsMaximumAndViolatesMultiplicityOfConfiguredNumber',\n 'Microsoft_Dynamics_Commerce_Runtime_UpdatingItem_QuantityExceedsMaximumAndViolatesMultiplicityOfConfiguredNumber',\n 'Microsoft_Dynamics_Commerce_Runtime_ItemQuantityLessThanMinimumAndViolatesMultiplicityOfConfiguredNumber',\n 'Microsoft_Dynamics_Commerce_Runtime_ItemQuantityLessThanMinimum',\n 'Microsoft_Dynamics_Commerce_Runtime_ItemQuantityExceedsMaximum',\n 'Microsoft_Dynamics_Commerce_Runtime_ItemQuantityViolatesMultiplicityOfConfiguredNumber'\n];\n\n/**\n * Get the quantity limit.\n * @param maxQuantityForCartLineItem - Max quantity for cart line.\n * @param inputItem - The input item.\n * @param inputItem.cartLineToAdd - Cart line to add.\n * @param inputItem.availableQuantity - Available quantity.\n * @param inputItem.shouldEnableStockCheck - Is stock check enabled.\n * @param inputItem.isAddServiceItemToCart - Is add service item to cart.\n * @returns The quantity limit.\n */\nfunction getQuantityLimit(\n maxQuantityForCartLineItem: number | undefined,\n inputItem: {\n cartLineToAdd: CartLine;\n availableQuantity?: number;\n shouldEnableStockCheck?: boolean;\n isAddServiceItemToCart?: boolean;\n }\n): number {\n let quantityLimit: number;\n const defaultSiteMaxQuantity = 10;\n\n if (inputItem.shouldEnableStockCheck === false) {\n quantityLimit = maxQuantityForCartLineItem ?? defaultSiteMaxQuantity;\n } else if (maxQuantityForCartLineItem === undefined && inputItem.availableQuantity === undefined) {\n quantityLimit = defaultSiteMaxQuantity;\n } else if (inputItem.availableQuantity === undefined) {\n quantityLimit = maxQuantityForCartLineItem ?? defaultSiteMaxQuantity;\n } else if (maxQuantityForCartLineItem === undefined) {\n quantityLimit = inputItem.availableQuantity;\n } else {\n quantityLimit = Math.min(maxQuantityForCartLineItem, inputItem.availableQuantity);\n }\n\n return quantityLimit;\n}\n\n/**\n * Get the index of the item to add.\n * @param lines - The cart lines.\n * @param cartLineToAdd - The cart line to add.\n * @returns The index of the item to add.\n */\nfunction getElementIndex(lines: CartLine[], cartLineToAdd: CartLine): number {\n let elementFoundAt: number = -1;\n const productIdToFind = cartLineToAdd.ProductId;\n\n for (const [index, line] of lines.entries()) {\n if (\n line.ProductId === productIdToFind &&\n (line.DeliveryMode || '') === (cartLineToAdd.DeliveryMode || '') &&\n (line.FulfillmentStoreId || '') === (cartLineToAdd.FulfillmentStoreId || '')\n ) {\n elementFoundAt = index;\n\n break;\n }\n }\n\n return elementFoundAt;\n}\n\nasync function addProductsToCartValidateAgainstDefaultOrderSettings(\n cart: Readonly,\n actionContext: IActionContext,\n input: {\n cartLineToAdd: CartLine;\n availableQuantity?: number;\n enableStockCheck?: boolean;\n isAddServiceItemToCart?: boolean;\n }[]\n): Promise {\n if (!cart.CartLines) {\n return { cart: undefined, status: 'FAILED', substatus: 'EMPTYCART' };\n }\n\n for (const inputItem of input) {\n if (inputItem.enableStockCheck && inputItem.availableQuantity) {\n let elementFoundAt: number = -1;\n const productIdToFind = inputItem.cartLineToAdd.ProductId;\n\n for (let i = 0; i < cart.CartLines.length; i++) {\n if (\n cart.CartLines[i].ProductId === productIdToFind &&\n (cart.CartLines[i].DeliveryMode || '') === (inputItem.cartLineToAdd.DeliveryMode || '') &&\n (cart.CartLines[i].FulfillmentStoreId || '') === (inputItem.cartLineToAdd.FulfillmentStoreId || '')\n ) {\n elementFoundAt = i;\n\n break;\n }\n }\n\n if (!inputItem.isAddServiceItemToCart && elementFoundAt !== -1) {\n const cartLineToUpdate = { ...cart.CartLines[elementFoundAt] };\n const curQuantity = cartLineToUpdate.Quantity || 0;\n\n if (curQuantity + (inputItem.cartLineToAdd.Quantity || 1) > inputItem.availableQuantity) {\n return {\n cart: {\n Id: cart.Id,\n CartLines: cart.CartLines\n },\n status: 'FAILED',\n substatus: 'MAXQUANTITY'\n };\n }\n }\n }\n }\n\n const newCartLines = input.map(inputItem => {\n const cartLine = { ...inputItem.cartLineToAdd };\n return cartLine;\n });\n let addCartLinesResult: ICartActionResultWithCart;\n\n if (cart.Version) {\n return addCartLinesAsync({ callerContext: actionContext }, cart.Id, newCartLines, cart.Version)\n .then(newCart => {\n addCartLinesResult = { cart: newCart, status: 'SUCCESS', substatus: 'PRODUCTADDED' };\n return addCartLinesResult;\n })\n .catch(error => {\n actionContext.telemetry.trace(error);\n actionContext.telemetry.trace('Unable to add Cart Line');\n\n const isQuantityError = quantityErrors.includes(error.name);\n\n if (isQuantityError) {\n addCartLinesResult = {\n cart: undefined,\n status: 'FAILED',\n substatus: 'QUANTITYLIMITS',\n errorDetails: { LocalizedMessage: error.message }\n };\n return addCartLinesResult;\n }\n\n const hasInvoiceInCart = cart.CartLines?.find(cartline => cartline.IsInvoiceLine === true);\n if (hasInvoiceInCart) {\n addCartLinesResult = {\n cart: undefined,\n status: 'FAILED',\n substatus: 'INVOICEINCART',\n errorDetails: { LocalizedMessage: error.message }\n };\n return addCartLinesResult;\n }\n\n addCartLinesResult = {\n cart: undefined,\n status: 'FAILED',\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing error type.\n errorDetails: { LocalizedMessage: error.message },\n validationResults: error.data?.ValidationResults\n };\n\n return addCartLinesResult;\n });\n }\n actionContext.telemetry.warning('Unable to update Cart Line, Cart Version could not be found');\n\n addCartLinesResult = { cart: undefined, status: 'FAILED', substatus: 'NOCARTVERSION' };\n return addCartLinesResult;\n}\n\nasync function addProductsToCartValidateAgainstSiteSettings(\n cart: Readonly,\n actionContext: IActionContext,\n input: {\n cartLineToAdd: CartLine;\n availableQuantity?: number;\n enableStockCheck?: boolean;\n isAddServiceItemToCart?: boolean;\n }[]\n): Promise {\n if (!cart.CartLines) {\n return { cart: undefined, status: 'FAILED', substatus: 'EMPTYCART' };\n }\n\n const maxQuantityForCartLineItem: number | undefined = actionContext.requestContext.app.config.maxQuantityForCartLineItem;\n\n for (const inputItem of input) {\n const quantityLimit: number = getQuantityLimit(maxQuantityForCartLineItem, {\n cartLineToAdd: inputItem.cartLineToAdd,\n availableQuantity: inputItem.availableQuantity,\n shouldEnableStockCheck: inputItem.enableStockCheck,\n isAddServiceItemToCart: inputItem.isAddServiceItemToCart\n });\n const elementFoundAt: number = getElementIndex(cart.CartLines, inputItem.cartLineToAdd);\n\n if (!inputItem.isAddServiceItemToCart && elementFoundAt !== -1) {\n const cartLineToUpdate = { ...cart.CartLines[elementFoundAt] };\n const currentQuantity = cartLineToUpdate.Quantity || 0;\n\n if (currentQuantity + (inputItem.cartLineToAdd.Quantity || 1) > quantityLimit) {\n return {\n cart: {\n Id: cart.Id,\n CartLines: cart.CartLines\n },\n status: 'FAILED',\n substatus: 'MAXQUANTITY'\n };\n }\n }\n\n if (\n !inputItem.isAddServiceItemToCart &&\n inputItem.cartLineToAdd &&\n inputItem.cartLineToAdd.Quantity &&\n inputItem.cartLineToAdd.Quantity > quantityLimit\n ) {\n return {\n cart: {\n Id: cart.Id,\n CartLines: cart.CartLines\n },\n status: 'FAILED',\n substatus: 'MAXQUANTITY'\n };\n }\n }\n\n const newCartLines = input.map(inputItem => {\n const cartLine = { ...inputItem.cartLineToAdd };\n cartLine.Quantity = cartLine.Quantity || 1;\n return cartLine;\n });\n let cartActionResult: ICartActionResultWithCart;\n\n if (cart.Version) {\n return addCartLinesAsync({ callerContext: actionContext }, cart.Id, newCartLines, cart.Version)\n .then(newCart => {\n cartActionResult = { cart: newCart, status: 'SUCCESS', substatus: 'PRODUCTADDED' };\n return cartActionResult;\n })\n .catch(error => {\n actionContext.telemetry.trace(error);\n actionContext.telemetry.trace('Unable to add Cart Line');\n\n const hasInvoiceInCart = cart.CartLines?.find(cartline => cartline.IsInvoiceLine === true);\n if (hasInvoiceInCart) {\n cartActionResult = {\n cart: undefined,\n status: 'FAILED',\n substatus: 'INVOICEINCART',\n errorDetails: { LocalizedMessage: error.message }\n };\n return cartActionResult;\n }\n\n cartActionResult = {\n cart: undefined,\n status: 'FAILED',\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing error type.\n errorDetails: { LocalizedMessage: error.message },\n validationResults: error.data?.ValidationResults\n };\n return cartActionResult;\n });\n }\n actionContext.telemetry.warning('Unable to update Cart Line, Cart Version could not be found');\n\n cartActionResult = { cart: undefined, status: 'FAILED', substatus: 'NOCARTVERSION' };\n return cartActionResult;\n}\n\n/**\n * Add products to cart without site settings validation.\n * @param cart - The cart.\n * @param actionContext - The action context.\n * @param input - The cart lines to add.\n * @returns The results.\n */\nasync function addProductsToCartWithoutSiteSettings(\n cart: Readonly,\n actionContext: IActionContext,\n input: {\n cartLineToAdd: CartLine;\n }[]\n): Promise {\n if (!cart.CartLines) {\n return { cart: undefined, status: 'FAILED', substatus: 'EMPTYCART' };\n }\n\n const defaultQuantity = 1;\n const newCartLines = input.map(inputItem => {\n const cartLine = { ...inputItem.cartLineToAdd };\n cartLine.Quantity = cartLine.Quantity ?? defaultQuantity;\n return cartLine;\n });\n let addCartLinesResult: ICartActionResultWithCart;\n\n if (cart.Version) {\n return addCartLinesAsync({ callerContext: actionContext }, cart.Id, newCartLines, cart.Version)\n .then(newCart => {\n addCartLinesResult = { cart: newCart, status: 'SUCCESS', substatus: 'PRODUCTADDED' };\n return addCartLinesResult;\n })\n .catch(error => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument -- existing error type.\n actionContext.telemetry.trace(error);\n actionContext.telemetry.trace('Unable to add cart lines');\n\n addCartLinesResult = {\n cart: undefined,\n status: 'FAILED',\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing error type.\n errorDetails: { LocalizedMessage: error.message },\n validationResults: error.data?.ValidationResults\n };\n return addCartLinesResult;\n });\n }\n\n actionContext.telemetry.warning('Unable to update cart lines, cart version could not be found');\n\n addCartLinesResult = { cart: undefined, status: 'FAILED', substatus: 'NOCARTVERSION' };\n return addCartLinesResult;\n}\n\nexport async function addProductsToCartInternal(\n cart: Readonly,\n actionContext: IActionContext,\n input: {\n cartLineToAdd: CartLine;\n availableQuantity?: number;\n isStockCheckEnabled?: boolean;\n isAddServiceItemToCart?: boolean;\n }[]\n): Promise {\n return addProductsToCartWithoutSiteSettings(cart, actionContext, input);\n}\n\nexport async function addProductToCartInternal(\n cart: Readonly,\n cartLineToAdd: CartLine,\n actionContext: IActionContext,\n validateOrderQuantityLimits: boolean,\n availableQuantity?: number,\n enableStockCheck?: boolean,\n isAddServiceItemToCart?: boolean,\n shouldSkipSiteSettings?: boolean\n): Promise {\n if (shouldSkipSiteSettings) {\n return addProductsToCartWithoutSiteSettings(cart, actionContext, [{ cartLineToAdd }]);\n }\n\n if (validateOrderQuantityLimits) {\n return addProductsToCartValidateAgainstDefaultOrderSettings(cart, actionContext, [\n { cartLineToAdd, availableQuantity, enableStockCheck, isAddServiceItemToCart }\n ]);\n }\n return addProductsToCartValidateAgainstSiteSettings(cart, actionContext, [\n { cartLineToAdd, availableQuantity, enableStockCheck, isAddServiceItemToCart }\n ]);\n}\n\nexport default addProductToCartInternal;\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 { addDiscountCodeAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport { Cart, Coupon } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\n\nimport { ICartActionResultWithCart } from './cart-action-result';\n\nexport default async function addPromoCode(\n cart: Readonly,\n promoCode: string,\n actionContext: IActionContext\n): Promise {\n if (!cart) {\n return { cart: undefined, status: 'FAILED', substatus: 'EMPTYCART' };\n }\n\n if (hasPromoCode(cart, promoCode)) {\n return { cart: undefined, status: 'FAILED', substatus: 'ALREADYADDED' };\n }\n\n return addDiscountCodeAsync({ callerContext: actionContext }, cart.Id, promoCode)\n .then(newCart => {\n // Retail server will still return success if a promo code is not valid,\n // but it won't actually add that promo code. So need to check if promo\n // code is actually in the new cart\n if (hasPromoCode(newCart, promoCode)) {\n return { cart: newCart, status: 'SUCCESS' };\n }\n return { cart: undefined, status: 'FAILED', substatus: 'INVALIDPROMOCODE' };\n })\n .catch(error => {\n actionContext.telemetry.warning(error);\n const resultWithCart: ICartActionResultWithCart = {\n cart: undefined,\n status: 'FAILED',\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing error type.\n errorDetails: { LocalizedMessage: error.message }\n };\n\n return resultWithCart;\n });\n}\n\nfunction hasPromoCode(cart: Cart, code: string): boolean {\n const codes = cart.Coupons\n ? cart.Coupons.map((coupon: Coupon) => {\n return coupon.Code!.toLowerCase();\n })\n : [];\n return codes.includes(code.toLowerCase());\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 { computed, observable } from 'mobx';\n\nimport { GlobalStateStatus, IGlobalState } from './i-global-state';\n\n/**\n * Base global state that handles common global state behavior that other state can extend from.\n */\nexport class GlobalState implements IGlobalState {\n protected isInitialized: boolean = false;\n\n protected actionContext: IActionContext;\n\n @observable protected _status: GlobalStateStatus;\n\n @computed public get status(): Readonly {\n return this._status;\n }\n\n constructor(actionContext: IActionContext) {\n this.actionContext = actionContext;\n this._status = 'UPDATING';\n }\n\n public async initialize(): Promise {\n this.isInitialized = true;\n this._status = 'READY';\n\n return;\n }\n\n protected async _doAsyncAction(lambda: () => Promise): Promise {\n this._status = 'UPDATING';\n\n return lambda()\n .then(result => {\n this._status = 'READY';\n return result;\n })\n .catch(error => {\n console.log(error);\n this._status = 'ERROR';\n\n return Promise.reject(error);\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 { IActionContext } from '@msdyn365-commerce/core';\nimport { updateCartLinesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport { Cart, CartLine } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\n\nimport { ICartActionResultWithCart } from './cart-action-result';\n\nexport default async function clearCartLineDeliveryMode(\n cart: Readonly,\n cartLineId: string,\n actionContext: IActionContext\n): Promise {\n if (!cart || !cart.CartLines) {\n return { cart: undefined, status: 'FAILED', substatus: 'EMPTYCART' };\n }\n\n const matchingLines = cart.CartLines.filter(cartLine => cartLine.LineId === cartLineId);\n\n if (matchingLines.length === 0) {\n return { cart: undefined, status: 'FAILED', substatus: 'NOMATCHEDCARTLINE' };\n }\n\n const copyCartLine: CartLine = { ...matchingLines[0] };\n\n copyCartLine.DeliveryMode = '';\n copyCartLine.FulfillmentStoreId = '';\n copyCartLine.ShippingAddress = {};\n copyCartLine.WarehouseId = actionContext.requestContext.channel?.InventLocation || cart.WarehouseId;\n\n return updateCartLinesAsync({ callerContext: actionContext }, cart.Id, [copyCartLine], null)\n .then(newCart => {\n return { cart: newCart, status: 'SUCCESS' };\n })\n .catch(error => {\n actionContext.telemetry.warning(error);\n actionContext.telemetry.debug('Unable to Update Cart Line');\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing error type.\n return { cart: undefined, status: 'FAILED', errorDetails: { LocalizedMessage: error.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 { IActionContext } from '@msdyn365-commerce/core';\nimport { updateCartLinesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport { Cart, CartLine, ChannelDeliveryOptionConfiguration } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { cloneDeep } from 'lodash';\n\nimport { ICartActionResultWithCart } from './cart-action-result';\n\nexport default async function clearCartLinesDeliveryInformation(\n cart: Readonly,\n actionContext: IActionContext,\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration\n): Promise {\n if (!cart || !cart.CartLines) {\n return { cart: undefined, status: 'FAILED', substatus: 'EMPTYCART' };\n }\n let matchingLines: CartLine[] = [];\n const pickupDeliveryModeCode =\n actionContext && actionContext.requestContext && actionContext.requestContext.channel?.PickupDeliveryModeCode;\n const emailDeliveryModeCode =\n actionContext && actionContext.requestContext && actionContext.requestContext.channel?.EmailDeliveryModeCode;\n if (channelDeliveryOptionConfig !== undefined) {\n matchingLines = cart.CartLines.filter(\n cartLine =>\n cartLine.DeliveryMode &&\n cartLine.DeliveryMode !== channelDeliveryOptionConfig.PickupDeliveryModeCodes?.find(dM => dM === cartLine.DeliveryMode) &&\n cartLine.DeliveryMode !== emailDeliveryModeCode &&\n cartLine.LineId\n );\n } else {\n matchingLines = cart.CartLines.filter(\n cartLine =>\n cartLine.DeliveryMode &&\n cartLine.DeliveryMode !== pickupDeliveryModeCode &&\n cartLine.DeliveryMode !== emailDeliveryModeCode &&\n cartLine.LineId\n );\n }\n\n // If there are no lines needing updates, just return success\n if (matchingLines.length === 0) {\n return { cart, status: 'SUCCESS' };\n }\n\n const copiedLines: CartLine[] = cloneDeep(matchingLines);\n\n copiedLines.forEach(line => {\n line.DeliveryMode = '';\n line.FulfillmentStoreId = '';\n line.ShippingAddress = {};\n });\n\n return updateCartLinesAsync({ callerContext: actionContext }, cart.Id, copiedLines, null)\n .then(newCart => {\n return { cart: newCart, status: 'SUCCESS' };\n })\n .catch((error: string) => {\n actionContext.telemetry.warning(error);\n actionContext.telemetry.debug('Unable to Update Cart Lines');\n\n return { cart: undefined, status: 'FAILED', errorDetails: { LocalizedMessage: error } };\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 { FeatureState, LoyaltyCardTenderType } from '@msdyn365-commerce/retail-proxy';\nimport {\n addCartLinesAsync,\n addCouponsAsync,\n createCartAsync,\n readAsync,\n removeCartLinesAsync,\n searchAsync,\n updateAsync\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport {\n getChannelDeliveryOptionConfigurationAsync,\n getCustomerLoyaltyCardsAsync,\n getFeatureStatesAsync\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\nimport {\n Cart,\n CartLine,\n CartSearchCriteria,\n Coupon,\n QueryResultSettings\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport isEmpty from 'lodash/isEmpty';\n\nenum CartTokenPrefix {\n Auth = 't',\n Anon = 'p'\n}\n\nexport default async function getOrCreateActiveCart(ctx: IActionContext): Promise {\n let cart: Cart | undefined;\n const cartCookie: string = ctx.requestContext.cookies.getCartCookie();\n const cartCookieParts: string[] = cartCookie.split(':');\n try {\n // Check if there are already is a cart cookie and it is in the format we understand\n cart = await getCartFromCookie(cartCookieParts, ctx);\n const wasReadFromCookie = !!cart && cart.Id;\n\n // If the customer is authenticated, and the auth cookie didn't give us a cart OR doesn't have a cookie, search for the customer's cart\n if (!(cart && cart.Id)) {\n cart = await getCartFromCustomer(ctx);\n }\n\n // If the customer just went from anon to signed in state then get that anon cart\n // if the search of carts didn't result in a cart, claim the current anon cart as a new auth cart for the customer\n // if the search resulted in a cart, and the read also resulted in cart, then go ahead an merge the carts\n const anonCart = await claimAnonCart(cartCookieParts, cart, ctx);\n if (anonCart) {\n cart = anonCart;\n }\n\n // If there is no cookie or everything else fails, create an empty cart and return that for the customer\n if (!(cart && cart.Id)) {\n cart = await createNewCart(ctx);\n }\n if (!wasReadFromCookie && ctx.requestContext.user.isAuthenticated && cart && !cart.LoyaltyCardId) {\n const cards = await getCustomerLoyaltyCardsAsync({ callerContext: ctx, queryResultSettings: {} }, null, {\n ChannelId: cart.ChannelId\n });\n if (cards && cards.length > 0) {\n const noneBlockingCards = cards.filter(card => card.CardTenderTypeValue !== LoyaltyCardTenderType.Blocked);\n if (noneBlockingCards && noneBlockingCards.length > 0) {\n cart = await updateAsync(\n { callerContext: ctx },\n {\n Id: cart.Id,\n LoyaltyCardId: noneBlockingCards[0].CardNumber\n }\n );\n }\n }\n }\n } catch (error) {\n ctx.telemetry.error(`Caught exception in getting cart: ${error}`);\n console.log('Error getting cart', error);\n cart = await createNewCart(ctx);\n }\n return cart;\n}\n\n/**\n * Function to check cart exception due to product no available\n *\n * @param ctx Request context.\n * @param errorObj Error Object.\n */\nfunction handleItemDiscontinuedException(ctx: IActionContext, errorObj: object): boolean {\n const error = errorObj as Error;\n let response = false;\n if (error && error.name === 'Microsoft_Dynamics_Commerce_Runtime_ItemDiscontinuedFromChannel') {\n ctx.telemetry.information('Caught cart ItemDiscontinuedException error.');\n response = true;\n }\n\n return response;\n}\n\nexport async function createNewCart(ctx: IActionContext): Promise {\n const newCart = await createCartAsync({ callerContext: ctx }, {});\n if (newCart && newCart.Id) {\n ctx.requestContext.cookies.setCartCookie(newCart, ctx.requestContext.user.isAuthenticated);\n\n return newCart;\n }\n\n return undefined;\n}\n\nexport async function getCartFromCookie(cartCookieParts: string[], ctx: IActionContext): Promise {\n let readCart: Cart | undefined;\n let readCartId: string = '';\n\n const isAuthenticated = ctx.requestContext.user.isAuthenticated;\n if (cartCookieParts && cartCookieParts.length === 2) {\n // If the customer is authenticated and they have an auth cookie\n // OR if the customer is not authenticated and then have an anon cookie\n // just get the cart and return that\n\n if (\n (isAuthenticated && cartCookieParts[0] === CartTokenPrefix.Auth) ||\n (!isAuthenticated && cartCookieParts[0] === CartTokenPrefix.Anon)\n ) {\n try {\n readCartId = cartCookieParts[1];\n const readCart = await readAsync({ callerContext: ctx, bypassCache: 'none' }, cartCookieParts[1]);\n\n if (readCart && readCart.Id) {\n ctx.requestContext.cookies.setCartCookie(readCart, ctx.requestContext.user.isAuthenticated);\n return readCart;\n }\n } catch (error) {\n if (handleItemDiscontinuedException(ctx, error)) {\n readCart = await readAsync({ callerContext: ctx, bypassCache: 'none' }, readCartId);\n }\n ctx.telemetry.error('Error getting cart based on saved card id');\n ctx.telemetry.exception(error);\n console.log('Error getting cart', error);\n }\n }\n }\n\n return readCart;\n}\n\nexport async function getCartFromCustomer(ctx: IActionContext): Promise {\n if (ctx.requestContext.user.isAuthenticated) {\n try {\n const authCarts = await searchCarts(ctx);\n if (authCarts && authCarts.length > 0) {\n ctx.requestContext.cookies.setCartCookie(authCarts[0], ctx.requestContext.user.isAuthenticated);\n return authCarts[0];\n }\n } catch (error) {\n ctx.telemetry.error('Error getting cart based on customer');\n ctx.telemetry.exception(error);\n console.log('Error getting cart', error);\n }\n }\n\n return undefined;\n}\n\nexport async function claimAnonCart(\n cartCookieParts: string[],\n currentCart: Cart | undefined,\n ctx: IActionContext\n): Promise {\n let anonCurrentCart: Cart | undefined;\n\n if (\n ctx.requestContext.user.isAuthenticated &&\n cartCookieParts &&\n cartCookieParts.length === 2 &&\n cartCookieParts[0] === CartTokenPrefix.Anon\n ) {\n try {\n anonCurrentCart = await readAsync({ callerContext: ctx, bypassCache: 'none' }, cartCookieParts[1]);\n } catch (error) {\n if (handleItemDiscontinuedException(ctx, error)) {\n anonCurrentCart = await readAsync({ callerContext: ctx, bypassCache: 'none' }, cartCookieParts[1]);\n console.log('Error getting anonymous cart', error);\n }\n }\n\n if (anonCurrentCart && !currentCart) {\n const newCart = await claimCart(anonCurrentCart.Id, ctx);\n if (newCart && newCart.Id) {\n ctx.requestContext.cookies.setCartCookie(newCart, ctx.requestContext.user.isAuthenticated);\n return newCart;\n }\n }\n\n if (anonCurrentCart && anonCurrentCart.Id && currentCart) {\n const mergedCart = await addCartLines(anonCurrentCart, currentCart, ctx);\n\n // Once updated, take that merged cart ID and store the cart ID in the cookie\n if (!(mergedCart instanceof Error) && mergedCart.Id) {\n ctx.requestContext.cookies.setCartCookie(mergedCart, ctx.requestContext.user.isAuthenticated);\n return mergedCart;\n }\n }\n }\n\n return undefined;\n}\n\n/**\n * Function that copies a cartline for giftcard.\n * @param cartline Source CartLine you want to copy.\n */\nfunction buildGiftCardLine(cartline: CartLine): CartLine {\n return {\n DeliveryMode: cartline.DeliveryMode,\n CatalogId: cartline.CatalogId,\n Description: cartline.Description,\n EntryMethodTypeValue: cartline.EntryMethodTypeValue || 3,\n ItemId: cartline.ItemId,\n ProductId: cartline.ProductId,\n Quantity: cartline.Quantity,\n Price: cartline.Price,\n NetPrice: cartline.NetPrice,\n GiftCardBalance: cartline.GiftCardBalance,\n TrackingId: '',\n UnitOfMeasureSymbol: cartline.UnitOfMeasureSymbol,\n IsPriceKeyedIn: true,\n IsGiftCardLine: true,\n ExtensionProperties: cartline.ExtensionProperties\n };\n}\n\n/**\n * Function that adds cart lines from source cart to destination cart.\n * @param sourceCart Source cart you want to add cart lines from.\n * @param destinationCart Destination cart that you want to add cart lines to.\n * @param ctx Request context.\n */\nexport async function addCartLines(sourceCart: Cart, destinationCart: Cart, ctx: IActionContext): Promise {\n let updatedCart;\n const cartLines: CartLine[] = [];\n const cartLinesToDelete: string[] = [];\n let hasShippingMethod: boolean;\n const channelConfiguration = ctx.requestContext.channel;\n const featureNames: string[] = ['Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature'];\n if (destinationCart.Version) {\n if (sourceCart.CartLines && sourceCart.CartLines.length > 0) {\n for (const cartline of sourceCart.CartLines) {\n let newCartLine: CartLine;\n\n if (cartline.IsGiftCardLine) {\n newCartLine = buildGiftCardLine(cartline);\n } else {\n newCartLine = {};\n const featureStates = await getFeatureStatesAsync({ callerContext: ctx }, featureNames);\n const isfeatureStatesEnabled =\n featureStates?.find(\n (featureState: FeatureState) =>\n featureState.Name === 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature'\n )?.IsEnabled || false;\n if (isfeatureStatesEnabled) {\n const channelDeliveryOptionConfig = await getChannelDeliveryOptionConfigurationAsync({ callerContext: ctx });\n hasShippingMethod =\n cartline.DeliveryMode ===\n channelDeliveryOptionConfig.PickupDeliveryModeCodes?.find(\n (deliveryMode: string) => deliveryMode === cartline.DeliveryMode\n );\n\n if (cartline.DeliveryMode !== undefined && hasShippingMethod) {\n newCartLine.DeliveryMode = cartline.DeliveryMode;\n newCartLine.FulfillmentStoreId = cartline.FulfillmentStoreId;\n newCartLine.ShippingAddress = cartline.ShippingAddress;\n newCartLine.WarehouseId = cartline.WarehouseId;\n }\n } else if (!isEmpty(cartline.DeliveryMode) && cartline.DeliveryMode === channelConfiguration?.PickupDeliveryModeCode) {\n newCartLine.DeliveryMode = channelConfiguration?.PickupDeliveryModeCode;\n newCartLine.FulfillmentStoreId = cartline.FulfillmentStoreId;\n newCartLine.ShippingAddress = cartline.ShippingAddress;\n newCartLine.WarehouseId = cartline.WarehouseId;\n }\n newCartLine.ProductId = cartline.ProductId;\n newCartLine.Quantity = cartline.Quantity;\n newCartLine.ExtensionProperties = cartline.ExtensionProperties;\n newCartLine.Description = cartline.Description;\n newCartLine.ReasonCodeLines = cartline.ReasonCodeLines;\n newCartLine.AttributeValues = cartline.AttributeValues;\n newCartLine.CatalogId = cartline.CatalogId;\n newCartLine.EntryMethodTypeValue = cartline.EntryMethodTypeValue;\n newCartLine.ItemId = cartline.ItemId;\n if (cartline.DeliveryMode !== undefined && cartline.DeliveryMode !== '') {\n newCartLine.DeliveryMode = cartline.DeliveryMode;\n }\n\n // without unitofmeasure cartline wont be aggregated in customer cart.\n newCartLine.UnitOfMeasureSymbol = cartline.UnitOfMeasureSymbol;\n if (cartline.IsPriceKeyedIn) {\n newCartLine.Price = cartline.Price;\n newCartLine.IsPriceKeyedIn = cartline.IsPriceKeyedIn;\n }\n }\n\n cartLines.push({ ...newCartLine });\n if (cartline.LineId) {\n cartLinesToDelete.push(cartline.LineId);\n }\n }\n }\n\n if (cartLines.length > 0) {\n try {\n updatedCart = await addCartLinesAsync({ callerContext: ctx }, destinationCart.Id, cartLines, destinationCart.Version);\n\n if (cartLinesToDelete.length > 0) {\n sourceCart = await removeCartLinesAsync({ callerContext: ctx }, sourceCart.Id, cartLinesToDelete);\n }\n } catch (error) {\n ctx.telemetry.error('Error adding cart lines to desination cart');\n ctx.telemetry.exception(error);\n return destinationCart;\n }\n }\n\n // Copy over coupon codes from source cart to destination cart so that the customer doesn't lose couponCodes while migration\n if (sourceCart.Coupons && sourceCart.Coupons.length > 0) {\n const coupons = sourceCart.Coupons.map((coupon: Coupon) => {\n return coupon.Code!;\n });\n\n try {\n updatedCart = await addCouponsAsync({ callerContext: ctx }, destinationCart.Id, coupons, false);\n } catch (error) {\n ctx.telemetry.error('Error adding existing coupon codes to the cart');\n ctx.telemetry.exception(error);\n return destinationCart;\n }\n }\n }\n\n return updatedCart || destinationCart;\n}\n\n/**\n * Function to claim a cart as auth cart and set the browser cookie accordingly.\n *\n * @param cartId Cart Id to claim as auth cart.\n * @param ctx Request Context.\n */\nexport async function claimCart(cartId: string, ctx: IActionContext): Promise {\n const claimAuthCart = await updateAsync(\n { callerContext: ctx },\n {\n Id: cartId\n }\n );\n if (!(claimAuthCart instanceof Error) && claimAuthCart && claimAuthCart.Id) {\n return claimAuthCart;\n }\n console.log('Error claiming cart', claimAuthCart);\n return {};\n}\n\n/**\n * Function to search carts that belong to a customer.\n *\n * @param ctx Request context.\n */\nexport async function searchCarts(ctx: IActionContext): Promise {\n const cartSearchCriteria: CartSearchCriteria = {\n IncludeAnonymous: false,\n CartTypeValue: 1\n };\n\n const queryResultSettings: QueryResultSettings = {\n Paging: {\n Top: 1,\n Skip: 0\n },\n Sorting: {\n Columns: [\n {\n ColumnName: 'ModifiedDateTime',\n IsDescending: true\n }\n ]\n }\n };\n\n return searchAsync({ callerContext: ctx, queryResultSettings }, cartSearchCriteria);\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 { readAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport { Cart } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\n\nexport default async function refreshCart(cartId: string, ctx: IActionContext): Promise {\n return readAsync({ callerContext: ctx, bypassCache: 'get' }, cartId)\n .then(cart => {\n return cart;\n })\n .catch(error => {\n return 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 { removeDiscountCodesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport { Cart } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\n\nimport { ICartActionResultWithCart } from './cart-action-result';\n\nexport default async function removeAllPromoCodes(\n cart: Readonly,\n actionContext: IActionContext\n): Promise {\n if (!cart) {\n return { cart: undefined, status: 'FAILED', substatus: 'EMPTYCART' };\n }\n\n if (cart.Coupons && cart.Coupons.length > 0) {\n const promoCodes = cart.Coupons.map(coupon => {\n return coupon.Code || '';\n });\n\n return removeDiscountCodesAsync({ callerContext: actionContext }, cart.Id, promoCodes)\n .then(newCart => {\n return { cart: newCart, status: 'SUCCESS' };\n })\n .catch(error => {\n actionContext.telemetry.warning(error);\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing error type.\n return { cart: undefined, status: 'FAILED', errorDetails: { LocalizedMessage: error.message } };\n });\n }\n\n return { cart, status: 'SUCCESS' };\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 { removeCartLinesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport { Cart } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\n\nimport { ICartActionResultWithCart } from './cart-action-result';\n\nexport default async function removeCartLinesInternal(\n cart: Readonly,\n cartLineIds: string[],\n actionContext: IActionContext\n): Promise {\n if (!cart) {\n return { cart: undefined, status: 'FAILED', substatus: 'EMPTYCART' };\n }\n\n return removeCartLinesAsync({ callerContext: actionContext }, cart.Id, cartLineIds)\n .then(newCart => {\n // This is because of a TSProxy typing error\n const returnedCart = Array.isArray(newCart) ? newCart[0] : newCart;\n\n return { cart: returnedCart, status: 'SUCCESS' };\n })\n .catch(error => {\n actionContext.telemetry.warning(error);\n actionContext.telemetry.debug('Unable to Remove Cart Line');\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing error type.\n return { cart: undefined, status: 'FAILED', errorDetails: { LocalizedMessage: error.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 { IActionContext } from '@msdyn365-commerce/core';\nimport { removeDiscountCodesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport { Cart } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\n\nimport { ICartActionResultWithCart } from './cart-action-result';\n\nexport default async function removePromoCodes(\n cart: Readonly,\n promoCodes: string[],\n actionContext: IActionContext\n): Promise {\n if (!cart) {\n return { cart: undefined, status: 'FAILED', substatus: 'EMPTYCART' };\n }\n\n return removeDiscountCodesAsync({ callerContext: actionContext }, cart.Id, promoCodes)\n .then(newCart => {\n return { cart: newCart, status: 'SUCCESS' };\n })\n .catch(error => {\n actionContext.telemetry.warning(error);\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing error type.\n return { cart: undefined, status: 'FAILED', errorDetails: { LocalizedMessage: error.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 { IActionContext } from '@msdyn365-commerce/core';\nimport { Cart, CartsDataActions } from '@msdyn365-commerce/retail-proxy';\n\nimport { ICartActionResultWithCart } from './cart-action-result';\n\n/**\n * Sets price for the given cart line with an invoice. Used to complete partial invoice payments.\n * @param cart - Cart where the invoice is located.\n * @param cartLineId - The cart line with the invoice for which to update the price.\n * @param price - The new value of price of the invoice.\n * @param actionContext - The action context from SDK.\n * @returns Result of the operation with the details.\n */\nexport async function setInvoiceLinePriceInternal(\n cart: Readonly,\n cartLineId: string | null,\n price: number,\n actionContext: IActionContext\n): Promise {\n if (!cart.Version) {\n actionContext.telemetry.warning('Unable to set invoice line price, Cart Version could not be found');\n return { cart: undefined, status: 'FAILED', substatus: 'NOCARTVERSION' };\n }\n\n try {\n const newCart = await CartsDataActions.setInvoiceLinePriceAsync(\n { callerContext: actionContext },\n cart.Id,\n cartLineId,\n price,\n cart.Version\n );\n return { cart: newCart, status: 'SUCCESS' };\n } catch (error) {\n const errorInstance = error as Error;\n actionContext.telemetry.trace(error as string);\n actionContext.telemetry.trace('Unable to set invoice line price');\n\n return {\n cart: undefined,\n status: 'FAILED',\n errorDetails: { LocalizedMessage: errorInstance.message }\n };\n }\n}\n\nexport default setInvoiceLinePriceInternal;\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 { updateAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport { Cart } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\n\nimport { ICartActionResultWithCart } from './cart-action-result';\n\nexport default async function updateCart(\n cart: Readonly,\n updatedCartObject: Cart,\n actionContext: IActionContext\n): Promise {\n if (!cart) {\n return { cart: undefined, status: 'FAILED', substatus: 'EMPTYCART' };\n }\n\n return updateAsync({ callerContext: actionContext }, { ...updatedCartObject, Id: cart.Id })\n .then(newCart => {\n return { cart: newCart, status: 'SUCCESS' };\n })\n .catch(error => {\n actionContext.telemetry.warning(error);\n actionContext.telemetry.debug('Unable to update the cart');\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing error type.\n return { cart: undefined, status: 'FAILED', errorDetails: { LocalizedMessage: error.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 { IActionContext } from '@msdyn365-commerce/core';\nimport { updateLineDeliverySpecificationsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport { Cart, LineDeliverySpecification } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\n\nimport { ICartActionResultWithCart } from './cart-action-result';\n\nexport default async function updateCartLineDeliverySpecificationsInternal(\n cart: Readonly,\n cartLineDeliverySpecifications: LineDeliverySpecification[],\n actionContext: IActionContext\n): Promise {\n if (!cart || !cart.CartLines || cartLineDeliverySpecifications.length === 0) {\n return { cart: undefined, status: 'FAILED', substatus: 'EMPTYCART' };\n }\n\n return updateLineDeliverySpecificationsAsync({ callerContext: actionContext }, cart.Id, cartLineDeliverySpecifications)\n .then(newCart => {\n return { cart: newCart, status: 'SUCCESS' };\n })\n .catch(error => {\n actionContext.telemetry.warning(error);\n actionContext.telemetry.debug('Unable to updateLineDeliverySpecificationsAsync');\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing error type.\n return { cart: undefined, status: 'FAILED', errorDetails: { LocalizedMessage: error.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 { IActionContext } from '@msdyn365-commerce/core';\nimport { updateCartLinesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport { Cart, CartLine } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\n\nimport { ICartActionResultWithCart } from './cart-action-result';\n\nexport default async function updateCartLineQuantityInternal(\n cart: Readonly,\n cartLineId: string,\n newQuantity: number,\n actionContext: IActionContext,\n isUsingDefaultOrderSettingsMax: boolean\n): Promise {\n if (isUsingDefaultOrderSettingsMax) {\n return updateCartLineQuantityValidateMaxAgainstDefaultOrderSettings(cart, cartLineId, newQuantity, actionContext);\n }\n return updateCartLineQuantityValidateMaxAgainstSiteSettings(cart, cartLineId, newQuantity, actionContext);\n}\nasync function updateCartLineQuantityValidateMaxAgainstDefaultOrderSettings(\n cart: Readonly,\n cartLineId: string,\n newQuantity: number,\n actionContext: IActionContext\n): Promise {\n if (!cart || !cart.CartLines) {\n return { cart: undefined, status: 'FAILED', substatus: 'EMPTYCART' };\n }\n\n const matchingLines = cart.CartLines.filter(cartLine => cartLine.LineId === cartLineId);\n\n if (matchingLines.length === 0) {\n return { cart: undefined, status: 'FAILED', substatus: 'NOMATCHEDCARTLINE' };\n }\n\n const copyCartLine: CartLine = { ...matchingLines[0] };\n\n copyCartLine.Quantity = newQuantity;\n\n return updateCartLinesAsync({ callerContext: actionContext }, cart.Id, [copyCartLine], null)\n .then(newCart => {\n return { cart: newCart, status: 'SUCCESS' };\n })\n .catch(error => {\n let cartActionResult: ICartActionResultWithCart;\n\n actionContext.telemetry.warning(error);\n actionContext.telemetry.debug('Unable to Update Cart Line');\n if (\n error.name === 'Microsoft_Dynamics_Commerce_Runtime_AddingItem_ExceedsMaximumQuantity' ||\n error.name === 'Microsoft_Dynamics_Commerce_Runtime_UpdatingItem_ExceedsMaximumQuantity'\n ) {\n cartActionResult = {\n cart: undefined,\n status: 'FAILED',\n substatus: 'QUANTITYLIMITS',\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing error type.\n errorDetails: { LocalizedMessage: error.message },\n validationResults: error.data?.ValidationResults\n };\n return cartActionResult;\n }\n\n cartActionResult = {\n cart: undefined,\n status: 'FAILED',\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing error type.\n errorDetails: { LocalizedMessage: error.message },\n validationResults: error.data?.ValidationResults\n };\n return cartActionResult;\n });\n}\n\nasync function updateCartLineQuantityValidateMaxAgainstSiteSettings(\n cart: Readonly,\n cartLineId: string,\n newQuantity: number,\n actionContext: IActionContext\n): Promise {\n if (!cart || !cart.CartLines) {\n return { cart: undefined, status: 'FAILED', substatus: 'EMPTYCART' };\n }\n\n const matchingLines = cart.CartLines.filter(cartLine => cartLine.LineId === cartLineId);\n\n if (matchingLines.length === 0) {\n return { cart: undefined, status: 'FAILED', substatus: 'NOMATCHEDCARTLINE' };\n }\n\n const copyCartLine: CartLine = { ...matchingLines[0] };\n copyCartLine.Quantity = Math.min(newQuantity, actionContext.requestContext.app.config.maxQuantityForCartLineItem || 10);\n\n return updateCartLinesAsync({ callerContext: actionContext }, cart.Id, [copyCartLine], null)\n .then(newCart => {\n return { cart: newCart, status: 'SUCCESS' };\n })\n .catch(error => {\n actionContext.telemetry.warning(error);\n actionContext.telemetry.debug('Unable to Update Cart Line');\n return {\n cart: undefined,\n status: 'FAILED',\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing error type.\n errorDetails: { LocalizedMessage: error.message },\n validationResults: error.data?.ValidationResults\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 { IActionContext } from '@msdyn365-commerce/core';\nimport { updateAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport { Cart } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\n\nimport { ICartActionResultWithCart } from './cart-action-result';\n\nexport default async function updateLoyaltyCardId(\n cart: Readonly,\n newLoyaltyCardId: string,\n actionContext: IActionContext\n): Promise {\n if (!cart) {\n return { cart: undefined, status: 'FAILED', substatus: 'EMPTYCART' };\n }\n\n return updateAsync(\n { callerContext: actionContext },\n {\n Id: cart.Id,\n LoyaltyCardId: newLoyaltyCardId\n }\n )\n .then(newCart => {\n return { cart: newCart, status: 'SUCCESS' };\n })\n .catch(error => {\n actionContext.telemetry.warning(error);\n actionContext.telemetry.debug('Unable to update loyalty card id');\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing error type.\n return { cart: undefined, status: 'FAILED', errorDetails: { LocalizedMessage: error.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 { IActionContext } from '@msdyn365-commerce/core';\nimport { Address, Cart, CartsDataActions } from '@msdyn365-commerce/retail-proxy';\n\nimport { ICartActionResultWithCart } from './cart-action-result';\n\n/**\n * Update shipping address in cart.\n * @param cart - The cart object.\n * @param shippingAddress - The new shipping address.\n * @param actionContext - The action context.\n * @returns The updated cart with new shipping address.\n */\nexport async function updateShippingAddress(\n cart: Readonly,\n shippingAddress: Address,\n actionContext: IActionContext\n): Promise {\n if (!cart) {\n return { cart: undefined, status: 'FAILED', substatus: 'EMPTYCART' };\n }\n\n return CartsDataActions.updateAsync(\n { callerContext: actionContext },\n {\n Id: cart.Id,\n ShippingAddress: shippingAddress\n }\n )\n .then(newCart => {\n const result: ICartActionResultWithCart = { cart: newCart, status: 'SUCCESS' };\n return result;\n })\n .catch(error => {\n actionContext.telemetry.warning(error);\n actionContext.telemetry.debug('Unable to update shipping address to the cart');\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing error type.\n return { cart: undefined, status: 'FAILED', errorDetails: { LocalizedMessage: error.message } };\n });\n}\n\nexport default updateShippingAddress;\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 { updateCartLinesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport { Cart, CartLine } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\n\nimport { ICartActionResultWithCart } from './cart-action-result';\n\nexport default async function updateCartLinesInternal(\n cart: Readonly,\n cartLinesToUpdate: CartLine[],\n actionContext: IActionContext\n): Promise {\n if (!cart || !cart.CartLines) {\n return { cart: undefined, status: 'FAILED', substatus: 'EMPTYCART' };\n }\n\n return updateCartLinesAsync({ callerContext: actionContext }, cart.Id, cartLinesToUpdate, null)\n .then(newCart => {\n return { cart: newCart, status: 'SUCCESS' };\n })\n .catch((error: string) => {\n actionContext.telemetry.warning(error);\n actionContext.telemetry.debug('Unable to Update Cart Lines');\n\n return { cart: undefined, status: 'FAILED', errorDetails: { LocalizedMessage: error } };\n });\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { BaseCartState } from '../cart-state/base-cart-state';\nimport getCheckoutCart, { GetCheckoutCartInput } from '../data-actions/get-checkout-cart';\n\n/**\n * Version of BaseCartState that uses the checkout cart.\n */\nexport class BaseCheckoutCartState extends BaseCartState {\n public async initialize(): Promise {\n if (this.isInitialized) {\n return;\n }\n\n const newCart = await getCheckoutCart(new GetCheckoutCartInput(this.actionContext.requestContext.apiSettings), this.actionContext);\n\n if (newCart) {\n this._cart = newCart;\n this._status = 'READY';\n } else {\n this._status = 'ERROR';\n }\n\n this.isInitialized = true;\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 CacheType,\n createObservableDataAction,\n IAction,\n IActionContext,\n IActionInput,\n ICommerceApiSettings,\n ICreateActionContext\n} from '@msdyn365-commerce/core';\nimport { Cart } from '@msdyn365-commerce/retail-proxy';\nimport { copyAsync, readAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\n\nimport { getCartState } from './get-cart-state';\n\n/**\n * Input class for getCheckoutCart data action.\n */\nexport class GetCheckoutCartInput implements IActionInput {\n private readonly apiSettings: ICommerceApiSettings;\n\n constructor(apiSettings: ICommerceApiSettings) {\n this.apiSettings = apiSettings;\n }\n\n public getCacheKey = () => `CheckoutCart-ChannelId:${this.apiSettings.channelId}-ApiSettingsCatalogId:${this.apiSettings.catalogId}`;\n\n public getCacheObjectType = () => 'CheckoutCart';\n\n public dataCacheType = (): CacheType => 'request';\n}\n\nenum CartTokenPrefix {\n Auth = 't',\n Anon = 'p'\n}\n\nconst createInput = (inputData: ICreateActionContext) => {\n return new GetCheckoutCartInput(inputData.requestContext.apiSettings);\n};\n\n/**\n * Data action to copy the cart for checkout actions.\n * @param input\n * @param ctx\n */\nexport async function getCheckoutCart(input: GetCheckoutCartInput, ctx: IActionContext): Promise {\n const savedCheckoutCartId = ctx.requestContext.cookies.getCheckoutCartCookie();\n const cartCookieParts: string[] = savedCheckoutCartId.split(':');\n let checkoutCartId = null;\n const isAuthenticated = ctx.requestContext.user.isAuthenticated;\n\n if (\n (isAuthenticated && cartCookieParts[0] === CartTokenPrefix.Auth) ||\n (!isAuthenticated && cartCookieParts[0] === CartTokenPrefix.Anon)\n ) {\n checkoutCartId = cartCookieParts[1];\n }\n\n let checkoutCart: Cart | undefined;\n\n if (checkoutCartId) {\n try {\n checkoutCart = await readAsync({ callerContext: ctx, bypassCache: 'none' }, checkoutCartId);\n } catch (error) {\n ctx.telemetry.error('Error getting checkout cart based on saved checkout card id');\n ctx.telemetry.exception(error);\n }\n }\n\n const cartState = await getCartState(ctx);\n if (cartState && cartState.cart.Id !== undefined) {\n if (checkoutCart && checkoutCart.Version && cartState.cart.Version && checkoutCart.Version > cartState.cart.Version) {\n return Promise.resolve(checkoutCart);\n }\n\n return copyAsync({ callerContext: ctx }, cartState.cart.Id, 2)\n .then(cart => {\n ctx.requestContext.cookies.setCheckoutCartCookie(cart, isAuthenticated);\n return cart;\n })\n .catch(error => {\n ctx.telemetry.error('Error copying cart');\n ctx.telemetry.exception(error);\n return undefined;\n });\n }\n\n return undefined;\n}\n\nexport const getCheckoutCartDataAction = createObservableDataAction({\n id: '@msdyn365-commerce/global-state/get-checkout-cart',\n action: >getCheckoutCart,\n input: createInput\n});\n\nexport default getCheckoutCartDataAction;\n"],"names":["msdyn365Commerce","GlobalStateInput","constructor","key","stateConstructor","apiSettings","requestContext","getCacheKey","_this$catalogId","this","channelId","catalogId","getCacheObjectType","dataCacheType","getCatalogId","async","getState","input","ctx","globalStateObject","createGlobalState","initialize","createGlobalStateDataAction","createObservableDataAction","action","args","BaseCartState","GlobalState","actionContext","super","_operationQueue","Promise","resolve","_cart","_attributeValues","_extensionProperties","_isProductAddedToCart","CartLines","map","cartLine","Quantity","reduce","total","num","length","some","cartline","IsInvoiceLine","_doAsyncAction","newCart","refreshCartInternal","cart","Id","status","_input$catalogId","_input$additionalProp","CatalogId","Description","product","EntryMethodTypeValue","ItemId","ProductId","RecordId","count","TrackingId","UnitOfMeasureSymbol","DefaultUnitOfMeasure","IsPriceKeyedIn","isPriceKeyedIn","IsGiftCardLine","IsGiftCard","Price","customPrice","location","channel","undefined","deliveryMode","DeliveryMode","retailMultiplePickupModeEnabled","PickupDeliveryModeCode","FulfillmentStoreId","OrgUnitNumber","WarehouseId","InventoryLocationId","ShippingAddress","_buildAddressFromOrgUnitLocation","isAddEmailDeliveryItemToCart","EmailDeliveryModeCode","isAddServiceItemToCart","ItemTypeValue","ReleasedProductType","Service","validateQuantity","additionalProperties","_doCartOperationWithRetry","addProductToCartInternal","availableQuantity","enableStockCheck","shouldSkipSiteSettings","internalInput","inputItem","_inputItem$catalogId","_this$actionContext$r","PRODUCTASSERVICE","push","cartLineToAdd","isStockCheckEnabled","addProductsToCartInternal","invoiceIds","Version","CartsDataActions","callerContext","then","catch","error","telemetry","trace","errorDetails","data","warning","substatus","addInvoicesToCartInternal","invoiceId","lineDescription","addOrderInvoiceAsync","LocalizedMessage","message","addOrderInvoiceToCartInternal","setInvoiceLinePriceInternal","cartLineId","price","removeCartLineInternal","cartLineIds","clearCartLineDeliveryModeInternal","clearCartLinesDeliveryInformation","channelDeliveryOptionConfiguration","cartLineDeliverySpecification","LineId","DeliverySpecification","DeliveryModeId","DeliveryPreferenceTypeValue","PickUpStoreId","DeliveryAddress","updateCartLineDeliverySpecificationsInternal","lineDeliverySpecifications","deliveryModeId","trim","pickupDeliveryModeCode","emailDeliveryModeCode","cartLinesForShipping","channelDeliveryOptionConfig","filter","_input$channelDeliver","PickupDeliveryModeCodes","find","deliverySpecifications","shippingAddress","_input$additionalProp2","updateCartLineQuantityInternal","newQuantity","isUsingDefaultOrderSettingsMax","loyaltyCardNumber","updateLoyaltyCardIdInternal","addPromoCode","addPromoCodeInternal","promoCode","removePromoCodes","removePromoCodesInternal","promoCodes","removeAllPromoCodes","removeAllPromoCodesInternal","email","customerReference","customerRequisition","note","updatedCart","ReceiptEmail","Comment","CustomerRequisition","Notes","updateAsync","debug","updateReceiptEmail","newEmail","updateShippingAddress","newShippingAddress","newAttributeValues","newCartObject","AttributeValues","updateCart","newExtensionProperties","ExtensionProperties","updateCartLinesInternal","updatedCartLinesObject","isInitialized","getOrCreateActiveCart","_status","callback","features","enable_checkout_race_condition_hot_fix","operationPromise","callbackResult","refreshCart","validationResults","PostalAddressId","Name","OrgUnitName","FullAddress","Address","Street","StreetNumber","City","DistrictName","BuildingCompliment","Postbox","ThreeLetterISORegionName","Country","ZipCode","Zip","County","CountyName","State","StateName","__decorate","observable","computed","CheckoutStorageKey","BaseCheckoutState","_giftCardExtends","_loyaltyAmount","_guestCheckoutEmail","_customerAccountAmount","_emailAddressFromExpressCheckout","_checkoutGenericData","_checkoutCart","BaseCheckoutCartState","_shouldEnableSinglePaymentAuthorizationCheckout","app","config","shouldEnableSinglePaymentAuthorizationCheckout","_shouldEnableCheckoutErrorDisplayMessaging","shouldEnableCheckoutErrorDisplayMessaging","_salesOrder","_orderedProducts","_tokenizedPaymentCard","_tenderLine","_billingAddress","_isBillingAddressSameAsShippingAddress","_shippingAddress","_cartLinesWithShippingAddress","_hasShippingAddress","_hasCartDeliveryMode","_cardPrefix","_paymentTenderType","giftCardExtends","_loyaltyCardNumber","_hasGuestCheckoutEmail","_isTermsAndConditionAccepted","_isTermsAndConditionChecked","_shouldCollapsePaymentSection","_shouldTriggerPaymentWithPlaceOrder","_isPaymentSectionContainerReady","_cardPaymentAcceptResult","_isPaymentSectionContainerHasError","_redirectAdditionalContext","_redirectPaymentConnectorId","_checkoutErrorPaymentConnectorId","_isPlaceOrderEnabledInRedirection","_isPaymentVerificationRequired","_isCheckoutCallFailed","_shouldEnableExpressCheckoutInCheckout","_shouldEnableExpressCheckoutInCart","_shippingAddressFromExpressCheckout","_billingAddressFromExpressCheckout","_isExpressCheckoutApplied","_isExpressAddressApplied","_isExpressCheckoutAppliedInCartPage","_isExpressPaymentModulesReady","requestFormData","query","pv","redirectResult","_checkoutError","_isBillingAddressHasError","_checkoutErrorFocus","_shouldFocusOnCheckoutError","updateSalesOrder","newSalesOrder","newOrderedProducts","updateTokenizedPaymentCard","newTokenizedPaymentCard","updateTenderLine","newTenderLine","newCartLinesWithShippingAddress","newHasShippingAddress","newHasCartDeliveryMode","newIsTermsAndConditionAccepted","newIsTermsAndConditionChecked","newShouldCollapsePaymentSection","newShouldTriggerPaymentWithPlaceOrder","newIsPaymentSectionContainerReady","newCardPaymentAcceptResult","newIsPaymentSectionContainerHasError","newRedirectAdditionalContext","newRedirectPaymentConnectorId","newCheckoutErrorPaymentConnectorId","newIsCheckoutCallFailed","newIsPlaceOrderEnabledInRedirection","newIsPaymentVerificationRequired","updateBillingAddress","newBillingAddress","isBillingAddressSameAsShippingAddress","removeBillingAddress","updatePaymentTenderType","newPaymentTenderType","updateCardPrefix","newCardPrefix","removeGiftCard","giftCard","giftCardNumber","removeGiftCardExtend","addGiftCard","Pin","ExpirationDate","TenderTypeId","gitCardExtend","_objectSpread","addGiftCardExtend","updateLoyaltyCardNumber","newLoyaltyCardNumber","updateLoyaltyAmount","Number","newAmount","toFixed","_noteOnCart$","_noteInput$","newGuestCheckoutEmail","emailOnCart","checkoutCart","customerReqOnCart","customerRefOnCart","noteOnCart","noteInput","updateCartLines","newHasGuestCheckoutEmail","removeCheckoutCartId","cookies","removeCheckoutCartCookie","saveDataInStorage","sessionStorage","billingAddress","setCheckoutCartData","BillingAddress","GiftCard","LoyaltyCardNumber","loyaltyAmount","LoyaltyAmount","isTermsAndConditionAccepted","TermsAndCondition","paymentTenderType","window","setItem","PaymentTenderType","redirectPaymentConnectorId","RedirectPaymentConnectorId","isExpressCheckoutApplied","IsExpressCheckoutApplied","toString","filtered","Object","keys","filteredData","SaveDataBeforeRedirect","CheckoutGenericData","checkoutGenericData","updateCustomerAccountAmount","newBillingAddressFromExpressCheckout","newShippingAddressFromExpressCheckout","newEmailAddressFromExpressCheckout","newShouldEnableExpressCheckoutInCheckout","newShouldEnableExpressCheckoutInCart","newIsExpressCheckoutApplied","newIsExpressAddressApplied","newIsExpressCheckoutAppliedInCartPage","newIsBillingAddressHasError","newIsExpressPaymentModulesReady","newCheckoutError","setCheckoutGenericData","getCheckoutGenericData","newCheckoutErrorFocus","newShouldFocusOnCheckoutError","setInitialData","cleanCheckoutData","removeCheckoutCartData","isPaymentVerificationRedirection","_window$sessionStorag","getCheckoutCartData","get","Array","isArray","getItem","getCartState","cartStateDataAction","GetCartStateDataInput","getCartStateData","cartState","id","inputData","getCheckoutState","checkoutStateDataAction","ErrorCode","ErrorMessageResource","ErrorLocation","CheckoutModule","quantityErrors","getQuantityLimit","maxQuantityForCartLineItem","quantityLimit","shouldEnableStockCheck","Math","min","getElementIndex","lines","elementFoundAt","productIdToFind","index","line","entries","addProductsToCartWithoutSiteSettings","newCartLines","_cartLine$Quantity","addCartLinesResult","addCartLinesAsync","_error$data3","ValidationResults","validateOrderQuantityLimits","i","_cart$CartLines","_error$data","includes","name","addProductsToCartValidateAgainstDefaultOrderSettings","cartActionResult","_cart$CartLines2","_error$data2","addProductsToCartValidateAgainstSiteSettings","hasPromoCode","addDiscountCodeAsync","code","Coupons","coupon","Code","toLowerCase","lambda","result","console","log","reject","clearCartLineDeliveryMode","_actionContext$reques","matchingLines","copyCartLine","InventLocation","updateCartLinesAsync","_actionContext$reques2","_channelDeliveryOptio","dM","copiedLines","_cloneDeep","forEach","CartTokenPrefix","cartCookieParts","getCartCookie","split","readCart","readCartId","isAuthenticated","user","Auth","Anon","readAsync","bypassCache","setCartCookie","handleItemDiscontinuedException","exception","getCartFromCookie","wasReadFromCookie","authCarts","cartSearchCriteria","IncludeAnonymous","CartTypeValue","queryResultSettings","Paging","Top","Skip","Sorting","Columns","ColumnName","IsDescending","searchAsync","searchCarts","getCartFromCustomer","anonCart","currentCart","anonCurrentCart","cartId","claimAuthCart","Error","claimCart","mergedCart","sourceCart","destinationCart","cartLines","cartLinesToDelete","hasShippingMethod","channelConfiguration","featureNames","newCartLine","buildGiftCardLine","_featureStates$find","featureStates","getFeatureStatesAsync","featureState","IsEnabled","getChannelDeliveryOptionConfigurationAsync","isEmpty","ReasonCodeLines","removeCartLinesAsync","coupons","addCouponsAsync","addCartLines","claimAnonCart","createNewCart","LoyaltyCardId","cards","getCustomerLoyaltyCardsAsync","ChannelId","noneBlockingCards","card","CardTenderTypeValue","LoyaltyCardTenderType","Blocked","CardNumber","errorObj","response","information","createCartAsync","NetPrice","GiftCardBalance","removeDiscountCodesAsync","removeCartLinesInternal","errorInstance","updatedCartObject","cartLineDeliverySpecifications","updateLineDeliverySpecificationsAsync","updateCartLineQuantityValidateMaxAgainstDefaultOrderSettings","updateCartLineQuantityValidateMaxAgainstSiteSettings","updateLoyaltyCardId","newLoyaltyCardId","cartLinesToUpdate","getCheckoutCart","GetCheckoutCartInput","getCheckoutCartCookie","checkoutCartId","copyAsync","setCheckoutCartCookie"],"sourceRoot":""}