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