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AAO,CAAEA,UAAW,iBACpC,gBAAoB,IAAS,CAAE+I,UAAWjF,EAAE,cAAeD,GAAI,UAAWmF,KAAMlF,EAAE,0BAClF,gBAAoB,IAAa,CAAEmF,eAAgB,QAASC,IAAKpH,EAASqH,KAAM,UAAWC,WAAW,QAAe,C","sources":["webpack:///./assets/common/src/components/bag/ExpressPaymentsButtonAmazonpay.tsx","webpack:///./assets/common/src/components/bag/ExpressPaymentsButtonApplepay.tsx","webpack:///./assets/common/src/components/bag/ExpressPaymentsButtonGooglepay.tsx","webpack:///./assets/common/src/components/bag/ExpressPaymentsButtonPaypal.tsx","webpack:///./assets/common/src/components/bag/ExpressPaymentsButtons.tsx","webpack:///./assets/common/src/components/bag/ExpressTaxInfoForm.tsx"],"sourcesContent":["import paymentutils from '@utils/paymentutils';\nimport ErrorBox from '@components/common/ErrorBox';\nimport React, { useEffect, useRef, useState } from 'react';\nconst ExpressPaymentsButtonAmazonpay = (props) => {\n const buttonRef = useRef();\n const [enabled, setEnabled] = useState();\n const [error, setError] = useState();\n const [amazonPayConfiguration, setAmazonPayConfiguration] = useState();\n useEffect(() => {\n var _a, _b, _c, _d;\n if (props.paymentMethods) {\n setEnabled(!!((_b = (_a = props.paymentMethods) === null || _a === void 0 ? void 0 : _a.AdyenPaymentMethods) === null || _b === void 0 ? void 0 : _b.paymentMethods.find((p) => p.type == 'amazonpay')));\n let currentConfiguration = (_d = (_c = props.paymentMethods) === null || _c === void 0 ? void 0 : _c.AdyenPaymentMethods) === null || _d === void 0 ? void 0 : _d.paymentMethods.find(function (p) {\n if (p.type === 'amazonpay') {\n return p;\n }\n });\n setAmazonPayConfiguration(currentConfiguration);\n }\n }, [props.paymentMethods]);\n useEffect(() => {\n let onclicked = () => {\n props.onPaymentSelected && props.onPaymentSelected();\n };\n if (enabled && props.adyenConfig) {\n // @ts-ignore\n let payprops = {\n returnUrl: props.adyenConfig.amazonPayReviewUrl,\n showPayButton: false,\n };\n // OE-6181: fix for amazonpay on CH, set ledgerCurrency to EUR\n if (window.country == 'CH') {\n payprops.configuration = {\n merchantId: amazonPayConfiguration.configuration.merchantId,\n publicKeyId: amazonPayConfiguration.configuration.publicKeyId,\n region: amazonPayConfiguration.configuration.region || 'EU',\n ledgerCurrency: 'EUR',\n storeId: amazonPayConfiguration.configuration.storeId,\n };\n }\n else if (window.country === 'US') {\n // Only for test on US\n payprops.configuration = {\n merchantId: amazonPayConfiguration.configuration.merchantId,\n publicKeyId: amazonPayConfiguration.configuration.publicKeyId,\n region: 'US',\n ledgerCurrency: 'USD',\n storeId: amazonPayConfiguration.configuration.storeId,\n };\n }\n paymentutils.getAdyenCheckout(props.adyenConfig, props.bag, props.paymentMethods.AdyenPaymentMethods, true, window.formSetValue).then((resolve) => {\n var _a;\n let paymentcomponent = resolve.create('amazonpay', payprops);\n paymentcomponent.mount(buttonRef.current);\n // if enabled ovveride the method\n onclicked = () => {\n if (props && props.bag && props.bag.valid && props.bag.valid.error) {\n setError(props.bag.valid.message);\n }\n else {\n props.onPaymentSelected && props.onPaymentSelected();\n console.info('calling submit');\n paymentcomponent.submit();\n }\n };\n (_a = buttonRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('click', onclicked);\n });\n }\n return () => {\n var _a;\n (_a = buttonRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('click', onclicked);\n };\n }, [enabled, props.adyenConfig]);\n if (!enabled) {\n return React.createElement(React.Fragment, null);\n }\n return (React.createElement(React.Fragment, null,\n React.createElement(\"button\", { ref: buttonRef, type: \"button\", className: \"button button--secondary button--amazonpay\", style: { display: enabled ? 'block' : 'block' }, \"aria-label\": \"Amazon Pay\" }),\n ' ',\n error && React.createElement(ErrorBox, { errors: [error] })));\n};\nexport default ExpressPaymentsButtonAmazonpay;\n","import React, { useEffect, useState } from 'react';\nconst ExpressPaymentsButtonApplepay = (props) => {\n const [enabled, setEnabled] = useState();\n const [startPayment, setStartPayment] = useState();\n useEffect(() => {\n if (startPayment && props.confirmed) {\n // triggered in ExpressPaymentsButtons on placeorder click\n // \"Must create a new ApplePaySession from a user gesture handler\"\n // (document.getElementById('applepaybutton') as HTMLButtonElement).click();\n }\n }, [startPayment, props.confirmed]);\n // OE-24851 workaround to use both arrow with different behaviors\n const hideArrowAfterClick = () => {\n const paymentDiv = document.querySelector('.minibag__expresspayment__intro');\n if (paymentDiv) {\n paymentDiv.classList.remove('button--arrow-left');\n }\n };\n const triggerPayment = (e) => {\n e.preventDefault();\n hideArrowAfterClick();\n props.onPaymentSelected();\n props.showFlagsCallback();\n setStartPayment(true);\n };\n useEffect(() => {\n if (props.paymentMethods) {\n setEnabled(!!props.paymentMethods.AdyenPaymentMethods.paymentMethods.find((p) => p.type == 'applepay'));\n }\n }, [props.paymentMethods]);\n if (!enabled || !window.ApplePaySession || !ApplePaySession.canMakePayments()) {\n return React.createElement(React.Fragment, null);\n }\n return (React.createElement(\"button\", { type: \"button\", className: \"button button--secondary dw-apple-pay-button dw-apple-pay-border dw-apple-pay-logo-white apple-pay-cart-button apple-pay-button\", \"aria-pressed\": props.isSelected, \"aria-controls\": props.ariaControls, onClick: (e) => triggerPayment(e) },\n React.createElement(\"span\", { className: \"visually-hidden\" }, \"Apple Pay\")));\n};\nexport default ExpressPaymentsButtonApplepay;\n","import { addURLParameter } from '@common/utils/urlutils';\nimport ErrorBox from '@components/common/ErrorBox';\nimport Loading from '@ui/loading/Loading';\nimport api from '@utils/api';\nimport paymentutils from '@utils/paymentutils';\nimport React, { useEffect, useRef, useState, forwardRef, useImperativeHandle } from 'react';\nconst ExpressPaymentsButtonGooglepay = (props, ref) => {\n const [error, setError] = useState();\n const [loading, setLoading] = useState();\n const [enabled, setEnabled] = useState();\n const submitPaymentRef = useRef();\n const paymentReady = (state) => {\n setLoading(true);\n api.getForm('billing', {}).then((formdef) => {\n let form = {\n adyenStateData: JSON.stringify(state.data),\n paymentMethod: 'AdyenComponent',\n adyenPaymentMethod: 'paywithgoogle',\n brandCode: 'paywithgoogle',\n };\n api.expressSubmitPayment(form, formdef).then((data) => {\n if (data.error) {\n setLoading(false);\n setError(JSON.stringify(data));\n }\n else {\n api.checkoutPlaceOrder().then((data) => {\n if (data.error) {\n setLoading(false);\n if (data.errorMessage) {\n setError(data.errorMessage);\n }\n }\n if (data.continueUrl && data.orderID) {\n let newUrl = addURLParameter(data.continueUrl, 'ID', data.orderID);\n location.href = addURLParameter(newUrl, 'token', data.orderToken);\n }\n else {\n data.continueUrl;\n }\n });\n }\n });\n });\n };\n useEffect(() => {\n if (props.paymentMethods) {\n setEnabled(!!props.paymentMethods.AdyenPaymentMethods.paymentMethods.find((p) => p.type == 'paywithgoogle'));\n }\n }, [props.paymentMethods]);\n useEffect(() => {\n setError('');\n }, [props.bag]);\n const payWithGooglePay = () => {\n paymentutils.getAdyenCheckout(props.adyenConfig, props.bag, props.paymentMethods.AdyenPaymentMethods, true, window.formSetValue).then((resolve) => {\n let paymentcomponent = resolve.create('paywithgoogle', {\n onSubmit: (state) => {\n console.log('google onsubmit ' + JSON.stringify(state, null, 2));\n paymentReady(state);\n },\n onChange: (state, component) => {\n state.isValid; // True or false. Specifies if all the information that the shopper provided is valid.\n state.data; // Provides the data that you need to pass in the `/payments` call.\n // console.info('handleonchange state=', JSON.stringify(state, null, 2), '\\n', 'component ' + component);\n if (state.isValid) {\n console.log('google ondatachange ready');\n paymentReady(state);\n }\n },\n });\n // save the function to be called from parent\n submitPaymentRef.current = paymentcomponent.submit;\n });\n };\n useEffect(() => {\n if (props.isSelected) {\n payWithGooglePay();\n }\n }, [props.isSelected]);\n useImperativeHandle(ref, () => ({\n placeOrderWithGoogle: submitPaymentRef.current,\n }));\n // OE-24851 workaround to use both arrow with different behaviors\n const hideArrowAfterClick = () => {\n const paymentDiv = document.querySelector('.minibag__expresspayment__intro');\n if (paymentDiv) {\n paymentDiv.classList.remove('button--arrow-left');\n }\n };\n const triggerPayment = (e) => {\n var _a, _b, _c;\n e.preventDefault();\n hideArrowAfterClick();\n if ((_b = (_a = props.bag) === null || _a === void 0 ? void 0 : _a.valid) === null || _b === void 0 ? void 0 : _b.error) {\n setError((_c = props.bag.valid) === null || _c === void 0 ? void 0 : _c.message);\n }\n else {\n props.onPaymentSelected();\n props.showFlagsCallback();\n }\n };\n if (!enabled) {\n return React.createElement(React.Fragment, null);\n }\n return (React.createElement(React.Fragment, null,\n React.createElement(\"button\", Object.assign({ type: \"button\", className: \"button button--secondary button--googlepay\", \"aria-pressed\": props.isSelected }, (props.isSelected ? { style: { pointerEvents: 'none' }, tabIndex: -1 } : {}), { onClick: (e) => triggerPayment(e) }),\n React.createElement(\"span\", { className: \"visually-hidden\" }, \"Google Pay\")),\n error && React.createElement(ErrorBox, { errors: [error] }),\n loading && React.createElement(Loading, null)));\n};\nexport default forwardRef(ExpressPaymentsButtonGooglepay);\n","import { addURLParameter } from '@common/utils/urlutils';\nimport ErrorBox from '@components/common/ErrorBox';\nimport api from '@utils/api';\nimport React, { useEffect, useState } from 'react';\nconst ExpressPaymentsButtonPaypal = (props) => {\n var _a;\n const [error, setError] = useState();\n const [enabled, setEnabled] = useState();\n const [loading, setLoading] = useState();\n useEffect(() => {\n if (props.paymentMethods) {\n setEnabled(!!props.paymentMethods.AdyenPaymentMethods.paymentMethods.find((p) => p.type == 'paypal'));\n }\n }, [props.paymentMethods]);\n useEffect(() => {\n setError('');\n }, [props.bag]);\n const startExpress = () => {\n setLoading(true);\n props.onPaymentSelected();\n api.expressCheckoutStart().then((data) => {\n if (data.continueUrl && data.orderID) {\n let newUrl = addURLParameter(data.continueUrl, 'ID', data.orderID);\n window.location.href = addURLParameter(newUrl, 'token', data.orderToken);\n return;\n }\n else {\n data.continueUrl;\n }\n setLoading(false);\n if (data.error) {\n setError(data.errorMessage);\n }\n });\n };\n if (!enabled || !((_a = props === null || props === void 0 ? void 0 : props.adyenConfig) === null || _a === void 0 ? void 0 : _a.paypalExpressEnabled)) {\n return React.createElement(React.Fragment, null);\n }\n return (React.createElement(React.Fragment, null,\n React.createElement(\"button\", { type: \"button\", role: \"link\", \"aria-busy\": loading, disabled: loading, className: \"button button--secondary button--paypal\", id: \"container-paypal\", onClick: startExpress },\n React.createElement(\"span\", { className: \"visually-hidden\" }, \"Paypal\")),\n error && React.createElement(ErrorBox, { errors: [error] })));\n};\nexport default ExpressPaymentsButtonPaypal;\n","import CheckoutPrivacyFlags from '@components/checkout/CheckoutPrivacyFlags';\nimport Button from '@ui/button/Button';\nimport analytics from '@utils/analytics';\nimport React, { useEffect, useMemo, useRef, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport ExpressPaymentsButtonAmazonpay from './ExpressPaymentsButtonAmazonpay';\nimport ExpressPaymentsButtonApplepay from './ExpressPaymentsButtonApplepay';\nimport ExpressPaymentsButtonGooglepay from './ExpressPaymentsButtonGooglepay';\nimport ExpressPaymentsButtonPaypal from './ExpressPaymentsButtonPaypal';\nimport ExpressTaxInfoForm from './ExpressTaxInfoForm';\nimport { autoChooseClassnames, autoChooseComponent, getId } from '@common/utils/brandDiffsUtils';\nconst ExpressPaymentsButtons = (props) => {\n var _a, _b, _c;\n const { t } = useTranslation();\n const [enablePlaceorder, setEnablePlaceorder] = useState();\n const [showFlags, setShowFlags] = useState();\n const [confirmed, setConfirmed] = useState();\n const [selectedMethod, setSelectedMethod] = useState();\n const { reloadtimestamp } = props;\n const [taxCodeHK, setTaxCodeHK] = useState(window.country == 'HK' ? false : true); // mandatory for delivery on HK\n const [hasErrors, setHasErrors] = useState(false);\n const flagsWrapper = useRef();\n const paymentName = useMemo(() => {\n let paymentId = selectedMethod === 'googlepay' ? 'paywithgoogle' : selectedMethod;\n return (paymentId && t(`paymentmethod.${paymentId}`)) || '';\n }, [selectedMethod]);\n const googlePaymentRef = useRef(null);\n useEffect(() => {\n if (props === null || props === void 0 ? void 0 : props.onUpdate) {\n console.info('update altezza express payment buttons');\n props.onUpdate();\n }\n if (!showFlags) {\n setConfirmed(false);\n }\n else {\n setTimeout(() => {\n var _a;\n (_a = flagsWrapper.current) === null || _a === void 0 ? void 0 : _a.focus();\n }, 200);\n }\n }, [showFlags]);\n useEffect(() => {\n setSelectedMethod(null);\n setShowFlags(false);\n }, [reloadtimestamp]); // force reload\n // OE-24851 workaround to use both arrow with different behaviors\n const addArrowAfterClick = () => {\n const paymentDiv = document.querySelector('.minibag__expresspayment__intro');\n if (paymentDiv) {\n paymentDiv.classList.add('button--arrow-left');\n }\n };\n const clickPlaceOrder = (event) => {\n var _a;\n if (!enablePlaceorder || !taxCodeHK) {\n event.preventDefault();\n setHasErrors(true);\n setTimeout(() => {\n var _a, _b;\n (_b = (_a = flagsWrapper.current) === null || _a === void 0 ? void 0 : _a.querySelector('.is-invalid')) === null || _b === void 0 ? void 0 : _b.focus();\n }, 200);\n return false;\n }\n setHasErrors(false);\n setConfirmed(true);\n if (selectedMethod == 'googlepay') {\n setSelectedMethod(undefined);\n setShowFlags(false);\n (_a = googlePaymentRef === null || googlePaymentRef === void 0 ? void 0 : googlePaymentRef.current) === null || _a === void 0 ? void 0 : _a.placeOrderWithGoogle();\n }\n // needed for \"Must create a new ApplePaySession from a user gesture handler\"\n if (selectedMethod == 'applepay') {\n console.log('applepaybutton click');\n document.getElementById('applepaybutton').click();\n }\n event.preventDefault();\n };\n const arraySort = () => window.activedPaymentMethodCheckoutExpress.split(',').map((e) => {\n return !selectedMethod && e == 'paypal' ? (React.createElement(ExpressPaymentsButtonPaypal, Object.assign({ key: e, onPaymentSelected: () => {\n if (getId() == 'ST') {\n props === null || props === void 0 ? void 0 : props.analyticsStone('paypal');\n }\n else {\n analytics.expressCheckoutPaymentSelected('paypal');\n }\n } }, props))) : (!selectedMethod || selectedMethod == 'applepay') && e == 'applepay' ? (React.createElement(ExpressPaymentsButtonApplepay, Object.assign({ key: e, onPaymentSelected: () => {\n if (getId() == 'ST') {\n props === null || props === void 0 ? void 0 : props.analyticsStone('apple');\n }\n else {\n analytics.expressCheckoutPaymentSelected('apple');\n }\n } }, props, { confirmed: confirmed, isSelected: selectedMethod == 'applepay', ariaControls: \"express-modal-fieldset\", showFlagsCallback: () => {\n setSelectedMethod('applepay');\n setShowFlags(true);\n } }))) : !selectedMethod && e == 'amazonpay' ? (React.createElement(ExpressPaymentsButtonAmazonpay, Object.assign({ key: e, onPaymentSelected: () => {\n if (getId() == 'ST') {\n props === null || props === void 0 ? void 0 : props.analyticsStone('amazon');\n }\n else {\n analytics.expressCheckoutPaymentSelected('amazon');\n }\n } }, props))) : ((!selectedMethod || selectedMethod == 'googlepay') &&\n e == 'googlepay' && (React.createElement(ExpressPaymentsButtonGooglepay, Object.assign({ key: e, onPaymentSelected: () => {\n if (getId() == 'ST') {\n props === null || props === void 0 ? void 0 : props.analyticsStone('google');\n }\n else {\n analytics.expressCheckoutPaymentSelected('google');\n }\n } }, props, { isSelected: selectedMethod == 'googlepay', confirmed: confirmed, ariaControls: \"express-modal-fieldset\", showFlagsCallback: () => {\n setSelectedMethod('googlepay');\n setShowFlags(true);\n }, ref: googlePaymentRef }))));\n });\n return (React.createElement(React.Fragment, null,\n arraySort(),\n React.createElement(\"fieldset\", { \"aria-labelledby\": \"express-modal-legend\", id: \"express-modal-fieldset\", ref: flagsWrapper, tabIndex: -1 }, showFlags && (React.createElement(React.Fragment, null,\n React.createElement(\"legend\", { id: \"express-modal-legend\", className: \"d-none\" },\n t('checkout.expresscheckout'),\n \": \",\n paymentName),\n selectedMethod && (React.createElement(\"button\", { className: autoChooseClassnames({ ST: 'button--secondary' }, 'button button--arrow-back'), onClick: () => {\n addArrowAfterClick();\n setSelectedMethod(undefined);\n setShowFlags(false);\n props.onUpdate && props.onUpdate();\n props.onBackPress && props.onBackPress();\n }, \"aria-label\": t('button.back') }, !window.appmode &&\n autoChooseComponent({\n MO: (React.createElement(\"span\", null,\n React.createElement(\"i\", { className: \"icon--chevron-left\", \"aria-hidden\": true }))),\n ST: (React.createElement(React.Fragment, null,\n React.createElement(\"i\", { className: \"icon--chevron-left\", \"aria-hidden\": true }),\n React.createElement(\"span\", null, t('button.back')))),\n }))),\n window.country == 'HK' && React.createElement(ExpressTaxInfoForm, { setIsValidTaxForm: setTaxCodeHK }),\n React.createElement(CheckoutPrivacyFlags, Object.assign({}, props, { guest: (_a = props === null || props === void 0 ? void 0 : props.bag) === null || _a === void 0 ? void 0 : _a.guest, onSelect: setEnablePlaceorder, hidedataprocessing: true, containsMbm: !!((_b = props === null || props === void 0 ? void 0 : props.bag) === null || _b === void 0 ? void 0 : _b.items.find((el) => el.isMbm)), mbmurllegalareareturn: (props === null || props === void 0 ? void 0 : props.mbmurllegalareareturn) || (props === null || props === void 0 ? void 0 : props.returnpolicy), forceValidation: true, showValidationErrors: hasErrors })),\n React.createElement(Button, { type: \"button\", cls: ['button--primary'], onClick: clickPlaceOrder, ariaDescribedby: \"expresscheckout-guestdesc\" }, t('checkout.placeorder')),\n ((_c = props === null || props === void 0 ? void 0 : props.bag) === null || _c === void 0 ? void 0 : _c.guest) && (React.createElement(\"p\", { id: \"expresscheckout-guestdesc\", \"aria-hidden\": true, className: \"data-processing\", dangerouslySetInnerHTML: { __html: t('checkout.review.dataprocessing') } })))))));\n};\nexport default ExpressPaymentsButtons;\n","import React, { useEffect, useState } from 'react';\nimport DwFormField from '@ui/formfield/DwFormField';\nimport formutils from '@utils/formutils';\nimport api from '@utils/api';\nimport Tooltip from '@ui/tooltip/Tooltip';\nimport { Form } from 'react-final-form';\nimport { useTranslation } from 'react-i18next';\nconst ExpressTaxInfoForm = ({ setIsValidTaxForm }) => {\n // Apply for HK only\n if (window.country != 'HK')\n return null;\n const { t } = useTranslation();\n const [formdef, setFormdef] = useState(window.country == 'HK'\n ? {\n taxCode: {\n htmlValue: '',\n mandatory: true,\n dynamicHtmlName: 'dwfrm_billing_taxCode',\n valid: false,\n error: t('error.message.invalid'),\n label: 'HKID/BR number',\n maxLength: 16,\n formType: 'formField',\n },\n }\n : {});\n const validate = async (values) => {\n values.taxCode = (values.taxCode || '').toUpperCase();\n let errors = await formutils.validateForm(values, formdef, 'express-checkout-taxcode');\n if (!values.taxCode) {\n errors['taxCode'] = t('label.requiredfield');\n return errors;\n }\n if (!errors['taxCode']) {\n setIsValidTaxForm(true);\n return;\n }\n if (errors['taxCode']) {\n setIsValidTaxForm(false);\n }\n return errors;\n };\n const handleSubmit = (values) => {\n // Validation is done in validate()\n };\n // Download HK taxCode form definition\n useEffect(() => {\n api.getForm('express-checkout-taxcode', {}).then((data) => {\n if (data) {\n setFormdef(data);\n }\n });\n }, []);\n return (React.createElement(Form, { onSubmit: handleSubmit, initialValues: {}, validate: validate, mutators: {\n global: formutils.globalMutator,\n setValue: ([key, value], state, { changeValue }) => {\n console.log('setValue ' + key + '=' + value);\n changeValue(state, key, () => value);\n },\n }, render: ({ handleSubmit, form, submitting, pristine, values, validating }) => (React.createElement(\"form\", { onSubmit: handleSubmit, id: \"form-submitpayment\", onBlur: handleSubmit },\n React.createElement(\"div\", { className: \"express-payments-hk-tax-code mt-16\" },\n React.createElement(\"div\", { className: \"invoice-block\" },\n React.createElement(Tooltip, { ariaLabel: t('label.info'), id: \"taxCode\", text: t('checkout.hbidtooltip') }),\n React.createElement(DwFormField, { groupClassName: \"mt-16\", def: formdef, name: \"taxCode\", validTick: true }))))) }));\n};\nexport default ExpressTaxInfoForm;\n"],"names":["props","buttonRef","useRef","enabled","setEnabled","useState","error","setError","amazonPayConfiguration","setAmazonPayConfiguration","useEffect","_a","_b","_c","_d","paymentMethods","AdyenPaymentMethods","find","p","type","currentConfiguration","onclicked","onPaymentSelected","adyenConfig","payprops","returnUrl","amazonPayReviewUrl","showPayButton","window","country","configuration","merchantId","publicKeyId","region","ledgerCurrency","storeId","paymentutils","bag","formSetValue","then","resolve","paymentcomponent","create","mount","current","valid","message","console","info","submit","addEventListener","removeEventListener","ref","className","style","display","ErrorBox","errors","startPayment","setStartPayment","confirmed","triggerPayment","e","preventDefault","paymentDiv","document","querySelector","classList","remove","hideArrowAfterClick","showFlagsCallback","ApplePaySession","canMakePayments","isSelected","ariaControls","onClick","forwardRef","loading","setLoading","submitPaymentRef","paymentReady","state","api","formdef","form","adyenStateData","JSON","stringify","data","paymentMethod","adyenPaymentMethod","brandCode","errorMessage","continueUrl","orderID","newUrl","location","href","orderToken","onSubmit","log","onChange","component","isValid","useImperativeHandle","placeOrderWithGoogle","Object","assign","pointerEvents","tabIndex","Loading","paypalExpressEnabled","role","disabled","id","t","useTranslation","enablePlaceorder","setEnablePlaceorder","showFlags","setShowFlags","setConfirmed","selectedMethod","setSelectedMethod","reloadtimestamp","taxCodeHK","setTaxCodeHK","hasErrors","setHasErrors","flagsWrapper","paymentName","useMemo","paymentId","googlePaymentRef","onUpdate","setTimeout","focus","activedPaymentMethodCheckoutExpress","split","map","key","analyticsStone","analytics","ST","add","addArrowAfterClick","undefined","onBackPress","appmode","MO","ExpressTaxInfoForm","setIsValidTaxForm","CheckoutPrivacyFlags","guest","onSelect","hidedataprocessing","containsMbm","items","el","isMbm","mbmurllegalareareturn","returnpolicy","forceValidation","showValidationErrors","Button","cls","event","getElementById","click","ariaDescribedby","dangerouslySetInnerHTML","__html","setFormdef","taxCode","htmlValue","mandatory","dynamicHtmlName","label","maxLength","formType","values","initialValues","validate","async","toUpperCase","mutators","global","setValue","value","changeValue","render","handleSubmit","submitting","pristine","validating","onBlur","ariaLabel","text","groupClassName","def","name","validTick"],"sourceRoot":""}