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EhS,EAAAA,cAAC2Q,EAAAA,KAAIhW,OAAAwG,OAAA,GAAK2O,GACLzY,GAAeA,EAAYgC,KAAI,CAACC,EAAyBqG,IAAkBK,EAAAA,cAAC6R,EAAqBlX,OAAAwG,OAAA,CAACzC,IAAKiB,GAAWrG,QAoC3H,EAhC2D2Y,IAAA,IAAC,kBACxDxD,EAAiB,OACjBE,EAAM,MACNO,EAAK,QACLI,EAAO,aACPC,EAAY,mBACZN,EAAkB,KAClBlT,EAAI,MACJ8T,EAAK,WACLE,GACHkC,EAAA,OACGjS,EAAAA,cAACkS,EAAAA,OAAMvX,OAAAwG,OAAA,GAAKsN,GACPE,GAAU3O,EAAAA,cAAC2R,EAAkBhX,OAAAwG,OAAA,GAAKwN,IAClCW,EACAJ,GACGlP,EAAAA,cAAAA,EAAAA,SAAA,KACKkP,EACAD,GAGRM,GACGvP,EAAAA,cAAAA,EAAAA,SAAA,KACKuP,EACAN,GAGRlT,GAAQiE,EAAAA,cAAC+R,EAAgBpX,OAAAwG,OAAA,GAAKpF,IAC9B8T,EACAE,GAAcA","sources":["webpack://nss-commerce/./src/modules/order-history/actions/get-order-shipment-history.ts?b936","webpack://nss-commerce/./src/modules/order-history/components/get-sales-order.tsx?f5c0","webpack://nss-commerce/./src/modules/order-history/components/order-history-filter.tsx?87d0","webpack://nss-commerce/./src/modules/order-history/components/table-view/components/order-history-table-header-component.tsx?48e0","webpack://nss-commerce/./src/modules/order-history/components/table-view/components/order-history-table-row-component.tsx?a93c","webpack://nss-commerce/./src/modules/order-history/components/table-view/order-history-table.tsx?5dd4","webpack://nss-commerce/./src/modules/order-history/order-history.tsx?fd71","webpack://nss-commerce/./src/modules/order-history/order-history.view.tsx?2545"],"sourcesContent":["/*!\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    ICommerceApiSettings\n} from '@msdyn365-commerce/core';\nimport { IQueryResultSettings, SalesLine } from '@msdyn365-commerce/retail-proxy';\nimport { getOrderShipmentsHistoryAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CustomersDataActions.g';\nimport { OrderShipments, SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport {\n    buildCacheKey,\n    getOrganizationWideOrderHistory,\n    GetOrganizationWideOrderHistoryInput,\n    getSimpleProducts,\n    ProductInput\n} from '@msdyn365-commerce-modules/retail-actions';\n\nimport { OrderHistoryFilterState } from '../components/order-history-filter';\n\n/**\n * IPaging Interface.\n */\nexport interface IPaging {\n    top: number;\n    skip: number;\n}\n\n/**\n * IOrderHistory Interface.\n */\nexport interface IOrderHistory {\n    salesOrders: OrderShipments[];\n    products: SimpleProduct[];\n    nextPageToken?: string;\n}\n\n/**\n * IOrderHistoryResult Interface.\n */\nexport interface IOrderHistoryResult {\n    salesOrders: OrderShipments[];\n    nextPageToken?: string;\n}\n\n/**\n * Calls the Retail API and returns the products.\n * @param paging - Paging interface.\n * @param nextPageToken - Next Page Link.\n * @returns Collection of OrderShipments.\n */\nconst getOrderShipmentHistory = (paging: IPaging, nextPageToken?: string) => async (ctx: IActionContext): Promise<IOrderHistoryResult> => {\n    const orderHistoryResults = getOrderShipmentsHistoryAsync(\n        {\n            callerContext: ctx,\n            bypassCache: 'get',\n            queryResultSettings: {\n                Paging: {\n                    Top: paging.top,\n                    NextPageToken: nextPageToken\n                }\n            }\n        },\n        '',\n        nextPageToken\n    );\n\n    const orderHistoryResponse = await orderHistoryResults;\n    const nextLinkUrl = orderHistoryResults.metadata?.others?.nextLink;\n    const nextPageLink = nextLinkUrl !== undefined ? new URL(nextLinkUrl).searchParams.get('nextPageToken') : undefined;\n    const nextPage = nextPageLink !== null ? nextPageLink : undefined;\n    return {\n        salesOrders: orderHistoryResponse,\n        nextPageToken: nextPage\n    };\n};\n\n/**\n * Calls the Retail API and returns the products.\n * @param paging - Paging props.\n * @param nextPageToken - Next Page Link.\n * @returns Collections of order shipments.\n */\nconst getOrganizationWideOrderShipmentHistory = (paging: IPaging, nextPageToken?: string) => async (\n    context: IActionContext\n): Promise<IOrderHistoryResult> => {\n    const queryResultSetting: IQueryResultSettings = {\n        Paging: {\n            Top: paging.top,\n            Skip: paging.skip,\n            NextPageToken: nextPageToken\n        }\n    };\n\n    const orgOrderHistoryResults = getOrganizationWideOrderHistory(new GetOrganizationWideOrderHistoryInput(queryResultSetting), context);\n\n    const orgOrderHistoryResponse = await orgOrderHistoryResults;\n    const nextLinkUrl = orgOrderHistoryResults.metadata?.others?.nextLink;\n    const nextPageLink = nextLinkUrl !== undefined ? new URL(nextLinkUrl).searchParams.get('nextPageToken') : undefined;\n    const nextPage = nextPageLink !== null ? nextPageLink : undefined;\n    return {\n        salesOrders: orgOrderHistoryResponse,\n        nextPageToken: nextPage\n    };\n};\n\n/**\n * Calls the Retail API and returns the products.\n * @param productIds - Collection of products id.\n * @param channelId - ChannelId number.\n * @returns Collections of simple products.\n */\nconst getProducts = (productIds: number[] = [], channelId?: number) => (ctx: IActionContext): Promise<SimpleProduct[]> => {\n    const productInputs = productIds.map(\n        productId => new ProductInput(productId, ctx.requestContext.apiSettings, channelId, undefined, ctx.requestContext)\n    );\n    return getSimpleProducts(productInputs, ctx);\n};\n\n/**\n *  Action input.\n */\nexport class GetSalesOrderHistoryWithHydrationsInput implements IActionInput {\n    public paging: IPaging;\n\n    public filterState: OrderHistoryFilterState;\n\n    public nextPageToken?: string;\n\n    private readonly apiSettings: ICommerceApiSettings;\n\n    constructor(paging: IPaging, apiSettings: ICommerceApiSettings, filterState?: OrderHistoryFilterState, nextPageLink?: string) {\n        this.apiSettings = apiSettings;\n        this.paging = paging;\n        this.filterState = filterState || OrderHistoryFilterState.CurrentUser;\n        this.nextPageToken = nextPageLink;\n    }\n\n    public getCacheKey = () => buildCacheKey('OrderHistory', this.apiSettings);\n\n    /**\n     * GetCacheObjectType.\n     * @returns String.\n     */\n    public getCacheObjectType = () => 'OrderHistory';\n\n    public dataCacheType = (): CacheType => 'none';\n}\n\n/**\n * Splits product ids from the given orders into lists by their channel id.\n * @param {OrderShipments[]} salesOrders Orders with the products.\n * @param {number} currentChannelId Channel id to use by default if no channel id is provided for a product.\n * @returns {{ [x: number]: number[] }} A dictionary where the key is a channel id,\n * and the value is a list of product ids in which all items correspond to the key channel id.\n * @remark The list of product ids is always non-empty.\n */\nconst splitProductsByChannelId = (salesOrders: OrderShipments[], currentChannelId: number): { [x: number]: number[] } => {\n    const productIdsByChannel: { [x: number]: number[] } = {};\n\n    salesOrders.forEach(salesOrder =>\n        salesOrder?.SalesLines?.forEach(line => {\n            const orderProductId = line.ProductId || 0;\n            const orderChannelId = salesOrder.ChannelId || currentChannelId;\n            if (!productIdsByChannel[orderChannelId]) {\n                productIdsByChannel[orderChannelId] = [];\n            }\n            productIdsByChannel[orderChannelId].push(orderProductId);\n        })\n    );\n\n    return productIdsByChannel;\n};\n\n/**\n * Get sales order with hydrations action.\n * @param input - GetOrderHistory hydration input.\n * @param context - Channel context.\n * @returns - Order History props.\n */\nexport async function getSalesOrderHistoryWithHydrationsAction(\n    input: GetSalesOrderHistoryWithHydrationsInput,\n    context: IActionContext\n): Promise<IOrderHistory> {\n    if (!context) {\n        throw new Error('getSalesOrderWithHydrationsAction - Action context cannot be null/undefined');\n    }\n    const channelId = context.requestContext.apiSettings.channelId;\n    let salesOrders: OrderShipments[] = [];\n    let nextPage: string | undefined = '';\n    let orderHistoryResponse: IOrderHistoryResult;\n\n    switch (input.filterState) {\n        case OrderHistoryFilterState.CurrentUser:\n            orderHistoryResponse = await getOrderShipmentHistory(input.paging, input.nextPageToken)(context);\n            salesOrders = orderHistoryResponse.salesOrders;\n            nextPage = orderHistoryResponse.nextPageToken;\n            break;\n        case OrderHistoryFilterState.OrganizationWide:\n            orderHistoryResponse = await getOrganizationWideOrderShipmentHistory(input.paging, input.nextPageToken)(context);\n            salesOrders = orderHistoryResponse.salesOrders;\n            nextPage = orderHistoryResponse.nextPageToken;\n            break;\n        default:\n            throw new Error('getSalesOrderWithHydrationsAction - Invalid OrderHistoryFilterState passed');\n    }\n\n    salesOrders.map(salesOrder => {\n        return (salesOrder.SalesLines = salesOrder.SalesLines?.filter((saleline: SalesLine) => !saleline.IsVoided));\n    });\n\n    if (!salesOrders || salesOrders.length === 0) {\n        return {\n            salesOrders: [],\n            products: [],\n            nextPageToken: nextPage\n        };\n    }\n\n    // Splits the data by channel ids so that the products from different channels can be processed separately.\n    const productIdsByChannelId = splitProductsByChannelId(salesOrders, channelId);\n\n    // Promise that retrieves information about the products for each channel id.\n    // Note, the list of product ids should not be empty\n    // as it will generate an empty request which will force the promise to fail.\n    const getProductsPromise = Object.entries(productIdsByChannelId).map(([entryChannelId, entryProductIdsList]) => {\n        const getProductsCall = getProducts(entryProductIdsList, Number(entryChannelId));\n        return getProductsCall(context);\n    });\n\n    return Promise.all(getProductsPromise)\n        .then(\n            (productList): IOrderHistory => {\n                const products = productList.reduce((memo, list) => {\n                    return [...memo, ...list];\n                }, []);\n                return {\n                    salesOrders,\n                    products,\n                    nextPageToken: nextPage\n                };\n            }\n        )\n        .catch(error => {\n            context.telemetry.exception(error);\n            context.telemetry.debug('Failed to get products');\n            throw error;\n        });\n}\n\nexport const getSalesOrderHistoryWithHydrationsActionDataAction = createObservableDataAction({\n    id: '@msdyn365-commerce-modules/order-management/order-history/get-order-shipment-history',\n    action: <IAction<IOrderHistory>>getSalesOrderHistoryWithHydrationsAction\n});\n\nexport default getSalesOrderHistoryWithHydrationsActionDataAction;\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';\nimport {\n    ChannelDeliveryOptionConfiguration,\n    ChannelIdentity,\n    Customer,\n    format,\n    OrderOriginator,\n    OrderShipments,\n    OrgUnitLocation,\n    SimpleProduct\n} from '@msdyn365-commerce/retail-proxy';\nimport { ObjectExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport {\n    Button,\n    getPayloadObject,\n    getTelemetryAttributes,\n    INodeProps,\n    ITelemetryContent,\n    TelemetryConstant\n} from '@msdyn365-commerce-modules/utilities';\nimport { Observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { ExpandButtonState, SalesLineState } from '../../../common';\nimport { getGroups, IGroups } from '../../../common/get-groups';\nimport { getOrderInformation, getOrderInformationInput, IOrderInformation } from '../../../common/get-order-information';\nimport { ISalesLine } from '../../../common/get-sales-line';\nimport { getSalesLines, getSalesLinesInput, IGetSalesLinesInput } from '../../../common/get-sales-lines';\nimport { IOrderHistoryData } from '../order-history.data';\nimport { IOrderHistoryProps } from '../order-history.props.autogenerated';\n\nexport interface ISalesOrderProps extends IOrderHistoryProps<IOrderHistoryData> {\n    salesOrder: OrderShipments;\n    products: SimpleProduct[];\n    channelIdentities?: ChannelIdentity[];\n    orgUnitLocations?: OrgUnitLocation[];\n    customer?: Customer;\n    originator?: OrderOriginator;\n    showChannelInfo?: boolean;\n    telemetryContent?: ITelemetryContent;\n    retailMultiplePickUpOptionEnabled?: boolean;\n    channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\n    salesLinesLimit?: number;\n}\n\nexport interface ISalesOrder {\n    salesOrderProps: INodeProps;\n    orderInfomation: IOrderInformation;\n    groups?: IGroups;\n    orderDetailsLink: React.ReactNode;\n    expandProductsButton?: React.ReactNode;\n}\n\n/**\n * Retrieves the url for order details page.\n * @param actionContext - Core action context.\n * @param salesOrder - Order information.\n * @returns Url to order details.\n */\nexport const getOrderDetailsPageUrl = (actionContext: IActionContext, salesOrder: OrderShipments): string => {\n    const orderDetailsUrl = getUrlSync('orderDetails', actionContext) || '';\n    const separator = orderDetailsUrl.includes('?') ? '&' : '?';\n    if (salesOrder.SalesId) {\n        // Redirect with sales order sales id\n        return `${orderDetailsUrl}${separator}salesId=${salesOrder.SalesId}`;\n    }\n\n    // Redirect with sales order transaction id\n    return `${orderDetailsUrl}${separator}transactionId=${salesOrder.TransactionId!}`;\n};\n\n/**\n * Updates product states to show all products.\n * @param expandButtonState - Expand button state.\n * @param productStates - Product states.\n * @returns Callback method.\n */\nconst onExpandProductsCallback = (expandButtonState: ExpandButtonState, productStates: SalesLineState[]) => () => {\n    for (const productState of productStates) {\n        productState.isHidden = false;\n    }\n    expandButtonState.extraProductsCount = 0;\n};\n\nexport const getSalesOrder = (input: ISalesOrderProps): ISalesOrder => {\n    const {\n        id,\n        typeName,\n        context,\n        telemetry,\n        products,\n        salesOrder,\n        showChannelInfo,\n        channelIdentities,\n        orgUnitLocations,\n        customer,\n        originator,\n        telemetryContent,\n        resources: { freePriceText, detailsAriaLabel, detailsLabel, orderItemLabel, orderItemsLabel },\n        context: { actionContext },\n        retailMultiplePickUpOptionEnabled,\n        channelDeliveryOptionConfig\n    } = input;\n\n    const moduleName = 'ms-order-history';\n\n    const priceContext = {\n        id,\n        typeName,\n        context,\n        telemetry,\n        freePriceText\n    };\n\n    const salesOrderProps = { className: 'ms-order-history__sales-order', key: salesOrder.SalesId || salesOrder.TransactionId };\n\n    const orderInfomationInput = getOrderInformationInput(\n        input,\n        moduleName,\n        salesOrder,\n        priceContext,\n        channelIdentities,\n        orgUnitLocations,\n        customer,\n        originator,\n        showChannelInfo\n    );\n\n    const orderInfomation = getOrderInformation(orderInfomationInput);\n\n    const salesLinesInput =\n        products &&\n        getSalesLinesInput(\n            input,\n            moduleName,\n            salesOrder,\n            products,\n            priceContext,\n            undefined,\n            undefined,\n            undefined,\n            retailMultiplePickUpOptionEnabled,\n            channelDeliveryOptionConfig\n        );\n\n    let salesLines: ISalesLine[] | undefined;\n    let expandProductsButton: React.ReactNode;\n    if (salesLinesInput) {\n        const getSalesLinesInputProps: IGetSalesLinesInput = { ...salesLinesInput, imageOnly: true };\n        if (!ObjectExtensions.isNullOrUndefined(input.salesLinesLimit)) {\n            const extraProductsCount = getSalesLinesInputProps.salesLines.length - input.salesLinesLimit;\n            getSalesLinesInputProps.salesLineStates = getSalesLinesInputProps.salesLines.map(\n                (salesLine, index) => new SalesLineState(`${salesLine.LineId ?? ''}-${index}`, index >= input.salesLinesLimit!)\n            );\n            if (extraProductsCount > 0) {\n                const expandButtonState = new ExpandButtonState(extraProductsCount);\n                expandProductsButton = (\n                    <>\n                        <Observer>\n                            {() => {\n                                const text = format(\n                                    input.resources.orderHistoryExpandProductsButtonText,\n                                    expandButtonState.extraProductsCount\n                                );\n                                return (\n                                    expandButtonState.extraProductsCount > 0 && (\n                                        <Button\n                                            className={`${moduleName}__sales-order__expand-products-button`}\n                                            title={text}\n                                            role='button'\n                                            onClick={onExpandProductsCallback(expandButtonState, getSalesLinesInputProps.salesLineStates!)}\n                                            aria-label={text}\n                                        >\n                                            {text}\n                                        </Button>\n                                    )\n                                );\n                            }}\n                        </Observer>\n                    </>\n                );\n            }\n        }\n        salesLines = getSalesLines(getSalesLinesInputProps);\n    }\n\n    expandProductsButton = (\n        <>\n            {expandProductsButton}\n            <div className={`${moduleName}__sales-order__expand-products-button-wrapper`} />\n        </>\n    );\n\n    const payLoad = getPayloadObject('click', telemetryContent!, TelemetryConstant.OrderDetails);\n    const orderDetailsAttributes = getTelemetryAttributes(telemetryContent!, payLoad);\n\n    const groups =\n        salesLines &&\n        getGroups({\n            moduleName,\n            salesLines,\n            resources: { orderItemLabel, orderItemsLabel },\n            retailMultiplePickUpOptionEnabled\n        });\n\n    const orderDetailsLink = (\n        <Button\n            href={getOrderDetailsPageUrl(actionContext, salesOrder)}\n            role='button'\n            aria-label={\n                salesOrder.ChannelReferenceId && detailsAriaLabel\n                    ? detailsAriaLabel.replace('{orderId}', salesOrder.ChannelReferenceId)\n                    : ''\n            }\n            className='ms-order-history__btn-order-details'\n            {...orderDetailsAttributes}\n        >\n            {detailsLabel}\n        </Button>\n    );\n\n    return {\n        salesOrderProps,\n        orderInfomation,\n        groups,\n        orderDetailsLink,\n        expandProductsButton\n    };\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\nimport { Customer } from '@msdyn365-commerce/retail-proxy';\nimport { EnumExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { Button, Popover } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\nexport interface IOrderHistoryFilterResources {\n    orderHistoryFilterYourOrderHistory: string;\n    orderHistoryFilterOrganizationWide: string;\n}\n\nexport interface IOrderHistoryFilterData {\n    customerInformation: Customer;\n}\n\nexport interface IOrderHistoryFilterProps extends IComponentProps<IOrderHistoryFilterData> {\n    className: string;\n\n    resources: IOrderHistoryFilterResources;\n\n    currentState: OrderHistoryFilterState;\n    onFilterStateChanged(state: OrderHistoryFilterState): void;\n}\n\nexport enum OrderHistoryFilterState {\n    CurrentUser,\n    OrganizationWide\n}\n\nconst getOrderHistoryFilterStateResources = (filterState: OrderHistoryFilterState, resources: IOrderHistoryFilterResources): string => {\n    switch (filterState) {\n        case OrderHistoryFilterState.CurrentUser:\n            return resources.orderHistoryFilterYourOrderHistory;\n        case OrderHistoryFilterState.OrganizationWide:\n            return resources.orderHistoryFilterOrganizationWide;\n        default:\n            throw new Error('Failed to retrieve resource description for unknown order history filter state.');\n    }\n};\n\n/**\n * On Click functionality.\n * @param onStateClick -Filter state function.\n * @param filterState -Order history filter state.\n * @returns On state click functionality.\n */\nconst onClickHandler = (onStateClick: (filterState: OrderHistoryFilterState) => void, filterState: OrderHistoryFilterState) => () => {\n    onStateClick(filterState);\n};\n\nconst renderFilterStateItem = (\n    filterState: OrderHistoryFilterState,\n    resources: IOrderHistoryFilterResources,\n    className: string,\n    onStateClick: (filterState: OrderHistoryFilterState) => void\n): React.ReactNode => {\n    const stateStringRepresentation = OrderHistoryFilterState[filterState];\n\n    return (\n        <button className={`${className}__item__${stateStringRepresentation}`} onClick={onClickHandler(onStateClick, filterState)}>\n            {getOrderHistoryFilterStateResources(filterState, resources)}\n        </button>\n    );\n};\n\n/**\n * On Toggle Popover functionality.\n * @param setPopoverState -Set popover state function.\n * @param isPopoverState -Boolean value.\n * @returns Set toggle popover state functionality.\n */\nconst togglePopoverHandler = (setPopoverState: React.Dispatch<React.SetStateAction<boolean>>, isPopoverState: boolean) => () => {\n    setPopoverState(!isPopoverState);\n};\n\nconst OrderHistoryFilter: React.FC<IOrderHistoryFilterProps> = (props: IOrderHistoryFilterProps) => {\n    // Current version of filter doesn't include functionality for non b2b users or non-admin b2b users.\n    if (!props.data.customerInformation.IsB2bAdmin) {\n        return <div className={props.className} />;\n    }\n\n    const popoverRef = React.createRef<HTMLButtonElement>();\n    const [popoverState, setPopoverState] = React.useState(false);\n\n    const [filterState, setFilterState] = React.useState(props.currentState);\n\n    const onFilterStateClick = (clickedState: OrderHistoryFilterState) => {\n        setFilterState(clickedState);\n        setPopoverState(false);\n        props.onFilterStateChanged(clickedState);\n    };\n\n    return (\n        <div className={props.className}>\n            <Button\n                className={`${props.className}__expand-filter-button`}\n                innerRef={popoverRef}\n                aria-expanded={popoverState}\n                aria-describedby={props.className}\n                onClick={togglePopoverHandler(setPopoverState, popoverState)}\n            >\n                {getOrderHistoryFilterStateResources(filterState, props.resources)}\n            </Button>\n            <Popover\n                id={props.className}\n                placement='bottom-end'\n                isOpen={popoverState}\n                target={popoverRef}\n                toggle={togglePopoverHandler(setPopoverState, popoverState)}\n            >\n                {EnumExtensions.getEnumValues<OrderHistoryFilterState>(OrderHistoryFilterState).map(state => {\n                    return renderFilterStateItem(state, props.resources, props.className, onFilterStateClick);\n                })}\n            </Popover>\n        </div>\n    );\n};\n\nexport const OrderHistoryFilterComponent: React.FunctionComponent<IOrderHistoryFilterProps> = msdyn365Commerce.createComponent<\n    // @ts-expect-error\n    IOrderHistoryFilterProps\n>('OrderHistoryFilterComponent', { component: OrderHistoryFilter });\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IComponentProps, ICoreContext } from '@msdyn365-commerce/core';\nimport { isMobile, VariantType } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\n/**\n * Resources which are used in order history header.\n */\nexport interface IOrderHistoryTableHeaderResources {\n    orderHistoryOrderNumberText: string;\n    orderHistoryCreatedDateText: string;\n    orderHistoryItemsText: string;\n    orderHistoryTotalText: string;\n    orderHistoryOriginText: string;\n    orderPlacedByFullText?: string;\n}\n\n/**\n * Configuration of the component.\n */\nexport interface IOrderHistoryTableHeaderProps extends IComponentProps {\n    context: ICoreContext;\n    className: string;\n\n    resources: IOrderHistoryTableHeaderResources;\n\n    shouldShowChannelInfo: boolean;\n    shouldShowOrderPlacedBy?: boolean;\n}\n\n/**\n * Renders desktop view cells.\n * @param props - Configuration of the module.\n * @returns List of cells for the header.\n */\nconst getDesktopHeaderCells = (props: IOrderHistoryTableHeaderProps) => {\n    const { resources } = props;\n\n    const columnWithNumberClassName = `${props.className}__row__column-with-number`;\n\n    return (\n        <>\n            {props.shouldShowOrderPlacedBy && <th>{resources.orderPlacedByFullText}</th>}\n            <th>{resources.orderHistoryOrderNumberText}</th>\n            <th>{resources.orderHistoryCreatedDateText}</th>\n            <th className={columnWithNumberClassName}>{resources.orderHistoryItemsText}</th>\n            <th className={columnWithNumberClassName}>{resources.orderHistoryTotalText}</th>\n            {props.shouldShowChannelInfo && <th>{resources.orderHistoryOriginText}</th>}\n            <th />\n        </>\n    );\n};\n\n/**\n * Renders mobile view cells.\n * @param props - Configuration of the module.\n * @returns List of cells for the header.\n */\nconst getMobileHeaderCells = (props: IOrderHistoryTableHeaderProps) => {\n    const { resources } = props;\n    return (\n        <>\n            <th className={`${props.className}__row__mobile-cell`}>{resources.orderHistoryOrderNumberText}</th>\n            <th />\n        </>\n    );\n};\n\n/**\n * Order history table header component.\n * @param props - Configuration of the component.\n * @returns React node with the header.\n */\nexport const OrderHistoryTableHeaderComponent: React.FC<IOrderHistoryTableHeaderProps> = (props: IOrderHistoryTableHeaderProps) => {\n    const rowClassName = `${props.className}__row`;\n\n    let headerCells: JSX.Element;\n    const isMobileView = isMobile({ variant: VariantType.Viewport, context: props.context.request }) === 'xs';\n    if (isMobileView) {\n        headerCells = getMobileHeaderCells(props);\n    } else {\n        headerCells = getDesktopHeaderCells(props);\n    }\n\n    return (\n        <thead className={props.className}>\n            <tr className={rowClassName}>{headerCells}</tr>\n        </thead>\n    );\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport MsDyn365, { IComponentProps, ICoreContext, IDateFormatOptions, isOboRequest } from '@msdyn365-commerce/core';\nimport { ChannelIdentity, Customer, format, OrderOriginator, OrderShipments, OrgUnitLocation } from '@msdyn365-commerce/retail-proxy';\nimport { ArrayExtensions, StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { Button, isMobile, VariantType } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\nimport {\n    getOrderChannelAddress,\n    getOrderChannelName,\n    getOrderChannelTypeValue,\n    isOnlineStoreChannel\n} from '../../../../../common/get-order-information';\nimport { countItems } from '../../../../../common/utilities';\nimport { getOrderDetailsPageUrl } from '../../get-sales-order';\n\n/**\n * Data required to render each order history row.\n */\nexport interface IOrderHistoryTableRowData {\n    salesOrder: OrderShipments;\n    channelIdentities?: ChannelIdentity[];\n    orgUnitLocations?: OrgUnitLocation[];\n    customer?: Customer;\n    originator?: OrderOriginator;\n}\n\n/**\n * Resources for order history table rows.\n */\nexport interface IOrderHistoryTableRowResources {\n    orderHistoryViewDetailsButtonText: string;\n    orderHistoryViewDetailsButtonAriaLabel: string;\n    orderHistoryCreatedDateMobileDescriptionText: string;\n    orderHistoryOrderNumberIsNotAvailable: string;\n    onlineStoreChannelNameText: string;\n    posChannelNameText: string;\n    orderPlacedByFullText?: string;\n    orderPlacedByYouText?: string;\n    orderOnBehalfOfText?: string;\n}\n\n/**\n * Configuration for the order history rows.\n */\nexport interface IOrderHistoryTableRowProps extends IComponentProps<IOrderHistoryTableRowData> {\n    context: ICoreContext;\n    className: string;\n\n    resources: IOrderHistoryTableRowResources;\n\n    shouldShowChannelInfo: boolean;\n    shouldShowOrderPlacedBy?: boolean;\n}\n\n/**\n * Formats amount.\n * @param context - Core context.\n * @param amount - Amount to display.\n * @param currencyCode - Currency for the amount.\n * @returns String value.\n */\nconst formatAmount = (context: ICoreContext, amount: number | undefined, currencyCode: string | undefined) => {\n    if (amount === undefined) {\n        return '';\n    }\n    return context.cultureFormatter.formatCurrency(amount, currencyCode);\n};\n\n/**\n * Formats date.\n * @param context - Core context.\n * @param date - Date to display.\n * @returns String value.\n */\nconst formatDate = (context: ICoreContext, date: Date | undefined) => {\n    if (date === undefined) {\n        return '';\n    }\n\n    const dateOptions: IDateFormatOptions = { year: 'numeric', month: 'numeric', day: 'numeric' };\n    return context.cultureFormatter.formatDate(date, dateOptions);\n};\n\nconst getShortEllipsisText = (originalText: string, maxTextLength: number) => {\n    const isRtl = document.body.parentElement?.getAttribute('dir') === 'rtl';\n    return originalText.length > maxTextLength\n        ? isRtl\n            ? `…${originalText.substring(0, maxTextLength - 1)}`\n            : `${originalText.substring(0, maxTextLength - 1)}…`\n        : originalText;\n};\n\n/**\n * Renders rows for desktop view.\n * @param props - Configuration for the rows.\n * @returns A react node with a list of order history rows for desktop view.\n */\nexport const OrderHistoryDesktopTableRowCellComponent: React.FC<IOrderHistoryTableRowProps> = (props: IOrderHistoryTableRowProps) => {\n    const {\n        data: { salesOrder, channelIdentities, orgUnitLocations, customer, originator },\n        resources: { orderPlacedByFullText, orderPlacedByYouText, orderOnBehalfOfText }\n    } = props;\n\n    const linkToOrderHistoryDetails = getOrderDetailsPageUrl(props.context.actionContext, props.data.salesOrder);\n\n    const defaultCount = 0;\n    const itemsCount = ArrayExtensions.hasElements(salesOrder.SalesLines) ? countItems(salesOrder.SalesLines) : defaultCount;\n    const channelName = getOrderChannelName(salesOrder, channelIdentities);\n    const channelAddress = getOrderChannelAddress(salesOrder, orgUnitLocations);\n    const channelTypeValue = getOrderChannelTypeValue(salesOrder, channelIdentities);\n    const isOnlineStore = isOnlineStoreChannel(channelTypeValue, channelAddress);\n\n    const columnWithNumberClassName = `${props.className}__column-with-number`;\n\n    let orderNumberCellText = props.resources.orderHistoryOrderNumberIsNotAvailable;\n    if (!StringExtensions.isNullOrWhitespace(salesOrder.SalesId)) {\n        orderNumberCellText = salesOrder.SalesId!;\n    }\n\n    const isYou =\n        !isOboRequest(props.context.request) &&\n        originator?.CustomerId &&\n        originator?.CustomerName &&\n        !originator?.StaffId &&\n        !originator?.StaffName &&\n        customer?.AccountNumber === originator?.CustomerId\n            ? true\n            : false;\n    const isYouObo = !isYou && !isOboRequest(props.context.request);\n    let placedByName =\n        originator?.StaffId && originator.StaffName\n            ? originator.StaffName\n            : originator?.CustomerId && originator.CustomerName\n            ? originator.CustomerName\n            : '-';\n    placedByName = `${placedByName} ${isYou ? orderPlacedByYouText : ''}`;\n    const isOnBehalfOfOrder = isOnlineStore && originator?.StaffName && customer?.Name;\n    const maxOrderTextLength = window.innerWidth > 700 ? 20 : 12;\n    const placedByText = `${orderPlacedByFullText} ${placedByName}`;\n    const onBehalfOfText = `${orderOnBehalfOfText} ${customer?.Name} ${isYouObo ? orderPlacedByYouText : ''}`;\n\n    return (\n        <>\n            {props.shouldShowOrderPlacedBy && (\n                <td>\n                    <span\n                        className={`${props.className}__placed-by`}\n                        data-title={`${placedByName} ${isOnBehalfOfOrder ? onBehalfOfText : ''}`}\n                    >\n                        {placedByName}\n                        {isOnBehalfOfOrder && (\n                            <>\n                                <br /> {getShortEllipsisText(onBehalfOfText, maxOrderTextLength)}\n                            </>\n                        )}\n                    </span>\n                </td>\n            )}\n            <td>\n                <span className={`${props.className}__order-number`}>{orderNumberCellText}</span>\n                {isOnBehalfOfOrder && !props.shouldShowOrderPlacedBy && (\n                    <>\n                        <span className={`${props.className}__placed-by`} data-title={placedByText}>\n                            {getShortEllipsisText(placedByText, maxOrderTextLength)}\n                        </span>\n                    </>\n                )}\n            </td>\n            <td>{formatDate(props.context, salesOrder.CreatedDateTime)}</td>\n            <td className={columnWithNumberClassName}>{itemsCount}</td>\n            <td className={columnWithNumberClassName}>{formatAmount(props.context, salesOrder.TotalAmount, salesOrder.CurrencyCode)}</td>\n            {props.shouldShowChannelInfo && (\n                <td>\n                    {channelName &&\n                        (channelAddress\n                            ? `${props.resources.posChannelNameText} ${channelName}`\n                            : props.resources.onlineStoreChannelNameText)}\n                </td>\n            )}\n            <td>\n                <Button\n                    className={`${props.className}__view-details-button`}\n                    href={linkToOrderHistoryDetails}\n                    title={props.resources.orderHistoryViewDetailsButtonText}\n                    aria-label={props.resources.orderHistoryViewDetailsButtonAriaLabel}\n                >\n                    {props.resources.orderHistoryViewDetailsButtonText}\n                </Button>\n            </td>\n        </>\n    );\n};\n\n/**\n * Renders rows for mobile view.\n * @param props - Configuration for the rows.\n * @returns A react node with a list of order history rows for mobile view.\n */\nexport const OrderHistoryMobileTableRowCellComponent: React.FC<IOrderHistoryTableRowProps> = (props: IOrderHistoryTableRowProps) => {\n    const {\n        data: { salesOrder }\n    } = props;\n\n    const linkToOrderHistoryDetails = getOrderDetailsPageUrl(props.context.actionContext, props.data.salesOrder);\n\n    const onClickViewDetails = React.useCallback(() => {\n        if (MsDyn365.isBrowser) {\n            window.location.href = linkToOrderHistoryDetails;\n        }\n    }, [linkToOrderHistoryDetails]);\n\n    const orderNumber = StringExtensions.isNullOrWhitespace(salesOrder.SalesId)\n        ? props.resources.orderHistoryOrderNumberIsNotAvailable\n        : salesOrder.SalesId!;\n\n    const dateText = format(\n        props.resources.orderHistoryCreatedDateMobileDescriptionText,\n        formatDate(props.context, salesOrder.CreatedDateTime)\n    );\n\n    const cellClassName = `${props.className}__mobile-cell`;\n\n    return (\n        <>\n            <td className={cellClassName}>\n                <div\n                    className={`${cellClassName}__open-details`}\n                    onClick={onClickViewDetails}\n                    onKeyPress={onClickViewDetails}\n                    role='button'\n                    tabIndex={0}\n                >\n                    <span className={`${cellClassName}__mobile-order-id`}>{orderNumber}</span>\n                    <span className={`${cellClassName}__mobile-created-date`}>{dateText}</span>\n                </div>\n            </td>\n            <td>\n                <Button\n                    className={`${cellClassName}__view-details-button`}\n                    href={linkToOrderHistoryDetails}\n                    title={props.resources.orderHistoryViewDetailsButtonText}\n                    aria-label={props.resources.orderHistoryViewDetailsButtonAriaLabel}\n                >\n                    {props.resources.orderHistoryViewDetailsButtonText}\n                </Button>\n            </td>\n        </>\n    );\n};\n\n/**\n * Renders order history rows.\n * @param props - Configuration for the rows.\n * @returns A react node with a list of order history rows.\n */\nexport const OrderHistoryTableRowComponent: React.FC<IOrderHistoryTableRowProps> = (props: IOrderHistoryTableRowProps) => {\n    const isMobileView = isMobile({ variant: VariantType.Viewport, context: props.context.request }) === 'xs';\n\n    return (\n        <tr className={props.className}>\n            {isMobileView ? (\n                <OrderHistoryMobileTableRowCellComponent {...props} />\n            ) : (\n                <OrderHistoryDesktopTableRowCellComponent {...props} />\n            )}\n        </tr>\n    );\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IComponentProps, ICoreContext } from '@msdyn365-commerce/core';\nimport { ChannelIdentity, Customer, OrderOriginator, OrgUnitLocation } from '@msdyn365-commerce/retail-proxy';\nimport React from 'react';\n\nimport { IOrderHistory } from '../../actions/get-order-shipment-history';\nimport { IOrderHistoryTableHeaderResources, OrderHistoryTableHeaderComponent } from './components/order-history-table-header-component';\nimport { IOrderHistoryTableRowResources, OrderHistoryTableRowComponent } from './components/order-history-table-row-component';\n\n/**\n * Interface with the data required for order history.\n */\nexport interface IOrderHistoryTableData {\n    orderHistory: IOrderHistory;\n    channelIdentities?: ChannelIdentity[];\n    orgUnitLocations?: OrgUnitLocation[];\n    customer?: Customer;\n    originators?: OrderOriginator[];\n}\n\n/**\n * Resources needed to render order history table.\n */\nexport interface IOrderHistoryTableResources extends IOrderHistoryTableHeaderResources, IOrderHistoryTableRowResources {}\n\n/**\n * Configuration of order history table.\n */\nexport interface IOrderHistoryTableProps extends IComponentProps<IOrderHistoryTableData> {\n    context: ICoreContext;\n    className: string;\n\n    resources: IOrderHistoryTableResources;\n\n    shouldShowChannelInfo: boolean;\n    shouldShowOrderPlacedBy?: boolean;\n}\n\n/**\n * Renders order history table.\n * @param props - Configuration for order history table.\n * @returns React node with the table.\n */\nexport const OrderHistoryTableComponent: React.FC<IOrderHistoryTableProps> = (props: IOrderHistoryTableProps) => {\n    const rowClassName = `${props.className}__row`;\n    const headerClassName = `${props.className}__header`;\n\n    return (\n        <table className={props.className}>\n            <OrderHistoryTableHeaderComponent\n                context={props.context}\n                typeName={props.typeName}\n                id={headerClassName}\n                className={headerClassName}\n                resources={props.resources}\n                data={{}}\n                shouldShowChannelInfo={props.shouldShowChannelInfo}\n                shouldShowOrderPlacedBy={props.shouldShowOrderPlacedBy}\n            />\n            {props.data.orderHistory.salesOrders.map((salesOrder, index) => {\n                return (\n                    <OrderHistoryTableRowComponent\n                        context={props.context}\n                        typeName={props.typeName}\n                        id={`${rowClassName}-${index}`}\n                        key={salesOrder.SalesId}\n                        className={rowClassName}\n                        resources={props.resources}\n                        data={{\n                            salesOrder,\n                            channelIdentities: props.data.channelIdentities,\n                            orgUnitLocations: props.data.orgUnitLocations,\n                            customer: props.data.customer,\n                            originator: props.data.originators?.find(\n                                o =>\n                                    (salesOrder.SalesId && o.SalesId === salesOrder.SalesId) ||\n                                    (salesOrder.TransactionId && o.TransactionId === salesOrder.TransactionId)\n                            )\n                        }}\n                        shouldShowChannelInfo={props.shouldShowChannelInfo}\n                        shouldShowOrderPlacedBy={props.shouldShowOrderPlacedBy}\n                    />\n                );\n            })}\n        </table>\n    );\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport {\n    Button,\n    getPayloadObject,\n    getTelemetryAttributes,\n    getTelemetryObject,\n    IModuleProps,\n    INodeProps,\n    IPayLoad,\n    ITelemetryContent,\n    TelemetryConstant\n} from '@msdyn365-commerce-modules/utilities';\nimport classname from 'classnames';\nimport { observable } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { OrderOriginator, OrderShipments } from '@msdyn365-commerce/retail-proxy';\nimport { Label } from '../../common/label';\nimport {\n    getSalesOrderHistoryWithHydrationsAction,\n    GetSalesOrderHistoryWithHydrationsInput,\n    IOrderHistory,\n    IPaging\n} from './actions/get-order-shipment-history';\nimport { getOriginatorsAction, GetOrderOriginatorsInput } from '../../actions/get-sales-order-originators';\nimport { getSalesOrder, ISalesOrder } from './components/get-sales-order';\nimport { OrderHistoryFilterComponent, OrderHistoryFilterState } from './components/order-history-filter';\nimport { OrderHistoryTableComponent } from './components/table-view';\nimport { IOrderHistoryData } from './order-history.data';\nimport { IOrderHistoryProps } from './order-history.props.autogenerated';\n\n/**\n * Specifies different layouts for order history.\n */\nexport enum OrderHistoryViewMode {\n    listView = 0,\n    detailedView = 1\n}\n\nexport interface IHeader {\n    headerProps: INodeProps;\n    heading: React.ReactNode;\n    orderCountLabel?: React.ReactNode;\n    extraActions?: React.ReactNode;\n}\n\nexport interface IList {\n    listProps: INodeProps;\n    salesOrders: ISalesOrder[];\n}\n\nexport interface IOrderHistoryViewState {\n    isDataReady: boolean;\n    hasError: boolean;\n    isLoading: boolean;\n    isShowMoreButton: boolean;\n    errorCode?: string;\n    errorMessage?: string;\n}\n\nexport interface IOrderHistoryViewProps extends IOrderHistoryProps<IOrderHistoryData> {\n    orderHistory: IOrderHistory;\n    orderHistoryProps: IModuleProps;\n    alert?: React.ReactNode;\n    loading?: React.ReactNode;\n    emptyMessage?: React.ReactNode;\n    header: IHeader;\n    backToShoppingLink?: React.ReactNode;\n    list?: IList;\n    table?: React.ReactNode;\n    moreButton?: React.ReactNode;\n    viewState: IOrderHistoryViewState;\n}\n\n/**\n *\n * OrderHistory component.\n * @extends {React.Component<IOrderHistoryProps<IOrderHistoryData>>}\n */\n@observer\nclass OrderHistory extends React.Component<IOrderHistoryProps<IOrderHistoryData>> {\n    @observable private orderHistory!: IOrderHistory;\n\n    @observable private viewState!: IOrderHistoryViewState;\n\n    @observable private _viewMode: OrderHistoryViewMode;\n\n    private originatorList!: OrderOriginator[];\n\n    private filterState: OrderHistoryFilterState;\n\n    private pageSize!: number;\n\n    private paging!: IPaging;\n\n    private readonly telemetryContent?: ITelemetryContent;\n\n    private readonly payLoad: IPayLoad;\n\n    constructor(props: IOrderHistoryProps<IOrderHistoryData>) {\n        super(props);\n        this.initState();\n        this._viewMode = OrderHistoryViewMode.detailedView;\n        this.filterState = OrderHistoryFilterState.CurrentUser;\n        this.telemetryContent = getTelemetryObject(\n            this.props.context.request.telemetryPageName!,\n            this.props.friendlyName,\n            this.props.telemetry\n        );\n        this.payLoad = getPayloadObject('click', this.telemetryContent, '');\n    }\n\n    public componentDidMount(): void {\n        if (this.props.context.actionContext.requestContext.user.isAuthenticated) {\n            this._updateOrderHistory();\n        } else {\n            this.viewState.isDataReady = true;\n        }\n    }\n\n    public shouldComponentUpdate(nextProps: IOrderHistoryProps<IOrderHistoryData>, nextState: IOrderHistoryViewState): boolean {\n        if (this.state === nextState && this.props.data === nextProps.data) {\n            return false;\n        }\n        return true;\n    }\n\n    public render(): JSX.Element {\n        const {\n            config: { heading, className, showChannelInfo, shouldShowCount },\n            resources: {\n                genericErrorMessage,\n                noOrderHistoryLable,\n                moreButtonText,\n                backToShopping,\n                orderCountLabel,\n                ordersCountLabel,\n                loadingLabel\n            }\n        } = this.props;\n        const { salesOrders, products } = this.orderHistory;\n        const { isDataReady, hasError, isShowMoreButton, isLoading } = this.viewState;\n        const backToShoppingUrl = Msdyn365.getUrlSync('home', this.props.context.actionContext) || '';\n        const channelIdentities = this.props.data.channels.result && this.props.data.channels.result.channelIdentities;\n        const orgUnitLocations = this.props.data.orgUnitLocations.result && this.props.data.orgUnitLocations.result.orgUnitLocations;\n        const customer = this.props.data.customerInformation && this.props.data.customerInformation.result;\n\n        let viewProps: IOrderHistoryViewProps = {\n            ...this.props,\n            orderHistory: this.orderHistory,\n            viewState: this.viewState,\n            orderHistoryProps: {\n                moduleProps: this.props,\n                className: classname('ms-order-history', className)\n            },\n            header: {\n                headerProps: { className: 'ms-order-history__header' },\n                heading: heading && heading.text && (\n                    <Msdyn365.Text\n                        {...heading}\n                        className='ms-order-history__heading'\n                        text={heading.text}\n                        tag={heading.tag || 'h2'}\n                        editProps={{ onEdit: this.handleOrderHistoryHeadingChange, requestContext: this.props.context.request }}\n                    />\n                ),\n                extraActions: this.renderExtraActions()\n            },\n            backToShoppingLink: backToShoppingUrl && (\n                <Button className='ms-order-history__btn-keep-shopping' href={backToShoppingUrl}>\n                    {backToShopping}\n                </Button>\n            )\n        };\n\n        if (hasError) {\n            viewProps = {\n                ...viewProps,\n                alert: <Label className='ms-order-history__alert' label={genericErrorMessage} />\n            };\n            return this.props.renderView(viewProps) as React.ReactElement;\n        }\n\n        if (!isDataReady) {\n            viewProps = {\n                ...viewProps,\n                loading: <Label className='ms-order-history__loading' label={loadingLabel} />\n            };\n            return this.props.renderView(viewProps) as React.ReactElement;\n        }\n\n        if (!salesOrders || salesOrders.length === 0) {\n            if (this.viewState.errorCode === 'Microsoft_Dynamics_Commerce_Runtime_AuthorizationFailed') {\n                viewProps = {\n                    ...viewProps,\n                    emptyMessage: <p className='ms-order-history__empty-message'>{this.viewState.errorMessage}</p>\n                };\n            } else {\n                viewProps = {\n                    ...viewProps,\n                    emptyMessage: <p className='ms-order-history__empty-message'>{noOrderHistoryLable}</p>\n                };\n            }\n\n            return this.props.renderView(viewProps) as React.ReactElement;\n        }\n\n        const _orderCountLabel = salesOrders.length === 1 ? orderCountLabel : ordersCountLabel;\n        this.payLoad.contentAction.etext = TelemetryConstant.ViewMore;\n        const viewMoreAttributes = getTelemetryAttributes(this.telemetryContent!, this.payLoad);\n\n        const productsDetailedViewLimit = 5;\n\n        viewProps = {\n            ...viewProps,\n            header: {\n                ...viewProps.header,\n                orderCountLabel: shouldShowCount ? (\n                    <span className='ms-order-history__order-count'>{`(${salesOrders.length} ${_orderCountLabel})`}</span>\n                ) : (\n                    undefined\n                ),\n                extraActions: this.renderExtraActions()\n            },\n            table:\n                this._viewMode === OrderHistoryViewMode.listView ? (\n                    <OrderHistoryTableComponent\n                        id={this.props.id}\n                        typeName={this.props.typeName}\n                        context={this.props.context}\n                        className='ms-order-history__table-list'\n                        shouldShowChannelInfo={this.props.config.showChannelInfo ?? false}\n                        shouldShowOrderPlacedBy={Msdyn365.isChannelTypeB2B(this.props.context.request) ?? false}\n                        data={{\n                            orderHistory: this.orderHistory,\n                            channelIdentities,\n                            orgUnitLocations,\n                            customer,\n                            originators: this.originatorList\n                        }}\n                        resources={this.props.resources}\n                    />\n                ) : (\n                    undefined\n                ),\n            list:\n                this._viewMode === OrderHistoryViewMode.detailedView\n                    ? {\n                          listProps: { className: 'ms-order-history__sales-order-list' },\n                          salesOrders: salesOrders.map(salesOrder =>\n                              getSalesOrder({\n                                  ...this.props,\n                                  products,\n                                  salesOrder,\n                                  channelIdentities,\n                                  orgUnitLocations,\n                                  showChannelInfo,\n                                  customer,\n                                  originator: this.originatorList.find(\n                                      o =>\n                                          (salesOrder.SalesId && o.SalesId === salesOrder.SalesId) ||\n                                          (salesOrder.TransactionId && o.TransactionId === salesOrder.TransactionId)\n                                  ),\n                                  salesLinesLimit: productsDetailedViewLimit,\n                                  telemetryContent: this.telemetryContent\n                              })\n                          )\n                      }\n                    : undefined,\n            moreButton: isShowMoreButton && (\n                <Button\n                    className={`ms-order-history__btn-more ${isLoading ? 'is-busy' : ''}`}\n                    {...viewMoreAttributes}\n                    disabled={isLoading}\n                    onClick={this.onMoreButtonClick}\n                >\n                    {moreButtonText}\n                </Button>\n            )\n        };\n\n        return this.props.renderView(viewProps) as React.ReactElement;\n    }\n\n    public handleOrderHistoryHeadingChange = (event: Msdyn365.ContentEditableEvent) =>\n        (this.props.config.heading!.text = event.target.value);\n\n    private readonly onMoreButtonClick = () => {\n        this.getOrderHistory();\n    };\n\n    private readonly renderExtraActions = () => {\n        return (\n            <>\n                {this._renderOrderHistoryFilter()}\n                {this._renderViewModes()}\n            </>\n        );\n    };\n\n    /**\n     * Renders a filter for order history.\n     * @returns A react node or undefined if customer info is not ready.\n     */\n    private readonly _renderOrderHistoryFilter = () => {\n        return (\n            this.props.data.customerInformation &&\n            this.props.data.customerInformation.result && (\n                <OrderHistoryFilterComponent\n                    id={this.props.id}\n                    typeName={this.props.typeName}\n                    context={this.props.context}\n                    className='ms-order-history__ms-order-history-filter'\n                    resources={this.props.resources}\n                    data={{ customerInformation: this.props.data.customerInformation.result }}\n                    currentState={this.filterState}\n                    onFilterStateChanged={this.onFilterStateChanged}\n                />\n            )\n        );\n    };\n\n    /**\n     * Renders view mode switches for order history.\n     * @returns A react node.\n     */\n    private readonly _renderViewModes = () => {\n        if (!this.props.config.isGridViewEnabled) {\n            return null;\n        }\n\n        const viewModesClassName = 'ms-order-history__ms-order-history-view-modes';\n        return (\n            <div className={viewModesClassName}>\n                <Button\n                    className={classname(\n                        `${viewModesClassName}__detailed-view`,\n                        this._viewMode === OrderHistoryViewMode.detailedView ? 'msc-view-modes__selected' : ''\n                    )}\n                    title={this.props.resources.orderHistoryDetailedViewModeAriaLabel}\n                    aria-label={this.props.resources.orderHistoryDetailedViewModeAriaLabel}\n                    role='button'\n                    onClick={this._setDetailedViewMode}\n                />\n                <Button\n                    className={classname(\n                        `${viewModesClassName}__list-view`,\n                        this._viewMode === OrderHistoryViewMode.listView ? 'msc-view-modes__selected' : ''\n                    )}\n                    title={this.props.resources.orderHistoryListViewModeAriaLabel}\n                    aria-label={this.props.resources.orderHistoryListViewModeAriaLabel}\n                    role='button'\n                    onClick={this._setListViewMode}\n                />\n            </div>\n        );\n    };\n\n    private readonly initState = () => {\n        this.orderHistory = {\n            salesOrders: [],\n            products: [],\n            nextPageToken: ''\n        };\n        this.originatorList = [];\n        this.viewState = {\n            isDataReady: false,\n            hasError: false,\n            isShowMoreButton: (this.props.config.pageSize || 0) > 0,\n            isLoading: false,\n            errorCode: '',\n            errorMessage: ''\n        };\n        this.pageSize = this.props.config.pageSize || 10;\n        this.paging = {\n            top: this.pageSize,\n            skip: 0\n        };\n    };\n\n    /**\n     * Updates view mode to be list view.\n     */\n    private readonly _setListViewMode = () => {\n        this._viewMode = OrderHistoryViewMode.listView;\n    };\n\n    /**\n     * Updates view mode to be detailed view.\n     */\n    private readonly _setDetailedViewMode = () => {\n        this._viewMode = OrderHistoryViewMode.detailedView;\n    };\n\n    private readonly onFilterStateChanged = (state: OrderHistoryFilterState) => {\n        this.initState();\n        this.filterState = state;\n        this._updateOrderHistory();\n    };\n\n    /**\n     * Retrieves the data and updates the view state.\n     */\n    private readonly _updateOrderHistory = () => {\n        this.getOrderHistory()\n            .then(() => {\n                this.viewState.isDataReady = true;\n            })\n            .catch(() => {\n                this.viewState.hasError = true;\n            });\n    };\n\n    private readonly getOriginator = async (salesOrders: OrderShipments[]): Promise<void> => {\n        if (Msdyn365.isUserTypeB2B(this.props.context.request)) {\n            const actionContext = this.props.context.actionContext;\n            let result: OrderOriginator[] | undefined;\n            try {\n                const salesIds = salesOrders.map(order => order.SalesId ?? '').filter(id => id !== '');\n                const transactionIds = salesOrders.map(order => order.TransactionId ?? '').filter(id => id !== '');\n                const originatorsInput = new GetOrderOriginatorsInput(transactionIds, salesIds, this.props.context.request.apiSettings);\n                result = await getOriginatorsAction(originatorsInput, actionContext);\n            } catch (error) {\n                result = undefined;\n            }\n            if (result) {\n                this.originatorList.push(...result);\n            }\n        }\n    };\n\n    private readonly getOrderHistory = async (): Promise<void> => {\n        const actionContext = this.props.context.actionContext;\n        const input = new GetSalesOrderHistoryWithHydrationsInput(\n            this.paging,\n            this.props.context.request.apiSettings,\n            this.filterState,\n            this.orderHistory.nextPageToken\n        );\n\n        try {\n            this.viewState.isLoading = true;\n            const response = await getSalesOrderHistoryWithHydrationsAction(input, actionContext);\n            if (response) {\n                const { products, salesOrders } = response;\n                this.orderHistory.products.push(...products);\n                this.orderHistory.salesOrders.push(...salesOrders);\n                this.viewState.isShowMoreButton =\n                    this.viewState.isShowMoreButton && response.salesOrders.length > 0 && response.salesOrders.length === this.pageSize;\n                this.paging.skip += this.pageSize;\n                this.orderHistory.nextPageToken = response.nextPageToken;\n                await this.getOriginator(salesOrders);\n            }\n            this.viewState.isLoading = false;\n\n            await Promise.resolve();\n            return;\n        } catch (error) {\n            this.viewState.isLoading = false;\n\n            if (error?.error?.name === 'Microsoft_Dynamics_Commerce_Runtime_AuthorizationFailed') {\n                this.viewState.errorCode = 'Microsoft_Dynamics_Commerce_Runtime_AuthorizationFailed';\n                this.viewState.errorMessage = error.error?.name;\n                return Promise.reject();\n            }\n\n            return Promise.reject();\n        }\n    };\n}\n\nexport default OrderHistory;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IGroup, IGroupDelivery, IGroups } from '../../common/get-groups';\nimport { IOrderInformation } from '../../common/get-order-information';\nimport { ISalesLine } from '../../common/get-sales-line';\nimport { ISalesOrder } from './components/get-sales-order';\nimport { IHeader, IList, IOrderHistoryViewProps } from './order-history';\n\nexport const OrderHistoryOrderInfomation: React.FC<IOrderInformation> = ({\n    orderInformationProps,\n    salesId,\n    receiptId,\n    channelName,\n    createdDate,\n    count,\n    amount,\n    channelReferenceId\n}) => (\n    <Node {...orderInformationProps}>\n        {channelName}\n        {salesId}\n        {receiptId}\n        {createdDate}\n        {count}\n        {amount}\n        {channelReferenceId}\n    </Node>\n);\n\nexport const OrderHistoryGroupDelivery: React.FC<IGroupDelivery> = ({\n    deliveryProps,\n    heading,\n    count,\n    processing,\n    address,\n    trackingInfo\n}) => (\n    <Node {...deliveryProps}>\n        {heading}\n        {count}\n        {processing}\n        {address}\n        {trackingInfo}\n    </Node>\n);\n\nexport const OrderHistoryGroup: React.FC<IGroup> = ({ groupProps, delivery, salesLinesProps, salesLines }) => (\n    <Node {...groupProps}>\n        {delivery && <OrderHistoryGroupDelivery {...delivery} />}\n        {salesLines && (\n            <Node {...salesLinesProps}>\n                {salesLines.map((salesLine: ISalesLine) => (\n                    <React.Fragment key={salesLine.data.salesLine.LineId}>{salesLine.salesLine}</React.Fragment>\n                ))}\n            </Node>\n        )}\n    </Node>\n);\n\nexport const OrderHistoryGroups: React.FC<IGroups> = ({ groupsProps, groups }) => (\n    <Node {...groupsProps}>\n        {groups.map((group: IGroup, index: number) => (\n            <OrderHistoryGroup key={index} {...group} />\n        ))}\n    </Node>\n);\n\nexport const OrderHistoryHeader: React.FC<IHeader> = ({ headerProps, heading, orderCountLabel, extraActions }) => (\n    <Node {...headerProps}>\n        {heading}\n        {orderCountLabel}\n        {extraActions}\n    </Node>\n);\n\nexport const OrderHistorySalesOder: React.FC<ISalesOrder> = ({\n    salesOrderProps,\n    orderInfomation,\n    groups,\n    orderDetailsLink,\n    expandProductsButton\n}) => (\n    <Node {...salesOrderProps}>\n        {orderInfomation && <OrderHistoryOrderInfomation {...orderInfomation} />}\n        {groups && <OrderHistoryGroups {...groups} />}\n        {expandProductsButton}\n        {orderDetailsLink}\n    </Node>\n);\n\nexport const OrderHistoryList: React.FC<IList> = ({ listProps, salesOrders }) => (\n    <Node {...listProps}>\n        {salesOrders && salesOrders.map((salesOrder: ISalesOrder, index: number) => <OrderHistorySalesOder key={index} {...salesOrder} />)}\n    </Node>\n);\n\nconst OrderHistoryView: React.FC<IOrderHistoryViewProps> = ({\n    orderHistoryProps,\n    header,\n    alert,\n    loading,\n    emptyMessage,\n    backToShoppingLink,\n    list,\n    table,\n    moreButton\n}) => (\n    <Module {...orderHistoryProps}>\n        {header && <OrderHistoryHeader {...header} />}\n        {loading}\n        {alert && (\n            <>\n                {alert}\n                {backToShoppingLink}\n            </>\n        )}\n        {emptyMessage && (\n            <>\n                {emptyMessage}\n                {backToShoppingLink}\n            </>\n        )}\n        {list && <OrderHistoryList {...list} />}\n        {table}\n        {moreButton && moreButton}\n    </Module>\n);\n\nexport default OrderHistoryView;\n"],"names":["GetSalesOrderHistoryWithHydrationsInput","constructor","paging","apiSettings","filterState","nextPageLink","getCacheKey","buildCacheKey","this","getCacheObjectType","dataCacheType","OrderHistoryFilterState","CurrentUser","nextPageToken","async","getSalesOrderHistoryWithHydrationsAction","input","context","Error","channelId","requestContext","orderHistoryResponse","salesOrders","nextPage","_orderHistoryResults$","orderHistoryResults","getOrderShipmentsHistoryAsync","callerContext","ctx","bypassCache","queryResultSettings","Paging","Top","top","NextPageToken","nextLinkUrl","metadata","others","nextLink","undefined","URL","searchParams","get","OrganizationWide","getOrganizationWideOrderShipmentHistory","_orgOrderHistoryResul","queryResultSetting","Skip","skip","orgOrderHistoryResults","getOrganizationWideOrderHistory","GetOrganizationWideOrderHistoryInput","orgOrderHistoryResponse","getOrderShipmentHistory","map","salesOrder","_salesOrder$SalesLine2","SalesLines","filter","saleline","IsVoided","length","products","productIdsByChannelId","splitProductsByChannelId","currentChannelId","productIdsByChannel","forEach","_salesOrder$SalesLine","line","orderProductId","ProductId","orderChannelId","ChannelId","push","getProductsPromise","Object","entries","_ref","entryChannelId","entryProductIdsList","productIds","arguments","productInputs","productId","ProductInput","getSimpleProducts","getProducts","Number","getProductsCall","Promise","all","then","productList","reduce","memo","list","catch","error","telemetry","exception","debug","createObservableDataAction","id","action","getOrderDetailsPageUrl","actionContext","orderDetailsUrl","getUrlSync","separator","includes","SalesId","TransactionId","onExpandProductsCallback","expandButtonState","productStates","productState","isHidden","extraProductsCount","getSalesOrder","typeName","showChannelInfo","channelIdentities","orgUnitLocations","customer","originator","telemetryContent","resources","freePriceText","detailsAriaLabel","detailsLabel","orderItemLabel","orderItemsLabel","retailMultiplePickUpOptionEnabled","channelDeliveryOptionConfig","moduleName","priceContext","salesOrderProps","className","key","orderInfomationInput","getOrderInformationInput","orderInfomation","getOrderInformation","salesLinesInput","getSalesLinesInput","salesLines","expandProductsButton","getSalesLinesInputProps","_objectSpread","imageOnly","ObjectExtensions","isNullOrUndefined","salesLinesLimit","salesLineStates","salesLine","index","_salesLine$LineId","SalesLineState","LineId","ExpandButtonState","React","Observer","text","format","orderHistoryExpandProductsButtonText","Button","title","role","onClick","getSalesLines","payLoad","getPayloadObject","TelemetryConstant","OrderDetails","orderDetailsAttributes","getTelemetryAttributes","groups","getGroups","orderDetailsLink","assign","href","ChannelReferenceId","replace","getOrderHistoryFilterStateResources","orderHistoryFilterYourOrderHistory","orderHistoryFilterOrganizationWide","onClickHandler","onStateClick","togglePopoverHandler","setPopoverState","isPopoverState","OrderHistoryFilterComponent","msdyn365Commerce","createComponent","component","props","data","customerInformation","IsB2bAdmin","popoverRef","popoverState","setFilterState","currentState","onFilterStateClick","clickedState","onFilterStateChanged","innerRef","Popover","placement","isOpen","target","toggle","EnumExtensions","getEnumValues","state","renderFilterStateItem","stateStringRepresentation","OrderHistoryTableHeaderComponent","rowClassName","headerCells","isMobile","variant","VariantType","Viewport","request","orderHistoryOrderNumberText","getMobileHeaderCells","columnWithNumberClassName","shouldShowOrderPlacedBy","orderPlacedByFullText","orderHistoryCreatedDateText","orderHistoryItemsText","orderHistoryTotalText","shouldShowChannelInfo","orderHistoryOriginText","getDesktopHeaderCells","formatDate","date","cultureFormatter","year","month","day","getShortEllipsisText","originalText","maxTextLength","_document$body$parent","isRtl","document","body","parentElement","getAttribute","substring","OrderHistoryDesktopTableRowCellComponent","orderPlacedByYouText","orderOnBehalfOfText","linkToOrderHistoryDetails","itemsCount","ArrayExtensions","hasElements","countItems","channelName","getOrderChannelName","channelAddress","getOrderChannelAddress","channelTypeValue","getOrderChannelTypeValue","isOnlineStore","isOnlineStoreChannel","orderNumberCellText","orderHistoryOrderNumberIsNotAvailable","StringExtensions","isNullOrWhitespace","isYou","isOboRequest","CustomerId","CustomerName","StaffId","StaffName","AccountNumber","isYouObo","placedByName","isOnBehalfOfOrder","Name","maxOrderTextLength","window","innerWidth","placedByText","onBehalfOfText","CreatedDateTime","amount","TotalAmount","currencyCode","CurrencyCode","formatCurrency","posChannelNameText","onlineStoreChannelNameText","orderHistoryViewDetailsButtonText","orderHistoryViewDetailsButtonAriaLabel","formatAmount","OrderHistoryMobileTableRowCellComponent","onClickViewDetails","MsDyn365","isBrowser","location","orderNumber","dateText","orderHistoryCreatedDateMobileDescriptionText","cellClassName","onKeyPress","tabIndex","OrderHistoryTableRowComponent","isMobileView","OrderHistoryTableComponent","headerClassName","orderHistory","_props$data$originato","originators","find","o","OrderHistoryViewMode","OrderHistory","super","handleOrderHistoryHeadingChange","event","config","heading","value","onMoreButtonClick","getOrderHistory","renderExtraActions","_renderOrderHistoryFilter","_renderViewModes","result","isGridViewEnabled","viewModesClassName","classname","_viewMode","detailedView","orderHistoryDetailedViewModeAriaLabel","_setDetailedViewMode","listView","orderHistoryListViewModeAriaLabel","_setListViewMode","initState","originatorList","viewState","isDataReady","hasError","isShowMoreButton","pageSize","isLoading","errorCode","errorMessage","_updateOrderHistory","getOriginator","Msdyn365","salesIds","order","_order$SalesId","transactionIds","_order$TransactionId","originatorsInput","GetOrderOriginatorsInput","getOriginatorsAction","response","resolve","_error$error","_error$error2","name","reject","getTelemetryObject","telemetryPageName","friendlyName","componentDidMount","user","isAuthenticated","shouldComponentUpdate","nextProps","nextState","render","_this$props$config$sh","_Msdyn365$isChannelTy","shouldShowCount","genericErrorMessage","noOrderHistoryLable","moreButtonText","backToShopping","orderCountLabel","ordersCountLabel","loadingLabel","backToShoppingUrl","channels","viewProps","orderHistoryProps","moduleProps","header","headerProps","tag","editProps","onEdit","extraActions","backToShoppingLink","alert","Label","label","renderView","loading","emptyMessage","_orderCountLabel","contentAction","etext","ViewMore","viewMoreAttributes","table","listProps","moreButton","disabled","__decorate","observable","observer","OrderHistoryOrderInfomation","orderInformationProps","salesId","receiptId","createdDate","count","channelReferenceId","Node","OrderHistoryGroupDelivery","_ref2","deliveryProps","processing","address","trackingInfo","OrderHistoryGroup","_ref3","groupProps","delivery","salesLinesProps","OrderHistoryGroups","_ref4","groupsProps","group","OrderHistoryHeader","_ref5","OrderHistorySalesOder","_ref6","OrderHistoryList","_ref7","_ref8","Module"],"sourceRoot":""}