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./src/actions/BuyBoxSelectedQuantity/eshop-buybox-selected-quantity.ts?102e","webpack://Msdyn365.Commerce.Online/./src/actions/eShopOrderSummary/eshopOrderSummary.ts?5570","webpack://Msdyn365.Commerce.Online/./src/actions/helper-functions.ts?5715","webpack://Msdyn365.Commerce.Online/./src/modules/quickview/utilities/get-valid-product-images.ts?78b7","webpack://Msdyn365.Commerce.Online/./src/modules/quickview/quickview.tsx?4080","webpack://Msdyn365.Commerce.Online/./src/modules/quickview/utilities/get-product-details.ts?5cc2","webpack://Msdyn365.Commerce.Online/./src/modules/quickview/quickview.view.tsx?ee5b"],"sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * GetActivecategorymenustate Input Action\r\n */\r\nexport class GetSelectedQuantityValuesInput implements Msdyn365.IActionInput {\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `SelectedProductQuamtity`;\r\n public getCacheObjectType = () => 'SelectedProductQuamtity';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IGetSelectedQuantityStateData {\r\n selectedQuantity: number;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new GetSelectedQuantityValuesInput();\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function getSelectedQuantityValuesStateAction(input: GetSelectedQuantityValuesInput, ctx: Msdyn365.IActionContext):Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // TODO: Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { selectedQuantity: 1 };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getSelectedQuantityValuesStateAction,\r\n // TODO: Give your data action a unique id\r\n id: 'GetSelectedQuantityValuesStateActionState',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * GetActivecategorymenustate Input Action\r\n */\r\nexport class GetOrderSummaryStateValuesInput implements Msdyn365.IActionInput {\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `modelOpenValue`;\r\n public getCacheObjectType = () => 'modelOpenValue';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IGetOrderSummaryStateValuesInput {\r\n modelOpenValue: boolean;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new GetOrderSummaryStateValuesInput();\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function getSelectedQuantityValuesStateAction(input: GetOrderSummaryStateValuesInput, ctx: Msdyn365.IActionContext):Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // TODO: Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { modelOpenValue: false };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getSelectedQuantityValuesStateAction,\r\n // TODO: Give your data action a unique id\r\n id: 'GetOrderSummaryStateValuesInputStateActionState',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});","import { ICoreContext, IActionContext } from '@msdyn365-commerce/core';\r\n\r\nimport { CategoryHierarchy } from '@msdyn365-commerce/commerce-entities';\r\n\r\nimport { AsyncResult, Customer, Product, ProductSearchCriteria, ProductSearchResult, SimpleProduct, SalesOrder } from '@msdyn365-commerce/retail-proxy';\r\nimport { getOrderHistoryAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CustomersDataActions.g';\r\nimport { searchAsync, searchByCategoryAsync, getByIdsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\n\r\nimport { v4 as uuidv4, validate as uuidValidate, version as uuidVersion } from 'uuid';\r\n\r\nimport { createOrUpdateBTGPCartLineAsync, createBTGPErrorLogAsync, getByCustomerAllBTGPTransactionAsync, getByCustomerAllBTGPTransactionFromHqAsync } from '../actions/DataActionExtension.g';\r\nimport { CategoryProducts, FormDetails, PastTransaction, CartItem, Transaction } from '../actions/ecomm-interfaces';\r\n\r\nimport DedicationPeriod from '../resources/dedicationPeriod.json';\r\nimport { ICartState} from '@msdyn365-commerce/global-state';\r\nimport { ReceiptItem } from './kioskv3-interfaces';\r\n\r\nexport async function getProductsByCategoryId(context: ICoreContext, categoryId: number): Promise {\r\n const searchResult = await searchByCategoryAsync({ callerContext: context.actionContext }, context.actionContext.requestContext.apiSettings.channelId, context.actionContext.requestContext.apiSettings.catalogId, categoryId).catch(error => console.log('[getProductsByCategoryId] searchByCategoryAsync error: ', error));\r\n\r\n if (searchResult && searchResult.length > 0) {\r\n searchResult.sort((a: ProductSearchResult, b: ProductSearchResult) => ((a.DisplayOrder!) < (b.DisplayOrder!) ? -1 : 1));\r\n\r\n const productIds: number[] = [];\r\n\r\n searchResult.map(item => productIds.push(item.RecordId));\r\n\r\n // const availability = await getEstimatedAvailabilityAsync(context, { ProductIds: productIds, DefaultWarehouseOnly: true }).\r\n // catch(error => console.log('[getProductsByCategoryId] getEstimatedAvailabilityAsync error: ', error));\r\n\r\n // if (availability && availability.ProductWarehouseInventoryAvailabilities) {\r\n // const warehouse = availability.ProductWarehouseInventoryAvailabilities;\r\n\r\n // if (warehouse.length > 0) {\r\n // const availableIds: number[] = [];\r\n\r\n // searchResult.map(item => {\r\n // const found = warehouse.find(stock => stock.ProductId === item.RecordId);\r\n\r\n // if (found && (found.PhysicalAvailableInventoryLevelCode && found.PhysicalAvailableInventoryLevelCode === InventoryLvls.AVAIL)) {\r\n // availableIds.push(item.RecordId);\r\n // }\r\n // });\r\n\r\n // const products = await getByIdsAsync(context, channelId, availableIds).catch(error => console.log('[getProductsByCategoryId] getByIdsAsync error: ', error));\r\n\r\n // return products;\r\n // }\r\n // }\r\n\r\n const products = await getByIdsAsync({ callerContext: context.actionContext }, context.actionContext.requestContext.apiSettings.channelId, productIds).catch(error => console.log('[getProductsByCategoryId] getByIdsAsync error: ', error));\r\n\r\n return products;\r\n }\r\n\r\n return [];\r\n}\r\n\r\nexport async function getProducts(context: ICoreContext, categoryIDs: number[]): Promise {\r\n if (categoryIDs.length > 0) {\r\n const projectDomain = { ChannelId: context.actionContext.requestContext.apiSettings.channelId, CatalogId: context.actionContext.requestContext.apiSettings.catalogId };\r\n\r\n const criterias: ProductSearchCriteria = { Context: projectDomain, CategoryIds: categoryIDs, IncludeAttributes: true };\r\n \r\n const products = await searchAsync({ callerContext: context.actionContext }, criterias);\r\n \r\n return products;\r\n }\r\n\r\n return [];\r\n}\r\n\r\nexport async function getCustomerOrderHistory(context: ICoreContext, hierarchy: AsyncResult, customer: Customer, organisation: string, isUat: boolean, limit: number, source: string) {\r\n const dictionary = await generateDictionary(context, hierarchy);\r\n const orderHistory: PastTransaction[] = [];\r\n let btgpTransactions;\r\n let orders : SalesOrder[]= []; \r\n\r\n\r\n if (source ==\"CH\")\r\n {\r\n orders = await getOrderHistoryAsync({ callerContext: context.actionContext }, customer.AccountNumber);\r\n\r\n btgpTransactions = await getByCustomerAllBTGPTransactionAsync({ callerContext: context.actionContext }, customer.AccountNumber, customer.Email!, organisation, isUat, limit); \r\n }\r\n else{\r\n btgpTransactions = await getByCustomerAllBTGPTransactionFromHqAsync({ callerContext: context.actionContext }, isUat, customer.AccountNumber, customer.Email!, (organisation==\"BT\"?\"BTRT\":\"GPBT\")); \r\n }\r\n\r\n\r\n if (btgpTransactions)\r\n {\r\n for (let i = 0; i < btgpTransactions.length; i++) {\r\n const transaction: Transaction = JSON.parse(btgpTransactions[`${i}`]);\r\n \r\n if (transaction['errorCode']) {\r\n console.log(transaction['errorMessage']);\r\n } else {\r\n const transactionNames: string[] = [];\r\n\r\n for (let j = 1; j <= 20; j++) {\r\n const nameID = 'Name_' + j;\r\n\r\n if (transaction[`${nameID}`]) {\r\n transactionNames.push(transaction[`${nameID}`]);\r\n }\r\n }\r\n\r\n let mainName = '';\r\n let mainID = 0;\r\n let price = 0;\r\n\r\n if (transaction.ProductCategoryID === '' || transaction.ProductCategoryID === null) {\r\n dictionary.forEach(record => {\r\n const found = record.Products.find(item => item.RecordId === parseInt(transaction.ProductID));\r\n\r\n if (found) { \r\n mainName = record.Main.Name!; \r\n mainID = record.Main.RecordId;\r\n price = found.Price ? found.Price : 0;\r\n }\r\n });\r\n } else {\r\n mainName = transaction.ProductCategory;\r\n mainID = Number(transaction.ProductCategoryID);\r\n price = transaction.ProductPrice;\r\n }\r\n\r\n if (transaction.DedicationPeriod !== '') {\r\n let found = DedicationPeriod.en.period.findIndex(item => item.label === transaction.DedicationPeriod);\r\n\r\n // Look through chinese version.\r\n if (found < 0) {\r\n found = DedicationPeriod.zh.period.findIndex(item => item.label === transaction.DedicationPeriod);\r\n }\r\n\r\n // Found matching dedication period.\r\n if (found >= 0) {\r\n price = price * DedicationPeriod.scale[`${found}`];\r\n }\r\n }\r\n\r\n const matchingOrder = orders.find(order => order.Id === transaction.SalesOrderID);\r\n const orderReceiptNo = transaction.ReceiptNo === '' ? matchingOrder && matchingOrder.SalesId ? matchingOrder.SalesId : 'Pending' : transaction.ReceiptNo;\r\n\r\n let order = transaction;\r\n order.ProductPrice = price;\r\n order.ProductCategory = mainName;\r\n order.ProductCategoryID = mainID.toString();\r\n\r\n orderHistory.push({ \r\n EventDates: [transaction.EventName],\r\n Names: transactionNames,\r\n OrderDate: transaction.DateOfTransaction ? new Date(transaction.DateOfTransaction) : new Date(),\r\n ReceiptNo: [orderReceiptNo],\r\n Record: order\r\n });\r\n }\r\n }\r\n }\r\n\r\n orderHistory.sort((a, b) => {\r\n return b.OrderDate.getTime() - a.OrderDate.getTime();\r\n }); \r\n\r\n return orderHistory;\r\n}\r\n\r\nexport async function generateErrorLog(context: ICoreContext, errorLogName: string, errorDetails: string, item: FormDetails) {\r\n await createBTGPErrorLogAsync({ callerContext: context.actionContext }, generateUUID(), errorLogName, errorDetails, new Date().toISOString(), item.CartLineID, item.CartID, item.ProductID, item.EventID, item.EventName, item.SerialID, item.SerialNumber, item.SerialName, item.Name_1, item.Name_2, item.Name_3, item.Name_4, item.Name_5, item.Name_6, item.Name_7, item.Name_8, item.Name_9, item.Name_10, item.Name_11, item.Name_12, item.Name_13, item.Name_14, item.Name_15, item.Name_16, item.Name_17, item.Name_18, item.Name_19, item.Name_20, item.Remarks, item.Message, item.Category, item.DedicatedBy, item.HasTaxDeduction, item.Nric, item.BuildingName, item.UnitNumber, item.PostalCode, item.BirthDate, item.PhoneNumber, item.SchoolName, item.DonationOption, item.BlessingOption, item.CartLineComment, item.BirthTime, item.LightOption, item.ValidFrom, item.ValidTo, item.ParentCartLineID, item.DedicationPeriod, item.Country, item.CompanyName, item.DeceasedRelationship, item.SurgeryDate, item.DeathDate, item.DeathTime, item.NameChange, item.OldName_1, item.OldName_2, item.BirthDate_2, item.BirthTime_2, item.StartDate, item.Gender, item.ChineseName, item.ContactNumber, item.NameNextKin, item.ContactNumberNextKin, item.PassportNumber, item.PassportExpiryDate, item.PassportIssuedDate);\r\n}\r\n\r\nexport async function createOrUpdateCartline(context: ICoreContext, item: CartItem): Promise {\r\n const result = await createOrUpdateBTGPCartLineAsync({ callerContext: context.actionContext }, item.Form.CartLineID, item.Form.CartID, item.Form.ProductID, item.Form.EventID, item.Form.EventName, item.Form.SerialID, item.Form.SerialNumber, item.Form.SerialName, item.Form.Name_1, item.Form.Name_2, item.Form.Name_3, item.Form.Name_4, item.Form.Name_5, item.Form.Name_6, item.Form.Name_7, item.Form.Name_8, item.Form.Name_9, item.Form.Name_10, item.Form.Name_11, item.Form.Name_12, item.Form.Name_13, item.Form.Name_14, item.Form.Name_15, item.Form.Name_16, item.Form.Name_17, item.Form.Name_18, item.Form.Name_19, item.Form.Name_20, item.Form.Remarks, item.Form.Message, item.Form.Category, item.Form.DedicatedBy, item.Form.HasTaxDeduction, item.Form.Nric, item.Form.BuildingName, item.Form.UnitNumber, item.Form.PostalCode, item.Form.BirthDate, item.Form.PhoneNumber, item.Form.SchoolName, item.Form.DonationOption, item.Form.BlessingOption, item.Form.CartLineComment, item.Form.BirthTime, item.Form.LightOption, item.Form.ValidFrom, item.Form.ValidTo, item.Form.ParentCartLineID, item.Form.DedicationPeriod, item.Form.Country, item.Form.CompanyName, item.Form.DeceasedRelationship, item.Form.SurgeryDate, item.Form.DeathDate, item.Form.DeathTime, item.Form.NameChange, item.Form.OldName_1, item.Form.OldName_2, item.Form.BirthDate_2, item.Form.BirthTime_2, item.IsValid, item.InvalidType, item.InCart, item.IsSubProduct, item.Form.StartDate, item.Form.Gender, item.Form.ChineseName, item.Form.NameNextKin, item.Form.ContactNumber, item.Form.ContactNumberNextKin, item.Form.PassportNumber, item.Form.PassportExpiryDate, item.Form.PassportIssuedDate, item.Form.Consent, item.Form.IsInsuranceIncluded);\r\n\r\n return result;\r\n}\r\n\r\nexport async function generateDictionary(context: ICoreContext, hierarchy: AsyncResult): Promise {\r\n const dictionary: CategoryProducts[] = [];\r\n\r\n if (hierarchy.result) {\r\n hierarchy.result.forEach(record => {\r\n if (record.Children && record.Children.length > 0) {\r\n dictionary.push({ Main: record, SubIDs: record.Children.map(item => item.RecordId), Products: [] });\r\n }\r\n });\r\n }\r\n\r\n for (let j = 0; j < dictionary.length; ++j) {\r\n dictionary[`${j}`].Products = await getProducts(context, dictionary[`${j}`].SubIDs);\r\n }\r\n\r\n return dictionary;\r\n}\r\n\r\nexport function generateUUID(): string {\r\n let uuid = uuidv4();\r\n\r\n while (!(uuidValidate(uuid) && uuidVersion(uuid) == 4)) {\r\n uuid = uuidv4();\r\n }\r\n\r\n return uuid;\r\n}\r\n\r\nexport function showNextOrPreviousPage(selectors: string, showClassName: string, hideClassName: string, showNextPage: boolean) {\r\n let showPageIndex;\r\n const elements = document.querySelectorAll(selectors);\r\n\r\n // to get show page index\r\n for (let i = 0 ; i < elements.length; i++){\r\n const htmlElement = elements[`${i}`] as HTMLElement;\r\n if (htmlElement.classList.contains(showClassName)) {\r\n showPageIndex = showNextPage ? i + 1 : i - 1;\r\n }\r\n htmlElement.classList.remove(showClassName);\r\n htmlElement.classList.add(hideClassName);\r\n }\r\n\r\n const elementToShow = elements[`${showPageIndex}`] as HTMLElement;\r\n elementToShow.classList.remove(hideClassName);\r\n elementToShow.classList.add(showClassName);\r\n}\r\n\r\nexport function loadingProductListInHomePageOrPrecheckoutPage(className: string){\r\n const productListEl = document.getElementsByClassName(className)[0];\r\n const overlayEl = document.getElementsByClassName(\"loading-overlay-parent\")[0] as HTMLElement;\r\n\r\n if (!productListEl.hasChildNodes()){\r\n overlayEl.style.display = \"block\";\r\n\r\n const intervalId = setInterval(()=>{\r\n if (document.getElementsByClassName(className)[0].hasChildNodes()) {\r\n overlayEl.style.display = \"none\";\r\n clearInterval(intervalId);\r\n }\r\n }, 200);\r\n }\r\n else{\r\n overlayEl.style.display = \"none\";\r\n }\r\n}\r\n\r\nexport function showLoadingScreen(show: boolean){\r\n const overlayEl = document.getElementsByClassName(\"loading-overlay-parent\")[0] as HTMLElement;\r\n // show ? overlayEl.style.display = \"block\" : overlayEl.style.display = \"none\";\r\n let overlayTimeout: any = \"\";\r\n\r\n if (show){\r\n overlayTimeout = setTimeout(()=>{\r\n overlayEl.style.display = \"block\";\r\n }, 1000);\r\n }\r\n else{\r\n overlayEl.style.display = \"none\";\r\n }\r\n\r\n\r\n return overlayTimeout;\r\n}\r\n\r\nexport function showLoadingScreenInstant(show: boolean){\r\n const overlayEl = document.getElementsByClassName(\"loading-overlay-parent\")[0] as HTMLElement;\r\n show ? overlayEl.style.display = \"block\" : overlayEl.style.display = \"none\";\r\n}\r\n\r\nexport function showTryAgainPrintReceiptPopUp(show: boolean){\r\n const overlayEl = document.getElementsByClassName(\"try-again-overlay-parent\")[0] as HTMLElement;\r\n show ? overlayEl.style.display = \"block\" : overlayEl.style.display = \"none\";\r\n}\r\n\r\nexport function clearOverlayTimeout(overlayTimeout: NodeJS.Timeout){\r\n clearTimeout(overlayTimeout);\r\n}\r\n\r\nexport function showStartOverBtnInHeader2(show: boolean){\r\n let elements: Element[] = Array.from(document.getElementsByClassName(\"start-over\"));\r\n elements.forEach(element =>{\r\n if (show){\r\n (element as HTMLElement).style.display = \"block\";\r\n }\r\n else{\r\n (element as HTMLElement).style.display = \"none\";\r\n }\r\n });\r\n}\r\n\r\n\r\nexport async function buildKioskv3ReceiptItems(cart: ICartState, actionContext: IActionContext, channelId: number): Promise{\r\n let productIds: number[] = [];\r\n cart.cart.CartLines?.map(cartLine => productIds.push(Number(cartLine.ProductId)));\r\n\r\n let simpleProductsResults = await searchAsync({ callerContext: actionContext }, { Ids: productIds });\r\n\r\n let receiptItems: ReceiptItem[] = [];\r\n\r\n cart.cart.CartLines?.map(cartLine => {\r\n if (cartLine.ProductId) {\r\n let receiptItem: ReceiptItem = {\r\n quantity: cartLine.Quantity!,\r\n productName: simpleProductsResults.find(product => product.RecordId == cartLine.ProductId)!.ProductName!,\r\n price: cartLine.Price!,\r\n totalAmount: cartLine.Quantity! * cartLine.Price!,\r\n comment: cartLine.Comment!\r\n };\r\n receiptItems.push(receiptItem);\r\n }\r\n })\r\n\r\n return receiptItems;\r\n}","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { getCatalogId, IActionContext, IImageData, IImageSettings } from '@msdyn365-commerce/core';\nimport { MediaLocation, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { getMediaLocationsForSelectedVariant, MediaLocationsForSelectedVariantInput } from '@msdyn365-commerce-modules/retail-actions';\n\nexport async function getValidProductImages(\n productId: number,\n channelId: number,\n actionContext: IActionContext,\n imageSettings: IImageSettings,\n selectedProduct?: SimpleProduct\n): Promise {\n const catalogId = getCatalogId(actionContext.requestContext);\n const actionInput = new MediaLocationsForSelectedVariantInput(productId, channelId, selectedProduct, catalogId);\n\n return getMediaLocationsForSelectedVariant(actionInput, actionContext)\n .then(mediaLocations => {\n if (mediaLocations) {\n return Promise.all(mediaLocations.map(async mediaLocation => validateMediaLocaionAsync(mediaLocation, imageSettings))).then(\n pairs => {\n return pairs.filter(pair => pair[1]).map(pair => pair[0]);\n }\n );\n }\n return [];\n })\n .catch(error => {\n actionContext.telemetry.exception(error);\n actionContext.telemetry.debug('Unable to get Media Locations for Selected Variant');\n return [];\n });\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-unused-vars-experimental -- .\nasync function validateMediaLocaionAsync(mediaLocation: MediaLocation, imageSettings?: IImageSettings): Promise<[IImageData, boolean]> {\n const imageData = {\n src: mediaLocation.Uri || '',\n altText: mediaLocation.AltText || ''\n };\n\n if (imageData.src === '') {\n return [imageData, false];\n }\n\n return new Promise<[IImageData, boolean]>(resolve => {\n try {\n const http = new XMLHttpRequest();\n http.open('HEAD', imageData.src, true);\n\n http.addEventListener('load', () => {\n resolve([imageData, http.status === 200 || http.status === 201]);\n });\n\n http.addEventListener('error', () => {\n resolve([imageData, false]);\n });\n\n http.send();\n } catch {\n resolve([imageData, false]);\n }\n });\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ProductDimensionFull } from '@msdyn365-commerce/commerce-entities';\nimport { Carousel, ICarouselProps } from '@msdyn365-commerce/components';\nimport { IImageData, IImageSettings, Image } from '@msdyn365-commerce/core';\nimport {\n ProductDeliveryOptions,\n ProductDimension,\n ProductDimensionValue,\n ProductPrice,\n ReleasedProductType,\n SimpleProduct\n} from '@msdyn365-commerce/retail-proxy';\nimport {\n ArrayExtensions,\n FinitePromiseQueue,\n FinitePromiseQueueError,\n getDeliveryOptionsForSelectedVariant,\n GetDeliveryOptionsForSelectedVariantInput,\n getDimensionsForSelectedVariant,\n GetDimensionsForSelectedVariantInput,\n getPriceForSelectedVariant,\n getProductAvailabilitiesForSelectedVariant,\n getProductPageUrlSync,\n getSelectedVariant,\n IProductInventoryInformation,\n IPromiseQueue,\n ISelectedProduct,\n ObjectExtensions,\n PriceForSelectedVariantInput,\n ProductAvailabilitiesForSelectedVariantInput,\n SelectedVariantInput\n} from '@msdyn365-commerce-modules/retail-actions';\nimport {\n Button,\n format,\n getPayloadObject,\n getTelemetryAttributes,\n getTelemetryObject,\n IComponentNodeProps,\n IModuleProps,\n IncrementalQuantity,\n INodeProps,\n ISingleSlideCarouselProps,\n isMobile,\n ITelemetryContent,\n KeyCodes,\n Modal,\n ModalBody,\n ModalFooter,\n ModalHeader,\n NodeTag,\n onTelemetryClick,\n SingleSlideCarousel,\n TelemetryConstant,\n VariantType\n} from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport { Spinner, SpinnerSize } from 'office-ui-fabric-react';\nimport React, { ReactNode } from 'react';\n\nimport {\n getBuyboxAddToCart,\n getBuyBoxInventoryLabel,\n getBuyboxKeyInPrice,\n getBuyboxProductAddToWishlist,\n getBuyboxProductDescription,\n getBuyboxProductPrice,\n getBuyboxProductRating,\n getBuyboxProductTitle,\n getBuyboxProductUnitOfMeasure,\n getQuantityLimitsMessages,\n IBuyboxAddToCartViewProps,\n IBuyboxAddToOrderTemplateViewProps,\n IBuyboxAddToWishlistViewProps,\n IBuyboxCallbacks,\n IBuyboxCommonData,\n IBuyboxExtentedProps,\n IBuyboxKeyInPriceViewProps,\n IBuyboxProductConfigureViewProps,\n IBuyboxProductQuantityViewProps,\n IBuyboxState,\n IErrorState,\n IProductDetails,\n RetailDefaultOrderQuantityLimitsFeatureName\n} from '../../common';\nimport { getBuyboxProductConfigure } from '../../common/buybox-product-configure';\nimport { IQuickviewData } from './quickview.data';\nimport { IQuickviewProps, IQuickviewResources } from './quickview.props.autogenerated';\nimport { getProductDetails } from './utilities/get-product-details';\nimport { getValidProductImages } from './utilities/get-valid-product-images';\nimport { RecentlyViewedState } from '../recently-viewed';\n\n/**\n * QuickView props Interface.\n */\nexport interface IQuickviewViewProps extends IQuickviewProps {\n quickView: IModuleProps;\n quickViewButton: React.ReactNode;\n ModalContainer: IModuleProps;\n ModalHeaderContainer: INodeProps;\n ModalHeaderContent: React.ReactNode;\n ModalFooterContainer: INodeProps;\n ModalBodyContainer: INodeProps;\n cartContainerProps: INodeProps;\n state: IBuyboxState;\n ModuleProps?: IModuleProps;\n ProductInfoContainerProps: INodeProps;\n MediaGalleryContainerProps: INodeProps;\n callbacks?: IBuyboxCallbacks;\n title?: React.ReactNode;\n description?: React.ReactNode;\n configure?: IBuyboxProductConfigureViewProps;\n inventoryLabel?: React.ReactNode;\n rating?: React.ReactNode;\n price?: React.ReactNode;\n addToCart?: IBuyboxAddToCartViewProps;\n addToOrderTemplate?: IBuyboxAddToOrderTemplateViewProps;\n addToWishlist?: IBuyboxAddToWishlistViewProps;\n max: number | undefined;\n keyInPrice?: IBuyboxKeyInPriceViewProps;\n quantity?: IBuyboxProductQuantityViewProps;\n quantityLimitsMessages?: React.ReactNode;\n CarouselProps: INodeProps;\n Thumbnails: IQuickViewThumbnailsViewProps;\n seeDetailsbutton: React.ReactNode;\n isModalOpen: boolean;\n loading?: React.ReactNode;\n unitOfMeasure?: React.ReactNode;\n productDetails?: IProductDetails | undefined;\n isMobileDevice?: boolean;\n}\n\n/**\n * QuickView extend props Interface.\n */\nexport interface IQuickviewExtentedProps extends IQuickviewProps {\n selectedProductId?: number;\n selectedDimensions?: ProductDimension[];\n}\n\n/**\n * QuickView thumbnails props Interface.\n */\nexport interface IQuickViewThumbnailsViewProps {\n ThumbnailsContainerProps: INodeProps;\n SingleSlideCarouselComponentProps: INodeProps;\n items?: IQuickViewThumbnailItemViewProps[];\n}\n\n/**\n * QuickView thumbnail item view props Interface.\n */\nexport interface IQuickViewThumbnailItemViewProps {\n ThumbnailItemContainerProps: INodeProps;\n Picture: React.ReactElement;\n}\n\n/**\n * QuickView state Interface.\n */\nexport interface IQuickViewState extends IBuyboxState {\n isDataLoaded: boolean;\n}\n\n/**\n *\n * Quickview component.\n * @extends {React.Component>}\n */\nclass Quickview extends React.Component, IQuickViewState> {\n /**\n * A queue of tasks of processing the changes in the dimensions.\n * Limit to two processes:\n * 1 - for the current process, which is under execution at the moment.\n * 2 - next process, which will process the latest version of data.\n * @remark Enqueueing new promises will discard the previous ones (except the one which is under processing).\n */\n private readonly dimensionUpdateQueue: IPromiseQueue = new FinitePromiseQueue(2);\n\n private dimensions: { [id: number]: string } = {};\n\n private readonly telemetryContent: ITelemetryContent;\n\n private productDetails: IProductDetails | undefined;\n\n private readonly quickViewCallbacks: IBuyboxCallbacks = {\n updateQuantity: (newQuantity: number): boolean => {\n const errorState = { ...this.state.errorState };\n errorState.quantityError = undefined;\n errorState.otherError = undefined;\n\n this.setState({ quantity: newQuantity, errorState });\n return true;\n },\n updateErrorState: (newErrorState: IErrorState): void => {\n this.setState({ errorState: newErrorState });\n },\n updateSelectedProduct: (\n newSelectedProduct: Promise,\n newInventory: IProductInventoryInformation | undefined,\n newPrice: ProductPrice | undefined,\n newDeliveryOptions: ProductDeliveryOptions | undefined\n ): void => {\n this.setState({\n selectedProduct: newSelectedProduct,\n productAvailableQuantity: newInventory,\n productDeliveryOptions: newDeliveryOptions\n });\n this._updatePrice(newPrice);\n },\n dimensionSelectedAsync: async (selectedDimensionId: number, selectedDimensionValueId: string): Promise => {\n this.dimensions[selectedDimensionId] = selectedDimensionValueId;\n return this.dimensionUpdateQueue\n .enqueue(async () => {\n return this._updateDimensions();\n })\n .catch((error: unknown) => {\n // Ignore discarded processes.\n if (error !== FinitePromiseQueueError.ProcessWasDiscardedFromTheQueue) {\n throw error;\n }\n });\n },\n getDropdownName: (dimensionType: number, resources: IQuickviewResources): string => {\n return this._getDropdownName(dimensionType, resources);\n },\n changeModalOpen: (isModalOpen: boolean): void => {\n this._hideQuickViewDialog();\n },\n changeUpdatingDimension: (isUpdatingDimension: boolean): void => {\n this.setState({ isUpdatingDimension });\n },\n updateKeyInPrice: (customPrice: number): void => {\n // Remove custom amount error when updating the custom price\n const errorState = { ...this.state.errorState };\n errorState.customAmountError = undefined;\n\n this.setState({ isPriceKeyedIn: true, keyInPriceAmount: customPrice, errorState });\n this._updatePrice(this.state.productPrice, customPrice);\n }\n };\n\n private readonly defaultGalleryImageSettings: IImageSettings = {\n viewports: {\n xs: { q: 'w=767&h=767&m=8', w: 0, h: 0 },\n sm: { q: 'w=600&h=600&m=8', w: 0, h: 0 },\n md: { q: 'w=600&h=772&m=8', w: 0, h: 0 },\n lg: { q: 'h=772&m=8', w: 0, h: 0 }\n },\n lazyload: true,\n cropFocalRegion: true\n };\n\n private readonly defaultThumbnailImageSettings: IImageSettings = {\n viewports: {\n xs: { q: 'w=100&m=8', w: 100, h: 0 },\n lg: { q: 'w=100&m=8', w: 100, h: 0 }\n },\n lazyload: true,\n cropFocalRegion: true\n };\n\n public constructor(props: IQuickviewProps) {\n super(props);\n this.state = {\n modalOpen: false,\n quantity: 1,\n min: undefined,\n max: undefined,\n errorState: {\n configureErrors: {}\n },\n selectedProduct: undefined,\n productPrice: undefined,\n productDeliveryOptions: undefined,\n isUpdatingDimension: false,\n activeIndex: 0,\n animating: false,\n mediaGalleryItems: undefined,\n isDataLoaded: false\n };\n\n this._quickViewCloseButtonclick = this._quickViewCloseButtonclick.bind(this);\n this.telemetryContent = getTelemetryObject(props.context.request.telemetryPageName!, props.friendlyName, props.telemetry);\n }\n\n /**\n * React should component udpate function.\n * @param nextProps - Next Props.\n * @param nextState - Next State.\n * @returns Boolean - Whether the module will rerender or not.\n */\n public shouldComponentUpdate(nextProps: IQuickviewProps, nextState: IBuyboxState): 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 | null {\n const {\n config: { className = '' },\n resources\n } = this.props;\n const { max } = this.state;\n const product = this.productDetails?.product ? this.productDetails.product : undefined;\n const props = this.props as IBuyboxExtentedProps;\n const defaultMinimumKeyInPrice = 10;\n const defaultMaximumKeyInPrice = 100;\n const isMobileDevice = isMobile({ variant: VariantType.Viewport, context: this.props.context.request }) === 'xs';\n const viewprops: IQuickviewViewProps = {\n ...(this.props as IQuickviewExtentedProps),\n state: this.state,\n productDetails: this.productDetails,\n isModalOpen: this.state.modalOpen!,\n quickView: {\n moduleProps: this.props,\n className: classnames('ms-quickView', className),\n tag: 'div'\n },\n isMobileDevice,\n quickViewButton: (\n \n ),\n ModalContainer: {\n moduleProps: this.props,\n tag: Modal,\n className: 'ms-quickView__dialog',\n isOpen: this.state.modalOpen,\n 'aria-label': format(resources.quickViewAriaLabel, this.productDetails?.product?.Name),\n toggle: this._quickViewCloseButtonclick,\n modalTransition: { timeout: 0 },\n shouldUpdateFocusToFirstElement: this.state.isDataLoaded\n },\n ModalHeaderContainer: {\n tag: ModalHeader,\n className: 'ms-quickView__header',\n toggle: this._quickViewCloseButtonclick\n },\n ModalFooterContainer: {\n tag: ModalFooter,\n className: 'ms-quickView__footer'\n },\n ModalHeaderContent: '',\n ModalBodyContainer: {\n tag: ModalBody,\n className: 'ms-quickView__body'\n },\n cartContainerProps: {\n className: 'ms-quickView__product-add-to-cart'\n },\n ProductInfoContainerProps: {\n className: 'ms-quickView__content'\n },\n MediaGalleryContainerProps: {\n className: 'ms-quickView__media-gallery'\n },\n seeDetailsbutton: this._renderSeeDetailButton(product),\n loading: !this.state.isDataLoaded && (\n \n ),\n callbacks: this.quickViewCallbacks,\n title: this.state.isDataLoaded && getBuyboxProductTitle(props, this.productDetails),\n description: this.state.isDataLoaded && getBuyboxProductDescription(props, this.productDetails),\n configure: this.state.isDataLoaded\n ? getBuyboxProductConfigure(props, this.state, this.quickViewCallbacks, this.productDetails, this.props.selectedDimensions)\n : undefined,\n price: this.state.isDataLoaded && getBuyboxProductPrice(props, this.state),\n unitOfMeasure: this.state.isDataLoaded && getBuyboxProductUnitOfMeasure(props, this.productDetails),\n rating:\n this.state.isDataLoaded && !this.props.context.app.config.hideRating && getBuyboxProductRating(props, this.productDetails),\n addToCart: this.state.isDataLoaded\n ? getBuyboxAddToCart(\n props,\n this.state,\n this.quickViewCallbacks,\n defaultMinimumKeyInPrice,\n defaultMaximumKeyInPrice,\n this.productDetails\n )\n : undefined,\n keyInPrice:\n this.state.isDataLoaded && this.props.config.enableKeyInPrice && this.state.isCustomPriceSelected\n ? getBuyboxKeyInPrice(props, this.state, this.quickViewCallbacks)\n : undefined,\n quantity: product?.IsGiftCard ? undefined : this._renderQuantity(this.props, this.state, this.quickViewCallbacks),\n inventoryLabel: this.state.isDataLoaded && getBuyBoxInventoryLabel(props, this.productDetails),\n addToWishlist: this.state.isDataLoaded\n ? getBuyboxProductAddToWishlist(props, this.state, this.quickViewCallbacks, this.productDetails)\n : undefined,\n quantityLimitsMessages: this.state.isDataLoaded && getQuantityLimitsMessages(props, this.state),\n max,\n CarouselProps: this._renderCarousel(),\n Thumbnails: this._renderThumbnails()\n };\n\n return this.props.renderView(viewprops) as React.ReactElement;\n }\n\n /**\n * Method to render detail button on quick view.\n * @param product - Simple product object.\n * @returns JSX element.\n */\n private readonly _renderSeeDetailButton = (product: SimpleProduct | undefined): JSX.Element => {\n const { config } = this.props;\n const payLoad = getPayloadObject('click', this.telemetryContent, TelemetryConstant.seeDetails, '');\n const attributes = getTelemetryAttributes(this.telemetryContent, payLoad);\n\n return (\n \n {config.seeDetailsLinkText}\n \n );\n };\n\n /**\n * Method to return carousel.\n * @returns Node props.\n */\n private readonly _renderCarousel = (): INodeProps => {\n const { config, resources } = this.props;\n let mediaGalleryItems: ReactNode[];\n let keys: (string | undefined)[];\n const galleryImageSettings = config.galleryImageSettings;\n if (galleryImageSettings) {\n galleryImageSettings.cropFocalRegion = true;\n }\n\n if (ArrayExtensions.hasElements(this.state.mediaGalleryItems)) {\n mediaGalleryItems = this.state.mediaGalleryItems.map((item: IImageData, index: number) => {\n return this._renderCarouselItemImageView(item, galleryImageSettings || this.defaultGalleryImageSettings, index);\n });\n keys = [...this.state.mediaGalleryItems.map(item => item.src)];\n } else {\n mediaGalleryItems = [this._renderEmptyImage(galleryImageSettings)];\n keys = ['empty'];\n }\n\n const props: IComponentNodeProps = {\n tag: Carousel,\n className: 'ms-media-gallery__carousel',\n items: mediaGalleryItems,\n activeIndex: this.state.activeIndex ?? 0,\n next: this.next,\n previous: this.previous,\n interval: false,\n directionTextPrev: resources.previousScreenshotFlipperText,\n directionTextNext: resources.nextScreenshotFlipperText,\n indicatorAriaText: resources.ariaLabelForSlide,\n onIndicatorsClickHandler: this.goToIndex,\n handleOnExited: this.onExited,\n handleOnExiting: this.onExiting,\n key: keys\n };\n\n return props;\n };\n\n /**\n * Method to render thumbnails.\n * @returns QuickView Thumbnails view props.\n */\n private readonly _renderThumbnails = (): IQuickViewThumbnailsViewProps => {\n const { config, id, resources } = this.props;\n\n const thumbnailImageSettings = config.thumbnailImageSettings;\n if (thumbnailImageSettings) {\n thumbnailImageSettings.cropFocalRegion = true;\n }\n\n let mediaGalleryItems: IQuickViewThumbnailItemViewProps[];\n let keys: (string | undefined)[];\n if (ArrayExtensions.hasElements(this.state.mediaGalleryItems)) {\n mediaGalleryItems = this.state.mediaGalleryItems.map((item: IImageData, index: number) => {\n return this._getThumbnailItem(\n item,\n thumbnailImageSettings ?? this.defaultThumbnailImageSettings,\n index,\n this.state.activeIndex!\n );\n });\n keys = [...this.state.mediaGalleryItems.map(item => item.src)];\n } else {\n mediaGalleryItems = [];\n keys = [];\n }\n\n return {\n ThumbnailsContainerProps: { className: 'ms-media-gallery__thumbnails-container' },\n SingleSlideCarouselComponentProps: {\n tag: SingleSlideCarousel,\n className: 'ms-media-gallery__thumbnails',\n flipperPrevLabel: resources.previousScreenshotFlipperText,\n flipperNextLabel: resources.nextScreenshotFlipperText,\n parentId: id,\n useTabList: true,\n key: JSON.stringify(keys)\n } as IComponentNodeProps,\n items: mediaGalleryItems\n };\n };\n\n private _updateMediaItems(lastUpdatedTime: number): void {\n const product = this.productDetails?.product;\n if (!this.state.mediaGalleryItems && product?.PrimaryImageUrl) {\n this.setState({\n mediaGalleryItems: [this._mapProductToImageData(product)],\n lastUpdate: lastUpdatedTime\n });\n }\n }\n\n private _updatePrice(newPrice: ProductPrice | undefined, customPrice: number | undefined = this.state.keyInPriceAmount): void {\n if (this.state.isCustomPriceSelected && newPrice) {\n newPrice.CustomerContextualPrice = customPrice;\n }\n this.setState({ productPrice: newPrice });\n }\n\n private readonly _updateDimensions = async (): Promise => {\n const {\n context: {\n actionContext,\n request: {\n apiSettings: { channelId }\n }\n }\n } = this.props;\n\n const { product, productDimensions } = this.productDetails!;\n\n if (!product || !productDimensions) {\n return;\n }\n\n const dimensionsToUpdate: { [id: number]: string } = { ...this.dimensions };\n this.setState({ isUpdatingDimension: true });\n\n // Step 1: Clear error state to display relevant errors\n if (this.state.errorState.otherError || this.state.errorState.quantityError) {\n const clearErrorState = { ...this.state.errorState };\n clearErrorState.otherError = undefined;\n if (this.state.errorState.errorHost === 'ADDTOCART') {\n clearErrorState.quantityError = undefined;\n clearErrorState.errorHost = undefined;\n }\n this.setState({ errorState: clearErrorState });\n }\n\n // Step 2: Clear any errors indicating the dimension wasn't selected\n for (const key of Object.keys(dimensionsToUpdate)) {\n if (this.state.errorState.configureErrors[key]) {\n const errorState = { ...this.state.errorState };\n errorState.configureErrors[key] = undefined;\n\n this.setState({ errorState });\n }\n }\n\n // Step 3, Build the actually selected dimensions, prioritizing the information in state\n // over the information in data\n const mappedDimensions = productDimensions\n .map(dimension => {\n return {\n DimensionTypeValue: dimension.DimensionTypeValue,\n DimensionValue:\n this._updateDimensionValue(dimension, dimensionsToUpdate[dimension.DimensionTypeValue]) || dimension.DimensionValue,\n ExtensionProperties: dimension.ExtensionProperties\n };\n })\n .filter(dimension => {\n return dimension && dimension.DimensionValue;\n });\n\n // Step 4. Use these dimensions hydrate the product. Wrap this in a promise\n // so that places like add to cart can await it\n const selectedProduct = new Promise(async resolve => {\n const newProduct = await getSelectedVariant(\n new SelectedVariantInput(\n product.MasterProductId ? product.MasterProductId : product.RecordId,\n channelId,\n mappedDimensions,\n undefined,\n this.props.context.request\n ),\n actionContext\n );\n if (newProduct) {\n // @ts-expect-error\n this.productDetails.productDimensions = await getDimensionsForSelectedVariant(\n new GetDimensionsForSelectedVariantInput(\n newProduct.MasterProductId ? newProduct.MasterProductId : newProduct.RecordId,\n channelId,\n mappedDimensions,\n this.props.context.request\n ),\n actionContext\n );\n }\n\n resolve(newProduct);\n });\n\n this.setState({ selectedProduct });\n const variantProduct = await selectedProduct;\n\n if (variantProduct && this.productDetails) {\n // Step 5. Use these dimensions hydrate the inventory. Wrap this in a promise\n // so that places like add to cart can await it\n this.productDetails.product = variantProduct;\n const images = await getValidProductImages(\n this.productDetails.product.RecordId || 0,\n +this.props.context.request.apiSettings.channelId,\n this.props.context.actionContext,\n this.props.config.thumbnailImageSettings || this.defaultThumbnailImageSettings,\n variantProduct.productVariant ?? variantProduct\n );\n this.setState({\n mediaGalleryItems: [...images],\n activeIndex: 0,\n lastUpdate: Date.now()\n });\n\n const newAvailableQuantity = await getProductAvailabilitiesForSelectedVariant(\n new ProductAvailabilitiesForSelectedVariantInput(variantProduct.RecordId, channelId),\n actionContext\n );\n\n this.productDetails.productAvailableQuantity = newAvailableQuantity!;\n\n const isCustompriceSelected = variantProduct.Dimensions?.find(\n dimension => dimension.DimensionTypeValue === 4 && dimension.DimensionValue?.Value?.toLowerCase() === 'custom'\n );\n\n if (isCustompriceSelected) {\n this.setState({ isCustomPriceSelected: true });\n } else {\n // Remove custom amount error when unselect the custom amount\n const errorState = { ...this.state.errorState };\n errorState.customAmountError = undefined;\n\n this.setState({ isCustomPriceSelected: false, isPriceKeyedIn: false, errorState });\n }\n\n if (newAvailableQuantity && newAvailableQuantity.length > 0) {\n this.setState({ productAvailableQuantity: newAvailableQuantity[0] });\n } else {\n this.setState({ productAvailableQuantity: undefined });\n }\n\n // Step 6. Use these dimensions hydrate the product price.\n const newPrice = await getPriceForSelectedVariant(\n new PriceForSelectedVariantInput(variantProduct.RecordId, channelId),\n actionContext\n );\n\n if (newPrice) {\n this._updatePrice(newPrice);\n }\n\n const RetailMulitplePickupMFeatureState = this.props.data.featureState.result?.find(\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature'\n );\n\n // Step 7. Use these dimensions hydrate the product delivery options.\n const newDeliveryOptions = await getDeliveryOptionsForSelectedVariant(\n new GetDeliveryOptionsForSelectedVariantInput(\n variantProduct.RecordId,\n channelId,\n undefined,\n undefined,\n RetailMulitplePickupMFeatureState?.IsEnabled\n ),\n actionContext\n );\n\n if (newDeliveryOptions) {\n this.setState({ productDeliveryOptions: newDeliveryOptions });\n }\n\n this.setState({ isUpdatingDimension: false });\n await this._updateQuantitiesInState(variantProduct);\n }\n };\n\n private _getProductURL(product: SimpleProduct | undefined): string {\n if (product) {\n let producturl = ' ';\n producturl = getProductPageUrlSync(\n product.Name || '',\n product.RecordId,\n this.props.context && this.props.context.actionContext,\n undefined\n );\n return producturl;\n }\n return '';\n }\n\n private async _updateQuantitiesInState(product: SimpleProduct): Promise {\n const isOrderQuantityLimitsFeatureEnabled = await this._isOrderQuantityLimitsFeatureEnabled();\n const defaultQuantity = 1;\n const defaultMaxQuantity = 10;\n if (isOrderQuantityLimitsFeatureEnabled && product) {\n // For some of the products the DefaultQuantity is zero\n this.setState({\n min: product.Behavior?.MinimumQuantity || defaultQuantity,\n\n // If max by feature in default order settings is not defined then use max from site settings or default max 10.\n max:\n product.Behavior?.MaximumQuantity && product.Behavior?.MaximumQuantity > 0\n ? product.Behavior?.MaximumQuantity\n : this.props.context.app.config.maxQuantityForCartLineItem || defaultMaxQuantity\n });\n } else {\n this.setState({\n min: 1,\n max: this.props.context.app.config.maxQuantityForCartLineItem || 10\n });\n }\n }\n\n private readonly _updateDimensionValue = (\n productDimensionFull: ProductDimensionFull,\n newValueId: string | undefined\n ): ProductDimensionValue | undefined => {\n if (newValueId && productDimensionFull.DimensionValues) {\n return productDimensionFull.DimensionValues.find(dimension => dimension.RecordId === +newValueId);\n }\n\n return undefined;\n };\n\n private readonly _getDropdownName = (dimensionType: number, resources: IQuickviewResources): string => {\n const isGiftCard = this.productDetails?.product?.IsGiftCard;\n\n switch (dimensionType) {\n case 1: // ProductDimensionType.Color\n return resources.productDimensionTypeColor;\n case 2: // ProductDimensionType.Configuration\n return resources.productDimensionTypeConfiguration;\n case 3: // ProductDimensionType.Size\n return resources.productDimensionTypeSize;\n case 4: // ProductDimensionType.Style\n return isGiftCard ? resources.productDimensionTypeAmount : resources.productDimensionTypeStyle;\n default:\n return '';\n }\n };\n\n private async _isOrderQuantityLimitsFeatureEnabled(): Promise {\n const defaultOrderQuantityLimitsFeatureConfig = this.props.context.request.app.platform?.enableDefaultOrderQuantityLimits;\n if (defaultOrderQuantityLimitsFeatureConfig === 'none') {\n return false;\n }\n\n const featureStatuses = await this.props.data.featureState;\n const isFeatureEnabledInHq = featureStatuses.find(featureState => featureState.Name === RetailDefaultOrderQuantityLimitsFeatureName)\n ?.IsEnabled;\n if (!isFeatureEnabledInHq) {\n return false;\n }\n\n if (defaultOrderQuantityLimitsFeatureConfig === 'all') {\n return true;\n }\n let customerInfo;\n try {\n customerInfo = await this.props.data.customerInformation;\n } catch (error) {\n this.props.telemetry.information(error);\n this.props.telemetry.debug('Unable to receive Customer Information. May be user is not authorized');\n return false;\n }\n\n return (\n customerInfo !== undefined &&\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b))\n );\n }\n\n private readonly onExiting = () => {\n this.setState({ animating: true });\n };\n\n private readonly onExited = () => {\n this.setState({ animating: false });\n };\n\n private readonly next = (): void => {\n if (this.isLastItem() === undefined) {\n return;\n }\n\n const nextIndex = this.isLastItem() ? 0 : this.state.activeIndex! + 1;\n this.goToIndex(nextIndex);\n };\n\n private readonly previous = (): void => {\n const nextIndex = this.isFirstItem()\n ? this.state.mediaGalleryItems\n ? this.state.mediaGalleryItems.length - 1\n : 0\n : this.state.activeIndex! - 1;\n this.goToIndex(nextIndex);\n };\n\n private readonly goToIndex = (index: number): void => {\n this.setState({ activeIndex: index });\n };\n\n private _renderCarouselItemImageView(image: IImageData, imageSettings: IImageSettings, index: number): React.ReactNode {\n return <>{this._getCarouselItem(image, imageSettings, index)};\n }\n\n private readonly _getCarouselItem = (image: IImageData, imageSettings: IImageSettings, index: number): React.ReactNode => (\n \n );\n\n private readonly _getThumbnailItem = (\n image: IImageData,\n imageSettings: IImageSettings,\n index: number,\n modifiedActiveIndex: number\n ): IQuickViewThumbnailItemViewProps => {\n const classes = classnames(\n 'ms-media-gallery__thumbnail-item',\n modifiedActiveIndex === index ? 'ms-media-gallery__thumbnail-item-active' : ''\n );\n\n return {\n ThumbnailItemContainerProps: {\n tag: 'li' as NodeTag,\n className: classes,\n role: 'tab',\n tabIndex: 0,\n key: index,\n 'aria-label': image.altText,\n 'aria-selected': modifiedActiveIndex === index,\n 'aria-controls': `${this.props.id}__carousel-item__${index}`,\n onClick: this._generateOnThumbnailClick(index),\n onKeyDown: this._generateOnThumbnailKeyDown(index)\n },\n Picture: (\n \n )\n };\n };\n\n private readonly _generateOnThumbnailKeyDown = (index: number) => {\n return (event: React.KeyboardEvent) => {\n if (event.which === KeyCodes.Enter || event.which === KeyCodes.Space) {\n event.preventDefault();\n this.goToIndex(index);\n }\n };\n };\n\n private readonly _generateOnThumbnailClick = (index: number) => {\n return (event: React.MouseEvent) => {\n event.preventDefault();\n this.goToIndex(index);\n };\n };\n\n private _mapProductToImageData(product: SimpleProduct): IImageData {\n return {\n src: product.PrimaryImageUrl || '',\n altText: product.Name\n };\n }\n\n private readonly isFirstItem = () => this.state.activeIndex === 0;\n\n private readonly isLastItem = () => this.state.mediaGalleryItems && this.state.activeIndex === this.state.mediaGalleryItems.length - 1;\n\n private readonly onClickHandler = async (event: React.MouseEvent) => {\n return this._onClick(event, this.props);\n };\n\n private readonly _onClick = async (_event: React.MouseEvent, props: IQuickviewExtentedProps) => {\n if (!ObjectExtensions.isNullOrUndefined(props.selectedProductId)) {\n const {\n context: {\n actionContext,\n request: {\n apiSettings: { channelId }\n }\n }\n } = this.props;\n\n if (this.props.selectedProductId) {\n this.setState({ modalOpen: true });\n const productId = this.props.selectedProductId;\n const selectedDimensions = this.props.selectedDimensions;\n this.productDetails = await getProductDetails(productId, channelId, actionContext, selectedDimensions);\n const { product, productPrice } = this.productDetails;\n const currentTime: number = Date.now();\n this._updateMediaItems(currentTime);\n if (productPrice) {\n this._updatePrice(productPrice);\n }\n\n if (product) {\n const { context } = this.props;\n if (context.app.config.maxRecentlyViewedItemsCount > 0) {\n RecentlyViewedState.instance(this.props.context, context.app.config.maxRecentlyViewedItemsCount, product.RecordId);\n }\n // Check if the product is service or not by product type\n if (product.ItemTypeValue === ReleasedProductType.Service) {\n this.setState({ isServiceItem: true });\n }\n await this._updateQuantitiesInState(product);\n const images = await getValidProductImages(\n product.RecordId,\n +this.props.context.request.apiSettings.channelId,\n this.props.context.actionContext,\n this.props.config.thumbnailImageSettings || this.defaultThumbnailImageSettings,\n product.productVariant ?? product\n );\n\n this.setState({\n mediaGalleryItems: [...images],\n activeIndex: 0,\n lastUpdate: currentTime\n });\n }\n this.setState({ isDataLoaded: true });\n }\n }\n };\n\n private readonly _quickViewCloseButtonclick = () => {\n this._hideQuickViewDialog();\n };\n\n private _hideQuickViewDialog(): void {\n this.dimensions = [];\n this.setState({\n modalOpen: false,\n quantity: 1,\n min: undefined,\n max: undefined,\n errorState: {\n configureErrors: {}\n },\n selectedProduct: undefined,\n productPrice: undefined,\n productDeliveryOptions: undefined,\n isUpdatingDimension: false,\n productAvailableQuantity: undefined,\n lastUpdate: undefined,\n activeIndex: undefined,\n animating: undefined,\n mediaGalleryItems: [],\n isDataLoaded: false\n });\n }\n\n /**\n * Quantity Change Handler.\n * @param callbacks -Buybox callbacks.\n * @returns Update quantity.\n */\n private readonly onChangeHandler = (callbacks: IBuyboxCallbacks) => (newValue: number): boolean => {\n if (callbacks.updateQuantity) {\n return callbacks.updateQuantity(newValue);\n }\n return true;\n };\n\n private readonly _renderQuantity = (\n props: IQuickviewExtentedProps,\n state: IBuyboxState,\n callbacks: IBuyboxCallbacks\n ): IBuyboxProductQuantityViewProps => {\n const { resources } = props;\n\n const {\n quantity,\n max,\n errorState: { quantityError }\n } = state;\n\n return {\n ContainerProps: {\n className: 'ms-quickView__quantity'\n },\n LabelContainerProps: {\n tag: 'label',\n className: 'ms-quickView__product-quantity-label',\n htmlFor: 'ms-quickView__product-quantity-input'\n },\n heading:
{resources.productQuantityHeading}
,\n errors: quantityError && (\n \n \n ),\n input: (\n \n )\n };\n };\n\n private _renderEmptyImage(imageSettings: IImageSettings | undefined): React.ReactNode {\n return (\n
\n \n
\n );\n }\n}\nexport default Quickview;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { getCartStateData, GetCartStateDataInput } from '@msdyn365-commerce/global-state';\nimport { ProductDimension } from '@msdyn365-commerce/retail-proxy';\nimport {\n getDimensionsForSelectedVariant,\n GetDimensionsForSelectedVariantInput,\n getPriceForSelectedVariant,\n getProductAvailabilitiesForSelectedVariant,\n getRatingsSummary,\n GetRatingsSummaryInput,\n getRnrEndpointId,\n getRnrPartnerId,\n getSelectedVariant,\n PriceForSelectedVariantInput,\n ProductAvailabilitiesForSelectedVariantInput,\n SelectedVariantInput\n} from '@msdyn365-commerce-modules/retail-actions';\n\nimport { IProductDetails } from '../../../common/buyboxInterface';\n\n/**\n * Calls the Retail API and returns the product details.\n * @param productId\n * @param channelId\n * @param ctx\n * @param selectedDimensions - Dimensions previously selected for the product variant.\n */\nexport async function getProductDetails(\n productId: number,\n channelId: number,\n ctx: IActionContext,\n selectedDimensions?: ProductDimension[]\n): Promise {\n const productDetails: IProductDetails = {};\n\n if (productId > 0 && channelId > 0) {\n const tenantId = getRnrPartnerId(ctx);\n const serviceEndPoint = getRnrEndpointId(ctx);\n\n // Get Product Details\n await getSelectedVariant(new SelectedVariantInput(productId, channelId, selectedDimensions, 'get', ctx.requestContext), ctx)\n .then(async productResult => {\n if (productResult) {\n productDetails.product = productResult;\n }\n })\n .catch(error => {\n ctx.telemetry.exception(error);\n });\n\n // Get Product Availability\n await getProductAvailabilitiesForSelectedVariant(new ProductAvailabilitiesForSelectedVariantInput(productId, channelId), ctx)\n .then(productAvailabilities => {\n if (productAvailabilities) {\n productDetails.productAvailableQuantity = productAvailabilities;\n }\n })\n .catch(error => {\n ctx.telemetry.exception(error);\n });\n\n // Get Product Price\n await getPriceForSelectedVariant(new PriceForSelectedVariantInput(productId, channelId, undefined), ctx)\n .then(productPrice => {\n if (productPrice) {\n productDetails.productPrice = productPrice;\n }\n })\n .catch(error => {\n ctx.telemetry.exception(error);\n });\n\n // Get product dimensions\n await getDimensionsForSelectedVariant(\n new GetDimensionsForSelectedVariantInput(productId, channelId, selectedDimensions, ctx.requestContext),\n ctx\n )\n .then(productDimensions => {\n if (productDimensions) {\n productDetails.productDimensions = productDimensions;\n }\n })\n .catch(error => {\n ctx.telemetry.exception(error);\n });\n\n // Get Cart State\n await getCartStateData(new GetCartStateDataInput(ctx.requestContext.apiSettings, ctx.requestContext), ctx)\n .then(cartState => {\n productDetails.cart = cartState;\n })\n .catch(error => {\n ctx.telemetry.exception(error);\n });\n\n // Get Product Ratings\n if (tenantId && serviceEndPoint) {\n await getRatingsSummary(new GetRatingsSummaryInput(productId.toString(), tenantId, serviceEndPoint), ctx)\n .then(ratingsSummaryData => {\n if (ratingsSummaryData) {\n productDetails.ratingsSummary = ratingsSummaryData;\n }\n })\n .catch(error => {\n ctx.telemetry.exception(error);\n });\n }\n }\n\n return productDetails;\n}\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 {\n IBuyboxAddToCartViewProps,\n IBuyboxAddToWishlistViewProps,\n IBuyboxKeyInPriceViewProps,\n IBuyboxProductConfigureDropdownViewProps,\n IBuyboxProductConfigureViewProps,\n IBuyboxProductQuantityViewProps\n} from '../../common';\nimport { IQuickviewViewProps } from './quickview';\n\nconst _renderAddToCart = (addToCart: IBuyboxAddToCartViewProps): JSX.Element => {\n const { ContainerProps, errorBlock, button } = addToCart;\n\n return (\n \n {errorBlock}\n {button}\n \n );\n};\n\nconst _renderAddToWishlist = (addToWishlist: IBuyboxAddToWishlistViewProps): JSX.Element => {\n const { ContainerProps, errorBlock, button } = addToWishlist;\n\n return (\n \n {errorBlock}\n {button}\n \n );\n};\n\nconst _renderConfigureDropdown = (dropdown: IBuyboxProductConfigureDropdownViewProps): JSX.Element => {\n const { ContainerProps, LabelContainerProps, heading, errors, select } = dropdown;\n\n return (\n \n \n {heading}\n {errors}\n \n {select}\n \n );\n};\n\nconst _renderQuickViewPopup = (props: IQuickviewViewProps): JSX.Element => {\n const {\n ModalContainer,\n ModalHeaderContainer,\n ModalFooterContainer,\n ModalHeaderContent,\n ModalBodyContainer,\n addToWishlist,\n addToCart,\n cartContainerProps\n } = props;\n\n return (\n \n {ModalHeaderContent}\n {_renderBodyContent(props)}\n \n \n {addToCart && _renderAddToCart(addToCart)}\n {addToWishlist && _renderAddToWishlist(addToWishlist)}\n \n \n \n );\n};\n\nconst _renderQuantity = (quantity: IBuyboxProductQuantityViewProps, quantityLimitsMessages: React.ReactNode): JSX.Element => {\n const { ContainerProps, LabelContainerProps, heading, input, errors } = quantity;\n\n return (\n \n \n {heading}\n {errors}\n \n {input}\n {quantityLimitsMessages}\n \n );\n};\n\nconst _renderKeyInPrice = (keyInPrice: IBuyboxKeyInPriceViewProps): JSX.Element => {\n const { ContainerProps, LabelContainerProps, heading, input } = keyInPrice;\n\n return (\n \n {heading}\n {input}\n \n );\n};\n\nconst _renderConfigure = (configure: IBuyboxProductConfigureViewProps): JSX.Element => {\n const { ContainerProps, dropdowns } = configure;\n\n return {dropdowns.map(_renderConfigureDropdown)};\n};\n\nconst _renderBodyContent = (props: IQuickviewViewProps): JSX.Element => {\n const {\n title,\n price,\n rating,\n keyInPrice,\n quantity,\n configure,\n inventoryLabel,\n quantityLimitsMessages,\n seeDetailsbutton,\n loading,\n ProductInfoContainerProps,\n MediaGalleryContainerProps,\n CarouselProps,\n unitOfMeasure\n } = props;\n if (loading) {\n return <>{loading};\n }\n return (\n <>\n \n \n \n \n {title}\n {price}\n {unitOfMeasure}\n {rating}\n {configure && _renderConfigure(configure)}\n {keyInPrice && _renderKeyInPrice(keyInPrice)}\n {quantity && _renderQuantity(quantity, quantityLimitsMessages)}\n {seeDetailsbutton}\n {inventoryLabel}\n \n \n );\n};\n\n/**\n * Functional component which renders quick view button and popup based by the given props file.\n * @param {IQuickviewViewProps} props - Configuration for the quick view component.\n * @returns {React.FC} - Functional component of the quick view.\n */\nexport const QuickViewFunctionalComponent: React.FC = (props: IQuickviewViewProps) => {\n const { quickView, quickViewButton, isModalOpen, isMobileDevice } = props;\n return (\n \n {!isMobileDevice && quickViewButton}\n {isModalOpen && _renderQuickViewPopup(props)}\n \n );\n};\n\nexport default QuickViewFunctionalComponent;\n"],"names":["GetSelectedQuantityValuesInput","constructor","getCacheKey","getCacheObjectType","dataCacheType","Msdyn365","action","async","input","ctx","selectedQuantity","id","args","GetOrderSummaryStateValuesInput","modelOpenValue","getProductsByCategoryId","context","categoryId","searchResult","searchByCategoryAsync","callerContext","actionContext","requestContext","apiSettings","channelId","catalogId","catch","error","console","log","length","sort","a","b","DisplayOrder","productIds","map","item","push","RecordId","getByIdsAsync","getProducts","categoryIDs","criterias","Context","ChannelId","CatalogId","CategoryIds","IncludeAttributes","searchAsync","getCustomerOrderHistory","hierarchy","customer","organisation","isUat","limit","source","dictionary","result","forEach","record","Children","Main","SubIDs","Products","j","generateDictionary","orderHistory","btgpTransactions","orders","getOrderHistoryAsync","AccountNumber","getByCustomerAllBTGPTransactionAsync","Email","getByCustomerAllBTGPTransactionFromHqAsync","i","transaction","JSON","parse","transactionNames","nameID","mainName","mainID","price","ProductCategoryID","found","find","parseInt","ProductID","Name","Price","ProductCategory","Number","ProductPrice","DedicationPeriod","findIndex","label","matchingOrder","order","Id","SalesOrderID","orderReceiptNo","ReceiptNo","SalesId","toString","EventDates","EventName","Names","OrderDate","DateOfTransaction","Date","Record","getTime","generateErrorLog","errorLogName","errorDetails","createBTGPErrorLogAsync","uuid","uuidv4","uuidValidate","uuidVersion","generateUUID","toISOString","CartLineID","CartID","EventID","SerialID","SerialNumber","SerialName","Name_1","Name_2","Name_3","Name_4","Name_5","Name_6","Name_7","Name_8","Name_9","Name_10","Name_11","Name_12","Name_13","Name_14","Name_15","Name_16","Name_17","Name_18","Name_19","Name_20","Remarks","Message","Category","DedicatedBy","HasTaxDeduction","Nric","BuildingName","UnitNumber","PostalCode","BirthDate","PhoneNumber","SchoolName","DonationOption","BlessingOption","CartLineComment","BirthTime","LightOption","ValidFrom","ValidTo","ParentCartLineID","Country","CompanyName","DeceasedRelationship","SurgeryDate","DeathDate","DeathTime","NameChange","OldName_1","OldName_2","BirthDate_2","BirthTime_2","StartDate","Gender","ChineseName","ContactNumber","NameNextKin","ContactNumberNextKin","PassportNumber","PassportExpiryDate","PassportIssuedDate","createOrUpdateCartline","createOrUpdateBTGPCartLineAsync","Form","IsValid","InvalidType","InCart","IsSubProduct","Consent","IsInsuranceIncluded","showNextOrPreviousPage","selectors","showClassName","hideClassName","showNextPage","showPageIndex","elements","document","querySelectorAll","htmlElement","classList","contains","remove","add","elementToShow","loadingProductListInHomePageOrPrecheckoutPage","className","productListEl","getElementsByClassName","overlayEl","hasChildNodes","style","display","intervalId","setInterval","clearInterval","showLoadingScreen","show","overlayTimeout","setTimeout","showLoadingScreenInstant","showTryAgainPrintReceiptPopUp","clearOverlayTimeout","clearTimeout","showStartOverBtnInHeader2","Array","from","element","buildKioskv3ReceiptItems","cart","_cart$cart$CartLines","_cart$cart$CartLines2","CartLines","cartLine","ProductId","simpleProductsResults","Ids","receiptItems","receiptItem","quantity","Quantity","productName","product","ProductName","totalAmount","comment","Comment","getValidProductImages","productId","imageSettings","selectedProduct","getCatalogId","actionInput","MediaLocationsForSelectedVariantInput","getMediaLocationsForSelectedVariant","then","mediaLocations","Promise","all","mediaLocation","imageData","src","Uri","altText","AltText","resolve","http","XMLHttpRequest","open","addEventListener","status","send","_unused","validateMediaLocaionAsync","pairs","filter","pair","telemetry","exception","debug","Quickview","React","props","super","dimensionUpdateQueue","FinitePromiseQueue","dimensions","quickViewCallbacks","updateQuantity","newQuantity","errorState","_objectSpread","this","state","quantityError","undefined","otherError","setState","updateErrorState","newErrorState","updateSelectedProduct","newSelectedProduct","newInventory","newPrice","newDeliveryOptions","productAvailableQuantity","productDeliveryOptions","_updatePrice","dimensionSelectedAsync","selectedDimensionId","selectedDimensionValueId","enqueue","_updateDimensions","FinitePromiseQueueError","ProcessWasDiscardedFromTheQueue","getDropdownName","dimensionType","resources","_getDropdownName","changeModalOpen","isModalOpen","_hideQuickViewDialog","changeUpdatingDimension","isUpdatingDimension","updateKeyInPrice","customPrice","customAmountError","isPriceKeyedIn","keyInPriceAmount","productPrice","defaultGalleryImageSettings","viewports","xs","q","w","h","sm","md","lg","lazyload","cropFocalRegion","defaultThumbnailImageSettings","_renderSeeDetailButton","config","payLoad","getPayloadObject","telemetryContent","TelemetryConstant","seeDetails","attributes","getTelemetryAttributes","Button","Object","assign","onClick","onTelemetryClick","seeDetailsLinkText","href","_getProductURL","_renderCarousel","_this$state$activeInd","mediaGalleryItems","keys","galleryImageSettings","ArrayExtensions","hasElements","index","_renderCarouselItemImageView","_renderEmptyImage","tag","Carousel","items","activeIndex","next","previous","interval","directionTextPrev","previousScreenshotFlipperText","directionTextNext","nextScreenshotFlipperText","indicatorAriaText","ariaLabelForSlide","onIndicatorsClickHandler","goToIndex","handleOnExited","onExited","handleOnExiting","onExiting","key","_renderThumbnails","thumbnailImageSettings","_getThumbnailItem","ThumbnailsContainerProps","SingleSlideCarouselComponentProps","SingleSlideCarousel","flipperPrevLabel","flipperNextLabel","parentId","useTabList","stringify","request","productDimensions","productDetails","dimensionsToUpdate","clearErrorState","errorHost","configureErrors","mappedDimensions","dimension","DimensionTypeValue","DimensionValue","_updateDimensionValue","ExtensionProperties","newProduct","getSelectedVariant","SelectedVariantInput","MasterProductId","getDimensionsForSelectedVariant","GetDimensionsForSelectedVariantInput","variantProduct","_variantProduct$produ","_variantProduct$Dimen","_this$props$data$feat","images","productVariant","lastUpdate","now","newAvailableQuantity","getProductAvailabilitiesForSelectedVariant","ProductAvailabilitiesForSelectedVariantInput","Dimensions","_dimension$DimensionV","Value","toLowerCase","isCustomPriceSelected","getPriceForSelectedVariant","PriceForSelectedVariantInput","RetailMulitplePickupMFeatureState","data","featureState","getDeliveryOptionsForSelectedVariant","GetDeliveryOptionsForSelectedVariantInput","IsEnabled","_updateQuantitiesInState","productDimensionFull","newValueId","DimensionValues","_this$productDetails","isGiftCard","IsGiftCard","productDimensionTypeColor","productDimensionTypeConfiguration","productDimensionTypeSize","productDimensionTypeAmount","productDimensionTypeStyle","animating","isLastItem","nextIndex","isFirstItem","_getCarouselItem","image","Image","gridSettings","loadFailureBehavior","role","modifiedActiveIndex","ThumbnailItemContainerProps","classnames","tabIndex","_generateOnThumbnailClick","onKeyDown","_generateOnThumbnailKeyDown","Picture","event","which","KeyCodes","Enter","Space","preventDefault","onClickHandler","_onClick","_event","ObjectExtensions","isNullOrUndefined","selectedProductId","modalOpen","selectedDimensions","tenantId","getRnrPartnerId","serviceEndPoint","getRnrEndpointId","productResult","productAvailabilities","getCartStateData","GetCartStateDataInput","cartState","getRatingsSummary","GetRatingsSummaryInput","ratingsSummaryData","ratingsSummary","getProductDetails","currentTime","_updateMediaItems","_product$productVaria","app","maxRecentlyViewedItemsCount","RecentlyViewedState","instance","ItemTypeValue","ReleasedProductType","Service","isServiceItem","isDataLoaded","_quickViewCloseButtonclick","onChangeHandler","callbacks","newValue","_renderQuantity","max","ContainerProps","LabelContainerProps","htmlFor","heading","productQuantityHeading","errors","IncrementalQuantity","currentCount","onChange","inputQuantityAriaLabel","decrementButtonAriaLabel","incrementButtonAriaLabel","minQuantityText","maxQuantityText","disabled","min","bind","getTelemetryObject","telemetryPageName","friendlyName","shouldComponentUpdate","nextProps","nextState","render","_this$productDetails2","_this$productDetails3","isMobileDevice","isMobile","variant","VariantType","Viewport","viewprops","quickView","moduleProps","quickViewButton","quickViewbuttonText","ModalContainer","Modal","isOpen","format","quickViewAriaLabel","toggle","modalTransition","timeout","shouldUpdateFocusToFirstElement","ModalHeaderContainer","ModalHeader","ModalFooterContainer","ModalFooter","ModalHeaderContent","ModalBodyContainer","ModalBody","cartContainerProps","ProductInfoContainerProps","MediaGalleryContainerProps","seeDetailsbutton","loading","Spinner","loadingText","size","SpinnerSize","large","title","getBuyboxProductTitle","description","getBuyboxProductDescription","configure","getBuyboxProductConfigure","getBuyboxProductPrice","unitOfMeasure","getBuyboxProductUnitOfMeasure","rating","hideRating","getBuyboxProductRating","addToCart","getBuyboxAddToCart","keyInPrice","enableKeyInPrice","getBuyboxKeyInPrice","inventoryLabel","getBuyBoxInventoryLabel","addToWishlist","getBuyboxProductAddToWishlist","quantityLimitsMessages","getQuantityLimitsMessages","CarouselProps","Thumbnails","renderView","lastUpdatedTime","_this$productDetails4","PrimaryImageUrl","_mapProductToImageData","arguments","CustomerContextualPrice","producturl","getProductPageUrlSync","_product$Behavior","_product$Behavior2","_product$Behavior3","_product$Behavior4","_isOrderQuantityLimitsFeatureEnabled","Behavior","MinimumQuantity","MaximumQuantity","maxQuantityForCartLineItem","_this$props$context$r","_featureStatuses$find","defaultOrderQuantityLimitsFeatureConfig","platform","enableDefaultOrderQuantityLimits","RetailDefaultOrderQuantityLimitsFeatureName","customerInfo","customerInformation","information","IsB2b","_renderConfigureDropdown","dropdown","select","Node","_renderQuickViewPopup","Module","_renderBodyContent","errorBlock","button","_renderAddToCart","_renderAddToWishlist","dropdowns","_renderConfigure","_renderKeyInPrice","QuickViewFunctionalComponent"],"sourceRoot":""}