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IAMhGJ,EAAQC,QAAQ,oBAAsB,CACnCQ,EAAGA,IAAMC,EAAQ,MACjBC,MAAO,gBACPC,GAAI,CAAC,CAACC,KAAK,uBAAyBC,KAAK,2DAA4DC,MAAO,GAAG,CAACF,KAAK,oBAAsBC,KAAK,wCAAyCC,MAAO,GAAG,CAACF,KAAK,uBAAyBC,KAAK,2DAA4DC,MAAO,GAAG,CAACF,KAAK,gBAAkBC,KAAK,2CAA4CC,MAAO,IAE7XC,KAAK,EACLC,GAAI,YACJC,EAAG,mBACHC,EAAG,YAEHC,IAAK,GAGLC,GAAI,gCAOAlB,EAF4B,wCACXO,EAAQ,MAQzBP,EAF4B,2CACXO,EAAQ,MAQzBP,EAF4B,2DACXO,EAAQ,MAQzBP,EAF4B,2DACXO,EAAQ,KAMjCrH,OAAOiI,aAAejI,OAAOiI,cAAgB,GAC7CjI,OAAOiI,aAAarB,QAAOhK,EAAAA,EAAA,GACpBoD,OAAOiI,aAAarB,SAAW,IAC/BD,EAAQC,SAGX5G,OAAOiI,aAAapB,YAAWjK,EAAAA,EAAA,GAC5BoD,OAAOiI,aAAapB,aAAe,IACnCF,EAAQE,aAEY,MAAMqB,EAAiB,GAC9BA,EAAe,iEAAmE,CAC1Fd,EAAGA,IAAMC,EAAQ,MACjBc,GAAI,wCAEpBnI,OAAOiI,aAAejI,OAAOiI,cAAgB,GAC7CjI,OAAOiI,aAAaC,eAActL,EAAAA,EAAA,GACPoD,OAAOiI,aAAaC,gBAAkB,IACtCA,UCxG3BE,EAAOC,QAAU9N,cCAjB6N,EAAOC,QAAUC","sources":["webpack://Msdyn365.Commerce.Online.Memx/./src/actions/get-product-default-variant.action.ts?4082","webpack://Msdyn365.Commerce.Online.Memx/./src/actions/get-product-warranties.action.ts?94d8","webpack://Msdyn365.Commerce.Online.Memx/./src/actions/get-product-warranty-icon.action.ts?d623","webpack://Msdyn365.Commerce.Online.Memx/./src/actions/state-data-actions/product-quantity-state.action.ts?f54a","webpack://Msdyn365.Commerce.Online.Memx/./src/actions/state-data-actions/product-warranty-state.action.ts?49ae","webpack://Msdyn365.Commerce.Online.Memx/./src/modules/product-warranty/product-warranty.tsx?c8c9","webpack://Msdyn365.Commerce.Online.Memx/./src/modules/product-warranty/product-warranty.view.tsx?e002","webpack://Msdyn365.Commerce.Online.Memx/./src/modules/mmx-store-selector/state-manager/base-store-selector-state-manager.ts?fa5d","webpack://Msdyn365.Commerce.Online.Memx/./src/modules/mmx-store-selector/state-manager/map-store-selector-state-manager.ts?a944","webpack://Msdyn365.Commerce.Online.Memx/./src/utilities/utils.ts?6402","webpack://Msdyn365.Commerce.Online.Memx/./lib/product-warranty/module-registration.js?65ec","webpack://Msdyn365.Commerce.Online.Memx/external var \"React\"?0d3b","webpack://Msdyn365.Commerce.Online.Memx/external var \"ReactDOM\"?853b"],"sourcesContent":["import {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n ICreateActionContext,\r\n IActionContext,\r\n IActionInput,\r\n IGeneric,\r\n IAny\r\n} from '@msdyn365-commerce/core';\r\nimport { getProductDefaultVariantsAsync } from './DataActionExtension.g';\r\nimport { IProductDefaultVariant } from './DataServiceEntities.g';\r\nimport { getSelectedProductIdFromActionInput } from '../utilities/utils';\r\n\r\n/*\r\n * Input class for the getProductDefaultVariant data action\r\n */\r\nexport class ProductDefaultVariantInput implements IActionInput {\r\n public productId: number;\r\n constructor(productId: number) {\r\n this.productId = productId;\r\n }\r\n public getCacheKey = () => `mmx-productdefaultvariant-${this.productId.toString()}`;\r\n public getCacheObjectType = () => 'IProductDefaultVariant';\r\n public dataCacheType = (): CacheType => 'application';\r\n}\r\n\r\n/**\r\n * Create input method for the getProductDefaultVariant data action.\r\n * @param inputData The input data passed to the createInput method.\r\n */\r\nexport const createProductDefaultVariantInput = (inputData: ICreateActionContext>): ProductDefaultVariantInput[] => {\r\n const productIds: string[] = [];\r\n const selectedId = getSelectedProductIdFromActionInput(inputData);\r\n if (selectedId) {\r\n productIds.push(selectedId);\r\n if (Array.isArray(productIds) && productIds.length > 0) {\r\n return productIds.map((productId: string) => {\r\n return new ProductDefaultVariantInput(+productId);\r\n });\r\n }\r\n }\r\n throw new Error('Unable to find product variant, no productId found on module config or query');\r\n};\r\n\r\n/**\r\n * Action method for the getProductDefaultVariant data action.\r\n * @param input\r\n * @param ctx\r\n */\r\nexport async function getProductDefaultVariantAction(\r\n input: ProductDefaultVariantInput[],\r\n ctx: IActionContext\r\n): Promise {\r\n const productIds = input.map((input: ProductDefaultVariantInput): number => {\r\n return input.productId;\r\n });\r\n return getProductDefaultVariantsAsync({ callerContext: ctx }, productIds).then((response: IProductDefaultVariant[]) => {\r\n return response;\r\n });\r\n}\r\n\r\n/**\r\n * The GetProductDefaultVariant data action\r\n * Finds product the default variants for given product masters via the RetailServer API.\r\n */\r\nexport default createObservableDataAction({\r\n id: 'get-product-default-variant',\r\n action: >getProductDefaultVariantAction,\r\n input: createProductDefaultVariantInput,\r\n isBatched: true\r\n});\r\n","import {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n ICreateActionContext,\r\n IActionContext,\r\n IActionInput,\r\n IGeneric,\r\n IAny\r\n} from '@msdyn365-commerce/core';\r\nimport { getProductWarrantiesAsync } from './DataActionExtension.g';\r\nimport { IProductWarranties, IProductDefaultVariant } from './DataServiceEntities.g';\r\nimport { getProductDefaultVariantAction, ProductDefaultVariantInput } from './get-product-default-variant.action';\r\nimport { getSelectedProductIdFromActionInput } from '../utilities/utils';\r\n\r\n/*\r\n * Input class for the getProductWarranties data action\r\n */\r\nexport class ProductWarrantiesInput implements IActionInput {\r\n public productId: number;\r\n constructor(productId: number) {\r\n this.productId = productId;\r\n }\r\n public getCacheKey = () => `mmx-productwarranties-${this.productId}`;\r\n public getCacheObjectType = () => 'IProductWarranties';\r\n public dataCacheType = (): CacheType => 'application';\r\n}\r\n\r\n/**\r\n * Create input method for the getProductWarranties data action.\r\n * @param inputData The input data passed to the createInput method.\r\n */\r\nexport const createProductWarrantiesInput = (inputData: ICreateActionContext>): ProductWarrantiesInput[] => {\r\n const productIds: string[] = [];\r\n const selectedId = getSelectedProductIdFromActionInput(inputData);\r\n if (selectedId) {\r\n productIds.push(selectedId);\r\n if (Array.isArray(productIds) && productIds.length > 0) {\r\n return productIds.map((productId: string) => {\r\n return new ProductWarrantiesInput(+productId);\r\n });\r\n }\r\n }\r\n throw new Error('Unable to find product warranties, no productId found on module config or query');\r\n};\r\n\r\n/**\r\n * Action method for the getProductWarranties data action.\r\n * @param inputs\r\n * @param ctx\r\n */\r\nexport async function getProductWarrantiesAction(input: ProductWarrantiesInput[], ctx: IActionContext): Promise {\r\n if (!Array.isArray(input) || input.length === 0) {\r\n ctx.telemetry.trace('[getProductWarranties] Invalid or empty input.');\r\n return {};\r\n }\r\n\r\n const productDefaultVariantInputs: ProductDefaultVariantInput[] = input.map(\r\n (input: ProductWarrantiesInput): ProductDefaultVariantInput => {\r\n return new ProductDefaultVariantInput(input.productId);\r\n }\r\n );\r\n\r\n return getProductDefaultVariantAction(productDefaultVariantInputs, ctx).then((response: IProductDefaultVariant[]) => {\r\n const defaultProductMasterIds: number[] = [];\r\n const defaultVariantIds: number[] = [];\r\n\r\n response.map(response => {\r\n defaultProductMasterIds.push(response.MasterId);\r\n defaultVariantIds.push(response.DefaultProductId);\r\n });\r\n\r\n // Product Ids not accounted for by the getProductDefaultVariantAction response\r\n const missingInputIds = input\r\n .filter(input => !defaultProductMasterIds.includes(input.productId))\r\n .map(input => {\r\n return input.productId;\r\n });\r\n\r\n const allProductIds = [...new Set([...defaultVariantIds, ...missingInputIds])];\r\n\r\n return getProductWarrantiesAsync({ callerContext: ctx }, allProductIds).then((response: IProductWarranties[]) => {\r\n return response;\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * The GetProductWarranties data action\r\n * Finds variants from product masters or uses\r\n * Then finds the applicable warranties via the getProductWarranties RetailServer API.\r\n */\r\nexport default createObservableDataAction({\r\n id: 'get-product-warranties',\r\n action: >getProductWarrantiesAction,\r\n input: createProductWarrantiesInput,\r\n isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { getWarrantyIconsAsync } from './DataActionExtension.g';\r\nimport { IWarrantyIcon } from './DataServiceEntities.g';\r\n\r\n/**\r\n * GetWarrantyIcon Input Action\r\n */\r\nexport class GetProductWarrantyIconInput implements Msdyn365.IActionInput {\r\n constructor() {}\r\n\r\n public getCacheKey = () => `mmx-productwarranty-icons`;\r\n public getCacheObjectType = () => 'IWarrantyIcon';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new GetProductWarrantyIconInput();\r\n};\r\n\r\nasync function action(input: GetProductWarrantyIconInput, ctx: Msdyn365.IActionContext): Promise {\r\n return getWarrantyIconsAsync({ callerContext: ctx });\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n id: 'GetWarrantyIcon',\r\n input: createInput\r\n});\r\n","import {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICreateActionContext,\r\n IGeneric\r\n} from '@msdyn365-commerce/core';\r\nimport { getSelectedProductIdFromActionInput } from '../../utilities/utils';\r\n\r\nexport class ProductQuantityStateInput implements IActionInput {\r\n public productId: number;\r\n\r\n constructor(productId: number) {\r\n this.productId = productId;\r\n }\r\n\r\n public getCacheKey = () => `ProductQuantityState-${this.productId}`;\r\n public getCacheObjectType = () => 'number';\r\n public dataCacheType = (): CacheType => 'instance';\r\n}\r\n\r\nexport async function ProductQuantityStateAction(input: ProductQuantityStateInput, ctx: IActionContext): Promise {\r\n return {};\r\n}\r\n\r\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n const selectedId = getSelectedProductIdFromActionInput(inputData);\r\n if (selectedId) {\r\n return new ProductQuantityStateInput(+selectedId);\r\n }\r\n throw new Error('Unable to find warranty disabled state, no productId found on module config or query');\r\n};\r\n\r\nexport default createObservableDataAction({\r\n action: >ProductQuantityStateAction,\r\n input: createInput\r\n});\r\n","import {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICreateActionContext,\r\n IGeneric\r\n} from '@msdyn365-commerce/core';\r\nimport { getSelectedProductIdFromActionInput } from '../../utilities/utils';\r\nimport { IWarrantyOption } from '../DataServiceEntities.g';\r\n\r\nexport class ProductWarrantyStateInput implements IActionInput {\r\n public productId: number;\r\n\r\n constructor(productId: number) {\r\n this.productId = productId;\r\n }\r\n\r\n public getCacheKey = () => `ProductWarrantyState-${this.productId}`;\r\n public getCacheObjectType = () => 'IWarrantyOption';\r\n public dataCacheType = (): CacheType => 'instance';\r\n}\r\n\r\nexport async function productWarrantyStateAction(input: ProductWarrantyStateInput, ctx: IActionContext): Promise {\r\n return {};\r\n}\r\n\r\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n const selectedId = getSelectedProductIdFromActionInput(inputData);\r\n if (selectedId) {\r\n return new ProductWarrantyStateInput(+selectedId);\r\n }\r\n throw new Error('Unable to find product warranty state, no productId found on module config or query');\r\n};\r\n\r\nexport default createObservableDataAction({\r\n action: >productWarrantyStateAction,\r\n input: createInput\r\n});\r\n","import * as React from 'react';\r\n\r\nimport { IModuleProps } from '@msdyn365-commerce-modules/utilities';\r\nimport { IWarrantyOption } from '../../actions/DataServiceEntities.g';\r\nimport { ProductWarrantyStateInput } from '../../actions/state-data-actions/product-warranty-state.action';\r\nimport { IProductWarrantyComponentProps } from '../../components/product-warranty/product-warranty.props';\r\nimport { IProductWarrantyData } from './product-warranty.data';\r\nimport { IProductWarrantyProps } from './product-warranty.props.autogenerated';\r\nimport classnames from 'classnames';\r\nimport { getSelectedProductIdFromActionInput } from '../../utilities/utils';\r\n\r\nexport interface IProductWarrantyViewProps extends IProductWarrantyProps {\r\n moduleProps: IModuleProps;\r\n productWarrantyComponentProps: IProductWarrantyComponentProps;\r\n}\r\n\r\nexport interface IProductWarrantyState {\r\n error: any;\r\n isLoaded: boolean | undefined;\r\n selectedWarrantyOption: IWarrantyOption | undefined;\r\n isSelectWarrantyDisabled: boolean | undefined;\r\n}\r\n\r\nexport interface IPropText {\r\n imageSrc: string;\r\n imageAltText: string;\r\n textTitle: string;\r\n textSubtitle: string;\r\n textNoSelection: string;\r\n textPriceBridge: string;\r\n textResource: string;\r\n}\r\n\r\n/**\r\n *\r\n * ProductWarranty component\r\n * @extends {React.PureComponent>}\r\n */\r\nclass ProductWarranty extends React.PureComponent, IProductWarrantyState> {\r\n constructor(props: IProductWarrantyProps) {\r\n super(props);\r\n this.state = {\r\n error: null,\r\n isLoaded: false,\r\n selectedWarrantyOption: undefined,\r\n isSelectWarrantyDisabled: false\r\n };\r\n this.formSubmit = this.formSubmit.bind(this);\r\n }\r\n\r\n public _setSelectedWarrantyOption = (selectedWarrantyOption: IWarrantyOption | undefined) => {\r\n this.setState({\r\n selectedWarrantyOption: selectedWarrantyOption\r\n });\r\n const productId =\r\n getSelectedProductIdFromActionInput(this.props.context.actionContext) ?? selectedWarrantyOption?.WarrantableProduct;\r\n if (productId) {\r\n this.props.context.actionContext.update(new ProductWarrantyStateInput(+productId), selectedWarrantyOption);\r\n }\r\n };\r\n\r\n public _setSelectWarrantyDisabled = (isDisabled: boolean) => {\r\n this.setState({\r\n isSelectWarrantyDisabled: isDisabled\r\n });\r\n };\r\n\r\n public formSubmit(event: { preventDefault: () => void }) {\r\n event.preventDefault();\r\n }\r\n\r\n public componentDidMount() {\r\n this.setState({\r\n isLoaded: true\r\n });\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const productQuantity = this.props?.data?.productQuantityState?.result;\r\n let selectWarrantyDisabled = this.state.isSelectWarrantyDisabled;\r\n if (\r\n this.props?.context?.app?.config?.disableWarrantyOnMultipleQuantityProducts &&\r\n this.props?.data?.productQuantityState?.result &&\r\n this.props?.data?.productQuantityState?.result > 1\r\n ) {\r\n selectWarrantyDisabled = true;\r\n }\r\n const props: IProductWarrantyViewProps = {\r\n ...this.props,\r\n moduleProps: {\r\n moduleProps: this.props,\r\n className: classnames('mmx-product-warranty-module', this.props.config.className)\r\n },\r\n productWarrantyComponentProps: {\r\n design: this.props.context.app.config.productWarrantySelectorDesign,\r\n className: 'mmx-product-warranty-module',\r\n productWarranties: this.props.data.productWarranties[0].result,\r\n warrantyIcons: this.props.data.warrantyIcons?.result,\r\n isSelectWarrantyDisabled: selectWarrantyDisabled,\r\n productQuantity: productQuantity,\r\n learnMoreLink: this.props.context.app.config.productWarrantyLearnMoreLink,\r\n onSelectWarrantyOption: this._setSelectedWarrantyOption\r\n }\r\n };\r\n return this.props.renderView(props) as React.ReactElement;\r\n }\r\n}\r\n\r\nexport default ProductWarranty;\r\n","import * as React from 'react';\r\nimport { ProductWarrantyComponent } from '../../components/product-warranty/product-warranty';\r\nimport { IProductWarrantyViewProps } from './product-warranty';\r\nimport { Module } from '@msdyn365-commerce-modules/utilities';\r\n\r\nexport default (props: IProductWarrantyViewProps) => {\r\n if (props.productWarrantyComponentProps.productWarranties) {\r\n return (\r\n \r\n \r\n \r\n );\r\n }\r\n return renderViewNoWarranties();\r\n};\r\n\r\nexport function renderViewNoWarranties(): JSX.Element | null {\r\n return
;\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport MsDyn365, { IActionContext } from '@msdyn365-commerce/core';\r\nimport { action, computed, observable } from 'mobx';\r\n\r\nimport {\r\n IListMapViewState,\r\n ILoadMapApiInput,\r\n IStoreInfo,\r\n IStoreSelectionStateContext,\r\n IStoreSelectorLocation,\r\n IStoreSelectorStateManager\r\n} from './i-store-selection-state-manager';\r\n\r\n/**\r\n * Abstract instance of IStoreSelectorStateManager with base implementation\r\n * of everything except the geoLocate function.\r\n */\r\nexport abstract class BaseStoreSelectorStateManager implements IStoreSelectorStateManager {\r\n @computed public get isDialogOpen(): Readonly {\r\n return this._context !== undefined;\r\n }\r\n\r\n @computed public get context(): Readonly {\r\n return this._context;\r\n }\r\n\r\n @observable public isMapApiLoaded?: boolean;\r\n\r\n @observable public selectedStoreLocationId?: string;\r\n\r\n @observable public preferredStore?: IStoreInfo;\r\n\r\n @observable public listMapViewState: IListMapViewState = { displayList: true, displayMap: false };\r\n\r\n @observable public isMapModuleLoaded?: boolean;\r\n\r\n @observable public lastInlineShownStoreInfo?: IStoreInfo;\r\n\r\n @observable protected _context?: IStoreSelectionStateContext;\r\n\r\n private readonly preferredStoreLocalStorageKey: string = '_msdyn365__preferredStore_';\r\n\r\n constructor() {\r\n this.isMapModuleLoaded = false;\r\n const value = this._readFromToCookie(this.preferredStoreLocalStorageKey);\r\n try {\r\n const storeInfo: IStoreInfo | undefined = value ? JSON.parse(value) : undefined;\r\n if (storeInfo) {\r\n this.preferredStore = storeInfo;\r\n }\r\n } catch {\r\n this.preferredStore = undefined;\r\n }\r\n }\r\n\r\n public abstract geoLocate(searchTerm: string, actionContext: IActionContext): Promise;\r\n\r\n public abstract loadMapApi(input: ILoadMapApiInput): Promise;\r\n\r\n @action\r\n public async toggleListMapViewState(): Promise {\r\n this.listMapViewState = {\r\n displayList: !this.listMapViewState.displayList,\r\n displayMap: !this.listMapViewState.displayMap\r\n };\r\n }\r\n\r\n @action\r\n public async setMapModuleLoaded(input: boolean): Promise {\r\n this.isMapModuleLoaded = input;\r\n }\r\n\r\n @action\r\n public async setOrgUnitStoreInformation(input: IStoreSelectionStateContext): Promise {\r\n this._context = input;\r\n }\r\n\r\n @action\r\n public async setSelectedStoreLocationId(storeId: string | undefined): Promise {\r\n this.selectedStoreLocationId = storeId;\r\n }\r\n\r\n @action\r\n public async setPreferredStoreLocation(\r\n storeId?: string,\r\n storeName?: string | undefined,\r\n writeToCookie: boolean = false,\r\n latitude?: number,\r\n longitude?: number\r\n ): Promise {\r\n const storeInfo: IStoreInfo = { StoreId: storeId, StoreName: storeName, Latitude: latitude, Longitude: longitude };\r\n this.preferredStore = storeInfo;\r\n if (writeToCookie) {\r\n this._writeToCookie(this.preferredStoreLocalStorageKey, JSON.stringify(storeInfo));\r\n }\r\n }\r\n\r\n @action\r\n public async setLastInlineStoreInfo(latitude?: number, longitude?: number): Promise {\r\n const storeInfo: IStoreInfo = { StoreId: '', StoreName: '', Latitude: latitude, Longitude: longitude };\r\n this.lastInlineShownStoreInfo = storeInfo;\r\n }\r\n\r\n @action\r\n public async clearPreferredStore(writeToCookie: boolean): Promise {\r\n this.preferredStore = undefined;\r\n if (writeToCookie) {\r\n this._removeCookie(this.preferredStoreLocalStorageKey);\r\n }\r\n }\r\n\r\n @action\r\n public async openDialog(input: IStoreSelectionStateContext): Promise {\r\n if (this._context && this._context.id === input.id) {\r\n throw new Error('Dialog is already opened');\r\n }\r\n\r\n this._context = input;\r\n }\r\n\r\n @action\r\n public async closeDialog(): Promise {\r\n this._context = undefined;\r\n }\r\n\r\n private _removeCookie(key: string): void {\r\n if (!key) {\r\n return;\r\n }\r\n if (MsDyn365.isBrowser) {\r\n const storage = window.localStorage;\r\n storage.removeItem(key);\r\n }\r\n }\r\n\r\n private _writeToCookie(key: string, value: string | undefined): void {\r\n if (!key || !value) {\r\n return;\r\n }\r\n if (MsDyn365.isBrowser) {\r\n const storage = window.localStorage;\r\n storage.setItem(key, value);\r\n }\r\n }\r\n\r\n private _readFromToCookie(key: string): string | undefined {\r\n if (!key) {\r\n return undefined;\r\n }\r\n if (MsDyn365.isBrowser) {\r\n const storage = window.localStorage;\r\n const cookieValue = storage.getItem(key);\r\n if (cookieValue) {\r\n return cookieValue;\r\n }\r\n }\r\n\r\n return undefined;\r\n }\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { IActionContext } from '@msdyn365-commerce/core';\r\nimport { StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { action } from 'mobx';\r\n\r\nimport { BaseStoreSelectorStateManager } from './base-store-selector-state-manager';\r\nimport { ILoadMapApiInput, IStoreSelectorLocation } from './i-store-selection-state-manager';\r\nimport { IMapWindow, MapLocationsResult } from './models/map-data';\r\n\r\ndeclare const window: IMapWindow;\r\n\r\n/**\r\n * Instance of IStoreSelectorStateManager manager that uses Map service\r\n * for geo location.\r\n */\r\nexport class MapStoreSelectorStateManager extends BaseStoreSelectorStateManager {\r\n private readonly SERVICE_ENDPOINT: string = 'https://dev.virtualearth.net/REST/v1/';\r\n\r\n private readonly MAP_API_ENDPOINT: string = 'https://www.bing.com/api/maps/mapcontrol?callback=mapAPIReady';\r\n\r\n @action\r\n public async geoLocate(searchTerm: string, actionContext: IActionContext): Promise {\r\n if (\r\n !searchTerm ||\r\n !actionContext.requestContext.channel ||\r\n !actionContext.requestContext.channel.BingMapsApiKey ||\r\n !actionContext.requestContext.channel.BingMapsEnabled\r\n ) {\r\n return undefined;\r\n }\r\n\r\n let searchContent: string = searchTerm;\r\n\r\n const jsonp = `mapSearchCallback_${crypto.getRandomValues(new Uint32Array(1))[0]}`;\r\n\r\n if (actionContext.requestContext.channel.ChannelCountryRegionISOCode) {\r\n searchContent = `${searchTerm.trim()} ${actionContext.requestContext.channel.ChannelCountryRegionISOCode}`;\r\n }\r\n\r\n const query = encodeURI(searchContent);\r\n const key = encodeURI(actionContext.requestContext.channel.BingMapsApiKey);\r\n\r\n const geolocationApiUrl =\r\n actionContext.requestContext.app &&\r\n actionContext.requestContext.app.config &&\r\n actionContext.requestContext.app.config.geolocationApiUrl;\r\n const requestUrl = `${\r\n geolocationApiUrl ? geolocationApiUrl : this.SERVICE_ENDPOINT\r\n }/Locations?query=${query}&key=${key}&jsonp=${jsonp}`;\r\n\r\n return new Promise(resolve => {\r\n const script = document.createElement('script');\r\n script.setAttribute('type', 'text/javascript');\r\n script.setAttribute('src', requestUrl);\r\n\r\n window[jsonp] = (data: MapLocationsResult) => {\r\n delete window[jsonp];\r\n script.remove();\r\n\r\n if (data && data.resourceSets && data.resourceSets.length > 0 && data.resourceSets[0].resources.length > 0) {\r\n resolve({\r\n latitude: data.resourceSets[0].resources[0].point.coordinates[0],\r\n longitude: data.resourceSets[0].resources[0].point.coordinates[1]\r\n });\r\n }\r\n\r\n resolve(undefined);\r\n };\r\n\r\n document.body.appendChild(script);\r\n });\r\n }\r\n\r\n @action\r\n public async loadMapApi(input: ILoadMapApiInput): Promise {\r\n if (StringExtensions.isNullOrEmpty(input.key)) {\r\n return Promise.resolve();\r\n }\r\n\r\n const isScriptAlreadyLoaded = !!document?.getElementById('msdyn_map-api-script');\r\n\r\n if (isScriptAlreadyLoaded) {\r\n // Prevents from loading multiple script into the body\r\n return Promise.resolve();\r\n }\r\n\r\n const url = `${this.MAP_API_ENDPOINT}${input.key ? `&key=${input.key}` : ''}${input.lang ? `&setLang=${input.lang}` : ''}${\r\n input.market ? `&setMkt=${input.market}` : ''\r\n }`;\r\n\r\n return new Promise((resolve, reject) => {\r\n const script = document?.createElement('script');\r\n script.type = 'text/javascript';\r\n script.async = true;\r\n script.defer = true;\r\n script.src = url;\r\n script.id = 'msdyn_map-api-script';\r\n if (window) {\r\n window.mapAPIReady = () => {\r\n this.isMapApiLoaded = true;\r\n resolve();\r\n };\r\n }\r\n script.addEventListener('error', (error: string | Event) => {\r\n reject(error);\r\n });\r\n document?.body?.appendChild(script);\r\n });\r\n }\r\n}\r\n","import { IActionContext, ITelemetry, ICreateActionContext, IGeneric, IAny } from '@msdyn365-commerce/core';\r\nimport { OrgUnitLocation, ProductSearchResult, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { ICommerceApiSettings } from '@msdyn365-commerce/core-internal';\r\nimport { storeSelectorStateDataAction, IStoreSelectorStateManager } from '@msdyn365-commerce-modules/bopis-utilities';\r\n// @ts-ignore\r\nimport { MapStoreSelectorStateManager } from '../modules/mmx-store-selector/state-manager/map-store-selector-state-manager';\r\nimport {\r\n GenericInput,\r\n getDeliveryOptionsForSelectedVariant,\r\n GetDeliveryOptionsForSelectedVariantInput,\r\n getOrgUnitLocationsByArea,\r\n GetOrgUnitLocationsByAreaInput\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport React from 'react';\r\n\r\n/**\r\n * Assigns given pickup location to given product.\r\n */\r\nexport const setPickupLocationForProduct = async (\r\n product: SimpleProduct,\r\n quantity: number,\r\n onLocationSelected: (orgUnitLocation: OrgUnitLocation, deliveryMode: string) => Promise,\r\n storeSelectorId: string,\r\n modalCloseButtonReference: React.RefObject,\r\n channelId: number,\r\n actionContext: IActionContext,\r\n telemetry?: ITelemetry\r\n): Promise => {\r\n let storeSelectorStateManager = await storeSelectorStateDataAction(\r\n new GenericInput('mapSSSM', new MapStoreSelectorStateManager(), 'IStoreSelectorStateManager'),\r\n actionContext\r\n ).catch((error: Error) => {\r\n if (telemetry) {\r\n telemetry.error(error.message);\r\n telemetry.debug('Error finding store selector state manager');\r\n }\r\n });\r\n\r\n if (storeSelectorStateManager) {\r\n const deliveryOptions = await getDeliveryOptionsForSelectedVariant(\r\n new GetDeliveryOptionsForSelectedVariantInput(product.RecordId, channelId, undefined, undefined, true),\r\n actionContext\r\n );\r\n\r\n let locations = await getOrgUnitLocationsByArea(\r\n new GetOrgUnitLocationsByAreaInput(undefined, undefined, 0, 0, true),\r\n actionContext\r\n );\r\n\r\n if (locations && locations.length) {\r\n if (locations.length > 1) {\r\n await storeSelectorStateManager\r\n .openDialog({\r\n product: product,\r\n id: storeSelectorId ?? 'mmx-store-selector',\r\n parentElementRef: modalCloseButtonReference,\r\n deliveryOptions: deliveryOptions,\r\n additionalProperties: {\r\n amountSelected: quantity,\r\n isStockedProuct: product.Behavior?.IsStockedProduct\r\n },\r\n onLocationSelected: onLocationSelected\r\n })\r\n .catch((error: any) => {\r\n if (telemetry) {\r\n telemetry.warning(error);\r\n telemetry.debug('[order-template-lines] Error trying to Update Cart Line from the order template lines');\r\n }\r\n });\r\n return Promise.resolve(undefined);\r\n } else {\r\n if (locations[0].OrgUnitAvailability && locations[0].OrgUnitAvailability?.OrgUnitLocation) {\r\n const defaultDeliveryOption = deliveryOptions?.DeliveryOptions ? deliveryOptions.DeliveryOptions[0].Code : undefined;\r\n if (defaultDeliveryOption) {\r\n onLocationSelected(locations[0].OrgUnitAvailability.OrgUnitLocation, defaultDeliveryOption);\r\n return Promise.resolve(undefined);\r\n } else {\r\n return Promise.reject('Could not find value delivery options');\r\n }\r\n } else {\r\n return Promise.reject('No valid org unit availability object');\r\n }\r\n }\r\n } else {\r\n return Promise.reject('No location found');\r\n }\r\n }\r\n return Promise.reject('Could not set pickup location');\r\n};\r\n/**\r\n * Utility function to extract the active productId in the following priority:\r\n * First query param (productId), then UrlToken (itemId), then module config.\r\n * Shamelessly stolen from msdyn commerce modules.\r\n * @param inputData The Action Input data.\r\n */\r\nexport const getSelectedProductIdFromActionInput = (inputData: ICreateActionContext>): string | undefined => {\r\n if (inputData && inputData.requestContext && inputData.requestContext.query && inputData.requestContext.query['product-id']) {\r\n return inputData.requestContext.query['product-id'];\r\n } else if (inputData && inputData.requestContext && inputData.requestContext.query && inputData.requestContext.query.productId) {\r\n return inputData.requestContext.query.productId;\r\n } else if (\r\n inputData &&\r\n inputData.requestContext &&\r\n inputData.requestContext.urlTokens &&\r\n inputData.requestContext.urlTokens.pageType &&\r\n inputData.requestContext.urlTokens.pageType !== 'Category' &&\r\n inputData.requestContext.urlTokens.itemId\r\n ) {\r\n return inputData.requestContext.urlTokens.itemId;\r\n } else if (inputData && inputData.config && inputData.config.productId) {\r\n return inputData.config.productId;\r\n }\r\n return undefined;\r\n};\r\n\r\n/**\r\n * Generates a Image URL for a product based on data return from retail server.\r\n * @param product The Product returned by Retail Server.\r\n * @param apiSettings\r\n */\r\nexport const generateProductImageUrl = (\r\n product: SimpleProduct | ProductSearchResult,\r\n apiSettings: ICommerceApiSettings\r\n): string | undefined => {\r\n const fullImagePath = /^(\\/\\/|^)http/;\r\n const PRODUCT_DELINEATOR_INDEX = 0;\r\n const PRODUCT_SEQ_INDEX = 4;\r\n\r\n let imageUrl = product.PrimaryImageUrl;\r\n if (imageUrl) {\r\n if (fullImagePath.test(imageUrl)) {\r\n return imageUrl;\r\n }\r\n let imageUrlDecoded = decodeURIComponent(imageUrl);\r\n let imageComponents = imageUrlDecoded.split(' ^');\r\n let imageUrlRebuilt = imageComponents[PRODUCT_DELINEATOR_INDEX];\r\n if (imageComponents.length > 1) {\r\n imageUrlRebuilt += imageComponents[PRODUCT_SEQ_INDEX];\r\n }\r\n // Images hosted in Retail Server must be encoded and joined with the base image url\r\n return apiSettings.baseImageUrl + encodeURIComponent(imageUrlRebuilt);\r\n }\r\n return undefined;\r\n};\r\n\r\n/**\r\n * Gets item at provided cache key from the cache of a state data action. If multiple results are found, return only the first one.\r\n * @param context The request context\r\n * @param cacheObjectType The object type returned by the state data action\r\n * @param cacheKey The name of the state data action\r\n */\r\nexport function getSingleItemFromStateAction(context: IActionContext, cacheObjectType: string, cacheKey: string): T | undefined {\r\n const result = context.get(cacheObjectType, cacheKey);\r\n if (!result) {\r\n return undefined;\r\n } else if (Object.prototype.toString.call(result) !== '[object Array]') {\r\n //@ts-ignore\r\n return result;\r\n }\r\n return result[0];\r\n}\r\n","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n (binding.modules['product-warranty'] = {\n c: () => require('partner/modules/product-warranty/product-warranty.tsx'),\n $type: 'contentModule',\n da: [{name:'productQuantityState', path:'actions/state-data-actions/product-quantity-state.action', runOn: 0},{name:'productWarranties', path:'actions/get-product-warranties.action', runOn: 0},{name:'productWarrantyState', path:'actions/state-data-actions/product-warranty-state.action', runOn: 0},{name:'warrantyIcons', path:'actions/get-product-warranty-icon.action', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'product-warranty',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/product-warranty'\n });\n \n\n {\n const sanitizedActionPath = 'actions/get-product-warranties.action';\n let dataAction = require('partner/actions/get-product-warranties.action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'actions/get-product-warranty-icon.action';\n let dataAction = require('partner/actions/get-product-warranty-icon.action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'actions/state-data-actions/product-quantity-state.action';\n let dataAction = require('partner/actions/state-data-actions/product-quantity-state.action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'actions/state-data-actions/product-warranty-state.action';\n let dataAction = require('partner/actions/state-data-actions/product-warranty-state.action');\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|product-warranty|product-warranty'] = {\n c: () => require('partner/modules/product-warranty/product-warranty.view.tsx'),\n cn: '__local__-__local__-product-warranty'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","module.exports = React;","module.exports = ReactDOM;"],"names":["ProductDefaultVariantInput","constructor","productId","getCacheKey","this","toString","getCacheObjectType","dataCacheType","createProductDefaultVariantInput","inputData","productIds","selectedId","getSelectedProductIdFromActionInput","push","Array","isArray","length","map","Error","async","getProductDefaultVariantAction","input","ctx","getProductDefaultVariantsAsync","callerContext","then","response","createObservableDataAction","id","action","isBatched","ProductWarrantiesInput","createProductWarrantiesInput","getProductWarrantiesAction","telemetry","trace","productDefaultVariantInputs","defaultProductMasterIds","defaultVariantIds","MasterId","DefaultProductId","missingInputIds","filter","includes","allProductIds","Set","getProductWarrantiesAsync","GetProductWarrantyIconInput","Msdyn365","getWarrantyIconsAsync","args","ProductQuantityStateInput","ProductQuantityStateAction","ProductWarrantyStateInput","productWarrantyStateAction","ProductWarranty","React","props","super","_setSelectedWarrantyOption","selectedWarrantyOption","_getSelectedProductId","setState","context","actionContext","WarrantableProduct","update","_setSelectWarrantyDisabled","isDisabled","isSelectWarrantyDisabled","state","error","isLoaded","undefined","formSubmit","bind","event","preventDefault","componentDidMount","render","_this$props","_this$props2","_this$props3","_this$props4","_this$props$data$warr","productQuantity","data","productQuantityState","result","selectWarrantyDisabled","app","config","disableWarrantyOnMultipleQuantityProducts","_objectSpread","moduleProps","className","classnames","productWarrantyComponentProps","design","productWarrantySelectorDesign","productWarranties","warrantyIcons","learnMoreLink","productWarrantyLearnMoreLink","onSelectWarrantyOption","renderView","_props$productWarrant","Module","Object","assign","renderModuleAttributes","ProductWarrantyComponent","renderViewNoWarranties","BaseStoreSelectorStateManager","listMapViewState","displayList","displayMap","preferredStoreLocalStorageKey","isMapModuleLoaded","value","_readFromToCookie","storeInfo","JSON","parse","preferredStore","_unused","_context","storeId","selectedStoreLocationId","storeName","writeToCookie","arguments","StoreId","StoreName","Latitude","Longitude","_writeToCookie","stringify","latitude","longitude","lastInlineShownStoreInfo","_removeCookie","key","MsDyn365","isBrowser","window","localStorage","removeItem","setItem","cookieValue","getItem","__decorate","computed","observable","MapStoreSelectorStateManager","SERVICE_ENDPOINT","MAP_API_ENDPOINT","searchTerm","requestContext","channel","BingMapsApiKey","BingMapsEnabled","searchContent","jsonp","crypto","getRandomValues","Uint32Array","ChannelCountryRegionISOCode","trim","query","encodeURI","geolocationApiUrl","requestUrl","Promise","resolve","script","document","createElement","setAttribute","remove","resourceSets","resources","point","coordinates","body","appendChild","_document","StringExtensions","isNullOrEmpty","getElementById","url","lang","market","reject","_document2","_document3","type","defer","src","mapAPIReady","isMapApiLoaded","addEventListener","setPickupLocationForProduct","product","quantity","onLocationSelected","storeSelectorId","modalCloseButtonReference","channelId","storeSelectorStateManager","storeSelectorStateDataAction","GenericInput","catch","message","debug","deliveryOptions","getDeliveryOptionsForSelectedVariant","GetDeliveryOptionsForSelectedVariantInput","RecordId","locations","getOrgUnitLocationsByArea","GetOrgUnitLocationsByAreaInput","_product$Behavior","_locations$0$OrgUnitA","openDialog","parentElementRef","additionalProperties","amountSelected","isStockedProuct","Behavior","IsStockedProduct","warning","OrgUnitAvailability","OrgUnitLocation","defaultDeliveryOption","DeliveryOptions","Code","urlTokens","pageType","itemId","generateProductImageUrl","apiSettings","fullImagePath","imageUrl","PrimaryImageUrl","test","imageComponents","decodeURIComponent","split","imageUrlRebuilt","baseImageUrl","encodeURIComponent","binding","modules","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","prototype","RegistrationId","c","require","$type","da","name","path","runOn","iNM","ns","n","p","pdp","md","__bindings__","viewDictionary","cn","module","exports","ReactDOM"],"sourceRoot":""}