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EAARA,EAAUZ,YAAI,IAAAY,GAAdA,EAAgBX,YAAYR,OC5GjC,SAASsB,EAA8B/hB,GAC1C,OAAO,IAAIgiB,EAAAA,aAAyC,UAAWhiB,EAAQ,+BDavExS,EAAAA,EAAAA,IAAA,CADCZ,EAAAA,IAAM,+BAsDPY,EAAAA,EAAAA,IAAA,CADCZ,EAAAA,IAAM,+BC9DX,MAIaq1B,GAA6B7vB,EAAAA,EAAAA,IAA2B,CACjExF,OAA6Cs1B,EAAAA,iBAC7Cp1B,MAN2CuF,GACpC0vB,EAA8B,IAAIpC,KAQ7C,wBCxBAwC,EAAOC,QAAUv0B,2BCAjBs0B,EAAOC,QAAUC","sources":["webpack://mattressfirm/./src/Utilities/analytics/clickTrack.ts?bce2","webpack://mattressfirm/./src/Utilities/get-bv-attributes.ts?f55a","webpack://mattressfirm/./src/Utilities/get-html-parser-value.ts?1fb6","webpack://mattressfirm/./src/Utilities/select-financing-offer.tsx?5f53","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/product-compare-buybox-state-sharing.ts?5126","webpack://mattressfirm/./src/actions/select-your-foundation.action.ts?e743","webpack://mattressfirm/./src/common/components/error-boundary.tsx?6c0c","webpack://mattressfirm/./src/data-actions/buybox-get-dimension-pricing-action.ts?1fcd","webpack://mattressfirm/./src/data-actions/buybox-get-dimension-variants-availability-action.ts?fbe8","webpack://mattressfirm/./src/data-actions/financing-offer-state.action.ts?9faa","webpack://mattressfirm/./src/data-actions/store-selector-state-data-action.ts?6df6","webpack://mattressfirm/./src/modules/mfrm-buybox/components/buybox-call-chat.tsx?d8c6","webpack://mattressfirm/./src/modules/mfrm-buybox/list-page-state-buybox.ts?792c","webpack://mattressfirm/./src/modules/mfrm-buybox/components/buybox-size-component.tsx?61da","webpack://mattressfirm/./src/modules/mfrm-buybox/components/buybox-size-redesign-component.tsx?fe1b","webpack://mattressfirm/./src/Utilities/get-customized-variant-name.ts?0a2b","webpack://mattressfirm/./src/modules/mfrm-buybox/components/dropdown/dropdown.tsx?7f62","webpack://mattressfirm/./src/modules/mfrm-buybox/components/listing/listing.tsx?f7d9","webpack://mattressfirm/./src/modules/mfrm-buybox/components/buybox-height-foundation-redesign-component.tsx?0fe1","webpack://mattressfirm/./src/modules/mfrm-buybox/components/addtocart.tsx?6747","webpack://mattressfirm/./src/modules/mfrm-buybox/components/buybox-add-to-cart.tsx?1948","webpack://mattressfirm/./src/modules/mfrm-buybox/components/buybox-view-cart-link.tsx?5f11","webpack://mattressfirm/./src/modules/mfrm-buybox/components/buybox-social-share.tsx?5cfe","webpack://mattressfirm/./src/modules/mfrm-buybox/components/buybox-find-in-store.tsx?4a1a","webpack://mattressfirm/./src/themes/mattressfirm/custom-components/sleep-expert-summary-component.tsx?b78e","webpack://mattressfirm/./src/modules/mfrm-buybox/components/buybox-sleep-expert-summary.tsx?1d11","webpack://mattressfirm/./src/modules/mfrm-buybox/mfrm-buybox.props.autogenerated.ts?86c0","webpack://mattressfirm/./src/modules/mfrm-buybox/components/progressive-leasing-estimator.tsx?83c4","webpack://mattressfirm/./src/modules/mfrm-buybox/components/buybox-progressive-leasing-estimator.tsx?bad7","webpack://mattressfirm/./src/modules/mfrm-buybox/components/buybox-financing-per-month.tsx?dd8b","webpack://mattressfirm/./src/modules/mfrm-buybox/mfrm-buybox.view.tsx?d135","webpack://mattressfirm/./src/modules/mfrm-buybox/components/buybox-product-configure-mfrm.tsx?77c4","webpack://mattressfirm/./src/themes/mattressfirm/custom-components/CustomSkeleton/index.tsx?ef9d","webpack://mattressfirm/./src/themes/mattressfirm/custom-components/financing-per-month-component.tsx?fa70","webpack://mattressfirm/./lib/mfrm-buybox/module-registration.js?d206","webpack://mattressfirm/./src/store-selector-state-manager/base-store-selector-state-manager.ts?281e","webpack://mattressfirm/./src/store-selector-state-manager/map-store-selector-state-manager.ts?2ae0","webpack://mattressfirm/./src/store-selector-state-manager/store-selector-state-manager-data-action.ts?bd3e","webpack://mattressfirm/external var \"React\"?0d3b","webpack://mattressfirm/external var \"ReactDOM\"?853b"],"sourcesContent":["import { callUtagLink } from \"./utagCaller\";\r\n\r\nexport interface IUtagPromoConfig {\r\n promotion_impression_name?: string[];\r\n promotion_impression_id?: string[];\r\n promotion_impression_creative?: string[];\r\n promotion_impression_position?: (string | undefined)[];\r\n promotion_name?: string[];\r\n promotion_id?: string[];\r\n promotion_creative?: string[];\r\n promotion_position?: (string | undefined)[];\r\n}\r\n\r\nexport interface IUtagGeneralConfig {\r\n enhanced_action?: string | undefined;\r\n}\r\nexport interface ICustomerConfig {\r\n customer_email?: string;\r\n}\r\nexport interface IProductConfig {\r\n product_id?: string[];\r\n product_name?: string[];\r\n product_category?: (string | undefined)[];\r\n product_brand?: (string | undefined)[];\r\n product_variant?: (string | undefined)[];\r\n product_price?: (string | undefined)[];\r\n product_list_name?: string[];\r\n product_position?: (number | undefined)[];\r\n product_quantity?: (string | undefined)[];\r\n checkout_step?: string;\r\n}\r\nexport interface IProductImpressionConfig {\r\n product_impression_brand?: (string | undefined)[];\r\n product_impression_list_name?: (string | undefined)[];\r\n product_impression_id?: string[];\r\n product_impression_name?: string[];\r\n product_impression_category?: string[];\r\n product_impression_variant?: (string | undefined)[];\r\n product_impression_position?: number[];\r\n product_impression_price?: number[];\r\n}\r\nexport interface IAnalyticsConfiguration {\r\n event?: string | null;\r\n eventName?: string | null;\r\n eventCategory?: string | null;\r\n eventAction?: string | null;\r\n eventLabel?: string | null;\r\n eventType?: string | null;\r\n eventNoninteraction?: string;\r\n enhancedAction?: string | null;\r\n searchTerm?: string | undefined | null;\r\n searchType?: string | undefined | null;\r\n generalConfig?: IUtagGeneralConfig;\r\n promoConfig?: IUtagPromoConfig;\r\n productConfig?: IProductConfig;\r\n customerConfig?: ICustomerConfig;\r\n productImpressionConfig?: IProductImpressionConfig;\r\n wmap_type?: string;\r\n wmap_order_total?: number;\r\n wmap_amount_due?: number;\r\n wmap_paid?: number;\r\n wmap_pymt_amt?: number;\r\n}\r\n\r\nexport const fireAnalyticsLink = ({\r\n searchTerm = null,\r\n searchType = null,\r\n eventName = null,\r\n eventCategory = null,\r\n eventAction = null,\r\n eventLabel = null,\r\n eventType = null,\r\n eventNoninteraction = 'false',\r\n enhancedAction = null,\r\n generalConfig = {},\r\n promoConfig = {},\r\n productConfig = {},\r\n customerConfig = {},\r\n productImpressionConfig = {}\r\n}: IAnalyticsConfiguration) => {\r\n void callUtagLink({\r\n ...generalConfig,\r\n ...promoConfig,\r\n ...productConfig,\r\n ...customerConfig,\r\n ...productImpressionConfig,\r\n event: eventName,\r\n event_category: eventCategory,\r\n event_action: eventAction,\r\n event_label: eventLabel,\r\n event_type: eventType,\r\n event_noninteraction: eventNoninteraction,\r\n enhanced_action: enhancedAction,\r\n search_term: searchTerm,\r\n search_type: searchType\r\n });\r\n};","import { AttributeValue } from '@msdyn365-commerce/retail-proxy';\r\n\r\nexport const getBVAttributeValues = (attributeValues: AttributeValue[] | undefined, key: string): number => {\r\n const value = +(attributeValues?.find(attr => attr.Name?.trim() === key)?.TextValue || 0);\r\n return Math.round(value * 10) / 10;\r\n};\r\n\r\nexport const getBVAttributeValuesUnbxd = (attributeValues: any | undefined, key: string): number => {\r\n const value = +(attributeValues[key] ?? 0);\r\n return Math.round(value * 10) / 10;\r\n};\r\n","import ReactHtmlParser from 'react-html-parser';\r\n\r\nconst getHtmlParserValue = (value?: string) => {\r\n let parsedValue = '';\r\n const parsedArr = value && ReactHtmlParser(value);\r\n if (parsedArr && parsedArr?.length > 0) {\r\n parsedValue = parsedArr[0] ? parsedArr[0].toString() : '';\r\n }\r\n return parsedValue;\r\n};\r\n\r\nexport default getHtmlParserValue;","import { RichText } from '@msdyn365-commerce/core';\r\n\r\nimport dayjs from 'dayjs';\r\nimport tz from 'dayjs/plugin/timezone';\r\nimport utc from 'dayjs/plugin/utc';\r\nimport isBetween from 'dayjs/plugin/isBetween';\r\nimport { calculateFinancing } from './checkout-utils';\r\ndayjs.extend(tz);\r\ndayjs.extend(utc);\r\ndayjs.extend(isBetween);\r\nconst format = 'M/D/YYYY';\r\n\r\nexport interface IFinancingOffer {\r\n offerName?: string;\r\n noInterestFor: number;\r\n minPurchase: number;\r\n everydayFinancingOfferMessage: string,\r\n limitedFinancingOfferMessage: string,\r\n lowCostFinancingOfferMessage: string,\r\n cashbackFinancingOfferMessage: string,\r\n monthlyOfferDetails?: RichText;\r\n financingOfferDescription: RichText;\r\n disclaimer: RichText;\r\n offerValidStartDate?: string;\r\n offerValidEndDate?: string;\r\n specialCampaignOffer?: IFinancingOfferCampaign;\r\n checkoutDisplay?: { heading: string; details: string; specialOffer?: string},\r\n FinancingOfferDataOnPage?: RichText;\r\n cashBackPercentageAmount?: number;\r\n cashbackBannerDetails?: RichText;\r\n planID?: number;\r\n specialCase36Months?: boolean;\r\n}\r\nexport interface ILowCostOffer {\r\n offerName?: string;\r\n maxPurchase: number;\r\n lowCostFinancingOfferMessage: string,\r\n financingOfferDescription: RichText;\r\n disclaimer: RichText;\r\n defaultNumberOfMonths: number;\r\n lowCostOfferDetailsOnCart?: RichText;\r\n}\r\n\r\n\r\nexport interface IFinancingOfferFormatted {\r\n lowCostOfferDetailsOnCart?: RichText;\r\n numOfMonths: number;\r\n costPerMonth: number;\r\n startDate?: string;\r\n endDate?: string;\r\n isLTO: boolean;\r\n monthlyOfferDetails?: RichText;\r\n minPurchase: number;\r\n lowCostFinancingOfferMessage?: string;\r\n everydayFinancingOfferMessage?: string;\r\n limitedFinancingOfferMessage?: string;\r\n cashbackFinancingOfferMessage?: string;\r\n financingOfferDescription: RichText;\r\n disclaimer: RichText;\r\n specialCampaign?: IFinancingOfferCampaign;\r\n offerName?: string;\r\n checkoutDisplay?: { heading: string; details: string; specialOffer?: string },\r\n FinancingOfferDataOnPage?: RichText;\r\n isCashBack?: boolean;\r\n cashBackPercentageAmount?: number;\r\n cashbackBannerDetails?: RichText;\r\n specialCase36Months?: boolean;\r\n}\r\n\r\nexport interface IFinancingOfferCampaign {\r\n initialMonthlyAmount: number;\r\n numOfDiscountedMonths: number;\r\n campaignValidStartDate: string;\r\n campaignValidEndDate: string;\r\n enableCampaign: boolean;\r\n showEverydayFlag: boolean;\r\n}\r\n\r\nexport interface ISelectFinancingOfferData {\r\n limitedTimeFinancingOffers: IFinancingOffer[];\r\n everydayFinancingOffers: IFinancingOffer[];\r\n lowCostOffer?: ILowCostOffer[]\r\n totalPrice: number | undefined;\r\n specialFinancingOffer?: IFinancingOffer[];\r\n synchronySpecialFinancingCondition?: boolean;\r\n specialFinancingEnable?: boolean;\r\n checkoutShowEveryDayOffers?: boolean;\r\n cashbackFinancingEnable?: boolean;\r\n cashBackFinancingOffer?: IFinancingOffer[];\r\n}\r\n\r\nexport interface ICampaignRemainingCost {\r\n cost: number;\r\n months: number;\r\n}\r\n\r\nexport const getValidSpecialCampaign = (financingOffer: IFinancingOfferFormatted): IFinancingOfferCampaign | undefined => {\r\n if (\r\n financingOffer.specialCampaign &&\r\n financingOffer.specialCampaign.enableCampaign &&\r\n financingOffer.specialCampaign.initialMonthlyAmount &&\r\n financingOffer.specialCampaign.numOfDiscountedMonths &&\r\n isCampaignScheduled(financingOffer)\r\n ) {\r\n return financingOffer.specialCampaign;\r\n }\r\n\r\n return undefined;\r\n};\r\n\r\nexport const getCampaignRemainingCost = (\r\n campaign: IFinancingOfferCampaign,\r\n financingOffer: IFinancingOfferFormatted,\r\n totalPrice: number | undefined\r\n): ICampaignRemainingCost | undefined => {\r\n if (!totalPrice) {\r\n return undefined;\r\n }\r\n\r\n const initialCost = campaign.initialMonthlyAmount * campaign.numOfDiscountedMonths;\r\n const remainingCost = totalPrice - initialCost;\r\n const remainingMonths = financingOffer.numOfMonths - campaign.numOfDiscountedMonths;\r\n const monthlyCost = remainingCost / remainingMonths;\r\n\r\n return {\r\n cost: monthlyCost,\r\n months: remainingMonths\r\n };\r\n};\r\nexport const isValidLimitedTimeOffer = (offer: IFinancingOffer): boolean => {\r\n const startDate = dayjs(offer.offerValidStartDate, format);\r\n const endDate = dayjs(offer.offerValidEndDate, format).add(1, 'd');\r\n\r\n const startDateCentralTime = startDate.isValid() && dayjs(startDate.format(format), format).tz('America/Chicago').local();\r\n const endDateCentralTime = endDate.isValid() && dayjs(endDate.format(format), format).tz('America/Chicago').local();\r\n\r\n const now = dayjs();\r\n return startDateCentralTime && endDateCentralTime && now.isBetween(startDateCentralTime, endDateCentralTime);\r\n};\r\n\r\nexport const isCampaignScheduled = (offer: IFinancingOfferFormatted): boolean => {\r\n const tempOffer = Object.create(offer);\r\n if (tempOffer.specialCampaign?.campaignValidStartDate && tempOffer.specialCampaign?.campaignValidEndDate) {\r\n tempOffer.startDate = tempOffer.specialCampaign?.campaignValidStartDate;\r\n tempOffer.endDate = tempOffer.specialCampaign?.campaignValidEndDate;\r\n\r\n return isScheduled(tempOffer);\r\n }\r\n\r\n return false;\r\n};\r\n\r\nexport const isScheduled = (offer: IFinancingOfferFormatted): boolean => {\r\n const startDate = dayjs(offer.startDate, format);\r\n const endDate = dayjs(offer.endDate, format).add(1, 'd');\r\n\r\n const startDateCentralTime = startDate.isValid() && dayjs(startDate.format(format), format).tz('America/Chicago').local();\r\n const endDateCentralTime = endDate.isValid() && dayjs(endDate.format(format), format).tz('America/Chicago').local();\r\n\r\n const now = dayjs();\r\n\r\n return startDateCentralTime && endDateCentralTime && now.isBetween(startDateCentralTime, endDateCentralTime);\r\n};\r\n\r\nexport const selectFinancingOffer = ({ limitedTimeFinancingOffers = [], everydayFinancingOffers = [], lowCostOffer = [], totalPrice = 0, specialFinancingOffer = [], synchronySpecialFinancingCondition = false, specialFinancingEnable = false, checkoutShowEveryDayOffers, cashbackFinancingEnable = false, cashBackFinancingOffer = [] }: ISelectFinancingOfferData, returnCustomOfferArray?: boolean): IFinancingOfferFormatted | undefined => {\r\n let highestMinimumPurchase: number = 0;\r\n let bestOffer: IFinancingOfferFormatted = {\r\n numOfMonths: 0,\r\n costPerMonth: 0,\r\n isLTO: false,\r\n minPurchase: 0,\r\n everydayFinancingOfferMessage: '',\r\n limitedFinancingOfferMessage: '',\r\n cashbackFinancingOfferMessage: '',\r\n monthlyOfferDetails: '',\r\n financingOfferDescription: '',\r\n disclaimer: ''\r\n };\r\n let offerFound = false;\r\n\r\n let campaignFound: IFinancingOfferFormatted | undefined;\r\n\r\n const everydayOffers: IFinancingOfferFormatted[] | undefined = [];\r\n const specialOffer: IFinancingOfferFormatted[] | undefined = [];\r\n\r\n const validLimitedTimeFinancingOffers = limitedTimeFinancingOffers.filter((offer) => {\r\n return isValidLimitedTimeOffer(offer) && offer;\r\n });\r\n\r\n if (synchronySpecialFinancingCondition && specialFinancingEnable) {\r\n if (!offerFound || (!isScheduled(bestOffer) && specialFinancingOffer.length)) {\r\n // try default offer\r\n offerFound = false;\r\n highestMinimumPurchase = 0;\r\n specialFinancingOffer.forEach((offer: IFinancingOffer) => {\r\n const minPurchase = offer.minPurchase ? offer.minPurchase : 0;\r\n let currentOfferAccepted = false;\r\n if (totalPrice >= minPurchase && minPurchase >= highestMinimumPurchase) {\r\n bestOffer = {\r\n numOfMonths: offer.noInterestFor,\r\n costPerMonth: Math.ceil(totalPrice / offer.noInterestFor),\r\n startDate: offer.offerValidStartDate,\r\n endDate: offer.offerValidEndDate,\r\n isLTO: false,\r\n minPurchase: offer.minPurchase || 0,\r\n offerName: offer.offerName,\r\n financingOfferDescription: offer.financingOfferDescription,\r\n disclaimer: offer.disclaimer,\r\n FinancingOfferDataOnPage: offer?.FinancingOfferDataOnPage,\r\n checkoutDisplay: offer?.checkoutDisplay\r\n };\r\n highestMinimumPurchase = offer.minPurchase;\r\n offerFound = true;\r\n currentOfferAccepted = true;\r\n }\r\n if (returnCustomOfferArray && (totalPrice >= minPurchase)) {\r\n specialOffer?.push({\r\n numOfMonths: offer.noInterestFor,\r\n costPerMonth: Math.ceil(totalPrice / offer.noInterestFor),\r\n startDate: offer.offerValidStartDate,\r\n endDate: offer.offerValidEndDate,\r\n isLTO: false,\r\n minPurchase: offer.minPurchase || 0,\r\n everydayFinancingOfferMessage: offer.everydayFinancingOfferMessage,\r\n limitedFinancingOfferMessage: offer.limitedFinancingOfferMessage,\r\n cashbackFinancingOfferMessage: offer.cashbackFinancingOfferMessage,\r\n financingOfferDescription: offer.financingOfferDescription,\r\n disclaimer: offer.disclaimer,\r\n offerName: offer.offerName\r\n });\r\n highestMinimumPurchase = offer.minPurchase;\r\n offerFound = true;\r\n currentOfferAccepted = true;\r\n // @ts-ignore\r\n bestOffer = specialOffer;\r\n }\r\n // Do not use default if end date is defined and has expired\r\n if (currentOfferAccepted && offer.offerValidEndDate) {\r\n const endDate = dayjs(offer.offerValidEndDate, format);\r\n const now = dayjs();\r\n if (endDate.isValid() && now.isAfter(endDate)) {\r\n offerFound = false;\r\n }\r\n }\r\n });\r\n }\r\n } else {\r\n // if cashback enabled and has length check for cashback offer\r\n if (cashbackFinancingEnable && cashBackFinancingOffer?.length) {\r\n cashBackFinancingOffer.forEach((offer) => {\r\n const minPurchase = offer.minPurchase ? offer.minPurchase : 0;\r\n // if minimum purchase criteria is met, then create best offer\r\n if (totalPrice >= minPurchase) {\r\n const cashBackOffer = {\r\n numOfMonths: offer?.noInterestFor,\r\n costPerMonth: Math.ceil(totalPrice / offer?.noInterestFor),\r\n startDate: offer?.offerValidStartDate,\r\n endDate: offer?.offerValidEndDate,\r\n isLTO: false,\r\n minPurchase: offer?.minPurchase || 0,\r\n offerName: offer?.offerName,\r\n financingOfferDescription: offer?.financingOfferDescription,\r\n disclaimer: offer?.disclaimer,\r\n FinancingOfferDataOnPage: offer?.FinancingOfferDataOnPage,\r\n isCashBack: cashbackFinancingEnable,\r\n checkoutDisplay: offer?.checkoutDisplay,\r\n cashBackPercentageAmount: offer?.cashBackPercentageAmount,\r\n cashbackBannerDetails: offer?.cashbackBannerDetails,\r\n cashbackFinancingOfferMessage: offer?.cashbackFinancingOfferMessage\r\n };\r\n offerFound = true;\r\n bestOffer = cashBackOffer;\r\n }\r\n\r\n // check if current offer expired\r\n if (offerFound && offer?.offerValidEndDate) {\r\n const endDate = dayjs(offer?.offerValidEndDate, format);\r\n const now = dayjs();\r\n if (endDate?.isValid() && now.isAfter(endDate)) {\r\n offerFound = false;\r\n }\r\n }\r\n });\r\n }\r\n // if no offer found then check limited time financing offers\r\n if (!offerFound || !isScheduled(bestOffer)) {\r\n validLimitedTimeFinancingOffers.forEach((offer: IFinancingOffer) => {\r\n const minPurchase = offer.minPurchase ? offer.minPurchase : 0;\r\n if (totalPrice >= minPurchase && minPurchase > highestMinimumPurchase) {\r\n const updatedOffer = calculateFinancing(totalPrice , offer.noInterestFor, offer.monthlyOfferDetails);\r\n const currentOffer: IFinancingOfferFormatted = {\r\n numOfMonths: offer.noInterestFor,\r\n costPerMonth: updatedOffer?.monthlyPayment,\r\n startDate: offer.offerValidStartDate,\r\n endDate: offer.offerValidEndDate,\r\n isLTO: true,\r\n minPurchase: offer.minPurchase,\r\n everydayFinancingOfferMessage: offer.everydayFinancingOfferMessage,\r\n limitedFinancingOfferMessage: offer.limitedFinancingOfferMessage,\r\n cashbackFinancingOfferMessage: offer.cashbackFinancingOfferMessage,\r\n monthlyOfferDetails: updatedOffer?.financingMessage,\r\n financingOfferDescription: offer.financingOfferDescription,\r\n disclaimer: offer.disclaimer,\r\n specialCampaign: offer.specialCampaignOffer,\r\n checkoutDisplay: offer.checkoutDisplay,\r\n offerName: offer.offerName,\r\n specialCase36Months: offer.noInterestFor === 36\r\n };\r\n bestOffer = currentOffer;\r\n highestMinimumPurchase = offer.minPurchase;\r\n offerFound = true;\r\n\r\n // check if campaign schedule is scheduled, otherwise fall back to parent offer\r\n const validCampaign = getValidSpecialCampaign(currentOffer);\r\n if (validCampaign) {\r\n currentOffer.startDate = validCampaign.campaignValidStartDate;\r\n currentOffer.endDate = validCampaign.campaignValidEndDate;\r\n campaignFound = currentOffer;\r\n }\r\n else {\r\n campaignFound = undefined;\r\n }\r\n }\r\n });\r\n }\r\n // if no offer found then check everyday financing offer\r\n if (!offerFound || (!isScheduled(bestOffer) && everydayFinancingOffers.length)) {\r\n // try default offer\r\n offerFound = false;\r\n highestMinimumPurchase = 0;\r\n\r\n everydayFinancingOffers.forEach((offer: IFinancingOffer) => {\r\n const minPurchase = checkoutShowEveryDayOffers ? 0 : offer.minPurchase ? offer.minPurchase : 0;\r\n let currentOfferAccepted = false;\r\n if (totalPrice >= minPurchase && minPurchase >= highestMinimumPurchase) {\r\n bestOffer = {\r\n numOfMonths: offer.noInterestFor,\r\n costPerMonth: Math.ceil(totalPrice / offer.noInterestFor),\r\n isLTO: false,\r\n minPurchase: offer.minPurchase || 0,\r\n everydayFinancingOfferMessage: offer.everydayFinancingOfferMessage,\r\n limitedFinancingOfferMessage: offer.limitedFinancingOfferMessage,\r\n cashbackFinancingOfferMessage: offer.cashbackFinancingOfferMessage,\r\n offerName: offer.offerName,\r\n monthlyOfferDetails: offer.monthlyOfferDetails,\r\n financingOfferDescription: offer.financingOfferDescription,\r\n disclaimer: offer.disclaimer\r\n };\r\n highestMinimumPurchase = offer.minPurchase;\r\n offerFound = true;\r\n currentOfferAccepted = true;\r\n }\r\n\r\n if (returnCustomOfferArray && (totalPrice >= minPurchase)) {\r\n everydayOffers?.push({\r\n numOfMonths: offer.noInterestFor,\r\n costPerMonth: Math.ceil(totalPrice / offer.noInterestFor),\r\n isLTO: false,\r\n minPurchase: offer.minPurchase || 0,\r\n everydayFinancingOfferMessage: offer.everydayFinancingOfferMessage,\r\n limitedFinancingOfferMessage: offer.limitedFinancingOfferMessage,\r\n cashbackFinancingOfferMessage: offer.cashbackFinancingOfferMessage,\r\n monthlyOfferDetails: offer.monthlyOfferDetails,\r\n financingOfferDescription: offer.financingOfferDescription,\r\n disclaimer: offer.disclaimer,\r\n offerName: offer.offerName\r\n });\r\n highestMinimumPurchase = offer.minPurchase;\r\n offerFound = true;\r\n currentOfferAccepted = true;\r\n // @ts-ignore\r\n bestOffer = everydayOffers;\r\n }\r\n // Do not use default if end date is defined and has expired\r\n if (currentOfferAccepted && offer.offerValidEndDate) {\r\n const endDate = dayjs(offer.offerValidEndDate, format);\r\n const now = dayjs();\r\n if (endDate.isValid() && now.isAfter(endDate)) {\r\n offerFound = false;\r\n }\r\n }\r\n });\r\n }\r\n if (lowCostOffer?.length) {\r\n lowCostOffer.forEach((offer: ILowCostOffer) => {\r\n if (totalPrice <= offer.maxPurchase && offer.offerName?.toLowerCase() === 'low cost offer') {\r\n const LCO = {\r\n offerName: offer.offerName,\r\n maxPurchase: offer.maxPurchase || 0,\r\n lowCostFinancingOfferMessage: offer.lowCostFinancingOfferMessage,\r\n financingOfferDescription: offer?.financingOfferDescription?.replace(/{defaultNumOfMonths}/g, `${offer?.defaultNumberOfMonths?.toString() || 6}`),\r\n disclaimer: offer.disclaimer,\r\n lowCostOfferDetailsOnCart: offer.lowCostOfferDetailsOnCart\r\n };\r\n highestMinimumPurchase = offer.maxPurchase;\r\n offerFound = true;\r\n // @ts-ignore\r\n bestOffer = LCO;\r\n }\r\n });\r\n }\r\n }\r\n\r\n if (!offerFound) {\r\n return undefined;\r\n }\r\n if (campaignFound) {\r\n return campaignFound;\r\n }\r\n return bestOffer;\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 { 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","import * as React from \"react\";\r\nimport { ITelemetry } from '@msdyn365-commerce/core';\r\ninterface ErrorBoundaryState {\r\n hasError: boolean;\r\n errorMessage: string;\r\n}\r\n\r\ninterface ErrorBoundaryProps {\r\n showMessage?: boolean | string; //true to show the error message, set to string to show custom message\r\n telemetry: ITelemetry\r\n}\r\n\r\n\r\n// Put this in a child component to mock an error in order to test ErrorBoundary.\r\nexport const MockError = (props: {message?: string}) => {\r\n throw new Error(props.message);\r\n};\r\n\r\nexport class ErrorBoundary extends React.Component {\r\n constructor(props: ErrorBoundaryProps) {\r\n super(props);\r\n this.state = {\r\n hasError: false,\r\n errorMessage: \"\"\r\n };\r\n }\r\n\r\n\r\n // @ts-ignore\r\n private static getDerivedStateFromError(error: any) {\r\n // Update state so the next render will show the fallback UI.\r\n return { hasError: true, errorMessage: error.message };\r\n }\r\n\r\n// public componentDidCatch(error: any, errorInfo: any) {\r\n// // You can also log the error to an error reporting service\r\n// logErrorToMyService(error, errorInfo);\r\n// }\r\n\r\n public render() {\r\n const bgColor = \"rgba(0,0,255)\";\r\n\r\n if (this.state.hasError) {\r\n const { showMessage } = this.props;\r\n const message = typeof showMessage === 'string' ? showMessage : showMessage ? this.state.errorMessage : false;\r\n this.props?.telemetry?.error(this.state?.errorMessage);\r\n // TODO design this custom UI fallback\r\n return message ?
{message}
: null;\r\n }\r\n\r\n return this.props.children || null;\r\n }\r\n}\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport {\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 { getByIdAsync, getVariantsByDimensionValuesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { ProductDimension, SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\nimport getHtmlParserValue from '../Utilities/get-html-parser-value';\r\n\r\n// tslint:disable-next-line: completed-docs\r\nexport class BuyboxGetDimensionPricingInput implements IActionInput {\r\n public channelId: number;\r\n public productId: number;\r\n constructor(productId: number, channelId: number) {\r\n this.channelId = channelId;\r\n this.productId = productId;\r\n }\r\n public getCacheKey = () => `DimensionPrices`;\r\n public getCacheObjectType = () => 'Product';\r\n public dataCacheType = (): CacheType => 'none';\r\n}\r\n\r\nexport interface IBuyboxGetDimensionPricingActionData {\r\n discountAmount?: number;\r\n name: string;\r\n price: number;\r\n productId: number;\r\n dimensionLabel: string;\r\n}\r\n\r\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n if (inputData && inputData.requestContext && inputData.requestContext.query && inputData.requestContext.query.productId) {\r\n return new BuyboxGetDimensionPricingInput(\r\n +inputData.requestContext.query.productId,\r\n +inputData.requestContext.apiSettings.channelId\r\n );\r\n } else if (inputData && inputData.requestContext && inputData.requestContext.urlTokens && inputData.requestContext.urlTokens.itemId) {\r\n return new BuyboxGetDimensionPricingInput(\r\n +inputData.requestContext.urlTokens.itemId,\r\n +inputData.requestContext.apiSettings.channelId\r\n );\r\n } else if (inputData && inputData.config && inputData.config.productId) {\r\n return new BuyboxGetDimensionPricingInput(inputData.config.productId, inputData.requestContext.apiSettings.channelId);\r\n } else {\r\n throw new Error('Unable to create SelectedVariantInput, no productId found on module config or query');\r\n }\r\n};\r\n\r\nconst getDimensionLabel = (dimension: ProductDimension): string | undefined => {\r\n const extensionProperties = dimension.DimensionValue?.ExtensionProperties;\r\n\r\n let dimensionLabel;\r\n extensionProperties?.forEach(property => {\r\n if (property.Key?.toLowerCase() === 'description') {\r\n dimensionLabel = property.Value?.StringValue && getHtmlParserValue(property.Value?.StringValue);\r\n }\r\n });\r\n\r\n return dimensionLabel;\r\n};\r\n\r\nexport async function getDimensionPricingAction(\r\n input: BuyboxGetDimensionPricingInput,\r\n ctx: IActionContext\r\n): Promise {\r\n const pricingData: IBuyboxGetDimensionPricingActionData[] = [];\r\n\r\n const productResponse = await getByIdAsync(\r\n { callerContext: ctx, queryResultSettings: { Paging: { Top: 1 } } },\r\n input.productId,\r\n input.channelId\r\n );\r\n const baseProduct = Array.isArray(productResponse) ? productResponse[0] : productResponse;\r\n\r\n await getVariantsByDimensionValuesAsync(\r\n { callerContext: ctx, queryResultSettings: { Paging: { Top: 500 } } },\r\n baseProduct.MasterProductId || input.productId,\r\n input.channelId,\r\n []\r\n )\r\n .then(async (variants: SimpleProduct[]) => {\r\n // TODO: refactor code to use Hashmap\r\n // ex: https://codepen.io/asadalikanwal/pen/ZEpgmzd?editors=1111\r\n if (variants) {\r\n const dimensionsSizes = {};\r\n const productIds = [];\r\n variants.forEach(variant => {\r\n variant.Dimensions?.forEach(dimension => {\r\n if (dimension.DimensionTypeValue === 3) {\r\n const sizeLabel = dimension.DimensionValue?.Value?.toLowerCase().trim();\r\n const priceLabel = variant.Price;\r\n const dimensionLabel = getDimensionLabel(dimension);\r\n if (sizeLabel) {\r\n if (dimensionsSizes.hasOwnProperty(sizeLabel)) {\r\n if (priceLabel && dimensionsSizes[sizeLabel].price >= priceLabel) {\r\n dimensionsSizes[sizeLabel] = {\r\n price: priceLabel,\r\n productId: variant.RecordId,\r\n name: dimension.DimensionValue?.Value,\r\n dimensionLabel: dimensionLabel\r\n };\r\n }\r\n } else {\r\n dimensionsSizes[sizeLabel] = {\r\n price: priceLabel,\r\n productId: variant.RecordId,\r\n name: dimension.DimensionValue?.Value,\r\n dimensionLabel: dimensionLabel\r\n };\r\n }\r\n }\r\n }\r\n });\r\n });\r\n\r\n if (dimensionsSizes) {\r\n // push all dimension/variant ids to array for activePrice call\r\n for (const key of Object.keys(dimensionsSizes)) {\r\n if (dimensionsSizes.hasOwnProperty(key)) {\r\n pricingData.push(dimensionsSizes[key]);\r\n productIds.push(dimensionsSizes[key].productId);\r\n }\r\n }\r\n }\r\n }\r\n })\r\n .catch(error => {\r\n ctx.telemetry.exception(error);\r\n throw new Error('[IBuyboxGetDimensionPricingActionData]Unable to retieve data');\r\n });\r\n return pricingData;\r\n}\r\n\r\nexport default createObservableDataAction({\r\n id: 'DimensionPrices',\r\n action: >getDimensionPricingAction,\r\n input: createInput\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 {\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 { getByIdAsync, getVariantsByDimensionValuesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\n// tslint:disable-next-line: completed-docs\r\nexport class BuyboxGetDimensionVariantAvailabilityInput implements IActionInput {\r\n public channelId: number;\r\n public productId: number;\r\n constructor(productId: number, channelId: number) {\r\n this.channelId = channelId;\r\n this.productId = productId;\r\n }\r\n public getCacheKey = () => `VariantIDs-${this.productId}`;\r\n public getCacheObjectType = () => 'VariantIDs';\r\n public dataCacheType = (): CacheType => 'application';\r\n}\r\n\r\nexport interface IBuyboxGetDimensionVariantAvailabilityActionData {\r\n variantID: number;\r\n sizeDimensionRecordID: number;\r\n colorDimensionRecordId: number;\r\n dimensionRecordID?: number;\r\n itemID: string;\r\n sizeValue: string;\r\n isAvailable: boolean;\r\n secondaryDimensionValue?: string; // can be color or height\r\n}\r\n\r\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n if (inputData && inputData.requestContext && inputData.requestContext.query && inputData.requestContext.query.productId) {\r\n return new BuyboxGetDimensionVariantAvailabilityInput(\r\n +inputData.requestContext.query.productId,\r\n +inputData.requestContext.apiSettings.channelId\r\n );\r\n } else if (inputData && inputData.requestContext && inputData.requestContext.urlTokens && inputData.requestContext.urlTokens.itemId) {\r\n return new BuyboxGetDimensionVariantAvailabilityInput(\r\n +inputData.requestContext.urlTokens.itemId,\r\n +inputData.requestContext.apiSettings.channelId\r\n );\r\n } else if (inputData && inputData.config && inputData.config.productId) {\r\n return new BuyboxGetDimensionVariantAvailabilityInput(inputData.config.productId, inputData.requestContext.apiSettings.channelId);\r\n } else {\r\n throw new Error('Unable to create SelectedVariantInput, no productId found on module config or query');\r\n }\r\n};\r\n\r\nexport async function getAllVariantsAction(\r\n input: BuyboxGetDimensionVariantAvailabilityInput,\r\n ctx: IActionContext\r\n): Promise {\r\n const fetchedVariants: IBuyboxGetDimensionVariantAvailabilityActionData[] = [];\r\n const productResponse = await getByIdAsync({ callerContext: ctx, queryResultSettings: { Paging: { Top: 1 } } }, input.productId, input.channelId);\r\n const baseProduct = Array.isArray(productResponse) ? productResponse[0] : productResponse;\r\n await getVariantsByDimensionValuesAsync(\r\n { callerContext: ctx, queryResultSettings: { Paging: { Top: 500 } } },\r\n baseProduct.MasterProductId || input.productId,\r\n input.channelId,\r\n []\r\n )\r\n .then(async (variants: SimpleProduct[]) => {\r\n // TODO: refactor code to use Hashmap\r\n // ex: https://codepen.io/asadalikanwal/pen/ZEpgmzd?editors=1111\r\n if (variants) {\r\n variants.forEach((variant) => {\r\n const variantAvailabilityData: IBuyboxGetDimensionVariantAvailabilityActionData = { variantID: -1, sizeDimensionRecordID: -1, colorDimensionRecordId: -1, itemID: '', isAvailable: true, sizeValue: '' };\r\n variant.Dimensions?.forEach((dimension) => {\r\n if (dimension.DimensionTypeValue === 1) {\r\n variantAvailabilityData.variantID = variant.RecordId;\r\n variantAvailabilityData.colorDimensionRecordId = dimension.DimensionValue!.RecordId;\r\n variantAvailabilityData.itemID = variant.ItemId!;\r\n variantAvailabilityData.secondaryDimensionValue = dimension.DimensionValue?.Value;\r\n } else if (dimension.DimensionTypeValue === 3) {\r\n variantAvailabilityData.variantID = variant.RecordId;\r\n variantAvailabilityData.sizeDimensionRecordID = dimension.DimensionValue!.RecordId;\r\n variantAvailabilityData.sizeValue = dimension.DimensionValue!.Value!;\r\n }\r\n });\r\n fetchedVariants.push(variantAvailabilityData);\r\n });\r\n }\r\n return fetchedVariants;\r\n })\r\n .catch(error => {\r\n ctx.telemetry.exception(error);\r\n throw new Error('[IBuyboxGetDimensionPricingActionData]Unable to retieve data');\r\n });\r\n return fetchedVariants;\r\n}\r\n\r\nexport default createObservableDataAction({\r\n id: 'VariantIDs',\r\n action: >getAllVariantsAction,\r\n input: createInput\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\r\nimport { IFinancingOfferFormatted } from '../Utilities/select-financing-offer';\r\n\r\n/**\r\n * FinancingOfferState Input Action\r\n */\r\n\r\nexport class FinancingOfferStateInput implements Msdyn365.IActionInput {\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 = () => `FinancingOfferState`;\r\n public getCacheObjectType = () => 'FinancingOfferState';\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 IFinancingOfferStateData {\r\n isOpen: boolean;\r\n totalPrice?: number;\r\n financingOffer?: IFinancingOfferFormatted;\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 FinancingOfferStateInput();\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: FinancingOfferStateInput, ctx: Msdyn365.IActionContext): Promise {\r\n return { isOpen: false };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n id: 'FinancingOfferState',\r\n input: createInput\r\n});\r\n","import MsDyn365, {\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 { OrgUnitLocation } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport { IStoreSelectorState } from './store-selector-state';\r\n/**\r\n * storeSelectorState - action input\r\n */\r\nexport class StoreSelectorStateInput implements IActionInput {\r\n public getCacheKey = () => `storeSelectorState`;\r\n public getCacheObjectType = () => 'storeSelectorState';\r\n public dataCacheType = (): CacheType => 'application';\r\n}\r\n\r\n/**\r\n * StoreSelectorStateInput - action\r\n */\r\nexport async function storeSelectorStateAction(input: StoreSelectorStateInput, ctx: IActionContext): Promise {\r\n const prefferedStore: OrgUnitLocation =\r\n MsDyn365.isBrowser && localStorage.getItem('_mfrm__prefferedStore_')\r\n ? JSON.parse(localStorage.getItem('_mfrm__prefferedStore_') || '')\r\n : {};\r\n return { isModalOpen: false, prefferedStore: prefferedStore };\r\n}\r\n\r\n/**\r\n * StoreSelectorStateInput - create new input for create action\r\n */\r\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n return new StoreSelectorStateInput();\r\n};\r\n\r\n/**\r\n * StoreSelectorStateInput - create action\r\n */\r\nexport default createObservableDataAction({\r\n id: 'StoreSelectorState',\r\n action: >storeSelectorStateAction,\r\n input: createInput\r\n});\r\n","import React from 'react';\r\nimport { IMfrmBuyboxConfig } from \"..\";\r\nimport {\r\n ContentEditableEvent,\r\n IRequestContext,\r\n Text\r\n} from '@msdyn365-commerce/core';\r\nimport { Node } from '@msdyn365-commerce-modules/utilities';\r\n\r\nexport const BuyboxCallChat = (props: {config: IMfrmBuyboxConfig, requestContext: IRequestContext}): JSX.Element => {\r\n const {config, requestContext} = props;\r\n const telOnClick = () => {\r\n window.location.href = `tel:+${config.callChatPhoneNumber}`;\r\n };\r\n\r\n const toggleChatClick = () => {\r\n // tslint:disable: no-function-expression\r\n // tslint:disable: typedef\r\n setTimeout(function () {\r\n // eslint-disable-next-line no-eval, security/detect-eval-with-expression\r\n eval(\r\n `var elems = document.querySelectorAll('.uiButton.helpButtonEnabled, .minimizedContainer.helpButton, .sidebarHeader.minimizedContainer'); if(elems != undefined && elems.length > 0) { if(elems.length > 1){elems[1].click()} else {elems[0].click()}}`\r\n );\r\n }, 1000);\r\n // @ts-ignore\r\n if ('utag' in window) {\r\n // @ts-ignore\r\n // tslint:disable-next-line: object-literal-key-quotes\r\n utag.link({\r\n event: 'chat-widget-initiated',\r\n event_type: 'chat_click',\r\n event_category: 'chat',\r\n event_action: 'click',\r\n event_label: 'chat engagement'\r\n });\r\n }\r\n };\r\n\r\n const onTextChange = (event: ContentEditableEvent) => (config.callChatMessage = event.target.value);\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n};","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport {\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\n/* tslint:disable: no-duplicate-imports */\r\nimport { observable } from 'mobx';\r\n\r\n\r\n/**\r\n * ListPageState class\r\n */\r\nexport class ListPageStateBuyBox {\r\n @observable public variantId: string | undefined = '';\r\n @observable public itemId: string | undefined = '';\r\n @observable public name: string | undefined = '';\r\n @observable public categoryName: string | undefined = '';\r\n @observable public productBrandName: string | undefined = '';\r\n @observable public price: string | undefined = '';\r\n @observable public productUrl: string | undefined = '';\r\n @observable public productImageUrl: string | undefined = '';\r\n @observable public productSize: string | undefined = '';\r\n}\r\n\r\n/**\r\n * ListPageStateInput - action input\r\n */\r\nexport class ListPageStateBuyBoxInput implements IActionInput {\r\n public getCacheKey = () => `ListPageStateBuyBox`;\r\n public getCacheObjectType = () => 'ListPageStateBuyBox';\r\n public dataCacheType = (): CacheType => 'application';\r\n}\r\n\r\nexport async function listPageStateAction(\r\n input: ListPageStateBuyBoxInput,\r\n ctx: IActionContext\r\n): Promise {\r\n return new ListPageStateBuyBox();\r\n}\r\n\r\n/**\r\n * create new input for create action\r\n */\r\nexport const createListPageInput = (\r\n inputData: ICreateActionContext>\r\n): IActionInput => {\r\n return new ListPageStateBuyBoxInput();\r\n};\r\n\r\n/**\r\n * ListPageState - create action\r\n */\r\nexport default createObservableDataAction({\r\n action: >listPageStateAction,\r\n input: createListPageInput\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 React from 'react';\r\n\r\nimport { Modal, ModalBody, ModalHeader } from '@msdyn365-commerce-modules/utilities';\r\n\r\nimport { IBuyboxGetDimensionVariantAvailabilityActionData } from '../../../data-actions/buybox-get-dimension-variants-availability-action';\r\nimport { IModalDimensions } from './buybox-product-configure-mfrm';\r\n\r\nimport classnames from 'classnames';\r\n\r\nexport interface IMfrmModalDrawerViewProps {\r\n isOpen?: boolean;\r\n className?: string;\r\n isMobile: boolean;\r\n modalDimensions?: IModalDimensions[];\r\n preSelection?: IModalDimensions;\r\n variantAvailibilityList: IBuyboxGetDimensionVariantAvailabilityActionData[];\r\n outOfStockText: string;\r\n percentFunc(dimensionPrice: number, discountAmount: number): void;\r\n formatCurrencyFunc(dimPrice: number | undefined): void;\r\n addItemClick(\r\n selectId: string,\r\n selectedValue: string,\r\n dropdownId: string,\r\n selectedDimensionLabel?: string,\r\n isAddItemClick?: boolean\r\n ): void;\r\n dimensionClickFunc?(): void;\r\n onCloseModal?(): void;\r\n}\r\n// tslint:disable-next-line:max-func-body-length\r\nexport const BuyBoxSizeComponent: React.FC = props => {\r\n const { preSelection } = props;\r\n const isPreSelected = preSelection && preSelection.selectId.length && preSelection.selectedValue.length ? true : false;\r\n const [selectId, setSelectId] = React.useState();\r\n const [preSelectionPending, setPreSelectionPending] = React.useState(true);\r\n\r\n const handleKeyPress = (\r\n e: React.KeyboardEvent,\r\n highlightId: string,\r\n highlightValue: string,\r\n highlightDimensionLabel?: string\r\n ) => {\r\n if (e.keyCode === 13) {\r\n updatePricing(highlightId, highlightValue, highlightDimensionLabel, true);\r\n }\r\n };\r\n\r\n const updatePricing = (highlightId: string, highlightValue: string, highlightDimensionLabel?: string, isAddItemClick?: boolean) => {\r\n const selectHighlightId = highlightId;\r\n const selectedValue = highlightValue;\r\n const selectedDimensionLabel = highlightDimensionLabel;\r\n setSelectId(highlightId);\r\n\r\n let discountAmount = 0;\r\n let dimensionPrice = 0;\r\n\r\n props.modalDimensions &&\r\n props.modalDimensions.map(i => {\r\n if (preSelectionPending) {\r\n if (i.selectedValue === preSelection?.selectedValue) {\r\n discountAmount = i.discountAmount || 0;\r\n dimensionPrice = i.dimensionPrice || 0;\r\n }\r\n } else {\r\n if (i.selectedValue === selectedValue) {\r\n discountAmount = i.discountAmount || 0;\r\n dimensionPrice = i.dimensionPrice || 0;\r\n }\r\n }\r\n });\r\n\r\n if (preSelectionPending) {\r\n if (isPreSelected) {\r\n props.percentFunc(dimensionPrice, discountAmount);\r\n }\r\n } else {\r\n props.percentFunc(dimensionPrice, discountAmount);\r\n }\r\n\r\n if (highlightId) {\r\n selectHighlightId &&\r\n selectedValue &&\r\n props.modalDimensions &&\r\n props.addItemClick(\r\n selectHighlightId,\r\n selectedValue,\r\n props.modalDimensions[0].dropdownId,\r\n selectedDimensionLabel,\r\n isAddItemClick\r\n );\r\n } else {\r\n preSelection &&\r\n props.modalDimensions &&\r\n props.addItemClick(\r\n preSelection.selectId,\r\n preSelection.selectedValue,\r\n props.modalDimensions[0].dropdownId,\r\n preSelection.dimensionLabel,\r\n isAddItemClick\r\n );\r\n }\r\n };\r\n\r\n const returnValidPricing = (discountAmount: number, dimensionPrice: number) => {\r\n return discountAmount && dimensionPrice\r\n ? props.formatCurrencyFunc(dimensionPrice - discountAmount)\r\n : dimensionPrice\r\n ? props.formatCurrencyFunc(dimensionPrice)\r\n : '';\r\n };\r\n\r\n\r\n // if a pre-selection was made\r\n if (preSelection && isPreSelected && preSelectionPending) {\r\n updatePricing(preSelection.selectId, preSelection.selectedValue, preSelection.dimensionLabel, false);\r\n setPreSelectionPending(false);\r\n }\r\n\r\n return (\r\n \r\n \r\n \r\n

Choose a Size

\r\n {props.modalDimensions && props.modalDimensions.map((dimension: IModalDimensions) => {\r\n let isAvailable = false;\r\n for (let idx = 0; idx < props.variantAvailibilityList.length; idx++) {\r\n // tslint:disable-next-line: radix\r\n const sameSizeVariantsAvailability = props.variantAvailibilityList.filter((variant => variant.sizeDimensionRecordID === parseInt(dimension.selectId, 10)));\r\n isAvailable = sameSizeVariantsAvailability.find(variant => variant.isAvailable) ? true : false;\r\n }\r\n return (\r\n { dimension.selectId && dimension.selectedValue && updatePricing(dimension.selectId, dimension.selectedValue, dimension.dimensionLabel, true); }}\r\n // tslint:disable-next-line: jsx-no-lambda & react-this-binding-issue\r\n onKeyUp={(e) => { dimension.selectId && dimension.selectedValue && handleKeyPress(e, dimension.selectId, dimension.selectedValue, dimension.dimensionLabel); }}\r\n >\r\n
\r\n
\r\n
\r\n {dimension.selectedValue}\r\n
\r\n
\r\n {dimension.dimensionLabel}\r\n
\r\n
\r\n {isAvailable ?\r\n
\r\n {\r\n dimension && dimension.discountAmount !== undefined && dimension.dimensionPrice !== undefined\r\n ? returnValidPricing(dimension.discountAmount, dimension.dimensionPrice)\r\n : ''\r\n }\r\n
\r\n {dimension.percentDiff ? {dimension.percentDiff}% Off : null}\r\n {dimension.discountAmount ?  {props.formatCurrencyFunc(dimension.dimensionPrice)} : null}\r\n
\r\n
\r\n :\r\n
\r\n
\r\n {props.outOfStockText}\r\n
\r\n
\r\n }\r\n
\r\n \r\n );\r\n })}\r\n
\r\n \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\nimport * as React from 'react';\r\nimport { IBuyboxGetDimensionVariantAvailabilityActionData } from '../../../data-actions/buybox-get-dimension-variants-availability-action';\r\nimport { IModalDimensions } from './buybox-product-configure-mfrm';\r\nimport { IVariantNameMappingData } from '../mfrm-buybox.props.autogenerated';\r\nimport { getCustomizedVariantName } from '../../../Utilities/get-customized-variant-name';\r\nexport interface IMfrmSizeViewProps {\r\n sizeDimensions?: IModalDimensions[];\r\n preSelection?: IModalDimensions;\r\n variantAvailibilityList: IBuyboxGetDimensionVariantAvailabilityActionData[];\r\n outOfStockText: string;\r\n percentFunc(dimensionPrice: number, discountAmount: number): void;\r\n addItemClick(\r\n selectId: string,\r\n selectedValue: string,\r\n dropdownId: string,\r\n selectedDimensionLabel?: string,\r\n isAddItemClick?: boolean\r\n ): void;\r\n variantMappingConfig: IVariantNameMappingData[] | undefined;\r\n}\r\n// tslint:disable-next-line:max-func-body-length\r\nexport const BuyBoxSizeRedesignComponent: React.FC = props => {\r\n const { preSelection } = props;\r\n const isPreSelected = preSelection && preSelection.selectId.length && preSelection.selectedValue.length ? true : false;\r\n const [selectId, setSelectId] = React.useState();\r\n const [preSelectionPending, setPreSelectionPending] = React.useState(true);\r\n const handleKeyPress = (\r\n e: React.KeyboardEvent,\r\n highlightId: string,\r\n highlightValue: string,\r\n highlightDimensionLabel?: string\r\n ) => {\r\n if (e.keyCode === 13) {\r\n updatePricing(highlightId, highlightValue, highlightDimensionLabel, true);\r\n }\r\n };\r\n const updatePricing = (highlightId: string, highlightValue: string, highlightDimensionLabel?: string, isAddItemClick?: boolean) => {\r\n const selectHighlightId = highlightId;\r\n const selectedValue = highlightValue;\r\n const selectedDimensionLabel = highlightDimensionLabel;\r\n setSelectId(highlightId);\r\n let discountAmount = 0;\r\n let dimensionPrice = 0;\r\n props.sizeDimensions &&\r\n props.sizeDimensions.map(i => {\r\n if (preSelectionPending) {\r\n if (i.selectedValue === preSelection?.selectedValue) {\r\n discountAmount = i.discountAmount || 0;\r\n dimensionPrice = i.dimensionPrice || 0;\r\n }\r\n } else {\r\n if (i.selectedValue === selectedValue) {\r\n discountAmount = i.discountAmount || 0;\r\n dimensionPrice = i.dimensionPrice || 0;\r\n }\r\n }\r\n });\r\n if (preSelectionPending) {\r\n if (isPreSelected) {\r\n props.percentFunc(dimensionPrice, discountAmount);\r\n }\r\n } else {\r\n props.percentFunc(dimensionPrice, discountAmount);\r\n }\r\n if (highlightId) {\r\n selectHighlightId &&\r\n selectedValue &&\r\n props.sizeDimensions &&\r\n props.addItemClick(\r\n selectHighlightId,\r\n selectedValue,\r\n props.sizeDimensions[0].dropdownId,\r\n selectedDimensionLabel,\r\n isAddItemClick\r\n );\r\n } else {\r\n preSelection &&\r\n props.sizeDimensions &&\r\n props.addItemClick(\r\n preSelection.selectId,\r\n preSelection.selectedValue,\r\n props.sizeDimensions[0].dropdownId,\r\n preSelection.dimensionLabel,\r\n isAddItemClick\r\n );\r\n }\r\n };\r\n // if a pre-selection was made\r\n if (preSelection && isPreSelected && preSelectionPending) {\r\n updatePricing(preSelection.selectId, preSelection.selectedValue, preSelection.dimensionLabel, false);\r\n setPreSelectionPending(false);\r\n }\r\n return (\r\n
    \r\n {props.sizeDimensions && props.sizeDimensions.map((dimension: IModalDimensions) => {\r\n let isAvailable = false;\r\n for (let idx = 0; idx < props.variantAvailibilityList.length; idx++) {\r\n // tslint:disable-next-line: radix\r\n const sameSizeVariantsAvailability = props.variantAvailibilityList.filter((variant => variant.sizeDimensionRecordID === parseInt(dimension.selectId, 10)));\r\n isAvailable = sameSizeVariantsAvailability.find(variant => variant.isAvailable) ? true : false;\r\n }\r\n const isActive = dimension.selectId === selectId;\r\n if (isActive && isAvailable === false) {\r\n const selectedValueData = props.variantAvailibilityList.filter(item => item.sizeValue === dimension.selectedValue);\r\n const isVariantAvailableAtAll = selectedValueData.filter(item => item.isAvailable === true)?.length;\r\n const isAnyVariantAvailable = props.variantAvailibilityList.filter(item => item.isAvailable === true);\r\n if (isVariantAvailableAtAll === 0 && isAnyVariantAvailable.length !== 0) {\r\n updatePricing(isAnyVariantAvailable[0].sizeDimensionRecordID.toString(), isAnyVariantAvailable[0].sizeValue, '', true);\r\n }\r\n }\r\n const customVariantName = getCustomizedVariantName(props.variantMappingConfig, dimension.selectedValue);\r\n return (\r\n { dimension.selectId && dimension.selectedValue && updatePricing(dimension.selectId, dimension.selectedValue, dimension.dimensionLabel, true); }}\r\n // tslint:disable-next-line: jsx-no-lambda & react-this-binding-issue\r\n onKeyUp={(e) => { dimension.selectId && dimension.selectedValue && handleKeyPress(e, dimension.selectId, dimension.selectedValue, dimension.dimensionLabel); }}\r\n >\r\n \r\n \r\n );\r\n })}\r\n
\r\n );\r\n};","import { IVariantNameMappingData } from '../modules/mfrm-buybox/mfrm-buybox.props.autogenerated';\r\n\r\nexport const getCustomizedVariantName = (variantNameConfig: IVariantNameMappingData[] | undefined, originalVariantName: string): string | undefined => {\r\n const variantNameMapObject = variantNameConfig?.find((variant) => variant.originalVariantName === originalVariantName);\r\n if (variantNameMapObject?.originalVariantName === originalVariantName) {\r\n return variantNameMapObject?.customizedVariantName;\r\n }\r\n else {\r\n return originalVariantName;\r\n }\r\n};","/**\r\n * Copyright (c) 2018 Microsoft Corporation\r\n */\r\nimport { getPayloadObject, getTelemetryAttributes, IPayLoad } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\nimport { IDropdownProps } from './';\r\nimport { IDropdownItemProps } from './dropdown.props';\r\nimport { observer } from 'mobx-react';\r\ntype IDropdownState = {\r\n /**\r\n * @friendlyName selectedIndex\r\n * @description selected index\r\n */\r\n selectedIndex: string;\r\n /**\r\n * @friendlyName preSelectionSet\r\n * @description is a preselection set for the dropdown\r\n */\r\n preSelectionSet?: boolean;\r\n};\r\n/**\r\n *\r\n * DropDown component\r\n * @extends {React.PureComponent}\r\n */\r\n@observer\r\nexport class Dropdown extends React.PureComponent {\r\n private selectMenu: React.RefObject = React.createRef();\r\n private payLoad: IPayLoad;\r\n constructor(props: IDropdownProps, state: IDropdownState) {\r\n super(props);\r\n {\r\n /* VSI Customization - START */\r\n }\r\n const selectedValue = this.props?.dimensionValue?.RecordId?.toString() || '';\r\n this.state = {\r\n selectedIndex: selectedValue\r\n };\r\n {\r\n /* VSI Customization - END */\r\n }\r\n this.payLoad = getPayloadObject('click', props.telemetryContent!, this.props.dropdownName);\r\n }\r\n public componentDidMount(): void {\r\n {\r\n /* VSI Customization - START */\r\n }\r\n if (this.selectMenu.current && this.state.selectedIndex === '') {\r\n this.selectMenu.current.selectedIndex = 0;\r\n }\r\n {\r\n /* VSI Customization - END */\r\n }\r\n }\r\n public componentDidUpdate(): void {\r\n const selectedValue = this.props?.dimensionValue?.RecordId?.toString() || '';\r\n selectedValue && !this.state.preSelectionSet && this.setState({ selectedIndex: selectedValue, preSelectionSet: true });\r\n }\r\n public render(): JSX.Element {\r\n const { dropdownId, dropdownList, dropdownName, dropdownToggleName } = this.props;\r\n const attribute = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\r\n return (\r\n \r\n \r\n {dropdownList.map(\r\n (item: IDropdownItemProps) => {\r\n const isAvailable = this.props.variantAvailibilityList?.find(dim => dim.sizeValue.toLowerCase() === this.props.selectedSize?.toLowerCase() && dim.colorDimensionRecordId.toString() === item.id)?.isAvailable;\r\n const isActive = this.state.selectedIndex === item.id.toString();\r\n return (\r\n item && \r\n {item.value}\r\n \r\n );\r\n }\r\n )}\r\n \r\n );\r\n }\r\n private _onChanged = async (event: React.ChangeEvent) => {\r\n this.setState({ selectedIndex: event.target.value });\r\n if (this.props.onChange) {\r\n await this.props.onChange({\r\n dropdownId: this.props.dropdownId,\r\n selectId: event.target.value,\r\n selectedValue: event.target.innerText\r\n });\r\n }\r\n };\r\n}","import { ProductDimensionValue } from '@msdyn365-commerce/retail-proxy';\r\nimport * as React from 'react';\r\nimport { IBuyboxGetDimensionVariantAvailabilityActionData } from '../../../../data-actions/buybox-get-dimension-variants-availability-action';\r\nimport { getQueryParamsFromQueryByName } from '../../../../data-actions/utilities/utils';\r\nimport { variantQueryStringName } from '../../../../Utilities/constants';\r\nexport interface IListingProps {\r\n swatchName: string;\r\n dimension: IDimensionData;\r\n baseImageUrl: string;\r\n availabilityList: IBuyboxGetDimensionVariantAvailabilityActionData[];\r\n selectedSize: string;\r\n generateOnClick(id: number, value: string, variantID: number): (e: React.MouseEvent) => void;\r\n setActiveVariant(variantID: number): void;\r\n isVariantSelectionRedesignEnabled: boolean;\r\n selectedValueAvailable: boolean | undefined;\r\n}\r\nexport interface IDimensionData {\r\n DimensionTypeValue: number;\r\n DimensionValue?: ProductDimensionValue;\r\n DimensionValues?: ProductDimensionValue[];\r\n}\r\n/**\r\n *\r\n * Listing component\r\n * @extends {React.PureComponent}\r\n */\r\n\r\nexport const _renderSlashItem = (\r\n isVariantSelectionRedesignEnabled: boolean\r\n): JSX.Element => {\r\n return (\r\n isVariantSelectionRedesignEnabled\r\n ? \r\n : \r\n );\r\n};\r\n\r\nconst Listing = (props: IListingProps) => {\r\n const render = (props: IListingProps) => {\r\n const { baseImageUrl, dimension, generateOnClick, setActiveVariant, selectedValueAvailable, isVariantSelectionRedesignEnabled } = props;\r\n return (\r\n
    \r\n {dimension.DimensionValues\r\n ? dimension.DimensionValues.map((dimensionValue, index) => {\r\n const recordID = dimensionValue.RecordId.toString();\r\n let isAvailable = false;\r\n // For value of current color variant ID\r\n let currVariantID = -1;\r\n // check variant availability list to see if variant is out of stock\r\n for (let i = 0; i < props.availabilityList.length; i++) {\r\n const colorDimensionRecordId = JSON.stringify(props.availabilityList[i].colorDimensionRecordId);\r\n if (props.selectedSize === props.availabilityList[i].sizeValue && colorDimensionRecordId === recordID) {\r\n isAvailable = props.availabilityList[i].isAvailable;\r\n currVariantID = props.availabilityList[i].variantID;\r\n }\r\n }\r\n const dimensionId = dimensionValue.DimensionId?.replace(/[/]/g, '^')?.replace(/\\s+/g, '_').toLowerCase();\r\n const selectedValue = (dimension.DimensionValue && dimension.DimensionValue.RecordId) || 'not available';\r\n const isActive = selectedValue === dimensionValue.RecordId;\r\n const url = new URL(window.location.href.toString());\r\n const isVariantIdNotAvailable = Number(getQueryParamsFromQueryByName(url, variantQueryStringName)) ? false : true;\r\n\r\n if (isActive) {\r\n if (isVariantIdNotAvailable || !selectedValueAvailable) {\r\n const element = document.getElementsByClassName(\"selected\")[0] as HTMLElement;\r\n element?.click();\r\n }\r\n setActiveVariant(currVariantID);\r\n }\r\n return (\r\n !isAvailable ?\r\n \r\n
    \r\n {/*Note: will likely eventually update generateOnClick so you can pass in dimensionValue.RecordId instead of the index*/}\r\n \r\n {_renderSlashItem(isVariantSelectionRedesignEnabled)}\r\n
    \r\n \r\n :\r\n \r\n
    \r\n {/*Note: will likely eventually update generateOnClick so you can pass in dimensionValue.RecordId instead of the index*/}\r\n \r\n
    \r\n \r\n );\r\n })\r\n : false}\r\n
\r\n );\r\n };\r\n return render(props);\r\n};\r\nexport default Listing;","/**\r\n * Copyright (c) 2018 Microsoft Corporation\r\n */\r\nimport { getPayloadObject, getTelemetryAttributes, IPayLoad, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\nimport { IDropdownItemProps, IDropdownOnSelectionChangeNotification } from './dropdown/dropdown.props';\r\nimport { observer } from 'mobx-react';\r\nimport { ProductDimensionValue } from '@msdyn365-commerce/retail-proxy';\r\nimport { IBuyboxGetDimensionVariantAvailabilityActionData } from '../../../data-actions/buybox-get-dimension-variants-availability-action';\r\ntype IHeightFoundationState = {\r\n /**\r\n * @friendlyName selectedIndex\r\n * @description selected index\r\n */\r\n selectedIndex: string;\r\n /**\r\n * @friendlyName preSelectionSet\r\n * @description is a preselection set for the dropdown\r\n */\r\n preSelectionSet?: boolean;\r\n};\r\nexport interface IDimensionProps {\r\n /**\r\n * @friendlyName dropdownId\r\n * @description Id for dropdown component\r\n */\r\n dimensionId: string;\r\n /**\r\n * @friendlyName variantAvailibilityList\r\n * @description array for checking variant aviability\r\n */\r\n variantAvailibilityList: IBuyboxGetDimensionVariantAvailabilityActionData[];\r\n /**\r\n * @friendlyName dropdownName\r\n * @description Name of the dropdown component\r\n */\r\n dimensionName: string;\r\n selectedSize: string;\r\n dimensionValue?: ProductDimensionValue;\r\n /**\r\n * @friendlyName dropdownList\r\n * @description List of items in dropdown\r\n */\r\n dimensionList: IDropdownItemProps[];\r\n /**\r\n * @telemetryContent telemetryContent\r\n * @description telemetry content\r\n */\r\n telemetryContent?: ITelemetryContent;\r\n /**\r\n * @friendlyName onChange\r\n * @description Callback that gets fired when when a selected dimension changes\r\n */\r\n onChange?(notification: IDropdownOnSelectionChangeNotification): Promise;\r\n setActiveVariant(variantID: number): void;\r\n}\r\n/**\r\n *\r\n * DropDown component\r\n * @extends {React.PureComponent}\r\n */\r\n@observer\r\nexport class HeightFoundationComponent extends React.PureComponent {\r\n private selectMenu: React.RefObject = React.createRef();\r\n private payLoad: IPayLoad;\r\n constructor(props: IDimensionProps, state: IHeightFoundationState) {\r\n super(props);\r\n {\r\n /* VSI Customization - START */\r\n }\r\n const selectedValue = this.props?.dimensionValue?.RecordId?.toString() || '';\r\n this.state = {\r\n selectedIndex: selectedValue\r\n };\r\n {\r\n /* VSI Customization - END */\r\n }\r\n this.payLoad = getPayloadObject('click', props.telemetryContent!, this.props.dimensionName);\r\n }\r\n public componentDidMount(): void {\r\n {\r\n /* VSI Customization - START */\r\n }\r\n if (this.selectMenu.current && this.state.selectedIndex === '') {\r\n this.selectMenu.current.selectedIndex = 0;\r\n }\r\n {\r\n /* VSI Customization - END */\r\n }\r\n }\r\n public componentDidUpdate(): void {\r\n const selectedValue = this.props?.dimensionValue?.RecordId?.toString() || '';\r\n selectedValue && !this.state.preSelectionSet && this.setState({ selectedIndex: selectedValue, preSelectionSet: true });\r\n }\r\n public render(): JSX.Element {\r\n const { dimensionList } = this.props;\r\n const attribute = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\r\n return (\r\n <>\r\n
    \r\n {dimensionList.map(\r\n (item) => {\r\n const isAvailable = this.props.variantAvailibilityList.find(dim => dim.sizeValue.toLowerCase() === this.props.selectedSize.toLowerCase() && dim.colorDimensionRecordId.toString() === item.id)?.isAvailable;\r\n const isActive = this.state.selectedIndex === item.id.toString();\r\n const classNames = !isAvailable ? 'msc-dimensions-wrapper msc-dimensions-wrapper-disable' : isActive ? 'msc-dimensions-wrapper msc-dimensions-wrapper-active' : 'msc-dimensions-wrapper';\r\n const currentVariantId = this.props.variantAvailibilityList.find(dim => dim.sizeValue.toLowerCase() === this.props.selectedSize.toLowerCase() && dim.colorDimensionRecordId.toString() === item.id)?.variantID;\r\n if (isActive) {\r\n currentVariantId && this.props.setActiveVariant(currentVariantId);\r\n }\r\n return (\r\n item && this._handleOnClick(item.id, item.value)}\r\n role='button'\r\n >\r\n \r\n \r\n );\r\n }\r\n )}\r\n
\r\n \r\n );\r\n }\r\n private _handleOnClick = async (selectedId: string, selectedValue: string) => {\r\n this.setState({ selectedIndex: selectedId });\r\n if (this.props.onChange) {\r\n await this.props.onChange({\r\n dropdownId: this.props.dimensionId,\r\n selectId: selectedId,\r\n selectedValue: selectedValue\r\n });\r\n }\r\n };\r\n}\r\n","import { getConfigureErrors, getGenericError, getQuantityError } from '@msdyn365-commerce-modules/buybox';\r\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { Alert, getTelemetryObject, INodeProps, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport { IAddToCartFailureResult } from '@msdyn365-commerce/components';\r\nimport { getUrlSync, IImageSettings } from '@msdyn365-commerce/core';\r\nimport * as React from 'react';\r\nimport AddToCartComponent from '../../../themes/mattressfirm/views/components/addtocart';\r\nimport _getInventoryQuantity from '../../../Utilities/get-inventory-quantity';\r\nimport { IBuyboxViewPropsExtended } from '../types';\r\nimport { IMfrmBuyboxResources } from '../mfrm-buybox.props.autogenerated';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nexport interface IMfrmBuyboxAddToCartViewProps {\r\n ContainerProps?: INodeProps;\r\n errorBlock?: React.ReactNode;\r\n button?: React.ReactNode;\r\n}\r\nexport interface IBuyboxErrorBlockProps {\r\n configureErrors: { [configureId: string]: string | undefined };\r\n quantityError?: string;\r\n customAmountError?: string;\r\n otherError?: string;\r\n resources: IMfrmBuyboxResources;\r\n showError: boolean;\r\n}\r\n\r\nlet telemetryContent: ITelemetryContent;\r\nlet outOfStockSmallParcel: boolean = false;\r\nlet outOfStockBoolean: boolean | undefined = false;\r\nexport const BuyboxErrorBlock: React.FC = ({ showError, configureErrors, quantityError, customAmountError, otherError, resources }) => {\r\n let errorMessages: (string | undefined)[] = [];\r\n\r\n errorMessages = Object.values(configureErrors).filter(message => message !== undefined);\r\n\r\n if (quantityError) {\r\n errorMessages.push(quantityError);\r\n }\r\n\r\n if (customAmountError) {\r\n errorMessages.push(customAmountError);\r\n }\r\n\r\n if (otherError) {\r\n errorMessages.push(otherError);\r\n }\r\n\r\n return (\r\n 0}\r\n color='danger'\r\n assertive={true}\r\n aria-label={resources.buyboxErrorMessageHeader}\r\n >\r\n \r\n {errorMessages.map((message, index) => {\r\n return (\r\n
\r\n {message}\r\n
\r\n );\r\n })}\r\n \r\n );\r\n};\r\n\r\n// tslint:disable-next-line:max-func-body-length cyclomatic-complexity\r\nexport function mfrmgetBuyboxAddToCart(\r\n props: IBuyboxViewPropsExtended,\r\n defaultMinimumKeyInPrice: number,\r\n defaultMaximumKeyInPrice: number,\r\n variantOutOfStock: boolean,\r\n itemOutOfMarket: boolean,\r\n outOfStockSmallParcelState: boolean,\r\n adjustableItem: SimpleProduct | undefined,\r\n pillow: SimpleProduct | undefined,\r\n protector: SimpleProduct | undefined\r\n): IMfrmBuyboxAddToCartViewProps {\r\n const {\r\n id,\r\n typeName,\r\n context,\r\n data: {\r\n product: { result: product },\r\n productPrice: { result: productPrice },\r\n productAvailableQuantity: { result: productAvailableQuantity },\r\n productSpecificationData,\r\n categoryPaths\r\n },\r\n resources,\r\n config: { minimumKeyInPrice, maximumKeyInPrice },\r\n app: {\r\n config: { brandBackofficeAttributePdp }\r\n }\r\n } = props;\r\n const allCategoriesArr = categoryPaths?.result;\r\n const categoryObj = allCategoriesArr && allCategoriesArr[allCategoriesArr?.length - 1];\r\n const categoryName: string | undefined = categoryObj ? `${categoryObj?.Name}` : undefined;\r\n const fallBackBrandAttribute = 'VENDOR BRAND';\r\n const attribute = brandBackofficeAttributePdp || fallBackBrandAttribute;\r\n const attributes = productSpecificationData.result;\r\n let productBrandName =\r\n attributes &&\r\n attributes.find(currAttribute => currAttribute.Name && currAttribute.Name.toLowerCase().trim() === attribute.toLowerCase().trim())\r\n ?.TextValue;\r\n productBrandName = productBrandName ? `${productBrandName}` : undefined;\r\n const {\r\n quantity,\r\n errorState: { configureErrors, quantityError, customAmountError, otherError, errorHost },\r\n selectedProduct,\r\n isUpdatingDimension,\r\n isUpdatingDeliveryOptions,\r\n isServiceItem,\r\n keyInPriceAmount\r\n } = props.state;\r\n let allVariantOOS = false;\r\n const { ecomAllVairantStockInfoConcatenated } = props;\r\n if (ecomAllVairantStockInfoConcatenated && ecomAllVairantStockInfoConcatenated.length > 0) {\r\n for (let i = 0;i < props.ecomAllVairantStockInfoConcatenated.length;i++) {\r\n const variantIdOOS = ecomAllVairantStockInfoConcatenated[i].split('|');\r\n if (variantIdOOS && variantIdOOS[0] && variantIdOOS[1] && variantIdOOS[1] !== '0') {\r\n allVariantOOS = true;\r\n } else {\r\n allVariantOOS = false;\r\n break;\r\n }\r\n }\r\n }\r\n const lastBreadcrumbCategoryLink = categoryPaths && categoryPaths.result && categoryPaths?.result[categoryPaths?.result.length - 1];\r\n const outOfStockValue = productSpecificationData.result?.filter((specificationData) => {\r\n return specificationData.Name?.trim().toLowerCase() === props.context.app.config.outOfStockProductKey?.trim().toLowerCase();\r\n });\r\n\r\n const shippingInformationSmall = productSpecificationData.result?.find(\r\n attr => attr.Name?.trim() === props.context.app.config.smallParcelAttributeKey\r\n )?.TextValue;\r\n outOfStockBoolean = outOfStockValue && outOfStockValue[0] && outOfStockValue[0].BooleanValue;\r\n outOfStockBoolean ? (outOfStockSmallParcel = true) : (outOfStockSmallParcel = false);\r\n if (outOfStockBoolean === null || outOfStockBoolean === undefined) {\r\n outOfStockSmallParcel = false;\r\n }\r\n\r\n // checked product small parcel and drop ship product type\r\n if (shippingInformationSmall && _getProductType(shippingInformationSmall.toLowerCase()) === 'Drop Ship') {\r\n if (outOfStockBoolean) {\r\n outOfStockSmallParcel = true;\r\n } else {\r\n outOfStockSmallParcel = false;\r\n }\r\n } else if (shippingInformationSmall && _getProductType(shippingInformationSmall.toLowerCase()) === 'Small Parcel') {\r\n // tslint:disable-next-line: no-floating-promises\r\n if (outOfStockBoolean) {\r\n outOfStockSmallParcel = true;\r\n } else {\r\n const checkSPAvailibility = props.state?.variantAvailibilityList?.find((variant) => variant.variantID === product?.RecordId);\r\n if (checkSPAvailibility && !checkSPAvailibility?.isAvailable) {\r\n if (!props.state?.variantAvailibilityList?.some(variant => variant.isAvailable && variant.variantID !== product?.RecordId)) {\r\n outOfStockSmallParcel = true;\r\n }\r\n } else {\r\n outOfStockSmallParcel = false;\r\n }\r\n }\r\n } else if (shippingInformationSmall && _getProductType(shippingInformationSmall.toLowerCase()) === 'Core') {\r\n if (outOfStockBoolean) {\r\n outOfStockSmallParcel = true;\r\n } else {\r\n outOfStockSmallParcel = false;\r\n }\r\n }\r\n const productAvailability = props.state.productAvailableQuantity\r\n ? props.state.productAvailableQuantity.ProductAvailableQuantity\r\n : productAvailableQuantity && productAvailableQuantity.length\r\n ? productAvailableQuantity[0].ProductAvailableQuantity\r\n : undefined;\r\n\r\n const onAddToCartFailed = (result: IAddToCartFailureResult) => {\r\n let quantityErrorForState: string | undefined;\r\n let customAmountErrorForState: string | undefined;\r\n // VSI Performance Customization - used cart props.data.cart.result\r\n let otherErrorForState: string | undefined = getGenericError(\r\n result,\r\n props.data.cart.result,\r\n resources,\r\n context,\r\n product,\r\n productAvailability,\r\n undefined\r\n );\r\n\r\n if (result.failureReason === 'OUTOFSTOCK') {\r\n quantityErrorForState = result.failureReason === 'OUTOFSTOCK' ? getQuantityError(result.stockLeft, resources) : undefined;\r\n } else if (\r\n result.failureReason === 'CARTACTIONFAILED' &&\r\n result.cartActionResult &&\r\n (result.cartActionResult.substatus === 'MAXQUANTITY' || result.cartActionResult.substatus === 'QUANTITYLIMITS')\r\n ) {\r\n // VSI Performance Customization - used cart props.data.cart.result\r\n quantityErrorForState = getGenericError(\r\n result,\r\n props.data.cart.result,\r\n resources,\r\n context,\r\n product,\r\n productAvailability,\r\n undefined\r\n );\r\n otherErrorForState = undefined; // prevent error duplication in otherError and quantityError\r\n }\r\n\r\n if (result.failureReason === 'INVALIDCUSTOMAMOUNT') {\r\n if (keyInPriceAmount === undefined || keyInPriceAmount < (minimumKeyInPrice || defaultMinimumKeyInPrice)) {\r\n const formatedAmountLimit = props.context.cultureFormatter.formatCurrency(minimumKeyInPrice || defaultMinimumKeyInPrice);\r\n customAmountErrorForState = resources.invalidSmallCustomAmountText?.replace('{minAmount}', formatedAmountLimit);\r\n } else if (keyInPriceAmount > (maximumKeyInPrice || defaultMaximumKeyInPrice)) {\r\n const formatedAmountLimit = props.context.cultureFormatter.formatCurrency(maximumKeyInPrice || defaultMaximumKeyInPrice);\r\n customAmountErrorForState = resources.invalidLargeCustomAmountText?.replace('{maxAmount}', formatedAmountLimit);\r\n }\r\n }\r\n\r\n props.callbacks.updateErrorState({\r\n errorHost: 'ADDTOCART',\r\n quantityError: quantityErrorForState,\r\n configureErrors:\r\n result.failureReason === 'MISSINGDIMENSION'\r\n ? getConfigureErrors(result.missingDimensions, resources, product?.IsGiftCard)\r\n : {},\r\n customAmountError: customAmountErrorForState,\r\n otherError: otherErrorForState\r\n });\r\n };\r\n\r\n const dialogStrings = {\r\n goToCartText: resources.buyBoxGoToCartText,\r\n continueShoppingText: resources.buyBoxContinueShoppingText,\r\n headerItemOneText: resources.buyBoxSingleItemText,\r\n headerItemFormatText: resources.buyBoxMultiLineItemFormatText,\r\n headerMessageText: resources.buyBoxHeaderMessageText,\r\n freePriceText: resources.priceFree,\r\n originalPriceText: resources.originalPriceText,\r\n currentPriceText: resources.currentPriceText\r\n };\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: true\r\n };\r\n\r\n const isLoading = props.data.productAvailableQuantity.status === 'LOADING';\r\n if (isLoading) {\r\n props.callbacks.changeUpdatingDimension(false);\r\n }\r\n\r\n const isLoadingDeliveryOptions = typeName !== 'quickview' && props.data.deliveryOptions?.status === 'LOADING';\r\n if (isLoadingDeliveryOptions && props.callbacks.changeUpdatingDeliveryOptions) {\r\n props.callbacks.changeUpdatingDeliveryOptions(false);\r\n }\r\n\r\n telemetryContent = getTelemetryObject(props.context.request.telemetryPageName!, props.friendlyName, props.telemetry);\r\n\r\n // check if the product delivery mode is electronic\r\n const emailDeliveryModeCode = props.context.actionContext.requestContext.channel?.EmailDeliveryModeCode;\r\n const deliveryOptions = props.data.deliveryOptions?.result;\r\n const isEmailDelivery =\r\n deliveryOptions &&\r\n deliveryOptions.DeliveryOptions &&\r\n ArrayExtensions.hasElements(deliveryOptions.DeliveryOptions) &&\r\n deliveryOptions.DeliveryOptions[0].Code === emailDeliveryModeCode;\r\n\r\n const successfulATC = props.state.successfulATC;\r\n\r\n return {\r\n ContainerProps: {\r\n className: 'ms-buybox__add-to-cart-container'\r\n },\r\n button: product && (\r\n <>\r\n \r\n \r\n ),\r\n errorBlock: (\r\n \r\n )\r\n };\r\n}\r\n\r\nconst _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\nconst _isOrderQuantityLimitsFeatureEnabled = (props: IBuyboxViewPropsExtended): boolean | undefined => {\r\n const defaultOrderQuantityLimitsFeatureConfig = props.context?.request?.app?.platform?.enableDefaultOrderQuantityLimits;\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'none') {\r\n return false;\r\n }\r\n\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'all') {\r\n return true;\r\n }\r\n\r\n const customerInfo = props.data.customerInformation.result;\r\n return (\r\n customerInfo &&\r\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\r\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b))\r\n );\r\n};\r\n","import React from 'react';\r\nimport { Node } from '@msdyn365-commerce-modules/utilities';\r\nimport {\r\n IBuyboxAddToCartViewProps\r\n} from '@msdyn365-commerce-modules/buybox';\r\nimport { IBuyboxViewPropsExtended } from '../types';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { mfrmgetBuyboxAddToCart } from './addtocart';\r\n\r\nexport const BuyboxAddToCart = (props:{\r\n addToCart: IBuyboxAddToCartViewProps,\r\n buyboxProps: IBuyboxViewPropsExtended,\r\n variantOutOfStock: boolean,\r\n itemOutOfMarket: boolean,\r\n outOfStockSmallParcelState: boolean,\r\n adjustableItem: SimpleProduct | undefined,\r\n pillow: SimpleProduct | undefined,\r\n protector: SimpleProduct | undefined\r\n}): JSX.Element => {\r\n const {addToCart, buyboxProps, variantOutOfStock, itemOutOfMarket, outOfStockSmallParcelState, adjustableItem, pillow, protector} = props;\r\n const { ContainerProps } = addToCart;\r\n const mfrmDefaultMinimumKeyInPrice = 10;\r\n const mfrmDefaultMaximumKeyInPrice = 100;\r\n // tslint:disable-next-line:max-line-length\r\n const mfrmAddToCart = mfrmgetBuyboxAddToCart(\r\n buyboxProps,\r\n mfrmDefaultMinimumKeyInPrice,\r\n mfrmDefaultMaximumKeyInPrice,\r\n variantOutOfStock,\r\n itemOutOfMarket,\r\n outOfStockSmallParcelState,\r\n adjustableItem,\r\n pillow,\r\n protector\r\n ); // mfrmgetBuyboxAddToCart(props, props.state, props.callbacks, mfrmDefaultMinimumKeyInPrice, mfrmDefaultMaximumKeyInPrice);\r\n\r\n return (\r\n \r\n {mfrmAddToCart && mfrmAddToCart.errorBlock}\r\n {mfrmAddToCart && mfrmAddToCart.button}\r\n \r\n );\r\n};\r\n","import React from 'react';\r\nimport { Node } from '@msdyn365-commerce-modules/utilities';\r\nimport { IBuyboxViewPropsExtended } from '../types';\r\n\r\nexport const BuyboxViewCartLink = (props: IBuyboxViewPropsExtended) => {\r\n return (\r\n \r\n \r\n \r\n {props.resources.viewCartLinkText}\r\n \r\n \r\n \r\n );\r\n};","import React from 'react';\r\n\r\nexport const BuyboxSocialShare = (props: {socialShare: React.ReactNode[]}): JSX.Element | null => {\r\n const { socialShare } = props;\r\n if (!socialShare || socialShare?.length === 0) {\r\n return null;\r\n }\r\n\r\n return <>{socialShare[0]};\r\n};\r\n","import React from 'react';\r\nimport { Node } from '@msdyn365-commerce-modules/utilities';\r\nimport {\r\n IBuyboxFindInStoreViewProps\r\n} from '@msdyn365-commerce-modules/buybox';\r\n\r\nexport const BuyboxFindInStore = (props: IBuyboxFindInStoreViewProps): JSX.Element => {\r\n const {\r\n ContainerProps,\r\n storeSelector,\r\n heading,\r\n description,\r\n errors,\r\n button,\r\n modal,\r\n productPickupOptionList\r\n } = props;\r\n\r\n return (\r\n \r\n {storeSelector}\r\n {heading}\r\n {productPickupOptionList}\r\n {description}\r\n {errors}\r\n {button}\r\n {modal}\r\n \r\n );\r\n};","import * as React from 'react';\r\nimport { Node } from '@msdyn365-commerce-modules/utilities';\r\nimport { RichText, RichTextComponent } from '@msdyn365-commerce/core';\r\n\r\nexport interface ISleepExpertSummaryComponentProps {\r\n sleepExpertOpinionHeadingText : RichText,\r\n sleepExpertSummaryText?:string;\r\n }\r\nexport const SleepExpertSummaryComponent: React.FC = ({sleepExpertOpinionHeadingText,sleepExpertSummaryText}) => {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n {sleepExpertSummaryText}\r\n \r\n \r\n );\r\n};\r\n\r\nexport default SleepExpertSummaryComponent;","import React from 'react';\r\nimport { IBuyboxViewPropsExtended } from '../types';\r\nimport { SleepExpertSummaryComponent } from '../../../themes/mattressfirm/custom-components/sleep-expert-summary-component';\r\n\r\n\r\nexport const BuyboxSleepExpertSummary = (props:{buyboxProps: IBuyboxViewPropsExtended, sleepExpertSummaryText: string | undefined}): JSX.Element => {\r\n const {buyboxProps, sleepExpertSummaryText} = props;\r\n const sleepExpertOpinionHeadingText = buyboxProps.config.sleepExpertOpinionHeadingText ?? '';\r\n return sleepExpertSummaryText ? (\r\n \r\n ) : (\r\n <>\r\n );\r\n};","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All rights reserved. See License.txt in the project root for license information.\r\n * IMfrmBuybox containerModule Interface Properties\r\n * THIS FILE IS AUTO-GENERATED - MANUAL MODIFICATIONS WILL BE LOST\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport * as React from 'react';\r\n\r\nexport const enum titleHeadingTag {\r\n h1 = 'h1',\r\n h2 = 'h2',\r\n h3 = 'h3',\r\n h4 = 'h4',\r\n h5 = 'h5',\r\n h6 = 'h6'\r\n}\r\n\r\nexport interface IMfrmBuyboxConfig extends Msdyn365.IModuleConfig {\r\n showBVRatings?: boolean;\r\n eComDisplayColorAsDropDown?: string;\r\n eComDisplayColorLabel?: string;\r\n titleHeadingTag?: titleHeadingTag;\r\n className?: string;\r\n variantNameMapping?: IVariantNameMappingData[];\r\n enableShopSimilarLooks?: boolean;\r\n renderOOBMediaGallery?: boolean;\r\n enableShopSimilarDescription?: boolean;\r\n enableKeyInPrice?: boolean;\r\n minimumKeyInPrice?: number;\r\n maximumKeyInPrice?: number;\r\n callChatPhoneNumber?: string;\r\n callChatMessage?: string;\r\n productId?: string;\r\n progressiveLeasingEstimator?: IProgressiveLeasingEstimatorData;\r\n targetAudienceGroup?: string;\r\n enableVariantSelectionRedesign?: boolean;\r\n cSatRatingHeadingText?: string;\r\n cSatRatingPopoverText?: string;\r\n sleepExpertOpinionHeadingText?: Msdyn365.RichText;\r\n}\r\n\r\nexport interface IMfrmBuyboxResources {\r\n closeNotificationLabel: string;\r\n findInStoreNotAvailableTextButton: string;\r\n findInStoreNotAvailableDescription: string;\r\n findInStoreLinkText: string;\r\n findInStoreHeaderText: string;\r\n findInStoreDescriptionText: string;\r\n priceFree: string;\r\n originalPriceText: string;\r\n currentPriceText: string;\r\n addToCartText: string;\r\n addToCartProductsText: string;\r\n viewCartLinkText: string;\r\n outOfStockText: string;\r\n averageRatingAriaLabel: string;\r\n selectDimensionFormatString: string;\r\n productDimensionTypeColor: string;\r\n productDimensionTypeConfiguration: string;\r\n productDimensionTypeSize: string;\r\n productDimensionTypeStyle: string;\r\n productDimensionTypeAmount: string;\r\n createOrderTemplateHeader: string;\r\n orderTemplateTitle: string;\r\n orderTemplateNameAriaLabel: string;\r\n createOrderTemplateDescription: string;\r\n createNewOrderTemplateButtonText: string;\r\n createOrderTemplateButtonText: string;\r\n cancelNewOrderTemplateCreationButtonText: string;\r\n defaultOrderTemplateName: string;\r\n addToOrderTemplateHeader: string;\r\n addToOrderTemplateButtonTooltip: string;\r\n noOrderTemplatesMessage: string;\r\n noOrderTemplatesDescription: string;\r\n createAnOrderTemplateButtonText: string;\r\n cancelOrderTemplateCreationButtonText: string;\r\n selectTemplatesText: string;\r\n addToTemplateButtonText: string;\r\n lineItemsText: string;\r\n addToOrderTemplateButtonText: string;\r\n addToOrderTemplateMessage: string;\r\n addItemToOrderTemplateError: string;\r\n viewOrderTemplateButtonText: string;\r\n continueShoppingButtonText: string;\r\n itemAddedToOrderTemplateHeaderItemOneText: string;\r\n itemAddedToOrderTemplateHeaderItemFormatText: string;\r\n itemAddedToOrderTemplateHeaderMessageText: string;\r\n duplicatedProductsHeader: string;\r\n duplicatedProductsDescription: string;\r\n updateQuantityButtonText: string;\r\n cancelDuplicateItemsButtonText: string;\r\n addToWishlistButtonText: string;\r\n removeFromWishlistButtonText: string;\r\n nameOfWishlist: string;\r\n inputQuantityAriaLabel: string;\r\n addToWishlistMessage: string;\r\n removedFromWishlistMessage: string;\r\n addItemToWishlistError: string;\r\n removeItemFromWishlistError: string;\r\n productQuantityHeading: string;\r\n errorMessageOutOfStock: string;\r\n errorMessageOutOfRangeOneLeft: string;\r\n errorMessageOutOfRangeFormat: string;\r\n productDimensionTypeColorErrorMessage: string;\r\n productDimensionTypeConfigurationErrorMessage: string;\r\n productDimensionTypeSizeErrorMessage: string;\r\n productDimensionTypeStyleErrorMessage: string;\r\n productDimensionTypeAmountErrorMessage: string;\r\n buyboxErrorMessageHeader: string;\r\n addedToCartFailureMessage: string;\r\n maxQuantityLimitText: string;\r\n invalidSmallCustomAmountText: string;\r\n invalidLargeCustomAmountText: string;\r\n shopSimilarLooksText: string;\r\n shopSimilarDescriptionText: string;\r\n buyBoxGoToCartText: string;\r\n buyBoxContinueShoppingText: string;\r\n buyBoxSingleItemText: string;\r\n buyBoxMultiLineItemFormatText: string;\r\n buyBoxHeaderMessageText: string;\r\n maxQuantityText: string;\r\n minQuantityText: string;\r\n addedQuantityText: string;\r\n buyboxKeyInPriceLabelHeading: string;\r\n descriptionTextToShowAllPickupOptions: string;\r\n availableInStoresText: string;\r\n notAvailableInStoresText: string;\r\n availableInStoresTextV2: string;\r\n notAvailableInStoresTextV2: string;\r\n onlineOnlyProductsText: string;\r\n deliveryBy: string;\r\n changeZipCode: string;\r\n enterZipCode: string;\r\n mfrmOutOfStockText: string;\r\n mfrmContinueShoppingText: string;\r\n mfrmInvalidZipCode: string;\r\n informationIconText: string;\r\n priceRangeSeparator: string;\r\n bulkPurchaseLinkText: string;\r\n viewStoreDetailsText: string;\r\n changeStoreText: string;\r\n storeOpenAtHours: string;\r\n storeCloseAtHours: string;\r\n storeHoursClosedText: string;\r\n swatchItemAriaLabel: string;\r\n salesAgreementPricePrompt: string;\r\n salesAgreementExpirationDatePrompt: string;\r\n salesAgreementCommittedQuantityPrompt: string;\r\n salesAgreementRemainingQuantityPrompt: string;\r\n}\r\n\r\nexport interface IVariantNameMappingData {\r\n originalVariantName?: string;\r\n customizedVariantName?: string;\r\n}\r\n\r\nexport const enum ProgressiveLeasingEstimatorRequestType {\r\n pdp = 'pdp',\r\n checkoutPdp = 'checkoutPdp'\r\n}\r\n\r\nexport const enum ProgressiveLeasingEstimatorPayFrequency {\r\n weekly = 'weekly',\r\n biWeekly = 'biWeekly',\r\n semiMonthly = 'semiMonthly',\r\n monthly = 'monthly'\r\n}\r\n\r\nexport interface IProgressiveLeasingEstimatorData {\r\n infoText: string;\r\n progressiveLogo?: Msdyn365.IImageData;\r\n estimatorLink?: IEstimatorLinkData;\r\n requestType: ProgressiveLeasingEstimatorRequestType;\r\n payFrequency: ProgressiveLeasingEstimatorPayFrequency;\r\n storeId: string;\r\n approveMeName?: string;\r\n approveMeSlugValue?: string;\r\n}\r\n\r\nexport interface IEstimatorLinkData {\r\n linkText?: string;\r\n linkUrl: Msdyn365.ILinkData;\r\n ariaLabel?: string;\r\n openInNewTab?: boolean;\r\n}\r\n\r\nexport interface IMfrmBuyboxProps extends Msdyn365.IModule {\r\n resources: IMfrmBuyboxResources;\r\n config: IMfrmBuyboxConfig;\r\n slots: {\r\n mediaGallery: React.ReactNode[];\r\n storeSelector: React.ReactNode[];\r\n textBlocks: React.ReactNode[];\r\n socialShare: React.ReactNode[];\r\n mfrmStoreSelector: React.ReactNode[];\r\n mfrmMediaGallery: React.ReactNode[];\r\n additionalModules: React.ReactNode[];\r\n stylesAndDisruptorsModules: React.ReactNode[];\r\n completeYourBed: React.ReactNode[];\r\n chooseYourFoundationModule: React.ReactNode[];\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 { Modal, ModalBody, ModalHeader } from '@msdyn365-commerce-modules/utilities';\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nimport React, { useEffect, useState } from 'react';\r\n\r\nimport { fireAnalyticsLink } from '../../../Utilities/analytics/clickTrack';\r\nimport {\r\n IProgressiveLeasingEstimatorData,\r\n ProgressiveLeasingEstimatorPayFrequency,\r\n ProgressiveLeasingEstimatorRequestType\r\n} from '../mfrm-buybox.props.autogenerated';\r\n\r\nexport interface IMfrmProgressiveLeasingEstimatorProps {\r\n progressiveLeasingEstimator: IProgressiveLeasingEstimatorData;\r\n productPrice: number;\r\n ctx: Msdyn365.IRequestContext;\r\n isLeaseActive: boolean;\r\n}\r\n\r\nexport const MfrmProgressiveLeasingEstimator: React.FC = props => {\r\n const { infoText, estimatorLink } = props.progressiveLeasingEstimator;\r\n const [isOpen, setModalStatus] = useState(false);\r\n let estimatorUrl = buildEstimatorURL(props.progressiveLeasingEstimator, props.productPrice);\r\n // If MSFT suggests us to use imageSettings, we will uncomment this piece of code (linked to line : 73)\r\n // const imageProps = {\r\n // gridSettings: props.ctx.gridSettings || {},\r\n // imageSettings: progressiveLogo && progressiveLogo.imageSettings,\r\n // };\r\n\r\n const _openModal = (e: React.MouseEvent) => {\r\n if (!props.isLeaseActive) {\r\n e.preventDefault();\r\n } else {\r\n fireAnalyticsLink({\r\n eventName: 'internal navigation',\r\n eventCategory: 'internal links',\r\n eventAction: 'to: Progressive Leasing modal',\r\n eventLabel: `from PDP financing “${estimatorLink?.linkText}” link`,\r\n eventNoninteraction: 'false'\r\n });\r\n setModalStatus(true);\r\n }\r\n };\r\n\r\n const _closeModal = () => {\r\n setModalStatus(false);\r\n };\r\n\r\n useEffect(() => {\r\n const iframe = Msdyn365.msdyn365Commerce.isBrowser && document.querySelector('.msc-modal__iframe');\r\n if (iframe) {\r\n if (!isOpen) {\r\n (iframe as HTMLIFrameElement).src = 'about:blank';\r\n } else {\r\n (iframe as HTMLIFrameElement).src = estimatorUrl!;\r\n }\r\n }\r\n }, [isOpen]);\r\n\r\n useEffect(() => {\r\n estimatorUrl = buildEstimatorURL(props.progressiveLeasingEstimator, props.productPrice);\r\n }, [props.productPrice]);\r\n\r\n return (\r\n <>\r\n
\r\n
or {infoText?.replace(/\\u2028/, '')}\r\n \r\n {estimatorLink?.linkText || 'Link'}\r\n \r\n \r\n \r\n \r\n
\r\n
\r\n \r\n \r\n {/* // TODO: Remove the hardcoding once MSFT fixes the issue with imageSettings */}\r\n {/* */}\r\n \r\n {
\r\n
\r\n \r\n );\r\n};\r\n\r\nconst buildEstimatorURL = (progressiveLeasingEstimator: IProgressiveLeasingEstimatorData, itemCost: number) => {\r\n const { storeId, estimatorLink, requestType, payFrequency, approveMeName, approveMeSlugValue } = progressiveLeasingEstimator;\r\n\r\n // base url\r\n const estimatorURL =\r\n (estimatorLink &&\r\n estimatorLink.linkUrl &&\r\n estimatorLink.linkUrl.destinationUrl &&\r\n new URL(estimatorLink.linkUrl.destinationUrl?.replace('#', '%23'))) ||\r\n undefined;\r\n\r\n // add params\r\n const requestTypeValue = getRequestType(requestType);\r\n requestTypeValue && estimatorURL?.searchParams.append('requestType', requestTypeValue);\r\n\r\n const payFrequencyValue = getPayFrequency(payFrequency);\r\n payFrequencyValue && estimatorURL?.searchParams.append('payFrequency', payFrequencyValue);\r\n\r\n estimatorURL?.searchParams.append('storeId', storeId);\r\n estimatorURL?.searchParams.append('itemCost', itemCost.toString());\r\n\r\n approveMeName && estimatorURL?.searchParams.append('approveMeName', approveMeName);\r\n approveMeSlugValue && estimatorURL?.searchParams.append('approveMeSlugValue', approveMeSlugValue);\r\n\r\n const stateCode = getStateCode();\r\n stateCode && estimatorURL?.searchParams.append('stateCode', stateCode);\r\n\r\n return estimatorURL ? decodeURIComponent(estimatorURL.href) : undefined;\r\n};\r\n\r\nconst getRequestType = (type: ProgressiveLeasingEstimatorRequestType) => {\r\n switch (type) {\r\n case ProgressiveLeasingEstimatorRequestType.pdp:\r\n return 'pdp';\r\n case ProgressiveLeasingEstimatorRequestType.checkoutPdp:\r\n return 'checkout-pdp';\r\n default:\r\n return undefined;\r\n }\r\n};\r\n\r\nconst getPayFrequency = (frequency: ProgressiveLeasingEstimatorPayFrequency) => {\r\n switch (frequency) {\r\n case ProgressiveLeasingEstimatorPayFrequency.weekly:\r\n return 'weekly';\r\n case ProgressiveLeasingEstimatorPayFrequency.biWeekly:\r\n return 'biWeekly';\r\n case ProgressiveLeasingEstimatorPayFrequency.semiMonthly:\r\n return 'semiMonthly';\r\n case ProgressiveLeasingEstimatorPayFrequency.monthly:\r\n return 'monthly';\r\n default:\r\n return undefined;\r\n }\r\n};\r\n\r\n// TODO: will use MaxMind Geolocation to get state code in the future\r\nconst getStateCode = (): string | undefined => {\r\n const prefferedStoreData = localStorage.getItem('_mfrm__prefferedStore_');\r\n const parsedPrefferedStoreData = prefferedStoreData && JSON.parse(prefferedStoreData);\r\n\r\n return parsedPrefferedStoreData?.State;\r\n};\r\n","import React from 'react';\r\nimport { IProgressiveLeasingEstimatorData } from '../mfrm-buybox.props.autogenerated';\r\nimport {\r\n IRequestContext\r\n} from '@msdyn365-commerce/core';\r\nimport { MfrmProgressiveLeasingEstimator } from './progressive-leasing-estimator';\r\n\r\nexport const BuyboxProgressiveLeasingEstimator = (\r\n props: {\r\n progressiveLeasingEstimator: IProgressiveLeasingEstimatorData,\r\n productPrice: number,\r\n ctx: IRequestContext,\r\n leaseState: boolean\r\n }\r\n): JSX.Element | null => {\r\n const {\r\n progressiveLeasingEstimator,\r\n productPrice,\r\n ctx,\r\n leaseState\r\n } = props;\r\n return (\r\n \r\n );\r\n};\r\n","import React from 'react';\r\nimport { FinancingPerMonthComponent } from '../../../themes/mattressfirm/custom-components/financing-per-month-component';\r\nimport { IBuyboxViewPropsExtended } from '../types';\r\nimport { IMfrmBuyboxProps } from '../mfrm-buybox.props.autogenerated';\r\nimport { IMfrmBuyBoxData } from '../mfrm-buybox.view';\r\n\r\nexport const BuyboxFinancingPerMonth = (\r\n props:{\r\n buyboxProps: IBuyboxViewPropsExtended & IMfrmBuyboxProps,\r\n originalPrice: number | undefined,\r\n discountValue: number | undefined,\r\n productPrice: number | undefined,\r\n categoryName: string | undefined,\r\n activeVariantId: number | undefined,\r\n productId: number | undefined,\r\n activeColorVariantId: number | undefined,\r\n isLoadedPriceComponent: boolean | undefined,\r\n parentCategory?: string | undefined\r\n }\r\n): JSX.Element => {\r\n const {\r\n buyboxProps,\r\n originalPrice,\r\n discountValue,\r\n productPrice,\r\n categoryName,\r\n activeVariantId,\r\n productId,\r\n activeColorVariantId,\r\n isLoadedPriceComponent,\r\n parentCategory\r\n } = props;\r\n const percentageDiscount = discountValue && originalPrice && (discountValue / originalPrice) * 100;\r\n return (\r\n \r\n );\r\n};","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport { IStoreSelectorStateManager } from '@msdyn365-commerce-modules/bopis-utilities';\r\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\n// VSI Customization - end\r\nimport {\r\n HtmlHeadInclude,\r\n IImageData,\r\n ILinkData,\r\n RichTextComponent\r\n} from '@msdyn365-commerce/core';\r\nimport { ICategoryUrl } from '@msdyn365-commerce/core-internal/dist/types/interfaces/ICategoryPathInterfaces';\r\n// VSI Customization - starts\r\nimport { AsyncResult, AttributeValue, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { Dayjs } from 'dayjs';\r\nimport * as React from 'react';\r\nimport getHtmlParserValue from '../../Utilities/get-html-parser-value';\r\nimport { IBuyboxGetDimensionVariantAvailabilityActionData } from '../../data-actions/buybox-get-dimension-variants-availability-action';\r\nimport { IStoreSelectorState } from '../../data-actions/store-selector-state';\r\nimport _getDeliveryByMessage from '../../Utilities/get-delivery-by-message';\r\n\r\n/** VSI Customization - Start */\r\nimport _getInventoryQuantity from '../../Utilities/get-inventory-quantity';\r\nimport { BuyboxProductConfigureMfrm } from './components/buybox-product-configure-mfrm';\r\n/** VSI Customization - End */\r\nimport { IBuyboxViewPropsExtended } from './types';\r\nimport { IMfrmBuyboxData } from './mfrm-buybox.data';\r\nimport { IBuyboxGetDimensionPricingActionData } from '../../data-actions/buybox-get-dimension-pricing-action';\r\n\r\nimport CustomSkeleton from '../../themes/mattressfirm/custom-components/CustomSkeleton';\r\n\r\nimport { BuyboxCallChat } from './components/buybox-call-chat';\r\nimport { BuyboxAddToCart } from './components/buybox-add-to-cart';\r\nimport { BuyboxViewCartLink } from './components/buybox-view-cart-link';\r\nimport { BuyboxSocialShare } from './components/buybox-social-share';\r\nimport { BuyboxFindInStore } from './components/buybox-find-in-store';\r\nimport { BuyboxSleepExpertSummary } from './components/buybox-sleep-expert-summary';\r\nimport { BuyboxProgressiveLeasingEstimator } from './components/buybox-progressive-leasing-estimator';\r\nimport { BuyboxFinancingPerMonth } from './components/buybox-financing-per-month';\r\nimport { BuyboxDeliveryByMessage } from './components/buybox-devliery-by-message';\r\nimport { _smallParcelProductATPCallForInventoryStatus } from '../../Utilities/mfrm-buybox-utils';\r\nimport { ErrorBoundary } from '../../common/components/error-boundary';\r\nimport useVwoClientInstance from '../../common/hooks/useVwoClientInstance';\r\n\r\n// TODO: remove this interface and all references to it\r\nexport interface IMfrmBuyBoxData extends IMfrmBuyboxData {\r\n productSpecificationData: AsyncResult;\r\n dimensionPrices: AsyncResult;\r\n allVariants: AsyncResult;\r\n storeSelectorStateManager: AsyncResult;\r\n storeSelectorState: AsyncResult;\r\n categoryPaths: AsyncResult;\r\n allProductVariants: AsyncResult;\r\n}\r\n\r\nexport interface IBrandLinkData {\r\n linkText?: string;\r\n linkUrl: ILinkData;\r\n ariaLabel?: string;\r\n openInNewTab?: boolean;\r\n}\r\n\r\nexport interface IVariantStockInfo {\r\n VariantRecID: number;\r\n OutOfStock: boolean;\r\n}\r\n\r\nexport interface IBrandListData {\r\n brandName: string;\r\n brandLogo: IImageData;\r\n logoHeight?: number;\r\n brandLink?: IBrandLinkData;\r\n brandLeadtime?: string;\r\n}\r\n\r\nexport interface IMfrmAtpMessage {\r\n Message?: string;\r\n}\r\n\r\nexport interface IBadgeData {\r\n src: string;\r\n alt: string;\r\n start: Dayjs;\r\n end: Dayjs;\r\n}\r\n\r\nconst setActiveSwatchSelected = (\r\n variantID: number,\r\n outOfStock: boolean,\r\n setOutOfStock: (outOfStock: boolean) => void,\r\n avList: IBuyboxGetDimensionVariantAvailabilityActionData[]\r\n): void => {\r\n if (variantID < 0) {\r\n return;\r\n }\r\n if (avList?.length) {\r\n for (let variantsIDIter = 0; variantsIDIter < avList.length; variantsIDIter++) {\r\n if (avList[variantsIDIter].variantID === variantID) {\r\n if (outOfStock !== !avList[variantsIDIter].isAvailable) {\r\n setOutOfStock(!avList[variantsIDIter].isAvailable);\r\n }\r\n return;\r\n }\r\n }\r\n }\r\n};\r\n\r\n// tslint:disable-next-line\r\nconst BuyboxView: React.FC = props => {\r\n const {\r\n ModuleProps,\r\n MediaGalleryContainerProps,\r\n ProductInfoContainerProps,\r\n addToCart,\r\n /*addToWishlist,*/\r\n findInStore,\r\n title,\r\n inventoryLabel,\r\n shopSimilarLook,\r\n keyInPrice,\r\n /*addToOrderTemplate*/\r\n productBadges,\r\n ratingComponent,\r\n tryInStoreComponent,\r\n promotionalMessage,\r\n customerSatisfactionScore,\r\n adjustableItem,\r\n pillow,\r\n protector,\r\n config: {\r\n progressiveLeasingEstimator,\r\n renderOOBMediaGallery\r\n },\r\n slots: { mfrmStoreSelector, mediaGallery, mfrmMediaGallery, additionalModules, stylesAndDisruptorsModules, chooseYourFoundationModule, completeYourBed },\r\n data: { product, productSpecificationData, categoryPaths: { result } }\r\n } = props;\r\n {\r\n /* VSI Customization - START */\r\n }\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 dimensionRows = parentCategory === 'pillows' ? 1 : 2;\r\n const AttributeValues = productSpecificationData.result;\r\n const productPrice = props.state.productPrice?.CustomerContextualPrice;\r\n const originalPrice = props.state.productPrice?.AdjustedPrice;\r\n const discountValue = props.state.productPrice?.DiscountAmount;\r\n const productId = props.state.productPrice?.ProductId;\r\n const productIdPrefix = (props.app.config.productIdPrefix && props.app.config.productIdPrefix?.trim()) || '';\r\n const mfrmProductId = product.result?.ItemId ? `${productIdPrefix}${product.result?.ItemId}` : null;\r\n const [isLeaseActive, setLeasingButtonActive] = React.useState(true);\r\n const [activeVariantId, setActiveVariantId] = React.useState(productId);\r\n const [activeColorVariantId, setActiveColorVariantId] = React.useState(productId);\r\n const [outOfStockSmallParcelState, SetoutOfStockSmallParcelState] = React.useState(false);\r\n // call/chat product\r\n const isCallChatProduct = productSpecificationData.result?.find(attr => attr.Name?.trim().toLowerCase() === 'call/chat only')\r\n ?.BooleanValue;\r\n const sleepExpertSummaryText = productSpecificationData.result?.find(attr => attr.Name?.trim().toLowerCase() === 'sleep expert opinion')\r\n ?.TextValue;\r\n const tagsArr = _getBuyboxSEOMetaTags(AttributeValues);\r\n const [itemOutOfMarket, setItemOutOfMarket] = React.useState(false);\r\n const [variantOutOfStock, setVariantOutOfStock] = React.useState(false);\r\n const setActiveVariant = async (variantID: number) => {\r\n setActiveColorVariantId(variantID);\r\n setActiveSwatchSelected(variantID, variantOutOfStock, setVariantOutOfStock, props.state.variantAvailibilityList);\r\n if (outOfStockSmallParcelState) {\r\n await _smallParcelProductATPCallForInventoryStatus(props, props.data.product.result!.RecordId, props.data.product.result!.ItemId, SetoutOfStockSmallParcelState, true).then().catch();\r\n }\r\n };\r\n const categoryName = props.data.listPageStateBuyBox.result?.categoryName;\r\n const propsWithLeasingState = {\r\n ...props,\r\n setLeasingButtonActive,\r\n variantAvailibilityList: props.state.variantAvailibilityList,\r\n setActiveVariant,\r\n outOfStockSmallParcelState,\r\n setActiveVariantId\r\n };\r\n const renderDimensions = BuyboxProductConfigureMfrm(propsWithLeasingState);\r\n const showViewCartLink = props.showViewCartLink;\r\n /* VSI Customization - END */\r\n const isLoadedPriceComponent = (productPrice && (activeVariantId === product.result?.RecordId || activeColorVariantId === productId)) ? true : false;\r\n const isLoadedprogressiveLeasingEstimator = progressiveLeasingEstimator && productPrice ? true : false;\r\n // VWO Tracking\r\n const {vwoAccountId, vwoSdkKey} = props.app.config;\r\n if( vwoAccountId && vwoSdkKey ){\r\n const [ vwoClientInstance, vwoUserId ] = useVwoClientInstance(vwoAccountId, vwoSdkKey );\r\n if( vwoClientInstance ){\r\n const campaignKey = null;\r\n const userId = vwoUserId;\r\n vwoClientInstance.track(campaignKey, userId, 'pdpPageviews');\r\n }\r\n }\r\n\r\n return (\r\n \r\n {/* VSI Customization - START - 6432 */}\r\n \r\n {tagsArr?.map(\r\n (tag, index) =>\r\n tag?.content && \r\n )}\r\n \r\n\r\n {/* VSI Customization - END - 6432 */}\r\n \r\n {/* VSI Customization - START */}\r\n {productBadges}\r\n {/* VSI Customization - END */}\r\n {renderOOBMediaGallery ? mediaGallery : mfrmMediaGallery}\r\n \r\n\r\n {/* VSI Customization - END */}\r\n \r\n {/* VSI Customization - START */}\r\n \r\n {customerSatisfactionScore}\r\n {/* VSI Customization - END */}\r\n {title}\r\n {/* VSI Customization - START */}\r\n \r\n {mfrmProductId && (\r\n \r\n {mfrmProductId}\r\n \r\n )}\r\n {!props.context.app.config.hideRating && ratingComponent}\r\n \r\n {/* Financing Per Month Redesign code starts here */}\r\n { }\r\n {!isLoadedPriceComponent ?\r\n <>\r\n \r\n \r\n \r\n : \r\n }\r\n {isLoadedprogressiveLeasingEstimator ? (progressiveLeasingEstimator &&\r\n productPrice &&\r\n ) ||\r\n null : }\r\n {/* Financing Per Month Redesign code ends here */}\r\n {/*TODO: What is this*/}\r\n {inventoryLabel}\r\n {(props.state.isEyeBrowLoading) ? :\r\n }\r\n {/*Delivery By Message and Try In-store Redesign code starts here */}\r\n
\r\n \r\n {' '}\r\n {props.state.isStoreLoading ? : tryInStoreComponent}\r\n
\r\n {/*Delivery By Message and Try In-store Redesign code starts here */}\r\n {!props.state.currentProductDimensions?.length && <>\r\n \r\n
\r\n {[...Array(dimensionRows * 3)].map((i, x) => )}\r\n
\r\n \r\n
\r\n {[...Array(1 * 3)].map((i, x) => )}\r\n
}\r\n {renderDimensions}\r\n {chooseYourFoundationModule}\r\n {categoryName === \"Mattresses\" && completeYourBed}\r\n {/*TODO: What is this*/}\r\n {keyInPrice}\r\n <>\r\n {isCallChatProduct\r\n ? \r\n : addToCart &&\r\n }\r\n {showViewCartLink ? : null}\r\n \r\n {/*TODO: What is this*/}\r\n {findInStore && }\r\n
\r\n \r\n {shopSimilarLook}\r\n {mfrmStoreSelector?.[0]}\r\n {additionalModules}\r\n \r\n
\r\n {stylesAndDisruptorsModules}\r\n
\r\n
\r\n
\r\n );\r\n };\r\n\r\n{\r\n /* VSI Customization - START - 6432 */\r\n}\r\n\r\nconst _getBuyboxSEOMetaTags = (attributeValues: AttributeValue[] | undefined) => {\r\n const pageKeywords = _getSEOMetaTagValue(attributeValues, 'pageKeywords');\r\n const pageKeywordsParser = pageKeywords && getHtmlParserValue(pageKeywords);\r\n\r\n return [{ content: pageKeywordsParser?.toString(), name: 'keywords' }];\r\n};\r\n\r\nconst _getSEOMetaTagValue = (attributeValues: AttributeValue[] | undefined, keyValue: string) => {\r\n return attributeValues?.find(currAttribute => currAttribute.Name?.toLowerCase().trim() === keyValue?.toLowerCase().trim())?.TextValue;\r\n};\r\n\r\n\r\n{\r\n /* VSI Customization - END - 6432 */\r\n}\r\n\r\nexport default BuyboxView;\r\n","import { Node } from '@msdyn365-commerce-modules/utilities';\r\nimport { ProductDimensionValue } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport * as React from 'react';\r\nimport { IBuyboxGetDimensionPricingActionData } from '../../../data-actions/buybox-get-dimension-pricing-action';\r\nimport { IBuyboxGetDimensionVariantAvailabilityActionData } from '../../../data-actions/buybox-get-dimension-variants-availability-action';\r\nimport { fireAnalyticsLink } from '../../../Utilities/analytics/clickTrack';\r\nimport _getViewPort from '../../../Utilities/get-view-port';\r\nimport { _getActivePrices } from '../../../Utilities/mfrm-buybox-utils';\r\nimport { IBuyboxViewPropsExtended } from '../types';\r\nimport { IMfrmBuyboxProps } from '../mfrm-buybox.props.autogenerated';\r\nimport { IMfrmBuyBoxData } from '../mfrm-buybox.view';\r\nimport { BuyBoxSizeComponent } from './buybox-size-component';\r\nimport { BuyBoxSizeRedesignComponent } from './buybox-size-redesign-component';\r\nimport { Dropdown } from './dropdown/dropdown';\r\nimport { IDropdownItemProps } from './dropdown/dropdown.props';\r\nimport Listing from './listing';\r\nimport { HeightFoundationComponent } from './buybox-height-foundation-redesign-component';\r\n\r\nexport interface INotificationData {\r\n dropdownId: string;\r\n selectId: string;\r\n selectedValue: string;\r\n}\r\nexport interface IModalDimensions {\r\n selectId: string;\r\n selectedValue: string;\r\n dropdownId: string;\r\n dimensionPrice?: number;\r\n discountAmount?: number;\r\n percentDiff?: string;\r\n dimensionLabel?: string;\r\n}\r\n\r\nexport interface IProgressiveLeasingState {\r\n setLeasingButtonActive: React.Dispatch>;\r\n}\r\nexport interface IVariantAvailabilityProps {\r\n variantAvailibilityList: IBuyboxGetDimensionVariantAvailabilityActionData[];\r\n}\r\n\r\nexport interface IVariantSelected {\r\n setActiveVariant(variantID: number): void;\r\n}\r\n\r\nexport interface IFinancingPerMonthCallbacks {\r\n setActiveVariantId(selectedVariantId: number | undefined): void;\r\n}\r\n\r\n// tslint:disable-next-line: max-func-body-length\r\nexport const BuyboxProductConfigureMfrm: React.FC &\r\n IProgressiveLeasingState &\r\n IVariantAvailabilityProps &\r\n IVariantSelected &\r\n IFinancingPerMonthCallbacks> = props => {\r\n const [sizeVariantsLength, setSizeVariantsLength] = React.useState(0);\r\n const [isOpen, setIsOpen] = React.useState(false); // modal toggle state\r\n const [isMobile, setisMobile] = React.useState(false);\r\n const [selectedDisplayLabel, setselectedDisplayLabel] = React.useState();\r\n const [selectedDimensionLabel, setSelectedDimensionLabel] = React.useState();\r\n const [dimensionPrice, setDimensionPrice] = React.useState();\r\n const [discountAmount, setDiscountAmount] = React.useState();\r\n const [percentDiff, setPercentDiff] = React.useState();\r\n const [selectedSize, setSetlectedSize] = React.useState('');\r\n const selectedVariantId = props.variantAvailibilityList.find(\r\n item => item.sizeValue && item.sizeValue.toLowerCase().trim() === selectedSize.toLowerCase().trim() && item.variantID === props.data.product?.result?.RecordId\r\n )?.variantID;\r\n const modalDimensionsArray: IModalDimensions[] = [];\r\n let preSelectedDimension: IModalDimensions = {\r\n selectId: '',\r\n selectedValue: '',\r\n dropdownId: ''\r\n };\r\n const { context } = props;\r\n React.useEffect(() => {\r\n const viewPort = _getViewPort(context);\r\n viewPort === 'xs' || viewPort === 'sm' ? setisMobile(true) : setisMobile(false);\r\n }, []);\r\n\r\n // VSI Customization - START - 47026\r\n React.useEffect(() => {\r\n props.state.currentProductDimensions && props.state.currentProductDimensions.length > 0\r\n && props.state.currentProductDimensions?.map((dimension, i) => {\r\n const dropdownList: IDropdownItemProps[] = getDropdownList(dimension.DimensionValues);\r\n if (dimension && dimension.DimensionTypeValue === 3) {\r\n setSizeVariantsLength(dropdownList?.length ? dropdownList?.length : 0);\r\n }\r\n });\r\n }, [props.state.currentProductDimensions]);\r\n\r\n React.useEffect(() => {\r\n props.setActiveVariantId(selectedVariantId);\r\n }, [selectedVariantId]);\r\n\r\n const getDropdownList = (dimensionValues: ProductDimensionValue[] | undefined): IDropdownItemProps[] => {\r\n const dropdownList = dimensionValues && dimensionValues?.length > 0\r\n ? dimensionValues.map(dimensionValue => {\r\n return {\r\n value: dimensionValue.Value || '',\r\n id: dimensionValue.RecordId.toString(),\r\n selectedValue: (dimensionValue && dimensionValue.RecordId.toString()) || ''\r\n };\r\n })\r\n : [];\r\n return dropdownList;\r\n };\r\n // VSI Customization - END - 47026\r\n\r\n const {\r\n context: {\r\n request: {\r\n apiSettings: { baseImageUrl }\r\n }\r\n }\r\n } = props;\r\n const [activePrices, setActivePrices] = React.useState(props.data.dimensionPrices.result!);\r\n const [showColorPicker] = React.useState(\r\n !!props.data.productSpecificationData.result\r\n ?.find(attr => attr.Name?.toLowerCase().trim() === props.config.eComDisplayColorLabel?.toLowerCase().trim())\r\n ?.TextValue?.toLowerCase()\r\n );\r\n React.useEffect(() => {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n _getActivePrices(props.data.dimensionPrices.result!, props.context.actionContext).then(resultPrices => {\r\n setActivePrices(resultPrices);\r\n }).catch(err => console.log('Error', err));\r\n }, [props.data.dimensionPrices.result]);\r\n\r\n const generateOnClick = (id: number, valueId: string, variantID: number) => async (e: React.MouseEvent) => {\r\n fireAnalyticsLink({\r\n eventName: 'PDP-card-action',\r\n eventCategory: 'PDP Card Action',\r\n eventAction: 'Change Color',\r\n eventLabel: 'Change Color PDP',\r\n eventNoninteraction: 'false',\r\n enhancedAction: 'change_color',\r\n generalConfig: { enhanced_action: 'change_color' }\r\n });\r\n await props.callbacks.dimensionSelectedAsync(id, valueId);\r\n };\r\n const dropdownCallback = (notification: INotificationData): Promise => {\r\n return new Promise((resolve, reject) => {\r\n resolve(props.callbacks.dimensionSelectedAsync(+notification.dropdownId, notification.selectId));\r\n });\r\n };\r\n const toggleBuyBoxModal = () => {\r\n setIsOpen(!isOpen);\r\n };\r\n const buyBoxModalAddItemClick = async (\r\n selectId: string,\r\n selectedValue: string,\r\n dropdownId: string,\r\n dimensionLabel?: string,\r\n isAddItemClick?: boolean\r\n ) => {\r\n setSetlectedSize(selectedValue);\r\n if (isAddItemClick) {\r\n fireAnalyticsLink({\r\n eventName: 'PDP-card-action',\r\n eventAction: 'Change Size',\r\n eventCategory: 'PDP Card Action',\r\n eventNoninteraction: 'false',\r\n eventLabel: 'Change Size PDP',\r\n enhancedAction: 'change_size',\r\n generalConfig: { enhanced_action: 'change_size' }\r\n });\r\n }\r\n setIsOpen(false);\r\n props.setLeasingButtonActive(false);\r\n setselectedDisplayLabel(selectedValue);\r\n setSelectedDimensionLabel(dimensionLabel);\r\n isAddItemClick ? await dropdownCallback({ selectId: selectId, selectedValue: selectedValue, dropdownId: dropdownId }) : null;\r\n props.setLeasingButtonActive(true);\r\n };\r\n const calculatePercentage = (dimPrice: number, discountAmnt: number) => {\r\n const percentSaved = Math.round((discountAmnt / dimPrice) * 100);\r\n setPercentDiff(percentSaved);\r\n setDiscountAmount(discountAmnt);\r\n setDimensionPrice(dimPrice);\r\n };\r\n const formatCurrency = (price: number | undefined): string | undefined => {\r\n if (price === undefined) {\r\n return undefined;\r\n }\r\n return props.context.cultureFormatter.formatCurrency(price);\r\n };\r\n // tslint:disable-next-line: max-func-body-length\r\n const output = props.state.currentProductDimensions && props.state.currentProductDimensions.length > 0\r\n ? props.state.currentProductDimensions?.map((dimension, i) => {\r\n const {\r\n data: {\r\n productSpecificationData: { result }\r\n },\r\n config: { eComDisplayColorAsDropDown, eComDisplayColorLabel }\r\n } = props;\r\n // tslint:disable-next-line: max-line-length\r\n const displayAsDropdown =\r\n result && eComDisplayColorAsDropDown\r\n ? result.find(obj => obj.Name && obj.Name.toLowerCase().trim() === eComDisplayColorAsDropDown.toLowerCase().trim())\r\n ?.BooleanValue\r\n : ''; // Get EcomDisplayColorAsDropDown value\r\n const dropDownDisplayLabel =\r\n result && eComDisplayColorLabel\r\n ? result.find(obj => obj.Name && obj.Name.toLowerCase().trim() === eComDisplayColorLabel.toLowerCase().trim())\r\n ?.TextValue\r\n : ''; // Get EcomDisplayColorLabel value\r\n const dropdownName = props.callbacks.getDropdownName(dimension.DimensionTypeValue, props.resources);\r\n const dropdownId = dimension.DimensionTypeValue.toString();\r\n const dropdownToggleName = props.resources.selectDimensionFormatString?.replace('{0}', dropdownName.toLowerCase());\r\n const swatchName = props.callbacks.getDropdownName(dimension.DimensionTypeValue, props.resources).toLowerCase();\r\n const dropdownList: IDropdownItemProps[] = getDropdownList(dimension.DimensionValues);\r\n if (dimension && dimension.DimensionTypeValue === 1) {\r\n const { DimensionTypeValue, DimensionValues, DimensionValue } = dimension;\r\n // check if type of dimension is height since it also has a DimensionTypeValue of 1\r\n // TODO: see if any other dimension types have a DimensionTypeValue of 1\r\n const doesSelectedValueExist = props.variantAvailibilityList.filter(item => item.colorDimensionRecordId === dimension.DimensionValue?.RecordId && item.sizeValue === selectedSize).length;\r\n const doesSelectedValueAvailable = props.variantAvailibilityList.find(item => item.colorDimensionRecordId === dimension.DimensionValue?.RecordId && item.sizeValue === selectedSize)?.isAvailable;\r\n const availableOptions = props.variantAvailibilityList.filter(item => item.sizeValue.toLowerCase().trim() === selectedSize.toLowerCase().trim()).map(item => item.secondaryDimensionValue);\r\n const availableDimensionValues = DimensionValues?.filter(item => availableOptions.includes(item.Value));\r\n const alternativeOption = props.variantAvailibilityList.find(item => item.sizeValue.toLowerCase().trim() === selectedSize.toLowerCase().trim() && item.isAvailable === true)?.secondaryDimensionValue;\r\n const dimensionValue = doesSelectedValueExist !== 0 && doesSelectedValueAvailable ? DimensionValue : DimensionValues?.find(item => item.Value === alternativeOption);\r\n const selectedValue = (dimension.DimensionValue && dimension.DimensionValue.RecordId) || 'not available';\r\n const isActive = selectedValue === DimensionValue?.RecordId;\r\n const isVariantSelectionRedesignEnabled = props.config.enableVariantSelectionRedesign || false;\r\n\r\n return (\r\n <>\r\n {(displayAsDropdown !== true || displayAsDropdown === null) && showColorPicker ?\r\n <>\r\n \r\n {props.config.enableVariantSelectionRedesign ?\r\n \r\n \r\n {`${dropdownName.toUpperCase()}: `}\r\n {isVariantSelectionRedesignEnabled && isActive ? dimensionValue?.DimensionId : ''}\r\n \r\n {`${availableDimensionValues?.length} Colors`}\r\n :\r\n \r\n {dropdownName} {dimensionValue && dimensionValue.Value ? ({dimensionValue.Value}) : false}\r\n \r\n }\r\n \r\n \r\n \r\n \r\n {/* Keep original Color Dropdown hidden for SEO */}\r\n \r\n {dropdownName}\r\n \r\n \r\n \r\n :\r\n null\r\n }\r\n {dropdownList.length > 1 && displayAsDropdown === true ?\r\n \r\n {props.config.enableVariantSelectionRedesign ? {`${dropDownDisplayLabel} :`} : {dropDownDisplayLabel}}\r\n {/* tslint:disable: max-line-length */}\r\n
\r\n {props.config.enableVariantSelectionRedesign ?\r\n :\r\n \r\n }\r\n
\r\n
\r\n :\r\n null\r\n }\r\n \r\n );\r\n\r\n } else if (dimension && dimension.DimensionTypeValue === 3) {\r\n const { DimensionValue } = dimension;\r\n\r\n dropdownList && dropdownList.length > 0 && dropdownList.forEach(item => {\r\n let damount = 0;\r\n let price = 0;\r\n let percent = '';\r\n let label;\r\n\r\n activePrices &&\r\n activePrices.forEach(size => {\r\n if (size.name === item.value) {\r\n price = size.price;\r\n label = size.dimensionLabel;\r\n if (size.discountAmount) {\r\n damount = size.discountAmount;\r\n percent = damount > 0 ? Math.round((damount / price) * 100).toString() : '';\r\n }\r\n }\r\n });\r\n if (item.value.trim().toLowerCase() === DimensionValue?.Value?.trim().toLowerCase()) {\r\n preSelectedDimension = {\r\n selectId: item.id,\r\n selectedValue: item.value,\r\n dropdownId: dropdownId,\r\n discountAmount: damount,\r\n dimensionPrice: price,\r\n percentDiff: percent,\r\n dimensionLabel: label\r\n };\r\n if ((discountAmount === undefined || discountAmount <= 0) && damount > 0) {\r\n setDiscountAmount(damount);\r\n const percentSaved = Math.round((damount / price) * 100);\r\n setPercentDiff(percentSaved);\r\n }\r\n }\r\n modalDimensionsArray.push({\r\n selectId: item.id,\r\n selectedValue: item.value,\r\n dropdownId: dropdownId,\r\n discountAmount: damount,\r\n dimensionPrice: price,\r\n percentDiff: percent,\r\n dimensionLabel: label\r\n });\r\n });\r\n\r\n // Hidden Size Dropdown with full dimensions for SEO\r\n const SEODropdownList = modalDimensionsArray.map(productDimension => {\r\n // tslint:disable-next-line: no-shadowed-variable\r\n const { dimensionLabel, dimensionPrice, selectId, selectedValue } = productDimension;\r\n // tslint:disable-next-line: no-unnecessary-local-variable\r\n const SEODropDownItem = {\r\n value: `${selectedValue} - ${dimensionLabel} - ${formatCurrency(dimensionPrice)}`,\r\n id: selectId,\r\n selectedValue: selectedValue\r\n };\r\n\r\n return SEODropDownItem;\r\n });\r\n return (// Keeping dropdown for ADA complianace hidden for now.\r\n \r\n {dropdownName}\r\n \r\n \r\n );\r\n } else {\r\n return (// Keeping dropdown for ADA complianace hidden for now.\r\n \r\n {dropdownName}\r\n \r\n \r\n );\r\n }\r\n }) : undefined;\r\n\r\n return (\r\n \r\n {!props.config.enableVariantSelectionRedesign ?\r\n <>\r\n \r\n {/* tslint:disable-next-line: cyclomatic-complexity */}\r\n {sizeVariantsLength === 1 || sizeVariantsLength === 0 ? (\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n {selectedDisplayLabel ? selectedDisplayLabel : 'Select a Size'}\r\n
\r\n
{selectedDimensionLabel}
\r\n
\r\n \r\n {selectedDisplayLabel && discountAmount && dimensionPrice\r\n ? formatCurrency(dimensionPrice - discountAmount)\r\n : dimensionPrice\r\n ? formatCurrency(dimensionPrice)\r\n : ''\r\n }\r\n
\r\n
\r\n {selectedDisplayLabel && percentDiff && percentDiff !== 0 ? (\r\n {percentDiff}% Off\r\n ) : null}\r\n {selectedDisplayLabel && discountAmount ? (\r\n  {formatCurrency(dimensionPrice)}\r\n ) : null}\r\n
\r\n
\r\n
\r\n \r\n
\r\n ) : (\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n {selectedDisplayLabel ? selectedDisplayLabel : 'Select a Size'}\r\n
\r\n
{selectedDimensionLabel}
\r\n
\r\n \r\n {selectedDisplayLabel && discountAmount && dimensionPrice\r\n ? formatCurrency(dimensionPrice - discountAmount)\r\n : formatCurrency(dimensionPrice)}\r\n
\r\n
\r\n {selectedDisplayLabel && percentDiff && percentDiff !== 0 ? (\r\n {percentDiff}% Off\r\n ) : null}\r\n {selectedDisplayLabel && discountAmount ? (\r\n  {formatCurrency(dimensionPrice)}\r\n ) : null}\r\n
\r\n
\r\n
\r\n \r\n
\r\n )}\r\n \r\n : <>\r\n {modalDimensionsArray.length !== 0 &&

Size: {preSelectedDimension?.dimensionLabel !== undefined && preSelectedDimension?.dimensionLabel}

}\r\n \r\n \r\n }\r\n {output}\r\n \r\n );\r\n };\r\n","import React, { FunctionComponent } from 'react';\r\n\r\n\r\ninterface Props {\r\n /** Sets the skeleton-pulse style */\r\n type?: 'text' | 'image' | 'button' | 'button-secondary';\r\n /** Sets the width of the skeleton. Default unit is px. */\r\n width?: number | string;\r\n /** Sets the height of the skeleton. Default unit is px. */\r\n height?: number | string;\r\n /** Makes the skeleton look like a circle */\r\n circle?: boolean;\r\n /** Override classNames on wrapper */\r\n className?: string;\r\n /** Override styles on wrapper */\r\n style?: object;\r\n [rest: string]: unknown; // ...rest property\r\n}\r\n\r\nconst getValidCSSInput = (input: string | number) => {\r\n switch (typeof input) {\r\n case 'undefined':\r\n case 'boolean':\r\n return null;\r\n case 'number':\r\n return `${input}px`;\r\n default:\r\n const parsedInput = parseFloat(input);\r\n const unit = input.match(/%|em/);\r\n return isNaN(parsedInput) ? '' : unit ? `${parsedInput}${unit}` : `${parsedInput}px`;\r\n }\r\n};\r\n\r\nconst CustomSkeleton: FunctionComponent = ({\r\n width,\r\n height,\r\n circle,\r\n type = 'text',\r\n className = '',\r\n style = {},\r\n ...rest\r\n}) => {\r\n const isTextType = type === 'text';\r\n const classNames = `pulse ${!className ? type : ``} ${isTextType ? 'transform' : ''} ${type === 'button-secondary' && !className ? 'button' : ''} ${circle ? 'circle' : ''} ${className}`;\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\nexport default CustomSkeleton;\r\n","/*!\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\n\r\nimport { ICoreContext, RichTextComponent } from '@msdyn365-commerce/core';\r\nimport { FinancingOfferStateInput, IFinancingOfferStateData } from '../../../data-actions/financing-offer-state.action';\r\nimport { fireAnalyticsLink } from '../../../Utilities/analytics/clickTrack';\r\nimport {\r\n getCampaignRemainingCost,\r\n getValidSpecialCampaign,\r\n IFinancingOfferFormatted,\r\n selectFinancingOffer\r\n} from '../../../Utilities/select-financing-offer';\r\nimport { getQueryParamsFromQueryByName } from '../../../data-actions/utilities/utils';\r\nimport { variantQueryStringName } from '../../../Utilities/constants';\r\nimport CustomSkeleton from './CustomSkeleton';\r\n\r\nexport type FinancingComponentPageType = 'PDP' | 'PLP';\r\n\r\nexport interface IFinancingPerMonthComponentProps {\r\n pageType: FinancingComponentPageType;\r\n sellingPrice: number;\r\n // tslint:disable-next-line:no-any\r\n context: ICoreContext<{ [x: string]: any }>;\r\n priceComponent?: JSX.Element;\r\n // VSI Customization - START\r\n sizeValue?: string | undefined;\r\n dimensionPrice?: number | undefined;\r\n percentDiff?: number | undefined;\r\n discountAmount?: number;\r\n categoryName?: String | undefined,\r\n activeVariantId: number | undefined,\r\n productId: number | undefined,\r\n activeColorVariantId: number | undefined,\r\n isLoadedPriceComponent?: boolean | undefined,\r\n parentCategory?: string | undefined\r\n // VSI Customization - END\r\n}\r\n\r\nexport const FinancingPerMonthComponent: React.FC = ({\r\n pageType,\r\n sellingPrice,\r\n context,\r\n priceComponent,\r\n sizeValue,\r\n dimensionPrice,\r\n percentDiff,\r\n discountAmount,\r\n categoryName,\r\n activeVariantId,\r\n productId,\r\n activeColorVariantId,\r\n isLoadedPriceComponent,\r\n parentCategory\r\n}) => {\r\n const selectedFinancingOffer: IFinancingOfferFormatted | undefined = selectFinancingOffer({\r\n limitedTimeFinancingOffers: context.app.config.limitedTimeFinancingOffers,\r\n everydayFinancingOffers: context.app.config.everydayFinancingOffers,\r\n lowCostOffer: context.app.config.lowCostFinancingOffers,\r\n cashBackFinancingOffer: context.app.config.cashBackFinancingOffer,\r\n cashbackFinancingEnable: context.app.config.cashbackFinancingEnable,\r\n totalPrice: sellingPrice\r\n });\r\n\r\n if (!sellingPrice) {\r\n return null;\r\n }\r\n const monthlyCost = selectedFinancingOffer && Math.ceil(sellingPrice / selectedFinancingOffer.numOfMonths);\r\n const stateUpdate: IFinancingOfferStateData = {\r\n isOpen: true,\r\n totalPrice: sellingPrice,\r\n financingOffer: selectedFinancingOffer\r\n };\r\n const url = new URL(window.location.href.toString());\r\n const variantId = Number(getQueryParamsFromQueryByName(url, variantQueryStringName)) || undefined;\r\n const openModal = () => {\r\n fireAnalyticsLink({\r\n eventName: 'internal navigation',\r\n eventCategory: 'internal links',\r\n eventAction: 'to: Financing Per Month modal',\r\n eventLabel: `from ${pageType} Financing Per Month “Learn How” link`,\r\n eventNoninteraction: 'false'\r\n });\r\n context.actionContext.update(new FinancingOfferStateInput(), stateUpdate);\r\n };\r\n // format currency and strip trailing zeros\r\n // TODO: remove the cents portion in a dynamic way for all currencies\r\n const formattedMonthlyCost = monthlyCost && context.cultureFormatter.formatCurrency(monthlyCost);\r\n const monthlyCostStrippedZeros = formattedMonthlyCost && formattedMonthlyCost.substring(0, formattedMonthlyCost.length - 3);\r\n\r\n const campaign = selectedFinancingOffer && getValidSpecialCampaign(selectedFinancingOffer);\r\n const campaignRemainingCost =\r\n campaign && selectedFinancingOffer && getCampaignRemainingCost(campaign, selectedFinancingOffer, sellingPrice);\r\n\r\n const formattedCampaignCost =\r\n campaign && campaignRemainingCost && context.cultureFormatter.formatCurrency(Math.ceil(campaignRemainingCost.cost));\r\n const campaignCostStrippedZeros = formattedCampaignCost && formattedCampaignCost?.substring(0, formattedCampaignCost.length - 3);\r\n\r\n const cashbackFinancingMessage = context.app.config?.cashbackFinancingMessage;\r\n const pdpCashbackFinancingMessage = context.app.config?.pdpCashbackFinancingMessage;\r\n const everydayFinancingMessage = context.app.config.everydayFinancingMessage;\r\n const limitedFinancingMessage = context.app.config.limitedFinancingMessage;\r\n const limitedCampaignFinancingMessage = context.app.config.limitedCampaignFinancingMessage;\r\n\r\n const sellingPriceDollars = sellingPrice.toFixed(2).split('.')[0];\r\n const sellingPriceCents = sellingPrice.toFixed(2).split('.')[1];\r\n\r\n const dimensionDollars = dimensionPrice?.toFixed(2).split('.')[0];\r\n const dimensionCents = dimensionPrice?.toFixed(2).split('.')[1];\r\n const readyToShow = activeVariantId === productId || activeColorVariantId === productId || variantId === productId || pageType === \"PLP\";\r\n const promotionalPeriod = selectedFinancingOffer?.numOfMonths;\r\n const validThroughDate = selectedFinancingOffer && selectedFinancingOffer.isLTO && (promotionalPeriod === 36 || promotionalPeriod === 48 || promotionalPeriod === 60) ? '' : ` Valid thru ${selectedFinancingOffer?.endDate} `;\r\n const offerMinPurchase =\r\n selectedFinancingOffer && context.cultureFormatter.formatCurrency(Math.ceil(selectedFinancingOffer.minPurchase));\r\n const offerMinPurchaseStrippedZeros = offerMinPurchase && offerMinPurchase?.substring(0, offerMinPurchase.length - 3);\r\n // tslint:disable: react-this-binding-issue jsx-no-lambda react-a11y-event-has-role\r\n return pageType === 'PDP' ? (\r\n
\r\n
\r\n
0 && Number(percentDiff) < 100 && discountAmount !== 0 ? 'product-price' : 'product-price-black'}>\r\n\r\n {Number(percentDiff) > 0 && discountAmount !== 0 ? readyToShow ?\r\n <>\r\n ${sellingPriceDollars}\r\n {sellingPriceCents}\r\n \r\n \r\n ${dimensionDollars}\r\n {dimensionCents}\r\n \r\n {percentDiff && percentDiff.toFixed()}% Off\r\n \r\n : : readyToShow ? priceComponent || (\r\n <>\r\n ${sellingPriceDollars}\r\n {sellingPriceCents}\r\n ) : \r\n }\r\n
\r\n
\r\n {selectedFinancingOffer && (\r\n <>\r\n {campaign && campaignRemainingCost ? (\r\n
\r\n {/* commented as per story no 21902 */}\r\n {/*
Pay as low as
*/}\r\n
or {`$${Math.ceil(\r\n campaign.initialMonthlyAmount\r\n )}/mo for the first ${campaign.numOfDiscountedMonths} months`}
\r\n {/* tslint:disable-next-line: react-this-binding-issue jsx-no-lambda react-a11y-event-has-role*/}\r\n
e.stopPropagation()}>\r\n {/* {`Then $${Math.ceil(campaignRemainingCost.cost)}/mo for ${\r\n campaignRemainingCost?.months\r\n } months with 0% APR with Mattress Firm Credit Card.Limited Time.`} */}\r\n {limitedCampaignFinancingMessage &&\r\n limitedCampaignFinancingMessage\r\n ?.replace('{campaignCost}', campaignCostStrippedZeros)\r\n ?.replace('{campaignMonths}', campaignRemainingCost?.months)}\r\n \r\n Learn How\r\n \r\n \r\n \r\n \r\n
\r\n
\r\n ) : selectedFinancingOffer.offerName?.toLowerCase() === 'low cost offer' ?\r\n
\r\n {/* tslint:disable-next-line: react-this-binding-issue jsx-no-lambda react-a11y-event-has-role*/}\r\n
e.stopPropagation()}>\r\n {selectedFinancingOffer.lowCostFinancingOfferMessage}\r\n \r\n Learn How\r\n \r\n
\r\n
: (\r\n
\r\n {/* commented as per story no 21902 */}\r\n {/*
Pay as low as
*/}\r\n {/*
\r\n {pageType === 'PDP' ? `${monthlyCostStrippedZeros}/mo` : `${monthlyCostStrippedZeros} / mo`}\r\n
*/}\r\n {/* tslint:disable-next-line: react-this-binding-issue jsx-no-lambda react-a11y-event-has-role*/}\r\n
e.stopPropagation()}>\r\n {/* {pageType === 'PDP' ? `${monthlyCostStrippedZeros}/mo` : `${monthlyCostStrippedZeros} / mo`} */}\r\n {selectedFinancingOffer?.isCashBack ? pdpCashbackFinancingMessage &&\r\n :\r\n selectedFinancingOffer.isLTO\r\n ? `${limitedFinancingMessage &&\r\n limitedFinancingMessage?.replace(\r\n '{numOfMonths}',\r\n selectedFinancingOffer.numOfMonths\r\n )}${(pageType === 'PDP' && validThroughDate)}`\r\n : everydayFinancingMessage &&\r\n everydayFinancingMessage\r\n ?.replace('{monthlyCostStrippedZeros}', monthlyCostStrippedZeros)\r\n ?.replace('{numOfMonths}', selectedFinancingOffer.numOfMonths)}\r\n {/* ? `0% Interest with ${\r\n selectedFinancingOffer.numOfMonths\r\n } equal monthly payments. Limited Time.${(pageType === 'PDP' &&\r\n ` Valid thru ${selectedFinancingOffer.endDate} `) ||\r\n ''}`\r\n :`Suggested payments with ${selectedFinancingOffer.numOfMonths} months special financing. `} */}\r\n \r\n Learn How\r\n \r\n \r\n \r\n \r\n
\r\n
\r\n )}\r\n \r\n )}\r\n
\r\n ) : (\r\n
\r\n
\r\n {/* VSI Customization - START */}\r\n
{pageType === 'PLP' ? (sizeValue ? sizeValue : 'Starting at') : null}
\r\n {/* VSI Customization - END */}\r\n
{priceComponent || `${context.cultureFormatter.formatCurrency(sellingPrice)}`}
\r\n
\r\n {selectedFinancingOffer && (\r\n <>\r\n
\r\n OR\r\n
\r\n {campaign && campaignRemainingCost ? (\r\n
\r\n {/* commented as per story no 21902 */}\r\n {/*
Pay as low as
*/}\r\n
{`$${Math.ceil(\r\n campaign.initialMonthlyAmount\r\n )}/mo for the first ${campaign.numOfDiscountedMonths} months`}
\r\n {/* tslint:disable-next-line: react-this-binding-issue jsx-no-lambda react-a11y-event-has-role*/}\r\n
e.stopPropagation()}>\r\n {/* {`Then $${Math.ceil(campaignRemainingCost.cost)}/mo for ${\r\n campaignRemainingCost?.months\r\n } months with 0% APR with Mattress Firm Credit Card.Limited Time.`} */}\r\n {limitedCampaignFinancingMessage &&\r\n limitedCampaignFinancingMessage\r\n ?.replace('{campaignCost}', campaignCostStrippedZeros)\r\n ?.replace('{campaignMonths}', campaignRemainingCost?.months)}\r\n \r\n
\r\n
\r\n )\r\n :\r\n selectedFinancingOffer.offerName?.toLowerCase() === 'low cost offer' ?\r\n
\r\n {/* tslint:disable-next-line: react-this-binding-issue jsx-no-lambda react-a11y-event-has-role*/}\r\n
e.stopPropagation()}>\r\n

{selectedFinancingOffer.lowCostFinancingOfferMessage?.replace('.', '.\\n')}

\r\n \r\n
\r\n
\r\n : (\r\n
\r\n {/* tslint:disable-next-line: react-this-binding-issue jsx-no-lambda react-a11y-event-has-role*/}\r\n
\r\n {pageType === 'PLP' ? `${monthlyCostStrippedZeros}/mo` : `${monthlyCostStrippedZeros} / mo`}\r\n
\r\n
e.stopPropagation()}>\r\n {selectedFinancingOffer?.isCashBack ? cashbackFinancingMessage &&\r\n :\r\n selectedFinancingOffer.isLTO\r\n ? `${limitedFinancingMessage &&\r\n limitedFinancingMessage?.replace(\r\n '{numOfMonths}',\r\n selectedFinancingOffer.numOfMonths\r\n )?.replace('{monthlyCostStrippedZeros}', monthlyCostStrippedZeros)\r\n }`\r\n : everydayFinancingMessage &&\r\n everydayFinancingMessage\r\n ?.replace('{numOfMonths}', selectedFinancingOffer.numOfMonths)\r\n ?.replace('{monthlyCostStrippedZeros}', monthlyCostStrippedZeros)\r\n }\r\n \r\n
\r\n
\r\n )}\r\n \r\n )}\r\n
\r\n );\r\n};\r\n","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n (binding.modules['mfrm-buybox'] = {\n c: () => require('partner/modules/mfrm-buybox/mfrm-buybox.tsx'),\n $type: 'containerModule',\n da: [{name:'allProductVariants', path:'data-actions/buybox-get-all-variants-list', runOn: 0},{name:'allVariants', path:'data-actions/buybox-get-dimension-variants-availability-action', runOn: 0},{name:'cart', path:'@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action', runOn: 1},{name:'categoryPaths', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-category-paths', runOn: 0},{name:'completeYourBedPillow', path:'actions/complete-your-bed-pillow.action', runOn: 0},{name:'completeYourBedProtector', path:'actions/complete-your-bed-protector.action', runOn: 0},{name:'customerInformation', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer', runOn: 0},{name:'deliveryOptions', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-delivery-options-for-selected-variant', runOn: 0},{name:'dimensionPrices', path:'data-actions/buybox-get-dimension-pricing-action', runOn: 0},{name:'listPageStateBuyBox', path:'modules/mfrm-buybox/list-page-state-buybox', runOn: 0},{name:'product', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant', runOn: 0},{name:'productAvailableQuantity', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-product-availabilities-for-selected-variant', runOn: 0},{name:'productDimensions', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-dimensions-for-selected-variant', runOn: 0},{name:'productPrice', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-price-for-selected-variant', runOn: 0},{name:'productSpecificationData', path:'data-actions/get-attributes-for-selected-variant', runOn: 0},{name:'selectedFoundation', path:'actions/select-your-foundation.action', runOn: 0},{name:'storeSelectorState', path:'data-actions/store-selector-state-data-action', runOn: 0},{name:'storeSelectorStateManager', path:'@msdyn365-commerce-modules/bopis-utilities/dist/lib/store-selector-state-manager/store-selector-state-manager-data-action', runOn: 1}],\n \n iNM: false,\n ns: '__local__',\n n: 'mfrm-buybox',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/mfrm-buybox'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/bopis-utilities/dist/lib/store-selector-state-manager/store-selector-state-manager-data-action';\n let dataAction = require('@msdyn365-commerce-modules/bopis-utilities/dist/lib/store-selector-state-manager/store-selector-state-manager-data-action');\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-customer';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-delivery-options-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-delivery-options-for-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-dimensions-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-dimensions-for-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-price-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-price-for-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-product-availabilities-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-product-availabilities-for-selected-variant');\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 = '@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action';\n let dataAction = require('@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action');\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/select-your-foundation.action';\n let dataAction = require('partner/actions/select-your-foundation.action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'data-actions/buybox-get-all-variants-list';\n let dataAction = require('partner/data-actions/buybox-get-all-variants-list');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'data-actions/buybox-get-dimension-pricing-action';\n let dataAction = require('partner/data-actions/buybox-get-dimension-pricing-action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'data-actions/buybox-get-dimension-variants-availability-action';\n let dataAction = require('partner/data-actions/buybox-get-dimension-variants-availability-action');\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 const sanitizedActionPath = 'data-actions/store-selector-state-data-action';\n let dataAction = require('partner/data-actions/store-selector-state-data-action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'modules/mfrm-buybox/list-page-state-buybox';\n let dataAction = require('partner/modules/mfrm-buybox/list-page-state-buybox');\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-buybox|mfrm-buybox'] = {\n c: () => require('partner/modules/mfrm-buybox/mfrm-buybox.view.tsx'),\n cn: '__local__-__local__-mfrm-buybox'\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 MsDyn365, { IActionContext } from '@msdyn365-commerce/core';\nimport { action, computed, observable } from 'mobx';\n\nimport {\n IListMapViewState,\n ILoadMapApiInput,\n IStoreInfo,\n IStoreSelectionStateContext,\n IStoreSelectorLocation,\n IStoreSelectorStateManager\n} from './i-store-selection-state-manager';\n\n/**\n * Abstract instance of IStoreSelectorStateManager with base implementation\n * of everything except the geoLocate function.\n */\nexport abstract class BaseStoreSelectorStateManager implements IStoreSelectorStateManager {\n @computed public get isDialogOpen(): Readonly {\n return this._context !== undefined;\n }\n\n @computed public get context(): Readonly {\n return this._context;\n }\n\n @observable public isMapApiLoaded?: boolean;\n\n @observable public selectedStoreLocationId?: string;\n\n @observable public preferredStore?: IStoreInfo;\n\n @observable public listMapViewState: IListMapViewState = { displayList: true, displayMap: false };\n\n @observable public isMapModuleLoaded?: boolean;\n\n @observable public lastInlineShownStoreInfo?: IStoreInfo;\n\n @observable protected _context?: IStoreSelectionStateContext;\n\n private readonly preferredStoreLocalStorageKey: string = '_msdyn365__preferredStore_';\n\n constructor() {\n this.isMapModuleLoaded = false;\n const value = this._readFromToCookie(this.preferredStoreLocalStorageKey);\n try {\n const storeInfo: IStoreInfo | undefined = value ? JSON.parse(value) : undefined;\n if (storeInfo) {\n this.preferredStore = storeInfo;\n }\n } catch {\n this.preferredStore = undefined;\n }\n }\n\n public abstract geoLocate(searchTerm: string, actionContext: IActionContext): Promise;\n\n public abstract loadMapApi(input: ILoadMapApiInput): Promise;\n\n @action\n public async toggleListMapViewState(): Promise {\n this.listMapViewState = {\n displayList: !this.listMapViewState.displayList,\n displayMap: !this.listMapViewState.displayMap\n };\n }\n\n @action\n public async setMapModuleLoaded(input: boolean): Promise {\n this.isMapModuleLoaded = input;\n }\n\n @action\n public async setOrgUnitStoreInformation(input: IStoreSelectionStateContext): Promise {\n this._context = input;\n }\n\n @action\n public async setSelectedStoreLocationId(storeId: string | undefined): Promise {\n this.selectedStoreLocationId = storeId;\n }\n\n @action\n public async setPreferredStoreLocation(\n storeId?: string,\n storeName?: string | undefined,\n writeToCookie: boolean = false,\n latitude?: number,\n longitude?: number\n ): Promise {\n const storeInfo: IStoreInfo = { StoreId: storeId, StoreName: storeName, Latitude: latitude, Longitude: longitude };\n this.preferredStore = storeInfo;\n if (writeToCookie) {\n this._writeToCookie(this.preferredStoreLocalStorageKey, JSON.stringify(storeInfo));\n }\n }\n\n @action\n public async setLastInlineStoreInfo(latitude?: number, longitude?: number): Promise {\n const storeInfo: IStoreInfo = { StoreId: '', StoreName: '', Latitude: latitude, Longitude: longitude };\n this.lastInlineShownStoreInfo = storeInfo;\n }\n\n @action\n public async clearPreferredStore(writeToCookie: boolean): Promise {\n this.preferredStore = undefined;\n if (writeToCookie) {\n this._removeCookie(this.preferredStoreLocalStorageKey);\n }\n }\n\n @action\n public async openDialog(input: IStoreSelectionStateContext): Promise {\n if (this._context && this._context.id === input.id) {\n throw new Error('Dialog is already opened');\n }\n\n this._context = input;\n }\n\n @action\n public async closeDialog(): Promise {\n this._context = undefined;\n }\n\n private _removeCookie(key: string): void {\n if (!key) {\n return;\n }\n if (MsDyn365.isBrowser) {\n const storage = window.localStorage;\n storage.removeItem(key);\n }\n }\n\n private _writeToCookie(key: string, value: string | undefined): void {\n if (!key || !value) {\n return;\n }\n if (MsDyn365.isBrowser) {\n const storage = window.localStorage;\n storage.setItem(key, value);\n }\n }\n\n private _readFromToCookie(key: string): string | undefined {\n if (!key) {\n return undefined;\n }\n if (MsDyn365.isBrowser) {\n const storage = window.localStorage;\n const cookieValue = storage.getItem(key);\n if (cookieValue) {\n return cookieValue;\n }\n }\n\n return undefined;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { action } from 'mobx';\n\nimport { BaseStoreSelectorStateManager } from './base-store-selector-state-manager';\nimport { ILoadMapApiInput, IStoreSelectorLocation } from './i-store-selection-state-manager';\nimport { IMapWindow, MapLocationsResult } from './models/map-data';\n\ndeclare const window: IMapWindow;\n\n/**\n * Instance of IStoreSelectorStateManager manager that uses Map service\n * for geo location.\n */\nexport class MapStoreSelectorStateManager extends BaseStoreSelectorStateManager {\n private readonly SERVICE_ENDPOINT: string = 'https://dev.virtualearth.net/REST/v1/';\n\n private readonly MAP_API_ENDPOINT: string = 'https://www.bing.com/api/maps/mapcontrol?callback=mapAPIReady';\n\n @action\n public async geoLocate(searchTerm: string, actionContext: IActionContext): Promise {\n if (\n !searchTerm ||\n !actionContext.requestContext.channel ||\n !actionContext.requestContext.channel.BingMapsApiKey ||\n !actionContext.requestContext.channel.BingMapsEnabled\n ) {\n return undefined;\n }\n\n let searchContent: string = searchTerm;\n\n const jsonp = `mapSearchCallback_${crypto.getRandomValues(new Uint32Array(1))[0]}`;\n\n if (actionContext.requestContext.channel.ChannelCountryRegionISOCode) {\n searchContent = `${searchTerm.trim()} ${actionContext.requestContext.channel.ChannelCountryRegionISOCode}`;\n }\n\n const query = encodeURI(searchContent);\n const key = encodeURI(actionContext.requestContext.channel.BingMapsApiKey);\n\n const geolocationApiUrl =\n actionContext.requestContext.app &&\n actionContext.requestContext.app.config &&\n actionContext.requestContext.app.config.geolocationApiUrl;\n const requestUrl = `${\n geolocationApiUrl ? geolocationApiUrl : this.SERVICE_ENDPOINT\n }/Locations?query=${query}&key=${key}&jsonp=${jsonp}`;\n\n return new Promise(resolve => {\n const script = document.createElement('script');\n script.setAttribute('type', 'text/javascript');\n script.setAttribute('src', requestUrl);\n\n window[jsonp] = (data: MapLocationsResult) => {\n delete window[jsonp];\n script.remove();\n\n if (data && data.resourceSets && data.resourceSets.length > 0 && data.resourceSets[0].resources.length > 0) {\n resolve({\n latitude: data.resourceSets[0].resources[0].point.coordinates[0],\n longitude: data.resourceSets[0].resources[0].point.coordinates[1]\n });\n }\n\n resolve(undefined);\n };\n\n document.body.appendChild(script);\n });\n }\n\n @action\n public async loadMapApi(input: ILoadMapApiInput): Promise {\n if (StringExtensions.isNullOrEmpty(input.key)) {\n return Promise.resolve();\n }\n\n const isScriptAlreadyLoaded = !!document?.getElementById('msdyn_map-api-script');\n\n if (isScriptAlreadyLoaded) {\n if (window) {\n const currentWindowAPI = window.mapAPIReady;\n window.mapAPIReady = () => {\n if (currentWindowAPI) {\n currentWindowAPI();\n }\n this.isMapApiLoaded = true;\n };\n }\n // Prevents from loading multiple script into the body\n return Promise.resolve();\n }\n\n const url = `${this.MAP_API_ENDPOINT}${input.key ? `&key=${input.key}` : ''}${input.lang ? `&setLang=${input.lang}` : ''}${\n input.market ? `&setMkt=${input.market}` : ''\n }`;\n\n return new Promise((resolve, reject) => {\n const script = document?.createElement('script');\n script.type = 'text/javascript';\n script.async = true;\n script.defer = true;\n script.src = url;\n script.id = 'msdyn_map-api-script';\n if (window) {\n window.mapAPIReady = () => {\n this.isMapApiLoaded = true;\n resolve();\n };\n }\n script.addEventListener('error', (error: string | Event) => {\n reject(error);\n });\n document?.body?.appendChild(script);\n });\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createObservableDataAction, IAction, IActionInput, IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\nimport { GenericInput, getGenericAction } from '@msdyn365-commerce-modules/retail-actions';\n\nimport { IStoreSelectorStateManager } from './i-store-selection-state-manager';\nimport { MapStoreSelectorStateManager } from './map-store-selector-state-manager';\n\nexport function createStoreSelectorStateInput(result: IStoreSelectorStateManager): GenericInput {\n return new GenericInput('mapSSSM', result, 'IStoreSelectorStateManager');\n}\n\nconst createStoreSelectorStateInputInternal = (inputData: ICreateActionContext>): IActionInput => {\n return createStoreSelectorStateInput(new MapStoreSelectorStateManager());\n};\n\nexport const getGenericActionDataAction = createObservableDataAction({\n action: >getGenericAction,\n input: createStoreSelectorStateInputInternal\n});\n\nexport default getGenericActionDataAction;\n","module.exports = React;","module.exports = ReactDOM;"],"names":["fireAnalyticsLink","_ref","searchTerm","searchType","eventName","eventCategory","eventAction","eventLabel","eventType","eventNoninteraction","enhancedAction","generalConfig","promoConfig","productConfig","customerConfig","productImpressionConfig","callUtagLink","_objectSpread","event","event_category","event_action","event_label","event_type","event_noninteraction","enhanced_action","search_term","search_type","getBVAttributeValues","attributeValues","key","_attributeValues$find","value","find","attr","_attr$Name","Name","trim","TextValue","Math","round","getBVAttributeValuesUnbxd","_attributeValues$key","parsedValue","parsedArr","ReactHtmlParser","length","toString","dayjs","tz","utc","isBetween","format","getValidSpecialCampaign","financingOffer","specialCampaign","enableCampaign","initialMonthlyAmount","numOfDiscountedMonths","isCampaignScheduled","getCampaignRemainingCost","campaign","totalPrice","remainingCost","remainingMonths","numOfMonths","cost","months","offer","_tempOffer$specialCam","_tempOffer$specialCam2","tempOffer","Object","create","_tempOffer$specialCam3","_tempOffer$specialCam4","campaignValidStartDate","campaignValidEndDate","startDate","endDate","isScheduled","add","startDateCentralTime","isValid","local","endDateCentralTime","now","selectFinancingOffer","returnCustomOfferArray","campaignFound","limitedTimeFinancingOffers","everydayFinancingOffers","lowCostOffer","specialFinancingOffer","synchronySpecialFinancingCondition","specialFinancingEnable","checkoutShowEveryDayOffers","cashbackFinancingEnable","cashBackFinancingOffer","highestMinimumPurchase","bestOffer","costPerMonth","isLTO","minPurchase","everydayFinancingOfferMessage","limitedFinancingOfferMessage","cashbackFinancingOfferMessage","monthlyOfferDetails","financingOfferDescription","disclaimer","offerFound","everydayOffers","specialOffer","validLimitedTimeFinancingOffers","filter","offerValidStartDate","offerValidEndDate","isValidLimitedTimeOffer","forEach","currentOfferAccepted","noInterestFor","ceil","offerName","FinancingOfferDataOnPage","checkoutDisplay","push","isAfter","cashBackOffer","isCashBack","cashBackPercentageAmount","cashbackBannerDetails","updatedOffer","calculateFinancing","currentOffer","monthlyPayment","financingMessage","specialCampaignOffer","specialCase36Months","validCampaign","undefined","_offer$offerName","maxPurchase","toLowerCase","_offer$financingOffer","_offer$defaultNumberO","LCO","lowCostFinancingOfferMessage","replace","defaultNumberOfMonths","lowCostOfferDetailsOnCart","CompleteYourBedPillowInput","constructor","pillow","getCacheKey","getCacheObjectType","dataCacheType","this","Msdyn365","action","async","input","ctx","id","args","_args$config","config","CompleteyourBedProtectorInput","protector","ProductCompareBuyboxStateSharing","zipCode","__decorate","observable","SelectYourFoundationInput","foundation","ErrorBoundary","React","props","super","state","hasError","errorMessage","error","message","render","_this$props","_this$state","showMessage","telemetry","style","background","padding","color","children","BuyboxGetDimensionPricingInput","productId","channelId","getDimensionPricingAction","pricingData","productResponse","getByIdAsync","callerContext","queryResultSettings","Paging","Top","baseProduct","Array","isArray","getVariantsByDimensionValuesAsync","MasterProductId","then","variants","dimensionsSizes","productIds","variant","_variant$Dimensions","Dimensions","dimension","DimensionTypeValue","_dimension$DimensionV2","sizeLabel","DimensionValue","Value","priceLabel","Price","dimensionLabel","_dimension$DimensionV","extensionProperties","ExtensionProperties","property","_property$Key","_property$Value","_property$Value2","Key","StringValue","getHtmlParserValue","getDimensionLabel","_dimension$DimensionV3","_dimension$DimensionV4","hasOwnProperty","price","RecordId","name","keys","catch","exception","Error","createObservableDataAction","inputData","requestContext","query","apiSettings","urlTokens","itemId","BuyboxGetDimensionVariantAvailabilityInput","getAllVariantsAction","fetchedVariants","variantAvailabilityData","variantID","sizeDimensionRecordID","colorDimensionRecordId","itemID","isAvailable","sizeValue","ItemId","secondaryDimensionValue","FinancingOfferStateInput","isOpen","StoreSelectorStateInput","storeSelectorStateAction","isModalOpen","prefferedStore","MsDyn365","isBrowser","localStorage","getItem","JSON","parse","BuyboxCallChat","telOnClick","window","location","href","callChatPhoneNumber","toggleChatClick","setTimeout","eval","utag","link","onTextChange","callChatMessage","target","Node","className","Text","text","editProps","onEdit","onClick","ListPageStateBuyBox","variantId","categoryName","productBrandName","productUrl","productImageUrl","productSize","ListPageStateBuyBoxInput","listPageStateAction","createListPageInput","BuyBoxSizeComponent","preSelection","isPreSelected","selectId","selectedValue","setSelectId","preSelectionPending","setPreSelectionPending","updatePricing","highlightId","highlightValue","highlightDimensionLabel","isAddItemClick","selectHighlightId","selectedDimensionLabel","discountAmount","dimensionPrice","modalDimensions","map","i","percentFunc","addItemClick","dropdownId","Modal","autoFocus","fade","horizontalPosition","isMobile","verticalPosition","zIndex","toggle","onCloseModal","applicationNode","modalClassName","classnames","ModalHeader","ModalBody","idx","variantAvailibilityList","parseInt","role","tabIndex","onKeyUp","e","handleKeyPress","keyCode","formatCurrencyFunc","percentDiff","outOfStockText","returnValidPricing","BuyBoxSizeRedesignComponent","sizeDimensions","isActive","_selectedValueData$fi","isVariantAvailableAtAll","item","isAnyVariantAvailable","customVariantName","getCustomizedVariantName","variantNameConfig","originalVariantName","variantNameMapObject","customizedVariantName","variantMappingConfig","disabled","Dropdown","selectMenu","_onChanged","setState","selectedIndex","onChange","innerText","dimensionValue","payLoad","getPayloadObject","telemetryContent","dropdownName","componentDidMount","current","componentDidUpdate","_this$props2","preSelectionSet","dropdownList","dropdownToggleName","attribute","getTelemetryAttributes","assign","ref","selected","hidden","_this$props$variantAv","dim","_this$props$selectedS","selectedSize","observer","baseImageUrl","generateOnClick","setActiveVariant","selectedValueAvailable","isVariantSelectionRedesignEnabled","swatchName","DimensionValues","index","_dimensionValue$Dimen","recordID","currVariantID","availabilityList","stringify","dimensionId","DimensionId","url","URL","isVariantIdNotAvailable","Number","getQueryParamsFromQueryByName","variantQueryStringName","element","document","getElementsByClassName","click","backgroundImage","slice","_renderSlashItem","HeightFoundationComponent","_handleOnClick","selectedId","dimensionName","dimensionList","_this$props$variantAv2","classNames","currentVariantId","outOfStockSmallParcel","outOfStockBoolean","BuyboxErrorBlock","showError","configureErrors","quantityError","customAmountError","otherError","resources","errorMessages","values","Alert","assertive","buyboxErrorMessageHeader","_getProductType","shippingInformation","_isOrderQuantityLimitsFeatureEnabled","_props$context","defaultOrderQuantityLimitsFeatureConfig","context","request","app","platform","enableDefaultOrderQuantityLimits","customerInfo","data","customerInformation","result","IsB2b","BuyboxAddToCart","addToCart","buyboxProps","variantOutOfStock","itemOutOfMarket","outOfStockSmallParcelState","adjustableItem","ContainerProps","mfrmAddToCart","defaultMinimumKeyInPrice","defaultMaximumKeyInPrice","_attributes$find","_productSpecification","_productSpecification2","_props$data$deliveryO","_props$context$action","_props$data$deliveryO2","typeName","product","productPrice","productAvailableQuantity","productSpecificationData","categoryPaths","minimumKeyInPrice","maximumKeyInPrice","brandBackofficeAttributePdp","allCategoriesArr","categoryObj","attributes","currAttribute","quantity","errorState","errorHost","selectedProduct","isUpdatingDimension","isUpdatingDeliveryOptions","isServiceItem","keyInPriceAmount","allVariantOOS","ecomAllVairantStockInfoConcatenated","variantIdOOS","split","lastBreadcrumbCategoryLink","outOfStockValue","specificationData","_specificationData$Na","_props$context$app$co","outOfStockProductKey","shippingInformationSmall","smallParcelAttributeKey","BooleanValue","_props$state","checkSPAvailibility","_props$state2","some","productAvailability","ProductAvailableQuantity","dialogStrings","goToCartText","buyBoxGoToCartText","continueShoppingText","buyBoxContinueShoppingText","headerItemOneText","buyBoxSingleItemText","headerItemFormatText","buyBoxMultiLineItemFormatText","headerMessageText","buyBoxHeaderMessageText","freePriceText","priceFree","originalPriceText","currentPriceText","defaultImageSettings","viewports","xs","q","w","h","lg","xl","lazyload","isLoading","status","callbacks","changeUpdatingDimension","isLoadingDeliveryOptions","deliveryOptions","changeUpdatingDeliveryOptions","getTelemetryObject","telemetryPageName","friendlyName","emailDeliveryModeCode","actionContext","channel","EmailDeliveryModeCode","isEmailDelivery","DeliveryOptions","ArrayExtensions","hasElements","Code","successfulATC","button","AddToCartComponent","addToCartText","addToCartProductsText","mfrmOutOfStockCustomText","mfrmOutOfStockText","mfrmContinueShoppingText","mfrmContinueShoppingLink","mfrmOutOfStockSmallParcell","navigationUrl","getUrlSync","onError","quantityErrorForState","customAmountErrorForState","otherErrorForState","getGenericError","cart","failureReason","getQuantityError","stockLeft","cartActionResult","substatus","_resources$invalidSma","formatedAmountLimit","cultureFormatter","formatCurrency","invalidSmallCustomAmountText","_resources$invalidLar","invalidLargeCustomAmountText","updateErrorState","getConfigureErrors","missingDimensions","IsGiftCard","getSelectedProduct","gridSettings","imageSettings","isAddServiceItemToCart","isPriceKeyedIn","customPriceAmount","isCustomPriceSelected","isOrderQuantityLimitsFeatureEnabled","isAddEmailDeliveryItemToCart","extensionProps","allProductVariants","productCategoryName","productBrand","updateSuccessfulATC","variantIdForTracking","errorBlock","mfrmgetBuyboxAddToCart","BuyboxViewCartLink","viewCartLink","viewCartLinkText","BuyboxSocialShare","socialShare","BuyboxFindInStore","storeSelector","heading","description","errors","modal","productPickupOptionList","SleepExpertSummaryComponent","sleepExpertOpinionHeadingText","sleepExpertSummaryText","tag","RichTextComponent","BuyboxSleepExpertSummary","_buyboxProps$config$s","titleHeadingTag","ProgressiveLeasingEstimatorRequestType","ProgressiveLeasingEstimatorPayFrequency","MfrmProgressiveLeasingEstimator","infoText","estimatorLink","progressiveLeasingEstimator","setModalStatus","useState","estimatorUrl","buildEstimatorURL","_closeModal","useEffect","iframe","querySelector","src","isLeaseActive","linkText","preventDefault","ariaLabel","alt","type","sandbox","itemCost","_estimatorLink$linkUr","storeId","requestType","payFrequency","approveMeName","approveMeSlugValue","estimatorURL","linkUrl","destinationUrl","requestTypeValue","getRequestType","searchParams","append","payFrequencyValue","getPayFrequency","stateCode","getStateCode","decodeURIComponent","pdp","checkoutPdp","frequency","weekly","biWeekly","semiMonthly","monthly","prefferedStoreData","parsedPrefferedStoreData","State","BuyboxProgressiveLeasingEstimator","leaseState","BuyboxFinancingPerMonth","originalPrice","discountValue","activeVariantId","activeColorVariantId","isLoadedPriceComponent","parentCategory","percentageDiscount","FinancingPerMonthComponent","pageType","sellingPrice","_getBuyboxSEOMetaTags","pageKeywords","_getSEOMetaTagValue","pageKeywordsParser","content","keyValue","_currAttribute$Name","_result$","_result$2","_props$state$productP","_props$state$productP2","_props$state$productP3","_props$state$productP4","_props$app$config$pro","_product$result","_product$result2","_props$data$listPageS","_product$result3","_props$state$currentP","ModuleProps","MediaGalleryContainerProps","ProductInfoContainerProps","findInStore","title","inventoryLabel","shopSimilarLook","keyInPrice","productBadges","ratingComponent","tryInStoreComponent","promotionalMessage","customerSatisfactionScore","renderOOBMediaGallery","slots","mfrmStoreSelector","mediaGallery","mfrmMediaGallery","additionalModules","stylesAndDisruptorsModules","chooseYourFoundationModule","completeYourBed","dimensionRows","AttributeValues","CustomerContextualPrice","AdjustedPrice","DiscountAmount","ProductId","productIdPrefix","mfrmProductId","setLeasingButtonActive","setActiveVariantId","setActiveColorVariantId","SetoutOfStockSmallParcelState","isCallChatProduct","_attr$Name2","tagsArr","setItemOutOfMarket","setVariantOutOfStock","listPageStateBuyBox","renderDimensions","_props$variantAvailib","_props$data$productSp","_props$state$currentP2","_preSelectedDimension","_preSelectedDimension2","sizeVariantsLength","setSizeVariantsLength","setIsOpen","setisMobile","selectedDisplayLabel","setselectedDisplayLabel","setSelectedDimensionLabel","setDimensionPrice","setDiscountAmount","setPercentDiff","setSetlectedSize","selectedVariantId","_props$data$product","modalDimensionsArray","preSelectedDimension","viewPort","_getViewPort","currentProductDimensions","getDropdownList","dimensionValues","activePrices","setActivePrices","dimensionPrices","showColorPicker","_props$config$eComDis","eComDisplayColorLabel","_getActivePrices","resultPrices","err","console","log","valueId","dimensionSelectedAsync","dropdownCallback","notification","Promise","resolve","reject","toggleBuyBoxModal","buyBoxModalAddItemClick","calculatePercentage","dimPrice","discountAmnt","percentSaved","output","_result$find","_result$find2","_props$resources$sele","eComDisplayColorAsDropDown","displayAsDropdown","obj","dropDownDisplayLabel","getDropdownName","selectDimensionFormatString","_props$variantAvailib2","_props$variantAvailib3","doesSelectedValueExist","doesSelectedValueAvailable","availableOptions","availableDimensionValues","includes","alternativeOption","enableVariantSelectionRedesign","toUpperCase","Listing","_DimensionValue$Value","label","damount","percent","size","SEODropdownList","productDimension","variantNameMapping","BuyboxProductConfigureMfrm","setActiveSwatchSelected","outOfStock","setOutOfStock","avList","variantsIDIter","_smallParcelProductATPCallForInventoryStatus","showViewCartLink","isLoadedprogressiveLeasingEstimator","vwoAccountId","vwoSdkKey","vwoClientInstance","vwoUserId","useVwoClientInstance","campaignKey","userId","track","Module","HtmlHeadInclude","hideRating","CustomSkeleton","isEyeBrowLoading","BuyboxDeliveryByMessage","isStoreLoading","x","circle","getValidCSSInput","parsedInput","parseFloat","unit","match","isNaN","_getValidCSSInput","_getValidCSSInput2","width","height","rest","_objectWithoutProperties","_excluded","borderRadius","_context$app$config","_context$app$config2","_limitedCampaignFinan","_selectedFinancingOff","_pdpCashbackFinancing","_everydayFinancingMes","_limitedCampaignFinan2","_selectedFinancingOff2","_selectedFinancingOff3","_cashbackFinancingMes","_limitedFinancingMess","_everydayFinancingMes2","priceComponent","selectedFinancingOffer","lowCostFinancingOffers","monthlyCost","stateUpdate","openModal","update","formattedMonthlyCost","monthlyCostStrippedZeros","substring","campaignRemainingCost","formattedCampaignCost","campaignCostStrippedZeros","cashbackFinancingMessage","pdpCashbackFinancingMessage","everydayFinancingMessage","limitedFinancingMessage","limitedCampaignFinancingMessage","sellingPriceDollars","toFixed","sellingPriceCents","dimensionDollars","dimensionCents","readyToShow","promotionalPeriod","validThroughDate","offerMinPurchase","offerMinPurchaseStrippedZeros","stopPropagation","binding","modules","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","prototype","RegistrationId","c","require","$type","da","path","runOn","iNM","ns","n","p","md","__bindings__","viewDictionary","cn","BaseStoreSelectorStateManager","listMapViewState","displayList","displayMap","preferredStoreLocalStorageKey","isMapModuleLoaded","_readFromToCookie","storeInfo","preferredStore","_unused","_context","selectedStoreLocationId","storeName","writeToCookie","arguments","StoreId","StoreName","Latitude","Longitude","_writeToCookie","latitude","longitude","lastInlineShownStoreInfo","_removeCookie","removeItem","setItem","cookieValue","computed","MapStoreSelectorStateManager","SERVICE_ENDPOINT","MAP_API_ENDPOINT","BingMapsApiKey","BingMapsEnabled","searchContent","jsonp","crypto","getRandomValues","Uint32Array","ChannelCountryRegionISOCode","encodeURI","geolocationApiUrl","requestUrl","script","createElement","setAttribute","remove","resourceSets","point","coordinates","body","appendChild","_document","StringExtensions","isNullOrEmpty","getElementById","currentWindowAPI","mapAPIReady","isMapApiLoaded","lang","market","_document2","_document3","defer","addEventListener","createStoreSelectorStateInput","GenericInput","getGenericActionDataAction","getGenericAction","module","exports","ReactDOM"],"sourceRoot":""}