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ASqC,EAAazgB,GAAQ8f,EAAO,IAAKuB,GAU5C,OALAjD,EAFEiD,EAAc,EAEPC,IADTH,EAAI/C,EAAO1d,SACW2gB,EAClB,KAAOvB,EAAO,IAAKuB,EAAcF,GAAK/C,EACtC2B,EAAY3B,EAAQ,EAAG+C,EAAIE,GAAe,IAAMtB,EAAY3B,EAAQ+C,EAAIE,IAEnEC,EAAOlD","sources":["webpack://Msdyn365.Commerce.Online.Memx/./src/cart-state/add-product-to-cart.ts?85ba","webpack://Msdyn365.Commerce.Online.Memx/./src/cart-state/add-promo-code.ts?2e69","webpack://Msdyn365.Commerce.Online.Memx/./src/cart-state/base-cart-state.ts?592c","webpack://Msdyn365.Commerce.Online.Memx/./src/cart-state/add-invoices-to-cart.ts?cb4a","webpack://Msdyn365.Commerce.Online.Memx/./src/cart-state/add-order-invoice-to-cart.ts?d6f8","webpack://Msdyn365.Commerce.Online.Memx/./src/cart-state/update-receipt-email.ts?a0ea","webpack://Msdyn365.Commerce.Online.Memx/./src/cart-state/clear-cart-line-delivery-mode.ts?86b9","webpack://Msdyn365.Commerce.Online.Memx/./src/cart-state/clear-cart-lines-delivery-information.ts?527a","webpack://Msdyn365.Commerce.Online.Memx/./src/cart-state/get-or-create-active-cart.ts?26ce","webpack://Msdyn365.Commerce.Online.Memx/./src/cart-state/refresh-cart.ts?3943","webpack://Msdyn365.Commerce.Online.Memx/./src/cart-state/remove-all-promo-codes.ts?1bb2","webpack://Msdyn365.Commerce.Online.Memx/./src/cart-state/remove-cart-lines.ts?2e16","webpack://Msdyn365.Commerce.Online.Memx/./src/cart-state/remove-promo-codes.ts?ffc1","webpack://Msdyn365.Commerce.Online.Memx/./src/cart-state/set-invoice-line-price.ts?9cb9","webpack://Msdyn365.Commerce.Online.Memx/./src/cart-state/update-cart-line-delivery-specifications.ts?6d68","webpack://Msdyn365.Commerce.Online.Memx/./src/cart-state/update-cart-line-quantity.ts?a037","webpack://Msdyn365.Commerce.Online.Memx/./src/cart-state/update-cart-lines.ts?cd2f","webpack://Msdyn365.Commerce.Online.Memx/./src/cart-state/update-cart.ts?8850","webpack://Msdyn365.Commerce.Online.Memx/./src/cart-state/update-loyalty-card-id.ts?c304","webpack://Msdyn365.Commerce.Online.Memx/./src/cart-state/update-shipping-address.ts?4d06","webpack://Msdyn365.Commerce.Online.Memx/./src/checkout-state/base-checkout-cart-state.ts?509c","webpack://Msdyn365.Commerce.Online.Memx/./src/checkout-state/checkout-state-storage.ts?b049","webpack://Msdyn365.Commerce.Online.Memx/./src/checkout-state/base-checkout-state.ts?a438","webpack://Msdyn365.Commerce.Online.Memx/./src/data-actions/cart-state-data-action.ts?5695","webpack://Msdyn365.Commerce.Online.Memx/./src/data-actions/checkout-state-data-action.ts?ad58","webpack://Msdyn365.Commerce.Online.Memx/./src/data-actions/get-cart-state-data-action.ts?9f8e","webpack://Msdyn365.Commerce.Online.Memx/./src/data-actions/get-cart-state.ts?4428","webpack://Msdyn365.Commerce.Online.Memx/./src/data-actions/get-checkout-cart.ts?2235","webpack://Msdyn365.Commerce.Online.Memx/./src/data-actions/global-state-data-action.ts?901a","webpack://Msdyn365.Commerce.Online.Memx/./src/global-state/i-global-state.ts?6850","webpack://Msdyn365.Commerce.Online.Memx/./src/data-actions/get-checkout-state.ts?61f7","webpack://Msdyn365.Commerce.Online.Memx/./src/global-state/global-state.ts?008e","webpack://Msdyn365.Commerce.Online.Memx/./src/state-interfaces/checkout-state-enums.ts?13e8","webpack://Msdyn365.Commerce.Online.Memx/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/internals/string-repeat.js?40ad","webpack://Msdyn365.Commerce.Online.Memx/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/internals/this-number-value.js?b1ac","webpack://Msdyn365.Commerce.Online.Memx/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/modules/es.number.to-fixed.js?0c0f"],"sourcesContent":["/*!\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\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 addProductsToCartValidateMaxAgainstDefaultOrderSettings(\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 if (\n error.name === 'Microsoft_Dynamics_Commerce_Runtime_AddingItem_ExceedsMaximumQuantity' ||\n error.name === 'Microsoft_Dynamics_Commerce_Runtime_UpdatingItem_ExceedsMaximumQuantity'\n ) {\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 addProductsToCartValidateMaxAgainstSiteSettings(\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 orderQuantityLimitsFeatureIsEnabled: boolean,\n availableQuantity?: number,\n enableStockCheck?: boolean,\n isAddServiceItemToCart?: boolean,\n isMaxByQuantityValidationFeatureDefined?: boolean,\n shouldSkipSiteSettings?: boolean\n): Promise {\n if (shouldSkipSiteSettings) {\n return addProductsToCartWithoutSiteSettings(cart, actionContext, [{ cartLineToAdd }]);\n }\n\n // Using max from the default order settings if it's defined there and quantity limits feature is enabled.\n // Otherwise use max from site settings or default max 10.\n if (isMaxByQuantityValidationFeatureDefined && orderQuantityLimitsFeatureIsEnabled) {\n return addProductsToCartValidateMaxAgainstDefaultOrderSettings(cart, actionContext, [\n { cartLineToAdd, availableQuantity, enableStockCheck, isAddServiceItemToCart }\n ]);\n }\n return addProductsToCartValidateMaxAgainstSiteSettings(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 { 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 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';\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 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 orderQuantityLimitsFeatureIsEnabled: boolean = !!input.additionalProperties?.orderQuantityLimitsFeatureIsEnabled;\n const isMaxByQuantityValidationFeatureDefined: boolean = !!input.product.Behavior?.MaximumQuantity;\n return this._doCartOperationWithRetry(() =>\n addProductToCartInternal(\n this.cart,\n cartLine,\n this.actionContext,\n orderQuantityLimitsFeatureIsEnabled,\n input.availableQuantity,\n input.enableStockCheck,\n isAddServiceItemToCart,\n isMaxByQuantityValidationFeatureDefined,\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 * 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 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.additionalProperties - Additional properties.\n * @returns The cart action result.\n */\n @action\n public async updateReceiptEmail(input: { newEmail: string; additionalProperties?: object }): Promise {\n return this._doAsyncAction(async () => {\n return this._doCartOperationWithRetry(() => updateReceiptEmail(this.cart, input.newEmail, this.actionContext));\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 });\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 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 * 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 } 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): 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 ReceiptEmail: email\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 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\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 } 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 card = await getCustomerLoyaltyCardsAsync({ callerContext: ctx, queryResultSettings: {} }, null);\n if (card && card.length > 0) {\n cart = await updateAsync(\n { callerContext: ctx },\n {\n Id: cart.Id,\n LoyaltyCardId: card[0].CardNumber\n }\n );\n }\n }\n } catch (error) {\n ctx.telemetry.error(`Caught exception in 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 }\n }\n }\n\n return readCart;\n}\n\nexport async function getCartFromCustomer(ctx: IActionContext): Promise {\n if (ctx.requestContext.user.isAuthenticated) {\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 }\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 }\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\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 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 { 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 { 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 { 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 { 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 { 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\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 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 _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 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 additionalProperties?: object;\n }): Promise {\n this._guestCheckoutEmail = input.newGuestCheckoutEmail;\n const emailOnCart = this.checkoutCart.cart.ReceiptEmail;\n\n if (emailOnCart !== input.newGuestCheckoutEmail) {\n await this.checkoutCart.updateReceiptEmail({ newEmail: input.newGuestCheckoutEmail });\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: { newHasGuestCheckoutEmail: boolean; additionalProperties?: { [key: string]: unknown } }\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 { 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 { 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 {\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 { 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 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","/*!\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 { 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\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\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","'use strict';\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\nvar toString = require('../internals/to-string');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nvar $RangeError = RangeError;\n\n// `String.prototype.repeat` method implementation\n// https://tc39.es/ecma262/#sec-string.prototype.repeat\nmodule.exports = function repeat(count) {\n var str = toString(requireObjectCoercible(this));\n var result = '';\n var n = toIntegerOrInfinity(count);\n if (n < 0 || n === Infinity) throw new $RangeError('Wrong number of repetitions');\n for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str;\n return result;\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\n\n// `thisNumberValue` abstract operation\n// https://tc39.es/ecma262/#sec-thisnumbervalue\nmodule.exports = uncurryThis(1.0.valueOf);\n","'use strict';\nvar $ = require('../internals/export');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\nvar thisNumberValue = require('../internals/this-number-value');\nvar $repeat = require('../internals/string-repeat');\nvar fails = require('../internals/fails');\n\nvar $RangeError = RangeError;\nvar $String = String;\nvar floor = Math.floor;\nvar repeat = uncurryThis($repeat);\nvar stringSlice = uncurryThis(''.slice);\nvar nativeToFixed = uncurryThis(1.0.toFixed);\n\nvar pow = function (x, n, acc) {\n return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc);\n};\n\nvar log = function (x) {\n var n = 0;\n var x2 = x;\n while (x2 >= 4096) {\n n += 12;\n x2 /= 4096;\n }\n while (x2 >= 2) {\n n += 1;\n x2 /= 2;\n } return n;\n};\n\nvar multiply = function (data, n, c) {\n var index = -1;\n var c2 = c;\n while (++index < 6) {\n c2 += n * data[index];\n data[index] = c2 % 1e7;\n c2 = floor(c2 / 1e7);\n }\n};\n\nvar divide = function (data, n) {\n var index = 6;\n var c = 0;\n while (--index >= 0) {\n c += data[index];\n data[index] = floor(c / n);\n c = (c % n) * 1e7;\n }\n};\n\nvar dataToString = function (data) {\n var index = 6;\n var s = '';\n while (--index >= 0) {\n if (s !== '' || index === 0 || data[index] !== 0) {\n var t = $String(data[index]);\n s = s === '' ? t : s + repeat('0', 7 - t.length) + t;\n }\n } return s;\n};\n\nvar FORCED = fails(function () {\n return nativeToFixed(0.00008, 3) !== '0.000' ||\n nativeToFixed(0.9, 0) !== '1' ||\n nativeToFixed(1.255, 2) !== '1.25' ||\n nativeToFixed(1000000000000000128.0, 0) !== '1000000000000000128';\n}) || !fails(function () {\n // V8 ~ Android 4.3-\n nativeToFixed({});\n});\n\n// `Number.prototype.toFixed` method\n// https://tc39.es/ecma262/#sec-number.prototype.tofixed\n$({ target: 'Number', proto: true, forced: FORCED }, {\n toFixed: function toFixed(fractionDigits) {\n var number = thisNumberValue(this);\n var fractDigits = toIntegerOrInfinity(fractionDigits);\n var data = [0, 0, 0, 0, 0, 0];\n var sign = '';\n var result = '0';\n var e, z, j, k;\n\n // TODO: ES2018 increased the maximum number of fraction digits to 100, need to improve the implementation\n if (fractDigits < 0 || fractDigits > 20) throw new $RangeError('Incorrect fraction digits');\n // eslint-disable-next-line no-self-compare -- NaN check\n if (number !== number) return 'NaN';\n if (number <= -1e21 || number >= 1e21) return $String(number);\n if (number < 0) {\n sign = '-';\n number = -number;\n }\n if (number > 1e-21) {\n e = log(number * pow(2, 69, 1)) - 69;\n z = e < 0 ? number * pow(2, -e, 1) : number / pow(2, e, 1);\n z *= 0x10000000000000;\n e = 52 - e;\n if (e > 0) {\n multiply(data, 0, z);\n j = fractDigits;\n while (j >= 7) {\n multiply(data, 1e7, 0);\n j -= 7;\n }\n multiply(data, pow(10, j, 1), 0);\n j = e - 1;\n while (j >= 23) {\n divide(data, 1 << 23);\n j -= 23;\n }\n divide(data, 1 << j);\n multiply(data, 1, 1);\n divide(data, 2);\n result = dataToString(data);\n } else {\n multiply(data, 0, z);\n multiply(data, 1 << -e, 0);\n result = dataToString(data) + repeat('0', fractDigits);\n }\n }\n if (fractDigits > 0) {\n k = result.length;\n result = sign + (k <= fractDigits\n ? '0.' + repeat('0', fractDigits - k) + result\n : stringSlice(result, 0, k - fractDigits) + '.' + stringSlice(result, k - fractDigits));\n } else {\n result = sign + result;\n } return result;\n }\n});\n"],"names":["getQuantityLimit","maxQuantityForCartLineItem","inputItem","quantityLimit","shouldEnableStockCheck","undefined","availableQuantity","Math","min","getElementIndex","lines","cartLineToAdd","elementFoundAt","productIdToFind","ProductId","index","line","entries","DeliveryMode","FulfillmentStoreId","async","addProductsToCartWithoutSiteSettings","cart","actionContext","input","CartLines","status","substatus","newCartLines","map","_cartLine$Quantity","cartLine","_objectSpread","Quantity","addCartLinesResult","Version","addCartLinesAsync","callerContext","Id","then","newCart","catch","error","_error$data3","telemetry","trace","errorDetails","LocalizedMessage","message","validationResults","data","ValidationResults","warning","addProductsToCartInternal","orderQuantityLimitsFeatureIsEnabled","enableStockCheck","isAddServiceItemToCart","isMaxByQuantityValidationFeatureDefined","shouldSkipSiteSettings","i","length","_cart$CartLines","_error$data","name","find","cartline","IsInvoiceLine","addProductsToCartValidateMaxAgainstDefaultOrderSettings","requestContext","app","config","cartActionResult","_cart$CartLines2","_error$data2","addProductsToCartValidateMaxAgainstSiteSettings","addPromoCode","promoCode","hasPromoCode","addDiscountCodeAsync","code","Coupons","coupon","Code","toLowerCase","includes","BaseCartState","GlobalState","constructor","super","this","_cart","_attributeValues","_extensionProperties","_isProductAddedToCart","reduce","total","num","some","_doAsyncAction","refreshCartInternal","_input$catalogId","_input$additionalProp","_input$product$Behavi","CatalogId","catalogId","getCatalogId","Description","product","EntryMethodTypeValue","ItemId","RecordId","count","TrackingId","UnitOfMeasureSymbol","DefaultUnitOfMeasure","IsPriceKeyedIn","isPriceKeyedIn","IsGiftCardLine","IsGiftCard","Price","customPrice","location","channel","deliveryMode","retailMultiplePickupModeEnabled","PickupDeliveryModeCode","OrgUnitNumber","WarehouseId","InventoryLocationId","ShippingAddress","_buildAddressFromOrgUnitLocation","isAddEmailDeliveryItemToCart","EmailDeliveryModeCode","ItemTypeValue","ReleasedProductType","Service","additionalProperties","Behavior","MaximumQuantity","_doCartOperationWithRetry","addProductToCartInternal","internalInput","_inputItem$catalogId","_this$actionContext$r","PRODUCTASSERVICE","push","isStockCheckEnabled","invoiceIds","CartsDataActions","addInvoicesToCartInternal","invoiceId","lineDescription","addOrderInvoiceAsync","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","deliverySpecifications","shippingAddress","_input$additionalProp2","updateCartLineQuantityInternal","newQuantity","isUsingDefaultOrderSettingsMax","loyaltyCardNumber","updateLoyaltyCardIdInternal","addPromoCodeInternal","removePromoCodes","removePromoCodesInternal","promoCodes","removeAllPromoCodes","removeAllPromoCodesInternal","email","updateAsync","ReceiptEmail","debug","updateReceiptEmail","newEmail","updateShippingAddress","newShippingAddress","newAttributeValues","newCartObject","AttributeValues","updateCart","newExtensionProperties","ExtensionProperties","updateCartLinesInternal","updatedCartLinesObject","isInitialized","getOrCreateActiveCart","_status","callback","callbackResult","refreshCart","PostalAddressId","Name","OrgUnitName","FullAddress","Address","Street","StreetNumber","City","DistrictName","BuildingCompliment","Postbox","ThreeLetterISORegionName","Country","ZipCode","Zip","County","CountyName","State","StateName","__decorate","observable","computed","action","clearCartLineDeliveryMode","_actionContext$reques","matchingLines","copyCartLine","InventLocation","updateCartLinesAsync","_actionContext$reques2","_channelDeliveryOptio","dM","copiedLines","_cloneDeep","forEach","CartTokenPrefix","ctx","cartCookieParts","cookies","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","updatedCart","cartLines","cartLinesToDelete","hasShippingMethod","channelConfiguration","featureNames","newCartLine","buildGiftCardLine","_featureStates$find","featureStates","getFeatureStatesAsync","featureState","IsEnabled","getChannelDeliveryOptionConfigurationAsync","isEmpty","ReasonCodeLines","removeCartLinesAsync","coupons","addCouponsAsync","addCartLines","claimAnonCart","createNewCart","LoyaltyCardId","card","getCustomerLoyaltyCardsAsync","CardNumber","errorObj","response","information","createCartAsync","NetPrice","GiftCardBalance","removeDiscountCodesAsync","removeCartLinesInternal","Array","isArray","errorInstance","cartLineDeliverySpecifications","updateLineDeliverySpecificationsAsync","updateCartLineQuantityValidateMaxAgainstDefaultOrderSettings","updateCartLineQuantityValidateMaxAgainstSiteSettings","cartLinesToUpdate","updatedCartObject","updateLoyaltyCardId","newLoyaltyCardId","BaseCheckoutCartState","getCheckoutCart","GetCheckoutCartInput","apiSettings","CheckoutStorageKey","BaseCheckoutState","_giftCardExtends","_loyaltyAmount","_guestCheckoutEmail","_customerAccountAmount","_emailAddressFromExpressCheckout","_checkoutGenericData","_checkoutCart","_shouldEnableSinglePaymentAuthorizationCheckout","shouldEnableSinglePaymentAuthorizationCheckout","_shouldEnableCheckoutErrorDisplayMessaging","shouldEnableCheckoutErrorDisplayMessaging","_salesOrder","_orderedProducts","_tokenizedPaymentCard","_tenderLine","_billingAddress","_isBillingAddressSameAsShippingAddress","_shippingAddress","_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","Promise","resolve","updateTokenizedPaymentCard","newTokenizedPaymentCard","updateTenderLine","newTenderLine","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","addGiftCardExtend","updateLoyaltyCardNumber","newLoyaltyCardNumber","updateLoyaltyAmount","Number","newAmount","toFixed","newGuestCheckoutEmail","checkoutCart","updateCartLines","newHasGuestCheckoutEmail","removeCheckoutCartId","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","key","SaveDataBeforeRedirect","CheckoutGenericData","checkoutGenericData","updateCustomerAccountAmount","newBillingAddressFromExpressCheckout","newShippingAddressFromExpressCheckout","newEmailAddressFromExpressCheckout","newShouldEnableExpressCheckoutInCheckout","newShouldEnableExpressCheckoutInCart","newIsExpressCheckoutApplied","newIsExpressAddressApplied","newIsExpressCheckoutAppliedInCartPage","newIsBillingAddressHasError","newIsExpressPaymentModulesReady","newCheckoutError","setCheckoutGenericData","getCheckoutGenericData","newCheckoutErrorFocus","newShouldFocusOnCheckoutError","initialize","setInitialData","cleanCheckoutData","removeCheckoutCartData","isPaymentVerificationRedirection","_window$sessionStorag","getCheckoutCartData","get","getItem","createGlobalStateDataAction","GetCartStateDataInput","getCacheKey","_this$catalogId","channelId","getCacheObjectType","dataCacheType","getCartStateData","cartState","getCartState","createObservableDataAction","id","inputData","cartStateDataAction","GlobalStateInput","getCheckoutCartCookie","checkoutCartId","copyAsync","setCheckoutCartCookie","stateConstructor","getState","globalStateObject","createGlobalState","args","getCheckoutState","checkoutStateDataAction","lambda","result","console","log","reject","ErrorCode","ErrorMessageResource","ErrorLocation","CheckoutModule","toIntegerOrInfinity","requireObjectCoercible","$RangeError","RangeError","module","exports","str","n","Infinity","uncurryThis","valueOf","$","thisNumberValue","$repeat","fails","$String","String","floor","repeat","stringSlice","slice","nativeToFixed","pow","x","acc","multiply","c","c2","divide","dataToString","s","t","target","proto","forced","fractionDigits","e","z","j","k","number","fractDigits","sign","x2"],"sourceRoot":""}