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T,EAAYpT,MACnE2X,EAAWrT,cAZFkR,GAAM,WACjB,MAAO,CAAC,EAAG,GAAGqC,mBAAqB,IAAIzG,EAAU,CAAC,EAAG,IAAIyG,sBACpDrC,GAAM,WACXpE,EAAUE,UAAUuG,eAAevC,KAAK,CAAC,EAAG","sources":["webpack://Dobbies.Commerce/../../src/get-categories-hierarchy.ts?acde","webpack://Dobbies.Commerce/../../src/get-categories.ts?8dc6","webpack://Dobbies.Commerce/../../../../src/utilities/Url-builder/parameterize.ts?f5a5","webpack://Dobbies.Commerce/../../../../src/utilities/Url-builder/category-url-builder.ts?e564","webpack://Dobbies.Commerce/../../../../src/utilities/Url-builder/invoice-url-builder.ts?d542","webpack://Dobbies.Commerce/../../../../src/utilities/Url-builder/product-url-builder.ts?baf1","webpack://Dobbies.Commerce/../../../../src/utilities/data-structures/dictionary.ts?bab3","webpack://Dobbies.Commerce/../../../../src/utilities/events/event.ts?15a9","webpack://Dobbies.Commerce/../../../src/utilities/product-inventory-information.ts?0ec6","webpack://Dobbies.Commerce/../../../../src/utilities/promise-queue/finite-promise-queue.ts?77bf","webpack://Dobbies.Commerce/../../../../src/utilities/promise-queue/promise-queue.ts?e362","webpack://Dobbies.Commerce/./node_modules/@msdyn365-commerce-modules/retail-actions/node_modules/uuid/dist/esm-browser/rng.js?b47d","webpack://Dobbies.Commerce/./node_modules/@msdyn365-commerce-modules/retail-actions/node_modules/uuid/dist/esm-browser/regex.js?08ba","webpack://Dobbies.Commerce/./node_modules/@msdyn365-commerce-modules/retail-actions/node_modules/uuid/dist/esm-browser/validate.js?acea","webpack://Dobbies.Commerce/./node_modules/@msdyn365-commerce-modules/retail-actions/node_modules/uuid/dist/esm-browser/stringify.js?6cb1","webpack://Dobbies.Commerce/./node_modules/@msdyn365-commerce-modules/retail-actions/node_modules/uuid/dist/esm-browser/v4.js?0101","webpack://Dobbies.Commerce/../../../../src/utilities/random/guid.ts?1947","webpack://Dobbies.Commerce/../../../../src/utilities/random/index.ts?1f9d","webpack://Dobbies.Commerce/../../../../src/utilities/regex/email-regex.ts?6a6a","webpack://Dobbies.Commerce/../../../../src/utilities/regex/password-regex.ts?456d","webpack://Dobbies.Commerce/../../../../src/utilities/regex/phone-regex.ts?9ada","webpack://Dobbies.Commerce/../../../src/utilities/validate-cartlines-inventory.ts?8b82","webpack://Dobbies.Commerce/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/internals/array-buffer-basic-detection.js?f9cc","webpack://Dobbies.Commerce/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/internals/array-buffer-view-core.js?b510","webpack://Dobbies.Commerce/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/internals/array-fill.js?bf4c","webpack://Dobbies.Commerce/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/internals/to-big-int.js?0cbf","webpack://Dobbies.Commerce/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/internals/to-offset.js?9da8","webpack://Dobbies.Commerce/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/internals/to-positive-integer.js?9a5c","webpack://Dobbies.Commerce/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/modules/es.typed-array.fill.js?db26","webpack://Dobbies.Commerce/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/modules/es.typed-array.set.js?a29e","webpack://Dobbies.Commerce/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/modules/es.typed-array.sort.js?b52e","webpack://Dobbies.Commerce/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/modules/es.typed-array.to-locale-string.js?7764"],"sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { CategoryHierarchy } from '@msdyn365-commerce/commerce-entities';\nimport {\n CacheType,\n createObservableDataAction,\n getCatalogId,\n IAction,\n IActionContext,\n IActionInput,\n IAny,\n ICommerceApiSettings,\n ICreateActionContext,\n IGeneric,\n IRequestContext\n} from '@msdyn365-commerce/core';\nimport { Category, TextValueTranslation } from '@msdyn365-commerce/retail-proxy';\n\nimport getCategoryAction, { CategoriesInput as RawCategoriesInput } from './get-categories';\nimport { getCategoryUrl } from './utilities/Url-builder';\nimport { generateCacheKey } from './utilities/utils';\n\n/**\n * Input for get-categories data action.\n */\nexport class CategoriesInput implements IActionInput {\n public readonly maxItems: number;\n\n public readonly channelId: number;\n\n public includeRootCategory?: boolean;\n\n private readonly catalogId: number;\n\n private readonly sitePath: string;\n\n private readonly _mappedToHierarchy: boolean;\n\n private readonly apiSettings: ICommerceApiSettings;\n\n private readonly locale?: string;\n\n public constructor(context: IRequestContext, mappedToHierarchy: boolean, maxItems?: number, includeRootCategory?: boolean) {\n this._mappedToHierarchy = mappedToHierarchy;\n this.includeRootCategory = includeRootCategory;\n this.maxItems = maxItems || 250;\n this.channelId = context && context.apiSettings && context.apiSettings.channelId ? +context.apiSettings.channelId : 0;\n this.sitePath = (context && context.sitePath) || '';\n this.apiSettings = context.apiSettings;\n this.locale = context.locale || '';\n this.catalogId = getCatalogId(context);\n }\n\n public getCacheKey = () =>\n generateCacheKey(\n this.apiSettings,\n { key: 'SitePath', value: this.sitePath },\n { key: 'IncludeRootCategory', value: this.includeRootCategory },\n { key: 'Top', value: this.maxItems },\n { key: 'CatalogId', value: this.catalogId },\n { key: 'Locale', value: this.locale }\n );\n\n public getCacheObjectType = () => (this._mappedToHierarchy ? 'CategoryHierarchy' : 'Category');\n\n public dataCacheType = (): CacheType => 'request';\n\n public getLocale = (): string => this.locale || '';\n}\n\nconst getFriendlyName = (locale?: string, nameTranslations?: TextValueTranslation[]): string | undefined => {\n let nameTranslation: TextValueTranslation | undefined;\n if (locale && nameTranslations && nameTranslations.length > 0) {\n nameTranslation = nameTranslations.find(item => item.Language!.toLowerCase() === locale.toLowerCase());\n }\n\n return nameTranslation && nameTranslation.Text;\n};\n\nexport interface ICategoryMap {\n [RecordId: number]: CategoryHierarchy;\n}\n\n/**\n * Creates a hierarchy of categories based on the ParentCategory property.\n * @param categoryList Categories that will be converted into a hierarchy.\n * @param ctx\n * @param locale\n * @returns Hierarchy of categories in array.\n */\nexport const mapCategoryToHierarchy = (\n categoryList: Category[],\n ctx: IActionContext,\n locale?: string,\n includeRootCategory?: boolean\n): CategoryHierarchy[] => {\n if (!categoryList || categoryList.length === 0) {\n return [];\n }\n\n const categoryMap: ICategoryMap = {};\n\n for (const category of categoryList) {\n const localName = getFriendlyName(locale, category.NameTranslations);\n const categoryHierarchy = { ...category };\n categoryHierarchy.NeutralizedName = category.Name;\n categoryHierarchy.Name = localName || categoryHierarchy.NeutralizedName;\n categoryMap[category.RecordId] = categoryHierarchy;\n }\n\n let rootCategory: CategoryHierarchy | undefined;\n\n for (const category of Object.values(categoryMap)) {\n const parentId = category.ParentCategory;\n category.Url = getCategoryUrl(category, ctx, categoryMap);\n if (parentId === 0) {\n rootCategory = category;\n continue;\n }\n\n const parent = parentId && categoryMap[parentId];\n if (parent) {\n parent.Children = parent.Children || [];\n parent.Children.push(category);\n }\n }\n\n if (!rootCategory) {\n return [];\n }\n\n if (includeRootCategory) {\n const categoryHierarchy: CategoryHierarchy[] = [];\n categoryHierarchy.push(rootCategory);\n return categoryHierarchy;\n }\n\n return rootCategory.Children ?? [];\n};\n\n/**\n * Creates the input required to make the retail api call.\n * @param inputData\n */\nexport const createCategoriesHierarchyInput = (inputData: ICreateActionContext>): IActionInput => {\n const topItems = inputData.config && inputData.config.topCategories && Number.parseInt(inputData.config.topCategories, 10);\n return new CategoriesInput(inputData.requestContext, true, topItems);\n};\n\n/**\n * Calls the Retail API and returns all the categories as a hierarchy.\n * @param input\n * @param ctx\n */\nexport async function getCategoryHierarchyAction(input: CategoriesInput, ctx: IActionContext): Promise {\n const categories = await getCategoryAction(new RawCategoriesInput(ctx.requestContext, false, input.maxItems), ctx);\n return mapCategoryToHierarchy(categories, ctx, input.getLocale(), input.includeRootCategory);\n}\n\nexport const getCategoryHierarchyActionDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/retail-actions/get-categories-hierarchy',\n action: >getCategoryHierarchyAction,\n input: createCategoriesHierarchyInput\n});\n\nexport default getCategoryHierarchyActionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { CategoryHierarchy } from '@msdyn365-commerce/commerce-entities';\nimport {\n CacheType,\n createObservableDataAction,\n getCatalogId,\n IAction,\n IActionContext,\n IActionInput,\n IAny,\n ICreateActionContext,\n IGeneric,\n IRequestContext\n} from '@msdyn365-commerce/core';\nimport { CategoriesDataActions } from '@msdyn365-commerce/retail-proxy';\nimport { generateCacheKey } from './utilities';\n\n/**\n * Input for get-categories data action.\n */\nexport class CategoriesInput implements IActionInput {\n public readonly maxItems: number;\n\n public readonly channelId: number;\n\n public readonly catalogId?: number;\n\n private readonly _requestContext: IRequestContext;\n\n private readonly _mappedToHierarchy: boolean;\n\n public constructor(context: IRequestContext, mappedToHierarchy: boolean, maxItems?: number) {\n this._requestContext = context;\n this._mappedToHierarchy = mappedToHierarchy;\n this.maxItems = maxItems || 250;\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Required.\n this.channelId = context?.apiSettings?.channelId ? Number(context.apiSettings.channelId) : 0;\n this.catalogId = getCatalogId(context);\n }\n\n /**\n * Get Cache Key.\n * @returns - Cache key string.\n */\n public getCacheKey = (): string =>\n generateCacheKey(\n this._requestContext.apiSettings,\n { key: 'Top', value: this.maxItems },\n { key: 'CatalogId', value: this.catalogId }\n );\n\n /**\n * Get Cache type Name.\n * @returns - Cache name string.\n */\n public getCacheObjectType = (): string => (this._mappedToHierarchy ? 'CategoryHierarchy' : 'Category');\n\n /**\n * Get Cache type.\n * @returns - CacheType enum.\n */\n public dataCacheType = (): CacheType => 'application';\n}\n\n/**\n * Creates the input required to make the retail api call.\n * @param inputData -- Input data.\n * @returns -- IActionInput.\n */\nexport const createCategoriesInput = (inputData: ICreateActionContext>): IActionInput => {\n const topItems = inputData.config?.topCategories && Number.parseInt(inputData.config.topCategories, 10);\n return new CategoriesInput(inputData.requestContext, false, topItems);\n};\n\n/**\n * Calls the Retail API and returns all the categories as a flat list.\n * @param input - Input.\n * @param ctx - Context.\n * @returns - CategoryHierarchy.\n */\nexport async function getCategoryAction(input: CategoriesInput, ctx: IActionContext): Promise {\n return ((await CategoriesDataActions.getCategoriesAsync(\n {\n callerContext: ctx\n },\n input.channelId,\n input.catalogId\n )) as unknown) as CategoryHierarchy[];\n}\n\n/**\n * The getCategory Data Action.\n */\nexport const getCategoryActionDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/retail-actions/get-categories',\n action: getCategoryAction as IAction,\n input: createCategoriesInput\n});\n\nexport default getCategoryActionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport msdyn365Commerce, { IParameterizeFeatureFlags } from '@msdyn365-commerce/core';\n\nexport function parameterize(\n name: string = '',\n sep = '-',\n parameterizeFeatureFlags: IParameterizeFeatureFlags = {},\n neutralizedName?: string\n) {\n // If neutralizedName flag enabled, we use neutralizedName to construct string\n const candidateName =\n (msdyn365Commerce.platformSettings && msdyn365Commerce.platformSettings.enableUrlLocalization) ||\n parameterizeFeatureFlags.enableUrlLocalization\n ? name\n : neutralizedName || name;\n\n /*\n 1\t‘ ‘ (space)\t-> (single dash)\n 3\tAny character disallowed in URLs -> URL-encode\n 5\t‘ & ‘ (space ampersand space) -> (single dash)\n 6\t‘ - ‘ (space dash space) -> (single dash)\n 7\t‘ ‘ (2+ spaces) -> (single dash)\n 10\t[A-Z] (capital letters) -> [a-z] (lower-case)\n 12\tAny non-ASCII character outside of the set of disallowed characters -> URL-encode\n */\n if (\n parameterizeFeatureFlags.enableUrlEncoding ||\n (msdyn365Commerce.platformSettings && msdyn365Commerce.platformSettings.enableUrlEncoding)\n ) {\n // Replace url reserved characters with dash, and remove front and end dash;\n // &*!() reserved characters that can not be encoded by encodeURIComponent()\n return encodeURIComponent(\n candidateName\n .toLowerCase()\n .replace(/[\\s!&'()*]+/g, '-')\n .trim()\n .replace(/-+/g, '-')\n .replace(/^-+|-+$/g, '')\n );\n }\n return name\n .toLowerCase()\n .replace(/[^\\d_a-z\\-]+/g, ' ')\n .trim()\n .replace(/\\s+/g, sep);\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { CategoryHierarchy } from '@msdyn365-commerce/commerce-entities';\nimport { getParameterizeFeatureFlags, getUrlSync, IActionContext, IParameterizeFeatureFlags } from '@msdyn365-commerce/core';\n\nimport { parameterize } from './parameterize';\n\ninterface ICategoryMap {\n [RecordId: number]: CategoryHierarchy;\n}\n\n/**\n * Builds slugs for category.\n * @param category\n * @param categoryMap\n * @param parameterizeFeatureFlags\n */\nexport function getCategorySlug(\n category: CategoryHierarchy,\n categoryMap: ICategoryMap,\n parameterizeFeatureFlags?: IParameterizeFeatureFlags\n): string {\n if (!category || !category.Name) {\n // Invalid category\n return '';\n }\n const categoryName = parameterize(category.Name, undefined, parameterizeFeatureFlags, category.NeutralizedName);\n if (!category.ParentCategory || category.ParentCategory === 0) {\n // Base case assign url\n category.Slug = category.Slug || `/${categoryName}`;\n } else if (category.ParentCategory) {\n category.Slug =\n category.Slug ||\n `${getCategorySlug(categoryMap[category.ParentCategory], categoryMap, parameterizeFeatureFlags)}/${categoryName}`;\n }\n\n return category.Slug || '';\n}\n\n/**\n * Gets Url for category hierarchy. Returns string and adds url to Url property of category hierarchy.\n * @param category Category to generate URL for.\n * @param ctx\n * @param categoryMap Dictionary of all categories.\n */\nexport function getCategoryUrl(category: CategoryHierarchy, ctx?: IActionContext, categoryMap?: ICategoryMap): string | undefined {\n if (!category.Url && ctx && categoryMap) {\n if (!category.Slug) {\n const parameterizeFeatureFlags: IParameterizeFeatureFlags = ctx.requestContext ? getParameterizeFeatureFlags(ctx) : {};\n category.Slug = getCategorySlug(category, categoryMap, parameterizeFeatureFlags);\n }\n category.Url = getUrlSync('category', ctx, { category });\n }\n return category.Url;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { getUrlSync, IActionContext } from '@msdyn365-commerce/core';\n\n/**\n * Syncronously creates an invoice detail page url.\n * @param invoiceId Invoice Id.\n * @param ctx\n */\nexport function getInvoiceDetailsPageUrlSync(invoiceId: string, ctx: IActionContext): string {\n let url = getUrlSync('invoice-details', ctx) || '';\n url = url.includes('?') ? url.substr(0, url.indexOf('?')) : url;\n return `${url}?invoiceId=${invoiceId}`;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { CategoryHierarchy } from '@msdyn365-commerce/commerce-entities';\nimport { getUrlSync, IActionContext } from '@msdyn365-commerce/core';\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\n\n/**\n * Syncronously creates a product url.\n * @param product Simple product to get url from.\n * @param ctx\n * @param category Category to add to product url.\n */\nexport function getProductUrlSync(product: SimpleProduct, ctx: IActionContext, category?: CategoryHierarchy): string {\n const selectedProduct = { ...product, RecordId: product.MasterProductId || product.RecordId };\n\n return getProductPageUrlSync(selectedProduct.Name || '', selectedProduct.RecordId, ctx, category)!;\n}\n\n/**\n * Syncronously creates a product detail page url.\n * @param name Simple product name.\n * @param recordId Record id of product.\n * @param ctx\n * @param category\n */\nexport function getProductPageUrlSync(name: string, recordId: number, ctx: IActionContext, category?: CategoryHierarchy): string {\n return getUrlSync('product', ctx, {\n product: { Name: name || '', RecordId: recordId },\n category\n })!;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/**\n * Represents a pair of two fields: key and value.\n * Used to initialize a dictionary.\n */\nexport interface IKeyValuePair {\n readonly key: Key;\n readonly value: Value;\n}\n\n/**\n * Represents a dictionary in memory storage.\n */\nexport class Dictionary {\n /**\n * Values stored in the dictionary.\n */\n private _values: { [eventName: string]: Value };\n\n /**\n * The number of values stored in the dictionary (does not include keys).\n */\n private _length: number;\n\n /**\n * Initializes an empty dictionary or a dictionary with the given key value pairs.\n * @param {IKeyValuePair[]} entries The key value pairs which should be stored in the dictionary initially.\n */\n public constructor(...entries: IKeyValuePair[]) {\n this._values = {};\n this._length = 0;\n entries.forEach(keyValuePair => {\n this.setValue(keyValuePair.key, keyValuePair.value);\n });\n }\n\n /**\n * Removes value from the dictionary for the given key.\n * @param {Key} key The key to retrieve the value.\n * @remark Does nothing in case the key is not present in the dictionary.\n */\n public removeValue(key: Key): void {\n if (!this.hasValue(key)) {\n return;\n }\n\n --this._length;\n delete this._values[key];\n }\n\n /**\n * Retrieves a value from the dictionary or returns undefined in case it's not found.\n * @param {Key} key The key to retrieve the value.\n * @returns {Value | undefined} The value stored in the dictionary or undefined in case it's not found.\n */\n public getValue(key: Key): Value | undefined {\n return this._values[key];\n }\n\n /**\n * Retrieves a value from the dictionary.\n * In case it's not found, adds the default value to the dictionary and returns it.\n * @param {Key} key The key to retrieve the value.\n * @param defaultValue\n * @returns {Value} The value stored in the dictionary or the default value in case it's not found.\n */\n public getValueWithDefaultValue(key: Key, defaultValue: Value): Value {\n if (!this.hasValue(key)) {\n this.setValue(key, defaultValue);\n }\n return this.getValue(key)!;\n }\n\n /**\n * Sets the value to the dictionary for the given key.\n * @remarks In case undefined was passed, removes the value from the dictionary instead.\n * @param {Key} key The key under which the value should be stored.\n * @param {Value} value The value which should be stored in the dictionary.\n */\n public setValue(key: Key, value: Value): void {\n if (value === undefined) {\n this.removeValue(key);\n return;\n }\n\n if (!this.hasValue(key)) {\n ++this._length;\n }\n\n this._values[key] = value;\n }\n\n /**\n * Checks if the dictionary stores some value (except undefined) for the given key.\n * @param {Key} key The key to retrieve the value.\n * @returns {boolean} True in case the value is present, false otherwise or if it's undefined.\n */\n public hasValue(key: Key): boolean {\n return this._values[key] !== undefined;\n }\n\n /**\n * Checks if the dictionary is empty.\n * @returns {boolean} True if the dictionary is empty, false otherwise.\n */\n public isEmpty(): boolean {\n return this.length === 0;\n }\n\n /**\n * Retrieves the number of values stored in the dictionary.\n * @remark Use `isEmpty` to check if the dictionary has any elements.\n * @returns {number} The number of values stored.\n */\n public get length(): number {\n return this._length;\n }\n\n /**\n * Clears the dictionary by removing all elements from the storage.\n */\n public clear(): void {\n this._values = {};\n this._length = 0;\n }\n\n /**\n * Returns all values stored in the dictionary.\n * @returns {Value[]} List of values.\n */\n public getValues(): Value[] {\n return this.getKeys().map(key => this._values[key]);\n }\n\n /**\n * Returns all keys stored in the dictionary.\n * @returns {string[]} List of keys.\n */\n public getKeys(): Key[] {\n return Object.keys(this._values);\n }\n\n /**\n * Returns all key value pairs stored in the dictionary.\n * @returns {IKeyValuePair[]} List of key value pairs.\n */\n public getKeyValuePairs(): IKeyValuePair[] {\n return this.getKeys().map(key => {\n return { key, value: this._values[key] };\n });\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IEventSubscriber } from './event-subscriber';\n\n/**\n * Represents a simple event with subscribers. Notifies the subscribers once the event is triggered.\n */\nexport class Event {\n /**\n * The list of subscribers.\n */\n private _subscribers: IEventSubscriber[];\n\n /**\n * Initializes the event with a empty subscribers list.\n */\n public constructor() {\n this._subscribers = [];\n }\n\n /**\n * Subscribes given instance to the event.\n * @param {IEventSubscriber} instance The info about the subscriber.\n */\n public subscribe(instance: IEventSubscriber): void {\n this._subscribers.push(instance);\n }\n\n /**\n * Removes the subscriber from the list of subscribers watching the event.\n * @param {string} instanceId The unique identifier of the subscriber which was earlier passed in `subscribe` method in `IEventSubscriber`.\n */\n public unsubscribe(instanceId: string): void {\n this._subscribers = this._subscribers.filter(element => element.instanceId !== instanceId);\n }\n\n /**\n * Clears the list of subscriber removing all instances watching the event.\n */\n public unsubscribeAll(): void {\n this._subscribers = [];\n }\n\n /**\n * Triggers the event.\n * Notifies the subscribers that the event is triggered by calling `handler` method.\n */\n public trigger(): void {\n this._subscribers.forEach(subscriber => {\n subscriber.handler();\n });\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n ProductAvailableQuantity,\n ProductDimensionValueInventoryAvailability,\n ProductInventoryAvailability\n} from '@msdyn365-commerce/retail-proxy';\n\n/**\n * This setting defines the delivery modes supported.\n */\nexport enum DeliveryMode {\n allWareHouses = 0,\n shipping = 1,\n pickup = 2\n}\n\n/**\n * This setting defines the inventory levels supported.\n */\nexport enum InventoryLevels {\n physicalAvailable = 'physicalAvailable',\n totalAvailable = 'totalAvailable',\n threshold = 'inventoryThreshold'\n}\n\n/**\n * Product inventory information class.\n */\nexport interface IProductInventoryInformation {\n ProductAvailableQuantity: ProductAvailableQuantity;\n StockLevelCode?: string;\n StockLevelLabel?: string;\n IsProductAvailable: boolean;\n InventLocationId?: string;\n deliveryType?: DeliveryMode;\n}\n\n/**\n * This setting defines the inventory level values return by the API.\n */\nexport enum InventoryLevelValues {\n outOfStock = 'OOS',\n available = 'AVAIL'\n}\n\n/**\n * Retrieves inventory level code from the dimension based on the app config setting.\n * @param dimensionValuesWithInventory - The dimension info.\n * @param inventoryLevel - App config setting for inventory level.\n * @returns Inventory level code value.\n */\nexport const getInventoryLevelCodeFromDimensionValue = (\n dimensionValuesWithInventory: ProductDimensionValueInventoryAvailability,\n inventoryLevel?: InventoryLevels | undefined\n): InventoryLevelValues | undefined => {\n if (inventoryLevel === InventoryLevels.totalAvailable) {\n return dimensionValuesWithInventory.TotalAvailableInventoryLevelCode as InventoryLevelValues | undefined;\n }\n if (inventoryLevel === InventoryLevels.physicalAvailable) {\n return dimensionValuesWithInventory.PhysicalAvailableInventoryLevelCode as InventoryLevelValues | undefined;\n }\n return undefined;\n};\n\n/**\n * Retrieves inventory level code from the product availability based on the app config setting.\n * @param productAvailability - The product availability info.\n * @param inventoryLevel - App config setting for inventory level.\n * @returns Inventory level code value.\n */\nexport const getInventoryLevelCodeFromProductAvailability = (\n productAvailability: ProductInventoryAvailability,\n inventoryLevel?: InventoryLevels | undefined\n): InventoryLevelValues | undefined => {\n if (inventoryLevel === InventoryLevels.totalAvailable) {\n return productAvailability.TotalAvailableInventoryLevelCode as InventoryLevelValues | undefined;\n }\n if (inventoryLevel === InventoryLevels.physicalAvailable) {\n return productAvailability.PhysicalAvailableInventoryLevelCode as InventoryLevelValues | undefined;\n }\n return undefined;\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { PromiseBodyWrapper } from './base-promise-queue';\nimport { PromiseQueue } from './promise-queue';\n\nexport enum FinitePromiseQueueError {\n InvalidMaxQueueLengthPassed = 'Invalid maxQueueLength value passed to FinitePromiseQueue. maxQueueLength should be more or equal to 2.',\n ProcessWasDiscardedFromTheQueue = 'The process was discarded from FinitePromiseQueue.'\n}\n\n/**\n * Represents a FIFO queue over promises with a limited number of elements waiting for execution.\n * @remark\n * In case the queue reaches the limit,\n * before adding a new element the queue discards the oldest added element which is waiting to be processed.\n * Does not discard elements which are in progress under execution.\n * The discarded element will not be processed and executed.\n * @author Bohdan Yevchenko \n */\nexport class FinitePromiseQueue extends PromiseQueue {\n /**\n * @see constructor\n */\n private readonly _maxQueueLength: number;\n\n /**\n * Initializes the queue with the given limit.\n * @param {number} maxQueueLength\n * Defines the limit of maximum number of elements in the queue.\n * @remarks Includes both the number of elements waiting for the execution\n * and the element processed by the queue at the moment (in case there is some).\n * Value can't be less than 2.\n */\n public constructor(maxQueueLength: number) {\n if (maxQueueLength < 2) {\n throw new Error(FinitePromiseQueueError.InvalidMaxQueueLengthPassed);\n }\n\n super();\n this._maxQueueLength = maxQueueLength;\n }\n\n /**\n * Adds promise to the queue and automatically starts the queue execution.\n * @remarks In case the queue has reached the limit, also discards the oldest added element.\n * @param {PromiseBodyWrapper} promiseBody\n * The body of a function which contains a call to the promise which has to be executed in the queue.\n */\n public async enqueue(promiseBody: PromiseBodyWrapper): Promise {\n let totalElementsCount = this._queue.length;\n\n // If queue hasn't finished processing an element,\n // consider this element as pending.\n if (this._isBusy) {\n ++totalElementsCount;\n }\n\n // Discards the oldest added element from the queue to meet the given limitations.\n // The very first element in the queue is considered as oldest added.\n // Can't discard the element which is under execution as the promise can't be cancelled.\n if (totalElementsCount === this._maxQueueLength) {\n const element = this._queue.shift();\n if (element) {\n element.reject(FinitePromiseQueueError.ProcessWasDiscardedFromTheQueue);\n }\n }\n\n return super.enqueue(promiseBody);\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IPromiseQueue, PromiseBodyWrapper, PromiseRejectType, PromiseResolveType } from './base-promise-queue';\n\n/**\n * Represents an inner node which is stored in a promise queue.\n * Used internally in the PromiseQueue implementation.\n * @author Bohdan Yevchenko \n */\nclass PromiseQueueElement {\n /**\n * The body of a wrapper-function which contains a call to the promise which has to be executed in the queue.\n */\n public readonly body: PromiseBodyWrapper;\n\n /**\n * Method that resolves the promise after the promise from the body is resolved.\n */\n public readonly resolve: PromiseResolveType;\n\n /**\n * Method that rejects the promise after the promise from the body is rejected.\n */\n public readonly reject: PromiseRejectType;\n\n /**\n * Initializes queue element with the given data.\n * @param {PromiseBodyWrapper} body The body of a wrapper-function which contains a call to the promise which has to be executed in the queue.\n * @param {PromiseResolveType} resolve Method that resolves the promise after the promise from the body is resolved.\n * @param {PromiseRejectType} reject Method that rejects the promise after the promise from the body is rejected.\n */\n public constructor(\n body: PromiseBodyWrapper,\n resolve: PromiseResolveType,\n reject: PromiseRejectType\n ) {\n this.body = body;\n this.resolve = resolve;\n this.reject = reject;\n }\n}\n\n/**\n * Represents a FIFO basic queue over promises.\n * @author Bohdan Yevchenko \n */\nexport class PromiseQueue implements IPromiseQueue {\n /**\n * A list of promises waiting for execution.\n */\n protected readonly _queue: PromiseQueueElement[];\n\n /**\n * Defines whether the queue is processing some element.\n */\n protected _isBusy: boolean;\n\n /**\n * Defines whether the queue can start processing new element.\n */\n private get _canProcess(): boolean {\n return !this._isBusy && this._queue.length > 0;\n }\n\n /**\n * Creates a new instance of PromiseQueue.\n */\n public constructor() {\n this._queue = [];\n this._isBusy = false;\n }\n\n /**\n * Adds promise to the queue and automatically starts the queue execution.\n * @param {PromiseBodyWrapper} promiseBody\n * The body of a function which contains a call to the promise which has to be executed in the queue.\n */\n public async enqueue(promiseBody: PromiseBodyWrapper): Promise {\n return new Promise(async (resolve, reject) => {\n this._queue.push(new PromiseQueueElement(promiseBody, resolve, reject));\n await this._dequeue();\n });\n }\n\n /**\n * If the queue is free, starts processing the first element in the queue and waits until all the elements are processed.\n * Otherwise (if busy or has no elements to process), does nothing.\n */\n private async _dequeue(): Promise {\n // Skip if queue is not able to process any elements.\n if (!this._canProcess) {\n return;\n }\n\n // Lock queue to prevent parallel execution.\n this._isBusy = true;\n\n // Retrieve an element from the waiting queue and start processing.\n const element: PromiseQueueElement = this._queue.shift()!;\n await this._processElement(element);\n\n // Continue executing the subsequent queue elements.\n await this._processNext();\n }\n\n /**\n * Executes the given wrapper over the promise and calls initial resolve/reject correspondingly.\n * @param {PromiseQueueElement} element The queue element which should be processed now.\n */\n private async _processElement(element: PromiseQueueElement): Promise {\n try {\n await element\n .body()\n .then(element.resolve)\n .catch(element.reject);\n } catch (error) {\n element.reject(error);\n }\n }\n\n /**\n * Unlocks the queue and tries to process the next element in the queue.\n */\n private async _processNext(): Promise {\n this._isBusy = false;\n await this._dequeue();\n }\n}\n","// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nvar getRandomValues;\nvar rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation. Also,\n // find the complete implementation of crypto (msCrypto) on IE11.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;","import REGEX from './regex.js';\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && REGEX.test(uuid);\n}\n\nexport default validate;","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nvar byteToHex = [];\n\nfor (var i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr) {\n var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","import rng from './rng.js';\nimport stringify from './stringify.js';\n\nfunction v4(options, buf, offset) {\n options = options || {};\n var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (var i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return stringify(rnds);\n}\n\nexport default v4;","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { v4 as uuidv4 } from 'uuid';\n\n/**\n * Namespace which provides functionality for GUID.\n */\nexport namespace Guid {\n export function generateGuid(): string {\n return uuidv4();\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Guid as _guid } from './guid';\n\nexport namespace Random {\n export import Guid = _guid;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/**\n * Regular expressions to validate emails.\n */\n// eslint-disable-next-line @typescript-eslint/no-extraneous-class\nexport abstract class EmailRegex {\n /**\n * Represents a HTML5 Validation Regex.\n *\n * A valid email address is a string that matches the email production of the following ABNF, the character set for which is Unicode.\n * This ABNF implements the extensions described in RFC 1123.\n *\n * For more info: https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address.\n */\n public static readonly html5EmailRegex = /^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n\n /**\n * Returns a default regex which should be used for most email validation cases.\n *\n * As of now, the default regex is HTML5 email regex standard.\n * @see EmailRegex.html5EmailRegex - The regex which is set to be default right now.\n *\n * @returns Regular expression for email validation.\n */\n public static get defaultRegex(): RegExp {\n return EmailRegex.html5EmailRegex;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/**\n * Regular expressions to validate passwords.\n */\n// eslint-disable-next-line @typescript-eslint/no-extraneous-class\nexport abstract class PasswordRegex {\n // eslint-disable-next-line max-len\n public static readonly defaultRegex = /^((?=.*[a-z])(?=.*[A-Z])(?=.*\\d)|(?=.*[a-z])(?=.*[A-Z])(?=.*[^A-Za-z0-9])|(?=.*[a-z])(?=.*\\d)(?=.*[^A-Za-z0-9])|(?=.*[A-Z])(?=.*\\d)(?=.*[^A-Za-z0-9]))([A-Za-z\\d@#$%^&*\\-_+=[\\]{}|\\\\:',?/`~'();!]|\\.(?!@)){8,16}$/;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/**\n * Regular expressions to validate phone number.\n */\n// eslint-disable-next-line @typescript-eslint/no-extraneous-class\nexport abstract class PhoneRegex {\n public static readonly defaultRegex = '^$|^[- +()]*[0-9][- +()0-9]*$';\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { CartLine } from '@msdyn365-commerce/retail-proxy';\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\n\nimport { ArrayExtensions } from './extensions/array-extensions';\nimport { IProductInventoryInformation } from './product-inventory-information';\n\n/**\n * Cart line inventory validation result interface.\n */\nexport interface ICartLineInventoryValidationResult {\n /**\n * Define whether the cart lines inventory is valid across multiple cart lines.\n */\n readonly isValid: boolean;\n\n /**\n * Defines the list of product id with invalid inventory.\n */\n readonly productIdWithErrors: number[];\n}\n\n/**\n * Validates inventory across cart lines.\n * @param cartLines - The cart lines.\n * @param productAvailabilities - The product availability collection.\n * @param actionContext - The action context.\n * @param products - The products.\n * @param emailDeliveryModeCode - The emailDeliveryModeCode.\n * @returns True if all product quantity are available, false otherwise.\n */\n// eslint-disable-next-line complexity -- existing code.\nexport function validateCartLinesInventory(\n cartLines: CartLine[],\n productAvailabilities: IProductInventoryInformation[],\n actionContext: IActionContext,\n products?: SimpleProduct[],\n emailDeliveryModeCode?: string | undefined\n): ICartLineInventoryValidationResult {\n const cartLineMap = new Map();\n const defaultCartLineQuantity = 1;\n if (!actionContext.requestContext.app.config.enableStockCheck) {\n return {\n isValid: true,\n productIdWithErrors: []\n };\n }\n const productIdWithErrors = [];\n let isValid = true;\n\n if (ArrayExtensions.hasElements(cartLines) && ArrayExtensions.hasElements(productAvailabilities)) {\n // Consolidate products in different cart lines into single entry with the total cart quantity\n for (const cartLine of cartLines) {\n // Skip validation if is an invoice inline.\n if (cartLine.ProductId && !cartLine.IsInvoiceLine && !cartLine.IsGiftCardLine) {\n if (!cartLineMap.has(cartLine.ProductId)) {\n cartLineMap.set(cartLine.ProductId, cartLine.Quantity ?? defaultCartLineQuantity);\n } else {\n const cartLineTotal = cartLineMap.get(cartLine.ProductId) ?? 0;\n cartLineMap.delete(cartLine.ProductId);\n cartLineMap.set(cartLine.ProductId, cartLineTotal + (cartLine.Quantity ?? defaultCartLineQuantity));\n }\n }\n }\n\n // Hashing product availability object by product ID.\n const productAvailabilityMap = new Map();\n for (const productAvailability of productAvailabilities) {\n if (\n productAvailability.ProductAvailableQuantity.ProductId &&\n !productAvailabilityMap.has(productAvailability.ProductAvailableQuantity.ProductId)\n ) {\n productAvailabilityMap.set(productAvailability.ProductAvailableQuantity.ProductId, productAvailability);\n }\n }\n\n // Compare total quantity with the available quantity from the inventory API, also validate that the product is available.\n for (const productId of Array.from(cartLineMap.keys())) {\n const cartLineQty = cartLineMap.get(productId) ?? defaultCartLineQuantity;\n const productAvailability = productAvailabilityMap.get(productId);\n const availableQuantity = productAvailability?.ProductAvailableQuantity.AvailableQuantity ?? undefined;\n\n // If product is non-stocked or cartLine is electronic delivery, then no inventory check\n const cartLine = cartLines.find(line => line.ProductId === productId);\n const cartLineProduct = products?.find(product => product.RecordId === productId);\n let isStockedItem = true;\n if (cartLineProduct) {\n isStockedItem = !!cartLineProduct.Behavior?.IsStockedProduct;\n }\n const isEmailDelivery =\n cartLine?.DeliveryMode && cartLine.DeliveryMode !== '' ? cartLine.DeliveryMode === emailDeliveryModeCode : false;\n const shouldSkipInventoryCheck = !isStockedItem || isEmailDelivery;\n\n // If product is non-stocked or cartLine is electronic delivery, then no inventory check\n if (shouldSkipInventoryCheck) {\n continue;\n }\n if (!productAvailability?.IsProductAvailable || (availableQuantity && cartLineQty > availableQuantity)) {\n productIdWithErrors.push(productId);\n isValid = false;\n }\n }\n }\n return {\n isValid,\n productIdWithErrors\n };\n}\n","'use strict';\n// eslint-disable-next-line es/no-typed-arrays -- safe\nmodule.exports = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefined';\n","'use strict';\nvar NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-basic-detection');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar globalThis = require('../internals/global-this');\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\nvar hasOwn = require('../internals/has-own-property');\nvar classof = require('../internals/classof');\nvar tryToString = require('../internals/try-to-string');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar defineBuiltInAccessor = require('../internals/define-built-in-accessor');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar uid = require('../internals/uid');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar enforceInternalState = InternalStateModule.enforce;\nvar getInternalState = InternalStateModule.get;\nvar Int8Array = globalThis.Int8Array;\nvar Int8ArrayPrototype = Int8Array && Int8Array.prototype;\nvar Uint8ClampedArray = globalThis.Uint8ClampedArray;\nvar Uint8ClampedArrayPrototype = Uint8ClampedArray && Uint8ClampedArray.prototype;\nvar TypedArray = Int8Array && getPrototypeOf(Int8Array);\nvar TypedArrayPrototype = Int8ArrayPrototype && getPrototypeOf(Int8ArrayPrototype);\nvar ObjectPrototype = Object.prototype;\nvar TypeError = globalThis.TypeError;\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG');\nvar TYPED_ARRAY_CONSTRUCTOR = 'TypedArrayConstructor';\n// Fixing native typed arrays in Opera Presto crashes the browser, see #595\nvar NATIVE_ARRAY_BUFFER_VIEWS = NATIVE_ARRAY_BUFFER && !!setPrototypeOf && classof(globalThis.opera) !== 'Opera';\nvar TYPED_ARRAY_TAG_REQUIRED = false;\nvar NAME, Constructor, Prototype;\n\nvar TypedArrayConstructorsList = {\n Int8Array: 1,\n Uint8Array: 1,\n Uint8ClampedArray: 1,\n Int16Array: 2,\n Uint16Array: 2,\n Int32Array: 4,\n Uint32Array: 4,\n Float32Array: 4,\n Float64Array: 8\n};\n\nvar BigIntArrayConstructorsList = {\n BigInt64Array: 8,\n BigUint64Array: 8\n};\n\nvar isView = function isView(it) {\n if (!isObject(it)) return false;\n var klass = classof(it);\n return klass === 'DataView'\n || hasOwn(TypedArrayConstructorsList, klass)\n || hasOwn(BigIntArrayConstructorsList, klass);\n};\n\nvar getTypedArrayConstructor = function (it) {\n var proto = getPrototypeOf(it);\n if (!isObject(proto)) return;\n var state = getInternalState(proto);\n return (state && hasOwn(state, TYPED_ARRAY_CONSTRUCTOR)) ? state[TYPED_ARRAY_CONSTRUCTOR] : getTypedArrayConstructor(proto);\n};\n\nvar isTypedArray = function (it) {\n if (!isObject(it)) return false;\n var klass = classof(it);\n return hasOwn(TypedArrayConstructorsList, klass)\n || hasOwn(BigIntArrayConstructorsList, klass);\n};\n\nvar aTypedArray = function (it) {\n if (isTypedArray(it)) return it;\n throw new TypeError('Target is not a typed array');\n};\n\nvar aTypedArrayConstructor = function (C) {\n if (isCallable(C) && (!setPrototypeOf || isPrototypeOf(TypedArray, C))) return C;\n throw new TypeError(tryToString(C) + ' is not a typed array constructor');\n};\n\nvar exportTypedArrayMethod = function (KEY, property, forced, options) {\n if (!DESCRIPTORS) return;\n if (forced) for (var ARRAY in TypedArrayConstructorsList) {\n var TypedArrayConstructor = globalThis[ARRAY];\n if (TypedArrayConstructor && hasOwn(TypedArrayConstructor.prototype, KEY)) try {\n delete TypedArrayConstructor.prototype[KEY];\n } catch (error) {\n // old WebKit bug - some methods are non-configurable\n try {\n TypedArrayConstructor.prototype[KEY] = property;\n } catch (error2) { /* empty */ }\n }\n }\n if (!TypedArrayPrototype[KEY] || forced) {\n defineBuiltIn(TypedArrayPrototype, KEY, forced ? property\n : NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY] || property, options);\n }\n};\n\nvar exportTypedArrayStaticMethod = function (KEY, property, forced) {\n var ARRAY, TypedArrayConstructor;\n if (!DESCRIPTORS) return;\n if (setPrototypeOf) {\n if (forced) for (ARRAY in TypedArrayConstructorsList) {\n TypedArrayConstructor = globalThis[ARRAY];\n if (TypedArrayConstructor && hasOwn(TypedArrayConstructor, KEY)) try {\n delete TypedArrayConstructor[KEY];\n } catch (error) { /* empty */ }\n }\n if (!TypedArray[KEY] || forced) {\n // V8 ~ Chrome 49-50 `%TypedArray%` methods are non-writable non-configurable\n try {\n return defineBuiltIn(TypedArray, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && TypedArray[KEY] || property);\n } catch (error) { /* empty */ }\n } else return;\n }\n for (ARRAY in TypedArrayConstructorsList) {\n TypedArrayConstructor = globalThis[ARRAY];\n if (TypedArrayConstructor && (!TypedArrayConstructor[KEY] || forced)) {\n defineBuiltIn(TypedArrayConstructor, KEY, property);\n }\n }\n};\n\nfor (NAME in TypedArrayConstructorsList) {\n Constructor = globalThis[NAME];\n Prototype = Constructor && Constructor.prototype;\n if (Prototype) enforceInternalState(Prototype)[TYPED_ARRAY_CONSTRUCTOR] = Constructor;\n else NATIVE_ARRAY_BUFFER_VIEWS = false;\n}\n\nfor (NAME in BigIntArrayConstructorsList) {\n Constructor = globalThis[NAME];\n Prototype = Constructor && Constructor.prototype;\n if (Prototype) enforceInternalState(Prototype)[TYPED_ARRAY_CONSTRUCTOR] = Constructor;\n}\n\n// WebKit bug - typed arrays constructors prototype is Object.prototype\nif (!NATIVE_ARRAY_BUFFER_VIEWS || !isCallable(TypedArray) || TypedArray === Function.prototype) {\n // eslint-disable-next-line no-shadow -- safe\n TypedArray = function TypedArray() {\n throw new TypeError('Incorrect invocation');\n };\n if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {\n if (globalThis[NAME]) setPrototypeOf(globalThis[NAME], TypedArray);\n }\n}\n\nif (!NATIVE_ARRAY_BUFFER_VIEWS || !TypedArrayPrototype || TypedArrayPrototype === ObjectPrototype) {\n TypedArrayPrototype = TypedArray.prototype;\n if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {\n if (globalThis[NAME]) setPrototypeOf(globalThis[NAME].prototype, TypedArrayPrototype);\n }\n}\n\n// WebKit bug - one more object in Uint8ClampedArray prototype chain\nif (NATIVE_ARRAY_BUFFER_VIEWS && getPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype) {\n setPrototypeOf(Uint8ClampedArrayPrototype, TypedArrayPrototype);\n}\n\nif (DESCRIPTORS && !hasOwn(TypedArrayPrototype, TO_STRING_TAG)) {\n TYPED_ARRAY_TAG_REQUIRED = true;\n defineBuiltInAccessor(TypedArrayPrototype, TO_STRING_TAG, {\n configurable: true,\n get: function () {\n return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined;\n }\n });\n for (NAME in TypedArrayConstructorsList) if (globalThis[NAME]) {\n createNonEnumerableProperty(globalThis[NAME], TYPED_ARRAY_TAG, NAME);\n }\n}\n\nmodule.exports = {\n NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS,\n TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQUIRED && TYPED_ARRAY_TAG,\n aTypedArray: aTypedArray,\n aTypedArrayConstructor: aTypedArrayConstructor,\n exportTypedArrayMethod: exportTypedArrayMethod,\n exportTypedArrayStaticMethod: exportTypedArrayStaticMethod,\n getTypedArrayConstructor: getTypedArrayConstructor,\n isView: isView,\n isTypedArray: isTypedArray,\n TypedArray: TypedArray,\n TypedArrayPrototype: TypedArrayPrototype\n};\n","'use strict';\nvar toObject = require('../internals/to-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\n\n// `Array.prototype.fill` method implementation\n// https://tc39.es/ecma262/#sec-array.prototype.fill\nmodule.exports = function fill(value /* , start = 0, end = @length */) {\n var O = toObject(this);\n var length = lengthOfArrayLike(O);\n var argumentsLength = arguments.length;\n var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length);\n var end = argumentsLength > 2 ? arguments[2] : undefined;\n var endPos = end === undefined ? length : toAbsoluteIndex(end, length);\n while (endPos > index) O[index++] = value;\n return O;\n};\n","'use strict';\nvar toPrimitive = require('../internals/to-primitive');\n\nvar $TypeError = TypeError;\n\n// `ToBigInt` abstract operation\n// https://tc39.es/ecma262/#sec-tobigint\nmodule.exports = function (argument) {\n var prim = toPrimitive(argument, 'number');\n if (typeof prim == 'number') throw new $TypeError(\"Can't convert number to bigint\");\n // eslint-disable-next-line es/no-bigint -- safe\n return BigInt(prim);\n};\n","'use strict';\nvar toPositiveInteger = require('../internals/to-positive-integer');\n\nvar $RangeError = RangeError;\n\nmodule.exports = function (it, BYTES) {\n var offset = toPositiveInteger(it);\n if (offset % BYTES) throw new $RangeError('Wrong offset');\n return offset;\n};\n","'use strict';\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\n\nvar $RangeError = RangeError;\n\nmodule.exports = function (it) {\n var result = toIntegerOrInfinity(it);\n if (result < 0) throw new $RangeError(\"The argument can't be less than 0\");\n return result;\n};\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $fill = require('../internals/array-fill');\nvar toBigInt = require('../internals/to-big-int');\nvar classof = require('../internals/classof');\nvar call = require('../internals/function-call');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\nvar slice = uncurryThis(''.slice);\n\n// V8 ~ Chrome < 59, Safari < 14.1, FF < 55, Edge <=18\nvar CONVERSION_BUG = fails(function () {\n var count = 0;\n // eslint-disable-next-line es/no-typed-arrays -- safe\n new Int8Array(2).fill({ valueOf: function () { return count++; } });\n return count !== 1;\n});\n\n// `%TypedArray%.prototype.fill` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.fill\nexportTypedArrayMethod('fill', function fill(value /* , start, end */) {\n var length = arguments.length;\n aTypedArray(this);\n var actualValue = slice(classof(this), 0, 3) === 'Big' ? toBigInt(value) : +value;\n return call($fill, this, actualValue, length > 1 ? arguments[1] : undefined, length > 2 ? arguments[2] : undefined);\n}, CONVERSION_BUG);\n","'use strict';\nvar globalThis = require('../internals/global-this');\nvar call = require('../internals/function-call');\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar toOffset = require('../internals/to-offset');\nvar toIndexedObject = require('../internals/to-object');\nvar fails = require('../internals/fails');\n\nvar RangeError = globalThis.RangeError;\nvar Int8Array = globalThis.Int8Array;\nvar Int8ArrayPrototype = Int8Array && Int8Array.prototype;\nvar $set = Int8ArrayPrototype && Int8ArrayPrototype.set;\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\nvar WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS = !fails(function () {\n // eslint-disable-next-line es/no-typed-arrays -- required for testing\n var array = new Uint8ClampedArray(2);\n call($set, array, { length: 1, 0: 3 }, 1);\n return array[1] !== 3;\n});\n\n// https://bugs.chromium.org/p/v8/issues/detail?id=11294 and other\nvar TO_OBJECT_BUG = WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS && ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS && fails(function () {\n var array = new Int8Array(2);\n array.set(1);\n array.set('2', 1);\n return array[0] !== 0 || array[1] !== 2;\n});\n\n// `%TypedArray%.prototype.set` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.set\nexportTypedArrayMethod('set', function set(arrayLike /* , offset */) {\n aTypedArray(this);\n var offset = toOffset(arguments.length > 1 ? arguments[1] : undefined, 1);\n var src = toIndexedObject(arrayLike);\n if (WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS) return call($set, this, src, offset);\n var length = this.length;\n var len = lengthOfArrayLike(src);\n var index = 0;\n if (len + offset > length) throw new RangeError('Wrong length');\n while (index < len) this[offset + index] = src[index++];\n}, !WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS || TO_OBJECT_BUG);\n","'use strict';\nvar globalThis = require('../internals/global-this');\nvar uncurryThis = require('../internals/function-uncurry-this-clause');\nvar fails = require('../internals/fails');\nvar aCallable = require('../internals/a-callable');\nvar internalSort = require('../internals/array-sort');\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar FF = require('../internals/environment-ff-version');\nvar IE_OR_EDGE = require('../internals/environment-is-ie-or-edge');\nvar V8 = require('../internals/environment-v8-version');\nvar WEBKIT = require('../internals/environment-webkit-version');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\nvar Uint16Array = globalThis.Uint16Array;\nvar nativeSort = Uint16Array && uncurryThis(Uint16Array.prototype.sort);\n\n// WebKit\nvar ACCEPT_INCORRECT_ARGUMENTS = !!nativeSort && !(fails(function () {\n nativeSort(new Uint16Array(2), null);\n}) && fails(function () {\n nativeSort(new Uint16Array(2), {});\n}));\n\nvar STABLE_SORT = !!nativeSort && !fails(function () {\n // feature detection can be too slow, so check engines versions\n if (V8) return V8 < 74;\n if (FF) return FF < 67;\n if (IE_OR_EDGE) return true;\n if (WEBKIT) return WEBKIT < 602;\n\n var array = new Uint16Array(516);\n var expected = Array(516);\n var index, mod;\n\n for (index = 0; index < 516; index++) {\n mod = index % 4;\n array[index] = 515 - index;\n expected[index] = index - 2 * mod + 3;\n }\n\n nativeSort(array, function (a, b) {\n return (a / 4 | 0) - (b / 4 | 0);\n });\n\n for (index = 0; index < 516; index++) {\n if (array[index] !== expected[index]) return true;\n }\n});\n\nvar getSortCompare = function (comparefn) {\n return function (x, y) {\n if (comparefn !== undefined) return +comparefn(x, y) || 0;\n // eslint-disable-next-line no-self-compare -- NaN check\n if (y !== y) return -1;\n // eslint-disable-next-line no-self-compare -- NaN check\n if (x !== x) return 1;\n if (x === 0 && y === 0) return 1 / x > 0 && 1 / y < 0 ? 1 : -1;\n return x > y;\n };\n};\n\n// `%TypedArray%.prototype.sort` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.sort\nexportTypedArrayMethod('sort', function sort(comparefn) {\n if (comparefn !== undefined) aCallable(comparefn);\n if (STABLE_SORT) return nativeSort(this, comparefn);\n\n return internalSort(aTypedArray(this), getSortCompare(comparefn));\n}, !STABLE_SORT || ACCEPT_INCORRECT_ARGUMENTS);\n","'use strict';\nvar globalThis = require('../internals/global-this');\nvar apply = require('../internals/function-apply');\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar fails = require('../internals/fails');\nvar arraySlice = require('../internals/array-slice');\n\nvar Int8Array = globalThis.Int8Array;\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\nvar $toLocaleString = [].toLocaleString;\n\n// iOS Safari 6.x fails here\nvar TO_LOCALE_STRING_BUG = !!Int8Array && fails(function () {\n $toLocaleString.call(new Int8Array(1));\n});\n\nvar FORCED = fails(function () {\n return [1, 2].toLocaleString() !== new Int8Array([1, 2]).toLocaleString();\n}) || !fails(function () {\n Int8Array.prototype.toLocaleString.call([1, 2]);\n});\n\n// `%TypedArray%.prototype.toLocaleString` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.tolocalestring\nexportTypedArrayMethod('toLocaleString', function toLocaleString() {\n return apply(\n $toLocaleString,\n TO_LOCALE_STRING_BUG ? arraySlice(aTypedArray(this)) : aTypedArray(this),\n arraySlice(arguments)\n );\n}, FORCED);\n"],"names":["CategoriesInput","constructor","context","mappedToHierarchy","maxItems","includeRootCategory","getCacheKey","generateCacheKey","this","apiSettings","key","value","sitePath","catalogId","locale","getCacheObjectType","_mappedToHierarchy","dataCacheType","getLocale","channelId","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","getCategoryAction","RawCategoriesInput","getCategoryHierarchyActionDataAction","createObservableDataAction","id","action","_context$apiSettings","_requestContext","CategoriesDataActions","callerContext","_inputData$config","parameterize","name","arguments","undefined","sep","parameterizeFeatureFlags","neutralizedName","candidateName","msdyn365Commerce","platformSettings","enableUrlLocalization","enableUrlEncoding","encodeURIComponent","replace","trim","getCategorySlug","categoryName","Slug","getParameterizeFeatureFlags","getUrlSync","getInvoiceDetailsPageUrlSync","invoiceId","url","includes","substr","indexOf","getProductUrlSync","product","selectedProduct","MasterProductId","getProductPageUrlSync","recordId","Dictionary","_values","_length","_len","entries","Array","_key","forEach","keyValuePair","setValue","removeValue","hasValue","getValue","getValueWithDefaultValue","defaultValue","isEmpty","clear","getValues","getKeys","map","keys","getKeyValuePairs","Event","_subscribers","subscribe","instance","unsubscribe","instanceId","filter","element","unsubscribeAll","trigger","subscriber","handler","DeliveryMode","InventoryLevels","InventoryLevelValues","getInventoryLevelCodeFromDimensionValue","dimensionValuesWithInventory","inventoryLevel","totalAvailable","TotalAvailableInventoryLevelCode","physicalAvailable","PhysicalAvailableInventoryLevelCode","getInventoryLevelCodeFromProductAvailability","productAvailability","FinitePromiseQueueError","FinitePromiseQueue","PromiseQueue","maxQueueLength","Error","InvalidMaxQueueLengthPassed","super","_maxQueueLength","promiseBody","totalElementsCount","_queue","_isBusy","shift","reject","ProcessWasDiscardedFromTheQueue","enqueue","PromiseQueueElement","body","resolve","Promise","_dequeue","_canProcess","_processElement","_processNext","then","catch","error","getRandomValues","rnds8","Uint8Array","rng","crypto","bind","msCrypto","uuid","REGEX","test","byteToHex","i","toString","arr","offset","validate","TypeError","options","buf","rnds","random","stringify","Guid","Random","generateGuid","uuidv4","_guid","EmailRegex","html5EmailRegex","PasswordRegex","defaultRegex","PhoneRegex","validateCartLinesInventory","cartLines","productAvailabilities","actionContext","products","emailDeliveryModeCode","cartLineMap","Map","app","enableStockCheck","isValid","productIdWithErrors","ArrayExtensions","hasElements","cartLine","ProductId","IsInvoiceLine","IsGiftCardLine","has","_cartLineMap$get","_cartLine$Quantity2","cartLineTotal","get","delete","set","Quantity","_cartLine$Quantity","productAvailabilityMap","ProductAvailableQuantity","productId","from","_cartLineMap$get2","_productAvailability$","cartLineQty","availableQuantity","AvailableQuantity","line","cartLineProduct","isStockedItem","_cartLineProduct$Beha","Behavior","IsStockedProduct","isEmailDelivery","IsProductAvailable","module","exports","ArrayBuffer","DataView","NAME","Constructor","Prototype","NATIVE_ARRAY_BUFFER","DESCRIPTORS","globalThis","isCallable","isObject","hasOwn","classof","tryToString","createNonEnumerableProperty","defineBuiltIn","defineBuiltInAccessor","isPrototypeOf","getPrototypeOf","setPrototypeOf","wellKnownSymbol","uid","InternalStateModule","enforceInternalState","enforce","getInternalState","Int8Array","Int8ArrayPrototype","prototype","Uint8ClampedArray","Uint8ClampedArrayPrototype","TypedArray","TypedArrayPrototype","ObjectPrototype","TO_STRING_TAG","TYPED_ARRAY_TAG","TYPED_ARRAY_CONSTRUCTOR","NATIVE_ARRAY_BUFFER_VIEWS","opera","TYPED_ARRAY_TAG_REQUIRED","TypedArrayConstructorsList","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigIntArrayConstructorsList","BigInt64Array","BigUint64Array","getTypedArrayConstructor","it","proto","state","isTypedArray","klass","Function","configurable","aTypedArray","aTypedArrayConstructor","C","exportTypedArrayMethod","KEY","property","forced","ARRAY","TypedArrayConstructor","error2","exportTypedArrayStaticMethod","isView","toObject","toAbsoluteIndex","lengthOfArrayLike","O","argumentsLength","index","end","endPos","toPrimitive","$TypeError","argument","prim","BigInt","toPositiveInteger","$RangeError","RangeError","BYTES","toIntegerOrInfinity","result","ArrayBufferViewCore","$fill","toBigInt","call","uncurryThis","fails","slice","actualValue","count","fill","valueOf","toOffset","toIndexedObject","$set","WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS","array","0","TO_OBJECT_BUG","arrayLike","src","len","aCallable","internalSort","FF","IE_OR_EDGE","V8","WEBKIT","nativeSort","sort","ACCEPT_INCORRECT_ARGUMENTS","STABLE_SORT","mod","expected","a","b","comparefn","x","y","getSortCompare","apply","arraySlice","$toLocaleString","toLocaleString","TO_LOCALE_STRING_BUG"],"sourceRoot":""}