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EAAQ,MACjBC,MAAO,gBACPC,GAAI,CAAC,CAACC,KAAK,wBAA0BC,KAAK,0CAA2CC,MAAO,GAAG,CAACF,KAAK,2BAA6BC,KAAK,6CAA8CC,MAAO,GAAG,CAACF,KAAK,UAAYC,KAAK,0EAA2EC,MAAO,GAAG,CAACF,KAAK,mCAAqCC,KAAK,+CAAgDC,MAAO,GAAG,CAACF,KAAK,2BAA6BC,KAAK,mDAAoDC,MAAO,IAExfC,KAAK,EACLC,GAAI,YACJC,EAAG,yBACHC,EAAG,YAEHC,IAAK,GAGLC,GAAI,sCAOAlB,EAF4B,0EACXO,EAAQ,KAQzBP,EAF4B,0CACXO,EAAQ,MAQzBP,EAF4B,6CACXO,EAAQ,MAQzBP,EAF4B,+CACXO,EAAQ,MAQzBP,EAF4B,mDACXO,EAAQ,MAMjCnY,OAAO+Y,aAAe/Y,OAAO+Y,cAAgB,GAC7C/Y,OAAO+Y,aAAarB,QAAO,OACpB1X,OAAO+Y,aAAarB,SAAW,IAC/BD,EAAQC,SAGX1X,OAAO+Y,aAAapB,YAAW,OAC5B3X,OAAO+Y,aAAapB,aAAe,IACnCF,EAAQE,aAEY,MAAMqB,EAAiB,GAC9BA,EAAe,6EAA+E,CACtGd,EAAG,IAAMC,EAAQ,MACjBc,GAAI,8CAEpBjZ,OAAO+Y,aAAe/Y,OAAO+Y,cAAgB,GAC7C/Y,OAAO+Y,aAAaC,eAAc,OACPhZ,OAAO+Y,aAAaC,gBAAkB,IACtCA,UC/G3BE,EAAOC,QAAUzY,cCAjBwY,EAAOC,QAAUC","sources":["webpack://mattressfirm/./src/Utilities/components/BVRatingSummary.tsx?6e2e","webpack://mattressfirm/./src/Utilities/get-delivery-by-message.tsx?05db","webpack://mattressfirm/./src/Utilities/get-rating.tsx?7b67","webpack://mattressfirm/./src/Utilities/getAttributeUtils.ts?f2d8","webpack://mattressfirm/./src/Utilities/product-search-result-utils.tsx?58f2","webpack://mattressfirm/./src/actions/complete-your-bed-pillow.action.ts?db7f","webpack://mattressfirm/./src/actions/complete-your-bed-protector.action.ts?82b2","webpack://mattressfirm/./src/actions/fetch-complete-your-bed.action.ts?ea35","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/product-compare-buybox-state-sharing.ts?5126","webpack://mattressfirm/./src/data-actions/get-attributes-for-selected-variant.ts?4859","webpack://mattressfirm/./src/modules/mfrm-complete-your-bed/mfrm-complete-your-bed.tsx?0ab0","webpack://mattressfirm/./src/modules/mfrm-complete-your-bed/util/renderBaseImage.tsx?1323","webpack://mattressfirm/./src/modules/mfrm-complete-your-bed/util/hasDiscount.tsx?c72f","webpack://mattressfirm/./src/modules/mfrm-complete-your-bed/mfrm-complete-your-bed.view.tsx?d7c3","webpack://mattressfirm/./src/themes/mattressfirm/views/components/delivery-message/deliverymessage.component.tsx?e440","webpack://mattressfirm/./src/themes/mattressfirm/views/components/price/split-price.tsx?ee35","webpack://mattressfirm/./src/themes/mattressfirm/views/components/price/price.component.tsx?5d2f","webpack://mattressfirm/./src/themes/mattressfirm/views/components/selectable-card/selectable-card.component.tsx?a7a2","webpack://mattressfirm/./lib/mfrm-complete-your-bed/module-registration.js?70e6","webpack://mattressfirm/external var \"React\"?0d3b","webpack://mattressfirm/external var \"ReactDOM\"?853b"],"sourcesContent":["import React, { useState, useEffect, useRef } from 'react';\r\n\r\nexport const BVRatingSummary = ({\r\n itemId,\r\n onClick,\r\n variantId,\r\n hideReadReviewsButton\r\n}: {\r\n itemId: string | undefined;\r\n onClick?: () => void;\r\n variantId?: number | undefined;\r\n hideReadReviewsButton?: boolean\r\n}) => {\r\n const [dataBvProductIdAttr, setDataBvProductIdAttr] = useState(itemId);\r\n const wrapper = useRef(null);\r\n const interval = useRef(-1);\r\n const [numReviews, setNumReviews] = useState();\r\n\r\n useEffect(() => {\r\n setDataBvProductIdAttr(itemId);\r\n }, [itemId]);\r\n\r\n useEffect(() => {\r\n setDataBvProductIdAttr('bv-refresh');\r\n }, [variantId]);\r\n\r\n useEffect(() => {\r\n if (dataBvProductIdAttr === 'bv-refresh') {\r\n setDataBvProductIdAttr(itemId);\r\n }\r\n }, [dataBvProductIdAttr]);\r\n useEffect(() => {\r\n const pollInterval = window.setInterval(() => {\r\n const numReviewsHTML = wrapper.current?.querySelector('.bv_numReviews_text')?.innerHTML.match(/\\(([^)]+)\\)/)?.[1];\r\n if (numReviewsHTML) {\r\n setNumReviews(numReviewsHTML);\r\n clearInterval(pollInterval);\r\n }\r\n }, 0);\r\n });\r\n useEffect(() => {\r\n if (wrapper.current) {\r\n numReviews === '0' ? wrapper.current.style.display = 'none' : wrapper.current.style.display = 'flex';\r\n }\r\n }, [numReviews]);\r\n\r\n return (\r\n {\r\n if (hideReadReviewsButton) {\r\n interval.current = window.setInterval(() => {\r\n const button: Element | undefined = Array.from(document.querySelectorAll('.bv_button_buttonFull')).find((button) => {\r\n return button?.innerHTML === `Read ${numReviews} Reviews`;\r\n });\r\n if (button) {\r\n button.outerHTML = '';\r\n }\r\n });\r\n }\r\n }}\r\n onMouseLeave={() => {\r\n if (hideReadReviewsButton) {\r\n clearInterval(interval.current);\r\n }\r\n }}\r\n data-bv-show='rating_summary'\r\n data-bv-product-id={dataBvProductIdAttr}\r\n onClick={onClick}\r\n ref={wrapper}\r\n />\r\n );\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 { RatingComponent } from '@msdyn365-commerce/components';\r\nimport {\r\n ICoreContext\r\n} from '@msdyn365-commerce/core';\r\nimport {\r\n format\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport React from 'react';\r\nexport function 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\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}","import { AttributeValue } from \"@msdyn365-commerce/retail-proxy\";\r\n\r\nexport const getAttributeByName = (attributeValues: AttributeValue[] | undefined, keyValue: string): AttributeValue | undefined => {\r\n return attributeValues && attributeValues.find(currAttribute => currAttribute.Name && currAttribute.Name.toLowerCase().trim() === keyValue.toLowerCase().trim());\r\n};\r\nexport const getAttributeValueByNameUnbxd = (list: any[] | undefined, keyValue: string | undefined): string | undefined => {\r\n return keyValue && list && list[keyValue];\r\n};\r\nexport const getAttributeArrayValueByNameUnbxd = (list: any[] | undefined, keyValue: string | undefined): string[] | undefined => {\r\n return keyValue && list && list[keyValue];\r\n};\r\nexport const getAttributeTextValue = (attribute: AttributeValue | undefined): string | undefined => {\r\n return attribute && attribute.TextValue;\r\n};\r\nexport const getunbxdAttributeNameByCRTName = (crtName: string | undefined, mapList: any): string | undefined => {\r\n return mapList && Array.isArray(mapList) && mapList?.find((attr: any) => crtName && attr?.CRTName.toLowerCase().trim() === crtName.toLowerCase().trim())?.UnbxdName;\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.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\n\r\n/**\r\n * CompleteyourBedPillow Input Action\r\n */\r\nexport class CompleteYourBedPillowInput implements Msdyn365.IActionInput {\r\n public pillow: SimpleProduct | undefined | null;\r\n // Construct the input needed to run the action\r\n constructor(pillow: SimpleProduct | undefined | null) {\r\n this.pillow = pillow;\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 = () => `CompleteyourBedPillow`;\r\n public getCacheObjectType = () => 'CompleteyourBedPillow';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\nexport interface ICompleteYourBedPillowData {\r\n pillow: SimpleProduct | undefined | null;\r\n}\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new CompleteYourBedPillowInput(args?.config?.pillow);\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 action(input: CompleteYourBedPillowInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { pillow: input.pillow };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // Give your data action a unique id\r\n id: 'CompleteyourBedPillow',\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","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\n\r\n/**\r\n * CompleteyourBedProtector Input Action\r\n */\r\nexport class CompleteyourBedProtectorInput implements Msdyn365.IActionInput {\r\n public protector: SimpleProduct | undefined | null;\r\n // Construct the input needed to run the action\r\n constructor(protector: SimpleProduct | undefined | null) {\r\n this.protector = protector;\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 = () => `CompleteyourBedProtector`;\r\n public getCacheObjectType = () => 'CompleteyourBedProtector';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\nexport interface ICompleteYourBedProtectorData {\r\n protector: SimpleProduct | undefined | null;\r\n}\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new CompleteyourBedProtectorInput(args?.config?.protector);\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 action(input: CompleteyourBedProtectorInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { protector: input.protector };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // Give your data action a unique id\r\n id: 'CompleteyourBedProtector',\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","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { AsyncResult } from '@msdyn365-commerce/retail-proxy';\r\n\r\n/**\r\n * FetchcompleteYourBedData Input Action\r\n */\r\nexport class FetchCompleteYourBedDataInput implements Msdyn365.IActionInput {\r\n public jsonData: string;\r\n // Construct the input needed to run the action\r\n constructor(jsonData: string) {\r\n this.jsonData = jsonData;\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 = () => `completeYourBedData`;\r\n public getCacheObjectType = () => 'completeYourBedDataObject';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\nexport interface IFetchcompleteYourBedData {\r\n text: string;\r\n jsonData: string;\r\n}\r\n\r\nexport interface IDataRow {\r\n mattressVariantReqId: string;\r\n buyAllVariantRecIds:any;\r\n}\r\n\r\nexport interface foo {\r\n data: AsyncResult;\r\n}\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new FetchCompleteYourBedDataInput(args?.config?.jsonData!);\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 action(input: FetchCompleteYourBedDataInput, ctx: Msdyn365.IActionContext): Promise {\r\n\r\n const res = await Msdyn365.sendRequest(input.jsonData, 'get');\r\n const data = res.data;\r\n return data;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // Give your data action a unique id\r\n id: 'FetchcompleteYourBedData',\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","/*---------------------------------------------------------------------------------------------\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","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { observable } from 'mobx';\r\n/**\r\n * SelectYourFoundation Input Action\r\n */\r\nexport class ProductCompareBuyboxStateSharing implements Msdyn365.IActionInput {\r\n @observable public zipCode?: string | undefined;\r\n // Construct the input needed to run the action\r\n constructor(zipCode: string | undefined) {\r\n this.zipCode = zipCode;\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 = () => `ProductCompareBuyboxStateSharing`;\r\n public getCacheObjectType = () => 'ProductCompareBuyboxStateSharing';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\nexport interface ISelectYourFoundationData {\r\n zipCode: string | undefined;\r\n}\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new ProductCompareBuyboxStateSharing(args?.config?.zipCode);\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 action(input: ProductCompareBuyboxStateSharing, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { zipCode: input.zipCode };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // Give your data action a unique id\r\n id: 'ProductCompareBuyboxStateSharing',\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","import {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICreateActionContext,\r\n IGeneric\r\n} from '@msdyn365-commerce/core';\r\nimport { AttributeValue, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\n\r\nimport { getSelectedProductIdFromActionInput, getSelectedVariant, SelectedVariantInput } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getAttributeValuesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\n\r\n/**\r\n * Chains getting the SelectedVariant with GetActivePrice\r\n */\r\nexport class AttributesForSelectedVariantInput implements IActionInput {\r\n public productId: number;\r\n public channelId: number;\r\n public catalogId: number;\r\n public selectedProduct: SimpleProduct | undefined;\r\n\r\n constructor(productId: number, channelId: number, selectedProduct?: SimpleProduct, catalogId?: number) {\r\n this.productId = productId;\r\n this.channelId = channelId;\r\n this.selectedProduct = selectedProduct;\r\n this.catalogId = catalogId || 0;\r\n }\r\n\r\n public getCacheKey = () => `AttributesForSelectedVariant`;\r\n public getCacheObjectType = () => 'ProductAttributeValue';\r\n public dataCacheType = (): CacheType => 'none';\r\n}\r\n\r\nexport const createAttributesForSelectedVariantInput = (\r\n inputData: ICreateActionContext>\r\n): AttributesForSelectedVariantInput => {\r\n const productId = getSelectedProductIdFromActionInput(inputData);\r\n if (productId) {\r\n return new AttributesForSelectedVariantInput(+productId, +inputData.requestContext.apiSettings.channelId);\r\n } else {\r\n throw new Error('Unable to create PriceForSelectedVariantInput, no productId found on module config or query');\r\n }\r\n};\r\n\r\n/**\r\n * Calls the Retail API a get a list of dimension values for a given product.\r\n */\r\nexport async function getAttributesForSelectedVariantAction(\r\n input: AttributesForSelectedVariantInput,\r\n ctx: IActionContext\r\n): Promise {\r\n // @ts-ignore: Promise vs. ObservablePromise typing conflict\r\n return Promise.resolve()\r\n .then(() => {\r\n const activeProduct: SimpleProduct | undefined = input.selectedProduct;\r\n\r\n if (!activeProduct) {\r\n const selectedVariantInput = new SelectedVariantInput(input.productId, input.channelId);\r\n\r\n return getSelectedVariant(selectedVariantInput, ctx);\r\n }\r\n\r\n return activeProduct;\r\n })\r\n .then((productResult: SimpleProduct | null) => {\r\n const activeProduct: SimpleProduct | undefined = productResult;\r\n\r\n if (activeProduct) {\r\n return getAttributeValuesAsync(\r\n { callerContext: ctx, queryResultSettings: {} },\r\n activeProduct.RecordId,\r\n input.channelId,\r\n input.catalogId\r\n );\r\n }\r\n\r\n return null;\r\n })\r\n .then((attributeValues: AttributeValue[] | null) => {\r\n const resultArray = attributeValues;\r\n if (resultArray) {\r\n return resultArray;\r\n }\r\n\r\n return [];\r\n })\r\n .catch((error: Error) => {\r\n ctx.trace(error.message);\r\n throw new Error(`[getPriceForSelectedVariantAction]Error executing action ${error.message}`);\r\n });\r\n}\r\n\r\nexport default createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/product-info/get-attributes-for-selected-variant',\r\n action: >getAttributesForSelectedVariantAction,\r\n input: createAttributesForSelectedVariantInput\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n\r\nimport React, { useEffect } from 'react';\r\n\r\nimport { IMfrmCompleteYourBedData } from './mfrm-complete-your-bed.data';\r\nimport { IMfrmCompleteYourBedProps } from './mfrm-complete-your-bed.props.autogenerated';\r\nimport { getActivePricesAsync, getAttributeValuesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { ProductSearchCriteria, ProductSearchResult, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { getBVAttributeValues } from '../../Utilities/get-bv-attributes';\r\nimport { getByIdsAsync, searchByCriteriaAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport fetchCompleteYourBedDataDataAction, { FetchCompleteYourBedDataInput, IDataRow } from '../../actions/fetch-complete-your-bed.action';\r\nimport { CompleteYourBedPillowInput } from '../../actions/complete-your-bed-pillow.action';\r\nimport { generateImageUrl } from '../../data-actions/utilities/utils';\r\nimport { getTelemetryObject, getPayloadObject, onTelemetryClick, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport { CompleteyourBedProtectorInput } from '../../actions/complete-your-bed-protector.action';\r\nimport { getAttributeByName } from '../../Utilities/getAttributeUtils';\r\nimport { _getProductType } from '../../themes/mattressfirm/views/components/delivery-message/deliverymessage.component';\r\nimport { _smallParcelProductATPBooleanStatus } from '../../Utilities/mfrm-buybox-utils';\r\n\r\nexport interface IMfrmCompleteYourBedViewProps extends IMfrmCompleteYourBedProps {\r\n product: SimpleProduct;\r\n items: MergedProduct[];\r\n protectorData: MergedProduct[];\r\n onUnselect(arg0: SimpleProduct, arg1: number): void;\r\n onSelect(arg0: SimpleProduct, arg1: number, arg2: boolean | undefined): void;\r\n onUnselectProtector(arg0: SimpleProduct, arg1: number): void;\r\n onSelectProtector(arg0: SimpleProduct, arg1: number, arg2: boolean | undefined): void;\r\n matressProtectorData: any;\r\n protectorSelected: boolean;\r\n pillowSelected: boolean;\r\n}\r\nexport interface MergedProduct extends SimpleProduct {\r\n productName?: string;\r\n ItemId?: string;\r\n CustomerContextualPrice: number | undefined;\r\n DiscountAmount: number | undefined;\r\n TotalRatings: number | undefined;\r\n AverageRating: number | undefined;\r\n brand?: string;\r\n PrimaryImageUrl?: string;\r\n isSelected: boolean;\r\n inventoryStatus: { outOfStock: boolean | undefined, productType: string | undefined };\r\n}\r\n/**\r\n *\r\n * MfrmCompleteYourBed component\r\n * @extends {React.PureComponent>}\r\n */\r\n\r\nexport const MfrmCompleteYourBed: React.FC> = props => {\r\n // let smallParcelData: any[] = [];\r\n const [items, setItems] = React.useState([]);\r\n const [protectorData, setProtectorData] = React.useState([]);\r\n // const [matressProtectorData, setMatressProtectorData] = React.useState(null);\r\n const [protectorSelected, setProtectorSelected] = React.useState(false);\r\n const [pillowSelected, setPillowSelected] = React.useState(false);\r\n const [database, setDatabase] = React.useState(null);\r\n const {\r\n data: {\r\n product: { result: productResult },\r\n productCompareBuyboxStateSharing: { result: buyboxState }\r\n }\r\n } = props;\r\n const getVariantIds = (RecordId: any) => {\r\n const databaseRow: IDataRow = database.find((item: any /* this is obvi */) => item.mattressVariantReqId === `${RecordId}`);\r\n setItems([]);\r\n setProtectorData([]);\r\n props.context.actionContext.update(new CompleteYourBedPillowInput(null), { pillow: null });\r\n props.context.actionContext.update(new CompleteyourBedProtectorInput(null), { protector: null });\r\n const buyAll3Array = databaseRow?.buyAllVariantRecIds;\r\n if (buyAll3Array && buyAll3Array.length > 0) {\r\n buyAll3Array[0] && buyAll3Array && getProductsFromProductId(Number(buyAll3Array[0]), \"pillow\");\r\n if (buyAll3Array.length > 1) {\r\n buyAll3Array[1] && buyAll3Array && getProductsFromProductId(Number(buyAll3Array[1]), \"protector\");\r\n }\r\n }\r\n };\r\n const getProductsFromProductId = async (RecordId: number, type: string) => {\r\n\r\n const products = await getByIdsAsync(\r\n { callerContext: props.context.actionContext },\r\n props.context.request.apiSettings.channelId,\r\n [RecordId]\r\n );\r\n const inventoryStatus = await getInventoryStatus(RecordId, products[0]?.ItemId?.toString(), undefined, undefined);\r\n const productPrices = await getActivePricesAsync(\r\n { callerContext: props.context.actionContext },\r\n {\r\n ChannelId: props.context.actionContext.requestContext.apiSettings.channelId,\r\n CatalogId: props.context.actionContext.requestContext.apiSettings.catalogId\r\n },\r\n [RecordId],\r\n new Date(),\r\n null,\r\n [],\r\n true\r\n );\r\n let productSearchResults: ProductSearchResult[] = [];\r\n if (products.length) {\r\n const productSearchCriteria: ProductSearchCriteria = {\r\n Ids: [...new Set(products.map(item => item.MasterProductId ?? 0))],\r\n Context: {\r\n ChannelId: +props.context.actionContext.requestContext.apiSettings.channelId,\r\n CatalogId: +props.context.actionContext.requestContext.apiSettings.catalogId\r\n },\r\n IncludeAttributes: true,\r\n SearchCondition: '*'\r\n };\r\n productSearchResults = await searchByCriteriaAsync({ callerContext: props.context.actionContext }, productSearchCriteria);\r\n }\r\n const _parseValue = (productRating?: string | number): number => {\r\n const value = +(productRating || 0);\r\n return Math.round(value * 10) / 10;\r\n };\r\n const MergedProducts: any[] = products.map((product, i) => {\r\n const productImageUrl = product.PrimaryImageUrl;\r\n return {\r\n ...product,\r\n productName: product.Name,\r\n ItemId: product.ItemId,\r\n CustomerContextualPrice: productPrices[i].CustomerContextualPrice,\r\n DiscountAmount: productPrices[i].DiscountAmount,\r\n AverageRating:\r\n getBVAttributeValues(\r\n productSearchResults.find(item => item.MasterProductId === product.MasterProductId)?.AttributeValues,\r\n 'BVAverageOverallRating'\r\n ) ?? _parseValue(productSearchResults.find(item => item.MasterProductId === product.MasterProductId)?.AverageRating),\r\n TotalRatings:\r\n getBVAttributeValues(\r\n productSearchResults.find(item => item.MasterProductId === product.MasterProductId)?.AttributeValues,\r\n 'BVTotalReviewCount'\r\n ) ?? _parseValue(productSearchResults.find(item => item.MasterProductId === product.MasterProductId)?.TotalRatings),\r\n brand: productSearchResults.find(item => item.MasterProductId === product.MasterProductId)?.AttributeValues?.find(attr => attr.KeyName?.trim() === 'VendorBrand')?.TextValue,\r\n PrimaryImageUrl: generateImageUrl(productImageUrl, props.context.request.apiSettings),\r\n inventoryStatus\r\n };\r\n });\r\n\r\n type === \"pillow\" ? setItems(MergedProducts) : setProtectorData(MergedProducts);\r\n type === \"protector\" && MergedProducts && protectorSelected && props.context.actionContext.update(new CompleteyourBedProtectorInput(MergedProducts[0]), { protector: MergedProducts[0], listPosition: 0 });\r\n type === \"pillow\" && MergedProducts && pillowSelected && props.context.actionContext.update(new CompleteYourBedPillowInput(MergedProducts[0]), { pillow: MergedProducts[0], listPosition: 0 });\r\n };\r\n\r\n const getInventoryStatus = async (variantId: number, itemId: string | undefined, productTypeArg: string | undefined, outOfStock: boolean | undefined, isZipCodeChnaged: boolean = false):\r\n Promise<{ productType: string, outOfStock: boolean | undefined }> => {\r\n if (!productTypeArg) {\r\n const attributeValues = await getAttributeValuesAsync(\r\n {\r\n callerContext: props.context.actionContext,\r\n queryResultSettings: {}\r\n },\r\n variantId,\r\n props.context.actionContext.requestContext.apiSettings.channelId,\r\n props.context.actionContext.requestContext.apiSettings.catalogId\r\n );\r\n productTypeArg = _getProductType(getAttributeByName(attributeValues, 'shippingInformation')?.TextValue).toLowerCase();\r\n outOfStock = getAttributeByName(attributeValues, 'Out of Stock')?.BooleanValue ?? false;\r\n }\r\n if (productTypeArg === 'small parcel' && (isZipCodeChnaged || !outOfStock)) {\r\n outOfStock = await _smallParcelProductATPBooleanStatus(variantId, itemId, props.context.app.config.weeksPDPforATPCall, props.context);\r\n }\r\n return { productType: productTypeArg, outOfStock };\r\n };\r\n\r\n const onSelectPillow = (product: SimpleProduct | null | undefined, index: any, outOfStock?: boolean | undefined) => {\r\n if (outOfStock) {\r\n return;\r\n }\r\n const telemetryContent: ITelemetryContent = getTelemetryObject('Products Details Page', props.friendlyName, props.telemetry);\r\n const payLoad = getPayloadObject('click', telemetryContent, 'Selected Pillow', '');\r\n onTelemetryClick(telemetryContent, payLoad, 'Selected Pillow')();\r\n props.context.actionContext.update(new CompleteYourBedPillowInput(product), { pillow: product, listPosition: index });\r\n const clone = items.map((item, i) => {\r\n if (index === i) {\r\n item.isSelected = true;\r\n }\r\n\r\n return item;\r\n });\r\n setItems(clone);\r\n setPillowSelected(true);\r\n\r\n };\r\n\r\n const onSelectProtector = (product: SimpleProduct | null | undefined, index: any, outOfStock?: boolean | undefined) => {\r\n if (outOfStock) {\r\n return;\r\n }\r\n const telemetryContent: ITelemetryContent = getTelemetryObject('Products Details Page', props.friendlyName, props.telemetry);\r\n const payLoad = getPayloadObject('click', telemetryContent, 'Selected Mattress Protector', '');\r\n onTelemetryClick(telemetryContent, payLoad, 'Selected Mattress Protector')();\r\n props.context.actionContext.update(new CompleteyourBedProtectorInput(product), { protector: product, listPosition: index });\r\n const clone = protectorData.map((item, i) => {\r\n if (index === i) {\r\n item.isSelected = true;\r\n }\r\n\r\n return item;\r\n });\r\n setProtectorData(clone);\r\n setProtectorSelected(true);\r\n\r\n };\r\n\r\n const onUnselectPillow = (product: SimpleProduct | null | undefined, index: any, outOfStock?: boolean | undefined) => {\r\n const telemetryContent: ITelemetryContent = getTelemetryObject('Products Details Page', props.friendlyName, props.telemetry);\r\n const payLoad = getPayloadObject('click', telemetryContent, 'Unselected Pillow', '');\r\n onTelemetryClick(telemetryContent, payLoad, 'Unselected Pillow')();\r\n props.context.actionContext.update(new CompleteYourBedPillowInput(null), { pillow: null });\r\n const clone = items.map((item, i) => {\r\n if (index === i) {\r\n item.isSelected = false;\r\n if (outOfStock) {\r\n item.inventoryStatus.outOfStock = outOfStock;\r\n }\r\n }\r\n\r\n return item;\r\n });\r\n setItems(clone);\r\n setPillowSelected(false);\r\n\r\n };\r\n const onUnselectProtector = (product: SimpleProduct | null | undefined, index: any, outOfStock?: boolean | undefined) => {\r\n const telemetryContent: ITelemetryContent = getTelemetryObject('Products Details Page', props.friendlyName, props.telemetry);\r\n const payLoad = getPayloadObject('click', telemetryContent, 'Unselected Mattress Protector', '');\r\n onTelemetryClick(telemetryContent, payLoad, 'Unselected Mattress Protector')();\r\n props.context.actionContext.update(new CompleteyourBedProtectorInput(null), { protector: null });\r\n const clone = protectorData.map((item, i) => {\r\n if (index === i) {\r\n item.isSelected = false;\r\n if (outOfStock) {\r\n item.inventoryStatus.outOfStock = outOfStock;\r\n }\r\n }\r\n\r\n return item;\r\n });\r\n setProtectorData(clone);\r\n setProtectorSelected(false);\r\n\r\n };\r\n\r\n const inventoryCheckZipCode = async () => {\r\n if (buyboxState?.zipCode) {\r\n if (items?.length > 0 && (items[0].inventoryStatus?.productType === 'small parcel')) {\r\n await getInventoryStatus(items[0]?.RecordId, items[0]?.ItemId?.toString(), items[0].inventoryStatus?.productType, items[0].inventoryStatus?.outOfStock, true).then((status: any) => {\r\n setItems(prevState => {\r\n const newItems = [...prevState];\r\n newItems[0] = { ...newItems[0], inventoryStatus: { productType: newItems[0].inventoryStatus.productType, outOfStock: status?.outOfStock } };\r\n return newItems;\r\n });\r\n if (status?.outOfStock && pillowSelected) {\r\n onUnselectPillow(null, 0, status?.outOfStock);\r\n }\r\n }).catch((err) => console.log(err));\r\n }\r\n if (protectorData?.length > 0 && (protectorData[0].inventoryStatus?.productType === 'small parcel')) {\r\n await getInventoryStatus(protectorData[0]?.RecordId, protectorData[0]?.ItemId?.toString(), protectorData[0].inventoryStatus?.productType, protectorData[0].inventoryStatus?.outOfStock, true).then((status: any) => {\r\n setProtectorData(prevState => {\r\n const newItems = [...prevState];\r\n newItems[0] = { ...newItems[0], inventoryStatus: { productType: newItems[0].inventoryStatus.productType, outOfStock: status?.outOfStock } };\r\n return newItems;\r\n });\r\n if (status?.outOfStock && protectorSelected) {\r\n onUnselectProtector(null, 0, status?.outOfStock);\r\n }\r\n }\r\n ).catch((err) => console.log(err));\r\n }\r\n }\r\n };\r\n useEffect(() => {\r\n const actionInput = new FetchCompleteYourBedDataInput(props.context.app.config.jsonSrc);\r\n fetchCompleteYourBedDataDataAction(actionInput, props.context.actionContext)\r\n .then(data => setDatabase(data))\r\n .catch(e => {\r\n console.error('Error fetching database', e);\r\n });\r\n }, []);\r\n useEffect(() => {\r\n void inventoryCheckZipCode();\r\n }, [buyboxState?.zipCode]);\r\n useEffect(() => {\r\n database && productResult?.RecordId && getVariantIds(productResult?.RecordId);\r\n }, [productResult?.RecordId, database !== null]);\r\n return props.renderView({\r\n ...props,\r\n items,\r\n onSelect: onSelectPillow,\r\n onSelectProtector: onSelectProtector,\r\n onUnselect: onUnselectPillow,\r\n onUnselectProtector: onUnselectProtector,\r\n protectorData: protectorData,\r\n protectorSelected: protectorSelected,\r\n pillowSelected: pillowSelected\r\n });\r\n};\r\n\r\nexport default MfrmCompleteYourBed;\r\n\r\n\r\n","import React from 'react';\r\nimport { IGridSettings, IImageData, IImageSettings, Image } from '@msdyn365-commerce/core';\r\n\r\n\r\nexport const renderBaseImage = (\r\n gridSettings?: IGridSettings,\r\n PrimaryImageUrl?: string,\r\n altText?: string,\r\n fallbackImageUrl?: any\r\n): JSX.Element | null => {\r\n if (!PrimaryImageUrl || !gridSettings) {\r\n return null;\r\n }\r\n const defaultImageSettings: IImageSettings = {\r\n viewports: {\r\n xs: { q: `w=240&h=240&m=6`, w: 0, h: 0 },\r\n lg: { q: `w=240&h=240&m=6`, w: 0, h: 0 },\r\n xl: { q: `w=240&h=240&m=6`, w: 0, h: 0 }\r\n },\r\n lazyload: false\r\n };\r\n\r\n const img: IImageData = {\r\n src: PrimaryImageUrl ? PrimaryImageUrl : '',\r\n altText: altText ? altText : ''\r\n };\r\n return (\r\n \r\n );\r\n};","import { MergedProduct } from \"../mfrm-complete-your-bed\";\r\nexport const hasDiscount = (item: MergedProduct) => {\r\n return typeof item.DiscountAmount !== 'undefined' && item.DiscountAmount > 0;\r\n};","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as React from 'react';\r\nimport { Node } from '@msdyn365-commerce-modules/utilities';\r\nimport { IMfrmCompleteYourBedViewProps } from './mfrm-complete-your-bed';\r\nimport SelectableCard from '../../themes/mattressfirm/views/components/selectable-card';\r\nimport { renderBaseImage } from './util/renderBaseImage';\r\nimport { hasDiscount } from './util/hasDiscount';\r\nimport { getFallbackImageUrl } from '../../data-actions/utilities/utils';\r\nimport Price from '../../themes/mattressfirm/views/components/price/price.component';\r\nimport { BVRatingSummary } from '../../Utilities/components/BVRatingSummary';\r\nimport { renderRating } from '../../Utilities/get-rating';\r\n\r\nexport default (props: IMfrmCompleteYourBedViewProps) => {\r\n const { items, protectorData, onSelect, onUnselect, onSelectProtector, onUnselectProtector, protectorSelected, pillowSelected } = props;\r\n const renderBadge = (outOfStock: boolean | undefined, text: string | undefined) => {\r\n if (outOfStock) {\r\n return {text};\r\n }\r\n return null;\r\n };\r\n const renderCard = items.map((item, i) => {\r\n const onchange = (e: boolean | React.ChangeEvent | any) => {\r\n const checkbox = e.target;\r\n const checkboxIsChecked = checkbox.checked;\r\n if (checkboxIsChecked === true) {\r\n onSelect(item, i, item.inventoryStatus?.outOfStock);\r\n } else {\r\n onUnselect(item, i);\r\n }\r\n };\r\n\r\n const htmlCheckboxId = \"mfrm-complete-your-bed-checkbox-pillow\";\r\n return (\r\n <>\r\n {renderBadge(item.inventoryStatus?.outOfStock, props.resources.outOfStockText)}\r\n onchange(e)}\r\n disabled={item.inventoryStatus?.outOfStock}\r\n />\r\n \r\n : renderRating(\r\n props.context,\r\n props.typeName,\r\n props.id,\r\n item.AverageRating,\r\n item.TotalRatings,\r\n props.resources.ratingAriaLabel\r\n )}\r\n standardPrice={\r\n typeof item.CustomerContextualPrice === 'number' &&\r\n typeof item.DiscountAmount === 'number' &&\r\n item.CustomerContextualPrice + item.DiscountAmount\r\n }\r\n isActive={!item.inventoryStatus?.outOfStock}\r\n currentPrice={hasDiscount(item) && item.CustomerContextualPrice} />\r\n \r\n {pillowSelected && Added!}\r\n );\r\n });\r\n\r\n const renderProtectorCard = protectorData && protectorData.map((protector, i) => {\r\n const onchange = (e: boolean | React.ChangeEvent | any) => {\r\n const checkbox = e.target;\r\n const checkboxIsChecked = checkbox.checked;\r\n if (checkboxIsChecked === true) {\r\n onSelectProtector(protector, i, protector?.inventoryStatus?.outOfStock);\r\n } else {\r\n onUnselectProtector(protector, i);\r\n }\r\n };\r\n\r\n const htmlCheckboxId = \"mfrm-complete-your-bed-checkbox-protector\";\r\n return (\r\n <>\r\n {renderBadge(protector?.inventoryStatus?.outOfStock, props.resources.outOfStockText)}\r\n onchange(e)}\r\n disabled={protector?.inventoryStatus?.outOfStock}\r\n />\r\n \r\n
\r\n
{renderBaseImage(\r\n props.context.request.gridSettings,\r\n protector.PrimaryImageUrl,\r\n protector.productName,\r\n getFallbackImageUrl(protector.ItemId, props.context.request.apiSettings)\r\n )}
\r\n
\r\n
{''}
\r\n
{protector.productName ? protector.brand ? `${protector.brand} ${protector.productName}` : `${protector.productName}` : ''}
\r\n {protector.TotalRatings !== undefined && protector.AverageRating !== undefined && (\r\n
\r\n {props.config.showBVRatings ? (\r\n \r\n ) : (\r\n \r\n {renderRating(\r\n props.context,\r\n props.typeName,\r\n props.id,\r\n protector.AverageRating,\r\n protector.TotalRatings,\r\n props.resources.ratingAriaLabel\r\n )}\r\n \r\n )}\r\n
\r\n )}\r\n {protector.CustomerContextualPrice && }\r\n
\r\n
\r\n \r\n {protectorSelected && Added!} \r\n );\r\n });\r\n\r\n return (\r\n (items.length !== 0 || protectorData.length !== 0) && < div className='mfrm-complete-your-bed' >\r\n\r\n

{props.config.titleHeadingTag ? props.config.titleHeadingTag : \"Complete Your Bed\"}

\r\n {\r\n items.length !== 0 &&
\r\n {renderCard}\r\n
\r\n }\r\n {\r\n protectorData.length !== 0 &&
\r\n {renderProtectorCard}\r\n
\r\n }\r\n \r\n );\r\n};\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;","export const splitPrice = (price: number | boolean | undefined) => {\r\n if (price === 0) {\r\n return { dollars: \"0\", cents: \"\" };\r\n }\r\n const formattedPrice = price?.toLocaleString(\"en-US\", {\r\n style: \"currency\",\r\n currency: \"USD\"\r\n });\r\n\r\n const priceArr = formattedPrice?.match(/(\\d|,)+/g);\r\n\r\n const dollars = priceArr?.[0] || \"0\";\r\n const cents = priceArr?.[1] || \"00\";\r\n\r\n return { dollars, cents };\r\n};\r\n","import React from 'react';\r\nimport { splitPrice } from \"./split-price\";\r\n\r\nexport interface PriceProps {\r\n standard: number;\r\n current: number | false | undefined;\r\n}\r\n\r\nexport const Price:React.FC = ({ standard, current }) => {\r\n const { dollars: standardDollars, cents: standardCents } = splitPrice(\r\n standard\r\n );\r\n const { dollars: currentDollars, cents: currentCents } = splitPrice(current);\r\n\r\n return (\r\n
\r\n {current && (\r\n
\r\n ${currentDollars}\r\n {currentCents}\r\n
\r\n )}\r\n
\r\n ${standardDollars}\r\n {standardCents}\r\n {current &&
}\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default Price;\r\n","import React from 'react';\r\nimport { Price } from '../price/price.component';\r\nexport interface SelectableCardProps {\r\n img: React.ReactNode;\r\n productName: string;\r\n ratings?: React.ReactNode;\r\n standardPrice?: false | number;\r\n currentPrice?: false | number | undefined;\r\n eyebrowText?: string;\r\n isActive?: boolean\r\n}\r\n\r\nconst SelectableCard:React.FC = ({ img, productName, ratings, standardPrice, currentPrice, eyebrowText, isActive = true }) => {\r\n return (\r\n
\r\n
{img}
\r\n
\r\n
{eyebrowText}
\r\n
{productName}
\r\n {ratings && (\r\n
\r\n {ratings}\r\n
\r\n )}\r\n {standardPrice && }\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default SelectableCard;","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['mfrm-complete-your-bed'] = {\n c: () => require('partner/modules/mfrm-complete-your-bed/mfrm-complete-your-bed.tsx'),\n $type: 'contentModule',\n da: [{name:'completeYourBedPillow', path:'actions/complete-your-bed-pillow.action', runOn: 0},{name:'completeYourBedProtector', path:'actions/complete-your-bed-protector.action', runOn: 0},{name:'product', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant', runOn: 0},{name:'productCompareBuyboxStateSharing', path:'actions/product-compare-buybox-state-sharing', runOn: 0},{name:'productSpecificationData', path:'data-actions/get-attributes-for-selected-variant', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'mfrm-complete-your-bed',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/mfrm-complete-your-bed'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'actions/complete-your-bed-pillow.action';\n let dataAction = require('partner/actions/complete-your-bed-pillow.action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'actions/complete-your-bed-protector.action';\n let dataAction = require('partner/actions/complete-your-bed-protector.action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'actions/product-compare-buybox-state-sharing';\n let dataAction = require('partner/actions/product-compare-buybox-state-sharing');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'data-actions/get-attributes-for-selected-variant';\n let dataAction = require('partner/data-actions/get-attributes-for-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };\n export const viewDictionary = {};\n viewDictionary['__local__|__local__|modules|mfrm-complete-your-bed|mfrm-complete-your-bed'] = {\n c: () => require('partner/modules/mfrm-complete-your-bed/mfrm-complete-your-bed.view.tsx'),\n cn: '__local__-__local__-mfrm-complete-your-bed'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","module.exports = React;","module.exports = ReactDOM;"],"names":["BVRatingSummary","itemId","onClick","variantId","hideReadReviewsButton","dataBvProductIdAttr","setDataBvProductIdAttr","useState","wrapper","useRef","interval","numReviews","setNumReviews","useEffect","pollInterval","window","setInterval","numReviewsHTML","current","querySelector","innerHTML","match","clearInterval","style","display","React","onMouseEnter","button","Array","from","document","querySelectorAll","find","outerHTML","onMouseLeave","ref","async","request","context","isCached","getDeliveryMessageActionInput","GetDeliveryMessageInput","result","getDeliveryMessageAction","actionContext","error","console","log","renderRating","typeName","id","avgRating","totalRatings","ariaLabel","numRatings","toString","ratingAriaLabel","rating","roundedRating","toFixed","format","getRatingAriaLabel","RatingComponent","ratingCount","readOnly","data","getAttributeByName","attributeValues","keyValue","currAttribute","Name","toLowerCase","trim","getAttributeValueByNameUnbxd","list","getAttributeArrayValueByNameUnbxd","getunbxdAttributeNameByCRTName","crtName","mapList","isArray","attr","CRTName","UnbxdName","_getEyebrowMessage","products","priceGroupForAPICall","app","config","priceGroup","length","undefined","items","map","item","singleItem","ItemId","DistinctProductVariant","push","requestBody","PriceGroup","Items","getEyebrowMessageInput","GetEyebrowMessageInput","getEyebrowAction","_makeDeliveryMessage","days","deliveryByMessage","date","Date","daysSpan","split","deliveryDate","now","deliveryByMessageRange","parseInt","numberOfDays","newDate","setDate","getDate","dayjs","flag","_setTime","time","temp","newDatewithTime","toUpperCase","_getSoonestDeliveryDate","coreProductATPData","deliveryDetails","locationId","index","Available","ATPQuantity","today","SlotDate","currHour","StartTime","Location1","_getDeliveryDate","startTimeHour","substring","CompleteYourBedPillowInput","constructor","pillow","getCacheKey","getCacheObjectType","dataCacheType","this","Msdyn365","action","input","ctx","args","CompleteyourBedProtectorInput","protector","FetchCompleteYourBedDataInput","jsonData","ZipCode","ItemLines","VariantRecordId","mFIATPInventoryAsync","callerContext","MFIPromotionExtensionClass","odataObject","EyeBrows","i","className","substr","lastIndexOf","concat","EntityClasses","ExtensionProperties","createMFIGetAvailablePromotionsDescriptionInput","queryResultSettings","availablePromotionsDescription","key","DataServiceQuery","DataServiceEntities","availablePromotionsDescriptionsQuery","resultSettings","createDataServiceRequestForOperation","bypassCache","returnEntity","pageType","createCacheKey","obj","join","callActionOrExecute","mFIGetAvailablePromotionsDescriptionAsync","Paging","Top","ProductCompareBuyboxStateSharing","zipCode","__decorate","observable","AttributesForSelectedVariantInput","productId","channelId","selectedProduct","catalogId","createAttributesForSelectedVariantInput","inputData","getSelectedProductIdFromActionInput","requestContext","apiSettings","Error","getAttributesForSelectedVariantAction","Promise","resolve","then","activeProduct","selectedVariantInput","SelectedVariantInput","getSelectedVariant","productResult","getAttributeValuesAsync","RecordId","catch","trace","message","createObservableDataAction","MfrmCompleteYourBed","props","setItems","protectorData","setProtectorData","protectorSelected","setProtectorSelected","pillowSelected","setPillowSelected","database","setDatabase","product","productCompareBuyboxStateSharing","buyboxState","getProductsFromProductId","type","getByIdsAsync","inventoryStatus","getInventoryStatus","productPrices","getActivePricesAsync","ChannelId","CatalogId","productSearchResults","productSearchCriteria","Ids","Set","MasterProductId","Context","IncludeAttributes","SearchCondition","searchByCriteriaAsync","_parseValue","productRating","value","Math","round","MergedProducts","productImageUrl","PrimaryImageUrl","productName","CustomerContextualPrice","DiscountAmount","AverageRating","getBVAttributeValues","AttributeValues","TotalRatings","brand","KeyName","TextValue","generateImageUrl","update","listPosition","productTypeArg","outOfStock","isZipCodeChnaged","_getProductType","BooleanValue","_smallParcelProductATPBooleanStatus","weeksPDPforATPCall","productType","onUnselectPillow","telemetryContent","getTelemetryObject","friendlyName","telemetry","payLoad","getPayloadObject","onTelemetryClick","clone","isSelected","onUnselectProtector","actionInput","jsonSrc","fetchCompleteYourBedDataDataAction","e","status","prevState","newItems","err","inventoryCheckZipCode","databaseRow","mattressVariantReqId","buyAll3Array","buyAllVariantRecIds","Number","getVariantIds","renderView","onSelect","onSelectProtector","onUnselect","renderBaseImage","gridSettings","altText","fallbackImageUrl","defaultImageSettings","viewports","xs","q","w","h","lg","xl","lazyload","img","src","Image","fallBackSrc","imageSettings","bypassHideOnFailure","imageFallbackOptimize","hasDiscount","renderBadge","text","Node","renderCard","htmlCheckboxId","resources","outOfStockText","checked","onChange","target","onchange","disabled","htmlFor","SelectableCard","getFallbackImageUrl","eyebrowText","ratings","showBVRatings","standardPrice","isActive","currentPrice","renderProtectorCard","Price","standard","titleHeadingTag","shippingInformation","computeItemLines","defaultVariantId","lowestPriceVariantRecordId","IsMasterProduct","extensionProperties","productDeliveryMessage","shippingInformationSmall","smallParcelAttributeKey","defaultVariantShippingInformation","property","Key","Value","StringValue","deliveryDays","leadTime","brandList","brandBackofficeAttributePlp","singleBrand","brandName","brandLeadtime","CustomSkeleton","splitPrice","price","dollars","cents","formattedPrice","toLocaleString","currency","priceArr","standardDollars","standardCents","currentDollars","currentCents","binding","modules","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","prototype","RegistrationId","c","require","$type","da","name","path","runOn","iNM","ns","n","p","pdp","md","__bindings__","viewDictionary","cn","module","exports","ReactDOM"],"sourceRoot":""}