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B,EAC7B,IAAK,IAAI4C,EAAI,EAAGA,GAAKD,EAAE7N,OAAS,EAAG8N,IAEjC,GADArN,EAAKyK,EAAG2C,EAAEC,IACN5C,EAAElL,SAAW2M,EAAK,OAAOzB,EAE/ByC,EAAID,EAAIE,GAIZ,OADAnN,EAAKyK,EAAGiB,EAAY1B,EAAGiD,IAChBxC,QA3H4BW,GAAM,WAE7C,IAAIkC,EAAK,OACLC,EAAeD,EAAG7B,KACtB6B,EAAG7B,KAAO,WAAc,OAAO8B,EAAa3C,MAAMjI,KAAM6K,YACxD,IAAIhD,EAAS,KAAKuB,MAAMuB,GACxB,OAAyB,IAAlB9C,EAAOjL,QAA8B,MAAdiL,EAAO,IAA4B,MAAdA,EAAO,MAwHrBa","sources":["webpack://mattressfirm/./src/Utilities/select-financing-offer.tsx?5f53","webpack://mattressfirm/./src/actions/payment-redirect-to-order-confirmation.action.ts?c6dc","webpack://mattressfirm/./src/actions/paypalsuccesstrigger.action.ts?ccb0","webpack://mattressfirm/./src/actions/update-monthly-payment.action.ts?0e43","webpack://mattressfirm/./src/data-actions/financing-offer-state.action.ts?9faa","webpack://mattressfirm/./src/data-actions/get-card-payment-accept-point.override.action.ts?a2c5","webpack://mattressfirm/./src/data-actions/payment-error-state.action.ts?5f0f","webpack://mattressfirm/./src/data-actions/toggle-submit-order-button.action.ts?9a11","webpack://mattressfirm/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/modules/es.string.match.js?a69e","webpack://mattressfirm/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/modules/es.string.split.js?9fc2"],"sourcesContent":["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 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}\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}\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\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 cashbackFinancingOfferMessage: offer.cashbackFinancingOfferMessage,\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 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\n\r\n/**\r\n * PaymentRedirectToOrderConfirmation Input Action\r\n */\r\nexport class PaymentRedirectToOrderConfirmationInput implements Msdyn365.IActionInput {\r\n // Construct the input needed to run the action\r\n constructor() {}\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 = () => `PaymentRedirectToOrderConfirmation`;\r\n public getCacheObjectType = () => 'PaymentRedirectToOrderConfirmation';\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 IPaymentRedirectToOrderConfirmationData {\r\n redirectToOrderConfirmation: boolean;\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 PaymentRedirectToOrderConfirmationInput();\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 paymentRedirectAction(input: PaymentRedirectToOrderConfirmationInput, 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 { redirectToOrderConfirmation: false };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >paymentRedirectAction,\r\n // Give your data action a unique id\r\n id: 'PaymentRedirectToOrderConfirmation',\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\n\r\n/**\r\n * Paypalsuccesstrigger Input Action\r\n */\r\nexport class PaypalsuccesstriggerInput implements Msdyn365.IActionInput {\r\n // Construct the input needed to run the action\r\n constructor() {}\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 = () => `PayPalSuccessFlag`;\r\n public getCacheObjectType = () => 'PayPalSuccessFlag';\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 IPaypalsuccesstriggerData {\r\n isPaymentSuccess: boolean;\r\n paymentSuccessEmail: string;\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 PaypalsuccesstriggerInput();\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: PaypalsuccesstriggerInput, 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 { isPaymentSuccess: false, paymentSuccessEmail: '' };\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: 'Paypalsuccesstrigger',\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\n/**\r\n * UpdateMonthlyPayment Input Action\r\n */\r\nexport class UpdateMonthlyPaymentInput implements Msdyn365.IActionInput {\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `updateMonthlyPayment`;\r\n public getCacheObjectType = () => 'updateMonthlyPayment';\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 IUpdateMonthlyPaymentData {\r\n updateTotal: 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 UpdateMonthlyPaymentInput();\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 updateMonthlyPayment(input: UpdateMonthlyPaymentInput, ctx: Msdyn365.IActionContext): Promise {\r\n return { updateTotal: '0' };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n id:'UpdateMonthlyPayment',\r\n action: >updateMonthlyPayment,\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","/*---------------------------------------------------------------------------------------------\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 { buildCacheKey } from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n CacheType, createObservableDataAction, IAction, IActionContext, IActionInput,\r\n ICommerceApiSettings, ICreateActionContext, isEmptyOrNullObject\r\n} from '@msdyn365-commerce/core';\r\nimport { getCheckoutState, ICheckoutState } from '@msdyn365-commerce/global-state';\r\nimport {\r\n getCardPaymentAcceptPointAsync\r\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\r\nimport {\r\n CardPaymentAcceptPoint, CommerceProperty\r\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport get from 'lodash/get';\r\nimport { selectFinancingOffer } from '../Utilities/select-financing-offer';\r\nimport { getSetEcomFinanceOption, getSetEcomFinancePlanId, getSetGrandTotal, getSetSelectedPaymentRadio } from '../Utilities/cart-utils';\r\nimport { hasArray } from '../Utilities/emtpyChecker';\r\nimport { CheckoutSkeletonInput } from './checkout-skeleton.action';\r\nimport { isSafari } from '../Utilities/checkout-utils';\r\n\r\nexport interface IGetCardPaymentAcceptPointInput {\r\n showBillingAddress?: boolean;\r\n paymenTenderType?: string;\r\n apiSettings: ICommerceApiSettings;\r\n selectedOfferName?: string;\r\n isReload?: boolean;\r\n amountDue?: number;\r\n synchronySpecialFinancingCondition?: boolean;\r\n}\r\n\r\n/**\r\n * GetCardPaymentAcceptPointInput - Input for create GetCardPaymentAcceptPoint\r\n */\r\nexport class GetCardPaymentAcceptPointInput implements IActionInput {\r\n public showBillingAddress?: boolean;\r\n public paymenTenderType?: string;\r\n public selectedOfferName?: string;\r\n public amountDue?: number;\r\n public synchronySpecialFinancingCondition?: boolean;\r\n private apiSettings: ICommerceApiSettings;\r\n public isReload?: boolean;\r\n\r\n constructor(input: IGetCardPaymentAcceptPointInput) {\r\n this.showBillingAddress = input.showBillingAddress;\r\n this.paymenTenderType = input.paymenTenderType;\r\n this.apiSettings = input.apiSettings;\r\n this.selectedOfferName = input.selectedOfferName;\r\n this.isReload = input.isReload;\r\n this.amountDue = input.amountDue;\r\n this.synchronySpecialFinancingCondition = input.synchronySpecialFinancingCondition;\r\n }\r\n\r\n public getCacheKey = () => buildCacheKey(`CardPaymentAcceptPoint${this.paymenTenderType ? `-${this.paymenTenderType}` : ''}`, this.apiSettings);\r\n public getCacheObjectType = () => `CardPaymentAcceptPoint`;\r\n public dataCacheType = (): CacheType => 'none';\r\n}\r\n\r\nexport const createCheckoutPaymentInstrumentInput = (inputData: ICreateActionContext) => {\r\n // @ts-ignore\r\n const { showBillingAddress, paymenTenderType, amountDue, synchronySpecialFinancingCondition, lastGetAPITrigger, expressSkeleton, expressPhoneNotavailable, expressLoaderRunning } = inputData.config;\r\n const getCardPaymentAcceptPointInput = {\r\n showBillingAddres: showBillingAddress,\r\n paymenTenderType: paymenTenderType,\r\n apiSettings: inputData.requestContext.apiSettings,\r\n amountDue,\r\n synchronySpecialFinancingCondition,\r\n lastGetAPITrigger,\r\n expressSkeleton,\r\n expressPhoneNotavailable,\r\n expressLoaderRunning\r\n };\r\n\r\n return new GetCardPaymentAcceptPointInput(getCardPaymentAcceptPointInput);\r\n};\r\n\r\n/**\r\n * Calls the Retail API and returns a cart object based on the passed GetCartInput\r\n */\r\nexport async function getCardPaymentAcceptPointAction(\r\n input: GetCardPaymentAcceptPointInput,\r\n ctx: IActionContext\r\n): Promise {\r\n // If no cart ID is provided in input, we need to create a cart object\r\n if (!input) {\r\n ctx.telemetry.exception(new Error('[getCardPaymentAcceptPointAction] No valid Input was provided, failing'));\r\n throw new Error('[getCardPaymentAcceptPointAction] No valid Input was provided, failing');\r\n }\r\n\r\n const { showBillingAddress, paymenTenderType, amountDue = 0, synchronySpecialFinancingCondition } = input;\r\n const checkoutState: ICheckoutState = await getCheckoutState(ctx).catch((error: Error) => {\r\n ctx.telemetry.exception(error);\r\n throw error;\r\n });\r\n\r\n if (\r\n isEmptyOrNullObject(checkoutState) ||\r\n isEmptyOrNullObject(checkoutState.checkoutCart) ||\r\n isEmptyOrNullObject(checkoutState.checkoutCart.cart)\r\n ) {\r\n ctx.telemetry.exception(new Error('[getCardPaymentAcceptPointAction] Unable to get cart'));\r\n throw new Error('[getCardPaymentAcceptPointAction] Unable to get cart');\r\n }\r\n\r\n if (!checkoutState.checkoutCart.cart.CartLines || !checkoutState.checkoutCart.cart.CartLines.length) {\r\n ctx.telemetry.exception(new Error('[getCardPaymentAcceptPointAction] Cart is empty'));\r\n throw new Error('[getCardPaymentAcceptPointAction] Cart is empty');\r\n }\r\n\r\n const requestUrl =\r\n typeof ctx.requestContext.url.requestUrl === 'string'\r\n ? new URL(ctx.requestContext.url.requestUrl)\r\n : ctx.requestContext.url.requestUrl;\r\n const origin = get(window, 'location.origin') || requestUrl.origin;\r\n const zeroAmount = 0;\r\n\r\n const cardPaymentAcceptSettings = {\r\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.CardPaymentAcceptSettings',\r\n HostPageOrigin: origin,\r\n AdaptorPath: `${origin}/Connectors/` || origin,\r\n CardPaymentEnabled: false,\r\n CardTokenizationEnabled: true,\r\n ...(!showBillingAddress && { HideBillingAddress: true }),\r\n ...(paymenTenderType && { TenderTypeId: paymenTenderType }),\r\n PaymentAmount: amountDue || zeroAmount\r\n };\r\n\r\n const { everydayFinancingOffers, addPaymentMethodName, extensionKeyPlanId, limitedTimeFinancingOffers, specialFinancingOffer, specialFinancingEnable, cashbackFinancingEnable, cashBackFinancingOffer } = ctx.requestContext.app.config;\r\n const getOffer = selectFinancingOffer({\r\n limitedTimeFinancingOffers,\r\n everydayFinancingOffers,\r\n totalPrice: getSetGrandTotal('get'),\r\n specialFinancingOffer,\r\n synchronySpecialFinancingCondition,\r\n specialFinancingEnable,\r\n cashbackFinancingEnable,\r\n cashBackFinancingOffer\r\n });\r\n // all financing offers\r\n const allOffers = [...(hasArray(limitedTimeFinancingOffers) || []), ...(hasArray(everydayFinancingOffers) || []), ...(hasArray(specialFinancingOffer) || []), ...(hasArray(cashBackFinancingOffer) || [])];\r\n // selected offer name\r\n const offerName = ((synchronySpecialFinancingCondition && specialFinancingEnable) || getOffer?.isCashBack || getOffer?.isLTO) ? getOffer?.offerName : (input.selectedOfferName || getOffer?.offerName);\r\n const isReload = input.isReload;\r\n const paymentTenderType = paymenTenderType?.toLowerCase().trim();\r\n const defaultVal =\r\n allOffers?.find((item: { offerName: string }) => item.offerName?.toLowerCase() === offerName?.toLowerCase());\r\n const isSynchrony = paymentTenderType === addPaymentMethodName?.toLowerCase();\r\n if(isSynchrony){\r\n getSetEcomFinanceOption('set', defaultVal?.offerName);\r\n getSetEcomFinancePlanId('set', defaultVal?.planID);\r\n }\r\n\r\n // VSI Customization - Following code checks when to hide Payment skeleton when paypal radio is selected in SAFARI\r\n // Problem is load event is not fired in SAFARI sometimes because when the data is cached, the load event fires before you attached the handler.\r\n\r\n const _selectedPaymentRadio: string = getSetSelectedPaymentRadio('get') || '';\r\n const selectedPaymentRadio = _selectedPaymentRadio?.toLowerCase().trim();\r\n const paypalTenderType = ctx.requestContext.app.config.paymentTypes?.paypal?.toLowerCase().trim();\r\n // Check if paypal radio button is selected, hide the payment skeleton (Following logic is for only safari browser as load event doesn't trigger for paypal iframe in safari)\r\n const isPayPal = isSafari() && selectedPaymentRadio === paypalTenderType && selectedPaymentRadio === paymentTenderType;\r\n\r\n const ep: CommerceProperty[] = isSynchrony ? [{Key: extensionKeyPlanId, Value: { StringValue: defaultVal?.planID}}] : [];\r\n if (isReload) {\r\n return getCardPaymentAcceptPointAsync(\r\n { callerContext: ctx, bypassCache: 'get' },\r\n checkoutState.checkoutCart.cart.Id,\r\n cardPaymentAcceptSettings,\r\n ep\r\n ).then(cardPaymentAcceptPoint => {\r\n if (!cardPaymentAcceptPoint.AcceptPageUrl && !cardPaymentAcceptPoint.AcceptPageContent) {\r\n throw new Error(\r\n '[getCardPaymentAcceptPointAction] Payment Accept Page has neither return AcceptPageUrl nor AcceptPageContent in updatePaymentAcceptPageData'\r\n );\r\n }\r\n if(isPayPal) {\r\n ctx.update(new CheckoutSkeletonInput(), { showPaymentSkeleton: false });\r\n }\r\n if(selectedPaymentRadio?.toLowerCase() === paymenTenderType?.toLowerCase()) {\r\n ctx.update(new CheckoutSkeletonInput(), { showPaymentSkeleton: false });\r\n }\r\n return cardPaymentAcceptPoint;\r\n })\r\n .catch(error => {\r\n if(error) {\r\n ctx.update(new CheckoutSkeletonInput(), { showPaymentSkeleton: false, expressSkeleton: false, isPaymentApiFailed: true });\r\n }\r\n ctx.telemetry.exception(error);\r\n ctx.telemetry.debug('Unable to get Card Payment Accept Point');\r\n throw error;\r\n });\r\n }\r\n return {};\r\n}\r\n\r\nexport const getCardPaymentAcceptPointActionDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce/checkout-payment-instrument/get-card-payment-accept-point',\r\n action: >getCardPaymentAcceptPointAction,\r\n input: createCheckoutPaymentInstrumentInput\r\n});\r\n\r\nexport default getCardPaymentAcceptPointActionDataAction;","/*!\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 * PaymentErrorState Input Action\r\n */\r\nexport class PaymentErrorStateInput implements Msdyn365.IActionInput {\r\n // Construct the input needed to run the action\r\n constructor() { }\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 = () => `PaymentErrorState`;\r\n public getCacheObjectType = () => 'PaymentErrorState';\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 IPaymentErrorState {\r\n errorTitle: string;\r\n errorMessage: string;\r\n progressiveLinkText: string;\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 PaymentErrorStateInput();\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: PaymentErrorStateInput, 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 { errorTitle: \"\", errorMessage: \"\", progressiveLinkText: \"\" };\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: 'PaymentErrorState',\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\n\r\n/**\r\n * ToggleSynchronySubmitOrderButton Input Action\r\n */\r\nexport class ToggleSubmitOrderButtonInput implements Msdyn365.IActionInput {\r\n // Construct the input needed to run the action\r\n constructor() {}\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 = () => `toggle-submit-order-button`;\r\n public getCacheObjectType = () => 'toggle-submit-order-button';\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 IToggleSubmitOrderButtonData {\r\n isSynchronySelected: boolean;\r\n isPaypalSelected: boolean;\r\n isCreditcardSelected: boolean;\r\n isCcFieldsNotPopulated: boolean;\r\n isProgressiveSelected: boolean;\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 ToggleSubmitOrderButtonInput();\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: ToggleSubmitOrderButtonInput, 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 { isSynchronySelected: false, isPaypalSelected: false, isCreditcardSelected: false, isCcFieldsNotPopulated: true, isProgressiveSelected: false };\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: 'ToggleSubmitOrderButton',\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","'use strict';\nvar call = require('../internals/function-call');\nvar fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic');\nvar anObject = require('../internals/an-object');\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\nvar toLength = require('../internals/to-length');\nvar toString = require('../internals/to-string');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar getMethod = require('../internals/get-method');\nvar advanceStringIndex = require('../internals/advance-string-index');\nvar regExpExec = require('../internals/regexp-exec-abstract');\n\n// @@match logic\nfixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNative) {\n return [\n // `String.prototype.match` method\n // https://tc39.es/ecma262/#sec-string.prototype.match\n function match(regexp) {\n var O = requireObjectCoercible(this);\n var matcher = isNullOrUndefined(regexp) ? undefined : getMethod(regexp, MATCH);\n return matcher ? call(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString(O));\n },\n // `RegExp.prototype[@@match]` method\n // https://tc39.es/ecma262/#sec-regexp.prototype-@@match\n function (string) {\n var rx = anObject(this);\n var S = toString(string);\n var res = maybeCallNative(nativeMatch, rx, S);\n\n if (res.done) return res.value;\n\n if (!rx.global) return regExpExec(rx, S);\n\n var fullUnicode = rx.unicode;\n rx.lastIndex = 0;\n var A = [];\n var n = 0;\n var result;\n while ((result = regExpExec(rx, S)) !== null) {\n var matchStr = toString(result[0]);\n A[n] = matchStr;\n if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);\n n++;\n }\n return n === 0 ? null : A;\n }\n ];\n});\n","'use strict';\nvar apply = require('../internals/function-apply');\nvar call = require('../internals/function-call');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic');\nvar anObject = require('../internals/an-object');\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\nvar isRegExp = require('../internals/is-regexp');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar speciesConstructor = require('../internals/species-constructor');\nvar advanceStringIndex = require('../internals/advance-string-index');\nvar toLength = require('../internals/to-length');\nvar toString = require('../internals/to-string');\nvar getMethod = require('../internals/get-method');\nvar arraySlice = require('../internals/array-slice-simple');\nvar callRegExpExec = require('../internals/regexp-exec-abstract');\nvar regexpExec = require('../internals/regexp-exec');\nvar stickyHelpers = require('../internals/regexp-sticky-helpers');\nvar fails = require('../internals/fails');\n\nvar UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;\nvar MAX_UINT32 = 0xFFFFFFFF;\nvar min = Math.min;\nvar $push = [].push;\nvar exec = uncurryThis(/./.exec);\nvar push = uncurryThis($push);\nvar stringSlice = uncurryThis(''.slice);\n\n// Chrome 51 has a buggy \"split\" implementation when RegExp#exec !== nativeExec\n// Weex JS has frozen built-in prototypes, so use try / catch wrapper\nvar SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {\n // eslint-disable-next-line regexp/no-empty-group -- required for testing\n var re = /(?:)/;\n var originalExec = re.exec;\n re.exec = function () { return originalExec.apply(this, arguments); };\n var result = 'ab'.split(re);\n return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';\n});\n\n// @@split logic\nfixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNative) {\n var internalSplit;\n if (\n 'abbc'.split(/(b)*/)[1] === 'c' ||\n // eslint-disable-next-line regexp/no-empty-group -- required for testing\n 'test'.split(/(?:)/, -1).length !== 4 ||\n 'ab'.split(/(?:ab)*/).length !== 2 ||\n '.'.split(/(.?)(.?)/).length !== 4 ||\n // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing\n '.'.split(/()()/).length > 1 ||\n ''.split(/.?/).length\n ) {\n // based on es5-shim implementation, need to rework it\n internalSplit = function (separator, limit) {\n var string = toString(requireObjectCoercible(this));\n var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;\n if (lim === 0) return [];\n if (separator === undefined) return [string];\n // If `separator` is not a regex, use native split\n if (!isRegExp(separator)) {\n return call(nativeSplit, string, separator, lim);\n }\n var output = [];\n var flags = (separator.ignoreCase ? 'i' : '') +\n (separator.multiline ? 'm' : '') +\n (separator.unicode ? 'u' : '') +\n (separator.sticky ? 'y' : '');\n var lastLastIndex = 0;\n // Make `global` and avoid `lastIndex` issues by working with a copy\n var separatorCopy = new RegExp(separator.source, flags + 'g');\n var match, lastIndex, lastLength;\n while (match = call(regexpExec, separatorCopy, string)) {\n lastIndex = separatorCopy.lastIndex;\n if (lastIndex > lastLastIndex) {\n push(output, stringSlice(string, lastLastIndex, match.index));\n if (match.length > 1 && match.index < string.length) apply($push, output, arraySlice(match, 1));\n lastLength = match[0].length;\n lastLastIndex = lastIndex;\n if (output.length >= lim) break;\n }\n if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop\n }\n if (lastLastIndex === string.length) {\n if (lastLength || !exec(separatorCopy, '')) push(output, '');\n } else push(output, stringSlice(string, lastLastIndex));\n return output.length > lim ? arraySlice(output, 0, lim) : output;\n };\n // Chakra, V8\n } else if ('0'.split(undefined, 0).length) {\n internalSplit = function (separator, limit) {\n return separator === undefined && limit === 0 ? [] : call(nativeSplit, this, separator, limit);\n };\n } else internalSplit = nativeSplit;\n\n return [\n // `String.prototype.split` method\n // https://tc39.es/ecma262/#sec-string.prototype.split\n function split(separator, limit) {\n var O = requireObjectCoercible(this);\n var splitter = isNullOrUndefined(separator) ? undefined : getMethod(separator, SPLIT);\n return splitter\n ? call(splitter, separator, O, limit)\n : call(internalSplit, toString(O), separator, limit);\n },\n // `RegExp.prototype[@@split]` method\n // https://tc39.es/ecma262/#sec-regexp.prototype-@@split\n //\n // NOTE: This cannot be properly polyfilled in engines that don't support\n // the 'y' flag.\n function (string, limit) {\n var rx = anObject(this);\n var S = toString(string);\n var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);\n\n if (res.done) return res.value;\n\n var C = speciesConstructor(rx, RegExp);\n\n var unicodeMatching = rx.unicode;\n var flags = (rx.ignoreCase ? 'i' : '') +\n (rx.multiline ? 'm' : '') +\n (rx.unicode ? 'u' : '') +\n (UNSUPPORTED_Y ? 'g' : 'y');\n\n // ^(? + rx + ) is needed, in combination with some S slicing, to\n // simulate the 'y' flag.\n var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags);\n var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;\n if (lim === 0) return [];\n if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];\n var p = 0;\n var q = 0;\n var A = [];\n while (q < S.length) {\n splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;\n var z = callRegExpExec(splitter, UNSUPPORTED_Y ? stringSlice(S, q) : S);\n var e;\n if (\n z === null ||\n (e = min(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p\n ) {\n q = advanceStringIndex(S, q, unicodeMatching);\n } else {\n push(A, stringSlice(S, p, q));\n if (A.length === lim) return A;\n for (var i = 1; i <= z.length - 1; i++) {\n push(A, z[i]);\n if (A.length === lim) return A;\n }\n q = p = e;\n }\n }\n push(A, stringSlice(S, p));\n return A;\n }\n ];\n}, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);\n"],"names":["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","_ref","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","length","forEach","currentOfferAccepted","noInterestFor","Math","ceil","offerName","FinancingOfferDataOnPage","checkoutDisplay","push","isAfter","cashBackOffer","isCashBack","cashBackPercentageAmount","cashbackBannerDetails","currentOffer","specialCampaignOffer","validCampaign","undefined","_offer$offerName","maxPurchase","toLowerCase","_offer$financingOffer","_offer$defaultNumberO","LCO","lowCostFinancingOfferMessage","replace","defaultNumberOfMonths","toString","lowCostOfferDetailsOnCart","PaymentRedirectToOrderConfirmationInput","constructor","getCacheKey","getCacheObjectType","dataCacheType","Msdyn365","action","async","input","ctx","redirectToOrderConfirmation","id","args","PaypalsuccesstriggerInput","isPaymentSuccess","paymentSuccessEmail","UpdateMonthlyPaymentInput","updateTotal","FinancingOfferStateInput","isOpen","GetCardPaymentAcceptPointInput","buildCacheKey","this","paymenTenderType","apiSettings","showBillingAddress","selectedOfferName","isReload","amountDue","createCheckoutPaymentInstrumentInput","inputData","lastGetAPITrigger","expressSkeleton","expressPhoneNotavailable","expressLoaderRunning","config","getCardPaymentAcceptPointInput","showBillingAddres","requestContext","getCardPaymentAcceptPointAction","_ctx$requestContext$a","telemetry","exception","Error","checkoutState","getCheckoutState","catch","error","isEmptyOrNullObject","checkoutCart","cart","CartLines","requestUrl","url","URL","origin","get","window","cardPaymentAcceptSettings","_objectSpread","HostPageOrigin","AdaptorPath","CardPaymentEnabled","CardTokenizationEnabled","HideBillingAddress","TenderTypeId","PaymentAmount","addPaymentMethodName","extensionKeyPlanId","app","getOffer","getSetGrandTotal","allOffers","hasArray","paymentTenderType","trim","defaultVal","find","item","_item$offerName","isSynchrony","getSetEcomFinanceOption","getSetEcomFinancePlanId","planID","_selectedPaymentRadio","getSetSelectedPaymentRadio","selectedPaymentRadio","paypalTenderType","paymentTypes","paypal","isPayPal","isSafari","ep","Key","Value","StringValue","getCardPaymentAcceptPointAsync","callerContext","bypassCache","Id","then","cardPaymentAcceptPoint","AcceptPageUrl","AcceptPageContent","update","CheckoutSkeletonInput","showPaymentSkeleton","isPaymentApiFailed","debug","getCardPaymentAcceptPointActionDataAction","createObservableDataAction","PaymentErrorStateInput","errorTitle","errorMessage","progressiveLinkText","ToggleSubmitOrderButtonInput","isSynchronySelected","isPaypalSelected","isCreditcardSelected","isCcFieldsNotPopulated","isProgressiveSelected","call","fixRegExpWellKnownSymbolLogic","anObject","isNullOrUndefined","toLength","requireObjectCoercible","getMethod","advanceStringIndex","regExpExec","MATCH","nativeMatch","maybeCallNative","regexp","O","matcher","RegExp","string","rx","S","res","done","value","global","fullUnicode","unicode","lastIndex","result","A","n","matchStr","apply","uncurryThis","isRegExp","speciesConstructor","arraySlice","callRegExpExec","regexpExec","stickyHelpers","fails","UNSUPPORTED_Y","MAX_UINT32","min","$push","exec","stringSlice","slice","SPLIT","nativeSplit","internalSplit","split","separator","limit","lim","match","lastLength","output","flags","ignoreCase","multiline","sticky","lastLastIndex","separatorCopy","source","index","splitter","C","unicodeMatching","p","q","e","z","i","re","originalExec","arguments"],"sourceRoot":""}