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,iBAAKT,GAAmBG,IAGxC,EAtCqErC,IACjE,MAAM,QACF6C,EAAO,2BACPC,EAA0B,SAC1B5Y,EAAQ,kCACR6Y,EAAiC,mBACjCC,EAAkB,WAClByJ,EAAU,aACVY,GACArN,EAEJ,OAAI9V,EAEIgL,EAAAA,cAACuT,EAAAA,OAAM,iBAAK3F,GACPD,EACAwK,EACAZ,EAAac,EAAgBxK,EAAmC7Y,GAAY+a,EAAYjC,EAAoB9Y,KAIzH8V,EAAM9W,QAAQmV,UAAU5U,MAAM,4DACvB,cC/BX+jB,EAAOC,QAAUvY,cCAjBsY,EAAOC,QAAUC","sources":["webpack://mattressfirm/./src/Utilities/allRegex.ts?9889","webpack://mattressfirm/./src/Utilities/analytics/utagCaller.ts?3814","webpack://mattressfirm/./src/Utilities/constants.ts?8bdf","webpack://mattressfirm/./src/Utilities/emtpyChecker.ts?e2f5","webpack://mattressfirm/./src/Utilities/get-bv-attributes.ts?f55a","webpack://mattressfirm/./src/Utilities/get-delivery-by-message.tsx?05db","webpack://mattressfirm/./src/Utilities/get-page-path.ts?590a","webpack://mattressfirm/./src/Utilities/product-search-result-utils.tsx?58f2","webpack://mattressfirm/./src/actions/get-delivery-message.action.ts?965e","webpack://mattressfirm/./src/actions/EyebrowMessageDataServiceEntities.g.ts?c30c","webpack://mattressfirm/./src/actions/EyebrowMessageDataActionExtension.g.ts?1765","webpack://mattressfirm/./src/actions/get-eyebrow-message.action.ts?b0a0","webpack://mattressfirm/./src/actions/get-mfrm-products-category-paths.action.ts?dc81","webpack://mattressfirm/./src/data-actions/utilities/utils.ts?7452","webpack://mattressfirm/./src/themes/mattressfirm/custom-components/CustomSkeleton/index.tsx?ef9d","webpack://mattressfirm/./src/themes/mattressfirm/views/components/delivery-message/deliverymessage.component.tsx?e440","webpack://mattressfirm/./src/themes/mattressfirm/views/components/product.component.tsx?8ce2","webpack://mattressfirm/./src/Utilities/convert-to-titlecase.ts?8d6f","webpack://mattressfirm/./src/themes/mattressfirm/views/product-collection.view.tsx?e9f1","webpack://mattressfirm/./lib/product-collection/module-registration.js?36d3","webpack://mattressfirm/./src/modules/product-collection/product-collection.tsx?4008","webpack://mattressfirm/./src/modules/product-collection/product-collection.view.tsx?5d36","webpack://mattressfirm/external var \"React\"?0d3b","webpack://mattressfirm/external var \"ReactDOM\"?853b"],"sourcesContent":["import { ICoreContext } from '@msdyn365-commerce/core';\r\nexport const emailRegex = (emailValue: string) => {\r\n // eslint-disable-next-line security/detect-unsafe-regex\r\n const validationEmail = /^[-a-z0-9!#$%&'*+/=?^_`{|}~]+(?:\\.[-a-z0-9!#$%&'*+/=?^_`{|}~]+)*@(?:[a-z0-9]+(?:-+[a-z0-9]+)*\\.)+(?:xn--[a-z0-9]+|[a-z]{2,16})$/i;\r\n\r\n return validationEmail.test(emailValue);\r\n};\r\n\r\n/**\r\n * Method to remove special characters for product name from product URL\r\n * @param str string\r\n * @param ctx ICoreContext\r\n * @returns string\r\n */\r\n\r\nexport const removeSpecialChars = (str: string, ctx: ICoreContext): string => {\r\n if (ctx && ctx.request.app?.config.removeSpecialCharsPDP) {\r\n return str?.replace(/[^a-zA-Z0-9- ]/g, '');\r\n }\r\n return str;\r\n};\r\n\r\n\r\n/**\r\n * Method to remove special characters for product URL's path\r\n * @param str string\r\n * @param ctx ICoreContext\r\n * @returns string\r\n */\r\n\r\nexport const removeSpecialCharsFromURLPath = (str: string, ctx: ICoreContext): string => {\r\n if (ctx && ctx.request.app?.config.removeSpecialCharsPDP) {\r\n const urlPath = decodeURIComponent(str.split('.p')[0])?.replace(/[^a-zA-Z0-9-/ ]/g, '');\r\n return `${urlPath}.p`;\r\n }\r\n return str;\r\n};\r\n","import { IAnalyticsConfiguration } from './clickTrack';\r\n\r\n// Interface for 3rd-party function. AKA utag.\r\ninterface ITealium {\r\n link(data: {}): void | false;\r\n view(data: {}): void | false;\r\n data(data: {}): void | false;\r\n}\r\n\r\nexport interface IPromotionConfig {\r\n event?: string | null;\r\n event_name?: string | null;\r\n search_term?: string | null;\r\n search_type?: string | null;\r\n event_category?: string | null;\r\n event_action?: string | null;\r\n event_label?: string | null;\r\n event_type?: string | null;\r\n event_noninteraction?: string;\r\n enhanced_action?: string | null;\r\n customer_email?: string | undefined;\r\n customer_phone_number?: string | undefined;\r\n first_name?: string | undefined;\r\n last_name?: string | undefined;\r\n address1?: string | undefined;\r\n address2?: string | undefined;\r\n city?: string | undefined;\r\n state?: string | undefined;\r\n zip_code?: string | undefined;\r\n order_subtotal?: string | undefined;\r\n order_currency?: string | undefined;\r\n country?: string | undefined;\r\n // productConfig?: IProductDataConfig;\r\n checkout_step?: string;\r\n checkout_option?:(string | undefined)[];\r\n checkout_type?:(string | undefined)[];\r\n product_id?: (string | undefined)[];\r\n product_name?: (string | undefined)[];\r\n product_category?: (string | undefined)[];\r\n product_brand?: (string | undefined)[];\r\n product_variant?: (string | undefined | number)[];\r\n product_price?: (string | undefined)[];\r\n product_quantity?: (string | undefined)[];\r\n product_url?: (string | undefined)[];\r\n product_size?: (string | undefined)[];\r\n product_image_url?: (string | undefined)[];\r\n core_item_flag?: string | null;\r\n funnel_type?: string | null;\r\n ga_title?: string | null;\r\n ga_location?: string | null;\r\n order_quantity?: string | null;\r\n}\r\n\r\ninterface IProductDataConfig {\r\n product_variant?: (string | undefined)[];\r\n product_price?: (string | undefined)[];\r\n}\r\n\r\nexport interface IAnalyticsConfigurationData {\r\n productConfig?: IProductDataConfig;\r\n}\r\n\r\n\r\n// Legacy function\r\nexport const callUtag = async (objToCall: IPromotionConfig) => {\r\n void await callUtagLink(objToCall);\r\n};\r\n\r\n/**\r\n * Tealium dispatch click tracking.\r\n * @param objToCall\r\n */\r\nexport const callUtagLink = async (objToCall: IPromotionConfig | IAnalyticsConfiguration) => {\r\n try {\r\n Object.keys(objToCall).forEach(\r\n key => {\r\n if (objToCall[key] === null) {\r\n delete objToCall[key];\r\n }\r\n }\r\n );\r\n // If utag doesn't exist in the global scope, set as false.\r\n const utag: ITealium = global.hasOwnProperty('utag') ? global[\"utag\"] : false;\r\n if(utag) { utag.link(objToCall); }\r\n\r\n } catch (e) {\r\n console.log('Utag Error', e);\r\n }\r\n};\r\n\r\n/**\r\n * Tealium dispatch view tracking.\r\n * @param objToCall\r\n */\r\nexport const callUtagView = async (objToCall: {}) => {\r\n try {\r\n // If utag doesn't exist in the global scope, set as false.\r\n const utag: ITealium = global.hasOwnProperty('utag') ? global[\"utag\"] : false;\r\n if(utag) { utag.view(objToCall); }\r\n } catch (e) {\r\n console.log('utag View Error', e);\r\n }\r\n};\r\n\r\n/**\r\n * Not currently implemented.\r\n * @param objToCall\r\n * @param dataType\r\n */\r\nexport const callUtagData = ({ productConfig = {} }: IAnalyticsConfigurationData , dataType: string) => {\r\n try {\r\n // If utag doesn't exist in the global scope, set as false.\r\n const utag: ITealium = global.hasOwnProperty('utag') ? global[\"utag\"] : false;\r\n switch (dataType) {\r\n case 'data':\r\n // @ts-ignore\r\n if('utag' in window) { utag.data = {...utag.data, ...productConfig}; }\r\n break;\r\n case '_data':\r\n // @ts-ignore\r\n utag_data = {...utag_data , ...productConfig};\r\n break;\r\n default:\r\n null;\r\n }\r\n } catch (e) {\r\n console.log('Utag Error', e);\r\n }\r\n};","export const variantQueryStringName = 'variantid';","// tslint:disable\r\nexport const hasArray = (values: any): any[] | undefined => {\r\n return (typeof values !== 'string') && values && values.length ? values : undefined;\r\n};","import { AttributeValue } from '@msdyn365-commerce/retail-proxy';\r\n\r\nexport const getBVAttributeValues = (attributeValues: AttributeValue[] | undefined, key: string): number => {\r\n const value = +(attributeValues?.find(attr => attr.Name?.trim() === key)?.TextValue || 0);\r\n return Math.round(value * 10) / 10;\r\n};\r\n\r\nexport const getBVAttributeValuesUnbxd = (attributeValues: any | undefined, key: string): number => {\r\n const value = +(attributeValues[key] ?? 0);\r\n return Math.round(value * 10) / 10;\r\n};\r\n","import { IAny, ICoreContext, IGeneric } from '@msdyn365-commerce/core';\r\nimport { IMFICLDeliveryScheduleParameters } from '../actions/CoreProductDataServiceEntities.g';\r\nimport getDeliveryMessageAction, { GetDeliveryMessageInput } from '../actions/get-delivery-message.action';\r\n\r\nconst _getDeliveryByMessage = async (request: IMFICLDeliveryScheduleParameters, context: ICoreContext>, isCached?: boolean) => {\r\n if (request) {\r\n const getDeliveryMessageActionInput = new GetDeliveryMessageInput(request, isCached);\r\n try {\r\n let result;\r\n // eslint-disable-next-line prefer-const\r\n result = await getDeliveryMessageAction(getDeliveryMessageActionInput, context.actionContext);\r\n if (result) {\r\n return result;\r\n }\r\n } catch (error) {\r\n console.log('Error', error);\r\n }\r\n }\r\n return null;\r\n};\r\n\r\nexport default _getDeliveryByMessage;\r\n","import MsDyn365 from '@msdyn365-commerce/core';\r\n\r\nexport const getPagePath = (): string => {\r\n return MsDyn365.isBrowser\r\n ? window.location.href.split(location.host)[1].includes('?')\r\n ? window.location.href.split(location.host)[1].split('?')[0]\r\n : window.location.href.split(location.host)[1]\r\n : '';\r\n};","import { IAny, ICoreContext, IGeneric } from '@msdyn365-commerce/core';\r\nimport dayjs from 'dayjs';\r\nimport Cookies from 'universal-cookie';\r\nimport { IMFIATPInventoryEntity, IMFICartLine, IMFICLDeliveryScheduleParameters } from '../actions/CoreProductDataServiceEntities.g';\r\nimport { IMFIAvailablePromotionDescription, IMFIItem } from '../actions/EyebrowMessageDataServiceEntities.g';\r\nimport getEyebrowAction, { GetEyebrowMessageInput } from '../actions/get-eyebrow-message.action';\r\nimport _getDeliveryByMessage from './get-delivery-by-message';\r\nimport { IMFIATPInventoryEntityPLP } from '../actions/BatchCoreProductDataServiceEntities.g';\r\n\r\nexport const _getEyebrowMessage = async (products: IMFIItem[], context: ICoreContext>) => {\r\n const priceGroupForAPICall = context.app && context.app.config.priceGroup;\r\n if (products && products.length > 0 && (priceGroupForAPICall !== '' || priceGroupForAPICall !== undefined)) {\r\n const items: IMFIItem[] | undefined = [];\r\n products.map(item => {\r\n const singleItem: IMFIItem = {\r\n ItemId: item.ItemId,\r\n DistinctProductVariant: item.DistinctProductVariant\r\n };\r\n items.push(singleItem);\r\n });\r\n\r\n const requestBody: IMFIAvailablePromotionDescription = {\r\n PriceGroup: priceGroupForAPICall,\r\n Items: items\r\n };\r\n const getEyebrowMessageInput = new GetEyebrowMessageInput(requestBody, undefined, true);\r\n try {\r\n const result = await getEyebrowAction(getEyebrowMessageInput, context.actionContext);\r\n if (result) {\r\n return result;\r\n }\r\n } catch (error) {\r\n console.log('Error', error);\r\n }\r\n }\r\n return null;\r\n};\r\n\r\nexport const _makeDeliveryMessage = (days: string) => {\r\n if (days === '' || days === undefined || days === null) {\r\n return '';\r\n }\r\n\r\n let deliveryByMessage = '';\r\n let date = new Date();\r\n const daysSpan = days.split('-');\r\n let deliveryDate = Date.now();\r\n if (daysSpan && daysSpan[1] !== undefined && daysSpan.length) {\r\n let deliveryByMessageRange = '';\r\n daysSpan.map((item: string) => {\r\n date = new Date();\r\n deliveryDate = Date.now();\r\n if (parseInt(item, 10) > 0) {\r\n let numberOfDays = parseInt(item, 10);\r\n let newDate = deliveryDate;\r\n while (numberOfDays > 0) {\r\n newDate = date.setDate(date.getDate() + 1);\r\n if (dayjs(newDate).format('d') !== '0' && dayjs(newDate).format('d') !== '6') {\r\n numberOfDays--;\r\n }\r\n }\r\n deliveryByMessage = dayjs(newDate).format('MMM D');\r\n if (deliveryByMessageRange !== '') {\r\n deliveryByMessageRange = `${deliveryByMessageRange} to ${deliveryByMessage}`;\r\n } else {\r\n deliveryByMessageRange = deliveryByMessage;\r\n newDate = date.setDate(date.getDate() - parseInt(item[0], 10));\r\n }\r\n }\r\n });\r\n return `Delivery by ${deliveryByMessageRange}`;\r\n } else {\r\n deliveryByMessage = dayjs(deliveryDate).format('MMM D');\r\n let numberOfDays = parseInt(days, 10);\r\n let newDate = deliveryDate;\r\n let flag = true;\r\n while (numberOfDays > 0) {\r\n newDate = date.setDate(date.getDate() + 1);\r\n if (dayjs(newDate).format('d') !== '0' && dayjs(newDate).format('d') !== '6') {\r\n numberOfDays--;\r\n } else {\r\n flag = false;\r\n }\r\n }\r\n deliveryByMessage =\r\n flag && days === '1'\r\n ? `Tomorrow ${dayjs(Date.now()).format('MMM D')}`\r\n : dayjs(newDate).format('ddd MMM, D');\r\n return `Delivery by ${deliveryByMessage}`;\r\n }\r\n};\r\n\r\n// tslint:disable-next-line: no-any\r\nexport const _coreProductATPCall = async (\r\n itemLines: IMFICartLine[],\r\n setCoreProductATPData: React.Dispatch,\r\n context: ICoreContext>\r\n) => {\r\n const cookies = new Cookies();\r\n const zipcode = cookies.get('zip_code');\r\n if (itemLines && itemLines.length === 0) {\r\n setCoreProductATPData([]);\r\n }\r\n const currentDate = Date.now();\r\n const requestBody: IMFICLDeliveryScheduleParameters = {\r\n InventoryType: 'Delivery',\r\n Weeks: context.app.config.weeksPDPforATPCall,\r\n StoreId: '',\r\n Page: 'plp',\r\n RequestedDate: dayjs(currentDate).format('MM/DD/YYYY'),\r\n ZipCode: zipcode,\r\n ItemLines: itemLines\r\n };\r\n const getDeliveryByMessage = _getDeliveryByMessage(requestBody, context);\r\n getDeliveryByMessage\r\n .then(result => {\r\n if (result !== undefined && result?.ATPInventoryData && result?.ATPInventoryData.length > 0) {\r\n setCoreProductATPData(result?.ATPInventoryData);\r\n } else {\r\n setCoreProductATPData([]);\r\n }\r\n })\r\n .catch(e => {\r\n console.log('Error', e);\r\n });\r\n};\r\n\r\nconst _setTime = (time: string | undefined) => {\r\n if (time !== undefined && time !== '') {\r\n const temp = time.split(' ');\r\n if (temp && temp.length > 0) {\r\n let newDatewithTime = dayjs(Date.now()).format('M/D/YYYY');\r\n newDatewithTime = `${newDatewithTime} ${temp[0]}:00 ${temp[1].toUpperCase()}`;\r\n return newDatewithTime;\r\n }\r\n }\r\n return '';\r\n};\r\n\r\nexport interface IATPInventoryData {\r\n deliveryByMessage: string;\r\n locationId: string;\r\n}\r\n\r\nexport const _getSoonestDeliveryDate = (coreProductATPData: IMFIATPInventoryEntity[]): IATPInventoryData => {\r\n let deliveryDetails = {\r\n deliveryByMessage: '',\r\n locationId: ''\r\n };\r\n if (!coreProductATPData || !coreProductATPData.length) {\r\n return deliveryDetails;\r\n }\r\n for (let index = 0; index < coreProductATPData.length; index++) {\r\n const item = coreProductATPData[index];\r\n if (item.Available === 'YES' && item.ATPQuantity !== undefined && parseInt(item.ATPQuantity, 10) > 0) {\r\n const date = new Date();\r\n const today = dayjs(Date.now()).format('D M YY');\r\n const deliveryDate = dayjs(item.SlotDate).format('D M YY');\r\n const currHour = dayjs(Date.now()).format('H');\r\n if (today === deliveryDate) {\r\n const deliveryMessage =\r\n _setTime(item.StartTime) !== ''\r\n ? parseInt(dayjs(_setTime(item.StartTime)).format('H'), 10) < 14 && parseInt(currHour, 10) < 14\r\n ? `Delivery by Today ${dayjs(Date.now()).format('MMM D')}`\r\n : `Delivery by Tomorrow ${dayjs(date.setDate(date.getDate() + 1)).format('MMM D')}`\r\n : '';\r\n deliveryDetails = {\r\n deliveryByMessage: deliveryMessage,\r\n locationId: item.Location1!\r\n };\r\n break;\r\n } else {\r\n const deliveryMessage = `Delivery by ${dayjs(item.SlotDate).format('MMM D')}`;\r\n deliveryDetails = {\r\n deliveryByMessage: deliveryMessage,\r\n locationId: item.Location1!\r\n };\r\n break;\r\n }\r\n }\r\n }\r\n return deliveryDetails;\r\n};\r\n\r\nexport const _getDeliveryDate = (coreProductATPData: IMFIATPInventoryEntityPLP) => {\r\n let deliveryDetails = {\r\n deliveryByMessage: '',\r\n locationId: ''\r\n };\r\n const item = coreProductATPData;\r\n if (item.Available === 'YES' && item.ATPQuantity !== undefined && parseInt(item.ATPQuantity, 10) > 0) {\r\n const date = new Date();\r\n const today = dayjs(Date.now()).format('D M YY');\r\n const deliveryDate = dayjs(item.SlotDate).format('D M YY');\r\n const currHour = dayjs(Date.now()).format('H');\r\n const startTimeHour = item.StartTime?.substring(0,2) || \"14\";\r\n if (today === deliveryDate) {\r\n const deliveryMessage =\r\n parseInt(startTimeHour, 10) < 14 && parseInt(currHour, 10) < 14\r\n ? `Delivery by Today ${dayjs(Date.now()).format('MMM D')}`\r\n : `Delivery by Tomorrow ${dayjs(date.setDate(date.getDate() + 1)).format('MMM D')}`;\r\n deliveryDetails = {\r\n deliveryByMessage: deliveryMessage,\r\n locationId: item.Location1!\r\n };\r\n } else {\r\n const deliveryMessage = `Delivery by ${dayjs(item.SlotDate).format('MMM D')}`;\r\n deliveryDetails = {\r\n deliveryByMessage: deliveryMessage,\r\n locationId: item.Location1!\r\n };\r\n }\r\n }\r\n return deliveryDetails;\r\n};\r\n\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\nimport { mFIATPInventoryAsync } from './CoreProductDataActionExtension.g';\r\nimport { IMFIATPInventoryResponse, IMFICLDeliveryScheduleParameters } from './CoreProductDataServiceEntities.g';\r\n\r\n/**\r\n * GetDeliveryMessage Input Action\r\n */\r\n\r\nexport class GetDeliveryMessageInput implements Msdyn365.IActionInput {\r\n // Construct the input needed to run the action\r\n public input: IMFICLDeliveryScheduleParameters;\r\n public isCached?: boolean;\r\n constructor(input: IMFICLDeliveryScheduleParameters, isCached: boolean = true) {\r\n this.input = input;\r\n this.isCached = isCached;\r\n }\r\n\r\n // 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 = () =>\r\n `Get-Delivery-Message${this.input.ZipCode}-${this.input.ItemLines![0].ItemId}-${this.input.ItemLines![0].VariantRecordId}`;\r\n // public getCacheKey = () => 'do';\r\n public getCacheObjectType = () => 'GetDeliveryMessageResult';\r\n public dataCacheType = (): Msdyn365.CacheType => (this.isCached ? 'request' : 'none');\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\n// const createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n// return new GetDeliveryMessageInput();\r\n// };\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function getDeliveryMessageAction(\r\n request: GetDeliveryMessageInput,\r\n ctx: Msdyn365.IActionContext\r\n): Promise {\r\n if (request.input) {\r\n try {\r\n const result = await mFIATPInventoryAsync({ callerContext: ctx }, request.input);\r\n if (result) {\r\n return result;\r\n }\r\n } catch (error) {\r\n console.log('Error', error);\r\n }\r\n }\r\n return null;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getDeliveryMessageAction,\r\n // Give your data action a unique id\r\n id: 'GetDeliveryMessage'\r\n // input: createInput\r\n // Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","// tslint:disable\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as Entities from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\n/**\r\n * MFIPromotion entity interface.\r\n */\r\nexport interface IMFIPromotion {\r\n ItemId: string;\r\n DistinctProductVariant?: string;\r\n EyeBrows?: Entities.Promotion[];\r\n ExtensionProperties?: Entities.CommerceProperty[];\r\n}\r\n\r\n/**\r\n * MFIAvailablePromotionDescription entity interface.\r\n */\r\nexport interface IMFIAvailablePromotionDescription {\r\n PriceGroup?: string;\r\n Items?: IMFIItem[];\r\n}\r\n\r\n/**\r\n * MFIItem entity interface.\r\n */\r\nexport interface IMFIItem {\r\n ItemId?: string;\r\n DistinctProductVariant?: string;\r\n}\r\n\r\n/**\r\n * MFIPromotion entity class.\r\n */\r\nexport class MFIPromotionExtensionClass implements IMFIPromotion {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ItemId: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public DistinctProductVariant: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public EyeBrows: Entities.Promotion[];\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ExtensionProperties: Entities.CommerceProperty[];\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ItemId = odataObject.ItemId;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.DistinctProductVariant = odataObject.DistinctProductVariant;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.EyeBrows = undefined;\r\n if (odataObject.EyeBrows) {\r\n this.EyeBrows = [];\r\n for (let i = 0; i < odataObject.EyeBrows.length; i++) {\r\n if (odataObject.EyeBrows[i]) {\r\n if (odataObject.EyeBrows[i]['@odata.type']) {\r\n let className: string = odataObject.EyeBrows[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className]) {\r\n this.EyeBrows[i] = new EntityClasses[className](odataObject.EyeBrows[i]);\r\n }\r\n } else {\r\n this.EyeBrows[i] = new EntityClasses.PromotionClass(odataObject.EyeBrows[i]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.EyeBrows[i] = undefined;\r\n }\r\n }\r\n }\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties = undefined;\r\n if (odataObject.ExtensionProperties) {\r\n this.ExtensionProperties = [];\r\n for (let i = 0; i < odataObject.ExtensionProperties.length; i++) {\r\n if (odataObject.ExtensionProperties[i]) {\r\n if (odataObject.ExtensionProperties[i]['@odata.type']) {\r\n let className: string = odataObject.ExtensionProperties[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className]) {\r\n this.ExtensionProperties[i] = new EntityClasses[className](odataObject.ExtensionProperties[i]);\r\n }\r\n } else {\r\n this.ExtensionProperties[i] = new EntityClasses.CommercePropertyClass(odataObject.ExtensionProperties[i]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties[i] = undefined;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * MFIAvailablePromotionDescription entity class.\r\n */\r\nexport class MFIAvailablePromotionDescriptionExtensionClass implements IMFIAvailablePromotionDescription {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public PriceGroup: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Items: IMFIItem[];\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.PriceGroup = odataObject.PriceGroup;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Items = undefined;\r\n if (odataObject.Items) {\r\n this.Items = [];\r\n for (let i = 0; i < odataObject.Items.length; i++) {\r\n if (odataObject.Items[i]) {\r\n if (odataObject.Items[i]['@odata.type']) {\r\n let className: string = odataObject.Items[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className]) {\r\n this.Items[i] = new EntityClasses[className](odataObject.Items[i]);\r\n }\r\n } else {\r\n this.Items[i] = new MFIItemExtensionClass(odataObject.Items[i]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Items[i] = undefined;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * MFIItem entity class.\r\n */\r\nexport class MFIItemExtensionClass implements IMFIItem {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ItemId: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public DistinctProductVariant: string;\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ItemId = odataObject.ItemId;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.DistinctProductVariant = odataObject.DistinctProductVariant;\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 * THIS FILE IS AN AUTOGENERATED TYPESCRIPT PROXY EXTENSION.\r\n * TO USE THIS FILE, IT MUST BE ADDED TO A D365COMMERCE APPLICATION\r\n */\r\n// tslint:disable\r\nimport {\r\n AsyncResult,\r\n callActionOrExecute,\r\n DataServiceQuery,\r\n IContext,\r\n IDataServiceRequest,\r\n IQueryResultSettings\r\n} from '@msdyn365-commerce/retail-proxy';\r\n// @ts-ignore\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as DataServiceEntities from './EyebrowMessageDataServiceEntities.g';\r\n\r\n// @ts-ignore\r\nfunction availablePromotionsDescriptionsQuery(itemId?: string): DataServiceQuery {\r\n const key = itemId ? { ItemId: itemId } : null;\r\n return new DataServiceQuery('AvailablePromotionsDescriptions', 'MFIPromotion', DataServiceEntities.MFIPromotionExtensionClass, key);\r\n}\r\n\r\nexport function createMFIGetAvailablePromotionsDescriptionInput(\r\n queryResultSettings: IQueryResultSettings,\r\n availablePromotionsDescription: DataServiceEntities.IMFIAvailablePromotionDescription\r\n): IDataServiceRequest {\r\n const query = availablePromotionsDescriptionsQuery().resultSettings(queryResultSettings);\r\n return query.createDataServiceRequestForOperation(\r\n 'MFIGetAvailablePromotionsDescription',\r\n true,\r\n DataServiceEntities.MFIPromotionExtensionClass,\r\n 'true',\r\n { bypassCache: 'get', returnEntity: 'DataServiceEntities.IMFIPromotion' },\r\n { availablePromotionsDescription: availablePromotionsDescription }\r\n );\r\n}\r\n\r\nexport function mFIGetAvailablePromotionsDescriptionAsync(\r\n context: IContext,\r\n availablePromotionsDescription: DataServiceEntities.IMFIAvailablePromotionDescription\r\n): AsyncResult {\r\n const request = createMFIGetAvailablePromotionsDescriptionInput(context.queryResultSettings || {}, availablePromotionsDescription);\r\n return callActionOrExecute(request, context.callerContext);\r\n}\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// tslint:disable-next-line: no-duplicate-imports\r\nimport { IActionContext } from '@msdyn365-commerce/core';\r\nimport { CacheType } from '@msdyn365-commerce/retail-proxy';\r\nimport { mFIGetAvailablePromotionsDescriptionAsync } from './EyebrowMessageDataActionExtension.g';\r\nimport { IMFIAvailablePromotionDescription, IMFIPromotion } from './EyebrowMessageDataServiceEntities.g';\r\n/**\r\n * GetEyebrowMessage Input Action\r\n */\r\n\r\nexport class GetEyebrowMessageInput implements Msdyn365.IActionInput {\r\n // Construct the input needed to run the action\r\n public item: IMFIAvailablePromotionDescription;\r\n public isCached?: boolean;\r\n public pageType?: string;\r\n private readonly createCacheKey: string | '';\r\n constructor(item: IMFIAvailablePromotionDescription, pageType?: string, isCached?: boolean) {\r\n this.item = item;\r\n this.isCached = isCached;\r\n this.pageType = pageType;\r\n // incase of pdp cache key will be based on variantId and on PLP will be basded on ItemId\r\n this.createCacheKey =\r\n this.item.Items?.map(obj => (this.pageType === 'pdp' ? obj?.DistinctProductVariant : obj?.ItemId))\r\n .join('-')\r\n .toString() || '';\r\n }\r\n\r\n // 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 = () => `Get-Eyebrow-Message-${this.createCacheKey}`;\r\n // public getCacheKey = () => 'EyebrowMessage';\r\n public getCacheObjectType = () => 'EyebrowMessage';\r\n public dataCacheType = (): CacheType => (this.isCached ? 'application' : 'application');\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function getEyebrowAction(input: GetEyebrowMessageInput, ctx: IActionContext): Promise {\r\n try {\r\n const result = await mFIGetAvailablePromotionsDescriptionAsync(\r\n { callerContext: ctx, queryResultSettings: { Paging: { Top: 50 } } },\r\n input.item\r\n );\r\n if (result) {\r\n return result;\r\n }\r\n } catch (error) {\r\n console.log('Error', error);\r\n }\r\n return null;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getEyebrowAction,\r\n // Give your data action a unique id\r\n id: 'GetEyebrowMessage'\r\n // Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\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 ICommerceApiSettings,\r\n ICreateActionContext,\r\n IGeneric,\r\n IRequestContext\r\n} from '@msdyn365-commerce/core';\r\n// import { ICategoryPath, ICategoryUrl } from '@msdyn365-commerce/core-internal/dist/types/interfaces/ICategoryPathInterfaces';\r\nimport { getCategoryPathsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { CategoryPathLookup, CategoryPathResult } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport { hasArray } from '../Utilities/emtpyChecker';\r\n\r\n/**\r\n * Category path input\r\n */\r\nexport class GetCategoryPathsInput implements IActionInput {\r\n public readonly ChannelId: number;\r\n public CatalogId?: number;\r\n public productIds?: number[];\r\n // public readonly categoryPathLooksups: CategoryPathLookup[];\r\n public readonly apiSettings: ICommerceApiSettings;\r\n // @ts-ignore\r\n private constructedCacheKey: string | undefined;\r\n\r\n constructor(context: IRequestContext, catalogId?: number, productIds?: number[]) {\r\n this.ChannelId = context.apiSettings.channelId;\r\n this.CatalogId = catalogId; // context.apiSettings.catalogId || 0;\r\n this.productIds = productIds;\r\n // this.categoryPathLooksups = categoryPathLooksups;\r\n this.apiSettings = context.apiSettings;\r\n this.constructedCacheKey = '';\r\n // categoryPathLooksups.forEach(categoryPath=> {\r\n // this.constructedCacheKey+=`${categoryPath.ProductId && categoryPath.ProductId.toString()}|`;\r\n // });\r\n this.constructedCacheKey = this.productIds?.map(ids => ids).join('-').toString();\r\n this.constructedCacheKey += `${this.ChannelId?.toString()}|`;\r\n this.constructedCacheKey += `${this.CatalogId?.toString()}|`;\r\n }\r\n\r\n public getCacheKey = () => `MFRMProductCategoryPath-${this.constructedCacheKey}`;\r\n public getCacheObjectType = () => 'MFRMProductCategoryPath';\r\n public dataCacheType = (): CacheType => 'application';\r\n}\r\n\r\n/**\r\n * Creates the input required to make the getCategoryPath retail api call\r\n */\r\nexport const createGetCategoryPathsInput = (\r\n inputData: GetCategoryPathsInput,\r\n context: ICreateActionContext>\r\n): IActionInput => {\r\n const productId = inputData.productIds;\r\n if (productId) {\r\n return new GetCategoryPathsInput(context.requestContext, inputData.CatalogId, inputData.productIds);\r\n } else {\r\n throw new Error('Unable to create SelectedVariantInput, no productId found on module config or query');\r\n }\r\n};\r\n\r\n/**\r\n * Calls the Retail API and returns the category path for a product\r\n */\r\nexport async function getProductsCategoryPathsAction(input: GetCategoryPathsInput, ctx: IActionContext): Promise {\r\n const catPaths: CategoryPathLookup[] = [];\r\n if (!hasArray(input.productIds)) {\r\n return [];\r\n }\r\n for (let productsIter = 0; productsIter < input.productIds!.length; productsIter++) {\r\n catPaths.push({ ProductId: input.productIds![productsIter] });\r\n }\r\n try {\r\n return await getCategoryPathsAsync({ callerContext: ctx, queryResultSettings: { Paging: { Top: input.productIds!.length }, Sorting: {} } }, input.ChannelId, input.CatalogId!, catPaths);\r\n } catch (err) {\r\n console.log(err);\r\n return [];\r\n }\r\n}\r\n\r\nexport const getCategoryPathsActionDataAction = createObservableDataAction({\r\n id: 'GetMFRMProductsCategoryPaths',\r\n action: >getProductsCategoryPathsAction,\r\n input: createGetCategoryPathsInput\r\n});\r\n\r\nexport default getCategoryPathsActionDataAction;\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { IAny, ICommerceApiSettings, ICoreContext, ICreateActionContext, IGeneric, IRequestContext } from '@msdyn365-commerce/core';\r\nimport {\r\n AsyncResult, CartLine, CommerceListLine, ProductDimension,\r\n ProductDimensionType, ProductSearchResult, SimpleProduct\r\n} from '@msdyn365-commerce/retail-proxy';\r\n\r\nimport { ProductDetailsCriteria, InventoryLevels, ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { variantQueryStringName } from '../../Utilities/constants';\r\n// import { parseSearchData } from '@msdyn365-commerce-modules/retail-actions/src/utilities/input-data-parser';\r\n\r\nexport const wrapInResolvedAsyncResult = (input: T | null | undefined): AsyncResult => {\r\n return >{\r\n status: 'SUCCESS',\r\n result: input,\r\n metadata: {}\r\n };\r\n};\r\n\r\nexport const wrapInRejectedAsyncResult = (input: T | null | undefined): AsyncResult => {\r\n return >{\r\n status: 'FAILED',\r\n result: input,\r\n metadata: {}\r\n };\r\n};\r\n\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 * @param inputData - The Action Input data.\r\n * @returns Productid or undefined.\r\n */\r\nexport const getSelectedProductIdFromActionInput = (inputData: ICreateActionContext>): string | undefined => {\r\n const context = inputData.requestContext;\r\n const variantId = context.app.config.queryBasedVariantSelection ? getQueryParamsFromQueryByName(context.url.requestUrl, variantQueryStringName) : undefined;\r\n\r\n if (variantId) {\r\n return variantId;\r\n } else if (context.query?.productId) {\r\n return context.query.productId;\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Exsiting code.\r\n } else if (context.urlTokens && inputData.requestContext.urlTokens.itemId && inputData.requestContext.urlTokens.pageType === 'Product') {\r\n return context.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\nexport const getQueryParamsFromQueryByName = (inputUrl: URL, queryParamName: string) => {\r\n const urlWithIgnoredCase = new URL(inputUrl.toString().toLocaleLowerCase());\r\n const urlParameters = urlWithIgnoredCase.searchParams;\r\n const value = urlParameters.get(queryParamName.trim().toLocaleLowerCase());\r\n if (!value || Number.isNaN(Number(value))) {\r\n return undefined;\r\n }\r\n return value;\r\n};\r\n/**\r\n * Generates a Image URL based on data return from retail server.\r\n * @param imageUrl The image url returned by Retail Server.\r\n * @param ctx The request context.\r\n * @param apiSettings\r\n */\r\nexport const generateImageUrl = (imageUrl: string | undefined, apiSettings: ICommerceApiSettings): string | undefined => {\r\n if (imageUrl) {\r\n // Images hosted in CMS include schema\r\n if (imageUrl.startsWith('http')) {\r\n return imageUrl;\r\n }\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(imageUrl);\r\n }\r\n\r\n // D365Commerce.telemetry.warning(`Unable to generate a proper Image URL for Product: ${product.RecordId}`);\r\n return undefined;\r\n\r\n};\r\n\r\n/**\r\n * Represents app configuration for dimensions.\r\n */\r\nexport interface IDimensionsConfig {\r\n dimensionsAsSwatchType?: DimensionTypes[];\r\n dimensionsInProductCard?: DimensionTypes[];\r\n inventoryLevel?: InventoryLevels;\r\n dimensionToPreSelectInProductCard?: DimensionTypes;\r\n}\r\n\r\n/**\r\n * Represents app configuration for dimensions.\r\n */\r\nexport interface IDimensionsApp {\r\n config: IDimensionsConfig;\r\n}\r\n\r\n/**\r\n * Represents product dimension types.\r\n */\r\nexport enum DimensionTypes {\r\n none = 'none',\r\n color = 'color',\r\n configuration = 'configuration',\r\n size = 'size',\r\n style = 'style'\r\n}\r\n\r\n/**\r\n * Defines display configuration types.\r\n */\r\nexport enum DimensionSwatchDisplayTypes {\r\n default = 'default',\r\n productCard = 'productCard'\r\n}\r\n\r\n/**\r\n * Checks if rendering the particular dimensions is allowed.\r\n * @param dimensionType - Dimension to be displayed.\r\n * @param context - Core application context.\r\n * @param displayType - The swatch location, the component from which it comes from.\r\n * @returns Updates the state with new product page url.\r\n */\r\nexport const checkIfShouldDisplayAsSwatch = (\r\n dimensionType: DimensionTypes,\r\n context: ICoreContext,\r\n displayType: DimensionSwatchDisplayTypes = DimensionSwatchDisplayTypes.default): boolean => {\r\n\r\n // Additional checks for the product card since it has a separate config setting.\r\n if (displayType === DimensionSwatchDisplayTypes.productCard) {\r\n const dimensionsToDisplayOnProductCard = context.app.config.dimensionsInProductCard;\r\n if (!ArrayExtensions.hasElements(dimensionsToDisplayOnProductCard) ||\r\n dimensionsToDisplayOnProductCard.includes(DimensionTypes.none) ||\r\n !dimensionsToDisplayOnProductCard.includes(dimensionType)) {\r\n return false;\r\n }\r\n }\r\n\r\n const dimensionsToDisplayAsSwatch = context.app.config.dimensionsAsSwatchType;\r\n return ArrayExtensions.hasElements(dimensionsToDisplayAsSwatch) &&\r\n !dimensionsToDisplayAsSwatch.includes(DimensionTypes.none) &&\r\n dimensionsToDisplayAsSwatch.includes(dimensionType);\r\n};\r\n\r\n/**\r\n * Generates an image URL for a swatch.\r\n * @param imageUrl - The image url returned by Retail Server.\r\n * @param apiSettings - The request context.\r\n * @returns Full image url.\r\n */\r\nexport const generateSwatchImageUrl = (imageUrl: string, apiSettings: ICommerceApiSettings): string => {\r\n if (imageUrl.startsWith('http')) {\r\n return imageUrl;\r\n }\r\n\r\n return apiSettings.baseImageUrl + encodeURIComponent(imageUrl);\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 ctx The request context.\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 return generateImageUrl(product.PrimaryImageUrl, apiSettings);\r\n};\r\n\r\n/**\r\n * Creates a CartLine object from the passed data.\r\n * @param product The product.\r\n * @param quantity The quantity.\r\n * @param catalogId The catalog.\r\n */\r\nexport const buildCartLine = (product: SimpleProduct, quantity?: number, catalogId?: number): CartLine => {\r\n return {\r\n CatalogId: catalogId || 0,\r\n Description: product.Description,\r\n\r\n // TODO: Investigate this value and what it represents\r\n EntryMethodTypeValue: 3,\r\n ItemId: product.ItemId,\r\n ProductId: product.RecordId,\r\n Quantity: quantity || 1,\r\n TrackingId: '',\r\n UnitOfMeasureSymbol: product.DefaultUnitOfMeasure\r\n };\r\n};\r\n\r\n/**\r\n * Creates a CommerceListLine (also know as WishlistLine) object from the passed data.\r\n * @param productId The RecordId of the Product to be added.\r\n * @param customerId The account number of the customer.\r\n * @param wishlistId The Id of the commerce list.\r\n */\r\nexport const buildWishlistLine = (productId: number, customerId: string, wishlistId: number): CommerceListLine => {\r\n return {\r\n CommerceListId: wishlistId,\r\n ProductId: productId,\r\n CustomerId: customerId\r\n };\r\n};\r\n\r\n/**\r\n * Utility function to prepare the product details criteria before getting full product:\r\n * @param inputData The Action Input data\r\n */\r\nexport const getProductDetailsCriteriaFromActionInput = (inputData: ICreateActionContext>): ProductDetailsCriteria => {\r\n if (inputData && inputData.config) {\r\n return {\r\n getPrice: !inputData.config.hidePrice,\r\n getRating: !inputData.config.hideRating\r\n };\r\n }\r\n return {\r\n getPrice: true,\r\n getRating: true\r\n };\r\n};\r\n\r\n/**\r\n * Transforms search text into the expected 'search terms' format, expected by refiner APIs.\r\n * @param searchText Free-form text used for searching for products or categories of products.\r\n */\r\nexport const ensureSearchTextIsFormedProperly = (searchText: string): string => {\r\n const prefix = searchText.startsWith('\\'') ? '' : '\\'';\r\n const suffix = searchText.endsWith('\\'') ? '' : '\\'';\r\n return `${prefix}${searchText}${suffix}`;\r\n};\r\n\r\nexport const ensureSafeSearchText = (searchText: string): string => {\r\n return searchText?.replace(/[^\\d\\sA-Za-z]+/g, '');\r\n};\r\n\r\nexport const buildCacheKey = (base: string, apiSettings: ICommerceApiSettings, locale?: string): string => {\r\n return `${base}-chanId:${apiSettings.channelId}-catId:${apiSettings.catalogId}${locale ? `-${locale}` : ''}`;\r\n};\r\n\r\nexport const buildCacheKeyWithUrlTokens = (base: string, requestContext: IRequestContext): string => {\r\n const urlTokens = requestContext.urlTokens;\r\n const defaultCacheKey = buildCacheKey(base, requestContext.apiSettings, requestContext.locale);\r\n return urlTokens ? `${defaultCacheKey}-${urlTokens.itemId}-${urlTokens.recordId}-${urlTokens.pageType}` : defaultCacheKey;\r\n};\r\n\r\n/**\r\n * Generates a key from set of arguments as inputs.\r\n *\r\n * @param args Argument list of pivots to generate key from.\r\n * @param handler Handler function for null/undefined values.\r\n */\r\n\r\ntype TKeyTypes = string | number | boolean | null | undefined;\r\ninterface IGenerateKeyOptions {\r\n separator?: string;\r\n handler?(input: null | undefined): string;\r\n}\r\nexport const generateKey = (args: TKeyTypes[], options?: IGenerateKeyOptions): string => {\r\n const { handler, separator }: IGenerateKeyOptions = { ...{ separator: '-', handler: undefined }, ...(options || {}) };\r\n return args\r\n .map(arg => {\r\n if (arg === null || arg === undefined) {\r\n if (handler) {\r\n return handler(arg);\r\n }\r\n }\r\n return arg;\r\n })\r\n .join(separator);\r\n};\r\n\r\n/**\r\n * Gets the fall back image url for a variant image.\r\n * @param itemId Item id of a product.\r\n * @param apiSettings Api setting from request context.\r\n */\r\nexport const getFallbackImageUrl = (itemId: string | undefined, apiSettings: ICommerceApiSettings): string | undefined => {\r\n if (!itemId) {\r\n return '';\r\n }\r\n\r\n const parsedItemId = itemId.trim().split(' ')[0];\r\n\r\n const productUrl = `Products/${parsedItemId}_000_001.png`;\r\n return generateImageUrl(productUrl, apiSettings);\r\n};\r\n\r\n/**\r\n * Converts retail proxy product dimension type to display dimension type.\r\n * @param productDimensionType - Product dimension type from retail proxy.\r\n * @returns Local dimension type.\r\n */\r\nexport const convertProductDimensionTypeToDimensionTypes = (productDimensionType: ProductDimensionType): DimensionTypes => {\r\n switch (productDimensionType) {\r\n case ProductDimensionType.Color:\r\n return DimensionTypes.color;\r\n case ProductDimensionType.Configuration:\r\n return DimensionTypes.configuration;\r\n case ProductDimensionType.Size:\r\n return DimensionTypes.size;\r\n case ProductDimensionType.Style:\r\n return DimensionTypes.style;\r\n default:\r\n return DimensionTypes.none;\r\n }\r\n};\r\n\r\n/**\r\n * Converts display dimension type to retail proxy product dimension type.\r\n * @param dimensionType - Local dimension type.\r\n * @returns Product dimension type from retail proxy.\r\n */\r\nexport const convertDimensionTypeToProductDimensionType = (dimensionType: DimensionTypes): ProductDimensionType => {\r\n switch (dimensionType) {\r\n case DimensionTypes.color:\r\n return ProductDimensionType.Color;\r\n case DimensionTypes.configuration:\r\n return ProductDimensionType.Configuration;\r\n case DimensionTypes.size:\r\n return ProductDimensionType.Size;\r\n case DimensionTypes.style:\r\n return ProductDimensionType.Style;\r\n default:\r\n return ProductDimensionType.None;\r\n }\r\n};\r\n\r\n/**\r\n * Sets dimensions to url.\r\n * @param inputUrl - Url to update.\r\n * @param productDimensions - Dimensions to set.\r\n */\r\nexport const setDimensionValuesToQuery = (inputUrl: URL, productDimensions: ProductDimension[]): void => {\r\n for (const dimension of productDimensions) {\r\n inputUrl.searchParams.set(\r\n convertProductDimensionTypeToDimensionTypes(dimension.DimensionTypeValue), dimension.DimensionValue?.Value ?? '');\r\n }\r\n\r\n window.history?.replaceState(window.history.state, '', inputUrl.toString()?.replace(inputUrl.host, window.location.host));\r\n};\r\n\r\n/**\r\n * Retrieves dimension value stored in url.\r\n * @param urlParameters - Url parameters.\r\n * @param productDimensionType - The dimension type to retrieve.\r\n * @returns Product dimension item.\r\n */\r\nconst parseDimensionFromUrl = (urlParameters: URLSearchParams, productDimensionType: ProductDimensionType): ProductDimension | undefined => {\r\n const localDimensionType = convertProductDimensionTypeToDimensionTypes(productDimensionType);\r\n const value = urlParameters.get(localDimensionType);\r\n if (!value) {\r\n return undefined;\r\n }\r\n return {\r\n DimensionTypeValue: productDimensionType,\r\n DimensionValue: {\r\n RecordId: 0,\r\n Value: value\r\n }\r\n };\r\n};\r\n\r\n/**\r\n * Retrieves all dimensions from URL.\r\n * @param urlParameters - Url parameters.\r\n * @returns Product dimensions stored in url.\r\n */\r\nconst parseDimensionsFromUrl = (urlParameters: URLSearchParams): ProductDimension[] => {\r\n const dimensionsToParse: ProductDimensionType[] = [\r\n ProductDimensionType.Color,\r\n ProductDimensionType.Configuration,\r\n ProductDimensionType.Size,\r\n ProductDimensionType.Style\r\n ];\r\n const parsedDimensions = dimensionsToParse.map(dimension => parseDimensionFromUrl(urlParameters, dimension));\r\n return ArrayExtensions.validValues(parsedDimensions);\r\n};\r\n\r\n/**\r\n * Utility function to extract the dimension values from input url querystring.\r\n * @param inputUrl - The request url.\r\n * @returns The selected dimension values.\r\n */\r\nexport const getDimensionValuesFromQuery = (inputUrl: URL): ProductDimension[] => {\r\n const urlWithIgnoredCase = new URL(inputUrl.toString().toLocaleLowerCase());\r\n const urlParameters = urlWithIgnoredCase.searchParams;\r\n const dimensions: ProductDimension[] = parseDimensionsFromUrl(urlParameters);\r\n return dimensions;\r\n};\r\n","import React, { FunctionComponent } from 'react';\r\n\r\n\r\ninterface Props {\r\n /** Sets the skeleton-pulse style */\r\n type?: 'text' | 'image' | 'button' | 'button-secondary';\r\n /** Sets the width of the skeleton. Default unit is px. */\r\n width?: number | string;\r\n /** Sets the height of the skeleton. Default unit is px. */\r\n height?: number | string;\r\n /** Makes the skeleton look like a circle */\r\n circle?: boolean;\r\n /** Override classNames on wrapper */\r\n className?: string;\r\n /** Override styles on wrapper */\r\n style?: object;\r\n [rest: string]: unknown; // ...rest property\r\n}\r\n\r\nconst getValidCSSInput = (input: string | number) => {\r\n switch (typeof input) {\r\n case 'undefined':\r\n case 'boolean':\r\n return null;\r\n case 'number':\r\n return `${input}px`;\r\n default:\r\n const parsedInput = parseFloat(input);\r\n const unit = input.match(/%|em/);\r\n return isNaN(parsedInput) ? '' : unit ? `${parsedInput}${unit}` : `${parsedInput}px`;\r\n }\r\n};\r\n\r\nconst CustomSkeleton: FunctionComponent = ({\r\n width,\r\n height,\r\n circle,\r\n type = 'text',\r\n className = '',\r\n style = {},\r\n ...rest\r\n}) => {\r\n const isTextType = type === 'text';\r\n const classNames = `pulse ${!className ? type : ``} ${isTextType ? 'transform' : ''} ${type === 'button-secondary' && !className ? 'button' : ''} ${circle ? 'circle' : ''} ${className}`;\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\nexport default CustomSkeleton;\r\n","import { ICoreContext, IGeneric, IAny } from '@msdyn365-commerce/core';\r\nimport { AttributeValue, CommerceProperty } from '@msdyn365-commerce/retail-proxy';\r\nimport React from 'react';\r\nimport { IBrandListData } from '../../../../../modules/mfrm-buybox/mfrm-buybox.view';\r\nimport { _getSoonestDeliveryDate, _makeDeliveryMessage } from '../../../../../Utilities/product-search-result-utils';\r\nimport { ProductSearchResultExtended } from '../../../custom-components/product-search-result-items';\r\nimport CustomSkeleton from '../../../custom-components/CustomSkeleton';\r\ninterface IDeliveryMessage {\r\n product?: ProductSearchResultExtended;\r\n context: ICoreContext>;\r\n isMasterProduct?: boolean;\r\n attributeValues?: AttributeValue[];\r\n extensionProperties?: CommerceProperty[];\r\n lowestPriceVariantRecordId?: string;\r\n}\r\n\r\n//TODO: common method; move to general utility file. AND change return type to an Enumeration\r\nexport const _getProductType = (shippingInformation: string | undefined): string => {\r\n if (shippingInformation && shippingInformation.toLowerCase() === 'delivery') {\r\n return 'Core';\r\n }\r\n if (shippingInformation && shippingInformation.toLowerCase() === 'parcel') {\r\n return 'Small Parcel';\r\n }\r\n if (shippingInformation && shippingInformation.toLowerCase() === 'drop ship') {\r\n return 'Drop Ship';\r\n }\r\n return '';\r\n};\r\n\r\nexport const computeItemLines = (\r\n product: IDeliveryMessage['product'],\r\n defaultVariantId: number | undefined,\r\n lowestPriceVariantRecordId: string | undefined\r\n) => {\r\n if (product?.IsMasterProduct) {\r\n if (defaultVariantId && defaultVariantId !== 0) {\r\n return defaultVariantId.toString();\r\n }\r\n if (lowestPriceVariantRecordId && lowestPriceVariantRecordId !== '') {\r\n return lowestPriceVariantRecordId;\r\n }\r\n }\r\n return product?.RecordId.toString();\r\n};\r\n\r\nconst DeliveryMessage: React.FC = ({\r\n product,\r\n context,\r\n attributeValues,\r\n extensionProperties,\r\n lowestPriceVariantRecordId\r\n}) => {\r\n let productDeliveryMessage = '';\r\n const { app } = context;\r\n const shippingInformationSmall = attributeValues && attributeValues.find(\r\n (attr: AttributeValue) => attr.Name?.trim() === app.config.smallParcelAttributeKey\r\n )?.TextValue?.toLowerCase();\r\n\r\n const defaultVariantShippingInformation = extensionProperties && extensionProperties.find(\r\n (property: CommerceProperty) => property?.Key === \"Unbxd_DefaultVariantShippingInformation\"\r\n )?.Value?.StringValue;\r\n\r\n if ((_getProductType(defaultVariantShippingInformation || shippingInformationSmall)) === 'Core') {\r\n productDeliveryMessage = product?.deliveryByMessage ?? '';\r\n } else if ((\r\n (_getProductType(defaultVariantShippingInformation || shippingInformationSmall)) === 'Small Parcel' ||\r\n (_getProductType(defaultVariantShippingInformation || shippingInformationSmall)) === 'Drop Ship'\r\n )) {\r\n let deliveryDays =\r\n attributeValues && attributeValues.find(attr => attr.Name?.trim() === app.config.leadTime)?.TextValue;\r\n if (\r\n (deliveryDays === '' || deliveryDays === undefined || deliveryDays === null) &&\r\n app.config.brandList &&\r\n app.config.brandList.length > 0\r\n ) {\r\n const brand =\r\n attributeValues &&\r\n attributeValues.find(\r\n attr =>\r\n app.config.brandBackofficeAttributePlp &&\r\n attr.Name?.trim() === app.config.brandBackofficeAttributePlp\r\n )?.TextValue?.toLowerCase();\r\n\r\n if (brand !== undefined && brand !== null && brand !== '') {\r\n app.config.brandList.map((singleBrand: IBrandListData) => {\r\n if (singleBrand.brandName.toLowerCase() === brand) {\r\n deliveryDays =\r\n singleBrand.brandLeadtime !== undefined &&\r\n singleBrand.brandLeadtime !== '' &&\r\n singleBrand.brandLeadtime !== null\r\n ? singleBrand.brandLeadtime\r\n : '';\r\n }\r\n });\r\n }\r\n deliveryDays = app.config.brandList[0].brandLeadtime;\r\n }\r\n if (deliveryDays && productDeliveryMessage === '') {\r\n productDeliveryMessage = _makeDeliveryMessage(deliveryDays);\r\n }\r\n }\r\n\r\n return productDeliveryMessage ? (\r\n
\r\n {productDeliveryMessage}\r\n
\r\n ) : ;\r\n};\r\n\r\nexport default DeliveryMessage;","import { getProductPageUrlSync } from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n Button,\r\n format,\r\n getPayloadObject,\r\n getTelemetryAttributes,\r\n ITelemetryContent,\r\n onTelemetryClick\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport { PriceComponent, RatingComponent, IPriceComponentResources } from '@msdyn365-commerce/components';\r\nimport { CommerceProperty } from '@msdyn365-commerce/retail-proxy';\r\nimport MsDyn365, {\r\n IComponent,\r\n IComponentProps,\r\n ICoreContext,\r\n IGridSettings,\r\n IImageData,\r\n IImageSettings,\r\n IImageProps,\r\n Image,\r\n IRequestContext,\r\n msdyn365Commerce,\r\n RichTextComponent\r\n} from '@msdyn365-commerce/core';\r\nimport { AttributeValue, ProductPrice, ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\r\nimport React from 'react';\r\n// VSI Customization - starts\r\nimport { convertToTitlecase } from '../../../../Utilities/convert-to-titlecase';\r\nimport { getBVAttributeValues } from '../../../../Utilities/get-bv-attributes';\r\nimport { buildProductBadge, parseBadgeData } from '../../../../Utilities/get-product-badge';\r\nimport { parseBrandName } from '../../../../Utilities/get-product-brand';\r\nimport {\r\n _coreProductATPCall,\r\n _getEyebrowMessage,\r\n _getSoonestDeliveryDate,\r\n _makeDeliveryMessage\r\n} from '../../../../Utilities/product-search-result-utils';\r\nimport { FinancingPerMonthComponent } from '../../custom-components/financing-per-month-component';\r\nimport DeliveryMessage from './delivery-message';\r\nimport { BVRatingSummary } from '../../../../Utilities/components/BVRatingSummary';\r\nimport { removeSpecialChars } from '../../../../Utilities/allRegex';\r\nimport CustomSkeleton from '../../custom-components/CustomSkeleton';\r\nimport { ErrorBoundary } from '../../../../common/components/error-boundary';\r\n// VSI Customization - ends\r\nexport interface IProductComponentProps extends IComponentProps<{ product?: ProductSearchResult }> {\r\n className?: string;\r\n imageSettings?: IImageSettings;\r\n savingsText?: string;\r\n freePriceText?: string;\r\n originalPriceText?: string;\r\n currentPriceText?: string;\r\n ratingAriaLabel?: string;\r\n allowBack?: boolean;\r\n telemetryContent?: ITelemetryContent;\r\n quickViewButton?: React.ReactNode;\r\n eyebrowMessage?: string | undefined;\r\n badgeAttribute?: string;\r\n deliveryMessage?: string;\r\n isRefinersEnabled?: boolean;\r\n // VSI Customization - Copied following 3 props from OOTB product.component to be used in product recommendations for Cart\r\n ratingCountAriaLabel?: string;\r\n isPriceMinMaxEnabled?: boolean;\r\n priceResources?: IPriceComponentResources;\r\n // Customized props for product recommendation on Cart page\r\n displayShopNow?: boolean;\r\n showBvRatings?: boolean;\r\n shopNowBtnText?: string;\r\n}\r\n\r\nexport interface IEyebrowMessageDimensions {\r\n height: number;\r\n visibleHeight: number;\r\n}\r\n\r\nexport interface IProductComponent extends IComponent { }\r\n\r\nconst PriceComponentActions = {};\r\n\r\n// tslint:disable-next-line: max-func-body-length cyclomatic-complexity\r\nconst ProductCard: React.FC = ({\r\n data,\r\n context,\r\n imageSettings,\r\n savingsText,\r\n freePriceText,\r\n originalPriceText,\r\n currentPriceText,\r\n ratingAriaLabel,\r\n allowBack,\r\n typeName,\r\n id,\r\n telemetryContent,\r\n quickViewButton,\r\n eyebrowMessage,\r\n badgeAttribute,\r\n deliveryMessage,\r\n isRefinersEnabled,\r\n displayShopNow,\r\n shopNowBtnText,\r\n showBvRatings\r\n}) => {\r\n // VSI Customization - starts\r\n const {\r\n app: {\r\n config: { brandBackofficeAttributePlp, enableAttributeBasedRating }\r\n }\r\n } = context;\r\n const getEyebrowElementRef = React.useRef(null);\r\n const eyebrowElement = getEyebrowElementRef.current?.querySelector('.mfrm-eyebrow__button-plp') as Element;\r\n const [isTruncated, setTruncated] = React.useState({\r\n height: eyebrowElement?.scrollHeight,\r\n visibleHeight: eyebrowElement?.clientHeight\r\n });\r\n\r\n const badgeAttributeToUse = context.app.config.productBadgeAttribute;\r\n // VSI Customization - ends\r\n const product = data.product;\r\n if (!product) {\r\n return null;\r\n }\r\n // VSI Customization - starts\r\n /** When enabled rating values will be picked from BazaarVoice attributes created on product.\r\n * If disabled rating will be shown from OOTB properties on a product.\r\n * This will be used for PLP and product-collection/product recommendations\r\n */\r\n const { AttributeValues, ExtensionProperties } = product;\r\n let isBVratings = false;\r\n if (AttributeValues && AttributeValues?.find(attr => attr.Name?.trim() === \"BVAverageOverallRating\")) {\r\n isBVratings = true;\r\n }\r\n const averageRating = enableAttributeBasedRating && AttributeValues && isBVratings ? getBVAttributeValues(AttributeValues, 'BVAverageOverallRating') : _parseValue(product?.AverageRating);\r\n const totalRatings = enableAttributeBasedRating && AttributeValues && isBVratings ? getBVAttributeValues(AttributeValues, 'BVTotalReviewCount') : _parseValue(product?.TotalRatings);\r\n React.useEffect(() => {\r\n function handleResize(): void {\r\n setTruncated({\r\n height: eyebrowElement?.scrollHeight,\r\n visibleHeight: eyebrowElement?.clientHeight\r\n });\r\n }\r\n handleResize();\r\n if (MsDyn365.isBrowser) {\r\n window.addEventListener('resize', handleResize);\r\n return () => window.removeEventListener('resize', handleResize);\r\n } else {\r\n return () => null;\r\n }\r\n }, [eyebrowElement?.scrollHeight, eyebrowElement?.clientHeight]);\r\n // VSI Customization - ends\r\n const lowestPriceVariantRecordId = AttributeValues?.find(\r\n attr => attr.Name?.trim() === context.app.config.EcomLowestPriceVariantRecIdKey\r\n )?.TextValue;\r\n const unbxdDefaultVariant = product && product.ExtensionProperties?.find((property: CommerceProperty) => property?.Key === \"Unbxd_DefaultVariantID\")?.Value?.LongValue;\r\n const queryBasedSelection = context.app.config.queryBasedVariantSelection;\r\n const fallBackImage = context.app.config.placeholderImageName;\r\n const defaultOrLowestVariantRecordId = unbxdDefaultVariant! > 0 ? unbxdDefaultVariant : product.RecordId;\r\n let productUrl = getProductPageUrlSync(removeSpecialChars(product?.Name!, context) || '', queryBasedSelection ? product.MasterProductId || product.RecordId : product.RecordId, context && context.actionContext, undefined);\r\n\r\n if (allowBack) {\r\n productUrl = updateProductUrl(productUrl, context);\r\n }\r\n if (queryBasedSelection) {\r\n const variantIdQueryParams = productUrl.includes('?') ? `&variantid=${defaultOrLowestVariantRecordId}` : `?variantid=${defaultOrLowestVariantRecordId}`;\r\n productUrl += variantIdQueryParams;\r\n }\r\n // Construct telemetry attribute to render\r\n const payLoad = getPayloadObject('click', telemetryContent!, '', defaultOrLowestVariantRecordId!.toString());\r\n const attribute = getTelemetryAttributes(telemetryContent!, payLoad);\r\n // VSI Customization -starts\r\n // #17772: Check the master product, if false then add size Refinement property otherwise show Starting at\r\n let sizeValue =\r\n product && !product?.IsMasterProduct && product?.ExtensionProperties && product?.ExtensionProperties?.length > 0\r\n ? product?.ExtensionProperties.find(i => i.Key === \"Size\")?.Value?.StringValue\r\n : '';\r\n sizeValue = sizeValue && convertToTitlecase(sizeValue);\r\n\r\n // Flag used on cart page to display ratings & shop now button\r\n const isCustomizedDesign = displayShopNow;\r\n\r\n if (typeName === 'product-collection') {\r\n // VSI Customization -starts\r\n const brandName = parseBrandName(AttributeValues, brandBackofficeAttributePlp);\r\n const productTitleWithBrandname = brandName ? `${brandName} ${product.Name}` : product.Name;\r\n // VSI Customization -end\r\n // tslint:disable:max-line-length\r\n return (\r\n \r\n
\r\n \r\n {
{renderProductBadge(badgeAttributeToUse, AttributeValues, context.request)}
}\r\n
\r\n {renderProductPlacementImage(\r\n imageSettings, context.request.gridSettings, product.PrimaryImageUrl,\r\n product.PrimaryImageUrl, product.Name, context.actionContext.requestContext, fallBackImage)}\r\n
\r\n \r\n
\r\n {/* VSI Customization - START */}\r\n {/* (ADO:23447) Added only class name conditionally as discounted price based on product.component if BasePrice > Price then it will be discounted else not */}\r\n product.Price\r\n ? 'msc-product discounted'\r\n : 'msc-product'\r\n : 'msc-product'\r\n }\r\n href={productUrl}\r\n onClick={onTelemetryClick(telemetryContent!, payLoad, product.Name!)}\r\n aria-label={renderLabel(\r\n product.Name,\r\n context.cultureFormatter.formatCurrency(product.Price),\r\n product.AverageRating,\r\n ratingAriaLabel\r\n )}\r\n {...attribute}\r\n >\r\n {/* Todo: 'Starting at' string will be replaced with relevant resources */} {/* For cart page, price will be shown after name */}\r\n {!isCustomizedDesign &&\r\n <>\r\n {sizeValue ? sizeValue : product.Price !== 0 ? 'Starting at ' : ''}\r\n {renderPrice(\r\n context,\r\n typeName,\r\n id,\r\n product.BasePrice,\r\n product.Price,\r\n savingsText,\r\n freePriceText,\r\n originalPriceText,\r\n currentPriceText\r\n )}\r\n \r\n }\r\n {!isCustomizedDesign &&\r\n \r\n {productTitleWithBrandname && productTitleWithBrandname.length > 40\r\n ? `${productTitleWithBrandname.slice(0, 40)}...`\r\n : productTitleWithBrandname}\r\n \r\n }\r\n {isCustomizedDesign &&\r\n \r\n {productTitleWithBrandname}\r\n \r\n }\r\n {isCustomizedDesign &&\r\n
\r\n {renderPrice(\r\n context,\r\n typeName,\r\n id,\r\n product.BasePrice,\r\n product.Price,\r\n savingsText,\r\n freePriceText,\r\n originalPriceText,\r\n currentPriceText\r\n )}\r\n
\r\n }\r\n {/* todo : will be added when required in next sprints */}\r\n {!context.app.config.hideRating &&\r\n renderRating(context, typeName, id, averageRating, totalRatings, ratingAriaLabel)}\r\n {isCustomizedDesign &&\r\n \r\n }\r\n {/* VSI Customization - END */}\r\n \r\n
\r\n {/* OOB Quick View */}\r\n {/* {quickViewButton && renderQuickView(quickViewButton, product.RecordId)} */}\r\n
\r\n
\r\n );\r\n } else {\r\n const priceComponent = renderPrice(\r\n context,\r\n typeName,\r\n id,\r\n product.BasePrice,\r\n product.Price,\r\n savingsText,\r\n freePriceText,\r\n originalPriceText,\r\n currentPriceText\r\n );\r\n const isSearchResultContainer = typeName === 'search-result-container' || typeName === 'mfrm-search-result-container';\r\n const brandName = parseBrandName(AttributeValues, brandBackofficeAttributePlp);\r\n return (\r\n // tslint:disable-next-line: react-this-binding-issue jsx-no-lambda\r\n \r\n
setProductUrl(productUrl)}>\r\n \r\n {isSearchResultContainer && (\r\n
\r\n {renderProductBadge(badgeAttributeToUse, AttributeValues, context.request)}\r\n
\r\n )}\r\n
\r\n {renderProductPlacementImage(\r\n imageSettings, context.request.gridSettings, product.PrimaryImageUrl,\r\n product.PrimaryImageUrl, product.Name, context.actionContext.requestContext, fallBackImage)}\r\n
\r\n \r\n\r\n
\r\n {/* VSI Customization - START */}\r\n
\r\n {/* VSI Customization - END */}\r\n {isSearchResultContainer && eyebrowMessage && (\r\n
\r\n
\r\n \r\n {isTruncated.height > isTruncated.visibleHeight ? (\r\n \r\n ) : (\r\n false\r\n )}\r\n
\r\n
\r\n )}\r\n {isSearchResultContainer && !eyebrowMessage && eyebrowMessage?.length !== 0 && !showBvRatings && (\r\n \r\n )}\r\n {isSearchResultContainer && eyebrowMessage?.length === 0 && !showBvRatings && (\r\n
\r\n
 
\r\n
\r\n )}\r\n {!context.app.config.hideRating && (data.product && showBvRatings) ? :\r\n (renderRating(context, typeName, id, averageRating, totalRatings, ratingAriaLabel) ? renderRating(context, typeName, id, averageRating, totalRatings, ratingAriaLabel) :\r\n
\r\n
 
\r\n
\r\n )}\r\n {/* VSI Customization - START */}\r\n
\r\n {/* VSI Customization - END */}\r\n \r\n \r\n {brandName ? `${brandName} ${product.Name}` : product.Name}\r\n \r\n\r\n {/* original price */}\r\n {!isSearchResultContainer && priceComponent}\r\n {renderDescription(product.Description)}\r\n \r\n {/* {deliveryMessage && <>{deliveryMessage}} */}\r\n \r\n
\r\n {/* new price */}\r\n {isSearchResultContainer\r\n ? product.Price\r\n ? priceComponent && (\r\n \r\n )\r\n : priceComponent\r\n : null}\r\n {/* OOB Quick View */}\r\n {/* {quickViewButton && renderQuickView(quickViewButton, product.RecordId)} */}\r\n
\r\n
\r\n );\r\n }\r\n // VSI Customization - Ends here\r\n};\r\n// VSI Customization - Starts here\r\nfunction _parseValue(productRating?: string | number): number {\r\n const value = +(productRating || 0);\r\n return Math.round(value * 10) / 10;\r\n}\r\n// VSI Customization - Ends here\r\nfunction renderLabel(name?: string, price?: string, rating?: number, ratingAriaLabel?: string): string {\r\n name = name || '';\r\n price = price || '';\r\n return `${name} ${price} ${getRatingAriaLabel(rating, ratingAriaLabel)}`;\r\n}\r\n\r\nfunction setProductUrl(productUrl: string): void {\r\n if (MsDyn365.isBrowser) {\r\n window.location.href = productUrl;\r\n }\r\n}\r\n\r\nfunction renderDescription(description?: string): JSX.Element | null {\r\n return

{description}

;\r\n}\r\n\r\n// Render Quick View\r\n// function renderQuickView(quickview: React.ReactNode, item?: number): JSX.Element | undefined {\r\n// if (quickview === null) {\r\n// return undefined;\r\n// }\r\n// return React.cloneElement(quickview as React.ReactElement, { selectedProductId: item });\r\n// }\r\n\r\nfunction getRatingAriaLabel(rating?: number, ratingAriaLabel?: string): string {\r\n if (rating && ratingAriaLabel) {\r\n const roundedRating = rating.toFixed(2);\r\n return format(ratingAriaLabel || '', roundedRating, '5');\r\n }\r\n return '';\r\n}\r\n\r\nfunction updateProductUrl(productUrl: string, context: ICoreContext): string {\r\n const srcUrl = new URL(productUrl, context.request.apiSettings.baseUrl);\r\n const queryString = 'back=true';\r\n if (srcUrl.search) {\r\n srcUrl.search += `&${queryString}`;\r\n } else {\r\n srcUrl.search += queryString;\r\n }\r\n\r\n const updatedUrl = new URL(srcUrl.href);\r\n return updatedUrl.pathname + srcUrl.search;\r\n}\r\n\r\nfunction renderRating(\r\n context: ICoreContext,\r\n typeName: string,\r\n id: string,\r\n avgRating?: number,\r\n totalRatings?: number,\r\n ariaLabel?: string\r\n): JSX.Element | null {\r\n if (avgRating && avgRating !== 0) {\r\n const numRatings = (totalRatings && totalRatings.toString()) || '0';\r\n const ratingAriaLabel = getRatingAriaLabel(avgRating, ariaLabel);\r\n\r\n return (\r\n \r\n );\r\n } else {\r\n return null;\r\n }\r\n}\r\n\r\nfunction renderPrice(\r\n context: ICoreContext,\r\n typeName: string,\r\n id: string,\r\n basePrice?: number,\r\n adjustedPrice?: number,\r\n savingsText?: string,\r\n freePriceText?: string,\r\n originalPriceText?: string,\r\n currentPriceText?: string\r\n): JSX.Element | null {\r\n const price: ProductPrice = {\r\n BasePrice: basePrice,\r\n AdjustedPrice: adjustedPrice,\r\n CustomerContextualPrice: adjustedPrice\r\n };\r\n return basePrice ? (\r\n \r\n ) : null;\r\n}\r\n\r\n/**\r\n * Gets the react component for product rating.\r\n * @param productCardimageSettings - Module image settings for product card.\r\n * @param gridSettings - Grid settings defined in theme.\r\n * @param imageUrl - Image url.\r\n * @param fallbackImageUrl - Fallback url for imge.\r\n * @param altText - Image Alt text.\r\n * @param requestContext - Request context using the component.\r\n * @param fallBackImage - Placeholder Image from App settings\r\n * @returns React component for product image.\r\n */\r\nfunction renderProductPlacementImage(\r\n productCardimageSettings?: IImageSettings, gridSettings?: IGridSettings,\r\n imageUrl?: string, fallbackImageUrl?: string, altText?: string, requestContext?: IRequestContext, fallBackImage?: string): JSX.Element | null {\r\n\r\n if (!imageUrl || !gridSettings || !productCardimageSettings) {\r\n return null;\r\n }\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Site level config can be of any type.\r\n const emptyPlaceHolderImage = fallBackImage || '';\r\n let fallbackImageSource = fallbackImageUrl;\r\n if (emptyPlaceHolderImage && fallbackImageUrl) {\r\n fallbackImageSource = `${fallbackImageUrl},${emptyPlaceHolderImage}`;\r\n }\r\n const image: IImageData = {\r\n src: imageUrl,\r\n altText: altText ? altText : '',\r\n fallBackSrc: fallbackImageSource\r\n };\r\n const imageProps: IImageProps = { gridSettings };\r\n\r\n imageProps.gridSettings = gridSettings;\r\n imageProps.imageSettings = productCardimageSettings;\r\n imageProps.imageSettings.cropFocalRegion = true;\r\n return (\r\n \r\n );\r\n}\r\n// VSI Customization - starts\r\n\r\nfunction renderProductBadge(\r\n attributeName: string | undefined,\r\n attributes: AttributeValue[] | undefined,\r\n requestContext: IRequestContext\r\n): JSX.Element | undefined {\r\n const badgeData =\r\n attributeName &&\r\n attributes?.find(\r\n currAttribute => currAttribute.Name && currAttribute.Name.toLowerCase().trim() === attributeName.toLowerCase().trim()\r\n )?.TextValue;\r\n if (!badgeData) {\r\n return;\r\n }\r\n\r\n // split badge data into its separate badges\r\n const badges = badgeData.split(',');\r\n\r\n // parse badge data to get its schedule and image src\r\n const parsedBadges = badges.map(badge => parseBadgeData(badge, requestContext));\r\n // build product badge image components\r\n const finalizedBadges = parsedBadges.map(parsedBadge => parsedBadge && buildProductBadge(parsedBadge, requestContext));\r\n\r\n return finalizedBadges && <>{finalizedBadges};\r\n}\r\n\r\n// VSI Customization - ends\r\n\r\n// @ts-ignore\r\nexport const ProductComponent: React.FunctionComponent = msdyn365Commerce.createComponentOverride<\r\n IProductComponent\r\n>('Product', { component: ProductCard, ...PriceComponentActions });\r\n\r\nexport default ProductComponent;","export const convertToTitlecase = (stringValue?: string, stopConvert?: boolean) => {\r\n // this stopConvert flag will use to stop conversion in specific scenario\r\n return stopConvert\r\n ? stringValue\r\n : stringValue?.replace(/\\w\\S*/g, txt => {\r\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\r\n });\r\n};\r\n","import get from 'lodash/get';\r\nimport * as React from 'react';\r\nimport { useInView } from 'react-intersection-observer';\r\nimport { ObjectExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { IProductCollectionViewProps, IProductComponentViewProps } from '@msdyn365-commerce-modules/product-collection';\r\nimport { INodeProps, Module, Node, getTelemetryObject, NodeTag } from '@msdyn365-commerce-modules/utilities';\r\nimport MsDyn365 from '@msdyn365-commerce/core';\r\nimport { AttributeValue, CommerceProperty, ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\r\nimport { IPriceComponentResources } from '@msdyn365-commerce/components';\r\nimport { GetCategoryPathsInput, getProductsCategoryPathsAction } from '../../../actions/get-mfrm-products-category-paths.action';\r\nimport { getBrandNameCheck } from '../../../Utilities/get-product-brand';\r\nimport { IProductCollectionProps } from '../definition-extensions/product-collection.ext.props.autogenerated';\r\nimport { hasArray } from '../../../Utilities/emtpyChecker';\r\nimport { getPagePath } from '../../../Utilities/get-page-path';\r\nimport ProductComponent from './components/product.component';\r\nimport classnames from 'classnames';\r\n\r\ninterface IFetchedCategoryIds {\r\n productId?: number | undefined;\r\n categoryId?: number | undefined;\r\n categoryName?: string | undefined;\r\n brand: string | undefined;\r\n variantID: string | undefined;\r\n}\r\nexport type GridSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\r\n// tslint:disable:cyclomatic-complexity\r\nconst getProductsCategories = async (\r\n props: IProductCollectionViewProps & IProductCollectionProps<{}>,\r\n products: IProductComponentViewProps[] | undefined\r\n): Promise => {\r\n if (products && products.length > 0) {\r\n const productIds: number[] = [];\r\n const catalogId = props.context.actionContext.requestContext.apiSettings.catalogId;\r\n for (let productPricesIter = 0; productPricesIter < products.length; productPricesIter++) {\r\n const prodId = get(products[productPricesIter].productComponent, 'props.data.product.RecordId');\r\n productIds.push(prodId);\r\n }\r\n if (!hasArray(productIds)) {\r\n return [];\r\n }\r\n const productsCategories = await getProductsCategoryPathsAction(\r\n new GetCategoryPathsInput(props.context.request, catalogId, productIds),\r\n props.context.actionContext\r\n );\r\n const categoryIds: IFetchedCategoryIds[] = [];\r\n for (let productCategoriesIter = 0; productCategoriesIter < productsCategories.length; productCategoriesIter++) {\r\n if (\r\n productsCategories[productCategoriesIter] &&\r\n productsCategories[productCategoriesIter].CategoryPath &&\r\n productsCategories[productCategoriesIter].CategoryPath!.length > 0\r\n ) {\r\n const catPath = productsCategories[productCategoriesIter].CategoryPath;\r\n const catPathSegments = catPath![0].Segments;\r\n if (catPathSegments && catPathSegments.length > 0) {\r\n const catId = catPathSegments.length > 0 ? catPathSegments[catPathSegments.length - 1].CategoryId : -1;\r\n const catName = catPathSegments.length > 0 ? catPathSegments[catPathSegments.length - 1].CategoryName : '';\r\n const collectionProductAttributes: AttributeValue[] = get(\r\n products[productCategoriesIter].productComponent,\r\n 'props.data.product.AttributeValues'\r\n );\r\n let variantId: string | undefined;\r\n const configVendorNamePlp = props.context.app.config.brandBackofficeAttributePlp;\r\n const configVendorNamePdp = props.context.app.config.brandBackofficeAttributePdp;\r\n let brandName: string | undefined = getBrandNameCheck(collectionProductAttributes, configVendorNamePlp);\r\n if (!brandName) {\r\n brandName = getBrandNameCheck(collectionProductAttributes, configVendorNamePdp);\r\n }\r\n if (!brandName) {\r\n brandName = undefined;\r\n }\r\n const eProps: CommerceProperty[] = get(\r\n products[productCategoriesIter].productComponent,\r\n 'props.data.product.ExtensionProperties'\r\n );\r\n if (eProps && eProps.length > 0) {\r\n for (let ePropsIter = 0; ePropsIter < eProps.length; ePropsIter++) {\r\n if (eProps[ePropsIter].Key === 'RetailVariantId') {\r\n variantId = eProps[ePropsIter].Value?.StringValue === 'null' ? undefined : eProps[ePropsIter].Value?.StringValue;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n categoryIds.push({\r\n productId: productsCategories[productCategoriesIter].ProductId,\r\n categoryId: catId,\r\n categoryName: catName,\r\n brand: brandName,\r\n variantID: variantId\r\n });\r\n }\r\n }\r\n }\r\n return categoryIds;\r\n }\r\n return [];\r\n};\r\n\r\nconst callTelium = (\r\n props: IProductCollectionViewProps & IProductCollectionProps<{}>,\r\n categoryID: IFetchedCategoryIds[],\r\n productIDList: number[]\r\n): void => {\r\n const { products } = props;\r\n const categoryListArray = categoryID.filter(item1 => productIDList.some(item2 => item1.productId === item2));\r\n const categoryList: string[] = [];\r\n const brandNameArr: (string | undefined)[] = [];\r\n const productVariantArr: (string | undefined)[] = [];\r\n categoryListArray.forEach((item: IFetchedCategoryIds) => {\r\n categoryList.push(item.categoryName!);\r\n brandNameArr.push(item.brand);\r\n productVariantArr.push(item.variantID);\r\n });\r\n const listName = props.config.productRecommendationImpressionListName\r\n ? `${props.config.productRecommendationImpressionListName}`\r\n : undefined;\r\n const pagePath = getPagePath();\r\n const productNameArr: string[] = [];\r\n const productIdArr: string[] = [];\r\n const productPositionArr: number[] = [];\r\n const productPriceArr: number[] = [];\r\n const productListArray =\r\n products &&\r\n products.filter((item1, index) => {\r\n return productIDList.some(item2 => {\r\n const productID = get(item1.productComponent, 'props.data.product.RecordId');\r\n if (productID === item2) {\r\n productPositionArr.push(index + 1);\r\n }\r\n return productID === item2; // return the ones with equal id\r\n });\r\n });\r\n productListArray &&\r\n productListArray.forEach((item: IProductComponentViewProps, index: number) => {\r\n const { productComponent } = item;\r\n productNameArr.push(get(productComponent, 'props.data.product.Name'));\r\n productIdArr.push(get(productComponent, 'props.data.product.ItemId'));\r\n productPriceArr.push(get(productComponent, 'props.data.product.Price'));\r\n });\r\n // @ts-ignore\r\n if ('utag' in window) {\r\n // @ts-ignore\r\n // tslint:disable-next-line: object-literal-key-quotes\r\n utag.link({\r\n event: 'product-impression',\r\n event_category: 'ecommerce',\r\n event_action: 'product impression',\r\n enhanced_action: 'product_impression',\r\n event_label: `${pagePath}`,\r\n event_noninteraction: 'true',\r\n product_impression_list_name: [`${listName}`],\r\n product_impression_position: productPositionArr,\r\n product_impression_id: productIdArr,\r\n product_impression_name: productNameArr,\r\n product_impression_category: categoryList,\r\n product_impression_brand: brandNameArr,\r\n product_impression_variant: productVariantArr,\r\n product_impression_price: productPriceArr\r\n });\r\n }\r\n};\r\n\r\nconst callTeliumOnClick = (\r\n props: IProductCollectionViewProps & IProductCollectionProps<{}>,\r\n categoryID: IFetchedCategoryIds[],\r\n product: IProductComponentViewProps\r\n): void => {\r\n const { productComponent } = product;\r\n const { heading } = props;\r\n const productHeading = get(heading, 'props.text');\r\n const productName = get(productComponent, 'props.data.product.Name');\r\n const productPositionArr: number[] = [];\r\n const productRecordID = get(productComponent, 'props.data.product.RecordId');\r\n const categoryListArr: string[] = [];\r\n const brandNameArr: (string | undefined)[] = [];\r\n const productVariantArr: (string | undefined)[] = [];\r\n const pagePath = getPagePath();\r\n const productId = get(productComponent, 'props.data.product.ItemId');\r\n categoryID?.forEach((item, index) => {\r\n if (productRecordID === item.productId) {\r\n productPositionArr.push(index + 1);\r\n categoryListArr.push(item.categoryName!);\r\n brandNameArr.push(item.brand);\r\n productVariantArr.push(item.variantID);\r\n }\r\n });\r\n // @ts-ignore\r\n if ('utag' in window) {\r\n // @ts-ignore\r\n // tslint:disable-next-line: object-literal-key-quotes\r\n utag.link({\r\n event: 'product-click',\r\n enhanced_action: 'product_click',\r\n event_category: 'ecommerce',\r\n event_action: 'product click',\r\n event_label: `${productId}: ${productName}`,\r\n event_noninteraction: 'false',\r\n product_list_name: [`${productHeading}-${pagePath}`],\r\n product_position: productPositionArr,\r\n product_id: [`${productId}`],\r\n product_name: [`${productName}`],\r\n product_category: categoryListArr,\r\n product_brand: brandNameArr,\r\n product_variant: productVariantArr\r\n });\r\n }\r\n const singlePosition = productPositionArr[0];\r\n // @ts-ignore\r\n if ('utag' in window) {\r\n // @ts-ignore\r\n // tslint:disable-next-line: object-literal-key-quotes\r\n utag.link({\r\n event: 'product-recommendations',\r\n event_category: productHeading,\r\n event_action: singlePosition,\r\n event_label: productName,\r\n event_noninteraction: 'false'\r\n });\r\n }\r\n};\r\n\r\nconst getSkipProductValue = (props: IProductCollectionViewProps, teliumCall: number): number => {\r\n let skipProducts: number = 0;\r\n const viewPortCode = getViewport(props);\r\n if (viewPortCode === 'xs' || viewPortCode === 'sm' || viewPortCode === 'md') {\r\n skipProducts = 1;\r\n } else if (viewPortCode === 'lg') {\r\n if (MsDyn365.isBrowser && window.innerWidth) {\r\n if (window.innerWidth >= 1070 && window.innerWidth < 1112) {\r\n skipProducts = 2;\r\n } else {\r\n skipProducts = 3;\r\n }\r\n }\r\n } else if (viewPortCode === 'xl') {\r\n if (teliumCall === 2) {\r\n skipProducts = 1;\r\n } else {\r\n skipProducts = 3;\r\n }\r\n }\r\n return skipProducts;\r\n};\r\n\r\nconst getViewport = (props: IProductCollectionViewProps): GridSize => {\r\n const { context } = props;\r\n // always render in mobile viewport on a mobile device\r\n if (context.request && context.request.device && context.request.device.Type === 'Mobile') {\r\n return 'xs';\r\n }\r\n if (MsDyn365.isBrowser && window.innerWidth) {\r\n const gridSettings = context.request.gridSettings;\r\n if (gridSettings) {\r\n if (gridSettings.xs && window.innerWidth <= gridSettings.xs.w) {\r\n return 'xs';\r\n } else if (gridSettings.sm && window.innerWidth <= gridSettings.sm.w) {\r\n return 'sm';\r\n } else if (gridSettings.md && window.innerWidth <= gridSettings.md.w) {\r\n return 'md';\r\n } else if (gridSettings.lg && window.innerWidth <= gridSettings.lg.w) {\r\n return 'lg';\r\n } else {\r\n return 'xl';\r\n }\r\n }\r\n }\r\n\r\n return 'lg';\r\n};\r\n\r\nconst ProductCollectionView: React.FC> = props => {\r\n const { heading, ProductCollectionContainer, products, SingleSlideCarouselComponentProps, GridComponentProps } = props;\r\n const layoutType = props.config.layout;\r\n\r\n const [productIDList, setproductIDList] = React.useState([]);\r\n const [categoryID, setCategoryID] = React.useState([]);\r\n const [teliumCall, setteliumCall] = React.useState(0);\r\n React.useEffect(() => {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n getProductsCategories(props, products).then(result => {\r\n // tslint:disable-next-line: no-floating-promises\r\n setCategoryID(result);\r\n });\r\n }, []);\r\n\r\n const handleProductId = (productID: number): void => {\r\n setproductIDList(prevArray => [...prevArray, productID]);\r\n };\r\n const _renderCarousel = (carouselContainer: INodeProps, items: (IProductComponentViewProps | undefined)[]): JSX.Element => {\r\n return {items && items.map(item => _renderProduct(item))};\r\n };\r\n const _renderGrid = (gridContainer: INodeProps, items: (IProductComponentViewProps | undefined)[]): JSX.Element => {\r\n return {items && items.map(item => _renderProduct(item))};\r\n };\r\n\r\n const _renderProduct = (product: IProductComponentViewProps | undefined): JSX.Element | null => {\r\n if (!product) {\r\n return null;\r\n }\r\n const { ProductContainer, productComponent } = product;\r\n const [ref, inView] = useInView({\r\n triggerOnce: true\r\n });\r\n\r\n React.useEffect(() => {\r\n if (MsDyn365.isBrowser && productComponent && inView) {\r\n const productID = get(productComponent, 'props.data.product.RecordId');\r\n handleProductId(productID);\r\n }\r\n }, [inView]);\r\n\r\n return (\r\n // tslint:disable-next-line: jsx-no-lambda react-this-binding-issue\r\n callTeliumOnClick(props, categoryID, product)} {...ProductContainer}>\r\n
{productComponent}
\r\n
\r\n );\r\n };\r\n const skipProductsVal = getSkipProductValue(props, teliumCall);\r\n if (productIDList.length > skipProductsVal) {\r\n if (categoryID.length > 0) {\r\n callTelium(props, categoryID, productIDList);\r\n setproductIDList([]);\r\n setteliumCall(teliumCall + 1);\r\n }\r\n }\r\n // Use customized configuration for product component in case of Cart page\r\n const updatedProducts = props.config.displayShopNow ? _getProductsList(props) : products;\r\n\r\n let layout;\r\n if (layoutType === 'carousel') {\r\n layout = _renderCarousel(SingleSlideCarouselComponentProps, updatedProducts);\r\n } else if (layoutType === 'simple product') {\r\n layout = _renderSimpleCarousel(SingleSlideCarouselComponentProps, updatedProducts, props);\r\n } else if (layoutType === 'grid') {\r\n layout = _renderGrid(GridComponentProps, updatedProducts);\r\n } else {\r\n layout = _renderGrid(GridComponentProps, updatedProducts);\r\n }\r\n if (updatedProducts) {\r\n return (\r\n \r\n {heading}\r\n {layout}\r\n \r\n );\r\n }\r\n props.context.telemetry.warning('Product collection content is empty, module wont render.');\r\n return null;\r\n};\r\n/* VSI Customization - START */\r\nconst _getProductsList = (props: IProductCollectionViewProps & IProductCollectionProps<{}>): (IProductComponentViewProps | undefined)[] => {\r\n const { config: { productCollection } } = props;\r\n const products = productCollection.products;\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- product check for safety.\r\n const updatedProducts = products?.map(\r\n (item: ProductSearchResult, index: number) => {\r\n const getProductData = _getProduct(item, index, props);\r\n return !ObjectExtensions.isNullOrUndefined(getProductData) ? getProductData : undefined;\r\n }\r\n );\r\n const productsList = updatedProducts?.filter(item => item !== undefined);\r\n return productsList;\r\n};\r\n\r\nconst _getProduct = (product: ProductSearchResult, index: number, props: IProductCollectionViewProps & IProductCollectionProps<{}>): IProductComponentViewProps | null => {\r\n if (!product || !product.Name) {\r\n props.telemetry.trace('[product-collection] Product or product name is null');\r\n return null;\r\n }\r\n const { context, resources, id, typeName, friendlyName, telemetry,\r\n config: { imageSettings, allowBackNavigation, displayShopNow },\r\n slots: { quickview: quickviewSlot } } = props;\r\n\r\n const breaCrumbType = context.app.config.breadcrumbType;\r\n const priceResources: IPriceComponentResources = {\r\n priceRangeSeparator: resources.priceRangeSeparator\r\n };\r\n const telemetryContent = getTelemetryObject(context.request.telemetryPageName!,\r\n friendlyName,\r\n telemetry);\r\n const reviewTotalRatings = Number(product.TotalRatings);\r\n const reviewCount = 1;\r\n const reviewCountAriaLabelValue = reviewTotalRatings > reviewCount ? resources.ratingCountAriaLabel : resources.ratingCountAriaLabelSingleUser;\r\n const allowBack = allowBackNavigation && (breaCrumbType === 'back' || breaCrumbType === 'categoryAndBack');\r\n const isPriceMinMaxEnabled = props.data.featureState.result?.find(\r\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailSearchPriceRangeFeature');\r\n\r\n return {\r\n ProductContainer: {\r\n tag: 'li' as NodeTag,\r\n className: classnames('ms-product-collection__item', displayShopNow ? 'msc-product__with-cta' : ''),\r\n role: 'listitem',\r\n key: index\r\n },\r\n productComponent: (\r\n \r\n )\r\n };\r\n};\r\n/* VSI Customization - END */\r\nconst _renderSimpleCarousel = (carouselContainer: INodeProps, items: (IProductComponentViewProps | undefined)[], props: IProductCollectionViewProps & IProductCollectionProps<{}>): JSX.Element => {\r\n return (\r\n \r\n {items && items.map(item => _renderSimpleProduct(item, props))}\r\n \r\n );\r\n};\r\n\r\nconst _renderSimpleProduct = (product: IProductComponentViewProps | undefined, props: IProductCollectionViewProps & IProductCollectionProps<{}>): JSX.Element | null => {\r\n if (!product) {\r\n return null;\r\n }\r\n const { ProductContainer, productComponent } = product;\r\n return {productComponent};\r\n};\r\n\r\nexport default ProductCollectionView;\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-collection'] = {\n c: () => require('@msdyn365-commerce-modules/product-collection/dist/lib/modules/product-collection/product-collection'),\n $type: 'containerModule',\n da: [{name:'featureState', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state', runOn: 0}],\n \n iNM: true,\n ns: '@msdyn365-commerce-modules',\n n: 'product-collection',\n p: 'product-collection',\n \n pdp: '',\n \n \n md: 'node_modules/@msdyn365-commerce-modules/product-collection/dist/lib/modules/product-collection'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state');\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__|themes|mattressfirm|views|product-collection'] = {\n c: () => require('partner/themes/mattressfirm/views/product-collection.view.tsx'),\n cn: '__local__-__local__-product-collection'\n };\nviewDictionary['@msdyn365-commerce-modules|product-collection|modules|product-collection|product-collection'] = {\n c: () => require('@msdyn365-commerce-modules/product-collection/dist/lib/modules/product-collection/product-collection.view.js'),\n cn: '@msdyn365-commerce-modules-product-collection-product-collection'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IProductsDimensionsAvailabilities } from '@msdyn365-commerce/commerce-entities';\nimport { IPriceComponentResources, ProductComponent } from '@msdyn365-commerce/components';\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport { getCatalogId, ICoreContext } from '@msdyn365-commerce/core';\nimport { ProductPrice, ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\nimport {\n ArrayExtensions,\n DimensionAvailabilitiesForProductSearchResultInput,\n DimensionTypes,\n DimensionSwatchDisplayTypes,\n getDimensionAvailabilitiesForProductSearchResultAction,\n getPriceForProductSearchResult,\n IDimensionsApp,\n ObjectExtensions,\n PriceForProductSearchResultInput\n} from '@msdyn365-commerce-modules/retail-actions';\nimport {\n Button,\n getTelemetryObject,\n IComponentNodeProps,\n IModuleProps,\n INodeProps,\n ISingleSlideCarouselProps,\n ITelemetryContent,\n NodeTag,\n SingleSlideCarousel\n} from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { IProductCollectionData } from './product-collection.data';\nimport { IProductCollectionProps, layout } from './product-collection.props.autogenerated';\n\nexport interface IProductCollectionViewProps extends IProductCollectionProps {\n heading?: React.ReactNode;\n ProductCollectionContainer: IModuleProps;\n SingleSlideCarouselComponentProps: INodeProps;\n GridComponentProps: INodeProps;\n products: IProductComponentViewProps[];\n isCarousel: boolean;\n productPrices?: ProductPrice[];\n seeAllButton?: React.ReactNode;\n}\n\nexport interface IProductComponentViewProps {\n ProductContainer: INodeProps;\n productComponent: React.ReactNode;\n}\nexport interface IProductComponentState {\n products: ProductSearchResult[];\n productsDimensionAvailabilities?: IProductsDimensionsAvailabilities[][];\n}\n\n/**\n * ProductCollection component.\n */\nclass ProductCollection extends React.PureComponent, IProductComponentState> {\n private readonly telemetryContent: ITelemetryContent;\n\n private readonly productPrices: ProductPrice[];\n\n constructor(props: IProductCollectionProps) {\n super(props);\n this.productPrices = [];\n this.state = {\n products: this.props.config.productCollection.products\n };\n this.telemetryContent = getTelemetryObject(\n this.props.context.request.telemetryPageName!,\n this.props.friendlyName,\n this.props.telemetry\n );\n }\n\n public async componentDidMount(): Promise {\n if (this.props.config.enableAffiliationBasedPricing && this.props.context.actionContext.requestContext.user.isAuthenticated) {\n await this._getActivePrice();\n }\n }\n\n public render(): JSX.Element | null {\n const { heading, className, shouldDisplaySeeAllButton } = this.props.config;\n const { resources } = this.props;\n const recommendation = this.props.config.productCollection.recommendationListId;\n\n // Initialize state in case if the products were not found during initial module render\n // eslint-disable-next-line @typescript-eslint/no-floating-promises -- Initialize data if not there.\n this.initProductState(this.props.config.productCollection);\n\n const products = this.state.products;\n const isCarousel = this.props.config.layout === layout.carousel;\n const headingLabel = heading ? heading.text : '';\n const headingComponent = heading && (\n \n );\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- product check for safety.\n const updatedProducts = products?.map((item: ProductSearchResult, index: number) => {\n const getProductData = this._getProduct(item, index);\n return !ObjectExtensions.isNullOrUndefined(getProductData) ? getProductData : undefined;\n });\n\n const productCollectionViewProps = {\n ...this.props,\n heading: headingComponent,\n SingleSlideCarouselComponentProps: {\n tag: SingleSlideCarousel,\n className: '',\n flipperPrevLabel: `${headingLabel} ${resources.flipperPrevious}`,\n flipperNextLabel: `${headingLabel} ${resources.flipperNext}`,\n parentId: this.props.id,\n telemetryContent: this.telemetryContent\n } as IComponentNodeProps,\n ProductCollectionContainer: {\n moduleProps: this.props,\n className: classnames('ms-product-collection', className)\n },\n GridComponentProps: {\n tag: 'ul' as NodeTag,\n className: 'ms-product-collection__items'\n },\n isCarousel,\n\n products:\n ArrayExtensions.hasElements(updatedProducts) &&\n updatedProducts.filter(item => {\n return item !== undefined;\n }),\n productPrices: this.productPrices,\n seeAllButton:\n recommendation && shouldDisplaySeeAllButton && ArrayExtensions.hasElements(updatedProducts)\n ? this._getSeeAllButton(recommendation, headingLabel)\n : undefined\n };\n return this.props.renderView(productCollectionViewProps) as React.ReactElement;\n }\n\n public handleHeadingChange = (event: Msdyn365.ContentEditableEvent) => (this.props.config.heading!.text = event.target.value);\n\n /**\n * Get products dimension availabilities.\n * @param products - Products.\n * @returns Promise.\n */\n private readonly _getProductsDimensionsAvailabilities = async (products: ProductSearchResult[]): Promise => {\n const context = this.props.context as ICoreContext;\n const dimensionsToDisplayOnProductCard = context.app.config.dimensionsInProductCard;\n const dimensionsToDisplayAsSwatch = context.app.config.dimensionsAsSwatchType;\n const validProducts = ArrayExtensions.validValues(products);\n if (\n ArrayExtensions.hasElements(validProducts) &&\n ArrayExtensions.hasElements(dimensionsToDisplayOnProductCard) &&\n !dimensionsToDisplayOnProductCard.includes(DimensionTypes.none) &&\n ArrayExtensions.hasElements(dimensionsToDisplayAsSwatch) &&\n !dimensionsToDisplayAsSwatch.includes(DimensionTypes.none)\n ) {\n const productsDimensionAvailabilities = await getDimensionAvailabilitiesForProductSearchResultAction(\n new DimensionAvailabilitiesForProductSearchResultInput(\n validProducts,\n this.props.context as ICoreContext,\n DimensionSwatchDisplayTypes.productCard\n ),\n this.props.context.actionContext\n );\n\n if (ArrayExtensions.hasElements(productsDimensionAvailabilities)) {\n this.setState({ productsDimensionAvailabilities });\n }\n }\n };\n\n /**\n * Helper method to initialize products state.\n * @param productCollection - List of products.\n */\n private readonly initProductState = async (productCollection: Msdyn365.IProductList) => {\n let products = this.state.products;\n const productCollectionProducts = productCollection.products;\n if (!ArrayExtensions.hasElements(products) && ArrayExtensions.hasElements(productCollectionProducts)) {\n products = productCollectionProducts;\n this.setState({ products });\n } else if (\n ArrayExtensions.hasElements(products) &&\n ArrayExtensions.hasElements(productCollectionProducts) &&\n !ArrayExtensions.equals(products, productCollectionProducts)\n ) {\n products = productCollectionProducts;\n this.setState({ products });\n }\n\n if (Msdyn365.msdyn365Commerce.isBrowser && !ArrayExtensions.hasElements(this.state.productsDimensionAvailabilities)) {\n await this._getProductsDimensionsAvailabilities(products);\n }\n };\n\n private readonly _getProduct = (product: ProductSearchResult, index: number): IProductComponentViewProps | null => {\n if (!product || !product.Name) {\n this.props.telemetry.trace('[product-collection] Product or product name is null');\n return null;\n }\n const telemetryContent = getTelemetryObject(\n this.props.context.request.telemetryPageName!,\n this.props.friendlyName,\n this.props.telemetry\n );\n const { imageSettings, allowBackNavigation } = this.props.config;\n const resources = this.props.resources;\n const breaCrumbType = this.props.context.app.config.breadcrumbType;\n const allowBack = allowBackNavigation && (breaCrumbType === 'back' || breaCrumbType === 'categoryAndBack');\n const quickviewSlot =\n this.props.slots && this.props.slots.quickview && this.props.slots.quickview.length > 0 ? this.props.slots.quickview[0] : null;\n const productComparisonButtonSlot = ArrayExtensions.hasElements(this.props.slots.productComparisonButton)\n ? this.props.slots.productComparisonButton[0]\n : null;\n\n const reviewCount = 1;\n const reviewTotalRatings = Number(product.TotalRatings);\n const reviewCountAriaLabelValue =\n reviewTotalRatings > reviewCount ? resources.ratingCountAriaLabel : resources.ratingCountAriaLabelSingleUser;\n const isPriceMinMaxEnabled = this.props.data.featureState.result?.find(\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailSearchPriceRangeFeature'\n );\n const priceResources: IPriceComponentResources = {\n priceRangeSeparator: resources.priceRangeSeparator\n };\n return {\n ProductContainer: {\n tag: 'li' as NodeTag,\n className: 'ms-product-collection__item',\n role: 'listitem',\n key: index\n },\n productComponent: (\n \n ArrayExtensions.hasElements(dimensionAvailability) &&\n dimensionAvailability[0].masterProductId === (product.MasterProductId ?? product.RecordId)\n )}\n />\n )\n };\n };\n\n /**\n * Get the active price for products.\n */\n private readonly _getActivePrice = async (): Promise => {\n const productsList = this.state.products;\n const products = await getPriceForProductSearchResult(\n new PriceForProductSearchResultInput(productsList),\n this.props.context.actionContext\n );\n if (Msdyn365.msdyn365Commerce.isBrowser) {\n await this._getProductsDimensionsAvailabilities(products);\n }\n\n this.setState({ products });\n };\n\n /**\n * Get the see all button.\n * @param recommendation - Recommendation.\n * @param headingLabel - Heading label.\n * @returns IProductComponentSeeAllViewProps - Product component see all view props.\n */\n private readonly _getSeeAllButton = (recommendation: string, headingLabel: string): React.ReactNode => {\n const catalogId = getCatalogId(this.props.context.request);\n const seeAllLink = `/search?recommendation=${recommendation}&title=${headingLabel}&catalogid=${catalogId}`;\n return (\n \n {this.props.resources.seeAllButtonText}\n \n );\n };\n}\n\nexport default ProductCollection;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { INodeProps, Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IProductCollectionViewProps, IProductComponentViewProps } from './product-collection';\n\nconst ProductCollectionView: React.FC = props => {\n const {\n heading,\n ProductCollectionContainer,\n products,\n SingleSlideCarouselComponentProps,\n GridComponentProps,\n isCarousel,\n seeAllButton\n } = props;\n\n if (products) {\n return (\n \n {heading}\n {seeAllButton}\n {isCarousel ? _renderCarousel(SingleSlideCarouselComponentProps, products) : _renderGrid(GridComponentProps, products)}\n \n );\n }\n props.context.telemetry.error('Product collection content is empty, module wont render.');\n return null;\n};\n\nconst _renderCarousel = (carouselContainer: INodeProps, items: IProductComponentViewProps[]): JSX.Element => {\n return {items && items.map(_renderProduct)};\n};\n\nconst _renderGrid = (gridContainer: INodeProps, items: IProductComponentViewProps[]): JSX.Element => {\n return {items && items.map(_renderProduct)};\n};\n\nconst _renderProduct = (product: IProductComponentViewProps): JSX.Element => {\n const { ProductContainer, productComponent } = product;\n\n return {productComponent};\n};\n\nexport default ProductCollectionView;\n","module.exports = React;","module.exports = ReactDOM;"],"names":["emailRegex","emailValue","test","removeSpecialChars","str","ctx","request","app","config","removeSpecialCharsPDP","replace","removeSpecialCharsFromURLPath","decodeURIComponent","split","callUtag","async","callUtagLink","objToCall","Object","keys","forEach","key","utag","global","hasOwnProperty","link","e","console","log","callUtagView","view","variantQueryStringName","hasArray","values","length","undefined","getBVAttributeValues","attributeValues","value","find","attr","Name","trim","TextValue","Math","round","getBVAttributeValuesUnbxd","context","isCached","getDeliveryMessageActionInput","GetDeliveryMessageInput","result","getDeliveryMessageAction","actionContext","error","getPagePath","MsDyn365","window","location","href","host","includes","_getEyebrowMessage","products","priceGroupForAPICall","priceGroup","items","map","item","singleItem","ItemId","DistinctProductVariant","push","requestBody","PriceGroup","Items","getEyebrowMessageInput","GetEyebrowMessageInput","getEyebrowAction","_makeDeliveryMessage","days","deliveryByMessage","date","Date","daysSpan","deliveryDate","now","deliveryByMessageRange","parseInt","numberOfDays","newDate","setDate","getDate","dayjs","format","flag","_setTime","time","temp","newDatewithTime","toUpperCase","_getSoonestDeliveryDate","coreProductATPData","deliveryDetails","locationId","index","Available","ATPQuantity","today","SlotDate","currHour","StartTime","Location1","_getDeliveryDate","startTimeHour","substring","constructor","input","getCacheKey","this","ZipCode","ItemLines","VariantRecordId","getCacheObjectType","dataCacheType","Msdyn365","action","mFIATPInventoryAsync","callerContext","id","MFIPromotionExtensionClass","odataObject","EyeBrows","i","className","substr","lastIndexOf","concat","EntityClasses","ExtensionProperties","createMFIGetAvailablePromotionsDescriptionInput","queryResultSettings","availablePromotionsDescription","itemId","DataServiceQuery","DataServiceEntities","availablePromotionsDescriptionsQuery","resultSettings","createDataServiceRequestForOperation","bypassCache","returnEntity","pageType","createCacheKey","obj","join","toString","callActionOrExecute","mFIGetAvailablePromotionsDescriptionAsync","Paging","Top","GetCategoryPathsInput","catalogId","productIds","constructedCacheKey","ChannelId","apiSettings","channelId","CatalogId","ids","createGetCategoryPathsInput","inputData","requestContext","Error","getProductsCategoryPathsAction","catPaths","productsIter","ProductId","getCategoryPathsAsync","Sorting","err","getCategoryPathsActionDataAction","createObservableDataAction","getSelectedProductIdFromActionInput","variantId","queryBasedVariantSelection","getQueryParamsFromQueryByName","url","requestUrl","query","productId","urlTokens","inputUrl","queryParamName","URL","toLocaleLowerCase","searchParams","get","Number","isNaN","generateImageUrl","imageUrl","startsWith","baseImageUrl","encodeURIComponent","DimensionTypes","DimensionSwatchDisplayTypes","getFallbackImageUrl","parsedItemId","convertProductDimensionTypeToDimensionTypes","productDimensionType","ProductDimensionType","color","configuration","size","style","none","parseDimensionsFromUrl","urlParameters","parsedDimensions","dimension","localDimensionType","DimensionTypeValue","DimensionValue","RecordId","Value","parseDimensionFromUrl","ArrayExtensions","getDimensionValuesFromQuery","getValidCSSInput","parsedInput","parseFloat","unit","match","width","height","circle","type","rest","classNames","React","borderRadius","_getProductType","shippingInformation","toLowerCase","computeItemLines","product","defaultVariantId","lowestPriceVariantRecordId","IsMasterProduct","extensionProperties","productDeliveryMessage","shippingInformationSmall","smallParcelAttributeKey","defaultVariantShippingInformation","property","Key","StringValue","deliveryDays","leadTime","brandList","brand","brandBackofficeAttributePlp","singleBrand","brandName","brandLeadtime","CustomSkeleton","_parseValue","productRating","renderLabel","name","price","rating","ratingAriaLabel","getRatingAriaLabel","roundedRating","toFixed","renderRating","typeName","avgRating","totalRatings","ariaLabel","numRatings","RatingComponent","ratingCount","readOnly","data","renderPrice","basePrice","adjustedPrice","savingsText","freePriceText","originalPriceText","currentPriceText","BasePrice","AdjustedPrice","CustomerContextualPrice","PriceComponent","renderProductPlacementImage","productCardimageSettings","gridSettings","fallbackImageUrl","altText","fallBackImage","emptyPlaceHolderImage","fallbackImageSource","image","src","fallBackSrc","imageProps","imageSettings","cropFocalRegion","Image","loadFailureBehavior","bypassHideOnFailure","renderProductBadge","attributeName","attributes","badgeData","currAttribute","finalizedBadges","badge","parseBadgeData","parsedBadge","buildProductBadge","ProductComponent","msdyn365Commerce","component","allowBack","telemetryContent","quickViewButton","eyebrowMessage","badgeAttribute","deliveryMessage","isRefinersEnabled","displayShopNow","shopNowBtnText","showBvRatings","enableAttributeBasedRating","getEyebrowElementRef","eyebrowElement","current","querySelector","isTruncated","setTruncated","scrollHeight","visibleHeight","clientHeight","badgeAttributeToUse","productBadgeAttribute","AttributeValues","isBVratings","averageRating","AverageRating","TotalRatings","handleResize","addEventListener","removeEventListener","EcomLowestPriceVariantRecIdKey","unbxdDefaultVariant","LongValue","queryBasedSelection","placeholderImageName","defaultOrLowestVariantRecordId","productUrl","getProductPageUrlSync","MasterProductId","srcUrl","baseUrl","queryString","search","pathname","updateProductUrl","variantIdQueryParams","payLoad","getPayloadObject","attribute","getTelemetryAttributes","sizeValue","stringValue","stopConvert","txt","charAt","isCustomizedDesign","parseBrandName","productTitleWithBrandname","ErrorBoundary","telemetry","onClick","onTelemetryClick","cultureFormatter","formatCurrency","Price","PrimaryImageUrl","title","slice","hideRating","Button","priceComponent","isSearchResultContainer","role","setProductUrl","ref","RichTextComponent","text","BVRatingSummary","description","Description","DeliveryMessage","FinancingPerMonthComponent","sellingPrice","activeVariantId","activeColorVariantId","getViewport","props","device","Type","innerWidth","xs","w","sm","md","lg","_getProductsList","productCollection","updatedProducts","getProductData","_getProduct","ObjectExtensions","filter","trace","resources","friendlyName","allowBackNavigation","slots","quickview","quickviewSlot","breaCrumbType","breadcrumbType","priceResources","priceRangeSeparator","getTelemetryObject","telemetryPageName","reviewCountAriaLabelValue","ratingCountAriaLabel","ratingCountAriaLabelSingleUser","isPriceMinMaxEnabled","featureState","ProductContainer","tag","classnames","productComponent","priceFree","IsEnabled","shopNowButtonText","_renderSimpleCarousel","carouselContainer","Node","_renderSimpleProduct","heading","ProductCollectionContainer","SingleSlideCarouselComponentProps","GridComponentProps","layoutType","layout","productIDList","setproductIDList","categoryID","setCategoryID","teliumCall","setteliumCall","productPricesIter","prodId","productsCategories","categoryIds","productCategoriesIter","CategoryPath","catPathSegments","Segments","catId","CategoryId","catName","CategoryName","collectionProductAttributes","configVendorNamePlp","configVendorNamePdp","brandBackofficeAttributePdp","getBrandNameCheck","eProps","ePropsIter","categoryId","categoryName","variantID","getProductsCategories","then","_renderGrid","gridContainer","_renderProduct","inView","useInView","triggerOnce","productID","prevArray","handleProductId","productHeading","productName","productPositionArr","productRecordID","categoryListArr","brandNameArr","productVariantArr","pagePath","event","enhanced_action","event_category","event_action","event_label","event_noninteraction","product_list_name","product_position","product_id","product_name","product_category","product_brand","product_variant","singlePosition","callTeliumOnClick","skipProductsVal","skipProducts","viewPortCode","getSkipProductValue","categoryListArray","item1","some","item2","categoryList","listName","productRecommendationImpressionListName","productNameArr","productIdArr","productPriceArr","productListArray","product_impression_list_name","product_impression_position","product_impression_id","product_impression_name","product_impression_category","product_impression_brand","product_impression_variant","product_impression_price","callTelium","Module","warning","binding","modules","dataActions","c","require","$type","da","path","runOn","iNM","ns","n","p","pdp","sanitizedActionPath","dataAction","default","prototype","RegistrationId","registerSanitizedActionPath","__bindings__","viewDictionary","cn","ProductCollection","super","handleHeadingChange","target","_getProductsDimensionsAvailabilities","dimensionsToDisplayOnProductCard","dimensionsInProductCard","dimensionsToDisplayAsSwatch","dimensionsAsSwatchType","validProducts","productsDimensionAvailabilities","getDimensionAvailabilitiesForProductSearchResultAction","DimensionAvailabilitiesForProductSearchResultInput","setState","initProductState","state","productCollectionProducts","productComparisonButtonSlot","productComparisonButton","dimensionAvailabilities","dimensionAvailability","masterProductId","_getActivePrice","productsList","getPriceForProductSearchResult","PriceForProductSearchResultInput","_getSeeAllButton","recommendation","headingLabel","seeAllLink","getCatalogId","seeAllButtonText","productPrices","enableAffiliationBasedPricing","user","isAuthenticated","render","shouldDisplaySeeAllButton","recommendationListId","isCarousel","headingComponent","editProps","onEdit","productCollectionViewProps","SingleSlideCarousel","flipperPrevLabel","flipperPrevious","flipperNextLabel","flipperNext","parentId","moduleProps","seeAllButton","renderView","_renderCarousel","module","exports","ReactDOM"],"sourceRoot":""}