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://mattressfirm/./src/Utilities/get-rating.tsx?7b67","webpack://mattressfirm/./src/actions/fetch-choose-your-foundation-database.action.ts?867b","webpack://mattressfirm/./src/actions/get-delivery-message.action.ts?965e","webpack://mattressfirm/./src/actions/product-compare-buybox-state-sharing.ts?5126","webpack://mattressfirm/./src/actions/select-your-foundation.action.ts?e743","webpack://mattressfirm/./src/modules/mfrm-choose-your-foundation/mfrm-choose-your-foundation.tsx?590a","webpack://mattressfirm/./src/themes/mattressfirm/views/components/titled-modal/titled-modal.tsx?bdc2","webpack://mattressfirm/./src/themes/mattressfirm/views/components/titled-modal/titled-modal-button.tsx?481d","webpack://mattressfirm/./src/themes/mattressfirm/custom-components/tabs.tsx?d1f8","webpack://mattressfirm/./src/themes/mattressfirm/custom-components/rows-grey-separator.tsx?362d","webpack://mattressfirm/./src/themes/mattressfirm/custom-components/selectable-cards.tsx?6e64","webpack://mattressfirm/./src/modules/mfrm-choose-your-foundation/util/hasDiscount.tsx?4f9d","webpack://mattressfirm/./src/modules/mfrm-choose-your-foundation/util/getDisplayedBaseName.tsx?f3f0","webpack://mattressfirm/./src/modules/mfrm-choose-your-foundation/util/getTabs.tsx?0169","webpack://mattressfirm/./src/modules/mfrm-choose-your-foundation/util/getKeys.tsx?66f1","webpack://mattressfirm/./src/themes/mattressfirm/custom-components/badge.tsx?fc31","webpack://mattressfirm/./src/modules/mfrm-choose-your-foundation/mfrm-choose-your-foundation.view.tsx?5dd1","webpack://mattressfirm/./src/modules/mfrm-choose-your-foundation/util/renderBaseImage.tsx?27d3","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-choose-your-foundation/module-registration.js?eb88","webpack://mattressfirm/./src/dataActions/get-attributes-for-selected-variant.ts?e4b6","webpack://mattressfirm/external var \"React\"?0d3b","webpack://mattressfirm/external var \"ReactDOM\"?853b"],"sourcesContent":["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}","/*!\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 * FetchChooseYourFoundationDatabase Input Action\r\n */\r\nexport class FetchChooseYourFoundationDatabaseInput implements Msdyn365.IActionInput {\r\n public jsonSrc: string;\r\n // Construct the input needed to run the action\r\n constructor(jsonSrc: string) {\r\n this.jsonSrc = jsonSrc;\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 = () => `ChooseYourFoundationDatabase`;\r\n public getCacheObjectType = () => 'ChooseYourFoundationDatabase';\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 IFetchChooseYourFoundationDatabaseData {\r\n text: string;\r\n jsonSrc: string;\r\n}\r\n\r\nexport interface IDatabaseRow {\r\n mattressVariantReqId: string;\r\n baseVariantReqIdList: string[];\r\n recommendedBaseVariantReqId: string;\r\n}\r\n\r\nexport interface foo {\r\n database: 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 FetchChooseYourFoundationDatabaseInput(args?.requestContext.app.config.jsonSrc!);\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: FetchChooseYourFoundationDatabaseInput, ctx: Msdyn365.IActionContext): Promise {\r\n const res = await Msdyn365.sendRequest(input.jsonSrc, 'get');\r\n const database = res.data;\r\n return database;\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: 'FetchChooseYourFoundationDatabase',\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","/*!\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","/*!\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 * SelectYourFoundation Input Action\r\n */\r\nexport class SelectYourFoundationInput implements Msdyn365.IActionInput {\r\n public foundation: SimpleProduct | undefined | null;\r\n // Construct the input needed to run the action\r\n constructor(foundation: SimpleProduct | undefined | null) {\r\n this.foundation = foundation;\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 = () => `SelectYourFoundation`;\r\n public getCacheObjectType = () => 'SelectYourFoundation';\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 foundation: 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 SelectYourFoundationInput(args?.config?.foundation);\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: SelectYourFoundationInput, 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 { foundation: input.foundation };\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: 'SelectYourFoundation',\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 React, { useEffect } from 'react';\r\n\r\nimport { IMfrmChooseYourFoundationData } from './mfrm-choose-your-foundation.data';\r\nimport { IMfrmChooseYourFoundationProps } from './mfrm-choose-your-foundation.props.autogenerated';\r\nimport fetchChooseYourFoundationDatabaseDataAction, {\r\n FetchChooseYourFoundationDatabaseInput,\r\n IDatabaseRow\r\n} from '../../actions/fetch-choose-your-foundation-database.action';\r\nimport { getActivePricesAsync, getAttributeValuesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { getByIdsAsync, searchByCriteriaAsync } 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 { generateImageUrl } from '../../data-actions/utilities/utils';\r\nimport { SelectYourFoundationInput } from '../../actions/select-your-foundation.action';\r\nimport { getTelemetryObject, getPayloadObject, onTelemetryClick, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport _getInventoryQuantity from '../../Utilities/get-inventory-quantity';\r\nimport { _smallParcelProductATPBooleanStatus } from '../../Utilities/mfrm-buybox-utils';\r\n\r\nexport interface AdjustableBase {\r\n eyebrowText?: string;\r\n productName: string;\r\n rating: number;\r\n numberOfRatings: number;\r\n standardPrice: number;\r\n currentPrice?: number;\r\n imgSrc: string;\r\n imgAlt: string;\r\n}\r\n\r\nexport interface MergedBase extends SimpleProduct {\r\n outOfStock?: boolean;\r\n productType?: string;\r\n CustomerContextualPrice: number | undefined;\r\n DiscountAmount: number | undefined;\r\n TotalRatings: number | undefined;\r\n AverageRating: number | undefined;\r\n isRecommended: boolean;\r\n brand?: string;\r\n}\r\n\r\nexport type ChooseYourFoundationBaseId = number | 'Mattress Only';\r\nexport type Tab = 'All' | 'Adjustable Bases' | 'Box Springs';\r\nexport interface IMfrmChooseYourFoundationViewProps extends IMfrmChooseYourFoundationProps {\r\n onClickCard(key: ChooseYourFoundationBaseId, index: number): void;\r\n onClickTab(tab: Tab): void;\r\n onClickButton(): void;\r\n onCloseModal(): void;\r\n product: SimpleProduct;\r\n bases: MergedBase[];\r\n selectedBaseId: ChooseYourFoundationBaseId;\r\n selectedTab: Tab;\r\n isLoading: boolean;\r\n}\r\n\r\nexport interface AdjustableBaseObject {\r\n foundation?: MergedBase;\r\n listPosition?: number;\r\n}\r\n\r\n/**\r\n *\r\n * MfrmChooseYourFoundation component\r\n * @extends {React.PureComponent>}\r\n */\r\n\r\nexport const MfrmChooseYourFoundation: React.FC> = props => {\r\n\r\n const {\r\n data: {\r\n product: { result: productResult },\r\n productCompareBuyboxStateSharing: { result: buyboxState }\r\n }\r\n } = props;\r\n\r\n const [database, setDatabase] = React.useState(null);\r\n const [bases, setBases] = React.useState([]);\r\n const [isLoading, setIsLoading] = React.useState(true);\r\n const [selectedBaseId, setSelectedBaseId] = React.useState('Mattress Only');\r\n const [selectedTab, setSelectedTab] = React.useState('All');\r\n const hasSelectedBase = React.useRef(false);\r\n\r\n const fetchProductTypeAndOutOfStockStatus = async (baseId: number, itemId: string): Promise<{ productType?: string, outOfStock: boolean }> => {\r\n const attributeValues = await getAttributeValuesAsync(\r\n {\r\n callerContext: props.context.actionContext,\r\n queryResultSettings: {}\r\n },\r\n baseId,\r\n props.context.actionContext.requestContext.apiSettings.channelId,\r\n props.context.actionContext.requestContext.apiSettings.catalogId\r\n );\r\n\r\n //TODO come back and update when we clean up IS/OOS logic\r\n const OOS = attributeValues\r\n ?.find(attribute => attribute.Name === 'EcomAllVariantOOSInfo1')\r\n ?.TextValue?.split(\",\")\r\n .find(item => item.includes(`${baseId}|1`)) || attributeValues?.find(attribute => attribute.Name === 'Out of Stock')?.TextValue;\r\n\r\n const textValue = attributeValues?.find(attribute => attribute.Name === 'Product Type')?.TextValue;\r\n const parcelShippingMethod = attributeValues?.find(attribute => attribute.Name === 'shippingInformation')?.TextValue === \"Parcel\";\r\n const parcelOOS = parcelShippingMethod && await _smallParcelProductATPBooleanStatus(baseId, itemId, props.context.app.config.weeksPDPforATPCall, props.context);\r\n if (typeof textValue === 'string') {\r\n return parcelShippingMethod ? ( { productType: textValue, outOfStock: !!parcelOOS } ) : ( { productType: textValue, outOfStock: !!OOS });\r\n } else {\r\n return parcelShippingMethod ? ( { outOfStock: !!parcelOOS } ) : ( { outOfStock: !!OOS });\r\n }\r\n };\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\r\n const getBasesFromProductId = async (RecordId: number) => {\r\n const databaseRow: IDatabaseRow | undefined = database!.find((item: IDatabaseRow) => item.mattressVariantReqId === `${RecordId}`);\r\n if (!databaseRow || !databaseRow.baseVariantReqIdList) {\r\n setBases([]);\r\n setIsLoading(false);\r\n } else {\r\n try {\r\n const bases = await getByIdsAsync(\r\n { callerContext: props.context.actionContext },\r\n props.context.request.apiSettings.channelId,\r\n databaseRow.baseVariantReqIdList.map((id: string) => {\r\n return Number(id);\r\n })\r\n );\r\n const basePrices = 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 databaseRow.baseVariantReqIdList.map((id: string) => {\r\n return Number(id);\r\n }),\r\n new Date(),\r\n null,\r\n [],\r\n true\r\n );\r\n let productSearchResult: ProductSearchResult[] = [];\r\n if (bases.length) {\r\n const productSearchCriteria: ProductSearchCriteria = {\r\n Ids: [...new Set(bases.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 productSearchResult = await searchByCriteriaAsync({ callerContext: props.context.actionContext }, productSearchCriteria);\r\n }\r\n\r\n const mergedBases = bases.map((base, i) => {\r\n const baseImageUrl = generateImageUrl(base.PrimaryImageUrl, props.context.request.apiSettings);\r\n return {\r\n ...base,\r\n CustomerContextualPrice: basePrices[i].CustomerContextualPrice,\r\n DiscountAmount: basePrices[i].DiscountAmount,\r\n AverageRating:\r\n getBVAttributeValues(\r\n productSearchResult.find(item => item.MasterProductId === base.MasterProductId)?.AttributeValues,\r\n 'BVAverageOverallRating'\r\n ) ?? _parseValue(productSearchResult.find(item => item.MasterProductId === base.MasterProductId)?.AverageRating),\r\n TotalRatings:\r\n getBVAttributeValues(\r\n productSearchResult.find(item => item.MasterProductId === base.MasterProductId)?.AttributeValues,\r\n 'BVTotalReviewCount'\r\n ) ?? _parseValue(productSearchResult.find(item => item.MasterProductId === base.MasterProductId)?.TotalRatings),\r\n PrimaryImageUrl: baseImageUrl ? baseImageUrl : '',\r\n brand: productSearchResult.find(item => item.MasterProductId === base.MasterProductId)?.AttributeValues?.find(attr => attr.KeyName?.trim() === 'VendorBrand')?.TextValue,\r\n isRecommended: base.RecordId.toString() === databaseRow.recommendedBaseVariantReqId\r\n };\r\n });\r\n setBases(mergedBases);\r\n setIsLoading(false);\r\n mergedBases.forEach((item, index) => {\r\n const itemId = item.ItemId || '';\r\n fetchProductTypeAndOutOfStockStatus(Number(databaseRow.baseVariantReqIdList[index]), itemId)\r\n .then(({ productType, outOfStock }) => {\r\n setBases(bases => {\r\n bases[index].productType = productType;\r\n bases[index].outOfStock = outOfStock;\r\n return bases;\r\n });\r\n })\r\n .catch(e => console.error(e));\r\n });\r\n } catch (error) {\r\n setIsLoading(false);\r\n console.error(error);\r\n }\r\n\r\n }\r\n props.context.actionContext.update(new SelectYourFoundationInput(null), { foundation: null });\r\n };\r\n\r\n const handleClickButton = () => {\r\n const telemetryContent: ITelemetryContent = getTelemetryObject('Products Details Page', props.friendlyName, props.telemetry);\r\n const payLoad = getPayloadObject('click', telemetryContent, 'Adjustable Base Modal Button', '');\r\n onTelemetryClick(telemetryContent, payLoad, 'Adjustable Base Modal Button')();\r\n };\r\n\r\n const handleCloseModal = () => {\r\n const telemetryContent: ITelemetryContent = getTelemetryObject('Products Details Page', props.friendlyName, props.telemetry);\r\n const payLoad = getPayloadObject('click', telemetryContent, 'Close Button', '');\r\n onTelemetryClick(telemetryContent, payLoad, 'Close Button')();\r\n };\r\n\r\n const handleClickCard = (key: ChooseYourFoundationBaseId, index: number) => {\r\n if (key === 'Mattress Only') {\r\n const telemetryContent: ITelemetryContent = getTelemetryObject('Products Details Page', props.friendlyName, props.telemetry);\r\n const payLoad = getPayloadObject('click', telemetryContent, props.config.noSelectionText, '');\r\n onTelemetryClick(telemetryContent, payLoad, props.config.noSelectionText)();\r\n if (selectedBaseId !== 'Mattress Only') {\r\n const base = bases.find(base => base.RecordId === selectedBaseId)!;\r\n // @ts-ignore\r\n utag.link({\r\n enhanced_action: 'remove_base',\r\n event: 'PDP-card-action-remove-base',\r\n event_category: 'PDP Card Action',\r\n event_action: 'Remove Base/Foundation',\r\n event_label: `${base.ItemId}: ${base.Name}`,\r\n event_noninteraction: 'false'\r\n });\r\n }\r\n setSelectedBaseId('Mattress Only');\r\n props.context.actionContext.update(new SelectYourFoundationInput(null), { foundation: null });\r\n } else {\r\n const base = bases.find(base => base.RecordId === key)!;\r\n const telemetryContent: ITelemetryContent = getTelemetryObject('Products Details Page', props.friendlyName, props.telemetry);\r\n const payLoad = getPayloadObject('click', telemetryContent, 'AdjustableBaseModal', '');\r\n onTelemetryClick(telemetryContent, payLoad, 'AdjustableBaseModal')();\r\n if (selectedBaseId === base.RecordId) {\r\n setSelectedBaseId('Mattress Only');\r\n props.context.actionContext.update(new SelectYourFoundationInput(null), { foundation: null });\r\n } else {\r\n if (!hasSelectedBase.current) {\r\n hasSelectedBase.current = true;\r\n // @ts-ignore\r\n utag.link({\r\n enhanced_action: 'add_base',\r\n event: 'PDP-card-action-add-base',\r\n event_category: 'PDP Card Action',\r\n event_action: 'Add Base/Foundation',\r\n event_label: `${base.ItemId}: ${base.Name}`,\r\n event_noninteraction: 'false'\r\n });\r\n } else {\r\n // @ts-ignore\r\n utag.link({\r\n enhanced_action: 'change_base',\r\n event: 'PDP-card-action-change-base',\r\n event_category: 'PDP Card Action',\r\n event_action: 'Change Base/Foundation',\r\n event_label: `${base.ItemId}: ${base.Name}`,\r\n event_noninteraction: 'false'\r\n });\r\n }\r\n setSelectedBaseId(base.RecordId);\r\n props.context.actionContext.update(new SelectYourFoundationInput(base), { foundation: base, listPosition: index });\r\n }\r\n }\r\n };\r\n\r\n const handleClickTab = (tab: Tab) => {\r\n setSelectedTab(tab);\r\n };\r\n\r\n useEffect(() => {\r\n const actionInput = new FetchChooseYourFoundationDatabaseInput(props.context.app.config.jsonSrc);\r\n fetchChooseYourFoundationDatabaseDataAction(actionInput, props.context.actionContext)\r\n .then(database => setDatabase(database))\r\n .catch(e => {\r\n console.error('Error fetching database', e);\r\n });\r\n }, []);\r\n\r\n // useEffect(() => {\r\n // const cookies = new Cookies();\r\n // const currentZipCode = cookies.get('zip_code');\r\n // setZipCode(currentZipCode);\r\n // }, [buyboxState?.zipCode]);\r\n\r\n useEffect(() => {\r\n setSelectedBaseId('Mattress Only');\r\n setSelectedTab('All');\r\n database && productResult?.RecordId && getBasesFromProductId(productResult.RecordId);\r\n }, [productResult?.RecordId, database !== null, buyboxState?.zipCode]);\r\n\r\n return props.renderView({\r\n ...props,\r\n product: productResult,\r\n bases,\r\n selectedBaseId,\r\n selectedTab,\r\n isLoading,\r\n onClickButton: handleClickButton,\r\n onCloseModal: handleCloseModal,\r\n onClickCard: handleClickCard,\r\n onClickTab: handleClickTab\r\n });\r\n};\r\n\r\nexport default MfrmChooseYourFoundation;\r\n","import * as React from 'react';\r\nimport classnames from 'classnames';\r\nimport { Modal, ModalBody, ModalHeader } from '@msdyn365-commerce-modules/utilities';\r\nimport { IModalDimensions } from '../../../../../modules/mfrm-buybox/components/buybox-product-configure-mfrm';\r\nexport interface IMfrmModalDrawerViewProps {\r\n isOpen?: boolean;\r\n className?: string;\r\n isMobile: boolean;\r\n distinctClassName: string;\r\n modalDimensions?: IModalDimensions[];\r\n preSelection?: IModalDimensions;\r\n onClickBaseFunc?(): void;\r\n onCloseModal?(): void;\r\n title: string;\r\n subtitle: string;\r\n}\r\n\r\nconst AdjustableBaseModal: React.FC = props => {\r\n return (\r\n \r\n \r\n \r\n

{props.title}

\r\n

{props.subtitle}

\r\n {props.children}\r\n
\r\n \r\n );\r\n};\r\n\r\nexport default AdjustableBaseModal;\r\n","import * as React from 'react';\r\nimport { Node } from '@msdyn365-commerce-modules/utilities';\r\n\r\nconst AdjustableBaseModalButton: React.FC<{\r\n onClick: Function;\r\n isAdjustableModalVisible: boolean;\r\n children?: React.ReactNode;\r\n}> = props => {\r\n return (\r\n <>\r\n {\r\n props.onClick();\r\n }}\r\n className={''}\r\n >\r\n \r\n
\r\n
{props.children}
\r\n
\r\n
\r\n \r\n \r\n );\r\n};\r\n\r\nexport default AdjustableBaseModalButton;\r\n","import React from 'react';\r\n\r\ninterface TabsProps {\r\n tabs: string[];\r\n selectedTab: string;\r\n onClickTab: Function\r\n}\r\n\r\nexport const Tabs: React.FC = ({ tabs, selectedTab, onClickTab }) => {\r\n if (tabs.length < 1) {\r\n return null;\r\n }\r\n return (\r\n
\r\n {tabs.map(tab => (
onClickTab(tab)}>\r\n {tab}\r\n
))}\r\n
\r\n );\r\n};\r\n","import React from \"react\";\r\n\r\nexport interface Row{\r\n children: React.ReactNode;\r\n}\r\n\r\nexport const Row: React.FC = ({children}) => {\r\n return (
\r\n {children}\r\n
);\r\n};\r\nexport interface RowsGreySeparator {\r\n children: React.ReactNode;\r\n}\r\n\r\nexport const RowsGreySeparator: React.FC = ({children}) => {\r\n return (
\r\n {children}\r\n
);\r\n};\r\n","import React from 'react';\r\nimport { RowsGreySeparator, Row } from './rows-grey-separator';\r\nimport classnames from 'classnames';\r\ninterface SelectableCards {\r\n keys: (string | number)[];\r\n onClickCard: Function;\r\n renderCard: Function;\r\n renderBadge: Function;\r\n disabled: Function;\r\n selected: string | number;\r\n}\r\n\r\nexport const SelectableCards: React.FC = ({ keys, renderCard, onClickCard, selected, renderBadge, disabled }) => {\r\n return (\r\n \r\n {keys.map((key: string | number, index) => {\r\n const handleClick = (key: string | number) => {\r\n if (!disabled(key)) {\r\n onClickCard(key, index);\r\n }\r\n };\r\n const classes = classnames('selectable-card-wrapper', {\r\n selected: selected === key,\r\n 'disable-hover': disabled(key)\r\n });\r\n return (\r\n \r\n {renderBadge(key)}\r\n
handleClick(key)}>\r\n {renderCard(key)}\r\n
\r\n
\r\n );\r\n })}\r\n
\r\n );\r\n};\r\n","import { MergedBase } from \"../mfrm-choose-your-foundation\";\r\nexport const hasDiscount = (base: MergedBase) => {\r\n return typeof base.DiscountAmount !== 'undefined' && base.DiscountAmount > 0;\r\n};","import { MergedBase } from \"../mfrm-choose-your-foundation\";\r\n\r\nexport const getDisplayedBaseName = (base: MergedBase) => {\r\n const lowOrReg = base.Dimensions?.find(Dimension => Dimension.DimensionTypeValue === 1)?.DimensionValue?.Value;\r\n const profile = lowOrReg ? ` - ${lowOrReg} Profile - ${lowOrReg === 'Low' ? '5\"' : '9\"'}` : '';\r\n return `${base.brand} ${base.Name}${profile}`;\r\n};\r\n","import { MergedBase } from \"../mfrm-choose-your-foundation\";\r\n\r\nexport const getTabs = (bases: MergedBase[]) => {\r\n const springs = bases.filter(base => base.productType === 'Box Springs');\r\n const canFilterByBoxSpring = springs.length > 0 && springs.length < bases.length;\r\n\r\n const adjustableBases = bases.filter(base =>base.productType === 'Adjustable Bases');\r\n const canFilterByAdjustableBases = adjustableBases.length > 0 && adjustableBases.length < bases.length;\r\n\r\n const tabs = [];\r\n\r\n if ((canFilterByBoxSpring || canFilterByAdjustableBases)) {\r\n tabs.push('All');\r\n }\r\n if (canFilterByAdjustableBases) {\r\n tabs.push('Adjustable Bases');\r\n }\r\n if (canFilterByBoxSpring) {\r\n tabs.push('Box Springs');\r\n }\r\n\r\n return tabs;\r\n};","import { MergedBase } from \"../mfrm-choose-your-foundation\";\r\nimport { Tab } from \"../mfrm-choose-your-foundation\";\r\n\r\nexport const getKeys = (bases: MergedBase[], selectedTab: Tab) : (string|number)[] => {\r\n const keys = [\r\n 'Mattress Only',\r\n ...bases\r\n ?.filter(base => {\r\n return (\r\n selectedTab === 'All' ||\r\n (selectedTab === 'Adjustable Bases' && base.productType === 'Adjustable Bases') ||\r\n (selectedTab === 'Box Springs' && base.productType === 'Box Springs')\r\n );\r\n })\r\n .map(base => base.RecordId)\r\n ];\r\n return keys;\r\n};\r\n","import React from 'react';\r\nimport { Node } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\n\r\nexport const Badge: React.FC<{ color: string; children: React.ReactNode }> = ({ color, children }) => {\r\n const classes = classnames('badge', color);\r\n return {children};\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 React from 'react';\r\nimport { Node } from '@msdyn365-commerce-modules/utilities';\r\n// @ts-ignore\r\nimport SelectableCard from '../../themes/mattressfirm/views/components/selectable-card';\r\nimport TitledModal, { TitledModalButton } from '../../themes/mattressfirm/views/components/titled-modal';\r\n\r\nimport { IMfrmChooseYourFoundationViewProps } from './mfrm-choose-your-foundation';\r\nimport { renderRating } from '../../Utilities/get-rating';\r\nimport { getFallbackImageUrl } from '../../data-actions/utilities/utils';\r\nimport { Tabs } from '../../themes/mattressfirm/custom-components/tabs';\r\nimport { SelectableCards } from '../../themes/mattressfirm/custom-components/selectable-cards';\r\nimport { renderBaseImage } from './util/renderBaseImage';\r\nimport { hasDiscount } from './util/hasDiscount';\r\nimport { getDisplayedBaseName } from './util/getDisplayedBaseName';\r\nimport { getTabs } from './util/getTabs';\r\nimport { getKeys } from './util/getKeys';\r\nimport { Badge } from '../../themes/mattressfirm/custom-components/badge';\r\nimport CustomSkeleton from '../../themes/mattressfirm/custom-components/CustomSkeleton';\r\n\r\nexport default (props: IMfrmChooseYourFoundationViewProps) => {\r\n const { product, bases, selectedBaseId, selectedTab, onClickCard, onClickTab, onClickButton, onCloseModal, isLoading } = props;\r\n const { addABaseTitle, addABaseSubtitle } = props.config;\r\n const { data: { categoryPaths: { result } } } = props;\r\n let parentCategory = result && result[0]?.Name ? result[0]?.Name?.toLowerCase() : '';\r\n parentCategory = parentCategory === 'mattresses' || parentCategory === 'pillows' || parentCategory === 'bedding' ? parentCategory : 'default';\r\n const [isAdjustableModalVisible, setIsAdjustableModalVisible] = React.useState(false);\r\n const selectedBase = bases.find(base => base.RecordId === selectedBaseId)!;\r\n const renderBadge = (key: number) => {\r\n const base = bases.find(base => base.RecordId === key)!;\r\n if (base?.outOfStock) {\r\n return Out of Stock;\r\n }\r\n return null;\r\n };\r\n const renderCard = (key: number | 'Mattress Only') => {\r\n if (key === 'Mattress Only') {\r\n return (\r\n \r\n );\r\n }\r\n const base = bases.find(base => base.RecordId === key)!;\r\n return (\r\n \r\n );\r\n };\r\n\r\n const handleClickButton = () => {\r\n onClickButton();\r\n setIsAdjustableModalVisible((isAdjustableModalVisible: boolean) => !isAdjustableModalVisible);\r\n };\r\n\r\n if (isLoading) {\r\n return ();\r\n }\r\n if (bases.length < 1) {\r\n return null;\r\n }\r\n\r\n return (\r\n
\r\n \r\n \r\n {selectedBaseId !== 'Mattress Only' ? (\r\n \r\n Your foundation: {getDisplayedBaseName(selectedBase)} +{' '}\r\n ${selectedBase.CustomerContextualPrice}\r\n \r\n ) : (\r\n props.config.label\r\n )}\r\n \r\n \r\n {\r\n onCloseModal();\r\n setIsAdjustableModalVisible(!isAdjustableModalVisible);\r\n }}\r\n title={addABaseTitle}\r\n subtitle={addABaseSubtitle}\r\n >\r\n onClickTab(tab)}\r\n />\r\n
\r\n {\r\n onClickCard(key, index);\r\n setIsAdjustableModalVisible(false);\r\n }}\r\n renderCard={renderCard}\r\n renderBadge={renderBadge}\r\n disabled={(key: number | 'Mattress Only') => {\r\n return bases.find(base => base.RecordId === key)?.outOfStock;\r\n }}\r\n />\r\n
\r\n \r\n
\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 lazyLoading?: boolean\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: lazyLoading ? lazyLoading : 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};","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-choose-your-foundation'] = {\n c: () => require('partner/modules/mfrm-choose-your-foundation/mfrm-choose-your-foundation.tsx'),\n $type: 'contentModule',\n da: [{name:'categoryPaths', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-category-paths', 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:'@msdyn365-commerce-modules/product-specification/dist/lib/dataActions/get-attributes-for-selected-variant', runOn: 0},{name:'selectedFoundation', path:'actions/select-your-foundation.action', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'mfrm-choose-your-foundation',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/mfrm-choose-your-foundation'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/product-specification/dist/lib/dataActions/get-attributes-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/product-specification/dist/lib/dataActions/get-attributes-for-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-category-paths';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-category-paths');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\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/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 = 'actions/select-your-foundation.action';\n let dataAction = require('partner/actions/select-your-foundation.action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };\n export const viewDictionary = {};\n viewDictionary['__local__|__local__|modules|mfrm-choose-your-foundation|mfrm-choose-your-foundation'] = {\n c: () => require('partner/modules/mfrm-choose-your-foundation/mfrm-choose-your-foundation.view.tsx'),\n cn: '__local__-__local__-mfrm-choose-your-foundation'\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 {\n CacheType,\n createObservableDataAction,\n getCatalogId,\n IAction,\n IActionContext,\n IActionInput,\n IAny,\n ICreateActionContext,\n IGeneric\n} from '@msdyn365-commerce/core';\nimport { AttributeValue, ProductsDataActions, SimpleProduct, StoreOperationsDataActions } from '@msdyn365-commerce/retail-proxy';\nimport {\n getAttributeValuesByConfiguration,\n getSelectedProductIdFromActionInput,\n getSelectedVariant,\n QueryResultSettingsProxy,\n SelectedVariantInput\n} from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * Chains getting the SelectedVariant with GetActivePrice.\n */\nexport class AttributesForSelectedVariantInput implements IActionInput {\n public productId: number;\n\n public channelId: number;\n\n public catalogId: number;\n\n public selectedProduct: SimpleProduct | undefined;\n\n constructor(productId: number, channelId: number, selectedProduct?: SimpleProduct, catalogId?: number) {\n this.productId = productId;\n this.channelId = channelId;\n this.selectedProduct = selectedProduct;\n this.catalogId = catalogId || 0;\n }\n\n public getCacheKey = () => 'AttributesForSelectedVariant';\n\n public getCacheObjectType = () => 'ProductAttributeValue';\n\n public dataCacheType = (): CacheType => 'none';\n}\n\nexport const createAttributesForSelectedVariantInput = (\n inputData: ICreateActionContext>\n): AttributesForSelectedVariantInput => {\n const productId = getSelectedProductIdFromActionInput(inputData);\n const catalogId = getCatalogId(inputData.requestContext);\n\n if (productId) {\n return new AttributesForSelectedVariantInput(+productId, +inputData.requestContext.apiSettings.channelId, undefined, catalogId);\n }\n throw new Error('Unable to create PriceForSelectedVariantInput, no productId found on module config or query');\n};\n\n/**\n * Calls the Retail API a get a list of dimension values for a given product.\n * @param input - The input.\n * @param context - The context.\n * @returns The attribute values.\n */\nexport async function getAttributesForSelectedVariantAction(\n input: AttributesForSelectedVariantInput,\n context: IActionContext\n): Promise {\n return Promise.resolve()\n .then(() => {\n const activeProduct: SimpleProduct | undefined = input.selectedProduct;\n\n if (!activeProduct) {\n const selectedVariantInput = new SelectedVariantInput(\n input.productId,\n input.channelId,\n undefined,\n undefined,\n context.requestContext\n );\n\n return getSelectedVariant(selectedVariantInput, context);\n }\n\n return activeProduct;\n })\n .then((productResult: SimpleProduct | null) => {\n const activeProduct: SimpleProduct | undefined = productResult;\n\n if (activeProduct) {\n return ProductsDataActions.getAttributeValuesAsync(\n {\n callerContext: context,\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(context)\n },\n activeProduct.RecordId,\n input.channelId,\n input.catalogId\n );\n }\n\n return null;\n })\n .then(async (attributeValues: AttributeValue[] | null) => {\n const channelInventoryConfiguration = await StoreOperationsDataActions.getInventoryConfigurationAsync({\n callerContext: context\n });\n\n return { attributeValues, channelInventoryConfiguration };\n })\n .then(result => {\n return getAttributeValuesByConfiguration(result.attributeValues, result.channelInventoryConfiguration);\n })\n .catch((error: Error) => {\n context.trace(error.message);\n throw new Error('[getPriceForSelectedVariantAction]Error executing action');\n });\n}\n\nexport default createObservableDataAction({\n id: '@msdyn365-commerce-modules/product-info/get-attributes-for-selected-variant',\n action: >getAttributesForSelectedVariantAction,\n input: createAttributesForSelectedVariantInput\n});\n","module.exports = React;","module.exports = ReactDOM;"],"names":["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","React","RatingComponent","ratingCount","readOnly","data","FetchChooseYourFoundationDatabaseInput","constructor","jsonSrc","getCacheKey","getCacheObjectType","dataCacheType","this","Msdyn365","action","input","ctx","args","requestContext","app","config","ZipCode","ItemLines","ItemId","VariantRecordId","mFIATPInventoryAsync","callerContext","ProductCompareBuyboxStateSharing","zipCode","__decorate","observable","SelectYourFoundationInput","foundation","MfrmChooseYourFoundation","props","product","productResult","productCompareBuyboxStateSharing","buyboxState","database","setDatabase","bases","setBases","isLoading","setIsLoading","selectedBaseId","setSelectedBaseId","selectedTab","setSelectedTab","hasSelectedBase","_parseValue","productRating","value","Math","round","getBasesFromProductId","databaseRow","find","item","mattressVariantReqId","RecordId","baseVariantReqIdList","getByIdsAsync","apiSettings","channelId","map","Number","basePrices","getActivePricesAsync","ChannelId","CatalogId","catalogId","Date","productSearchResult","length","productSearchCriteria","Ids","Set","MasterProductId","Context","IncludeAttributes","SearchCondition","searchByCriteriaAsync","mergedBases","base","i","baseImageUrl","generateImageUrl","PrimaryImageUrl","CustomerContextualPrice","DiscountAmount","AverageRating","getBVAttributeValues","AttributeValues","TotalRatings","brand","attr","KeyName","trim","TextValue","isRecommended","recommendedBaseVariantReqId","forEach","index","itemId","baseId","attributeValues","getAttributeValuesAsync","queryResultSettings","OOS","attribute","Name","split","includes","textValue","parcelShippingMethod","parcelOOS","_smallParcelProductATPBooleanStatus","weeksPDPforATPCall","productType","outOfStock","fetchProductTypeAndOutOfStockStatus","then","catch","e","update","useEffect","actionInput","fetchChooseYourFoundationDatabaseDataAction","renderView","onClickButton","telemetryContent","getTelemetryObject","friendlyName","telemetry","payLoad","getPayloadObject","onTelemetryClick","onCloseModal","onClickCard","key","noSelectionText","utag","link","enhanced_action","event","event_category","event_action","event_label","event_noninteraction","current","listPosition","onClickTab","tab","Modal","autoFocus","fade","isOpen","horizontalPosition","isMobile","verticalPosition","zIndex","toggle","applicationNode","modalClassName","classnames","distinctClassName","ModalHeader","ModalBody","className","title","subtitle","children","Node","onClick","isAdjustableModalVisible","tabIndex","Tabs","tabs","Row","RowsGreySeparator","SelectableCards","keys","renderCard","selected","renderBadge","disabled","classes","handleClick","hasDiscount","getDisplayedBaseName","lowOrReg","Dimensions","Dimension","DimensionTypeValue","DimensionValue","Value","profile","getTabs","springs","filter","canFilterByBoxSpring","adjustableBases","canFilterByAdjustableBases","push","getKeys","Badge","color","addABaseTitle","addABaseSubtitle","categoryPaths","parentCategory","toLowerCase","setIsAdjustableModalVisible","selectedBase","CustomSkeleton","type","TitledModalButton","label","TitledModal","SelectableCard","productName","img","renderBaseImage","gridSettings","getFallbackImageUrl","eyebrowText","ratings","resources","standardPrice","currentPrice","isActive","altText","fallbackImageUrl","lazyLoading","defaultImageSettings","viewports","xs","q","w","h","lg","xl","lazyload","src","Image","fallBackSrc","imageSettings","bypassHideOnFailure","imageFallbackOptimize","splitPrice","price","dollars","cents","formattedPrice","toLocaleString","style","currency","priceArr","match","Price","standard","standardDollars","standardCents","currentDollars","currentCents","binding","modules","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","Error","prototype","RegistrationId","c","require","$type","da","name","path","runOn","iNM","ns","n","p","pdp","md","window","__bindings__","viewDictionary","cn","AttributesForSelectedVariantInput","productId","selectedProduct","createAttributesForSelectedVariantInput","inputData","getSelectedProductIdFromActionInput","getCatalogId","undefined","getAttributesForSelectedVariantAction","Promise","resolve","activeProduct","selectedVariantInput","SelectedVariantInput","getSelectedVariant","ProductsDataActions","QueryResultSettingsProxy","channelInventoryConfiguration","StoreOperationsDataActions","getAttributeValuesByConfiguration","trace","message","createObservableDataAction","module","exports","ReactDOM"],"sourceRoot":""}