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,EAAQE,YAAYE,GAAcO,EAAQ,KAC1CR,EAAiBC,GAIzBQ,OAAOC,aAAeD,OAAOC,cAAgB,GAC7CD,OAAOC,aAAaZ,QAAO7B,EAAAA,EAAA,GACpBwC,OAAOC,aAAaZ,SAAW,IAC/BD,EAAQC,SAGXW,OAAOC,aAAaC,mBAAqB,GACzCF,OAAOC,aAAaC,mBAA8B,UAAC1C,EAAA,GAC5C4B,EAAQE,iCC7GvBa,EAAOC,QAAUC,2BCAjBF,EAAOC,QAAUE","sources":["webpack://Msdyn365.Commerce.Online/./src/actions/add-order-template-to-cart-override.action.ts?2f05","webpack://Msdyn365.Commerce.Online/./src/actions/get-availabilities-cartlines-override.action.ts?0841","webpack://Msdyn365.Commerce.Online/./src/actions/utilities/QueryResultsSettingsProxy.ts?8cf7","webpack://Msdyn365.Commerce.Online/./src/actions/get-delivery-options-for-cart-override.action.ts?7763","webpack://Msdyn365.Commerce.Online/./src/actions/get-email-subscriptions.action.ts?7fd2","webpack://Msdyn365.Commerce.Online/./src/actions/get-inventory-uom.action.ts?9307","webpack://Msdyn365.Commerce.Online/./src/actions/get-sales-order-detail-by-salesid.action.ts?ef47","webpack://Msdyn365.Commerce.Online/./src/actions/get-simple-products.override.action.ts?5d46","webpack://Msdyn365.Commerce.Online/./src/actions/get-uom.action.ts?12cd","webpack://Msdyn365.Commerce.Online/./src/actions/get-zone-prices.action.ts?fc01","webpack://Msdyn365.Commerce.Online/./src/actions/past-due-notice.action.ts?4d2c","webpack://Msdyn365.Commerce.Online/./src/utilities/get-catalog-id-from-context.ts?89bf","webpack://Msdyn365.Commerce.Online/./lib/__local__/module-registration.js?8a42","webpack://Msdyn365.Commerce.Online/external var \"React\"?0d3b","webpack://Msdyn365.Commerce.Online/external var \"ReactDOM\"?853b"],"sourcesContent":["/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n ICreateActionContext\r\n} from '@msdyn365-commerce/core';\r\nimport { getCartState } from '@msdyn365-commerce/global-state';\r\nimport { CartLine, QueryResultSettings } from '@msdyn365-commerce/retail-proxy';\r\nimport { addCartLinesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\r\n\r\nimport { getPaginatedOrderTemplateLinesAction, GetPaginatedOrderTemplateLinesInput } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { GetCatalogIdFromContext } from '../utilities/get-catalog-id-from-context';\r\n\r\n/**\r\n * Input class for the AddOrderTemplateToCart data action.\r\n */\r\nexport class AddOrderTemplateToCartInput implements IActionInput {\r\n public readonly orderTemplateId: string;\r\n\r\n constructor(orderTemplateId: string) {\r\n this.orderTemplateId = orderTemplateId;\r\n }\r\n\r\n public getCacheKey = () => 'AddOrderTemplateToCartInput';\r\n\r\n public getCacheObjectType = () => 'AddOrderTemplateToCartInput';\r\n\r\n public dataCacheType = (): CacheType => 'none';\r\n}\r\n\r\n/**\r\n * CreateInput method for the AddOrderTemplateToCart method.\r\n * @param {ICreateActionContext} inputData The input data passed to the createInput method.\r\n * @param {string} orderTemplateId The id of template.\r\n */\r\nexport const addOrderTemplateToCartInput = (inputData: ICreateActionContext, orderTemplateId: string): AddOrderTemplateToCartInput => {\r\n const { requestContext } = inputData;\r\n if (!requestContext.user.isAuthenticated) {\r\n throw new Error('Unable to create order template. User is not authenticated.');\r\n }\r\n return new AddOrderTemplateToCartInput(orderTemplateId);\r\n};\r\n\r\n/**\r\n * The action method for the AddOrderTemplateToCart data action.\r\n * @param {AddOrderTemplateToCartInput} input The action input.\r\n * @param {IActionContext} ctx The action context.\r\n * @param context\r\n */\r\nexport async function addOrderTemplateToCartAction(input: AddOrderTemplateToCartInput, context: IActionContext): Promise {\r\n const cartState = await getCartState(context);\r\n const catalogId = GetCatalogIdFromContext(context);\r\n const chunkCount = 1000;\r\n const queryResultSettings: QueryResultSettings = {\r\n Paging: {\r\n Top: chunkCount,\r\n Skip: 0\r\n }\r\n };\r\n const getPaginatedOrderTemplateLinesInput = new GetPaginatedOrderTemplateLinesInput(input.orderTemplateId, queryResultSettings);\r\n let orderTemplateLines = await getPaginatedOrderTemplateLinesAction(getPaginatedOrderTemplateLinesInput, context);\r\n let addedCartLines: CartLine[] = [];\r\n for (let skip = chunkCount; orderTemplateLines.lines.length > 0; skip += chunkCount) {\r\n const cartLines: CartLine[] = orderTemplateLines.lines.map(productLine => {\r\n const cartLine: CartLine = {\r\n ItemId: productLine.fullProduct?.ProductDetails.ItemId,\r\n ProductId: productLine.productListLine.ProductId,\r\n Quantity: productLine.productListLine.Quantity,\r\n TrackingId: '',\r\n UnitOfMeasureSymbol: productLine.productListLine.UnitOfMeasure,\r\n CatalogId: catalogId\r\n };\r\n return cartLine;\r\n });\r\n await addCartLinesAsync({ callerContext: context }, cartState.cart.Id, cartLines, cartState.cart.Version).catch(error => {\r\n context.telemetry.trace(error.data?.ValidationResults);\r\n context.telemetry.trace('Unable to add order template to cart.');\r\n throw error.data?.ValidationResults;\r\n });\r\n addedCartLines = addedCartLines.concat(cartLines);\r\n getPaginatedOrderTemplateLinesInput.queryResultSettings.Paging!.Skip = skip;\r\n orderTemplateLines = await getPaginatedOrderTemplateLinesAction(getPaginatedOrderTemplateLinesInput, context);\r\n }\r\n await cartState.refreshCart({});\r\n return addedCartLines;\r\n}\r\n\r\n/**\r\n * The AddOrderTemplateToCart Data Action.\r\n * Returns created order template.\r\n */\r\nexport const addOrderTemplateToCartActionDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/retail-actions/order-templates/add-order-template-to-cart',\r\n action: >addOrderTemplateToCartAction,\r\n input: addOrderTemplateToCartInput\r\n});\r\nexport default addOrderTemplateToCartActionDataAction;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICommerceApiSettings,\r\n ICreateActionContext,\r\n IGeneric\r\n} from '@msdyn365-commerce/core';\r\nimport { getCartState } from '@msdyn365-commerce/global-state';\r\nimport { CartLine, ChannelDeliveryOptionConfiguration, ProductWarehouse } from '@msdyn365-commerce/retail-proxy';\r\nimport { getOrgUnitConfigurationAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/OrgUnitsDataActions.g';\r\nimport {\r\n getEstimatedAvailabilityAsync,\r\n getEstimatedProductWarehouseAvailabilityAsync\r\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\n// import {\r\n// createGetFeatureStatesInput,\r\n// getChannelDeliveryOptionConfigurationAsync\r\n// } from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\r\n\r\nimport {\r\n ActiveCartProductsInput,\r\n ArrayExtensions,\r\n buildCacheKey,\r\n getActiveCartProductsAction,\r\n IProductInventoryInformation,\r\n mapAggregatedProductInventoryInformation,\r\n mapProductInventoryInformation\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\n\r\n/**\r\n * Input class for availabilities for items in cart.\r\n */\r\nexport class ProductAvailabilitiesForCartLineItems implements IActionInput {\r\n private readonly apiSettings: ICommerceApiSettings;\r\n\r\n constructor(apiSettings: ICommerceApiSettings) {\r\n this.apiSettings = apiSettings;\r\n }\r\n\r\n public getCacheKey = () => buildCacheKey('ActiveCartLineItemsAvailability', this.apiSettings);\r\n\r\n public getCacheObjectType = () => 'ActiveCartLineItemsAvailability';\r\n\r\n public dataCacheType = (): CacheType => 'none';\r\n}\r\n\r\nconst createInput = (inputData: ICreateActionContext>) => {\r\n return new ProductAvailabilitiesForCartLineItems(inputData.requestContext.apiSettings);\r\n};\r\n\r\n/**\r\n * Calls the Retail Feature State API and returns a list of feature with isEnabled flag.\r\n * @param cartLine\r\n * @param featureSate\r\n * @param channelDeliveryOptionConfig\r\n * @param pickupDeliveryMode\r\n */\r\nconst getDeliveryMode = (\r\n cartLine: CartLine,\r\n featureSate: boolean = false,\r\n channelDeliveryOptionConfig: ChannelDeliveryOptionConfiguration,\r\n pickupDeliveryMode?: string\r\n) => {\r\n if (!featureSate) {\r\n return cartLine.DeliveryMode === pickupDeliveryMode;\r\n }\r\n return (\r\n cartLine.DeliveryMode ===\r\n channelDeliveryOptionConfig?.PickupDeliveryModeCodes?.find(deliveryMode => deliveryMode === cartLine.DeliveryMode)\r\n );\r\n};\r\n\r\n/**\r\n * Calls the Retail API to get the product availabilities for items in the cart.\r\n * @param input\r\n * @param ctx\r\n */\r\n// eslint-disable-next-line complexity\r\nexport async function getAvailabilitiesForCartLineItems(\r\n input: ProductAvailabilitiesForCartLineItems,\r\n ctx: IActionContext\r\n): Promise {\r\n // If no input is provided fail out\r\n if (!input) {\r\n throw new Error('[getAvailabilitiesForCartLineItems]No valid Input was provided, failing');\r\n }\r\n const shippingItems: CartLine[] = [];\r\n const bopisItems = [];\r\n let productAvailabilities: IProductInventoryInformation[] = [];\r\n // const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n let channelDeliveryOptionConfig: any;\r\n\r\n const cartState = await getCartState(ctx);\r\n const cart = cartState.cart;\r\n const channelConfiguration = await getOrgUnitConfigurationAsync({ callerContext: ctx });\r\n const products = await getActiveCartProductsAction(new ActiveCartProductsInput(), ctx);\r\n /**\r\n * Calls the Retail Feature State API and returns a list of feature with isEnabled flag.\r\n * @param context\r\n */\r\n // async function getFeatureState(context: IActionContext): Promise {\r\n // console.log('Getting feature states');\r\n // const featureState = createGetFeatureStatesInput({ Paging: { Top: 1000, Skip: 0 } });\r\n // return getFeatureStateDataAction(featureState, context);\r\n // }\r\n // const featureState = await getFeatureState(ctx);\r\n // console.log('Got feature states', featureState);\r\n // const retailMultiplePickUpOptionEnabled = featureState?.find(item => item.Name === multiplePickupStoreSwitchName)?.IsEnabled;\r\n // if (retailMultiplePickUpOptionEnabled) {\r\n // channelDeliveryOptionConfig = await getChannelDeliveryOptionConfigurationAsync({ callerContext: ctx });\r\n // }\r\n const PickupDeliveryModeCode = channelConfiguration.PickupDeliveryModeCode;\r\n const EmailDeliveryModeCode = channelConfiguration.EmailDeliveryModeCode;\r\n if (!cart || !channelConfiguration || !products || products.length === 0) {\r\n ctx.trace('[getAvailabilitiesForCartLineItems] Not able to get cart OR channelConfiguration or no products in cart');\r\n return [];\r\n }\r\n\r\n if (cart && cart.Id && cart.CartLines && cart.CartLines.length > 0 && channelConfiguration) {\r\n for (const cartLine of cart.CartLines) {\r\n if (\r\n cartLine.DeliveryMode &&\r\n cartLine.DeliveryMode !== '' &&\r\n getDeliveryMode(cartLine, false, channelDeliveryOptionConfig, PickupDeliveryModeCode)\r\n ) {\r\n bopisItems.push(cartLine);\r\n } else if (EmailDeliveryModeCode === '' || cartLine.DeliveryMode !== EmailDeliveryModeCode) {\r\n shippingItems.push(cartLine);\r\n }\r\n }\r\n }\r\n\r\n if (shippingItems && shippingItems.length > 0) {\r\n let csProducts: number[] = [];\r\n let eaProducts: number[] = [];\r\n shippingItems.forEach(cl => {\r\n if (cl.UnitOfMeasureSymbol === 'CS') {\r\n csProducts.push(cl.ProductId!);\r\n } else {\r\n eaProducts.push(cl.ProductId!);\r\n }\r\n });\r\n csProducts = ArrayExtensions.unique(csProducts);\r\n eaProducts = ArrayExtensions.unique(eaProducts);\r\n const availabilities1 = getAvailability(csProducts, 1, 'CS', ctx);\r\n const availabilities2 = getAvailability(eaProducts, 0, 'EA', ctx);\r\n productAvailabilities = [...(await availabilities1), ...(await availabilities2)];\r\n }\r\n\r\n if (bopisItems && bopisItems.length > 0) {\r\n const productWarehouses: ProductWarehouse[] = [];\r\n\r\n for (const bopisItem of bopisItems) {\r\n const productWarehouse: ProductWarehouse = {\r\n ProductId: bopisItem.ProductId,\r\n InventLocationId: bopisItem.WarehouseId\r\n };\r\n\r\n if (ctx.requestContext.channel && ctx.requestContext.channel.InventLocationDataAreaId) {\r\n productWarehouse.DataAreaId = ctx.requestContext.channel.InventLocationDataAreaId;\r\n }\r\n productWarehouses.push(productWarehouse);\r\n }\r\n const quantityUnitTypeSales: number = 2;\r\n const getProductWarehouseAvail = await getEstimatedProductWarehouseAvailabilityAsync(\r\n { callerContext: ctx, bypassCache: 'get', queryResultSettings: {} },\r\n productWarehouses,\r\n quantityUnitTypeSales\r\n );\r\n\r\n if (\r\n getProductWarehouseAvail &&\r\n getProductWarehouseAvail.ProductWarehouseInventoryAvailabilities &&\r\n getProductWarehouseAvail.ProductWarehouseInventoryAvailabilities.length > 0\r\n ) {\r\n const productWarehouseMapping = mapProductInventoryInformation(\r\n ctx,\r\n getProductWarehouseAvail?.ProductWarehouseInventoryAvailabilities\r\n );\r\n if (productWarehouseMapping && productWarehouseMapping.length > 0) {\r\n for (const item of productWarehouseMapping) {\r\n productAvailabilities.push(item);\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (productAvailabilities && productAvailabilities.length > 0) {\r\n return productAvailabilities;\r\n }\r\n\r\n ctx.trace('[getAvailabilitiesForCartLineItems] unable to get availabilities for product');\r\n return [];\r\n}\r\n\r\nconst getAvailability = async (productIds: number[], quantityUnitTypeValue: number, uom: string, ctx: IActionContext) => {\r\n if (!productIds.length) {\r\n return [];\r\n }\r\n const availabilities = await getEstimatedAvailabilityAsync(\r\n { callerContext: ctx },\r\n { ProductIds: productIds, DefaultWarehouseOnly: true, QuantityUnitTypeValue: quantityUnitTypeValue }\r\n );\r\n const availabilities2 = mapAggregatedProductInventoryInformation(ctx, availabilities);\r\n availabilities2.forEach(a => {\r\n a.ProductAvailableQuantity.UnitOfMeasure = uom;\r\n });\r\n return availabilities2;\r\n};\r\n\r\nexport const getAvailabilitiesForCartLineItemsDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/retail-actions/get-availabilities-cartlines',\r\n action: >getAvailabilitiesForCartLineItems,\r\n input: createInput\r\n});\r\n\r\nexport default getAvailabilitiesForCartLineItemsDataAction;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { IAny, ICreateActionContext, IGeneric, IRequestContext } from '@msdyn365-commerce/core';\r\nimport { QueryResultSettings, SortColumn, SortingInfo } from '@msdyn365-commerce/retail-proxy';\r\n\r\ninterface IQueryResultSettingsModuleConfig {\r\n itemsPerPage?: number;\r\n sortingCriteria?: SortingInfo;\r\n}\r\n\r\n/**\r\n * Wrapper for query result settings, which guarantees some properties that are optional in the real subject\r\n * and includes some common utilities for data actions.\r\n */\r\nexport class QueryResultSettingsProxy {\r\n // Real subject\r\n private readonly queryResultSettings: QueryResultSettings;\r\n\r\n /**\r\n * Factory method for data actions.\r\n * @param inputData - Input data.\r\n * @returns - Returns query result settings proxy.\r\n */\r\n public static fromInputData(inputData: ICreateActionContext>): QueryResultSettingsProxy {\r\n const { requestContext, config } = inputData;\r\n return QueryResultSettingsProxy.fromModuleData(requestContext, config as IQueryResultSettingsModuleConfig);\r\n }\r\n\r\n /**\r\n * Factory method for modules.\r\n * @param requestContext - RequestContext.\r\n * @param config - Module config from props.\r\n * @returns - Returns query result settings proxy.\r\n */\r\n public static fromModuleData(requestContext: IRequestContext, config: IQueryResultSettingsModuleConfig): QueryResultSettingsProxy {\r\n const sortingCriteria = (config && config.sortingCriteria) || undefined;\r\n const query = requestContext && requestContext.query;\r\n const top = (query && query.top) || undefined;\r\n const skip = (query && query.skip) || undefined;\r\n\r\n const queryResultSettings = {\r\n Paging: {\r\n Skip: (skip && Number(skip)) || 0,\r\n Top: (top && Number(top)) || config?.itemsPerPage || 50\r\n },\r\n Sorting: sortingCriteria || {}\r\n };\r\n\r\n return new QueryResultSettingsProxy(queryResultSettings);\r\n }\r\n\r\n /**\r\n * Return the query result settings with default paging or with the passed value.\r\n * @param inputData - Input Data.\r\n * @returns - Query Result settings.\r\n */\r\n public static getPagingFromInputDataOrDefaultValue(inputData: ICreateActionContext>): QueryResultSettings {\r\n const config: IQueryResultSettingsModuleConfig | undefined = inputData.config;\r\n const defaultPageSize: number = 100;\r\n const queryResultSettings: QueryResultSettings = {\r\n Paging: {\r\n // eslint-disable-next-line max-len -- Disable max length for next line.\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unnecessary-condition -- Reading from config.\r\n Top:\r\n config?.itemsPerPage ??\r\n Number.parseInt(inputData.requestContext?.app?.platform?.defaultPageSizeForAPI ?? defaultPageSize, 10)\r\n }\r\n };\r\n return queryResultSettings;\r\n }\r\n\r\n /**\r\n * Factory method.\r\n * @returns - Returns query result settings proxy.\r\n */\r\n public static getDefault(): QueryResultSettingsProxy {\r\n return new QueryResultSettingsProxy({ Paging: {}, Sorting: {} });\r\n }\r\n\r\n /**\r\n * Private constructor, expect instances to be created with the factory method.\r\n * @param queryResultSettings - Query result setting.\r\n */\r\n private constructor(queryResultSettings: QueryResultSettings) {\r\n this.queryResultSettings = queryResultSettings;\r\n }\r\n\r\n public get QueryResultSettings(): QueryResultSettings {\r\n return this.queryResultSettings;\r\n }\r\n\r\n /**\r\n * Gets the hints for the cache key based on query result settings.\r\n * @returns - Returns cache key hint.\r\n */\r\n public get cacheKeyHint(): string {\r\n // The factory method guarantees values are defined\r\n const topHint = `top-${this.queryResultSettings.Paging!.Top!}`;\r\n const skipHint = `skip-${this.queryResultSettings.Paging!.Skip!}`;\r\n const sortingHintData =\r\n (this.queryResultSettings.Sorting!.Columns || [])\r\n .map((column: SortColumn) => {\r\n return `${column.ColumnName}--${(column.IsDescending && 'desc') || 'asc'}`;\r\n })\r\n .join(',') || undefined;\r\n const sortingHint = `sortBy-${sortingHintData}`;\r\n return `${topHint}|${skipHint}|${sortingHint}`;\r\n }\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICommerceApiSettings,\r\n ICreateActionContext,\r\n IGeneric\r\n} from '@msdyn365-commerce/core';\r\nimport { getCartState } from '@msdyn365-commerce/global-state';\r\nimport { ProductAvailableQuantity, ProductDeliveryOptions, ProductsDataActions } from '@msdyn365-commerce/retail-proxy';\r\n\r\nimport { ActiveCartProductsInput, buildCacheKey, getActiveCartProductsAction } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { QueryResultSettingsProxy } from './utilities/QueryResultsSettingsProxy';\r\n\r\n/**\r\n * Input class for delivery options for items in cart.\r\n */\r\nexport class ProductDeliveryOptionsForCartLineItems implements IActionInput {\r\n private readonly apiSettings: ICommerceApiSettings;\r\n\r\n constructor(apiSettings: ICommerceApiSettings) {\r\n this.apiSettings = apiSettings;\r\n }\r\n\r\n public getCacheKey = () => buildCacheKey('ActiveCartLineItemsDeliveryOptions', this.apiSettings);\r\n\r\n public getCacheObjectType = () => 'ActiveCartLineItemsDeliveryOptions';\r\n\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\nconst createInput = (inputData: ICreateActionContext>) => {\r\n return new ProductDeliveryOptionsForCartLineItems(inputData.requestContext.apiSettings);\r\n};\r\n\r\n/**\r\n * Calls the Retail API to get the delivery options for items in the cart.\r\n * @param input\r\n * @param ctx\r\n */\r\nexport async function getDeliveryOptionsForCartLineItems(\r\n input: ProductDeliveryOptionsForCartLineItems,\r\n ctx: IActionContext\r\n): Promise {\r\n // If no input is provided fail out\r\n if (!input) {\r\n throw new Error('[getDeliveryOptionsForCartLineItems]No valid Input was provided, failing');\r\n }\r\n const cartState = await getCartState(ctx);\r\n const cart = cartState.cart;\r\n const products = await getActiveCartProductsAction(new ActiveCartProductsInput(), ctx);\r\n\r\n if (!cart || !products || products.length === 0) {\r\n ctx.trace('[getDeliveryOptionsForCartLineItems] Not able to get cart OR channelConfiguration or no products in cart');\r\n return [];\r\n }\r\n\r\n return ProductsDataActions.getDeliveryOptionsAsync(\r\n {\r\n callerContext: ctx,\r\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(ctx)\r\n },\r\n products.map(x => x.RecordId).filter(x => !!x),\r\n {},\r\n null\r\n )\r\n .then(result => {\r\n return result;\r\n })\r\n .catch((error: Error) => {\r\n ctx.trace(error.message);\r\n ctx.telemetry.exception(error);\r\n ctx.telemetry.debug('[getDeliveryOptionsForCartLineItems]Error executing action');\r\n throw new Error('[getDeliveryOptionsForCartLineItems]Error executing action');\r\n });\r\n}\r\n\r\nexport const getDeliveryOptionsForCartLineItemsDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/retail-actions/get-delivery-options-for-cartlines',\r\n action: >getDeliveryOptionsForCartLineItems,\r\n input: createInput\r\n});\r\n\r\nexport default getDeliveryOptionsForCartLineItemsDataAction;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nimport { IWLDCommunicationPreferences } from './DataServiceEntities.g';\r\nimport { getCommunicationPreferencesStatusAsync } from './DataActionExtension.g';\r\n\r\n/**\r\n * GetEmailSubscriptionsInput Input Action\r\n */\r\nexport class GetEmailSubscriptionsInput implements Msdyn365.IActionInput {\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `EmailSubscriptions`;\r\n public getCacheObjectType = () => 'EmailSubscriptions';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createEmailSubscripionsInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new GetEmailSubscriptionsInput();\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: GetEmailSubscriptionsInput, ctx: Msdyn365.IActionContext): Promise {\r\n // TODO: Uncomment the below line to get the value from a service\r\n const res = await getCommunicationPreferencesStatusAsync({ callerContext: ctx });\r\n return res;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'GetEmailSubscriptions',\r\n input: createEmailSubscripionsInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { getEstimatedAvailabilityAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { IProductInventoryInformation, mapAggregatedProductInventoryInformation } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { IActionContext } from '@msdyn365-commerce/core';\r\n\r\nexport interface IUomProductInventoryInput {\r\n productId: number;\r\n unitOfMeasure: string;\r\n}\r\n\r\nexport interface IUomProductFactor {\r\n productId: number;\r\n factor: number;\r\n}\r\n/**\r\n * GetInventoryUom Input Action\r\n */\r\nexport class GetInventoryUomInput implements Msdyn365.IActionInput {\r\n public products: IUomProductInventoryInput[];\r\n public multiUomProducts: IUomProductFactor[];\r\n constructor(products: IUomProductInventoryInput[], multiUomProducts: IUomProductFactor[]) {\r\n this.products = products;\r\n this.multiUomProducts = multiUomProducts;\r\n }\r\n public getCacheKey = () => `UNITOFMEASUREINVENTORY`;\r\n public getCacheObjectType = () => 'UNITOFMEASUREINVENTORY';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IGetInventoryUomData {\r\n productInventoryInformation: IProductInventoryInformation[];\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new GetInventoryUomInput([], []);\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: GetInventoryUomInput, ctx: Msdyn365.IActionContext): Promise {\r\n const multiUomProductIds = input.multiUomProducts.map(p => p.productId);\r\n const csProducts = input.products.filter(p => p.unitOfMeasure.toUpperCase() === 'CS').map(pr => pr.productId);\r\n const eaProducts = input.products\r\n .filter(p => p.unitOfMeasure.toUpperCase() === 'EA' || multiUomProductIds.includes(p.productId))\r\n .map(pr => pr.productId);\r\n const csAvailabilities = getAvailability(csProducts, 1, 'CS', ctx);\r\n const eaAvailabilities = getAvailability(eaProducts, 0, 'EA', ctx);\r\n const allAvailabilities = [];\r\n allAvailabilities.push(...(await csAvailabilities));\r\n allAvailabilities.push(...(await eaAvailabilities));\r\n\r\n return { productInventoryInformation: allAvailabilities };\r\n}\r\n\r\nconst getAvailability = async (productIds: number[], quantityUnitTypeValue: number, uom: string, ctx: IActionContext) => {\r\n if (!productIds.length) {\r\n return [];\r\n }\r\n const availabilities = await getEstimatedAvailabilityAsync(\r\n { callerContext: ctx },\r\n { ProductIds: productIds, DefaultWarehouseOnly: true, QuantityUnitTypeValue: quantityUnitTypeValue }\r\n );\r\n const availabilities2 = mapAggregatedProductInventoryInformation(ctx, availabilities);\r\n availabilities2.forEach(a => (a.ProductAvailableQuantity.UnitOfMeasure = uom));\r\n return availabilities2;\r\n};\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'GetInventoryUom',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { SalesOrder, SalesOrdersDataActions } from '@msdyn365-commerce/retail-proxy';\r\n\r\n/**\r\n * GetSalesOrderDetailBySalesid Input Action\r\n */\r\nexport class GetSalesOrderDetailBySalesIdInput implements Msdyn365.IActionInput {\r\n public salesId: string;\r\n constructor(salesId: string) {\r\n this.salesId = salesId;\r\n }\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `SALES-ORDER-DETAIL:${this.salesId}`;\r\n public getCacheObjectType = () => 'SALES-ORDER';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\nexport interface IGetSalesOrderDetailBySalesIdData {\r\n salesOrders: SalesOrder;\r\n}\r\n\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new GetSalesOrderDetailBySalesIdInput('');\r\n};\r\n\r\nasync function action(input: GetSalesOrderDetailBySalesIdInput, ctx: Msdyn365.IActionContext): Promise {\r\n return { salesOrders: await SalesOrdersDataActions.getSalesOrderDetailsBySalesIdAsync({ callerContext: ctx }, input.salesId || '') };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n id: 'GetSalesOrderDetailBySalesId',\r\n input: createInput\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n getCatalogId,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICommerceApiSettings,\r\n ICreateActionContext,\r\n IDictionary,\r\n IGeneric,\r\n IRequestContext\r\n} from '@msdyn365-commerce/core';\r\nimport { getByIdsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\nimport {\r\n ArrayExtensions,\r\n QueryResultSettingsProxy,\r\n buildCacheKey,\r\n generateProductImageUrl\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\n// import { buildCacheKey, generateProductImageUrl } from './utilities/utils';\r\n\r\n/**\r\n * Product Input.\r\n */\r\nexport class ProductInput implements IActionInput {\r\n public productId: number;\r\n\r\n public channelId: number;\r\n\r\n public warehouseId?: string;\r\n\r\n public catalogId?: number;\r\n\r\n private readonly apiSettings: ICommerceApiSettings;\r\n\r\n public constructor(\r\n productId: number | string,\r\n apiSettings: ICommerceApiSettings,\r\n channelId?: number,\r\n warehouseId?: string,\r\n requestContext?: IRequestContext,\r\n catalogId?: number\r\n ) {\r\n this.apiSettings = apiSettings;\r\n this.productId = +productId;\r\n this.channelId = channelId || apiSettings.channelId;\r\n this.warehouseId = warehouseId;\r\n this.catalogId = catalogId;\r\n\r\n if (requestContext && catalogId === undefined) {\r\n this.catalogId = getCatalogId(requestContext);\r\n }\r\n }\r\n\r\n public getCacheKey = () =>\r\n buildCacheKey(\r\n `RecordId-${this.productId.toString()}-ChannelId-${this.channelId.toString()}-WahehouseId-${this.warehouseId ?? ''}-${this\r\n .catalogId ?? 0}`,\r\n this.apiSettings\r\n );\r\n\r\n public getCacheObjectType = () => 'SimpleProduct';\r\n\r\n public dataCacheType = (): CacheType => 'application';\r\n}\r\n\r\n/**\r\n * Creates the input required to make the retail api call.\r\n * @param inputData\r\n */\r\nexport const createSimpleProductsInput = (inputData: ICreateActionContext>): IActionInput[] => {\r\n let productIds = inputData.config && inputData.config.productIds;\r\n if (!productIds) {\r\n return [];\r\n }\r\n\r\n productIds = typeof productIds === 'string' ? productIds.split(',') : productIds;\r\n return !Array.isArray(productIds)\r\n ? []\r\n : productIds.map((productId: string) => {\r\n return new ProductInput(productId, inputData.requestContext.apiSettings, undefined, undefined, inputData.requestContext);\r\n });\r\n};\r\n\r\n/**\r\n * Calls the Retail API and returns the product based on the passed ProductInput.\r\n * @param inputs\r\n * @param ctx\r\n */\r\nexport async function getSimpleProductsAction(inputs: ProductInput[], ctx: IActionContext): Promise {\r\n if (!ArrayExtensions.hasElements(inputs)) {\r\n ctx.trace('[getSimpleProductsAction] Invalid or empty inputs passed.');\r\n return [];\r\n }\r\n\r\n const productIdMapping: IDictionary = {};\r\n\r\n for (let index = 0; index < inputs.length; ++index) {\r\n productIdMapping[inputs[index].productId] = index;\r\n }\r\n\r\n const getProductPromises: Promise[] = [];\r\n const catalogIds = ArrayExtensions.unique(inputs.map(input => input.catalogId));\r\n const backupCatalogId = getCatalogId(ctx.requestContext);\r\n for (const catalogId of catalogIds) {\r\n const productInputs = inputs.filter(input => input.catalogId === catalogId);\r\n\r\n getProductPromises.push(\r\n getByIdsAsync(\r\n {\r\n callerContext: ctx,\r\n queryResultSettings: {\r\n ...QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(ctx),\r\n Paging: { Top: 1000 }\r\n }\r\n },\r\n inputs[0].channelId,\r\n productInputs.map(input => input.productId),\r\n inputs[0].warehouseId ?? null,\r\n catalogId !== 0 ? catalogId : backupCatalogId // catalogId ?? 0\r\n )\r\n );\r\n }\r\n\r\n const products = ArrayExtensions.flatten(await Promise.all(getProductPromises));\r\n const mappedProducts = products\r\n .map(product => {\r\n try {\r\n const newImageUrl = generateProductImageUrl(product, ctx.requestContext.apiSettings);\r\n\r\n if (newImageUrl) {\r\n product.PrimaryImageUrl = newImageUrl;\r\n }\r\n\r\n return product;\r\n } catch {\r\n ctx.trace('[getSimpleProductsAction] Unable to update ImageURL for Product');\r\n return undefined;\r\n }\r\n })\r\n .reduce((memo: SimpleProduct[], product: SimpleProduct | undefined) => {\r\n if (!product) {\r\n return memo;\r\n }\r\n const index = productIdMapping[product.RecordId];\r\n memo[index] = product;\r\n return memo;\r\n }, []);\r\n\r\n // NOTE: This is not an ideal fix, but will resolve all current issues\r\n return inputs.map(input => {\r\n const foundProduct = mappedProducts.find(product => product && product.RecordId === input.productId);\r\n return foundProduct || {};\r\n });\r\n}\r\n\r\nexport const getSimpleProductsDataAction = createObservableDataAction({\r\n action: >getSimpleProductsAction,\r\n id: '@msdyn365-commerce-modules/retail-actions/get-simple-products',\r\n input: createSimpleProductsInput\r\n});\r\n\r\nexport default getSimpleProductsDataAction;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { postEveUomRequestAsync } from './DataActionExtension.g';\r\nimport { IEveEachPrice, IEveEachPriceRequestMap } from './DataServiceEntities.g';\r\n\r\n/**\r\n * GetUom Input Action\r\n */\r\nexport class GetUomInput implements Msdyn365.IActionInput {\r\n public reqMap: IEveEachPriceRequestMap[];\r\n public catalogId: string | number;\r\n // TODO: Construct the input needed to run the action\r\n constructor(itemIds: IEveEachPriceRequestMap[], catalogId: string | number) {\r\n this.reqMap = itemIds;\r\n this.catalogId = catalogId;\r\n }\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `ITEMIDS:${this.reqMap.map(i => i.ProductItemId).join(';')}:CATID:${this.catalogId}`;\r\n public getCacheObjectType = () => 'UnitOfMeasure';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IGetUomData {\r\n prices: IEveEachPrice[];\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new GetUomInput([], 0);\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: GetUomInput, ctx: Msdyn365.IActionContext): Promise {\r\n return postEveUomRequestAsync({ callerContext: ctx }, input.reqMap, +input.catalogId);\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'GetUom',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { getZonePricesAsync } from './DataActionExtension.g';\r\nimport { IZonePricingEntity } from './DataServiceEntities.g';\r\n\r\n/**\r\n * GetZonePrices Input Action\r\n */\r\nexport class GetZonePricesInput implements Msdyn365.IActionInput {\r\n public shouldGetZonePrices: boolean;\r\n constructor(shouldGetZonePrices: boolean) {\r\n this.shouldGetZonePrices = shouldGetZonePrices;\r\n }\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `ZonePrices`;\r\n public getCacheObjectType = () => 'ZonePrices';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IGetZonePricesData {\r\n zones: IZonePricingEntity[];\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createZonePricesInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n // @ts-expect-error\r\n const shouldGetZonePrices: boolean = args.config?.shouldGetZonePrices;\r\n return new GetZonePricesInput(shouldGetZonePrices);\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: GetZonePricesInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // TODO: Uncomment the below line to get the value from a service\r\n if (input.shouldGetZonePrices) {\r\n const response = await getZonePricesAsync({ callerContext: ctx });\r\n return { zones: response };\r\n }\r\n return { zones: [] };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'GetZonePrices',\r\n input: createZonePricesInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { pastDueNoticeEntityAsync } from './DataActionExtension.g';\r\n\r\n/**\r\n * PastDueNotice Input Action\r\n */\r\nexport class PastDueNoticeInput implements Msdyn365.IActionInput {\r\n constructor() {}\r\n\r\n public getCacheKey = () => `PastDueNotice`;\r\n public getCacheObjectType = () => 'PastDueNotice';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\nexport interface IPastDueNoticeData {\r\n hasAccountInCredit: boolean;\r\n}\r\n\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new PastDueNoticeInput();\r\n};\r\n\r\nasync function action(input: PastDueNoticeInput, ctx: Msdyn365.IActionContext): Promise {\r\n if (!ctx.requestContext.user.isAuthenticated) {\r\n return { hasAccountInCredit: false };\r\n }\r\n const resp = await pastDueNoticeEntityAsync({ callerContext: ctx });\r\n return { hasAccountInCredit: resp.HasAccountInCredit };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n id: 'PastDueNotice',\r\n input: createInput\r\n});\r\n","import { IActionContext } from '@msdyn365-commerce/core-internal';\r\n\r\n/**\r\n * Gets Catalog ID from the action context object\r\n * @param context\r\n * @constructor\r\n */\r\nexport const GetCatalogIdFromContext = (context: IActionContext): number => {\r\n if (!context.requestContext.user) {\r\n return 0;\r\n }\r\n let catalogId =\r\n (context.requestContext.query && context.requestContext.query['catalogid'] && +context.requestContext.query['catalogid']) || 0;\r\n if (catalogId === 0) {\r\n catalogId = (context.requestContext.user.catalogId && +context.requestContext.user.catalogId) || 0;\r\n }\r\n\r\n return catalogId;\r\n};\r\n","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n { \n const actionPath = 'actions/add-order-template-to-cart-override.action';\n binding.dataActions[actionPath] = require('partner/actions/add-order-template-to-cart-override.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-availabilities-cartlines-override.action';\n binding.dataActions[actionPath] = require('partner/actions/get-availabilities-cartlines-override.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-delivery-options-for-cart-override.action';\n binding.dataActions[actionPath] = require('partner/actions/get-delivery-options-for-cart-override.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-email-subscriptions.action';\n binding.dataActions[actionPath] = require('partner/actions/get-email-subscriptions.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-inventory-uom.action';\n binding.dataActions[actionPath] = require('partner/actions/get-inventory-uom.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-sales-order-detail-by-salesid.action';\n binding.dataActions[actionPath] = require('partner/actions/get-sales-order-detail-by-salesid.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-simple-products.override.action';\n binding.dataActions[actionPath] = require('partner/actions/get-simple-products.override.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-uom.action';\n binding.dataActions[actionPath] = require('partner/actions/get-uom.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-zone-prices.action';\n binding.dataActions[actionPath] = require('partner/actions/get-zone-prices.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/past-due-notice.action';\n binding.dataActions[actionPath] = require('partner/actions/past-due-notice.action');\n registerActionId(actionPath);\n }\n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.packageDataActions = {};\n window.__bindings__.packageDataActions['__local__'] = {\n ...binding.dataActions\n };","module.exports = React;","module.exports = ReactDOM;"],"names":["AddOrderTemplateToCartInput","constructor","orderTemplateId","getCacheKey","getCacheObjectType","dataCacheType","this","addOrderTemplateToCartInput","inputData","requestContext","user","isAuthenticated","Error","async","addOrderTemplateToCartAction","input","context","cartState","getCartState","catalogId","GetCatalogIdFromContext","chunkCount","queryResultSettings","Paging","Top","Skip","getPaginatedOrderTemplateLinesInput","GetPaginatedOrderTemplateLinesInput","orderTemplateLines","getPaginatedOrderTemplateLinesAction","addedCartLines","skip","lines","length","cartLines","map","productLine","_productLine$fullProd","ItemId","fullProduct","ProductDetails","ProductId","productListLine","Quantity","TrackingId","UnitOfMeasureSymbol","UnitOfMeasure","CatalogId","addCartLinesAsync","callerContext","cart","Id","Version","catch","error","_error$data","_error$data2","telemetry","trace","data","ValidationResults","concat","refreshCart","addOrderTemplateToCartActionDataAction","createObservableDataAction","id","action","ProductAvailabilitiesForCartLineItems","apiSettings","buildCacheKey","getDeliveryMode","cartLine","_channelDeliveryOptio","featureSate","arguments","undefined","channelDeliveryOptionConfig","pickupDeliveryMode","DeliveryMode","PickupDeliveryModeCodes","find","deliveryMode","getAvailabilitiesForCartLineItems","ctx","shippingItems","bopisItems","productAvailabilities","channelConfiguration","getOrgUnitConfigurationAsync","products","getActiveCartProductsAction","ActiveCartProductsInput","PickupDeliveryModeCode","EmailDeliveryModeCode","CartLines","push","csProducts","eaProducts","forEach","cl","ArrayExtensions","unique","availabilities1","getAvailability","availabilities2","productWarehouses","bopisItem","productWarehouse","InventLocationId","WarehouseId","channel","InventLocationDataAreaId","DataAreaId","quantityUnitTypeSales","getProductWarehouseAvail","getEstimatedProductWarehouseAvailabilityAsync","bypassCache","ProductWarehouseInventoryAvailabilities","productWarehouseMapping","mapProductInventoryInformation","item","productIds","quantityUnitTypeValue","uom","availabilities","getEstimatedAvailabilityAsync","ProductIds","DefaultWarehouseOnly","QuantityUnitTypeValue","mapAggregatedProductInventoryInformation","a","ProductAvailableQuantity","getAvailabilitiesForCartLineItemsDataAction","QueryResultSettingsProxy","config","fromModuleData","sortingCriteria","query","top","Number","itemsPerPage","Sorting","_config$itemsPerPage","_inputData$requestCon","_inputData$requestCon2","parseInt","app","platform","defaultPageSizeForAPI","Columns","column","ColumnName","IsDescending","join","ProductDeliveryOptionsForCartLineItems","getDeliveryOptionsForCartLineItems","ProductsDataActions","getPagingFromInputDataOrDefaultValue","x","RecordId","filter","then","result","message","exception","debug","getDeliveryOptionsForCartLineItemsDataAction","GetEmailSubscriptionsInput","Msdyn365","getCommunicationPreferencesStatusAsync","args","GetInventoryUomInput","multiUomProducts","multiUomProductIds","p","productId","unitOfMeasure","toUpperCase","pr","includes","csAvailabilities","eaAvailabilities","allAvailabilities","productInventoryInformation","GetSalesOrderDetailBySalesIdInput","salesId","salesOrders","SalesOrdersDataActions","ProductInput","channelId","warehouseId","_this$warehouseId","_this$catalogId","toString","getCatalogId","createSimpleProductsInput","split","Array","isArray","getSimpleProductsAction","inputs","hasElements","productIdMapping","index","getProductPromises","catalogIds","backupCatalogId","_inputs$0$warehouseId","productInputs","getByIdsAsync","_objectSpread","mappedProducts","flatten","Promise","all","product","newImageUrl","generateProductImageUrl","PrimaryImageUrl","_unused","reduce","memo","getSimpleProductsDataAction","GetUomInput","itemIds","reqMap","i","ProductItemId","postEveUomRequestAsync","GetZonePricesInput","shouldGetZonePrices","zones","getZonePricesAsync","_args$config","PastDueNoticeInput","hasAccountInCredit","pastDueNoticeEntityAsync","HasAccountInCredit","binding","modules","dataActions","registerActionId","actionPath","default","prototype","Object","keys","exportName","Action","require","window","__bindings__","packageDataActions","module","exports","React","ReactDOM"],"sourceRoot":""}