@funnelsgrove/payments 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -3
- package/dist/components/shared/ApplePaySubscribeButton.d.ts +15 -0
- package/dist/components/shared/ApplePaySubscribeButton.js +76 -0
- package/dist/components/shared/CheckoutBrandAssets.d.ts +12 -0
- package/dist/components/shared/CheckoutBrandAssets.js +56 -0
- package/dist/components/shared/GooglePaySubscribeButton.d.ts +14 -0
- package/dist/components/shared/GooglePaySubscribeButton.js +94 -0
- package/dist/components/shared/SharedStripeCheckoutDialog.d.ts +44 -0
- package/dist/components/shared/SharedStripeCheckoutDialog.js +717 -0
- package/dist/components/shared/SharedStripeCheckoutV2Dialog.d.ts +60 -0
- package/dist/components/shared/SharedStripeCheckoutV2Dialog.js +988 -0
- package/dist/components/shared/StripeExpressCheckoutButton.d.ts +18 -0
- package/dist/components/shared/StripeExpressCheckoutButton.js +164 -0
- package/dist/components/shared/StripeExpressCheckoutElement.d.ts +8 -0
- package/dist/components/shared/StripeExpressCheckoutElement.js +19 -0
- package/dist/components/shared/StripePlanSelector.d.ts +5 -7
- package/dist/components/shared/StripePlanSelector.js +16 -57
- package/dist/components/shared/walletPlatform.d.ts +11 -0
- package/dist/components/shared/walletPlatform.js +39 -0
- package/dist/config/billing.config.d.ts +60 -9
- package/dist/config/billing.config.js +7 -2
- package/dist/hooks/useResolvedPaywallPlans.d.ts +15 -0
- package/dist/hooks/useResolvedPaywallPlans.js +68 -0
- package/dist/index.d.ts +21 -5
- package/dist/index.js +21 -5
- package/dist/providers/paymentProvider.types.d.ts +4 -0
- package/dist/providers/paymentProvider.types.js +4 -0
- package/dist/providers/stripe/ApplePaySubscriptionCheckoutSlot.d.ts +5 -0
- package/dist/providers/stripe/ApplePaySubscriptionCheckoutSlot.js +21 -0
- package/dist/providers/stripe/GooglePaySubscriptionCheckoutSlot.d.ts +7 -0
- package/dist/providers/stripe/GooglePaySubscriptionCheckoutSlot.js +44 -0
- package/dist/providers/stripe/WalletSubscriptionCheckoutSlot.d.ts +32 -0
- package/dist/providers/stripe/WalletSubscriptionCheckoutSlot.js +69 -0
- package/dist/providers/stripe/useStripeSubscriptionCheckoutSession.d.ts +30 -0
- package/dist/providers/stripe/useStripeSubscriptionCheckoutSession.js +164 -0
- package/dist/services/paywallOffer.service.d.ts +65 -0
- package/dist/services/paywallOffer.service.js +312 -0
- package/dist/services/planCatalog.service.d.ts +28 -0
- package/dist/services/planCatalog.service.js +60 -0
- package/dist/services/runtimeBillingPlanCatalog.service.d.ts +6 -0
- package/dist/services/runtimeBillingPlanCatalog.service.js +24 -0
- package/dist/services/stripe.service.d.ts +66 -6
- package/dist/services/stripe.service.js +409 -54
- package/package.json +3 -3
|
@@ -0,0 +1,988 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
14
|
+
import { useEffect, useMemo, useState, } from 'react';
|
|
15
|
+
import { CardCvcElement, CardExpiryElement, CardNumberElement, Elements, useElements, useStripe, } from '@stripe/react-stripe-js';
|
|
16
|
+
import { PaymentBrandMark, SecurityLockIcon } from './CheckoutBrandAssets.js';
|
|
17
|
+
import { StripeExpressCheckoutButton } from './StripeExpressCheckoutButton.js';
|
|
18
|
+
import { getStripeWalletPaymentMethodOrder, usePlatformWalletPaymentMethods, } from './walletPlatform.js';
|
|
19
|
+
const defaultPaymentMethodLabels = ['Visa', 'Mastercard', 'Maestro', 'Discover'];
|
|
20
|
+
const isValidEmail = (value) => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value);
|
|
21
|
+
const normalizeBillingName = (input) => {
|
|
22
|
+
var _a, _b, _c, _d;
|
|
23
|
+
const normalizedName = ((_a = input.name) === null || _a === void 0 ? void 0 : _a.trim()) || ((_b = input.fallback) === null || _b === void 0 ? void 0 : _b.trim());
|
|
24
|
+
if (normalizedName) {
|
|
25
|
+
return normalizedName;
|
|
26
|
+
}
|
|
27
|
+
const normalizedEmail = (_c = input.email) === null || _c === void 0 ? void 0 : _c.trim();
|
|
28
|
+
if (normalizedEmail) {
|
|
29
|
+
const localPart = (_d = normalizedEmail
|
|
30
|
+
.split('@')[0]) === null || _d === void 0 ? void 0 : _d.replace(/[._-]+/g, ' ').trim();
|
|
31
|
+
if (localPart) {
|
|
32
|
+
return localPart;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return 'Customer';
|
|
36
|
+
};
|
|
37
|
+
const isSuccessfulIntentStatus = (status) => {
|
|
38
|
+
return status === 'succeeded' || status === 'processing' || status === 'requires_capture';
|
|
39
|
+
};
|
|
40
|
+
const formatCountdown = (remainingSeconds) => {
|
|
41
|
+
const normalizedSeconds = Number.isFinite(remainingSeconds)
|
|
42
|
+
? Math.max(0, Math.floor(remainingSeconds))
|
|
43
|
+
: 0;
|
|
44
|
+
const minutes = Math.floor(normalizedSeconds / 60);
|
|
45
|
+
const seconds = normalizedSeconds % 60;
|
|
46
|
+
return `${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}`;
|
|
47
|
+
};
|
|
48
|
+
const stripeCardElementStyle = {
|
|
49
|
+
base: {
|
|
50
|
+
color: '#303136',
|
|
51
|
+
fontFamily: 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
|
|
52
|
+
fontSize: '18px',
|
|
53
|
+
fontSmoothing: 'antialiased',
|
|
54
|
+
fontWeight: '500',
|
|
55
|
+
'::placeholder': {
|
|
56
|
+
color: '#8c909a',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
invalid: {
|
|
60
|
+
color: '#ff2544',
|
|
61
|
+
iconColor: '#ff2544',
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
const cardNumberElementOptions = {
|
|
65
|
+
placeholder: 'Credit or Debit Card Number',
|
|
66
|
+
showIcon: false,
|
|
67
|
+
style: stripeCardElementStyle,
|
|
68
|
+
};
|
|
69
|
+
const cardExpiryElementOptions = {
|
|
70
|
+
placeholder: 'Expiry Date',
|
|
71
|
+
style: stripeCardElementStyle,
|
|
72
|
+
};
|
|
73
|
+
const cardCvcElementOptions = {
|
|
74
|
+
placeholder: 'CVV/CVC',
|
|
75
|
+
style: stripeCardElementStyle,
|
|
76
|
+
};
|
|
77
|
+
function getFriendlyCardErrorMessage(error) {
|
|
78
|
+
return error instanceof Error && error.message
|
|
79
|
+
? error.message
|
|
80
|
+
: 'Payment failed. Please review your card details and try again.';
|
|
81
|
+
}
|
|
82
|
+
function SharedStripeCheckoutV2Form({ amountCents, buttonColor, cardSubmitLabel, clientSecret, closeAriaLabel, countdownLabel, customerEmail, customerEmailEditable = false, customerEmailLabel = 'Email', customerEmailPlaceholder = 'Enter your email', customerEmailInvalidMessage = 'Enter a valid email address.', customerName, discountAmountLabel, discountLabel, discountPercent, initialWalletAvailable, nameOnCardPlaceholder = 'Name on card', onClose, onCustomerEmailChange, onCustomerEmailCommit, onError, onSuccess, paymentMethodLabels = defaultPaymentMethodLabels, promoActive, processingLabel, promoCode, promoCodeLabel, remainingSeconds, returnUrl, savedLabel, secureLabel, satisfactionLabel, satisfactionPercent, summaryLabel, themeColor, title, totalLabel, totalValue, walletButtonLabel, originalPriceLabel, originalPriceValue, }) {
|
|
83
|
+
const stripe = useStripe();
|
|
84
|
+
const elements = useElements();
|
|
85
|
+
const walletPaymentMethods = usePlatformWalletPaymentMethods();
|
|
86
|
+
const [selectedMethod, setSelectedMethod] = useState('wallet');
|
|
87
|
+
const [walletAvailable, setWalletAvailable] = useState(initialWalletAvailable !== null && initialWalletAvailable !== void 0 ? initialWalletAvailable : null);
|
|
88
|
+
const effectiveWalletAvailable = initialWalletAvailable === true && walletAvailable !== false
|
|
89
|
+
? true
|
|
90
|
+
: walletAvailable;
|
|
91
|
+
const [submitting, setSubmitting] = useState(false);
|
|
92
|
+
const [error, setError] = useState(null);
|
|
93
|
+
const [cardNumberError, setCardNumberError] = useState(null);
|
|
94
|
+
const [cardExpiryError, setCardExpiryError] = useState(null);
|
|
95
|
+
const [cardCvcError, setCardCvcError] = useState(null);
|
|
96
|
+
const [emailDraft, setEmailDraft] = useState((customerEmail === null || customerEmail === void 0 ? void 0 : customerEmail.trim()) || '');
|
|
97
|
+
const [nameOnCard, setNameOnCard] = useState((customerName === null || customerName === void 0 ? void 0 : customerName.trim()) || '');
|
|
98
|
+
const cardBrandLabels = useMemo(() => paymentMethodLabels.length > 0 ? paymentMethodLabels : defaultPaymentMethodLabels, [paymentMethodLabels]);
|
|
99
|
+
const normalizedPromoCode = promoCode.trim();
|
|
100
|
+
const showPromo = promoActive !== null && promoActive !== void 0 ? promoActive : (discountPercent > 0 && normalizedPromoCode.length > 0);
|
|
101
|
+
const countdownValue = formatCountdown(remainingSeconds);
|
|
102
|
+
const initialCustomerEmail = (customerEmail === null || customerEmail === void 0 ? void 0 : customerEmail.trim()) || '';
|
|
103
|
+
const resolvedCustomerEmail = customerEmailEditable
|
|
104
|
+
? emailDraft.trim() || initialCustomerEmail
|
|
105
|
+
: initialCustomerEmail;
|
|
106
|
+
const checkoutStyle = {
|
|
107
|
+
'--shared-checkout-v2-theme-color': themeColor,
|
|
108
|
+
'--shared-checkout-v2-button-color': buttonColor,
|
|
109
|
+
};
|
|
110
|
+
const expressCheckoutSummaryLabel = (summaryLabel === null || summaryLabel === void 0 ? void 0 : summaryLabel.trim()) || discountLabel || title;
|
|
111
|
+
const walletAriaLabel = walletPaymentMethods
|
|
112
|
+
.map((method) => method === 'applePay' ? walletButtonLabel : 'Google Pay')
|
|
113
|
+
.join(' / ');
|
|
114
|
+
const showWalletMethod = effectiveWalletAvailable !== false && walletPaymentMethods.length > 0;
|
|
115
|
+
const effectiveSelectedMethod = showWalletMethod && selectedMethod === 'wallet' ? 'wallet' : 'card';
|
|
116
|
+
const expressCheckoutOptions = useMemo(() => {
|
|
117
|
+
return {
|
|
118
|
+
buttonHeight: 55,
|
|
119
|
+
buttonTheme: {
|
|
120
|
+
applePay: 'black',
|
|
121
|
+
googlePay: 'black',
|
|
122
|
+
},
|
|
123
|
+
buttonType: {
|
|
124
|
+
applePay: 'subscribe',
|
|
125
|
+
googlePay: 'subscribe',
|
|
126
|
+
},
|
|
127
|
+
emailRequired: true,
|
|
128
|
+
layout: {
|
|
129
|
+
maxColumns: 1,
|
|
130
|
+
maxRows: 2,
|
|
131
|
+
overflow: 'auto',
|
|
132
|
+
},
|
|
133
|
+
paymentMethodOrder: getStripeWalletPaymentMethodOrder(walletPaymentMethods),
|
|
134
|
+
paymentMethods: {
|
|
135
|
+
amazonPay: 'never',
|
|
136
|
+
applePay: walletPaymentMethods.includes('applePay') ? 'always' : 'never',
|
|
137
|
+
googlePay: walletPaymentMethods.includes('googlePay') ? 'always' : 'never',
|
|
138
|
+
klarna: 'never',
|
|
139
|
+
link: 'never',
|
|
140
|
+
paypal: 'never',
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
}, [walletPaymentMethods]);
|
|
144
|
+
const setSharedError = (message) => {
|
|
145
|
+
setError(message);
|
|
146
|
+
onError === null || onError === void 0 ? void 0 : onError(message);
|
|
147
|
+
};
|
|
148
|
+
const selectWalletMethod = () => {
|
|
149
|
+
if (showWalletMethod) {
|
|
150
|
+
setSelectedMethod('wallet');
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
const selectCardMethod = () => setSelectedMethod('card');
|
|
154
|
+
const handleWalletAvailabilityChange = (available) => {
|
|
155
|
+
setWalletAvailable(available);
|
|
156
|
+
if (!available && selectedMethod === 'wallet') {
|
|
157
|
+
setSelectedMethod('card');
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
useEffect(() => {
|
|
161
|
+
if (effectiveSelectedMethod !== 'card' || typeof window === 'undefined') {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
const resizeTimer = window.setTimeout(() => {
|
|
165
|
+
window.dispatchEvent(new Event('resize'));
|
|
166
|
+
}, 0);
|
|
167
|
+
return () => window.clearTimeout(resizeTimer);
|
|
168
|
+
}, [effectiveSelectedMethod]);
|
|
169
|
+
const ensureCustomerEmail = async () => {
|
|
170
|
+
const normalizedEmail = resolvedCustomerEmail.trim();
|
|
171
|
+
if (!normalizedEmail || !isValidEmail(normalizedEmail)) {
|
|
172
|
+
setSharedError(customerEmailInvalidMessage);
|
|
173
|
+
return null;
|
|
174
|
+
}
|
|
175
|
+
if (!customerEmailEditable || !onCustomerEmailCommit) {
|
|
176
|
+
return normalizedEmail;
|
|
177
|
+
}
|
|
178
|
+
const committedEmail = await onCustomerEmailCommit(normalizedEmail);
|
|
179
|
+
const nextEmail = typeof committedEmail === 'string' && committedEmail.trim()
|
|
180
|
+
? committedEmail.trim()
|
|
181
|
+
: normalizedEmail;
|
|
182
|
+
setEmailDraft(nextEmail);
|
|
183
|
+
onCustomerEmailChange === null || onCustomerEmailChange === void 0 ? void 0 : onCustomerEmailChange(nextEmail);
|
|
184
|
+
return nextEmail;
|
|
185
|
+
};
|
|
186
|
+
const handleFieldError = (event, setFieldError) => {
|
|
187
|
+
var _a, _b, _c;
|
|
188
|
+
setFieldError((_b = (_a = event.error) === null || _a === void 0 ? void 0 : _a.message) !== null && _b !== void 0 ? _b : null);
|
|
189
|
+
if ((_c = event.error) === null || _c === void 0 ? void 0 : _c.message) {
|
|
190
|
+
setSharedError(event.error.message);
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
setSharedError(null);
|
|
194
|
+
};
|
|
195
|
+
const handleSubmit = async (event) => {
|
|
196
|
+
var _a;
|
|
197
|
+
event.preventDefault();
|
|
198
|
+
if (submitting) {
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
if (!stripe || !elements) {
|
|
202
|
+
setSharedError('Payment form is not ready yet.');
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
const cardNumberElement = elements.getElement(CardNumberElement);
|
|
206
|
+
if (!cardNumberElement) {
|
|
207
|
+
setSharedError('Payment form is not ready yet.');
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
setSubmitting(true);
|
|
211
|
+
setSharedError(null);
|
|
212
|
+
try {
|
|
213
|
+
const syncedEmail = await ensureCustomerEmail();
|
|
214
|
+
if (!syncedEmail) {
|
|
215
|
+
setSubmitting(false);
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
const result = await stripe.confirmCardPayment(clientSecret, {
|
|
219
|
+
payment_method: {
|
|
220
|
+
card: cardNumberElement,
|
|
221
|
+
billing_details: {
|
|
222
|
+
email: syncedEmail || undefined,
|
|
223
|
+
name: normalizeBillingName({
|
|
224
|
+
email: syncedEmail,
|
|
225
|
+
name: customerName,
|
|
226
|
+
fallback: nameOnCard,
|
|
227
|
+
}),
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
return_url: returnUrl,
|
|
231
|
+
});
|
|
232
|
+
if (result.error) {
|
|
233
|
+
setSharedError(result.error.message || 'Payment failed.');
|
|
234
|
+
setSubmitting(false);
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
if (typeof window !== 'undefined' &&
|
|
238
|
+
isSuccessfulIntentStatus((_a = result.paymentIntent) === null || _a === void 0 ? void 0 : _a.status)) {
|
|
239
|
+
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
|
|
240
|
+
window.location.assign(returnUrl);
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
setSubmitting(false);
|
|
244
|
+
}
|
|
245
|
+
catch (submitError) {
|
|
246
|
+
setSharedError(getFriendlyCardErrorMessage(submitError));
|
|
247
|
+
setSubmitting(false);
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
const visibleError = error || cardNumberError || cardExpiryError || cardCvcError;
|
|
251
|
+
return (_jsxs("div", { className: 'shared-checkout-v2-shell', style: checkoutStyle, children: [_jsxs("header", { className: 'shared-checkout-v2-header', children: [_jsx("button", { type: 'button', className: 'shared-checkout-v2-close', onClick: onClose, "aria-label": closeAriaLabel, children: _jsx("span", { "aria-hidden": 'true' }) }), _jsx("h2", { id: 'shared-checkout-v2-title', children: title })] }), _jsxs("section", { className: 'shared-checkout-v2-summary', children: [showPromo ? (_jsxs("p", { className: 'shared-checkout-v2-countdown', children: [discountPercent, "% ", countdownLabel, " ", countdownValue, " min"] })) : null, _jsxs("p", { className: 'shared-checkout-v2-satisfaction', children: [_jsx("strong", { children: satisfactionPercent }), " ", satisfactionLabel] }), showPromo ? (_jsxs("div", { className: 'shared-checkout-v2-price-stack', children: [_jsxs("div", { className: 'shared-checkout-v2-price-row is-muted', children: [_jsx("span", { children: originalPriceLabel }), _jsx("span", { className: 'shared-checkout-v2-strike', children: originalPriceValue })] }), _jsxs("div", { className: 'shared-checkout-v2-price-row is-discount', children: [_jsx("strong", { children: discountLabel }), _jsx("strong", { children: discountAmountLabel })] }), _jsxs("div", { className: 'shared-checkout-v2-promo', children: [_jsx("span", { children: promoCodeLabel }), _jsx("strong", { children: normalizedPromoCode })] })] })) : null, _jsxs("div", { className: [
|
|
252
|
+
'shared-checkout-v2-total',
|
|
253
|
+
showPromo ? '' : 'is-plain',
|
|
254
|
+
]
|
|
255
|
+
.filter(Boolean)
|
|
256
|
+
.join(' '), children: [_jsx("span", { children: totalLabel }), _jsxs("strong", { children: [_jsx("svg", { viewBox: '0 0 24 24', "aria-hidden": 'true', children: _jsx("path", { d: 'M20.6 13.4 12.4 21.6a2.2 2.2 0 0 1-3.1 0L2.4 14.7a2.2 2.2 0 0 1-.6-1.6V5.4a2 2 0 0 1 2-2h7.7a2.2 2.2 0 0 1 1.6.6l7.5 7.5a1.4 1.4 0 0 1 0 1.9ZM7.2 8.1a1.2 1.2 0 1 0 0-2.4 1.2 1.2 0 0 0 0 2.4Z' }) }), totalValue] })] }), showPromo ? (_jsxs("p", { className: 'shared-checkout-v2-saved', children: [_jsx("span", { "aria-hidden": 'true', children: "\uD83D\uDD25" }), savedLabel] })) : null] }), _jsxs("form", { className: 'shared-checkout-v2-payment', onSubmit: (event) => void handleSubmit(event), children: [_jsxs("div", { className: [
|
|
257
|
+
'shared-checkout-v2-methods',
|
|
258
|
+
showWalletMethod ? '' : 'has-card-only',
|
|
259
|
+
]
|
|
260
|
+
.filter(Boolean)
|
|
261
|
+
.join(' '), role: 'tablist', "aria-label": 'Payment method', children: [showWalletMethod ? (_jsxs("button", { type: 'button', className: [
|
|
262
|
+
'shared-checkout-v2-method',
|
|
263
|
+
effectiveSelectedMethod === 'wallet' ? 'is-selected' : '',
|
|
264
|
+
]
|
|
265
|
+
.filter(Boolean)
|
|
266
|
+
.join(' '), onClick: selectWalletMethod, role: 'tab', "aria-selected": effectiveSelectedMethod === 'wallet', children: [_jsxs("span", { className: 'shared-checkout-v2-tab-wallets', "aria-hidden": 'true', children: [walletPaymentMethods.includes('applePay') ? (_jsx(PaymentBrandMark, { label: 'Apple Pay', className: 'shared-checkout-v2-tab-wallet' })) : null, walletPaymentMethods.includes('googlePay') ? (_jsx(PaymentBrandMark, { label: 'Google Pay', className: 'shared-checkout-v2-tab-wallet' })) : null] }), _jsx("span", { className: 'shared-checkout-v2-sr-only', children: walletAriaLabel })] })) : null, _jsxs("button", { type: 'button', className: [
|
|
267
|
+
'shared-checkout-v2-method',
|
|
268
|
+
effectiveSelectedMethod === 'card' ? 'is-selected' : '',
|
|
269
|
+
]
|
|
270
|
+
.filter(Boolean)
|
|
271
|
+
.join(' '), onClick: selectCardMethod, role: 'tab', "aria-selected": effectiveSelectedMethod === 'card', children: [_jsx("strong", { children: "Credit card" }), _jsx("span", { className: 'shared-checkout-v2-tab-brands', "aria-hidden": 'true', children: cardBrandLabels.slice(0, 4).map((label) => (_jsx(PaymentBrandMark, { label: label, className: 'shared-checkout-v2-tab-brand' }, label))) })] })] }), _jsxs("div", { hidden: effectiveSelectedMethod !== 'wallet', className: [
|
|
272
|
+
'shared-checkout-v2-wallet-panel',
|
|
273
|
+
effectiveSelectedMethod === 'wallet' ? 'is-visible' : '',
|
|
274
|
+
]
|
|
275
|
+
.filter(Boolean)
|
|
276
|
+
.join(' '), children: [_jsxs("p", { className: 'shared-checkout-v2-secure-pill', children: [_jsx(SecurityLockIcon, { className: 'shared-checkout-v2-secure-pill-icon' }), secureLabel] }), _jsxs("div", { className: 'shared-checkout-v2-wallet-shell', "aria-label": walletAriaLabel, children: [_jsx(StripeExpressCheckoutButton, { amountCents: amountCents, availabilityPaymentMethods: walletPaymentMethods, beforeConfirm: ensureCustomerEmail, className: 'shared-checkout-v2-express-buttons', customerEmail: resolvedCustomerEmail, customerName: customerName, initialAvailable: initialWalletAvailable, keepInitialAvailableOnReady: initialWalletAvailable === true, onAvailabilityChange: handleWalletAvailabilityChange, onError: setSharedError, onSuccess: onSuccess, options: expressCheckoutOptions, returnUrl: returnUrl, summaryLabel: expressCheckoutSummaryLabel }), _jsx("span", { className: 'shared-checkout-v2-sr-only', children: walletAriaLabel })] })] }), _jsxs("div", { hidden: effectiveSelectedMethod !== 'card', className: [
|
|
277
|
+
'shared-checkout-v2-card-panel',
|
|
278
|
+
effectiveSelectedMethod === 'card' ? 'is-visible' : '',
|
|
279
|
+
]
|
|
280
|
+
.filter(Boolean)
|
|
281
|
+
.join(' '), children: [customerEmailEditable ? (_jsxs("label", { className: 'shared-checkout-v2-email-field', children: [_jsx("span", { children: customerEmailLabel }), _jsx("input", { type: 'email', autoComplete: 'email', className: 'shared-checkout-v2-email-input', inputMode: 'email', value: emailDraft, placeholder: customerEmailPlaceholder, onChange: (event) => {
|
|
282
|
+
setEmailDraft(event.target.value);
|
|
283
|
+
onCustomerEmailChange === null || onCustomerEmailChange === void 0 ? void 0 : onCustomerEmailChange(event.target.value);
|
|
284
|
+
} })] })) : null, _jsxs("div", { className: 'shared-checkout-v2-card-box', children: [_jsx("div", { className: 'shared-checkout-v2-card-number', children: _jsx(CardNumberElement, { options: cardNumberElementOptions, onChange: (event) => {
|
|
285
|
+
handleFieldError(event, setCardNumberError);
|
|
286
|
+
} }) }), _jsxs("div", { className: 'shared-checkout-v2-card-row', children: [_jsx("div", { className: 'shared-checkout-v2-card-half', children: _jsx(CardExpiryElement, { options: cardExpiryElementOptions, onChange: (event) => {
|
|
287
|
+
handleFieldError(event, setCardExpiryError);
|
|
288
|
+
} }) }), _jsxs("div", { className: 'shared-checkout-v2-card-half shared-checkout-v2-card-half--cvc', children: [_jsx(CardCvcElement, { options: cardCvcElementOptions, onChange: (event) => {
|
|
289
|
+
handleFieldError(event, setCardCvcError);
|
|
290
|
+
} }), _jsx("span", { className: 'shared-checkout-v2-cvc-info', "aria-hidden": 'true', children: "i" })] })] })] }), _jsx("input", { type: 'text', autoComplete: 'cc-name', className: 'shared-checkout-v2-name-input', value: nameOnCard, placeholder: nameOnCardPlaceholder, onChange: (event) => setNameOnCard(event.target.value) }), visibleError ? _jsx("p", { className: 'shared-checkout-v2-error', children: visibleError }) : null, _jsxs("button", { type: 'submit', className: 'shared-checkout-v2-card-submit', disabled: submitting, children: [_jsx(SecurityLockIcon, { className: 'shared-checkout-v2-card-submit-icon' }), submitting ? processingLabel : cardSubmitLabel] }), _jsx("div", { className: 'shared-checkout-v2-card-brands', "aria-hidden": 'true', children: cardBrandLabels.map((label) => (_jsx(PaymentBrandMark, { label: label, className: 'shared-checkout-v2-card-brand' }, label))) }), _jsxs("p", { className: 'shared-checkout-v2-secure-pill', children: [_jsx(SecurityLockIcon, { className: 'shared-checkout-v2-secure-pill-icon' }), secureLabel] })] })] })] }));
|
|
291
|
+
}
|
|
292
|
+
export function SharedStripeCheckoutV2Dialog(_a) {
|
|
293
|
+
var { clientSecret, onClose, stripePromise } = _a, props = __rest(_a, ["clientSecret", "onClose", "stripePromise"]);
|
|
294
|
+
useEffect(() => {
|
|
295
|
+
const handleKeyDown = (event) => {
|
|
296
|
+
if (event.key === 'Escape') {
|
|
297
|
+
onClose();
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
window.addEventListener('keydown', handleKeyDown);
|
|
301
|
+
return () => window.removeEventListener('keydown', handleKeyDown);
|
|
302
|
+
}, [onClose]);
|
|
303
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: 'shared-checkout-v2-overlay', children: _jsx("div", { className: 'shared-checkout-v2-dialog', role: 'dialog', "aria-modal": 'true', "aria-labelledby": 'shared-checkout-v2-title', children: _jsx(Elements, { stripe: stripePromise, options: {
|
|
304
|
+
clientSecret,
|
|
305
|
+
}, children: _jsx(SharedStripeCheckoutV2Form, Object.assign({}, props, { clientSecret: clientSecret, onClose: onClose })) }) }) }), _jsx("style", { children: sharedStripeCheckoutV2Styles })] }));
|
|
306
|
+
}
|
|
307
|
+
function SharedCheckoutSpecialOfferGift({ discountLabel, imageAlt, imageSrc, }) {
|
|
308
|
+
if (imageSrc) {
|
|
309
|
+
return (_jsxs("div", { className: 'shared-checkout-special-offer-gift shared-checkout-special-offer-gift--image', children: [_jsx("span", { className: 'shared-checkout-special-offer-gift-image', role: imageAlt ? 'img' : undefined, "aria-label": imageAlt || undefined, style: { backgroundImage: `url("${imageSrc}")` } }), _jsx("span", { className: 'shared-checkout-special-offer-image-discount', children: discountLabel })] }));
|
|
310
|
+
}
|
|
311
|
+
return (_jsxs("svg", { className: 'shared-checkout-special-offer-gift', viewBox: '0 0 260 190', fill: 'none', "aria-hidden": 'true', children: [_jsx("ellipse", { cx: '134', cy: '164', rx: '92', ry: '13', fill: '#dff7e7' }), _jsx("path", { d: 'M83 68h110a13 13 0 0 1 13 13v78H70V81a13 13 0 0 1 13-13Z', fill: '#e8f9df' }), _jsx("path", { d: 'M83 68h110a13 13 0 0 1 13 13v78H70V81a13 13 0 0 1 13-13Z', stroke: '#35a969', strokeWidth: '3' }), _jsx("path", { d: 'M124 68h28v91h-28V68Z', fill: '#39b86a' }), _jsx("path", { d: 'M66 87h144v25H66V87Z', fill: '#fff0a8' }), _jsx("path", { d: 'M66 87h144v25H66V87Z', stroke: '#35a969', strokeWidth: '3' }), _jsx("path", { d: 'M137 68c-16-3-36-16-32-29 3-11 18-13 31-5 11 8 10 21 1 34Z', fill: '#fff0a8', stroke: '#39b86a', strokeWidth: '8', strokeLinecap: 'round', strokeLinejoin: 'round' }), _jsx("path", { d: 'M142 68c17-3 37-16 33-29-3-11-18-13-31-5-11 8-11 21-2 34Z', fill: '#fff0a8', stroke: '#39b86a', strokeWidth: '8', strokeLinecap: 'round', strokeLinejoin: 'round' }), _jsxs("g", { className: 'shared-checkout-special-offer-discount', children: [_jsx("rect", { x: '73', y: '111', width: '116', height: '48', rx: '9', fill: '#fff8d9', stroke: '#f2b84b', strokeWidth: '3' }), _jsx("circle", { cx: '88', cy: '135', r: '5', fill: '#f2b84b' }), _jsx("text", { x: '131', y: '135', fill: '#1f8f4d', fontFamily: 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif', fontSize: '32', fontWeight: '900', letterSpacing: '0', textAnchor: 'middle', dominantBaseline: 'middle', children: discountLabel })] }), _jsx("path", { d: 'M220 69c8 3 12 8 15 16 3-8 7-13 15-16-8-3-12-8-15-16-3 8-7 13-15 16ZM213 118c5 2 8 5 10 10 2-5 5-8 10-10-5-2-8-5-10-10-2 5-5 8-10 10Z', fill: '#ffb84d' }), _jsx("path", { d: 'M45 76c6 2 10 6 12 12 2-6 6-10 12-12-6-2-10-6-12-12-2 6-6 10-12 12Z', fill: '#f56d78', opacity: '0.9' })] }));
|
|
312
|
+
}
|
|
313
|
+
export function SharedCheckoutSpecialOfferDialog({ buttonColor, buttonLabel, description, discountLabel, imageAlt, imageSrc, onAccept, themeColor, title, }) {
|
|
314
|
+
const checkoutStyle = {
|
|
315
|
+
'--shared-checkout-v2-theme-color': themeColor,
|
|
316
|
+
'--shared-checkout-v2-button-color': buttonColor,
|
|
317
|
+
};
|
|
318
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: 'shared-checkout-special-offer-overlay', style: checkoutStyle, children: _jsxs("section", { className: 'shared-checkout-special-offer-dialog', role: 'dialog', "aria-modal": 'true', "aria-labelledby": 'shared-checkout-special-offer-title', children: [_jsx(SharedCheckoutSpecialOfferGift, { discountLabel: discountLabel, imageAlt: imageAlt, imageSrc: imageSrc }), _jsx("h2", { id: 'shared-checkout-special-offer-title', children: title }), _jsx("p", { children: description }), _jsx("button", { type: 'button', className: 'shared-checkout-special-offer-button', onClick: onAccept, children: buttonLabel })] }) }), _jsx("style", { children: sharedStripeCheckoutV2Styles })] }));
|
|
319
|
+
}
|
|
320
|
+
const sharedStripeCheckoutV2Styles = `
|
|
321
|
+
.shared-checkout-v2-overlay {
|
|
322
|
+
position: fixed;
|
|
323
|
+
inset: 0;
|
|
324
|
+
z-index: 110;
|
|
325
|
+
display: flex;
|
|
326
|
+
align-items: stretch;
|
|
327
|
+
justify-content: center;
|
|
328
|
+
overflow: hidden;
|
|
329
|
+
background: #fff;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.shared-checkout-v2-dialog {
|
|
333
|
+
width: min(100%, 430px);
|
|
334
|
+
height: 100svh;
|
|
335
|
+
max-height: 100svh;
|
|
336
|
+
overflow: hidden;
|
|
337
|
+
background: #fff;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.shared-checkout-v2-shell {
|
|
341
|
+
height: 100%;
|
|
342
|
+
max-height: 100svh;
|
|
343
|
+
box-sizing: border-box;
|
|
344
|
+
display: flex;
|
|
345
|
+
flex-direction: column;
|
|
346
|
+
overflow-y: auto;
|
|
347
|
+
overflow-x: hidden;
|
|
348
|
+
-webkit-overflow-scrolling: touch;
|
|
349
|
+
background: #fff;
|
|
350
|
+
color: #303136;
|
|
351
|
+
font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.shared-checkout-v2-header {
|
|
355
|
+
position: relative;
|
|
356
|
+
min-height: 70px;
|
|
357
|
+
display: flex;
|
|
358
|
+
align-items: center;
|
|
359
|
+
justify-content: center;
|
|
360
|
+
padding: 0 56px;
|
|
361
|
+
background: #fff;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
.shared-checkout-v2-header h2 {
|
|
365
|
+
margin: 0;
|
|
366
|
+
color: #020203;
|
|
367
|
+
font-size: 24px;
|
|
368
|
+
font-weight: 900;
|
|
369
|
+
line-height: 1.15;
|
|
370
|
+
letter-spacing: 0;
|
|
371
|
+
text-align: center;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
.shared-checkout-v2-close {
|
|
375
|
+
position: absolute;
|
|
376
|
+
left: 16px;
|
|
377
|
+
top: 50%;
|
|
378
|
+
width: 40px;
|
|
379
|
+
height: 40px;
|
|
380
|
+
border: 0;
|
|
381
|
+
border-radius: 999px;
|
|
382
|
+
background: #f2f2f3;
|
|
383
|
+
color: #aaa;
|
|
384
|
+
transform: translateY(-50%);
|
|
385
|
+
cursor: pointer;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.shared-checkout-v2-close span,
|
|
389
|
+
.shared-checkout-v2-close span::after {
|
|
390
|
+
position: absolute;
|
|
391
|
+
left: 50%;
|
|
392
|
+
top: 50%;
|
|
393
|
+
width: 28px;
|
|
394
|
+
height: 4px;
|
|
395
|
+
border-radius: 999px;
|
|
396
|
+
background: currentColor;
|
|
397
|
+
content: '';
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
.shared-checkout-v2-close span {
|
|
401
|
+
transform: translate(-50%, -50%) rotate(45deg);
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
.shared-checkout-v2-close span::after {
|
|
405
|
+
transform: translate(-50%, -50%) rotate(90deg);
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
.shared-checkout-v2-summary {
|
|
409
|
+
padding: 0 17px 0;
|
|
410
|
+
background: #fff;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.shared-checkout-v2-countdown {
|
|
414
|
+
margin: 0;
|
|
415
|
+
min-height: 37px;
|
|
416
|
+
display: flex;
|
|
417
|
+
align-items: center;
|
|
418
|
+
justify-content: center;
|
|
419
|
+
border-radius: 12px;
|
|
420
|
+
background: color-mix(in srgb, var(--shared-checkout-v2-theme-color) 10%, #fff);
|
|
421
|
+
color: var(--shared-checkout-v2-theme-color);
|
|
422
|
+
font-size: 16px;
|
|
423
|
+
font-weight: 900;
|
|
424
|
+
line-height: 1.2;
|
|
425
|
+
letter-spacing: 0;
|
|
426
|
+
text-align: center;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.shared-checkout-v2-satisfaction {
|
|
430
|
+
margin: 17px 0 21px;
|
|
431
|
+
color: #2f3034;
|
|
432
|
+
font-size: 19px;
|
|
433
|
+
font-weight: 800;
|
|
434
|
+
line-height: 1.15;
|
|
435
|
+
letter-spacing: 0;
|
|
436
|
+
text-align: center;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
.shared-checkout-v2-satisfaction strong {
|
|
440
|
+
color: var(--shared-checkout-v2-theme-color);
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
.shared-checkout-v2-price-stack {
|
|
444
|
+
display: flex;
|
|
445
|
+
flex-direction: column;
|
|
446
|
+
gap: 8px;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
.shared-checkout-v2-price-row {
|
|
450
|
+
display: flex;
|
|
451
|
+
align-items: center;
|
|
452
|
+
justify-content: space-between;
|
|
453
|
+
gap: 12px;
|
|
454
|
+
font-size: 18px;
|
|
455
|
+
line-height: 1.2;
|
|
456
|
+
letter-spacing: 0;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
.shared-checkout-v2-price-row.is-muted {
|
|
460
|
+
color: #9d9d9f;
|
|
461
|
+
font-size: 17px;
|
|
462
|
+
font-weight: 500;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
.shared-checkout-v2-strike {
|
|
466
|
+
text-decoration-line: line-through;
|
|
467
|
+
text-decoration-thickness: 2px;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
.shared-checkout-v2-price-row.is-discount {
|
|
471
|
+
color: #040508;
|
|
472
|
+
font-size: 17px;
|
|
473
|
+
font-weight: 900;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
.shared-checkout-v2-price-row.is-discount strong:last-child {
|
|
477
|
+
color: #ff2544;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
.shared-checkout-v2-promo {
|
|
481
|
+
min-height: 42px;
|
|
482
|
+
box-sizing: border-box;
|
|
483
|
+
display: flex;
|
|
484
|
+
align-items: center;
|
|
485
|
+
justify-content: space-between;
|
|
486
|
+
gap: 12px;
|
|
487
|
+
border-radius: 13px;
|
|
488
|
+
background: #f0f0f0;
|
|
489
|
+
padding: 0 14px;
|
|
490
|
+
color: #8d8d90;
|
|
491
|
+
font-size: 16px;
|
|
492
|
+
font-weight: 500;
|
|
493
|
+
line-height: 1.1;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
.shared-checkout-v2-promo strong {
|
|
497
|
+
color: #050609;
|
|
498
|
+
font-weight: 900;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
.shared-checkout-v2-total {
|
|
502
|
+
margin-top: 20px;
|
|
503
|
+
min-height: 76px;
|
|
504
|
+
border-top: 1px solid #dedede;
|
|
505
|
+
display: flex;
|
|
506
|
+
align-items: center;
|
|
507
|
+
justify-content: space-between;
|
|
508
|
+
gap: 16px;
|
|
509
|
+
color: #303136;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
.shared-checkout-v2-total span {
|
|
513
|
+
font-size: 23px;
|
|
514
|
+
font-weight: 800;
|
|
515
|
+
line-height: 1;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
.shared-checkout-v2-total strong {
|
|
519
|
+
display: inline-flex;
|
|
520
|
+
align-items: center;
|
|
521
|
+
gap: 7px;
|
|
522
|
+
color: #303136;
|
|
523
|
+
font-size: 25px;
|
|
524
|
+
font-weight: 900;
|
|
525
|
+
line-height: 1;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
.shared-checkout-v2-total svg {
|
|
529
|
+
width: 25px;
|
|
530
|
+
height: 25px;
|
|
531
|
+
fill: none;
|
|
532
|
+
stroke: currentColor;
|
|
533
|
+
stroke-width: 2;
|
|
534
|
+
stroke-linejoin: round;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
.shared-checkout-v2-total.is-plain {
|
|
538
|
+
margin-top: 0;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
.shared-checkout-v2-saved {
|
|
542
|
+
width: fit-content;
|
|
543
|
+
min-height: 36px;
|
|
544
|
+
box-sizing: border-box;
|
|
545
|
+
display: flex;
|
|
546
|
+
align-items: center;
|
|
547
|
+
justify-content: center;
|
|
548
|
+
gap: 8px;
|
|
549
|
+
margin: -8px 0 9px auto;
|
|
550
|
+
border-radius: 12px;
|
|
551
|
+
background: #ffdce3;
|
|
552
|
+
padding: 0 14px;
|
|
553
|
+
color: #ff2544;
|
|
554
|
+
font-size: 14px;
|
|
555
|
+
font-weight: 900;
|
|
556
|
+
line-height: 1.1;
|
|
557
|
+
letter-spacing: 0;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
.shared-checkout-v2-payment {
|
|
561
|
+
min-height: 0;
|
|
562
|
+
display: flex;
|
|
563
|
+
flex-direction: column;
|
|
564
|
+
gap: 12px;
|
|
565
|
+
background: #f2f2f3;
|
|
566
|
+
padding: 9px 17px 32px;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
.shared-checkout-v2-methods {
|
|
570
|
+
display: grid;
|
|
571
|
+
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
|
572
|
+
gap: 42px;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
.shared-checkout-v2-methods.has-card-only {
|
|
576
|
+
grid-template-columns: minmax(0, 1fr);
|
|
577
|
+
gap: 0;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
.shared-checkout-v2-method {
|
|
581
|
+
min-width: 0;
|
|
582
|
+
min-height: 74px;
|
|
583
|
+
box-sizing: border-box;
|
|
584
|
+
border: 2px solid #e6e7eb;
|
|
585
|
+
border-radius: 13px;
|
|
586
|
+
background: #fff;
|
|
587
|
+
color: #344376;
|
|
588
|
+
padding: 9px 8px;
|
|
589
|
+
display: flex;
|
|
590
|
+
flex-direction: column;
|
|
591
|
+
align-items: center;
|
|
592
|
+
justify-content: center;
|
|
593
|
+
gap: 6px;
|
|
594
|
+
cursor: pointer;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
.shared-checkout-v2-method.is-selected {
|
|
598
|
+
border: 3px solid #050505;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
.shared-checkout-v2-tab-wallet {
|
|
602
|
+
width: 58px;
|
|
603
|
+
height: 36px;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
.shared-checkout-v2-tab-wallet svg {
|
|
607
|
+
display: block;
|
|
608
|
+
width: 100%;
|
|
609
|
+
height: 100%;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
.shared-checkout-v2-tab-wallets {
|
|
613
|
+
display: flex;
|
|
614
|
+
align-items: center;
|
|
615
|
+
justify-content: center;
|
|
616
|
+
gap: 8px;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
.shared-checkout-v2-method strong {
|
|
620
|
+
color: #344376;
|
|
621
|
+
font-size: 20px;
|
|
622
|
+
font-weight: 900;
|
|
623
|
+
line-height: 1;
|
|
624
|
+
letter-spacing: 0;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
.shared-checkout-v2-tab-brands {
|
|
628
|
+
display: flex;
|
|
629
|
+
align-items: center;
|
|
630
|
+
justify-content: center;
|
|
631
|
+
gap: 6px;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
.shared-checkout-v2-tab-brand {
|
|
635
|
+
width: 30px;
|
|
636
|
+
height: 20px;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
.shared-checkout-v2-wallet-panel,
|
|
640
|
+
.shared-checkout-v2-card-panel {
|
|
641
|
+
display: flex;
|
|
642
|
+
flex-direction: column;
|
|
643
|
+
height: 0;
|
|
644
|
+
overflow: hidden;
|
|
645
|
+
opacity: 0;
|
|
646
|
+
pointer-events: none;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
.shared-checkout-v2-wallet-panel[hidden],
|
|
650
|
+
.shared-checkout-v2-card-panel[hidden] {
|
|
651
|
+
display: none;
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
.shared-checkout-v2-wallet-panel {
|
|
655
|
+
align-items: center;
|
|
656
|
+
gap: 22px;
|
|
657
|
+
padding-top: 5px;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
.shared-checkout-v2-secure-pill {
|
|
661
|
+
width: fit-content;
|
|
662
|
+
min-height: 47px;
|
|
663
|
+
box-sizing: border-box;
|
|
664
|
+
display: inline-flex;
|
|
665
|
+
align-items: center;
|
|
666
|
+
justify-content: center;
|
|
667
|
+
gap: 12px;
|
|
668
|
+
margin: 0 auto;
|
|
669
|
+
border-radius: 12px;
|
|
670
|
+
background: #dcffd0;
|
|
671
|
+
padding: 0 22px;
|
|
672
|
+
color: #207733;
|
|
673
|
+
font-size: 18px;
|
|
674
|
+
font-weight: 600;
|
|
675
|
+
line-height: 1.1;
|
|
676
|
+
letter-spacing: 0;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
.shared-checkout-v2-secure-pill-icon {
|
|
680
|
+
width: 24px;
|
|
681
|
+
height: 24px;
|
|
682
|
+
flex: none;
|
|
683
|
+
color: #147232;
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
.shared-checkout-v2-wallet-shell {
|
|
687
|
+
width: 100%;
|
|
688
|
+
min-height: 124px;
|
|
689
|
+
display: flex;
|
|
690
|
+
flex-direction: column;
|
|
691
|
+
justify-content: center;
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
.shared-checkout-v2-express-buttons {
|
|
695
|
+
width: 100%;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
.shared-checkout-v2-card-panel {
|
|
699
|
+
gap: 10px;
|
|
700
|
+
padding: 2px 15px 5px;
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
.shared-checkout-v2-wallet-panel.is-visible,
|
|
704
|
+
.shared-checkout-v2-card-panel.is-visible {
|
|
705
|
+
height: auto;
|
|
706
|
+
overflow: visible;
|
|
707
|
+
opacity: 1;
|
|
708
|
+
pointer-events: auto;
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
.shared-checkout-v2-wallet-panel:not(.is-visible),
|
|
712
|
+
.shared-checkout-v2-card-panel:not(.is-visible) {
|
|
713
|
+
padding-top: 0;
|
|
714
|
+
padding-bottom: 0;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
.shared-checkout-v2-email-field {
|
|
718
|
+
display: grid;
|
|
719
|
+
gap: 7px;
|
|
720
|
+
color: #25272a;
|
|
721
|
+
font-size: 13px;
|
|
722
|
+
font-weight: 800;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
.shared-checkout-v2-email-input,
|
|
726
|
+
.shared-checkout-v2-name-input {
|
|
727
|
+
width: 100%;
|
|
728
|
+
min-height: 56px;
|
|
729
|
+
box-sizing: border-box;
|
|
730
|
+
border: 1px solid #8f94a0;
|
|
731
|
+
border-radius: 14px;
|
|
732
|
+
background: #f6f7fc;
|
|
733
|
+
padding: 0 24px;
|
|
734
|
+
color: #303136;
|
|
735
|
+
font: inherit;
|
|
736
|
+
font-size: 19px;
|
|
737
|
+
font-weight: 500;
|
|
738
|
+
outline: none;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
.shared-checkout-v2-email-input::placeholder,
|
|
742
|
+
.shared-checkout-v2-name-input::placeholder {
|
|
743
|
+
color: #8c909a;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
.shared-checkout-v2-card-box {
|
|
747
|
+
overflow: hidden;
|
|
748
|
+
border: 1px solid #8f94a0;
|
|
749
|
+
border-radius: 14px;
|
|
750
|
+
background: #f6f7fc;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
.shared-checkout-v2-card-number,
|
|
754
|
+
.shared-checkout-v2-card-half {
|
|
755
|
+
position: relative;
|
|
756
|
+
min-height: 56px;
|
|
757
|
+
box-sizing: border-box;
|
|
758
|
+
display: flex;
|
|
759
|
+
align-items: center;
|
|
760
|
+
padding: 0 24px;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
.shared-checkout-v2-card-number > div,
|
|
764
|
+
.shared-checkout-v2-card-half > div {
|
|
765
|
+
position: relative;
|
|
766
|
+
z-index: 1;
|
|
767
|
+
width: 100%;
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
.shared-checkout-v2-card-number {
|
|
771
|
+
border-bottom: 1px solid #8f94a0;
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
.shared-checkout-v2-card-row {
|
|
775
|
+
display: grid;
|
|
776
|
+
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
.shared-checkout-v2-card-half:first-child {
|
|
780
|
+
border-right: 1px solid #8f94a0;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
.shared-checkout-v2-card-half--cvc {
|
|
784
|
+
justify-content: space-between;
|
|
785
|
+
gap: 10px;
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
.shared-checkout-v2-card-half--cvc > div {
|
|
789
|
+
flex: 1;
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
.shared-checkout-v2-cvc-info {
|
|
793
|
+
width: 24px;
|
|
794
|
+
height: 24px;
|
|
795
|
+
border-radius: 999px;
|
|
796
|
+
display: inline-flex;
|
|
797
|
+
align-items: center;
|
|
798
|
+
justify-content: center;
|
|
799
|
+
background: #8c909a;
|
|
800
|
+
color: #fff;
|
|
801
|
+
font-size: 16px;
|
|
802
|
+
font-weight: 900;
|
|
803
|
+
line-height: 1;
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
.shared-checkout-v2-error {
|
|
807
|
+
margin: 0;
|
|
808
|
+
color: #c43737;
|
|
809
|
+
font-size: 13px;
|
|
810
|
+
font-weight: 600;
|
|
811
|
+
line-height: 1.35;
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
.shared-checkout-v2-card-submit {
|
|
815
|
+
min-height: 60px;
|
|
816
|
+
border: 0;
|
|
817
|
+
border-radius: 11px;
|
|
818
|
+
background: var(--shared-checkout-v2-button-color);
|
|
819
|
+
color: #fff;
|
|
820
|
+
display: inline-flex;
|
|
821
|
+
align-items: center;
|
|
822
|
+
justify-content: center;
|
|
823
|
+
gap: 14px;
|
|
824
|
+
font-size: 22px;
|
|
825
|
+
font-weight: 900;
|
|
826
|
+
line-height: 1;
|
|
827
|
+
letter-spacing: 0;
|
|
828
|
+
cursor: pointer;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
.shared-checkout-v2-card-submit:disabled {
|
|
832
|
+
cursor: wait;
|
|
833
|
+
opacity: 0.72;
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
.shared-checkout-v2-card-submit-icon {
|
|
837
|
+
width: 26px;
|
|
838
|
+
height: 26px;
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
.shared-checkout-v2-card-brands {
|
|
842
|
+
min-height: 34px;
|
|
843
|
+
display: flex;
|
|
844
|
+
align-items: center;
|
|
845
|
+
justify-content: center;
|
|
846
|
+
gap: 12px;
|
|
847
|
+
opacity: 0.95;
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
.shared-checkout-v2-card-brand {
|
|
851
|
+
width: 42px;
|
|
852
|
+
height: 25px;
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
.shared-checkout-v2-sr-only {
|
|
856
|
+
position: absolute;
|
|
857
|
+
width: 1px;
|
|
858
|
+
height: 1px;
|
|
859
|
+
padding: 0;
|
|
860
|
+
margin: -1px;
|
|
861
|
+
overflow: hidden;
|
|
862
|
+
clip: rect(0, 0, 0, 0);
|
|
863
|
+
white-space: nowrap;
|
|
864
|
+
border: 0;
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
.shared-checkout-special-offer-overlay {
|
|
868
|
+
position: fixed;
|
|
869
|
+
inset: 0;
|
|
870
|
+
z-index: 120;
|
|
871
|
+
display: flex;
|
|
872
|
+
align-items: center;
|
|
873
|
+
justify-content: center;
|
|
874
|
+
box-sizing: border-box;
|
|
875
|
+
padding: 22px;
|
|
876
|
+
background: rgb(0 0 0 / 48%);
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
.shared-checkout-special-offer-dialog {
|
|
880
|
+
width: min(100%, 386px);
|
|
881
|
+
box-sizing: border-box;
|
|
882
|
+
border-radius: 14px;
|
|
883
|
+
background: #fff;
|
|
884
|
+
padding: 55px 26px 28px;
|
|
885
|
+
color: #303136;
|
|
886
|
+
text-align: center;
|
|
887
|
+
font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
.shared-checkout-special-offer-gift {
|
|
891
|
+
display: block;
|
|
892
|
+
width: min(100%, 260px);
|
|
893
|
+
height: auto;
|
|
894
|
+
margin: 0 auto 22px;
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
.shared-checkout-special-offer-gift--image {
|
|
898
|
+
position: relative;
|
|
899
|
+
width: min(100%, 250px);
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
.shared-checkout-special-offer-gift-image {
|
|
903
|
+
display: block;
|
|
904
|
+
width: 100%;
|
|
905
|
+
aspect-ratio: 1;
|
|
906
|
+
background-position: center;
|
|
907
|
+
background-repeat: no-repeat;
|
|
908
|
+
background-size: contain;
|
|
909
|
+
user-select: none;
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
.shared-checkout-special-offer-image-discount {
|
|
913
|
+
position: absolute;
|
|
914
|
+
top: 69%;
|
|
915
|
+
left: 50%;
|
|
916
|
+
transform: translate(-50%, -50%);
|
|
917
|
+
color: #1f8f4d;
|
|
918
|
+
font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
919
|
+
font-size: 34px;
|
|
920
|
+
font-weight: 900;
|
|
921
|
+
line-height: 1;
|
|
922
|
+
letter-spacing: 0;
|
|
923
|
+
pointer-events: none;
|
|
924
|
+
white-space: nowrap;
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
.shared-checkout-special-offer-dialog h2 {
|
|
928
|
+
margin: 0;
|
|
929
|
+
color: #303136;
|
|
930
|
+
font-size: 36px;
|
|
931
|
+
font-weight: 900;
|
|
932
|
+
line-height: 1.1;
|
|
933
|
+
letter-spacing: 0;
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
.shared-checkout-special-offer-dialog p {
|
|
937
|
+
margin: 26px 0 32px;
|
|
938
|
+
color: #77787e;
|
|
939
|
+
font-size: 24px;
|
|
940
|
+
font-weight: 500;
|
|
941
|
+
line-height: 1.18;
|
|
942
|
+
letter-spacing: 0;
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
.shared-checkout-special-offer-button {
|
|
946
|
+
width: 100%;
|
|
947
|
+
min-height: 76px;
|
|
948
|
+
border: 0;
|
|
949
|
+
border-radius: 12px;
|
|
950
|
+
background: var(--shared-checkout-v2-button-color);
|
|
951
|
+
color: #fff;
|
|
952
|
+
font-size: 23px;
|
|
953
|
+
font-weight: 900;
|
|
954
|
+
line-height: 1;
|
|
955
|
+
letter-spacing: 0;
|
|
956
|
+
cursor: pointer;
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
@media (max-width: 429px) {
|
|
960
|
+
.shared-checkout-v2-header {
|
|
961
|
+
min-height: 64px;
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
.shared-checkout-v2-header h2 {
|
|
965
|
+
font-size: 24px;
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
.shared-checkout-v2-summary {
|
|
969
|
+
padding-inline: 17px;
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
.shared-checkout-v2-satisfaction {
|
|
973
|
+
font-size: 19px;
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
.shared-checkout-v2-methods {
|
|
977
|
+
gap: 42px;
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
.shared-checkout-v2-method strong {
|
|
981
|
+
font-size: 19px;
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
.shared-checkout-v2-card-panel {
|
|
985
|
+
padding-inline: 15px;
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
`;
|