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EAAKd,eAAe0C,MAAM8S,OAC3F5V,EAAMqB,oBAAoBU,OAAO8T,MAAQ3U,EAAKd,eAAe0C,MAAM8S,MAGvE5V,EAAMqB,oBAAoB6P,OAAQ,EAE3BlR,KAyVX","sources":["webpack://Msdyn365.Commerce.Online/external var \"React\"?0d3b","webpack://Msdyn365.Commerce.Online/external var \"ReactDOM\"?853b","webpack://Msdyn365.Commerce.Online/./src/actions/get-product-attributes-cartlines.action.ts?e311","webpack://Msdyn365.Commerce.Online/./src/actions/payment-state-share.action.ts?5a06","webpack://Msdyn365.Commerce.Online/./src/modules/search-result-container/actions/base-collection-action.ts?ec13","webpack://Msdyn365.Commerce.Online/./src/actions/get-product-active-prices.action.ts?7ea5","webpack://Msdyn365.Commerce.Online/./src/actions/GetCustomerAddress.action.ts?d507","webpack://Msdyn365.Commerce.Online/./src/actions/getCustomer.action.ts?8843","webpack://Msdyn365.Commerce.Online/./src/modules/search-result-container/actions/url-utils.ts?1541","webpack://Msdyn365.Commerce.Online/./src/modules/search-result-container/actions/get-product-refiner-hierarchy.ts?3937","webpack://Msdyn365.Commerce.Online/./src/actions/getStateCity.action.ts?af75","webpack://Msdyn365.Commerce.Online/./src/modules/search-result-container/actions/get-inventory-refiners.ts?eaa4","webpack://Msdyn365.Commerce.Online/./src/actions/createAddProductListLines.action.ts?f99f","webpack://Msdyn365.Commerce.Online/./src/actions/get-products.action.ts?435e","webpack://Msdyn365.Commerce.Online/./src/actions/get-invoices.action.ts?51f9","webpack://Msdyn365.Commerce.Online/./src/actions/addproductlistlines.action.ts?a127","webpack://Msdyn365.Commerce.Online/./src/actions/searchOrderHistoryByPO.action.ts?2d70","webpack://Msdyn365.Commerce.Online/./lib/__local__/module-registration.js?8a42","webpack://Msdyn365.Commerce.Online/./src/actions/get-full-products-by-collection.override.action.ts?2b4a"],"sourcesContent":["module.exports = React;","module.exports = ReactDOM;","/*!\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 { AttributeValue } from '@msdyn365-commerce/retail-proxy';\r\nimport { getCatalogId } from '@msdyn365-commerce/core';\r\nimport { getAttributeValuesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\n/**\r\n * GetProductAttributesCartlines Input Action\r\n */\r\nexport class GetProductAttributesCartlinesInput implements Msdyn365.IActionInput {\r\n public productID: number;\r\n constructor(productID: number) {\r\n this.productID = productID;\r\n }\r\n\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `getProductAttributeCartline`;\r\n public getCacheObjectType = () => 'getProductAttributeCartline';\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 IGetProductAttributesCartlinesData {\r\n productAttributes: AttributeValue[];\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\nexport async function getProductAttributeCartlineAction(\r\n input: GetProductAttributesCartlinesInput,\r\n ctx: Msdyn365.IActionContext\r\n): Promise {\r\n const catalogId = getCatalogId(ctx.requestContext);\r\n const channelID = +ctx.requestContext.apiSettings.channelId;\r\n\r\n const attributeValueResponse = await getAttributeValuesAsync({ callerContext: ctx }, input.productID, channelID, catalogId);\r\n return { productAttributes: attributeValueResponse };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getProductAttributeCartlineAction,\r\n id: 'GetProductAttributesCartlines'\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\n\r\n/**\r\n * PaymentStateShare Input Action\r\n */\r\nexport class PaymentStateShareInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n constructor() {}\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 = () => `payment-state-share`;\r\n public getCacheObjectType = () => 'payment-state-share';\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 IPaymentStateShareData {\r\n isAccountPaymentSelected: boolean;\r\n isCreditCardSelected: boolean;\r\n shouldApplyOnAccountPayment: boolean;\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 PaymentStateShareInput();\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: PaymentStateShareInput, 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 // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { isAccountPaymentSelected: true, isCreditCardSelected: false, shouldApplyOnAccountPayment: false };\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: 'PaymentStateShare',\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","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { CacheType, getCatalogId, IActionInput, IAny, ICommerceApiSettings, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\nimport { IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\nimport {\n convertToString,\n ChannelInventoryConfiguration,\n IQueryResultSettings,\n ProductRefinerValue,\n SortColumn\n} from '@msdyn365-commerce/retail-proxy';\nimport { generateCacheKey, QueryResultSettingsProxy } from '@msdyn365-commerce-modules/retail-actions';\nimport { toJS } from 'mobx';\n\nimport { hydrateRefinersFromUrl } from './url-utils';\n\n/**\n * Export listPageType.\n */\nexport type listPageType = 'Category' | 'Search' | 'Unknown';\n\n/**\n * Get include attributes from config.\n * @param inputData - ICreateActionContext.\n * @returns Boolean.\n */\nfunction getIncludeAttributes(inputData: ICreateActionContext, IGeneric>): boolean {\n if (process.env.NODE_ENV === 'development' && process.env.ENABLE_CLOUD_SEARCH?.toLowerCase() !== 'true') {\n return false;\n }\n\n if (inputData && inputData.config && inputData.config.includeAttributes !== undefined && inputData.config.includeAttributes === true) {\n return true;\n }\n return false;\n}\n\n/**\n * Get updateRefinerPanel from config.\n * @param inputData - ICreateActionContext.\n * @returns Boolean.\n */\nfunction getUpdateRefinerPanel(inputData: ICreateActionContext, IGeneric>): boolean {\n return !!inputData.config?.updateRefinerPanel;\n}\n\n/**\n * BaseCollection Action Input.\n */\nexport class BaseCollectionInput implements IActionInput {\n public pageType: listPageType;\n\n public category: number | undefined;\n\n public searchText: string | undefined;\n\n public refiners: ProductRefinerValue[];\n\n public queryResultSettings: IQueryResultSettings;\n\n public apiSettings: ICommerceApiSettings;\n\n public includeAttributes: boolean | undefined;\n\n public locale?: string;\n\n public isUpdateRefinerPanel?: boolean;\n\n public catalogId?: number;\n\n public channelInventoryConfiguration?: ChannelInventoryConfiguration;\n\n public inventoryRefiner?: IProductRefinerHierarchy;\n\n public constructor(\n pageType: listPageType,\n apiSettings: ICommerceApiSettings,\n queryResultSettings: IQueryResultSettings,\n refiners: ProductRefinerValue[],\n category: number | undefined,\n searchText: string | undefined,\n includeAttributes: boolean | undefined,\n isUpdateRefinerPanel?: boolean | undefined,\n locale?: string,\n catalogId?: number,\n channelInventoryConfiguration?: ChannelInventoryConfiguration,\n inventoryRefiner?: IProductRefinerHierarchy\n ) {\n this.pageType = pageType;\n this.apiSettings = apiSettings;\n this.category = category;\n this.searchText = searchText;\n this.queryResultSettings = queryResultSettings;\n this.refiners = refiners;\n this.includeAttributes = includeAttributes;\n this.isUpdateRefinerPanel = isUpdateRefinerPanel;\n this.locale = locale;\n this.catalogId = catalogId ?? 0;\n this.channelInventoryConfiguration = channelInventoryConfiguration;\n this.inventoryRefiner = inventoryRefiner;\n }\n\n public getCacheKey = () => {\n const queryResultSettings = {\n ...this.queryResultSettings.Paging,\n ...toJS(this.queryResultSettings.Sorting)\n };\n\n const cacheKey = generateCacheKey(\n this.apiSettings,\n { key: 'PageType', value: this.pageType },\n { key: 'Category', value: this.category },\n { key: 'SearchText', value: this.searchText },\n { key: 'CatalogId', value: this.catalogId },\n {\n key: 'Refiners',\n value: this.refiners.map(\n refiner =>\n `RefinerRecordId:${refiner.RefinerRecordId}-LeftValueBoundString:${refiner.LeftValueBoundString ||\n ''}-RightValueBoundString:${refiner.RightValueBoundString || ''}`\n )\n },\n { key: 'QueryResultSettings', value: convertToString(queryResultSettings) },\n { key: 'Locale', value: this.locale }\n );\n return cacheKey;\n };\n\n public getCacheObjectType = () => 'CollectionActionResult';\n\n public dataCacheType = (): CacheType => 'request';\n}\n\n// TODO: Create a data model here or import one to capture the response of the action\nexport interface IGetFullProductsByCollectionData {\n text: string;\n}\n\nexport type CollectionClassConstructor = new (\n pageType: listPageType,\n apiSettings: ICommerceApiSettings,\n queryResultSettings: IQueryResultSettings,\n refiners: ProductRefinerValue[],\n category: number | undefined,\n searchText: string | undefined,\n includeAttributes: boolean | undefined,\n isUpdateRefinerPanel?: boolean | undefined,\n locale?: string,\n catalogId?: number,\n channelInventoryConfiguration?: ChannelInventoryConfiguration,\n inventoryRefiner?: IProductRefinerHierarchy\n) => BaseCollectionInput;\n\n/**\n * TODO: Use this function to create the input required to make the action call.\n * @param args\n * @param inputClassConstuctor\n */\nexport const createBaseCollectionInput = (\n args: ICreateActionContext,\n inputClassConstuctor: CollectionClassConstructor\n): BaseCollectionInput => {\n const pageType =\n args.requestContext.urlTokens.pageType === 'Category' || (args.requestContext.query && args.requestContext.query.categoryId)\n ? 'Category'\n : 'Search';\n\n const queryResultSettings = QueryResultSettingsProxy.fromInputData(args).QueryResultSettings;\n const queryRefiners = hydrateRefinersFromUrl(args.requestContext);\n const includeAttributes = getIncludeAttributes(args);\n const isUpdateRefinerPanel = getUpdateRefinerPanel(args);\n const catalogId = getCatalogId(args.requestContext);\n\n if (args.requestContext.query && args.requestContext.query.sorting) {\n queryResultSettings.Sorting = { Columns: JSON.parse(decodeURIComponent(args.requestContext.query.sorting)) };\n }\n\n if (pageType === 'Category') {\n return new inputClassConstuctor(\n pageType,\n args.requestContext.apiSettings,\n queryResultSettings,\n queryRefiners,\n +(args.requestContext.urlTokens.itemId || (args.requestContext.query && args.requestContext.query.categoryId) || 0),\n undefined,\n includeAttributes,\n isUpdateRefinerPanel,\n args.requestContext.locale,\n catalogId\n );\n } else if (pageType === 'Search' && args.requestContext.query && args.requestContext.query.q) {\n return new inputClassConstuctor(\n pageType,\n args.requestContext.apiSettings,\n queryResultSettings,\n queryRefiners,\n undefined,\n args.requestContext.query.q,\n includeAttributes,\n isUpdateRefinerPanel,\n args.requestContext.locale,\n catalogId\n );\n } else if (pageType === 'Search' && args.requestContext.query && args.requestContext.query.recommendation) {\n let searchText = '';\n if (args.requestContext.query.productId) {\n searchText = JSON.stringify({\n ProductId: args.requestContext.query.productId,\n Recommendation: args.requestContext.query.recommendation\n });\n } else {\n searchText = JSON.stringify({ Recommendation: args.requestContext.query.recommendation });\n }\n return new inputClassConstuctor(\n pageType,\n args.requestContext.apiSettings,\n queryResultSettings,\n queryRefiners,\n undefined,\n searchText,\n includeAttributes,\n isUpdateRefinerPanel,\n args.requestContext.locale,\n catalogId\n );\n } else if (pageType === 'Search' && args.requestContext.query && args.requestContext.query.discountIds) {\n const searchText = JSON.stringify({ DiscountIds: args.requestContext.query.discountIds });\n return new inputClassConstuctor(\n pageType,\n args.requestContext.apiSettings,\n queryResultSettings,\n queryRefiners,\n undefined,\n searchText,\n includeAttributes,\n isUpdateRefinerPanel,\n args.requestContext.locale,\n catalogId\n );\n }\n\n throw new Error('[getFullProductsForCollection]Unable to create input');\n};\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 { getCatalogId } from '@msdyn365-commerce/core';\r\nimport { ProductPrice } from '@msdyn365-commerce/retail-proxy';\r\nimport { getActivePricesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\n\r\n/**\r\n * GetProductActivePrices Input Action\r\n */\r\nexport class GetProductActivePricesInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n public productIDs: number[];\r\n constructor(productIDs: number[]) {\r\n this.productIDs = productIDs;\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 = () => `GetActivePrices`;\r\n public getCacheObjectType = () => 'GetActivePrices';\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 IGetProductActivePricesData {\r\n activePrices: ProductPrice[];\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 getActivePricesAction(\r\n input: GetProductActivePricesInput,\r\n ctx: Msdyn365.IActionContext\r\n): Promise {\r\n const catalogId = getCatalogId(ctx.requestContext);\r\n const projectDomain = {\r\n ChannelId: +ctx.requestContext.apiSettings.channelId,\r\n CatalogId: catalogId\r\n };\r\n const activePricesResponse = await getActivePricesAsync(\r\n { callerContext: ctx },\r\n projectDomain,\r\n input.productIDs,\r\n new Date(),\r\n null,\r\n null,\r\n true,\r\n null,\r\n true\r\n ).then(productPrices => {\r\n return productPrices;\r\n });\r\n return { activePrices: activePricesResponse };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getActivePricesAction,\r\n id: 'GetProductActivePrices'\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 { getCustomerAddressAsync } from './SearchItemsDataActionExtension.g';\r\nimport { IITSCustomerAddressResponse } from './SearchItemsDataServiceEntities.g';\r\n\r\n/**\r\n * Getaddresses Input Action\r\n */\r\n\r\nexport interface IITSCutomerAddressInput extends Msdyn365.IActionInput {\r\n customerAccount: string;\r\n}\r\nexport class GetaddressesInput implements Msdyn365.IActionInput {\r\n public customerAccount: string;\r\n // TODO: Construct the input needed to run the action\r\n constructor(customerAccount: string) {\r\n this.customerAccount = customerAccount;\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 = () => `GetCustomerAddress`;\r\n public getCacheObjectType = () => 'GetCustomerAddress';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\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\nexport async function getCustomerAddressesAction(\r\n request: IITSCutomerAddressInput,\r\n ctx: Msdyn365.IActionContext\r\n): Promise {\r\n if (request.customerAccount) {\r\n try {\r\n const result = await getCustomerAddressAsync({ callerContext: ctx }, request.customerAccount);\r\n if (result) {\r\n return result;\r\n }\r\n } catch (error) {\r\n console.log('Error', error);\r\n }\r\n }\r\n return null;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getCustomerAddressesAction,\r\n // TODO: Give your data action a unique id\r\n id: `GetCustomerAddress`\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 {\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 { Customer, CustomersDataActions } from '@msdyn365-commerce/retail-proxy';\r\n\r\nimport { buildCacheKey } from '@msdyn365-commerce-modules/retail-actions';\r\n\r\n/**\r\n * Input class for get customer data action.\r\n */\r\nexport class GetCustomerInput implements IActionInput {\r\n public customerAccountNumber?: string;\r\n\r\n private readonly apiSettings: ICommerceApiSettings;\r\n\r\n private readonly cacheType?: CacheType;\r\n\r\n public constructor(apiSettings: ICommerceApiSettings, accountNumber?: string, cacheType?: CacheType) {\r\n this.customerAccountNumber = accountNumber;\r\n this.apiSettings = apiSettings;\r\n this.cacheType = cacheType;\r\n }\r\n\r\n /**\r\n * GetCacheKey.\r\n * @returns - Returns string.\r\n */\r\n public getCacheKey = (): string => buildCacheKey(`Customer-${this.customerAccountNumber}`, this.apiSettings);\r\n\r\n /**\r\n * GetCacheObjectType.\r\n * @returns - Cache Object Type string.\r\n */\r\n public getCacheObjectType = (): string => 'Customer';\r\n\r\n /**\r\n * DataCacheType.\r\n * @returns - CacheType string.\r\n */\r\n public dataCacheType = (): CacheType => {\r\n return this.cacheType ? this.cacheType : 'request';\r\n };\r\n}\r\n\r\n/**\r\n * Creates the input required to make the retail api call.\r\n * @param inputData -- The input data passed to the createInput method.\r\n * @returns - ProductAvailabilitiesForSelectedVariant or error.\r\n */\r\nconst createInput = (inputData: ICreateActionContext>): GetCustomerInput => {\r\n const { user, apiSettings } = inputData.requestContext;\r\n if (!user.token || !user.isAuthenticated) {\r\n throw new Error('[getCustomer][createInput]: User is not Authenticated.');\r\n }\r\n\r\n return new GetCustomerInput(apiSettings);\r\n};\r\n\r\n/**\r\n * GetCustomerAction.\r\n * @param input - GetCustomerInput.\r\n * @param ctx - Action Context.\r\n * @returns - Customer information.\r\n */\r\nconst getCustomerAction = async (input: GetCustomerInput, ctx: IActionContext): Promise => {\r\n if (input && ctx.requestContext.user.isAuthenticated) {\r\n // TO-DO- Need to clean up this code once SDK releases new proxy that handles null.\r\n return CustomersDataActions.readAsync({ callerContext: ctx, bypassCache: 'get' }, input.customerAccountNumber || '').then(\r\n response => {\r\n return Array.isArray(response) ? response[0] : response;\r\n }\r\n );\r\n }\r\n\r\n ctx.trace('[getCustomer]Invalid input passed to action');\r\n return {};\r\n};\r\n\r\n/**\r\n * The customer data action.\r\n */\r\nexport const getCustomerActionDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/retail-actions/get-customer',\r\n action: >getCustomerAction,\r\n input: createInput\r\n});\r\n\r\nexport default getCustomerActionDataAction;\r\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport MsDyn365, { IRequestContext } from '@msdyn365-commerce/core';\nimport { ProductRefinerValue, SortColumn } from '@msdyn365-commerce/retail-proxy';\n\n/**\n * Refiner Compression:\n * Refiners contains a non-trivial amount of data that is required to successfully make\n * a refiner-based API call. To allow for deep-linking of refiners in the URL, refiner data\n * must be compressed so that URL max length is not exceeded. Refiners will be compressed into\n * the following array style index-based format:\n * [DataTypeValue, LeftValueBoundString, RefinerRecordId, RefinerSourceValue, RightValueBoundString, UnitText].\n */\nconst compressedRefinerKeys = [\n 'DataTypeValue',\n 'LeftValueBoundString',\n 'RefinerRecordId',\n 'RefinerSourceValue',\n 'RightValueBoundString',\n 'UnitText',\n // Added RowNumber to identify if custom range integer or API values option is selected\n 'RowNumber'\n];\n\n/**\n * Hydrates compressed refiner data from URL.\n * @param fullUrl The full URL of the page.\n * @param requestContext\n */\nexport const hydrateRefinersFromUrl = (requestContext: IRequestContext): ProductRefinerValue[] => {\n const compressedRefinerArray = parseQueryParam<(string | number)[][]>('refiners', requestContext);\n if (!compressedRefinerArray || compressedRefinerArray.length === 0) {\n return [];\n }\n\n return compressedRefinerArray\n .map(compressedRefiner => {\n try {\n const parsedRefiner: ProductRefinerValue = {};\n compressedRefinerKeys.forEach((refinerKey, index) => {\n parsedRefiner[refinerKey] = compressedRefiner[index];\n });\n return parsedRefiner;\n } catch {\n return undefined;\n }\n })\n .filter(Boolean);\n};\n\n/**\n * Compressed a list of refiners for use in URLs.\n * @param refiners The uncompressed refiners.\n */\nexport const compressRefiners = (refiners: ProductRefinerValue[]) => {\n const compressedRefiners: (string | number)[][] = [];\n\n refiners.forEach(refiner => {\n const compressedRefiner: (string | number)[] = [];\n compressedRefinerKeys.forEach(refinerKey => {\n compressedRefiner.push(refiner[refinerKey]);\n });\n compressedRefiners.push(compressedRefiner);\n });\n\n return compressedRefiners;\n};\n\n/**\n * Method which creates a URL contiaining serialized active refiners.\n * @param fullUrl The Current URL of the page.\n * @param refiners The refiners which should be added to the URL.\n * @param sortingColumns\n * @param skipCount\n */\nexport const buildListPageUrl = (fullUrl: URL, refiners?: ProductRefinerValue[], sortingColumns?: SortColumn[], skipCount?: number) => {\n // Refiner Change flow\n if (refiners !== undefined) {\n if (refiners.length === 0) {\n fullUrl.searchParams.delete('refiners');\n } else {\n const sortedRefiners = refiners.sort((first, second) =>\n first.RefinerRecordId && second.RefinerRecordId && first.RefinerRecordId > second.RefinerRecordId ? 1 : -1\n );\n fullUrl.searchParams.set('refiners', JSON.stringify(compressRefiners(sortedRefiners)));\n }\n\n // Adding or removing a refiner means we want to always load page 1\n fullUrl.searchParams.delete('skip');\n return fullUrl.href;\n }\n\n if (sortingColumns !== undefined) {\n if (sortingColumns.length === 0) {\n fullUrl.searchParams.delete('sorting');\n } else {\n fullUrl.searchParams.set('sorting', JSON.stringify(sortingColumns));\n }\n\n // Changing the sort means always load page 1\n fullUrl.searchParams.delete('skip');\n return fullUrl.href;\n }\n\n if (skipCount) {\n fullUrl.searchParams.set('skip', skipCount.toString());\n }\n\n return fullUrl.href;\n};\n\n/**\n * Parses a query param from the query object of the request context.\n * @param key The query parameter key.\n * @param requestContext The request context.\n */\nexport const parseQueryParam = (key: string, requestContext: IRequestContext): T | null => {\n if (requestContext.query && requestContext.query[key]) {\n return JSON.parse(decodeURIComponent(requestContext.query[key]));\n }\n return null;\n};\n\n/**\n * Gets the current URL of the page from the request context.\n * @param requestContext The request context.\n */\nexport const getCurrentUrl = (requestContext: IRequestContext): URL => {\n if (MsDyn365.isBrowser) {\n return new URL(window.location.href);\n }\n\n // NOTE: Typing on requestURL is incorrect\n if (requestContext.url.requestUrl.href) {\n return new URL(requestContext.url.requestUrl.href);\n }\n return new URL((requestContext.url.requestUrl));\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { IQueryResultSettings, ProductRefiner, ProductSearchCriteria } from '@msdyn365-commerce/retail-proxy';\nimport { getProductSearchRefinersAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\n\n/**\n * Uses Bulk refiner API to get refiners and child refiner values.\n * @param searchCriteria Product search criteria.\n * @param maxItems Max items.\n * @param queryResultSettings\n * @param ctx Action context.\n */\nexport async function getProductRefinerHierarchy(\n searchCriteria: ProductSearchCriteria,\n queryResultSettings: IQueryResultSettings,\n ctx: IActionContext\n): Promise {\n return getProductSearchRefinersAsync({ callerContext: ctx, queryResultSettings }, searchCriteria).then(\n (productRefiners: ProductRefiner[]) => {\n if (!productRefiners) {\n ctx.trace('[getRefinersByCriteriaAction] returned no refiners');\n return [];\n }\n\n const result = (productRefiners || []).map((productRefiner: ProductRefiner) => productRefiner);\n\n if (result.length === 0) {\n ctx.trace('[getRefinersByCriteriaAction] returned no IProductRefinerHierarchy objects');\n return [];\n }\n\n return result;\n }\n );\n}\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 { getStateCityAsync } from './SearchItemsDataActionExtension.g';\r\nimport { IStatesEntity } from './SearchItemsDataServiceEntities.g';\r\n\r\n/**\r\n * Getaddresses Input Action\r\n */\r\n\r\nexport interface IITSStateCityInput extends Msdyn365.IActionInput {\r\n zipCode: string;\r\n}\r\nexport class GetZipCodeInput implements Msdyn365.IActionInput {\r\n public zipCode: string;\r\n // TODO: Construct the input needed to run the action\r\n constructor(zipCode: string) {\r\n this.zipCode = zipCode;\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 = () => `getStateCity`;\r\n public getCacheObjectType = () => 'getStateCity';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\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\nexport async function getStateCityAction(request: IITSStateCityInput, ctx: Msdyn365.IActionContext): Promise {\r\n if (request.zipCode) {\r\n try {\r\n const result = await getStateCityAsync({ callerContext: ctx }, request.zipCode); //calling getStateCityAsync API\r\n if (result) {\r\n return result;\r\n }\r\n } catch (error) {\r\n console.log('Error', error);\r\n }\r\n }\r\n return null;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getStateCityAction,\r\n // TODO: Give your data action a unique id\r\n id: `getStateCity`\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","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\nimport { CacheType, createObservableDataAction, IAction, IActionContext, IActionInput } from '@msdyn365-commerce/core';\nimport { buildCacheKey } from '@msdyn365-commerce-modules/retail-actions';\n\nimport {\n AttributeDataType,\n ChannelInventoryConfiguration,\n ProductRefinerSource,\n ProductRefinerValue\n} from '@msdyn365-commerce/retail-proxy';\nimport { BaseCollectionInput } from './base-collection-action';\nimport { getProductRefinerHierarchy } from './get-product-refiner-hierarchy';\n\n/**\n * Returns inventory in stock sortable refiner value.\n * @param channelInventoryConfiguration - The channelInventoryConfiguration.\n * @param isInStock - The flag indicating whether is getting in-stock refiner or out-of-stock refiner.\n * @returns Refiners.\n */\nexport const getInventorySortableRefinerValue = (\n channelInventoryConfiguration: ChannelInventoryConfiguration,\n isInStock: boolean\n): ProductRefinerValue | undefined => {\n if (channelInventoryConfiguration && channelInventoryConfiguration.ProductAvailabilitySortableAttributeRecordId) {\n return {\n RefinerRecordId: channelInventoryConfiguration.ProductAvailabilitySortableAttributeRecordId,\n DataTypeValue: AttributeDataType.TrueFalse,\n LeftValueBoundString: isInStock ? 'true' : 'false',\n RightValueBoundString: isInStock ? 'true' : 'false',\n UnitText: '',\n RowNumber: 0,\n Count: 0,\n ExtensionProperties: [],\n RefinerSourceValue: ProductRefinerSource.Attribute\n };\n }\n return undefined;\n};\n\n/**\n * InventoryInStockRefinerValue Input action.\n * @remark The get-inventory-refiners data action is obsoleted. Please use getInventorySortableRefinerValue instead.\n */\nexport class InventoryInStockRefinerValueInput extends BaseCollectionInput implements IActionInput {\n public inventoryProductAttributeRecordId: number;\n\n public constructor(input: BaseCollectionInput, inventoryProductAttributeRecordId: number = 0) {\n super(\n input.pageType,\n input.apiSettings,\n {\n count: true\n },\n\n // Parameter - refiners\n [],\n\n // Parameter - category\n undefined,\n\n // Parameter - searchText\n '',\n\n // Parameter - includeAttributes\n false,\n\n // Parameter - isUpdateRefinerPanel\n false,\n\n // Parameter - locale\n undefined,\n input.catalogId,\n input.channelInventoryConfiguration,\n input.inventoryRefiner\n );\n\n this.inventoryProductAttributeRecordId =\n inventoryProductAttributeRecordId || input.channelInventoryConfiguration?.InventoryProductAttributeRecordId || 0;\n }\n\n /**\n * GetCacheKey.\n * @returns - Returns string.\n */\n public getCacheKey = (): string => buildCacheKey('RefinerList', this.apiSettings);\n\n /**\n * GetCacheObjectType.\n * @returns - Returns string.\n */\n public getCacheObjectType = (): string => 'RefinerList';\n\n /**\n * DataCacheType.\n * @returns - CacheType string.\n */\n public dataCacheType = (): CacheType => 'application';\n}\n\n/**\n * Action method returns inventory in stock refiners.\n * @param input - InventoryInStockRefinerValueInput.\n * @param context - IActionContext.\n * @returns - Promise.\n * @remark The get-inventory-refiners data action is obsoleted. Please use getInventorySortableRefinerValue instead.\n */\nasync function action(input: InventoryInStockRefinerValueInput, context: IActionContext): Promise {\n const refiners = await getProductRefinerHierarchy(\n {\n Context: {\n ChannelId: input.apiSettings.channelId,\n CatalogId: input.catalogId\n }\n },\n input.queryResultSettings,\n context\n );\n\n // InventoryProductAttributeRecordId may be 0, and recId of default refiner Category/Price/Rating is always 0 by design. In this case, we should not return refiner\n // Why recId of default refiner Category/Price/Rating is 0: see GetChannelProductRefiners.sql\n return (\n (input.channelInventoryConfiguration?.InventoryProductAttributeRecordId !== 0 &&\n refiners.find(refiner => refiner.RecordId === input.channelInventoryConfiguration?.InventoryProductAttributeRecordId)) ||\n // keep legacy logic to avoid break existing customers usage from this file\n (input.inventoryProductAttributeRecordId !== 0 &&\n refiners.find(refiner => refiner.RecordId === input.inventoryProductAttributeRecordId)) ||\n null\n );\n}\n\n/**\n * Action.\n * @param id - Id.\n * @param action - Action.\n * @returns - Results.\n * @remark The get-inventory-refiners data action is obsoleted. Please use getInventorySortableRefinerValue instead.\n */\nexport const actionDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/search-result-container/get-inventory-refiners',\n action: action as IAction\n});\n\nexport default actionDataAction;\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 { ProductList } from '@msdyn365-commerce/retail-proxy';\r\nimport { createProductListAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductListsDataActions.g';\r\n/**\r\n * GetProductAttributesCartlines Input Action\r\n */\r\nexport class CreateAddProductListLinesInput implements Msdyn365.IActionInput {\r\n public productListEntity: ProductList;\r\n constructor(productListEntity: ProductList) {\r\n this.productListEntity = productListEntity;\r\n }\r\n\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `createAddProductListLines`;\r\n public getCacheObjectType = () => 'createAddProductListLines';\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 ICreateAddProductListLines {\r\n result: ProductList;\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\nexport async function createAddProductListLinesAction(\r\n input: CreateAddProductListLinesInput,\r\n ctx: Msdyn365.IActionContext\r\n): Promise {\r\n const createProductListLineResponse = await createProductListAsync({ callerContext: ctx }, input.productListEntity);\r\n return { result: createProductListLineResponse };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >createAddProductListLinesAction,\r\n id: 'createAddProductListLines'\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 { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { getByIdsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\n/**\r\n * GetProductAttributesCartlines Input Action\r\n */\r\nexport class GetProductsInput implements Msdyn365.IActionInput {\r\n public productIDs: number[];\r\n constructor(productID: number[]) {\r\n this.productIDs = productID;\r\n }\r\n\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `getProductsByIdsAsync`;\r\n public getCacheObjectType = () => 'getProductsByIdsAsync';\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 IGetProducts {\r\n products: SimpleProduct[];\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\nexport async function getProductsActions(input: GetProductsInput, ctx: Msdyn365.IActionContext): Promise {\r\n const channelID = +ctx.requestContext.apiSettings.channelId;\r\n\r\n const getProductsResponse = await getByIdsAsync({ callerContext: ctx }, channelID, input.productIDs);\r\n return { products: getProductsResponse };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getProductsActions,\r\n id: 'getProductsByIdsAsync'\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 ICreateActionContext\r\n} from '@msdyn365-commerce/core';\r\nimport { InvoicePaidStatus, InvoiceSearchCriteria, InvoiceType, IQueryResultSettings, OrderInvoice } from '@msdyn365-commerce/retail-proxy';\r\nimport { getCurrentAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/BusinessPartnersDataActions.g';\r\n\r\nimport getCustomer, { GetCustomerInput } from './getCustomer.action';\r\nimport { QueryResultSettingsProxy } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getSortedInvoicesAsync } from './SearchItemsDataActionExtension.g';\r\n\r\nconst getDefaultSearchCriteria = (): InvoiceSearchCriteria => {\r\n return {\r\n InvoicePaidStatusValues: [InvoicePaidStatus.None]\r\n };\r\n};\r\n\r\n/**\r\n * Input class for get invoice data action.\r\n */\r\nexport class GetInvoicesInput implements IActionInput {\r\n public readonly searchCriteria: InvoiceSearchCriteria;\r\n\r\n public readonly queryResultSettings: IQueryResultSettings;\r\n\r\n constructor(searchCriteria: InvoiceSearchCriteria, queryResultSettings: IQueryResultSettings) {\r\n this.searchCriteria = searchCriteria;\r\n this.queryResultSettings = queryResultSettings;\r\n }\r\n\r\n public getCacheKey = () => 'BusinessPartnerInvoices';\r\n\r\n public getCacheObjectType = () => 'OrderInvoice';\r\n\r\n public dataCacheType = (): CacheType => 'none';\r\n}\r\n\r\nexport const CreateGetInvoicesInput = (inputData: ICreateActionContext): IActionInput => {\r\n const { requestContext } = inputData;\r\n\r\n // Check if the user is authenticated.\r\n if (!requestContext.user.isAuthenticated) {\r\n throw new Error('User is not logged in.');\r\n }\r\n\r\n const queryResultSettings: IQueryResultSettings = QueryResultSettingsProxy.fromInputData(inputData).QueryResultSettings;\r\n\r\n return new GetInvoicesInput(getDefaultSearchCriteria(), queryResultSettings);\r\n};\r\n\r\nexport async function getInvoices(input: GetInvoicesInput, context: IActionContext): Promise {\r\n if (!context?.requestContext?.user?.isAuthenticated) {\r\n throw new Error('Unable to get list of invoices. User is not authenticated.');\r\n }\r\n\r\n input.searchCriteria.InvoiceTypeValues = [InvoiceType.SalesOrderInvoice];\r\n\r\n const businessPartner = await getCurrentAsync({ callerContext: context });\r\n input.searchCriteria.BusinessPartnerId = businessPartner?.BusinessPartnerId;\r\n\r\n const customer = await getCustomer(new GetCustomerInput(context.requestContext.apiSettings), context);\r\n input.searchCriteria.CustomerId = customer.AccountNumber;\r\n\r\n const promise = getSortedInvoicesAsync(\r\n { callerContext: context, queryResultSettings: input.queryResultSettings },\r\n input.searchCriteria,\r\n 100,\r\n 0\r\n );\r\n\r\n return (await promise).Invoices ?? [];\r\n}\r\n\r\nexport const getInvoicesDataAction = createObservableDataAction({\r\n id: 'get-invoices',\r\n action: >getInvoices,\r\n input: CreateGetInvoicesInput\r\n});\r\n\r\nexport default getInvoicesDataAction;\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 { addProductListLinesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductListsDataActions.g';\r\nimport { ProductListLine } from '@msdyn365-commerce/retail-proxy';\r\n\r\n/**\r\n * Getaddresses Input Action\r\n */\r\n\r\nexport interface IITSaddProductListLinesInput extends Msdyn365.IActionInput {\r\n id: string;\r\n productListLines: ProductListLine[];\r\n}\r\nexport class GetaddProductListLinesInput implements Msdyn365.IActionInput {\r\n public id: string;\r\n public productListLines: ProductListLine[];\r\n // TODO: Construct the input needed to run the action\r\n constructor(id: string, productListLines: ProductListLine[]) {\r\n this.id = id;\r\n this.productListLines = productListLines;\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 = () => `addProductListLines`;\r\n public getCacheObjectType = () => 'addProductListLines';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\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\nexport async function addProductListLinesAction(\r\n request: IITSaddProductListLinesInput,\r\n ctx: Msdyn365.IActionContext\r\n): Promise {\r\n if (request.id && request.productListLines) {\r\n try {\r\n const result = await addProductListLinesAsync({ callerContext: ctx }, request.id, request.productListLines); //calling getStateCityAsync API\r\n if (result) {\r\n return result;\r\n }\r\n } catch (error) {\r\n console.log('Error', error);\r\n }\r\n }\r\n return null;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >addProductListLinesAction,\r\n // TODO: Give your data action a unique id\r\n id: `addProductListLines`\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 { getOrderHistoryByPONumberAsync } from './SearchItemsDataActionExtension.g';\r\nimport * as Entities from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\n/**\r\n * searchOrderHistoryByPo Input Action\r\n */\r\nexport interface IITSsearchOrderHistoryByPoInput extends Msdyn365.IActionInput {\r\n pONumber: string;\r\n customerAccount: string;\r\n businessPartnerId: string;\r\n}\r\n\r\nexport class searchOrderHistoryByPoInput implements Msdyn365.IActionInput {\r\n public pONumber: string;\r\n public customerAccount: string;\r\n public businessPartnerId: string;\r\n constructor(pONumber: string, customerAccount: string, businessPartnerId: string) {\r\n this.pONumber = pONumber;\r\n this.customerAccount = customerAccount;\r\n this.businessPartnerId = businessPartnerId;\r\n }\r\n\r\n public getCacheKey = () => `searchOrderHistoryByPO`;\r\n public getCacheObjectType = () => 'searchOrderHistoryByPO';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\r\n}\r\n\r\nexport async function searchOrderHistorybyPOAction(\r\n request: IITSsearchOrderHistoryByPoInput,\r\n ctx: Msdyn365.IActionContext\r\n): Promise {\r\n if (request.pONumber) {\r\n try {\r\n const result = await getOrderHistoryByPONumberAsync(\r\n { callerContext: ctx },\r\n request.pONumber,\r\n request.customerAccount,\r\n request.businessPartnerId\r\n );\r\n if (result) {\r\n return result;\r\n }\r\n } catch (error) {\r\n console.log('Error', error);\r\n }\r\n }\r\n return [];\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >searchOrderHistorybyPOAction,\r\n id: 'searchOrderHistoryByPO'\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/GetCustomerAddress.action';\n binding.dataActions[actionPath] = require('partner/actions/GetCustomerAddress.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/GetProductsByPartNumber.action';\n binding.dataActions[actionPath] = require('partner/actions/GetProductsByPartNumber.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/addproductlistlines.action';\n binding.dataActions[actionPath] = require('partner/actions/addproductlistlines.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/createAddProductListLines.action';\n binding.dataActions[actionPath] = require('partner/actions/createAddProductListLines.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-full-products-by-collection.override.action';\n binding.dataActions[actionPath] = require('partner/actions/get-full-products-by-collection.override.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-invoices.action';\n binding.dataActions[actionPath] = require('partner/actions/get-invoices.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-product-active-prices.action';\n binding.dataActions[actionPath] = require('partner/actions/get-product-active-prices.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-product-attributes-cartlines.action';\n binding.dataActions[actionPath] = require('partner/actions/get-product-attributes-cartlines.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-products.action';\n binding.dataActions[actionPath] = require('partner/actions/get-products.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/getCustomer.action';\n binding.dataActions[actionPath] = require('partner/actions/getCustomer.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/getStateCity.action';\n binding.dataActions[actionPath] = require('partner/actions/getStateCity.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/payment-state-share.action';\n binding.dataActions[actionPath] = require('partner/actions/payment-state-share.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/searchOrderHistoryByPO.action';\n binding.dataActions[actionPath] = require('partner/actions/searchOrderHistoryByPO.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 };","/*!\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 {\r\n AsyncResult,\r\n ChannelInventoryConfiguration,\r\n ProductSearchCriteria,\r\n ProductSearchResult,\r\n ProductWarehouseInventoryInformation,\r\n SortColumn\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n getEstimatedAvailabilityAsync,\r\n searchByCriteriaAsync\r\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { getInventoryConfigurationAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\r\nimport {\r\n ArrayExtensions,\r\n generateProductImageUrl,\r\n InventoryLevels,\r\n createInventoryAvailabilitySearchCriteria\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\n\r\nimport {\r\n BaseCollectionInput,\r\n createBaseCollectionInput\r\n} from '@msdyn365-commerce-modules/search-result-container/dist/lib/modules/search-result-container/actions/base-collection-action';\r\n\r\nimport { getInventorySortableRefinerValue } from '@msdyn365-commerce-modules/search-result-container/dist/lib/modules/search-result-container/actions/get-inventory-refiners';\r\nimport { getProductsByItemPartNumberAsync } from './SearchItemsDataActionExtension.g';\r\nimport { IITSSearchItemPartResponse, IProductEntity } from './SearchItemsDataServiceEntities.g';\r\n/**\r\n * GetFullProductsByCollection Action Input.\r\n */\r\nexport class GetFullProductsByCollectionInput extends BaseCollectionInput implements IActionInput {\r\n /**\r\n * The cache object type.\r\n * @returns The cache object type.\r\n */\r\n public getCacheObjectType = (): string => 'FullProductSearchResult';\r\n\r\n public getCacheKey = () => 'FullProductSearchResultOverride';\r\n /**\r\n * The data cache type.\r\n * @returns The data cache type.\r\n */\r\n public dataCacheType = (): CacheType => {\r\n // Commented OOB code for category cache type in order to change cache type for category\r\n // We will keep this code we might need it in future\r\n /* if (\r\n this.pageType !== 'Category' ||\r\n (this.refiners && this.refiners.length > 0) ||\r\n (this.queryResultSettings &&\r\n this.queryResultSettings.Sorting &&\r\n this.queryResultSettings.Sorting.Columns &&\r\n this.queryResultSettings.Sorting.Columns.length > 0)\r\n ) {\r\n return 'request';\r\n } */\r\n return 'none';\r\n };\r\n}\r\n\r\n/**\r\n * This setting defines inventory filtering options.\r\n */\r\nexport enum ProductListInventoryFilteringOptions {\r\n /**\r\n * Filter out all products out of stock.\r\n */\r\n HideOOS = 'hideOOS',\r\n\r\n /**\r\n * Sort products by availability, OOS goes last.\r\n */\r\n SortOOS = 'sortOOS',\r\n\r\n /**\r\n * No filtering selected.\r\n */\r\n Default = 'default'\r\n}\r\n\r\n/**\r\n * The full product search result with count interface.\r\n */\r\n\r\n// export interface IExtendedProductSearchResult extends ProductSearchResult {\r\n// extensionProps: CommerceProperty[];\r\n// }\r\nexport interface IFullProductsSearchResultsWithCount {\r\n products: ProductSearchResult[];\r\n count: number;\r\n channelInventoryConfigurationId?: number;\r\n inventoryAwareSortableAttributeId?: number;\r\n}\r\n\r\nexport interface IExtendedFullProductsSearchResultsWithCount extends IFullProductsSearchResultsWithCount {\r\n products: ProductSearchResult[];\r\n count: number;\r\n channelInventoryConfigurationId?: number;\r\n inventoryAwareSortableAttributeId?: number;\r\n}\r\n\r\nexport interface IProduct {\r\n itemId: string;\r\n recordId: number;\r\n isAlternateProduct: boolean;\r\n supersededItemId: string;\r\n alternativeText: string;\r\n}\r\n\r\n/**\r\n * CreateInput function which creates and actionInput used to fetch products for a list page.\r\n * @param args - The API arguments.\r\n * @returns IActionInput - The action input.\r\n */\r\nconst createInput = (args: ICreateActionContext<{ itemsPerPage: number; includedAttributes: boolean | undefined }>): IActionInput => {\r\n const input = createBaseCollectionInput(args, GetFullProductsByCollectionInput);\r\n\r\n // Set Top\r\n if (input.queryResultSettings.Paging && args.config) {\r\n input.queryResultSettings.Paging.Top = args.config.itemsPerPage || 1;\r\n }\r\n\r\n // Set Skip\r\n if (input.queryResultSettings.Paging && args.requestContext.query && args.requestContext.query.skip) {\r\n input.queryResultSettings.Paging.Skip = +args.requestContext.query.skip;\r\n }\r\n\r\n input.queryResultSettings.count = true;\r\n\r\n return input;\r\n};\r\n\r\n/**\r\n * Returns list of products based on inventory information.\r\n * @param productSearchResults - The products.\r\n * @param context - The context.\r\n * @param metadataCount - The metadata count.\r\n * @param channelInventoryConfiguration - The channel inventory configuration.\r\n * @returns List of product based on the inventory information.\r\n */\r\nexport async function returnProducts(\r\n productSearchResults: ProductSearchResult[],\r\n context: IActionContext,\r\n metadataCount: number | undefined,\r\n channelInventoryConfiguration?: ChannelInventoryConfiguration,\r\n notFoundItems?: string[],\r\n queryString?: string,\r\n productsWithSupersededProducts?: IProduct[],\r\n productInventoryResultResponse?: ProductWarehouseInventoryInformation\r\n): Promise {\r\n const defaultProductCount: number = 0;\r\n const productSearchResultsWithImages = productSearchResults.map(productSearchResult => {\r\n const item = productsWithSupersededProducts?.find(d => d.recordId === productSearchResult.RecordId);\r\n const stockText = productInventoryResultResponse?.ProductWarehouseInventoryAvailabilities?.find(\r\n product => product.ProductId === productSearchResult.RecordId\r\n );\r\n const newImageUrl = generateProductImageUrl(productSearchResult, context.requestContext.apiSettings);\r\n const extensionPropsNotFound = {\r\n Key: 'notFoundProducts',\r\n Value: { StringValue: notFoundItems?.join(',') }\r\n };\r\n productSearchResult.ExtensionProperties?.push(extensionPropsNotFound);\r\n const extensionPropsFound = {\r\n Key: 'queryString',\r\n Value: { StringValue: queryString }\r\n };\r\n productSearchResult.ExtensionProperties?.push(extensionPropsFound);\r\n const extensionSupersededItem = {\r\n Key: 'supersededItemId',\r\n Value: { StringValue: item ? item.supersededItemId : '' }\r\n };\r\n productSearchResult.ExtensionProperties?.push(extensionSupersededItem);\r\n const extensionSupersededText = {\r\n Key: 'alternateProductText',\r\n Value: { StringValue: item ? item.alternativeText : '' }\r\n };\r\n productSearchResult.ExtensionProperties?.push(extensionSupersededText);\r\n const extensionStockText = {\r\n Key: 'stockCheckText',\r\n Value: { StringValue: stockText ? stockText.PhysicalAvailableInventoryLevelLabel : '' }\r\n };\r\n productSearchResult.ExtensionProperties?.push(extensionStockText);\r\n const extensionStockCode = {\r\n Key: 'stockCheckCode',\r\n Value: { StringValue: stockText ? stockText.PhysicalAvailableInventoryLevelCode : '' }\r\n };\r\n productSearchResult.ExtensionProperties?.push(extensionStockCode);\r\n if (newImageUrl) {\r\n productSearchResult.PrimaryImageUrl = newImageUrl;\r\n }\r\n\r\n return productSearchResult;\r\n });\r\n\r\n // If inventory level is threshold or inventory check is disabled then return the list of products without the inventory configuration\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- read config file.\r\n if (\r\n context.requestContext.app.config.inventoryLevel === InventoryLevels.threshold ||\r\n context.requestContext.app.config.enableStockCheck === false\r\n ) {\r\n return {\r\n products: productSearchResultsWithImages,\r\n count: metadataCount ?? defaultProductCount\r\n };\r\n }\r\n\r\n const mappedProducts = productSearchResultsWithImages.map(productSearchResult => {\r\n if (ArrayExtensions.hasElements(productSearchResult.AttributeValues)) {\r\n for (const element of productSearchResult.AttributeValues) {\r\n if (\r\n channelInventoryConfiguration &&\r\n element.RecordId !== undefined &&\r\n element.RecordId === channelInventoryConfiguration.InventoryProductAttributeRecordId &&\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- read config file.\r\n context.requestContext.app.config.inventoryRanges !== 'all' &&\r\n element.TextValue !== channelInventoryConfiguration.InventoryOutOfStockAttributeValueText\r\n ) {\r\n // If same RecordId then it means that is the Inventory attribute\r\n // Based on the inventory range (and filtering options), the inventory label will be displayed\r\n // If Inventory range is 'All' then in stock and out of stock labels are shown, else only OOS\r\n // if the text value is different that the channelInventoryConfiguration.InventoryOutOfStockAttributeValueText then is in stock\r\n element.TextValue = '';\r\n }\r\n }\r\n }\r\n\r\n return productSearchResult;\r\n });\r\n\r\n return {\r\n products: mappedProducts,\r\n count: metadataCount ?? defaultProductCount,\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- check config.\r\n channelInventoryConfigurationId: channelInventoryConfiguration\r\n ? channelInventoryConfiguration.InventoryProductAttributeRecordId\r\n : undefined,\r\n inventoryAwareSortableAttributeId: channelInventoryConfiguration\r\n ? channelInventoryConfiguration.ProductAvailabilitySortableAttributeRecordId\r\n : undefined\r\n };\r\n}\r\n\r\nexport async function getProductsByPartNumebrs(\r\n input: GetFullProductsByCollectionInput,\r\n context: IActionContext\r\n): Promise {\r\n if (input.searchText && context.requestContext.query?.q) {\r\n try {\r\n const promsie: AsyncResult = getProductsByItemPartNumberAsync(\r\n { callerContext: context },\r\n context.requestContext.query?.q,\r\n false\r\n );\r\n return await promsie;\r\n } catch (error) {\r\n console.log('Error', error);\r\n }\r\n }\r\n return {};\r\n}\r\nexport async function getProductAvailbility(\r\n input: GetFullProductsByCollectionInput,\r\n context: IActionContext,\r\n productIdData: number[]\r\n): Promise {\r\n if (input.searchText && context.requestContext.query?.q) {\r\n const searchCriteria = createInventoryAvailabilitySearchCriteria(context, ArrayExtensions.unique(productIdData), true);\r\n try {\r\n const promise: ProductWarehouseInventoryInformation = await getEstimatedAvailabilityAsync(\r\n { callerContext: context, bypassCache: 'get' },\r\n searchCriteria\r\n );\r\n return promise;\r\n } catch (error) {\r\n console.log('Error', error);\r\n }\r\n }\r\n return {};\r\n}\r\n\r\n/**\r\n * Action function to fetch products for a list page.\r\n * @param input - The input.\r\n * @param context - The context.\r\n * @returns IFullProductsSearchResultsWithCount - The full product search result with count.\r\n */\r\n// eslint-disable-next-line complexity -- ignore the complexity.\r\nasync function action(\r\n input: GetFullProductsByCollectionInput,\r\n context: IActionContext\r\n): Promise {\r\n let promise: AsyncResult | null = null;\r\n let channelInventoryConfigurationPromise: AsyncResult;\r\n let searchProductId;\r\n const searchCriteriaInput: ProductSearchCriteria = {};\r\n searchCriteriaInput.Context = { ChannelId: context.requestContext.apiSettings.channelId, CatalogId: input.catalogId };\r\n // Decouple searchCriteriaInput.Refinement from input.refiners to avoid input.refiners being modified below\r\n searchCriteriaInput.Refinement = [...input.refiners];\r\n searchCriteriaInput.IncludeAttributes = input.includeAttributes;\r\n searchCriteriaInput.SkipVariantExpansion = true;\r\n const defaultNumber: number = 0;\r\n if (input.channelInventoryConfiguration) {\r\n channelInventoryConfigurationPromise = AsyncResult.resolve(input.channelInventoryConfiguration);\r\n } else {\r\n channelInventoryConfigurationPromise = getInventoryConfigurationAsync({ callerContext: context });\r\n }\r\n const channelInventoryConfiguration = await channelInventoryConfigurationPromise;\r\n\r\n // Replace InventoryProductAttribute with boolean refiner.\r\n // Because the value of InventoryProductAttribute is different from language to language since it's string type.\r\n // The cached old inventory refiner value may be hit when customer switch language which will lead to \"no products found\" issue.\r\n const inventoryRefiner = searchCriteriaInput.Refinement.find(\r\n refiner => refiner.RefinerRecordId === channelInventoryConfiguration?.InventoryProductAttributeRecordId\r\n );\r\n if (inventoryRefiner) {\r\n searchCriteriaInput.Refinement = searchCriteriaInput.Refinement.filter(\r\n refiner => refiner.RefinerRecordId !== channelInventoryConfiguration?.InventoryProductAttributeRecordId\r\n );\r\n\r\n const isInStockRefiner =\r\n inventoryRefiner.LeftValueBoundString !== channelInventoryConfiguration?.InventoryOutOfStockAttributeValueText &&\r\n inventoryRefiner.RightValueBoundString !== channelInventoryConfiguration?.InventoryOutOfStockAttributeValueText;\r\n const inventoryRefinerValue = getInventorySortableRefinerValue(channelInventoryConfiguration, isInStockRefiner);\r\n\r\n const isInventoryRefinerValueExist = searchCriteriaInput.Refinement.some(\r\n refiner => refiner.RefinerRecordId === inventoryRefinerValue?.RefinerRecordId\r\n );\r\n if (!isInventoryRefinerValueExist && inventoryRefinerValue) {\r\n searchCriteriaInput.Refinement.push(inventoryRefinerValue);\r\n }\r\n }\r\n\r\n if (context.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.HideOOS) {\r\n const isInStock = true;\r\n const inventoryInStockRefinerValue = getInventorySortableRefinerValue(channelInventoryConfiguration, isInStock);\r\n\r\n const isInventoryInStockRefinerValueExist = searchCriteriaInput.Refinement.some(\r\n refiner => refiner.RefinerRecordId === inventoryInStockRefinerValue?.RefinerRecordId\r\n );\r\n if (!isInventoryInStockRefinerValueExist && inventoryInStockRefinerValue) {\r\n searchCriteriaInput.Refinement.push(inventoryInStockRefinerValue);\r\n }\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- app configs are of generic type\r\n if (\r\n context.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.SortOOS &&\r\n channelInventoryConfiguration.ProductAvailabilitySortableAttributeRecordId\r\n ) {\r\n input.queryResultSettings.Sorting = input.queryResultSettings.Sorting ?? {};\r\n input.queryResultSettings.Sorting.Columns = input.queryResultSettings.Sorting.Columns ?? [];\r\n const sortColumnName = `Attr_${channelInventoryConfiguration.ProductAvailabilitySortableAttributeRecordId}`;\r\n const isSortAttributeExist = input.queryResultSettings.Sorting.Columns.some(\r\n (column: SortColumn) => column.ColumnName === sortColumnName\r\n );\r\n if (!isSortAttributeExist) {\r\n input.queryResultSettings.Sorting.Columns.push({\r\n ColumnName: sortColumnName,\r\n IsDescending: true\r\n });\r\n }\r\n }\r\n\r\n const queryParam = context.requestContext.query?.strict;\r\n let notFoundItems: string[] = [];\r\n let productInventoryResult: ProductWarehouseInventoryInformation = {};\r\n const productsWithSupersededProducts: IProduct[] = [];\r\n if (queryParam === 'false') {\r\n if (input.pageType === 'Category' || context.requestContext.query?.categoryId) {\r\n if (input.category) {\r\n searchCriteriaInput.CategoryIds = [input.category || defaultNumber];\r\n promise = searchByCriteriaAsync(\r\n {\r\n callerContext: context,\r\n queryResultSettings: input.queryResultSettings\r\n },\r\n searchCriteriaInput\r\n );\r\n } else {\r\n throw new Error('[GetFullProductsForCollection]Category Page Detected, but no global categoryId found');\r\n }\r\n } else if (input.searchText && context.requestContext.query?.q) {\r\n searchCriteriaInput.SearchCondition = input.searchText;\r\n promise = searchByCriteriaAsync(\r\n {\r\n callerContext: context,\r\n queryResultSettings: input.queryResultSettings\r\n },\r\n searchCriteriaInput\r\n );\r\n } else if (input.searchText && context.requestContext.query && context.requestContext.query.recommendation) {\r\n const searchObject = JSON.parse(input.searchText);\r\n if (context.requestContext.query.productId) {\r\n searchProductId = Number(searchObject.ProductId);\r\n }\r\n if (Number.isNaN(searchProductId)) {\r\n throw new Error('Failed to cast search product id into a number.');\r\n } else if (\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Existing code\r\n !searchObject.Recommendation\r\n ) {\r\n throw new Error('Failed to retrieve the Recommendation.');\r\n } else {\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- Existing code\r\n searchCriteriaInput.RecommendationListId = searchObject.Recommendation;\r\n if (searchProductId) {\r\n searchCriteriaInput.Ids = [searchProductId || defaultNumber];\r\n }\r\n promise = searchByCriteriaAsync(\r\n {\r\n callerContext: context,\r\n queryResultSettings: input.queryResultSettings\r\n },\r\n searchCriteriaInput\r\n );\r\n }\r\n } else {\r\n throw new Error('[GetFullProductsForCollection]Search Page Detected, but no q= or productId= query parameter found');\r\n }\r\n } else if (input.searchText && context.requestContext.query?.q) {\r\n const productsFromStrictSearch = await getProductsByPartNumebrs(input, context);\r\n if (productsFromStrictSearch) {\r\n notFoundItems =\r\n productsFromStrictSearch && productsFromStrictSearch.NotFoundItems ? productsFromStrictSearch.NotFoundItems : [];\r\n const foundProducts: number[] = [];\r\n productsFromStrictSearch &&\r\n productsFromStrictSearch.FoundProducts &&\r\n productsFromStrictSearch.FoundProducts.map((product: IProductEntity) => {\r\n const productWithSuperssesionInfo: IProduct = {\r\n itemId: product.ProductNumber ? product.ProductNumber : '',\r\n recordId: product.RecId,\r\n isAlternateProduct: product.ProductSuperseded ? true : false,\r\n supersededItemId: product.ProductSuperseded ? product.ProductSuperseded : '',\r\n alternativeText: product.AlternativeText ? product.AlternativeText : ''\r\n };\r\n productsWithSupersededProducts.push(productWithSuperssesionInfo);\r\n foundProducts.push(product.RecId);\r\n });\r\n if (foundProducts && foundProducts.length && foundProducts.length > 0) {\r\n searchCriteriaInput.Ids = foundProducts;\r\n promise = searchByCriteriaAsync(\r\n {\r\n callerContext: context,\r\n queryResultSettings: input.queryResultSettings\r\n },\r\n searchCriteriaInput\r\n );\r\n productInventoryResult = await getProductAvailbility(input, context, foundProducts);\r\n }\r\n }\r\n }\r\n\r\n const productSearchResults = await promise;\r\n if (productSearchResults && promise) {\r\n return returnProducts(\r\n productSearchResults,\r\n context,\r\n promise.metadata.count,\r\n channelInventoryConfiguration,\r\n notFoundItems,\r\n context.requestContext.query?.q,\r\n productsWithSupersededProducts,\r\n productInventoryResult\r\n );\r\n }\r\n return returnProducts([], context, 0, channelInventoryConfiguration, notFoundItems);\r\n}\r\n\r\nexport const actionDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/search-result-container/get-full-products-by-collection',\r\n action: action as IAction,\r\n input: createInput\r\n});\r\n\r\nexport default actionDataAction;\r\n"],"names":["module","exports","React","ReactDOM","GetProductAttributesCartlinesInput","constructor","productID","getCacheKey","getCacheObjectType","dataCacheType","this","async","getProductAttributeCartlineAction","input","ctx","catalogId","getCatalogId","requestContext","channelID","apiSettings","channelId","productAttributes","getAttributeValuesAsync","callerContext","Msdyn365","action","id","PaymentStateShareInput","isAccountPaymentSelected","isCreditCardSelected","shouldApplyOnAccountPayment","args","BaseCollectionInput","pageType","queryResultSettings","refiners","category","searchText","includeAttributes","isUpdateRefinerPanel","locale","channelInventoryConfiguration","inventoryRefiner","_objectSpread","Paging","toJS","Sorting","generateCacheKey","key","value","map","refiner","RefinerRecordId","LeftValueBoundString","RightValueBoundString","convertToString","createBaseCollectionInput","inputClassConstuctor","urlTokens","query","categoryId","QueryResultSettingsProxy","fromInputData","QueryResultSettings","queryRefiners","hydrateRefinersFromUrl","inputData","config","undefined","_inputData$config","updateRefinerPanel","getUpdateRefinerPanel","sorting","Columns","JSON","parse","decodeURIComponent","itemId","q","recommendation","productId","stringify","ProductId","Recommendation","discountIds","DiscountIds","Error","GetProductActivePricesInput","productIDs","projectDomain","ChannelId","CatalogId","activePrices","getActivePricesAsync","Date","then","productPrices","GetaddressesInput","customerAccount","getCustomerAddressesAction","request","result","getCustomerAddressAsync","error","console","log","GetCustomerInput","accountNumber","cacheType","buildCacheKey","customerAccountNumber","getCustomerActionDataAction","createObservableDataAction","user","isAuthenticated","CustomersDataActions","bypassCache","response","Array","isArray","trace","token","compressedRefinerKeys","compressedRefinerArray","parseQueryParam","length","compressedRefiner","parsedRefiner","forEach","refinerKey","index","_unused","filter","Boolean","buildListPageUrl","fullUrl","sortingColumns","skipCount","searchParams","delete","sortedRefiners","sort","first","second","set","compressedRefiners","push","compressRefiners","href","toString","getCurrentUrl","MsDyn365","isBrowser","URL","window","location","url","requestUrl","getProductRefinerHierarchy","searchCriteria","getProductSearchRefinersAsync","productRefiners","productRefiner","GetZipCodeInput","zipCode","getStateCityAction","getStateCityAsync","getInventorySortableRefinerValue","isInStock","ProductAvailabilitySortableAttributeRecordId","DataTypeValue","AttributeDataType","TrueFalse","UnitText","RowNumber","Count","ExtensionProperties","RefinerSourceValue","ProductRefinerSource","Attribute","context","_input$channelInvento2","Context","InventoryProductAttributeRecordId","find","_input$channelInvento3","RecordId","inventoryProductAttributeRecordId","CreateAddProductListLinesInput","productListEntity","createAddProductListLinesAction","createProductListAsync","GetProductsInput","getProductsActions","products","getByIdsAsync","GetInvoicesInput","CreateGetInvoicesInput","InvoicePaidStatusValues","InvoicePaidStatus","None","getInvoices","_context$requestConte","_await$promise$Invoic","InvoiceTypeValues","InvoiceType","SalesOrderInvoice","businessPartner","getCurrentAsync","BusinessPartnerId","customer","getCustomer","CustomerId","AccountNumber","promise","getSortedInvoicesAsync","Invoices","getInvoicesDataAction","GetaddProductListLinesInput","productListLines","addProductListLinesAction","addProductListLinesAsync","searchOrderHistoryByPoInput","pONumber","businessPartnerId","searchOrderHistorybyPOAction","getOrderHistoryByPONumberAsync","binding","modules","dataActions","registerActionId","actionPath","default","prototype","Object","keys","exportName","Action","require","__bindings__","packageDataActions","ProductListInventoryFilteringOptions","GetFullProductsByCollectionInput","returnProducts","productSearchResults","metadataCount","notFoundItems","queryString","productsWithSupersededProducts","productInventoryResultResponse","productSearchResultsWithImages","productSearchResult","_productInventoryResu","_productSearchResult$","_productSearchResult$2","_productSearchResult$3","_productSearchResult$4","_productSearchResult$5","_productSearchResult$6","item","d","recordId","stockText","ProductWarehouseInventoryAvailabilities","product","newImageUrl","generateProductImageUrl","extensionPropsNotFound","Key","Value","StringValue","join","extensionPropsFound","extensionSupersededItem","supersededItemId","extensionSupersededText","alternativeText","extensionStockText","PhysicalAvailableInventoryLevelLabel","extensionStockCode","PhysicalAvailableInventoryLevelCode","PrimaryImageUrl","app","inventoryLevel","InventoryLevels","threshold","enableStockCheck","count","ArrayExtensions","hasElements","AttributeValues","element","inventoryRanges","TextValue","InventoryOutOfStockAttributeValueText","channelInventoryConfigurationId","inventoryAwareSortableAttributeId","getProductsByPartNumebrs","_context$requestConte2","promsie","getProductsByItemPartNumberAsync","getProductAvailbility","productIdData","_context$requestConte3","createInventoryAvailabilitySearchCriteria","unique","getEstimatedAvailabilityAsync","actionDataAction","_context$requestConte4","_context$requestConte5","_context$requestConte6","_context$requestConte9","channelInventoryConfigurationPromise","searchProductId","searchCriteriaInput","Refinement","IncludeAttributes","SkipVariantExpansion","AsyncResult","resolve","getInventoryConfigurationAsync","isInStockRefiner","inventoryRefinerValue","some","productListInventoryDisplay","HideOOS","inventoryInStockRefinerValue","SortOOS","_input$queryResultSet","_input$queryResultSet2","sortColumnName","column","ColumnName","IsDescending","queryParam","strict","productInventoryResult","_context$requestConte7","_context$requestConte8","CategoryIds","searchByCriteriaAsync","SearchCondition","searchObject","Number","isNaN","RecommendationListId","Ids","productsFromStrictSearch","NotFoundItems","foundProducts","FoundProducts","productWithSuperssesionInfo","ProductNumber","RecId","isAlternateProduct","ProductSuperseded","AlternativeText","_context$requestConte10","metadata","Top","itemsPerPage","skip","Skip"],"sourceRoot":""}