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1F,IALA,IAGIjD,EAASkD,EAHTC,EAAcL,EACdM,EAAc,EACdC,IAAQL,GAASR,EAAKQ,EAAQC,GAG3BG,EAAcP,GACfO,KAAeR,IACjB5C,EAAUqD,EAAQA,EAAMT,EAAOQ,GAAcA,EAAaT,GAAYC,EAAOQ,GAEzEL,EAAQ,GAAKV,EAAQrC,IACvBkD,EAAaZ,EAAkBtC,GAC/BmD,EAAcV,EAAiBC,EAAQC,EAAU3C,EAASkD,EAAYC,EAAaJ,EAAQ,GAAK,IAEhGR,EAAyBY,EAAc,GACvCT,EAAOS,GAAenD,GAGxBmD,KAEFC,IAEF,OAAOD,GAGTrB,EAAOC,QAAUU,8BChCjB,IAAIa,EAAI,EAAQ,IACZb,EAAmB,EAAQ,KAC3Bc,EAAW,EAAQ,IACnBjB,EAAoB,EAAQ,IAC5BkB,EAAsB,EAAQ,KAC9BC,EAAqB,EAAQ,KAIjCH,EAAE,CAAEZ,OAAQ,QAASgB,OAAO,GAAQ,CAClCjI,KAAM,WACJ,IAAIkI,EAAWzH,UAAUvN,OAASuN,UAAU,QAAK3G,EAC7CqO,EAAIL,EAASrW,MACb2V,EAAYP,EAAkBsB,GAC9BC,EAAIJ,EAAmBG,EAAG,GAE9B,OADAC,EAAElV,OAAS8T,EAAiBoB,EAAGD,EAAGA,EAAGf,EAAW,OAAgBtN,IAAboO,EAAyB,EAAIH,EAAoBG,IAC7FE,iCCdY,EAAQ,IAG/BC,CAAiB","sources":["webpack://bju-press/./src/action-overrides/get-categories-hierarchy.action.ts?9e9a","webpack://bju-press/./src/action-overrides/get-category-paths.action.ts?d3b3","webpack://bju-press/./src/action-overrides/get-checkout-cart.action.ts?9cde","webpack://bju-press/./src/action-overrides/get-invoice.action.ts?b253","webpack://bju-press/./src/action-overrides/get-invoices.action.ts?ef98","webpack://bju-press/./src/action-overrides/plp-actions/url-utils.ts?de8b","webpack://bju-press/./src/action-overrides/plp-actions/base-collection-action.ts?20cd","webpack://bju-press/./src/action-overrides/plp-actions/get-product-refiner-hierarchy.ts?f588","webpack://bju-press/./src/action-overrides/plp-actions/get-inventory-refiners.ts?996f","webpack://bju-press/./src/action-overrides/plp-actions/get-full-products-by-collection.ts?6356","webpack://bju-press/./src/action-overrides/plp-actions/get-refiners-for-collection.action.ts?5bc0","webpack://bju-press/./lib/__local__/module-registration.js?8a42","webpack://bju-press/external var \"React\"?0d3b","webpack://bju-press/external var \"ReactDOM\"?853b","webpack://bju-press/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/internals/does-not-exceed-safe-integer.js?683b","webpack://bju-press/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/internals/flatten-into-array.js?04fb","webpack://bju-press/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/modules/es.array.flat.js?58b6","webpack://bju-press/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/modules/es.array.unscopables.flat.js?62f8"],"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 { CategoryHierarchy } from '@msdyn365-commerce/commerce-entities';\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 IGeneric,\r\n IRequestContext\r\n} from '@msdyn365-commerce/core';\r\nimport { Category, TextValueTranslation } from '@msdyn365-commerce/retail-proxy';\r\n\r\n//----------------------------------------------------------\r\n// @CUSTOM: Fix imports (absolute references)\r\n//----------------------------------------------------------\r\nimport { CategoriesInput as RawCategoriesInput, getCategoryUrl, generateCacheKey, getCategories } from '@msdyn365-commerce-modules/retail-actions';\r\n//----------------------------------------------------------\r\n\r\n/**\r\n * Input for get-categories data action.\r\n */\r\nexport class CategoriesInput implements IActionInput {\r\n public readonly maxItems: number;\r\n\r\n public readonly channelId: number;\r\n\r\n public includeRootCategory?: boolean;\r\n\r\n private readonly catalogId: number;\r\n\r\n private readonly sitePath: string;\r\n\r\n private readonly _mappedToHierarchy: boolean;\r\n\r\n private readonly apiSettings: ICommerceApiSettings;\r\n\r\n private readonly locale?: string;\r\n\r\n public constructor(context: IRequestContext, mappedToHierarchy: boolean, maxItems?: number, includeRootCategory?: boolean) {\r\n this._mappedToHierarchy = mappedToHierarchy;\r\n this.includeRootCategory = includeRootCategory;\r\n this.maxItems = maxItems || 250;\r\n this.channelId = context && context.apiSettings && context.apiSettings.channelId ? +context.apiSettings.channelId : 0;\r\n this.sitePath = (context && context.sitePath) || '';\r\n this.apiSettings = context.apiSettings;\r\n this.locale = context.locale || '';\r\n this.catalogId = this.getCatalog(context); // @CUSTOM: Attempt to get the ID from the cookie if appropriate\r\n }\r\n\r\n public getCacheKey = () =>\r\n generateCacheKey(\r\n this.apiSettings,\r\n { key: 'SitePath', value: this.sitePath },\r\n { key: 'IncludeRootCategory', value: this.includeRootCategory },\r\n { key: 'Top', value: this.maxItems },\r\n { key: 'CatalogId', value: this.catalogId },\r\n { key: 'Locale', value: this.locale }\r\n );\r\n\r\n public getCacheObjectType = () => (this._mappedToHierarchy ? 'CategoryHierarchy' : 'Category');\r\n\r\n public dataCacheType = (): CacheType => 'request';\r\n\r\n public getLocale = (): string => this.locale || '';\r\n\r\n //----------------------------------------------------------\r\n // @CUSTOM\r\n //----------------------------------------------------------\r\n private getCatalog(context: IRequestContext) {\r\n const COOKIE_NAME = 'd365_catalog';\r\n\r\n // Only do something if the user is logged in\r\n if (context.user && (context.user.isB2b || context.user.isOBORequest)) {\r\n\r\n // Attempt to get catalog values from both the cookie and URL\r\n const cookieId = context.cookies.get(COOKIE_NAME); // This may even work on the server\r\n const urlId = context.query && context.query.catalogid; // This should work on the server\r\n\r\n // If catalog is in the URL, that takes precedence. Update the cookie.\r\n if (!urlId && cookieId?.value) {\r\n return +cookieId.value;\r\n }\r\n }\r\n\r\n return getCatalogId(context);\r\n }\r\n}\r\n\r\nconst getFriendlyName = (locale?: string, nameTranslations?: TextValueTranslation[]): string | undefined => {\r\n let nameTranslation: TextValueTranslation | undefined;\r\n if (locale && nameTranslations && nameTranslations.length > 0) {\r\n nameTranslation = nameTranslations.find(item => item.Language!.toLowerCase() === locale.toLowerCase());\r\n }\r\n\r\n return nameTranslation && nameTranslation.Text;\r\n};\r\n\r\nexport interface ICategoryMap {\r\n [RecordId: number]: CategoryHierarchy;\r\n}\r\n\r\n/**\r\n * Creates a hierarchy of categories based on the ParentCategory property.\r\n * @param categoryList Categories that will be converted into a hierarchy.\r\n * @param ctx\r\n * @param locale\r\n * @returns Hierarchy of categories in array.\r\n */\r\nexport const mapCategoryToHierarchy = (\r\n categoryList: Category[],\r\n ctx: IActionContext,\r\n locale?: string,\r\n includeRootCategory?: boolean\r\n): CategoryHierarchy[] => {\r\n if (!categoryList || categoryList.length === 0) {\r\n return [];\r\n }\r\n\r\n const categoryMap: ICategoryMap = {};\r\n\r\n for (const category of categoryList) {\r\n const localName = getFriendlyName(locale, category.NameTranslations);\r\n const categoryHierarchy = { ...category };\r\n categoryHierarchy.NeutralizedName = category.Name;\r\n categoryHierarchy.Name = localName || categoryHierarchy.NeutralizedName;\r\n categoryMap[category.RecordId] = categoryHierarchy;\r\n }\r\n\r\n let rootCategory: CategoryHierarchy | undefined;\r\n\r\n for (const category of Object.values(categoryMap)) {\r\n const parentId = category.ParentCategory;\r\n category.Url = getCategoryUrl(category, ctx, categoryMap);\r\n if (parentId === 0) {\r\n rootCategory = category;\r\n continue;\r\n }\r\n\r\n const parent = parentId && categoryMap[parentId];\r\n if (parent) {\r\n parent.Children = parent.Children || [];\r\n parent.Children.push(category);\r\n }\r\n }\r\n\r\n if (!rootCategory) {\r\n return [];\r\n }\r\n\r\n if (includeRootCategory) {\r\n const categoryHierarchy: CategoryHierarchy[] = [];\r\n categoryHierarchy.push(rootCategory);\r\n return categoryHierarchy;\r\n }\r\n\r\n return rootCategory.Children ?? [];\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 createCategoriesHierarchyInput = (inputData: ICreateActionContext>): IActionInput => {\r\n const topItems = inputData.config && inputData.config.topCategories && Number.parseInt(inputData.config.topCategories, 10);\r\n return new CategoriesInput(inputData.requestContext, true, topItems);\r\n};\r\n\r\n/**\r\n * Calls the Retail API and returns all the categories as a hierarchy.\r\n * @param input\r\n * @param ctx\r\n */\r\nexport async function getCategoryHierarchyAction(input: CategoriesInput, ctx: IActionContext): Promise {\r\n const categories = await getCategories(new RawCategoriesInput(ctx.requestContext, false, input.maxItems), ctx); // @CUSTOM: Renamed data action for external access\r\n return mapCategoryToHierarchy(categories, ctx, input.getLocale(), input.includeRootCategory);\r\n}\r\n\r\nexport const getCategoryHierarchyActionDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/retail-actions/get-categories-hierarchy',\r\n action: >getCategoryHierarchyAction,\r\n input: createCategoriesHierarchyInput\r\n});\r\n\r\nexport default getCategoryHierarchyActionDataAction;\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 getCategoriesUrlSync,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICommerceApiSettings,\r\n ICreateActionContext,\r\n IGeneric,\r\n IRequestContext\r\n} from '@msdyn365-commerce/core';\r\nimport { ICategoryPath, ICategoryUrl } from '@msdyn365-commerce/core-internal/dist/types/interfaces/ICategoryPathInterfaces';\r\nimport { getCategoryPathsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { CategoryPathLookup } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\n//----------------------------------------------------------\r\n// @CUSTOM: Fix imports (absolute references)\r\n//----------------------------------------------------------\r\nimport { QueryResultSettingsProxy, generateCacheKey, getSelectedProductIdFromActionInput } from '@msdyn365-commerce-modules/retail-actions';\r\n//----------------------------------------------------------\r\n\r\n/**\r\n * Category path input.\r\n */\r\nexport class GetCategoryPathsInput implements IActionInput {\r\n public readonly ChannelId: number;\r\n\r\n public readonly CatalogId: number;\r\n\r\n public readonly categoryPathLooksups: CategoryPathLookup[];\r\n\r\n public readonly apiSettings: ICommerceApiSettings;\r\n\r\n private readonly locale: string;\r\n\r\n private _requestContext: IRequestContext;\r\n\r\n public constructor(context: IRequestContext, categoryPathLooksups: CategoryPathLookup[]) {\r\n this._requestContext = context;\r\n this.ChannelId = context.apiSettings.channelId;\r\n this.CatalogId = this.getCatalog(context); // @CUSTOM: Attempt to get the ID from the cookie if appropriate\r\n this.categoryPathLooksups = categoryPathLooksups;\r\n this.apiSettings = context.apiSettings;\r\n this.locale = context.locale;\r\n }\r\n\r\n public getCacheKey = () =>\r\n generateCacheKey(\r\n this._requestContext.apiSettings,\r\n { key: 'CategoryPathProductIds', value: this.categoryPathLooksups.map(categoryPath => categoryPath.ProductId) },\r\n { key: 'CatalogId', value: this.CatalogId },\r\n { key: 'locale', value: this.locale }\r\n );\r\n\r\n public getCacheObjectType = () => 'CategoryPath';\r\n\r\n public dataCacheType = (): CacheType => 'request';\r\n\r\n /**\r\n * Retrieves locale to use for the current API call.\r\n * @returns A string which represents locale.\r\n */\r\n public getLocale = (): string => this.locale;\r\n\r\n //----------------------------------------------------------\r\n // @CUSTOM\r\n //----------------------------------------------------------\r\n private getCatalog(context: IRequestContext) {\r\n const COOKIE_NAME = 'd365_catalog';\r\n\r\n // Only do something if the user is logged in\r\n if (context.user && (context.user.isB2b || context.user.isOBORequest)) {\r\n\r\n // Attempt to get catalog values from both the cookie and URL\r\n const cookieId = context.cookies.get(COOKIE_NAME); // This may even work on the server\r\n const urlId = context.query && context.query.catalogid; // This should work on the server\r\n\r\n // If catalog is in the URL, that takes precedence. Update the cookie.\r\n if (!urlId && cookieId?.value) {\r\n return +cookieId.value;\r\n }\r\n }\r\n\r\n return getCatalogId(context);\r\n }\r\n}\r\n\r\n/**\r\n * Creates the input required to make the getCategoryPath retail api call.\r\n * @param inputData\r\n */\r\nexport const createGetCategoryPathsInput = (inputData: ICreateActionContext>): IActionInput => {\r\n const productId = getSelectedProductIdFromActionInput(inputData);\r\n if (productId) {\r\n return new GetCategoryPathsInput(inputData.requestContext, [{ ProductId: +productId }]);\r\n }\r\n throw new Error('Unable to create SelectedVariantInput, no productId found on module config or query');\r\n};\r\n\r\n/**\r\n * Calls the Retail API and returns the category path for a product.\r\n * @param input\r\n * @param ctx\r\n */\r\nexport async function getCategoryPathsAction(input: GetCategoryPathsInput, ctx: IActionContext): Promise {\r\n const categoryPathResults = await getCategoryPathsAsync(\r\n {\r\n callerContext: ctx,\r\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(ctx)\r\n },\r\n input.ChannelId,\r\n input.CatalogId,\r\n input.categoryPathLooksups\r\n );\r\n const categoryPath = categoryPathResults[0].CategoryPath && categoryPathResults[0].CategoryPath[0];\r\n const categoryUrl = getCategoriesUrlSync(categoryPath, ctx);\r\n if (categoryUrl) {\r\n /* Do not return the root category of the product*/\r\n return categoryUrl.slice(1);\r\n }\r\n return [];\r\n}\r\n\r\nexport const getCategoryPathsActionDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/retail-actions/get-category-paths',\r\n action: >getCategoryPathsAction,\r\n input: createGetCategoryPathsInput\r\n});\r\n\r\nexport default getCategoryPathsActionDataAction;\r\n","//==============================================================================\r\n// Extended version of global state's get-cart-state action\r\n//\r\n// The base version will check for the checkout cart cookie. If it exists, that\r\n// cart will be loaded. Otherwise, it will copy the regular cart to a new cart.\r\n//\r\n// This version will maintain standard functionality unless a specific query\r\n// parameter exists in the URL.\r\n// If the query parameter exists, a new cart will be constructed with products\r\n// from the query string.\r\n// It would be better to return an empty cart and leave cart population to\r\n// external code, but an empty cart will cause checkout to redirect.\r\n// Intercepting and adding contents before the redirect would be messier than\r\n// adding cart construction to this data action.\r\n//\r\n// NOTES:\r\n// This assumes all products are available in the current catalog. Catalog isn't included in the URL.\r\n// If we add discounts or catalogs, consider encoding the URL for light-weight protection\r\n//==============================================================================\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n ICommerceApiSettings,\r\n ICreateActionContext,\r\n getCatalogId,\r\n} from '@msdyn365-commerce/core';\r\nimport { Cart, CartType } from '@msdyn365-commerce/retail-proxy';\r\nimport { getCartState } from '@msdyn365-commerce/global-state';\r\nimport { copyAsync, readAsync, createCartAsync, addCartLinesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\r\n\r\n//==============================================================================\r\n// INTERFACES\r\n//==============================================================================\r\ninterface ProductAddRequest {\r\n recId: number\r\n quantity: number\r\n}\r\n\r\n//==============================================================================\r\n// INPUT\r\n//==============================================================================\r\n\r\n//==========================================================\r\n// Input class for getCheckoutCart data action.\r\n//==========================================================\r\nexport class GetCheckoutCartInput implements IActionInput {\r\n private readonly apiSettings: ICommerceApiSettings;\r\n public readonly catalogId: number;\r\n\r\n constructor(apiSettings: ICommerceApiSettings, catalogId?: number) {\r\n this.apiSettings = apiSettings;\r\n this.catalogId = catalogId || 0;\r\n }\r\n\r\n public getCacheKey = () => `CheckoutCart-chanId:${this.apiSettings.channelId}-catId:${this.catalogId}`;\r\n public getCacheObjectType = () => 'CheckoutCart';\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\n//==========================================================\r\n//==========================================================\r\nconst createInput = (inputData: ICreateActionContext) => {\r\n const catalogId = getCatalogId(inputData.requestContext);\r\n return new GetCheckoutCartInput(inputData.requestContext.apiSettings, catalogId);\r\n};\r\n\r\n//==============================================================================\r\n// ACTION\r\n//==============================================================================\r\nenum CartTokenPrefix {\r\n Auth = 't',\r\n Anon = 'p'\r\n}\r\n\r\n//==========================================================\r\n//==========================================================\r\nexport async function getCheckoutCart(input: GetCheckoutCartInput, ctx: IActionContext): Promise {\r\n\r\n // Determine whether to use the standard version, or the self-populating version\r\n // @TODO/dg: Make the query param case-insensitive\r\n const useSelfPopulating = !!(ctx.requestContext.query?.cart);\r\n\r\n return useSelfPopulating ? getPopulatedCheckoutCart(input, ctx) : standardGetCheckoutCart(input, ctx);\r\n}\r\n\r\n//==========================================================\r\n// Stand-alone Version\r\n//==========================================================\r\nasync function getPopulatedCheckoutCart(input: GetCheckoutCartInput, ctx: IActionContext): Promise {\r\n\r\n // Parse the request\r\n const cartRequest = parseCartRequest(ctx.requestContext.query!.cart);\r\n\r\n // Ensure there's at least a single product in the request\r\n if (cartRequest.length > 0) {\r\n\r\n // Create an empty checkout cart\r\n let cart = await createCartAsync({ callerContext: ctx, bypassCache: 'none' }, {CartTypeValue: CartType.Checkout} as Cart);\r\n\r\n // Add items to the cart\r\n cart = await addCartLinesAsync({ callerContext: ctx}, cart.Id, cartRequest.map(entry => ({\r\n CatalogId: input.catalogId,\r\n EntryMethodTypeValue: 3, // @FIXME/dg: Set this by name (which name??)\r\n ProductId: entry.recId,\r\n Quantity: entry.quantity,\r\n })));\r\n\r\n return cart;\r\n }\r\n return undefined;\r\n}\r\n\r\n//==========================================================\r\n// Parse requests passed in via query parameter\r\n//\r\n// Format: recId:qty,recId:qty,...\r\n//==========================================================\r\nfunction parseCartRequest(request: string): ProductAddRequest[] {\r\n\r\n // Split the string into a series of item/quantity pairs and process each one\r\n return request.split(',').reduce(\r\n (output: ProductAddRequest[], entry) => {\r\n\r\n // Split item record ID and quantity\r\n const [recId, qty] = entry.split(':');\r\n\r\n // Add to the list if the rec ID and quantity are valid\r\n if (+recId && +qty) {\r\n output.push({\r\n recId: +recId,\r\n quantity: +qty,\r\n });\r\n }\r\n return output;\r\n },\r\n []\r\n );\r\n}\r\n\r\n//==========================================================\r\n// LEGACY VERSION: Data action to copy the cart for checkout actions.\r\n//==========================================================\r\nasync function standardGetCheckoutCart(input: GetCheckoutCartInput, ctx: IActionContext): Promise {\r\n const savedCheckoutCartId = ctx.requestContext.cookies.getCheckoutCartCookie();\r\n const cartCookieParts: string[] = savedCheckoutCartId.split(':');\r\n\r\n let checkoutCartId = null;\r\n const isAuthenticated = ctx.requestContext.user.isAuthenticated;\r\n if (\r\n (isAuthenticated && cartCookieParts[0] === CartTokenPrefix.Auth) ||\r\n (!isAuthenticated && cartCookieParts[0] === CartTokenPrefix.Anon)\r\n ) {\r\n checkoutCartId = cartCookieParts[1];\r\n }\r\n\r\n let checkoutCart: Cart | undefined;\r\n if (checkoutCartId) {\r\n try {\r\n checkoutCart = await readAsync({ callerContext: ctx, bypassCache: 'none' }, checkoutCartId);\r\n } catch (error) {\r\n ctx.telemetry.error('Error getting checkout cart based on saved checkout card id');\r\n ctx.telemetry.exception(error as Error);\r\n }\r\n }\r\n\r\n const cartState = await getCartState(ctx);\r\n if (cartState && cartState.cart.Id !== undefined) {\r\n if (checkoutCart && checkoutCart.Version && cartState.cart.Version && checkoutCart.Version > cartState.cart.Version) {\r\n // @CUSTOM - fix for pickup\r\n if (checkoutCart.DeliveryMode === 'Pickup-PDC') {\r\n checkoutCart.ShippingAddress = {};\r\n }\r\n return Promise.resolve(checkoutCart);\r\n }\r\n return copyAsync({ callerContext: ctx }, cartState.cart.Id, 2)\r\n .then(cart => {\r\n ctx.requestContext.cookies.setCheckoutCartCookie(cart, isAuthenticated);\r\n return cart;\r\n })\r\n .catch(error => {\r\n ctx.telemetry.error('Error copying cart');\r\n ctx.telemetry.exception(error);\r\n return undefined;\r\n });\r\n }\r\n\r\n return undefined;\r\n}\r\n\r\n//==============================================================================\r\n// DEFINITION\r\n//==============================================================================\r\nexport const getCheckoutCartDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce/global-state/get-checkout-cart',\r\n action: >getCheckoutCart,\r\n input: createInput\r\n});\r\n\r\nexport default getCheckoutCartDataAction;\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 {\r\n InvoicePaidStatus,\r\n InvoiceSearchCriteria,\r\n InvoiceType,\r\n OrderInvoice,\r\n SalesOrdersDataActions\r\n} from '@msdyn365-commerce/retail-proxy';\r\n\r\n/**\r\n * Input class for get invoice data action.\r\n */\r\nexport class GetInvoiceInput implements IActionInput {\r\n public invoiceId: string;\r\n\r\n constructor(invoiceId: string) {\r\n this.invoiceId = invoiceId;\r\n }\r\n\r\n public getCacheKey = () => `GetInvoice|${this.invoiceId}`;\r\n\r\n public getCacheObjectType = () => 'OrderInvoice';\r\n\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\nexport const CreateGetInvoiceInput = (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('Unable to get invoice as User is not logged in.');\r\n }\r\n if (!inputData?.requestContext?.query?.invoiceId) {\r\n throw new Error('Unable to get invoice as no valid invoice id found.');\r\n }\r\n\r\n return new GetInvoiceInput(inputData.requestContext.query.invoiceId);\r\n};\r\n\r\nexport async function getInvoice(input: GetInvoiceInput, context: IActionContext): Promise {\r\n if (!context?.requestContext?.user?.isAuthenticated) {\r\n throw new Error('Unable to get invoice. User is not authenticated.');\r\n }\r\n\r\n if (!input.invoiceId) {\r\n throw new Error('Unable to get invoice as no valid invoice id found.');\r\n }\r\n\r\n const invoiceId = input.invoiceId;\r\n\r\n const searchCriteria: InvoiceSearchCriteria = {\r\n CustomerId: context?.requestContext?.user.customerAccountNumber, // @CUSTOM: We need to include the Customer ID for B2C mode since there's no organization\r\n InvoiceIds: [invoiceId],\r\n InvoiceTypeValues: [InvoiceType.SalesOrderInvoice],\r\n InvoicePaidStatusValues: [InvoicePaidStatus.None]\r\n };\r\n\r\n const invoices = await SalesOrdersDataActions.getInvoicesAsync({ callerContext: context }, searchCriteria);\r\n if (!invoices || invoices.length !== 1) {\r\n throw new Error('Unable to get invoice from the server.');\r\n }\r\n\r\n return invoices[0];\r\n}\r\n\r\nexport default createObservableDataAction({\r\n id: 'get-invoice',\r\n action: >getInvoice,\r\n input: CreateGetInvoiceInput\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 {\r\n InvoicePaidStatus,\r\n InvoiceSearchCriteria,\r\n InvoiceType,\r\n IQueryResultSettings,\r\n OrderInvoice,\r\n SalesOrdersDataActions\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport { getCurrentAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/BusinessPartnersDataActions.g';\r\n\r\n//----------------------------------------------------------\r\n//----------------------------------------------------------\r\n// @CUSTOM: Fix imports (absolute references)\r\nimport { getCustomer, GetCustomerInput, QueryResultSettingsProxy } from '@msdyn365-commerce-modules/retail-actions';\r\n//----------------------------------------------------------\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; // @CUSTOM: Added \"?\" for safety. There's no business partner in B2C mode.\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 return SalesOrdersDataActions.getInvoicesAsync(\r\n { callerContext: context, queryResultSettings: input.queryResultSettings },\r\n input.searchCriteria\r\n );\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 * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport MsDyn365, { IRequestContext } from '@msdyn365-commerce/core';\r\nimport { ProductRefinerValue, SortColumn } from '@msdyn365-commerce/retail-proxy';\r\n\r\n/**\r\n * Refiner Compression:\r\n * Refiners contains a non-trivial amount of data that is required to successfully make\r\n * a refiner-based API call. To allow for deep-linking of refiners in the URL, refiner data\r\n * must be compressed so that URL max length is not exceeded. Refiners will be compressed into\r\n * the following array style index-based format:\r\n * [DataTypeValue, LeftValueBoundString, RefinerRecordId, RefinerSourceValue, RightValueBoundString, UnitText].\r\n */\r\nconst compressedRefinerKeys = [\r\n 'DataTypeValue',\r\n 'LeftValueBoundString',\r\n 'RefinerRecordId',\r\n 'RefinerSourceValue',\r\n 'RightValueBoundString',\r\n 'UnitText'\r\n];\r\n\r\n/**\r\n * Hydrates compressed refiner data from URL.\r\n * @param fullUrl The full URL of the page.\r\n * @param requestContext\r\n */\r\nexport const hydrateRefinersFromUrl = (requestContext: IRequestContext): ProductRefinerValue[] => {\r\n const compressedRefinerArray = parseQueryParam<(string | number)[][]>('refiners', requestContext);\r\n if (!compressedRefinerArray || compressedRefinerArray.length === 0) {\r\n return [];\r\n }\r\n\r\n return compressedRefinerArray\r\n .map(compressedRefiner => {\r\n try {\r\n const parsedRefiner: ProductRefinerValue = {};\r\n compressedRefinerKeys.forEach((refinerKey, index) => {\r\n parsedRefiner[refinerKey] = compressedRefiner[index];\r\n });\r\n return parsedRefiner;\r\n } catch {\r\n return undefined;\r\n }\r\n })\r\n .filter(Boolean);\r\n};\r\n\r\n/**\r\n * Compressed a list of refiners for use in URLs.\r\n * @param refiners The uncompressed refiners.\r\n */\r\nexport const compressRefiners = (refiners: ProductRefinerValue[]) => {\r\n const compressedRefiners: (string | number)[][] = [];\r\n\r\n refiners.forEach(refiner => {\r\n const compressedRefiner: (string | number)[] = [];\r\n compressedRefinerKeys.forEach(refinerKey => {\r\n compressedRefiner.push(refiner[refinerKey]);\r\n });\r\n compressedRefiners.push(compressedRefiner);\r\n });\r\n\r\n return compressedRefiners;\r\n};\r\n\r\n/**\r\n * Method which creates a URL contiaining serialized active refiners.\r\n * @param fullUrl The Current URL of the page.\r\n * @param refiners The refiners which should be added to the URL.\r\n * @param sortingColumns\r\n * @param skipCount\r\n */\r\nexport const buildListPageUrl = (fullUrl: URL, refiners?: ProductRefinerValue[], sortingColumns?: SortColumn[], skipCount?: number) => {\r\n // Refiner Change flow\r\n if (refiners !== undefined) {\r\n if (refiners.length === 0) {\r\n fullUrl.searchParams.delete('refiners');\r\n } else {\r\n const sortedRefiners = refiners.sort((first, second) =>\r\n first.RefinerRecordId && second.RefinerRecordId && first.RefinerRecordId > second.RefinerRecordId ? 1 : -1\r\n );\r\n fullUrl.searchParams.set('refiners', JSON.stringify(compressRefiners(sortedRefiners)));\r\n }\r\n\r\n // Adding or removing a refiner means we want to always load page 1\r\n fullUrl.searchParams.delete('skip');\r\n return fullUrl.href;\r\n }\r\n\r\n if (sortingColumns !== undefined) {\r\n if (sortingColumns.length === 0) {\r\n fullUrl.searchParams.delete('sorting');\r\n } else {\r\n fullUrl.searchParams.set('sorting', JSON.stringify(sortingColumns));\r\n }\r\n\r\n // Changing the sort means always load page 1\r\n fullUrl.searchParams.delete('skip');\r\n return fullUrl.href;\r\n }\r\n\r\n if (skipCount) {\r\n fullUrl.searchParams.set('skip', skipCount.toString());\r\n }\r\n\r\n return fullUrl.href;\r\n};\r\n\r\n/**\r\n * Parses a query param from the query object of the request context.\r\n * @param key The query parameter key.\r\n * @param requestContext The request context.\r\n */\r\nexport const parseQueryParam = (key: string, requestContext: IRequestContext): T | null => {\r\n if (requestContext.query && requestContext.query[key]) {\r\n return JSON.parse(decodeURIComponent(requestContext.query[key]));\r\n }\r\n return null;\r\n};\r\n\r\n/**\r\n * Gets the current URL of the page from the request context.\r\n * @param requestContext The request context.\r\n */\r\nexport const getCurrentUrl = (requestContext: IRequestContext): URL => {\r\n if (MsDyn365.isBrowser) {\r\n return new URL(window.location.href);\r\n }\r\n\r\n // NOTE: Typing on requestURL is incorrect\r\n if (requestContext.url.requestUrl.href) {\r\n return new URL(requestContext.url.requestUrl.href);\r\n }\r\n return new URL((requestContext.url.requestUrl));\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 { CacheType, getCatalogId, IActionInput, IAny, ICommerceApiSettings, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\r\nimport { IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\r\nimport {\r\n convertToString,\r\n ChannelInventoryConfiguration,\r\n IQueryResultSettings,\r\n ProductRefinerValue,\r\n SortColumn\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport { generateCacheKey, QueryResultSettingsProxy } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { toJS } from 'mobx';\r\n\r\nimport { hydrateRefinersFromUrl } from './url-utils';\r\n\r\n/**\r\n * Export listPageType.\r\n */\r\nexport type listPageType = 'Category' | 'Search' | 'Unknown';\r\n\r\n/**\r\n * Get include attributes from config.\r\n * @param inputData - ICreateActionContext.\r\n * @returns Boolean.\r\n */\r\nfunction getIncludeAttributes(inputData: ICreateActionContext, IGeneric>): boolean {\r\n if (inputData && inputData.config && inputData.config.includeAttributes !== undefined && inputData.config.includeAttributes === true) {\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\n/**\r\n * Get updateRefinerPanel from config.\r\n * @param inputData - ICreateActionContext.\r\n * @returns Boolean.\r\n */\r\nfunction getUpdateRefinerPanel(inputData: ICreateActionContext, IGeneric>): boolean {\r\n return !!inputData.config?.updateRefinerPanel;\r\n}\r\n\r\n/**\r\n * BaseCollection Action Input.\r\n */\r\nexport class BaseCollectionInput implements IActionInput {\r\n public pageType: listPageType;\r\n\r\n public category: number | undefined;\r\n\r\n public searchText: string | undefined;\r\n\r\n public refiners: ProductRefinerValue[];\r\n\r\n public queryResultSettings: IQueryResultSettings;\r\n\r\n public apiSettings: ICommerceApiSettings;\r\n\r\n public includeAttributes: boolean | undefined;\r\n\r\n public locale?: string;\r\n\r\n public isUpdateRefinerPanel?: boolean;\r\n\r\n public catalogId?: number;\r\n\r\n public channelInventoryConfiguration?: ChannelInventoryConfiguration;\r\n\r\n public inventoryRefiner?: IProductRefinerHierarchy;\r\n\r\n public constructor(\r\n pageType: listPageType,\r\n apiSettings: ICommerceApiSettings,\r\n queryResultSettings: IQueryResultSettings,\r\n refiners: ProductRefinerValue[],\r\n category: number | undefined,\r\n searchText: string | undefined,\r\n includeAttributes: boolean | undefined,\r\n isUpdateRefinerPanel?: boolean | undefined,\r\n locale?: string,\r\n catalogId?: number,\r\n channelInventoryConfiguration?: ChannelInventoryConfiguration,\r\n inventoryRefiner?: IProductRefinerHierarchy\r\n ) {\r\n this.pageType = pageType;\r\n this.apiSettings = apiSettings;\r\n this.category = category;\r\n this.searchText = searchText;\r\n this.queryResultSettings = queryResultSettings;\r\n this.refiners = refiners;\r\n this.includeAttributes = includeAttributes;\r\n this.isUpdateRefinerPanel = isUpdateRefinerPanel;\r\n this.locale = locale;\r\n this.catalogId = catalogId ?? 0;\r\n this.channelInventoryConfiguration = channelInventoryConfiguration;\r\n this.inventoryRefiner = inventoryRefiner;\r\n }\r\n\r\n public getCacheKey = () => {\r\n const queryResultSettings = {\r\n ...this.queryResultSettings.Paging,\r\n ...toJS(this.queryResultSettings.Sorting)\r\n };\r\n\r\n const cacheKey = generateCacheKey(\r\n this.apiSettings,\r\n { key: 'PageType', value: this.pageType },\r\n { key: 'Category', value: this.category },\r\n { key: 'SearchText', value: this.searchText },\r\n { key: 'CatalogId', value: this.catalogId },\r\n {\r\n key: 'Refiners',\r\n value: this.refiners.map(\r\n refiner =>\r\n `RefinerRecordId:${refiner.RefinerRecordId}-LeftValueBoundString:${refiner.LeftValueBoundString ||\r\n ''}-RightValueBoundString:${refiner.RightValueBoundString || ''}`\r\n )\r\n },\r\n { key: 'QueryResultSettings', value: convertToString(queryResultSettings) },\r\n { key: 'Locale', value: this.locale }\r\n );\r\n return cacheKey;\r\n };\r\n\r\n public getCacheObjectType = () => 'CollectionActionResult';\r\n\r\n public dataCacheType = (): CacheType => 'request';\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 IGetFullProductsByCollectionData {\r\n text: string;\r\n}\r\n\r\nexport type CollectionClassConstructor = new (\r\n pageType: listPageType,\r\n apiSettings: ICommerceApiSettings,\r\n queryResultSettings: IQueryResultSettings,\r\n refiners: ProductRefinerValue[],\r\n category: number | undefined,\r\n searchText: string | undefined,\r\n includeAttributes: boolean | undefined,\r\n isUpdateRefinerPanel?: boolean | undefined,\r\n locale?: string,\r\n catalogId?: number,\r\n channelInventoryConfiguration?: ChannelInventoryConfiguration,\r\n inventoryRefiner?: IProductRefinerHierarchy\r\n) => BaseCollectionInput;\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call.\r\n * @param args\r\n * @param inputClassConstuctor\r\n */\r\nexport const createBaseCollectionInput = (\r\n args: ICreateActionContext,\r\n inputClassConstuctor: CollectionClassConstructor\r\n): BaseCollectionInput => {\r\n const pageType =\r\n args.requestContext.urlTokens.pageType === 'Category' || (args.requestContext.query && args.requestContext.query.categoryId)\r\n ? 'Category'\r\n : 'Search';\r\n\r\n const queryResultSettings = QueryResultSettingsProxy.fromInputData(args).QueryResultSettings;\r\n const queryRefiners = hydrateRefinersFromUrl(args.requestContext);\r\n const includeAttributes = getIncludeAttributes(args);\r\n const isUpdateRefinerPanel = getUpdateRefinerPanel(args);\r\n const catalogId = getCatalogId(args.requestContext);\r\n\r\n if (args.requestContext.query && args.requestContext.query.sorting) {\r\n queryResultSettings.Sorting = { Columns: JSON.parse(decodeURIComponent(args.requestContext.query.sorting)) };\r\n }\r\n\r\n if (pageType === 'Category') {\r\n return new inputClassConstuctor(\r\n pageType,\r\n args.requestContext.apiSettings,\r\n queryResultSettings,\r\n queryRefiners,\r\n +(args.requestContext.urlTokens.itemId || (args.requestContext.query && args.requestContext.query.categoryId) || 0),\r\n undefined,\r\n includeAttributes,\r\n isUpdateRefinerPanel,\r\n args.requestContext.locale,\r\n catalogId\r\n );\r\n } else if (pageType === 'Search' && args.requestContext.query && args.requestContext.query.q) {\r\n return new inputClassConstuctor(\r\n pageType,\r\n args.requestContext.apiSettings,\r\n queryResultSettings,\r\n queryRefiners,\r\n undefined,\r\n args.requestContext.query.q,\r\n includeAttributes,\r\n isUpdateRefinerPanel,\r\n args.requestContext.locale,\r\n catalogId\r\n );\r\n } else if (pageType === 'Search' && args.requestContext.query && args.requestContext.query.recommendation) {\r\n let searchText = '';\r\n if (args.requestContext.query.productId) {\r\n searchText = JSON.stringify({\r\n ProductId: args.requestContext.query.productId,\r\n Recommendation: args.requestContext.query.recommendation\r\n });\r\n } else {\r\n searchText = JSON.stringify({ Recommendation: args.requestContext.query.recommendation });\r\n }\r\n return new inputClassConstuctor(\r\n pageType,\r\n args.requestContext.apiSettings,\r\n queryResultSettings,\r\n queryRefiners,\r\n undefined,\r\n searchText,\r\n includeAttributes,\r\n isUpdateRefinerPanel,\r\n args.requestContext.locale,\r\n catalogId\r\n );\r\n }\r\n\r\n throw new Error('[getFullProductsForCollection]Unable to create input');\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 { IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\r\nimport { IActionContext } from '@msdyn365-commerce/core';\r\nimport { IQueryResultSettings, ProductRefiner, ProductSearchCriteria } from '@msdyn365-commerce/retail-proxy';\r\nimport { getProductSearchRefinersAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\n\r\n/**\r\n * Uses Bulk refiner API to get refiners and child refiner values.\r\n * @param searchCriteria Product search criteria.\r\n * @param maxItems Max items.\r\n * @param queryResultSettings\r\n * @param ctx Action context.\r\n */\r\nexport async function getProductRefinerHierarchy(\r\n searchCriteria: ProductSearchCriteria,\r\n queryResultSettings: IQueryResultSettings,\r\n ctx: IActionContext\r\n): Promise {\r\n return getProductSearchRefinersAsync({ callerContext: ctx, queryResultSettings }, searchCriteria).then(\r\n (productRefiners: ProductRefiner[]) => {\r\n if (!productRefiners) {\r\n ctx.trace('[getRefinersByCriteriaAction] returned no refiners');\r\n return [];\r\n }\r\n\r\n const result = (productRefiners || []).map((productRefiner: ProductRefiner) => productRefiner);\r\n\r\n if (result.length === 0) {\r\n ctx.trace('[getRefinersByCriteriaAction] returned no IProductRefinerHierarchy objects');\r\n return [];\r\n }\r\n\r\n // @CUSTOM sort refiners\r\n result.forEach(refiner => {\r\n // Sort the \"Values\" array based on the \"LeftValueBoundString\" field\r\n refiner.Values = refiner.Values.flat().sort((a, b) => {\r\n const leftValueA = (a.LeftValueBoundString || '').toLowerCase();\r\n const leftValueB = (b.LeftValueBoundString || '').toLowerCase();\r\n\r\n if (leftValueA < leftValueB) {\r\n return -1;\r\n }\r\n if (leftValueA > leftValueB) {\r\n return 1;\r\n }\r\n return 0;\r\n });\r\n });\r\n\r\n return result;\r\n }\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 { IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\r\nimport { CacheType, createObservableDataAction, IAction, IActionContext, IActionInput } from '@msdyn365-commerce/core';\r\nimport { buildCacheKey } from '@msdyn365-commerce-modules/retail-actions';\r\n\r\nimport { BaseCollectionInput } from './base-collection-action';\r\nimport { getProductRefinerHierarchy } from './get-product-refiner-hierarchy';\r\n\r\n/**\r\n * InventoryInStockRefinerValue Input action.\r\n */\r\nexport class InventoryInStockRefinerValueInput extends BaseCollectionInput implements IActionInput {\r\n public inventoryProductAttributeRecordId: number;\r\n\r\n public constructor(input: BaseCollectionInput, inventoryProductAttributeRecordId: number = 0) {\r\n super(\r\n input.pageType,\r\n input.apiSettings,\r\n {\r\n count: true\r\n },\r\n\r\n // Parameter - refiners\r\n [],\r\n\r\n // Parameter - category\r\n undefined,\r\n\r\n // Parameter - searchText\r\n '',\r\n\r\n // Parameter - includeAttributes\r\n false,\r\n\r\n // Parameter - isUpdateRefinerPanel\r\n false,\r\n\r\n // Parameter - locale\r\n undefined,\r\n input.catalogId,\r\n input.channelInventoryConfiguration,\r\n input.inventoryRefiner\r\n );\r\n\r\n this.inventoryProductAttributeRecordId =\r\n inventoryProductAttributeRecordId || input.channelInventoryConfiguration?.InventoryProductAttributeRecordId || 0;\r\n }\r\n\r\n /**\r\n * GetCacheKey.\r\n * @returns - Returns string.\r\n */\r\n public getCacheKey = (): string => buildCacheKey('RefinerList', this.apiSettings);\r\n\r\n /**\r\n * GetCacheObjectType.\r\n * @returns - Returns string.\r\n */\r\n public getCacheObjectType = (): string => 'RefinerList';\r\n\r\n /**\r\n * DataCacheType.\r\n * @returns - CacheType string.\r\n */\r\n public dataCacheType = (): CacheType => 'application';\r\n}\r\n\r\n/**\r\n * Action method returns inventory in stock refiners.\r\n * @param input - InventoryInStockRefinerValueInput.\r\n * @param context - IActionContext.\r\n * @returns - Promise.\r\n */\r\nasync function action(input: InventoryInStockRefinerValueInput, context: IActionContext): Promise {\r\n const refiners = await getProductRefinerHierarchy(\r\n {\r\n Context: {\r\n ChannelId: input.apiSettings.channelId,\r\n CatalogId: input.catalogId\r\n }\r\n },\r\n input.queryResultSettings,\r\n context\r\n );\r\n\r\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\r\n // Why recId of default refiner Category/Price/Rating is 0: see GetChannelProductRefiners.sql\r\n return (\r\n (input.channelInventoryConfiguration?.InventoryProductAttributeRecordId !== 0 &&\r\n refiners.find(refiner => refiner.RecordId === input.channelInventoryConfiguration?.InventoryProductAttributeRecordId)) ||\r\n // keep legacy logic to avoid break existing customers usage from this file\r\n (input.inventoryProductAttributeRecordId !== 0 &&\r\n refiners.find(refiner => refiner.RecordId === input.inventoryProductAttributeRecordId)) ||\r\n null\r\n );\r\n}\r\n\r\n/**\r\n * Action.\r\n * @param id - Id.\r\n * @param action - Action.\r\n * @returns - Results.\r\n */\r\nexport const actionDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/search-result-container/get-inventory-refiners',\r\n action: action as IAction\r\n});\r\n\r\nexport default actionDataAction;\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 {\r\n AsyncResult,\r\n ChannelInventoryConfiguration,\r\n ProductRefinerValue,\r\n ProductSearchCriteria,\r\n ProductSearchResult\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport { searchByCriteriaAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { getInventoryConfigurationAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\r\nimport { ArrayExtensions, generateProductImageUrl, InventoryLevels } from '@msdyn365-commerce-modules/retail-actions';\r\n\r\nimport { BaseCollectionInput, createBaseCollectionInput } from './base-collection-action';\r\nimport getInventoryRefinerAction, { InventoryInStockRefinerValueInput } from './get-inventory-refiners';\r\n\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 /**\r\n * The data cache type.\r\n * @returns The data cache type.\r\n */\r\n public dataCacheType = (): CacheType => {\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 'application';\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\nexport interface IFullProductsSearchResultsWithCount {\r\n products: ProductSearchResult[];\r\n count: number;\r\n channelInventoryConfigurationId?: number;\r\n inventoryAwareSortableAttributeId?: number;\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 inventory in stock refiner value.\r\n * @param input - The inventory refiner input.\r\n * @param context - The request context.\r\n * @param channelInventoryConfiguration - The channelInventoryConfiguration.\r\n * @returns Refiners.\r\n */\r\nasync function getInventoryInStockRefinerValueAsync(\r\n input: GetFullProductsByCollectionInput,\r\n context: IActionContext,\r\n channelInventoryConfiguration: ChannelInventoryConfiguration\r\n): Promise {\r\n let inventoryRefiner = input.inventoryRefiner;\r\n // For hydrate, the inventory refiner is not added on input parameter, need to query the inventory refiner\r\n // For reaction in browser, the inventory refiner is added in componentDidMount of search-result-container\r\n if (!inventoryRefiner) {\r\n const refinerInput = new InventoryInStockRefinerValueInput(input, channelInventoryConfiguration.InventoryProductAttributeRecordId);\r\n inventoryRefiner = await getInventoryRefinerAction(refinerInput, context);\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- inventoryRefiner may be null\r\n return (\r\n inventoryRefiner?.Values.find(\r\n value =>\r\n value.LeftValueBoundString !== channelInventoryConfiguration.InventoryOutOfStockAttributeValueText &&\r\n value.RightValueBoundString !== channelInventoryConfiguration.InventoryOutOfStockAttributeValueText\r\n ) ?? null\r\n );\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): Promise {\r\n const defaultProductCount: number = 0;\r\n\r\n const productSearchResultsWithImages = productSearchResults.map(productSearchResult => {\r\n const newImageUrl = generateProductImageUrl(productSearchResult, context.requestContext.apiSettings);\r\n\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\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(input: GetFullProductsByCollectionInput, context: IActionContext): Promise {\r\n let promise: AsyncResult;\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 searchCriteriaInput.Refinement = input.refiners;\r\n searchCriteriaInput.IncludeAttributes = input.includeAttributes;\r\n searchCriteriaInput.SkipVariantExpansion = true;\r\n const defaultNumber: number = 0;\r\n\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 if (context.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.HideOOS) {\r\n const inventoryInStockRefinerValue = await getInventoryInStockRefinerValueAsync(input, context, channelInventoryConfiguration);\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(column => column.ColumnName === sortColumnName);\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 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\r\n const productSearchResults = await promise;\r\n return returnProducts(productSearchResults, context, promise.metadata.count, channelInventoryConfiguration);\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","/*!\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 { IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\r\nimport { createObservableDataAction, IAction, IActionContext, IActionInput, ICreateActionContext } from '@msdyn365-commerce/core';\r\nimport { AsyncResult, ChannelInventoryConfiguration, ProductRefinerValue, ProductSearchCriteria } from '@msdyn365-commerce/retail-proxy';\r\nimport { getInventoryConfigurationAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\r\n\r\nimport { BaseCollectionInput, createBaseCollectionInput } from './base-collection-action';\r\nimport { getProductRefinerHierarchy } from './get-product-refiner-hierarchy';\r\nimport { ProductListInventoryFilteringOptions } from './get-full-products-by-collection';\r\nimport getInventoryRefinerAction, { InventoryInStockRefinerValueInput } from './get-inventory-refiners';\r\n\r\n/**\r\n * Default Category/Product Id Values.\r\n */\r\nenum DefaultValues {\r\n defaultCategoryIdValue = 0,\r\n defaultProductIdValue = 0\r\n}\r\n\r\n/**\r\n * Refiners-by-Collection Input action.\r\n */\r\nexport class RefinersByCollectionInput extends BaseCollectionInput implements IActionInput {\r\n public getCacheObjectType = () => 'ProductRefiner';\r\n\r\n public dataCacheType = () => {\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 'application';\r\n };\r\n}\r\n\r\n/**\r\n * Create input method which creates an ActionInput for fetching list page refiners.\r\n * @param args\r\n */\r\nconst createInput = (args: ICreateActionContext): IActionInput => {\r\n return createBaseCollectionInput(args, RefinersByCollectionInput);\r\n};\r\n\r\n/**\r\n * Returns inventory in stock refiner value.\r\n * @param input - The inventory refiner input.\r\n * @param context - The request context.\r\n * @param channelInventoryConfiguration - The channelInventoryConfiguration.\r\n * @returns Refiners.\r\n */\r\nasync function getInventoryInStockRefinerValueAsync(\r\n input: RefinersByCollectionInput,\r\n context: IActionContext,\r\n channelInventoryConfiguration: ChannelInventoryConfiguration\r\n): Promise {\r\n let inventoryRefiner = input.inventoryRefiner;\r\n // For hydrate, the inventory refiner is not added on input parameter, need to query the inventory refiner\r\n // For reaction in browser, the inventory refiner is added in componentDidMount of search-result-container\r\n if (!inventoryRefiner) {\r\n const refinerInput = new InventoryInStockRefinerValueInput(input, channelInventoryConfiguration.InventoryProductAttributeRecordId);\r\n inventoryRefiner = await getInventoryRefinerAction(refinerInput, context);\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- inventoryRefiner may be null\r\n return (\r\n inventoryRefiner?.Values.find(\r\n value =>\r\n value.LeftValueBoundString !== channelInventoryConfiguration.InventoryOutOfStockAttributeValueText &&\r\n value.RightValueBoundString !== channelInventoryConfiguration.InventoryOutOfStockAttributeValueText\r\n ) ?? null\r\n );\r\n}\r\n\r\n/**\r\n * Action method which fetches refiners for the given list page.\r\n * @param input\r\n * @param context\r\n */\r\nasync function action(input: RefinersByCollectionInput, context: IActionContext): Promise {\r\n let searchProductId;\r\n const refiners: ProductRefinerValue[] = input.refiners || [];\r\n\r\n if (context.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.HideOOS) {\r\n let channelInventoryConfigurationPromise: AsyncResult;\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 const inventoryInStockRefinerValue = await getInventoryInStockRefinerValueAsync(input, context, channelInventoryConfiguration);\r\n\r\n const isInventoryInStockRefinerValueExist = refiners.some(\r\n refiner => refiner.RefinerRecordId === inventoryInStockRefinerValue?.RefinerRecordId\r\n );\r\n if (!isInventoryInStockRefinerValueExist && inventoryInStockRefinerValue) {\r\n refiners.push(inventoryInStockRefinerValue);\r\n }\r\n }\r\n\r\n if (input.pageType === 'Category') {\r\n if (input.category) {\r\n return getProductRefinerHierarchy(\r\n {\r\n CategoryIds: [input.category || DefaultValues.defaultCategoryIdValue],\r\n Context: {\r\n ChannelId: input.apiSettings.channelId,\r\n CatalogId: input.catalogId\r\n },\r\n Refinement: input.isUpdateRefinerPanel ? refiners : []\r\n },\r\n input.queryResultSettings,\r\n context\r\n );\r\n }\r\n throw new Error('[GetRefinersForCollection]Category Page Detected, but no global categoryId found');\r\n } else {\r\n if (input.searchText && context.requestContext.query && context.requestContext.query.q) {\r\n return getProductRefinerHierarchy(\r\n {\r\n SearchCondition: input.searchText,\r\n Context: {\r\n ChannelId: input.apiSettings.channelId,\r\n CatalogId: input.catalogId\r\n },\r\n Refinement: input.isUpdateRefinerPanel ? refiners : []\r\n },\r\n input.queryResultSettings,\r\n context\r\n );\r\n }\r\n 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 (!searchObject.Recommendation) {\r\n throw new Error('Failed to retrieve the Recommendation.');\r\n } else {\r\n const searchCriteriaInput: ProductSearchCriteria = {};\r\n searchCriteriaInput.Context = {\r\n ChannelId: input.apiSettings.channelId,\r\n CatalogId: input.catalogId\r\n };\r\n searchCriteriaInput.Refinement = input.isUpdateRefinerPanel ? refiners : [];\r\n searchCriteriaInput.RecommendationListId = searchObject.Recommendation;\r\n if (searchProductId) {\r\n searchCriteriaInput.Ids = [searchProductId || DefaultValues.defaultProductIdValue];\r\n }\r\n return getProductRefinerHierarchy(searchCriteriaInput, input.queryResultSettings, context);\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 }\r\n}\r\n\r\nexport const actionDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/search-result-container/get-refiners-for-collection',\r\n action: >action,\r\n input: createInput\r\n});\r\n\r\nexport default actionDataAction;\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 = 'action-overrides/get-categories-hierarchy.action';\n binding.dataActions[actionPath] = require('partner/action-overrides/get-categories-hierarchy.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'action-overrides/get-category-paths.action';\n binding.dataActions[actionPath] = require('partner/action-overrides/get-category-paths.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'action-overrides/get-checkout-cart.action';\n binding.dataActions[actionPath] = require('partner/action-overrides/get-checkout-cart.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'action-overrides/get-invoice.action';\n binding.dataActions[actionPath] = require('partner/action-overrides/get-invoice.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'action-overrides/get-invoices.action';\n binding.dataActions[actionPath] = require('partner/action-overrides/get-invoices.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'action-overrides/plp-actions/get-refiners-for-collection.action';\n binding.dataActions[actionPath] = require('partner/action-overrides/plp-actions/get-refiners-for-collection.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;","'use strict';\nvar $TypeError = TypeError;\nvar MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991\n\nmodule.exports = function (it) {\n if (it > MAX_SAFE_INTEGER) throw $TypeError('Maximum allowed index exceeded');\n return it;\n};\n","'use strict';\nvar isArray = require('../internals/is-array');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar doesNotExceedSafeInteger = require('../internals/does-not-exceed-safe-integer');\nvar bind = require('../internals/function-bind-context');\n\n// `FlattenIntoArray` abstract operation\n// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray\nvar flattenIntoArray = function (target, original, source, sourceLen, start, depth, mapper, thisArg) {\n var targetIndex = start;\n var sourceIndex = 0;\n var mapFn = mapper ? bind(mapper, thisArg) : false;\n var element, elementLen;\n\n while (sourceIndex < sourceLen) {\n if (sourceIndex in source) {\n element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];\n\n if (depth > 0 && isArray(element)) {\n elementLen = lengthOfArrayLike(element);\n targetIndex = flattenIntoArray(target, original, element, elementLen, targetIndex, depth - 1) - 1;\n } else {\n doesNotExceedSafeInteger(targetIndex + 1);\n target[targetIndex] = element;\n }\n\n targetIndex++;\n }\n sourceIndex++;\n }\n return targetIndex;\n};\n\nmodule.exports = flattenIntoArray;\n","'use strict';\nvar $ = require('../internals/export');\nvar flattenIntoArray = require('../internals/flatten-into-array');\nvar toObject = require('../internals/to-object');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\nvar arraySpeciesCreate = require('../internals/array-species-create');\n\n// `Array.prototype.flat` method\n// https://tc39.es/ecma262/#sec-array.prototype.flat\n$({ target: 'Array', proto: true }, {\n flat: function flat(/* depthArg = 1 */) {\n var depthArg = arguments.length ? arguments[0] : undefined;\n var O = toObject(this);\n var sourceLen = lengthOfArrayLike(O);\n var A = arraySpeciesCreate(O, 0);\n A.length = flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toIntegerOrInfinity(depthArg));\n return A;\n }\n});\n","'use strict';\n// this method was added to unscopables after implementation\n// in popular engines, so it's moved to a separate module\nvar addToUnscopables = require('../internals/add-to-unscopables');\n\n// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables('flat');\n"],"names":["CategoriesInput","constructor","context","mappedToHierarchy","maxItems","includeRootCategory","getCacheKey","generateCacheKey","this","apiSettings","key","value","sitePath","catalogId","locale","getCacheObjectType","_mappedToHierarchy","dataCacheType","getLocale","channelId","getCatalog","user","isB2b","isOBORequest","cookieId","cookies","get","query","catalogid","getCatalogId","getFriendlyName","nameTranslations","nameTranslation","length","find","item","Language","toLowerCase","Text","mapCategoryToHierarchy","categoryList","ctx","_rootCategory$Childre","categoryMap","category","localName","NameTranslations","categoryHierarchy","_objectSpread","NeutralizedName","Name","RecordId","rootCategory","Object","values","parentId","ParentCategory","Url","getCategoryUrl","parent","Children","push","createCategoriesHierarchyInput","inputData","topItems","config","topCategories","Number","parseInt","requestContext","async","getCategoryHierarchyAction","input","categories","getCategories","RawCategoriesInput","getCategoryHierarchyActionDataAction","createObservableDataAction","id","action","GetCategoryPathsInput","categoryPathLooksups","_requestContext","map","categoryPath","ProductId","CatalogId","ChannelId","createGetCategoryPathsInput","productId","getSelectedProductIdFromActionInput","Error","getCategoryPathsAction","categoryPathResults","getCategoryPathsAsync","callerContext","queryResultSettings","QueryResultSettingsProxy","getPagingFromInputDataOrDefaultValue","CategoryPath","categoryUrl","getCategoriesUrlSync","slice","getCategoryPathsActionDataAction","GetCheckoutCartInput","CartTokenPrefix","getCheckoutCart","_ctx$requestContext$q","cart","cartRequest","request","split","reduce","output","entry","recId","qty","quantity","createCartAsync","bypassCache","CartTypeValue","CartType","Checkout","addCartLinesAsync","Id","EntryMethodTypeValue","Quantity","getPopulatedCheckoutCart","cartCookieParts","getCheckoutCartCookie","checkoutCartId","isAuthenticated","Auth","Anon","checkoutCart","readAsync","error","telemetry","exception","cartState","getCartState","undefined","Version","DeliveryMode","ShippingAddress","Promise","resolve","copyAsync","then","setCheckoutCartCookie","catch","standardGetCheckoutCart","getCheckoutCartDataAction","GetInvoiceInput","invoiceId","CreateGetInvoiceInput","_inputData$requestCon","getInvoice","_context$requestConte","_context$requestConte2","searchCriteria","CustomerId","customerAccountNumber","InvoiceIds","InvoiceTypeValues","InvoiceType","SalesOrderInvoice","InvoicePaidStatusValues","InvoicePaidStatus","None","invoices","SalesOrdersDataActions","GetInvoicesInput","CreateGetInvoicesInput","fromInputData","QueryResultSettings","getInvoices","businessPartner","getCurrentAsync","BusinessPartnerId","customer","getCustomer","GetCustomerInput","AccountNumber","getInvoicesDataAction","compressedRefinerKeys","parseQueryParam","JSON","parse","decodeURIComponent","BaseCollectionInput","pageType","refiners","searchText","includeAttributes","isUpdateRefinerPanel","channelInventoryConfiguration","inventoryRefiner","Paging","toJS","Sorting","refiner","RefinerRecordId","LeftValueBoundString","RightValueBoundString","convertToString","createBaseCollectionInput","args","inputClassConstuctor","urlTokens","categoryId","queryRefiners","compressedRefinerArray","compressedRefiner","parsedRefiner","forEach","refinerKey","index","_unused","filter","Boolean","hydrateRefinersFromUrl","_inputData$config","updateRefinerPanel","getUpdateRefinerPanel","sorting","Columns","itemId","q","recommendation","stringify","Recommendation","getProductRefinerHierarchy","getProductSearchRefinersAsync","productRefiners","trace","result","productRefiner","Values","flat","sort","a","b","leftValueA","leftValueB","InventoryInStockRefinerValueInput","_input$channelInvento","inventoryProductAttributeRecordId","arguments","super","count","buildCacheKey","InventoryProductAttributeRecordId","_input$channelInvento2","Context","_input$channelInvento3","GetFullProductsByCollectionInput","ProductListInventoryFilteringOptions","_context$requestConte3","_context$requestConte4","promise","channelInventoryConfigurationPromise","searchProductId","searchCriteriaInput","Refinement","IncludeAttributes","SkipVariantExpansion","AsyncResult","getInventoryConfigurationAsync","app","productListInventoryDisplay","HideOOS","inventoryInStockRefinerValue","_inventoryRefiner$Val","_inventoryRefiner","refinerInput","getInventoryRefinerAction","InventoryOutOfStockAttributeValueText","getInventoryInStockRefinerValueAsync","some","SortOOS","ProductAvailabilitySortableAttributeRecordId","_input$queryResultSet","_input$queryResultSet2","sortColumnName","column","ColumnName","IsDescending","CategoryIds","searchByCriteriaAsync","SearchCondition","searchObject","isNaN","RecommendationListId","Ids","productSearchResults","metadataCount","productSearchResultsWithImages","productSearchResult","newImageUrl","generateProductImageUrl","PrimaryImageUrl","inventoryLevel","InventoryLevels","threshold","enableStockCheck","products","ArrayExtensions","hasElements","AttributeValues","element","inventoryRanges","TextValue","channelInventoryConfigurationId","inventoryAwareSortableAttributeId","returnProducts","metadata","Top","itemsPerPage","skip","Skip","DefaultValues","RefinersByCollectionInput","actionDataAction","defaultCategoryIdValue","defaultProductIdValue","binding","modules","dataActions","registerActionId","actionPath","default","prototype","keys","exportName","Action","require","window","__bindings__","packageDataActions","module","exports","React","ReactDOM","$TypeError","TypeError","it","isArray","lengthOfArrayLike","doesNotExceedSafeInteger","bind","flattenIntoArray","target","original","source","sourceLen","start","depth","mapper","thisArg","elementLen","targetIndex","sourceIndex","mapFn","$","toObject","toIntegerOrInfinity","arraySpeciesCreate","proto","depthArg","O","A","addToUnscopables"],"sourceRoot":""}