@paynext/sdk 0.0.125 → 0.0.127
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +308 -302
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +14 -14
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -2,7 +2,7 @@ var Er = Object.defineProperty, kr = Object.defineProperties;
|
|
|
2
2
|
var xr = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var ot = Object.getOwnPropertySymbols;
|
|
4
4
|
var yn = Object.prototype.hasOwnProperty, Cn = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var xt = (n, e, t) => e in n ? Er(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t,
|
|
5
|
+
var xt = (n, e, t) => e in n ? Er(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, y = (n, e) => {
|
|
6
6
|
for (var t in e || (e = {}))
|
|
7
7
|
yn.call(e, t) && xt(n, t, e[t]);
|
|
8
8
|
if (ot)
|
|
@@ -67,7 +67,7 @@ class iu {
|
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
var
|
|
70
|
+
var w = /* @__PURE__ */ ((n) => (n.PAYPAL = "PAYPAL", n.APPLE_PAY = "APPLEPAY", n.GOOGLE_PAY = "GPAY", n.CARD = "CARD", n.VENMO = "VENMO", n))(w || {}), Pt = /* @__PURE__ */ ((n) => (n.PENDING = "PENDING", n.FAILED = "FAILED", n.AUTHORIZED = "AUTHORIZED", n.SETTLING = "SETTLING", n.SETTLED = "SETTLED", n.DECLINED = "DECLINED", n.CANCELLED = "CANCELLED", n))(Pt || {}), Dt = /* @__PURE__ */ ((n) => (n.INSUFFICIENT_FUNDS = "insufficient_funds", n.AUTHENTICATION_REQUIRED = "authentication_required", n.CARD_ISSUER_DECLINE = "card_issuer_decline", n.GENERIC_DECLINE = "generic_decline", n.WITHDRAWAL_LIMIT_EXCEEDED = "withdrawal_limit_exceeded", n.DO_NOT_HONOR = "do_not_honor", n.EXPIRED_CARD = "expired_card", n.SUSPECTED_FRAUD = "suspected_fraud", n.INCORRECT_CVC = "incorrect_cvc", n.INVALID_CARD_NUMBER = "invalid_card_number", n.ISSUER_UNAVAILABLE = "issuer_unavailable", n.CARD_LOST_OR_STOLEN = "card_lost_or_stolen", n.CARD_DECLINED = "card_declined", n))(Dt || {});
|
|
71
71
|
const En = {
|
|
72
72
|
appIds: {
|
|
73
73
|
develop: "app_00b96c0c3011",
|
|
@@ -83,26 +83,26 @@ const En = {
|
|
|
83
83
|
production: "https://api.paynext.com"
|
|
84
84
|
})[n], Tr = [
|
|
85
85
|
{
|
|
86
|
-
type:
|
|
86
|
+
type: w.PAYPAL,
|
|
87
87
|
order: 1,
|
|
88
88
|
is_active: !0
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
|
-
type:
|
|
91
|
+
type: w.APPLE_PAY,
|
|
92
92
|
order: 2,
|
|
93
93
|
is_active: !0
|
|
94
94
|
},
|
|
95
95
|
{
|
|
96
|
-
type:
|
|
96
|
+
type: w.GOOGLE_PAY,
|
|
97
97
|
order: 3,
|
|
98
98
|
is_active: !0
|
|
99
99
|
},
|
|
100
100
|
{
|
|
101
|
-
type:
|
|
101
|
+
type: w.CARD,
|
|
102
102
|
order: 4,
|
|
103
103
|
is_active: !0
|
|
104
104
|
}
|
|
105
|
-
], Ar = (n) => n.googlePay ?
|
|
105
|
+
], Ar = (n) => n.googlePay ? w.GOOGLE_PAY : n.applePay ? w.APPLE_PAY : n.paypal ? w.PAYPAL : n.braintree ? w.VENMO : w.CARD, Lr = (n) => {
|
|
106
106
|
const e = n.card;
|
|
107
107
|
if (e)
|
|
108
108
|
return {
|
|
@@ -129,16 +129,16 @@ const En = {
|
|
|
129
129
|
billing_agreement_token: e.billing_agreement_token.paypalId
|
|
130
130
|
};
|
|
131
131
|
}, Vr = (n) => {
|
|
132
|
-
var t, i;
|
|
132
|
+
var t, i, r, a, s, o, l, u, d, h, m, p, g, b, v, E, _, T;
|
|
133
133
|
const e = n.googlePay;
|
|
134
134
|
if (e != null && e.token)
|
|
135
135
|
return {
|
|
136
136
|
cryptogram: e.cryptogram,
|
|
137
137
|
eci: e.eci,
|
|
138
|
-
exp_month: (t = e.card)
|
|
139
|
-
exp_year: (
|
|
140
|
-
token: e.token.number,
|
|
141
|
-
token_service_provider: e.token.tokenServiceProvider
|
|
138
|
+
exp_month: (i = (t = e.card) == null ? void 0 : t.expiry) != null && i.month || (a = (r = e.token) == null ? void 0 : r.expiry) != null && a.month ? Number(((o = (s = e.card) == null ? void 0 : s.expiry) == null ? void 0 : o.month) || ((u = (l = e.token) == null ? void 0 : l.expiry) == null ? void 0 : u.month)) : void 0,
|
|
139
|
+
exp_year: (h = (d = e.card) == null ? void 0 : d.expiry) != null && h.year || (p = (m = e.token) == null ? void 0 : m.expiry) != null && p.year ? Number(((b = (g = e.card) == null ? void 0 : g.expiry) == null ? void 0 : b.year) || ((E = (v = e.token) == null ? void 0 : v.expiry) == null ? void 0 : E.year)) : void 0,
|
|
140
|
+
token: (_ = e.token) == null ? void 0 : _.number,
|
|
141
|
+
token_service_provider: (T = e.token) == null ? void 0 : T.tokenServiceProvider
|
|
142
142
|
};
|
|
143
143
|
}, Ir = (n) => {
|
|
144
144
|
var t, i, r, a, s, o;
|
|
@@ -159,7 +159,7 @@ const En = {
|
|
|
159
159
|
payment_method_nonce: e.nonce
|
|
160
160
|
};
|
|
161
161
|
}, kn = (n) => {
|
|
162
|
-
var i, r, a, s, o, l, u, d, h, m, p, g, b,
|
|
162
|
+
var i, r, a, s, o, l, u, d, h, m, p, g, b, v;
|
|
163
163
|
const { applePay: e, googlePay: t } = n;
|
|
164
164
|
if (!(!e && !t))
|
|
165
165
|
return {
|
|
@@ -168,10 +168,10 @@ const En = {
|
|
|
168
168
|
line1: ((l = (o = e == null ? void 0 : e.billingContact) == null ? void 0 : o.addressLines) == null ? void 0 : l.at(0)) || ((u = t == null ? void 0 : t.billingAddress) == null ? void 0 : u.address1) || void 0,
|
|
169
169
|
line2: ((h = (d = e == null ? void 0 : e.billingContact) == null ? void 0 : d.addressLines) == null ? void 0 : h.at(1)) || ((m = t == null ? void 0 : t.billingAddress) == null ? void 0 : m.address2) || void 0,
|
|
170
170
|
postal_code: ((p = e == null ? void 0 : e.billingContact) == null ? void 0 : p.postalCode) || ((g = t == null ? void 0 : t.billingAddress) == null ? void 0 : g.postalCode) || void 0,
|
|
171
|
-
state: ((b = e == null ? void 0 : e.billingContact) == null ? void 0 : b.administrativeArea) || ((
|
|
171
|
+
state: ((b = e == null ? void 0 : e.billingContact) == null ? void 0 : b.administrativeArea) || ((v = t == null ? void 0 : t.billingAddress) == null ? void 0 : v.administrativeArea) || void 0
|
|
172
172
|
};
|
|
173
173
|
}, xn = (n) => {
|
|
174
|
-
var r, a, s, o, l, u, d, h, m, p, g, b,
|
|
174
|
+
var r, a, s, o, l, u, d, h, m, p, g, b, v, E, _, T, I, A, D, C, x, O, R;
|
|
175
175
|
const { card: e, googlePay: t, applePay: i } = n;
|
|
176
176
|
if (!(!e && !(t != null && t.card) && !(i != null && i.card)))
|
|
177
177
|
return {
|
|
@@ -185,10 +185,10 @@ const En = {
|
|
|
185
185
|
type: (e == null ? void 0 : e.type) || ((g = t == null ? void 0 : t.card) == null ? void 0 : g.segment) || ((b = i == null ? void 0 : i.card) == null ? void 0 : b.segment)
|
|
186
186
|
},
|
|
187
187
|
cvc: e == null ? void 0 : e.cvc,
|
|
188
|
-
exp_month: e != null && e.expMonth || (
|
|
189
|
-
exp_year: e != null && e.expYear || (
|
|
190
|
-
last4: (e == null ? void 0 : e.lastFourDigits) || ((
|
|
191
|
-
number: (e == null ? void 0 : e.number) || ((
|
|
188
|
+
exp_month: e != null && e.expMonth || (E = (v = t == null ? void 0 : t.card) == null ? void 0 : v.expiry) != null && E.month ? Number((e == null ? void 0 : e.expMonth) || ((T = (_ = t == null ? void 0 : t.card) == null ? void 0 : _.expiry) == null ? void 0 : T.month)) : void 0,
|
|
189
|
+
exp_year: e != null && e.expYear || (A = (I = t == null ? void 0 : t.card) == null ? void 0 : I.expiry) != null && A.year ? Number((e == null ? void 0 : e.expYear) || ((C = (D = t == null ? void 0 : t.card) == null ? void 0 : D.expiry) == null ? void 0 : C.year)) : void 0,
|
|
190
|
+
last4: (e == null ? void 0 : e.lastFourDigits) || ((x = t == null ? void 0 : t.card) == null ? void 0 : x.lastFour) || ((O = i == null ? void 0 : i.card) == null ? void 0 : O.lastFour),
|
|
191
|
+
number: (e == null ? void 0 : e.number) || ((R = t == null ? void 0 : t.card) == null ? void 0 : R.number)
|
|
192
192
|
};
|
|
193
193
|
}, wn = (n) => {
|
|
194
194
|
var i, r;
|
|
@@ -202,33 +202,33 @@ const En = {
|
|
|
202
202
|
type: e
|
|
203
203
|
};
|
|
204
204
|
switch (e) {
|
|
205
|
-
case
|
|
206
|
-
return M(
|
|
205
|
+
case w.CARD:
|
|
206
|
+
return M(y({}, t), {
|
|
207
207
|
name: wn(n),
|
|
208
208
|
card: Lr(n)
|
|
209
209
|
});
|
|
210
|
-
case
|
|
211
|
-
return M(
|
|
210
|
+
case w.PAYPAL:
|
|
211
|
+
return M(y({}, t), {
|
|
212
212
|
paypal: _r(n)
|
|
213
213
|
});
|
|
214
|
-
case
|
|
215
|
-
return M(
|
|
214
|
+
case w.GOOGLE_PAY:
|
|
215
|
+
return M(y({}, t), {
|
|
216
216
|
name: (r = (i = n.googlePay) == null ? void 0 : i.billingAddress) == null ? void 0 : r.name,
|
|
217
217
|
phone: (l = (o = (s = (a = n.googlePay) == null ? void 0 : a.billingAddress) == null ? void 0 : s.phoneNumber) == null ? void 0 : o.replace(/ /g, "")) == null ? void 0 : l.replace(/-/g, ""),
|
|
218
218
|
card: xn(n),
|
|
219
219
|
google_pay: Vr(n),
|
|
220
220
|
billing_address: kn(n)
|
|
221
221
|
});
|
|
222
|
-
case
|
|
223
|
-
return M(
|
|
222
|
+
case w.APPLE_PAY:
|
|
223
|
+
return M(y({}, t), {
|
|
224
224
|
name: wn(n),
|
|
225
225
|
card: xn(n),
|
|
226
226
|
apple_pay: Ir(n),
|
|
227
227
|
phone: (d = (u = n.applePay) == null ? void 0 : u.shippingContact) == null ? void 0 : d.phoneNumber,
|
|
228
228
|
billing_address: kn(n)
|
|
229
229
|
});
|
|
230
|
-
case
|
|
231
|
-
return M(
|
|
230
|
+
case w.VENMO:
|
|
231
|
+
return M(y({}, t), {
|
|
232
232
|
venmo: Mr(n)
|
|
233
233
|
});
|
|
234
234
|
default:
|
|
@@ -259,7 +259,8 @@ const En = {
|
|
|
259
259
|
let Nr = class {
|
|
260
260
|
constructor(e) {
|
|
261
261
|
c(this, "apple", null);
|
|
262
|
-
|
|
262
|
+
// ToDo: remove isAvailable after testing
|
|
263
|
+
c(this, "isAvailable", !0);
|
|
263
264
|
c(this, "onReady");
|
|
264
265
|
this.ev = e;
|
|
265
266
|
}
|
|
@@ -275,7 +276,7 @@ let Nr = class {
|
|
|
275
276
|
onPaymentAttempt: o
|
|
276
277
|
}, l) {
|
|
277
278
|
const h = this.ev.transactions.create(e);
|
|
278
|
-
this.apple = this.ev.ui.applePay(h, M(
|
|
279
|
+
this.apple = this.ev.ui.applePay(h, M(y({
|
|
279
280
|
locale: t,
|
|
280
281
|
borderRadius: 12,
|
|
281
282
|
size: {
|
|
@@ -288,27 +289,32 @@ let Nr = class {
|
|
|
288
289
|
allowedCardNetworks: ["visa", "masterCard"],
|
|
289
290
|
requestBillingAddress: !0,
|
|
290
291
|
requestPayerDetails: ["name", "email", "phone"],
|
|
291
|
-
process: (
|
|
292
|
+
process: (g, b) => k(this, [g, b], function* (m, { fail: p }) {
|
|
292
293
|
o == null || o({
|
|
293
|
-
paymentMethod:
|
|
294
|
+
paymentMethod: w.GOOGLE_PAY
|
|
294
295
|
});
|
|
295
296
|
try {
|
|
296
|
-
a == null || a(
|
|
297
|
-
} catch (
|
|
298
|
-
console.error(
|
|
297
|
+
a == null || a(m);
|
|
298
|
+
} catch (v) {
|
|
299
|
+
console.error(v), p({
|
|
299
300
|
message: "Cannot pay with payment credentials"
|
|
300
301
|
});
|
|
301
302
|
}
|
|
302
303
|
})
|
|
303
|
-
}));
|
|
304
|
-
const m = "available";
|
|
305
|
-
this.isAvailable = m === "available", this.isAvailable || r == null || r("Apple Pay is not supported on this device"), r && this.apple.on("error", r), s && this.apple.on("cancel", s), this.onReady = i;
|
|
304
|
+
})), r && this.apple.on("error", r), s && this.apple.on("cancel", s), this.onReady = i;
|
|
306
305
|
});
|
|
307
306
|
}
|
|
308
307
|
render(e) {
|
|
309
308
|
return k(this, null, function* () {
|
|
310
309
|
var t;
|
|
311
|
-
!this.apple || !this.isAvailable
|
|
310
|
+
if (!(!this.apple || !this.isAvailable)) {
|
|
311
|
+
e.innerHTML = "";
|
|
312
|
+
try {
|
|
313
|
+
yield this.apple.mount(e), (t = this.onReady) == null || t.call(this);
|
|
314
|
+
} catch (i) {
|
|
315
|
+
throw console.error(i), new Error(i instanceof Error ? i.message : "Failed to render Apple Pay button");
|
|
316
|
+
}
|
|
317
|
+
}
|
|
312
318
|
});
|
|
313
319
|
}
|
|
314
320
|
}, Sr = class {
|
|
@@ -319,7 +325,7 @@ let Nr = class {
|
|
|
319
325
|
init(u, d) {
|
|
320
326
|
return k(this, arguments, function* ({ transaction: e, locale: t, onReady: i, onError: r, onSuccess: a, onCancel: s, onPaymentAttempt: o }, l) {
|
|
321
327
|
const h = this.ev.transactions.create(e);
|
|
322
|
-
this.google = this.ev.ui.googlePay(h, M(
|
|
328
|
+
this.google = this.ev.ui.googlePay(h, M(y({
|
|
323
329
|
locale: t,
|
|
324
330
|
size: {
|
|
325
331
|
width: "100%",
|
|
@@ -336,12 +342,12 @@ let Nr = class {
|
|
|
336
342
|
allowedCardNetworks: ["VISA", "MASTERCARD"],
|
|
337
343
|
process: (g, b) => k(this, [g, b], function* (m, { fail: p }) {
|
|
338
344
|
o == null || o({
|
|
339
|
-
paymentMethod:
|
|
345
|
+
paymentMethod: w.GOOGLE_PAY
|
|
340
346
|
});
|
|
341
347
|
try {
|
|
342
348
|
a == null || a(m);
|
|
343
|
-
} catch (
|
|
344
|
-
console.error(
|
|
349
|
+
} catch (v) {
|
|
350
|
+
console.error(v), p({
|
|
345
351
|
message: "Cannot pay with payment credentials"
|
|
346
352
|
});
|
|
347
353
|
}
|
|
@@ -562,7 +568,7 @@ function nn(n) {
|
|
|
562
568
|
}
|
|
563
569
|
const se = /* @__NO_SIDE_EFFECTS__ */ (n) => n * 1e3, le = /* @__NO_SIDE_EFFECTS__ */ (n) => n / 1e3;
|
|
564
570
|
function yi(n, e = 100, t) {
|
|
565
|
-
const i = t(M(
|
|
571
|
+
const i = t(M(y({}, n), { keyframes: [0, e] })), r = Math.min(nn(i), mt);
|
|
566
572
|
return {
|
|
567
573
|
type: "keyframes",
|
|
568
574
|
ease: (a) => i.next(r * a).value / e,
|
|
@@ -584,20 +590,20 @@ function Zr(n, a = {}, i, r) {
|
|
|
584
590
|
const o = e.duration || 0.3, l = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), d = {}, h = /* @__PURE__ */ new Map();
|
|
585
591
|
let m = 0, p = 0, g = 0;
|
|
586
592
|
for (let b = 0; b < n.length; b++) {
|
|
587
|
-
const
|
|
588
|
-
if (typeof
|
|
589
|
-
h.set(
|
|
593
|
+
const v = n[b];
|
|
594
|
+
if (typeof v == "string") {
|
|
595
|
+
h.set(v, p);
|
|
590
596
|
continue;
|
|
591
|
-
} else if (!Array.isArray(
|
|
592
|
-
h.set(
|
|
597
|
+
} else if (!Array.isArray(v)) {
|
|
598
|
+
h.set(v.name, Tn(p, v.at, m, h));
|
|
593
599
|
continue;
|
|
594
600
|
}
|
|
595
|
-
let [
|
|
601
|
+
let [E, _, T = {}] = v;
|
|
596
602
|
T.at !== void 0 && (p = Tn(p, T.at, m, h));
|
|
597
603
|
let I = 0;
|
|
598
|
-
const A = (D,
|
|
599
|
-
const q = Jr(D), Le =
|
|
600
|
-
let { ease: ne = e.ease || "easeOut", duration: f } =
|
|
604
|
+
const A = (D, C, x, O = 0, R = 0) => {
|
|
605
|
+
const q = Jr(D), Le = C, { delay: Te = 0, times: te = vi(q), type: fe = "keyframes", repeat: he, repeatType: Et, repeatDelay: kt = 0 } = Le, st = ae(Le, ["delay", "times", "type", "repeat", "repeatType", "repeatDelay"]);
|
|
606
|
+
let { ease: ne = e.ease || "easeOut", duration: f } = C;
|
|
601
607
|
const P = typeof Te == "function" ? Te(O, R) : Te, N = q.length, G = tn(fe) ? fe : r == null ? void 0 : r[fe];
|
|
602
608
|
if (N <= 2 && G) {
|
|
603
609
|
let z = 100;
|
|
@@ -605,7 +611,7 @@ function Zr(n, a = {}, i, r) {
|
|
|
605
611
|
const ge = q[1] - q[0];
|
|
606
612
|
z = Math.abs(ge);
|
|
607
613
|
}
|
|
608
|
-
const re =
|
|
614
|
+
const re = y({}, st);
|
|
609
615
|
f !== void 0 && (re.duration = /* @__PURE__ */ se(f));
|
|
610
616
|
const pe = yi(re, z, G);
|
|
611
617
|
ne = pe.ease, f = pe.duration;
|
|
@@ -627,37 +633,37 @@ function Zr(n, a = {}, i, r) {
|
|
|
627
633
|
Hr(te, he);
|
|
628
634
|
}
|
|
629
635
|
const Ae = ie + f;
|
|
630
|
-
Gr(
|
|
636
|
+
Gr(x, q, ne, te, ie, Ae), I = Math.max(P + f, I), g = Math.max(Ae, g);
|
|
631
637
|
};
|
|
632
|
-
if (J(
|
|
633
|
-
const D = An(
|
|
634
|
-
A(
|
|
638
|
+
if (J(E)) {
|
|
639
|
+
const D = An(E, u);
|
|
640
|
+
A(_, T, Ln("default", D));
|
|
635
641
|
} else {
|
|
636
|
-
const D = pi(
|
|
637
|
-
for (let
|
|
638
|
-
|
|
639
|
-
const O = D[
|
|
640
|
-
for (const q in
|
|
641
|
-
A(
|
|
642
|
+
const D = pi(E, _, i, d), C = D.length;
|
|
643
|
+
for (let x = 0; x < C; x++) {
|
|
644
|
+
_ = _, T = T;
|
|
645
|
+
const O = D[x], R = An(O, u);
|
|
646
|
+
for (const q in _)
|
|
647
|
+
A(_[q], Xr(T, q), Ln(q, R), x, C);
|
|
642
648
|
}
|
|
643
649
|
}
|
|
644
650
|
m = p, p += I;
|
|
645
651
|
}
|
|
646
|
-
return u.forEach((b,
|
|
647
|
-
for (const
|
|
648
|
-
const
|
|
649
|
-
|
|
652
|
+
return u.forEach((b, v) => {
|
|
653
|
+
for (const E in b) {
|
|
654
|
+
const _ = b[E];
|
|
655
|
+
_.sort(Yr);
|
|
650
656
|
const T = [], I = [], A = [];
|
|
651
|
-
for (let
|
|
652
|
-
const { at:
|
|
653
|
-
T.push(O), I.push(/* @__PURE__ */ en(0, g,
|
|
657
|
+
for (let C = 0; C < _.length; C++) {
|
|
658
|
+
const { at: x, value: O, easing: R } = _[C];
|
|
659
|
+
T.push(O), I.push(/* @__PURE__ */ en(0, g, x)), A.push(R || "easeOut");
|
|
654
660
|
}
|
|
655
|
-
I[0] !== 0 && (I.unshift(0), T.unshift(T[0]), A.unshift(Ur)), I[I.length - 1] !== 1 && (I.push(1), T.push(null)), l.has(
|
|
661
|
+
I[0] !== 0 && (I.unshift(0), T.unshift(T[0]), A.unshift(Ur)), I[I.length - 1] !== 1 && (I.push(1), T.push(null)), l.has(v) || l.set(v, {
|
|
656
662
|
keyframes: {},
|
|
657
663
|
transition: {}
|
|
658
664
|
});
|
|
659
|
-
const D = l.get(
|
|
660
|
-
D.keyframes[
|
|
665
|
+
const D = l.get(v);
|
|
666
|
+
D.keyframes[E] = T, D.transition[E] = y(M(y({}, e), {
|
|
661
667
|
duration: g,
|
|
662
668
|
ease: A,
|
|
663
669
|
times: I
|
|
@@ -675,7 +681,7 @@ function Jr(n) {
|
|
|
675
681
|
return Array.isArray(n) ? n : [n];
|
|
676
682
|
}
|
|
677
683
|
function Xr(n, e) {
|
|
678
|
-
return n && n[e] ?
|
|
684
|
+
return n && n[e] ? y(y({}, n), n[e]) : y({}, n);
|
|
679
685
|
}
|
|
680
686
|
const Qr = (n) => typeof n == "number", ea = (n) => n.every(Qr), Je = /* @__PURE__ */ new WeakMap(), ta = (n) => Array.isArray(n);
|
|
681
687
|
function _n(n) {
|
|
@@ -765,12 +771,12 @@ function aa(n, e) {
|
|
|
765
771
|
}, a = () => t = !0, s = lt.reduce((T, I) => (T[I] = ia(a), T), {}), { setup: o, read: l, resolveKeyframes: u, preUpdate: d, update: h, preRender: m, render: p, postRender: g } = s, b = () => {
|
|
766
772
|
const T = de.useManualTiming ? r.timestamp : performance.now();
|
|
767
773
|
t = !1, de.useManualTiming || (r.delta = i ? 1e3 / 60 : Math.max(Math.min(T - r.timestamp, ra), 1)), r.timestamp = T, r.isProcessing = !0, o.process(r), l.process(r), u.process(r), d.process(r), h.process(r), m.process(r), p.process(r), g.process(r), r.isProcessing = !1, t && e && (i = !1, n(b));
|
|
768
|
-
},
|
|
774
|
+
}, v = () => {
|
|
769
775
|
t = !0, i = !0, r.isProcessing || n(b);
|
|
770
776
|
};
|
|
771
777
|
return { schedule: lt.reduce((T, I) => {
|
|
772
778
|
const A = s[I];
|
|
773
|
-
return T[I] = (D,
|
|
779
|
+
return T[I] = (D, C = !1, x = !1) => (t || v(), A.schedule(D, C, x)), T;
|
|
774
780
|
}, {}), cancel: (T) => {
|
|
775
781
|
for (let I = 0; I < lt.length; I++)
|
|
776
782
|
s[lt[I]].cancel(T);
|
|
@@ -1033,7 +1039,7 @@ function da(n) {
|
|
|
1033
1039
|
}
|
|
1034
1040
|
function ua(n, e) {
|
|
1035
1041
|
let s = na(n, e) || {}, { transitionEnd: i = {}, transition: r = {} } = s, a = ae(s, ["transitionEnd", "transition"]);
|
|
1036
|
-
a =
|
|
1042
|
+
a = y(y({}, a), i);
|
|
1037
1043
|
for (const o in a) {
|
|
1038
1044
|
const l = da(a[o]);
|
|
1039
1045
|
ca(n, o, l);
|
|
@@ -1108,9 +1114,9 @@ const Ti = (n) => (e) => typeof e == "string" && e.startsWith(n), Ai = /* @__PUR
|
|
|
1108
1114
|
test: (n) => typeof n == "number",
|
|
1109
1115
|
parse: parseFloat,
|
|
1110
1116
|
transform: (n) => n
|
|
1111
|
-
}, Qe = M(
|
|
1117
|
+
}, Qe = M(y({}, Ne), {
|
|
1112
1118
|
transform: (n) => xe(0, 1, n)
|
|
1113
|
-
}), ct = M(
|
|
1119
|
+
}), ct = M(y({}, Ne), {
|
|
1114
1120
|
default: 1
|
|
1115
1121
|
}), We = (n) => Math.round(n * 1e5) / 1e5, sn = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu;
|
|
1116
1122
|
function La(n) {
|
|
@@ -1126,7 +1132,7 @@ const _a = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s
|
|
|
1126
1132
|
[t]: parseFloat(s),
|
|
1127
1133
|
alpha: o !== void 0 ? parseFloat(o) : 1
|
|
1128
1134
|
};
|
|
1129
|
-
}, Va = (n) => xe(0, 255, n), wt = M(
|
|
1135
|
+
}, Va = (n) => xe(0, 255, n), wt = M(y({}, Ne), {
|
|
1130
1136
|
transform: (n) => Math.round(Va(n))
|
|
1131
1137
|
}), ye = {
|
|
1132
1138
|
test: /* @__PURE__ */ on("rgb", "red"),
|
|
@@ -1150,7 +1156,7 @@ const Rt = {
|
|
|
1150
1156
|
test: (e) => typeof e == "string" && e.endsWith(n) && e.split(" ").length === 1,
|
|
1151
1157
|
parse: parseFloat,
|
|
1152
1158
|
transform: (e) => `${e}${n}`
|
|
1153
|
-
}), me = /* @__PURE__ */ rt("deg"), Me = /* @__PURE__ */ rt("%"),
|
|
1159
|
+
}), me = /* @__PURE__ */ rt("deg"), Me = /* @__PURE__ */ rt("%"), V = /* @__PURE__ */ rt("px"), Ma = /* @__PURE__ */ rt("vh"), Pa = /* @__PURE__ */ rt("vw"), Mn = M(y({}, Me), {
|
|
1154
1160
|
parse: (n) => Me.parse(n) / 100,
|
|
1155
1161
|
transform: (n) => Me.transform(n * 100)
|
|
1156
1162
|
}), Ve = {
|
|
@@ -1240,7 +1246,7 @@ const On = (n, e) => {
|
|
|
1240
1246
|
const t = Dn(n), i = Dn(e);
|
|
1241
1247
|
if (!t || !i)
|
|
1242
1248
|
return gt(n, e);
|
|
1243
|
-
const r =
|
|
1249
|
+
const r = y({}, t);
|
|
1244
1250
|
return (a) => (r.red = At(t.red, i.red, a), r.green = At(t.green, i.green, a), r.blue = At(t.blue, i.blue, a), r.alpha = nt(t.alpha, i.alpha, a), ye.transform(r));
|
|
1245
1251
|
}, Nt = /* @__PURE__ */ new Set(["none", "hidden"]);
|
|
1246
1252
|
function Ka(n, e) {
|
|
@@ -1262,7 +1268,7 @@ function Pi(n, e) {
|
|
|
1262
1268
|
};
|
|
1263
1269
|
}
|
|
1264
1270
|
function Ha(n, e) {
|
|
1265
|
-
const t =
|
|
1271
|
+
const t = y(y({}, n), e), i = {};
|
|
1266
1272
|
for (const r in t)
|
|
1267
1273
|
n[r] !== void 0 && e[r] !== void 0 && (i[r] = cn(n[r])(n[r], e[r]));
|
|
1268
1274
|
return (r) => {
|
|
@@ -1386,7 +1392,7 @@ function Rn(n, e) {
|
|
|
1386
1392
|
return e.some((t) => n[t] !== void 0);
|
|
1387
1393
|
}
|
|
1388
1394
|
function ns(n) {
|
|
1389
|
-
let e =
|
|
1395
|
+
let e = y({
|
|
1390
1396
|
velocity: B.velocity,
|
|
1391
1397
|
stiffness: B.stiffness,
|
|
1392
1398
|
damping: B.damping,
|
|
@@ -1396,14 +1402,14 @@ function ns(n) {
|
|
|
1396
1402
|
if (!Rn(n, ts) && Rn(n, es))
|
|
1397
1403
|
if (n.visualDuration) {
|
|
1398
1404
|
const t = n.visualDuration, i = 2 * Math.PI / (t * 1.2), r = i * i, a = 2 * xe(0.05, 1, 1 - (n.bounce || 0)) * Math.sqrt(r);
|
|
1399
|
-
e = M(
|
|
1405
|
+
e = M(y({}, e), {
|
|
1400
1406
|
mass: B.mass,
|
|
1401
1407
|
stiffness: r,
|
|
1402
1408
|
damping: a
|
|
1403
1409
|
});
|
|
1404
1410
|
} else {
|
|
1405
1411
|
const t = Ja(n);
|
|
1406
|
-
e = M(
|
|
1412
|
+
e = M(y(y({}, e), t), {
|
|
1407
1413
|
mass: B.mass
|
|
1408
1414
|
}), e.isResolvedFromDuration = !0;
|
|
1409
1415
|
}
|
|
@@ -1416,24 +1422,24 @@ function tt(n = B.visualDuration, e = B.bounce) {
|
|
|
1416
1422
|
bounce: e
|
|
1417
1423
|
} : n;
|
|
1418
1424
|
let { restSpeed: i, restDelta: r } = t;
|
|
1419
|
-
const a = t.keyframes[0], s = t.keyframes[t.keyframes.length - 1], o = { done: !1, value: a }, { stiffness: l, damping: u, mass: d, duration: h, velocity: m, isResolvedFromDuration: p } = ns(M(
|
|
1425
|
+
const a = t.keyframes[0], s = t.keyframes[t.keyframes.length - 1], o = { done: !1, value: a }, { stiffness: l, damping: u, mass: d, duration: h, velocity: m, isResolvedFromDuration: p } = ns(M(y({}, t), {
|
|
1420
1426
|
velocity: -/* @__PURE__ */ le(t.velocity || 0)
|
|
1421
|
-
})), g = m || 0, b = u / (2 * Math.sqrt(l * d)),
|
|
1422
|
-
i || (i =
|
|
1427
|
+
})), g = m || 0, b = u / (2 * Math.sqrt(l * d)), v = s - a, E = /* @__PURE__ */ le(Math.sqrt(l / d)), _ = Math.abs(v) < 5;
|
|
1428
|
+
i || (i = _ ? B.restSpeed.granular : B.restSpeed.default), r || (r = _ ? B.restDelta.granular : B.restDelta.default);
|
|
1423
1429
|
let T;
|
|
1424
1430
|
if (b < 1) {
|
|
1425
|
-
const A = St(
|
|
1431
|
+
const A = St(E, b);
|
|
1426
1432
|
T = (D) => {
|
|
1427
|
-
const
|
|
1428
|
-
return s -
|
|
1433
|
+
const C = Math.exp(-b * E * D);
|
|
1434
|
+
return s - C * ((g + b * E * v) / A * Math.sin(A * D) + v * Math.cos(A * D));
|
|
1429
1435
|
};
|
|
1430
1436
|
} else if (b === 1)
|
|
1431
|
-
T = (A) => s - Math.exp(-
|
|
1437
|
+
T = (A) => s - Math.exp(-E * A) * (v + (g + E * v) * A);
|
|
1432
1438
|
else {
|
|
1433
|
-
const A =
|
|
1439
|
+
const A = E * Math.sqrt(b * b - 1);
|
|
1434
1440
|
T = (D) => {
|
|
1435
|
-
const
|
|
1436
|
-
return s -
|
|
1441
|
+
const C = Math.exp(-b * E * D), x = Math.min(A * D, 300);
|
|
1442
|
+
return s - C * ((g + b * E * v) * Math.sinh(x) + A * v * Math.cosh(x)) / A;
|
|
1437
1443
|
};
|
|
1438
1444
|
}
|
|
1439
1445
|
const I = {
|
|
@@ -1443,15 +1449,15 @@ function tt(n = B.visualDuration, e = B.bounce) {
|
|
|
1443
1449
|
if (p)
|
|
1444
1450
|
o.done = A >= h;
|
|
1445
1451
|
else {
|
|
1446
|
-
let
|
|
1447
|
-
b < 1 && (
|
|
1448
|
-
const
|
|
1449
|
-
o.done =
|
|
1452
|
+
let C = A === 0 ? g : 0;
|
|
1453
|
+
b < 1 && (C = A === 0 ? /* @__PURE__ */ se(g) : Ri(T, A, D));
|
|
1454
|
+
const x = Math.abs(C) <= i, O = Math.abs(s - D) <= r;
|
|
1455
|
+
o.done = x && O;
|
|
1450
1456
|
}
|
|
1451
1457
|
return o.value = o.done ? s : D, o;
|
|
1452
1458
|
},
|
|
1453
1459
|
toString: () => {
|
|
1454
|
-
const A = Math.min(nn(I), mt), D = Oi((
|
|
1460
|
+
const A = Math.min(nn(I), mt), D = Oi((C) => I.next(A * C).value, A, 30);
|
|
1455
1461
|
return A + "ms " + D;
|
|
1456
1462
|
},
|
|
1457
1463
|
toTransition: () => {
|
|
@@ -1467,19 +1473,19 @@ function Ft({ keyframes: n, velocity: e = 0, power: t = 0.8, timeConstant: i = 3
|
|
|
1467
1473
|
const h = n[0], m = {
|
|
1468
1474
|
done: !1,
|
|
1469
1475
|
value: h
|
|
1470
|
-
}, p = (
|
|
1476
|
+
}, p = (x) => o !== void 0 && x < o || l !== void 0 && x > l, g = (x) => o === void 0 ? l : l === void 0 || Math.abs(o - x) < Math.abs(l - x) ? o : l;
|
|
1471
1477
|
let b = t * e;
|
|
1472
|
-
const
|
|
1473
|
-
|
|
1474
|
-
const
|
|
1475
|
-
const O =
|
|
1476
|
-
m.done = Math.abs(O) <= u, m.value = m.done ?
|
|
1478
|
+
const v = h + b, E = s === void 0 ? v : s(v);
|
|
1479
|
+
E !== v && (b = E - h);
|
|
1480
|
+
const _ = (x) => -b * Math.exp(-x / i), T = (x) => E + _(x), I = (x) => {
|
|
1481
|
+
const O = _(x), R = T(x);
|
|
1482
|
+
m.done = Math.abs(O) <= u, m.value = m.done ? E : R;
|
|
1477
1483
|
};
|
|
1478
1484
|
let A, D;
|
|
1479
|
-
const
|
|
1480
|
-
p(m.value) && (A =
|
|
1485
|
+
const C = (x) => {
|
|
1486
|
+
p(m.value) && (A = x, D = tt({
|
|
1481
1487
|
keyframes: [m.value, g(m.value)],
|
|
1482
|
-
velocity: Ri(T,
|
|
1488
|
+
velocity: Ri(T, x, m.value),
|
|
1483
1489
|
// TODO: This should be passing * 1000
|
|
1484
1490
|
damping: r,
|
|
1485
1491
|
stiffness: a,
|
|
@@ -1487,11 +1493,11 @@ function Ft({ keyframes: n, velocity: e = 0, power: t = 0.8, timeConstant: i = 3
|
|
|
1487
1493
|
restSpeed: d
|
|
1488
1494
|
}));
|
|
1489
1495
|
};
|
|
1490
|
-
return
|
|
1496
|
+
return C(0), {
|
|
1491
1497
|
calculatedDuration: null,
|
|
1492
|
-
next: (
|
|
1498
|
+
next: (x) => {
|
|
1493
1499
|
let O = !1;
|
|
1494
|
-
return !D && A === void 0 && (O = !0, I(
|
|
1500
|
+
return !D && A === void 0 && (O = !0, I(x), C(x)), A !== void 0 && x >= A ? D.next(x - A) : (!O && I(x), m);
|
|
1495
1501
|
}
|
|
1496
1502
|
};
|
|
1497
1503
|
}
|
|
@@ -1640,8 +1646,8 @@ class mn extends pn {
|
|
|
1640
1646
|
let { keyframes: o } = e;
|
|
1641
1647
|
const l = t || Ie;
|
|
1642
1648
|
process.env.NODE_ENV !== "production" && l !== Ie && ce(o.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${o}`), l !== Ie && typeof o[0] != "number" && (this.mixKeyframes = ln(gs, Di(o[0], o[1])), o = [0, 100]);
|
|
1643
|
-
const u = l(M(
|
|
1644
|
-
a === "mirror" && (this.mirroredGenerator = l(M(
|
|
1649
|
+
const u = l(M(y({}, e), { keyframes: o }));
|
|
1650
|
+
a === "mirror" && (this.mirroredGenerator = l(M(y({}, e), {
|
|
1645
1651
|
keyframes: [...o].reverse(),
|
|
1646
1652
|
velocity: -s
|
|
1647
1653
|
}))), u.calculatedDuration === null && (u.calculatedDuration = nn(u));
|
|
@@ -1656,22 +1662,22 @@ class mn extends pn {
|
|
|
1656
1662
|
const { generator: i, totalDuration: r, mixKeyframes: a, mirroredGenerator: s, resolvedDuration: o, calculatedDuration: l } = this;
|
|
1657
1663
|
if (this.startTime === null)
|
|
1658
1664
|
return i.next(0);
|
|
1659
|
-
const { delay: u = 0, keyframes: d, repeat: h, repeatType: m, repeatDelay: p, type: g, onUpdate: b, finalKeyframe:
|
|
1665
|
+
const { delay: u = 0, keyframes: d, repeat: h, repeatType: m, repeatDelay: p, type: g, onUpdate: b, finalKeyframe: v } = this.options;
|
|
1660
1666
|
this.speed > 0 ? this.startTime = Math.min(this.startTime, e) : this.speed < 0 && (this.startTime = Math.min(e - r / this.speed, this.startTime)), t ? this.currentTime = e : this.updateTime(e);
|
|
1661
|
-
const
|
|
1662
|
-
this.currentTime = Math.max(
|
|
1667
|
+
const E = this.currentTime - u * (this.playbackSpeed >= 0 ? 1 : -1), _ = this.playbackSpeed >= 0 ? E < 0 : E > r;
|
|
1668
|
+
this.currentTime = Math.max(E, 0), this.state === "finished" && this.holdTime === null && (this.currentTime = r);
|
|
1663
1669
|
let T = this.currentTime, I = i;
|
|
1664
1670
|
if (h) {
|
|
1665
|
-
const
|
|
1666
|
-
let O = Math.floor(
|
|
1667
|
-
!R &&
|
|
1671
|
+
const x = Math.min(this.currentTime, r) / o;
|
|
1672
|
+
let O = Math.floor(x), R = x % 1;
|
|
1673
|
+
!R && x >= 1 && (R = 1), R === 1 && O--, O = Math.min(O, h + 1), !!(O % 2) && (m === "reverse" ? (R = 1 - R, p && (R -= p / o)) : m === "mirror" && (I = s)), T = xe(0, 1, R) * o;
|
|
1668
1674
|
}
|
|
1669
|
-
const A =
|
|
1675
|
+
const A = _ ? { done: !1, value: d[0] } : I.next(T);
|
|
1670
1676
|
a && (A.value = a(A.value));
|
|
1671
1677
|
let { done: D } = A;
|
|
1672
|
-
!
|
|
1673
|
-
const
|
|
1674
|
-
return
|
|
1678
|
+
!_ && l !== null && (D = this.playbackSpeed >= 0 ? this.currentTime >= r : this.currentTime <= 0);
|
|
1679
|
+
const C = this.holdTime === null && (this.state === "finished" || this.state === "running" && D);
|
|
1680
|
+
return C && g !== Ft && (A.value = hn(d, this.options, v, this.speed)), b && b(A.value), C && this.finish(), A;
|
|
1675
1681
|
}
|
|
1676
1682
|
/**
|
|
1677
1683
|
* Allows the returned animation to be awaited or promise-chained. Currently
|
|
@@ -1801,7 +1807,7 @@ const Cs = (n, e) => {
|
|
|
1801
1807
|
function Es(n) {
|
|
1802
1808
|
return parseFloat(n.trim());
|
|
1803
1809
|
}
|
|
1804
|
-
const zn = (n) => n === Ne || n ===
|
|
1810
|
+
const zn = (n) => n === Ne || n === V, ks = /* @__PURE__ */ new Set(["x", "y", "z"]), xs = Oe.filter((n) => !ks.has(n));
|
|
1805
1811
|
function ws(n) {
|
|
1806
1812
|
const e = [];
|
|
1807
1813
|
return xs.forEach((t) => {
|
|
@@ -2077,7 +2083,7 @@ class Ns extends Ds {
|
|
|
2077
2083
|
t.set(e);
|
|
2078
2084
|
return;
|
|
2079
2085
|
}
|
|
2080
|
-
const o = new mn(M(
|
|
2086
|
+
const o = new mn(M(y({}, s), {
|
|
2081
2087
|
autoplay: !1
|
|
2082
2088
|
})), l = /* @__PURE__ */ se((d = this.finishedTime) != null ? d : this.time);
|
|
2083
2089
|
t.setWithVelocity(o.sample(l - Kn).value, o.sample(l).value, Kn), o.stop();
|
|
@@ -2133,12 +2139,12 @@ const Ks = 40;
|
|
|
2133
2139
|
class qs extends pn {
|
|
2134
2140
|
constructor(m) {
|
|
2135
2141
|
var p = m, { autoplay: e = !0, delay: t = 0, type: i = "keyframes", repeat: r = 0, repeatDelay: a = 0, repeatType: s = "loop", keyframes: o, name: l, motionValue: u, element: d } = p, h = ae(p, ["autoplay", "delay", "type", "repeat", "repeatDelay", "repeatType", "keyframes", "name", "motionValue", "element"]);
|
|
2136
|
-
var
|
|
2142
|
+
var v;
|
|
2137
2143
|
super(), this.stop = () => {
|
|
2138
|
-
var
|
|
2139
|
-
this._animation && (this._animation.stop(), (
|
|
2144
|
+
var E, _;
|
|
2145
|
+
this._animation && (this._animation.stop(), (E = this.stopTimeline) == null || E.call(this)), (_ = this.keyframeResolver) == null || _.cancel();
|
|
2140
2146
|
}, this.createdAt = ee.now();
|
|
2141
|
-
const g =
|
|
2147
|
+
const g = y({
|
|
2142
2148
|
autoplay: e,
|
|
2143
2149
|
delay: t,
|
|
2144
2150
|
type: i,
|
|
@@ -2149,18 +2155,18 @@ class qs extends pn {
|
|
|
2149
2155
|
motionValue: u,
|
|
2150
2156
|
element: d
|
|
2151
2157
|
}, h), b = (d == null ? void 0 : d.KeyframeResolver) || fn;
|
|
2152
|
-
this.keyframeResolver = new b(o, (
|
|
2158
|
+
this.keyframeResolver = new b(o, (E, _, T) => this.onKeyframesResolved(E, _, g, !T), l, u, d), (v = this.keyframeResolver) == null || v.scheduleResolve();
|
|
2153
2159
|
}
|
|
2154
2160
|
onKeyframesResolved(e, t, i, r) {
|
|
2155
2161
|
this.keyframeResolver = void 0;
|
|
2156
2162
|
const { name: a, type: s, velocity: o, delay: l, isHandoff: u, onUpdate: d } = i;
|
|
2157
2163
|
this.resolvedAt = ee.now(), Fs(e, a, s, o) || ((de.instantAnimations || !l) && (d == null || d(hn(e, i, t))), e[0] = e[e.length - 1], i.duration = 0, i.repeat = 0);
|
|
2158
|
-
const h = r ? this.resolvedAt ? this.resolvedAt - this.createdAt > Ks ? this.resolvedAt : this.createdAt : this.createdAt : void 0, m = M(
|
|
2164
|
+
const h = r ? this.resolvedAt ? this.resolvedAt - this.createdAt > Ks ? this.resolvedAt : this.createdAt : this.createdAt : void 0, m = M(y({
|
|
2159
2165
|
startTime: h,
|
|
2160
2166
|
finalKeyframe: t
|
|
2161
2167
|
}, i), {
|
|
2162
2168
|
keyframes: e
|
|
2163
|
-
}), p = !u && $s(m) ? new Ns(M(
|
|
2169
|
+
}), p = !u && $s(m) ? new Ns(M(y({}, m), {
|
|
2164
2170
|
element: m.motionValue.owner.current
|
|
2165
2171
|
})) : new mn(m);
|
|
2166
2172
|
p.finished.then(() => this.notifyFinished()).catch(De), this.pendingTimeline && (this.stopTimeline = p.attachTimeline(this.pendingTimeline), this.pendingTimeline = void 0), this._animation = p;
|
|
@@ -2218,7 +2224,7 @@ const Xi = (n, e, t, i = {}, r, a) => (s) => {
|
|
|
2218
2224
|
const o = wi(i, n) || {}, l = o.delay || i.delay || 0;
|
|
2219
2225
|
let { elapsed: u = 0 } = i;
|
|
2220
2226
|
u = u - /* @__PURE__ */ se(l);
|
|
2221
|
-
const d = M(
|
|
2227
|
+
const d = M(y({
|
|
2222
2228
|
keyframes: Array.isArray(t) ? t : [null, t],
|
|
2223
2229
|
ease: "easeOut",
|
|
2224
2230
|
velocity: e.getVelocity()
|
|
@@ -2268,22 +2274,22 @@ function Hs(n, e, { delay: t = 0, transitionOverride: i, type: r } = {}) {
|
|
|
2268
2274
|
const p = n.getValue(m, (h = n.latestValues[m]) != null ? h : null), g = o[m];
|
|
2269
2275
|
if (g === void 0 || u && Gs(u, m))
|
|
2270
2276
|
continue;
|
|
2271
|
-
const b =
|
|
2277
|
+
const b = y({
|
|
2272
2278
|
delay: t
|
|
2273
|
-
}, wi(a || {}, m)),
|
|
2274
|
-
if (
|
|
2279
|
+
}, wi(a || {}, m)), v = p.get();
|
|
2280
|
+
if (v !== void 0 && !p.isAnimating && !Array.isArray(g) && g === v && !b.velocity)
|
|
2275
2281
|
continue;
|
|
2276
|
-
let
|
|
2282
|
+
let E = !1;
|
|
2277
2283
|
if (window.MotionHandoffAnimation) {
|
|
2278
2284
|
const T = ga(n);
|
|
2279
2285
|
if (T) {
|
|
2280
2286
|
const I = window.MotionHandoffAnimation(T, m, ue);
|
|
2281
|
-
I !== null && (b.startTime = I,
|
|
2287
|
+
I !== null && (b.startTime = I, E = !0);
|
|
2282
2288
|
}
|
|
2283
2289
|
}
|
|
2284
|
-
pa(n, m), p.start(Xi(m, p, g, n.shouldReduceMotion && Qi.has(m) ? { type: !1 } : b, n,
|
|
2285
|
-
const
|
|
2286
|
-
|
|
2290
|
+
pa(n, m), p.start(Xi(m, p, g, n.shouldReduceMotion && Qi.has(m) ? { type: !1 } : b, n, E));
|
|
2291
|
+
const _ = p.animation;
|
|
2292
|
+
_ && l.push(_);
|
|
2287
2293
|
}
|
|
2288
2294
|
return s && Promise.all(l).then(() => {
|
|
2289
2295
|
ue.update(() => {
|
|
@@ -2391,7 +2397,7 @@ function io(n, e, t) {
|
|
|
2391
2397
|
const nr = (n) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n), ir = (n) => /^0[^.\s]+$/u.test(n), ro = {
|
|
2392
2398
|
test: (n) => n === "auto",
|
|
2393
2399
|
parse: (n) => n
|
|
2394
|
-
}, rr = (n) => (e) => e.test(n), ar = [Ne,
|
|
2400
|
+
}, rr = (n) => (e) => e.test(n), ar = [Ne, V, Me, me, Pa, Ma, ro], Yn = (n) => ar.find(rr(n)), ao = [...ar, U, Se], so = (n) => ao.find(rr(n)), oo = /* @__PURE__ */ new Set(["brightness", "contrast", "saturate", "opacity"]);
|
|
2395
2401
|
function lo(n) {
|
|
2396
2402
|
const [e, t] = n.slice(0, -1).split("(");
|
|
2397
2403
|
if (e === "drop-shadow")
|
|
@@ -2403,12 +2409,12 @@ function lo(n) {
|
|
|
2403
2409
|
let a = oo.has(e) ? 1 : 0;
|
|
2404
2410
|
return i !== t && (a *= 100), e + "(" + a + r + ")";
|
|
2405
2411
|
}
|
|
2406
|
-
const co = /\b([a-z-]*)\(.*?\)/gu, Ut = M(
|
|
2412
|
+
const co = /\b([a-z-]*)\(.*?\)/gu, Ut = M(y({}, Se), {
|
|
2407
2413
|
getAnimatableNone: (n) => {
|
|
2408
2414
|
const e = n.match(co);
|
|
2409
2415
|
return e ? e.map(lo).join(" ") : n;
|
|
2410
2416
|
}
|
|
2411
|
-
}), Un = M(
|
|
2417
|
+
}), Un = M(y({}, Ne), {
|
|
2412
2418
|
transform: Math.round
|
|
2413
2419
|
}), uo = {
|
|
2414
2420
|
rotate: me,
|
|
@@ -2422,62 +2428,62 @@ const co = /\b([a-z-]*)\(.*?\)/gu, Ut = M(v({}, Se), {
|
|
|
2422
2428
|
skew: me,
|
|
2423
2429
|
skewX: me,
|
|
2424
2430
|
skewY: me,
|
|
2425
|
-
distance:
|
|
2426
|
-
translateX:
|
|
2427
|
-
translateY:
|
|
2428
|
-
translateZ:
|
|
2429
|
-
x:
|
|
2430
|
-
y:
|
|
2431
|
-
z:
|
|
2432
|
-
perspective:
|
|
2433
|
-
transformPerspective:
|
|
2431
|
+
distance: V,
|
|
2432
|
+
translateX: V,
|
|
2433
|
+
translateY: V,
|
|
2434
|
+
translateZ: V,
|
|
2435
|
+
x: V,
|
|
2436
|
+
y: V,
|
|
2437
|
+
z: V,
|
|
2438
|
+
perspective: V,
|
|
2439
|
+
transformPerspective: V,
|
|
2434
2440
|
opacity: Qe,
|
|
2435
2441
|
originX: Mn,
|
|
2436
2442
|
originY: Mn,
|
|
2437
|
-
originZ:
|
|
2438
|
-
}, vn = M(
|
|
2443
|
+
originZ: V
|
|
2444
|
+
}, vn = M(y({
|
|
2439
2445
|
// Border props
|
|
2440
|
-
borderWidth:
|
|
2441
|
-
borderTopWidth:
|
|
2442
|
-
borderRightWidth:
|
|
2443
|
-
borderBottomWidth:
|
|
2444
|
-
borderLeftWidth:
|
|
2445
|
-
borderRadius:
|
|
2446
|
-
radius:
|
|
2447
|
-
borderTopLeftRadius:
|
|
2448
|
-
borderTopRightRadius:
|
|
2449
|
-
borderBottomRightRadius:
|
|
2450
|
-
borderBottomLeftRadius:
|
|
2446
|
+
borderWidth: V,
|
|
2447
|
+
borderTopWidth: V,
|
|
2448
|
+
borderRightWidth: V,
|
|
2449
|
+
borderBottomWidth: V,
|
|
2450
|
+
borderLeftWidth: V,
|
|
2451
|
+
borderRadius: V,
|
|
2452
|
+
radius: V,
|
|
2453
|
+
borderTopLeftRadius: V,
|
|
2454
|
+
borderTopRightRadius: V,
|
|
2455
|
+
borderBottomRightRadius: V,
|
|
2456
|
+
borderBottomLeftRadius: V,
|
|
2451
2457
|
// Positioning props
|
|
2452
|
-
width:
|
|
2453
|
-
maxWidth:
|
|
2454
|
-
height:
|
|
2455
|
-
maxHeight:
|
|
2456
|
-
top:
|
|
2457
|
-
right:
|
|
2458
|
-
bottom:
|
|
2459
|
-
left:
|
|
2458
|
+
width: V,
|
|
2459
|
+
maxWidth: V,
|
|
2460
|
+
height: V,
|
|
2461
|
+
maxHeight: V,
|
|
2462
|
+
top: V,
|
|
2463
|
+
right: V,
|
|
2464
|
+
bottom: V,
|
|
2465
|
+
left: V,
|
|
2460
2466
|
// Spacing props
|
|
2461
|
-
padding:
|
|
2462
|
-
paddingTop:
|
|
2463
|
-
paddingRight:
|
|
2464
|
-
paddingBottom:
|
|
2465
|
-
paddingLeft:
|
|
2466
|
-
margin:
|
|
2467
|
-
marginTop:
|
|
2468
|
-
marginRight:
|
|
2469
|
-
marginBottom:
|
|
2470
|
-
marginLeft:
|
|
2467
|
+
padding: V,
|
|
2468
|
+
paddingTop: V,
|
|
2469
|
+
paddingRight: V,
|
|
2470
|
+
paddingBottom: V,
|
|
2471
|
+
paddingLeft: V,
|
|
2472
|
+
margin: V,
|
|
2473
|
+
marginTop: V,
|
|
2474
|
+
marginRight: V,
|
|
2475
|
+
marginBottom: V,
|
|
2476
|
+
marginLeft: V,
|
|
2471
2477
|
// Misc
|
|
2472
|
-
backgroundPositionX:
|
|
2473
|
-
backgroundPositionY:
|
|
2478
|
+
backgroundPositionX: V,
|
|
2479
|
+
backgroundPositionY: V
|
|
2474
2480
|
}, uo), {
|
|
2475
2481
|
zIndex: Un,
|
|
2476
2482
|
// SVG
|
|
2477
2483
|
fillOpacity: Qe,
|
|
2478
2484
|
strokeOpacity: Qe,
|
|
2479
2485
|
numOctaves: Un
|
|
2480
|
-
}), ho = M(
|
|
2486
|
+
}), ho = M(y({}, vn), {
|
|
2481
2487
|
// Color props
|
|
2482
2488
|
color: U,
|
|
2483
2489
|
backgroundColor: U,
|
|
@@ -2525,7 +2531,7 @@ class lr {
|
|
|
2525
2531
|
this.renderScheduledAt < p && (this.renderScheduledAt = p, ue.render(this.render, !1, !0));
|
|
2526
2532
|
};
|
|
2527
2533
|
const { latestValues: l, renderState: u } = s;
|
|
2528
|
-
this.latestValues = l, this.baseTarget =
|
|
2534
|
+
this.latestValues = l, this.baseTarget = y({}, l), this.initialValues = t.initial ? y({}, l) : {}, this.renderState = u, this.parent = e, this.props = t, this.presenceContext = i, this.depth = e ? e.depth + 1 : 0, this.reducedMotionConfig = r, this.options = o, this.blockInitialAnimation = !!a, this.isControllingVariants = tr(t), this.isVariantNode = no(t), this.isVariantNode && (this.variantChildren = /* @__PURE__ */ new Set()), this.manuallyAnimateOnMount = !!(e && e.current);
|
|
2529
2535
|
const m = this.scrapeMotionValuesFromProps(t, {}, this), { willChange: d } = m, h = ae(m, ["willChange"]);
|
|
2530
2536
|
for (const p in h) {
|
|
2531
2537
|
const g = h[p];
|
|
@@ -2944,8 +2950,8 @@ const Vo = {
|
|
|
2944
2950
|
function Mo(n, e, t = 1, i = 0, r = !0) {
|
|
2945
2951
|
n.pathLength = 1;
|
|
2946
2952
|
const a = r ? Vo : Io;
|
|
2947
|
-
n[a.offset] =
|
|
2948
|
-
const s =
|
|
2953
|
+
n[a.offset] = V.transform(-i);
|
|
2954
|
+
const s = V.transform(e), o = V.transform(t);
|
|
2949
2955
|
n[a.array] = `${s} ${o}`;
|
|
2950
2956
|
}
|
|
2951
2957
|
function Po(n, h, l, u, d) {
|
|
@@ -2964,14 +2970,14 @@ function Po(n, h, l, u, d) {
|
|
|
2964
2970
|
"pathSpacing",
|
|
2965
2971
|
"pathOffset"
|
|
2966
2972
|
]);
|
|
2967
|
-
var b,
|
|
2973
|
+
var b, v;
|
|
2968
2974
|
if (hr(n, o, u), l) {
|
|
2969
2975
|
n.style.viewBox && (n.attrs.viewBox = n.style.viewBox);
|
|
2970
2976
|
return;
|
|
2971
2977
|
}
|
|
2972
2978
|
n.attrs = n.style, n.style = {};
|
|
2973
2979
|
const { attrs: p, style: g } = n;
|
|
2974
|
-
p.transform && (g.transform = p.transform, delete p.transform), (g.transform || p.transformOrigin) && (g.transformOrigin = (b = p.transformOrigin) != null ? b : "50% 50%", delete p.transformOrigin), g.transform && (g.transformBox = (
|
|
2980
|
+
p.transform && (g.transform = p.transform, delete p.transform), (g.transform || p.transformOrigin) && (g.transformOrigin = (b = p.transformOrigin) != null ? b : "50% 50%", delete p.transformOrigin), g.transform && (g.transformBox = (v = d == null ? void 0 : d.transformBox) != null ? v : "fill-box", delete p.transformBox), e !== void 0 && (p.x = e), t !== void 0 && (p.y = t), i !== void 0 && (p.scale = i), r !== void 0 && Mo(p, r, a, s, !1);
|
|
2975
2981
|
}
|
|
2976
2982
|
const fr = /* @__PURE__ */ new Set([
|
|
2977
2983
|
"baseFrequency",
|
|
@@ -3092,8 +3098,8 @@ function br(n, e, t, i) {
|
|
|
3092
3098
|
for (let o = 0; o < s; o++) {
|
|
3093
3099
|
const l = a[o], u = l instanceof Element ? Fo : jo;
|
|
3094
3100
|
Je.has(l) || u(l);
|
|
3095
|
-
const d = Je.get(l), h =
|
|
3096
|
-
"delay" in h && typeof h.delay == "function" && (h.delay = h.delay(o, s)), r.push(...Hs(d, M(
|
|
3101
|
+
const d = Je.get(l), h = y({}, t);
|
|
3102
|
+
"delay" in h && typeof h.delay == "function" && (h.delay = h.delay(o, s)), r.push(...Hs(d, M(y({}, e), { transition: h }), {}));
|
|
3097
3103
|
}
|
|
3098
3104
|
}
|
|
3099
3105
|
return r;
|
|
@@ -3525,9 +3531,9 @@ function yl() {
|
|
|
3525
3531
|
ii = 1;
|
|
3526
3532
|
var n = Ge && Ge.__assign || function() {
|
|
3527
3533
|
return n = Object.assign || function(g) {
|
|
3528
|
-
for (var b,
|
|
3529
|
-
b = arguments[
|
|
3530
|
-
for (var
|
|
3534
|
+
for (var b, v = 1, E = arguments.length; v < E; v++) {
|
|
3535
|
+
b = arguments[v];
|
|
3536
|
+
for (var _ in b) Object.prototype.hasOwnProperty.call(b, _) && (g[_] = b[_]);
|
|
3531
3537
|
}
|
|
3532
3538
|
return g;
|
|
3533
3539
|
}, n.apply(this, arguments);
|
|
@@ -3568,10 +3574,10 @@ function yl() {
|
|
|
3568
3574
|
}
|
|
3569
3575
|
function m(g, b) {
|
|
3570
3576
|
b === void 0 && (b = !1);
|
|
3571
|
-
var
|
|
3572
|
-
if (!b &&
|
|
3577
|
+
var v = u.indexOf(g);
|
|
3578
|
+
if (!b && v === -1)
|
|
3573
3579
|
throw new Error('"' + g + '" is not a supported card type.');
|
|
3574
|
-
return
|
|
3580
|
+
return v;
|
|
3575
3581
|
}
|
|
3576
3582
|
function p(g) {
|
|
3577
3583
|
var b = [];
|
|
@@ -3579,12 +3585,12 @@ function yl() {
|
|
|
3579
3585
|
return b;
|
|
3580
3586
|
if (g.length === 0)
|
|
3581
3587
|
return h();
|
|
3582
|
-
u.forEach(function(
|
|
3583
|
-
var
|
|
3584
|
-
(0, t.addMatchingCardsToResults)(g,
|
|
3588
|
+
u.forEach(function(E) {
|
|
3589
|
+
var _ = d(E);
|
|
3590
|
+
(0, t.addMatchingCardsToResults)(g, _, b);
|
|
3585
3591
|
});
|
|
3586
|
-
var
|
|
3587
|
-
return
|
|
3592
|
+
var v = (0, r.findBestMatch)(b);
|
|
3593
|
+
return v ? [v] : b;
|
|
3588
3594
|
}
|
|
3589
3595
|
return p.getTypeInfo = function(g) {
|
|
3590
3596
|
return (0, a.clone)(d(g));
|
|
@@ -3595,16 +3601,16 @@ function yl() {
|
|
|
3595
3601
|
var b = m(g.type, !0);
|
|
3596
3602
|
s[g.type] = g, b === -1 && u.push(g.type);
|
|
3597
3603
|
}, p.updateCard = function(g, b) {
|
|
3598
|
-
var
|
|
3599
|
-
if (!
|
|
3604
|
+
var v = s[g] || e[g];
|
|
3605
|
+
if (!v)
|
|
3600
3606
|
throw new Error('"'.concat(g, "\" is not a recognized type. Use `addCard` instead.'"));
|
|
3601
|
-
if (b.type &&
|
|
3607
|
+
if (b.type && v.type !== b.type)
|
|
3602
3608
|
throw new Error("Cannot overwrite type parameter.");
|
|
3603
|
-
var
|
|
3604
|
-
|
|
3609
|
+
var E = (0, a.clone)(v);
|
|
3610
|
+
E = n(n({}, E), b), s[E.type] = E;
|
|
3605
3611
|
}, p.changeOrder = function(g, b) {
|
|
3606
|
-
var
|
|
3607
|
-
u.splice(
|
|
3612
|
+
var v = m(g);
|
|
3613
|
+
u.splice(v, 1), u.splice(b, 0, g);
|
|
3608
3614
|
}, p.resetModifications = function() {
|
|
3609
3615
|
u = (0, a.clone)(l), s = {};
|
|
3610
3616
|
}, p.types = o, Ge = p, Ge;
|
|
@@ -3758,7 +3764,7 @@ const bt = [
|
|
|
3758
3764
|
}, Il = (n) => {
|
|
3759
3765
|
var e;
|
|
3760
3766
|
return n ? typeof n.amount != "number" ? (console.error("Transaction amount is missing or invalid for Google Pay"), null) : n.currency ? n.country ? n.merchant_id ? n.checkout_config && !((e = n.checkout_config) == null ? void 0 : e.find(
|
|
3761
|
-
({ is_active: i, type: r }) => i && r ===
|
|
3767
|
+
({ is_active: i, type: r }) => i && r === w.GOOGLE_PAY
|
|
3762
3768
|
)) ? null : {
|
|
3763
3769
|
amount: n.amount,
|
|
3764
3770
|
currency: n.currency,
|
|
@@ -3769,7 +3775,7 @@ const bt = [
|
|
|
3769
3775
|
}, Ml = (n) => {
|
|
3770
3776
|
var e, t;
|
|
3771
3777
|
return n ? typeof n.amount != "number" ? (console.error("Transaction amount is missing or invalid for Apple Pay"), null) : n.currency ? n.country ? n.merchant_id ? n.checkout_config && !((e = n.checkout_config) == null ? void 0 : e.find(
|
|
3772
|
-
({ is_active: r, type: a }) => r && a ===
|
|
3778
|
+
({ is_active: r, type: a }) => r && a === w.APPLE_PAY
|
|
3773
3779
|
)) ? null : {
|
|
3774
3780
|
amount: n.amount,
|
|
3775
3781
|
currency: n.currency,
|
|
@@ -3938,9 +3944,9 @@ function Sl() {
|
|
|
3938
3944
|
switch (f) {
|
|
3939
3945
|
case b:
|
|
3940
3946
|
return "Fragment";
|
|
3941
|
-
case
|
|
3947
|
+
case E:
|
|
3942
3948
|
return "Profiler";
|
|
3943
|
-
case
|
|
3949
|
+
case v:
|
|
3944
3950
|
return "StrictMode";
|
|
3945
3951
|
case A:
|
|
3946
3952
|
return "Suspense";
|
|
@@ -3957,14 +3963,14 @@ function Sl() {
|
|
|
3957
3963
|
return "Portal";
|
|
3958
3964
|
case T:
|
|
3959
3965
|
return (f.displayName || "Context") + ".Provider";
|
|
3960
|
-
case
|
|
3966
|
+
case _:
|
|
3961
3967
|
return (f._context.displayName || "Context") + ".Consumer";
|
|
3962
3968
|
case I:
|
|
3963
3969
|
var P = f.render;
|
|
3964
3970
|
return f = f.displayName, f || (f = P.displayName || P.name || "", f = f !== "" ? "ForwardRef(" + f + ")" : "ForwardRef"), f;
|
|
3965
|
-
case
|
|
3971
|
+
case C:
|
|
3966
3972
|
return P = f.displayName || null, P !== null ? P : n(f.type) || "Memo";
|
|
3967
|
-
case
|
|
3973
|
+
case x:
|
|
3968
3974
|
P = f._payload, f = f._init;
|
|
3969
3975
|
try {
|
|
3970
3976
|
return n(f(P));
|
|
@@ -3995,7 +4001,7 @@ function Sl() {
|
|
|
3995
4001
|
}
|
|
3996
4002
|
function i(f) {
|
|
3997
4003
|
if (f === b) return "<>";
|
|
3998
|
-
if (typeof f == "object" && f !== null && f.$$typeof ===
|
|
4004
|
+
if (typeof f == "object" && f !== null && f.$$typeof === x)
|
|
3999
4005
|
return "<...>";
|
|
4000
4006
|
try {
|
|
4001
4007
|
var P = n(f);
|
|
@@ -4121,7 +4127,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
4121
4127
|
function h(f) {
|
|
4122
4128
|
typeof f == "object" && f !== null && f.$$typeof === p && f._store && (f._store.validated = 1);
|
|
4123
4129
|
}
|
|
4124
|
-
var m = wr, p = Symbol.for("react.transitional.element"), g = Symbol.for("react.portal"), b = Symbol.for("react.fragment"),
|
|
4130
|
+
var m = wr, p = Symbol.for("react.transitional.element"), g = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), v = Symbol.for("react.strict_mode"), E = Symbol.for("react.profiler"), _ = Symbol.for("react.consumer"), T = Symbol.for("react.context"), I = Symbol.for("react.forward_ref"), A = Symbol.for("react.suspense"), D = Symbol.for("react.suspense_list"), C = Symbol.for("react.memo"), x = Symbol.for("react.lazy"), O = Symbol.for("react.activity"), R = Symbol.for("react.client.reference"), q = m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Te = Object.prototype.hasOwnProperty, te = Array.isArray, fe = console.createTask ? console.createTask : function() {
|
|
4125
4131
|
return null;
|
|
4126
4132
|
};
|
|
4127
4133
|
m = {
|
|
@@ -4195,7 +4201,7 @@ class Bl {
|
|
|
4195
4201
|
const t = this.config.state.transaction.getState(), i = this.config.state.translate.locale(), r = Ml(t);
|
|
4196
4202
|
if (!r)
|
|
4197
4203
|
return !1;
|
|
4198
|
-
const a = e ? M(
|
|
4204
|
+
const a = e ? M(y({}, e), {
|
|
4199
4205
|
onError: (s) => {
|
|
4200
4206
|
var l, u;
|
|
4201
4207
|
if (!this.isInitialized) {
|
|
@@ -4211,7 +4217,7 @@ class Bl {
|
|
|
4211
4217
|
}
|
|
4212
4218
|
}) : void 0;
|
|
4213
4219
|
return yield this.ev.initApple(
|
|
4214
|
-
M(
|
|
4220
|
+
M(y({}, a), {
|
|
4215
4221
|
transaction: r,
|
|
4216
4222
|
supportedCardTypes: Pl(jl),
|
|
4217
4223
|
locale: Dl(i || "en"),
|
|
@@ -4229,11 +4235,11 @@ class Bl {
|
|
|
4229
4235
|
}
|
|
4230
4236
|
}
|
|
4231
4237
|
const zl = [
|
|
4232
|
-
{ type:
|
|
4233
|
-
{ type:
|
|
4234
|
-
{ type:
|
|
4235
|
-
{ type:
|
|
4236
|
-
{ type:
|
|
4238
|
+
{ type: w.PAYPAL, is_active: !1, order: 1 },
|
|
4239
|
+
{ type: w.APPLE_PAY, is_active: !1, order: 2 },
|
|
4240
|
+
{ type: w.GOOGLE_PAY, is_active: !1, order: 3 },
|
|
4241
|
+
{ type: w.VENMO, is_active: !1, order: 4 },
|
|
4242
|
+
{ type: w.CARD, is_active: !0, order: 5 }
|
|
4237
4243
|
], _e = {
|
|
4238
4244
|
open: { y: 0, opacity: 1 },
|
|
4239
4245
|
close: { y: 100, opacity: 0 },
|
|
@@ -4272,7 +4278,7 @@ class ql {
|
|
|
4272
4278
|
const t = this.config.state.transaction.getState(), i = this.config.state.translate.locale(), r = Il(t);
|
|
4273
4279
|
if (!r)
|
|
4274
4280
|
return !1;
|
|
4275
|
-
const a = e ? M(
|
|
4281
|
+
const a = e ? M(y({}, e), {
|
|
4276
4282
|
onError: (s) => {
|
|
4277
4283
|
var o;
|
|
4278
4284
|
if (!this.isInitialized) {
|
|
@@ -4287,7 +4293,7 @@ class ql {
|
|
|
4287
4293
|
}
|
|
4288
4294
|
}) : void 0;
|
|
4289
4295
|
return yield this.ev.initGoogle(
|
|
4290
|
-
M(
|
|
4296
|
+
M(y({}, a), {
|
|
4291
4297
|
transaction: r,
|
|
4292
4298
|
locale: Ol(i || "en"),
|
|
4293
4299
|
onPaymentAttempt: this.onPaymentAttempt
|
|
@@ -4350,7 +4356,7 @@ class Yl {
|
|
|
4350
4356
|
} catch (l) {
|
|
4351
4357
|
return !1;
|
|
4352
4358
|
}
|
|
4353
|
-
const a = e ? M(
|
|
4359
|
+
const a = e ? M(y({}, e), {
|
|
4354
4360
|
onError: (l) => {
|
|
4355
4361
|
var d, h;
|
|
4356
4362
|
if (this.emitAttemptOnce(), !this.isInitialized) {
|
|
@@ -4369,7 +4375,7 @@ class Yl {
|
|
|
4369
4375
|
}
|
|
4370
4376
|
}) : void 0;
|
|
4371
4377
|
try {
|
|
4372
|
-
yield this.paypal.render(this.element, M(
|
|
4378
|
+
yield this.paypal.render(this.element, M(y({}, a), {
|
|
4373
4379
|
createBillingAgreement: r,
|
|
4374
4380
|
onClick: () => {
|
|
4375
4381
|
this.emitAttemptOnce();
|
|
@@ -4400,7 +4406,7 @@ class Yl {
|
|
|
4400
4406
|
return this.events[e].addListener(t);
|
|
4401
4407
|
}
|
|
4402
4408
|
emitAttemptOnce() {
|
|
4403
|
-
this.attemptEmitted || (this.attemptEmitted = !0, this.events.onPaymentAttempt.emit(
|
|
4409
|
+
this.attemptEmitted || (this.attemptEmitted = !0, this.events.onPaymentAttempt.emit(w.PAYPAL));
|
|
4404
4410
|
}
|
|
4405
4411
|
isUserCancellationError(e) {
|
|
4406
4412
|
var r;
|
|
@@ -4536,7 +4542,7 @@ class ic {
|
|
|
4536
4542
|
// display venmo button
|
|
4537
4543
|
displayVenmoButton(e) {
|
|
4538
4544
|
Object.assign(this.venmoButton.style, tc), this.venmoButton.addEventListener("click", () => k(this, null, function* () {
|
|
4539
|
-
if (this.events.onPaymentAttempt.emit(
|
|
4545
|
+
if (this.events.onPaymentAttempt.emit(w.VENMO), !this.isProcessing) {
|
|
4540
4546
|
this.isProcessing = !0, this.venmoButton.disabled = !0;
|
|
4541
4547
|
try {
|
|
4542
4548
|
const t = yield this.braintree.tokenize();
|
|
@@ -4618,19 +4624,19 @@ class rc {
|
|
|
4618
4624
|
try {
|
|
4619
4625
|
if (yield this.applePay.init({
|
|
4620
4626
|
onError: (i) => {
|
|
4621
|
-
this.events.error.emit(i), console.log("Apple Pay error:", i), e == null || e.remove(), this.attempted.delete(
|
|
4627
|
+
this.events.error.emit(i), console.log("Apple Pay error:", i), e == null || e.remove(), this.attempted.delete(w.APPLE_PAY);
|
|
4622
4628
|
},
|
|
4623
4629
|
onCancel: () => {
|
|
4624
|
-
this.events.cancel.emit(), this.attempted.delete(
|
|
4630
|
+
this.events.cancel.emit(), this.attempted.delete(w.APPLE_PAY);
|
|
4625
4631
|
},
|
|
4626
4632
|
onSuccess: (i) => {
|
|
4627
|
-
this.events.success.emit(M(
|
|
4633
|
+
this.events.success.emit(M(y({}, i), { type: "apple" })), this.attempted.delete(w.APPLE_PAY);
|
|
4628
4634
|
}
|
|
4629
4635
|
})) {
|
|
4630
4636
|
const i = this.applePay.render();
|
|
4631
4637
|
e == null || e.appendChild(i);
|
|
4632
4638
|
const r = () => {
|
|
4633
|
-
this.attempted.has(
|
|
4639
|
+
this.attempted.has(w.APPLE_PAY) || (this.attempted.add(w.APPLE_PAY), this.events.onPaymentAttempt.emit(w.APPLE_PAY));
|
|
4634
4640
|
};
|
|
4635
4641
|
i.addEventListener("pointerdown", r, { capture: !0 }), i.addEventListener("click", r, { capture: !0 }), i.addEventListener(
|
|
4636
4642
|
"keydown",
|
|
@@ -4657,19 +4663,19 @@ class rc {
|
|
|
4657
4663
|
try {
|
|
4658
4664
|
if (yield this.googlePay.init({
|
|
4659
4665
|
onError: (i) => {
|
|
4660
|
-
this.events.error.emit(i), e == null || e.remove(), this.attempted.delete(
|
|
4666
|
+
this.events.error.emit(i), e == null || e.remove(), this.attempted.delete(w.GOOGLE_PAY);
|
|
4661
4667
|
},
|
|
4662
4668
|
onCancel: () => {
|
|
4663
|
-
this.events.cancel.emit(), this.attempted.delete(
|
|
4669
|
+
this.events.cancel.emit(), this.attempted.delete(w.GOOGLE_PAY);
|
|
4664
4670
|
},
|
|
4665
4671
|
onSuccess: (i) => {
|
|
4666
|
-
this.events.success.emit(M(
|
|
4672
|
+
this.events.success.emit(M(y({}, i), { type: "google" })), this.attempted.delete(w.GOOGLE_PAY);
|
|
4667
4673
|
}
|
|
4668
4674
|
})) {
|
|
4669
4675
|
const i = this.googlePay.render();
|
|
4670
4676
|
e == null || e.appendChild(i);
|
|
4671
4677
|
const r = () => {
|
|
4672
|
-
this.attempted.has(
|
|
4678
|
+
this.attempted.has(w.GOOGLE_PAY) || (this.attempted.add(w.GOOGLE_PAY), this.events.onPaymentAttempt.emit(w.GOOGLE_PAY));
|
|
4673
4679
|
};
|
|
4674
4680
|
i.addEventListener("pointerdown", r, { capture: !0 }), i.addEventListener("click", r, { capture: !0 }), i.addEventListener(
|
|
4675
4681
|
"keydown",
|
|
@@ -4697,13 +4703,13 @@ class rc {
|
|
|
4697
4703
|
const t = this.paypal.render();
|
|
4698
4704
|
e == null || e.appendChild(t), (yield this.paypal.init({
|
|
4699
4705
|
onError: (r) => {
|
|
4700
|
-
this.events.error.emit(r), this.attempted.delete(
|
|
4706
|
+
this.events.error.emit(r), this.attempted.delete(w.PAYPAL);
|
|
4701
4707
|
},
|
|
4702
4708
|
onCancel: () => {
|
|
4703
|
-
this.events.cancel.emit(), this.attempted.delete(
|
|
4709
|
+
this.events.cancel.emit(), this.attempted.delete(w.PAYPAL);
|
|
4704
4710
|
},
|
|
4705
4711
|
onSuccess: (r) => {
|
|
4706
|
-
this.events.success.emit({ paypalId: r, type: "paypal" }), this.attempted.delete(
|
|
4712
|
+
this.events.success.emit({ paypalId: r, type: "paypal" }), this.attempted.delete(w.PAYPAL);
|
|
4707
4713
|
}
|
|
4708
4714
|
})) || e == null || e.remove();
|
|
4709
4715
|
} catch (t) {
|
|
@@ -4753,7 +4759,7 @@ class rc {
|
|
|
4753
4759
|
return k(this, null, function* () {
|
|
4754
4760
|
const e = this.config.state.transaction.getState(), t = Jl(zl, (e == null ? void 0 : e.checkout_config) || [], (s, o) => s.type === o.type), i = this.config.state.checkout.getState();
|
|
4755
4761
|
let r = t.filter(({ is_active: s }) => s);
|
|
4756
|
-
(i == null ? void 0 : i.variant) === "default" && (r = r.filter(({ type: s }) => s !==
|
|
4762
|
+
(i == null ? void 0 : i.variant) === "default" && (r = r.filter(({ type: s }) => s !== w.CARD));
|
|
4757
4763
|
const a = this.initializeButtonInstances(r);
|
|
4758
4764
|
Promise.all(a).then(() => {
|
|
4759
4765
|
this.handleOnFormLoaded();
|
|
@@ -4762,14 +4768,14 @@ class rc {
|
|
|
4762
4768
|
}
|
|
4763
4769
|
// initialize button instances
|
|
4764
4770
|
initializeButtonInstances(e) {
|
|
4765
|
-
const t = e.map(({ type: h }) => h), i = t.includes(
|
|
4771
|
+
const t = e.map(({ type: h }) => h), i = t.includes(w.APPLE_PAY), r = t.includes(w.GOOGLE_PAY), a = t.includes(w.PAYPAL), s = t.includes(w.VENMO), o = t.includes(w.CARD);
|
|
4766
4772
|
i && !this.applePay && (this.applePay = new Bl(this.config)), r && !this.googlePay && (this.googlePay = new ql(this.config)), a && !this.paypal && (this.paypal = new Yl(this.config), this.paypal.addEventListener("onPaymentAttempt", (h) => this.events.onPaymentAttempt.emit(h))), s && !this.braintree && (this.braintree = new ic(this.config), this.braintree.addEventListener("onPaymentAttempt", (h) => this.events.onPaymentAttempt.emit(h))), o && !this.card && (this.card = new Zl(this.config), this.card.addEventListener(() => {
|
|
4767
4773
|
this.events.open.emit();
|
|
4768
4774
|
}));
|
|
4769
4775
|
const l = e.filter(({ type: h }) => {
|
|
4770
|
-
var b,
|
|
4771
|
-
const m = navigator, p = (
|
|
4772
|
-
return !(h ===
|
|
4776
|
+
var b, v, E, _, T, I;
|
|
4777
|
+
const m = navigator, p = (E = (v = (b = m == null ? void 0 : m.userAgentData) == null ? void 0 : b.platform) == null ? void 0 : v.toLowerCase()) == null ? void 0 : E.includes("android"), g = (I = (T = (_ = m == null ? void 0 : m.userAgentData) == null ? void 0 : _.platform) == null ? void 0 : T.toLowerCase()) == null ? void 0 : I.includes("windows");
|
|
4778
|
+
return !(h === w.APPLE_PAY && (p || g));
|
|
4773
4779
|
}).sort((h, m) => h.order - m.order), u = /* @__PURE__ */ new Map();
|
|
4774
4780
|
for (const { type: h } of l) {
|
|
4775
4781
|
const m = document.createElement("div");
|
|
@@ -4777,15 +4783,15 @@ class rc {
|
|
|
4777
4783
|
}
|
|
4778
4784
|
return l.map(({ type: h }) => {
|
|
4779
4785
|
const m = u.get(h);
|
|
4780
|
-
if (h ===
|
|
4786
|
+
if (h === w.APPLE_PAY && this.applePay)
|
|
4781
4787
|
return this.initApple(m);
|
|
4782
|
-
if (h ===
|
|
4788
|
+
if (h === w.GOOGLE_PAY && this.googlePay)
|
|
4783
4789
|
return this.initGoogle(m);
|
|
4784
|
-
if (h ===
|
|
4790
|
+
if (h === w.PAYPAL && this.paypal)
|
|
4785
4791
|
return this.initPayPal(m);
|
|
4786
|
-
if (h ===
|
|
4792
|
+
if (h === w.VENMO && this.braintree)
|
|
4787
4793
|
return this.initBraintreeVenmo(m);
|
|
4788
|
-
if (h ===
|
|
4794
|
+
if (h === w.CARD && this.card)
|
|
4789
4795
|
return this.initCard(m);
|
|
4790
4796
|
throw new Error("Unknown button type");
|
|
4791
4797
|
});
|
|
@@ -4937,7 +4943,7 @@ class Ac {
|
|
|
4937
4943
|
var r, a, s, o, l, u, d, h, m;
|
|
4938
4944
|
const i = e.messages();
|
|
4939
4945
|
if (this.element = document.createElement("div"), this.element.classList.add($.wrapper), this.inputContainer.classList.add($.inputContainer), (r = t == null ? void 0 : t.container) != null && r.className && F(this.inputContainer, t.container.className), (a = t == null ? void 0 : t.container) != null && a.styles && Object.assign(this.inputContainer.style, t.container.styles), this.input.setAttribute("id", this.id), this.input.setAttribute("autocomplete", "cc-name"), this.input.setAttribute("placeholder", i.card.name.placeholder), this.input.classList.add($.input), (s = t == null ? void 0 : t.field) != null && s.className && F(this.input, t.field.className), (o = t == null ? void 0 : t.field) != null && o.styles && Object.assign(this.input.style, t.field.styles), (l = t == null ? void 0 : t.placeholder) != null && l.styles && Object.keys(t.placeholder.styles).length) {
|
|
4940
|
-
const p = (b) => b.replace(/[A-Z]/g, (
|
|
4946
|
+
const p = (b) => b.replace(/[A-Z]/g, (v) => "-" + v.toLowerCase()), g = Object.entries(t.placeholder.styles).map(([b, v]) => `${p(b)}:${v};`).join("");
|
|
4941
4947
|
this.placeholderStyle.textContent = `#${this.id}::placeholder{${g}}`, this.element.appendChild(this.placeholderStyle);
|
|
4942
4948
|
}
|
|
4943
4949
|
this.endContent.classList.add($.hidden), this.endContent.appendChild(this.warning.render()), this.inputContainer.append(this.input, this.endContent), this.label.setAttribute("for", this.id), this.label.classList.add($.label), (u = t == null ? void 0 : t.label) != null && u.className && F(this.label, t.label.className), (d = t == null ? void 0 : t.label) != null && d.styles && Object.assign(this.label.style, t.label.styles), this.labelText.textContent = i.card.name.label, this.labelError.textContent = i.card.required, this.labelError.classList.add($.labelError, $.hidden), (h = t == null ? void 0 : t.error) != null && h.className && F(this.labelError, t.error.className), (m = t == null ? void 0 : t.error) != null && m.styles && Object.assign(this.labelError.style, t.error.styles), this.label.append(this.labelText, this.labelError), this.element.append(this.label, this.inputContainer), this.input.addEventListener("input", () => this.handleChange(this.input.value)), this.input.addEventListener("paste", () => this.handleChange(this.input.value)), this.input.addEventListener("blur", () => this.validate(this.input.value)), e.subscribe(({ messages: p }) => {
|
|
@@ -5143,7 +5149,7 @@ class zc {
|
|
|
5143
5149
|
this.translate = e;
|
|
5144
5150
|
const i = e.messages();
|
|
5145
5151
|
if (this.element = document.createElement("div"), this.element.classList.add(j.wrapper), this.inputContainer.classList.add(j.inputContainer), (r = t == null ? void 0 : t.container) != null && r.className && F(this.inputContainer, t.container.className), (a = t == null ? void 0 : t.container) != null && a.styles && Object.assign(this.inputContainer.style, t.container.styles), this.input.setAttribute("id", this.id), this.input.setAttribute("autocomplete", "cc-number"), this.input.setAttribute("placeholder", "1234 1234 1234 1234"), this.input.setAttribute("inputmode", "numeric"), this.input.setAttribute("pattern", "[0-9]*"), this.input.setAttribute("enterkeyhint", "done"), this.input.classList.add(j.input), (s = t == null ? void 0 : t.field) != null && s.className && F(this.input, t.field.className), (o = t == null ? void 0 : t.field) != null && o.styles && Object.assign(this.input.style, t.field.styles), (l = t == null ? void 0 : t.placeholder) != null && l.styles && Object.keys(t.placeholder.styles).length) {
|
|
5146
|
-
const p = (
|
|
5152
|
+
const p = (v) => v.replace(/[A-Z]/g, (E) => "-" + E.toLowerCase()), g = Object.entries(t.placeholder.styles).map(([v, E]) => `${p(v)}:${E} !important;`).join(""), b = `#${this.id}`;
|
|
5147
5153
|
this.placeholderStyle.textContent = `${b}::placeholder{${g}}
|
|
5148
5154
|
${b}::-webkit-input-placeholder{${g}}
|
|
5149
5155
|
${b}::-moz-placeholder{${g}}
|
|
@@ -5158,9 +5164,9 @@ ${b}::-ms-input-placeholder{${g}}
|
|
|
5158
5164
|
const b = this.input.value.replace(/\D/g, "");
|
|
5159
5165
|
this.handleChange(b);
|
|
5160
5166
|
}), this.input.addEventListener("paste", (p) => {
|
|
5161
|
-
var
|
|
5167
|
+
var v;
|
|
5162
5168
|
p.preventDefault();
|
|
5163
|
-
const b = (((
|
|
5169
|
+
const b = (((v = p.clipboardData) == null ? void 0 : v.getData("text")) || "").replace(/\D/g, "");
|
|
5164
5170
|
this.handleChange(b);
|
|
5165
5171
|
}), this.input.addEventListener("blur", () => this.validate(this.input.value)), this.translate.subscribe(({ messages: p }) => {
|
|
5166
5172
|
this.labelText.textContent = p.card.number.label, this.labelError.textContent = p.card.required, this.render();
|
|
@@ -5309,14 +5315,14 @@ class ed {
|
|
|
5309
5315
|
expiryChange: new K(),
|
|
5310
5316
|
cvcChange: new K()
|
|
5311
5317
|
});
|
|
5312
|
-
var s, o, l, u, d, h, m, p, g, b,
|
|
5318
|
+
var s, o, l, u, d, h, m, p, g, b, v, E, _, T, I, A, D;
|
|
5313
5319
|
this.translate = e;
|
|
5314
5320
|
const i = e.messages();
|
|
5315
5321
|
this.element = document.createElement("div"), this.element.classList.add(L.securityContent), this.expiryInputContainer.classList.add(L.inputContainer), (s = t == null ? void 0 : t.container) != null && s.className && F(this.expiryInputContainer, t.container.className), (o = t == null ? void 0 : t.container) != null && o.styles && Object.assign(this.expiryInputContainer.style, t.container.styles), this.expiryInput.setAttribute("id", this.expiryId), this.expiryInput.setAttribute("autocomplete", "cc-exp"), this.expiryInput.setAttribute("placeholder", i.card.expiry.placeholder), this.expiryInput.setAttribute("inputmode", "numeric"), this.expiryInput.setAttribute("pattern", "[0-9]*"), this.expiryInput.setAttribute("enterkeyhint", "next"), this.expiryInput.classList.add(L.input), (l = t == null ? void 0 : t.field) != null && l.className && F(this.expiryInput, t.field.className), (u = t == null ? void 0 : t.field) != null && u.styles && Object.assign(this.expiryInput.style, t.field.styles), this.expiryEndContent.classList.add(L.endContent), this.expiryEndContent.appendChild(this.expiryWarning.render()), this.expiryInputContainer.append(this.expiryInput, this.expiryEndContent), this.expiryLabel.setAttribute("for", this.expiryId), this.expiryLabel.classList.add(L.label), (d = t == null ? void 0 : t.label) != null && d.className && F(this.expiryLabel, t.label.className), (h = t == null ? void 0 : t.label) != null && h.styles && Object.assign(this.expiryLabel.style, t.label.styles), this.expiryLabelText.contentEditable = "false", this.expiryLabelText.textContent = i.card.expiry.label, this.expiryLabelError.textContent = i.card.required, this.expiryLabelError.classList.add(L.labelError, L.hidden), this.expiryLabel.append(this.expiryLabelText, this.expiryLabelError), this.expiryError.classList.add(L.error, L.hidden), (m = t == null ? void 0 : t.error) != null && m.className && F(this.expiryError, t.error.className), (p = t == null ? void 0 : t.error) != null && p.styles && Object.assign(this.expiryError.style, t.error.styles);
|
|
5316
5322
|
const r = document.createElement("div");
|
|
5317
|
-
if (r.appendChild(this.expiryError), this.cvcInputContainer.classList.add(L.inputContainer), (g = t == null ? void 0 : t.container) != null && g.className && F(this.cvcInputContainer, t.container.className), (b = t == null ? void 0 : t.container) != null && b.styles && Object.assign(this.cvcInputContainer.style, t.container.styles), this.cvcInput.setAttribute("id", this.cvcId), this.cvcInput.setAttribute("autocomplete", "cc-csc"), this.cvcInput.setAttribute("placeholder", i.card.cvc.placeholder), this.cvcInput.setAttribute("inputmode", "numeric"), this.cvcInput.setAttribute("pattern", "[0-9]*"), this.cvcInput.setAttribute("enterkeyhint", "done"), this.cvcInput.classList.add(L.input), (
|
|
5318
|
-
const
|
|
5319
|
-
this.placeholderStyle.textContent = `#${this.expiryId}::placeholder{${
|
|
5323
|
+
if (r.appendChild(this.expiryError), this.cvcInputContainer.classList.add(L.inputContainer), (g = t == null ? void 0 : t.container) != null && g.className && F(this.cvcInputContainer, t.container.className), (b = t == null ? void 0 : t.container) != null && b.styles && Object.assign(this.cvcInputContainer.style, t.container.styles), this.cvcInput.setAttribute("id", this.cvcId), this.cvcInput.setAttribute("autocomplete", "cc-csc"), this.cvcInput.setAttribute("placeholder", i.card.cvc.placeholder), this.cvcInput.setAttribute("inputmode", "numeric"), this.cvcInput.setAttribute("pattern", "[0-9]*"), this.cvcInput.setAttribute("enterkeyhint", "done"), this.cvcInput.classList.add(L.input), (v = t == null ? void 0 : t.field) != null && v.className && F(this.cvcInput, t.field.className), (E = t == null ? void 0 : t.field) != null && E.styles && Object.assign(this.cvcInput.style, t.field.styles), (_ = t == null ? void 0 : t.placeholder) != null && _.styles && Object.keys(t.placeholder.styles).length) {
|
|
5324
|
+
const C = (O) => O.replace(/[A-Z]/g, (R) => "-" + R.toLowerCase()), x = Object.entries(t.placeholder.styles).map(([O, R]) => `${C(O)}:${R};`).join("");
|
|
5325
|
+
this.placeholderStyle.textContent = `#${this.expiryId}::placeholder{${x}}#${this.cvcId}::placeholder{${x}}`, this.element.appendChild(this.placeholderStyle);
|
|
5320
5326
|
}
|
|
5321
5327
|
this.cvcEndContent.classList.add(L.endContent), this.cvcEndContent.appendChild(this.cardCvc.render()), this.cvcInputContainer.append(this.cvcInput, this.cvcEndContent), this.cvcLabel.setAttribute("for", this.cvcId), this.cvcLabel.classList.add(L.label), (T = t == null ? void 0 : t.label) != null && T.className && F(this.cvcLabel, t.label.className), (I = t == null ? void 0 : t.label) != null && I.styles && Object.assign(this.cvcLabel.style, t.label.styles), this.cvcLabelText.textContent = i.card.cvc.label, this.cvcLabelError.textContent = i.card.required, this.cvcLabelError.classList.add(L.labelError, L.hidden), (A = t == null ? void 0 : t.error) != null && A.className && F(this.cvcLabel, t.error.className), (D = t == null ? void 0 : t.error) != null && D.styles && Object.assign(this.cvcLabelError.style, t.error.styles), this.cvcLabel.append(this.cvcLabelText, this.cvcLabelError), this.cvcError.classList.add(L.error, L.hidden);
|
|
5322
5328
|
const a = document.createElement("div");
|
|
@@ -5327,30 +5333,30 @@ class ed {
|
|
|
5327
5333
|
this.cvcInputContainer,
|
|
5328
5334
|
r,
|
|
5329
5335
|
a
|
|
5330
|
-
), this.expiryInput.addEventListener("input", (
|
|
5331
|
-
|
|
5336
|
+
), this.expiryInput.addEventListener("input", (C) => {
|
|
5337
|
+
C.preventDefault();
|
|
5332
5338
|
const O = this.expiryInput.value.replace(/\D/g, "");
|
|
5333
5339
|
this.handleExpiryChange(O);
|
|
5334
|
-
}), this.expiryInput.addEventListener("paste", (
|
|
5340
|
+
}), this.expiryInput.addEventListener("paste", (C) => {
|
|
5335
5341
|
var R;
|
|
5336
|
-
|
|
5337
|
-
const O = (((R =
|
|
5342
|
+
C.preventDefault();
|
|
5343
|
+
const O = (((R = C.clipboardData) == null ? void 0 : R.getData("text")) || "").replace(/\D/g, "");
|
|
5338
5344
|
this.handleExpiryChange(O);
|
|
5339
|
-
}), this.expiryInput.addEventListener("keydown", (
|
|
5340
|
-
this.isDisabled || ["Backspace", "Delete", "Tab", "ArrowLeft", "ArrowRight", "Home", "End"].includes(
|
|
5341
|
-
}), this.expiryInput.addEventListener("blur", () => this.validateExpiry(this.expiryInput.value)), this.cvcInput.addEventListener("input", (
|
|
5342
|
-
|
|
5345
|
+
}), this.expiryInput.addEventListener("keydown", (C) => {
|
|
5346
|
+
this.isDisabled || ["Backspace", "Delete", "Tab", "ArrowLeft", "ArrowRight", "Home", "End"].includes(C.key) || C.ctrlKey || C.metaKey || /^\d$/.test(C.key) || C.preventDefault();
|
|
5347
|
+
}), this.expiryInput.addEventListener("blur", () => this.validateExpiry(this.expiryInput.value)), this.cvcInput.addEventListener("input", (C) => {
|
|
5348
|
+
C.preventDefault();
|
|
5343
5349
|
const O = this.cvcInput.value.replace(/\D/g, "");
|
|
5344
5350
|
this.handleCvcChange(O);
|
|
5345
|
-
}), this.cvcInput.addEventListener("paste", (
|
|
5351
|
+
}), this.cvcInput.addEventListener("paste", (C) => {
|
|
5346
5352
|
var R;
|
|
5347
|
-
|
|
5348
|
-
const O = (((R =
|
|
5353
|
+
C.preventDefault();
|
|
5354
|
+
const O = (((R = C.clipboardData) == null ? void 0 : R.getData("text")) || "").replace(/\D/g, "");
|
|
5349
5355
|
this.handleCvcChange(O);
|
|
5350
|
-
}), this.cvcInput.addEventListener("keydown", (
|
|
5351
|
-
this.isDisabled || ["Backspace", "Delete", "Tab", "ArrowLeft", "ArrowRight", "Home", "End"].includes(
|
|
5352
|
-
}), this.cvcInput.addEventListener("blur", () => this.validateCvc(this.cvcInput.value)), this.translate.subscribe(({ messages:
|
|
5353
|
-
this.cvcInput.setAttribute("placeholder",
|
|
5356
|
+
}), this.cvcInput.addEventListener("keydown", (C) => {
|
|
5357
|
+
this.isDisabled || ["Backspace", "Delete", "Tab", "ArrowLeft", "ArrowRight", "Home", "End"].includes(C.key) || C.ctrlKey || C.metaKey || /^\d$/.test(C.key) || C.preventDefault();
|
|
5358
|
+
}), this.cvcInput.addEventListener("blur", () => this.validateCvc(this.cvcInput.value)), this.translate.subscribe(({ messages: C }) => {
|
|
5359
|
+
this.cvcInput.setAttribute("placeholder", C.card.cvc.placeholder), this.expiryInput.setAttribute("placeholder", C.card.expiry.placeholder), this.expiryLabelText.textContent = C.card.expiry.label, this.cvcLabelText.textContent = C.card.cvc.label, this.expiryLabelError.textContent = C.card.required, this.cvcLabelError.textContent = C.card.required, this.render();
|
|
5354
5360
|
});
|
|
5355
5361
|
}
|
|
5356
5362
|
cvcValidator(e) {
|
|
@@ -5506,7 +5512,7 @@ class td {
|
|
|
5506
5512
|
var p;
|
|
5507
5513
|
l.preventDefault();
|
|
5508
5514
|
const { cvc: u, expiry: d } = this.cardSecurity.value(), { value: h, cardType: m } = this.number.value();
|
|
5509
|
-
this.touchSubmit(), this.validate() && ((p = this.onPaymentAttempt) == null || p.call(this, { paymentMethod:
|
|
5515
|
+
this.touchSubmit(), this.validate() && ((p = this.onPaymentAttempt) == null || p.call(this, { paymentMethod: w.CARD }), this.events.submit.emit({
|
|
5510
5516
|
number: h,
|
|
5511
5517
|
expiry: d,
|
|
5512
5518
|
cvc: u,
|
|
@@ -5758,7 +5764,7 @@ class ld {
|
|
|
5758
5764
|
cardBrand: e.cardBrand || "",
|
|
5759
5765
|
number: s,
|
|
5760
5766
|
cvc: o,
|
|
5761
|
-
type:
|
|
5767
|
+
type: w.CARD,
|
|
5762
5768
|
metadata: {
|
|
5763
5769
|
name: e.name,
|
|
5764
5770
|
userAgent: navigator == null ? void 0 : navigator.userAgent
|
|
@@ -5789,7 +5795,7 @@ class ld {
|
|
|
5789
5795
|
yield this.config.service.ev.initThreeDs({
|
|
5790
5796
|
threeDsId: r.three_ds_session_id,
|
|
5791
5797
|
onSuccess: () => {
|
|
5792
|
-
this.setLoading(!1), this.handleSuccess(M(
|
|
5798
|
+
this.setLoading(!1), this.handleSuccess(M(y({}, e), { threeDsSessionId: r == null ? void 0 : r.three_ds_session_id }));
|
|
5793
5799
|
},
|
|
5794
5800
|
onError: () => {
|
|
5795
5801
|
this.handleError(r == null ? void 0 : r.status_reason);
|
|
@@ -5920,13 +5926,13 @@ const dd = {
|
|
|
5920
5926
|
};
|
|
5921
5927
|
class ud extends Ct {
|
|
5922
5928
|
constructor(e) {
|
|
5923
|
-
super(
|
|
5929
|
+
super(y(y({}, dd), e));
|
|
5924
5930
|
}
|
|
5925
5931
|
}
|
|
5926
5932
|
const hd = {};
|
|
5927
5933
|
class pd extends Ct {
|
|
5928
5934
|
constructor(e) {
|
|
5929
|
-
super(
|
|
5935
|
+
super(y(y({}, hd), e));
|
|
5930
5936
|
}
|
|
5931
5937
|
}
|
|
5932
5938
|
class md extends Ct {
|
|
@@ -7543,20 +7549,20 @@ const fd = {
|
|
|
7543
7549
|
if (!n) return Jt();
|
|
7544
7550
|
const t = Zt[n] || Jt();
|
|
7545
7551
|
return {
|
|
7546
|
-
card:
|
|
7552
|
+
card: y(y({}, t.card), e.card && {
|
|
7547
7553
|
required: e.card.required || t.card.required,
|
|
7548
|
-
number: e.card.number ? M(
|
|
7549
|
-
error: e.card.number.error ?
|
|
7554
|
+
number: e.card.number ? M(y(y({}, t.card.number), e.card.number), {
|
|
7555
|
+
error: e.card.number.error ? y(y({}, t.card.number.error), e.card.number.error) : t.card.number.error
|
|
7550
7556
|
}) : t.card.number,
|
|
7551
|
-
expiry: e.card.expiry ? M(
|
|
7552
|
-
error: e.card.expiry.error ?
|
|
7557
|
+
expiry: e.card.expiry ? M(y(y({}, t.card.expiry), e.card.expiry), {
|
|
7558
|
+
error: e.card.expiry.error ? y(y({}, t.card.expiry.error), e.card.expiry.error) : t.card.expiry.error
|
|
7553
7559
|
}) : t.card.expiry,
|
|
7554
|
-
cvc: e.card.cvc ? M(
|
|
7555
|
-
error: e.card.cvc.error ?
|
|
7560
|
+
cvc: e.card.cvc ? M(y(y({}, t.card.cvc), e.card.cvc), {
|
|
7561
|
+
error: e.card.cvc.error ? y(y({}, t.card.cvc.error), e.card.cvc.error) : t.card.cvc.error
|
|
7556
7562
|
}) : t.card.cvc,
|
|
7557
|
-
name: e.card.name ?
|
|
7558
|
-
pay: e.card.pay ?
|
|
7559
|
-
compact: e.card.compact ?
|
|
7563
|
+
name: e.card.name ? y(y({}, t.card.name), e.card.name) : t.card.name,
|
|
7564
|
+
pay: e.card.pay ? y(y({}, t.card.pay), e.card.pay) : t.card.pay,
|
|
7565
|
+
compact: e.card.compact ? y(y({}, t.card.compact), e.card.compact) : t.card.compact
|
|
7560
7566
|
}),
|
|
7561
7567
|
status: {
|
|
7562
7568
|
error: ((r = e == null ? void 0 : e.status) == null ? void 0 : r.error) || t.status.error,
|
|
@@ -7629,7 +7635,7 @@ class Qd {
|
|
|
7629
7635
|
if (!e.isConnected)
|
|
7630
7636
|
throw new Error("PayPal parent element must be connected to DOM before render()");
|
|
7631
7637
|
if (this.paypal) {
|
|
7632
|
-
const a =
|
|
7638
|
+
const a = y(y({}, Xd), (t == null ? void 0 : t.style) || {}), s = M(y({
|
|
7633
7639
|
fundingSource: "paypal"
|
|
7634
7640
|
}, t), {
|
|
7635
7641
|
style: a
|
|
@@ -7676,7 +7682,7 @@ class eu {
|
|
|
7676
7682
|
throw new Error("Braintree client must be initialized before creating Venmo instance");
|
|
7677
7683
|
try {
|
|
7678
7684
|
const i = (yield import("./venmo-Dybrh4_x.js").then((r) => r.v)).default;
|
|
7679
|
-
return this.venmoInstance = yield i.create(
|
|
7685
|
+
return this.venmoInstance = yield i.create(y({
|
|
7680
7686
|
client: this.client,
|
|
7681
7687
|
allowDesktop: !0,
|
|
7682
7688
|
mobileWebFallBack: !0,
|
|
@@ -7708,7 +7714,7 @@ class eu {
|
|
|
7708
7714
|
if (i)
|
|
7709
7715
|
t(i);
|
|
7710
7716
|
else {
|
|
7711
|
-
const a = M(
|
|
7717
|
+
const a = M(y({}, r), {
|
|
7712
7718
|
device_data: this.deviceData || void 0
|
|
7713
7719
|
}), s = r, o = (s == null ? void 0 : s.billingAddress) || (s == null ? void 0 : s.billing_address);
|
|
7714
7720
|
if (o) {
|
|
@@ -7752,6 +7758,6 @@ class su {
|
|
|
7752
7758
|
export {
|
|
7753
7759
|
su as Core,
|
|
7754
7760
|
iu as PayNextCheckout,
|
|
7755
|
-
|
|
7761
|
+
w as PaymentMethod
|
|
7756
7762
|
};
|
|
7757
7763
|
//# sourceMappingURL=index.es.js.map
|