@movmo_app/payments 0.2.0 → 0.2.1
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/dist/index.cjs.js +10 -10
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +67 -6
- package/dist/index.es.js +1169 -866
- package/dist/index.es.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
var
|
|
1
|
+
import Er, { useState as P, useRef as B, useEffect as L, useCallback as H, useMemo as Ue } from "react";
|
|
2
|
+
var rr = { exports: {} }, $e = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
5
5
|
* react-jsx-runtime.production.min.js
|
|
@@ -9,21 +9,21 @@ var ze = { exports: {} }, je = {};
|
|
|
9
9
|
* This source code is licensed under the MIT license found in the
|
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
|
11
11
|
*/
|
|
12
|
-
var
|
|
13
|
-
function
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
var r =
|
|
17
|
-
function
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
for (
|
|
21
|
-
if (
|
|
22
|
-
return { $$typeof: t, type:
|
|
12
|
+
var fr;
|
|
13
|
+
function zr() {
|
|
14
|
+
if (fr) return $e;
|
|
15
|
+
fr = 1;
|
|
16
|
+
var r = Er, t = Symbol.for("react.element"), s = Symbol.for("react.fragment"), o = Object.prototype.hasOwnProperty, l = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, c = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
17
|
+
function f(p, y, W) {
|
|
18
|
+
var N, b = {}, D = null, M = null;
|
|
19
|
+
W !== void 0 && (D = "" + W), y.key !== void 0 && (D = "" + y.key), y.ref !== void 0 && (M = y.ref);
|
|
20
|
+
for (N in y) o.call(y, N) && !c.hasOwnProperty(N) && (b[N] = y[N]);
|
|
21
|
+
if (p && p.defaultProps) for (N in y = p.defaultProps, y) b[N] === void 0 && (b[N] = y[N]);
|
|
22
|
+
return { $$typeof: t, type: p, key: D, ref: M, props: b, _owner: l.current };
|
|
23
23
|
}
|
|
24
|
-
return
|
|
24
|
+
return $e.Fragment = s, $e.jsx = f, $e.jsxs = f, $e;
|
|
25
25
|
}
|
|
26
|
-
var
|
|
26
|
+
var Ae = {};
|
|
27
27
|
/**
|
|
28
28
|
* @license React
|
|
29
29
|
* react-jsx-runtime.development.js
|
|
@@ -33,57 +33,57 @@ var _e = {};
|
|
|
33
33
|
* This source code is licensed under the MIT license found in the
|
|
34
34
|
* LICENSE file in the root directory of this source tree.
|
|
35
35
|
*/
|
|
36
|
-
var
|
|
37
|
-
function
|
|
38
|
-
return
|
|
39
|
-
var r =
|
|
40
|
-
function
|
|
36
|
+
var pr;
|
|
37
|
+
function Vr() {
|
|
38
|
+
return pr || (pr = 1, process.env.NODE_ENV !== "production" && function() {
|
|
39
|
+
var r = Er, t = Symbol.for("react.element"), s = Symbol.for("react.portal"), o = Symbol.for("react.fragment"), l = Symbol.for("react.strict_mode"), c = Symbol.for("react.profiler"), f = Symbol.for("react.provider"), p = Symbol.for("react.context"), y = Symbol.for("react.forward_ref"), W = Symbol.for("react.suspense"), N = Symbol.for("react.suspense_list"), b = Symbol.for("react.memo"), D = Symbol.for("react.lazy"), M = Symbol.for("react.offscreen"), X = Symbol.iterator, T = "@@iterator";
|
|
40
|
+
function se(e) {
|
|
41
41
|
if (e === null || typeof e != "object")
|
|
42
42
|
return null;
|
|
43
|
-
var n =
|
|
43
|
+
var n = X && e[X] || e[T];
|
|
44
44
|
return typeof n == "function" ? n : null;
|
|
45
45
|
}
|
|
46
|
-
var
|
|
47
|
-
function
|
|
46
|
+
var E = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
47
|
+
function S(e) {
|
|
48
48
|
{
|
|
49
|
-
for (var n = arguments.length, i = new Array(n > 1 ? n - 1 : 0),
|
|
50
|
-
i[
|
|
51
|
-
|
|
49
|
+
for (var n = arguments.length, i = new Array(n > 1 ? n - 1 : 0), m = 1; m < n; m++)
|
|
50
|
+
i[m - 1] = arguments[m];
|
|
51
|
+
q("error", e, i);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function q(e, n, i) {
|
|
55
55
|
{
|
|
56
|
-
var
|
|
57
|
-
|
|
58
|
-
var
|
|
59
|
-
return String(
|
|
56
|
+
var m = E.ReactDebugCurrentFrame, j = m.getStackAddendum();
|
|
57
|
+
j !== "" && (n += "%s", i = i.concat([j]));
|
|
58
|
+
var k = i.map(function(x) {
|
|
59
|
+
return String(x);
|
|
60
60
|
});
|
|
61
|
-
|
|
61
|
+
k.unshift("Warning: " + n), Function.prototype.apply.call(console[e], console, k);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
var
|
|
65
|
-
|
|
66
|
-
function
|
|
67
|
-
return !!(typeof e == "string" || typeof e == "function" || e === o || e ===
|
|
64
|
+
var ue = !1, re = !1, g = !1, ne = !1, ye = !1, I;
|
|
65
|
+
I = Symbol.for("react.module.reference");
|
|
66
|
+
function R(e) {
|
|
67
|
+
return !!(typeof e == "string" || typeof e == "function" || e === o || e === c || ye || e === l || e === W || e === N || ne || e === M || ue || re || g || typeof e == "object" && e !== null && (e.$$typeof === D || e.$$typeof === b || e.$$typeof === f || e.$$typeof === p || e.$$typeof === y || // This needs to include all possible module reference object
|
|
68
68
|
// types supported by any Flight configuration anywhere since
|
|
69
69
|
// we don't know which Flight build this will end up being used
|
|
70
70
|
// with.
|
|
71
|
-
e.$$typeof ===
|
|
71
|
+
e.$$typeof === I || e.getModuleId !== void 0));
|
|
72
72
|
}
|
|
73
|
-
function
|
|
74
|
-
var
|
|
75
|
-
if (
|
|
76
|
-
return
|
|
77
|
-
var
|
|
78
|
-
return
|
|
73
|
+
function d(e, n, i) {
|
|
74
|
+
var m = e.displayName;
|
|
75
|
+
if (m)
|
|
76
|
+
return m;
|
|
77
|
+
var j = n.displayName || n.name || "";
|
|
78
|
+
return j !== "" ? i + "(" + j + ")" : i;
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function C(e) {
|
|
81
81
|
return e.displayName || "Context";
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function w(e) {
|
|
84
84
|
if (e == null)
|
|
85
85
|
return null;
|
|
86
|
-
if (typeof e.tag == "number" &&
|
|
86
|
+
if (typeof e.tag == "number" && S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
87
87
|
return e.displayName || e.name || null;
|
|
88
88
|
if (typeof e == "string")
|
|
89
89
|
return e;
|
|
@@ -92,32 +92,32 @@ function Ur() {
|
|
|
92
92
|
return "Fragment";
|
|
93
93
|
case s:
|
|
94
94
|
return "Portal";
|
|
95
|
-
case
|
|
95
|
+
case c:
|
|
96
96
|
return "Profiler";
|
|
97
97
|
case l:
|
|
98
98
|
return "StrictMode";
|
|
99
|
-
case
|
|
99
|
+
case W:
|
|
100
100
|
return "Suspense";
|
|
101
|
-
case
|
|
101
|
+
case N:
|
|
102
102
|
return "SuspenseList";
|
|
103
103
|
}
|
|
104
104
|
if (typeof e == "object")
|
|
105
105
|
switch (e.$$typeof) {
|
|
106
|
-
case
|
|
106
|
+
case p:
|
|
107
107
|
var n = e;
|
|
108
|
-
return
|
|
109
|
-
case
|
|
108
|
+
return C(n) + ".Consumer";
|
|
109
|
+
case f:
|
|
110
110
|
var i = e;
|
|
111
|
-
return
|
|
111
|
+
return C(i._context) + ".Provider";
|
|
112
112
|
case y:
|
|
113
|
-
return
|
|
114
|
-
case
|
|
115
|
-
var
|
|
116
|
-
return
|
|
117
|
-
case
|
|
118
|
-
var
|
|
113
|
+
return d(e, e.render, "ForwardRef");
|
|
114
|
+
case b:
|
|
115
|
+
var m = e.displayName || null;
|
|
116
|
+
return m !== null ? m : w(e.type) || "Memo";
|
|
117
|
+
case D: {
|
|
118
|
+
var j = e, k = j._payload, x = j._init;
|
|
119
119
|
try {
|
|
120
|
-
return
|
|
120
|
+
return w(x(k));
|
|
121
121
|
} catch {
|
|
122
122
|
return null;
|
|
123
123
|
}
|
|
@@ -125,18 +125,18 @@ function Ur() {
|
|
|
125
125
|
}
|
|
126
126
|
return null;
|
|
127
127
|
}
|
|
128
|
-
var
|
|
129
|
-
function
|
|
128
|
+
var $ = Object.assign, J = 0, Y, Q, z, _, F, fe, ve;
|
|
129
|
+
function ge() {
|
|
130
130
|
}
|
|
131
|
-
|
|
132
|
-
function
|
|
131
|
+
ge.__reactDisabledLog = !0;
|
|
132
|
+
function we() {
|
|
133
133
|
{
|
|
134
|
-
if (
|
|
135
|
-
|
|
134
|
+
if (J === 0) {
|
|
135
|
+
Y = console.log, Q = console.info, z = console.warn, _ = console.error, F = console.group, fe = console.groupCollapsed, ve = console.groupEnd;
|
|
136
136
|
var e = {
|
|
137
137
|
configurable: !0,
|
|
138
138
|
enumerable: !0,
|
|
139
|
-
value:
|
|
139
|
+
value: ge,
|
|
140
140
|
writable: !0
|
|
141
141
|
};
|
|
142
142
|
Object.defineProperties(console, {
|
|
@@ -149,250 +149,250 @@ function Ur() {
|
|
|
149
149
|
groupEnd: e
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
|
-
|
|
152
|
+
J++;
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
function
|
|
155
|
+
function me() {
|
|
156
156
|
{
|
|
157
|
-
if (
|
|
157
|
+
if (J--, J === 0) {
|
|
158
158
|
var e = {
|
|
159
159
|
configurable: !0,
|
|
160
160
|
enumerable: !0,
|
|
161
161
|
writable: !0
|
|
162
162
|
};
|
|
163
163
|
Object.defineProperties(console, {
|
|
164
|
-
log:
|
|
165
|
-
value:
|
|
164
|
+
log: $({}, e, {
|
|
165
|
+
value: Y
|
|
166
166
|
}),
|
|
167
|
-
info:
|
|
168
|
-
value:
|
|
167
|
+
info: $({}, e, {
|
|
168
|
+
value: Q
|
|
169
169
|
}),
|
|
170
|
-
warn:
|
|
171
|
-
value:
|
|
170
|
+
warn: $({}, e, {
|
|
171
|
+
value: z
|
|
172
172
|
}),
|
|
173
|
-
error:
|
|
174
|
-
value:
|
|
173
|
+
error: $({}, e, {
|
|
174
|
+
value: _
|
|
175
175
|
}),
|
|
176
|
-
group:
|
|
177
|
-
value:
|
|
176
|
+
group: $({}, e, {
|
|
177
|
+
value: F
|
|
178
178
|
}),
|
|
179
|
-
groupCollapsed:
|
|
179
|
+
groupCollapsed: $({}, e, {
|
|
180
180
|
value: fe
|
|
181
181
|
}),
|
|
182
|
-
groupEnd:
|
|
183
|
-
value:
|
|
182
|
+
groupEnd: $({}, e, {
|
|
183
|
+
value: ve
|
|
184
184
|
})
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
|
-
|
|
187
|
+
J < 0 && S("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
|
-
var
|
|
191
|
-
function
|
|
190
|
+
var je = E.ReactCurrentDispatcher, he;
|
|
191
|
+
function G(e, n, i) {
|
|
192
192
|
{
|
|
193
|
-
if (
|
|
193
|
+
if (he === void 0)
|
|
194
194
|
try {
|
|
195
195
|
throw Error();
|
|
196
|
-
} catch (
|
|
197
|
-
var
|
|
198
|
-
|
|
196
|
+
} catch (j) {
|
|
197
|
+
var m = j.stack.trim().match(/\n( *(at )?)/);
|
|
198
|
+
he = m && m[1] || "";
|
|
199
199
|
}
|
|
200
200
|
return `
|
|
201
|
-
` +
|
|
201
|
+
` + he + e;
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
|
-
var
|
|
204
|
+
var oe = !1, ie;
|
|
205
205
|
{
|
|
206
|
-
var
|
|
207
|
-
|
|
206
|
+
var xe = typeof WeakMap == "function" ? WeakMap : Map;
|
|
207
|
+
ie = new xe();
|
|
208
208
|
}
|
|
209
|
-
function
|
|
210
|
-
if (!e ||
|
|
209
|
+
function Ee(e, n) {
|
|
210
|
+
if (!e || oe)
|
|
211
211
|
return "";
|
|
212
212
|
{
|
|
213
|
-
var i =
|
|
213
|
+
var i = ie.get(e);
|
|
214
214
|
if (i !== void 0)
|
|
215
215
|
return i;
|
|
216
216
|
}
|
|
217
|
-
var
|
|
218
|
-
|
|
219
|
-
var
|
|
217
|
+
var m;
|
|
218
|
+
oe = !0;
|
|
219
|
+
var j = Error.prepareStackTrace;
|
|
220
220
|
Error.prepareStackTrace = void 0;
|
|
221
|
-
var
|
|
222
|
-
|
|
221
|
+
var k;
|
|
222
|
+
k = je.current, je.current = null, we();
|
|
223
223
|
try {
|
|
224
224
|
if (n) {
|
|
225
|
-
var
|
|
225
|
+
var x = function() {
|
|
226
226
|
throw Error();
|
|
227
227
|
};
|
|
228
|
-
if (Object.defineProperty(
|
|
228
|
+
if (Object.defineProperty(x.prototype, "props", {
|
|
229
229
|
set: function() {
|
|
230
230
|
throw Error();
|
|
231
231
|
}
|
|
232
232
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
233
233
|
try {
|
|
234
|
-
Reflect.construct(
|
|
235
|
-
} catch (
|
|
236
|
-
|
|
234
|
+
Reflect.construct(x, []);
|
|
235
|
+
} catch (ae) {
|
|
236
|
+
m = ae;
|
|
237
237
|
}
|
|
238
|
-
Reflect.construct(e, [],
|
|
238
|
+
Reflect.construct(e, [], x);
|
|
239
239
|
} else {
|
|
240
240
|
try {
|
|
241
|
-
|
|
242
|
-
} catch (
|
|
243
|
-
|
|
241
|
+
x.call();
|
|
242
|
+
} catch (ae) {
|
|
243
|
+
m = ae;
|
|
244
244
|
}
|
|
245
|
-
e.call(
|
|
245
|
+
e.call(x.prototype);
|
|
246
246
|
}
|
|
247
247
|
} else {
|
|
248
248
|
try {
|
|
249
249
|
throw Error();
|
|
250
|
-
} catch (
|
|
251
|
-
|
|
250
|
+
} catch (ae) {
|
|
251
|
+
m = ae;
|
|
252
252
|
}
|
|
253
253
|
e();
|
|
254
254
|
}
|
|
255
|
-
} catch (
|
|
256
|
-
if (
|
|
257
|
-
for (var
|
|
258
|
-
`),
|
|
259
|
-
`),
|
|
260
|
-
|
|
261
|
-
for (;
|
|
262
|
-
if (
|
|
263
|
-
if (
|
|
255
|
+
} catch (ae) {
|
|
256
|
+
if (ae && m && typeof ae.stack == "string") {
|
|
257
|
+
for (var h = ae.stack.split(`
|
|
258
|
+
`), ee = m.stack.split(`
|
|
259
|
+
`), A = h.length - 1, U = ee.length - 1; A >= 1 && U >= 0 && h[A] !== ee[U]; )
|
|
260
|
+
U--;
|
|
261
|
+
for (; A >= 1 && U >= 0; A--, U--)
|
|
262
|
+
if (h[A] !== ee[U]) {
|
|
263
|
+
if (A !== 1 || U !== 1)
|
|
264
264
|
do
|
|
265
|
-
if (
|
|
266
|
-
var
|
|
267
|
-
` +
|
|
268
|
-
return e.displayName &&
|
|
265
|
+
if (A--, U--, U < 0 || h[A] !== ee[U]) {
|
|
266
|
+
var de = `
|
|
267
|
+
` + h[A].replace(" at new ", " at ");
|
|
268
|
+
return e.displayName && de.includes("<anonymous>") && (de = de.replace("<anonymous>", e.displayName)), typeof e == "function" && ie.set(e, de), de;
|
|
269
269
|
}
|
|
270
|
-
while (
|
|
270
|
+
while (A >= 1 && U >= 0);
|
|
271
271
|
break;
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
274
|
} finally {
|
|
275
|
-
|
|
275
|
+
oe = !1, je.current = k, me(), Error.prepareStackTrace = j;
|
|
276
276
|
}
|
|
277
|
-
var
|
|
278
|
-
return typeof e == "function" &&
|
|
277
|
+
var Pe = e ? e.displayName || e.name : "", Re = Pe ? G(Pe) : "";
|
|
278
|
+
return typeof e == "function" && ie.set(e, Re), Re;
|
|
279
279
|
}
|
|
280
|
-
function
|
|
281
|
-
return
|
|
280
|
+
function Ne(e, n, i) {
|
|
281
|
+
return Ee(e, !1);
|
|
282
282
|
}
|
|
283
|
-
function
|
|
283
|
+
function _e(e) {
|
|
284
284
|
var n = e.prototype;
|
|
285
285
|
return !!(n && n.isReactComponent);
|
|
286
286
|
}
|
|
287
|
-
function
|
|
287
|
+
function le(e, n, i) {
|
|
288
288
|
if (e == null)
|
|
289
289
|
return "";
|
|
290
290
|
if (typeof e == "function")
|
|
291
|
-
return
|
|
291
|
+
return Ee(e, _e(e));
|
|
292
292
|
if (typeof e == "string")
|
|
293
|
-
return
|
|
293
|
+
return G(e);
|
|
294
294
|
switch (e) {
|
|
295
|
-
case
|
|
296
|
-
return
|
|
297
|
-
case
|
|
298
|
-
return
|
|
295
|
+
case W:
|
|
296
|
+
return G("Suspense");
|
|
297
|
+
case N:
|
|
298
|
+
return G("SuspenseList");
|
|
299
299
|
}
|
|
300
300
|
if (typeof e == "object")
|
|
301
301
|
switch (e.$$typeof) {
|
|
302
302
|
case y:
|
|
303
|
-
return
|
|
304
|
-
case
|
|
305
|
-
return
|
|
306
|
-
case
|
|
307
|
-
var
|
|
303
|
+
return Ne(e.render);
|
|
304
|
+
case b:
|
|
305
|
+
return le(e.type, n, i);
|
|
306
|
+
case D: {
|
|
307
|
+
var m = e, j = m._payload, k = m._init;
|
|
308
308
|
try {
|
|
309
|
-
return
|
|
309
|
+
return le(k(j), n, i);
|
|
310
310
|
} catch {
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
314
|
return "";
|
|
315
315
|
}
|
|
316
|
-
var
|
|
317
|
-
function
|
|
316
|
+
var v = Object.prototype.hasOwnProperty, O = {}, V = E.ReactDebugCurrentFrame;
|
|
317
|
+
function pe(e) {
|
|
318
318
|
if (e) {
|
|
319
|
-
var n = e._owner, i =
|
|
320
|
-
|
|
319
|
+
var n = e._owner, i = le(e.type, e._source, n ? n.type : null);
|
|
320
|
+
V.setExtraStackFrame(i);
|
|
321
321
|
} else
|
|
322
|
-
|
|
322
|
+
V.setExtraStackFrame(null);
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function Ye(e, n, i, m, j) {
|
|
325
325
|
{
|
|
326
|
-
var
|
|
327
|
-
for (var
|
|
328
|
-
if (
|
|
329
|
-
var
|
|
326
|
+
var k = Function.call.bind(v);
|
|
327
|
+
for (var x in e)
|
|
328
|
+
if (k(e, x)) {
|
|
329
|
+
var h = void 0;
|
|
330
330
|
try {
|
|
331
|
-
if (typeof e[
|
|
332
|
-
var
|
|
333
|
-
throw
|
|
331
|
+
if (typeof e[x] != "function") {
|
|
332
|
+
var ee = Error((m || "React class") + ": " + i + " type `" + x + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[x] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
333
|
+
throw ee.name = "Invariant Violation", ee;
|
|
334
334
|
}
|
|
335
|
-
|
|
336
|
-
} catch (
|
|
337
|
-
|
|
335
|
+
h = e[x](n, x, m, i, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
336
|
+
} catch (A) {
|
|
337
|
+
h = A;
|
|
338
338
|
}
|
|
339
|
-
|
|
339
|
+
h && !(h instanceof Error) && (pe(j), S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", m || "React class", i, x, typeof h), pe(null)), h instanceof Error && !(h.message in O) && (O[h.message] = !0, pe(j), S("Failed %s type: %s", i, h.message), pe(null));
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
|
-
var
|
|
344
|
-
function
|
|
345
|
-
return
|
|
343
|
+
var ze = Array.isArray;
|
|
344
|
+
function u(e) {
|
|
345
|
+
return ze(e);
|
|
346
346
|
}
|
|
347
|
-
function
|
|
347
|
+
function ce(e) {
|
|
348
348
|
{
|
|
349
349
|
var n = typeof Symbol == "function" && Symbol.toStringTag, i = n && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
350
350
|
return i;
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
|
-
function
|
|
353
|
+
function te(e) {
|
|
354
354
|
try {
|
|
355
|
-
return
|
|
355
|
+
return K(e), !1;
|
|
356
356
|
} catch {
|
|
357
357
|
return !0;
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
|
-
function
|
|
360
|
+
function K(e) {
|
|
361
361
|
return "" + e;
|
|
362
362
|
}
|
|
363
|
-
function
|
|
364
|
-
if (
|
|
365
|
-
return
|
|
363
|
+
function Le(e) {
|
|
364
|
+
if (te(e))
|
|
365
|
+
return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ce(e)), K(e);
|
|
366
366
|
}
|
|
367
|
-
var
|
|
367
|
+
var be = E.ReactCurrentOwner, Ve = {
|
|
368
368
|
key: !0,
|
|
369
369
|
ref: !0,
|
|
370
370
|
__self: !0,
|
|
371
371
|
__source: !0
|
|
372
|
-
},
|
|
373
|
-
function
|
|
374
|
-
if (
|
|
372
|
+
}, nr, sr;
|
|
373
|
+
function Cr(e) {
|
|
374
|
+
if (v.call(e, "ref")) {
|
|
375
375
|
var n = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
376
376
|
if (n && n.isReactWarning)
|
|
377
377
|
return !1;
|
|
378
378
|
}
|
|
379
379
|
return e.ref !== void 0;
|
|
380
380
|
}
|
|
381
|
-
function
|
|
382
|
-
if (
|
|
381
|
+
function kr(e) {
|
|
382
|
+
if (v.call(e, "key")) {
|
|
383
383
|
var n = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
384
384
|
if (n && n.isReactWarning)
|
|
385
385
|
return !1;
|
|
386
386
|
}
|
|
387
387
|
return e.key !== void 0;
|
|
388
388
|
}
|
|
389
|
-
function
|
|
390
|
-
typeof e.ref == "string" &&
|
|
389
|
+
function Pr(e, n) {
|
|
390
|
+
typeof e.ref == "string" && be.current;
|
|
391
391
|
}
|
|
392
|
-
function
|
|
392
|
+
function Tr(e, n) {
|
|
393
393
|
{
|
|
394
394
|
var i = function() {
|
|
395
|
-
|
|
395
|
+
nr || (nr = !0, S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", n));
|
|
396
396
|
};
|
|
397
397
|
i.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
398
398
|
get: i,
|
|
@@ -400,10 +400,10 @@ function Ur() {
|
|
|
400
400
|
});
|
|
401
401
|
}
|
|
402
402
|
}
|
|
403
|
-
function
|
|
403
|
+
function Sr(e, n) {
|
|
404
404
|
{
|
|
405
405
|
var i = function() {
|
|
406
|
-
|
|
406
|
+
sr || (sr = !0, S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", n));
|
|
407
407
|
};
|
|
408
408
|
i.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
409
409
|
get: i,
|
|
@@ -411,70 +411,70 @@ function Ur() {
|
|
|
411
411
|
});
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
|
-
var
|
|
415
|
-
var
|
|
414
|
+
var Fr = function(e, n, i, m, j, k, x) {
|
|
415
|
+
var h = {
|
|
416
416
|
// This tag allows us to uniquely identify this as a React Element
|
|
417
417
|
$$typeof: t,
|
|
418
418
|
// Built-in properties that belong on the element
|
|
419
419
|
type: e,
|
|
420
420
|
key: n,
|
|
421
421
|
ref: i,
|
|
422
|
-
props:
|
|
422
|
+
props: x,
|
|
423
423
|
// Record the component responsible for creating this element.
|
|
424
|
-
_owner:
|
|
424
|
+
_owner: k
|
|
425
425
|
};
|
|
426
|
-
return
|
|
426
|
+
return h._store = {}, Object.defineProperty(h._store, "validated", {
|
|
427
427
|
configurable: !1,
|
|
428
428
|
enumerable: !1,
|
|
429
429
|
writable: !0,
|
|
430
430
|
value: !1
|
|
431
|
-
}), Object.defineProperty(
|
|
431
|
+
}), Object.defineProperty(h, "_self", {
|
|
432
432
|
configurable: !1,
|
|
433
433
|
enumerable: !1,
|
|
434
434
|
writable: !1,
|
|
435
|
-
value:
|
|
436
|
-
}), Object.defineProperty(
|
|
435
|
+
value: m
|
|
436
|
+
}), Object.defineProperty(h, "_source", {
|
|
437
437
|
configurable: !1,
|
|
438
438
|
enumerable: !1,
|
|
439
439
|
writable: !1,
|
|
440
|
-
value:
|
|
441
|
-
}), Object.freeze && (Object.freeze(
|
|
440
|
+
value: j
|
|
441
|
+
}), Object.freeze && (Object.freeze(h.props), Object.freeze(h)), h;
|
|
442
442
|
};
|
|
443
|
-
function
|
|
443
|
+
function Or(e, n, i, m, j) {
|
|
444
444
|
{
|
|
445
|
-
var
|
|
446
|
-
i !== void 0 && (
|
|
447
|
-
for (
|
|
448
|
-
|
|
445
|
+
var k, x = {}, h = null, ee = null;
|
|
446
|
+
i !== void 0 && (Le(i), h = "" + i), kr(n) && (Le(n.key), h = "" + n.key), Cr(n) && (ee = n.ref, Pr(n, j));
|
|
447
|
+
for (k in n)
|
|
448
|
+
v.call(n, k) && !Ve.hasOwnProperty(k) && (x[k] = n[k]);
|
|
449
449
|
if (e && e.defaultProps) {
|
|
450
|
-
var
|
|
451
|
-
for (
|
|
452
|
-
|
|
450
|
+
var A = e.defaultProps;
|
|
451
|
+
for (k in A)
|
|
452
|
+
x[k] === void 0 && (x[k] = A[k]);
|
|
453
453
|
}
|
|
454
|
-
if (
|
|
455
|
-
var
|
|
456
|
-
|
|
454
|
+
if (h || ee) {
|
|
455
|
+
var U = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
456
|
+
h && Tr(x, U), ee && Sr(x, U);
|
|
457
457
|
}
|
|
458
|
-
return
|
|
458
|
+
return Fr(e, h, ee, j, m, be.current, x);
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
var
|
|
462
|
-
function
|
|
461
|
+
var Ke = E.ReactCurrentOwner, or = E.ReactDebugCurrentFrame;
|
|
462
|
+
function ke(e) {
|
|
463
463
|
if (e) {
|
|
464
|
-
var n = e._owner, i =
|
|
465
|
-
|
|
464
|
+
var n = e._owner, i = le(e.type, e._source, n ? n.type : null);
|
|
465
|
+
or.setExtraStackFrame(i);
|
|
466
466
|
} else
|
|
467
|
-
|
|
467
|
+
or.setExtraStackFrame(null);
|
|
468
468
|
}
|
|
469
|
-
var
|
|
470
|
-
|
|
471
|
-
function
|
|
469
|
+
var qe;
|
|
470
|
+
qe = !1;
|
|
471
|
+
function Ge(e) {
|
|
472
472
|
return typeof e == "object" && e !== null && e.$$typeof === t;
|
|
473
473
|
}
|
|
474
|
-
function
|
|
474
|
+
function ir() {
|
|
475
475
|
{
|
|
476
|
-
if (
|
|
477
|
-
var e =
|
|
476
|
+
if (Ke.current) {
|
|
477
|
+
var e = w(Ke.current.type);
|
|
478
478
|
if (e)
|
|
479
479
|
return `
|
|
480
480
|
|
|
@@ -483,13 +483,13 @@ Check the render method of \`` + e + "`.";
|
|
|
483
483
|
return "";
|
|
484
484
|
}
|
|
485
485
|
}
|
|
486
|
-
function
|
|
486
|
+
function Wr(e) {
|
|
487
487
|
return "";
|
|
488
488
|
}
|
|
489
|
-
var
|
|
490
|
-
function
|
|
489
|
+
var lr = {};
|
|
490
|
+
function Dr(e) {
|
|
491
491
|
{
|
|
492
|
-
var n =
|
|
492
|
+
var n = ir();
|
|
493
493
|
if (!n) {
|
|
494
494
|
var i = typeof e == "string" ? e : e.displayName || e.name;
|
|
495
495
|
i && (n = `
|
|
@@ -499,39 +499,39 @@ Check the top-level render call using <` + i + ">.");
|
|
|
499
499
|
return n;
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
|
-
function
|
|
502
|
+
function cr(e, n) {
|
|
503
503
|
{
|
|
504
504
|
if (!e._store || e._store.validated || e.key != null)
|
|
505
505
|
return;
|
|
506
506
|
e._store.validated = !0;
|
|
507
|
-
var i =
|
|
508
|
-
if (
|
|
507
|
+
var i = Dr(n);
|
|
508
|
+
if (lr[i])
|
|
509
509
|
return;
|
|
510
|
-
|
|
511
|
-
var
|
|
512
|
-
e && e._owner && e._owner !==
|
|
510
|
+
lr[i] = !0;
|
|
511
|
+
var m = "";
|
|
512
|
+
e && e._owner && e._owner !== Ke.current && (m = " It was passed a child from " + w(e._owner.type) + "."), ke(e), S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', i, m), ke(null);
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
|
-
function
|
|
515
|
+
function dr(e, n) {
|
|
516
516
|
{
|
|
517
517
|
if (typeof e != "object")
|
|
518
518
|
return;
|
|
519
|
-
if (
|
|
519
|
+
if (u(e))
|
|
520
520
|
for (var i = 0; i < e.length; i++) {
|
|
521
|
-
var
|
|
522
|
-
|
|
521
|
+
var m = e[i];
|
|
522
|
+
Ge(m) && cr(m, n);
|
|
523
523
|
}
|
|
524
|
-
else if (
|
|
524
|
+
else if (Ge(e))
|
|
525
525
|
e._store && (e._store.validated = !0);
|
|
526
526
|
else if (e) {
|
|
527
|
-
var
|
|
528
|
-
if (typeof
|
|
529
|
-
for (var
|
|
530
|
-
|
|
527
|
+
var j = se(e);
|
|
528
|
+
if (typeof j == "function" && j !== e.entries)
|
|
529
|
+
for (var k = j.call(e), x; !(x = k.next()).done; )
|
|
530
|
+
Ge(x.value) && cr(x.value, n);
|
|
531
531
|
}
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
|
-
function
|
|
534
|
+
function $r(e) {
|
|
535
535
|
{
|
|
536
536
|
var n = e.type;
|
|
537
537
|
if (n == null || typeof n == "string")
|
|
@@ -541,233 +541,267 @@ Check the top-level render call using <` + i + ">.");
|
|
|
541
541
|
i = n.propTypes;
|
|
542
542
|
else if (typeof n == "object" && (n.$$typeof === y || // Note: Memo only checks outer props here.
|
|
543
543
|
// Inner props are checked in the reconciler.
|
|
544
|
-
n.$$typeof ===
|
|
544
|
+
n.$$typeof === b))
|
|
545
545
|
i = n.propTypes;
|
|
546
546
|
else
|
|
547
547
|
return;
|
|
548
548
|
if (i) {
|
|
549
|
-
var
|
|
550
|
-
|
|
551
|
-
} else if (n.PropTypes !== void 0 && !
|
|
552
|
-
|
|
553
|
-
var
|
|
554
|
-
|
|
549
|
+
var m = w(n);
|
|
550
|
+
Ye(i, e.props, "prop", m, e);
|
|
551
|
+
} else if (n.PropTypes !== void 0 && !qe) {
|
|
552
|
+
qe = !0;
|
|
553
|
+
var j = w(n);
|
|
554
|
+
S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", j || "Unknown");
|
|
555
555
|
}
|
|
556
|
-
typeof n.getDefaultProps == "function" && !n.getDefaultProps.isReactClassApproved &&
|
|
556
|
+
typeof n.getDefaultProps == "function" && !n.getDefaultProps.isReactClassApproved && S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
557
557
|
}
|
|
558
558
|
}
|
|
559
|
-
function
|
|
559
|
+
function Ar(e) {
|
|
560
560
|
{
|
|
561
561
|
for (var n = Object.keys(e.props), i = 0; i < n.length; i++) {
|
|
562
|
-
var
|
|
563
|
-
if (
|
|
564
|
-
|
|
562
|
+
var m = n[i];
|
|
563
|
+
if (m !== "children" && m !== "key") {
|
|
564
|
+
ke(e), S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", m), ke(null);
|
|
565
565
|
break;
|
|
566
566
|
}
|
|
567
567
|
}
|
|
568
|
-
e.ref !== null && (
|
|
568
|
+
e.ref !== null && (ke(e), S("Invalid attribute `ref` supplied to `React.Fragment`."), ke(null));
|
|
569
569
|
}
|
|
570
570
|
}
|
|
571
|
-
var
|
|
572
|
-
function
|
|
571
|
+
var ur = {};
|
|
572
|
+
function mr(e, n, i, m, j, k) {
|
|
573
573
|
{
|
|
574
|
-
var
|
|
575
|
-
if (!
|
|
576
|
-
var
|
|
577
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (
|
|
578
|
-
var
|
|
579
|
-
|
|
580
|
-
var
|
|
581
|
-
e === null ?
|
|
574
|
+
var x = R(e);
|
|
575
|
+
if (!x) {
|
|
576
|
+
var h = "";
|
|
577
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (h += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
578
|
+
var ee = Wr();
|
|
579
|
+
ee ? h += ee : h += ir();
|
|
580
|
+
var A;
|
|
581
|
+
e === null ? A = "null" : u(e) ? A = "array" : e !== void 0 && e.$$typeof === t ? (A = "<" + (w(e.type) || "Unknown") + " />", h = " Did you accidentally export a JSX literal instead of a component?") : A = typeof e, S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", A, h);
|
|
582
582
|
}
|
|
583
|
-
var
|
|
584
|
-
if (
|
|
585
|
-
return
|
|
586
|
-
if (
|
|
587
|
-
var
|
|
588
|
-
if (
|
|
589
|
-
if (
|
|
590
|
-
if (
|
|
591
|
-
for (var
|
|
592
|
-
|
|
593
|
-
Object.freeze && Object.freeze(
|
|
583
|
+
var U = Or(e, n, i, j, k);
|
|
584
|
+
if (U == null)
|
|
585
|
+
return U;
|
|
586
|
+
if (x) {
|
|
587
|
+
var de = n.children;
|
|
588
|
+
if (de !== void 0)
|
|
589
|
+
if (m)
|
|
590
|
+
if (u(de)) {
|
|
591
|
+
for (var Pe = 0; Pe < de.length; Pe++)
|
|
592
|
+
dr(de[Pe], e);
|
|
593
|
+
Object.freeze && Object.freeze(de);
|
|
594
594
|
} else
|
|
595
|
-
|
|
595
|
+
S("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
596
596
|
else
|
|
597
|
-
|
|
597
|
+
dr(de, e);
|
|
598
598
|
}
|
|
599
|
-
if (
|
|
600
|
-
var
|
|
601
|
-
return
|
|
602
|
-
}),
|
|
603
|
-
if (!
|
|
604
|
-
var
|
|
605
|
-
|
|
599
|
+
if (v.call(n, "key")) {
|
|
600
|
+
var Re = w(e), ae = Object.keys(n).filter(function(Yr) {
|
|
601
|
+
return Yr !== "key";
|
|
602
|
+
}), Je = ae.length > 0 ? "{key: someKey, " + ae.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
603
|
+
if (!ur[Re + Je]) {
|
|
604
|
+
var Br = ae.length > 0 ? "{" + ae.join(": ..., ") + ": ...}" : "{}";
|
|
605
|
+
S(`A props object containing a "key" prop is being spread into JSX:
|
|
606
606
|
let props = %s;
|
|
607
607
|
<%s {...props} />
|
|
608
608
|
React keys must be passed directly to JSX without using spread:
|
|
609
609
|
let props = %s;
|
|
610
|
-
<%s key={someKey} {...props} />`,
|
|
610
|
+
<%s key={someKey} {...props} />`, Je, Re, Br, Re), ur[Re + Je] = !0;
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
|
-
return e === o ?
|
|
613
|
+
return e === o ? Ar(U) : $r(U), U;
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
|
-
function
|
|
617
|
-
return
|
|
616
|
+
function Mr(e, n, i) {
|
|
617
|
+
return mr(e, n, i, !0);
|
|
618
618
|
}
|
|
619
|
-
function
|
|
620
|
-
return
|
|
619
|
+
function Ir(e, n, i) {
|
|
620
|
+
return mr(e, n, i, !1);
|
|
621
621
|
}
|
|
622
|
-
var
|
|
623
|
-
|
|
624
|
-
}()),
|
|
622
|
+
var Ur = Ir, Lr = Mr;
|
|
623
|
+
Ae.Fragment = o, Ae.jsx = Ur, Ae.jsxs = Lr;
|
|
624
|
+
}()), Ae;
|
|
625
625
|
}
|
|
626
|
-
process.env.NODE_ENV === "production" ?
|
|
627
|
-
var a =
|
|
628
|
-
function
|
|
626
|
+
process.env.NODE_ENV === "production" ? rr.exports = zr() : rr.exports = Vr();
|
|
627
|
+
var a = rr.exports;
|
|
628
|
+
function _r(r) {
|
|
629
629
|
var t, s, o = "";
|
|
630
630
|
if (typeof r == "string" || typeof r == "number") o += r;
|
|
631
631
|
else if (typeof r == "object") if (Array.isArray(r)) {
|
|
632
632
|
var l = r.length;
|
|
633
|
-
for (t = 0; t < l; t++) r[t] && (s =
|
|
633
|
+
for (t = 0; t < l; t++) r[t] && (s = _r(r[t])) && (o && (o += " "), o += s);
|
|
634
634
|
} else for (s in r) r[s] && (o && (o += " "), o += s);
|
|
635
635
|
return o;
|
|
636
636
|
}
|
|
637
|
-
function
|
|
638
|
-
for (var r, t, s = 0, o = "", l = arguments.length; s < l; s++) (r = arguments[s]) && (t =
|
|
637
|
+
function Z() {
|
|
638
|
+
for (var r, t, s = 0, o = "", l = arguments.length; s < l; s++) (r = arguments[s]) && (t = _r(r)) && (o && (o += " "), o += t);
|
|
639
639
|
return o;
|
|
640
640
|
}
|
|
641
|
-
const
|
|
642
|
-
let
|
|
643
|
-
const
|
|
644
|
-
|
|
645
|
-
},
|
|
641
|
+
const Kr = "https://core.spreedly.com/iframe/iframe-v1.min.js", qr = "https://cdn.e2e.movmo.io";
|
|
642
|
+
let Te = {};
|
|
643
|
+
const wt = (r) => {
|
|
644
|
+
Te = { ...Te, ...r };
|
|
645
|
+
}, He = (r) => {
|
|
646
646
|
var s;
|
|
647
647
|
const t = globalThis.process;
|
|
648
648
|
return (s = t == null ? void 0 : t.env) == null ? void 0 : s[r];
|
|
649
|
-
},
|
|
650
|
-
baseUrl:
|
|
651
|
-
spreedlyScriptUrl:
|
|
652
|
-
iconCdnBaseUrl:
|
|
653
|
-
|
|
649
|
+
}, De = () => ({
|
|
650
|
+
baseUrl: Te.baseUrl ?? He("REACT_APP_MOVMO_API_URL") ?? "",
|
|
651
|
+
spreedlyScriptUrl: Te.spreedlyScriptUrl ?? He("REACT_APP_SPREEDLY_SCRIPT_URL") ?? Kr,
|
|
652
|
+
iconCdnBaseUrl: Te.iconCdnBaseUrl ?? He("REACT_APP_MOVMO_ICON_CDN_URL") ?? qr,
|
|
653
|
+
fetch: Te.fetch ?? (typeof globalThis < "u" && typeof globalThis.fetch == "function" ? globalThis.fetch.bind(globalThis) : (() => {
|
|
654
|
+
throw new Error("@movmo_app/payments: no fetch available");
|
|
655
|
+
})())
|
|
656
|
+
}), tr = (r) => ({
|
|
654
657
|
id: r.id,
|
|
655
658
|
last4: r.last4,
|
|
656
659
|
brand: r.brand,
|
|
657
660
|
expMonth: r.expMonth,
|
|
658
661
|
expYear: r.expYear,
|
|
659
662
|
isDefault: r.isDefault
|
|
660
|
-
}),
|
|
663
|
+
}), Se = {
|
|
661
664
|
Accept: "application/json",
|
|
662
665
|
"Content-Type": "application/json"
|
|
663
|
-
},
|
|
664
|
-
const { baseUrl: t } =
|
|
666
|
+
}, Fe = (r) => {
|
|
667
|
+
const { baseUrl: t } = De();
|
|
665
668
|
if (!t)
|
|
666
669
|
throw new Error(
|
|
667
670
|
"@movmo_app/payments: baseUrl is not configured. Call setPaymentsConfig({ baseUrl }) at app boot, or set REACT_APP_MOVMO_API_URL."
|
|
668
671
|
);
|
|
669
672
|
return `${t}${r}`;
|
|
670
|
-
},
|
|
673
|
+
}, Oe = (r, t) => {
|
|
674
|
+
const { fetch: s } = De();
|
|
675
|
+
return s(r, t);
|
|
676
|
+
}, We = async (r, t) => {
|
|
671
677
|
try {
|
|
672
678
|
return (await r.json()).message || t;
|
|
673
679
|
} catch {
|
|
674
680
|
return t;
|
|
675
681
|
}
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
}
|
|
686
|
-
|
|
687
|
-
|
|
682
|
+
};
|
|
683
|
+
let Me = null;
|
|
684
|
+
const ar = () => {
|
|
685
|
+
if (Me) return Me;
|
|
686
|
+
const r = (async () => {
|
|
687
|
+
const t = await Oe(Fe("/v1/payments/tokenization-session"), {
|
|
688
|
+
method: "GET",
|
|
689
|
+
headers: Se,
|
|
690
|
+
credentials: "include"
|
|
691
|
+
});
|
|
692
|
+
if (!t.ok)
|
|
693
|
+
throw new Error(
|
|
694
|
+
await We(t, `Failed to fetch tokenization session (${t.status})`)
|
|
695
|
+
);
|
|
696
|
+
return await t.json();
|
|
697
|
+
})();
|
|
698
|
+
return Me = r, r.finally(() => {
|
|
699
|
+
Me === r && (Me = null);
|
|
700
|
+
}).catch(() => {
|
|
701
|
+
}), r;
|
|
702
|
+
}, Gr = (r) => typeof r.brand == "string" && typeof r.last4 == "string" && typeof r.expMonth == "number" && typeof r.expYear == "number", Jr = async (r, t, s) => {
|
|
703
|
+
const o = await Oe(
|
|
704
|
+
Fe(`/v1/users/${encodeURIComponent(r)}/payment-methods/from-token`),
|
|
688
705
|
{
|
|
689
706
|
method: "POST",
|
|
690
|
-
headers:
|
|
707
|
+
headers: Se,
|
|
691
708
|
credentials: "include",
|
|
692
709
|
body: JSON.stringify({ tokenizedPaymentMethodId: t, isDefault: s })
|
|
693
710
|
}
|
|
694
711
|
);
|
|
695
712
|
if (!o.ok)
|
|
696
|
-
throw new Error(await
|
|
713
|
+
throw new Error(await We(o, `Failed to save payment method (${o.status})`));
|
|
697
714
|
const l = await o.json();
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
const
|
|
715
|
+
if (Gr(l))
|
|
716
|
+
return tr(l);
|
|
717
|
+
const c = await Oe(
|
|
718
|
+
Fe(
|
|
719
|
+
`/v1/users/${encodeURIComponent(r)}/payment-methods/${encodeURIComponent(l.id)}`
|
|
720
|
+
),
|
|
721
|
+
{
|
|
722
|
+
method: "GET",
|
|
723
|
+
headers: Se,
|
|
724
|
+
credentials: "include"
|
|
725
|
+
}
|
|
726
|
+
);
|
|
727
|
+
if (!c.ok)
|
|
728
|
+
throw new Error(
|
|
729
|
+
await We(c, `Failed to fetch saved payment method (${c.status})`)
|
|
730
|
+
);
|
|
731
|
+
const f = await c.json();
|
|
732
|
+
return tr(f);
|
|
733
|
+
}, Hr = async (r) => {
|
|
734
|
+
const t = await Oe(Fe(`/v1/users/${encodeURIComponent(r)}/payment-methods`), {
|
|
701
735
|
method: "GET",
|
|
702
|
-
headers:
|
|
736
|
+
headers: Se,
|
|
703
737
|
credentials: "include"
|
|
704
738
|
});
|
|
705
739
|
if (!t.ok)
|
|
706
|
-
throw new Error(await
|
|
707
|
-
return (await t.json() ?? []).map(
|
|
708
|
-
},
|
|
709
|
-
const s = await
|
|
710
|
-
|
|
740
|
+
throw new Error(await We(t, `Failed to fetch payment methods (${t.status})`));
|
|
741
|
+
return (await t.json() ?? []).map(tr);
|
|
742
|
+
}, Zr = async (r, t) => {
|
|
743
|
+
const s = await Oe(
|
|
744
|
+
Fe(
|
|
711
745
|
`/v1/users/${encodeURIComponent(r)}/payment-methods/${encodeURIComponent(t)}`
|
|
712
746
|
),
|
|
713
747
|
{
|
|
714
748
|
method: "DELETE",
|
|
715
|
-
headers:
|
|
749
|
+
headers: Se,
|
|
716
750
|
credentials: "include"
|
|
717
751
|
}
|
|
718
752
|
);
|
|
719
753
|
if (!s.ok)
|
|
720
|
-
throw new Error(await
|
|
721
|
-
},
|
|
722
|
-
const o = await
|
|
723
|
-
|
|
754
|
+
throw new Error(await We(s, `Failed to delete payment method (${s.status})`));
|
|
755
|
+
}, Xr = async (r, t, s) => {
|
|
756
|
+
const o = await Oe(
|
|
757
|
+
Fe(
|
|
724
758
|
`/v1/users/${encodeURIComponent(r)}/payment-methods/${encodeURIComponent(t)}`
|
|
725
759
|
),
|
|
726
760
|
{
|
|
727
761
|
method: "PUT",
|
|
728
|
-
headers:
|
|
762
|
+
headers: Se,
|
|
729
763
|
credentials: "include",
|
|
730
764
|
body: JSON.stringify(s)
|
|
731
765
|
}
|
|
732
766
|
);
|
|
733
767
|
if (!o.ok)
|
|
734
|
-
throw new Error(await
|
|
735
|
-
},
|
|
768
|
+
throw new Error(await We(o, `Failed to update payment method (${o.status})`));
|
|
769
|
+
}, Qr = {
|
|
736
770
|
visa: "visa",
|
|
737
771
|
master: "mastercard",
|
|
738
772
|
mastercard: "mastercard",
|
|
739
773
|
american_express: "amex",
|
|
740
774
|
amex: "amex",
|
|
741
775
|
discover: "discover"
|
|
742
|
-
},
|
|
776
|
+
}, et = 28, Ce = ({
|
|
743
777
|
brand: r,
|
|
744
778
|
className: t,
|
|
745
779
|
width: s = 46
|
|
746
780
|
}) => {
|
|
747
|
-
const o =
|
|
781
|
+
const o = r ? Qr[r.toLowerCase()] ?? "credit-card" : "credit-card", l = Math.max(s, et), c = Math.round(l * 24 / 34), { iconCdnBaseUrl: f } = De();
|
|
748
782
|
return /* @__PURE__ */ a.jsx(
|
|
749
783
|
"img",
|
|
750
784
|
{
|
|
751
|
-
src: `${
|
|
785
|
+
src: `${f}/website/assets/icons/payments/${o}.svg`,
|
|
752
786
|
alt: o === "credit-card" ? "card" : `${o} card`,
|
|
753
787
|
"data-testid": `card-brand-${r.toLowerCase()}`,
|
|
754
788
|
className: t,
|
|
755
789
|
width: l,
|
|
756
|
-
height:
|
|
790
|
+
height: c,
|
|
757
791
|
loading: "lazy"
|
|
758
792
|
}
|
|
759
793
|
);
|
|
760
794
|
};
|
|
761
|
-
let
|
|
762
|
-
const
|
|
795
|
+
let Ie = null;
|
|
796
|
+
const rt = () => {
|
|
763
797
|
if (typeof window > "u")
|
|
764
798
|
return Promise.reject(new Error("Spreedly can only be loaded in a browser environment."));
|
|
765
799
|
if (window.Spreedly)
|
|
766
800
|
return Promise.resolve(window.Spreedly);
|
|
767
|
-
if (
|
|
768
|
-
return
|
|
769
|
-
const { spreedlyScriptUrl: r } =
|
|
770
|
-
return
|
|
801
|
+
if (Ie)
|
|
802
|
+
return Ie;
|
|
803
|
+
const { spreedlyScriptUrl: r } = De();
|
|
804
|
+
return Ie = new Promise((t, s) => {
|
|
771
805
|
const o = document.querySelector(
|
|
772
806
|
`script[src="${r}"]`
|
|
773
807
|
), l = () => {
|
|
@@ -787,122 +821,144 @@ const Hr = () => {
|
|
|
787
821
|
);
|
|
788
822
|
return;
|
|
789
823
|
}
|
|
790
|
-
const
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
}, document.head.appendChild(
|
|
824
|
+
const c = document.createElement("script");
|
|
825
|
+
c.src = r, c.async = !0, c.onload = l, c.onerror = () => {
|
|
826
|
+
c.remove(), s(new Error("Failed to load Spreedly iframe script."));
|
|
827
|
+
}, document.head.appendChild(c);
|
|
794
828
|
}).catch((t) => {
|
|
795
|
-
throw
|
|
796
|
-
}),
|
|
797
|
-
},
|
|
829
|
+
throw Ie = null, t;
|
|
830
|
+
}), Ie;
|
|
831
|
+
}, tt = "movmo-card-number", at = "movmo-card-cvv", nt = (r) => ({
|
|
798
832
|
first_name: r.firstName,
|
|
799
833
|
last_name: r.lastName,
|
|
800
834
|
month: r.month,
|
|
801
835
|
year: r.year,
|
|
802
836
|
...r.email ? { email: r.email } : {},
|
|
803
837
|
...r.zip ? { zip: r.zip } : {}
|
|
804
|
-
}),
|
|
838
|
+
}), st = (r = {}) => {
|
|
805
839
|
const {
|
|
806
|
-
numberEl: t =
|
|
807
|
-
cvvEl: s =
|
|
840
|
+
numberEl: t = tt,
|
|
841
|
+
cvvEl: s = at,
|
|
808
842
|
onCardTokenized: o,
|
|
809
843
|
onFieldErrors: l,
|
|
810
|
-
onValidityChange:
|
|
811
|
-
onBrandChange:
|
|
812
|
-
} = r, [
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
}, [o]),
|
|
816
|
-
|
|
817
|
-
}, [l]),
|
|
818
|
-
|
|
819
|
-
}, [
|
|
820
|
-
|
|
821
|
-
}, [
|
|
822
|
-
const
|
|
823
|
-
|
|
824
|
-
let
|
|
825
|
-
return y("loading"),
|
|
844
|
+
onValidityChange: c,
|
|
845
|
+
onBrandChange: f
|
|
846
|
+
} = r, [p, y] = P("idle"), [W, N] = P(null), [b, D] = P({ number: !1, cvv: !1 }), [M, X] = P(null), [T, se] = P({ number: !1, cvv: !1 }), E = B(null), S = B(o), q = B(l), ue = B(c), re = B(f);
|
|
847
|
+
L(() => {
|
|
848
|
+
S.current = o;
|
|
849
|
+
}, [o]), L(() => {
|
|
850
|
+
q.current = l;
|
|
851
|
+
}, [l]), L(() => {
|
|
852
|
+
ue.current = c;
|
|
853
|
+
}, [c]), L(() => {
|
|
854
|
+
re.current = f;
|
|
855
|
+
}, [f]);
|
|
856
|
+
const g = B({ number: !1, cvv: !1 });
|
|
857
|
+
L(() => {
|
|
858
|
+
let I = !1;
|
|
859
|
+
return y("loading"), N(null), D({ number: !1, cvv: !1 }), X(null), g.current = { number: !1, cvv: !1 }, (async () => {
|
|
826
860
|
try {
|
|
827
|
-
const [
|
|
828
|
-
|
|
829
|
-
|
|
861
|
+
const [R, d] = await Promise.all([
|
|
862
|
+
ar(),
|
|
863
|
+
rt()
|
|
830
864
|
]);
|
|
831
|
-
if (
|
|
832
|
-
|
|
833
|
-
var
|
|
834
|
-
if (!
|
|
865
|
+
if (I) return;
|
|
866
|
+
E.current = d, d.on("ready", () => {
|
|
867
|
+
var C, w, $, J, Y, Q;
|
|
868
|
+
if (!I) {
|
|
835
869
|
y("ready");
|
|
836
870
|
try {
|
|
837
|
-
(
|
|
871
|
+
(C = d.setFieldType) == null || C.call(d, "number", "tel"), (w = d.setFieldType) == null || w.call(d, "cvv", "tel");
|
|
872
|
+
} catch {
|
|
873
|
+
}
|
|
874
|
+
try {
|
|
875
|
+
typeof d.setNumberFormat == "function" ? d.setNumberFormat("prettyFormat") : console.warn(
|
|
876
|
+
"@movmo_app/payments: Spreedly.setNumberFormat is missing — card-number digits will not be space-grouped."
|
|
877
|
+
);
|
|
878
|
+
} catch (z) {
|
|
879
|
+
console.warn("@movmo_app/payments: setNumberFormat failed", z);
|
|
880
|
+
}
|
|
881
|
+
try {
|
|
882
|
+
($ = d.setPlaceholder) == null || $.call(d, "number", "Card number"), (J = d.setPlaceholder) == null || J.call(d, "cvv", "CVV");
|
|
883
|
+
const z = 'box-sizing: border-box;width: 100%;height: 100%;margin: 0;padding: 0;border: 0;background: transparent;outline: none;font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;font-size: 14px;font-weight: 400;line-height: 20px;color: rgb(28 25 23);letter-spacing: 0;vertical-align: middle;';
|
|
884
|
+
(Y = d.setStyle) == null || Y.call(d, "number", z), (Q = d.setStyle) == null || Q.call(d, "cvv", z);
|
|
838
885
|
} catch {
|
|
839
886
|
}
|
|
840
887
|
}
|
|
841
|
-
}),
|
|
842
|
-
var
|
|
843
|
-
(
|
|
844
|
-
}),
|
|
845
|
-
var
|
|
846
|
-
(
|
|
847
|
-
}),
|
|
848
|
-
var
|
|
849
|
-
if (
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
888
|
+
}), d.on("paymentMethod", (C) => {
|
|
889
|
+
var w;
|
|
890
|
+
(w = S.current) == null || w.call(S, C);
|
|
891
|
+
}), d.on("errors", (C) => {
|
|
892
|
+
var w;
|
|
893
|
+
(w = q.current) == null || w.call(q, C);
|
|
894
|
+
}), d.on("fieldEvent", (C, w, $, J) => {
|
|
895
|
+
var z;
|
|
896
|
+
if (I) return;
|
|
897
|
+
if (w === "focus") {
|
|
898
|
+
se((_) => _[C] ? _ : { ..._, [C]: !0 });
|
|
899
|
+
return;
|
|
900
|
+
}
|
|
901
|
+
if (w === "blur") {
|
|
902
|
+
se((_) => _[C] ? { ..._, [C]: !1 } : _);
|
|
903
|
+
return;
|
|
904
|
+
}
|
|
905
|
+
if (w !== "input") return;
|
|
906
|
+
const Y = J ?? {};
|
|
907
|
+
if (C === "number") {
|
|
908
|
+
if (Y.numberLength === 0)
|
|
909
|
+
X((_) => {
|
|
910
|
+
var F;
|
|
911
|
+
return _ !== null && ((F = re.current) == null || F.call(re, null)), null;
|
|
856
912
|
});
|
|
857
|
-
else if (
|
|
858
|
-
const
|
|
859
|
-
|
|
860
|
-
var
|
|
861
|
-
return
|
|
913
|
+
else if (Y.cardType !== void 0) {
|
|
914
|
+
const _ = Y.cardType || null;
|
|
915
|
+
X((F) => {
|
|
916
|
+
var fe;
|
|
917
|
+
return F !== _ && ((fe = re.current) == null || fe.call(re, _)), _;
|
|
862
918
|
});
|
|
863
919
|
}
|
|
864
920
|
}
|
|
865
|
-
const
|
|
866
|
-
if (typeof
|
|
867
|
-
const
|
|
868
|
-
(
|
|
921
|
+
const Q = C === "number" ? typeof Y.validNumber == "boolean" ? Y.validNumber : void 0 : typeof Y.validCvv == "boolean" ? Y.validCvv : void 0;
|
|
922
|
+
if (typeof Q == "boolean") {
|
|
923
|
+
const _ = g.current, F = C === "number" ? { ..._, number: Q } : { ..._, cvv: Q };
|
|
924
|
+
(F.number !== _.number || F.cvv !== _.cvv) && (g.current = F, D(F), (z = ue.current) == null || z.call(ue, F));
|
|
869
925
|
}
|
|
870
|
-
}),
|
|
871
|
-
var
|
|
872
|
-
const
|
|
873
|
-
(
|
|
874
|
-
}),
|
|
926
|
+
}), d.on("consoleError", (C) => {
|
|
927
|
+
var $;
|
|
928
|
+
const w = C instanceof Error ? C.message : "An unexpected error occurred while securing your card.";
|
|
929
|
+
($ = q.current) == null || $.call(q, [{ message: w }]);
|
|
930
|
+
}), d.init(R.environmentKey, {
|
|
875
931
|
numberEl: t,
|
|
876
932
|
cvvEl: s,
|
|
877
|
-
nonce:
|
|
878
|
-
timestamp: String(
|
|
879
|
-
certificateToken:
|
|
880
|
-
signature:
|
|
933
|
+
nonce: R.nonce,
|
|
934
|
+
timestamp: String(R.timestamp),
|
|
935
|
+
certificateToken: R.certificateToken,
|
|
936
|
+
signature: R.signature
|
|
881
937
|
});
|
|
882
|
-
} catch (
|
|
883
|
-
if (
|
|
884
|
-
const
|
|
885
|
-
|
|
938
|
+
} catch (R) {
|
|
939
|
+
if (I) return;
|
|
940
|
+
const d = R instanceof Error ? R.message : "Failed to initialize card form.";
|
|
941
|
+
N(d), y("error");
|
|
886
942
|
}
|
|
887
943
|
})(), () => {
|
|
888
|
-
var
|
|
889
|
-
|
|
944
|
+
var R, d;
|
|
945
|
+
I = !0;
|
|
890
946
|
try {
|
|
891
|
-
(
|
|
947
|
+
(d = (R = E.current) == null ? void 0 : R.removeHandlers) == null || d.call(R);
|
|
892
948
|
} catch {
|
|
893
949
|
}
|
|
894
|
-
|
|
950
|
+
E.current = null;
|
|
895
951
|
};
|
|
896
952
|
}, [t, s]);
|
|
897
|
-
const
|
|
898
|
-
var
|
|
899
|
-
(
|
|
900
|
-
}, []),
|
|
901
|
-
var
|
|
902
|
-
(
|
|
953
|
+
const ne = H((I) => {
|
|
954
|
+
var R;
|
|
955
|
+
(R = E.current) == null || R.tokenizeCreditCard(nt(I));
|
|
956
|
+
}, []), ye = H((I) => {
|
|
957
|
+
var R, d;
|
|
958
|
+
(d = (R = E.current) == null ? void 0 : R.transferFocus) == null || d.call(R, I);
|
|
903
959
|
}, []);
|
|
904
|
-
return { status:
|
|
905
|
-
},
|
|
960
|
+
return { status: p, error: W, tokenize: ne, validity: b, brand: M, focused: T, focusField: ye };
|
|
961
|
+
}, Ze = "h-11 w-full rounded-md border border-grayWarm-300 bg-white px-3 py-2 text-sm text-grayWarm-900 placeholder:text-grayWarm-400 outline-none focus:border-grayWarm-950 focus:shadow-[0_0_0_1px_#1c1917]", yr = "flex h-11 w-full items-center gap-2 rounded-md border bg-white px-3 py-2 transition-shadow", vr = "border-grayWarm-950 shadow-[0_0_0_1px_#1c1917]", hr = "border-grayWarm-300", ot = (r) => {
|
|
906
962
|
const t = r.trim();
|
|
907
963
|
if (!t) return { firstName: "", lastName: "" };
|
|
908
964
|
const s = t.lastIndexOf(" ");
|
|
@@ -910,117 +966,155 @@ const Hr = () => {
|
|
|
910
966
|
firstName: t.slice(0, s).trim(),
|
|
911
967
|
lastName: t.slice(s + 1).trim()
|
|
912
968
|
};
|
|
913
|
-
},
|
|
969
|
+
}, Nr = (r) => {
|
|
914
970
|
const t = r.replace(/\D/g, "");
|
|
915
971
|
if (t.length < 4) return { month: "", year: "" };
|
|
916
972
|
const s = t.slice(0, 2), o = t.slice(2), l = o.length === 2 ? `20${o}` : o.slice(0, 4);
|
|
917
973
|
return { month: s, year: l };
|
|
918
|
-
},
|
|
974
|
+
}, it = (r) => {
|
|
919
975
|
const t = r.replace(/\D/g, "").slice(0, 4);
|
|
920
976
|
return t.length <= 2 ? t : `${t.slice(0, 2)} / ${t.slice(2)}`;
|
|
921
|
-
},
|
|
922
|
-
const { month: t, year: s } =
|
|
977
|
+
}, Xe = (r) => {
|
|
978
|
+
const { month: t, year: s } = Nr(r);
|
|
923
979
|
if (!t || !s) return !1;
|
|
924
980
|
const o = parseInt(t, 10), l = parseInt(s, 10);
|
|
925
981
|
if (isNaN(o) || o < 1 || o > 12) return !1;
|
|
926
|
-
const
|
|
927
|
-
return !(l <
|
|
928
|
-
},
|
|
982
|
+
const c = /* @__PURE__ */ new Date();
|
|
983
|
+
return !(l < c.getFullYear() || l > c.getFullYear() + 20 || l === c.getFullYear() && o < c.getMonth() + 1);
|
|
984
|
+
}, Qe = (r) => /^\d{5}(-\d{4})?$/.test(r.trim()), lt = (r) => {
|
|
929
985
|
const t = r.replace(/[^\d]/g, "").slice(0, 9);
|
|
930
986
|
return t.length <= 5 ? t : `${t.slice(0, 5)}-${t.slice(5)}`;
|
|
931
|
-
},
|
|
987
|
+
}, Rr = ({
|
|
932
988
|
userId: r,
|
|
933
989
|
onSuccess: t,
|
|
934
990
|
onError: s,
|
|
935
991
|
isDefault: o = !1,
|
|
936
992
|
className: l,
|
|
937
|
-
defaultCardholderName:
|
|
938
|
-
defaultCardholderFirstName:
|
|
939
|
-
defaultCardholderLastName:
|
|
993
|
+
defaultCardholderName: c,
|
|
994
|
+
defaultCardholderFirstName: f = "",
|
|
995
|
+
defaultCardholderLastName: p = "",
|
|
940
996
|
autoSave: y = !1,
|
|
941
|
-
formId:
|
|
942
|
-
hideInternalSaveButton:
|
|
943
|
-
onCanSubmitChange:
|
|
997
|
+
formId: W = "movmo-card-form",
|
|
998
|
+
hideInternalSaveButton: N = !1,
|
|
999
|
+
onCanSubmitChange: b,
|
|
1000
|
+
onSavingChange: D,
|
|
1001
|
+
autoFocus: M
|
|
944
1002
|
}) => {
|
|
945
|
-
const
|
|
946
|
-
async (
|
|
947
|
-
|
|
1003
|
+
const X = c ?? [f, p].filter(Boolean).join(" "), [T, se] = P(X), [E, S] = P(""), [q, ue] = P(""), [re, g] = P("idle"), ne = B(!1), ye = H(
|
|
1004
|
+
async (v) => {
|
|
1005
|
+
g("saving");
|
|
948
1006
|
try {
|
|
949
|
-
const
|
|
950
|
-
|
|
951
|
-
} catch (
|
|
952
|
-
const
|
|
953
|
-
|
|
1007
|
+
const O = await Jr(r, v, o);
|
|
1008
|
+
g("ready"), t(O);
|
|
1009
|
+
} catch (O) {
|
|
1010
|
+
const V = O instanceof Error ? O.message : "Failed to save payment method.";
|
|
1011
|
+
g("ready"), ne.current = !1, s(V);
|
|
954
1012
|
}
|
|
955
1013
|
},
|
|
956
1014
|
[r, o, t, s]
|
|
957
|
-
),
|
|
958
|
-
(
|
|
959
|
-
const
|
|
960
|
-
|
|
1015
|
+
), I = H(
|
|
1016
|
+
(v) => {
|
|
1017
|
+
const O = v.map((V) => V.message).filter(Boolean).join("; ") || "Card validation failed.";
|
|
1018
|
+
g((V) => V === "tokenizing" ? "ready" : V), ne.current = !1, s(O);
|
|
961
1019
|
},
|
|
962
1020
|
[s]
|
|
963
|
-
),
|
|
1021
|
+
), R = Ue(
|
|
964
1022
|
() => ({
|
|
965
|
-
onCardTokenized:
|
|
966
|
-
onFieldErrors:
|
|
1023
|
+
onCardTokenized: ye,
|
|
1024
|
+
onFieldErrors: I
|
|
967
1025
|
}),
|
|
968
|
-
[
|
|
1026
|
+
[ye, I]
|
|
969
1027
|
), {
|
|
970
|
-
status:
|
|
971
|
-
error:
|
|
972
|
-
tokenize:
|
|
973
|
-
validity:
|
|
974
|
-
brand:
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
}, [
|
|
981
|
-
const
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
1028
|
+
status: d,
|
|
1029
|
+
error: C,
|
|
1030
|
+
tokenize: w,
|
|
1031
|
+
validity: $,
|
|
1032
|
+
brand: J,
|
|
1033
|
+
focused: Y,
|
|
1034
|
+
focusField: Q
|
|
1035
|
+
} = st(R), z = B(!1);
|
|
1036
|
+
L(() => {
|
|
1037
|
+
!M || d !== "ready" || z.current || (z.current = !0, Q(M));
|
|
1038
|
+
}, [M, d, Q]);
|
|
1039
|
+
const _ = T.trim().split(/\s+/).length >= 2, F = Xe(E), fe = Qe(q), ve = B(!1), ge = B(!1), we = B(!1), me = B(null), je = B(null);
|
|
1040
|
+
L(() => {
|
|
1041
|
+
var v;
|
|
1042
|
+
$.cvv ? ge.current || (ge.current = !0, (v = me.current) == null || v.focus()) : ge.current = !1;
|
|
1043
|
+
}, [$.cvv]);
|
|
1044
|
+
const he = !_ || !F || !fe || !$.number || !$.cvv, G = re === "tokenizing" || re === "saving", oe = d === "ready" && !G && !he, ie = B(b);
|
|
1045
|
+
L(() => {
|
|
1046
|
+
ie.current = b;
|
|
1047
|
+
}, [b]), L(() => {
|
|
1048
|
+
var v;
|
|
1049
|
+
(v = ie.current) == null || v.call(ie, oe);
|
|
1050
|
+
}, [oe]);
|
|
1051
|
+
const xe = B(D);
|
|
1052
|
+
L(() => {
|
|
1053
|
+
xe.current = D;
|
|
1054
|
+
}, [D]), L(() => {
|
|
1055
|
+
var v;
|
|
1056
|
+
(v = xe.current) == null || v.call(xe, G);
|
|
1057
|
+
}, [G]);
|
|
1058
|
+
const Ee = H(() => {
|
|
1059
|
+
const { firstName: v, lastName: O } = ot(T), { month: V, year: pe } = Nr(E);
|
|
1060
|
+
g("tokenizing"), w({ firstName: v, lastName: O, month: V, year: pe, zip: q.trim() });
|
|
1061
|
+
}, [T, E, q, w]);
|
|
1062
|
+
L(() => {
|
|
1063
|
+
if (!y || !oe || ne.current) return;
|
|
1064
|
+
const v = setTimeout(() => {
|
|
1065
|
+
ne.current = !0, Ee();
|
|
996
1066
|
}, 1200);
|
|
997
|
-
return () => clearTimeout(
|
|
998
|
-
}, [y,
|
|
999
|
-
const
|
|
1000
|
-
|
|
1001
|
-
},
|
|
1002
|
-
return
|
|
1067
|
+
return () => clearTimeout(v);
|
|
1068
|
+
}, [y, oe, Ee]);
|
|
1069
|
+
const Ne = (v) => {
|
|
1070
|
+
v.preventDefault(), oe && Ee();
|
|
1071
|
+
}, _e = d !== "ready" || G, le = B(s);
|
|
1072
|
+
return L(() => {
|
|
1073
|
+
le.current = s;
|
|
1074
|
+
}, [s]), L(() => {
|
|
1075
|
+
var v;
|
|
1076
|
+
C && ((v = le.current) == null || v.call(le, C));
|
|
1077
|
+
}, [C]), /* @__PURE__ */ a.jsxs(
|
|
1003
1078
|
"form",
|
|
1004
1079
|
{
|
|
1005
|
-
id:
|
|
1006
|
-
onSubmit:
|
|
1007
|
-
className:
|
|
1080
|
+
id: W,
|
|
1081
|
+
onSubmit: Ne,
|
|
1082
|
+
className: Z("flex w-full flex-col gap-3", l),
|
|
1008
1083
|
"data-testid": "movmo-card-form",
|
|
1009
1084
|
children: [
|
|
1010
1085
|
/* @__PURE__ */ a.jsxs("div", { children: [
|
|
1011
1086
|
/* @__PURE__ */ a.jsx("span", { id: "movmo-card-number-label", className: "sr-only", children: "Card number" }),
|
|
1012
|
-
/* @__PURE__ */ a.jsxs(
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
"
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1087
|
+
/* @__PURE__ */ a.jsxs(
|
|
1088
|
+
"div",
|
|
1089
|
+
{
|
|
1090
|
+
className: Z(
|
|
1091
|
+
yr,
|
|
1092
|
+
Y.number ? vr : hr
|
|
1093
|
+
),
|
|
1094
|
+
children: [
|
|
1095
|
+
/* @__PURE__ */ a.jsx(Ce, { brand: J ?? "", width: 32, className: "flex-shrink-0" }),
|
|
1096
|
+
/* @__PURE__ */ a.jsxs("div", { className: "relative h-full flex-1", children: [
|
|
1097
|
+
/* @__PURE__ */ a.jsx(
|
|
1098
|
+
"div",
|
|
1099
|
+
{
|
|
1100
|
+
id: "movmo-card-number",
|
|
1101
|
+
"aria-labelledby": "movmo-card-number-label",
|
|
1102
|
+
"aria-busy": d !== "ready",
|
|
1103
|
+
className: "absolute inset-0",
|
|
1104
|
+
"data-testid": "movmo-card-number-mount"
|
|
1105
|
+
}
|
|
1106
|
+
),
|
|
1107
|
+
d !== "ready" ? /* @__PURE__ */ a.jsx(
|
|
1108
|
+
"div",
|
|
1109
|
+
{
|
|
1110
|
+
"aria-hidden": "true",
|
|
1111
|
+
className: "pointer-events-none absolute inset-y-2 left-0 right-2 animate-pulse rounded bg-grayWarm-200"
|
|
1112
|
+
}
|
|
1113
|
+
) : null
|
|
1114
|
+
] })
|
|
1115
|
+
]
|
|
1116
|
+
}
|
|
1117
|
+
)
|
|
1024
1118
|
] }),
|
|
1025
1119
|
/* @__PURE__ */ a.jsxs("div", { className: "grid grid-cols-3 gap-3", children: [
|
|
1026
1120
|
/* @__PURE__ */ a.jsxs("div", { children: [
|
|
@@ -1033,13 +1127,13 @@ const Hr = () => {
|
|
|
1033
1127
|
inputMode: "numeric",
|
|
1034
1128
|
autoComplete: "cc-exp",
|
|
1035
1129
|
placeholder: "MM / YY",
|
|
1036
|
-
value:
|
|
1037
|
-
onChange: (
|
|
1038
|
-
const
|
|
1039
|
-
|
|
1130
|
+
value: E,
|
|
1131
|
+
onChange: (v) => {
|
|
1132
|
+
const O = it(v.target.value);
|
|
1133
|
+
S(O), Xe(O) && !ve.current ? (ve.current = !0, Q("cvv")) : Xe(O) || (ve.current = !1);
|
|
1040
1134
|
},
|
|
1041
|
-
className:
|
|
1042
|
-
disabled:
|
|
1135
|
+
className: Z(Ze, E && !F && "border-error-500"),
|
|
1136
|
+
disabled: _e,
|
|
1043
1137
|
required: !0,
|
|
1044
1138
|
"data-testid": "movmo-card-expiry-input"
|
|
1045
1139
|
}
|
|
@@ -1047,29 +1141,48 @@ const Hr = () => {
|
|
|
1047
1141
|
] }),
|
|
1048
1142
|
/* @__PURE__ */ a.jsxs("div", { className: "relative", children: [
|
|
1049
1143
|
/* @__PURE__ */ a.jsx("span", { id: "movmo-card-cvv-label", className: "sr-only", children: "CVV" }),
|
|
1050
|
-
/* @__PURE__ */ a.jsxs(
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1144
|
+
/* @__PURE__ */ a.jsxs(
|
|
1145
|
+
"div",
|
|
1146
|
+
{
|
|
1147
|
+
className: Z(
|
|
1148
|
+
yr,
|
|
1149
|
+
Y.cvv ? vr : hr
|
|
1150
|
+
),
|
|
1151
|
+
children: [
|
|
1152
|
+
/* @__PURE__ */ a.jsxs("div", { className: "relative h-full flex-1", children: [
|
|
1153
|
+
/* @__PURE__ */ a.jsx(
|
|
1154
|
+
"div",
|
|
1155
|
+
{
|
|
1156
|
+
id: "movmo-card-cvv",
|
|
1157
|
+
"aria-labelledby": "movmo-card-cvv-label",
|
|
1158
|
+
"aria-busy": d !== "ready",
|
|
1159
|
+
className: "absolute inset-0",
|
|
1160
|
+
"data-testid": "movmo-card-cvv-mount"
|
|
1161
|
+
}
|
|
1162
|
+
),
|
|
1163
|
+
d !== "ready" ? /* @__PURE__ */ a.jsx(
|
|
1164
|
+
"div",
|
|
1165
|
+
{
|
|
1166
|
+
"aria-hidden": "true",
|
|
1167
|
+
className: "pointer-events-none absolute inset-y-2 left-0 right-2 animate-pulse rounded bg-grayWarm-200"
|
|
1168
|
+
}
|
|
1169
|
+
) : null
|
|
1170
|
+
] }),
|
|
1171
|
+
/* @__PURE__ */ a.jsx(
|
|
1172
|
+
"button",
|
|
1173
|
+
{
|
|
1174
|
+
type: "button",
|
|
1175
|
+
"aria-label": "CVV help",
|
|
1176
|
+
tabIndex: -1,
|
|
1177
|
+
className: "flex h-5 w-5 flex-shrink-0 items-center justify-center rounded-full border border-grayWarm-300 text-xs text-grayWarm-500",
|
|
1178
|
+
title: J === "american_express" ? "The 4 numbers on the front of your card." : "The 3 numbers on the back of your card.",
|
|
1179
|
+
"data-testid": "movmo-cvv-help",
|
|
1180
|
+
children: "?"
|
|
1181
|
+
}
|
|
1182
|
+
)
|
|
1183
|
+
]
|
|
1184
|
+
}
|
|
1185
|
+
)
|
|
1073
1186
|
] }),
|
|
1074
1187
|
/* @__PURE__ */ a.jsxs("div", { children: [
|
|
1075
1188
|
/* @__PURE__ */ a.jsx("label", { htmlFor: "movmo-card-zip", className: "sr-only", children: "ZIP code" }),
|
|
@@ -1077,19 +1190,19 @@ const Hr = () => {
|
|
|
1077
1190
|
"input",
|
|
1078
1191
|
{
|
|
1079
1192
|
id: "movmo-card-zip",
|
|
1080
|
-
ref:
|
|
1193
|
+
ref: me,
|
|
1081
1194
|
type: "text",
|
|
1082
1195
|
inputMode: "numeric",
|
|
1083
1196
|
autoComplete: "postal-code",
|
|
1084
1197
|
placeholder: "ZIP code",
|
|
1085
|
-
value:
|
|
1086
|
-
onChange: (
|
|
1087
|
-
var
|
|
1088
|
-
const
|
|
1089
|
-
|
|
1198
|
+
value: q,
|
|
1199
|
+
onChange: (v) => {
|
|
1200
|
+
var V;
|
|
1201
|
+
const O = lt(v.target.value);
|
|
1202
|
+
ue(O), Qe(O) && !we.current ? (we.current = !0, (V = je.current) == null || V.focus()) : Qe(O) || (we.current = !1);
|
|
1090
1203
|
},
|
|
1091
|
-
className:
|
|
1092
|
-
disabled:
|
|
1204
|
+
className: Z(Ze, q && !fe && "border-error-500"),
|
|
1205
|
+
disabled: _e,
|
|
1093
1206
|
required: !0,
|
|
1094
1207
|
"data-testid": "movmo-card-zip-input"
|
|
1095
1208
|
}
|
|
@@ -1102,112 +1215,118 @@ const Hr = () => {
|
|
|
1102
1215
|
"input",
|
|
1103
1216
|
{
|
|
1104
1217
|
id: "movmo-card-cardholder-name",
|
|
1105
|
-
ref:
|
|
1218
|
+
ref: je,
|
|
1106
1219
|
type: "text",
|
|
1107
1220
|
autoComplete: "cc-name",
|
|
1108
1221
|
placeholder: "Cardholder name",
|
|
1109
|
-
value:
|
|
1110
|
-
onChange: (
|
|
1111
|
-
className:
|
|
1112
|
-
disabled:
|
|
1222
|
+
value: T,
|
|
1223
|
+
onChange: (v) => se(v.target.value),
|
|
1224
|
+
className: Ze,
|
|
1225
|
+
disabled: _e,
|
|
1113
1226
|
required: !0,
|
|
1114
1227
|
"data-testid": "movmo-card-cardholder-name-input"
|
|
1115
1228
|
}
|
|
1116
1229
|
)
|
|
1117
1230
|
] }),
|
|
1118
|
-
|
|
1119
|
-
"p",
|
|
1120
|
-
{
|
|
1121
|
-
role: "alert",
|
|
1122
|
-
className: "rounded-md bg-error-50 px-3 py-2 text-sm text-error-700",
|
|
1123
|
-
"data-testid": "movmo-card-error",
|
|
1124
|
-
children: ye
|
|
1125
|
-
}
|
|
1126
|
-
) : null,
|
|
1127
|
-
!y && !g ? /* @__PURE__ */ a.jsx(
|
|
1231
|
+
!y && !N ? /* @__PURE__ */ a.jsx(
|
|
1128
1232
|
"button",
|
|
1129
1233
|
{
|
|
1130
1234
|
type: "submit",
|
|
1131
|
-
disabled: !
|
|
1132
|
-
className:
|
|
1235
|
+
disabled: !oe,
|
|
1236
|
+
className: Z(
|
|
1133
1237
|
"inline-flex h-11 items-center justify-center rounded-md bg-brand-500 px-4 text-sm font-semibold text-white transition-colors hover:bg-brand-600",
|
|
1134
1238
|
"disabled:cursor-not-allowed disabled:bg-grayWarm-300 disabled:text-grayWarm-500"
|
|
1135
1239
|
),
|
|
1136
1240
|
"data-testid": "movmo-card-save",
|
|
1137
|
-
children:
|
|
1241
|
+
children: G ? "Saving…" : d === "loading" ? "Loading…" : "Save card"
|
|
1138
1242
|
}
|
|
1139
|
-
) :
|
|
1243
|
+
) : G && y ? (
|
|
1244
|
+
// In autoSave mode (empty-state inline form, no Save button at all),
|
|
1245
|
+
// surface the in-flight state as inline text. The modal flow uses a
|
|
1246
|
+
// spinner inside the modal-footer Save button instead — see
|
|
1247
|
+
// AddPaymentMethodModal.isSaving.
|
|
1248
|
+
/* @__PURE__ */ a.jsx(
|
|
1249
|
+
"p",
|
|
1250
|
+
{
|
|
1251
|
+
className: "text-center text-sm text-grayWarm-500",
|
|
1252
|
+
"aria-live": "polite",
|
|
1253
|
+
"data-testid": "movmo-card-autosaving",
|
|
1254
|
+
children: "Saving card…"
|
|
1255
|
+
}
|
|
1256
|
+
)
|
|
1257
|
+
) : null
|
|
1140
1258
|
]
|
|
1141
1259
|
}
|
|
1142
1260
|
);
|
|
1143
1261
|
};
|
|
1144
|
-
|
|
1145
|
-
const
|
|
1146
|
-
const [t, s] =
|
|
1147
|
-
return { deletePaymentMethod:
|
|
1148
|
-
async (
|
|
1262
|
+
Rr.displayName = "MovmoCardForm";
|
|
1263
|
+
const ct = (r) => {
|
|
1264
|
+
const [t, s] = P("idle"), [o, l] = P(null);
|
|
1265
|
+
return { deletePaymentMethod: H(
|
|
1266
|
+
async (f) => {
|
|
1149
1267
|
s("pending"), l(null);
|
|
1150
1268
|
try {
|
|
1151
|
-
await
|
|
1152
|
-
} catch (
|
|
1153
|
-
const y =
|
|
1154
|
-
throw l(y), s("error"),
|
|
1269
|
+
await Zr(r, f), s("idle");
|
|
1270
|
+
} catch (p) {
|
|
1271
|
+
const y = p instanceof Error ? p.message : "Failed to delete payment method.";
|
|
1272
|
+
throw l(y), s("error"), p;
|
|
1155
1273
|
}
|
|
1156
1274
|
},
|
|
1157
1275
|
[r]
|
|
1158
1276
|
), status: t, error: o };
|
|
1159
|
-
},
|
|
1160
|
-
const [t, s] =
|
|
1161
|
-
return { setDefault:
|
|
1162
|
-
async (
|
|
1277
|
+
}, dt = (r) => {
|
|
1278
|
+
const [t, s] = P("idle"), [o, l] = P(null);
|
|
1279
|
+
return { setDefault: H(
|
|
1280
|
+
async (f) => {
|
|
1163
1281
|
s("pending"), l(null);
|
|
1164
1282
|
try {
|
|
1165
|
-
await
|
|
1166
|
-
} catch (
|
|
1167
|
-
const y =
|
|
1168
|
-
throw l(y), s("error"),
|
|
1283
|
+
await Xr(r, f, { isDefault: !0 }), s("idle");
|
|
1284
|
+
} catch (p) {
|
|
1285
|
+
const y = p instanceof Error ? p.message : "Failed to set default payment method.";
|
|
1286
|
+
throw l(y), s("error"), p;
|
|
1169
1287
|
}
|
|
1170
1288
|
},
|
|
1171
1289
|
[r]
|
|
1172
1290
|
), status: t, error: o };
|
|
1173
|
-
},
|
|
1174
|
-
const [t, s] =
|
|
1175
|
-
|
|
1176
|
-
var
|
|
1177
|
-
(
|
|
1178
|
-
const
|
|
1179
|
-
return
|
|
1180
|
-
|
|
1181
|
-
}).catch((
|
|
1182
|
-
if (
|
|
1183
|
-
const
|
|
1184
|
-
|
|
1291
|
+
}, ut = (r) => {
|
|
1292
|
+
const [t, s] = P([]), [o, l] = P("idle"), [c, f] = P(null), [p, y] = P(0), W = B(null);
|
|
1293
|
+
L(() => {
|
|
1294
|
+
var D;
|
|
1295
|
+
(D = W.current) == null || D.abort();
|
|
1296
|
+
const b = new AbortController();
|
|
1297
|
+
return W.current = b, l("loading"), f(null), Hr(r).then((M) => {
|
|
1298
|
+
b.signal.aborted || (s(M), l("ready"));
|
|
1299
|
+
}).catch((M) => {
|
|
1300
|
+
if (b.signal.aborted) return;
|
|
1301
|
+
const X = M instanceof Error ? M.message : "Failed to fetch payment methods.";
|
|
1302
|
+
f(X), l("error");
|
|
1185
1303
|
}), () => {
|
|
1186
|
-
|
|
1304
|
+
b.abort();
|
|
1187
1305
|
};
|
|
1188
|
-
}, [r,
|
|
1189
|
-
const
|
|
1190
|
-
y((
|
|
1306
|
+
}, [r, p]);
|
|
1307
|
+
const N = H(() => {
|
|
1308
|
+
y((b) => b + 1);
|
|
1191
1309
|
}, []);
|
|
1192
|
-
return { items: t, status: o, error:
|
|
1193
|
-
},
|
|
1310
|
+
return { items: t, status: o, error: c, refetch: N };
|
|
1311
|
+
}, mt = ({
|
|
1194
1312
|
open: r,
|
|
1195
1313
|
onClose: t,
|
|
1196
1314
|
formId: s,
|
|
1197
1315
|
saveDisabled: o,
|
|
1198
1316
|
saveLabel: l = "Save",
|
|
1317
|
+
isSaving: c = !1,
|
|
1199
1318
|
children: f
|
|
1200
|
-
}) => (
|
|
1319
|
+
}) => (L(() => {
|
|
1201
1320
|
if (!r) return;
|
|
1202
|
-
const
|
|
1203
|
-
|
|
1321
|
+
const p = (y) => {
|
|
1322
|
+
y.key === "Escape" && t();
|
|
1204
1323
|
};
|
|
1205
|
-
return document.addEventListener("keydown",
|
|
1206
|
-
}, [r, t]),
|
|
1324
|
+
return document.addEventListener("keydown", p), () => document.removeEventListener("keydown", p);
|
|
1325
|
+
}, [r, t]), L(() => {
|
|
1207
1326
|
if (!r) return;
|
|
1208
|
-
const
|
|
1327
|
+
const p = document.body.style.overflow;
|
|
1209
1328
|
return document.body.style.overflow = "hidden", () => {
|
|
1210
|
-
document.body.style.overflow =
|
|
1329
|
+
document.body.style.overflow = p;
|
|
1211
1330
|
};
|
|
1212
1331
|
}, [r]), r ? /* @__PURE__ */ a.jsx(
|
|
1213
1332
|
"div",
|
|
@@ -1216,8 +1335,8 @@ const nt = (r) => {
|
|
|
1216
1335
|
"aria-modal": "true",
|
|
1217
1336
|
"aria-labelledby": "movmo-add-payment-title",
|
|
1218
1337
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",
|
|
1219
|
-
onClick: (
|
|
1220
|
-
|
|
1338
|
+
onClick: (p) => {
|
|
1339
|
+
p.target === p.currentTarget && t();
|
|
1221
1340
|
},
|
|
1222
1341
|
"data-testid": "add-payment-method-modal",
|
|
1223
1342
|
children: /* @__PURE__ */ a.jsxs("div", { className: "flex max-h-full w-full max-w-md flex-col rounded-xl bg-white shadow-2xl", children: [
|
|
@@ -1228,15 +1347,16 @@ const nt = (r) => {
|
|
|
1228
1347
|
type: "button",
|
|
1229
1348
|
onClick: t,
|
|
1230
1349
|
"aria-label": "Close add-payment dialog",
|
|
1231
|
-
className: "flex h-
|
|
1350
|
+
className: "flex h-9 w-9 flex-shrink-0 items-center justify-center rounded-lg bg-grayWarm-100 p-2 text-grayWarm-950 transition-colors hover:bg-grayWarm-200",
|
|
1232
1351
|
"data-testid": "add-payment-method-close",
|
|
1233
|
-
children: /* @__PURE__ */ a.jsx("svg", { viewBox: "0 0
|
|
1352
|
+
children: /* @__PURE__ */ a.jsx("svg", { viewBox: "0 0 20 20", width: "20", height: "20", "aria-hidden": "true", children: /* @__PURE__ */ a.jsx(
|
|
1234
1353
|
"path",
|
|
1235
1354
|
{
|
|
1236
|
-
d: "
|
|
1355
|
+
d: "M5 5L15 15M15 5L5 15",
|
|
1237
1356
|
stroke: "currentColor",
|
|
1238
|
-
strokeWidth: "1.
|
|
1239
|
-
strokeLinecap: "round"
|
|
1357
|
+
strokeWidth: "1.67",
|
|
1358
|
+
strokeLinecap: "round",
|
|
1359
|
+
strokeLinejoin: "round"
|
|
1240
1360
|
}
|
|
1241
1361
|
) })
|
|
1242
1362
|
}
|
|
@@ -1249,7 +1369,7 @@ const nt = (r) => {
|
|
|
1249
1369
|
children: "Add payment method"
|
|
1250
1370
|
}
|
|
1251
1371
|
),
|
|
1252
|
-
/* @__PURE__ */ a.jsx("span", { "aria-hidden": "true", className: "h-
|
|
1372
|
+
/* @__PURE__ */ a.jsx("span", { "aria-hidden": "true", className: "h-9 w-9 flex-shrink-0" })
|
|
1253
1373
|
] }),
|
|
1254
1374
|
/* @__PURE__ */ a.jsx("div", { className: "flex-1 overflow-y-auto p-4", children: f }),
|
|
1255
1375
|
/* @__PURE__ */ a.jsxs("div", { className: "flex gap-3 border-t border-grayWarm-200 p-4", children: [
|
|
@@ -1268,53 +1388,122 @@ const nt = (r) => {
|
|
|
1268
1388
|
{
|
|
1269
1389
|
type: "submit",
|
|
1270
1390
|
form: s,
|
|
1271
|
-
disabled: o,
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1391
|
+
disabled: c ? !1 : o,
|
|
1392
|
+
"aria-disabled": c || o,
|
|
1393
|
+
"aria-busy": c,
|
|
1394
|
+
className: Z(
|
|
1395
|
+
"inline-flex h-11 flex-1 items-center justify-center rounded-lg bg-brand-500 px-4 text-sm font-semibold text-white transition-colors",
|
|
1396
|
+
c ? "cursor-not-allowed opacity-90 pointer-events-none" : "hover:bg-brand-600 disabled:cursor-not-allowed disabled:bg-grayWarm-300 disabled:text-grayWarm-500"
|
|
1275
1397
|
),
|
|
1276
1398
|
"data-testid": "add-payment-method-save",
|
|
1277
|
-
children:
|
|
1399
|
+
children: c ? /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
|
|
1400
|
+
/* @__PURE__ */ a.jsxs(
|
|
1401
|
+
"svg",
|
|
1402
|
+
{
|
|
1403
|
+
className: "h-[18px] w-[18px] animate-spin",
|
|
1404
|
+
viewBox: "0 0 24 24",
|
|
1405
|
+
fill: "none",
|
|
1406
|
+
"aria-hidden": "true",
|
|
1407
|
+
children: [
|
|
1408
|
+
/* @__PURE__ */ a.jsx(
|
|
1409
|
+
"circle",
|
|
1410
|
+
{
|
|
1411
|
+
cx: "12",
|
|
1412
|
+
cy: "12",
|
|
1413
|
+
r: "10",
|
|
1414
|
+
stroke: "currentColor",
|
|
1415
|
+
strokeWidth: "3",
|
|
1416
|
+
strokeOpacity: "0.25"
|
|
1417
|
+
}
|
|
1418
|
+
),
|
|
1419
|
+
/* @__PURE__ */ a.jsx(
|
|
1420
|
+
"path",
|
|
1421
|
+
{
|
|
1422
|
+
d: "M22 12a10 10 0 0 1-10 10",
|
|
1423
|
+
stroke: "currentColor",
|
|
1424
|
+
strokeWidth: "3",
|
|
1425
|
+
strokeLinecap: "round"
|
|
1426
|
+
}
|
|
1427
|
+
)
|
|
1428
|
+
]
|
|
1429
|
+
}
|
|
1430
|
+
),
|
|
1431
|
+
/* @__PURE__ */ a.jsx("span", { className: "sr-only", children: "Saving card" })
|
|
1432
|
+
] }) : l
|
|
1278
1433
|
}
|
|
1279
1434
|
)
|
|
1280
1435
|
] })
|
|
1281
1436
|
] })
|
|
1282
1437
|
}
|
|
1283
|
-
) : null),
|
|
1438
|
+
) : null), ft = (r) => {
|
|
1439
|
+
if (!r) return "Card";
|
|
1440
|
+
const t = r.toLowerCase();
|
|
1441
|
+
return t === "amex" ? "Amex" : t.charAt(0).toUpperCase() + t.slice(1);
|
|
1442
|
+
}, pt = ({
|
|
1443
|
+
method: r,
|
|
1444
|
+
trailing: t,
|
|
1445
|
+
onClick: s,
|
|
1446
|
+
cardLabelFormat: o = "branded",
|
|
1447
|
+
className: l
|
|
1448
|
+
}) => /* @__PURE__ */ a.jsxs(
|
|
1449
|
+
"div",
|
|
1450
|
+
{
|
|
1451
|
+
className: Z("flex items-center gap-3", s && "cursor-pointer", l),
|
|
1452
|
+
onClick: s,
|
|
1453
|
+
role: s ? "button" : void 0,
|
|
1454
|
+
tabIndex: s ? 0 : void 0,
|
|
1455
|
+
onKeyDown: s ? (c) => {
|
|
1456
|
+
(c.key === "Enter" || c.key === " ") && (c.preventDefault(), s());
|
|
1457
|
+
} : void 0,
|
|
1458
|
+
"data-testid": `payment-method-preview-${r.id}`,
|
|
1459
|
+
children: [
|
|
1460
|
+
/* @__PURE__ */ a.jsx(Ce, { brand: r.brand, width: 34, className: "flex-shrink-0" }),
|
|
1461
|
+
/* @__PURE__ */ a.jsx("span", { className: "flex-1 text-lg font-semibold text-grayWarm-950", children: o === "masked" ? `•••• ${r.last4}` : `${ft(r.brand)} ${r.last4}` }),
|
|
1462
|
+
t
|
|
1463
|
+
]
|
|
1464
|
+
}
|
|
1465
|
+
), yt = (r, t, s = /* @__PURE__ */ new Date()) => t < s.getFullYear() || t === s.getFullYear() && r < s.getMonth() + 1, xr = (r) => {
|
|
1466
|
+
if (!r) return "Card";
|
|
1284
1467
|
const t = r.toLowerCase();
|
|
1285
|
-
return t === "amex" ? "Amex" : t
|
|
1286
|
-
},
|
|
1468
|
+
return t === "amex" ? "Amex" : t.charAt(0).toUpperCase() + t.slice(1);
|
|
1469
|
+
}, vt = (r, t) => `${String(r).padStart(2, "0")}/${t}`, ht = ({
|
|
1287
1470
|
method: r,
|
|
1288
1471
|
selectable: t,
|
|
1289
1472
|
selected: s,
|
|
1290
1473
|
onSelect: o,
|
|
1291
1474
|
onSetDefault: l,
|
|
1292
|
-
onRemove:
|
|
1293
|
-
disabled:
|
|
1294
|
-
showDefaultBadge:
|
|
1295
|
-
hideSetDefaultMenuItem: y
|
|
1475
|
+
onRemove: c,
|
|
1476
|
+
disabled: f,
|
|
1477
|
+
showDefaultBadge: p,
|
|
1478
|
+
hideSetDefaultMenuItem: y,
|
|
1479
|
+
cardLabelFormat: W = "branded"
|
|
1296
1480
|
}) => {
|
|
1297
|
-
const [
|
|
1298
|
-
|
|
1299
|
-
if (!
|
|
1300
|
-
const
|
|
1301
|
-
var
|
|
1302
|
-
(
|
|
1481
|
+
const [N, b] = P(!1), D = B(null), M = yt(r.expMonth, r.expYear);
|
|
1482
|
+
L(() => {
|
|
1483
|
+
if (!N) return;
|
|
1484
|
+
const T = (se) => {
|
|
1485
|
+
var E;
|
|
1486
|
+
(E = D.current) != null && E.contains(se.target) || b(!1);
|
|
1303
1487
|
};
|
|
1304
|
-
return document.addEventListener("mousedown",
|
|
1305
|
-
}, [
|
|
1306
|
-
const
|
|
1307
|
-
t && o && !
|
|
1488
|
+
return document.addEventListener("mousedown", T), () => document.removeEventListener("mousedown", T);
|
|
1489
|
+
}, [N]);
|
|
1490
|
+
const X = () => {
|
|
1491
|
+
t && o && !f && o(r);
|
|
1308
1492
|
};
|
|
1309
1493
|
return /* @__PURE__ */ a.jsxs(
|
|
1310
1494
|
"div",
|
|
1311
1495
|
{
|
|
1312
|
-
className:
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1496
|
+
className: Z(
|
|
1497
|
+
// items-start + per-element mt offsets so the radio, brand icon, and
|
|
1498
|
+
// label all read as one horizontal line, with the Exp text directly
|
|
1499
|
+
// below the label in the same column. Matches main's flights-ui +
|
|
1500
|
+
// accounts-ui row layout (both use items-start).
|
|
1501
|
+
"flex items-start gap-3 transition-colors",
|
|
1502
|
+
t ? "rounded-lg border px-3 py-3" : "py-4",
|
|
1503
|
+
t && !f && "cursor-pointer",
|
|
1504
|
+
t && (s ? "border-grayWarm-950 shadow-[0_0_0_1px_#1c1917]" : "border-grayWarm-200 hover:border-grayWarm-300")
|
|
1316
1505
|
),
|
|
1317
|
-
onClick:
|
|
1506
|
+
onClick: X,
|
|
1318
1507
|
"data-testid": `payment-method-row-${r.id}`,
|
|
1319
1508
|
children: [
|
|
1320
1509
|
t ? /* @__PURE__ */ a.jsx(
|
|
@@ -1324,79 +1513,102 @@ const nt = (r) => {
|
|
|
1324
1513
|
name: "movmo-payment-method",
|
|
1325
1514
|
checked: s,
|
|
1326
1515
|
onChange: () => o == null ? void 0 : o(r),
|
|
1327
|
-
onClick: (
|
|
1328
|
-
"aria-label": `Select ${
|
|
1329
|
-
className: "h-4 w-4 cursor-pointer
|
|
1330
|
-
disabled:
|
|
1516
|
+
onClick: (T) => T.stopPropagation(),
|
|
1517
|
+
"aria-label": `Select ${xr(r.brand)} ending ${r.last4}`,
|
|
1518
|
+
className: "mr-1 h-4 w-4 mt-2 cursor-pointer appearance-none rounded-full border-2 border-grayWarm-300 checked:border-[5px] checked:border-grayWarm-950 bg-white checked:bg-white focus:ring-0 focus:ring-offset-0",
|
|
1519
|
+
disabled: f
|
|
1331
1520
|
}
|
|
1332
1521
|
) : null,
|
|
1333
|
-
/* @__PURE__ */ a.jsx(
|
|
1522
|
+
/* @__PURE__ */ a.jsx(Ce, { brand: r.brand, className: "flex-shrink-0" }),
|
|
1334
1523
|
/* @__PURE__ */ a.jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
1335
1524
|
/* @__PURE__ */ a.jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
1336
|
-
/* @__PURE__ */ a.
|
|
1337
|
-
|
|
1338
|
-
" ••••",
|
|
1339
|
-
r.last4
|
|
1340
|
-
] }),
|
|
1341
|
-
v && r.isDefault ? /* @__PURE__ */ a.jsx(
|
|
1525
|
+
/* @__PURE__ */ a.jsx("span", { className: "text-lg font-semibold text-grayWarm-950", children: W === "masked" ? `•••• ${r.last4}` : `${xr(r.brand)} ${r.last4}` }),
|
|
1526
|
+
p && r.isDefault ? /* @__PURE__ */ a.jsx(
|
|
1342
1527
|
"span",
|
|
1343
1528
|
{
|
|
1344
|
-
className: "inline-flex items-center rounded-full bg-success-50 px-2 py-0.5 text-xs font-
|
|
1529
|
+
className: "inline-flex items-center rounded-full bg-success-50 px-2 py-0.5 text-xs font-semibold text-success-700",
|
|
1345
1530
|
"data-testid": `badge-default-${r.id}`,
|
|
1346
1531
|
children: "Default"
|
|
1347
1532
|
}
|
|
1348
1533
|
) : null,
|
|
1349
|
-
|
|
1534
|
+
M ? /* @__PURE__ */ a.jsx(
|
|
1350
1535
|
"span",
|
|
1351
1536
|
{
|
|
1352
|
-
className: "inline-flex items-center rounded-full bg-error-50 px-2 py-0.5 text-xs font-
|
|
1537
|
+
className: "inline-flex items-center rounded-full bg-error-50 px-2 py-0.5 text-xs font-semibold text-error-700",
|
|
1353
1538
|
"data-testid": `badge-expired-${r.id}`,
|
|
1354
1539
|
children: "Expired"
|
|
1355
1540
|
}
|
|
1356
1541
|
) : null
|
|
1357
1542
|
] }),
|
|
1358
|
-
/* @__PURE__ */ a.jsxs("div", { className:
|
|
1543
|
+
/* @__PURE__ */ a.jsxs("div", { className: Z("text-base", M ? "text-grayWarm-400" : "text-grayWarm-600"), children: [
|
|
1359
1544
|
"Exp. ",
|
|
1360
|
-
|
|
1545
|
+
vt(r.expMonth, r.expYear)
|
|
1361
1546
|
] })
|
|
1362
1547
|
] }),
|
|
1363
|
-
/* @__PURE__ */ a.jsxs("div", { className: "relative flex-shrink-0", ref:
|
|
1548
|
+
/* @__PURE__ */ a.jsxs("div", { className: "relative flex-shrink-0", ref: D, children: [
|
|
1364
1549
|
/* @__PURE__ */ a.jsx(
|
|
1365
1550
|
"button",
|
|
1366
1551
|
{
|
|
1367
1552
|
type: "button",
|
|
1368
1553
|
"aria-label": `Open actions for card ending ${r.last4}`,
|
|
1369
1554
|
"aria-haspopup": "menu",
|
|
1370
|
-
"aria-expanded":
|
|
1555
|
+
"aria-expanded": N,
|
|
1371
1556
|
className: "rounded-lg p-2 text-grayWarm-600 transition-colors hover:bg-grayWarm-100 disabled:cursor-not-allowed disabled:opacity-50",
|
|
1372
|
-
disabled:
|
|
1373
|
-
onClick: (
|
|
1374
|
-
|
|
1557
|
+
disabled: f,
|
|
1558
|
+
onClick: (T) => {
|
|
1559
|
+
T.stopPropagation(), b((se) => !se);
|
|
1375
1560
|
},
|
|
1376
1561
|
"data-testid": `menu-trigger-${r.id}`,
|
|
1377
|
-
children: /* @__PURE__ */ a.
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1562
|
+
children: /* @__PURE__ */ a.jsx(
|
|
1563
|
+
"svg",
|
|
1564
|
+
{
|
|
1565
|
+
viewBox: "0 0 24 24",
|
|
1566
|
+
width: "20",
|
|
1567
|
+
height: "20",
|
|
1568
|
+
fill: "currentColor",
|
|
1569
|
+
"aria-hidden": "true",
|
|
1570
|
+
children: /* @__PURE__ */ a.jsx("path", { d: "M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" })
|
|
1571
|
+
}
|
|
1572
|
+
)
|
|
1382
1573
|
}
|
|
1383
1574
|
),
|
|
1384
|
-
|
|
1575
|
+
N ? /* @__PURE__ */ a.jsxs(
|
|
1385
1576
|
"div",
|
|
1386
1577
|
{
|
|
1387
1578
|
role: "menu",
|
|
1388
|
-
className:
|
|
1389
|
-
|
|
1579
|
+
className: Z(
|
|
1580
|
+
"absolute z-10 whitespace-nowrap rounded-lg border border-grayWarm-200 bg-white py-1 shadow-lg",
|
|
1581
|
+
// selectable mode (flights-ui): the row has a thick border that a
|
|
1582
|
+
// top-aligned dropdown would crash through. Float the menu ABOVE
|
|
1583
|
+
// the trigger button, horizontally centered, with a small tail
|
|
1584
|
+
// pointing back down at the dots. Matches main's flights-ui menu.
|
|
1585
|
+
// non-selectable mode (accounts-ui): no per-row border to
|
|
1586
|
+
// overlap; keep the menu below + right-aligned.
|
|
1587
|
+
t ? "bottom-full left-1/2 mb-2 -translate-x-1/2" : "right-0 top-full mt-1"
|
|
1588
|
+
),
|
|
1589
|
+
onClick: (T) => T.stopPropagation(),
|
|
1390
1590
|
"data-testid": `menu-${r.id}`,
|
|
1391
1591
|
children: [
|
|
1592
|
+
t ? (
|
|
1593
|
+
// Tail: 8px square rotated 45° so its bottom-right corner
|
|
1594
|
+
// becomes a downward-pointing tip. Bottom + right borders of
|
|
1595
|
+
// the square form the menu's continuous border.
|
|
1596
|
+
/* @__PURE__ */ a.jsx(
|
|
1597
|
+
"span",
|
|
1598
|
+
{
|
|
1599
|
+
"aria-hidden": "true",
|
|
1600
|
+
className: "absolute -bottom-1.5 left-1/2 h-3 w-3 -translate-x-1/2 rotate-45 border-b border-r border-grayWarm-200 bg-white"
|
|
1601
|
+
}
|
|
1602
|
+
)
|
|
1603
|
+
) : null,
|
|
1392
1604
|
!r.isDefault && !y ? /* @__PURE__ */ a.jsx(
|
|
1393
1605
|
"button",
|
|
1394
1606
|
{
|
|
1395
1607
|
type: "button",
|
|
1396
1608
|
role: "menuitem",
|
|
1397
|
-
className: "block w-full px-4 py-
|
|
1609
|
+
className: "block w-full px-4 py-1 text-left text-md font-semibold text-grayWarm-950 hover:text-grayWarm-700",
|
|
1398
1610
|
onClick: () => {
|
|
1399
|
-
|
|
1611
|
+
b(!1), l(r);
|
|
1400
1612
|
},
|
|
1401
1613
|
"data-testid": `menu-set-default-${r.id}`,
|
|
1402
1614
|
children: "Set as default"
|
|
@@ -1407,12 +1619,12 @@ const nt = (r) => {
|
|
|
1407
1619
|
{
|
|
1408
1620
|
type: "button",
|
|
1409
1621
|
role: "menuitem",
|
|
1410
|
-
className: "block w-full px-4 py-
|
|
1622
|
+
className: "block w-full px-4 py-1 text-left text-md font-semibold text-error-700 hover:text-error-500",
|
|
1411
1623
|
onClick: () => {
|
|
1412
|
-
|
|
1624
|
+
b(!1), c(r);
|
|
1413
1625
|
},
|
|
1414
1626
|
"data-testid": `menu-remove-${r.id}`,
|
|
1415
|
-
children: "
|
|
1627
|
+
children: "Delete"
|
|
1416
1628
|
}
|
|
1417
1629
|
)
|
|
1418
1630
|
]
|
|
@@ -1422,16 +1634,16 @@ const nt = (r) => {
|
|
|
1422
1634
|
]
|
|
1423
1635
|
}
|
|
1424
1636
|
);
|
|
1425
|
-
},
|
|
1637
|
+
}, xt = (r) => `${De().iconCdnBaseUrl}/website/assets/icons/payments/${r}.svg`, er = ({ slug: r, alt: t }) => /* @__PURE__ */ a.jsx(
|
|
1426
1638
|
"img",
|
|
1427
1639
|
{
|
|
1428
|
-
src:
|
|
1640
|
+
src: xt(r),
|
|
1429
1641
|
alt: t,
|
|
1430
1642
|
height: 20,
|
|
1431
1643
|
loading: "lazy",
|
|
1432
1644
|
style: { height: 20, width: "auto" }
|
|
1433
1645
|
}
|
|
1434
|
-
),
|
|
1646
|
+
), Be = ({
|
|
1435
1647
|
type: r,
|
|
1436
1648
|
label: t,
|
|
1437
1649
|
iconNode: s
|
|
@@ -1464,18 +1676,18 @@ const nt = (r) => {
|
|
|
1464
1676
|
]
|
|
1465
1677
|
}
|
|
1466
1678
|
)
|
|
1467
|
-
),
|
|
1679
|
+
), br = ({
|
|
1468
1680
|
selected: r,
|
|
1469
1681
|
onSelect: t,
|
|
1470
1682
|
creditCardBody: s,
|
|
1471
1683
|
className: o
|
|
1472
1684
|
}) => {
|
|
1473
1685
|
const l = r === "credit_card";
|
|
1474
|
-
return /* @__PURE__ */ a.jsxs("div", { className:
|
|
1686
|
+
return /* @__PURE__ */ a.jsxs("div", { className: Z("flex w-full flex-col gap-3", o), children: [
|
|
1475
1687
|
/* @__PURE__ */ a.jsxs(
|
|
1476
1688
|
"label",
|
|
1477
1689
|
{
|
|
1478
|
-
className:
|
|
1690
|
+
className: Z(
|
|
1479
1691
|
"flex cursor-pointer flex-col gap-3 rounded-lg border px-4 py-3 transition-colors",
|
|
1480
1692
|
l ? "border-grayWarm-900 shadow-[0_0_0_1px_#1c1917]" : "border-grayWarm-200"
|
|
1481
1693
|
),
|
|
@@ -1496,10 +1708,10 @@ const nt = (r) => {
|
|
|
1496
1708
|
),
|
|
1497
1709
|
/* @__PURE__ */ a.jsx("span", { className: "flex-1 text-sm font-semibold text-grayWarm-900", children: "Credit card" }),
|
|
1498
1710
|
/* @__PURE__ */ a.jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
1499
|
-
/* @__PURE__ */ a.jsx(
|
|
1500
|
-
/* @__PURE__ */ a.jsx(
|
|
1501
|
-
/* @__PURE__ */ a.jsx(
|
|
1502
|
-
/* @__PURE__ */ a.jsx(
|
|
1711
|
+
/* @__PURE__ */ a.jsx(Ce, { brand: "mastercard", width: 28 }),
|
|
1712
|
+
/* @__PURE__ */ a.jsx(Ce, { brand: "visa", width: 28 }),
|
|
1713
|
+
/* @__PURE__ */ a.jsx(Ce, { brand: "amex", width: 28 }),
|
|
1714
|
+
/* @__PURE__ */ a.jsx(Ce, { brand: "discover", width: 28 })
|
|
1503
1715
|
] })
|
|
1504
1716
|
] }),
|
|
1505
1717
|
l ? /* @__PURE__ */ a.jsx("div", { "data-testid": "payment-type-credit_card-body", children: s }) : null
|
|
@@ -1515,31 +1727,31 @@ const nt = (r) => {
|
|
|
1515
1727
|
}
|
|
1516
1728
|
) : null,
|
|
1517
1729
|
/* @__PURE__ */ a.jsx(
|
|
1518
|
-
|
|
1730
|
+
Be,
|
|
1519
1731
|
{
|
|
1520
1732
|
type: "paypal",
|
|
1521
1733
|
label: "PayPal",
|
|
1522
|
-
iconNode: /* @__PURE__ */ a.jsx(
|
|
1734
|
+
iconNode: /* @__PURE__ */ a.jsx(er, { slug: "paypal", alt: "PayPal" })
|
|
1523
1735
|
}
|
|
1524
1736
|
),
|
|
1525
1737
|
/* @__PURE__ */ a.jsx(
|
|
1526
|
-
|
|
1738
|
+
Be,
|
|
1527
1739
|
{
|
|
1528
1740
|
type: "googlepay",
|
|
1529
1741
|
label: "GooglePay",
|
|
1530
|
-
iconNode: /* @__PURE__ */ a.jsx(
|
|
1742
|
+
iconNode: /* @__PURE__ */ a.jsx(er, { slug: "google-pay", alt: "GooglePay" })
|
|
1531
1743
|
}
|
|
1532
1744
|
),
|
|
1533
1745
|
/* @__PURE__ */ a.jsx(
|
|
1534
|
-
|
|
1746
|
+
Be,
|
|
1535
1747
|
{
|
|
1536
1748
|
type: "klarna",
|
|
1537
1749
|
label: "Klarna",
|
|
1538
|
-
iconNode: /* @__PURE__ */ a.jsx(
|
|
1750
|
+
iconNode: /* @__PURE__ */ a.jsx(er, { slug: "klarna", alt: "Klarna" })
|
|
1539
1751
|
}
|
|
1540
1752
|
),
|
|
1541
1753
|
/* @__PURE__ */ a.jsx(
|
|
1542
|
-
|
|
1754
|
+
Be,
|
|
1543
1755
|
{
|
|
1544
1756
|
type: "ach",
|
|
1545
1757
|
label: "Bank account (ACH)",
|
|
@@ -1547,143 +1759,190 @@ const nt = (r) => {
|
|
|
1547
1759
|
}
|
|
1548
1760
|
)
|
|
1549
1761
|
] });
|
|
1550
|
-
},
|
|
1762
|
+
}, gr = "movmo-add-payment-form", wr = (r) => {
|
|
1551
1763
|
const t = r.filter((o) => o.isDefault), s = r.filter((o) => !o.isDefault);
|
|
1552
1764
|
return [...t, ...s];
|
|
1553
|
-
},
|
|
1765
|
+
}, jr = ({ withDefaultBadge: r = !1 }) => /* @__PURE__ */ a.jsxs(
|
|
1554
1766
|
"div",
|
|
1555
1767
|
{
|
|
1556
|
-
className: "flex items-
|
|
1768
|
+
className: "flex items-start justify-between py-4",
|
|
1557
1769
|
"data-testid": "payment-method-skeleton",
|
|
1558
1770
|
children: [
|
|
1559
|
-
/* @__PURE__ */ a.
|
|
1560
|
-
|
|
1561
|
-
/* @__PURE__ */ a.
|
|
1562
|
-
|
|
1771
|
+
/* @__PURE__ */ a.jsxs("div", { className: "flex items-start gap-3", children: [
|
|
1772
|
+
/* @__PURE__ */ a.jsx("div", { className: "h-8 w-[46px] flex-shrink-0 animate-pulse rounded bg-grayWarm-200" }),
|
|
1773
|
+
/* @__PURE__ */ a.jsxs("div", { className: "space-y-2", children: [
|
|
1774
|
+
/* @__PURE__ */ a.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1775
|
+
/* @__PURE__ */ a.jsx("div", { className: "h-5 w-[120px] animate-pulse rounded bg-grayWarm-200" }),
|
|
1776
|
+
r ? /* @__PURE__ */ a.jsx("div", { className: "h-5 w-[56px] animate-pulse rounded-full bg-grayWarm-200" }) : null
|
|
1777
|
+
] }),
|
|
1778
|
+
/* @__PURE__ */ a.jsx("div", { className: "h-4 w-[100px] animate-pulse rounded bg-grayWarm-200" })
|
|
1779
|
+
] })
|
|
1563
1780
|
] }),
|
|
1564
|
-
/* @__PURE__ */ a.jsx("div", { className: "h-
|
|
1781
|
+
/* @__PURE__ */ a.jsx("div", { className: "h-5 w-5 flex-shrink-0 animate-pulse rounded-full bg-grayWarm-200" })
|
|
1565
1782
|
]
|
|
1566
1783
|
}
|
|
1567
|
-
),
|
|
1784
|
+
), bt = ({
|
|
1568
1785
|
userId: r,
|
|
1569
1786
|
defaultCardholderName: t,
|
|
1570
1787
|
defaultCardholderFirstName: s,
|
|
1571
1788
|
defaultCardholderLastName: o,
|
|
1572
1789
|
selectedId: l,
|
|
1573
|
-
onSelect:
|
|
1574
|
-
onChange:
|
|
1575
|
-
paymentTypeSelector:
|
|
1790
|
+
onSelect: c,
|
|
1791
|
+
onChange: f,
|
|
1792
|
+
paymentTypeSelector: p = !0,
|
|
1576
1793
|
autoSaveFirstCard: y = !0,
|
|
1577
|
-
selectionSetsDefault:
|
|
1578
|
-
showDefaultBadge:
|
|
1579
|
-
|
|
1794
|
+
selectionSetsDefault: W = !1,
|
|
1795
|
+
showDefaultBadge: N = !0,
|
|
1796
|
+
collapsible: b = !1,
|
|
1797
|
+
cardLabelFormat: D = "branded",
|
|
1798
|
+
className: M
|
|
1580
1799
|
}) => {
|
|
1581
|
-
const { items:
|
|
1582
|
-
|
|
1583
|
-
}, []),
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
}, [
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1800
|
+
const { items: X, status: T, error: se, refetch: E } = ut(r), { deletePaymentMethod: S, status: q } = ct(r), { setDefault: ue, status: re } = dt(r), [g, ne] = P([]), [ye, I] = P(null), [R, d] = P(!1), [C, w] = P(null), [$, J] = P(!1), [Y, Q] = P(!1), [z, _] = P(null), [F, fe] = P(!1), ve = B(!1), ge = H(() => {
|
|
1801
|
+
d(!1), w(null), _(null);
|
|
1802
|
+
}, []), we = t ?? ([s, o].filter(Boolean).join(" ") || void 0);
|
|
1803
|
+
L(() => {
|
|
1804
|
+
T === "ready" && ne(wr(X));
|
|
1805
|
+
}, [X, T]), L(() => {
|
|
1806
|
+
if (!c || ve.current || T !== "ready" || g.length === 0 || l) return;
|
|
1807
|
+
ve.current = !0;
|
|
1808
|
+
const u = g.find((ce) => ce.isDefault) ?? g[0];
|
|
1809
|
+
c(u);
|
|
1810
|
+
}, [c, T, g, l]);
|
|
1811
|
+
const me = H(
|
|
1812
|
+
(u) => {
|
|
1813
|
+
ne((ce) => {
|
|
1814
|
+
const te = typeof u == "function" ? u(ce) : u, K = wr(te);
|
|
1815
|
+
return f == null || f(K), K;
|
|
1592
1816
|
});
|
|
1593
1817
|
},
|
|
1594
|
-
[
|
|
1595
|
-
),
|
|
1596
|
-
async (
|
|
1597
|
-
const
|
|
1598
|
-
|
|
1818
|
+
[f]
|
|
1819
|
+
), je = q === "pending" || re === "pending", he = H(
|
|
1820
|
+
async (u) => {
|
|
1821
|
+
const ce = g;
|
|
1822
|
+
I(null), me((te) => te.map((K) => ({ ...K, isDefault: K.id === u.id })));
|
|
1599
1823
|
try {
|
|
1600
|
-
await
|
|
1601
|
-
} catch (
|
|
1602
|
-
|
|
1603
|
-
const
|
|
1604
|
-
|
|
1824
|
+
await ue(u.id), E();
|
|
1825
|
+
} catch (te) {
|
|
1826
|
+
ne(ce), f == null || f(ce);
|
|
1827
|
+
const K = te instanceof Error ? te.message : "Failed to set default payment method.";
|
|
1828
|
+
I(K);
|
|
1605
1829
|
}
|
|
1606
1830
|
},
|
|
1607
|
-
[
|
|
1608
|
-
),
|
|
1609
|
-
(
|
|
1610
|
-
|
|
1831
|
+
[g, me, ue, E, f]
|
|
1832
|
+
), G = H(
|
|
1833
|
+
(u) => {
|
|
1834
|
+
c == null || c(u), W && (u.isDefault || he(u));
|
|
1611
1835
|
},
|
|
1612
|
-
[
|
|
1613
|
-
),
|
|
1614
|
-
async (
|
|
1615
|
-
const
|
|
1616
|
-
|
|
1836
|
+
[c, W, he]
|
|
1837
|
+
), oe = H(
|
|
1838
|
+
async (u) => {
|
|
1839
|
+
const ce = g;
|
|
1840
|
+
I(null);
|
|
1841
|
+
const te = g.filter((be) => be.id !== u.id);
|
|
1842
|
+
me(() => te);
|
|
1843
|
+
const K = u.id === l && c ? te.find((be) => be.isDefault) ?? te[0] ?? null : null;
|
|
1844
|
+
K && G(K);
|
|
1845
|
+
const Le = !!K && W && K !== null && !K.isDefault;
|
|
1617
1846
|
try {
|
|
1618
|
-
await
|
|
1619
|
-
} catch (
|
|
1620
|
-
|
|
1621
|
-
const
|
|
1622
|
-
|
|
1847
|
+
await S(u.id), Le || E();
|
|
1848
|
+
} catch (be) {
|
|
1849
|
+
ne(ce), f == null || f(ce);
|
|
1850
|
+
const Ve = be instanceof Error ? be.message : "Failed to delete payment method.";
|
|
1851
|
+
I(Ve);
|
|
1623
1852
|
}
|
|
1624
1853
|
},
|
|
1625
|
-
[
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1854
|
+
[
|
|
1855
|
+
g,
|
|
1856
|
+
me,
|
|
1857
|
+
S,
|
|
1858
|
+
E,
|
|
1859
|
+
f,
|
|
1860
|
+
l,
|
|
1861
|
+
c,
|
|
1862
|
+
G,
|
|
1863
|
+
W
|
|
1864
|
+
]
|
|
1865
|
+
), ie = H(
|
|
1866
|
+
(u) => {
|
|
1867
|
+
w(null), d(!1), _(null), me((te) => [u, ...te.filter((K) => K.id !== u.id)]), G(u), !!c && W && !u.isDefault || E();
|
|
1629
1868
|
},
|
|
1630
|
-
[
|
|
1631
|
-
),
|
|
1632
|
-
|
|
1633
|
-
}, []), Ee =
|
|
1634
|
-
(
|
|
1635
|
-
|
|
1869
|
+
[me, E, G, c, W]
|
|
1870
|
+
), xe = H((u) => {
|
|
1871
|
+
w(u);
|
|
1872
|
+
}, []), Ee = T === "ready" && g.length === 0, Ne = typeof c == "function", _e = !Ne && !b, le = g.length === 0, v = y && g.length === 0, O = H(
|
|
1873
|
+
(u) => /* @__PURE__ */ a.jsx(
|
|
1874
|
+
Rr,
|
|
1636
1875
|
{
|
|
1637
1876
|
userId: r,
|
|
1638
|
-
isDefault:
|
|
1639
|
-
defaultCardholderName:
|
|
1640
|
-
autoSave: !
|
|
1641
|
-
hideInternalSaveButton:
|
|
1642
|
-
formId:
|
|
1643
|
-
onCanSubmitChange:
|
|
1644
|
-
|
|
1645
|
-
|
|
1877
|
+
isDefault: le,
|
|
1878
|
+
defaultCardholderName: we,
|
|
1879
|
+
autoSave: !u && v,
|
|
1880
|
+
hideInternalSaveButton: u,
|
|
1881
|
+
formId: u ? gr : void 0,
|
|
1882
|
+
onCanSubmitChange: u ? J : void 0,
|
|
1883
|
+
onSavingChange: u ? Q : void 0,
|
|
1884
|
+
autoFocus: u ? "number" : void 0,
|
|
1885
|
+
onSuccess: ie,
|
|
1886
|
+
onError: xe
|
|
1646
1887
|
}
|
|
1647
1888
|
),
|
|
1648
|
-
[r,
|
|
1649
|
-
),
|
|
1650
|
-
|
|
1889
|
+
[r, le, we, v, ie, xe]
|
|
1890
|
+
), V = Ue(() => O(!1), [O]), pe = Ue(() => O(!0), [O]), Ye = Ue(() => p ? /* @__PURE__ */ a.jsx(
|
|
1891
|
+
br,
|
|
1651
1892
|
{
|
|
1652
|
-
selected:
|
|
1653
|
-
onSelect: (
|
|
1654
|
-
creditCardBody:
|
|
1893
|
+
selected: z,
|
|
1894
|
+
onSelect: (u) => _(u),
|
|
1895
|
+
creditCardBody: V
|
|
1655
1896
|
}
|
|
1656
|
-
) :
|
|
1657
|
-
|
|
1897
|
+
) : V, [p, z, V]), ze = Ue(() => p ? /* @__PURE__ */ a.jsx(
|
|
1898
|
+
br,
|
|
1658
1899
|
{
|
|
1659
|
-
selected:
|
|
1660
|
-
onSelect: (
|
|
1661
|
-
creditCardBody:
|
|
1900
|
+
selected: z,
|
|
1901
|
+
onSelect: (u) => _(u),
|
|
1902
|
+
creditCardBody: pe
|
|
1662
1903
|
}
|
|
1663
|
-
) :
|
|
1904
|
+
) : pe, [p, z, pe]);
|
|
1664
1905
|
return /* @__PURE__ */ a.jsxs(
|
|
1665
1906
|
"div",
|
|
1666
1907
|
{
|
|
1667
|
-
className:
|
|
1908
|
+
className: Z("flex w-full flex-col gap-4", M),
|
|
1668
1909
|
"data-testid": "payment-methods-manager",
|
|
1669
1910
|
children: [
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1911
|
+
T === "loading" && g.length === 0 ? (
|
|
1912
|
+
// Only show the skeleton on first load — during a silent refetch
|
|
1913
|
+
// (e.g. after set-default or delete optimistic mutations), the user
|
|
1914
|
+
// already sees the correct optimistic list and a skeleton flash
|
|
1915
|
+
// here would be jarring.
|
|
1916
|
+
/* @__PURE__ */ a.jsxs(
|
|
1917
|
+
"div",
|
|
1918
|
+
{
|
|
1919
|
+
className: Z(
|
|
1920
|
+
// Match the real-list shell so layout doesn't reflow when data
|
|
1921
|
+
// arrives. In selection mode the outer card is suppressed too.
|
|
1922
|
+
_e ? "flex flex-col divide-y divide-grayWarm-200 rounded-xl border border-grayWarm-200 px-4 md:px-6" : "flex flex-col gap-2"
|
|
1923
|
+
),
|
|
1924
|
+
"data-testid": "payment-methods-loading",
|
|
1925
|
+
children: [
|
|
1926
|
+
/* @__PURE__ */ a.jsx(jr, { withDefaultBadge: !0 }),
|
|
1927
|
+
/* @__PURE__ */ a.jsx(jr, {})
|
|
1928
|
+
]
|
|
1929
|
+
}
|
|
1930
|
+
)
|
|
1931
|
+
) : null,
|
|
1932
|
+
T === "error" ? /* @__PURE__ */ a.jsxs(
|
|
1675
1933
|
"div",
|
|
1676
1934
|
{
|
|
1677
1935
|
role: "alert",
|
|
1936
|
+
"aria-live": "polite",
|
|
1678
1937
|
className: "flex items-center justify-between gap-3 rounded-md bg-error-50 p-3 text-sm text-error-700",
|
|
1679
1938
|
"data-testid": "payment-methods-list-error",
|
|
1680
1939
|
children: [
|
|
1681
|
-
/* @__PURE__ */ a.jsx("span", { children:
|
|
1940
|
+
/* @__PURE__ */ a.jsx("span", { children: se ?? "Failed to load payment methods." }),
|
|
1682
1941
|
/* @__PURE__ */ a.jsx(
|
|
1683
1942
|
"button",
|
|
1684
1943
|
{
|
|
1685
1944
|
type: "button",
|
|
1686
|
-
onClick:
|
|
1945
|
+
onClick: E,
|
|
1687
1946
|
className: "rounded-md border border-error-700 px-3 py-1 text-xs font-semibold text-error-700 hover:bg-error-50",
|
|
1688
1947
|
children: "Retry"
|
|
1689
1948
|
}
|
|
@@ -1691,62 +1950,136 @@ const nt = (r) => {
|
|
|
1691
1950
|
]
|
|
1692
1951
|
}
|
|
1693
1952
|
) : null,
|
|
1694
|
-
|
|
1953
|
+
ye ? /* @__PURE__ */ a.jsx(
|
|
1695
1954
|
"div",
|
|
1696
1955
|
{
|
|
1697
1956
|
role: "alert",
|
|
1957
|
+
"aria-live": "polite",
|
|
1698
1958
|
className: "rounded-md bg-error-50 p-3 text-sm text-error-700",
|
|
1699
1959
|
"data-testid": "payment-methods-mutation-error",
|
|
1700
|
-
children:
|
|
1960
|
+
children: ye
|
|
1701
1961
|
}
|
|
1702
1962
|
) : null,
|
|
1703
|
-
|
|
1704
|
-
|
|
1963
|
+
b && g.length > 0 ? /* @__PURE__ */ a.jsx("div", { className: "border-t border-grayWarm-200 pt-4", children: /* @__PURE__ */ a.jsxs(
|
|
1964
|
+
"div",
|
|
1705
1965
|
{
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1966
|
+
className: "flex items-center justify-between",
|
|
1967
|
+
"data-testid": F ? "payment-methods-drawer-header" : "payment-methods-collapsed-preview",
|
|
1968
|
+
children: [
|
|
1969
|
+
F ? /* @__PURE__ */ a.jsx("h3", { className: "text-md font-semibold text-grayWarm-950", children: "Payment methods" }) : /* @__PURE__ */ a.jsx(
|
|
1970
|
+
pt,
|
|
1971
|
+
{
|
|
1972
|
+
method: g.find((u) => u.id === l) ?? g.find((u) => u.isDefault) ?? g[0],
|
|
1973
|
+
cardLabelFormat: D,
|
|
1974
|
+
className: "flex-1"
|
|
1975
|
+
}
|
|
1976
|
+
),
|
|
1977
|
+
/* @__PURE__ */ a.jsx(
|
|
1978
|
+
"button",
|
|
1979
|
+
{
|
|
1980
|
+
type: "button",
|
|
1981
|
+
"aria-label": F ? "Collapse payment methods" : "Expand payment methods",
|
|
1982
|
+
"aria-expanded": F,
|
|
1983
|
+
className: "bg-grayWarm-100 p-2 rounded-lg hover:bg-grayWarm-200 transition-colors",
|
|
1984
|
+
onClick: () => fe((u) => !u),
|
|
1985
|
+
"data-testid": F ? "payment-methods-drawer-close" : "payment-methods-drawer-open",
|
|
1986
|
+
children: /* @__PURE__ */ a.jsx(
|
|
1987
|
+
"img",
|
|
1988
|
+
{
|
|
1989
|
+
src: `${De().iconCdnBaseUrl}/website/assets/icons/chevron-${F ? "up" : "down"}-double.svg`,
|
|
1990
|
+
alt: "",
|
|
1991
|
+
className: "w-5 h-5"
|
|
1992
|
+
}
|
|
1993
|
+
)
|
|
1994
|
+
}
|
|
1995
|
+
)
|
|
1996
|
+
]
|
|
1997
|
+
}
|
|
1998
|
+
) }) : null,
|
|
1999
|
+
g.length > 0 && (!b || F) ? /* @__PURE__ */ a.jsx(
|
|
2000
|
+
"div",
|
|
1723
2001
|
{
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
2002
|
+
className: Z(
|
|
2003
|
+
"flex flex-col",
|
|
2004
|
+
// accounts-ui (non-selectable, non-collapsible): rounded outer card
|
|
2005
|
+
// with divide-y separators between rows.
|
|
2006
|
+
// flights-ui (selectable or collapsible): bare space-y-3 gap between
|
|
2007
|
+
// per-row bordered tiles; no outer card chrome.
|
|
2008
|
+
_e ? "rounded-xl border border-grayWarm-200 px-4 md:px-6 divide-y divide-grayWarm-200" : "space-y-3"
|
|
2009
|
+
),
|
|
2010
|
+
children: g.map((u) => /* @__PURE__ */ a.jsx(
|
|
2011
|
+
ht,
|
|
2012
|
+
{
|
|
2013
|
+
method: u,
|
|
2014
|
+
selectable: Ne,
|
|
2015
|
+
selected: Ne && u.id === l,
|
|
2016
|
+
onSelect: G,
|
|
2017
|
+
onSetDefault: he,
|
|
2018
|
+
onRemove: oe,
|
|
2019
|
+
disabled: je,
|
|
2020
|
+
showDefaultBadge: N,
|
|
2021
|
+
hideSetDefaultMenuItem: W,
|
|
2022
|
+
cardLabelFormat: D
|
|
2023
|
+
},
|
|
2024
|
+
u.id
|
|
2025
|
+
))
|
|
1731
2026
|
}
|
|
1732
2027
|
) : null,
|
|
2028
|
+
Ee ? (
|
|
2029
|
+
// Empty state: render the add-card body inline (per Figma 1536-21454).
|
|
2030
|
+
/* @__PURE__ */ a.jsx("div", { "data-testid": "payment-methods-empty", children: Ye })
|
|
2031
|
+
) : g.length > 0 && (!b || F) ? (
|
|
2032
|
+
// Keep the Add button visible during silent refetches (status flips
|
|
2033
|
+
// back to 'loading' transiently after set-default / delete).
|
|
2034
|
+
// In collapsible mode only show the Add button when the drawer is open.
|
|
2035
|
+
/* @__PURE__ */ a.jsx(
|
|
2036
|
+
"button",
|
|
2037
|
+
{
|
|
2038
|
+
type: "button",
|
|
2039
|
+
onClick: () => {
|
|
2040
|
+
w(null), _(null), J(!1), d(!0);
|
|
2041
|
+
},
|
|
2042
|
+
onMouseEnter: () => {
|
|
2043
|
+
ar().catch(() => {
|
|
2044
|
+
});
|
|
2045
|
+
},
|
|
2046
|
+
onFocus: () => {
|
|
2047
|
+
ar().catch(() => {
|
|
2048
|
+
});
|
|
2049
|
+
},
|
|
2050
|
+
className: "self-start rounded-lg bg-brand-50 px-6 py-3 text-md font-semibold text-brand-600 transition-colors hover:bg-brand-100",
|
|
2051
|
+
"data-testid": "payment-methods-add-trigger",
|
|
2052
|
+
children: "Add payment method"
|
|
2053
|
+
}
|
|
2054
|
+
)
|
|
2055
|
+
) : null,
|
|
1733
2056
|
/* @__PURE__ */ a.jsxs(
|
|
1734
|
-
|
|
2057
|
+
mt,
|
|
1735
2058
|
{
|
|
1736
|
-
open:
|
|
1737
|
-
onClose:
|
|
1738
|
-
formId:
|
|
1739
|
-
saveDisabled:
|
|
2059
|
+
open: R,
|
|
2060
|
+
onClose: ge,
|
|
2061
|
+
formId: gr,
|
|
2062
|
+
saveDisabled: !$,
|
|
2063
|
+
isSaving: Y,
|
|
1740
2064
|
children: [
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
2065
|
+
ze,
|
|
2066
|
+
C ? (
|
|
2067
|
+
// Single source of truth for save-time errors (API failures + hook
|
|
2068
|
+
// init failures forwarded from MovmoCardForm.onError). MovmoCardForm
|
|
2069
|
+
// intentionally does NOT render its own banner — two role="alert"
|
|
2070
|
+
// nodes on the same string is a WCAG 4.1.3 violation (announced
|
|
2071
|
+
// twice). aria-live="polite" so SR users hear new errors but the
|
|
2072
|
+
// announcement doesn't interrupt their current input.
|
|
2073
|
+
/* @__PURE__ */ a.jsx(
|
|
2074
|
+
"p",
|
|
2075
|
+
{
|
|
2076
|
+
role: "alert",
|
|
2077
|
+
"aria-live": "polite",
|
|
2078
|
+
className: "mt-3 rounded-md bg-error-50 px-3 py-2 text-sm text-error-700",
|
|
2079
|
+
"data-testid": "payment-methods-modal-error",
|
|
2080
|
+
children: C
|
|
2081
|
+
}
|
|
2082
|
+
)
|
|
1750
2083
|
) : null
|
|
1751
2084
|
]
|
|
1752
2085
|
}
|
|
@@ -1755,46 +2088,16 @@ const nt = (r) => {
|
|
|
1755
2088
|
}
|
|
1756
2089
|
);
|
|
1757
2090
|
};
|
|
1758
|
-
|
|
1759
|
-
const mt = (r) => {
|
|
1760
|
-
const t = r.toLowerCase();
|
|
1761
|
-
return t === "amex" ? "Amex" : t ? t.charAt(0).toUpperCase() + t.slice(1) : "Card";
|
|
1762
|
-
}, vt = ({
|
|
1763
|
-
method: r,
|
|
1764
|
-
trailing: t,
|
|
1765
|
-
onClick: s,
|
|
1766
|
-
className: o
|
|
1767
|
-
}) => /* @__PURE__ */ a.jsxs(
|
|
1768
|
-
"div",
|
|
1769
|
-
{
|
|
1770
|
-
className: ne("flex items-center gap-3 py-2", s && "cursor-pointer", o),
|
|
1771
|
-
onClick: s,
|
|
1772
|
-
role: s ? "button" : void 0,
|
|
1773
|
-
tabIndex: s ? 0 : void 0,
|
|
1774
|
-
onKeyDown: s ? (l) => {
|
|
1775
|
-
(l.key === "Enter" || l.key === " ") && (l.preventDefault(), s());
|
|
1776
|
-
} : void 0,
|
|
1777
|
-
"data-testid": `payment-method-preview-${r.id}`,
|
|
1778
|
-
children: [
|
|
1779
|
-
/* @__PURE__ */ a.jsx(be, { brand: r.brand, className: "flex-shrink-0" }),
|
|
1780
|
-
/* @__PURE__ */ a.jsxs("span", { className: "flex-1 text-base font-semibold text-grayWarm-900", children: [
|
|
1781
|
-
mt(r.brand),
|
|
1782
|
-
" ",
|
|
1783
|
-
r.last4
|
|
1784
|
-
] }),
|
|
1785
|
-
t
|
|
1786
|
-
]
|
|
1787
|
-
}
|
|
1788
|
-
);
|
|
2091
|
+
bt.displayName = "PaymentMethodsManager";
|
|
1789
2092
|
export {
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
2093
|
+
Rr as MovmoCardForm,
|
|
2094
|
+
pt as PaymentMethodPreview,
|
|
2095
|
+
bt as PaymentMethodsManager,
|
|
2096
|
+
De as getPaymentsConfig,
|
|
2097
|
+
wt as setPaymentsConfig,
|
|
2098
|
+
ct as useDeletePaymentMethod,
|
|
2099
|
+
st as useMovmoCardFields,
|
|
2100
|
+
dt as useSetDefaultPaymentMethod,
|
|
2101
|
+
ut as useUserPaymentMethods
|
|
1799
2102
|
};
|
|
1800
2103
|
//# sourceMappingURL=index.es.js.map
|