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H,IACpC/H,GAAsB,iBAARA,GAAqBA,EAAImL,SAASiG,IAI9CrJ,EAAiB/H,EAAI2N,QAAQyD,EAAkBrJ,GAH7C/H,C","sources":["webpack://nocodenodeweb/./src/client/components/layout/PaymentWrapper.tsx","webpack://nocodenodeweb/./src/client/components/payment/DisclaimerPolicy.tsx","webpack://nocodenodeweb/./src/client/components/payment/index.tsx","webpack://nocodenodeweb/./src/client/components/ContainerTemplates/SplitScreenBase/index.tsx","webpack://nocodenodeweb/./src/client/components/ContainerTemplates/SingleScreenBase/index.tsx","webpack://nocodenodeweb/./src/client/components/ContainerTemplates/MainBaseContainer/styles.ts","webpack://nocodenodeweb/./src/client/components/ContainerTemplates/MainBaseContainer/index.tsx","webpack://nocodenodeweb/./src/client/components/Paywall/prefillData.ts","webpack://nocodenodeweb/./src/client/components/Paywall/index.tsx","webpack://nocodenodeweb/./src/client/helpers/processURL.ts","webpack://nocodenodeweb/./src/client/components/App/index.tsx","webpack://nocodenodeweb/./src/client/bootstraps/bootstrapPayment.ts","webpack://nocodenodeweb/./src/client/components/Settings/utils.ts","webpack://nocodenodeweb/./src/client/components/buttons/serverClientPayloadKeyMapper.ts","webpack://nocodenodeweb/./src/client/components/buttons/types.ts","webpack://nocodenodeweb/./src/client/contexts/WorldReadyContext.tsx","webpack://nocodenodeweb/./src/client/helpers/ucpConfig.ts","webpack://nocodenodeweb/./src/client/utils/constants.ts","webpack://nocodenodeweb/./src/client/utils/utils.ts","webpack://nocodenodeweb/./src/common/buttonConfigValidations.ts","webpack://nocodenodeweb/./src/common/constants.ts","webpack://nocodenodeweb/./src/common/replaceGeoUrl.ts"],"sourcesContent":["import React from 'react';\nimport { Container } from '@paypalcorp/pp-react';\nimport { css } from '@emotion/react';\n\ntype PaymentLayoutProps = {\n children: React.ReactNode | undefined;\n};\n\nconst containerStyles = css`\n width: auto;\n margin-top: 4.5rem;\n max-width: 28.25rem;\n box-sizing: border-box;\n padding: 0 1rem;\n\n @media (min-width: 47rem) {\n max-width: 28.25rem;\n }\n`;\n\nconst PaymentWrapper = ({ children }: PaymentLayoutProps) => {\n return (\n \n {children}\n \n );\n};\n\nexport default PaymentWrapper;\n","import React, { useContext } from 'react';\nimport { CaptionText, Link } from '@paypalcorp/pp-react';\nimport { Context as WorldReadyContext } from '@paypalcorp/worldready-react';\nimport { css } from '@emotion/react';\nimport { getLocalizedString, WorldReadyProps } from '@client/utils/localeHelper';\nimport { recordClick } from '@common/analytics';\nimport commonStyles from '@components/common/commonStyles';\n\nconst style = css`\n ${commonStyles.Row()};\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n margin-top: 2rem;\n row-gap: 2rem;\n`;\n\nconst DisclaimerPolicy = () => {\n const worldReady = useContext(WorldReadyContext);\n\n return (\n
\n \n {getLocalizedString(worldReady, 'payment.text.disclaimerPolicy')}\n \n {\n recordClick({\n eventName: 'disclaimer_link_clicked',\n pageName: 'payment'\n });\n }}\n >\n {getLocalizedString(worldReady, 'payment.text.reportThisLink')}\n \n
\n );\n};\n\nexport default DisclaimerPolicy;\n","import React, { useEffect } from 'react';\nimport { useParams } from 'react-router-dom';\nimport { Col } from '@paypalcorp/pp-react';\nimport { buildAdditionalTags, recordImpression } from '@common/analytics';\nimport {\n ButtonWrapperVariation,\n HostedButtonDetails as HostedButtonDetailsType\n} from '@customTypes/client/Common';\nimport PaymentWrapper from '@components/layout/PaymentWrapper';\nimport { useAppContext } from '@client/contexts/AppContext';\nimport { CaptureStatus } from '@client/utils/constants';\nimport commonStyles from '@components/common/commonStyles';\nimport StackedButtonsContainer from '@components/ButtonsStack/Container';\nimport {\n PaymentContextProvider,\n PaymentContextValuesGenerator\n} from '@client/contexts/PaymentContext';\nimport { extractSourceAndFlowType } from '@common/fpti';\nimport ErrorMessage from './ErrorMessage';\nimport HostedButtonDetails from './HostedButtonDetails';\nimport DisclaimerPolicy from './DisclaimerPolicy';\n\nexport const useOnCaptureFailEffect = (\n captureStatus: string,\n fptiAdditionalTags: ReturnType,\n errorMessage: string\n) => {\n useEffect(() => {\n if (captureStatus === CaptureStatus.FAILED || captureStatus === CaptureStatus.AUTH_FAILED) {\n recordImpression({\n ...fptiAdditionalTags,\n pageName: 'payment',\n eventName: 'payment_failed_alert_shown',\n error_message: errorMessage || 'default'\n });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [captureStatus]);\n};\n\nconst Payment = () => {\n const { hostedButtonId } = useParams();\n const appContext = useAppContext();\n const enablePaywall = appContext?.enablePaywall;\n const merchantSettings = appContext?.merchantSettings;\n const isSettingsEnabled = appContext?.isSettingsEnabled;\n const hostedButtonDetails = appContext?.hostedButtonDetails as HostedButtonDetailsType;\n const { sourceType, flowType } = extractSourceAndFlowType(appContext?.fptiData);\n const merchantSettingsOptions = { merchantSettings, isSettingsEnabled };\n const fptiAdditionalTags = buildAdditionalTags(\n hostedButtonDetails,\n sourceType,\n flowType,\n enablePaywall,\n merchantSettingsOptions\n );\n const paymentContextValues = PaymentContextValuesGenerator(fptiAdditionalTags);\n\n useOnCaptureFailEffect(\n paymentContextValues.captureStatus,\n fptiAdditionalTags,\n paymentContextValues.errorMessage\n );\n\n return (\n \n \n \n \n \n {!!hostedButtonId && (\n \n )}\n \n \n \n \n );\n};\n\nexport default Payment;\n","import React from 'react';\nimport cx from 'classnames';\n\ninterface SplitScreenBaseProps {\n leftChild: React.ReactNode;\n rightChild: React.ReactNode;\n isMobileReverseOrder?: boolean;\n}\nconst SplitScreenBase = ({ leftChild, rightChild, isMobileReverseOrder }: SplitScreenBaseProps) => {\n return (\n <>\n
\n {leftChild}\n
\n
{rightChild}
\n \n );\n};\n\nexport default SplitScreenBase;\n","import React from 'react';\n\n/* As for now (August 2024), this SingleScreenBase is only used by Subscriptions */\nconst SingleScreenBase = ({ children }) => {\n return
{children}
;\n};\n\nexport default SingleScreenBase;\n","import { css } from '@emotion/react';\nimport { PAYPAL_THEME } from '@paypalcorp/pp-react';\n\n/*\n JS SDK buttons has a min-width of 150px.\n We noticed an issue with new button presentment on paywall, a 2-column button layout, \n buttons were overlapping the enclosed container on sysSizeMediaMd breakpoint.\n Hence, we have defined this specific breakpoint to overcome the issue.\n*/\nconst breakpointWidth = '51.25rem';\n\nconst styles = {\n pageContainer: css`\n min-height: 100vh;\n padding-top: 4.5rem;\n padding-bottom: 1rem;\n background-color: #f1f2f3;\n box-sizing: border-box;\n overflow: hidden;\n @media (max-width: 47rem) {\n padding-bottom: 3rem;\n }\n @media (max-width: 36rem) {\n padding-top: 0;\n }\n `,\n container: css`\n box-sizing: border-box;\n padding: 0 1rem;\n max-width: 86.5rem !important;\n\n @media screen and (max-width: ${PAYPAL_THEME.sysSizeMediaSm}) {\n padding: 0 0.75rem;\n }\n\n @media screen and (max-width: ${PAYPAL_THEME.sysSizeMediaXs}) {\n padding: 0 0.5rem;\n }\n `,\n contentContainer: css`\n position: relative;\n display: flex;\n border-radius: 1.5rem;\n box-shadow: 0px 0.1rem 1rem rgba(0, 0, 0, 0.15);\n background-color: #ffffff;\n flex-wrap: nowrap;\n min-height: 70vh;\n\n @media screen and (max-width: ${breakpointWidth}) {\n flex-direction: column;\n }\n\n .loading-spinner-container {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(255, 255, 255, 0.9);\n z-index: 9999;\n border-radius: 1.5rem;\n flex-direction: column;\n }\n\n .panel {\n /**\n * Why did we set width: 0?\n * This makes the panels the equal widths when there is not enough space for the children to grow\n * E.g: When Single select dropdown text is too long, it will not grow the dropdown width\n * TODO: move this to the SingleSelectList dropdown when paywall is ramped\n */\n width: 0;\n flex: 1;\n padding: 4rem;\n gap: 1.5rem;\n\n @media screen and (max-width: ${breakpointWidth}) {\n width: auto;\n }\n\n @media screen and (max-width: ${PAYPAL_THEME.sysSizeMediaLg}) {\n padding: 2rem;\n }\n\n @media screen and (max-width: ${PAYPAL_THEME.sysSizeMediaSm}) {\n padding: 1rem;\n }\n }\n\n .details-panel {\n /* Need to match the border for the panel */\n border-top-left-radius: 1.5rem;\n border-bottom-left-radius: 1.5rem;\n\n /* Swap when we swap the layout orientation */\n @media screen and (max-width: ${breakpointWidth}) {\n border-bottom-left-radius: 0;\n border-top-right-radius: 1.5rem;\n\n &.reverse-order {\n order: 1;\n background-color: transparent;\n }\n }\n\n background-color: rgb(250, 251, 251);\n }\n `,\n disclaimerPolicyStyle: css`\n justify-content: center;\n margin: 0 auto;\n text-align: center;\n `\n};\n\nexport default styles;\n","import React, { ReactNode } from 'react';\nimport { Container, Row, CaptionText, LoadingSpinner, ContainerProps } from '@paypalcorp/pp-react';\nimport commonStyles from '@components/common/commonStyles';\nimport ErrorMessage from '@components/payment/ErrorMessage';\nimport SplitScreenBase from '../SplitScreenBase';\nimport SingleScreenBase from '../SingleScreenBase';\nimport styles from './styles';\n\ninterface MainBaseContainerProps extends ContainerProps {\n xxl?: boolean;\n contentLeft: ReactNode;\n contentRight?: ReactNode;\n disclaimer?: ReactNode;\n isLoading?: boolean;\n loadingSpinnerText?: string;\n topLevelErrorStatus?: string;\n topLevelErrorMessage?: string;\n isMobileReverseOrder?: boolean;\n returnLink?: ReactNode;\n}\n\nconst MainBaseContainer = ({\n contentLeft,\n contentRight = null,\n disclaimer,\n isLoading = false,\n loadingSpinnerText = '',\n topLevelErrorStatus = '',\n topLevelErrorMessage = '',\n isMobileReverseOrder,\n returnLink = null,\n ...rest\n}: MainBaseContainerProps) => {\n return (\n
\n {returnLink && (\n \n {returnLink}\n \n )}\n \n \n \n \n
\n {isLoading && (\n \n \n {loadingSpinnerText}\n
\n )}\n {contentLeft &&\n (contentRight ? (\n \n ) : (\n {contentLeft}\n ))}\n
\n {disclaimer && {disclaimer}}\n \n \n );\n};\n\nexport default MainBaseContainer;\n","import { IAppContext } from '@client/contexts/AppContext';\nimport { ButtonType, INVALID_OPTION_CONTENT_KEY } from '@client/utils/constants';\nimport { HostedButtonDetails, PaymentPrefillData } from '@client/typings/Common';\nimport { transformButtonVariables } from '@client/utils/utils';\nimport { getButtonVariablesFromMerchantSettings } from '@components/Settings/utils';\nimport { PaymentContextPrefillData } from '@client/contexts/PaymentContext';\nimport { checkForDecimalErrors } from '@common/buttonConfigValidations';\nimport { WorldReadyProps } from '@client/utils/localeHelper';\n\nexport type PaywallPrefillData = PaymentContextPrefillData & {\n loggingErrors: PaymentPrefillData;\n};\n\ntype ValidFieldsMap = {\n amount?: boolean;\n invoice?: boolean;\n item?: boolean;\n memo?: boolean;\n quantity?: boolean;\n};\n\nconst VALID_FIELDS_MAP = {\n [ButtonType.FIXED_PRICE]: {\n quantity: true,\n memo: true\n },\n [ButtonType.SINGLE_SELECT_LIST]: {\n quantity: true,\n item: true,\n memo: true\n },\n [ButtonType.VARIABLE_PRICE]: {\n amount: true,\n invoice: true,\n memo: true\n }\n};\n\nconst getQuantityData = (\n paymentContextPrefillData: PaymentContextPrefillData,\n prefillData: PaymentPrefillData,\n quantityOption: string | undefined,\n shouldCheckQuantity: boolean = false\n) => {\n if (!shouldCheckQuantity) {\n return {};\n }\n\n const quantityOptionNumber = Number(quantityOption);\n\n // We need to do the hasOwnProperty check to account for empty strings and any other false-y values.\n // We will be showing an error for the dropdown when these false-y values are sent in.\n const isQuantityRelevant = Object.prototype.hasOwnProperty.call(prefillData, 'quantity');\n const isQuantityOptionEnabled = quantityOption && !Number.isNaN(quantityOptionNumber);\n\n if (!isQuantityRelevant || !isQuantityOptionEnabled) {\n return {};\n }\n\n const prefillQuantity = Number(prefillData.quantity);\n if (\n Number.isNaN(prefillQuantity) ||\n !prefillQuantity ||\n !Number.isInteger(prefillQuantity) ||\n prefillQuantity < 1 ||\n prefillQuantity > quantityOptionNumber\n ) {\n paymentContextPrefillData.errors.quantity = INVALID_OPTION_CONTENT_KEY;\n return {\n errors: {\n quantity: INVALID_OPTION_CONTENT_KEY\n }\n };\n }\n\n return {\n values: {\n quantity: prefillData.quantity\n }\n };\n};\n\nconst getMatchedOption = (buttonDetails: HostedButtonDetails, prefillItem: string | undefined) => {\n const items =\n buttonDetails?.option_details?.find((_) => _.name === 'items')?.selection_details ?? [];\n const matchedItem = items.find((item) => item.option_selection?.trim() === prefillItem);\n return matchedItem?.option_selection;\n};\n\nconst getAmountData = (\n shouldCheckAmount: boolean,\n hasAmountLabel: boolean,\n prefillAmount: string | undefined,\n worldReady: WorldReadyProps,\n currencyCode: string = 'USD'\n) => {\n if (!shouldCheckAmount || !hasAmountLabel) {\n return {};\n }\n\n // Currently merchant hosted does not support decimal separators and only supports comma separators\n // so we will do these checks with that assumption in mind.\n const prefilledAmountNumber = Number(prefillAmount);\n if (\n Number.isNaN(prefilledAmountNumber) ||\n prefilledAmountNumber < 0 ||\n checkForDecimalErrors(worldReady, prefilledAmountNumber, currencyCode).hasError\n ) {\n // We do not have an associated error message for this since we aren't prefilling the value.\n // We let the default form validations take care of it. However, we still want to log\n // that some error occurred so we pass this into the loggingErrors.\n return {\n loggingErrors: {\n amount: INVALID_OPTION_CONTENT_KEY\n }\n };\n }\n\n return {\n values: {\n amount: prefillAmount\n }\n };\n};\n\n// To figure out what data we should pre-fill from the merchant hosted fields for 3-buttons\nexport const getPrefillData = (\n appContext: IAppContext | null,\n buttonDetails: HostedButtonDetails,\n worldReady: WorldReadyProps\n) => {\n const prefillData = appContext?.paymentPrefillData;\n const merchantSettings = appContext?.merchantSettings;\n const isSettingsEnabled = appContext?.isSettingsEnabled;\n const originalButtonVariables = transformButtonVariables(buttonDetails.link_variables);\n const buttonVariables = getButtonVariablesFromMerchantSettings(\n merchantSettings,\n originalButtonVariables,\n isSettingsEnabled\n );\n const buttonType = buttonVariables.button_type?.toUpperCase() as ButtonType;\n\n const paymentContextPrefillData: PaywallPrefillData = {\n values: {},\n errors: {},\n loggingErrors: {}\n };\n\n if (!buttonType || !prefillData || !Object.keys(prefillData).length) {\n return paymentContextPrefillData;\n }\n\n const validFields: ValidFieldsMap = VALID_FIELDS_MAP[buttonType] || {};\n\n const { errors: quantityErrors, values: quantityValues } = getQuantityData(\n paymentContextPrefillData,\n prefillData,\n buttonVariables.quantity_option,\n validFields.quantity\n );\n\n // We need to do the hasOwnProperty check to account for empty strings and any other false-y values.\n // We will be showing an error for the dropdown when these false-y values are sent in.\n // We use the item value from matched option as prefillData value to avoid future mismatch issues.\n if (validFields.item && Object.prototype.hasOwnProperty.call(prefillData, 'item')) {\n const matchedOption = getMatchedOption(buttonDetails, prefillData?.item);\n const doesPrefillItemExist = !!matchedOption;\n if (doesPrefillItemExist) {\n paymentContextPrefillData.values.item = matchedOption;\n } else {\n paymentContextPrefillData.errors.item = INVALID_OPTION_CONTENT_KEY;\n }\n }\n\n const { values: amountValues, loggingErrors: amountLoggingErrors } = getAmountData(\n validFields.amount && Object.prototype.hasOwnProperty.call(prefillData, 'amount'),\n !!buttonVariables.amount_label,\n prefillData?.amount,\n worldReady,\n buttonVariables.currency_code\n );\n\n if (validFields.invoice && buttonVariables.invoice_label && prefillData.invoice) {\n paymentContextPrefillData.values.invoice = prefillData.invoice;\n }\n\n if (validFields.memo && buttonVariables.memo_label && prefillData.memo) {\n paymentContextPrefillData.values.memo = prefillData.memo;\n }\n\n paymentContextPrefillData.values = {\n ...paymentContextPrefillData.values,\n ...quantityValues,\n ...amountValues\n };\n\n paymentContextPrefillData.errors = {\n ...paymentContextPrefillData.errors,\n ...quantityErrors\n };\n\n paymentContextPrefillData.loggingErrors = {\n ...paymentContextPrefillData.loggingErrors,\n ...amountLoggingErrors\n };\n\n return paymentContextPrefillData;\n};\n","import React, { useEffect } from 'react';\nimport { useParams } from 'react-router-dom';\nimport { Link } from '@paypalcorp/pp-react';\nimport ButtonContainer from '@components/ButtonsStack/Container';\nimport { useAppContext } from '@client/contexts/AppContext';\nimport MainBaseContainer from '@components/ContainerTemplates/MainBaseContainer';\nimport DisclaimerPolicy from '@components/payment/DisclaimerPolicy';\nimport { useWorldReadyContext } from '@client/contexts/WorldReadyContext';\nimport { getLocalizedString } from '@client/utils/localeHelper';\nimport {\n ButtonWrapperVariation,\n HostedButtonDetails as HostedButtonDetailsType\n} from '@client/typings/Common';\nimport HostedButtonDetails from '@components/payment/HostedButtonDetails';\nimport { buildAdditionalTags, recordImpression } from '@common/analytics';\nimport {\n PaymentContextProvider,\n PaymentContextValuesGenerator\n} from '@client/contexts/PaymentContext';\nimport { getPrefillData, PaywallPrefillData } from '@components/Paywall/prefillData';\nimport useDeepEqualMemo from '@client/hooks/useDeepEqualMemo';\nimport useOnCaptureFailEffect from '@client/hooks/useOnCaptureFailEffect';\nimport { logInfoClient } from '@client/utils/beaverLogger';\nimport { extractSourceAndFlowType } from '@common/fpti';\nimport processURL from '@client/helpers/processURL';\nimport { getSettingsValuesWithFallback } from '@components/Settings/utils';\n\nconst useOnPrefillDataPopulatedEffect = (\n prefillData: PaywallPrefillData,\n fptiAdditionalTags: ReturnType\n) => {\n useEffect(() => {\n const prefillErrorKeys = Object.keys(prefillData.errors);\n const errorKeysForLogging = Object.keys(prefillData.loggingErrors);\n const hasValues = !!Object.keys(prefillData.values).length;\n const hasErrors = !!prefillErrorKeys.length || !!errorKeysForLogging.length;\n if (hasValues || hasErrors) {\n const prefillDataToLog = {\n values: prefillData.values,\n errors: [...prefillErrorKeys, ...errorKeysForLogging]\n };\n logInfoClient('paywall prefilled values and errors', prefillDataToLog);\n recordImpression(\n {\n ...fptiAdditionalTags,\n pageName: 'paywall',\n eventName: 'payment_data_prefilled'\n },\n { prefill: prefillDataToLog.values, int_error_desc: prefillDataToLog.errors }\n );\n }\n }, [prefillData, fptiAdditionalTags]);\n};\n\nconst Paywall = () => {\n const { hostedButtonId } = useParams();\n const appContext = useAppContext();\n const worldReady = useWorldReadyContext();\n const enablePaywall = appContext?.enablePaywall;\n const merchantSettings = appContext?.merchantSettings;\n const isSettingsEnabled = appContext?.isSettingsEnabled;\n const enablePaywallButtons = appContext?.enablePaywallButtons;\n const hostedButtonDetails = appContext?.hostedButtonDetails as HostedButtonDetailsType;\n const { sourceType, flowType } = extractSourceAndFlowType(appContext?.fptiData);\n const merchantSettingsOptions = { merchantSettings, isSettingsEnabled };\n const fptiAdditionalTags = useDeepEqualMemo(\n buildAdditionalTags(\n hostedButtonDetails,\n sourceType,\n flowType,\n enablePaywall,\n merchantSettingsOptions,\n enablePaywallButtons\n )\n );\n\n const prefillData = useDeepEqualMemo(getPrefillData(appContext, hostedButtonDetails, worldReady));\n const paymentContextValues = PaymentContextValuesGenerator(fptiAdditionalTags, prefillData);\n const { homepage_url: homepageUrl } = getSettingsValuesWithFallback(appContext);\n const returnLink = homepageUrl ? (\n \n {getLocalizedString(worldReady, 'settings.homePageUrl.button.label')}\n \n ) : null;\n\n useOnPrefillDataPopulatedEffect(prefillData, fptiAdditionalTags);\n\n useOnCaptureFailEffect(\n paymentContextValues.captureStatus,\n fptiAdditionalTags,\n paymentContextValues.errorMessage\n );\n\n return (\n \n }\n contentRight={\n hostedButtonId && (\n \n )\n }\n topLevelErrorStatus={paymentContextValues.captureStatus}\n topLevelErrorMessage={paymentContextValues.errorMessage}\n isLoading={paymentContextValues.isLoading}\n loadingSpinnerText={getLocalizedString(worldReady, 'payment.text.paymentProcessing')}\n disclaimer={}\n returnLink={returnLink}\n />\n \n );\n};\n\nexport default Paywall;\n","/**\n * Attach https in front of the URL\n */\nconst processURL = (url: string) => {\n if (url.indexOf('http') !== 0) {\n return `https://${url}`;\n }\n return url;\n};\n\nexport default processURL;\n","import React from 'react';\nimport { Routes, Route } from 'react-router-dom';\nimport { ThemeProvider as EmotionThemeProvider } from '@emotion/react';\nimport { PAYPAL_THEME } from '@paypalcorp/pp-react';\nimport { AppContextProvider } from '@client/contexts/AppContext';\nimport Payment from '@components/payment';\nimport Paywall from '@components/Paywall';\nimport Notfound from '@components/notfound';\nimport '@client/lib/datadog';\n\nfunction App({ initialAppData }) {\n const { enablePaywall } = initialAppData;\n\n return (\n \n \n \n : }\n />\n } />\n \n \n \n );\n}\n\nexport default App;\n","import React from 'react';\nimport PaymentApp from '@components/App';\nimport { initializeAppData, hydrate } from './bootstrap';\n\nconst initialAppData = initializeAppData();\nhydrate({ App: PaymentApp, initialAppData, options: { hydrateMethod: 'hydrateRoot' } });\n","import { ButtonVariation, MerchantSettings } from '@client/typings/Common';\nimport type { ButtonConfig } from '@components/buttons/types';\nimport type { IAppContext } from '@client/contexts/AppContext';\nimport {\n SecondButtonType,\n ButtonShape,\n ButtonSize,\n ButtonColorType,\n ButtonLayout\n} from '@components/Settings/types';\nimport { CheckoutPaymentOptionsOtherThanPayPal } from '@client/components/buttons/types';\nimport {\n DEFAULT_MERCHANT_SETTINGS,\n DEFAULT_MERCHANT_CART_BUTTON_SETTINGS,\n DEFAULT_MERCHANT_CHECKOUT_SETTINGS\n} from './getInitialMerchantSettings';\n\n// some fields from setting but not defined in Buttonconfig.\nexport type ButtonConfigExtensionFromSettings = {\n paymentMethodVenmo?: boolean;\n paymentMethodPayLater?: boolean;\n paymentMethodApplePay?: boolean;\n showBusinessName?: boolean;\n showBusinessLogo?: boolean;\n homepageUrl?: string;\n secondButtonType?: SecondButtonType;\n singelButtonShape?: ButtonShape;\n cartButtonShape?: ButtonShape;\n cartButtonSize?: ButtonSize;\n cartButtonColorType?: ButtonColorType;\n cartButtonColorCode?: string;\n};\n\ntype ButtonVariablesFromSettings = {\n payment_method_paylater?: boolean;\n payment_method_venmo?: boolean;\n payment_method_applepay?: boolean;\n show_business_name?: boolean;\n show_business_logo?: boolean;\n homepage_url?: string;\n layout?: ButtonLayout;\n shape?: ButtonShape;\n size?: ButtonSize;\n color?: ButtonColorType;\n second_button_type?: SecondButtonType;\n checkout_button_text_type?: string;\n checkout_button_custom_text?: string;\n single_button_shape?: ButtonShape;\n single_button_color_type?: ButtonColorType;\n single_button_color?: string;\n single_button_size?: ButtonSize;\n cart_button_shape?: ButtonShape;\n cart_button_size?: ButtonSize;\n cart_button_color_type?: ButtonColorType;\n cart_button_color_code?: string;\n};\n\ntype SettingsFieldsMapper = {\n configMapper: keyof ButtonConfig;\n variablesMapper: keyof ButtonVariablesFromSettings;\n variableHandler?: (data) => string | undefined;\n};\n\nconst BooleanButtonVariableHandler = (data: boolean) => `${data}`;\n\nconst SETTINGS_FIELDS_CHECKOUT: { [K in keyof MerchantSettings]?: SettingsFieldsMapper } = {\n payment_method_paylater: {\n configMapper: 'paymentMethodPayLater',\n variablesMapper: 'payment_method_paylater',\n variableHandler: BooleanButtonVariableHandler\n },\n payment_method_venmo: {\n configMapper: 'paymentMethodVenmo',\n variablesMapper: 'payment_method_venmo',\n variableHandler: BooleanButtonVariableHandler\n },\n payment_method_apple_pay: {\n configMapper: 'paymentMethodApplePay',\n variablesMapper: 'payment_method_applepay',\n variableHandler: BooleanButtonVariableHandler\n },\n // TODO: Support Google Pay once Google Pay integration provided\n // payment_method_google_pay: {\n // configMapper: 'paymentMethodGooglePay',\n // variablesMapper: 'payment_method_googlepay',\n // variableHandler: BooleanButtonVariableHandler\n // },\n // TODO: Support paypal button message once JSSDK inner source work completed\n // paypal_button_message: {\n // configMapper: 'paypaButtonMessage',\n // variablesMapper: 'paypal_button_message',\n // variableHandler: BooleanButtonVariableHandler\n // },\n show_business_name: {\n configMapper: 'showBusinessName',\n variablesMapper: 'show_business_name',\n variableHandler: BooleanButtonVariableHandler\n },\n show_business_logo: {\n configMapper: 'showBusinessLogo',\n variablesMapper: 'show_business_logo',\n variableHandler: BooleanButtonVariableHandler\n },\n homepage_url: {\n configMapper: 'homepageUrl',\n variablesMapper: 'homepage_url'\n }\n};\n\nconst SETTINGS_FIELDS_STACKED_BUTTON: {\n [K in keyof MerchantSettings]?: SettingsFieldsMapper;\n} = {\n stacked_button_layout: {\n configMapper: 'layout',\n variablesMapper: 'layout'\n },\n stacked_button_shape: {\n configMapper: 'shape',\n variablesMapper: 'shape'\n },\n stacked_button_size: {\n configMapper: 'size',\n variablesMapper: 'size'\n },\n stacked_button_color_type: {\n configMapper: 'color',\n variablesMapper: 'color'\n },\n stacked_button_second_button_type: {\n configMapper: 'secondButtonType',\n variablesMapper: 'second_button_type'\n },\n stacked_button_text_type: {\n configMapper: 'checkoutButtonTextType',\n variablesMapper: 'checkout_button_text_type'\n },\n stacked_button_custom_text: {\n configMapper: 'checkoutButtonCustomText',\n variablesMapper: 'checkout_button_custom_text'\n }\n};\n\nconst SETTINGS_FIELDS_SINGLE_BUTTON: {\n [K in keyof MerchantSettings]?: SettingsFieldsMapper;\n} = {\n single_button_shape: {\n configMapper: 'singelButtonShape',\n variablesMapper: 'single_button_shape'\n },\n single_button_size: {\n configMapper: 'singleButtonSize',\n variablesMapper: 'single_button_size'\n },\n single_button_color_type: {\n configMapper: 'singleButtonColorType',\n variablesMapper: 'single_button_color_type'\n },\n single_button_color_code: {\n configMapper: 'singleButtonColor',\n variablesMapper: 'single_button_color'\n }\n};\n\nconst SETTINGS_FIELDS_CART_BUTTON: {\n [K in keyof MerchantSettings]?: SettingsFieldsMapper;\n} = {\n cart_button_shape: {\n configMapper: 'cartButtonShape',\n variablesMapper: 'cart_button_shape'\n },\n cart_button_size: {\n configMapper: 'cartButtonSize',\n variablesMapper: 'cart_button_size'\n },\n cart_button_color_type: {\n configMapper: 'cartButtonColorType',\n variablesMapper: 'cart_button_color_type'\n },\n cart_button_color_code: {\n configMapper: 'cartButtonColorCode',\n variablesMapper: 'cart_button_color_code'\n }\n};\n\nconst DEFAULT_FIELDS_MAPPER = {\n ...SETTINGS_FIELDS_CHECKOUT,\n ...SETTINGS_FIELDS_STACKED_BUTTON,\n ...SETTINGS_FIELDS_SINGLE_BUTTON\n};\n\nconst DEFAULT_CART_FIELDS_MAPPER = {\n ...SETTINGS_FIELDS_CART_BUTTON,\n ...SETTINGS_FIELDS_CHECKOUT\n};\n\nconst DEFAULT_CART_BUTTON_SETTINGS = {\n ...DEFAULT_MERCHANT_CHECKOUT_SETTINGS,\n ...DEFAULT_MERCHANT_CART_BUTTON_SETTINGS\n};\n\n// TODO: the following fields are newly added in settings, we set these default values here to keep the behavior as phase 2 when settings is not ramped,\n// we can delete the following map when settings feature is 100% ramped\nconst SETTINGS_NEWLY_ADDED_FIELDS_DEFAULT_VALUES = {\n payment_method_paylater: true,\n payment_method_venmo: true,\n payment_method_apple_pay: true,\n show_business_name: false,\n show_business_logo: false,\n homepage_url: ''\n};\n\nconst getSettingsValuesWithFallback = (appContext: IAppContext | null) =>\n appContext?.isSettingsEnabled\n ? appContext?.merchantSettings || {}\n : SETTINGS_NEWLY_ADDED_FIELDS_DEFAULT_VALUES;\n\nconst mergeInButtonConfigWithMerchantSettings = (\n merchantSettings: MerchantSettings | undefined,\n buttonConfig: ButtonConfig,\n isSettingsEnabled?: boolean,\n buttonVariation: ButtonVariation = ButtonVariation.BuyNow\n): ButtonConfig => {\n const isCartButton = buttonVariation === ButtonVariation.Cart;\n const calculatedButtonConfig = Object.entries(\n isCartButton ? DEFAULT_CART_FIELDS_MAPPER : DEFAULT_FIELDS_MAPPER\n ).reduce((acc, [settingsKey, mapper]) => {\n let mappingValue;\n if (isSettingsEnabled) {\n mappingValue =\n merchantSettings?.[settingsKey] ??\n buttonConfig?.[mapper.configMapper] ??\n (isCartButton ? DEFAULT_CART_BUTTON_SETTINGS : DEFAULT_MERCHANT_SETTINGS)[settingsKey];\n } else {\n mappingValue =\n buttonConfig?.[mapper.configMapper] ??\n SETTINGS_NEWLY_ADDED_FIELDS_DEFAULT_VALUES[settingsKey] ??\n (isCartButton ? DEFAULT_CART_BUTTON_SETTINGS : DEFAULT_MERCHANT_SETTINGS)[settingsKey];\n }\n const mapping = { [mapper.configMapper]: mappingValue };\n return { ...acc, ...mapping };\n }, {});\n\n return { ...buttonConfig, ...calculatedButtonConfig };\n};\n\nconst getButtonVariablesFromMerchantSettings = (\n merchantSettings: MerchantSettings | undefined,\n buttonVariables: Record,\n isSettingsEnabled?: boolean,\n buttonVariation: ButtonVariation = ButtonVariation.BuyNow\n): Record => {\n const isCartButton = buttonVariation === ButtonVariation.Cart;\n const calculatedButtonVariables = Object.entries(\n isCartButton ? DEFAULT_CART_FIELDS_MAPPER : DEFAULT_FIELDS_MAPPER\n ).reduce((acc, [settingsKey, mapper]) => {\n let mappingValue;\n if (isSettingsEnabled) {\n mappingValue =\n merchantSettings?.[settingsKey] ??\n buttonVariables?.[mapper.variablesMapper] ??\n (isCartButton ? DEFAULT_CART_BUTTON_SETTINGS : DEFAULT_MERCHANT_SETTINGS)[settingsKey];\n } else {\n mappingValue =\n buttonVariables?.[mapper.variablesMapper] ??\n SETTINGS_NEWLY_ADDED_FIELDS_DEFAULT_VALUES[settingsKey] ??\n (isCartButton ? DEFAULT_CART_BUTTON_SETTINGS : DEFAULT_MERCHANT_SETTINGS)[settingsKey];\n }\n\n if (mapper.variableHandler) {\n mappingValue = mapper.variableHandler(mappingValue);\n }\n\n const mapping = { [mapper.variablesMapper]: mappingValue };\n return { ...acc, ...mapping };\n }, {});\n\n return { ...buttonVariables, ...calculatedButtonVariables };\n};\n\nconst getAllowedPaymentMethodsFromSettings = (\n paymentMethodVenmo: boolean,\n paymentMethodPayLater: boolean,\n paymentMethodApplePay: boolean,\n allowApplePayToggle: boolean\n): CheckoutPaymentOptionsOtherThanPayPal[] => {\n const switches = {\n [CheckoutPaymentOptionsOtherThanPayPal.Venmo]: paymentMethodVenmo,\n [CheckoutPaymentOptionsOtherThanPayPal.PayLater]: paymentMethodPayLater,\n [CheckoutPaymentOptionsOtherThanPayPal.ApplePay]: paymentMethodApplePay && allowApplePayToggle,\n [CheckoutPaymentOptionsOtherThanPayPal.Card]: true\n };\n const allowedMethods = Object.values(CheckoutPaymentOptionsOtherThanPayPal).reduce(\n (acc, paymentOption) => {\n if (switches[paymentOption]) {\n return acc.concat(paymentOption);\n }\n return acc;\n },\n [] as CheckoutPaymentOptionsOtherThanPayPal[]\n );\n return allowedMethods;\n};\n\nexport {\n SETTINGS_FIELDS_CHECKOUT,\n SETTINGS_FIELDS_STACKED_BUTTON,\n SETTINGS_FIELDS_SINGLE_BUTTON,\n SETTINGS_FIELDS_CART_BUTTON,\n SETTINGS_NEWLY_ADDED_FIELDS_DEFAULT_VALUES,\n mergeInButtonConfigWithMerchantSettings,\n getButtonVariablesFromMerchantSettings,\n getAllowedPaymentMethodsFromSettings,\n getSettingsValuesWithFallback\n};\n","import _invert from 'lodash/invert';\nimport type { ButtonConfig, Item } from './types';\nimport { Payload } from './mapValuesToPayload';\n\nconst COMMON_PAYLOAD_KEY_MAPPER: { [K in keyof ButtonConfig]?: string } = {\n currencyCode: 'currency_code',\n itemName: 'item_name',\n shipping: 'shipping',\n taxRate: 'tax_rate',\n memoLabel: 'memo_label',\n layout: 'layout',\n shape: 'shape',\n color: 'color',\n paypalButtonText: 'button_text',\n tagline: 'tagline',\n amount: 'amount',\n quantityOption: 'quantity_option',\n amountLabel: 'amount_label',\n invoiceLabel: 'invoice_label',\n returnUrlType: 'return_url_type',\n customReturnUrl: 'custom_return_url',\n checkoutButtonTextType: 'checkout_button_text_type',\n checkoutButtonCustomText: 'checkout_button_custom_text',\n singleButtonColorType: 'single_button_color_type',\n singleButtonColor: 'single_button_color',\n singleButtonTextType: 'single_button_text_type',\n singleButtonCustomText: 'single_button_custom_text',\n singleButtonSize: 'single_button_size',\n paymentButtonType: 'payment_button_type',\n productId: 'product_id',\n checkoutButtonType: 'checkout_button_type',\n size: 'size',\n isNotCollectShippingAddress: 'no_shipping',\n shippingPreference: 'shipping_preference',\n taxRatePreference: 'tax_rate_preference',\n cartButtonShape: 'cart_button_shape',\n cartButtonSize: 'cart_button_size',\n cartButtonColorType: 'cart_button_color_type',\n cartButtonColorCode: 'cart_button_color_code'\n};\n\nconst CLIENT_TO_NCNWServer_PAYLOAD_KEY_MAPPER: { [K in keyof ButtonConfig]?: string } = {\n ...COMMON_PAYLOAD_KEY_MAPPER,\n buttonType: 'button_type',\n items: 'items',\n isEnableQuantityOption: 'enableQuantity'\n};\n\nconst BFS_TO_CLIENT_PAYLOAD_KEY_MAPPER = {\n ..._invert(COMMON_PAYLOAD_KEY_MAPPER),\n button_sub_type: 'buttonType'\n};\n\nexport const mapServerToClientPayloadKeys = (\n buttonVariables: Record\n) => {\n return Object.entries(buttonVariables).reduce(\n (acc, [key, value]) => ({\n ...acc,\n ...(BFS_TO_CLIENT_PAYLOAD_KEY_MAPPER[key] && {\n [BFS_TO_CLIENT_PAYLOAD_KEY_MAPPER[key]]: value\n })\n }),\n {}\n );\n};\n\nexport const mapClientToServerPayloadKeys = (payloadWithClientTypeKeys: Payload) => {\n return Object.entries(payloadWithClientTypeKeys).reduce(\n (acc, [key, value]) => ({\n ...acc,\n ...(CLIENT_TO_NCNWServer_PAYLOAD_KEY_MAPPER[key] && {\n [CLIENT_TO_NCNWServer_PAYLOAD_KEY_MAPPER[key]]: value\n })\n }),\n {}\n );\n};\n\n/**\n * Get \"items\" from optionDetails which is separate from buttonVariables\n */\nexport const mapServerToClientItems = (optionDetails: unknown): Item[] | null => {\n if (!optionDetails || !Array.isArray(optionDetails)) {\n return null;\n }\n\n const itemOptionDetail = optionDetails.find((optionDetail) => optionDetail.name === 'items');\n if (!itemOptionDetail) {\n return null;\n }\n\n const selectionDetails = itemOptionDetail.selection_details;\n if (!selectionDetails || !Array.isArray(selectionDetails) || !selectionDetails.length) {\n return null;\n }\n\n const items = selectionDetails.map((selectionDetail) => ({\n desc: selectionDetail.option_selection,\n price: selectionDetail.price\n }));\n return items;\n};\n","import { ButtonType } from '@client/utils/constants';\nimport { PayPalPaymentOption } from '@client/typings/payment';\nimport { ButtonConfigExtensionFromSettings } from '@client/components/Settings/utils';\n\nexport enum PaymentButtonType {\n Link = 'LINK',\n Button = 'BUTTON'\n}\n\nexport enum CheckoutButtonType {\n Stacked = 'stacked',\n Single = 'single'\n}\n\nexport enum CheckoutButtonLayout {\n Vertical = 'vertical',\n Horizontal = 'horizontal'\n}\n\nexport enum CheckoutButtonShape {\n Rect = 'rect',\n Pill = 'pill',\n Sharp = 'sharp'\n}\n\nexport enum CheckoutButtonColor {\n Gold = 'gold',\n Blue = 'blue',\n Silver = 'silver',\n White = 'white',\n Black = 'black'\n}\n\nexport enum CheckoutSingleButtonColorType {\n Recommended = 'recommended',\n White = 'white',\n Black = 'black',\n Custom = 'custom'\n}\n\nexport enum SingleButtonTextType {\n Buynow = 'buynow',\n Paynow = 'paynow',\n Custom = 'custom'\n}\n\nexport enum CheckoutPaypalButtonText {\n Paypal = 'paypal',\n Checkout = 'checkout',\n Buynow = 'buynow',\n Pay = 'pay',\n Installment = 'installment'\n}\n\nexport enum CheckoutButtonTagline {\n True = 'true',\n False = 'false'\n}\n\nexport enum CheckoutButtonSize {\n Large = 'large',\n Medium = 'medium',\n Small = 'small'\n}\n\nexport enum CheckoutButtonTextType {\n Checkout = 'checkout',\n Proceed = 'proceed',\n Pay = 'pay',\n Custom = 'custom'\n}\n\nexport enum NoShipping {\n /**\n * Prompt for an address, but do not require one\n */\n // PromptOptional = '0',\n /**\n * Do not prompt for an address\n */\n NoPrompt = '1',\n /**\n * Prompt for an address and require one\n */\n PromptRequired = '2'\n}\n\nexport enum ShippingPreference {\n /**\n * Shipping from profile\n */\n FromProfile = 'shipping_from_profile',\n /**\n * Free shipping\n */\n Free = 'free_shipping',\n /**\n * Shipping not applicable\n */\n NotApplicable = 'shipping_not_applicable',\n /**\n * Custom shipping\n */\n Custom = 'custom_shipping'\n}\n\nexport enum TaxRatePreference {\n /**\n * Tax rate from profile\n */\n FromProfile = 'tax_rate_from_profile',\n /**\n * Tax rate not applicable\n */\n NotApplicable = 'tax_rate_not_applicable',\n /**\n * Custom tax rate\n */\n Custom = 'custom_tax_rate'\n}\n\nexport enum ReturnUrlType {\n /**\n * No return url\n */\n None = 'no_return_url',\n /**\n * Return url from profile\n */\n FromProfile = 'return_url_from_profile',\n /**\n * Custom return url\n */\n Custom = 'custom_return_url'\n}\n\nexport enum CheckoutPaymentOptionsOtherThanPayPal {\n Venmo = 'venmo',\n PayLater = 'paylater',\n ApplePay = 'applepay',\n Card = 'card'\n}\n\nexport type CheckoutPaymentOptions = PayPalPaymentOption | CheckoutPaymentOptionsOtherThanPayPal;\n\n/**\n * Key values that are specific to client side and will not send to server\n */\ntype ClientConfig = {};\n\n/**\n * Key values that we want to pass to the server from the client\n */\ntype OverrideFlagsConfig = {\n /**\n * [DTNCPS-1141][TEMP] Adding in to handle overriding the 3-buttons elmo for our functional tests\n */\n is3ButtonsEligible?: boolean;\n};\n\nexport type CheckoutButtonStackedConfig = {\n /**\n * Checkout button layout\n */\n layout?: `${CheckoutButtonLayout}`;\n /**\n * Checkout button shape\n */\n shape?: `${CheckoutButtonShape}`;\n /**\n * Checkout button color\n */\n color?: `${CheckoutButtonColor}`;\n /**\n * Paypal checkout button text\n */\n paypalButtonText?: `${CheckoutPaypalButtonText}`;\n /**\n * Checkout button tagline\n * @deprecated\n * No longer being used in phase 2\n */\n tagline: `${CheckoutButtonTagline}`;\n /**\n * Checkout button text type\n */\n checkoutButtonTextType?: `${CheckoutButtonTextType}`;\n /**\n * Checkout button custom text\n */\n checkoutButtonCustomText?: string;\n /**\n * Checkout button size\n */\n size?: `${CheckoutButtonSize}`;\n};\n\nexport type CheckoutButtonSingleConfig = {\n /**\n * Checkout single button color type\n */\n singleButtonColorType?: `${CheckoutSingleButtonColorType}`;\n /**\n * Checkout single button color type in hex\n * E.g: \"FFD140\"\n */\n singleButtonColor?: string;\n /**\n * Checkout button text type\n */\n singleButtonTextType: `${SingleButtonTextType}`;\n /**\n * Checkout button custom text\n */\n singleButtonCustomText: string;\n /**\n * Checkout single button color type\n */\n singleButtonSize?: `${CheckoutButtonSize}`;\n};\n\ntype CheckoutButtonConfig = CheckoutButtonStackedConfig &\n CheckoutButtonSingleConfig & {\n /**\n * Checkout button type\n */\n checkoutButtonType: `${CheckoutButtonType}`;\n };\n\ntype ThankYouConfig = {\n /**\n * Return url type\n */\n returnUrlType: `${ReturnUrlType}`;\n /**\n * Custom return url\n */\n customReturnUrl: string;\n};\n\nexport type ButtonConfigBase = ThankYouConfig & {\n /**\n * Button type\n */\n buttonType: `${ButtonType}`;\n /**\n * Product name or description\n */\n itemName: string;\n /**\n * Currency code\n * e.g: USD\n */\n currencyCode: string;\n /**\n * Custom shipping rate\n */\n shipping: string;\n /**\n * Shipping preference - optional\n */\n shippingPreference?: `${ShippingPreference}`;\n /**\n * Custom tax rate\n */\n taxRate: string;\n /**\n * Tax rate preference - optional\n */\n taxRatePreference?: `${TaxRatePreference}`;\n /**\n * Whether to not collect shipping address\n */\n isNotCollectShippingAddress: boolean;\n /**\n * Product id to show in order details. Does not show to buyer\n */\n productId: string;\n};\n\ntype QuantityConfig = {\n quantityOption: string;\n isEnableQuantityOption: boolean;\n};\n\nexport type BuyNowButtonConfig = CheckoutButtonConfig & {\n /**\n * Preference type to guide the merchant through button creation experience\n */\n paymentButtonType: `${PaymentButtonType}`;\n /**\n * Memo notes for the buyers\n */\n memoLabel: string;\n};\n\nexport type Item = {\n desc: string;\n price: string;\n};\n\nexport type FixedButtonConfig = QuantityConfig & {\n amount: string;\n};\n\nexport type SingleSelectButtonConfig = QuantityConfig & {\n items: Array;\n};\n\nexport type VariableButtonConfig = {\n invoiceLabel: string;\n amountLabel: string;\n};\n\nexport type ButtonConfig = ClientConfig &\n OverrideFlagsConfig &\n ButtonConfigBase &\n BuyNowButtonConfig &\n FixedButtonConfig &\n SingleSelectButtonConfig &\n VariableButtonConfig &\n ButtonConfigExtensionFromSettings;\n\nexport type CommonButtonConfig = ButtonConfigBase & FixedButtonConfig & SingleSelectButtonConfig;\n\nexport enum AccordionName {\n BUTTON_PREFERENCE = 'buttonPreference',\n CREATE_PRODUCT = 'createProduct',\n CUSTOMIZE_BUTTON = 'customizeButton',\n CUSTOMIZE_THANK_YOU = 'customizeThankYou'\n}\n","import { useContext } from 'react';\nimport { Context as WorldReadyContext } from '@paypalcorp/worldready-react';\nimport { WorldReadyProvider } from '@paypalcorp/pp-react-worldready';\nimport type { WorldReadyProps } from '@client/utils/localeHelper';\n\nconst useWorldReadyContext = () => useContext(WorldReadyContext);\n\nexport { WorldReadyProvider, useWorldReadyContext, WorldReadyProps };\n","import { IAppContext } from '@client/contexts/AppContext';\nimport { UcpConfig } from '@client/typings/Common';\n\nexport const getAppConfig = (appContext: IAppContext | null) => appContext?.app?.config;\n\nexport const getFeatureFlags = (appContext: IAppContext | null): UcpConfig['featureFlags'] =>\n getAppConfig(appContext)?.featureFlags || {};\n","import {\n CheckoutButtonSize,\n CheckoutPaymentOptionsOtherThanPayPal,\n CheckoutSingleButtonColorType\n} from '@components/buttons/types';\nimport { OptionalPaymentMethods } from '@components/Settings/types';\nimport { replaceGeoUrl } from '@common/replaceGeoUrl';\nimport serverData from '@client/utils/server-data';\n\nexport enum OrderStatus {\n CREATED = 'CREATED',\n COMPLETED = 'COMPLETED',\n FAILED = 'FAILED',\n PAYER_ACTION_REQUIRED = 'PAYER_ACTION_REQUIRED'\n}\n\nexport enum CaptureStatus {\n PENDING = 'PENDING',\n COMPLETED = 'COMPLETED',\n FAILED = 'FAILED',\n DECLINED = 'DECLINED',\n AUTH_FAILED = 'AUTH_FAILED',\n CART_EMPTY = 'CART_EMPTY'\n}\n\nexport enum ButtonType {\n FIXED_PRICE = 'FIXED_PRICE',\n VARIABLE_PRICE = 'VARIABLE_PRICE',\n SINGLE_SELECT_LIST = 'SINGLE_SELECT_LIST'\n}\n\nexport enum IntegrationOptions {\n ADD_TO_CART = 'addToCart',\n PAYMENT_LINK = 'paymentLink',\n QR_CODE = 'qrCode',\n STACKED_BUTTONS = 'stackedButtons',\n SINGLE_BUTTON = 'singleButton'\n}\n\nconst cardImg = replaceGeoUrl(\n 'https://www.paypalobjects.com/paypal-ui/pictograms/multicolored/svg/cards.svg',\n serverData?.geoAwareDomain\n);\n\nexport const INTEGRATION_TYPE_TO_IMAGE = {\n [IntegrationOptions.PAYMENT_LINK]: replaceGeoUrl(\n 'https://www.paypalobjects.com/paypal-ui/pictograms/multicolored/svg/fun.svg',\n serverData?.geoAwareDomain\n ),\n [IntegrationOptions.QR_CODE]: replaceGeoUrl(\n 'https://www.paypalobjects.com/paypal-ui/pictograms/multicolored/svg/qrc-pay.svg',\n serverData?.geoAwareDomain\n ),\n [IntegrationOptions.STACKED_BUTTONS]: cardImg,\n [IntegrationOptions.SINGLE_BUTTON]: cardImg,\n [IntegrationOptions.ADD_TO_CART]:\n 'https://www.paypalobjects.com/paypal-ui/pictograms/multicolored/svg/cart.svg'\n};\n\nexport const PAYMENT_IMAGE_SOURCE = {\n [OptionalPaymentMethods.PAYLATER]: replaceGeoUrl(\n 'https://www.paypalobjects.com/paypal-ui/logos/svg/paypal-mark-color.svg',\n serverData?.geoAwareDomain\n ),\n [OptionalPaymentMethods.VENMO]: replaceGeoUrl(\n 'https://www.paypalobjects.com/paypal-ui/logos/svg/venmo-mark-color.svg',\n serverData?.geoAwareDomain\n ),\n [OptionalPaymentMethods.APPLEPAY]: replaceGeoUrl(\n 'https://www.paypalobjects.com/paypal-ui/logos/svg/apple-pay-color.svg',\n serverData?.geoAwareDomain\n ),\n [OptionalPaymentMethods.GOOGLEPAY]: replaceGeoUrl(\n 'https://www.paypalobjects.com/paypal-ui/logos/svg/google-pay-color.svg',\n serverData?.geoAwareDomain\n )\n};\n\nexport const PaymentMethodLogoUrlMapper = {\n [OptionalPaymentMethods.PAYLATER]: PAYMENT_IMAGE_SOURCE[OptionalPaymentMethods.PAYLATER],\n [OptionalPaymentMethods.VENMO]: PAYMENT_IMAGE_SOURCE[OptionalPaymentMethods.VENMO],\n [OptionalPaymentMethods.APPLEPAY]: PAYMENT_IMAGE_SOURCE[OptionalPaymentMethods.APPLEPAY],\n [OptionalPaymentMethods.GOOGLEPAY]: PAYMENT_IMAGE_SOURCE[OptionalPaymentMethods.GOOGLEPAY]\n};\n\nexport const PaymentMethodLogoSVGUrlMapper = {\n [CheckoutPaymentOptionsOtherThanPayPal.Venmo]: PAYMENT_IMAGE_SOURCE[OptionalPaymentMethods.VENMO],\n [CheckoutPaymentOptionsOtherThanPayPal.PayLater]:\n PAYMENT_IMAGE_SOURCE[OptionalPaymentMethods.PAYLATER],\n [CheckoutPaymentOptionsOtherThanPayPal.ApplePay]:\n PAYMENT_IMAGE_SOURCE[OptionalPaymentMethods.APPLEPAY]\n};\n\nexport const Color = {\n [CheckoutSingleButtonColorType.Recommended]: '#FFD140',\n [CheckoutSingleButtonColorType.Black]: '#000000',\n [CheckoutSingleButtonColorType.White]: '#ffffff'\n};\n\nexport enum PreviewTabName {\n PRODUCT = 'product',\n CHECK_OUT = 'checkout',\n THANK_YOU = 'thankyou',\n STACKED_BUTTONS = 'stackedButtons',\n SINGLE_BUTTON = 'singleButton',\n VIEW_CART = 'viewCart'\n}\n\nexport const SINGLE_SELECT_ITEM_LIMIT = 15;\nexport const INVALID_OPTION_CONTENT_KEY = 'error.text.buyerInvalidOption';\n\nexport const CardSVGUrl = {\n cardSVGUrlWithApplePay: replaceGeoUrl(\n 'https://www.paypalobjects.com/images/Debit_Credit_APM.svg',\n serverData?.geoAwareDomain\n ),\n cardSVGUrlWithOutApplePay: replaceGeoUrl(\n 'https://www.paypalobjects.com/images/Debit_Credit.svg',\n serverData?.geoAwareDomain\n )\n};\n\n// reference: https://www.figma.com/design/2R4zzzptJETTxjvplCSTTM/No-Code-Checkout-2.0?node-id=13514-107034&m=dev\n// checkout button requires height in px unit to match SDK buttons, which only accept px values\nexport const ButtonSizes = {\n [CheckoutButtonSize.Large]: {\n minWidth: '11.625rem',\n maxWidth: '31.1875rem',\n horizontalWidth: '33.75rem',\n lineHeight: '1.5rem',\n fontWeight: 700,\n sdkFontSize: '1.125rem',\n sdkHeight: '50px',\n singleButtonFontSize: '1.125rem',\n singleButtonHeight: '3.125rem'\n },\n [CheckoutButtonSize.Medium]: {\n minWidth: '11.625rem',\n maxWidth: '24.9375rem',\n horizontalWidth: '30.625rem',\n lineHeight: '1.25rem',\n fontWeight: 700,\n sdkFontSize: '1rem',\n sdkHeight: '42px',\n singleButtonFontSize: '1rem',\n singleButtonHeight: '2.625rem'\n },\n [CheckoutButtonSize.Small]: {\n minWidth: '11.625rem',\n // need this to be 316px instead of 299px since minimum JS SDK button width is 150\n // so when 2 horizontal buttons are rendered side by side, it could be up to 150+150+16(gap)\n maxWidth: '19.75rem',\n horizontalWidth: '25rem',\n lineHeight: '1.125rem',\n fontWeight: 700,\n sdkFontSize: '0.75rem',\n sdkHeight: '32px',\n singleButtonFontSize: '0.875rem',\n singleButtonHeight: '2rem'\n }\n};\n\nexport const VenmoColorMapping = {\n gold: undefined,\n blue: 'silver',\n silver: 'blue',\n black: 'black',\n white: 'white'\n};\n\nexport const checkoutColorMapping = {\n default: {\n backgroundColor: '#001435',\n color: 'white',\n hoverBrightness: 1.5,\n focus: {\n outline: 'solid 0.3rem #009cde',\n offset: '-0.3rem'\n }\n },\n black: {\n color: 'white',\n backgroundColor: '#2c2e2f',\n hoverBrightness: 1.2\n },\n white: {\n color: '#2c2e2f',\n backgroundColor: 'white',\n border: '0.0625rem solid #555',\n hoverBrightness: 0.95\n }\n};\n\nexport enum CodeLanguages {\n HTML = 'html',\n REACT = 'react'\n}\n\nexport const PREVIEW_CART_ITEM_ID = 'preview_cart_item_id';\n","import { CheckoutPaymentOptionsOtherThanPayPal } from '@client/components/buttons/types';\nimport {\n ButtonVariation,\n type ButtonStyleConfig,\n type HostedButtonDetails,\n type PaymentAmountDetails,\n type PaymentBreakdownAmount,\n type SDKButtonStyle,\n type UcpConfig,\n FieldValueContent,\n type UserInputsType,\n MerchantInfo\n} from '@client/typings/Common';\nimport { WorldReadyProps } from '@client/contexts/WorldReadyContext';\nimport { getButtonVariablesFromMerchantSettings } from '@components/Settings/utils';\nimport type { ButtonConfig } from '@client/components/buttons/types';\nimport { SecondButtonType, Stacked3ButtonPaymentOption } from '@components/Settings/types';\nimport { IAppContext } from '@client/contexts/AppContext';\nimport { supportedCurrencies } from '@common/currencyConfigs';\nimport { getFeatureFlags } from '@client/helpers/ucpConfig';\nimport { JSSDK_SPECIAL_LOCALES_MAP } from '@common/constants';\nimport { extractSourceAndFlowType } from '@common/fpti';\nimport { FlowVariationType } from '@common/analytics';\nimport { PreviewTabName, PREVIEW_CART_ITEM_ID } from '@client/utils/constants';\nimport { CurrencyConfigType, formatCurrency, getLocalizedString } from './localeHelper';\nimport { DEFAULT_MERCHANT_CHECKOUT_SETTINGS } from '../components/Settings/getInitialMerchantSettings';\n\nconst ENABLED_FUNDING_METHODS = [\n CheckoutPaymentOptionsOtherThanPayPal.Venmo,\n CheckoutPaymentOptionsOtherThanPayPal.PayLater\n];\n\nexport const transformButtonVariables = (linkVariables: HostedButtonDetails['link_variables']) =>\n (linkVariables || []).reduce((acc, curr) => {\n acc[curr.name] = curr.value;\n return acc;\n }, {} as Record);\n\nexport const transformButtonVariablesToLinkVariables: (\n buttonVariables: Record\n) => Array<{ name: string; value: string | undefined }> = (buttonVariables) =>\n Object.entries(buttonVariables || {}).reduce(\n (acc, [name, value]) => [...acc, { name, value }],\n []\n );\n\nexport const transButtonStyleFromButtonVariables = (\n buttonStyleConfig: ButtonStyleConfig\n): SDKButtonStyle => {\n const { layout, shape, color, button_text: label, tagline } = buttonStyleConfig;\n const style: SDKButtonStyle = { layout, shape, color, label };\n\n if (layout !== 'vertical') {\n style.tagline = tagline === 'true' || tagline === true;\n } else {\n // JSSDK - style.tagline is not allowed for vertical layout\n style.tagline = false;\n }\n return style;\n};\n\nexport const isMerchantHostedExp = () =>\n typeof window !== 'undefined' && window.opener && window.opener !== window;\n\n/**\n * Align with round method used in worldready\n * (2.54, 0) => 3\n * (2.54, 1) => 2.5\n * (2.54, 2) => 2.54\n * (2.54, 3) => 2.54\n */\nexport const roundToMaxDecimal = (initValue: number, maximumFractionDigits: number = 2) => {\n const maxDecimals = Math.max(0, maximumFractionDigits);\n return +`${Math.round(Number(`${initValue}e${maxDecimals}`))}e-${maxDecimals}`;\n};\n\nexport const getTaxAmount = (\n subtotal: number,\n taxRate: number,\n maximumFractionDigits: number = 2\n) => {\n const taxAmount = (subtotal * taxRate) / 100;\n return roundToMaxDecimal(taxAmount, maximumFractionDigits);\n};\n\nexport const buttonIsEligible = (\n paymentMethod: CheckoutPaymentOptionsOtherThanPayPal,\n country: string | undefined,\n currency: string,\n config: UcpConfig | undefined\n) => {\n const paymentMethodConfig = config?.[paymentMethod];\n if (paymentMethodConfig) {\n const isSupportedCountry =\n !paymentMethodConfig.supportedCountries ||\n (country && paymentMethodConfig.supportedCountries.includes(country));\n const isSupportedCurrency =\n !paymentMethodConfig.supportedCurrencies ||\n paymentMethodConfig.supportedCurrencies.includes(currency);\n return isSupportedCountry && isSupportedCurrency;\n }\n return true;\n};\n\nexport const buttonIsAvailable = (\n paymentMethod: CheckoutPaymentOptionsOtherThanPayPal,\n country: string | undefined,\n currency: string,\n globalConfig: UcpConfig | undefined,\n flags: { enableApplePay: boolean },\n profileShipTax?: boolean\n) => {\n if (paymentMethod === CheckoutPaymentOptionsOtherThanPayPal.ApplePay && !flags.enableApplePay) {\n return false;\n }\n if (\n paymentMethod === CheckoutPaymentOptionsOtherThanPayPal.Venmo &&\n profileShipTax &&\n !globalConfig?.featureFlags?.venmoShipTaxSupport\n ) {\n return false;\n }\n const paymentMethodConfig = globalConfig?.[paymentMethod];\n const paymentMethodEnabled = !!paymentMethodConfig?.enabled;\n const buttonEligible = buttonIsEligible(paymentMethod, country, currency, globalConfig);\n if (!paymentMethodEnabled || !buttonEligible) {\n return false;\n }\n return true;\n};\n\nexport const transSDKFundingConfig = (\n allowedPaymentMethods: `${CheckoutPaymentOptionsOtherThanPayPal}`[]\n) => {\n const disabledPaymentMethods = Object.values(CheckoutPaymentOptionsOtherThanPayPal).filter(\n (method) => !allowedPaymentMethods.includes(method)\n );\n\n const enabledPaymentMethods = ENABLED_FUNDING_METHODS.filter((method) =>\n allowedPaymentMethods.includes(method)\n );\n\n const newConfig = {\n enableFunding: enabledPaymentMethods.length > 0 ? enabledPaymentMethods.join(',') : '',\n disableFunding: disabledPaymentMethods.length > 0 ? disabledPaymentMethods.join(',') : ''\n };\n return newConfig;\n};\n\nexport const getPaymentBreakdown = (\n paymentDetails: PaymentAmountDetails,\n currencyConfig: CurrencyConfigType\n): PaymentBreakdownAmount => {\n const maxDecimal = currencyConfig.maxDecimalPlaces;\n let shippingValue = parseFloat(paymentDetails.shipping);\n let taxRateValue = parseFloat(paymentDetails.taxRate);\n let itemPriceValue = parseFloat(paymentDetails.itemPrice);\n if (Number.isNaN(itemPriceValue)) {\n itemPriceValue = 0;\n }\n if (Number.isNaN(shippingValue)) {\n shippingValue = 0;\n }\n if (Number.isNaN(taxRateValue)) {\n taxRateValue = 0;\n }\n const roundedPrice = roundToMaxDecimal(itemPriceValue, maxDecimal);\n const subtotal = roundedPrice * paymentDetails.quantity;\n const taxAmount = getTaxAmount(subtotal, taxRateValue, maxDecimal);\n return {\n subtotal: roundToMaxDecimal(subtotal, maxDecimal),\n shipping: roundToMaxDecimal(shippingValue, maxDecimal),\n taxAmount: roundToMaxDecimal(taxAmount, maxDecimal),\n total: roundToMaxDecimal(subtotal + shippingValue + taxAmount, maxDecimal)\n };\n};\n\nexport const getAllowedPaymentMethodsFromConfigs = (\n merchantCountry: string | undefined,\n ucpConfig: UcpConfig | undefined,\n currencyCode: string,\n toggles: {\n paymentMethodVenmo: boolean | undefined;\n paymentMethodPayLater: boolean | undefined;\n paymentMethodApplePay: boolean | undefined;\n },\n flags: {\n enableApplePay: boolean; // TODO: Remove this after elmo is ramped to 100%\n },\n profileShipTax?: boolean\n): CheckoutPaymentOptionsOtherThanPayPal[] => {\n const venmoToggle =\n toggles.paymentMethodVenmo ?? DEFAULT_MERCHANT_CHECKOUT_SETTINGS.payment_method_venmo;\n const payLaterToggle =\n toggles.paymentMethodPayLater ?? DEFAULT_MERCHANT_CHECKOUT_SETTINGS.payment_method_paylater;\n const applePayToggle =\n toggles.paymentMethodApplePay ?? DEFAULT_MERCHANT_CHECKOUT_SETTINGS.payment_method_apple_pay;\n\n const switches = {\n [CheckoutPaymentOptionsOtherThanPayPal.Venmo]: venmoToggle,\n [CheckoutPaymentOptionsOtherThanPayPal.PayLater]: payLaterToggle,\n [CheckoutPaymentOptionsOtherThanPayPal.ApplePay]: applePayToggle,\n [CheckoutPaymentOptionsOtherThanPayPal.Card]: true\n };\n const allowedMethods = Object.values(CheckoutPaymentOptionsOtherThanPayPal).reduce(\n (acc, paymentOption) => {\n const buttonAvailable = buttonIsAvailable(\n paymentOption,\n merchantCountry,\n currencyCode,\n ucpConfig,\n flags,\n profileShipTax\n );\n if (buttonAvailable && switches[paymentOption]) {\n return acc.concat(paymentOption);\n }\n return acc;\n },\n [] as CheckoutPaymentOptionsOtherThanPayPal[]\n );\n return allowedMethods;\n};\n\nexport const shouldShow3ButtonsInDetails = (appContext: IAppContext | null) => {\n const originalButtonVariables = transformButtonVariables(\n appContext?.hostedButton?.button_variables\n );\n const merchantSettings = appContext?.merchantSettings;\n const isSettingsEnabled = appContext?.isSettingsEnabled;\n const buttonVariables = getButtonVariablesFromMerchantSettings(\n merchantSettings,\n originalButtonVariables,\n isSettingsEnabled\n );\n return !!(\n (appContext?.isSlowRampMerchant || !!buttonVariables.checkout_button_type) &&\n getFeatureFlags(appContext).jsSDKThreeButtonExp\n );\n};\n\nexport const shouldShow3ButtonsInEditor = (appContext: IAppContext | null) =>\n !!(appContext?.is3ButtonsEligible && getFeatureFlags(appContext).jsSDKThreeButtonExp);\n\nexport const get3ButtonsPaymentEligibility = (\n enableApplePay,\n currencyCode,\n country,\n config,\n profileShipTax?\n) => {\n const flags = { enableApplePay: enableApplePay ?? false };\n const showVenmo = currencyCode\n ? buttonIsAvailable(\n CheckoutPaymentOptionsOtherThanPayPal.Venmo,\n country,\n currencyCode,\n config,\n flags,\n profileShipTax\n ) && window?.paypal?.isFundingEligible?.(CheckoutPaymentOptionsOtherThanPayPal.Venmo)\n : false;\n const showPayLater = currencyCode\n ? buttonIsAvailable(\n CheckoutPaymentOptionsOtherThanPayPal.PayLater,\n country,\n currencyCode,\n config,\n flags\n ) && window?.paypal?.isFundingEligible?.(CheckoutPaymentOptionsOtherThanPayPal.PayLater)\n : false;\n const eligibleApplePay = currencyCode\n ? buttonIsAvailable(\n CheckoutPaymentOptionsOtherThanPayPal.ApplePay,\n country,\n currencyCode,\n config,\n flags\n )\n : false;\n return {\n showVenmo,\n showPayLater,\n eligibleApplePay\n };\n};\n/**\n * Map WorldReady locale to jssdk locale.\n * @param locale\n * @returns\n */\nexport const sdkLocaleMapper = (locale: string) => {\n return (JSSDK_SPECIAL_LOCALES_MAP[locale] || locale || 'en-US').replace('-', '_');\n};\n\nexport const shouldShow3ButtonsAlert = (appContext: IAppContext | null) => {\n const originalButtonVariables = transformButtonVariables(\n appContext?.hostedButton?.button_variables\n );\n\n const merchantSettings = appContext?.merchantSettings;\n const isSettingsEnabled = appContext?.isSettingsEnabled;\n const buttonVariables = getButtonVariablesFromMerchantSettings(\n merchantSettings,\n originalButtonVariables,\n isSettingsEnabled\n );\n return (\n appContext?.hostedButton?.id &&\n shouldShow3ButtonsInEditor(appContext) &&\n !buttonVariables.checkout_button_type\n );\n};\n\nexport const getSourceAndFlowTypeForOrderStatus = (appContext: IAppContext | null) => {\n const checkoutButtonTextType = appContext?.orderDetails?.checkoutButtonTextType;\n const isSlowRampMerchant = appContext?.isSlowRampMerchant;\n let { sourceType, flowType } = extractSourceAndFlowType(appContext?.fptiData);\n if (isMerchantHostedExp()) {\n if (isSlowRampMerchant || !!checkoutButtonTextType) {\n flowType = 'merchant';\n sourceType = '3_button_code';\n } else {\n flowType = 'merchant';\n sourceType = 'button_code';\n }\n }\n return { sourceType, flowType };\n};\n\nexport const isMerchantHostedPreview = (isPreview: boolean, tabName: string) =>\n isPreview && (tabName === PreviewTabName.PRODUCT || tabName === PreviewTabName.STACKED_BUTTONS);\n\nexport const getButtonVariation = (appContext: IAppContext | null) =>\n appContext?.buttonVariation || ButtonVariation.BuyNow;\n\nexport const getFlowVariation = (appContext: IAppContext | null): FlowVariationType =>\n getButtonVariation(appContext) === ButtonVariation.Cart ? 'add_to_cart' : 'buy_now';\n\nexport const getCurrencyList = (country: string | undefined) => {\n return (\n country === 'MY' ? supportedCurrencies : supportedCurrencies.filter((_) => _ !== 'MYR')\n ).map((currency) => ({\n value: currency,\n primaryText: currency\n }));\n};\n\nexport const getValueContent = (\n worldReady: WorldReadyProps,\n value: number | `${FieldValueContent}`,\n currencyCode: string | undefined,\n showCurrencySymbol: boolean = true\n) => {\n if (value === FieldValueContent.EstimateLater) {\n return getLocalizedString(worldReady, 'payment.text.estimatedLater');\n }\n\n if (value === FieldValueContent.Free) {\n return getLocalizedString(worldReady, 'payment.text.freeShipping');\n }\n\n return formatCurrency(worldReady, currencyCode, value, showCurrencySymbol);\n};\n\nexport const getNumItemsInPreviewCart = (userInputs: UserInputsType) =>\n parseInt(userInputs?.cartItems?.[PREVIEW_CART_ITEM_ID]?.quantity || '0', 10);\n\nexport const getPreviewMerchantInfoWithFallback = (\n worldReady: WorldReadyProps,\n merchantInfo: MerchantInfo | undefined\n): MerchantInfo => ({\n ...merchantInfo,\n businessName:\n merchantInfo?.businessName ||\n `[${getLocalizedString(worldReady, 'app.business.name.fallbackText')}]`,\n countryCode: merchantInfo?.countryCode || '',\n merchantId: merchantInfo?.merchantId || '',\n primaryCurrencyCode: merchantInfo?.primaryCurrencyCode || null\n});\n\nexport const get3ButtonRenderListFromButtonConfig = (\n buttonConfig: ButtonConfig,\n options: {\n showVenmo: boolean | undefined;\n showPayLater: boolean | undefined;\n isSettingsEnabled: boolean | undefined;\n }\n) => {\n const buttonRenderList = [Stacked3ButtonPaymentOption.PayPal];\n\n if (options?.isSettingsEnabled) {\n switch (buttonConfig.secondButtonType) {\n case SecondButtonType.PayPalRecommended:\n if (buttonConfig.paymentMethodVenmo && options?.showVenmo) {\n buttonRenderList.push(Stacked3ButtonPaymentOption.Venmo);\n } else if (buttonConfig.paymentMethodPayLater && options?.showPayLater) {\n buttonRenderList.push(Stacked3ButtonPaymentOption.PayLater);\n }\n break;\n\n case SecondButtonType.Venmo:\n if (buttonConfig.paymentMethodVenmo && options?.showVenmo) {\n buttonRenderList.push(Stacked3ButtonPaymentOption.Venmo);\n }\n break;\n\n case SecondButtonType.PayLater:\n if (buttonConfig.paymentMethodPayLater && options?.showPayLater) {\n buttonRenderList.push(Stacked3ButtonPaymentOption.PayLater);\n }\n break;\n\n default:\n break;\n }\n }\n\n if (!options?.isSettingsEnabled) {\n if (options?.showVenmo) {\n buttonRenderList.push(Stacked3ButtonPaymentOption.Venmo);\n } else if (options?.showPayLater) {\n buttonRenderList.push(Stacked3ButtonPaymentOption.PayLater);\n }\n }\n\n buttonRenderList.push(Stacked3ButtonPaymentOption.Checkout);\n return buttonRenderList;\n};\n\nexport const get3ButtonPreferencesFromButtonVariables = (\n buttonVariables: Record,\n enableFundingMethods: CheckoutPaymentOptionsOtherThanPayPal[],\n isSettingsEnabled: boolean | undefined\n) => {\n const buttonPreferences: Array = [\n Stacked3ButtonPaymentOption.PayPal\n ];\n\n if (isSettingsEnabled) {\n switch (buttonVariables.second_button_type) {\n case SecondButtonType.PayPalRecommended:\n if (\n buttonVariables.payment_method_venmo === 'true' &&\n enableFundingMethods.includes(CheckoutPaymentOptionsOtherThanPayPal.Venmo)\n ) {\n buttonPreferences.push(Stacked3ButtonPaymentOption.Venmo);\n } else if (\n buttonVariables.payment_method_paylater === 'true' &&\n enableFundingMethods.includes(CheckoutPaymentOptionsOtherThanPayPal.PayLater)\n ) {\n buttonPreferences.push(Stacked3ButtonPaymentOption.PayLater);\n }\n break;\n\n case SecondButtonType.Venmo:\n if (\n buttonVariables.payment_method_venmo === 'true' &&\n enableFundingMethods.includes(CheckoutPaymentOptionsOtherThanPayPal.Venmo)\n ) {\n buttonPreferences.push(Stacked3ButtonPaymentOption.Venmo);\n }\n break;\n\n case SecondButtonType.PayLater:\n if (\n buttonVariables.payment_method_paylater === 'true' &&\n enableFundingMethods.includes(CheckoutPaymentOptionsOtherThanPayPal.PayLater)\n ) {\n buttonPreferences.push(Stacked3ButtonPaymentOption.PayLater);\n }\n break;\n\n default:\n break;\n }\n } else {\n buttonPreferences.push('default');\n }\n\n return buttonPreferences;\n};\n\n// Taken from pp-react\n// https://github.paypal.com/PayPal-UI-R/pp-react/blob/6815c9f62a7e461cc6d38eaac677ad9db0dbc4a2/packages/horizontal-scroll/src/horizontalScroll.tsx#L76-L79\n// https://github.paypal.com/PayPal-UI-R/pp-react/search?p=2&q=breakpoints.mediaMd\nexport const DESKTOP_WIDTH_BREAKPOINT = 752;\n\nexport const getIsDesktop = () => {\n return window.innerWidth >= DESKTOP_WIDTH_BREAKPOINT;\n};\n\nexport const MOBILE_WIDTH_BREAKPOINT = 751;\n\nexport const getIsMobile = () => {\n return window.innerWidth <= MOBILE_WIDTH_BREAKPOINT;\n};\n","/**\n * !!!!!! THIS FILE ASSUMES THAT ALL NUMBERS HAVE ALREADY BEEN NORMALIZED !!!!!!\n *\n * All initial validations logic taken from `smart-button-editor`'s `validate.js`\n * https://github.paypal.com/Checkout/smart-button-editor/blob/master/src/common/validate.js\n *\n * Validations documented here: https://paypal.atlassian.net/wiki/spaces/NCPS/pages/815675533/NCPS+button+validations\n *\n */\nimport { CurrencyFormat } from '@paypalcorp/worldready';\nimport { Buffer } from 'buffer';\nimport { WorldReadyProps } from '@client/utils/localeHelper';\nimport {\n CheckoutButtonLayout,\n PaymentButtonType,\n CheckoutButtonType,\n CheckoutButtonShape,\n CheckoutButtonColor,\n CheckoutPaypalButtonText,\n CheckoutButtonSize,\n NoShipping,\n CheckoutButtonTextType,\n ReturnUrlType,\n ShippingPreference,\n TaxRatePreference,\n CheckoutSingleButtonColorType,\n SingleButtonTextType\n} from '@components/buttons/types';\nimport type { KrakenRequest } from '@server/typings';\nimport { ButtonType, SINGLE_SELECT_ITEM_LIMIT } from '@client/utils/constants';\nimport { supportedCurrencies, amountValidations, shippingValidations } from './currencyConfigs';\n\n// Shared error messages\nexport enum ValidationErrorType {\n REQUIRED = 'required',\n INVALID_NUMBER = 'invalidNumber',\n INVALID_INTEGER = 'invalidInteger',\n INVALID_SIZE = 'invalidSize',\n INVALID_RANGE = 'invalidRange',\n DECIMAL_PLACES = 'decimalPlaces',\n DECIMAL_NOT_SUPPORTED = 'decimalNotSupported',\n UNSUPPORTED_CURRENCY = 'unsupportedCurrency',\n INVALID_BUTTON_TYPE = 'invalidButtonType',\n UNSUPPORTED_TYPE = 'unsupportedType',\n INVALID_URL = 'invalidUrl',\n INVALID_CUSTOM_COLOR = 'invalidCustomColor',\n DUPLICATE = 'duplicate',\n GENERIC_INVALID = 'genericInvalid',\n NEED_COLLECT_SHIPPING_ADDR = 'needCollectShippingAddress',\n NOT_SUPPORT_FROM_PROFILE = 'notSupportFromProfile'\n}\n\nexport type ValidationError = {\n error?: `${ValidationErrorType}`;\n details?: {\n min?: number;\n max?: number;\n numOfPlaces?: number;\n };\n};\n\ntype ItemError = {\n desc: ValidationError;\n price: ValidationError;\n};\n\nexport interface ItemsError extends ValidationError {\n itemErrors?: Array;\n}\n\n// To support both the server and client side typings for WorldReady.\ntype WorldReadyFlex = WorldReadyProps | KrakenRequest['worldReady'];\n\ntype NumberInput = string;\n\n// Data size/length validations\nconst MAX_BYTES_ITEM_NAME = 127;\nconst MAX_CHARS_LABEL = 127;\nconst MAX_CHARS_OPTION_NAME = 64;\nconst MAX_CHARS_MEMO_LABEL = 64;\nexport const MAX_CHARS_BUTTON_TEXT = 20;\n\n// Min/max config taken from smart-button-editor\nexport const MIN_QUANTITY = 1;\nexport const MAX_QUANTITY = 100;\nexport const taxConfig = {\n min: 0,\n max: 99.9999,\n maxDecimals: 4\n};\n\nconst trimString = (value: unknown) => (typeof value === 'string' ? value.trim() : '');\n\nexport const validateItemName = (itemName: string | unknown, buttonType: string) => {\n const validations: ValidationError = {};\n const trimmedItemName = trimString(itemName);\n if (trimmedItemName === '') {\n if (buttonType === ButtonType.FIXED_PRICE || buttonType === ButtonType.SINGLE_SELECT_LIST) {\n validations.error = ValidationErrorType.REQUIRED;\n }\n } else if (Buffer.byteLength(trimmedItemName, 'utf8') > MAX_BYTES_ITEM_NAME) {\n validations.error = ValidationErrorType.INVALID_SIZE;\n }\n return validations;\n};\n\nexport const validateQuantity = (quantity: NumberInput, isEnabled: boolean) => {\n const validations: ValidationError = {};\n if (!isEnabled) {\n return validations;\n }\n\n const quantityNum = Number(quantity);\n if (quantity === '') {\n validations.error = ValidationErrorType.REQUIRED;\n } else if (Number.isNaN(quantityNum)) {\n validations.error = ValidationErrorType.INVALID_NUMBER;\n } else if (!Number.isInteger(quantityNum)) {\n validations.error = ValidationErrorType.INVALID_INTEGER;\n } else if (quantityNum < MIN_QUANTITY || quantityNum > MAX_QUANTITY) {\n validations.error = ValidationErrorType.INVALID_RANGE;\n validations.details = {\n min: MIN_QUANTITY,\n max: MAX_QUANTITY\n };\n }\n\n return validations;\n};\n\nconst VALID_SINGLE_BUTTON_COLOR_TYPES = [\n CheckoutSingleButtonColorType.Recommended,\n CheckoutSingleButtonColorType.Black,\n CheckoutSingleButtonColorType.White,\n CheckoutSingleButtonColorType.Custom\n];\nexport const validateSingleButtonColorType = (\n singleColorType: string,\n isSettingsEnabled: boolean = false\n) => {\n const validations: ValidationError = {};\n if (isSettingsEnabled && !singleColorType) {\n return validations;\n }\n if (!singleColorType) {\n validations.error = ValidationErrorType.REQUIRED;\n } else if (VALID_SINGLE_BUTTON_COLOR_TYPES.every((value) => value !== singleColorType)) {\n validations.error = ValidationErrorType.UNSUPPORTED_TYPE;\n }\n return validations;\n};\n\nexport const validateCustomColor = (\n singleButtonColorType: string | undefined,\n color: string | undefined,\n isSettingsEnabled: boolean = false\n) => {\n const validations: ValidationError = {};\n\n if (isSettingsEnabled && !color) {\n return validations;\n }\n\n if (singleButtonColorType !== CheckoutSingleButtonColorType.Custom) {\n return validations;\n }\n\n const HEX_VALIDATION = /^[A-Fa-f0-9]{6}$/g;\n if (!color || !color.match(HEX_VALIDATION)) {\n validations.error = ValidationErrorType.INVALID_CUSTOM_COLOR;\n }\n return validations;\n};\n\nconst VALID_SINGLE_BUTTON_TEXT_TYPES = [\n SingleButtonTextType.Buynow,\n SingleButtonTextType.Paynow,\n SingleButtonTextType.Custom\n];\nexport const validateSingleButtonTextType = (singleButtonTextType: string) => {\n const validations: ValidationError = {};\n if (!singleButtonTextType) {\n validations.error = ValidationErrorType.REQUIRED;\n } else if (VALID_SINGLE_BUTTON_TEXT_TYPES.every((value) => value !== singleButtonTextType)) {\n validations.error = ValidationErrorType.UNSUPPORTED_TYPE;\n }\n return validations;\n};\n\nexport const validateSingleButtonCustomText = (\n singleButtonTextType: string,\n singleButtonCustomText: string\n) => {\n const validations: ValidationError = {};\n if (singleButtonTextType !== SingleButtonTextType.Custom) {\n return validations;\n }\n\n const trimmedLabel = trimString(singleButtonCustomText);\n if (trimmedLabel === '') {\n validations.error = ValidationErrorType.REQUIRED;\n } else if (trimmedLabel.length > MAX_CHARS_BUTTON_TEXT) {\n validations.error = ValidationErrorType.INVALID_SIZE;\n }\n return validations;\n};\n\n// This should only be applied to a normalized number so that % will work correctly with Number.\nconst isDecimal = (n: number) => !Number.isNaN(n) && n % 1 !== 0;\n\n// At this point, we should have normalized the prices/numbers so the decimal should be using the expected separator (\".\")\nconst countDecimals = (n: number) => {\n let decimalCount: number | undefined;\n if (isDecimal(n)) {\n decimalCount = n.toString().split('.')[1].length;\n }\n return decimalCount || 0;\n};\n\n// Get the maximum number of decimals allowed from WorldReady and validate the number.\nexport const checkForDecimalErrors = (\n worldReady: WorldReadyFlex,\n num: number,\n currency: string\n): {\n hasError: boolean;\n decimalError?: ValidationError;\n} => {\n const castedWorldReady = worldReady as WorldReadyProps; // TODO: fix the type\n const currencyOptions = new CurrencyFormat(castedWorldReady, {\n currency\n }).resolvedOptions();\n\n // If for some reason WorldReady does not have a max fraction digit,\n // we'll use the original fallback of 2.\n const maximumFractionDigits =\n currencyOptions?.maximumFractionDigits !== undefined\n ? currencyOptions.maximumFractionDigits\n : 2;\n\n // If the currency does not support decimals (maximumFractionDigits = 0),\n // then we should return decimal not supported.\n if (isDecimal(num) && maximumFractionDigits === 0) {\n return {\n hasError: true,\n decimalError: {\n error: ValidationErrorType.DECIMAL_NOT_SUPPORTED\n }\n };\n }\n\n if (countDecimals(num) > maximumFractionDigits) {\n return {\n hasError: true,\n decimalError: {\n error: ValidationErrorType.DECIMAL_PLACES,\n details: {\n numOfPlaces: maximumFractionDigits\n }\n }\n };\n }\n\n return {\n hasError: false\n };\n};\n\nexport const validateTaxRate = (taxRatePreference: string | undefined, taxRate: NumberInput) => {\n const validations: ValidationError = {};\n /**\n * 1. Tax rate is optional so we should just return if it's not passed in\n * 2. When tax rate preference is NOT custom, we send '0'\n */\n if (!taxRate || taxRatePreference !== TaxRatePreference.Custom) {\n return validations;\n }\n\n const rateNum = parseFloat(taxRate);\n const isTaxValid = rateNum >= taxConfig.min && rateNum <= taxConfig.max;\n\n if (Number.isNaN(rateNum)) {\n validations.error = ValidationErrorType.INVALID_NUMBER;\n } else if (!isTaxValid) {\n validations.error = ValidationErrorType.INVALID_RANGE;\n validations.details = {\n min: taxConfig.min,\n max: taxConfig.max\n };\n } else if (countDecimals(rateNum) > taxConfig.maxDecimals) {\n validations.error = ValidationErrorType.DECIMAL_PLACES;\n validations.details = {\n numOfPlaces: 4\n };\n }\n return validations;\n};\n\nexport const validateShipping = (\n worldReady: WorldReadyFlex,\n shippingPreference: string | undefined,\n shipping: NumberInput,\n currencyCode: string\n) => {\n let validations: ValidationError = {};\n const minShipping = shippingValidations[currencyCode]?.min ?? shippingValidations.default.min;\n const maxShipping = shippingValidations[currencyCode]?.max;\n\n /**\n * 1. Shipping is optional so return early if there is no value.\n * 2. When shipping preference is NOT custom, we send '0'\n */\n if (!shipping || shippingPreference !== ShippingPreference.Custom) {\n return validations;\n }\n\n const shippingNum = parseFloat(shipping);\n const { hasError: hasDecimalError, decimalError } = checkForDecimalErrors(\n worldReady,\n shippingNum,\n currencyCode\n );\n if (Number.isNaN(shippingNum)) {\n validations.error = ValidationErrorType.INVALID_NUMBER;\n } else if (shippingNum < minShipping) {\n validations.error = ValidationErrorType.INVALID_RANGE;\n validations.details = {\n min: minShipping\n };\n } else if (maxShipping && shippingNum > maxShipping) {\n validations.error = ValidationErrorType.INVALID_RANGE;\n validations.details = {\n max: maxShipping\n };\n } else if (hasDecimalError) {\n validations = {\n ...validations,\n ...decimalError\n };\n }\n return validations;\n};\n\n// Fixed price amount validations. Re-used when verifying the single select list\n// item prices.\nexport const validateAmount = (\n worldReady: WorldReadyFlex,\n amount: NumberInput,\n currencyCode: string\n) => {\n let validations: ValidationError = {};\n const minAmount = amountValidations[currencyCode]?.min ?? amountValidations.default.min;\n const maxAmount = amountValidations[currencyCode]?.max;\n\n const amountNum = Number(amount);\n const { hasError: hasDecimalError, decimalError } = checkForDecimalErrors(\n worldReady,\n amountNum,\n currencyCode\n );\n if (amount === '') {\n validations.error = ValidationErrorType.REQUIRED;\n } else if (Number.isNaN(amountNum)) {\n validations.error = ValidationErrorType.INVALID_NUMBER;\n } else if (amountNum < minAmount) {\n validations.error = ValidationErrorType.INVALID_RANGE;\n validations.details = {\n min: minAmount\n };\n } else if (maxAmount && amountNum > maxAmount) {\n validations.error = ValidationErrorType.INVALID_RANGE;\n validations.details = {\n max: maxAmount\n };\n } else if (hasDecimalError) {\n validations = {\n ...validations,\n ...decimalError\n };\n }\n return validations;\n};\n\nexport const validateItems = (\n worldReady: WorldReadyFlex,\n items: Array<{ desc: string; price: NumberInput }>,\n currencyCode: string,\n checkMaxQuantity?: boolean\n) => {\n const validations: ItemsError = {};\n const itemErrors: Array = [];\n\n // If no list is provided, we need to throw a required validation error.\n if (!items.length) {\n validations.error = ValidationErrorType.REQUIRED;\n return validations;\n }\n\n // If we have more than 15 items, we should throw an error. This error does not have a corresponding\n // error message on the UI since the UI should be blocking item addition past 15, we should just be\n // showing the generic error message.\n if (checkMaxQuantity && items.length > SINGLE_SELECT_ITEM_LIMIT) {\n validations.error = ValidationErrorType.GENERIC_INVALID;\n return validations;\n }\n\n // Iterate through each of the items and ensure that the descriptions and the amounts are valid.\n items.forEach((item, index) => {\n const trimmedDesc = item.desc.trim();\n const descError: ValidationError = {};\n if (trimmedDesc === '') {\n descError.error = ValidationErrorType.REQUIRED;\n } else if (\n trimmedDesc.length > MAX_CHARS_OPTION_NAME ||\n Buffer.byteLength(trimmedDesc, 'utf8') > MAX_BYTES_ITEM_NAME\n ) {\n descError.error = ValidationErrorType.INVALID_SIZE;\n } else if (\n items.some(\n (itemTemp, indexTemp) => itemTemp.desc.trim() === trimmedDesc && indexTemp !== index\n )\n ) {\n descError.error = ValidationErrorType.DUPLICATE;\n }\n\n const priceError: ValidationError = validateAmount(worldReady, item.price, currencyCode);\n itemErrors.push({ desc: descError, price: priceError });\n });\n\n // If even one of the items in the list has an error,\n // then we should set the whole errors list.\n const hasItemError = itemErrors.some((err) => err.desc.error || err.price.error);\n if (hasItemError) {\n validations.itemErrors = itemErrors;\n }\n\n return validations;\n};\n\n// For Variable Price labels - price, and invoice (optional)\nexport const validateVariableLabel = (label: string | unknown, isRequired: boolean) => {\n const validations: ValidationError = {};\n const trimmedLabel = trimString(label);\n if (isRequired && trimmedLabel === '') {\n validations.error = ValidationErrorType.REQUIRED;\n } else if (trimmedLabel.length > MAX_CHARS_LABEL) {\n validations.error = ValidationErrorType.INVALID_SIZE;\n }\n return validations;\n};\nexport const validateMemoLabel = (label: string | unknown) => {\n const validations: ValidationError = {};\n const trimmedLabel = trimString(label);\n if (trimmedLabel.length > MAX_CHARS_MEMO_LABEL) {\n validations.error = ValidationErrorType.INVALID_SIZE;\n }\n return validations;\n};\n\nexport const validateCurrencyCode = (currencyCode: string, country: string) => {\n const validations: ValidationError = {};\n if ((currencyCode === 'MYR' && country !== 'MY') || !supportedCurrencies.includes(currencyCode)) {\n validations.error = ValidationErrorType.UNSUPPORTED_CURRENCY;\n }\n return validations;\n};\n\nconst VALID_LAYOUT_TYPES = [CheckoutButtonLayout.Vertical, CheckoutButtonLayout.Horizontal];\nexport const validateLayout = (layout: string, isSettingsEnabled: boolean = false) => {\n const validations: ValidationError = {};\n if (isSettingsEnabled && !layout) {\n return validations;\n }\n if (!layout) {\n validations.error = ValidationErrorType.REQUIRED;\n } else if (VALID_LAYOUT_TYPES.every((value) => value !== layout)) {\n validations.error = ValidationErrorType.UNSUPPORTED_TYPE;\n }\n return validations;\n};\n\nconst VALID_SHAPE_TYPES = [CheckoutButtonShape.Pill, CheckoutButtonShape.Rect];\nexport const validateShape = (shape: string, isSettingsEnabled: boolean = false) => {\n const validations: ValidationError = {};\n if (isSettingsEnabled && !shape) {\n return validations;\n }\n if (!shape) {\n validations.error = ValidationErrorType.REQUIRED;\n } else if (VALID_SHAPE_TYPES.every((value) => value !== shape)) {\n validations.error = ValidationErrorType.UNSUPPORTED_TYPE;\n }\n return validations;\n};\n\nconst VALID_COLOR_TYPES = [\n CheckoutButtonColor.Black,\n CheckoutButtonColor.Blue,\n CheckoutButtonColor.Gold,\n CheckoutButtonColor.Silver,\n CheckoutButtonColor.White\n];\nexport const validateColor = (color: string, isSettingsEnabled: boolean = false) => {\n const validations: ValidationError = {};\n if (isSettingsEnabled && !color) {\n return validations;\n }\n if (!color) {\n validations.error = ValidationErrorType.REQUIRED;\n } else if (VALID_COLOR_TYPES.every((value) => value !== color)) {\n validations.error = ValidationErrorType.UNSUPPORTED_TYPE;\n }\n return validations;\n};\n\nconst VALID_BUTTON_TEXT_TYPES = [\n CheckoutPaypalButtonText.Buynow,\n CheckoutPaypalButtonText.Checkout,\n CheckoutPaypalButtonText.Installment,\n CheckoutPaypalButtonText.Pay,\n CheckoutPaypalButtonText.Paypal\n];\nexport const validateButtonText = (buttonText: string) => {\n const validations: ValidationError = {};\n if (!buttonText) {\n validations.error = ValidationErrorType.REQUIRED;\n } else if (VALID_BUTTON_TEXT_TYPES.every((value) => value !== buttonText)) {\n validations.error = ValidationErrorType.UNSUPPORTED_TYPE;\n }\n return validations;\n};\n\nconst VALID_PAYMENT_BUTTON_TYPES = [PaymentButtonType.Button, PaymentButtonType.Link];\nexport const validatePaymentButtonType = (paymentButtonType: string) => {\n const validations: ValidationError = {};\n if (!paymentButtonType) {\n validations.error = ValidationErrorType.REQUIRED;\n } else if (VALID_PAYMENT_BUTTON_TYPES.every((value) => value !== paymentButtonType)) {\n validations.error = ValidationErrorType.UNSUPPORTED_TYPE;\n }\n return validations;\n};\n\nconst VALID_NO_SHIPPING_TYPES = [NoShipping.NoPrompt, NoShipping.PromptRequired];\nexport const validateNoShipping = (noShipping: string) => {\n const validations: ValidationError = {};\n if (!noShipping) {\n validations.error = ValidationErrorType.REQUIRED;\n } else if (VALID_NO_SHIPPING_TYPES.every((value) => value !== noShipping)) {\n validations.error = ValidationErrorType.UNSUPPORTED_TYPE;\n }\n return validations;\n};\n\nconst VALID_CHECKOUT_BUTTON_TYPES = [CheckoutButtonType.Single, CheckoutButtonType.Stacked];\nexport const validateCheckoutButtonType = (checkoutButtonType: string) => {\n const validations: ValidationError = {};\n if (!checkoutButtonType) {\n validations.error = ValidationErrorType.REQUIRED;\n } else if (VALID_CHECKOUT_BUTTON_TYPES.every((value) => value !== checkoutButtonType)) {\n validations.error = ValidationErrorType.UNSUPPORTED_TYPE;\n }\n return validations;\n};\n\nconst VALID_CHECKOUT_BUTTON_TEXT_TYPES = [\n CheckoutButtonTextType.Checkout,\n CheckoutButtonTextType.Pay,\n CheckoutButtonTextType.Proceed,\n CheckoutButtonTextType.Custom\n];\nexport const validateCheckoutButtonTextType = (\n checkoutButtonTextType: string,\n isSettingsEnabled: boolean = false\n) => {\n const validations: ValidationError = {};\n if (isSettingsEnabled && !checkoutButtonTextType) {\n return validations;\n }\n if (!checkoutButtonTextType) {\n validations.error = ValidationErrorType.REQUIRED;\n } else if (VALID_CHECKOUT_BUTTON_TEXT_TYPES.every((value) => value !== checkoutButtonTextType)) {\n validations.error = ValidationErrorType.UNSUPPORTED_TYPE;\n }\n return validations;\n};\n\nexport const validateCheckoutButtonCustomText = (\n checkoutButtonTextType?: string,\n checkoutButtonCustomText?: string,\n isSettingsEnabled: boolean = false\n) => {\n const validations: ValidationError = {};\n if (isSettingsEnabled && !checkoutButtonCustomText) {\n return validations;\n }\n if (checkoutButtonTextType !== CheckoutButtonTextType.Custom) {\n return validations;\n }\n\n const trimmedLabel = trimString(checkoutButtonCustomText);\n if (trimmedLabel === '') {\n validations.error = ValidationErrorType.REQUIRED;\n } else if (trimmedLabel.length > MAX_CHARS_BUTTON_TEXT) {\n validations.error = ValidationErrorType.INVALID_SIZE;\n }\n return validations;\n};\n\nconst VALID_SIZE_TYPES = [\n CheckoutButtonSize.Large,\n CheckoutButtonSize.Medium,\n CheckoutButtonSize.Small\n];\nexport const validateSize = (size: string, isSettingsEnabled: boolean = false) => {\n const validations: ValidationError = {};\n if (isSettingsEnabled && !size) {\n return validations;\n }\n if (!size) {\n validations.error = ValidationErrorType.REQUIRED;\n } else if (VALID_SIZE_TYPES.every((value) => value !== size)) {\n validations.error = ValidationErrorType.UNSUPPORTED_TYPE;\n }\n return validations;\n};\n\n// https://uibakery.io/regex-library/url\nconst URL_REGEX =\n /^((http|https)\\:\\/\\/)?[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b(?:[-a-zA-Z0-9()@:%_\\+.~#?&//=]*)$/;\nexport const validateUrl = (url: string) => {\n const validations: ValidationError = {};\n const trimmedUrl = trimString(url);\n if (!trimmedUrl) return validations; // Optional\n\n if (trimmedUrl.length > MAX_CHARS_LABEL) {\n validations.error = ValidationErrorType.INVALID_SIZE;\n } else if (!URL_REGEX.test(url)) {\n validations.error = ValidationErrorType.INVALID_URL;\n }\n return validations;\n};\n\nconst VALID_RETURN_URL_TYPES = [ReturnUrlType.Custom, ReturnUrlType.None];\nexport const validateReturnUrlType = (returnUrlType: string) => {\n const validations: ValidationError = {};\n if (!returnUrlType) {\n validations.error = ValidationErrorType.REQUIRED;\n } else if (VALID_RETURN_URL_TYPES.every((value) => value !== returnUrlType)) {\n validations.error = ValidationErrorType.UNSUPPORTED_TYPE;\n }\n return validations;\n};\n\nexport const validateReturnUrl = (returnUrlType: string, returnUrl: string) => {\n const validations: ValidationError = {};\n if (returnUrlType !== ReturnUrlType.Custom) {\n return validations;\n }\n if (!trimString(returnUrl)) {\n validations.error = ValidationErrorType.INVALID_URL;\n return validations;\n }\n\n return validateUrl(returnUrl);\n};\n\nconst VALID_SHIPPING_PREFERENCES = [\n ShippingPreference.Custom,\n ShippingPreference.Free,\n ShippingPreference.FromProfile,\n ShippingPreference.NotApplicable\n];\nexport const validateShippingPreference = (\n shippingPreference: string | undefined,\n noShipping: string,\n supportProfileShipTaxConfig?: boolean\n) => {\n const validations: ValidationError = {};\n if (\n shippingPreference &&\n VALID_SHIPPING_PREFERENCES.every((value) => value !== shippingPreference)\n ) {\n validations.error = ValidationErrorType.UNSUPPORTED_TYPE;\n } else if (\n !supportProfileShipTaxConfig &&\n shippingPreference === ShippingPreference.FromProfile\n ) {\n validations.error = ValidationErrorType.NOT_SUPPORT_FROM_PROFILE;\n } else if (\n noShipping === NoShipping.NoPrompt &&\n shippingPreference === ShippingPreference.FromProfile\n ) {\n validations.error = ValidationErrorType.NEED_COLLECT_SHIPPING_ADDR;\n }\n return validations;\n};\n\nconst VALID_TAX_RATE_PREFERENCES = [\n TaxRatePreference.Custom,\n TaxRatePreference.FromProfile,\n TaxRatePreference.NotApplicable\n];\nexport const validateTaxRatePreference = (\n taxRatePreference: string | undefined,\n noShipping: string,\n supportProfileShipTaxConfig?: boolean\n) => {\n const validations: ValidationError = {};\n if (\n taxRatePreference &&\n VALID_TAX_RATE_PREFERENCES.every((value) => value !== taxRatePreference)\n ) {\n validations.error = ValidationErrorType.UNSUPPORTED_TYPE;\n } else if (!supportProfileShipTaxConfig && taxRatePreference === TaxRatePreference.FromProfile) {\n validations.error = ValidationErrorType.NOT_SUPPORT_FROM_PROFILE;\n } else if (\n noShipping === NoShipping.NoPrompt &&\n taxRatePreference === TaxRatePreference.FromProfile\n ) {\n validations.error = ValidationErrorType.NEED_COLLECT_SHIPPING_ADDR;\n }\n return validations;\n};\n\nexport const validatePaymentOption = (paymentOption: string) => {\n const validations: ValidationError = {};\n if (!paymentOption) {\n validations.error = ValidationErrorType.REQUIRED;\n } else if (paymentOption !== 'true' && paymentOption !== 'false') {\n validations.error = ValidationErrorType.REQUIRED;\n }\n return validations;\n};\n","const NCP_BASE = '/ncp';\nexport const LINKS_BASE_URL = '/links';\nexport const CART_BASE_URL = '/cart';\nexport const SETTINGS_BASE_URL = '/settings';\nexport const EDITOR_AND_DETAILS_URL = `${NCP_BASE}${LINKS_BASE_URL}`;\nexport const ADD_TO_CART_EDITOR_URL = `${NCP_BASE}${CART_BASE_URL}`;\nexport const SETTINGS_URL = `${NCP_BASE}${SETTINGS_BASE_URL}`;\n\n// This mapping is for JSSDK, according to https://developer.paypal.com/sdk/js/configuration/#link-locale\nexport const JSSDK_SPECIAL_LOCALES_MAP = {\n 'zh-CN-xbord': 'zh-CN',\n 'en-CN-xbord': 'zh-CN',\n 'nb-NO': 'no-NO',\n 'fil-PH': 'en-PH'\n};\n\n// According to https://paypal.slack.com/archives/C02D21KRD45/p1693268291663499\nexport const BFS_SPECIAL_LOCALES_MAP = {\n 'zh-CN-xbord': 'zh-C2',\n 'en-CN-xbord': 'en-C2',\n 'nb-NO': 'no-NO',\n 'fil-PH': 'tl-PH'\n};\n\nexport const ERRORS = {\n CART_OUT_OF_SYNC: 'Cart out of sync with server'\n};\n","const defaultCdnDomain = 'www.paypalobjects.com';\n\nexport const replaceGeoUrl = (url: string, geoAwareDomain?: string) => {\n if (!url || typeof url !== 'string' || !url.includes(defaultCdnDomain)) {\n return url;\n }\n\n return geoAwareDomain ? url.replace(defaultCdnDomain, geoAwareDomain) : url;\n};\n"],"names":["containerStyles","css","PaymentWrapper","children","_jsx","_Container","xxl","style","commonStyles","DisclaimerPolicy","worldReady","useContext","WorldReadyContext","_jsxs","_CaptionText","getLocalizedString","_Link","href","region","target","size","secondary","onClick","recordClick","eventName","pageName","Payment","hostedButtonId","useParams","appContext","useAppContext","enablePaywall","merchantSettings","isSettingsEnabled","hostedButtonDetails","sourceType","flowType","extractSourceAndFlowType","fptiData","merchantSettingsOptions","fptiAdditionalTags","buildAdditionalTags","paymentContextValues","PaymentContextValuesGenerator","useOnCaptureFailEffect","captureStatus","errorMessage","useEffect","CaptureStatus","FAILED","AUTH_FAILED","recordImpression","error_message","PaymentContextProvider","value","_Col","ErrorMessage","HostedButtonDetails","buttonDetails","StackedButtonsContainer","variation","ButtonWrapperVariation","HOSTED_BUTTONS","SplitScreenBase","leftChild","rightChild","isMobileReverseOrder","_Fragment","className","cx","SingleScreenBase","breakpointWidth","pageContainer","container","_PAYPAL_THEME","sysSizeMediaSm","sysSizeMediaXs","contentContainer","sysSizeMediaLg","disclaimerPolicyStyle","MainBaseContainer","contentLeft","contentRight","disclaimer","isLoading","loadingSpinnerText","topLevelErrorStatus","topLevelErrorMessage","returnLink","rest","styles","maxWidth","margin","_Row","_LoadingSpinner","VALID_FIELDS_MAP","ButtonType","FIXED_PRICE","quantity","memo","SINGLE_SELECT_LIST","item","VARIABLE_PRICE","amount","invoice","Paywall","useWorldReadyContext","enablePaywallButtons","useDeepEqualMemo","prefillData","getPrefillData","paymentPrefillData","originalButtonVariables","transformButtonVariables","link_variables","buttonVariables","getButtonVariablesFromMerchantSettings","buttonType","button_type","toUpperCase","paymentContextPrefillData","values","errors","loggingErrors","Object","keys","length","validFields","quantityErrors","quantityValues","getQuantityData","quantityOption","shouldCheckQuantity","quantityOptionNumber","Number","isQuantityRelevant","prototype","hasOwnProperty","call","isQuantityOptionEnabled","isNaN","prefillQuantity","isInteger","INVALID_OPTION_CONTENT_KEY","quantity_option","matchedOption","getMatchedOption","prefillItem","matchedItem","option_details","find","_","name","selection_details","option_selection","trim","amountValues","amountLoggingErrors","getAmountData","shouldCheckAmount","hasAmountLabel","prefillAmount","currencyCode","prefilledAmountNumber","checkForDecimalErrors","hasError","amount_label","currency_code","invoice_label","memo_label","homepage_url","homepageUrl","getSettingsValuesWithFallback","url","indexOf","useOnPrefillDataPopulatedEffect","prefillErrorKeys","errorKeysForLogging","hasValues","hasErrors","prefillDataToLog","logInfoClient","prefill","int_error_desc","ButtonContainer","PAYWALL","initialAppData","initializeAppData","hydrate","App","EmotionThemeProvider","theme","AppContextProvider","Routes","Route","path","element","Notfound","options","hydrateMethod","BooleanButtonVariableHandler","data","SETTINGS_FIELDS_CHECKOUT","payment_method_paylater","configMapper","variablesMapper","variableHandler","payment_method_venmo","payment_method_apple_pay","show_business_name","show_business_logo","DEFAULT_FIELDS_MAPPER","stacked_button_layout","stacked_button_shape","stacked_button_size","stacked_button_color_type","stacked_button_second_button_type","stacked_button_text_type","stacked_button_custom_text","single_button_shape","single_button_size","single_button_color_type","single_button_color_code","DEFAULT_CART_FIELDS_MAPPER","cart_button_shape","cart_button_size","cart_button_color_type","cart_button_color_code","DEFAULT_CART_BUTTON_SETTINGS","DEFAULT_MERCHANT_CHECKOUT_SETTINGS","DEFAULT_MERCHANT_CART_BUTTON_SETTINGS","SETTINGS_NEWLY_ADDED_FIELDS_DEFAULT_VALUES","buttonVariation","ButtonVariation","BuyNow","isCartButton","Cart","calculatedButtonVariables","entries","reduce","acc","settingsKey","mapper","mappingValue","DEFAULT_MERCHANT_SETTINGS","_invert","itemName","shipping","taxRate","memoLabel","layout","shape","color","paypalButtonText","tagline","amountLabel","invoiceLabel","returnUrlType","customReturnUrl","checkoutButtonTextType","checkoutButtonCustomText","singleButtonColorType","singleButtonColor","singleButtonTextType","singleButtonCustomText","singleButtonSize","paymentButtonType","productId","checkoutButtonType","isNotCollectShippingAddress","shippingPreference","taxRatePreference","cartButtonShape","cartButtonSize","cartButtonColorType","cartButtonColorCode","PaymentButtonType","CheckoutButtonType","CheckoutButtonLayout","CheckoutButtonShape","CheckoutButtonColor","CheckoutSingleButtonColorType","SingleButtonTextType","CheckoutPaypalButtonText","CheckoutButtonSize","CheckoutButtonTextType","NoShipping","ShippingPreference","TaxRatePreference","ReturnUrlType","CheckoutPaymentOptionsOtherThanPayPal","getFeatureFlags","app","config","getAppConfig","featureFlags","OrderStatus","IntegrationOptions","replaceGeoUrl","serverData","geoAwareDomain","PAYMENT_LINK","QR_CODE","STACKED_BUTTONS","SINGLE_BUTTON","ADD_TO_CART","OptionalPaymentMethods","PAYLATER","VENMO","APPLEPAY","GOOGLEPAY","Venmo","PayLater","ApplePay","Recommended","Black","White","PreviewTabName","checkoutColorMapping","Large","Medium","Small","default","backgroundColor","hoverBrightness","focus","outline","offset","black","white","border","ENABLED_FUNDING_METHODS","linkVariables","curr","transButtonStyleFromButtonVariables","buttonStyleConfig","button_text","label","getTaxAmount","subtotal","maximumFractionDigits","roundToMaxDecimal","initValue","maxDecimals","Math","max","round","transSDKFundingConfig","allowedPaymentMethods","disabledPaymentMethods","filter","method","includes","enabledPaymentMethods","enableFunding","join","disableFunding","getAllowedPaymentMethodsFromConfigs","merchantCountry","ucpConfig","toggles","flags","profileShipTax","venmoToggle","paymentMethodVenmo","payLaterToggle","paymentMethodPayLater","applePayToggle","paymentMethodApplePay","switches","Card","paymentOption","buttonIsAvailable","paymentMethod","country","currency","globalConfig","enableApplePay","venmoShipTaxSupport","paymentMethodConfig","paymentMethodEnabled","enabled","buttonEligible","buttonIsEligible","isSupportedCountry","supportedCountries","isSupportedCurrency","supportedCurrencies","concat","sdkLocaleMapper","locale","JSSDK_SPECIAL_LOCALES_MAP","replace","isMerchantHostedPreview","isPreview","tabName","PRODUCT","getValueContent","showCurrencySymbol","FieldValueContent","EstimateLater","Free","formatCurrency","ValidationErrorType","MAX_QUANTITY","isDecimal","Custom","Buynow","Paynow","n","num","castedWorldReady","currencyOptions","CurrencyFormat","resolvedOptions","undefined","decimalError","error","DECIMAL_NOT_SUPPORTED","decimalCount","toString","split","countDecimals","DECIMAL_PLACES","details","numOfPlaces","Vertical","Horizontal","Pill","Rect","Blue","Gold","Silver","Checkout","Installment","Pay","Paypal","Button","Link","NoPrompt","PromptRequired","Single","Stacked","Proceed","None","FromProfile","NotApplicable","ERRORS","CART_OUT_OF_SYNC","defaultCdnDomain"],"sourceRoot":""}