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,QAAU1H,cCAjByH,EAAOC,QAAUC","sources":["webpack://Msdyn365.Commerce.Online/./src/actions/eCommSelectedFilter/ecomm-get-selected-filter-criterias.ts?cf57","webpack://Msdyn365.Commerce.Online/./src/actions/helper-functions.ts?5715","webpack://Msdyn365.Commerce.Online/./src/components/breakpoints.ts?f4e7","webpack://Msdyn365.Commerce.Online/./src/modules/ecomm-history-filter/ecomm-history-filter.tsx?dd63","webpack://Msdyn365.Commerce.Online/./src/modules/ecomm-history-filter/ecomm-history-filter.view.tsx?c245","webpack://Msdyn365.Commerce.Online/./lib/ecomm-history-filter/module-registration.js?61b3","webpack://Msdyn365.Commerce.Online/../../src/get-customer.ts?8319","webpack://Msdyn365.Commerce.Online/external var \"React\"?0d3b","webpack://Msdyn365.Commerce.Online/external var \"ReactDOM\"?853b"],"sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * GetActivecategorymenustate Input Action\r\n */\r\nexport class GetCategoryFilterValuesInput implements Msdyn365.IActionInput {\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `CategoryFilter`;\r\n public getCacheObjectType = () => 'CategoryFilter';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IGetFilteredCategoryMenuStateData {\r\n filteredCategories: string[];\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new GetCategoryFilterValuesInput();\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function getCategoryFilterValuesStateAction(input: GetCategoryFilterValuesInput, ctx: Msdyn365.IActionContext):Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // TODO: Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { filteredCategories: [] };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getCategoryFilterValuesStateAction,\r\n // TODO: Give your data action a unique id\r\n id: 'GetCategoryFilterValuesStateActionState',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});","import { ICoreContext, IActionContext } from '@msdyn365-commerce/core';\r\n\r\nimport { CategoryHierarchy } from '@msdyn365-commerce/commerce-entities';\r\n\r\nimport { AsyncResult, Customer, Product, ProductSearchCriteria, ProductSearchResult, SimpleProduct, SalesOrder } from '@msdyn365-commerce/retail-proxy';\r\nimport { getOrderHistoryAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CustomersDataActions.g';\r\nimport { searchAsync, searchByCategoryAsync, getByIdsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\n\r\nimport { v4 as uuidv4, validate as uuidValidate, version as uuidVersion } from 'uuid';\r\n\r\nimport { createOrUpdateBTGPCartLineAsync, createBTGPErrorLogAsync, getByCustomerAllBTGPTransactionAsync, getByCustomerAllBTGPTransactionFromHqAsync } from '../actions/DataActionExtension.g';\r\nimport { CategoryProducts, FormDetails, PastTransaction, CartItem, Transaction } from '../actions/ecomm-interfaces';\r\n\r\nimport DedicationPeriod from '../resources/dedicationPeriod.json';\r\nimport { ICartState} from '@msdyn365-commerce/global-state';\r\nimport { ReceiptItem } from './kioskv3-interfaces';\r\n\r\nexport async function getProductsByCategoryId(context: ICoreContext, categoryId: number): Promise {\r\n const searchResult = await searchByCategoryAsync({ callerContext: context.actionContext }, context.actionContext.requestContext.apiSettings.channelId, context.actionContext.requestContext.apiSettings.catalogId, categoryId).catch(error => console.log('[getProductsByCategoryId] searchByCategoryAsync error: ', error));\r\n\r\n if (searchResult && searchResult.length > 0) {\r\n searchResult.sort((a: ProductSearchResult, b: ProductSearchResult) => ((a.DisplayOrder!) < (b.DisplayOrder!) ? -1 : 1));\r\n\r\n const productIds: number[] = [];\r\n\r\n searchResult.map(item => productIds.push(item.RecordId));\r\n\r\n // const availability = await getEstimatedAvailabilityAsync(context, { ProductIds: productIds, DefaultWarehouseOnly: true }).\r\n // catch(error => console.log('[getProductsByCategoryId] getEstimatedAvailabilityAsync error: ', error));\r\n\r\n // if (availability && availability.ProductWarehouseInventoryAvailabilities) {\r\n // const warehouse = availability.ProductWarehouseInventoryAvailabilities;\r\n\r\n // if (warehouse.length > 0) {\r\n // const availableIds: number[] = [];\r\n\r\n // searchResult.map(item => {\r\n // const found = warehouse.find(stock => stock.ProductId === item.RecordId);\r\n\r\n // if (found && (found.PhysicalAvailableInventoryLevelCode && found.PhysicalAvailableInventoryLevelCode === InventoryLvls.AVAIL)) {\r\n // availableIds.push(item.RecordId);\r\n // }\r\n // });\r\n\r\n // const products = await getByIdsAsync(context, channelId, availableIds).catch(error => console.log('[getProductsByCategoryId] getByIdsAsync error: ', error));\r\n\r\n // return products;\r\n // }\r\n // }\r\n\r\n const products = await getByIdsAsync({ callerContext: context.actionContext }, context.actionContext.requestContext.apiSettings.channelId, productIds).catch(error => console.log('[getProductsByCategoryId] getByIdsAsync error: ', error));\r\n\r\n return products;\r\n }\r\n\r\n return [];\r\n}\r\n\r\nexport async function getProducts(context: ICoreContext, categoryIDs: number[]): Promise {\r\n if (categoryIDs.length > 0) {\r\n const projectDomain = { ChannelId: context.actionContext.requestContext.apiSettings.channelId, CatalogId: context.actionContext.requestContext.apiSettings.catalogId };\r\n\r\n const criterias: ProductSearchCriteria = { Context: projectDomain, CategoryIds: categoryIDs, IncludeAttributes: true };\r\n \r\n const products = await searchAsync({ callerContext: context.actionContext }, criterias);\r\n \r\n return products;\r\n }\r\n\r\n return [];\r\n}\r\n\r\nexport async function getCustomerOrderHistory(context: ICoreContext, hierarchy: AsyncResult, customer: Customer, organisation: string, isUat: boolean, limit: number, source: string) {\r\n const dictionary = await generateDictionary(context, hierarchy);\r\n const orderHistory: PastTransaction[] = [];\r\n let btgpTransactions;\r\n let orders : SalesOrder[]= []; \r\n\r\n\r\n if (source ==\"CH\")\r\n {\r\n orders = await getOrderHistoryAsync({ callerContext: context.actionContext }, customer.AccountNumber);\r\n\r\n btgpTransactions = await getByCustomerAllBTGPTransactionAsync({ callerContext: context.actionContext }, customer.AccountNumber, customer.Email!, organisation, isUat, limit); \r\n }\r\n else{\r\n btgpTransactions = await getByCustomerAllBTGPTransactionFromHqAsync({ callerContext: context.actionContext }, isUat, customer.AccountNumber, customer.Email!, (organisation==\"BT\"?\"BTRT\":\"GPBT\")); \r\n }\r\n\r\n\r\n if (btgpTransactions)\r\n {\r\n for (let i = 0; i < btgpTransactions.length; i++) {\r\n const transaction: Transaction = JSON.parse(btgpTransactions[`${i}`]);\r\n \r\n if (transaction['errorCode']) {\r\n console.log(transaction['errorMessage']);\r\n } else {\r\n const transactionNames: string[] = [];\r\n\r\n for (let j = 1; j <= 20; j++) {\r\n const nameID = 'Name_' + j;\r\n\r\n if (transaction[`${nameID}`]) {\r\n transactionNames.push(transaction[`${nameID}`]);\r\n }\r\n }\r\n\r\n let mainName = '';\r\n let mainID = 0;\r\n let price = 0;\r\n\r\n if (transaction.ProductCategoryID === '' || transaction.ProductCategoryID === null) {\r\n dictionary.forEach(record => {\r\n const found = record.Products.find(item => item.RecordId === parseInt(transaction.ProductID));\r\n\r\n if (found) { \r\n mainName = record.Main.Name!; \r\n mainID = record.Main.RecordId;\r\n price = found.Price ? found.Price : 0;\r\n }\r\n });\r\n } else {\r\n mainName = transaction.ProductCategory;\r\n mainID = Number(transaction.ProductCategoryID);\r\n price = transaction.ProductPrice;\r\n }\r\n\r\n if (transaction.DedicationPeriod !== '') {\r\n let found = DedicationPeriod.en.period.findIndex(item => item.label === transaction.DedicationPeriod);\r\n\r\n // Look through chinese version.\r\n if (found < 0) {\r\n found = DedicationPeriod.zh.period.findIndex(item => item.label === transaction.DedicationPeriod);\r\n }\r\n\r\n // Found matching dedication period.\r\n if (found >= 0) {\r\n price = price * DedicationPeriod.scale[`${found}`];\r\n }\r\n }\r\n\r\n const matchingOrder = orders.find(order => order.Id === transaction.SalesOrderID);\r\n const orderReceiptNo = transaction.ReceiptNo === '' ? matchingOrder && matchingOrder.SalesId ? matchingOrder.SalesId : 'Pending' : transaction.ReceiptNo;\r\n\r\n let order = transaction;\r\n order.ProductPrice = price;\r\n order.ProductCategory = mainName;\r\n order.ProductCategoryID = mainID.toString();\r\n\r\n orderHistory.push({ \r\n EventDates: [transaction.EventName],\r\n Names: transactionNames,\r\n OrderDate: transaction.DateOfTransaction ? new Date(transaction.DateOfTransaction) : new Date(),\r\n ReceiptNo: [orderReceiptNo],\r\n Record: order\r\n });\r\n }\r\n }\r\n }\r\n\r\n orderHistory.sort((a, b) => {\r\n return b.OrderDate.getTime() - a.OrderDate.getTime();\r\n }); \r\n\r\n return orderHistory;\r\n}\r\n\r\nexport async function generateErrorLog(context: ICoreContext, errorLogName: string, errorDetails: string, item: FormDetails) {\r\n await createBTGPErrorLogAsync({ callerContext: context.actionContext }, generateUUID(), errorLogName, errorDetails, new Date().toISOString(), item.CartLineID, item.CartID, item.ProductID, item.EventID, item.EventName, item.SerialID, item.SerialNumber, item.SerialName, item.Name_1, item.Name_2, item.Name_3, item.Name_4, item.Name_5, item.Name_6, item.Name_7, item.Name_8, item.Name_9, item.Name_10, item.Name_11, item.Name_12, item.Name_13, item.Name_14, item.Name_15, item.Name_16, item.Name_17, item.Name_18, item.Name_19, item.Name_20, item.Remarks, item.Message, item.Category, item.DedicatedBy, item.HasTaxDeduction, item.Nric, item.BuildingName, item.UnitNumber, item.PostalCode, item.BirthDate, item.PhoneNumber, item.SchoolName, item.DonationOption, item.BlessingOption, item.CartLineComment, item.BirthTime, item.LightOption, item.ValidFrom, item.ValidTo, item.ParentCartLineID, item.DedicationPeriod, item.Country, item.CompanyName, item.DeceasedRelationship, item.SurgeryDate, item.DeathDate, item.DeathTime, item.NameChange, item.OldName_1, item.OldName_2, item.BirthDate_2, item.BirthTime_2, item.StartDate, item.Gender, item.ChineseName, item.ContactNumber, item.NameNextKin, item.ContactNumberNextKin, item.PassportNumber, item.PassportExpiryDate, item.PassportIssuedDate);\r\n}\r\n\r\nexport async function createOrUpdateCartline(context: ICoreContext, item: CartItem): Promise {\r\n const result = await createOrUpdateBTGPCartLineAsync({ callerContext: context.actionContext }, item.Form.CartLineID, item.Form.CartID, item.Form.ProductID, item.Form.EventID, item.Form.EventName, item.Form.SerialID, item.Form.SerialNumber, item.Form.SerialName, item.Form.Name_1, item.Form.Name_2, item.Form.Name_3, item.Form.Name_4, item.Form.Name_5, item.Form.Name_6, item.Form.Name_7, item.Form.Name_8, item.Form.Name_9, item.Form.Name_10, item.Form.Name_11, item.Form.Name_12, item.Form.Name_13, item.Form.Name_14, item.Form.Name_15, item.Form.Name_16, item.Form.Name_17, item.Form.Name_18, item.Form.Name_19, item.Form.Name_20, item.Form.Remarks, item.Form.Message, item.Form.Category, item.Form.DedicatedBy, item.Form.HasTaxDeduction, item.Form.Nric, item.Form.BuildingName, item.Form.UnitNumber, item.Form.PostalCode, item.Form.BirthDate, item.Form.PhoneNumber, item.Form.SchoolName, item.Form.DonationOption, item.Form.BlessingOption, item.Form.CartLineComment, item.Form.BirthTime, item.Form.LightOption, item.Form.ValidFrom, item.Form.ValidTo, item.Form.ParentCartLineID, item.Form.DedicationPeriod, item.Form.Country, item.Form.CompanyName, item.Form.DeceasedRelationship, item.Form.SurgeryDate, item.Form.DeathDate, item.Form.DeathTime, item.Form.NameChange, item.Form.OldName_1, item.Form.OldName_2, item.Form.BirthDate_2, item.Form.BirthTime_2, item.IsValid, item.InvalidType, item.InCart, item.IsSubProduct, item.Form.StartDate, item.Form.Gender, item.Form.ChineseName, item.Form.NameNextKin, item.Form.ContactNumber, item.Form.ContactNumberNextKin, item.Form.PassportNumber, item.Form.PassportExpiryDate, item.Form.PassportIssuedDate, item.Form.Consent, item.Form.IsInsuranceIncluded);\r\n\r\n return result;\r\n}\r\n\r\nexport async function generateDictionary(context: ICoreContext, hierarchy: AsyncResult): Promise {\r\n const dictionary: CategoryProducts[] = [];\r\n\r\n if (hierarchy.result) {\r\n hierarchy.result.forEach(record => {\r\n if (record.Children && record.Children.length > 0) {\r\n dictionary.push({ Main: record, SubIDs: record.Children.map(item => item.RecordId), Products: [] });\r\n }\r\n });\r\n }\r\n\r\n for (let j = 0; j < dictionary.length; ++j) {\r\n dictionary[`${j}`].Products = await getProducts(context, dictionary[`${j}`].SubIDs);\r\n }\r\n\r\n return dictionary;\r\n}\r\n\r\nexport function generateUUID(): string {\r\n let uuid = uuidv4();\r\n\r\n while (!(uuidValidate(uuid) && uuidVersion(uuid) == 4)) {\r\n uuid = uuidv4();\r\n }\r\n\r\n return uuid;\r\n}\r\n\r\nexport function showNextOrPreviousPage(selectors: string, showClassName: string, hideClassName: string, showNextPage: boolean) {\r\n let showPageIndex;\r\n const elements = document.querySelectorAll(selectors);\r\n\r\n // to get show page index\r\n for (let i = 0 ; i < elements.length; i++){\r\n const htmlElement = elements[`${i}`] as HTMLElement;\r\n if (htmlElement.classList.contains(showClassName)) {\r\n showPageIndex = showNextPage ? i + 1 : i - 1;\r\n }\r\n htmlElement.classList.remove(showClassName);\r\n htmlElement.classList.add(hideClassName);\r\n }\r\n\r\n const elementToShow = elements[`${showPageIndex}`] as HTMLElement;\r\n elementToShow.classList.remove(hideClassName);\r\n elementToShow.classList.add(showClassName);\r\n}\r\n\r\nexport function loadingProductListInHomePageOrPrecheckoutPage(className: string){\r\n const productListEl = document.getElementsByClassName(className)[0];\r\n const overlayEl = document.getElementsByClassName(\"loading-overlay-parent\")[0] as HTMLElement;\r\n\r\n if (!productListEl.hasChildNodes()){\r\n overlayEl.style.display = \"block\";\r\n\r\n const intervalId = setInterval(()=>{\r\n if (document.getElementsByClassName(className)[0].hasChildNodes()) {\r\n overlayEl.style.display = \"none\";\r\n clearInterval(intervalId);\r\n }\r\n }, 200);\r\n }\r\n else{\r\n overlayEl.style.display = \"none\";\r\n }\r\n}\r\n\r\nexport function showLoadingScreen(show: boolean){\r\n const overlayEl = document.getElementsByClassName(\"loading-overlay-parent\")[0] as HTMLElement;\r\n // show ? overlayEl.style.display = \"block\" : overlayEl.style.display = \"none\";\r\n let overlayTimeout: any = \"\";\r\n\r\n if (show){\r\n overlayTimeout = setTimeout(()=>{\r\n overlayEl.style.display = \"block\";\r\n }, 1000);\r\n }\r\n else{\r\n overlayEl.style.display = \"none\";\r\n }\r\n\r\n\r\n return overlayTimeout;\r\n}\r\n\r\nexport function showLoadingScreenInstant(show: boolean){\r\n const overlayEl = document.getElementsByClassName(\"loading-overlay-parent\")[0] as HTMLElement;\r\n show ? overlayEl.style.display = \"block\" : overlayEl.style.display = \"none\";\r\n}\r\n\r\nexport function showPrintReceiptPopUp(show: boolean){\r\n const overlayEl = document.getElementsByClassName(\"try-again-overlay-parent\")[0] as HTMLElement;\r\n show ? overlayEl.style.display = \"block\" : overlayEl.style.display = \"none\";\r\n}\r\n\r\nexport function clearOverlayTimeout(overlayTimeout: NodeJS.Timeout){\r\n clearTimeout(overlayTimeout);\r\n}\r\n\r\nexport function showStartOverBtnInHeader2(show: boolean){\r\n let elements: Element[] = Array.from(document.getElementsByClassName(\"start-over\"));\r\n elements.forEach(element =>{\r\n if (show){\r\n (element as HTMLElement).style.display = \"block\";\r\n }\r\n else{\r\n (element as HTMLElement).style.display = \"none\";\r\n }\r\n });\r\n}\r\n\r\n\r\nexport async function buildKioskv3ReceiptItems(cart: ICartState, actionContext: IActionContext, channelId: number): Promise{\r\n let productIds: number[] = [];\r\n cart.cart.CartLines?.map(cartLine => productIds.push(Number(cartLine.ProductId)));\r\n\r\n let simpleProductsResults = await searchAsync({ callerContext: actionContext }, { Ids: productIds });\r\n\r\n let receiptItems: ReceiptItem[] = [];\r\n\r\n cart.cart.CartLines?.map(cartLine => {\r\n if (cartLine.ProductId) {\r\n let receiptItem: ReceiptItem = {\r\n quantity: cartLine.Quantity!,\r\n productName: simpleProductsResults.find(product => product.RecordId == cartLine.ProductId)!.ProductName!,\r\n price: cartLine.Price!,\r\n totalAmount: cartLine.Quantity! * cartLine.Price!,\r\n comment: cartLine.Comment!\r\n };\r\n receiptItems.push(receiptItem);\r\n }\r\n })\r\n\r\n return receiptItems;\r\n}","// <= 999 = Mobile\r\n// >= 1000 = Tablet and Desktop\r\n\r\nexport const enum Breakpoints {\r\n small = 540,\r\n medium = 768,\r\n large = 992\r\n}\r\n\r\nexport function isMobile (width: number): boolean {\r\n return width < Breakpoints.large;\r\n}","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as React from 'react';\r\n\r\nimport { getUrlSync } from '@msdyn365-commerce/core';\r\nimport { CategoryHierarchy } from '@msdyn365-commerce/commerce-entities';\r\n\r\nimport { PastTransaction } from '../../actions/ecomm-interfaces';\r\nimport { getCustomerOrderHistory } from '../../actions/helper-functions';\r\n\r\nimport { IEcommHistoryFilterData } from './ecomm-history-filter.data';\r\nimport { IEcommHistoryFilterProps } from './ecomm-history-filter.props.autogenerated';\r\n\r\nexport interface IEcommHistoryFilterViewProps extends IEcommHistoryFilterProps {\r\n filterNodes: any[];\r\n extendedNodes: string[];\r\n totalProducts: number;\r\n}\r\n\r\nexport interface IFilterTreeView {\r\n node?: ITreeViewNode[];\r\n}\r\n\r\nexport interface ITreeViewNode {\r\n value: string;\r\n label: string;\r\n name: string;\r\n children?: ITreeViewNode[];\r\n}\r\n\r\nexport interface IEcommHistoryFilterState {\r\n filterTreeNodesState: ITreeViewNode[];\r\n extendedNodes: string[];\r\n totalProducts: number;\r\n transactions: PastTransaction[];\r\n}\r\n\r\n/**\r\n *\r\n * EcommHistoryFilter component\r\n * @extends {React.PureComponent>}\r\n */\r\nclass EcommHistoryFilter extends React.PureComponent> {\r\n public state: IEcommHistoryFilterState = { filterTreeNodesState: [], extendedNodes: [], totalProducts: 0, transactions: [] };\r\n\r\n private extendedNodes: string[] = [];\r\n\r\n public async componentDidMount() {\r\n const { context, data: { hierarchy } } = this.props;\r\n\r\n const customer = this.props.data.accountInformation?.result;\r\n\r\n if (customer) {\r\n const orderHistory = await getCustomerOrderHistory(context, hierarchy, customer, this.props.config.organisation ? this.props.config.organisation : 'BT', this.props.config.isUat, this.props.config.historyLimit, (this.props.config.srcForCustTransactions?this.props.config.srcForCustTransactions:\"CH\"));\r\n\r\n this.setState({ transactions: orderHistory });\r\n\r\n this._getFilerTreeDataStructure(this.extendedNodes).catch(error => console.log('[EcommSideBarFilter]_getFilerTreeDataStructure error: ', error));\r\n } \r\n else {\r\n const homeLink = getUrlSync('home', this.props.context.actionContext) || '';\r\n\r\n window.location.assign(homeLink.replace('home', ''));\r\n }\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const HistoryFilterViewProps = {\r\n ...this.props,\r\n filterNodes: this.state.filterTreeNodesState,\r\n extendedNodes: this.state.extendedNodes,\r\n totalProducts: this.state.totalProducts\r\n };\r\n\r\n return this.props.renderView(HistoryFilterViewProps);\r\n }\r\n\r\n private async _getFilerTreeDataStructure(extended: string[]):Promise {\r\n const { data: { hierarchy } } = this.props;\r\n\r\n const retObject: ITreeViewNode[] = [];\r\n const totalProductNumber = this.state.transactions.length;\r\n \r\n const promises = hierarchy.result!.sort((a, b) => a.DisplayOrder! - b.DisplayOrder!).map(async elem => {\r\n if (hierarchy.result![0].ParentCategory! === elem.ParentCategory) {\r\n await this._addNode(retObject, elem, extended);\r\n }\r\n });\r\n\r\n Promise.all(promises).then(() => {\r\n this.setState({ filterTreeNodesState: retObject, extendedNodes: extended, totalProducts: totalProductNumber });\r\n })\r\n .catch(error => {\r\n console.log('[_getFilerTreeDataStructure] error: ', error);\r\n });\r\n }\r\n\r\n private async _addNode(tree: ITreeViewNode[], node: CategoryHierarchy, extended: string[]): Promise {\r\n if (!node) {\r\n return [];\r\n }\r\n\r\n const totalProductNumber = this._getCountByCategory(node.RecordId);\r\n\r\n let newTreeNode: ITreeViewNode = { value: '', label: '', name: '' };\r\n \r\n newTreeNode.value = node.RecordId.toString();\r\n newTreeNode.label = `${node.Name} (${totalProductNumber})`;\r\n newTreeNode.name = node.Name ? node.Name : '';\r\n\r\n // Add record to extended array.\r\n extended.push(node.RecordId.toString());\r\n\r\n tree.push(newTreeNode);\r\n\r\n return tree;\r\n }\r\n\r\n private _getCountByCategory(categoryId: number): number {\r\n return this.state.transactions.filter(transaction => Number(transaction.Record.ProductCategoryID) == categoryId).length;\r\n }\r\n}\r\n\r\nexport default EcommHistoryFilter;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as React from 'react';\r\n\r\nimport Dropdown from 'react-bootstrap/Dropdown';\r\nimport DropdownButton from 'react-bootstrap/DropdownButton';\r\n\r\nimport { isMobile } from '../../components/breakpoints';\r\n\r\nimport { GetCategoryFilterValuesInput } from '../../actions/eCommSelectedFilter/ecomm-get-selected-filter-criterias';\r\n\r\nimport { ITreeViewNode, IEcommHistoryFilterViewProps } from './ecomm-history-filter';\r\n\r\nexport class EcommHistoryFilterView extends React.PureComponent {\r\n public state: any = { width: 0, hasMounted: false, checked: [], expanded: [], selectedCategory: undefined };\r\n\r\n private _hasInitiated = false;\r\n\r\n public componentDidMount(): void {\r\n if (!this.state.hasMounted) { \r\n window.addEventListener('resize', this._updateDimensions);\r\n\r\n this.setState({ width: window.innerWidth, hasMounted: true });\r\n }\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n if (!this.state.hasMounted) {\r\n return null;\r\n }\r\n\r\n const { config, filterNodes, totalProducts } = this.props;\r\n\r\n const mobileOptions: ITreeViewNode[] = [];\r\n const desktopOptions: ITreeViewNode[] = [];\r\n\r\n filterNodes.forEach(item => {\r\n if (this.state.selectedCategory) {\r\n if (item.value !== this.state.selectedCategory.value) {\r\n mobileOptions.push(item);\r\n }\r\n }\r\n\r\n desktopOptions.push(item);\r\n });\r\n\r\n if (isMobile(this.state.width)) {\r\n const displayName = this.state.selectedCategory ? this.state.selectedCategory.label : '';\r\n \r\n return (\r\n
\r\n \r\n {mobileOptions.map((item: ITreeViewNode, idx: number) =>\r\n {item.label}\r\n )}\r\n \r\n
\r\n );\r\n }\r\n\r\n const count = `(${totalProducts} ` + `${config.itemsText})`;\r\n\r\n return (\r\n
\r\n
\r\n

{config.categoriesText}

\r\n

{count}

\r\n
\r\n
\r\n {desktopOptions.map((item: ITreeViewNode, idx: number) => {\r\n const activeStyle = this.state.selectedCategory !== undefined && this.state.selectedCategory.value === item.value ? 'active' : '';\r\n\r\n return \r\n })}\r\n
\r\n
\r\n );\r\n }\r\n\r\n public componentDidUpdate() {\r\n const { context, extendedNodes, filterNodes } = this.props;\r\n\r\n if (extendedNodes.length !== 0 && !this._hasInitiated) {\r\n const selected: string[] = [];\r\n\r\n selected.push(filterNodes[0].value);\r\n\r\n context.actionContext.update(new GetCategoryFilterValuesInput(), { filteredCategories: selected });\r\n\r\n this.setState({ selectedCategory: filterNodes[0] });\r\n\r\n this._hasInitiated = true;\r\n } else {\r\n if (this.state.selectedCategory) {\r\n const selected: string[] = [];\r\n\r\n selected.push(this.state.selectedCategory.value);\r\n \r\n context.actionContext.update(new GetCategoryFilterValuesInput(), { filteredCategories: selected });\r\n }\r\n }\r\n }\r\n\r\n public componentWillUnmount() {\r\n window.removeEventListener('resize', this._updateDimensions);\r\n }\r\n\r\n private _onSelect = (event: any) => {\r\n const { filterNodes } = this.props;\r\n\r\n const result = filterNodes.find(item => item.value === event.currentTarget.value);\r\n\r\n if (result) {\r\n this.setState({ selectedCategory: result });\r\n }\r\n }\r\n\r\n private _onDropdownSelect = (event: any) => {\r\n const { filterNodes } = this.props;\r\n\r\n const result = filterNodes.find(item => item.value === event);\r\n\r\n if (result) {\r\n this.setState({ selectedCategory: result });\r\n }\r\n }\r\n\r\n private _updateDimensions = () => {\r\n this.setState({ width: window.innerWidth });\r\n };\r\n}\r\n\r\nexport default EcommHistoryFilterView;","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 (binding.modules['ecomm-history-filter'] = {\n c: () => require('partner/modules/ecomm-history-filter/ecomm-history-filter.tsx'),\n $type: 'contentModule',\n da: [{name:'accountInformation', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer', runOn: 0},{name:'hierarchy', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-categories-hierarchy', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'ecomm-history-filter',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/ecomm-history-filter'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-categories-hierarchy';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-categories-hierarchy');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };\n export const viewDictionary = {};\n viewDictionary['__local__|__local__|modules|ecomm-history-filter|ecomm-history-filter'] = {\n c: () => require('partner/modules/ecomm-history-filter/ecomm-history-filter.view.tsx'),\n cn: '__local__-__local__-ecomm-history-filter'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n IAction,\n IActionContext,\n IActionInput,\n IAny,\n ICommerceApiSettings,\n ICreateActionContext,\n IGeneric\n} from '@msdyn365-commerce/core';\nimport { Customer, CustomersDataActions } from '@msdyn365-commerce/retail-proxy';\n\nimport { buildCacheKey } from './utilities/utils';\n\n/**\n * Input class for get customer data action.\n */\nexport class GetCustomerInput implements IActionInput {\n public customerAccountNumber?: string;\n\n private readonly apiSettings: ICommerceApiSettings;\n\n private readonly cacheType?: CacheType;\n\n public constructor(apiSettings: ICommerceApiSettings, accountNumber?: string, cacheType?: CacheType) {\n this.customerAccountNumber = accountNumber;\n this.apiSettings = apiSettings;\n this.cacheType = cacheType;\n }\n\n /**\n * GetCacheKey.\n * @returns - Returns string.\n */\n public getCacheKey = (): string => buildCacheKey(`Customer-${this.customerAccountNumber}`, this.apiSettings);\n\n /**\n * GetCacheObjectType.\n * @returns - Cache Object Type string.\n */\n public getCacheObjectType = (): string => 'Customer';\n\n /**\n * DataCacheType.\n * @returns - CacheType string.\n */\n public dataCacheType = (): CacheType => {\n return this.cacheType ? this.cacheType : 'request';\n };\n}\n\n/**\n * Creates the input required to make the retail api call.\n * @param inputData -- The input data passed to the createInput method.\n * @returns - ProductAvailabilitiesForSelectedVariant or error.\n */\nconst createInput = (inputData: ICreateActionContext>): GetCustomerInput => {\n const { user, apiSettings } = inputData.requestContext;\n if (!user.token || !user.isAuthenticated) {\n throw new Error('[getCustomer][createInput]: User is not Authenticated.');\n }\n\n return new GetCustomerInput(apiSettings);\n};\n\n/**\n * GetCustomerAction.\n * @param input - GetCustomerInput.\n * @param ctx - Action Context.\n * @returns - Customer information.\n */\nconst getCustomerAction = async (input: GetCustomerInput, ctx: IActionContext): Promise => {\n if (input && ctx.requestContext.user.isAuthenticated) {\n // TO-DO- Need to clean up this code once SDK releases new proxy that handles null.\n return CustomersDataActions.readAsync({ callerContext: ctx, bypassCache: 'get' }, input.customerAccountNumber || '').then(\n response => {\n return Array.isArray(response) ? response[0] : response;\n }\n );\n }\n\n ctx.trace('[getCustomer]Invalid input passed to action');\n return {};\n};\n\n/**\n * The customer data action.\n */\nexport const getCustomerActionDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/retail-actions/get-customer',\n action: >getCustomerAction,\n input: createInput\n});\n\nexport default getCustomerActionDataAction;\n","module.exports = React;","module.exports = ReactDOM;"],"names":["GetCategoryFilterValuesInput","constructor","getCacheKey","getCacheObjectType","dataCacheType","Msdyn365","action","async","input","ctx","filteredCategories","id","args","getProductsByCategoryId","context","categoryId","searchResult","searchByCategoryAsync","callerContext","actionContext","requestContext","apiSettings","channelId","catalogId","catch","error","console","log","length","sort","a","b","DisplayOrder","productIds","map","item","push","RecordId","getByIdsAsync","getProducts","categoryIDs","criterias","Context","ChannelId","CatalogId","CategoryIds","IncludeAttributes","searchAsync","getCustomerOrderHistory","hierarchy","customer","organisation","isUat","limit","source","dictionary","result","forEach","record","Children","Main","SubIDs","Products","j","generateDictionary","orderHistory","btgpTransactions","orders","getOrderHistoryAsync","AccountNumber","getByCustomerAllBTGPTransactionAsync","Email","getByCustomerAllBTGPTransactionFromHqAsync","i","transaction","JSON","parse","transactionNames","nameID","mainName","mainID","price","ProductCategoryID","found","find","parseInt","ProductID","Name","Price","ProductCategory","Number","ProductPrice","DedicationPeriod","findIndex","label","matchingOrder","order","Id","SalesOrderID","orderReceiptNo","ReceiptNo","SalesId","toString","EventDates","EventName","Names","OrderDate","DateOfTransaction","Date","Record","getTime","generateErrorLog","errorLogName","errorDetails","createBTGPErrorLogAsync","uuid","uuidv4","uuidValidate","uuidVersion","generateUUID","toISOString","CartLineID","CartID","EventID","SerialID","SerialNumber","SerialName","Name_1","Name_2","Name_3","Name_4","Name_5","Name_6","Name_7","Name_8","Name_9","Name_10","Name_11","Name_12","Name_13","Name_14","Name_15","Name_16","Name_17","Name_18","Name_19","Name_20","Remarks","Message","Category","DedicatedBy","HasTaxDeduction","Nric","BuildingName","UnitNumber","PostalCode","BirthDate","PhoneNumber","SchoolName","DonationOption","BlessingOption","CartLineComment","BirthTime","LightOption","ValidFrom","ValidTo","ParentCartLineID","Country","CompanyName","DeceasedRelationship","SurgeryDate","DeathDate","DeathTime","NameChange","OldName_1","OldName_2","BirthDate_2","BirthTime_2","StartDate","Gender","ChineseName","ContactNumber","NameNextKin","ContactNumberNextKin","PassportNumber","PassportExpiryDate","PassportIssuedDate","createOrUpdateCartline","createOrUpdateBTGPCartLineAsync","Form","IsValid","InvalidType","InCart","IsSubProduct","Consent","IsInsuranceIncluded","showNextOrPreviousPage","selectors","showClassName","hideClassName","showNextPage","showPageIndex","elements","document","querySelectorAll","htmlElement","classList","contains","remove","add","elementToShow","loadingProductListInHomePageOrPrecheckoutPage","className","productListEl","getElementsByClassName","overlayEl","hasChildNodes","style","display","intervalId","setInterval","clearInterval","showLoadingScreen","show","overlayTimeout","setTimeout","showLoadingScreenInstant","showPrintReceiptPopUp","clearOverlayTimeout","clearTimeout","showStartOverBtnInHeader2","Array","from","element","buildKioskv3ReceiptItems","cart","_cart$cart$CartLines","_cart$cart$CartLines2","CartLines","cartLine","ProductId","simpleProductsResults","Ids","receiptItems","receiptItem","quantity","Quantity","productName","product","ProductName","totalAmount","comment","Comment","Breakpoints","isMobile","width","large","EcommHistoryFilter","React","state","filterTreeNodesState","extendedNodes","totalProducts","transactions","_this$props$data$acco","data","this","props","accountInformation","config","historyLimit","srcForCustTransactions","setState","_getFilerTreeDataStructure","homeLink","getUrlSync","window","location","assign","replace","render","HistoryFilterViewProps","_objectSpread","filterNodes","renderView","extended","retObject","totalProductNumber","promises","ParentCategory","elem","_addNode","Promise","all","then","tree","node","_getCountByCategory","newTreeNode","value","name","filter","EcommHistoryFilterView","hasMounted","checked","expanded","selectedCategory","undefined","_hasInitiated","_onSelect","event","currentTarget","_onDropdownSelect","_updateDimensions","innerWidth","componentDidMount","addEventListener","mobileOptions","desktopOptions","displayName","DropdownButton","title","onSelect","idx","Dropdown","Item","key","eventKey","count","itemsText","categoriesText","activeStyle","onClick","componentDidUpdate","selected","update","componentWillUnmount","removeEventListener","binding","modules","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","Error","prototype","RegistrationId","c","require","$type","da","path","runOn","iNM","ns","n","p","pdp","md","__bindings__","viewDictionary","cn","GetCustomerInput","accountNumber","cacheType","buildCacheKey","customerAccountNumber","getCustomerActionDataAction","createObservableDataAction","user","isAuthenticated","CustomersDataActions","bypassCache","response","isArray","trace","inputData","token","module","exports","ReactDOM"],"sourceRoot":""}