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6CC,MAAO,GAAG,CAACF,KAAK,mBAAqBC,KAAK,qDAAsDC,MAAO,IAE5LC,KAAK,EACLC,GAAI,YACJC,EAAG,sBACHC,EAAG,YAEHC,IAAK,GAGLtF,GAAI,mCAOAoE,EAF4B,qDACXQ,EAAQ,MAQzBR,EAF4B,4CACXQ,EAAQ,MAMjC/G,OAAO0H,aAAe1H,OAAO0H,cAAgB,GAC7C1H,OAAO0H,aAAarB,QAApB,OACOrG,OAAO0H,aAAarB,SAAW,IAC/BD,EAAQC,SAGXrG,OAAO0H,aAAapB,YAApB,OACGtG,OAAO0H,aAAapB,aAAe,IACnCF,EAAQE,aAEY,MAAMqB,EAAiB,GAC9BA,EAAe,uEAAyE,CAChGb,EAAG,IAAMC,EAAQ,MACjBa,GAAI,2CAEpB5H,OAAO0H,aAAe1H,OAAO0H,cAAgB,GAC7C1H,OAAO0H,aAAaC,eAApB,OAC2B3H,OAAO0H,aAAaC,gBAAkB,IACtCA,UC1F3BE,EAAOC,QAAUhL,cCAjB+K,EAAOC,QAAUC","sources":["webpack://mattressfirm/./src/Utilities/analytics/utagCaller.ts?3814","webpack://mattressfirm/./src/Utilities/select-financing-offer.tsx?5f53","webpack://mattressfirm/./src/Utilities/splitPrice.ts?0ea8","webpack://mattressfirm/./src/actions/trigger-special-synchrony-financing.action.ts?1948","webpack://mattressfirm/./src/data-actions/financing-offer-state.action.ts?9faa","webpack://mattressfirm/./src/modules/mfrm-cc-offer-modal/components/CTA-Button/CTA-Button.tsx?2aa0","webpack://mattressfirm/./src/modules/mfrm-cc-offer-modal/components/action-card.tsx?27fe","webpack://mattressfirm/./src/modules/mfrm-cc-offer-modal/mfrm-cc-offer-modal.tsx?155a","webpack://mattressfirm/./src/modules/mfrm-cc-offer-modal/mfrm-cc-offer-modal.view.tsx?44e6","webpack://mattressfirm/./lib/mfrm-cc-offer-modal/module-registration.js?c606","webpack://mattressfirm/external var \"React\"?0d3b","webpack://mattressfirm/external var \"ReactDOM\"?853b"],"sourcesContent":["import { IAnalyticsConfiguration } from './clickTrack';\r\n\r\n// Interface for 3rd-party function. AKA utag.\r\ninterface ITealium {\r\n link(data: {}): void | false;\r\n view(data: {}): void | false;\r\n data(data: {}): void | false;\r\n}\r\n\r\nexport interface IPromotionConfig {\r\n event?: string | null;\r\n event_name?: string | null;\r\n search_term?: string | null;\r\n search_type?: string | null;\r\n event_category?: string | null;\r\n event_action?: string | null;\r\n event_label?: string | null;\r\n event_type?: string | null;\r\n event_noninteraction?: string;\r\n enhanced_action?: string | null;\r\n customer_email?: string | undefined;\r\n customer_phone_number?: string | undefined;\r\n first_name?: string | undefined;\r\n last_name?: string | undefined;\r\n address1?: string | undefined;\r\n address2?: string | undefined;\r\n city?: string | undefined;\r\n state?: string | undefined;\r\n zip_code?: string | undefined;\r\n order_subtotal?: string | undefined;\r\n order_currency?: string | undefined;\r\n country?: string | undefined;\r\n // productConfig?: IProductDataConfig;\r\n checkout_step?: string;\r\n checkout_option?:(string | undefined)[];\r\n checkout_type?:(string | undefined)[];\r\n product_id?: (string | undefined)[];\r\n product_name?: (string | undefined)[];\r\n product_category?: (string | undefined)[];\r\n product_brand?: (string | undefined)[];\r\n product_variant?: (string | undefined | number)[];\r\n product_price?: (string | undefined)[];\r\n product_quantity?: (string | undefined)[];\r\n product_url?: (string | undefined)[];\r\n product_size?: (string | undefined)[];\r\n product_image_url?: (string | undefined)[];\r\n core_item_flag?: string | null;\r\n funnel_type?: string | null;\r\n}\r\n\r\ninterface IProductDataConfig {\r\n product_variant?: (string | undefined)[];\r\n product_price?: (string | undefined)[];\r\n}\r\n\r\nexport interface IAnalyticsConfigurationData {\r\n productConfig?: IProductDataConfig;\r\n}\r\n\r\n\r\n// Legacy function\r\nexport const callUtag = async (objToCall: IPromotionConfig) => {\r\n void await callUtagLink(objToCall);\r\n};\r\n\r\n/**\r\n * Tealium dispatch click tracking.\r\n * @param objToCall\r\n */\r\nexport const callUtagLink = async (objToCall: IPromotionConfig | IAnalyticsConfiguration) => {\r\n try {\r\n Object.keys(objToCall).forEach(\r\n key => {\r\n if (objToCall[key] === null) {\r\n delete objToCall[key];\r\n }\r\n }\r\n );\r\n // If utag doesn't exist in the global scope, set as false.\r\n const utag: ITealium = global.hasOwnProperty('utag') ? global[\"utag\"] : false;\r\n if(utag) { utag.link(objToCall); }\r\n\r\n } catch (e) {\r\n console.log('Utag Error', e);\r\n }\r\n};\r\n\r\n/**\r\n * Tealium dispatch view tracking.\r\n * @param objToCall\r\n */\r\nexport const callUtagView = async (objToCall: {}) => {\r\n try {\r\n // If utag doesn't exist in the global scope, set as false.\r\n const utag: ITealium = global.hasOwnProperty('utag') ? global[\"utag\"] : false;\r\n if(utag) { utag.view(objToCall); }\r\n } catch (e) {\r\n console.log('utag View Error', e);\r\n }\r\n};\r\n\r\n/**\r\n * Not currently implemented.\r\n * @param objToCall\r\n * @param dataType\r\n */\r\nexport const callUtagData = ({ productConfig = {} }: IAnalyticsConfigurationData , dataType: string) => {\r\n try {\r\n // If utag doesn't exist in the global scope, set as false.\r\n const utag: ITealium = global.hasOwnProperty('utag') ? global[\"utag\"] : false;\r\n switch (dataType) {\r\n case 'data':\r\n // @ts-ignore\r\n if(utag) { utag.data = {...utag.data, ...productConfig}; }\r\n break;\r\n case '_data':\r\n // @ts-ignore\r\n utag_data = {...utag_data , ...productConfig};\r\n break;\r\n default:\r\n null;\r\n }\r\n } catch (e) {\r\n console.log('Utag Error', e);\r\n }\r\n};","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\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 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}\r\n}\r\n\r\nexport interface IFinancingOfferFormatted {\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 everydayFinancingOfferMessage:string;\r\n limitedFinancingOfferMessage:string;\r\n financingOfferDescription: RichText;\r\n disclaimer: RichText;\r\n specialCampaign?: IFinancingOfferCampaign;\r\n offerName?: string;\r\n checkoutDisplay?: {heading: string; details: string}\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 totalPrice: number | undefined;\r\n specialFinancingOffer?: IFinancingOffer[];\r\n synchronySpecialFinancingCondition?: boolean;\r\n specialFinancingEnable?: boolean;\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 = [], totalPrice = 0, specialFinancingOffer = [], synchronySpecialFinancingCondition = false, specialFinancingEnable = false }: 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 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 everydayFinancingOfferMessage:offer.everydayFinancingOfferMessage,\r\n limitedFinancingOfferMessage:offer.limitedFinancingOfferMessage,\r\n offerName: offer.offerName,\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 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 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 validLimitedTimeFinancingOffers.forEach((offer: IFinancingOffer) => {\r\n const minPurchase = offer.minPurchase ? offer.minPurchase : 0;\r\n\r\n if (totalPrice >= minPurchase && minPurchase > highestMinimumPurchase) {\r\n const currentOffer: IFinancingOfferFormatted = {\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: true,\r\n minPurchase: offer.minPurchase,\r\n everydayFinancingOfferMessage:offer.everydayFinancingOfferMessage,\r\n limitedFinancingOfferMessage:offer.limitedFinancingOfferMessage,\r\n monthlyOfferDetails: offer.monthlyOfferDetails,\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 };\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 (!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 = 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 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 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\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}\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","const splitPrice = (price: number = 0) => {\r\n if (price === 0) {\r\n return { dollars: '0', cents: '' };\r\n }\r\n const formattedPrice = price.toLocaleString('en-US', {\r\n style: 'currency',\r\n currency: 'USD'\r\n });\r\n\r\n const priceArr = formattedPrice.match(/(\\d|,)+/g);\r\n\r\n const dollars = priceArr?.[0] || '0';\r\n const cents = priceArr?.[1] || '00';\r\n\r\n return { dollars, cents };\r\n};\r\n\r\nexport default splitPrice;\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\n\r\n/**\r\n * TriggerSpecialSynchronyFinancing Input Action\r\n */\r\nexport class TriggerSpecialSynchronyFinancingInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n constructor() {}\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `TriggerSpecialSynchronyFinancing`;\r\n public getCacheObjectType = () => 'TriggerSpecialSynchronyFinancing';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface ITriggerSpecialSynchronyFinancingData {\r\n triggerSpecialFinancing: boolean;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new TriggerSpecialSynchronyFinancingInput();\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: TriggerSpecialSynchronyFinancingInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // TODO: Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { triggerSpecialFinancing: false };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'TriggerSpecialSynchronyFinancing',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*---------------------------------------------------------------------------------------------\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 // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `FinancingOfferState`;\r\n public getCacheObjectType = () => 'FinancingOfferState';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IFinancingOfferStateData {\r\n isOpen: boolean;\r\n totalPrice?: number;\r\n financingOffer?: IFinancingOfferFormatted;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new FinancingOfferStateInput();\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function 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 React from 'react';\r\n\r\ninterface ICTAButton {\r\n linkData: {\r\n linkUrl?: string;\r\n openInNewTab?: boolean;\r\n linkText?: string;\r\n };\r\n actionClick: () => void;\r\n actionKeyUp: any;\r\n labelText: string;\r\n}\r\n\r\nconst CTAButton: React.FC = (props) => {\r\n return (\r\n
\r\n {props.linkData && (\r\n props.actionClick()}\r\n onKeyUp={() => props.actionKeyUp()}\r\n className='mfrm-financing-modal__button'\r\n >\r\n {props.linkData.linkText}\r\n \r\n )}\r\n

\r\n {props.labelText}\r\n

\r\n
\r\n );\r\n};\r\n\r\nexport default CTAButton;\r\n","import * as React from 'react';\r\n\r\nexport interface IActionCardProps {\r\n className?: string;\r\n href?: string;\r\n target?: string;\r\n description?: string;\r\n heading: string;\r\n showIcon?: boolean;\r\n iconClassName?: string;\r\n onClick?(): void;\r\n onKeyUp?(): void;\r\n}\r\n\r\nclass ActionCard extends React.PureComponent {\r\n\r\n public render(): JSX.Element {\r\n const { className, href, target, heading, description, iconClassName, showIcon } = this.props;\r\n const actionCardClassName = className ? `${className} ${'mfrm-action-card'}` : 'mfrm-action-card';\r\n const actionCardDefaultClassName = 'mfrm-action-card';\r\n\r\n return (\r\n \r\n
{`${heading}, ${description}`}
\r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nexport default ActionCard;\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 React from 'react';\r\n\r\nimport { Modal, ModalBody, ModalHeader, format } from '@msdyn365-commerce-modules/utilities';\r\nimport { IImageSettings, Image, RichTextComponent, msdyn365Commerce } from '@msdyn365-commerce/core';\r\n\r\nimport { FinancingOfferStateInput } from '../../data-actions/financing-offer-state.action';\r\nimport {\r\n getCampaignRemainingCost,\r\n getValidSpecialCampaign,\r\n IFinancingOfferCampaign,\r\n IFinancingOfferFormatted\r\n} from '../../Utilities/select-financing-offer';\r\nimport splitPrice from '../../Utilities/splitPrice';\r\nimport { IMfrmCcOfferModalData } from './mfrm-cc-offer-modal.data';\r\nimport { IMfrmCcOfferModalProps } from './mfrm-cc-offer-modal.props.autogenerated';\r\nimport ActionCard from './components/action-card';\r\nimport CTAButton from './components/CTA-Button';\r\nimport { callUtagLink } from '../../Utilities/analytics/utagCaller';\r\n\r\nexport interface IMfrmCcOfferModalViewProps extends IMfrmCcOfferModalProps {\r\n content: React.ReactNode;\r\n}\r\n\r\n/**\r\n *\r\n * MfrmCcOfferModal component\r\n * @extends {React.PureComponent>}\r\n */\r\n\r\nclass MfrmCcOfferModal extends React.PureComponent> {\r\n private totalPrice: number = 0;\r\n private timer: NodeJS.Timeout | null;\r\n private moduleClassName: string = 'mfrm-financing-modal';\r\n\r\n constructor(props: IMfrmCcOfferModalProps) {\r\n super(props);\r\n this.timer = null;\r\n }\r\n\r\n public componentWillUnmount(): void {\r\n if (this.timer) {\r\n clearTimeout(this.timer);\r\n }\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n if (!this.props.data.financingOfferState.result?.financingOffer) {\r\n return null;\r\n } else {\r\n const { totalPrice, financingOffer } = this.props.data.financingOfferState.result;\r\n if (totalPrice) {\r\n this.totalPrice = totalPrice;\r\n }\r\n\r\n const viewProps: IMfrmCcOfferModalViewProps = {\r\n ...this.props,\r\n content: this._buildContent(financingOffer)\r\n };\r\n return this.props.renderView(viewProps);\r\n }\r\n }\r\n\r\n\r\n private onCallClick = () => {\r\n // @ts-ignore\r\n if (utag) {\r\n // @ts-ignore\r\n // tslint:disable-next-line: object-literal-key-quotes\r\n utag.link({\r\n event: 'call_engagement',\r\n event_type: 'call_engagement',\r\n event_category: 'call',\r\n event_action: 'synchrony modal click',\r\n event_label: 'call engagement',\r\n event_noninteraction: 'false'\r\n });\r\n }\r\n };\r\n\r\n private onCallKeyUp = (e: React.KeyboardEvent) => {\r\n if (e.keyCode === 13) {\r\n this.onCallClick;\r\n }\r\n };\r\n\r\n private onChatClick = (event: React.SyntheticEvent) => {\r\n event.preventDefault();\r\n this.timer = setTimeout(function () {\r\n // eslint-disable-next-line no-eval\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 // eslint-disable-next-line no-eval\r\n // eval(\r\n // `document.querySelectorAll('.embeddedServiceHelpButton')?.[0]?.classList.add('show-chat');`\r\n // );\r\n }, 1000);\r\n\r\n // @ts-ignore\r\n if (utag) {\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 this._toggleModal();\r\n };\r\n\r\n private onChatKeyUp = (e: React.KeyboardEvent) => {\r\n if (e.keyCode === 13) {\r\n this.onChatClick;\r\n }\r\n };\r\n\r\n private applyNowClick = () => {\r\n /* VSI customization START - 61856 Tracking */\r\n const {\r\n context: {\r\n actionContext: {\r\n requestContext: { url: requestUrl }\r\n }\r\n }\r\n } = this.props;\r\n if (requestUrl.requestUrl.href.includes('cart')) {\r\n void callUtagLink({\r\n event: 'Cart-Synchrony-Apply',\r\n event_category: 'Financing',\r\n event_action: 'Cart page Apply Now button click',\r\n event_label: 'Synchrony - Apply Now',\r\n event_noninteraction: 'false',\r\n event_type: 'synch_button'\r\n });\r\n } else if (requestUrl.requestUrl.href.includes('checkout')) {\r\n void callUtagLink({\r\n event: 'Payment-Synchrony-Apply',\r\n event_category: 'Financing',\r\n event_action: 'Payment page Apply Now button click',\r\n event_label: 'Synchrony - Apply Now',\r\n event_noninteraction: 'false',\r\n event_type: 'synch_button'\r\n });\r\n } else {\r\n void callUtagLink({\r\n event: 'PDP-Synchrony-Apply',\r\n event_category: 'Financing',\r\n event_action: 'Button',\r\n event_label: 'Synchrony - Apply Now',\r\n event_noninteraction: 'false',\r\n event_type: 'synch_button'\r\n });\r\n }\r\n /* VSI customization END - 61856 Tracking */\r\n };\r\n\r\n private prequalifyNowClick = () => {\r\n // @ts-ignore\r\n // tslint:disable-next-line: object-literal-key-quotes\r\n 'utag' in window && utag.link({\r\n event: 'PDP-Synchrony-Prequalify',\r\n event_category: 'Financing',\r\n event_action: 'Button',\r\n event_label: 'Synchrony - Prequalify Now',\r\n event_noninteraction: 'false',\r\n event_type: 'synch_button'\r\n });\r\n };\r\n\r\n private applyNowKeyUp = (e: React.KeyboardEvent) => {\r\n if (e.keyCode === 13) {\r\n this.applyNowClick;\r\n }\r\n };\r\n\r\n private prequalifyNowKeyUp = (e: React.KeyboardEvent) => {\r\n if (e.keyCode === 13) {\r\n this.prequalifyNowClick;\r\n }\r\n };\r\n\r\n private _toggleModal = (): void => {\r\n if (this.props.data.financingOfferState.result) {\r\n this.props.context.actionContext.update(new FinancingOfferStateInput(), {\r\n isOpen: !this.props.data.financingOfferState.result.isOpen\r\n });\r\n }\r\n };\r\n\r\n private _focusModal = (): void => {\r\n if (msdyn365Commerce.isBrowser && this.props.data.financingOfferState.result?.isOpen) {\r\n document.getElementById('financingModal')?.focus();\r\n }\r\n };\r\n private _getLogo(): React.ReactNode {\r\n const img = this.props.config.logoImage;\r\n\r\n const defaultImageSettings: IImageSettings = {\r\n viewports: {\r\n xs: { q: 'w=238&h=85&m=8', w: 0, h: 0 },\r\n sm: { q: 'w=238&h=85&m=8', w: 0, h: 0 },\r\n md: { q: 'w=322&h=115&m=8', w: 0, h: 0 },\r\n lg: { q: 'w=322&h=115&m=8', w: 0, h: 0 }\r\n },\r\n lazyload: true\r\n };\r\n\r\n return (\r\n
\r\n
\r\n \r\n
\r\n
\r\n );\r\n }\r\n\r\n private _getHeading(): React.ReactNode {\r\n const { header, subheader } = this.props.config;\r\n\r\n return (\r\n
\r\n
{header}
\r\n

{subheader}

\r\n
\r\n );\r\n }\r\n\r\n private _getStarted(): React.ReactNode {\r\n const { resources,\r\n config: { applyLink, phoneNo }\r\n } = this.props;\r\n\r\n const applyLinkData = applyLink && {\r\n linkText: applyLink.linkText || 'Link',\r\n linkUrl: applyLink.linkUrl?.destinationUrl,\r\n ariaLabel: applyLink.ariaLabel,\r\n openInNewTab: applyLink.openInNewTab\r\n };\r\n\r\n return (\r\n
\r\n
\r\n {resources.ccModalGetStartedText}\r\n
\r\n
\r\n \r\n this.onCallClick}\r\n onKeyUp={() => this.onCallKeyUp}\r\n />\r\n \r\n
\r\n