@odus/checkout 0.4.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/checkout.es.js +548 -470
- package/dist/checkout.umd.js +18 -0
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/checkout.es.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const
|
|
2
|
-
class
|
|
1
|
+
const k = () => "http://localhost:3000";
|
|
2
|
+
class $ {
|
|
3
3
|
apiKey;
|
|
4
4
|
baseUrl;
|
|
5
5
|
browserInfo;
|
|
6
6
|
constructor(e, t, a) {
|
|
7
|
-
this.apiKey = e, this.baseUrl =
|
|
7
|
+
this.apiKey = e, this.baseUrl = k(), this.browserInfo = a || { userAgent: navigator.userAgent };
|
|
8
8
|
}
|
|
9
9
|
async fetchApi({
|
|
10
10
|
endpoint: e,
|
|
@@ -12,40 +12,40 @@ class D {
|
|
|
12
12
|
body: a,
|
|
13
13
|
customHeaders: i = {}
|
|
14
14
|
}) {
|
|
15
|
-
const
|
|
15
|
+
const r = {
|
|
16
16
|
Authorization: `Bearer ${this.apiKey}`,
|
|
17
17
|
"Content-Type": "application/json",
|
|
18
18
|
...i
|
|
19
19
|
};
|
|
20
20
|
try {
|
|
21
|
-
const
|
|
21
|
+
const s = await fetch(`${this.baseUrl}${e}`, {
|
|
22
22
|
method: t,
|
|
23
|
-
headers:
|
|
23
|
+
headers: r,
|
|
24
24
|
body: a ? JSON.stringify(a) : void 0
|
|
25
25
|
});
|
|
26
|
-
if (!
|
|
26
|
+
if (!s.ok) {
|
|
27
27
|
let o;
|
|
28
28
|
try {
|
|
29
|
-
o = await
|
|
29
|
+
o = await s.json();
|
|
30
30
|
} catch (c) {
|
|
31
31
|
console.log("error", c);
|
|
32
32
|
}
|
|
33
33
|
throw {
|
|
34
|
-
message: o?.message[0] || `API request failed: ${
|
|
35
|
-
status:
|
|
36
|
-
statusText:
|
|
34
|
+
message: o?.message[0] || `API request failed: ${s.status} ${s.statusText}`,
|
|
35
|
+
status: s.status,
|
|
36
|
+
statusText: s.statusText,
|
|
37
37
|
details: o
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
-
return
|
|
41
|
-
} catch (
|
|
42
|
-
throw
|
|
43
|
-
message:
|
|
40
|
+
return s.json();
|
|
41
|
+
} catch (s) {
|
|
42
|
+
throw s instanceof Error ? {
|
|
43
|
+
message: s.message,
|
|
44
44
|
status: 0,
|
|
45
45
|
// Use 0 for network/client errors
|
|
46
46
|
statusText: "Network Error",
|
|
47
|
-
details: { message:
|
|
48
|
-
} :
|
|
47
|
+
details: { message: s.message }
|
|
48
|
+
} : s;
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
async authorizePayment({
|
|
@@ -53,12 +53,12 @@ class D {
|
|
|
53
53
|
checkoutKey: t,
|
|
54
54
|
formData: a,
|
|
55
55
|
token: i,
|
|
56
|
-
returnUrl:
|
|
56
|
+
returnUrl: r
|
|
57
57
|
}) {
|
|
58
|
-
let
|
|
58
|
+
let s = {};
|
|
59
59
|
if (i && a) {
|
|
60
60
|
const o = a.cardExpiry.replace(/\s+/g, "").split("/"), l = o[0], c = o[1];
|
|
61
|
-
|
|
61
|
+
s = {
|
|
62
62
|
paymentMethodData: {
|
|
63
63
|
type: "card",
|
|
64
64
|
card: {
|
|
@@ -73,17 +73,17 @@ class D {
|
|
|
73
73
|
name: a.name
|
|
74
74
|
},
|
|
75
75
|
context: {
|
|
76
|
-
returnUrl:
|
|
76
|
+
returnUrl: r,
|
|
77
77
|
browserInfo: this.browserInfo
|
|
78
78
|
}
|
|
79
79
|
};
|
|
80
80
|
} else
|
|
81
|
-
|
|
81
|
+
s = {
|
|
82
82
|
paymentMethodData: {
|
|
83
83
|
type: "paypal"
|
|
84
84
|
},
|
|
85
85
|
context: {
|
|
86
|
-
returnUrl:
|
|
86
|
+
returnUrl: r,
|
|
87
87
|
browserInfo: this.browserInfo
|
|
88
88
|
}
|
|
89
89
|
};
|
|
@@ -92,16 +92,16 @@ class D {
|
|
|
92
92
|
customHeaders: {
|
|
93
93
|
Authorization: `Bearer ${t}`
|
|
94
94
|
},
|
|
95
|
-
body:
|
|
95
|
+
body: s
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
const
|
|
99
|
+
const R = async ({
|
|
100
100
|
id: n,
|
|
101
101
|
apiKey: e,
|
|
102
102
|
environment: t
|
|
103
103
|
}) => {
|
|
104
|
-
const a =
|
|
104
|
+
const a = k(), i = await fetch(`${a}/checkout-profiles/${n}`, {
|
|
105
105
|
method: "GET",
|
|
106
106
|
headers: {
|
|
107
107
|
"Content-Type": "application/json",
|
|
@@ -150,13 +150,13 @@ class V {
|
|
|
150
150
|
return this.events.get(e)?.size || 0;
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
-
const
|
|
154
|
-
class
|
|
153
|
+
const B = new V();
|
|
154
|
+
class O {
|
|
155
155
|
state;
|
|
156
156
|
initialState;
|
|
157
157
|
eventBus;
|
|
158
158
|
stateChangedEvent = "state-changed";
|
|
159
|
-
constructor(e, t =
|
|
159
|
+
constructor(e, t = B) {
|
|
160
160
|
this.initialState = { ...e }, this.state = { ...e }, this.eventBus = t;
|
|
161
161
|
}
|
|
162
162
|
/**
|
|
@@ -196,36 +196,36 @@ class B {
|
|
|
196
196
|
return this.state[e];
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
|
-
function
|
|
200
|
-
return new
|
|
199
|
+
function L(n) {
|
|
200
|
+
return new O(n);
|
|
201
201
|
}
|
|
202
|
-
function
|
|
202
|
+
function H({
|
|
203
203
|
apiKey: n,
|
|
204
204
|
profileId: e,
|
|
205
205
|
environment: t
|
|
206
206
|
}) {
|
|
207
|
-
const a =
|
|
207
|
+
const a = L({
|
|
208
208
|
checkoutProfile: void 0,
|
|
209
209
|
isLoading: !0,
|
|
210
210
|
error: null
|
|
211
211
|
}), i = async () => {
|
|
212
212
|
try {
|
|
213
213
|
a.setState({ isLoading: !0 });
|
|
214
|
-
const
|
|
214
|
+
const r = await R({
|
|
215
215
|
apiKey: n,
|
|
216
216
|
id: e,
|
|
217
217
|
environment: t
|
|
218
218
|
});
|
|
219
|
-
|
|
220
|
-
checkoutProfile:
|
|
219
|
+
r && a.setState({
|
|
220
|
+
checkoutProfile: r,
|
|
221
221
|
isLoading: !1,
|
|
222
222
|
error: null
|
|
223
223
|
});
|
|
224
|
-
} catch (
|
|
224
|
+
} catch (r) {
|
|
225
225
|
a.setState({
|
|
226
226
|
error: "Failed to load checkout profile",
|
|
227
227
|
isLoading: !1
|
|
228
|
-
}), console.error(
|
|
228
|
+
}), console.error(r);
|
|
229
229
|
}
|
|
230
230
|
};
|
|
231
231
|
return i(), {
|
|
@@ -234,13 +234,13 @@ function O({
|
|
|
234
234
|
reload: i
|
|
235
235
|
};
|
|
236
236
|
}
|
|
237
|
-
const
|
|
237
|
+
const z = {
|
|
238
238
|
cardNumber: (n) => (n.replace(/\s/g, "").match(/.{1,4}/g) || []).join(" "),
|
|
239
239
|
cardExpiry: (n) => {
|
|
240
240
|
const t = n.replace(/\D/g, "").slice(0, 4);
|
|
241
241
|
return t.length > 2 ? `${t.slice(0, 2)} / ${t.slice(2)}` : t;
|
|
242
242
|
}
|
|
243
|
-
},
|
|
243
|
+
}, D = {
|
|
244
244
|
"gmail.com": [
|
|
245
245
|
"gmal.com",
|
|
246
246
|
"gmil.com",
|
|
@@ -312,7 +312,7 @@ const T = {
|
|
|
312
312
|
"comcast.net": ["comcast.com", "comcat.net", "comcst.net", "comcastnet", "comcast.nt", "comcas.net"],
|
|
313
313
|
"verizon.net": ["verizon.com", "verizon.nt", "verizonnet", "verizn.net", "verizon.ne", "verzon.net"],
|
|
314
314
|
"att.net": ["att.com", "at.net", "att.nt", "attnet", "att.ne", "attt.net"]
|
|
315
|
-
},
|
|
315
|
+
}, K = (n) => {
|
|
316
316
|
if (!n || n.includes("."))
|
|
317
317
|
return null;
|
|
318
318
|
const e = ["com", "net", "org", "edu", "gov", "io", "co"];
|
|
@@ -325,36 +325,36 @@ const T = {
|
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
327
|
return null;
|
|
328
|
-
},
|
|
328
|
+
}, j = (n, e) => {
|
|
329
329
|
if (n.length === 0) return e.length;
|
|
330
330
|
if (e.length === 0) return n.length;
|
|
331
331
|
const t = e.length + 1, a = n.length + 1, i = Array.from(
|
|
332
332
|
{ length: t },
|
|
333
|
-
(
|
|
333
|
+
(r, s) => Array.from({ length: a }, (o, l) => s === 0 ? l : l === 0 ? s : 0)
|
|
334
334
|
);
|
|
335
|
-
for (let
|
|
336
|
-
for (let
|
|
337
|
-
const o = n[
|
|
338
|
-
i[
|
|
339
|
-
i[
|
|
335
|
+
for (let r = 1; r < t; r++)
|
|
336
|
+
for (let s = 1; s < a; s++) {
|
|
337
|
+
const o = n[s - 1] === e[r - 1] ? 0 : 1;
|
|
338
|
+
i[r][s] = Math.min(
|
|
339
|
+
i[r - 1][s] + 1,
|
|
340
340
|
// deletion
|
|
341
|
-
i[
|
|
341
|
+
i[r][s - 1] + 1,
|
|
342
342
|
// insertion
|
|
343
|
-
i[
|
|
343
|
+
i[r - 1][s - 1] + o
|
|
344
344
|
// substitution
|
|
345
345
|
);
|
|
346
346
|
}
|
|
347
347
|
return i[e.length][n.length];
|
|
348
|
-
},
|
|
348
|
+
}, U = (n) => {
|
|
349
349
|
let t = null, a = 3;
|
|
350
350
|
const i = n.toLowerCase();
|
|
351
|
-
for (const
|
|
352
|
-
const
|
|
353
|
-
|
|
351
|
+
for (const r of Object.keys(D)) {
|
|
352
|
+
const s = j(i, r);
|
|
353
|
+
s <= 2 && s < a && (a = s, t = r);
|
|
354
354
|
}
|
|
355
355
|
return t;
|
|
356
|
-
},
|
|
357
|
-
const { t: n } =
|
|
356
|
+
}, _ = () => {
|
|
357
|
+
const { t: n } = I();
|
|
358
358
|
return {
|
|
359
359
|
validateEmail: (t) => {
|
|
360
360
|
const a = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
@@ -371,25 +371,25 @@ const T = {
|
|
|
371
371
|
message: n("validation.emailInvalid"),
|
|
372
372
|
suggestion: null
|
|
373
373
|
};
|
|
374
|
-
const
|
|
375
|
-
if (!
|
|
376
|
-
const l =
|
|
374
|
+
const r = t.substring(0, i), s = t.substring(i + 1);
|
|
375
|
+
if (!s.includes(".")) {
|
|
376
|
+
const l = K(s);
|
|
377
377
|
if (l)
|
|
378
378
|
return {
|
|
379
379
|
isValid: !1,
|
|
380
380
|
message: n("validation.emailSuggestion", {
|
|
381
|
-
email: `${
|
|
381
|
+
email: `${r}@${l}`
|
|
382
382
|
}),
|
|
383
|
-
suggestion: `${
|
|
383
|
+
suggestion: `${r}@${l}`
|
|
384
384
|
};
|
|
385
|
-
for (const c of Object.keys(
|
|
386
|
-
if (c.replace(/\./g, "") ===
|
|
385
|
+
for (const c of Object.keys(D))
|
|
386
|
+
if (c.replace(/\./g, "") === s)
|
|
387
387
|
return {
|
|
388
388
|
isValid: !1,
|
|
389
389
|
message: n("validation.emailSuggestion", {
|
|
390
|
-
email: `${
|
|
390
|
+
email: `${r}@${c}`
|
|
391
391
|
}),
|
|
392
|
-
suggestion: `${
|
|
392
|
+
suggestion: `${r}@${c}`
|
|
393
393
|
};
|
|
394
394
|
}
|
|
395
395
|
if (!a.test(t))
|
|
@@ -398,9 +398,9 @@ const T = {
|
|
|
398
398
|
message: n("validation.emailInvalid"),
|
|
399
399
|
suggestion: null
|
|
400
400
|
};
|
|
401
|
-
const o =
|
|
402
|
-
if (o && o !==
|
|
403
|
-
const l = `${
|
|
401
|
+
const o = U(s);
|
|
402
|
+
if (o && o !== s) {
|
|
403
|
+
const l = `${r}@${o}`;
|
|
404
404
|
return {
|
|
405
405
|
isValid: !1,
|
|
406
406
|
message: n("validation.emailSuggestion", { email: l }),
|
|
@@ -415,7 +415,7 @@ const T = {
|
|
|
415
415
|
}
|
|
416
416
|
};
|
|
417
417
|
}, q = () => {
|
|
418
|
-
const { t: n } =
|
|
418
|
+
const { t: n } = I(), { validateEmail: e } = _();
|
|
419
419
|
return {
|
|
420
420
|
email: (t) => {
|
|
421
421
|
const a = e(t);
|
|
@@ -426,18 +426,18 @@ const T = {
|
|
|
426
426
|
return n("validation.nameRequired");
|
|
427
427
|
},
|
|
428
428
|
cardExpiry: (t) => {
|
|
429
|
-
const a = t.replace(/\s/g, ""), [i,
|
|
430
|
-
if (!i || !
|
|
429
|
+
const a = t.replace(/\s/g, ""), [i, r] = a.split("/").map((u) => u.trim());
|
|
430
|
+
if (!i || !r || i.length !== 2 || r.length !== 2)
|
|
431
431
|
return n("validation.cardExpiryFormat");
|
|
432
|
-
const
|
|
432
|
+
const s = /* @__PURE__ */ new Date(), o = s.getFullYear() % 100, l = s.getMonth() + 1, c = parseInt(i, 10), d = parseInt(r, 10);
|
|
433
433
|
if (c < 1 || c > 12)
|
|
434
434
|
return n("validation.cardExpiryFormat");
|
|
435
|
-
if (
|
|
435
|
+
if (d < o || d === o && c < l)
|
|
436
436
|
return n("validation.cardExpiryInvalid");
|
|
437
437
|
}
|
|
438
438
|
};
|
|
439
|
-
},
|
|
440
|
-
const n = q(), e =
|
|
439
|
+
}, Y = () => {
|
|
440
|
+
const n = q(), e = L({
|
|
441
441
|
formData: {
|
|
442
442
|
name: "",
|
|
443
443
|
email: "",
|
|
@@ -451,58 +451,58 @@ const T = {
|
|
|
451
451
|
},
|
|
452
452
|
isValid: !1
|
|
453
453
|
}), t = (l, c) => {
|
|
454
|
-
const
|
|
455
|
-
return
|
|
454
|
+
const d = n[l];
|
|
455
|
+
return d?.(c);
|
|
456
456
|
}, a = (l) => {
|
|
457
457
|
const c = {};
|
|
458
|
-
return Object.keys(l).forEach((
|
|
459
|
-
const
|
|
460
|
-
|
|
458
|
+
return Object.keys(l).forEach((d) => {
|
|
459
|
+
const u = t(d, l[d]);
|
|
460
|
+
u && (c[d] = u);
|
|
461
461
|
}), c;
|
|
462
462
|
}, i = (l) => {
|
|
463
463
|
const c = a(l);
|
|
464
464
|
return Object.keys(c).length === 0;
|
|
465
|
-
},
|
|
466
|
-
const
|
|
467
|
-
let
|
|
468
|
-
l in
|
|
469
|
-
const
|
|
470
|
-
...
|
|
471
|
-
[l]:
|
|
472
|
-
},
|
|
473
|
-
if (
|
|
474
|
-
const
|
|
475
|
-
|
|
465
|
+
}, r = (l, c) => {
|
|
466
|
+
const d = e.getState();
|
|
467
|
+
let u = c;
|
|
468
|
+
l in z && (u = z[l](c));
|
|
469
|
+
const E = {
|
|
470
|
+
...d.formData,
|
|
471
|
+
[l]: u
|
|
472
|
+
}, v = { ...d.errors };
|
|
473
|
+
if (d.touched[l]) {
|
|
474
|
+
const m = t(l, u);
|
|
475
|
+
m ? v[l] = m : delete v[l];
|
|
476
476
|
}
|
|
477
477
|
e.setState({
|
|
478
|
-
formData:
|
|
479
|
-
errors:
|
|
480
|
-
isValid: i(
|
|
478
|
+
formData: E,
|
|
479
|
+
errors: v,
|
|
480
|
+
isValid: i(E)
|
|
481
481
|
});
|
|
482
|
-
},
|
|
483
|
-
const
|
|
484
|
-
...
|
|
482
|
+
}, s = (l, c) => {
|
|
483
|
+
const d = e.getState(), u = {
|
|
484
|
+
...d.touched,
|
|
485
485
|
[l]: !0
|
|
486
|
-
},
|
|
487
|
-
|
|
488
|
-
touched:
|
|
489
|
-
errors:
|
|
486
|
+
}, E = t(l, c), v = { ...d.errors };
|
|
487
|
+
E ? v[l] = E : delete v[l], e.setState({
|
|
488
|
+
touched: u,
|
|
489
|
+
errors: v
|
|
490
490
|
});
|
|
491
491
|
}, o = (l) => {
|
|
492
|
-
const
|
|
492
|
+
const d = {
|
|
493
493
|
...e.getState().formData,
|
|
494
494
|
...l
|
|
495
495
|
};
|
|
496
496
|
e.setState({
|
|
497
|
-
formData:
|
|
498
|
-
isValid: i(
|
|
497
|
+
formData: d,
|
|
498
|
+
isValid: i(d)
|
|
499
499
|
});
|
|
500
500
|
};
|
|
501
501
|
return {
|
|
502
502
|
getFormState: e.getState.bind(e),
|
|
503
503
|
subscribe: e.subscribe.bind(e),
|
|
504
|
-
handleChange:
|
|
505
|
-
handleBlur:
|
|
504
|
+
handleChange: r,
|
|
505
|
+
handleBlur: s,
|
|
506
506
|
setFormData: o,
|
|
507
507
|
reset: e.resetState.bind(e)
|
|
508
508
|
};
|
|
@@ -511,7 +511,7 @@ const T = {
|
|
|
511
511
|
apiKey: e,
|
|
512
512
|
environment: t
|
|
513
513
|
}) => {
|
|
514
|
-
const a =
|
|
514
|
+
const a = k(), i = await fetch(
|
|
515
515
|
`${a}/tokenization/generate-iframe-configuration`,
|
|
516
516
|
{
|
|
517
517
|
method: "POST",
|
|
@@ -525,8 +525,8 @@ const T = {
|
|
|
525
525
|
if (!i.ok)
|
|
526
526
|
throw new Error(`HTTP error! Status: ${i.status}`);
|
|
527
527
|
return await i.json();
|
|
528
|
-
};
|
|
529
|
-
function
|
|
528
|
+
}, Z = 100, J = 2, W = 2e3, X = 5;
|
|
529
|
+
function Q({
|
|
530
530
|
apiKey: n,
|
|
531
531
|
// scriptLoaded,
|
|
532
532
|
checkoutProfile: e,
|
|
@@ -534,7 +534,7 @@ function Y({
|
|
|
534
534
|
setFormData: a,
|
|
535
535
|
environment: i
|
|
536
536
|
}) {
|
|
537
|
-
const
|
|
537
|
+
const r = L({
|
|
538
538
|
iframeConfig: void 0,
|
|
539
539
|
loadingIframe: !0,
|
|
540
540
|
isCcValid: !1,
|
|
@@ -543,7 +543,7 @@ function Y({
|
|
|
543
543
|
isCvvFocused: !1,
|
|
544
544
|
possibleCardType: "unknown"
|
|
545
545
|
});
|
|
546
|
-
let
|
|
546
|
+
let s = null;
|
|
547
547
|
const o = async () => {
|
|
548
548
|
try {
|
|
549
549
|
const m = await G({
|
|
@@ -553,175 +553,227 @@ function Y({
|
|
|
553
553
|
apiKey: n,
|
|
554
554
|
environment: i
|
|
555
555
|
});
|
|
556
|
-
m && (
|
|
556
|
+
m && (r.setState({
|
|
557
557
|
iframeConfig: {
|
|
558
558
|
...m,
|
|
559
559
|
origin: globalThis.location.origin
|
|
560
560
|
}
|
|
561
|
-
}),
|
|
561
|
+
}), d());
|
|
562
562
|
} catch (m) {
|
|
563
563
|
console.error("Failed to generate iframe config:", m);
|
|
564
564
|
}
|
|
565
565
|
}, l = () => {
|
|
566
|
-
const m =
|
|
567
|
-
if (m.iframeConfig
|
|
568
|
-
|
|
569
|
-
|
|
566
|
+
const m = r.getState();
|
|
567
|
+
if (!m.iframeConfig || !e)
|
|
568
|
+
return;
|
|
569
|
+
const g = document.getElementById("card-element"), f = document.getElementById("card-cvv-element");
|
|
570
|
+
if (!g || !f)
|
|
571
|
+
throw new Error("Card elements not found in DOM");
|
|
572
|
+
console.log("✅ TokenEx iframe initializing successfully:", {
|
|
573
|
+
cardElementId: g.id,
|
|
574
|
+
cvvElementId: f.id,
|
|
575
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
576
|
+
}), s = new globalThis.TokenEx.Iframe("card-element", {
|
|
577
|
+
...m.iframeConfig,
|
|
578
|
+
placeholder: "1234 1234 1234 1234",
|
|
579
|
+
cvvPlaceholder: "CVC",
|
|
580
|
+
cvv: !0,
|
|
581
|
+
cvvContainerID: "card-cvv-element",
|
|
582
|
+
enableValidateOnBlur: !1,
|
|
583
|
+
enableValidateOnKeyUp: !0,
|
|
584
|
+
enableValidateOnCvvKeyUp: !0,
|
|
585
|
+
enablePrettyFormat: !0,
|
|
586
|
+
inputMode: "numeric",
|
|
587
|
+
cvvInputType: "numeric",
|
|
588
|
+
font: e.styles.fontFamily,
|
|
589
|
+
enableAutoComplete: !0,
|
|
590
|
+
returnAutoCompleteValues: !0,
|
|
591
|
+
useExtendedBIN: !0,
|
|
592
|
+
styles: {
|
|
593
|
+
...t,
|
|
594
|
+
base: `${t.base}; sans-serif; border-radius: ${e.styles.borderRadius}px ${e.styles.borderRadius}px 0px 0px`,
|
|
595
|
+
cvv: {
|
|
596
|
+
...t,
|
|
597
|
+
base: `${t.base}; border-radius: 0px 0px ${e.styles.borderRadius}px 0px`
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
}), s.on("load", () => {
|
|
601
|
+
r.setState({ loadingIframe: !1 });
|
|
602
|
+
}), s.on("autoCompleteValues", function(p) {
|
|
603
|
+
const { nameOnCard: C, cardExp: b } = p;
|
|
604
|
+
a({
|
|
605
|
+
name: C,
|
|
606
|
+
cardExpiry: b
|
|
607
|
+
});
|
|
608
|
+
}), s.on("validate", function(p) {
|
|
609
|
+
const { isValid: C, isCvvValid: b } = p;
|
|
610
|
+
r.setState({
|
|
611
|
+
isCcValid: C,
|
|
612
|
+
isCvvValid: b
|
|
613
|
+
});
|
|
614
|
+
}), s.on("focus", function() {
|
|
615
|
+
r.setState({ isFocused: !0 });
|
|
616
|
+
}), s.on("blur", function() {
|
|
617
|
+
r.setState({ isFocused: !1 });
|
|
618
|
+
}), s.on("cvvFocus", function() {
|
|
619
|
+
r.setState({ isCvvFocused: !0 });
|
|
620
|
+
}), s.on("cvvBlur", function() {
|
|
621
|
+
r.setState({ isCvvFocused: !1 });
|
|
622
|
+
}), s.on(
|
|
623
|
+
"cardTypeChange",
|
|
624
|
+
function({ possibleCardType: p }) {
|
|
625
|
+
r.setState({ possibleCardType: p });
|
|
626
|
+
}
|
|
627
|
+
), s.load();
|
|
628
|
+
}, c = () => {
|
|
629
|
+
let m = 0;
|
|
630
|
+
const g = X;
|
|
631
|
+
console.warn(
|
|
632
|
+
"Card elements not found in DOM, retrying iframe initialization..."
|
|
633
|
+
);
|
|
634
|
+
const f = () => {
|
|
635
|
+
if (m++, m > g) {
|
|
636
|
+
console.error("Failed to find card elements after maximum retries");
|
|
570
637
|
return;
|
|
571
638
|
}
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
cvvInputType: "numeric",
|
|
584
|
-
font: e.styles.fontFamily,
|
|
585
|
-
enableAutoComplete: !0,
|
|
586
|
-
returnAutoCompleteValues: !0,
|
|
587
|
-
useExtendedBIN: !0,
|
|
588
|
-
styles: {
|
|
589
|
-
...t,
|
|
590
|
-
base: `${t.base}; sans-serif; border-radius: ${e.styles.borderRadius}px ${e.styles.borderRadius}px 0px 0px`,
|
|
591
|
-
cvv: {
|
|
592
|
-
...t,
|
|
593
|
-
base: `${t.base}; border-radius: 0px 0px ${e.styles.borderRadius}px 0px`
|
|
639
|
+
const p = Math.min(
|
|
640
|
+
Z * Math.pow(J, m - 1),
|
|
641
|
+
W
|
|
642
|
+
);
|
|
643
|
+
setTimeout(() => {
|
|
644
|
+
const C = document.getElementById("card-element"), b = document.getElementById("card-cvv-element");
|
|
645
|
+
if (C && b)
|
|
646
|
+
try {
|
|
647
|
+
l();
|
|
648
|
+
} catch (y) {
|
|
649
|
+
console.error("Failed to create TokenEx iframe:", y);
|
|
594
650
|
}
|
|
595
|
-
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
const { isValid: p, isCvvValid: f } = u;
|
|
606
|
-
s.setState({
|
|
607
|
-
isCcValid: p,
|
|
608
|
-
isCvvValid: f
|
|
609
|
-
});
|
|
610
|
-
}), r.on("focus", function() {
|
|
611
|
-
s.setState({ isFocused: !0 });
|
|
612
|
-
}), r.on("blur", function() {
|
|
613
|
-
s.setState({ isFocused: !1 });
|
|
614
|
-
}), r.on("cvvFocus", function() {
|
|
615
|
-
s.setState({ isCvvFocused: !0 });
|
|
616
|
-
}), r.on("cvvBlur", function() {
|
|
617
|
-
s.setState({ isCvvFocused: !1 });
|
|
618
|
-
}), r.on(
|
|
619
|
-
"cardTypeChange",
|
|
620
|
-
function({ possibleCardType: u }) {
|
|
621
|
-
s.setState({ possibleCardType: u });
|
|
622
|
-
}
|
|
623
|
-
), r.load();
|
|
651
|
+
else m < g && f();
|
|
652
|
+
}, p);
|
|
653
|
+
};
|
|
654
|
+
f();
|
|
655
|
+
}, d = () => {
|
|
656
|
+
if (!r.getState().iframeConfig || !e)
|
|
657
|
+
return;
|
|
658
|
+
if (!globalThis.TokenEx?.Iframe) {
|
|
659
|
+
console.error("TokenEx script not loaded correctly");
|
|
660
|
+
return;
|
|
624
661
|
}
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
662
|
+
const g = document.getElementById("card-element"), f = document.getElementById("card-cvv-element");
|
|
663
|
+
if (console.log("🔍 TokenEx iframe initialization check:", {
|
|
664
|
+
cardElementExists: !!g,
|
|
665
|
+
cvvElementExists: !!f,
|
|
666
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
667
|
+
}), !g || !f) {
|
|
668
|
+
c();
|
|
669
|
+
return;
|
|
670
|
+
}
|
|
671
|
+
try {
|
|
672
|
+
l();
|
|
673
|
+
} catch (p) {
|
|
674
|
+
console.error("Failed to create TokenEx iframe:", p);
|
|
675
|
+
}
|
|
676
|
+
}, u = async () => {
|
|
677
|
+
n && await o();
|
|
678
|
+
}, E = () => {
|
|
679
|
+
s && (s.remove(), s = null);
|
|
680
|
+
}, v = async (m) => {
|
|
681
|
+
s && (s.on("tokenize", async function(g) {
|
|
682
|
+
await m(g);
|
|
683
|
+
}), s.tokenize());
|
|
633
684
|
};
|
|
634
685
|
return {
|
|
635
|
-
getState:
|
|
636
|
-
subscribe:
|
|
637
|
-
tokenize:
|
|
638
|
-
cleanup:
|
|
686
|
+
getState: r.getState.bind(r),
|
|
687
|
+
subscribe: r.subscribe.bind(r),
|
|
688
|
+
tokenize: v,
|
|
689
|
+
cleanup: E,
|
|
690
|
+
initialize: u
|
|
639
691
|
};
|
|
640
692
|
}
|
|
641
|
-
const
|
|
642
|
-
email:
|
|
643
|
-
cardholderNameLabel:
|
|
644
|
-
cardInformation:
|
|
645
|
-
cardholderNamePlaceholder:
|
|
646
|
-
cardExpiry:
|
|
647
|
-
loading:
|
|
648
|
-
buttonTexts:
|
|
649
|
-
validation:
|
|
650
|
-
},
|
|
651
|
-
email:
|
|
652
|
-
cardholderNameLabel:
|
|
653
|
-
cardInformation:
|
|
654
|
-
cardholderNamePlaceholder:
|
|
655
|
-
cardExpiry:
|
|
656
|
-
loading:
|
|
657
|
-
buttonTexts:
|
|
658
|
-
validation:
|
|
659
|
-
},
|
|
660
|
-
email:
|
|
661
|
-
cardholderNameLabel:
|
|
662
|
-
cardInformation:
|
|
663
|
-
cardholderNamePlaceholder:
|
|
664
|
-
cardExpiry:
|
|
665
|
-
loading:
|
|
666
|
-
buttonTexts:
|
|
667
|
-
validation:
|
|
668
|
-
},
|
|
669
|
-
email:
|
|
670
|
-
cardholderNameLabel:
|
|
671
|
-
cardInformation:
|
|
672
|
-
cardholderNamePlaceholder:
|
|
673
|
-
cardExpiry:
|
|
674
|
-
loading:
|
|
675
|
-
buttonTexts:
|
|
676
|
-
validation:
|
|
677
|
-
},
|
|
678
|
-
email:
|
|
679
|
-
cardholderNameLabel:
|
|
680
|
-
cardInformation:
|
|
681
|
-
cardholderNamePlaceholder:
|
|
682
|
-
cardExpiry:
|
|
683
|
-
loading:
|
|
684
|
-
buttonTexts:
|
|
685
|
-
validation:
|
|
686
|
-
},
|
|
687
|
-
email:
|
|
688
|
-
cardholderNameLabel:
|
|
689
|
-
cardInformation:
|
|
690
|
-
cardholderNamePlaceholder:
|
|
691
|
-
cardExpiry:
|
|
692
|
-
loading:
|
|
693
|
-
buttonTexts:
|
|
694
|
-
validation:
|
|
695
|
-
},
|
|
696
|
-
email:
|
|
697
|
-
cardholderNameLabel:
|
|
698
|
-
cardInformation:
|
|
699
|
-
cardholderNamePlaceholder:
|
|
700
|
-
cardExpiry:
|
|
701
|
-
loading:
|
|
702
|
-
buttonTexts:
|
|
703
|
-
validation:
|
|
704
|
-
},
|
|
705
|
-
email:
|
|
706
|
-
cardholderNameLabel:
|
|
707
|
-
cardInformation:
|
|
708
|
-
cardholderNamePlaceholder:
|
|
709
|
-
cardExpiry:
|
|
710
|
-
loading:
|
|
711
|
-
buttonTexts:
|
|
712
|
-
validation:
|
|
713
|
-
},
|
|
714
|
-
en:
|
|
715
|
-
de:
|
|
716
|
-
es:
|
|
717
|
-
fr:
|
|
718
|
-
pl:
|
|
719
|
-
pt:
|
|
720
|
-
tr:
|
|
721
|
-
it:
|
|
693
|
+
const ee = "E-Mail", te = "Name des/der Karteninhaber/in", ae = "Kartendaten", ie = "Vollständiger Name", re = "MM / JJ", se = "Das Fenster nicht schließen", ne = { pay: "ZAHLEN", submit: "ABSENDEN", getPlan: "MEINEN PLAN ERHALTEN", donate: "spenden", book: "jetzt buchen", order: "jetzt bestellen" }, oe = { emailSuggestion: "Meinten Sie {{email}}?", emailInvalid: "Ihre E-Mail-Adresse ist nicht korrekt", cardExpiryInvalid: "Das Ablaufdatum Ihrer Karte liegt in der Vergangenheit", cardExpiryFormat: "Das Ablaufdatum Ihrer Karte ist unvollständig", cardSecurityFormat: "Der Sicherheitscode Ihrer Karte ist unvollständig", nameRequired: "Gib deinen Namen genau so ein, wie er auf deiner Karte steht", cardNumberInvalid: "Die Kartennummer ist unvollständig" }, le = {
|
|
694
|
+
email: ee,
|
|
695
|
+
cardholderNameLabel: te,
|
|
696
|
+
cardInformation: ae,
|
|
697
|
+
cardholderNamePlaceholder: ie,
|
|
698
|
+
cardExpiry: re,
|
|
699
|
+
loading: se,
|
|
700
|
+
buttonTexts: ne,
|
|
701
|
+
validation: oe
|
|
702
|
+
}, ce = "Email", de = "Cardholder name", he = "Card information", me = "Full name on card", ue = "MM / YY", pe = "Do not close the window", fe = { pay: "PAY", submit: "SUBMIT", getPlan: "GET MY PLAN", donate: "DONATE", book: "BOOK NOW", order: "ORDER NOW" }, ge = { emailSuggestion: "Did you mean {{email}}?", emailInvalid: "Your email is not correct", cardExpiryInvalid: "Your card's expiration date is in the past", cardExpiryFormat: "Your card’s expiration date is incomplete", cardSecurityFormat: "Your card’s security code is incomplete", nameRequired: "Please enter the name as it appears on your card", cardNumberInvalid: "Your card number is invalid" }, ve = {
|
|
703
|
+
email: ce,
|
|
704
|
+
cardholderNameLabel: de,
|
|
705
|
+
cardInformation: he,
|
|
706
|
+
cardholderNamePlaceholder: me,
|
|
707
|
+
cardExpiry: ue,
|
|
708
|
+
loading: pe,
|
|
709
|
+
buttonTexts: fe,
|
|
710
|
+
validation: ge
|
|
711
|
+
}, ye = "Correo electrónico", Ee = "Nombre del titular de la tarjeta", be = "Información de la tarjeta", Ce = "Nombre completo en la tarjeta", Se = "MM / AA", xe = "Por favor, no cierre esta ventana", Fe = { pay: "PAGAR", submit: "ENVIAR", getPlan: "OBTENER MI PLAN", donate: "DONAR", book: "RESERVAR AHORA", order: "ORDENAR AHORA" }, we = { emailSuggestion: "¿Quisiste decir {{email}}?", emailInvalid: "Su correo electrónico no es válido", cardExpiryInvalid: "La fecha de vencimiento de la tarjeta ya pasó", cardExpiryFormat: "La fecha de vencimiento de su tarjeta está incompleta", cardSecurityFormat: "El código de seguridad de su tarjeta está incompleto", nameRequired: "Por favor, ingrese el nombre tal como aparece en su tarjeta", cardNumberInvalid: "Su número de tarjeta no es válido" }, Le = {
|
|
712
|
+
email: ye,
|
|
713
|
+
cardholderNameLabel: Ee,
|
|
714
|
+
cardInformation: be,
|
|
715
|
+
cardholderNamePlaceholder: Ce,
|
|
716
|
+
cardExpiry: Se,
|
|
717
|
+
loading: xe,
|
|
718
|
+
buttonTexts: Fe,
|
|
719
|
+
validation: we
|
|
720
|
+
}, Me = "E-mail", ke = "Nom du titulaire de la carte", Ie = "Informations de la carte", Te = "Nom complet figurant sur la carte", ze = "MM / AA", Ne = "Veuillez ne pas fermer cette fenêtre", Ae = { pay: "PAYER", submit: "ENVOYER", getPlan: "OBTENIR MON PLAN", donate: "FAIRE UN DON", book: "RÉSERVER MAINTENANT", order: "COMMANDER MAINTENANT" }, Pe = { emailSuggestion: "Vouliez-vous dire {{email}}?", emailInvalid: "Votre adresse e-mail n’est pas valide", cardExpiryInvalid: "La date d'expiration de votre carte est dans le passé", cardExpiryFormat: "La date d’expiration de votre carte est incomplète", cardSecurityFormat: "Le code de sécurité de votre carte est incomplet", nameRequired: "Veuillez saisir le nom tel qu’il figure sur votre carte", cardNumberInvalid: "Votre numéro de carte est invalide" }, De = {
|
|
721
|
+
email: Me,
|
|
722
|
+
cardholderNameLabel: ke,
|
|
723
|
+
cardInformation: Ie,
|
|
724
|
+
cardholderNamePlaceholder: Te,
|
|
725
|
+
cardExpiry: ze,
|
|
726
|
+
loading: Ne,
|
|
727
|
+
buttonTexts: Ae,
|
|
728
|
+
validation: Pe
|
|
729
|
+
}, $e = "Email", Re = "Nome del titolare della carta", Ve = "Informazioni sulla carta", Be = "Nome completo sulla carta", Oe = "MM / AA", He = "Non chiudere la finestra", Ke = { pay: "PAGA", submit: "INVIA", getPlan: "OTTIENI IL MIO PIANO", donate: "DONARE", book: "PRENOTA ORA", order: "ORDINA ORA" }, je = { emailSuggestion: "Intendevi {{email}}?", emailInvalid: "La tua email non è corretta", cardExpiryInvalid: "La data di scadenza della tua carta è nel passato", cardExpiryFormat: "La data di scadenza della tua carta è incompleta", cardSecurityFormat: "Il codice di sicurezza della tua carta è incompleto", nameRequired: "Inserisci il nome come appare sulla tua carta", cardNumberInvalid: "Il numero della tua carta non è valido" }, Ue = {
|
|
730
|
+
email: $e,
|
|
731
|
+
cardholderNameLabel: Re,
|
|
732
|
+
cardInformation: Ve,
|
|
733
|
+
cardholderNamePlaceholder: Be,
|
|
734
|
+
cardExpiry: Oe,
|
|
735
|
+
loading: He,
|
|
736
|
+
buttonTexts: Ke,
|
|
737
|
+
validation: je
|
|
738
|
+
}, _e = "Adres e-mail", qe = "Imię i nazwisko posiadacza karty", Ye = "Informacje o karcie", Ge = "Imię i nazwisko na karcie", Ze = "MM / RR", Je = "Proszę nie zamykać tego okna", We = { pay: "ZAPŁAĆ", submit: "WYŚLIJ", getPlan: "POBIERZ MÓJ PLAN", donate: "PRZEKAŻ DAROWIZNĘ", book: "ZAREZERWUJ TERAZ", order: "ZAMÓW TERAZ" }, Xe = { emailSuggestion: "Czy chodziło Ci o {{email}}?", emailInvalid: "Państwa adres e-mail jest nieprawidłowy", cardExpiryInvalid: "Data ważności Państwa karty jest w przeszłości", cardExpiryFormat: "Data ważności Państwa karty jest niekompletna", cardSecurityFormat: "Kod zabezpieczający Państwa karty jest niekompletny", nameRequired: "Proszę wpisać imię i nazwisko tak, jak widnieje na karcie", cardNumberInvalid: "Numer Państwa karty jest nieprawidłowy" }, Qe = {
|
|
739
|
+
email: _e,
|
|
740
|
+
cardholderNameLabel: qe,
|
|
741
|
+
cardInformation: Ye,
|
|
742
|
+
cardholderNamePlaceholder: Ge,
|
|
743
|
+
cardExpiry: Ze,
|
|
744
|
+
loading: Je,
|
|
745
|
+
buttonTexts: We,
|
|
746
|
+
validation: Xe
|
|
747
|
+
}, et = "E-mail", tt = "Nome do titular do cartão", at = "Informações do cartão", it = "Nome completo no cartão", rt = "MM / AA", st = "Por favor, não feche esta janela", nt = { pay: "PAGAR", submit: "ENVIAR", getPlan: "OBTER MEU PLANO", donate: "DOAR", book: "RESERVAR AGORA", order: "FAZER PEDIDO" }, ot = { emailSuggestion: "Você quis dizer {{email}}?", emailInvalid: "O seu endereço de e-mail não é válido", cardExpiryInvalid: "A data de validade do seu cartão está no passado", cardExpiryFormat: "A data de validade do seu cartão está incompleta", cardSecurityFormat: "O código de segurança do seu cartão está incompleto", nameRequired: "Por favor, insira o nome conforme aparece no cartão", cardNumberInvalid: "O número do seu cartão é inválido" }, lt = {
|
|
748
|
+
email: et,
|
|
749
|
+
cardholderNameLabel: tt,
|
|
750
|
+
cardInformation: at,
|
|
751
|
+
cardholderNamePlaceholder: it,
|
|
752
|
+
cardExpiry: rt,
|
|
753
|
+
loading: st,
|
|
754
|
+
buttonTexts: nt,
|
|
755
|
+
validation: ot
|
|
756
|
+
}, ct = "E-posta", dt = "Kart sahibinin adı", ht = "Kart bilgileri", mt = "Kart üzerindeki tam ad", ut = "AA / YY", pt = "Lütfen pencereyi kapatmayın", ft = { pay: "ÖDE", submit: "GÖNDER", getPlan: "PLANIMI AL", donate: "BAĞIŞ YAP", book: "ŞİMDİ REZERVASYON YAP", order: "ŞİMDİ SİPARİŞ VER" }, gt = { emailSuggestion: "{{email}} demek mi istediniz?", emailInvalid: "E-posta adresiniz geçerli değil", cardExpiryInvalid: "Kartınızın son kullanma tarihi geçmiş", cardExpiryFormat: "Kartınızın son kullanma tarihi eksik", cardSecurityFormat: "Kartınızın güvenlik kodu eksik", nameRequired: "Lütfen kart üzerindeki ismi girin", cardNumberInvalid: "Kart numaranız geçersiz" }, vt = {
|
|
757
|
+
email: ct,
|
|
758
|
+
cardholderNameLabel: dt,
|
|
759
|
+
cardInformation: ht,
|
|
760
|
+
cardholderNamePlaceholder: mt,
|
|
761
|
+
cardExpiry: ut,
|
|
762
|
+
loading: pt,
|
|
763
|
+
buttonTexts: ft,
|
|
764
|
+
validation: gt
|
|
765
|
+
}, N = {
|
|
766
|
+
en: ve,
|
|
767
|
+
de: le,
|
|
768
|
+
es: Le,
|
|
769
|
+
fr: De,
|
|
770
|
+
pl: Qe,
|
|
771
|
+
pt: lt,
|
|
772
|
+
tr: vt,
|
|
773
|
+
it: Ue
|
|
722
774
|
// Add other locales here
|
|
723
775
|
};
|
|
724
|
-
class
|
|
776
|
+
class yt {
|
|
725
777
|
locale;
|
|
726
778
|
loadedLocales = /* @__PURE__ */ new Set();
|
|
727
779
|
constructor(e = "en") {
|
|
@@ -739,27 +791,27 @@ class ut {
|
|
|
739
791
|
}
|
|
740
792
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
741
793
|
getNestedTranslation(e) {
|
|
742
|
-
const t = this.locale in
|
|
794
|
+
const t = this.locale in N ? N[this.locale] : {}, a = this.findNestedValue(t, e);
|
|
743
795
|
return a === void 0 ? e : a;
|
|
744
796
|
}
|
|
745
797
|
findNestedValue(e, t) {
|
|
746
798
|
const a = t.split(".");
|
|
747
799
|
let i = e;
|
|
748
|
-
for (const
|
|
749
|
-
if (i == null || !Object.prototype.hasOwnProperty.call(i,
|
|
800
|
+
for (const r of a) {
|
|
801
|
+
if (i == null || !Object.prototype.hasOwnProperty.call(i, r))
|
|
750
802
|
return;
|
|
751
|
-
i = i[
|
|
803
|
+
i = i[r];
|
|
752
804
|
}
|
|
753
805
|
return typeof i == "string" ? i : void 0;
|
|
754
806
|
}
|
|
755
807
|
interpolate(e, t) {
|
|
756
808
|
return e.replace(/{{(\w+)}}/g, (a, i) => {
|
|
757
|
-
const
|
|
758
|
-
return
|
|
809
|
+
const r = t[i];
|
|
810
|
+
return r === void 0 ? a : String(r);
|
|
759
811
|
});
|
|
760
812
|
}
|
|
761
813
|
}
|
|
762
|
-
const
|
|
814
|
+
const A = [
|
|
763
815
|
"en",
|
|
764
816
|
"de",
|
|
765
817
|
"es",
|
|
@@ -768,14 +820,14 @@ const N = [
|
|
|
768
820
|
"pt",
|
|
769
821
|
"it",
|
|
770
822
|
"tr"
|
|
771
|
-
],
|
|
772
|
-
function
|
|
773
|
-
const e = new
|
|
823
|
+
], Et = "en";
|
|
824
|
+
function bt(n) {
|
|
825
|
+
const e = new yt(), a = (() => {
|
|
774
826
|
const o = navigator?.language?.split("-")[0]?.toLowerCase();
|
|
775
|
-
return
|
|
827
|
+
return A.includes(o) ? o : Et;
|
|
776
828
|
})();
|
|
777
829
|
e.setLocale(a);
|
|
778
|
-
const i =
|
|
830
|
+
const i = L({
|
|
779
831
|
locale: a,
|
|
780
832
|
translationService: e
|
|
781
833
|
});
|
|
@@ -783,14 +835,14 @@ function ft(n) {
|
|
|
783
835
|
store: i,
|
|
784
836
|
translate: (o, l) => i.getState().translationService.translate(o, l),
|
|
785
837
|
setLocale: (o) => {
|
|
786
|
-
|
|
838
|
+
A.includes(o) && (i.getState().translationService.setLocale(o), i.setState({ locale: o }));
|
|
787
839
|
},
|
|
788
840
|
getLocale: () => i.getValue("locale"),
|
|
789
841
|
subscribe: i.subscribe.bind(i)
|
|
790
842
|
};
|
|
791
843
|
}
|
|
792
|
-
const
|
|
793
|
-
const { translate: n, getLocale: e, setLocale: t, subscribe: a } =
|
|
844
|
+
const Ct = bt(), I = () => {
|
|
845
|
+
const { translate: n, getLocale: e, setLocale: t, subscribe: a } = Ct;
|
|
794
846
|
return {
|
|
795
847
|
t: n,
|
|
796
848
|
translate: n,
|
|
@@ -798,7 +850,7 @@ const gt = ft(), M = () => {
|
|
|
798
850
|
setLocale: t,
|
|
799
851
|
subscribe: a
|
|
800
852
|
};
|
|
801
|
-
},
|
|
853
|
+
}, St = ({ fontFamily: n }) => {
|
|
802
854
|
if (!n)
|
|
803
855
|
return { cleanup: () => {
|
|
804
856
|
} };
|
|
@@ -806,11 +858,11 @@ const gt = ft(), M = () => {
|
|
|
806
858
|
(o) => o.href.includes("fonts.googleapis.com/css2") && o.rel === "stylesheet"
|
|
807
859
|
), i = document.createElement("link");
|
|
808
860
|
i.rel = "stylesheet", i.href = t;
|
|
809
|
-
const
|
|
861
|
+
const r = a.find(
|
|
810
862
|
(o) => o.href.includes(`family=${e}`)
|
|
811
863
|
);
|
|
812
|
-
if (
|
|
813
|
-
|
|
864
|
+
if (r)
|
|
865
|
+
r.href = t;
|
|
814
866
|
else if (a.length > 0) {
|
|
815
867
|
const o = a.at(
|
|
816
868
|
-1
|
|
@@ -821,7 +873,7 @@ const gt = ft(), M = () => {
|
|
|
821
873
|
return { cleanup: () => {
|
|
822
874
|
document.head.contains(i) && document.head.removeChild(i);
|
|
823
875
|
} };
|
|
824
|
-
},
|
|
876
|
+
}, xt = ({
|
|
825
877
|
scriptSrc: n,
|
|
826
878
|
async: e = !1
|
|
827
879
|
}) => {
|
|
@@ -832,7 +884,7 @@ const gt = ft(), M = () => {
|
|
|
832
884
|
isLoaded: Promise.resolve(!1)
|
|
833
885
|
};
|
|
834
886
|
if ([...document.head.querySelectorAll("script")].filter(
|
|
835
|
-
(
|
|
887
|
+
(s) => s.src === n
|
|
836
888
|
).length > 0)
|
|
837
889
|
return {
|
|
838
890
|
cleanup: () => {
|
|
@@ -841,8 +893,8 @@ const gt = ft(), M = () => {
|
|
|
841
893
|
};
|
|
842
894
|
const a = document.createElement("script");
|
|
843
895
|
a.src = n, a.async = e;
|
|
844
|
-
const i = new Promise((
|
|
845
|
-
a.onload = () =>
|
|
896
|
+
const i = new Promise((s, o) => {
|
|
897
|
+
a.onload = () => s(!0), a.onerror = () => {
|
|
846
898
|
console.error(`Failed to load script: ${n}`), o(new Error(`Failed to load script: ${n}`));
|
|
847
899
|
};
|
|
848
900
|
});
|
|
@@ -852,11 +904,11 @@ const gt = ft(), M = () => {
|
|
|
852
904
|
},
|
|
853
905
|
isLoaded: i
|
|
854
906
|
};
|
|
855
|
-
},
|
|
907
|
+
}, w = (n) => Object.entries(n).map(([e, t]) => {
|
|
856
908
|
const a = e.replace(/([A-Z])/g, "-$1").toLowerCase(), i = typeof t == "number" ? `${t}px` : t;
|
|
857
909
|
return `${a}: ${i}`;
|
|
858
910
|
}).join("; ");
|
|
859
|
-
function
|
|
911
|
+
function Ft(n) {
|
|
860
912
|
if (!n)
|
|
861
913
|
return {
|
|
862
914
|
formContainerStyle: {},
|
|
@@ -891,24 +943,24 @@ function Et(n) {
|
|
|
891
943
|
color: "#dc2727"
|
|
892
944
|
}, i = {
|
|
893
945
|
outline: 0
|
|
894
|
-
}, s = {
|
|
895
|
-
fontFamily: `${n.styles.fontFamily}, sans-serif`
|
|
896
946
|
}, r = {
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
947
|
+
fontFamily: `${n.styles.fontFamily}, sans-serif`
|
|
948
|
+
}, s = {
|
|
949
|
+
base: w(e),
|
|
950
|
+
error: w(a),
|
|
951
|
+
focus: w(i),
|
|
952
|
+
placeholder: w(t)
|
|
901
953
|
};
|
|
902
954
|
return {
|
|
903
|
-
formContainerStyle:
|
|
955
|
+
formContainerStyle: r,
|
|
904
956
|
baseStyles: e,
|
|
905
957
|
placeholderStyles: t,
|
|
906
958
|
errorStyles: a,
|
|
907
959
|
focusStyles: i,
|
|
908
|
-
inputStyles:
|
|
960
|
+
inputStyles: s
|
|
909
961
|
};
|
|
910
962
|
}
|
|
911
|
-
class
|
|
963
|
+
class h {
|
|
912
964
|
element;
|
|
913
965
|
children = [];
|
|
914
966
|
eventListeners = [];
|
|
@@ -919,8 +971,8 @@ class d {
|
|
|
919
971
|
* @param attributes Optional attributes to set on the element
|
|
920
972
|
*/
|
|
921
973
|
constructor(e, t = [], a = {}) {
|
|
922
|
-
this.element = document.createElement(e), t.length > 0 && this.addClass(...t), Object.entries(a).forEach(([i,
|
|
923
|
-
this.setAttribute(i,
|
|
974
|
+
this.element = document.createElement(e), t.length > 0 && this.addClass(...t), Object.entries(a).forEach(([i, r]) => {
|
|
975
|
+
this.setAttribute(i, r);
|
|
924
976
|
});
|
|
925
977
|
}
|
|
926
978
|
/**
|
|
@@ -970,7 +1022,7 @@ class d {
|
|
|
970
1022
|
* Append this component to a parent element
|
|
971
1023
|
*/
|
|
972
1024
|
appendTo(e) {
|
|
973
|
-
return e instanceof
|
|
1025
|
+
return e instanceof h ? e.appendChild(this) : e.appendChild(this.element), this;
|
|
974
1026
|
}
|
|
975
1027
|
/**
|
|
976
1028
|
* Add an event listener to the element
|
|
@@ -1005,24 +1057,24 @@ class d {
|
|
|
1005
1057
|
}), this.eventListeners = [], this.children.forEach((e) => e.destroy()), this.children = [], this.element.parentNode && this.element.parentNode.removeChild(this.element);
|
|
1006
1058
|
}
|
|
1007
1059
|
}
|
|
1008
|
-
class
|
|
1060
|
+
class S {
|
|
1009
1061
|
/**
|
|
1010
1062
|
* Create a div element
|
|
1011
1063
|
*/
|
|
1012
1064
|
static createDiv(e = [], t = {}) {
|
|
1013
|
-
return new
|
|
1065
|
+
return new h("div", e, t);
|
|
1014
1066
|
}
|
|
1015
1067
|
/**
|
|
1016
1068
|
* Create a span element
|
|
1017
1069
|
*/
|
|
1018
1070
|
static createSpan(e = [], t = {}) {
|
|
1019
|
-
return new
|
|
1071
|
+
return new h("span", e, t);
|
|
1020
1072
|
}
|
|
1021
1073
|
/**
|
|
1022
1074
|
* Create a button element
|
|
1023
1075
|
*/
|
|
1024
1076
|
static createButton(e, t = [], a = {}) {
|
|
1025
|
-
const i = new
|
|
1077
|
+
const i = new h("button", t, a);
|
|
1026
1078
|
return i.setText(e), i;
|
|
1027
1079
|
}
|
|
1028
1080
|
/**
|
|
@@ -1030,7 +1082,7 @@ class y {
|
|
|
1030
1082
|
*/
|
|
1031
1083
|
static createInput(e, t = [], a = {}) {
|
|
1032
1084
|
const i = { type: e, ...a };
|
|
1033
|
-
return new
|
|
1085
|
+
return new h("input", t, i);
|
|
1034
1086
|
}
|
|
1035
1087
|
/**
|
|
1036
1088
|
* Create a text input
|
|
@@ -1041,58 +1093,58 @@ class y {
|
|
|
1041
1093
|
placeholder: e,
|
|
1042
1094
|
...a
|
|
1043
1095
|
};
|
|
1044
|
-
return new
|
|
1096
|
+
return new h("input", t, i);
|
|
1045
1097
|
}
|
|
1046
1098
|
/**
|
|
1047
1099
|
* Create a form element
|
|
1048
1100
|
*/
|
|
1049
1101
|
static createForm(e = [], t = {}) {
|
|
1050
|
-
return new
|
|
1102
|
+
return new h("form", e, t);
|
|
1051
1103
|
}
|
|
1052
1104
|
/**
|
|
1053
1105
|
* Create a label element
|
|
1054
1106
|
*/
|
|
1055
1107
|
static createLabel(e, t = "", a = [], i = {}) {
|
|
1056
|
-
const
|
|
1057
|
-
return
|
|
1108
|
+
const r = t ? { for: t, ...i } : i, s = new h("label", a, r);
|
|
1109
|
+
return s.setText(e), s;
|
|
1058
1110
|
}
|
|
1059
1111
|
/**
|
|
1060
1112
|
* Create a select element
|
|
1061
1113
|
*/
|
|
1062
1114
|
static createSelect(e, t = [], a = {}) {
|
|
1063
|
-
const i = new
|
|
1064
|
-
return e.forEach((
|
|
1065
|
-
const
|
|
1066
|
-
|
|
1115
|
+
const i = new h("select", t, a);
|
|
1116
|
+
return e.forEach((r) => {
|
|
1117
|
+
const s = document.createElement("option");
|
|
1118
|
+
s.value = r.value, s.textContent = r.text, r.selected && (s.selected = !0), i.getElement().appendChild(s);
|
|
1067
1119
|
}), i;
|
|
1068
1120
|
}
|
|
1069
1121
|
/**
|
|
1070
1122
|
* Create an image element
|
|
1071
1123
|
*/
|
|
1072
1124
|
static createImage(e, t = "", a = [], i = {}) {
|
|
1073
|
-
const
|
|
1074
|
-
return new
|
|
1125
|
+
const r = { src: e, alt: t, ...i };
|
|
1126
|
+
return new h("img", a, r);
|
|
1075
1127
|
}
|
|
1076
1128
|
}
|
|
1077
|
-
class
|
|
1129
|
+
class wt extends h {
|
|
1078
1130
|
messageComponent;
|
|
1079
1131
|
constructor(e) {
|
|
1080
1132
|
super("div", []);
|
|
1081
|
-
const t =
|
|
1133
|
+
const t = S.createDiv(["error-alert"], {
|
|
1082
1134
|
role: "alert",
|
|
1083
1135
|
"aria-live": "polite"
|
|
1084
|
-
}), a =
|
|
1136
|
+
}), a = S.createDiv(["error-alert-content"]), i = S.createDiv([
|
|
1085
1137
|
"error-alert-icon-container"
|
|
1086
1138
|
]);
|
|
1087
1139
|
i.getElement().innerHTML = this.createAlertCircleSVG();
|
|
1088
|
-
const
|
|
1140
|
+
const r = S.createDiv([
|
|
1089
1141
|
"error-alert-text-container"
|
|
1090
|
-
]),
|
|
1142
|
+
]), s = new h("h4", [
|
|
1091
1143
|
"error-alert-title"
|
|
1092
1144
|
]);
|
|
1093
|
-
|
|
1145
|
+
s.setText("Checkout Error"), this.messageComponent = new h("p", [
|
|
1094
1146
|
"error-alert-message"
|
|
1095
|
-
]), this.messageComponent.setText(e.message || "Bad request"),
|
|
1147
|
+
]), this.messageComponent.setText(e.message || "Bad request"), r.appendChild(s), r.appendChild(this.messageComponent), a.appendChild(i), a.appendChild(r), t.appendChild(a), this.appendChild(t);
|
|
1096
1148
|
}
|
|
1097
1149
|
createAlertCircleSVG() {
|
|
1098
1150
|
return `
|
|
@@ -1117,18 +1169,18 @@ class bt extends d {
|
|
|
1117
1169
|
return this.messageComponent.setText(e), this;
|
|
1118
1170
|
}
|
|
1119
1171
|
}
|
|
1120
|
-
class
|
|
1172
|
+
class P extends h {
|
|
1121
1173
|
titleElement;
|
|
1122
1174
|
constructor(e = {}) {
|
|
1123
1175
|
super("div", ["blur-bg"]);
|
|
1124
|
-
const t =
|
|
1125
|
-
this.titleElement = new
|
|
1176
|
+
const t = S.createDiv(["loader"]);
|
|
1177
|
+
this.titleElement = new h("h3", ["title"]), this.titleElement.setText(e.text || ""), this.appendChild(t), this.appendChild(this.titleElement);
|
|
1126
1178
|
}
|
|
1127
1179
|
setText(e) {
|
|
1128
1180
|
return this.titleElement.setText(e), this;
|
|
1129
1181
|
}
|
|
1130
1182
|
}
|
|
1131
|
-
class
|
|
1183
|
+
class x extends h {
|
|
1132
1184
|
constructor(e) {
|
|
1133
1185
|
super("div", []);
|
|
1134
1186
|
const t = document.createElement("span");
|
|
@@ -1139,7 +1191,7 @@ class v extends d {
|
|
|
1139
1191
|
return t && (t.textContent = e), this;
|
|
1140
1192
|
}
|
|
1141
1193
|
}
|
|
1142
|
-
class
|
|
1194
|
+
class Lt extends h {
|
|
1143
1195
|
constructor(e) {
|
|
1144
1196
|
super("label", ["input-label"], {
|
|
1145
1197
|
for: e.id
|
|
@@ -1148,12 +1200,12 @@ class Ct extends d {
|
|
|
1148
1200
|
t.style.fontFamily = "inherit", t.style.color = e.styles.color, t.style.fontSize = `${e.styles.fontSize}px`;
|
|
1149
1201
|
}
|
|
1150
1202
|
}
|
|
1151
|
-
class
|
|
1203
|
+
class T extends h {
|
|
1152
1204
|
inputElement;
|
|
1153
1205
|
helperText = null;
|
|
1154
1206
|
constructor(e) {
|
|
1155
1207
|
if (super("div", ["input-wrapper"]), e.label && e.styles) {
|
|
1156
|
-
const a = new
|
|
1208
|
+
const a = new Lt({
|
|
1157
1209
|
styles: {
|
|
1158
1210
|
color: e.styles.color,
|
|
1159
1211
|
fontSize: e.styles.fontSize
|
|
@@ -1168,7 +1220,7 @@ class k extends d {
|
|
|
1168
1220
|
name: e.name,
|
|
1169
1221
|
class: `form-input ${e.error ? "form-input-error" : ""}`
|
|
1170
1222
|
};
|
|
1171
|
-
if (e.placeholder && (t.placeholder = e.placeholder), e.value && (t.value = e.value), e.required && (t.required = String(e.required)), e.disabled && (t.disabled = String(e.disabled)), this.inputElement =
|
|
1223
|
+
if (e.placeholder && (t.placeholder = e.placeholder), e.value && (t.value = e.value), e.required && (t.required = String(e.required)), e.disabled && (t.disabled = String(e.disabled)), e.autocomplete && (t.autocomplete = e.autocomplete), this.inputElement = S.createInput(
|
|
1172
1224
|
e.type || "text",
|
|
1173
1225
|
[],
|
|
1174
1226
|
t
|
|
@@ -1176,7 +1228,7 @@ class k extends d {
|
|
|
1176
1228
|
const a = this.inputElement.getElement();
|
|
1177
1229
|
a.style.fontFamily = `"${e.styles.fontFamily}", sans-serif`, a.style.color = e.styles.color, a.style.fontSize = `${e.styles.fontSize}px`, a.style.borderRadius = e.styles.borderRadius;
|
|
1178
1230
|
}
|
|
1179
|
-
e.onChange && this.inputElement.getElement().addEventListener("input", e.onChange), this.getElement().appendChild(this.inputElement.getElement()), e.error && (this.helperText = new
|
|
1231
|
+
e.onChange && this.inputElement.getElement().addEventListener("input", e.onChange), this.getElement().appendChild(this.inputElement.getElement()), e.error && (this.helperText = new x({ text: e.errorMsg }), this.appendChild(this.helperText));
|
|
1180
1232
|
}
|
|
1181
1233
|
getValue() {
|
|
1182
1234
|
return this.inputElement.getElement().value;
|
|
@@ -1186,29 +1238,30 @@ class k extends d {
|
|
|
1186
1238
|
}
|
|
1187
1239
|
setError(e, t) {
|
|
1188
1240
|
const a = this.inputElement.getElement();
|
|
1189
|
-
return e ? (a.classList.add("form-input-error"), !this.helperText && t ? (this.helperText = new
|
|
1241
|
+
return e ? (a.classList.add("form-input-error"), !this.helperText && t ? (this.helperText = new x({ text: t }), this.appendChild(this.helperText)) : this.helperText && t && this.helperText.setText(t)) : (a.classList.remove("form-input-error"), this.helperText && (this.helperText.getElement().remove(), this.helperText = null)), this;
|
|
1190
1242
|
}
|
|
1191
1243
|
addEventListener(e, t, a) {
|
|
1192
1244
|
return this.inputElement.getElement().addEventListener(e, t, a), this;
|
|
1193
1245
|
}
|
|
1194
1246
|
}
|
|
1195
|
-
class
|
|
1247
|
+
class Mt {
|
|
1196
1248
|
input;
|
|
1197
1249
|
constructor(e) {
|
|
1198
1250
|
const {
|
|
1199
1251
|
value: t,
|
|
1200
1252
|
onChange: a,
|
|
1201
1253
|
onBlur: i,
|
|
1202
|
-
error:
|
|
1203
|
-
errorMsg:
|
|
1254
|
+
error: r,
|
|
1255
|
+
errorMsg: s,
|
|
1204
1256
|
checkoutProfile: o,
|
|
1205
|
-
translationFunc: l
|
|
1257
|
+
translationFunc: l,
|
|
1258
|
+
autocomplete: c = "cc-name"
|
|
1206
1259
|
} = e;
|
|
1207
|
-
this.input = new
|
|
1260
|
+
this.input = new T({
|
|
1208
1261
|
name: "name",
|
|
1209
1262
|
label: l("cardholderNameLabel"),
|
|
1210
|
-
error:
|
|
1211
|
-
errorMsg:
|
|
1263
|
+
error: r,
|
|
1264
|
+
errorMsg: s,
|
|
1212
1265
|
styles: {
|
|
1213
1266
|
color: o.styles.textColor,
|
|
1214
1267
|
borderRadius: `${o.styles.borderRadius}px`,
|
|
@@ -1217,11 +1270,12 @@ class St {
|
|
|
1217
1270
|
},
|
|
1218
1271
|
placeholder: l("cardholderNamePlaceholder"),
|
|
1219
1272
|
value: t,
|
|
1220
|
-
|
|
1221
|
-
|
|
1273
|
+
autocomplete: c,
|
|
1274
|
+
onChange: (d) => {
|
|
1275
|
+
this.trim(), a(d);
|
|
1222
1276
|
}
|
|
1223
|
-
}), this.input.addEventListener("blur", (
|
|
1224
|
-
i(
|
|
1277
|
+
}), this.input.addEventListener("blur", (d) => {
|
|
1278
|
+
i(d);
|
|
1225
1279
|
});
|
|
1226
1280
|
}
|
|
1227
1281
|
getValue() {
|
|
@@ -1244,7 +1298,7 @@ class St {
|
|
|
1244
1298
|
return this.input.appendTo(e), this;
|
|
1245
1299
|
}
|
|
1246
1300
|
}
|
|
1247
|
-
class
|
|
1301
|
+
class kt extends h {
|
|
1248
1302
|
constructor(e) {
|
|
1249
1303
|
super("div", []);
|
|
1250
1304
|
const t = document.createElement("div");
|
|
@@ -1261,25 +1315,25 @@ class xt extends d {
|
|
|
1261
1315
|
return t && (e ? t.classList.add("loading") : t.classList.remove("loading")), this;
|
|
1262
1316
|
}
|
|
1263
1317
|
}
|
|
1264
|
-
const Ft = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20height='30px'%20width='30px'%20version='1.1'%20id='Capa_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20512%20512'%20xml:space='preserve'%3e%3cpath%20style='fill:%23306FC5;'%20d='M512,402.281c0,16.716-13.55,30.267-30.265,30.267H30.265C13.55,432.549,0,418.997,0,402.281V109.717%20c0-16.715,13.55-30.266,30.265-30.266h451.47c16.716,0,30.265,13.551,30.265,30.266V402.281L512,402.281z'/%3e%3cpath%20style='opacity:0.15;fill:%23202121;enable-background:new%20;'%20d='M21.517,402.281V109.717%20c0-16.715,13.552-30.266,30.267-30.266h-21.52C13.55,79.451,0,93.001,0,109.717v292.565c0,16.716,13.55,30.267,30.265,30.267h21.52%20C35.07,432.549,21.517,418.997,21.517,402.281z'/%3e%3cg%3e%3cpolygon%20style='fill:%23FFFFFF;'%20points='74.59,220.748%2089.888,220.748%2082.241,201.278%20'/%3e%3cpolygon%20style='fill:%23FFFFFF;'%20points='155.946,286.107%20155.946,295.148%20181.675,295.148%20181.675,304.885%20155.946,304.885%20155.946,315.318%20184.455,315.318%20197.666,300.712%20185.151,286.107%20'/%3e%3cpolygon%20style='fill:%23FFFFFF;'%20points='356.898,201.278%20348.553,220.748%20364.548,220.748%20'/%3e%3cpolygon%20style='fill:%23FFFFFF;'%20points='230.348,320.875%20230.348,281.241%20212.268,300.712%20'/%3e%3cpath%20style='fill:%23FFFFFF;'%20d='M264.42,292.368c-0.696-4.172-3.48-6.261-7.654-6.261h-14.599v12.516h15.299%20C261.637,298.624,264.42,296.539,264.42,292.368z'/%3e%3cpath%20style='fill:%23FFFFFF;'%20d='M313.09,297.236c1.391-0.697,2.089-2.785,2.089-4.867c0.696-2.779-0.698-4.172-2.089-4.868%20c-1.387-0.696-3.476-0.696-5.559-0.696h-13.91v11.127h13.909C309.613,297.932,311.702,297.932,313.09,297.236z'/%3e%3cpath%20style='fill:%23FFFFFF;'%20d='M413.217,183.198v8.344l-4.169-8.344H376.37v8.344l-4.174-8.344h-44.502%20c-7.648,0-13.909,1.392-19.469,4.173v-4.173h-31.289v0.696v3.477c-3.476-2.78-7.648-4.173-13.211-4.173h-111.95l-7.652,17.384%20l-7.647-17.384h-25.031h-10.431v8.344l-3.477-8.344h-0.696H66.942l-13.909,32.68L37.042,251.34l-0.294,0.697h0.294h35.463h0.444%20l0.252-0.697l4.174-10.428h9.039l4.172,11.125h40.326v-0.697v-7.647l3.479,8.343h20.163l3.475-8.343v7.647v0.697h15.993h79.965%20h0.696v-18.08h1.394c1.389,0,1.389,0,1.389,2.087v15.297h50.065v-4.172c4.172,2.089,10.426,4.172,18.771,4.172h20.863l4.172-11.123%20h9.732l4.172,11.123h40.328v-6.952v-3.476l6.261,10.428h1.387h0.698h30.595v-68.143h-31.291l0,0H413.217z%20M177.501,241.609h-6.955%20h-4.171v-4.169v-34.076l-0.696,1.595v-0.019l-16.176,36.669h-0.512h-3.719h-6.017l-16.687-38.245v38.245h-23.64l-4.867-10.43%20H70.417l-4.868,10.43H53.326l20.57-48.675h17.382l19.469,46.587v-46.587h4.171h14.251l0.328,0.697h0.024l8.773,19.094l6.3,14.306%20l0.223-0.721l13.906-33.375H177.5v48.674H177.501L177.501,241.609z%20M225.481,203.364h-27.119v9.039h26.423v9.734h-26.423v9.738%20h27.119v10.427h-38.939v-49.367h38.939V203.364L225.481,203.364z%20M275.076,221.294c0.018,0.016,0.041,0.027,0.063,0.042%20c0.263,0.278,0.488,0.557,0.68,0.824c1.332,1.746,2.409,4.343,2.463,8.151c0.004,0.066,0.007,0.131,0.011,0.197%20c0,0.038,0.007,0.071,0.007,0.11c0,0.022-0.002,0.039-0.002,0.06c0.016,0.383,0.026,0.774,0.026,1.197v9.735h-10.428v-5.565%20c0-2.781,0-6.954-2.089-9.735c-0.657-0.657-1.322-1.09-2.046-1.398c-1.042-0.675-3.017-0.686-6.295-0.686h-12.52v17.384h-11.818%20v-48.675h26.425c6.254,0,10.428,0,13.906,2.086c3.407,2.046,5.465,5.439,5.543,10.812c-0.161,7.4-4.911,11.46-8.326,12.829%20C270.676,218.662,272.996,219.129,275.076,221.294z%20M298.491,241.609h-11.822v-48.675h11.822V241.609z%20M434.083,241.609h-15.3%20l-22.25-36.855v30.595l-0.073-0.072v6.362h-11.747v-0.029h-11.822l-4.172-10.43H344.38l-4.172,11.123h-13.211%20c-5.559,0-12.517-1.389-16.687-5.561c-4.172-4.172-6.256-9.735-6.256-18.773c0-6.953,1.389-13.911,6.256-19.472%20c3.474-4.175,9.735-5.562,17.382-5.562h11.128v10.429h-11.128c-4.172,0-6.254,0.693-9.041,2.783%20c-2.082,2.085-3.474,6.256-3.474,11.123c0,5.564,0.696,9.04,3.474,11.821c2.091,2.089,4.87,2.785,8.346,2.785h4.867l15.991-38.243%20h6.957h10.428l19.472,46.587v-2.376v-15.705v-1.389v-27.116h17.382l20.161,34.07v-34.07h11.826v47.977h0.002L434.083,241.609%20L434.083,241.609z'/%3e%3cpath%20style='fill:%23FFFFFF;'%20d='M265.161,213.207c0.203-0.217,0.387-0.463,0.543-0.745c0.63-0.997,1.352-2.793,0.963-5.244%20c-0.016-0.225-0.057-0.433-0.105-0.634c-0.013-0.056-0.011-0.105-0.026-0.161l-0.007,0.001c-0.346-1.191-1.229-1.923-2.11-2.367%20c-1.394-0.693-3.48-0.693-5.565-0.693h-13.909v11.127h13.909c2.085,0,4.172,0,5.565-0.697c0.209-0.106,0.395-0.25,0.574-0.413%20l0.002,0.009C264.996,213.389,265.067,213.315,265.161,213.207z'/%3e%3cpath%20style='fill:%23FFFFFF;'%20d='M475.105,311.144c0-4.867-1.389-9.736-3.474-13.212v-31.289h-0.032v-2.089c0,0-29.145,0-33.483,0%20c-4.336,0-9.598,4.171-9.598,4.171v-4.171h-31.984c-4.87,0-11.124,1.392-13.909,4.171v-4.171h-57.016v2.089v2.081%20c-4.169-3.474-11.824-4.171-15.298-4.171h-37.549v2.089v2.081c-3.476-3.474-11.824-4.171-15.998-4.171H215.05l-9.737,10.431%20l-9.04-10.431h-2.911h-4.737h-54.93v2.089v5.493v62.651h61.19l10.054-10.057l8.715,10.057h0.698h35.258h1.598h0.696h0.692v-6.953%20v-9.039h3.479c4.863,0,11.124,0,15.991-2.089v17.382v1.394h31.291v-1.394V317.4h1.387c2.089,0,2.089,0,2.089,2.086v14.6v1.394%20h94.563c6.263,0,12.517-1.394,15.993-4.175v2.781v1.394h29.902c6.254,0,12.517-0.695,16.689-3.478%20c6.402-3.841,10.437-10.64,11.037-18.749c0.028-0.24,0.063-0.48,0.085-0.721l-0.041-0.039%20C475.087,312.043,475.105,311.598,475.105,311.144z%20M256.076,306.973h-13.91v2.081v4.174v4.173v7.649h-22.855l-13.302-15.299%20l-0.046,0.051l-0.65-0.748l-15.297,15.996h-44.501v-48.673h45.197l12.348,13.525l2.596,2.832l0.352-0.365l14.604-15.991h36.852%20c7.152,0,15.161,1.765,18.196,9.042c0.365,1.441,0.577,3.043,0.577,4.863C276.237,304.189,266.502,306.973,256.076,306.973z%20M325.609,306.276c1.389,2.081,2.085,4.867,2.085,9.041v9.732h-11.819v-6.256c0-2.786,0-7.65-2.089-9.739%20c-1.387-2.081-4.172-2.081-8.341-2.081H292.93v18.077h-11.82v-49.369h26.421c5.559,0,10.426,0,13.909,2.084%20c3.474,2.088,6.254,5.565,6.254,11.128c0,7.647-4.865,11.819-8.343,13.212C322.829,303.49,324.914,304.885,325.609,306.276z%20M373.589,286.107h-27.122v9.04h26.424v9.737h-26.424v9.736h27.122v10.429H334.65V275.68h38.939V286.107z%20M402.791,325.05h-22.252%20v-10.429h22.252c2.082,0,3.476,0,4.87-1.392c0.696-0.697,1.387-2.085,1.387-3.477c0-1.394-0.691-2.778-1.387-3.475%20c-0.698-0.695-2.091-1.391-4.176-1.391c-11.126-0.696-24.337,0-24.337-15.296c0-6.954,4.172-14.604,16.689-14.604h22.945v11.819%20h-21.554c-2.085,0-3.478,0-4.87,0.696c-1.387,0.697-1.387,2.089-1.387,3.478c0,2.087,1.387,2.783,2.778,3.473%20c1.394,0.697,2.783,0.697,4.172,0.697h6.259c6.259,0,10.43,1.391,13.211,4.173c2.087,2.087,3.478,5.564,3.478,10.43%20C420.869,320.179,414.611,325.05,402.791,325.05z%20M462.59,320.179c-2.778,2.785-7.648,4.871-14.604,4.871H425.74v-10.429h22.245%20c2.087,0,3.481,0,4.87-1.392c0.693-0.697,1.391-2.085,1.391-3.477c0-1.394-0.698-2.778-1.391-3.475%20c-0.696-0.695-2.085-1.391-4.172-1.391c-11.122-0.696-24.337,0-24.337-15.295c0-6.609,3.781-12.579,13.106-14.352%20c1.115-0.154,2.293-0.253,3.583-0.253h22.948v11.819h-15.3h-5.561h-0.696c-2.087,0-3.476,0-4.865,0.696%20c-0.7,0.697-1.396,2.089-1.396,3.478c0,2.087,0.696,2.783,2.785,3.473c1.389,0.697,2.78,0.697,4.172,0.697h0.691h5.565%20c3.039,0,5.337,0.375,7.44,1.114c1.926,0.697,8.302,3.549,9.728,10.994c0.124,0.78,0.215,1.594,0.215,2.495%20C466.761,313.925,465.37,317.401,462.59,320.179z'/%3e%3c/g%3e%3c/svg%3e", wt = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20height='30px'%20width='30px'%20version='1.1'%20id='Capa_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20512%20512'%20xml:space='preserve'%3e%3cpath%20style='fill:%2334495E;'%20d='M512,402.282c0,16.716-13.55,30.267-30.265,30.267H30.265C13.55,432.549,0,418.996,0,402.282V109.717%20c0-16.716,13.55-30.266,30.265-30.266h451.469c16.716,0,30.265,13.551,30.265,30.266L512,402.282L512,402.282z'/%3e%3cpath%20style='opacity:0.15;fill:%23202121;enable-background:new%20;'%20d='M21.517,402.282V109.717%20c0-16.716,13.552-30.266,30.267-30.266h-21.52C13.55,79.451,0,93.003,0,109.717v292.565c0,16.716,13.55,30.267,30.265,30.267h21.52%20C35.07,432.549,21.517,418.996,21.517,402.282z'/%3e%3cpath%20style='fill:%23F26E21;'%20d='M309.389,255.801c0.041-9.636-3.572-19.286-10.843-26.558c-7.287-7.287-16.961-10.897-26.617-10.839%20c-0.046,0-0.091-0.003-0.139-0.003c-20.968,0-37.6,16.628-37.6,37.602c0,20.767,16.837,37.599,37.6,37.599%20c20.974,0,37.604-16.631,37.604-37.599C309.394,255.934,309.389,255.869,309.389,255.801z'/%3e%3cg%3e%3cpath%20style='fill:%23E7E8E3;'%20d='M227.198,271.909c-5.62,5.626-10.807,7.824-16.394,7.943c-13.611-0.122-23.618-10.202-23.618-24.573%20c0-7.234,2.739-13.163,7.078-18.228l0,0c4.069-3.863,9.311-6.359,15.339-6.359c6.507,0,11.571,2.169,17.352,7.954v-16.631%20c-5.78-2.891-10.846-4.338-17.352-4.338c-9.192,0.657-17.859,4.371-24.507,10.203l0,0c-1.916,1.724-3.752,3.627-5.309,5.805%20c-4.856,6.294-7.791,14.001-7.791,22.32c0,20.967,16.637,36.875,37.606,36.875c0.102,0,0.203-0.009,0.302-0.01%20c0.141,0.002,0.28,0.01,0.42,0.01c5.784,0,10.85-1.443,17.357-4.336L227.198,271.909c-0.244,0.244,0.242,0.471,0,0.702V271.909z'/%3e%3cpolygon%20style='fill:%23E7E8E3;'%20points='356.863,228.033%20356.863,228.033%20340.487,268.295%20321.685,220.566%20306.502,220.566%20336.148,293.601%20344.102,293.601%20375.196,220.566%20360.013,220.566%20'/%3e%3cpolygon%20style='fill:%23E7E8E3;'%20points='380.983,252.384%20380.983,291.435%20420.033,291.435%20420.753,291.435%20420.753,279.861%20408.461,279.861%20395.445,279.861%20395.445,266.848%20395.445,260.342%20420.033,260.342%20420.033,248.045%20395.445,248.045%20395.445,232.861%20420.753,232.861%20420.753,220.566%20380.983,220.566%20'/%3e%3cpath%20style='fill:%23E7E8E3;'%20d='M54.135,220.566H33.884v70.869h20.25c10.845,0,18.798-2.895,25.306-7.957%20c7.953-6.508,13.017-16.629,13.017-27.474C92.458,235.028,77.27,220.566,54.135,220.566z%20M70.765,274.08%20c-4.339,3.614-10.124,5.781-18.802,5.781h-4.339V232.86h3.615c8.678,0,14.463,1.446,18.803,5.783%20c5.061,4.336,7.955,10.848,7.955,17.358C78.72,262.509,75.828,269.737,70.765,274.08z'/%3e%3crect%20x='98.97'%20y='220.56'%20style='fill:%23E7E8E3;'%20width='13.739'%20height='70.867'/%3e%3cpath%20style='fill:%23E7E8E3;'%20d='M147.415,248.045c-8.676-2.892-10.848-5.063-10.848-8.677c0-4.339,4.339-7.954,10.124-7.954%20c4.339,0,7.954,1.447,11.57,5.786l7.233-9.4c-5.787-5.064-13.015-7.953-20.97-7.953c-12.296,0-22.42,8.678-22.42,20.244%20c0,10.126,4.343,14.464,17.357,19.526c5.785,2.166,7.955,2.892,9.404,4.338c2.887,1.444,4.336,4.339,4.336,7.228%20c0,5.786-4.336,10.126-10.848,10.126c-6.514,0-12.294-3.615-15.187-9.401l-8.678,8.678c6.511,9.4,14.465,13.738,24.589,13.738%20c14.461,0,24.58-9.4,24.58-23.141C167.659,258.893,163.324,253.831,147.415,248.045z'/%3e%3cpath%20style='fill:%23E7E8E3;'%20d='M459.804,261.783c10.843-2.166,16.63-9.4,16.63-20.244c0-13.014-9.402-20.973-25.308-20.973h-20.972%20v70.869h13.739V263.23h2.172l19.519,28.205h16.634L459.804,261.783z%20M448.23,253.105h-4.336v-21.691h4.336%20c8.678,0,13.742,3.614,13.742,10.85C461.972,249.492,456.909,253.105,448.23,253.105z'/%3e%3c/g%3e%3c/svg%3e", Lt = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20height='800px'%20width='800px'%20version='1.1'%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20291.791%20291.791'%20xml:space='preserve'%3e%3cg%3e%3cpath%20style='fill:%23E2574C;'%20d='M182.298,145.895c0,50.366-40.801,91.176-91.149,91.176S0,196.252,0,145.895%20s40.811-91.176,91.149-91.176S182.298,95.538,182.298,145.895z'/%3e%3cpath%20style='fill:%23F4B459;'%20d='M200.616,54.719c-20.442,0-39.261,6.811-54.469,18.181l0.073,0.009%20c2.991,2.89,6.291,4.924,8.835,8.251l-18.965,0.301c-2.972,3-5.68,6.264-8.233,9.656H161.3c2.544,3.054,4.896,5.708,7.03,9.081%20h-46.536c-1.705,2.936-3.282,5.954-4.659,9.09h56.493c1.477,3.127,2.799,5.489,3.921,8.799h-63.76%20c-1.012,3.146-1.878,6.364-2.535,9.646h68.966c0.675,3.155,1.194,6.072,1.55,9.045h-71.884c-0.301,3-0.456,6.045-0.456,9.118%20h72.859c0,3.228-0.228,6.218-0.556,9.118h-71.847c0.31,3.091,0.766,6.127,1.368,9.118h68.856c-0.711,2.954-1.532,5.926-2.562,9.008%20h-63.969c0.966,3.118,2.143,6.145,3.428,9.099h56.621c-1.568,3.319-3.346,5.972-5.306,9.081h-46.691%20c1.842,3.191,3.875,6.236,6.081,9.154l33.589,0.501c-2.863,3.437-6.537,5.507-9.884,8.516c0.182,0.146-5.352-0.018-16.248-0.191%20c16.576,17.105,39.744,27.772,65.446,27.772c50.357,0,91.176-40.82,91.176-91.176S250.981,54.719,200.616,54.719z'/%3e%3c/g%3e%3c/svg%3e", Mt = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20width='800px'%20height='800px'%20viewBox='0%20-140%20780%20780'%20enable-background='new%200%200%20780%20500'%20version='1.1'%20xml:space='preserve'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M40,0h700c22.092,0,40,17.909,40,40v420c0,22.092-17.908,40-40,40H40c-22.091,0-40-17.908-40-40V40%20C0,17.909,17.909,0,40,0z'%20fill='%230E4595'/%3e%3cpath%20d='m293.2%20348.73l33.361-195.76h53.36l-33.385%20195.76h-53.336zm246.11-191.54c-10.57-3.966-27.137-8.222-47.822-8.222-52.725%200-89.865%2026.55-90.18%2064.603-0.299%2028.13%2026.514%2043.822%2046.752%2053.186%2020.771%209.595%2027.752%2015.714%2027.654%2024.283-0.131%2013.121-16.586%2019.116-31.922%2019.116-21.357%200-32.703-2.967-50.227-10.276l-6.876-3.11-7.489%2043.823c12.463%205.464%2035.51%2010.198%2059.438%2010.443%2056.09%200%2092.5-26.246%2092.916-66.882%200.199-22.269-14.016-39.216-44.801-53.188-18.65-9.055-30.072-15.099-29.951-24.268%200-8.137%209.668-16.839%2030.557-16.839%2017.449-0.27%2030.09%203.535%2039.938%207.5l4.781%202.26%207.232-42.429m137.31-4.223h-41.232c-12.773%200-22.332%203.487-27.941%2016.234l-79.244%20179.4h56.031s9.16-24.123%2011.232-29.418c6.125%200%2060.555%200.084%2068.338%200.084%201.596%206.853%206.49%2029.334%206.49%2029.334h49.514l-43.188-195.64zm-65.418%20126.41c4.412-11.279%2021.26-54.723%2021.26-54.723-0.316%200.522%204.379-11.334%207.074-18.684l3.605%2016.879s10.219%2046.729%2012.354%2056.528h-44.293zm-363.3-126.41l-52.24%20133.5-5.567-27.13c-9.725-31.273-40.025-65.155-73.898-82.118l47.766%20171.2%2056.456-0.064%2084.004-195.39h-56.521'%20fill='%23ffffff'/%3e%3cpath%20d='m146.92%20152.96h-86.041l-0.681%204.073c66.938%2016.204%20111.23%2055.363%20129.62%20102.41l-18.71-89.96c-3.23-12.395-12.597-16.094-24.186-16.527'%20fill='%23F2AE14'/%3e%3c/svg%3e", E = [
|
|
1318
|
+
const It = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20height='30px'%20width='30px'%20version='1.1'%20id='Capa_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20512%20512'%20xml:space='preserve'%3e%3cpath%20style='fill:%23306FC5;'%20d='M512,402.281c0,16.716-13.55,30.267-30.265,30.267H30.265C13.55,432.549,0,418.997,0,402.281V109.717%20c0-16.715,13.55-30.266,30.265-30.266h451.47c16.716,0,30.265,13.551,30.265,30.266V402.281L512,402.281z'/%3e%3cpath%20style='opacity:0.15;fill:%23202121;enable-background:new%20;'%20d='M21.517,402.281V109.717%20c0-16.715,13.552-30.266,30.267-30.266h-21.52C13.55,79.451,0,93.001,0,109.717v292.565c0,16.716,13.55,30.267,30.265,30.267h21.52%20C35.07,432.549,21.517,418.997,21.517,402.281z'/%3e%3cg%3e%3cpolygon%20style='fill:%23FFFFFF;'%20points='74.59,220.748%2089.888,220.748%2082.241,201.278%20'/%3e%3cpolygon%20style='fill:%23FFFFFF;'%20points='155.946,286.107%20155.946,295.148%20181.675,295.148%20181.675,304.885%20155.946,304.885%20155.946,315.318%20184.455,315.318%20197.666,300.712%20185.151,286.107%20'/%3e%3cpolygon%20style='fill:%23FFFFFF;'%20points='356.898,201.278%20348.553,220.748%20364.548,220.748%20'/%3e%3cpolygon%20style='fill:%23FFFFFF;'%20points='230.348,320.875%20230.348,281.241%20212.268,300.712%20'/%3e%3cpath%20style='fill:%23FFFFFF;'%20d='M264.42,292.368c-0.696-4.172-3.48-6.261-7.654-6.261h-14.599v12.516h15.299%20C261.637,298.624,264.42,296.539,264.42,292.368z'/%3e%3cpath%20style='fill:%23FFFFFF;'%20d='M313.09,297.236c1.391-0.697,2.089-2.785,2.089-4.867c0.696-2.779-0.698-4.172-2.089-4.868%20c-1.387-0.696-3.476-0.696-5.559-0.696h-13.91v11.127h13.909C309.613,297.932,311.702,297.932,313.09,297.236z'/%3e%3cpath%20style='fill:%23FFFFFF;'%20d='M413.217,183.198v8.344l-4.169-8.344H376.37v8.344l-4.174-8.344h-44.502%20c-7.648,0-13.909,1.392-19.469,4.173v-4.173h-31.289v0.696v3.477c-3.476-2.78-7.648-4.173-13.211-4.173h-111.95l-7.652,17.384%20l-7.647-17.384h-25.031h-10.431v8.344l-3.477-8.344h-0.696H66.942l-13.909,32.68L37.042,251.34l-0.294,0.697h0.294h35.463h0.444%20l0.252-0.697l4.174-10.428h9.039l4.172,11.125h40.326v-0.697v-7.647l3.479,8.343h20.163l3.475-8.343v7.647v0.697h15.993h79.965%20h0.696v-18.08h1.394c1.389,0,1.389,0,1.389,2.087v15.297h50.065v-4.172c4.172,2.089,10.426,4.172,18.771,4.172h20.863l4.172-11.123%20h9.732l4.172,11.123h40.328v-6.952v-3.476l6.261,10.428h1.387h0.698h30.595v-68.143h-31.291l0,0H413.217z%20M177.501,241.609h-6.955%20h-4.171v-4.169v-34.076l-0.696,1.595v-0.019l-16.176,36.669h-0.512h-3.719h-6.017l-16.687-38.245v38.245h-23.64l-4.867-10.43%20H70.417l-4.868,10.43H53.326l20.57-48.675h17.382l19.469,46.587v-46.587h4.171h14.251l0.328,0.697h0.024l8.773,19.094l6.3,14.306%20l0.223-0.721l13.906-33.375H177.5v48.674H177.501L177.501,241.609z%20M225.481,203.364h-27.119v9.039h26.423v9.734h-26.423v9.738%20h27.119v10.427h-38.939v-49.367h38.939V203.364L225.481,203.364z%20M275.076,221.294c0.018,0.016,0.041,0.027,0.063,0.042%20c0.263,0.278,0.488,0.557,0.68,0.824c1.332,1.746,2.409,4.343,2.463,8.151c0.004,0.066,0.007,0.131,0.011,0.197%20c0,0.038,0.007,0.071,0.007,0.11c0,0.022-0.002,0.039-0.002,0.06c0.016,0.383,0.026,0.774,0.026,1.197v9.735h-10.428v-5.565%20c0-2.781,0-6.954-2.089-9.735c-0.657-0.657-1.322-1.09-2.046-1.398c-1.042-0.675-3.017-0.686-6.295-0.686h-12.52v17.384h-11.818%20v-48.675h26.425c6.254,0,10.428,0,13.906,2.086c3.407,2.046,5.465,5.439,5.543,10.812c-0.161,7.4-4.911,11.46-8.326,12.829%20C270.676,218.662,272.996,219.129,275.076,221.294z%20M298.491,241.609h-11.822v-48.675h11.822V241.609z%20M434.083,241.609h-15.3%20l-22.25-36.855v30.595l-0.073-0.072v6.362h-11.747v-0.029h-11.822l-4.172-10.43H344.38l-4.172,11.123h-13.211%20c-5.559,0-12.517-1.389-16.687-5.561c-4.172-4.172-6.256-9.735-6.256-18.773c0-6.953,1.389-13.911,6.256-19.472%20c3.474-4.175,9.735-5.562,17.382-5.562h11.128v10.429h-11.128c-4.172,0-6.254,0.693-9.041,2.783%20c-2.082,2.085-3.474,6.256-3.474,11.123c0,5.564,0.696,9.04,3.474,11.821c2.091,2.089,4.87,2.785,8.346,2.785h4.867l15.991-38.243%20h6.957h10.428l19.472,46.587v-2.376v-15.705v-1.389v-27.116h17.382l20.161,34.07v-34.07h11.826v47.977h0.002L434.083,241.609%20L434.083,241.609z'/%3e%3cpath%20style='fill:%23FFFFFF;'%20d='M265.161,213.207c0.203-0.217,0.387-0.463,0.543-0.745c0.63-0.997,1.352-2.793,0.963-5.244%20c-0.016-0.225-0.057-0.433-0.105-0.634c-0.013-0.056-0.011-0.105-0.026-0.161l-0.007,0.001c-0.346-1.191-1.229-1.923-2.11-2.367%20c-1.394-0.693-3.48-0.693-5.565-0.693h-13.909v11.127h13.909c2.085,0,4.172,0,5.565-0.697c0.209-0.106,0.395-0.25,0.574-0.413%20l0.002,0.009C264.996,213.389,265.067,213.315,265.161,213.207z'/%3e%3cpath%20style='fill:%23FFFFFF;'%20d='M475.105,311.144c0-4.867-1.389-9.736-3.474-13.212v-31.289h-0.032v-2.089c0,0-29.145,0-33.483,0%20c-4.336,0-9.598,4.171-9.598,4.171v-4.171h-31.984c-4.87,0-11.124,1.392-13.909,4.171v-4.171h-57.016v2.089v2.081%20c-4.169-3.474-11.824-4.171-15.298-4.171h-37.549v2.089v2.081c-3.476-3.474-11.824-4.171-15.998-4.171H215.05l-9.737,10.431%20l-9.04-10.431h-2.911h-4.737h-54.93v2.089v5.493v62.651h61.19l10.054-10.057l8.715,10.057h0.698h35.258h1.598h0.696h0.692v-6.953%20v-9.039h3.479c4.863,0,11.124,0,15.991-2.089v17.382v1.394h31.291v-1.394V317.4h1.387c2.089,0,2.089,0,2.089,2.086v14.6v1.394%20h94.563c6.263,0,12.517-1.394,15.993-4.175v2.781v1.394h29.902c6.254,0,12.517-0.695,16.689-3.478%20c6.402-3.841,10.437-10.64,11.037-18.749c0.028-0.24,0.063-0.48,0.085-0.721l-0.041-0.039%20C475.087,312.043,475.105,311.598,475.105,311.144z%20M256.076,306.973h-13.91v2.081v4.174v4.173v7.649h-22.855l-13.302-15.299%20l-0.046,0.051l-0.65-0.748l-15.297,15.996h-44.501v-48.673h45.197l12.348,13.525l2.596,2.832l0.352-0.365l14.604-15.991h36.852%20c7.152,0,15.161,1.765,18.196,9.042c0.365,1.441,0.577,3.043,0.577,4.863C276.237,304.189,266.502,306.973,256.076,306.973z%20M325.609,306.276c1.389,2.081,2.085,4.867,2.085,9.041v9.732h-11.819v-6.256c0-2.786,0-7.65-2.089-9.739%20c-1.387-2.081-4.172-2.081-8.341-2.081H292.93v18.077h-11.82v-49.369h26.421c5.559,0,10.426,0,13.909,2.084%20c3.474,2.088,6.254,5.565,6.254,11.128c0,7.647-4.865,11.819-8.343,13.212C322.829,303.49,324.914,304.885,325.609,306.276z%20M373.589,286.107h-27.122v9.04h26.424v9.737h-26.424v9.736h27.122v10.429H334.65V275.68h38.939V286.107z%20M402.791,325.05h-22.252%20v-10.429h22.252c2.082,0,3.476,0,4.87-1.392c0.696-0.697,1.387-2.085,1.387-3.477c0-1.394-0.691-2.778-1.387-3.475%20c-0.698-0.695-2.091-1.391-4.176-1.391c-11.126-0.696-24.337,0-24.337-15.296c0-6.954,4.172-14.604,16.689-14.604h22.945v11.819%20h-21.554c-2.085,0-3.478,0-4.87,0.696c-1.387,0.697-1.387,2.089-1.387,3.478c0,2.087,1.387,2.783,2.778,3.473%20c1.394,0.697,2.783,0.697,4.172,0.697h6.259c6.259,0,10.43,1.391,13.211,4.173c2.087,2.087,3.478,5.564,3.478,10.43%20C420.869,320.179,414.611,325.05,402.791,325.05z%20M462.59,320.179c-2.778,2.785-7.648,4.871-14.604,4.871H425.74v-10.429h22.245%20c2.087,0,3.481,0,4.87-1.392c0.693-0.697,1.391-2.085,1.391-3.477c0-1.394-0.698-2.778-1.391-3.475%20c-0.696-0.695-2.085-1.391-4.172-1.391c-11.122-0.696-24.337,0-24.337-15.295c0-6.609,3.781-12.579,13.106-14.352%20c1.115-0.154,2.293-0.253,3.583-0.253h22.948v11.819h-15.3h-5.561h-0.696c-2.087,0-3.476,0-4.865,0.696%20c-0.7,0.697-1.396,2.089-1.396,3.478c0,2.087,0.696,2.783,2.785,3.473c1.389,0.697,2.78,0.697,4.172,0.697h0.691h5.565%20c3.039,0,5.337,0.375,7.44,1.114c1.926,0.697,8.302,3.549,9.728,10.994c0.124,0.78,0.215,1.594,0.215,2.495%20C466.761,313.925,465.37,317.401,462.59,320.179z'/%3e%3c/g%3e%3c/svg%3e", Tt = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20height='30px'%20width='30px'%20version='1.1'%20id='Capa_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20512%20512'%20xml:space='preserve'%3e%3cpath%20style='fill:%2334495E;'%20d='M512,402.282c0,16.716-13.55,30.267-30.265,30.267H30.265C13.55,432.549,0,418.996,0,402.282V109.717%20c0-16.716,13.55-30.266,30.265-30.266h451.469c16.716,0,30.265,13.551,30.265,30.266L512,402.282L512,402.282z'/%3e%3cpath%20style='opacity:0.15;fill:%23202121;enable-background:new%20;'%20d='M21.517,402.282V109.717%20c0-16.716,13.552-30.266,30.267-30.266h-21.52C13.55,79.451,0,93.003,0,109.717v292.565c0,16.716,13.55,30.267,30.265,30.267h21.52%20C35.07,432.549,21.517,418.996,21.517,402.282z'/%3e%3cpath%20style='fill:%23F26E21;'%20d='M309.389,255.801c0.041-9.636-3.572-19.286-10.843-26.558c-7.287-7.287-16.961-10.897-26.617-10.839%20c-0.046,0-0.091-0.003-0.139-0.003c-20.968,0-37.6,16.628-37.6,37.602c0,20.767,16.837,37.599,37.6,37.599%20c20.974,0,37.604-16.631,37.604-37.599C309.394,255.934,309.389,255.869,309.389,255.801z'/%3e%3cg%3e%3cpath%20style='fill:%23E7E8E3;'%20d='M227.198,271.909c-5.62,5.626-10.807,7.824-16.394,7.943c-13.611-0.122-23.618-10.202-23.618-24.573%20c0-7.234,2.739-13.163,7.078-18.228l0,0c4.069-3.863,9.311-6.359,15.339-6.359c6.507,0,11.571,2.169,17.352,7.954v-16.631%20c-5.78-2.891-10.846-4.338-17.352-4.338c-9.192,0.657-17.859,4.371-24.507,10.203l0,0c-1.916,1.724-3.752,3.627-5.309,5.805%20c-4.856,6.294-7.791,14.001-7.791,22.32c0,20.967,16.637,36.875,37.606,36.875c0.102,0,0.203-0.009,0.302-0.01%20c0.141,0.002,0.28,0.01,0.42,0.01c5.784,0,10.85-1.443,17.357-4.336L227.198,271.909c-0.244,0.244,0.242,0.471,0,0.702V271.909z'/%3e%3cpolygon%20style='fill:%23E7E8E3;'%20points='356.863,228.033%20356.863,228.033%20340.487,268.295%20321.685,220.566%20306.502,220.566%20336.148,293.601%20344.102,293.601%20375.196,220.566%20360.013,220.566%20'/%3e%3cpolygon%20style='fill:%23E7E8E3;'%20points='380.983,252.384%20380.983,291.435%20420.033,291.435%20420.753,291.435%20420.753,279.861%20408.461,279.861%20395.445,279.861%20395.445,266.848%20395.445,260.342%20420.033,260.342%20420.033,248.045%20395.445,248.045%20395.445,232.861%20420.753,232.861%20420.753,220.566%20380.983,220.566%20'/%3e%3cpath%20style='fill:%23E7E8E3;'%20d='M54.135,220.566H33.884v70.869h20.25c10.845,0,18.798-2.895,25.306-7.957%20c7.953-6.508,13.017-16.629,13.017-27.474C92.458,235.028,77.27,220.566,54.135,220.566z%20M70.765,274.08%20c-4.339,3.614-10.124,5.781-18.802,5.781h-4.339V232.86h3.615c8.678,0,14.463,1.446,18.803,5.783%20c5.061,4.336,7.955,10.848,7.955,17.358C78.72,262.509,75.828,269.737,70.765,274.08z'/%3e%3crect%20x='98.97'%20y='220.56'%20style='fill:%23E7E8E3;'%20width='13.739'%20height='70.867'/%3e%3cpath%20style='fill:%23E7E8E3;'%20d='M147.415,248.045c-8.676-2.892-10.848-5.063-10.848-8.677c0-4.339,4.339-7.954,10.124-7.954%20c4.339,0,7.954,1.447,11.57,5.786l7.233-9.4c-5.787-5.064-13.015-7.953-20.97-7.953c-12.296,0-22.42,8.678-22.42,20.244%20c0,10.126,4.343,14.464,17.357,19.526c5.785,2.166,7.955,2.892,9.404,4.338c2.887,1.444,4.336,4.339,4.336,7.228%20c0,5.786-4.336,10.126-10.848,10.126c-6.514,0-12.294-3.615-15.187-9.401l-8.678,8.678c6.511,9.4,14.465,13.738,24.589,13.738%20c14.461,0,24.58-9.4,24.58-23.141C167.659,258.893,163.324,253.831,147.415,248.045z'/%3e%3cpath%20style='fill:%23E7E8E3;'%20d='M459.804,261.783c10.843-2.166,16.63-9.4,16.63-20.244c0-13.014-9.402-20.973-25.308-20.973h-20.972%20v70.869h13.739V263.23h2.172l19.519,28.205h16.634L459.804,261.783z%20M448.23,253.105h-4.336v-21.691h4.336%20c8.678,0,13.742,3.614,13.742,10.85C461.972,249.492,456.909,253.105,448.23,253.105z'/%3e%3c/g%3e%3c/svg%3e", zt = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20height='800px'%20width='800px'%20version='1.1'%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20291.791%20291.791'%20xml:space='preserve'%3e%3cg%3e%3cpath%20style='fill:%23E2574C;'%20d='M182.298,145.895c0,50.366-40.801,91.176-91.149,91.176S0,196.252,0,145.895%20s40.811-91.176,91.149-91.176S182.298,95.538,182.298,145.895z'/%3e%3cpath%20style='fill:%23F4B459;'%20d='M200.616,54.719c-20.442,0-39.261,6.811-54.469,18.181l0.073,0.009%20c2.991,2.89,6.291,4.924,8.835,8.251l-18.965,0.301c-2.972,3-5.68,6.264-8.233,9.656H161.3c2.544,3.054,4.896,5.708,7.03,9.081%20h-46.536c-1.705,2.936-3.282,5.954-4.659,9.09h56.493c1.477,3.127,2.799,5.489,3.921,8.799h-63.76%20c-1.012,3.146-1.878,6.364-2.535,9.646h68.966c0.675,3.155,1.194,6.072,1.55,9.045h-71.884c-0.301,3-0.456,6.045-0.456,9.118%20h72.859c0,3.228-0.228,6.218-0.556,9.118h-71.847c0.31,3.091,0.766,6.127,1.368,9.118h68.856c-0.711,2.954-1.532,5.926-2.562,9.008%20h-63.969c0.966,3.118,2.143,6.145,3.428,9.099h56.621c-1.568,3.319-3.346,5.972-5.306,9.081h-46.691%20c1.842,3.191,3.875,6.236,6.081,9.154l33.589,0.501c-2.863,3.437-6.537,5.507-9.884,8.516c0.182,0.146-5.352-0.018-16.248-0.191%20c16.576,17.105,39.744,27.772,65.446,27.772c50.357,0,91.176-40.82,91.176-91.176S250.981,54.719,200.616,54.719z'/%3e%3c/g%3e%3c/svg%3e", Nt = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20width='800px'%20height='800px'%20viewBox='0%20-140%20780%20780'%20enable-background='new%200%200%20780%20500'%20version='1.1'%20xml:space='preserve'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M40,0h700c22.092,0,40,17.909,40,40v420c0,22.092-17.908,40-40,40H40c-22.091,0-40-17.908-40-40V40%20C0,17.909,17.909,0,40,0z'%20fill='%230E4595'/%3e%3cpath%20d='m293.2%20348.73l33.361-195.76h53.36l-33.385%20195.76h-53.336zm246.11-191.54c-10.57-3.966-27.137-8.222-47.822-8.222-52.725%200-89.865%2026.55-90.18%2064.603-0.299%2028.13%2026.514%2043.822%2046.752%2053.186%2020.771%209.595%2027.752%2015.714%2027.654%2024.283-0.131%2013.121-16.586%2019.116-31.922%2019.116-21.357%200-32.703-2.967-50.227-10.276l-6.876-3.11-7.489%2043.823c12.463%205.464%2035.51%2010.198%2059.438%2010.443%2056.09%200%2092.5-26.246%2092.916-66.882%200.199-22.269-14.016-39.216-44.801-53.188-18.65-9.055-30.072-15.099-29.951-24.268%200-8.137%209.668-16.839%2030.557-16.839%2017.449-0.27%2030.09%203.535%2039.938%207.5l4.781%202.26%207.232-42.429m137.31-4.223h-41.232c-12.773%200-22.332%203.487-27.941%2016.234l-79.244%20179.4h56.031s9.16-24.123%2011.232-29.418c6.125%200%2060.555%200.084%2068.338%200.084%201.596%206.853%206.49%2029.334%206.49%2029.334h49.514l-43.188-195.64zm-65.418%20126.41c4.412-11.279%2021.26-54.723%2021.26-54.723-0.316%200.522%204.379-11.334%207.074-18.684l3.605%2016.879s10.219%2046.729%2012.354%2056.528h-44.293zm-363.3-126.41l-52.24%20133.5-5.567-27.13c-9.725-31.273-40.025-65.155-73.898-82.118l47.766%20171.2%2056.456-0.064%2084.004-195.39h-56.521'%20fill='%23ffffff'/%3e%3cpath%20d='m146.92%20152.96h-86.041l-0.681%204.073c66.938%2016.204%20111.23%2055.363%20129.62%20102.41l-18.71-89.96c-3.23-12.395-12.597-16.094-24.186-16.527'%20fill='%23F2AE14'/%3e%3c/svg%3e", F = [
|
|
1265
1319
|
{
|
|
1266
1320
|
type: "visa",
|
|
1267
|
-
imgSrc:
|
|
1321
|
+
imgSrc: Nt
|
|
1268
1322
|
},
|
|
1269
1323
|
{
|
|
1270
1324
|
type: "masterCard",
|
|
1271
|
-
imgSrc:
|
|
1325
|
+
imgSrc: zt
|
|
1272
1326
|
},
|
|
1273
1327
|
{
|
|
1274
1328
|
type: "americanExpress",
|
|
1275
|
-
imgSrc:
|
|
1329
|
+
imgSrc: It
|
|
1276
1330
|
},
|
|
1277
1331
|
{
|
|
1278
1332
|
type: "discover",
|
|
1279
|
-
imgSrc:
|
|
1333
|
+
imgSrc: Tt
|
|
1280
1334
|
}
|
|
1281
1335
|
];
|
|
1282
|
-
class
|
|
1336
|
+
class At extends h {
|
|
1283
1337
|
cardType;
|
|
1284
1338
|
constructor(e) {
|
|
1285
1339
|
super("div", []), this.cardType = e.cardType;
|
|
@@ -1289,16 +1343,16 @@ class kt extends d {
|
|
|
1289
1343
|
a.className = e.isLoading ? "loading" : "", a.style.borderRadius = `${e.styles.borderRadius}px ${e.styles.borderRadius}px 0px 0px`;
|
|
1290
1344
|
const i = document.createElement("div");
|
|
1291
1345
|
i.id = "card-element", i.className = `card-element ${e.isFocused ? "card-element-focus" : ""}`, i.style.zIndex = e.isFocused ? "2" : "0";
|
|
1292
|
-
const
|
|
1293
|
-
if (
|
|
1294
|
-
|
|
1295
|
-
|
|
1346
|
+
const r = document.createElement("div");
|
|
1347
|
+
if (r.className = "cards-position", e.cardType === "unknown")
|
|
1348
|
+
F.forEach((s) => {
|
|
1349
|
+
r.appendChild(this.createCardIcon(s));
|
|
1296
1350
|
});
|
|
1297
1351
|
else {
|
|
1298
|
-
const
|
|
1299
|
-
|
|
1352
|
+
const s = F.find((o) => o.type === e.cardType);
|
|
1353
|
+
s && r.appendChild(this.createCardIcon(s));
|
|
1300
1354
|
}
|
|
1301
|
-
i.appendChild(
|
|
1355
|
+
i.appendChild(r), a.appendChild(i), this.getElement().appendChild(a);
|
|
1302
1356
|
}
|
|
1303
1357
|
createCardIcon(e) {
|
|
1304
1358
|
const t = document.createElement("div");
|
|
@@ -1326,19 +1380,19 @@ class kt extends d {
|
|
|
1326
1380
|
const a = this.getElement().querySelector(".cards-position");
|
|
1327
1381
|
if (a)
|
|
1328
1382
|
if (a.innerHTML = "", this.cardType === "unknown")
|
|
1329
|
-
|
|
1383
|
+
F.forEach((i) => {
|
|
1330
1384
|
a.appendChild(this.createCardIcon(i));
|
|
1331
1385
|
});
|
|
1332
1386
|
else {
|
|
1333
|
-
const i =
|
|
1334
|
-
i ? a.appendChild(this.createCardIcon(i)) :
|
|
1335
|
-
a.appendChild(this.createCardIcon(
|
|
1387
|
+
const i = F.find((r) => r.type === this.cardType);
|
|
1388
|
+
i ? a.appendChild(this.createCardIcon(i)) : F.forEach((r) => {
|
|
1389
|
+
a.appendChild(this.createCardIcon(r));
|
|
1336
1390
|
});
|
|
1337
1391
|
}
|
|
1338
1392
|
return this;
|
|
1339
1393
|
}
|
|
1340
1394
|
}
|
|
1341
|
-
class
|
|
1395
|
+
class Pt extends h {
|
|
1342
1396
|
cardNumber;
|
|
1343
1397
|
cardExpiry;
|
|
1344
1398
|
cardCvv;
|
|
@@ -1349,37 +1403,39 @@ class Tt extends d {
|
|
|
1349
1403
|
checkoutProfile: t,
|
|
1350
1404
|
isLoading: a,
|
|
1351
1405
|
isFocused: i,
|
|
1352
|
-
isCvvFocused:
|
|
1353
|
-
isCcValid:
|
|
1406
|
+
isCvvFocused: r,
|
|
1407
|
+
isCcValid: s,
|
|
1354
1408
|
isCvvValid: o,
|
|
1355
1409
|
cardType: l,
|
|
1356
1410
|
cardExpiry: c,
|
|
1357
|
-
cardExpiryError:
|
|
1358
|
-
cardExpiryTouched:
|
|
1359
|
-
onChange:
|
|
1360
|
-
onBlur:
|
|
1361
|
-
translationFunc:
|
|
1362
|
-
|
|
1363
|
-
|
|
1411
|
+
cardExpiryError: d,
|
|
1412
|
+
cardExpiryTouched: u,
|
|
1413
|
+
onChange: E,
|
|
1414
|
+
onBlur: v,
|
|
1415
|
+
translationFunc: m,
|
|
1416
|
+
cardExpiryAutocomplete: g = "cc-exp"
|
|
1417
|
+
} = e, f = document.createElement("div");
|
|
1418
|
+
f.className = "card-grid", this.cardNumber = new At({
|
|
1364
1419
|
styles: {
|
|
1365
1420
|
color: t.styles.textColor,
|
|
1366
1421
|
fontSize: t.styles.fontSize,
|
|
1367
1422
|
borderRadius: t.styles.borderRadius
|
|
1368
1423
|
},
|
|
1369
|
-
label:
|
|
1424
|
+
label: m("cardInformation"),
|
|
1370
1425
|
isLoading: a,
|
|
1371
1426
|
isFocused: i,
|
|
1372
1427
|
cardType: l
|
|
1373
|
-
}),
|
|
1374
|
-
const
|
|
1375
|
-
|
|
1428
|
+
}), f.appendChild(this.cardNumber.getElement());
|
|
1429
|
+
const p = document.createElement("div");
|
|
1430
|
+
p.className = "card-details", this.cardExpiry = new T({
|
|
1376
1431
|
name: "cardExpiry",
|
|
1377
|
-
placeholder:
|
|
1378
|
-
error: !!(
|
|
1379
|
-
errorMsg:
|
|
1432
|
+
placeholder: m("cardExpiry"),
|
|
1433
|
+
error: !!(d && u),
|
|
1434
|
+
errorMsg: d,
|
|
1380
1435
|
value: c,
|
|
1381
|
-
|
|
1382
|
-
|
|
1436
|
+
autocomplete: g,
|
|
1437
|
+
onChange: (y) => {
|
|
1438
|
+
this.trimCardExpiry(), E(y);
|
|
1383
1439
|
},
|
|
1384
1440
|
styles: {
|
|
1385
1441
|
color: t.styles.textColor,
|
|
@@ -1387,36 +1443,36 @@ class Tt extends d {
|
|
|
1387
1443
|
fontSize: t.styles.fontSize,
|
|
1388
1444
|
fontFamily: t.styles.fontFamily
|
|
1389
1445
|
}
|
|
1390
|
-
}), this.cardExpiry.addEventListener("blur",
|
|
1391
|
-
const
|
|
1446
|
+
}), this.cardExpiry.addEventListener("blur", v), this.cardExpiry.addEventListener("keydown", (y) => {
|
|
1447
|
+
const M = y;
|
|
1392
1448
|
![
|
|
1393
1449
|
"Backspace",
|
|
1394
1450
|
"Delete",
|
|
1395
1451
|
"ArrowLeft",
|
|
1396
1452
|
"ArrowRight",
|
|
1397
1453
|
"Tab"
|
|
1398
|
-
].includes(
|
|
1454
|
+
].includes(M.key) && !/^\d$/.test(M.key) && M.preventDefault();
|
|
1399
1455
|
});
|
|
1400
|
-
const
|
|
1401
|
-
|
|
1402
|
-
const
|
|
1403
|
-
if (
|
|
1456
|
+
const C = this.cardExpiry.getElement();
|
|
1457
|
+
C.style.height = "100%";
|
|
1458
|
+
const b = document.createElement("div");
|
|
1459
|
+
if (b.className = "input-wrapper", this.cardCvv = new kt({
|
|
1404
1460
|
styles: {
|
|
1405
1461
|
borderRadius: typeof t.styles.borderRadius == "number" ? t.styles.borderRadius : 0
|
|
1406
1462
|
},
|
|
1407
1463
|
isLoading: a,
|
|
1408
|
-
isFocused:
|
|
1409
|
-
}),
|
|
1410
|
-
const
|
|
1411
|
-
text:
|
|
1464
|
+
isFocused: r
|
|
1465
|
+
}), b.appendChild(this.cardCvv.getElement()), p.appendChild(this.cardExpiry.getElement()), p.appendChild(b), f.appendChild(p), this.getElement().appendChild(f), i && !s) {
|
|
1466
|
+
const y = new x({
|
|
1467
|
+
text: m("validation.cardNumberInvalid")
|
|
1412
1468
|
});
|
|
1413
|
-
this.validationMessages.set("cardNumber",
|
|
1469
|
+
this.validationMessages.set("cardNumber", y), this.appendChild(y);
|
|
1414
1470
|
}
|
|
1415
|
-
if (
|
|
1416
|
-
const
|
|
1417
|
-
text:
|
|
1471
|
+
if (r && !o) {
|
|
1472
|
+
const y = new x({
|
|
1473
|
+
text: m("validation.cardSecurityFormat")
|
|
1418
1474
|
});
|
|
1419
|
-
this.validationMessages.set("cardCvv",
|
|
1475
|
+
this.validationMessages.set("cardCvv", y), this.appendChild(y);
|
|
1420
1476
|
}
|
|
1421
1477
|
}
|
|
1422
1478
|
updateCardType(e) {
|
|
@@ -1435,7 +1491,7 @@ class Tt extends d {
|
|
|
1435
1491
|
updateCardNumberValidation(e, t, a) {
|
|
1436
1492
|
if (this.cardNumber.setFocused(e), e && !t) {
|
|
1437
1493
|
if (!this.validationMessages.has("cardNumber")) {
|
|
1438
|
-
const i = new
|
|
1494
|
+
const i = new x({
|
|
1439
1495
|
text: a("validation.cardNumberInvalid")
|
|
1440
1496
|
});
|
|
1441
1497
|
this.validationMessages.set("cardNumber", i), this.appendChild(i);
|
|
@@ -1449,7 +1505,7 @@ class Tt extends d {
|
|
|
1449
1505
|
updateCardCvvValidation(e, t, a) {
|
|
1450
1506
|
if (this.cardCvv.setFocused(e), e && !t) {
|
|
1451
1507
|
if (!this.validationMessages.has("cardCvv")) {
|
|
1452
|
-
const i = new
|
|
1508
|
+
const i = new x({
|
|
1453
1509
|
text: a("validation.cardSecurityFormat")
|
|
1454
1510
|
});
|
|
1455
1511
|
this.validationMessages.set("cardCvv", i), this.appendChild(i);
|
|
@@ -1464,23 +1520,24 @@ class Tt extends d {
|
|
|
1464
1520
|
return this.cardNumber.setLoading(e), this.cardCvv.setLoading(e), this;
|
|
1465
1521
|
}
|
|
1466
1522
|
}
|
|
1467
|
-
class
|
|
1523
|
+
class Dt {
|
|
1468
1524
|
input;
|
|
1469
1525
|
constructor(e) {
|
|
1470
1526
|
const {
|
|
1471
1527
|
value: t,
|
|
1472
1528
|
onChange: a,
|
|
1473
1529
|
onBlur: i,
|
|
1474
|
-
error:
|
|
1475
|
-
errorMsg:
|
|
1530
|
+
error: r,
|
|
1531
|
+
errorMsg: s,
|
|
1476
1532
|
checkoutProfile: o,
|
|
1477
|
-
translationFunc: l
|
|
1533
|
+
translationFunc: l,
|
|
1534
|
+
autocomplete: c = "email"
|
|
1478
1535
|
} = e;
|
|
1479
|
-
this.input = new
|
|
1536
|
+
this.input = new T({
|
|
1480
1537
|
name: "email",
|
|
1481
1538
|
label: l("email"),
|
|
1482
|
-
error:
|
|
1483
|
-
errorMsg:
|
|
1539
|
+
error: r,
|
|
1540
|
+
errorMsg: s,
|
|
1484
1541
|
styles: {
|
|
1485
1542
|
color: o.styles.textColor,
|
|
1486
1543
|
borderRadius: `${o.styles.borderRadius}px`,
|
|
@@ -1490,9 +1547,10 @@ class It {
|
|
|
1490
1547
|
placeholder: l("email"),
|
|
1491
1548
|
type: "email",
|
|
1492
1549
|
value: t,
|
|
1550
|
+
autocomplete: c,
|
|
1493
1551
|
// Wrap the original onChange to apply trim before calling it
|
|
1494
|
-
onChange: (
|
|
1495
|
-
this.trim(), a(
|
|
1552
|
+
onChange: (d) => {
|
|
1553
|
+
this.trim(), a(d);
|
|
1496
1554
|
}
|
|
1497
1555
|
}), this.input.addEventListener("blur", i);
|
|
1498
1556
|
}
|
|
@@ -1516,8 +1574,8 @@ class It {
|
|
|
1516
1574
|
return this.input.appendTo(e), this;
|
|
1517
1575
|
}
|
|
1518
1576
|
}
|
|
1519
|
-
const
|
|
1520
|
-
class
|
|
1577
|
+
const $t = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='101px'%20height='32'%20viewBox='0%200%20101%2032'%20preserveAspectRatio='xMinYMin%20meet'%3e%3cpath%20fill='%23003087'%20d='M%2012.237%202.8%20L%204.437%202.8%20C%203.937%202.8%203.437%203.2%203.337%203.7%20L%200.237%2023.7%20C%200.137%2024.1%200.437%2024.4%200.837%2024.4%20L%204.537%2024.4%20C%205.037%2024.4%205.537%2024%205.637%2023.5%20L%206.437%2018.1%20C%206.537%2017.6%206.937%2017.2%207.537%2017.2%20L%2010.037%2017.2%20C%2015.137%2017.2%2018.137%2014.7%2018.937%209.8%20C%2019.237%207.7%2018.937%206%2017.937%204.8%20C%2016.837%203.5%2014.837%202.8%2012.237%202.8%20Z%20M%2013.137%2010.1%20C%2012.737%2012.9%2010.537%2012.9%208.537%2012.9%20L%207.337%2012.9%20L%208.137%207.7%20C%208.137%207.4%208.437%207.2%208.737%207.2%20L%209.237%207.2%20C%2010.637%207.2%2011.937%207.2%2012.637%208%20C%2013.137%208.4%2013.337%209.1%2013.137%2010.1%20Z'/%3e%3cpath%20fill='%23003087'%20d='M%2035.437%2010%20L%2031.737%2010%20C%2031.437%2010%2031.137%2010.2%2031.137%2010.5%20L%2030.937%2011.5%20L%2030.637%2011.1%20C%2029.837%209.9%2028.037%209.5%2026.237%209.5%20C%2022.137%209.5%2018.637%2012.6%2017.937%2017%20C%2017.537%2019.2%2018.037%2021.3%2019.337%2022.7%20C%2020.437%2024%2022.137%2024.6%2024.037%2024.6%20C%2027.337%2024.6%2029.237%2022.5%2029.237%2022.5%20L%2029.037%2023.5%20C%2028.937%2023.9%2029.237%2024.3%2029.637%2024.3%20L%2033.037%2024.3%20C%2033.537%2024.3%2034.037%2023.9%2034.137%2023.4%20L%2036.137%2010.6%20C%2036.237%2010.4%2035.837%2010%2035.437%2010%20Z%20M%2030.337%2017.2%20C%2029.937%2019.3%2028.337%2020.8%2026.137%2020.8%20C%2025.037%2020.8%2024.237%2020.5%2023.637%2019.8%20C%2023.037%2019.1%2022.837%2018.2%2023.037%2017.2%20C%2023.337%2015.1%2025.137%2013.6%2027.237%2013.6%20C%2028.337%2013.6%2029.137%2014%2029.737%2014.6%20C%2030.237%2015.3%2030.437%2016.2%2030.337%2017.2%20Z'/%3e%3cpath%20fill='%23003087'%20d='M%2055.337%2010%20L%2051.637%2010%20C%2051.237%2010%2050.937%2010.2%2050.737%2010.5%20L%2045.537%2018.1%20L%2043.337%2010.8%20C%2043.237%2010.3%2042.737%2010%2042.337%2010%20L%2038.637%2010%20C%2038.237%2010%2037.837%2010.4%2038.037%2010.9%20L%2042.137%2023%20L%2038.237%2028.4%20C%2037.937%2028.8%2038.237%2029.4%2038.737%2029.4%20L%2042.437%2029.4%20C%2042.837%2029.4%2043.137%2029.2%2043.337%2028.9%20L%2055.837%2010.9%20C%2056.137%2010.6%2055.837%2010%2055.337%2010%20Z'/%3e%3cpath%20fill='%23009cde'%20d='M%2067.737%202.8%20L%2059.937%202.8%20C%2059.437%202.8%2058.937%203.2%2058.837%203.7%20L%2055.737%2023.6%20C%2055.637%2024%2055.937%2024.3%2056.337%2024.3%20L%2060.337%2024.3%20C%2060.737%2024.3%2061.037%2024%2061.037%2023.7%20L%2061.937%2018%20C%2062.037%2017.5%2062.437%2017.1%2063.037%2017.1%20L%2065.537%2017.1%20C%2070.637%2017.1%2073.637%2014.6%2074.437%209.7%20C%2074.737%207.6%2074.437%205.9%2073.437%204.7%20C%2072.237%203.5%2070.337%202.8%2067.737%202.8%20Z%20M%2068.637%2010.1%20C%2068.237%2012.9%2066.037%2012.9%2064.037%2012.9%20L%2062.837%2012.9%20L%2063.637%207.7%20C%2063.637%207.4%2063.937%207.2%2064.237%207.2%20L%2064.737%207.2%20C%2066.137%207.2%2067.437%207.2%2068.137%208%20C%2068.637%208.4%2068.737%209.1%2068.637%2010.1%20Z'/%3e%3cpath%20fill='%23009cde'%20d='M%2090.937%2010%20L%2087.237%2010%20C%2086.937%2010%2086.637%2010.2%2086.637%2010.5%20L%2086.437%2011.5%20L%2086.137%2011.1%20C%2085.337%209.9%2083.537%209.5%2081.737%209.5%20C%2077.637%209.5%2074.137%2012.6%2073.437%2017%20C%2073.037%2019.2%2073.537%2021.3%2074.837%2022.7%20C%2075.937%2024%2077.637%2024.6%2079.537%2024.6%20C%2082.837%2024.6%2084.737%2022.5%2084.737%2022.5%20L%2084.537%2023.5%20C%2084.437%2023.9%2084.737%2024.3%2085.137%2024.3%20L%2088.537%2024.3%20C%2089.037%2024.3%2089.537%2023.9%2089.637%2023.4%20L%2091.637%2010.6%20C%2091.637%2010.4%2091.337%2010%2090.937%2010%20Z%20M%2085.737%2017.2%20C%2085.337%2019.3%2083.737%2020.8%2081.537%2020.8%20C%2080.437%2020.8%2079.637%2020.5%2079.037%2019.8%20C%2078.437%2019.1%2078.237%2018.2%2078.437%2017.2%20C%2078.737%2015.1%2080.537%2013.6%2082.637%2013.6%20C%2083.737%2013.6%2084.537%2014%2085.137%2014.6%20C%2085.737%2015.3%2085.937%2016.2%2085.737%2017.2%20Z'/%3e%3cpath%20fill='%23009cde'%20d='M%2095.337%203.3%20L%2092.137%2023.6%20C%2092.037%2024%2092.337%2024.3%2092.737%2024.3%20L%2095.937%2024.3%20C%2096.437%2024.3%2096.937%2023.9%2097.037%2023.4%20L%20100.237%203.5%20C%20100.337%203.1%20100.037%202.8%2099.637%202.8%20L%2096.037%202.8%20C%2095.637%202.8%2095.437%203%2095.337%203.3%20Z'/%3e%3c/svg%3e";
|
|
1578
|
+
class Rt extends h {
|
|
1521
1579
|
formData;
|
|
1522
1580
|
onSubmit;
|
|
1523
1581
|
isSubmitting = !1;
|
|
@@ -1527,8 +1585,8 @@ class zt extends d {
|
|
|
1527
1585
|
this.formData = t, this.onSubmit = a, this.getElement().style.cursor = a ? "pointer" : "default", this.getElement().style.opacity = "1";
|
|
1528
1586
|
const i = document.createElement("div");
|
|
1529
1587
|
i.className = "paypal-icon-container";
|
|
1530
|
-
const
|
|
1531
|
-
|
|
1588
|
+
const r = document.createElement("img");
|
|
1589
|
+
r.src = $t, r.style.width = "69px", r.style.height = "22px", r.style.maxWidth = "100%", r.style.display = "block", r.style.height = "auto", i.appendChild(r), this.getElement().appendChild(i), a && this.getElement().addEventListener("click", () => this.handleSubmit());
|
|
1532
1590
|
}
|
|
1533
1591
|
async handleSubmit() {
|
|
1534
1592
|
if (!(!this.onSubmit || this.isSubmitting)) {
|
|
@@ -1549,7 +1607,7 @@ class zt extends d {
|
|
|
1549
1607
|
return this.isSubmitting = e, this.getElement().style.opacity = e ? "0.7" : "1", this;
|
|
1550
1608
|
}
|
|
1551
1609
|
}
|
|
1552
|
-
class
|
|
1610
|
+
class Vt extends h {
|
|
1553
1611
|
paymentMethods;
|
|
1554
1612
|
constructor(e) {
|
|
1555
1613
|
const { checkoutProfile: t, formData: a, onPaypalSubmit: i } = e;
|
|
@@ -1557,19 +1615,19 @@ class Pt extends d {
|
|
|
1557
1615
|
super("div", ["payment-methods"]), this.paymentMethods = /* @__PURE__ */ new Map(), this.getElement().style.display = "none";
|
|
1558
1616
|
return;
|
|
1559
1617
|
}
|
|
1560
|
-
const
|
|
1618
|
+
const r = Object.entries(
|
|
1561
1619
|
t.additionalPaymentMethods
|
|
1562
|
-
).filter(([,
|
|
1563
|
-
if (
|
|
1620
|
+
).filter(([, s]) => s.enabled).sort((s, o) => s[1].order - o[1].order);
|
|
1621
|
+
if (r.length === 0) {
|
|
1564
1622
|
super("div", ["payment-methods"]), this.paymentMethods = /* @__PURE__ */ new Map(), this.getElement().style.display = "none";
|
|
1565
1623
|
return;
|
|
1566
1624
|
}
|
|
1567
1625
|
super("div", ["payment-methods"]), this.paymentMethods = /* @__PURE__ */ new Map();
|
|
1568
|
-
for (const [
|
|
1569
|
-
switch (
|
|
1626
|
+
for (const [s] of r)
|
|
1627
|
+
switch (s) {
|
|
1570
1628
|
case "paypal": {
|
|
1571
1629
|
if (i) {
|
|
1572
|
-
const o = new
|
|
1630
|
+
const o = new Rt({
|
|
1573
1631
|
checkoutProfile: t,
|
|
1574
1632
|
formData: a,
|
|
1575
1633
|
onSubmit: i
|
|
@@ -1588,8 +1646,8 @@ class Pt extends d {
|
|
|
1588
1646
|
return this.paymentMethods.size > 0 && this.getElement().style.display !== "none";
|
|
1589
1647
|
}
|
|
1590
1648
|
}
|
|
1591
|
-
const
|
|
1592
|
-
class
|
|
1649
|
+
const Bt = 17;
|
|
1650
|
+
class Ot extends h {
|
|
1593
1651
|
styles;
|
|
1594
1652
|
isHovered = !1;
|
|
1595
1653
|
constructor(e) {
|
|
@@ -1600,7 +1658,7 @@ class Dt extends d {
|
|
|
1600
1658
|
}
|
|
1601
1659
|
applyStyles() {
|
|
1602
1660
|
const e = this.getElement();
|
|
1603
|
-
e.style.backgroundColor = this.isHovered ? `color-mix(in srgb, ${this.styles.backgroundColor} 80%, transparent)` : this.styles.backgroundColor, e.disabled ? e.style.color = "#cccccc" : e.style.color = this.styles.color, e.style.borderRadius = this.styles.borderRadius ===
|
|
1661
|
+
e.style.backgroundColor = this.isHovered ? `color-mix(in srgb, ${this.styles.backgroundColor} 80%, transparent)` : this.styles.backgroundColor, e.disabled ? e.style.color = "#cccccc" : e.style.color = this.styles.color, e.style.borderRadius = this.styles.borderRadius === Bt ? "100vmax" : `${this.styles.borderRadius}px`, e.style.fontSize = `${this.styles.fontSize}px`, e.style.fontFamily = `${this.styles.fontFamily}, sans-serif`;
|
|
1604
1662
|
}
|
|
1605
1663
|
handleMouseEnter() {
|
|
1606
1664
|
this.isHovered = !0, this.applyStyles();
|
|
@@ -1612,11 +1670,11 @@ class Dt extends d {
|
|
|
1612
1670
|
return this.getElement().disabled = e, e ? (this.addClass("disabled"), this.removeClass("valid")) : (this.removeClass("disabled"), this.addClass("valid")), this.applyStyles(), this;
|
|
1613
1671
|
}
|
|
1614
1672
|
}
|
|
1615
|
-
class
|
|
1673
|
+
class Ht {
|
|
1616
1674
|
button;
|
|
1617
1675
|
constructor(e) {
|
|
1618
1676
|
const { disabled: t, checkoutProfile: a, translationFunc: i } = e;
|
|
1619
|
-
this.button = new
|
|
1677
|
+
this.button = new Ot({
|
|
1620
1678
|
text: i(
|
|
1621
1679
|
`buttonTexts.${a?.layout.actionButton.translationKey}`
|
|
1622
1680
|
),
|
|
@@ -1643,8 +1701,8 @@ class $t {
|
|
|
1643
1701
|
return this.button.appendTo(e), this;
|
|
1644
1702
|
}
|
|
1645
1703
|
}
|
|
1646
|
-
const
|
|
1647
|
-
class
|
|
1704
|
+
const Kt = "https://test-htp.tokenex.com/Iframe/Iframe-v3.min.js", jt = "https://htp.tokenex.com/iframe/iframe-v3.min.js";
|
|
1705
|
+
class Ut extends h {
|
|
1648
1706
|
options;
|
|
1649
1707
|
isSubmitting = !1;
|
|
1650
1708
|
scriptCleanup;
|
|
@@ -1658,12 +1716,12 @@ class Bt extends d {
|
|
|
1658
1716
|
spinner;
|
|
1659
1717
|
alert;
|
|
1660
1718
|
// factories
|
|
1661
|
-
formManager =
|
|
1719
|
+
formManager = Y();
|
|
1662
1720
|
checkoutProfile;
|
|
1663
|
-
translation =
|
|
1721
|
+
translation = I();
|
|
1664
1722
|
iframeHook;
|
|
1665
1723
|
constructor(e) {
|
|
1666
|
-
super("form", ["form-container"]), this.options = e, this.checkoutProfile =
|
|
1724
|
+
super("form", ["form-container"]), this.options = e, this.checkoutProfile = H({
|
|
1667
1725
|
apiKey: e.apiKey,
|
|
1668
1726
|
profileId: e.profileId,
|
|
1669
1727
|
environment: e.environment
|
|
@@ -1689,12 +1747,14 @@ class Bt extends d {
|
|
|
1689
1747
|
if (this.setLoadingState(!1), e.checkoutProfile)
|
|
1690
1748
|
try {
|
|
1691
1749
|
if (e.checkoutProfile.styles?.fontFamily) {
|
|
1692
|
-
const { cleanup: t } =
|
|
1750
|
+
const { cleanup: t } = St({
|
|
1693
1751
|
fontFamily: e.checkoutProfile.styles.fontFamily
|
|
1694
1752
|
});
|
|
1695
1753
|
this.fontCleanup = t;
|
|
1696
1754
|
}
|
|
1697
|
-
this.initializeTokenExIframe()
|
|
1755
|
+
this.renderFormComponents(), this.initializeTokenExIframe().catch((t) => {
|
|
1756
|
+
console.error("Error initializing TokenEx iframe:", t), this.setErrorMessage("Failed to initialize payment form");
|
|
1757
|
+
});
|
|
1698
1758
|
} catch {
|
|
1699
1759
|
const t = e.error || "Failed to load checkout profile data";
|
|
1700
1760
|
this.setErrorMessage(t);
|
|
@@ -1704,7 +1764,7 @@ class Bt extends d {
|
|
|
1704
1764
|
applyFormContainerStyles(e) {
|
|
1705
1765
|
e.fontFamily && (this.getElement().style.fontFamily = e.fontFamily);
|
|
1706
1766
|
}
|
|
1707
|
-
initializeTokenExIframe = () => {
|
|
1767
|
+
initializeTokenExIframe = async () => {
|
|
1708
1768
|
const e = this.checkoutProfile.getState();
|
|
1709
1769
|
if (e.checkoutProfile && !this.iframeHook)
|
|
1710
1770
|
try {
|
|
@@ -1712,10 +1772,10 @@ class Bt extends d {
|
|
|
1712
1772
|
setTimeout(() => this.initializeTokenExIframe(), 500);
|
|
1713
1773
|
return;
|
|
1714
1774
|
}
|
|
1715
|
-
const { inputStyles: t, formContainerStyle: a } =
|
|
1775
|
+
const { inputStyles: t, formContainerStyle: a } = Ft(
|
|
1716
1776
|
e.checkoutProfile
|
|
1717
1777
|
);
|
|
1718
|
-
this.applyFormContainerStyles(a), this.iframeHook =
|
|
1778
|
+
this.applyFormContainerStyles(a), this.iframeHook = Q({
|
|
1719
1779
|
apiKey: this.options.apiKey,
|
|
1720
1780
|
checkoutProfile: e.checkoutProfile,
|
|
1721
1781
|
inputStyles: t,
|
|
@@ -1723,11 +1783,13 @@ class Bt extends d {
|
|
|
1723
1783
|
this.formManager.setFormData(i);
|
|
1724
1784
|
},
|
|
1725
1785
|
environment: this.options.environment
|
|
1726
|
-
}), this.iframeHook?.subscribe(this.handleIframeStateChange), this.
|
|
1786
|
+
}), this.iframeHook?.subscribe(this.handleIframeStateChange), await this.iframeHook?.initialize();
|
|
1727
1787
|
} catch {
|
|
1728
1788
|
this.setErrorMessage("Failed to initialize payment form");
|
|
1729
1789
|
}
|
|
1730
|
-
else e.checkoutProfile
|
|
1790
|
+
else e.checkoutProfile || this.setErrorMessage(
|
|
1791
|
+
"Cannot initialize iframe: No checkout profile available"
|
|
1792
|
+
);
|
|
1731
1793
|
};
|
|
1732
1794
|
handleIframeStateChange = (e) => {
|
|
1733
1795
|
this.cardSection && (this.cardSection.updateCardNumberValidation(
|
|
@@ -1741,17 +1803,25 @@ class Bt extends d {
|
|
|
1741
1803
|
), this.cardSection.updateCardType(e.possibleCardType), this.cardSection.setLoading(e.loadingIframe)), this.submitButton && this.submitButton.setDisabled(this.isFormDisabled());
|
|
1742
1804
|
};
|
|
1743
1805
|
createCardSection = (e) => {
|
|
1744
|
-
if (
|
|
1806
|
+
if (!this.cardSection)
|
|
1745
1807
|
try {
|
|
1746
|
-
const { formData: t, errors: a, touched: i } = this._getFormStateData()
|
|
1747
|
-
|
|
1808
|
+
const { formData: t, errors: a, touched: i } = this._getFormStateData();
|
|
1809
|
+
let r = {
|
|
1810
|
+
loadingIframe: !0,
|
|
1811
|
+
isFocused: !1,
|
|
1812
|
+
isCvvFocused: !1,
|
|
1813
|
+
isCcValid: !1,
|
|
1814
|
+
isCvvValid: !1,
|
|
1815
|
+
possibleCardType: "unknown"
|
|
1816
|
+
};
|
|
1817
|
+
this.iframeHook && (r = this.iframeHook.getState()), this.cardSection = new Pt({
|
|
1748
1818
|
checkoutProfile: e,
|
|
1749
|
-
isLoading:
|
|
1750
|
-
isFocused:
|
|
1751
|
-
isCvvFocused:
|
|
1752
|
-
isCcValid:
|
|
1753
|
-
isCvvValid:
|
|
1754
|
-
cardType:
|
|
1819
|
+
isLoading: r.loadingIframe,
|
|
1820
|
+
isFocused: r.isFocused,
|
|
1821
|
+
isCvvFocused: r.isCvvFocused,
|
|
1822
|
+
isCcValid: r.isCcValid,
|
|
1823
|
+
isCvvValid: r.isCvvValid,
|
|
1824
|
+
cardType: r.possibleCardType,
|
|
1755
1825
|
cardExpiry: t.cardExpiry,
|
|
1756
1826
|
cardExpiryError: a.cardExpiry,
|
|
1757
1827
|
cardExpiryTouched: !!i.cardExpiry,
|
|
@@ -1765,7 +1835,7 @@ class Bt extends d {
|
|
|
1765
1835
|
};
|
|
1766
1836
|
initializeForm() {
|
|
1767
1837
|
this.setLoadingState(!0), this.options.errorMsg && this.setErrorMessage(this.options.errorMsg);
|
|
1768
|
-
const e = this.options.environment === "test" ?
|
|
1838
|
+
const e = this.options.environment === "test" ? Kt : jt, { cleanup: t, isLoaded: a } = xt({
|
|
1769
1839
|
scriptSrc: e
|
|
1770
1840
|
});
|
|
1771
1841
|
this.scriptCleanup = t, a.then(() => {
|
|
@@ -1776,17 +1846,25 @@ class Bt extends d {
|
|
|
1776
1846
|
});
|
|
1777
1847
|
}
|
|
1778
1848
|
renderFormComponents() {
|
|
1779
|
-
if (!this.emailField)
|
|
1849
|
+
if (!this.emailField) {
|
|
1850
|
+
console.log("🏗️ Starting form components rendering:", {
|
|
1851
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1852
|
+
});
|
|
1780
1853
|
try {
|
|
1781
1854
|
const e = this.checkoutProfile.getState();
|
|
1782
1855
|
if (!e.checkoutProfile) {
|
|
1783
1856
|
this.setErrorMessage("Failed to load checkout configuration");
|
|
1784
1857
|
return;
|
|
1785
1858
|
}
|
|
1786
|
-
this.createPaymentMethods(e.checkoutProfile), this.createEmailField(e.checkoutProfile), this.createCardSection(e.checkoutProfile), this.createCardholderSection(e.checkoutProfile), this.createSubmitButton(e.checkoutProfile)
|
|
1859
|
+
this.createPaymentMethods(e.checkoutProfile), this.createEmailField(e.checkoutProfile), this.createCardSection(e.checkoutProfile), this.createCardholderSection(e.checkoutProfile), this.createSubmitButton(e.checkoutProfile), console.log("✅ Form components rendered successfully:", {
|
|
1860
|
+
cardElementExists: !!document.getElementById("card-element"),
|
|
1861
|
+
cvvElementExists: !!document.getElementById("card-cvv-element"),
|
|
1862
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1863
|
+
});
|
|
1787
1864
|
} catch {
|
|
1788
1865
|
this.setErrorMessage("Failed to render checkout form components");
|
|
1789
1866
|
}
|
|
1867
|
+
}
|
|
1790
1868
|
}
|
|
1791
1869
|
createPaymentMethods(e) {
|
|
1792
1870
|
if (!e?.additionalPaymentMethods || Object.entries(
|
|
@@ -1794,7 +1872,7 @@ class Bt extends d {
|
|
|
1794
1872
|
).filter(([, i]) => i.enabled).length === 0)
|
|
1795
1873
|
return;
|
|
1796
1874
|
const { formData: a } = this._getFormStateData();
|
|
1797
|
-
this.paymentMethods = new
|
|
1875
|
+
this.paymentMethods = new Vt({
|
|
1798
1876
|
checkoutProfile: e,
|
|
1799
1877
|
formData: a,
|
|
1800
1878
|
onPaypalSubmit: async () => {
|
|
@@ -1804,7 +1882,7 @@ class Bt extends d {
|
|
|
1804
1882
|
}
|
|
1805
1883
|
createEmailField(e) {
|
|
1806
1884
|
const { formData: t, errors: a, touched: i } = this._getFormStateData();
|
|
1807
|
-
this.emailField = new
|
|
1885
|
+
this.emailField = new Dt({
|
|
1808
1886
|
value: t.email,
|
|
1809
1887
|
onChange: this.handleChange,
|
|
1810
1888
|
onBlur: this.handleBlur,
|
|
@@ -1816,7 +1894,7 @@ class Bt extends d {
|
|
|
1816
1894
|
}
|
|
1817
1895
|
createCardholderSection(e) {
|
|
1818
1896
|
const { formData: t, errors: a, touched: i } = this._getFormStateData();
|
|
1819
|
-
this.cardholderSection = new
|
|
1897
|
+
this.cardholderSection = new Mt({
|
|
1820
1898
|
value: t.name,
|
|
1821
1899
|
onChange: this.handleChange,
|
|
1822
1900
|
onBlur: this.handleBlur,
|
|
@@ -1827,7 +1905,7 @@ class Bt extends d {
|
|
|
1827
1905
|
}), this.element.appendChild(this.cardholderSection.getElement());
|
|
1828
1906
|
}
|
|
1829
1907
|
createSubmitButton(e) {
|
|
1830
|
-
this.submitButton = new
|
|
1908
|
+
this.submitButton = new Ht({
|
|
1831
1909
|
disabled: this.isFormDisabled(),
|
|
1832
1910
|
checkoutProfile: e,
|
|
1833
1911
|
translationFunc: this.translation.t
|
|
@@ -1874,10 +1952,10 @@ class Bt extends d {
|
|
|
1874
1952
|
this.options.onLoadingStateChange(e);
|
|
1875
1953
|
return;
|
|
1876
1954
|
}
|
|
1877
|
-
e ? (this.hideSpinner(), this.spinner = new
|
|
1955
|
+
e ? (this.hideSpinner(), this.spinner = new P(), this.appendChild(this.spinner)) : this.hideSpinner();
|
|
1878
1956
|
}
|
|
1879
1957
|
showSpinner(e) {
|
|
1880
|
-
this.hideSpinner(), this.spinner = new
|
|
1958
|
+
this.hideSpinner(), this.spinner = new P({ text: e }), this.appendChild(this.spinner);
|
|
1881
1959
|
}
|
|
1882
1960
|
hideSpinner() {
|
|
1883
1961
|
this.spinner && (this.spinner.getElement().remove(), this.spinner = void 0);
|
|
@@ -1925,7 +2003,7 @@ class Bt extends d {
|
|
|
1925
2003
|
* Update the form error message
|
|
1926
2004
|
*/
|
|
1927
2005
|
setErrorMessage(e) {
|
|
1928
|
-
return this.alert && (this.alert.getElement().remove(), this.alert = void 0), this.alert = new
|
|
2006
|
+
return this.alert && (this.alert.getElement().remove(), this.alert = void 0), this.alert = new wt({ message: e }), this.element.insertBefore(this.alert.getElement(), this.element.firstChild), this;
|
|
1929
2007
|
}
|
|
1930
2008
|
/**
|
|
1931
2009
|
* Clean up resources when the form is destroyed
|
|
@@ -1937,7 +2015,7 @@ class Bt extends d {
|
|
|
1937
2015
|
e.key === "Enter" && !this.isFormDisabled() && (e.target instanceof HTMLTextAreaElement || (e.preventDefault(), this.handleSubmit(e)));
|
|
1938
2016
|
};
|
|
1939
2017
|
}
|
|
1940
|
-
class
|
|
2018
|
+
class _t {
|
|
1941
2019
|
container = null;
|
|
1942
2020
|
options;
|
|
1943
2021
|
onSubmit;
|
|
@@ -1952,7 +2030,7 @@ class Ot {
|
|
|
1952
2030
|
this.container && this.form && (this.form && e.errorMsg && !this.options.disableErrorMessages ? this.form.setErrorMessage(e.errorMsg) : this.renderForm(e.errorMsg));
|
|
1953
2031
|
}
|
|
1954
2032
|
renderForm(e) {
|
|
1955
|
-
this.container && (this.form && (this.form.destroy(), this.form = null), this.form = new
|
|
2033
|
+
this.container && (this.form && (this.form.destroy(), this.form = null), this.form = new Ut({
|
|
1956
2034
|
apiKey: this.options.apiKey,
|
|
1957
2035
|
onSubmit: this.onSubmit,
|
|
1958
2036
|
locale: this.options.locale,
|
|
@@ -1967,7 +2045,7 @@ class Ot {
|
|
|
1967
2045
|
this.form && (this.form.destroy(), this.form = null);
|
|
1968
2046
|
}
|
|
1969
2047
|
}
|
|
1970
|
-
class
|
|
2048
|
+
class qt {
|
|
1971
2049
|
state;
|
|
1972
2050
|
listeners = /* @__PURE__ */ new Set();
|
|
1973
2051
|
constructor(e) {
|
|
@@ -1989,19 +2067,19 @@ class Ht {
|
|
|
1989
2067
|
this.listeners.forEach((t) => t(e));
|
|
1990
2068
|
}
|
|
1991
2069
|
}
|
|
1992
|
-
class
|
|
2070
|
+
class Yt {
|
|
1993
2071
|
config;
|
|
1994
2072
|
apiService;
|
|
1995
2073
|
formManager;
|
|
1996
2074
|
stateManager;
|
|
1997
2075
|
constructor(e) {
|
|
1998
|
-
this.config = this.validateConfig(e), this.apiService = new
|
|
2076
|
+
this.config = this.validateConfig(e), this.apiService = new $(
|
|
1999
2077
|
this.config.apiKey,
|
|
2000
2078
|
this.config.environment
|
|
2001
|
-
), this.stateManager = new
|
|
2079
|
+
), this.stateManager = new qt({
|
|
2002
2080
|
mounted: !1,
|
|
2003
2081
|
form: null
|
|
2004
|
-
}), this.formManager = new
|
|
2082
|
+
}), this.formManager = new _t(
|
|
2005
2083
|
{
|
|
2006
2084
|
locale: this.config.locale,
|
|
2007
2085
|
apiKey: this.config.apiKey,
|
|
@@ -2088,15 +2166,15 @@ class Kt {
|
|
|
2088
2166
|
t && this.formManager.update({ errorMsg: e.details?.message });
|
|
2089
2167
|
}
|
|
2090
2168
|
}
|
|
2091
|
-
typeof globalThis < "u" && (globalThis.OdusCheckout =
|
|
2169
|
+
typeof globalThis < "u" && (globalThis.OdusCheckout = Yt);
|
|
2092
2170
|
export {
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2171
|
+
Yt as OdusCheckout,
|
|
2172
|
+
le as deLocale,
|
|
2173
|
+
ve as enLocale,
|
|
2174
|
+
Le as esLocale,
|
|
2175
|
+
De as frLocale,
|
|
2176
|
+
Ue as itLocale,
|
|
2177
|
+
Qe as plLocale,
|
|
2178
|
+
lt as ptLocale,
|
|
2179
|
+
vt as trLocale
|
|
2102
2180
|
};
|