@paynext/sdk 0.0.118 → 0.0.120
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.d.ts +1 -0
- package/dist/index.es.js +860 -846
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +21 -21
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var xr = Object.defineProperty, wr = Object.defineProperties;
|
|
2
|
+
var Tr = 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 ?
|
|
5
|
+
var xt = (n, e, t) => e in n ? xr(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, v = (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)
|
|
9
9
|
for (var t of ot(e))
|
|
10
10
|
Cn.call(e, t) && xt(n, t, e[t]);
|
|
11
11
|
return n;
|
|
12
|
-
}, I = (n, e) =>
|
|
13
|
-
var
|
|
12
|
+
}, I = (n, e) => wr(n, Tr(e));
|
|
13
|
+
var ae = (n, e) => {
|
|
14
14
|
var t = {};
|
|
15
15
|
for (var i in n)
|
|
16
16
|
yn.call(n, i) && e.indexOf(i) < 0 && (t[i] = n[i]);
|
|
@@ -21,22 +21,22 @@ var se = (n, e) => {
|
|
|
21
21
|
};
|
|
22
22
|
var c = (n, e, t) => xt(n, typeof e != "symbol" ? e + "" : e, t);
|
|
23
23
|
var E = (n, e, t) => new Promise((i, r) => {
|
|
24
|
-
var
|
|
24
|
+
var a = (l) => {
|
|
25
25
|
try {
|
|
26
26
|
o(t.next(l));
|
|
27
27
|
} catch (u) {
|
|
28
28
|
r(u);
|
|
29
29
|
}
|
|
30
|
-
},
|
|
30
|
+
}, s = (l) => {
|
|
31
31
|
try {
|
|
32
32
|
o(t.throw(l));
|
|
33
33
|
} catch (u) {
|
|
34
34
|
r(u);
|
|
35
35
|
}
|
|
36
|
-
}, o = (l) => l.done ? i(l.value) : Promise.resolve(l.value).then(
|
|
36
|
+
}, o = (l) => l.done ? i(l.value) : Promise.resolve(l.value).then(a, s);
|
|
37
37
|
o((t = t.apply(n, e)).next());
|
|
38
38
|
});
|
|
39
|
-
import
|
|
39
|
+
import Ar from "react";
|
|
40
40
|
class iu {
|
|
41
41
|
constructor(e) {
|
|
42
42
|
c(this, "parent");
|
|
@@ -68,7 +68,7 @@ class iu {
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
var x = /* @__PURE__ */ ((n) => (n.PAYPAL = "PAYPAL", n.APPLE_PAY = "APPLEPAY", n.GOOGLE_PAY = "GPAY", n.CARD = "CARD", n.VENMO = "VENMO", n))(x || {}), 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
|
-
const
|
|
71
|
+
const En = {
|
|
72
72
|
appIds: {
|
|
73
73
|
develop: "app_00b96c0c3011",
|
|
74
74
|
staging: "app_00396c84ac2b",
|
|
@@ -81,7 +81,7 @@ const kn = {
|
|
|
81
81
|
staging: "https://staging-api.paynext.com",
|
|
82
82
|
sandbox: "https://sandbox-api.paynext.com",
|
|
83
83
|
production: "https://api.paynext.com"
|
|
84
|
-
})[n],
|
|
84
|
+
})[n], _r = [
|
|
85
85
|
{
|
|
86
86
|
type: x.PAYPAL,
|
|
87
87
|
order: 1,
|
|
@@ -102,7 +102,7 @@ const kn = {
|
|
|
102
102
|
order: 4,
|
|
103
103
|
is_active: !0
|
|
104
104
|
}
|
|
105
|
-
],
|
|
105
|
+
], Lr = (n) => n.googlePay ? x.GOOGLE_PAY : n.applePay ? x.APPLE_PAY : n.paypal ? x.PAYPAL : n.braintree ? x.VENMO : x.CARD, Vr = (n) => {
|
|
106
106
|
const e = n.card;
|
|
107
107
|
if (e)
|
|
108
108
|
return {
|
|
@@ -121,14 +121,14 @@ const kn = {
|
|
|
121
121
|
last4: e.lastFourDigits,
|
|
122
122
|
number: e.number
|
|
123
123
|
};
|
|
124
|
-
},
|
|
124
|
+
}, Ir = (n) => {
|
|
125
125
|
var t;
|
|
126
126
|
const e = n.paypal;
|
|
127
127
|
if ((t = e == null ? void 0 : e.billing_agreement_token) != null && t.paypalId)
|
|
128
128
|
return {
|
|
129
129
|
billing_agreement_token: e.billing_agreement_token.paypalId
|
|
130
130
|
};
|
|
131
|
-
},
|
|
131
|
+
}, Mr = (n) => {
|
|
132
132
|
var t, i;
|
|
133
133
|
const e = n.googlePay;
|
|
134
134
|
if (e != null && e.token)
|
|
@@ -140,45 +140,45 @@ const kn = {
|
|
|
140
140
|
token: e.token.number,
|
|
141
141
|
token_service_provider: e.token.tokenServiceProvider
|
|
142
142
|
};
|
|
143
|
-
},
|
|
144
|
-
var t, i, r,
|
|
143
|
+
}, Pr = (n) => {
|
|
144
|
+
var t, i, r, a, s, o;
|
|
145
145
|
const e = n.applePay;
|
|
146
146
|
if (e)
|
|
147
147
|
return {
|
|
148
148
|
cryptogram: e.cryptogram,
|
|
149
149
|
eci: e.eci,
|
|
150
150
|
exp_month: (i = (t = e.networkToken) == null ? void 0 : t.expiry) != null && i.month ? Number(e.networkToken.expiry.month) : void 0,
|
|
151
|
-
exp_year: (
|
|
152
|
-
token: (
|
|
151
|
+
exp_year: (a = (r = e.networkToken) == null ? void 0 : r.expiry) != null && a.year ? Number(e.networkToken.expiry.year) : void 0,
|
|
152
|
+
token: (s = e.networkToken) == null ? void 0 : s.number,
|
|
153
153
|
token_service_provider: (o = e.networkToken) == null ? void 0 : o.tokenServiceProvider
|
|
154
154
|
};
|
|
155
|
-
},
|
|
155
|
+
}, Dr = (n) => {
|
|
156
156
|
const e = n.braintree;
|
|
157
157
|
if (e)
|
|
158
158
|
return {
|
|
159
159
|
payment_method_nonce: e.nonce
|
|
160
160
|
};
|
|
161
|
-
},
|
|
162
|
-
var i, r,
|
|
161
|
+
}, kn = (n) => {
|
|
162
|
+
var i, r, a, s, o, l, u, d, h, m, p, g, b, y;
|
|
163
163
|
const { applePay: e, googlePay: t } = n;
|
|
164
164
|
if (!(!e && !t))
|
|
165
165
|
return {
|
|
166
166
|
city: ((i = e == null ? void 0 : e.billingContact) == null ? void 0 : i.locality) || ((r = t == null ? void 0 : t.billingAddress) == null ? void 0 : r.locality) || void 0,
|
|
167
|
-
country: ((
|
|
167
|
+
country: ((a = e == null ? void 0 : e.billingContact) == null ? void 0 : a.countryCode) || ((s = t == null ? void 0 : t.billingAddress) == null ? void 0 : s.countryCode) || void 0,
|
|
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
171
|
state: ((b = e == null ? void 0 : e.billingContact) == null ? void 0 : b.administrativeArea) || ((y = t == null ? void 0 : t.billingAddress) == null ? void 0 : y.administrativeArea) || void 0
|
|
172
172
|
};
|
|
173
173
|
}, xn = (n) => {
|
|
174
|
-
var r,
|
|
174
|
+
var r, a, s, o, l, u, d, h, m, p, g, b, y, k, V, _, M, T, D;
|
|
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 {
|
|
178
178
|
bin: e == null ? void 0 : e.firstSixDigits,
|
|
179
179
|
bin_data: {
|
|
180
|
-
brand: (e == null ? void 0 : e.cardBrand) || ((r = t == null ? void 0 : t.card) == null ? void 0 : r.brand) || ((
|
|
181
|
-
country: (e == null ? void 0 : e.country) || ((
|
|
180
|
+
brand: (e == null ? void 0 : e.cardBrand) || ((r = t == null ? void 0 : t.card) == null ? void 0 : r.brand) || ((a = i == null ? void 0 : i.card) == null ? void 0 : a.brand),
|
|
181
|
+
country: (e == null ? void 0 : e.country) || ((s = t == null ? void 0 : t.card) == null ? void 0 : s.country) || ((o = i == null ? void 0 : i.card) == null ? void 0 : o.country),
|
|
182
182
|
currency_code: (e == null ? void 0 : e.currency) || ((l = t == null ? void 0 : t.card) == null ? void 0 : l.currency) || ((u = i == null ? void 0 : i.card) == null ? void 0 : u.currency),
|
|
183
183
|
funding: (e == null ? void 0 : e.funding) || ((d = t == null ? void 0 : t.card) == null ? void 0 : d.funding) || ((h = i == null ? void 0 : i.card) == null ? void 0 : h.funding),
|
|
184
184
|
issuer: (e == null ? void 0 : e.issuer) || ((m = t == null ? void 0 : t.card) == null ? void 0 : m.issuer) || ((p = i == null ? void 0 : i.card) == null ? void 0 : p.issuer),
|
|
@@ -194,9 +194,9 @@ const kn = {
|
|
|
194
194
|
var i, r;
|
|
195
195
|
const { applePay: e, card: t } = n;
|
|
196
196
|
return (i = e == null ? void 0 : e.billingContact) != null && i.givenName ? `${e.billingContact.givenName} ${e.billingContact.familyName || ""}`.trim() : (r = t == null ? void 0 : t.metadata) == null ? void 0 : r.name;
|
|
197
|
-
},
|
|
198
|
-
var i, r,
|
|
199
|
-
const e =
|
|
197
|
+
}, Rr = (n) => {
|
|
198
|
+
var i, r, a, s, o, l, u, d;
|
|
199
|
+
const e = Lr(n), t = {
|
|
200
200
|
client_session: n.clientSession,
|
|
201
201
|
three_ds_session_id: n.threeDsSessionId,
|
|
202
202
|
type: e
|
|
@@ -205,58 +205,58 @@ const kn = {
|
|
|
205
205
|
case x.CARD:
|
|
206
206
|
return I(v({}, t), {
|
|
207
207
|
name: wn(n),
|
|
208
|
-
card:
|
|
208
|
+
card: Vr(n)
|
|
209
209
|
});
|
|
210
210
|
case x.PAYPAL:
|
|
211
211
|
return I(v({}, t), {
|
|
212
|
-
paypal:
|
|
212
|
+
paypal: Ir(n)
|
|
213
213
|
});
|
|
214
214
|
case x.GOOGLE_PAY:
|
|
215
215
|
return I(v({}, t), {
|
|
216
216
|
name: (r = (i = n.googlePay) == null ? void 0 : i.billingAddress) == null ? void 0 : r.name,
|
|
217
|
-
phone: (
|
|
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
|
-
google_pay:
|
|
220
|
-
billing_address:
|
|
219
|
+
google_pay: Mr(n),
|
|
220
|
+
billing_address: kn(n)
|
|
221
221
|
});
|
|
222
222
|
case x.APPLE_PAY:
|
|
223
223
|
return I(v({}, t), {
|
|
224
224
|
name: wn(n),
|
|
225
225
|
card: xn(n),
|
|
226
|
-
apple_pay:
|
|
227
|
-
phone: (
|
|
228
|
-
billing_address:
|
|
226
|
+
apple_pay: Pr(n),
|
|
227
|
+
phone: (d = (u = n.applePay) == null ? void 0 : u.shippingContact) == null ? void 0 : d.phoneNumber,
|
|
228
|
+
billing_address: kn(n)
|
|
229
229
|
});
|
|
230
230
|
case x.VENMO:
|
|
231
231
|
return I(v({}, t), {
|
|
232
|
-
venmo:
|
|
232
|
+
venmo: Dr(n)
|
|
233
233
|
});
|
|
234
234
|
default:
|
|
235
235
|
throw new Error(`Unsupported payment method: ${e}`);
|
|
236
236
|
}
|
|
237
|
-
},
|
|
237
|
+
}, Or = (n, e, t) => E(void 0, null, function* () {
|
|
238
238
|
const i = `${Xt(e)}/payments/create`, r = new Headers();
|
|
239
239
|
r.append("Content-Type", "application/json"), r.append("X-API-Version", t);
|
|
240
|
-
const
|
|
240
|
+
const a = Rr(n);
|
|
241
241
|
return yield (yield fetch(i, {
|
|
242
242
|
method: "POST",
|
|
243
243
|
headers: r,
|
|
244
|
-
body: JSON.stringify(
|
|
244
|
+
body: JSON.stringify(a)
|
|
245
245
|
})).json();
|
|
246
|
-
}),
|
|
246
|
+
}), Nr = (n, e, t) => E(void 0, null, function* () {
|
|
247
247
|
const i = `${Xt(e)}/payments/create/billing/agreement`, r = new Headers();
|
|
248
248
|
return r.append("Content-Type", "application/json"), r.append("X-API-Version", t), (yield (yield fetch(i, {
|
|
249
249
|
method: "POST",
|
|
250
250
|
headers: r,
|
|
251
251
|
body: JSON.stringify({ client_session: n })
|
|
252
252
|
})).json()).paypal_agreement_token_response.token_id || "";
|
|
253
|
-
}),
|
|
253
|
+
}), Sr = (n, e, t) => E(void 0, null, function* () {
|
|
254
254
|
const i = new Headers();
|
|
255
255
|
i.append("X-API-Version", t);
|
|
256
|
-
const r = `${Xt(e)}/payments/config?client_session_id=${n}`,
|
|
257
|
-
return
|
|
256
|
+
const r = `${Xt(e)}/payments/config?client_session_id=${n}`, s = yield (yield fetch(r, { headers: i })).json();
|
|
257
|
+
return s.checkout_config || (s.checkout_config = _r), s;
|
|
258
258
|
});
|
|
259
|
-
let
|
|
259
|
+
let Tn = class {
|
|
260
260
|
constructor(e) {
|
|
261
261
|
c(this, "apple", null);
|
|
262
262
|
c(this, "isAvailable", !1);
|
|
@@ -270,8 +270,8 @@ let Nr = class {
|
|
|
270
270
|
// supportedCardTypes,
|
|
271
271
|
onReady: i,
|
|
272
272
|
onError: r,
|
|
273
|
-
onSuccess:
|
|
274
|
-
onCancel:
|
|
273
|
+
onSuccess: a,
|
|
274
|
+
onCancel: s,
|
|
275
275
|
onPaymentAttempt: o
|
|
276
276
|
}, l) {
|
|
277
277
|
const h = this.ev.transactions.create(e);
|
|
@@ -293,7 +293,7 @@ let Nr = class {
|
|
|
293
293
|
paymentMethod: x.GOOGLE_PAY
|
|
294
294
|
});
|
|
295
295
|
try {
|
|
296
|
-
|
|
296
|
+
a == null || a(p);
|
|
297
297
|
} catch (k) {
|
|
298
298
|
console.error(k), g({
|
|
299
299
|
message: "Cannot pay with payment credentials"
|
|
@@ -301,8 +301,8 @@ let Nr = class {
|
|
|
301
301
|
}
|
|
302
302
|
})
|
|
303
303
|
}));
|
|
304
|
-
const m =
|
|
305
|
-
this.isAvailable = m === "available", this.isAvailable || r == null || r("Apple Pay is not supported on this device"), r && this.apple.on("error", r),
|
|
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;
|
|
306
306
|
});
|
|
307
307
|
}
|
|
308
308
|
render(e) {
|
|
@@ -311,13 +311,13 @@ let Nr = class {
|
|
|
311
311
|
!this.apple || !this.isAvailable || (e.innerHTML = "", yield this.apple.mount(e), (t = this.onReady) == null || t.call(this));
|
|
312
312
|
});
|
|
313
313
|
}
|
|
314
|
-
},
|
|
314
|
+
}, An = class {
|
|
315
315
|
constructor(e) {
|
|
316
316
|
c(this, "google", null);
|
|
317
317
|
this.ev = e;
|
|
318
318
|
}
|
|
319
319
|
init(u, d) {
|
|
320
|
-
return E(this, arguments, function* ({ transaction: e, locale: t, onReady: i, onError: r, onSuccess:
|
|
320
|
+
return E(this, arguments, function* ({ transaction: e, locale: t, onReady: i, onError: r, onSuccess: a, onCancel: s, onPaymentAttempt: o }, l) {
|
|
321
321
|
const h = this.ev.transactions.create(e);
|
|
322
322
|
this.google = this.ev.ui.googlePay(h, I(v({
|
|
323
323
|
locale: t,
|
|
@@ -339,14 +339,14 @@ let Nr = class {
|
|
|
339
339
|
paymentMethod: x.GOOGLE_PAY
|
|
340
340
|
});
|
|
341
341
|
try {
|
|
342
|
-
|
|
342
|
+
a == null || a(m);
|
|
343
343
|
} catch (y) {
|
|
344
344
|
console.error(y), p({
|
|
345
345
|
message: "Cannot pay with payment credentials"
|
|
346
346
|
});
|
|
347
347
|
}
|
|
348
348
|
})
|
|
349
|
-
})),
|
|
349
|
+
})), s && this.google.on("cancel", s), i && this.google.on("ready", i), r && this.google.on("error", r);
|
|
350
350
|
});
|
|
351
351
|
}
|
|
352
352
|
render(e) {
|
|
@@ -378,7 +378,7 @@ class Fr {
|
|
|
378
378
|
c(this, "threeDs", null);
|
|
379
379
|
this.ev = e;
|
|
380
380
|
}
|
|
381
|
-
init(
|
|
381
|
+
init(a) {
|
|
382
382
|
return E(this, arguments, function* ({ threeDsId: e, onReady: t, onSuccess: i, onError: r }) {
|
|
383
383
|
this.threeDs = this.ev.ui.threeDSecure(e), this.threeDs.on("ready", () => t == null ? void 0 : t()), this.threeDs.on("success", () => i == null ? void 0 : i()), this.threeDs.on("failure", () => r == null ? void 0 : r()), this.threeDs.on("error", () => r == null ? void 0 : r());
|
|
384
384
|
});
|
|
@@ -405,15 +405,29 @@ class jr {
|
|
|
405
405
|
var i, r;
|
|
406
406
|
return ((i = this.ev) == null ? void 0 : i.config.appId) !== t || ((r = this.ev) == null ? void 0 : r.config.teamId) !== e;
|
|
407
407
|
}
|
|
408
|
-
//
|
|
409
|
-
|
|
408
|
+
// preload evervault
|
|
409
|
+
preloadEvervault(e) {
|
|
410
410
|
return E(this, null, function* () {
|
|
411
411
|
if (!this.isShouldLoad(e)) return;
|
|
412
412
|
if (typeof window == "undefined")
|
|
413
413
|
throw new Error("Evervault can only be initialized in browser environment");
|
|
414
414
|
this.isReady = !1;
|
|
415
415
|
const { loadEvervault: t } = yield import("./evervault-js-37KtqVz5.js");
|
|
416
|
-
this.ev = yield t(e.teamId, e.appId), this.apple = new
|
|
416
|
+
this.ev = yield t(e.teamId, e.appId), this.apple = new Tn(this.ev), this.google = new An(this.ev);
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
// init ev
|
|
420
|
+
initEv(e) {
|
|
421
|
+
return E(this, null, function* () {
|
|
422
|
+
if (!this.ev) {
|
|
423
|
+
if (!this.isShouldLoad(e)) return;
|
|
424
|
+
if (typeof window == "undefined")
|
|
425
|
+
throw new Error("Evervault can only be initialized in browser environment");
|
|
426
|
+
this.isReady = !1;
|
|
427
|
+
const { loadEvervault: t } = yield import("./evervault-js-37KtqVz5.js");
|
|
428
|
+
this.ev = yield t(e.teamId, e.appId), this.apple = new Tn(this.ev), this.google = new An(this.ev);
|
|
429
|
+
}
|
|
430
|
+
this.events.ready.emit(), this.isReady = !0;
|
|
417
431
|
});
|
|
418
432
|
}
|
|
419
433
|
// init three ds
|
|
@@ -476,48 +490,48 @@ function Br(n, e, t) {
|
|
|
476
490
|
return [n];
|
|
477
491
|
if (typeof n == "string") {
|
|
478
492
|
let r = document;
|
|
479
|
-
const
|
|
480
|
-
return
|
|
493
|
+
const a = (i = t == null ? void 0 : t[n]) != null ? i : r.querySelectorAll(n);
|
|
494
|
+
return a ? Array.from(a) : [];
|
|
481
495
|
}
|
|
482
496
|
return Array.from(n);
|
|
483
497
|
}
|
|
484
|
-
function
|
|
498
|
+
function fi(n, e, t, i) {
|
|
485
499
|
return typeof n == "string" && Qt(e) ? Br(n, t, i) : n instanceof NodeList ? Array.from(n) : Array.isArray(n) ? n : [n];
|
|
486
500
|
}
|
|
487
501
|
function zr(n, e, t) {
|
|
488
502
|
return n * (e + 1);
|
|
489
503
|
}
|
|
490
|
-
function
|
|
504
|
+
function _n(n, e, t, i) {
|
|
491
505
|
var r;
|
|
492
506
|
return typeof e == "number" ? e : e.startsWith("-") || e.startsWith("+") ? Math.max(0, n + parseFloat(e)) : e === "<" ? t : (r = i.get(e)) != null ? r : n;
|
|
493
507
|
}
|
|
494
508
|
const nt = (n, e, t) => n + (e - n) * t, $r = (n, e, t) => {
|
|
495
509
|
const i = e - n;
|
|
496
510
|
return ((t - n) % i + i) % i + n;
|
|
497
|
-
},
|
|
498
|
-
function
|
|
499
|
-
return
|
|
511
|
+
}, gi = (n) => Array.isArray(n) && typeof n[0] != "number";
|
|
512
|
+
function bi(n, e) {
|
|
513
|
+
return gi(n) ? n[$r(0, n.length, e)] : n;
|
|
500
514
|
}
|
|
501
515
|
function Kr(n, e) {
|
|
502
516
|
n.indexOf(e) === -1 && n.push(e);
|
|
503
517
|
}
|
|
504
|
-
function
|
|
518
|
+
function vi(n, e) {
|
|
505
519
|
const t = n.indexOf(e);
|
|
506
520
|
t > -1 && n.splice(t, 1);
|
|
507
521
|
}
|
|
508
522
|
function qr(n, e, t) {
|
|
509
523
|
for (let i = 0; i < n.length; i++) {
|
|
510
524
|
const r = n[i];
|
|
511
|
-
r.at > e && r.at < t && (
|
|
525
|
+
r.at > e && r.at < t && (vi(n, r), i--);
|
|
512
526
|
}
|
|
513
527
|
}
|
|
514
|
-
function Gr(n, e, t, i, r,
|
|
515
|
-
qr(n, r,
|
|
516
|
-
for (let
|
|
528
|
+
function Gr(n, e, t, i, r, a) {
|
|
529
|
+
qr(n, r, a);
|
|
530
|
+
for (let s = 0; s < e.length; s++)
|
|
517
531
|
n.push({
|
|
518
|
-
value: e[
|
|
519
|
-
at: nt(r,
|
|
520
|
-
easing:
|
|
532
|
+
value: e[s],
|
|
533
|
+
at: nt(r, a, i[s]),
|
|
534
|
+
easing: bi(t, s)
|
|
521
535
|
});
|
|
522
536
|
}
|
|
523
537
|
function Hr(n, e) {
|
|
@@ -531,16 +545,16 @@ const J = (n) => !!(n && n.getVelocity), en = /* @__NO_SIDE_EFFECTS__ */ (n, e,
|
|
|
531
545
|
const i = e - n;
|
|
532
546
|
return i === 0 ? 1 : (t - n) / i;
|
|
533
547
|
};
|
|
534
|
-
function
|
|
548
|
+
function yi(n, e) {
|
|
535
549
|
const t = n[n.length - 1];
|
|
536
550
|
for (let i = 1; i <= e; i++) {
|
|
537
551
|
const r = /* @__PURE__ */ en(0, e, i);
|
|
538
552
|
n.push(nt(t, 1, r));
|
|
539
553
|
}
|
|
540
554
|
}
|
|
541
|
-
function
|
|
555
|
+
function Ci(n) {
|
|
542
556
|
const e = [0];
|
|
543
|
-
return
|
|
557
|
+
return yi(e, n.length - 1), e;
|
|
544
558
|
}
|
|
545
559
|
function tn(n) {
|
|
546
560
|
return typeof n == "function" && "applyToOptions" in n;
|
|
@@ -554,12 +568,12 @@ function nn(n) {
|
|
|
554
568
|
e += t, i = n.next(e);
|
|
555
569
|
return e >= mt ? 1 / 0 : e;
|
|
556
570
|
}
|
|
557
|
-
const
|
|
558
|
-
function
|
|
571
|
+
const se = /* @__NO_SIDE_EFFECTS__ */ (n) => n * 1e3, le = /* @__NO_SIDE_EFFECTS__ */ (n) => n / 1e3;
|
|
572
|
+
function Ei(n, e = 100, t) {
|
|
559
573
|
const i = t(I(v({}, n), { keyframes: [0, e] })), r = Math.min(nn(i), mt);
|
|
560
574
|
return {
|
|
561
575
|
type: "keyframes",
|
|
562
|
-
ease: (
|
|
576
|
+
ease: (a) => i.next(r * a).value / e,
|
|
563
577
|
duration: /* @__PURE__ */ le(r)
|
|
564
578
|
};
|
|
565
579
|
}
|
|
@@ -573,8 +587,8 @@ process.env.NODE_ENV !== "production" && (it = (n, e) => {
|
|
|
573
587
|
throw new Error(e);
|
|
574
588
|
});
|
|
575
589
|
const Ur = "easeInOut", Wr = 20;
|
|
576
|
-
function Zr(n,
|
|
577
|
-
var
|
|
590
|
+
function Zr(n, a = {}, i, r) {
|
|
591
|
+
var s = a, { defaultTransition: e = {} } = s, t = ae(s, ["defaultTransition"]);
|
|
578
592
|
const o = e.duration || 0.3, l = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), d = {}, h = /* @__PURE__ */ new Map();
|
|
579
593
|
let m = 0, p = 0, g = 0;
|
|
580
594
|
for (let b = 0; b < n.length; b++) {
|
|
@@ -583,32 +597,32 @@ function Zr(n, s = {}, i, r) {
|
|
|
583
597
|
h.set(y, p);
|
|
584
598
|
continue;
|
|
585
599
|
} else if (!Array.isArray(y)) {
|
|
586
|
-
h.set(y.name,
|
|
600
|
+
h.set(y.name, _n(p, y.at, m, h));
|
|
587
601
|
continue;
|
|
588
602
|
}
|
|
589
603
|
let [k, V, _ = {}] = y;
|
|
590
|
-
_.at !== void 0 && (p =
|
|
604
|
+
_.at !== void 0 && (p = _n(p, _.at, m, h));
|
|
591
605
|
let M = 0;
|
|
592
606
|
const T = (D, C, w, R = 0, O = 0) => {
|
|
593
|
-
const q = Jr(D), _e = C, { delay: Te = 0, times: te =
|
|
607
|
+
const q = Jr(D), _e = C, { delay: Te = 0, times: te = Ci(q), type: fe = "keyframes", repeat: he, repeatType: Et, repeatDelay: kt = 0 } = _e, st = ae(_e, ["delay", "times", "type", "repeat", "repeatType", "repeatDelay"]);
|
|
594
608
|
let { ease: ne = e.ease || "easeOut", duration: f } = C;
|
|
595
609
|
const P = typeof Te == "function" ? Te(R, O) : Te, N = q.length, G = tn(fe) ? fe : r == null ? void 0 : r[fe];
|
|
596
610
|
if (N <= 2 && G) {
|
|
597
611
|
let z = 100;
|
|
598
|
-
if (N === 2 &&
|
|
612
|
+
if (N === 2 && ea(q)) {
|
|
599
613
|
const ge = q[1] - q[0];
|
|
600
614
|
z = Math.abs(ge);
|
|
601
615
|
}
|
|
602
|
-
const re = v({},
|
|
603
|
-
f !== void 0 && (re.duration = /* @__PURE__ */
|
|
604
|
-
const pe =
|
|
616
|
+
const re = v({}, st);
|
|
617
|
+
f !== void 0 && (re.duration = /* @__PURE__ */ se(f));
|
|
618
|
+
const pe = Ei(re, z, G);
|
|
605
619
|
ne = pe.ease, f = pe.duration;
|
|
606
620
|
}
|
|
607
621
|
f != null || (f = o);
|
|
608
622
|
const ie = p + P;
|
|
609
623
|
te.length === 1 && te[0] === 0 && (te[1] = 1);
|
|
610
624
|
const X = te.length - q.length;
|
|
611
|
-
if (X > 0 &&
|
|
625
|
+
if (X > 0 && yi(te, X), q.length === 1 && q.unshift(null), he) {
|
|
612
626
|
ce(he < Wr, "Repeat count too high, must be less than 20"), f = zr(f, he);
|
|
613
627
|
const z = [...q], re = [...te];
|
|
614
628
|
ne = Array.isArray(ne) ? [...ne] : [ne];
|
|
@@ -616,7 +630,7 @@ function Zr(n, s = {}, i, r) {
|
|
|
616
630
|
for (let ge = 0; ge < he; ge++) {
|
|
617
631
|
q.push(...z);
|
|
618
632
|
for (let je = 0; je < z.length; je++)
|
|
619
|
-
te.push(re[je] + (ge + 1)), ne.push(je === 0 ? "linear" :
|
|
633
|
+
te.push(re[je] + (ge + 1)), ne.push(je === 0 ? "linear" : bi(pe, je - 1));
|
|
620
634
|
}
|
|
621
635
|
Hr(te, he);
|
|
622
636
|
}
|
|
@@ -624,15 +638,15 @@ function Zr(n, s = {}, i, r) {
|
|
|
624
638
|
Gr(w, q, ne, te, ie, Ae), M = Math.max(P + f, M), g = Math.max(Ae, g);
|
|
625
639
|
};
|
|
626
640
|
if (J(k)) {
|
|
627
|
-
const D =
|
|
628
|
-
T(V, _,
|
|
641
|
+
const D = Ln(k, u);
|
|
642
|
+
T(V, _, Vn("default", D));
|
|
629
643
|
} else {
|
|
630
|
-
const D =
|
|
644
|
+
const D = fi(k, V, i, d), C = D.length;
|
|
631
645
|
for (let w = 0; w < C; w++) {
|
|
632
646
|
V = V, _ = _;
|
|
633
|
-
const R = D[w], O =
|
|
647
|
+
const R = D[w], O = Ln(R, u);
|
|
634
648
|
for (const q in V)
|
|
635
|
-
T(V[q], Xr(_, q),
|
|
649
|
+
T(V[q], Xr(_, q), Vn(q, O), w, C);
|
|
636
650
|
}
|
|
637
651
|
}
|
|
638
652
|
m = p, p += M;
|
|
@@ -659,10 +673,10 @@ function Zr(n, s = {}, i, r) {
|
|
|
659
673
|
}
|
|
660
674
|
}), l;
|
|
661
675
|
}
|
|
662
|
-
function
|
|
676
|
+
function Ln(n, e) {
|
|
663
677
|
return !e.has(n) && e.set(n, {}), e.get(n);
|
|
664
678
|
}
|
|
665
|
-
function
|
|
679
|
+
function Vn(n, e) {
|
|
666
680
|
return e[n] || (e[n] = []), e[n];
|
|
667
681
|
}
|
|
668
682
|
function Jr(n) {
|
|
@@ -671,27 +685,27 @@ function Jr(n) {
|
|
|
671
685
|
function Xr(n, e) {
|
|
672
686
|
return n && n[e] ? v(v({}, n), n[e]) : v({}, n);
|
|
673
687
|
}
|
|
674
|
-
const Qr = (n) => typeof n == "number",
|
|
675
|
-
function
|
|
688
|
+
const Qr = (n) => typeof n == "number", ea = (n) => n.every(Qr), Je = /* @__PURE__ */ new WeakMap(), ta = (n) => Array.isArray(n);
|
|
689
|
+
function In(n) {
|
|
676
690
|
const e = [{}, {}];
|
|
677
691
|
return n == null || n.values.forEach((t, i) => {
|
|
678
692
|
e[0][i] = t.get(), e[1][i] = t.getVelocity();
|
|
679
693
|
}), e;
|
|
680
694
|
}
|
|
681
|
-
function
|
|
695
|
+
function ki(n, e, t, i) {
|
|
682
696
|
if (typeof e == "function") {
|
|
683
|
-
const [r,
|
|
684
|
-
e = e(t !== void 0 ? t : n.custom, r,
|
|
697
|
+
const [r, a] = In(i);
|
|
698
|
+
e = e(t !== void 0 ? t : n.custom, r, a);
|
|
685
699
|
}
|
|
686
700
|
if (typeof e == "string" && (e = n.variants && n.variants[e]), typeof e == "function") {
|
|
687
|
-
const [r,
|
|
688
|
-
e = e(t !== void 0 ? t : n.custom, r,
|
|
701
|
+
const [r, a] = In(i);
|
|
702
|
+
e = e(t !== void 0 ? t : n.custom, r, a);
|
|
689
703
|
}
|
|
690
704
|
return e;
|
|
691
705
|
}
|
|
692
|
-
function
|
|
706
|
+
function na(n, e, t) {
|
|
693
707
|
const i = n.getProps();
|
|
694
|
-
return
|
|
708
|
+
return ki(i, e, i.custom, n);
|
|
695
709
|
}
|
|
696
710
|
const lt = [
|
|
697
711
|
"setup",
|
|
@@ -711,16 +725,16 @@ const lt = [
|
|
|
711
725
|
"postRender"
|
|
712
726
|
// Compute
|
|
713
727
|
];
|
|
714
|
-
function
|
|
715
|
-
let t = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), r = !1,
|
|
716
|
-
const
|
|
728
|
+
function ia(n, e) {
|
|
729
|
+
let t = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), r = !1, a = !1;
|
|
730
|
+
const s = /* @__PURE__ */ new WeakSet();
|
|
717
731
|
let o = {
|
|
718
732
|
delta: 0,
|
|
719
733
|
timestamp: 0,
|
|
720
734
|
isProcessing: !1
|
|
721
735
|
};
|
|
722
736
|
function l(d) {
|
|
723
|
-
|
|
737
|
+
s.has(d) && (u.schedule(d), n()), d(o);
|
|
724
738
|
}
|
|
725
739
|
const u = {
|
|
726
740
|
/**
|
|
@@ -728,68 +742,68 @@ function is(n, e) {
|
|
|
728
742
|
*/
|
|
729
743
|
schedule: (d, h = !1, m = !1) => {
|
|
730
744
|
const g = m && r ? t : i;
|
|
731
|
-
return h &&
|
|
745
|
+
return h && s.add(d), g.has(d) || g.add(d), d;
|
|
732
746
|
},
|
|
733
747
|
/**
|
|
734
748
|
* Cancel the provided callback from running on the next frame.
|
|
735
749
|
*/
|
|
736
750
|
cancel: (d) => {
|
|
737
|
-
i.delete(d),
|
|
751
|
+
i.delete(d), s.delete(d);
|
|
738
752
|
},
|
|
739
753
|
/**
|
|
740
754
|
* Execute all schedule callbacks.
|
|
741
755
|
*/
|
|
742
756
|
process: (d) => {
|
|
743
757
|
if (o = d, r) {
|
|
744
|
-
|
|
758
|
+
a = !0;
|
|
745
759
|
return;
|
|
746
760
|
}
|
|
747
|
-
r = !0, [t, i] = [i, t], t.forEach(l), t.clear(), r = !1,
|
|
761
|
+
r = !0, [t, i] = [i, t], t.forEach(l), t.clear(), r = !1, a && (a = !1, u.process(d));
|
|
748
762
|
}
|
|
749
763
|
};
|
|
750
764
|
return u;
|
|
751
765
|
}
|
|
752
|
-
const de = {},
|
|
753
|
-
function
|
|
766
|
+
const de = {}, ra = 40;
|
|
767
|
+
function aa(n, e) {
|
|
754
768
|
let t = !1, i = !0;
|
|
755
769
|
const r = {
|
|
756
770
|
delta: 0,
|
|
757
771
|
timestamp: 0,
|
|
758
772
|
isProcessing: !1
|
|
759
|
-
},
|
|
773
|
+
}, a = () => t = !0, s = lt.reduce((_, M) => (_[M] = ia(a), _), {}), { setup: o, read: l, resolveKeyframes: u, preUpdate: d, update: h, preRender: m, render: p, postRender: g } = s, b = () => {
|
|
760
774
|
const _ = de.useManualTiming ? r.timestamp : performance.now();
|
|
761
|
-
t = !1, de.useManualTiming || (r.delta = i ? 1e3 / 60 : Math.max(Math.min(_ - r.timestamp,
|
|
775
|
+
t = !1, de.useManualTiming || (r.delta = i ? 1e3 / 60 : Math.max(Math.min(_ - r.timestamp, ra), 1)), r.timestamp = _, 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));
|
|
762
776
|
}, y = () => {
|
|
763
777
|
t = !0, i = !0, r.isProcessing || n(b);
|
|
764
778
|
};
|
|
765
779
|
return { schedule: lt.reduce((_, M) => {
|
|
766
|
-
const T =
|
|
780
|
+
const T = s[M];
|
|
767
781
|
return _[M] = (D, C = !1, w = !1) => (t || y(), T.schedule(D, C, w)), _;
|
|
768
782
|
}, {}), cancel: (_) => {
|
|
769
783
|
for (let M = 0; M < lt.length; M++)
|
|
770
|
-
|
|
771
|
-
}, state: r, steps:
|
|
784
|
+
s[lt[M]].cancel(_);
|
|
785
|
+
}, state: r, steps: s };
|
|
772
786
|
}
|
|
773
|
-
const De = /* @__NO_SIDE_EFFECTS__ */ (n) => n, { schedule: ue, cancel: Rt, state: ft } = /* @__PURE__ */
|
|
787
|
+
const De = /* @__NO_SIDE_EFFECTS__ */ (n) => n, { schedule: ue, cancel: Rt, state: ft } = /* @__PURE__ */ aa(typeof requestAnimationFrame != "undefined" ? requestAnimationFrame : De, !0);
|
|
774
788
|
let pt;
|
|
775
|
-
function
|
|
789
|
+
function sa() {
|
|
776
790
|
pt = void 0;
|
|
777
791
|
}
|
|
778
792
|
const ee = {
|
|
779
793
|
now: () => (pt === void 0 && ee.set(ft.isProcessing || de.useManualTiming ? ft.timestamp : performance.now()), pt),
|
|
780
794
|
set: (n) => {
|
|
781
|
-
pt = n, queueMicrotask(
|
|
795
|
+
pt = n, queueMicrotask(sa);
|
|
782
796
|
}
|
|
783
|
-
},
|
|
784
|
-
function
|
|
785
|
-
n ||
|
|
797
|
+
}, Mn = /* @__PURE__ */ new Set();
|
|
798
|
+
function xi(n, e, t) {
|
|
799
|
+
n || Mn.has(e) || (console.warn(e), Mn.add(e));
|
|
786
800
|
}
|
|
787
|
-
class
|
|
801
|
+
class wi {
|
|
788
802
|
constructor() {
|
|
789
803
|
this.subscriptions = [];
|
|
790
804
|
}
|
|
791
805
|
add(e) {
|
|
792
|
-
return Kr(this.subscriptions, e), () =>
|
|
806
|
+
return Kr(this.subscriptions, e), () => vi(this.subscriptions, e);
|
|
793
807
|
}
|
|
794
808
|
notify(e, t, i) {
|
|
795
809
|
const r = this.subscriptions.length;
|
|
@@ -797,9 +811,9 @@ class Ei {
|
|
|
797
811
|
if (r === 1)
|
|
798
812
|
this.subscriptions[0](e, t, i);
|
|
799
813
|
else
|
|
800
|
-
for (let
|
|
801
|
-
const
|
|
802
|
-
|
|
814
|
+
for (let a = 0; a < r; a++) {
|
|
815
|
+
const s = this.subscriptions[a];
|
|
816
|
+
s && s(e, t, i);
|
|
803
817
|
}
|
|
804
818
|
}
|
|
805
819
|
getSize() {
|
|
@@ -809,11 +823,11 @@ class Ei {
|
|
|
809
823
|
this.subscriptions.length = 0;
|
|
810
824
|
}
|
|
811
825
|
}
|
|
812
|
-
function
|
|
826
|
+
function Ti(n, e) {
|
|
813
827
|
return e ? n * (1e3 / e) : 0;
|
|
814
828
|
}
|
|
815
|
-
const
|
|
816
|
-
class
|
|
829
|
+
const Pn = 30, oa = (n) => !isNaN(parseFloat(n));
|
|
830
|
+
class la {
|
|
817
831
|
/**
|
|
818
832
|
* @param init - The initiating value
|
|
819
833
|
* @param config - Optional configuration options
|
|
@@ -822,16 +836,16 @@ class ls {
|
|
|
822
836
|
*/
|
|
823
837
|
constructor(e, t = {}) {
|
|
824
838
|
this.canTrackVelocity = null, this.events = {}, this.updateAndNotify = (i, r = !0) => {
|
|
825
|
-
var
|
|
826
|
-
const
|
|
827
|
-
if (this.updatedAt !==
|
|
839
|
+
var s, o;
|
|
840
|
+
const a = ee.now();
|
|
841
|
+
if (this.updatedAt !== a && this.setPrevFrameValue(), this.prev = this.current, this.setCurrent(i), this.current !== this.prev && ((s = this.events.change) == null || s.notify(this.current), this.dependents))
|
|
828
842
|
for (const l of this.dependents)
|
|
829
843
|
l.dirty();
|
|
830
844
|
r && ((o = this.events.renderRequest) == null || o.notify(this.current));
|
|
831
845
|
}, this.hasAnimated = !1, this.setCurrent(e), this.owner = t.owner;
|
|
832
846
|
}
|
|
833
847
|
setCurrent(e) {
|
|
834
|
-
this.current = e, this.updatedAt = ee.now(), this.canTrackVelocity === null && e !== void 0 && (this.canTrackVelocity =
|
|
848
|
+
this.current = e, this.updatedAt = ee.now(), this.canTrackVelocity === null && e !== void 0 && (this.canTrackVelocity = oa(this.current));
|
|
835
849
|
}
|
|
836
850
|
setPrevFrameValue(e = this.current) {
|
|
837
851
|
this.prevFrameValue = e, this.prevUpdatedAt = this.updatedAt;
|
|
@@ -877,10 +891,10 @@ class ls {
|
|
|
877
891
|
* @deprecated
|
|
878
892
|
*/
|
|
879
893
|
onChange(e) {
|
|
880
|
-
return process.env.NODE_ENV !== "production" &&
|
|
894
|
+
return process.env.NODE_ENV !== "production" && xi(!1, 'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'), this.on("change", e);
|
|
881
895
|
}
|
|
882
896
|
on(e, t) {
|
|
883
|
-
this.events[e] || (this.events[e] = new
|
|
897
|
+
this.events[e] || (this.events[e] = new wi());
|
|
884
898
|
const i = this.events[e].add(t);
|
|
885
899
|
return e === "change" ? () => {
|
|
886
900
|
i(), ue.read(() => {
|
|
@@ -961,10 +975,10 @@ class ls {
|
|
|
961
975
|
*/
|
|
962
976
|
getVelocity() {
|
|
963
977
|
const e = ee.now();
|
|
964
|
-
if (!this.canTrackVelocity || this.prevFrameValue === void 0 || e - this.updatedAt >
|
|
978
|
+
if (!this.canTrackVelocity || this.prevFrameValue === void 0 || e - this.updatedAt > Pn)
|
|
965
979
|
return 0;
|
|
966
|
-
const t = Math.min(this.updatedAt - this.prevUpdatedAt,
|
|
967
|
-
return
|
|
980
|
+
const t = Math.min(this.updatedAt - this.prevUpdatedAt, Pn);
|
|
981
|
+
return Ti(parseFloat(this.current) - parseFloat(this.prevFrameValue), t);
|
|
968
982
|
}
|
|
969
983
|
/**
|
|
970
984
|
* Registers a new animation to control this `MotionValue`. Only one
|
|
@@ -1017,42 +1031,42 @@ class ls {
|
|
|
1017
1031
|
}
|
|
1018
1032
|
}
|
|
1019
1033
|
function Xe(n, e) {
|
|
1020
|
-
return new
|
|
1034
|
+
return new la(n, e);
|
|
1021
1035
|
}
|
|
1022
|
-
function
|
|
1036
|
+
function ca(n, e, t) {
|
|
1023
1037
|
n.hasValue(e) ? n.getValue(e).set(t) : n.addValue(e, Xe(t));
|
|
1024
1038
|
}
|
|
1025
|
-
function
|
|
1026
|
-
return
|
|
1039
|
+
function da(n) {
|
|
1040
|
+
return ta(n) ? n[n.length - 1] || 0 : n;
|
|
1027
1041
|
}
|
|
1028
|
-
function
|
|
1029
|
-
let
|
|
1030
|
-
|
|
1031
|
-
for (const o in
|
|
1032
|
-
const l =
|
|
1033
|
-
|
|
1042
|
+
function ua(n, e) {
|
|
1043
|
+
let s = na(n, e) || {}, { transitionEnd: i = {}, transition: r = {} } = s, a = ae(s, ["transitionEnd", "transition"]);
|
|
1044
|
+
a = v(v({}, a), i);
|
|
1045
|
+
for (const o in a) {
|
|
1046
|
+
const l = da(a[o]);
|
|
1047
|
+
ca(n, o, l);
|
|
1034
1048
|
}
|
|
1035
1049
|
}
|
|
1036
|
-
function
|
|
1050
|
+
function ha(n) {
|
|
1037
1051
|
return !!(J(n) && n.add);
|
|
1038
1052
|
}
|
|
1039
|
-
function
|
|
1053
|
+
function pa(n, e) {
|
|
1040
1054
|
const t = n.getValue("willChange");
|
|
1041
|
-
if (
|
|
1055
|
+
if (ha(t))
|
|
1042
1056
|
return t.add(e);
|
|
1043
1057
|
if (!t && de.WillChange) {
|
|
1044
1058
|
const i = new de.WillChange("auto");
|
|
1045
1059
|
n.addValue("willChange", i), i.add(e);
|
|
1046
1060
|
}
|
|
1047
1061
|
}
|
|
1048
|
-
const rn = (n) => n.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(),
|
|
1049
|
-
function
|
|
1050
|
-
return n.props[
|
|
1062
|
+
const rn = (n) => n.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(), ma = "framerAppearId", fa = "data-" + rn(ma);
|
|
1063
|
+
function ga(n) {
|
|
1064
|
+
return n.props[fa];
|
|
1051
1065
|
}
|
|
1052
|
-
const
|
|
1053
|
-
function
|
|
1054
|
-
const r = n.filter(
|
|
1055
|
-
return r[
|
|
1066
|
+
const ba = (n) => n !== null;
|
|
1067
|
+
function va(n, { repeat: e, repeatType: t = "loop" }, i) {
|
|
1068
|
+
const r = n.filter(ba), a = e && t !== "loop" && e % 2 === 1 ? 0 : r.length - 1;
|
|
1069
|
+
return r[a];
|
|
1056
1070
|
}
|
|
1057
1071
|
const Re = [
|
|
1058
1072
|
"transformPerspective",
|
|
@@ -1072,33 +1086,33 @@ const Re = [
|
|
|
1072
1086
|
"skew",
|
|
1073
1087
|
"skewX",
|
|
1074
1088
|
"skewY"
|
|
1075
|
-
], Oe = new Set(Re),
|
|
1089
|
+
], Oe = new Set(Re), ya = {
|
|
1076
1090
|
type: "spring",
|
|
1077
1091
|
stiffness: 500,
|
|
1078
1092
|
damping: 25,
|
|
1079
1093
|
restSpeed: 10
|
|
1080
|
-
},
|
|
1094
|
+
}, Ca = (n) => ({
|
|
1081
1095
|
type: "spring",
|
|
1082
1096
|
stiffness: 550,
|
|
1083
1097
|
damping: n === 0 ? 2 * Math.sqrt(550) : 30,
|
|
1084
1098
|
restSpeed: 10
|
|
1085
|
-
}),
|
|
1099
|
+
}), Ea = {
|
|
1086
1100
|
type: "keyframes",
|
|
1087
1101
|
duration: 0.8
|
|
1088
|
-
},
|
|
1102
|
+
}, ka = {
|
|
1089
1103
|
type: "keyframes",
|
|
1090
1104
|
ease: [0.25, 0.1, 0.35, 1],
|
|
1091
1105
|
duration: 0.3
|
|
1092
|
-
},
|
|
1093
|
-
function
|
|
1094
|
-
var m = h, { when: n, delay: e, delayChildren: t, staggerChildren: i, staggerDirection: r, repeat:
|
|
1106
|
+
}, xa = (n, { keyframes: e }) => e.length > 2 ? Ea : Oe.has(n) ? n.startsWith("scale") ? Ca(e[1]) : ya : ka;
|
|
1107
|
+
function wa(h) {
|
|
1108
|
+
var m = h, { when: n, delay: e, delayChildren: t, staggerChildren: i, staggerDirection: r, repeat: a, repeatType: s, repeatDelay: o, from: l, elapsed: u } = m, d = ae(m, ["when", "delay", "delayChildren", "staggerChildren", "staggerDirection", "repeat", "repeatType", "repeatDelay", "from", "elapsed"]);
|
|
1095
1109
|
return !!Object.keys(d).length;
|
|
1096
1110
|
}
|
|
1097
|
-
function
|
|
1111
|
+
function Ai(n, e) {
|
|
1098
1112
|
var t, i;
|
|
1099
1113
|
return (i = (t = n == null ? void 0 : n[e]) != null ? t : n == null ? void 0 : n.default) != null ? i : n;
|
|
1100
1114
|
}
|
|
1101
|
-
const
|
|
1115
|
+
const _i = (n) => (e) => typeof e == "string" && e.startsWith(n), Li = /* @__PURE__ */ _i("--"), Ta = /* @__PURE__ */ _i("var(--"), an = (n) => Ta(n) ? Aa.test(n.split("/*")[0].trim()) : !1, Aa = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu, xe = (n, e, t) => t > e ? e : t < n ? n : t, Ne = {
|
|
1102
1116
|
test: (n) => typeof n == "number",
|
|
1103
1117
|
parse: parseFloat,
|
|
1104
1118
|
transform: (n) => n
|
|
@@ -1106,28 +1120,28 @@ const Ti = (n) => (e) => typeof e == "string" && e.startsWith(n), Ai = /* @__PUR
|
|
|
1106
1120
|
transform: (n) => xe(0, 1, n)
|
|
1107
1121
|
}), ct = I(v({}, Ne), {
|
|
1108
1122
|
default: 1
|
|
1109
|
-
}), We = (n) => Math.round(n * 1e5) / 1e5,
|
|
1110
|
-
function
|
|
1123
|
+
}), We = (n) => Math.round(n * 1e5) / 1e5, sn = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu;
|
|
1124
|
+
function _a(n) {
|
|
1111
1125
|
return n == null;
|
|
1112
1126
|
}
|
|
1113
|
-
const
|
|
1127
|
+
const La = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu, on = (n, e) => (t) => !!(typeof t == "string" && La.test(t) && t.startsWith(n) || e && !_a(t) && Object.prototype.hasOwnProperty.call(t, e)), Vi = (n, e, t) => (i) => {
|
|
1114
1128
|
if (typeof i != "string")
|
|
1115
1129
|
return i;
|
|
1116
|
-
const [r,
|
|
1130
|
+
const [r, a, s, o] = i.match(sn);
|
|
1117
1131
|
return {
|
|
1118
1132
|
[n]: parseFloat(r),
|
|
1119
|
-
[e]: parseFloat(
|
|
1120
|
-
[t]: parseFloat(
|
|
1133
|
+
[e]: parseFloat(a),
|
|
1134
|
+
[t]: parseFloat(s),
|
|
1121
1135
|
alpha: o !== void 0 ? parseFloat(o) : 1
|
|
1122
1136
|
};
|
|
1123
|
-
},
|
|
1124
|
-
transform: (n) => Math.round(
|
|
1137
|
+
}, Va = (n) => xe(0, 255, n), wt = I(v({}, Ne), {
|
|
1138
|
+
transform: (n) => Math.round(Va(n))
|
|
1125
1139
|
}), ye = {
|
|
1126
1140
|
test: /* @__PURE__ */ on("rgb", "red"),
|
|
1127
|
-
parse: /* @__PURE__ */
|
|
1141
|
+
parse: /* @__PURE__ */ Vi("red", "green", "blue"),
|
|
1128
1142
|
transform: ({ red: n, green: e, blue: t, alpha: i = 1 }) => "rgba(" + wt.transform(n) + ", " + wt.transform(e) + ", " + wt.transform(t) + ", " + We(Qe.transform(i)) + ")"
|
|
1129
1143
|
};
|
|
1130
|
-
function
|
|
1144
|
+
function Ia(n) {
|
|
1131
1145
|
let e = "", t = "", i = "", r = "";
|
|
1132
1146
|
return n.length > 5 ? (e = n.substring(1, 3), t = n.substring(3, 5), i = n.substring(5, 7), r = n.substring(7, 9)) : (e = n.substring(1, 2), t = n.substring(2, 3), i = n.substring(3, 4), r = n.substring(4, 5), e += e, t += t, i += i, r += r), {
|
|
1133
1147
|
red: parseInt(e, 16),
|
|
@@ -1138,81 +1152,81 @@ function Is(n) {
|
|
|
1138
1152
|
}
|
|
1139
1153
|
const Ot = {
|
|
1140
1154
|
test: /* @__PURE__ */ on("#"),
|
|
1141
|
-
parse:
|
|
1155
|
+
parse: Ia,
|
|
1142
1156
|
transform: ye.transform
|
|
1143
1157
|
}, rt = /* @__NO_SIDE_EFFECTS__ */ (n) => ({
|
|
1144
1158
|
test: (e) => typeof e == "string" && e.endsWith(n) && e.split(" ").length === 1,
|
|
1145
1159
|
parse: parseFloat,
|
|
1146
1160
|
transform: (e) => `${e}${n}`
|
|
1147
|
-
}), me = /* @__PURE__ */ rt("deg"), Me = /* @__PURE__ */ rt("%"), L = /* @__PURE__ */ rt("px"),
|
|
1161
|
+
}), me = /* @__PURE__ */ rt("deg"), Me = /* @__PURE__ */ rt("%"), L = /* @__PURE__ */ rt("px"), Ma = /* @__PURE__ */ rt("vh"), Pa = /* @__PURE__ */ rt("vw"), Dn = I(v({}, Me), {
|
|
1148
1162
|
parse: (n) => Me.parse(n) / 100,
|
|
1149
1163
|
transform: (n) => Me.transform(n * 100)
|
|
1150
1164
|
}), Ve = {
|
|
1151
1165
|
test: /* @__PURE__ */ on("hsl", "hue"),
|
|
1152
|
-
parse: /* @__PURE__ */
|
|
1166
|
+
parse: /* @__PURE__ */ Vi("hue", "saturation", "lightness"),
|
|
1153
1167
|
transform: ({ hue: n, saturation: e, lightness: t, alpha: i = 1 }) => "hsla(" + Math.round(n) + ", " + Me.transform(We(e)) + ", " + Me.transform(We(t)) + ", " + We(Qe.transform(i)) + ")"
|
|
1154
1168
|
}, U = {
|
|
1155
1169
|
test: (n) => ye.test(n) || Ot.test(n) || Ve.test(n),
|
|
1156
1170
|
parse: (n) => ye.test(n) ? ye.parse(n) : Ve.test(n) ? Ve.parse(n) : Ot.parse(n),
|
|
1157
1171
|
transform: (n) => typeof n == "string" ? n : n.hasOwnProperty("red") ? ye.transform(n) : Ve.transform(n)
|
|
1158
|
-
},
|
|
1159
|
-
function
|
|
1172
|
+
}, Da = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;
|
|
1173
|
+
function Ra(n) {
|
|
1160
1174
|
var e, t;
|
|
1161
|
-
return isNaN(n) && typeof n == "string" && (((e = n.match(
|
|
1175
|
+
return isNaN(n) && typeof n == "string" && (((e = n.match(sn)) == null ? void 0 : e.length) || 0) + (((t = n.match(Da)) == null ? void 0 : t.length) || 0) > 0;
|
|
1162
1176
|
}
|
|
1163
|
-
const
|
|
1177
|
+
const Ii = "number", Mi = "color", Oa = "var", Na = "var(", Rn = "${}", Sa = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;
|
|
1164
1178
|
function et(n) {
|
|
1165
1179
|
const e = n.toString(), t = [], i = {
|
|
1166
1180
|
color: [],
|
|
1167
1181
|
number: [],
|
|
1168
1182
|
var: []
|
|
1169
1183
|
}, r = [];
|
|
1170
|
-
let
|
|
1171
|
-
const o = e.replace(
|
|
1184
|
+
let a = 0;
|
|
1185
|
+
const o = e.replace(Sa, (l) => (U.test(l) ? (i.color.push(a), r.push(Mi), t.push(U.parse(l))) : l.startsWith(Na) ? (i.var.push(a), r.push(Oa), t.push(l)) : (i.number.push(a), r.push(Ii), t.push(parseFloat(l))), ++a, Rn)).split(Rn);
|
|
1172
1186
|
return { values: t, split: o, indexes: i, types: r };
|
|
1173
1187
|
}
|
|
1174
|
-
function
|
|
1188
|
+
function Pi(n) {
|
|
1175
1189
|
return et(n).values;
|
|
1176
1190
|
}
|
|
1177
|
-
function
|
|
1191
|
+
function Di(n) {
|
|
1178
1192
|
const { split: e, types: t } = et(n), i = e.length;
|
|
1179
1193
|
return (r) => {
|
|
1180
|
-
let
|
|
1181
|
-
for (let
|
|
1182
|
-
if (
|
|
1183
|
-
const o = t[
|
|
1184
|
-
o ===
|
|
1194
|
+
let a = "";
|
|
1195
|
+
for (let s = 0; s < i; s++)
|
|
1196
|
+
if (a += e[s], r[s] !== void 0) {
|
|
1197
|
+
const o = t[s];
|
|
1198
|
+
o === Ii ? a += We(r[s]) : o === Mi ? a += U.transform(r[s]) : a += r[s];
|
|
1185
1199
|
}
|
|
1186
|
-
return
|
|
1200
|
+
return a;
|
|
1187
1201
|
};
|
|
1188
1202
|
}
|
|
1189
|
-
const
|
|
1190
|
-
function
|
|
1191
|
-
const e =
|
|
1192
|
-
return
|
|
1203
|
+
const Fa = (n) => typeof n == "number" ? 0 : n;
|
|
1204
|
+
function ja(n) {
|
|
1205
|
+
const e = Pi(n);
|
|
1206
|
+
return Di(n)(e.map(Fa));
|
|
1193
1207
|
}
|
|
1194
1208
|
const Se = {
|
|
1195
|
-
test:
|
|
1196
|
-
parse:
|
|
1197
|
-
createTransformer:
|
|
1198
|
-
getAnimatableNone:
|
|
1209
|
+
test: Ra,
|
|
1210
|
+
parse: Pi,
|
|
1211
|
+
createTransformer: Di,
|
|
1212
|
+
getAnimatableNone: ja
|
|
1199
1213
|
};
|
|
1200
1214
|
function Tt(n, e, t) {
|
|
1201
1215
|
return t < 0 && (t += 1), t > 1 && (t -= 1), t < 1 / 6 ? n + (e - n) * 6 * t : t < 1 / 2 ? e : t < 2 / 3 ? n + (e - n) * (2 / 3 - t) * 6 : n;
|
|
1202
1216
|
}
|
|
1203
|
-
function
|
|
1217
|
+
function Ba({ hue: n, saturation: e, lightness: t, alpha: i }) {
|
|
1204
1218
|
n /= 360, e /= 100, t /= 100;
|
|
1205
|
-
let r = 0,
|
|
1219
|
+
let r = 0, a = 0, s = 0;
|
|
1206
1220
|
if (!e)
|
|
1207
|
-
r =
|
|
1221
|
+
r = a = s = t;
|
|
1208
1222
|
else {
|
|
1209
1223
|
const o = t < 0.5 ? t * (1 + e) : t + e - t * e, l = 2 * t - o;
|
|
1210
|
-
r = Tt(l, o, n + 1 / 3),
|
|
1224
|
+
r = Tt(l, o, n + 1 / 3), a = Tt(l, o, n), s = Tt(l, o, n - 1 / 3);
|
|
1211
1225
|
}
|
|
1212
1226
|
return {
|
|
1213
1227
|
red: Math.round(r * 255),
|
|
1214
|
-
green: Math.round(
|
|
1215
|
-
blue: Math.round(
|
|
1228
|
+
green: Math.round(a * 255),
|
|
1229
|
+
blue: Math.round(s * 255),
|
|
1216
1230
|
alpha: i
|
|
1217
1231
|
};
|
|
1218
1232
|
}
|
|
@@ -1222,66 +1236,66 @@ function gt(n, e) {
|
|
|
1222
1236
|
const At = (n, e, t) => {
|
|
1223
1237
|
const i = n * n, r = t * (e * e - i) + i;
|
|
1224
1238
|
return r < 0 ? 0 : Math.sqrt(r);
|
|
1225
|
-
},
|
|
1226
|
-
function
|
|
1227
|
-
const e = $
|
|
1239
|
+
}, za = [Ot, ye, Ve], $a = (n) => za.find((e) => e.test(n));
|
|
1240
|
+
function On(n) {
|
|
1241
|
+
const e = $a(n);
|
|
1228
1242
|
if (it(!!e, `'${n}' is not an animatable color. Use the equivalent color code instead.`), !e)
|
|
1229
1243
|
return !1;
|
|
1230
1244
|
let t = e.parse(n);
|
|
1231
|
-
return e === Ve && (t =
|
|
1245
|
+
return e === Ve && (t = Ba(t)), t;
|
|
1232
1246
|
}
|
|
1233
|
-
const
|
|
1234
|
-
const t =
|
|
1247
|
+
const Nn = (n, e) => {
|
|
1248
|
+
const t = On(n), i = On(e);
|
|
1235
1249
|
if (!t || !i)
|
|
1236
1250
|
return gt(n, e);
|
|
1237
1251
|
const r = v({}, t);
|
|
1238
|
-
return (
|
|
1252
|
+
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));
|
|
1239
1253
|
}, Nt = /* @__PURE__ */ new Set(["none", "hidden"]);
|
|
1240
|
-
function
|
|
1254
|
+
function Ka(n, e) {
|
|
1241
1255
|
return Nt.has(n) ? (t) => t <= 0 ? n : e : (t) => t >= 1 ? e : n;
|
|
1242
1256
|
}
|
|
1243
|
-
const
|
|
1244
|
-
function
|
|
1257
|
+
const qa = (n, e) => (t) => e(n(t)), ln = (...n) => n.reduce(qa);
|
|
1258
|
+
function Ga(n, e) {
|
|
1245
1259
|
return (t) => nt(n, e, t);
|
|
1246
1260
|
}
|
|
1247
1261
|
function cn(n) {
|
|
1248
|
-
return typeof n == "number" ?
|
|
1262
|
+
return typeof n == "number" ? Ga : typeof n == "string" ? an(n) ? gt : U.test(n) ? Nn : Ua : Array.isArray(n) ? Ri : typeof n == "object" ? U.test(n) ? Nn : Ha : gt;
|
|
1249
1263
|
}
|
|
1250
|
-
function
|
|
1251
|
-
const t = [...n], i = t.length, r = n.map((
|
|
1252
|
-
return (
|
|
1253
|
-
for (let
|
|
1254
|
-
t[
|
|
1264
|
+
function Ri(n, e) {
|
|
1265
|
+
const t = [...n], i = t.length, r = n.map((a, s) => cn(a)(a, e[s]));
|
|
1266
|
+
return (a) => {
|
|
1267
|
+
for (let s = 0; s < i; s++)
|
|
1268
|
+
t[s] = r[s](a);
|
|
1255
1269
|
return t;
|
|
1256
1270
|
};
|
|
1257
1271
|
}
|
|
1258
|
-
function
|
|
1272
|
+
function Ha(n, e) {
|
|
1259
1273
|
const t = v(v({}, n), e), i = {};
|
|
1260
1274
|
for (const r in t)
|
|
1261
1275
|
n[r] !== void 0 && e[r] !== void 0 && (i[r] = cn(n[r])(n[r], e[r]));
|
|
1262
1276
|
return (r) => {
|
|
1263
|
-
for (const
|
|
1264
|
-
t[
|
|
1277
|
+
for (const a in i)
|
|
1278
|
+
t[a] = i[a](r);
|
|
1265
1279
|
return t;
|
|
1266
1280
|
};
|
|
1267
1281
|
}
|
|
1268
|
-
function
|
|
1282
|
+
function Ya(n, e) {
|
|
1269
1283
|
var r;
|
|
1270
1284
|
const t = [], i = { color: 0, var: 0, number: 0 };
|
|
1271
|
-
for (let
|
|
1272
|
-
const
|
|
1273
|
-
t[
|
|
1285
|
+
for (let a = 0; a < e.values.length; a++) {
|
|
1286
|
+
const s = e.types[a], o = n.indexes[s][i[s]], l = (r = n.values[o]) != null ? r : 0;
|
|
1287
|
+
t[a] = l, i[s]++;
|
|
1274
1288
|
}
|
|
1275
1289
|
return t;
|
|
1276
1290
|
}
|
|
1277
|
-
const
|
|
1291
|
+
const Ua = (n, e) => {
|
|
1278
1292
|
const t = Se.createTransformer(e), i = et(n), r = et(e);
|
|
1279
|
-
return i.indexes.var.length === r.indexes.var.length && i.indexes.color.length === r.indexes.color.length && i.indexes.number.length >= r.indexes.number.length ? Nt.has(n) && !r.values.length || Nt.has(e) && !i.values.length ?
|
|
1293
|
+
return i.indexes.var.length === r.indexes.var.length && i.indexes.color.length === r.indexes.color.length && i.indexes.number.length >= r.indexes.number.length ? Nt.has(n) && !r.values.length || Nt.has(e) && !i.values.length ? Ka(n, e) : ln(Ri(Ya(i, r), r.values), t) : (it(!0, `Complex values '${n}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`), gt(n, e));
|
|
1280
1294
|
};
|
|
1281
|
-
function
|
|
1295
|
+
function Oi(n, e, t) {
|
|
1282
1296
|
return typeof n == "number" && typeof e == "number" && typeof t == "number" ? nt(n, e, t) : cn(n)(n, e);
|
|
1283
1297
|
}
|
|
1284
|
-
const
|
|
1298
|
+
const Wa = (n) => {
|
|
1285
1299
|
const e = ({ timestamp: t }) => n(t);
|
|
1286
1300
|
return {
|
|
1287
1301
|
start: (t = !0) => ue.update(e, t),
|
|
@@ -1292,16 +1306,16 @@ const Ws = (n) => {
|
|
|
1292
1306
|
*/
|
|
1293
1307
|
now: () => ft.isProcessing ? ft.timestamp : ee.now()
|
|
1294
1308
|
};
|
|
1295
|
-
},
|
|
1309
|
+
}, Ni = (n, e, t = 10) => {
|
|
1296
1310
|
let i = "";
|
|
1297
1311
|
const r = Math.max(Math.round(e / t), 2);
|
|
1298
|
-
for (let
|
|
1299
|
-
i += n(
|
|
1312
|
+
for (let a = 0; a < r; a++)
|
|
1313
|
+
i += n(a / (r - 1)) + ", ";
|
|
1300
1314
|
return `linear(${i.substring(0, i.length - 2)})`;
|
|
1301
|
-
},
|
|
1302
|
-
function
|
|
1303
|
-
const i = Math.max(e -
|
|
1304
|
-
return
|
|
1315
|
+
}, Za = 5;
|
|
1316
|
+
function Si(n, e, t) {
|
|
1317
|
+
const i = Math.max(e - Za, 0);
|
|
1318
|
+
return Ti(t - n(i), e - i);
|
|
1305
1319
|
}
|
|
1306
1320
|
const B = {
|
|
1307
1321
|
// Default spring physics
|
|
@@ -1332,25 +1346,25 @@ const B = {
|
|
|
1332
1346
|
minDamping: 0.05,
|
|
1333
1347
|
maxDamping: 1
|
|
1334
1348
|
}, _t = 1e-3;
|
|
1335
|
-
function
|
|
1336
|
-
let r,
|
|
1337
|
-
it(n <= /* @__PURE__ */
|
|
1338
|
-
let
|
|
1339
|
-
|
|
1340
|
-
const d = u *
|
|
1349
|
+
function Ja({ duration: n = B.duration, bounce: e = B.bounce, velocity: t = B.velocity, mass: i = B.mass }) {
|
|
1350
|
+
let r, a;
|
|
1351
|
+
it(n <= /* @__PURE__ */ se(B.maxDuration), "Spring duration must be 10 seconds or less");
|
|
1352
|
+
let s = 1 - e;
|
|
1353
|
+
s = xe(B.minDamping, B.maxDamping, s), n = xe(B.minDuration, B.maxDuration, /* @__PURE__ */ le(n)), s < 1 ? (r = (u) => {
|
|
1354
|
+
const d = u * s, h = d * n, m = d - t, p = St(u, s), g = Math.exp(-h);
|
|
1341
1355
|
return _t - m / p * g;
|
|
1342
|
-
},
|
|
1343
|
-
const h = u *
|
|
1356
|
+
}, a = (u) => {
|
|
1357
|
+
const h = u * s * n, m = h * t + t, p = Math.pow(s, 2) * Math.pow(u, 2) * n, g = Math.exp(-h), b = St(Math.pow(u, 2), s);
|
|
1344
1358
|
return (-r(u) + _t > 0 ? -1 : 1) * ((m - p) * g) / b;
|
|
1345
1359
|
}) : (r = (u) => {
|
|
1346
1360
|
const d = Math.exp(-u * n), h = (u - t) * n + 1;
|
|
1347
1361
|
return -_t + d * h;
|
|
1348
|
-
},
|
|
1362
|
+
}, a = (u) => {
|
|
1349
1363
|
const d = Math.exp(-u * n), h = (t - u) * (n * n);
|
|
1350
1364
|
return d * h;
|
|
1351
1365
|
});
|
|
1352
|
-
const o = 5 / n, l =
|
|
1353
|
-
if (n = /* @__PURE__ */
|
|
1366
|
+
const o = 5 / n, l = Qa(r, a, o);
|
|
1367
|
+
if (n = /* @__PURE__ */ se(n), isNaN(l))
|
|
1354
1368
|
return {
|
|
1355
1369
|
stiffness: B.stiffness,
|
|
1356
1370
|
damping: B.damping,
|
|
@@ -1360,26 +1374,26 @@ function Js({ duration: n = B.duration, bounce: e = B.bounce, velocity: t = B.ve
|
|
|
1360
1374
|
const u = Math.pow(l, 2) * i;
|
|
1361
1375
|
return {
|
|
1362
1376
|
stiffness: u,
|
|
1363
|
-
damping:
|
|
1377
|
+
damping: s * 2 * Math.sqrt(i * u),
|
|
1364
1378
|
duration: n
|
|
1365
1379
|
};
|
|
1366
1380
|
}
|
|
1367
1381
|
}
|
|
1368
|
-
const
|
|
1369
|
-
function
|
|
1382
|
+
const Xa = 12;
|
|
1383
|
+
function Qa(n, e, t) {
|
|
1370
1384
|
let i = t;
|
|
1371
|
-
for (let r = 1; r <
|
|
1385
|
+
for (let r = 1; r < Xa; r++)
|
|
1372
1386
|
i = i - n(i) / e(i);
|
|
1373
1387
|
return i;
|
|
1374
1388
|
}
|
|
1375
1389
|
function St(n, e) {
|
|
1376
1390
|
return n * Math.sqrt(1 - e * e);
|
|
1377
1391
|
}
|
|
1378
|
-
const
|
|
1379
|
-
function
|
|
1392
|
+
const es = ["duration", "bounce"], ts = ["stiffness", "damping", "mass"];
|
|
1393
|
+
function Sn(n, e) {
|
|
1380
1394
|
return e.some((t) => n[t] !== void 0);
|
|
1381
1395
|
}
|
|
1382
|
-
function
|
|
1396
|
+
function ns(n) {
|
|
1383
1397
|
let e = v({
|
|
1384
1398
|
velocity: B.velocity,
|
|
1385
1399
|
stiffness: B.stiffness,
|
|
@@ -1387,16 +1401,16 @@ function na(n) {
|
|
|
1387
1401
|
mass: B.mass,
|
|
1388
1402
|
isResolvedFromDuration: !1
|
|
1389
1403
|
}, n);
|
|
1390
|
-
if (!
|
|
1404
|
+
if (!Sn(n, ts) && Sn(n, es))
|
|
1391
1405
|
if (n.visualDuration) {
|
|
1392
|
-
const t = n.visualDuration, i = 2 * Math.PI / (t * 1.2), r = i * i,
|
|
1406
|
+
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);
|
|
1393
1407
|
e = I(v({}, e), {
|
|
1394
1408
|
mass: B.mass,
|
|
1395
1409
|
stiffness: r,
|
|
1396
|
-
damping:
|
|
1410
|
+
damping: a
|
|
1397
1411
|
});
|
|
1398
1412
|
} else {
|
|
1399
|
-
const t =
|
|
1413
|
+
const t = Ja(n);
|
|
1400
1414
|
e = I(v(v({}, e), t), {
|
|
1401
1415
|
mass: B.mass
|
|
1402
1416
|
}), e.isResolvedFromDuration = !0;
|
|
@@ -1410,24 +1424,24 @@ function tt(n = B.visualDuration, e = B.bounce) {
|
|
|
1410
1424
|
bounce: e
|
|
1411
1425
|
} : n;
|
|
1412
1426
|
let { restSpeed: i, restDelta: r } = t;
|
|
1413
|
-
const
|
|
1427
|
+
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(I(v({}, t), {
|
|
1414
1428
|
velocity: -/* @__PURE__ */ le(t.velocity || 0)
|
|
1415
|
-
})), g = m || 0, b = u / (2 * Math.sqrt(l * d)), y =
|
|
1429
|
+
})), g = m || 0, b = u / (2 * Math.sqrt(l * d)), y = s - a, k = /* @__PURE__ */ le(Math.sqrt(l / d)), V = Math.abs(y) < 5;
|
|
1416
1430
|
i || (i = V ? B.restSpeed.granular : B.restSpeed.default), r || (r = V ? B.restDelta.granular : B.restDelta.default);
|
|
1417
1431
|
let _;
|
|
1418
1432
|
if (b < 1) {
|
|
1419
1433
|
const T = St(k, b);
|
|
1420
1434
|
_ = (D) => {
|
|
1421
1435
|
const C = Math.exp(-b * k * D);
|
|
1422
|
-
return
|
|
1436
|
+
return s - C * ((g + b * k * y) / T * Math.sin(T * D) + y * Math.cos(T * D));
|
|
1423
1437
|
};
|
|
1424
1438
|
} else if (b === 1)
|
|
1425
|
-
_ = (T) =>
|
|
1439
|
+
_ = (T) => s - Math.exp(-k * T) * (y + (g + k * y) * T);
|
|
1426
1440
|
else {
|
|
1427
1441
|
const T = k * Math.sqrt(b * b - 1);
|
|
1428
1442
|
_ = (D) => {
|
|
1429
1443
|
const C = Math.exp(-b * k * D), w = Math.min(T * D, 300);
|
|
1430
|
-
return
|
|
1444
|
+
return s - C * ((g + b * k * y) * Math.sinh(w) + T * y * Math.cosh(w)) / T;
|
|
1431
1445
|
};
|
|
1432
1446
|
}
|
|
1433
1447
|
const M = {
|
|
@@ -1438,14 +1452,14 @@ function tt(n = B.visualDuration, e = B.bounce) {
|
|
|
1438
1452
|
o.done = T >= h;
|
|
1439
1453
|
else {
|
|
1440
1454
|
let C = T === 0 ? g : 0;
|
|
1441
|
-
b < 1 && (C = T === 0 ? /* @__PURE__ */
|
|
1442
|
-
const w = Math.abs(C) <= i, R = Math.abs(
|
|
1455
|
+
b < 1 && (C = T === 0 ? /* @__PURE__ */ se(g) : Si(_, T, D));
|
|
1456
|
+
const w = Math.abs(C) <= i, R = Math.abs(s - D) <= r;
|
|
1443
1457
|
o.done = w && R;
|
|
1444
1458
|
}
|
|
1445
|
-
return o.value = o.done ?
|
|
1459
|
+
return o.value = o.done ? s : D, o;
|
|
1446
1460
|
},
|
|
1447
1461
|
toString: () => {
|
|
1448
|
-
const T = Math.min(nn(M), mt), D =
|
|
1462
|
+
const T = Math.min(nn(M), mt), D = Ni((C) => M.next(T * C).value, T, 30);
|
|
1449
1463
|
return T + "ms " + D;
|
|
1450
1464
|
},
|
|
1451
1465
|
toTransition: () => {
|
|
@@ -1454,16 +1468,16 @@ function tt(n = B.visualDuration, e = B.bounce) {
|
|
|
1454
1468
|
return M;
|
|
1455
1469
|
}
|
|
1456
1470
|
tt.applyToOptions = (n) => {
|
|
1457
|
-
const e =
|
|
1458
|
-
return n.ease = e.ease, n.duration = /* @__PURE__ */
|
|
1471
|
+
const e = Ei(n, 100, tt);
|
|
1472
|
+
return n.ease = e.ease, n.duration = /* @__PURE__ */ se(e.duration), n.type = "keyframes", n;
|
|
1459
1473
|
};
|
|
1460
|
-
function Ft({ keyframes: n, velocity: e = 0, power: t = 0.8, timeConstant: i = 325, bounceDamping: r = 10, bounceStiffness:
|
|
1474
|
+
function Ft({ keyframes: n, velocity: e = 0, power: t = 0.8, timeConstant: i = 325, bounceDamping: r = 10, bounceStiffness: a = 500, modifyTarget: s, min: o, max: l, restDelta: u = 0.5, restSpeed: d }) {
|
|
1461
1475
|
const h = n[0], m = {
|
|
1462
1476
|
done: !1,
|
|
1463
1477
|
value: h
|
|
1464
1478
|
}, p = (w) => o !== void 0 && w < o || l !== void 0 && w > l, g = (w) => o === void 0 ? l : l === void 0 || Math.abs(o - w) < Math.abs(l - w) ? o : l;
|
|
1465
1479
|
let b = t * e;
|
|
1466
|
-
const y = h + b, k =
|
|
1480
|
+
const y = h + b, k = s === void 0 ? y : s(y);
|
|
1467
1481
|
k !== y && (b = k - h);
|
|
1468
1482
|
const V = (w) => -b * Math.exp(-w / i), _ = (w) => k + V(w), M = (w) => {
|
|
1469
1483
|
const R = V(w), O = _(w);
|
|
@@ -1473,10 +1487,10 @@ function Ft({ keyframes: n, velocity: e = 0, power: t = 0.8, timeConstant: i = 3
|
|
|
1473
1487
|
const C = (w) => {
|
|
1474
1488
|
p(m.value) && (T = w, D = tt({
|
|
1475
1489
|
keyframes: [m.value, g(m.value)],
|
|
1476
|
-
velocity:
|
|
1490
|
+
velocity: Si(_, w, m.value),
|
|
1477
1491
|
// TODO: This should be passing * 1000
|
|
1478
1492
|
damping: r,
|
|
1479
|
-
stiffness:
|
|
1493
|
+
stiffness: a,
|
|
1480
1494
|
restDelta: u,
|
|
1481
1495
|
restSpeed: d
|
|
1482
1496
|
}));
|
|
@@ -1489,28 +1503,28 @@ function Ft({ keyframes: n, velocity: e = 0, power: t = 0.8, timeConstant: i = 3
|
|
|
1489
1503
|
}
|
|
1490
1504
|
};
|
|
1491
1505
|
}
|
|
1492
|
-
function
|
|
1493
|
-
const i = [], r = t || de.mix ||
|
|
1494
|
-
for (let
|
|
1495
|
-
let o = r(n[
|
|
1506
|
+
function is(n, e, t) {
|
|
1507
|
+
const i = [], r = t || de.mix || Oi, a = n.length - 1;
|
|
1508
|
+
for (let s = 0; s < a; s++) {
|
|
1509
|
+
let o = r(n[s], n[s + 1]);
|
|
1496
1510
|
if (e) {
|
|
1497
|
-
const l = Array.isArray(e) ? e[
|
|
1511
|
+
const l = Array.isArray(e) ? e[s] || De : e;
|
|
1498
1512
|
o = ln(l, o);
|
|
1499
1513
|
}
|
|
1500
1514
|
i.push(o);
|
|
1501
1515
|
}
|
|
1502
1516
|
return i;
|
|
1503
1517
|
}
|
|
1504
|
-
function
|
|
1505
|
-
const
|
|
1506
|
-
if (ce(
|
|
1518
|
+
function rs(n, e, { clamp: t = !0, ease: i, mixer: r } = {}) {
|
|
1519
|
+
const a = n.length;
|
|
1520
|
+
if (ce(a === e.length, "Both input and output ranges must be the same length"), a === 1)
|
|
1507
1521
|
return () => e[0];
|
|
1508
|
-
if (
|
|
1522
|
+
if (a === 2 && e[0] === e[1])
|
|
1509
1523
|
return () => e[1];
|
|
1510
|
-
const
|
|
1511
|
-
n[0] > n[
|
|
1512
|
-
const o =
|
|
1513
|
-
if (
|
|
1524
|
+
const s = n[0] === n[1];
|
|
1525
|
+
n[0] > n[a - 1] && (n = [...n].reverse(), e = [...e].reverse());
|
|
1526
|
+
const o = is(e, i, r), l = o.length, u = (d) => {
|
|
1527
|
+
if (s && d < n[0])
|
|
1514
1528
|
return e[0];
|
|
1515
1529
|
let h = 0;
|
|
1516
1530
|
if (l > 1)
|
|
@@ -1519,80 +1533,80 @@ function ra(n, e, { clamp: t = !0, ease: i, mixer: r } = {}) {
|
|
|
1519
1533
|
const m = /* @__PURE__ */ en(n[h], n[h + 1], d);
|
|
1520
1534
|
return o[h](m);
|
|
1521
1535
|
};
|
|
1522
|
-
return t ? (d) => u(xe(n[0], n[
|
|
1536
|
+
return t ? (d) => u(xe(n[0], n[a - 1], d)) : u;
|
|
1523
1537
|
}
|
|
1524
|
-
function
|
|
1538
|
+
function as(n, e) {
|
|
1525
1539
|
return n.map((t) => t * e);
|
|
1526
1540
|
}
|
|
1527
|
-
const
|
|
1528
|
-
function
|
|
1529
|
-
let
|
|
1541
|
+
const Fi = (n, e, t) => (((1 - 3 * t + 3 * e) * n + (3 * t - 6 * e)) * n + 3 * e) * n, ss = 1e-7, os = 12;
|
|
1542
|
+
function ls(n, e, t, i, r) {
|
|
1543
|
+
let a, s, o = 0;
|
|
1530
1544
|
do
|
|
1531
|
-
|
|
1532
|
-
while (Math.abs(
|
|
1533
|
-
return
|
|
1545
|
+
s = e + (t - e) / 2, a = Fi(s, i, r) - n, a > 0 ? t = s : e = s;
|
|
1546
|
+
while (Math.abs(a) > ss && ++o < os);
|
|
1547
|
+
return s;
|
|
1534
1548
|
}
|
|
1535
|
-
function
|
|
1549
|
+
function at(n, e, t, i) {
|
|
1536
1550
|
if (n === e && t === i)
|
|
1537
1551
|
return De;
|
|
1538
|
-
const r = (
|
|
1539
|
-
return (
|
|
1552
|
+
const r = (a) => ls(a, 0, 1, n, t);
|
|
1553
|
+
return (a) => a === 0 || a === 1 ? a : Fi(r(a), e, i);
|
|
1540
1554
|
}
|
|
1541
|
-
const
|
|
1555
|
+
const cs = /* @__PURE__ */ at(0.42, 0, 1, 1), ds = /* @__PURE__ */ at(0, 0, 0.58, 1), ji = /* @__PURE__ */ at(0.42, 0, 0.58, 1), Bi = (n) => (e) => e <= 0.5 ? n(2 * e) / 2 : (2 - n(2 * (1 - e))) / 2, zi = (n) => (e) => 1 - n(1 - e), $i = /* @__PURE__ */ at(0.33, 1.53, 0.69, 0.99), dn = /* @__PURE__ */ zi($i), Ki = /* @__PURE__ */ Bi(dn), qi = (n) => (n *= 2) < 1 ? 0.5 * dn(n) : 0.5 * (2 - Math.pow(2, -10 * (n - 1))), un = (n) => 1 - Math.sin(Math.acos(n)), us = zi(un), Gi = Bi(un), Hi = (n) => Array.isArray(n) && typeof n[0] == "number", Fn = {
|
|
1542
1556
|
linear: De,
|
|
1543
|
-
easeIn:
|
|
1544
|
-
easeInOut:
|
|
1545
|
-
easeOut:
|
|
1557
|
+
easeIn: cs,
|
|
1558
|
+
easeInOut: ji,
|
|
1559
|
+
easeOut: ds,
|
|
1546
1560
|
circIn: un,
|
|
1547
|
-
circInOut:
|
|
1548
|
-
circOut:
|
|
1561
|
+
circInOut: Gi,
|
|
1562
|
+
circOut: us,
|
|
1549
1563
|
backIn: dn,
|
|
1550
|
-
backInOut:
|
|
1551
|
-
backOut:
|
|
1552
|
-
anticipate:
|
|
1553
|
-
},
|
|
1554
|
-
if (
|
|
1564
|
+
backInOut: Ki,
|
|
1565
|
+
backOut: $i,
|
|
1566
|
+
anticipate: qi
|
|
1567
|
+
}, hs = (n) => typeof n == "string", jn = (n) => {
|
|
1568
|
+
if (Hi(n)) {
|
|
1555
1569
|
ce(n.length === 4, "Cubic bezier arrays must contain four numerical values.");
|
|
1556
1570
|
const [e, t, i, r] = n;
|
|
1557
|
-
return
|
|
1558
|
-
} else if (
|
|
1559
|
-
return ce(
|
|
1571
|
+
return at(e, t, i, r);
|
|
1572
|
+
} else if (hs(n))
|
|
1573
|
+
return ce(Fn[n] !== void 0, `Invalid easing type '${n}'`), Fn[n];
|
|
1560
1574
|
return n;
|
|
1561
1575
|
};
|
|
1562
|
-
function
|
|
1563
|
-
return n.map(() => e ||
|
|
1576
|
+
function ps(n, e) {
|
|
1577
|
+
return n.map(() => e || ji).splice(0, n.length - 1);
|
|
1564
1578
|
}
|
|
1565
1579
|
function Ie({ duration: n = 300, keyframes: e, times: t, ease: i = "easeInOut" }) {
|
|
1566
|
-
const r =
|
|
1580
|
+
const r = gi(i) ? i.map(jn) : jn(i), a = {
|
|
1567
1581
|
done: !1,
|
|
1568
1582
|
value: e[0]
|
|
1569
|
-
},
|
|
1583
|
+
}, s = as(
|
|
1570
1584
|
// Only use the provided offsets if they're the correct length
|
|
1571
1585
|
// TODO Maybe we should warn here if there's a length mismatch
|
|
1572
|
-
t && t.length === e.length ? t :
|
|
1586
|
+
t && t.length === e.length ? t : Ci(e),
|
|
1573
1587
|
n
|
|
1574
|
-
), o =
|
|
1575
|
-
ease: Array.isArray(r) ? r :
|
|
1588
|
+
), o = rs(s, e, {
|
|
1589
|
+
ease: Array.isArray(r) ? r : ps(e, r)
|
|
1576
1590
|
});
|
|
1577
1591
|
return {
|
|
1578
1592
|
calculatedDuration: n,
|
|
1579
|
-
next: (l) => (
|
|
1593
|
+
next: (l) => (a.value = o(l), a.done = l >= n, a)
|
|
1580
1594
|
};
|
|
1581
1595
|
}
|
|
1582
|
-
const
|
|
1596
|
+
const ms = (n) => n !== null;
|
|
1583
1597
|
function hn(n, { repeat: e, repeatType: t = "loop" }, i, r = 1) {
|
|
1584
|
-
const
|
|
1585
|
-
return !o || i === void 0 ?
|
|
1598
|
+
const a = n.filter(ms), o = r < 0 || e && t !== "loop" && e % 2 === 1 ? 0 : a.length - 1;
|
|
1599
|
+
return !o || i === void 0 ? a[o] : i;
|
|
1586
1600
|
}
|
|
1587
|
-
const
|
|
1601
|
+
const fs = {
|
|
1588
1602
|
decay: Ft,
|
|
1589
1603
|
inertia: Ft,
|
|
1590
1604
|
tween: Ie,
|
|
1591
1605
|
keyframes: Ie,
|
|
1592
1606
|
spring: tt
|
|
1593
1607
|
};
|
|
1594
|
-
function
|
|
1595
|
-
typeof n.type == "string" && (n.type =
|
|
1608
|
+
function Yi(n) {
|
|
1609
|
+
typeof n.type == "string" && (n.type = fs[n.type]);
|
|
1596
1610
|
}
|
|
1597
1611
|
class pn {
|
|
1598
1612
|
constructor() {
|
|
@@ -1618,7 +1632,7 @@ class pn {
|
|
|
1618
1632
|
return this.finished.then(e, t);
|
|
1619
1633
|
}
|
|
1620
1634
|
}
|
|
1621
|
-
const
|
|
1635
|
+
const gs = (n) => n / 100;
|
|
1622
1636
|
class mn extends pn {
|
|
1623
1637
|
constructor(e) {
|
|
1624
1638
|
super(), this.state = "idle", this.startTime = null, this.isStopped = !1, this.currentTime = 0, this.holdTime = null, this.playbackSpeed = 1, this.stop = () => {
|
|
@@ -1629,15 +1643,15 @@ class mn extends pn {
|
|
|
1629
1643
|
}
|
|
1630
1644
|
initAnimation() {
|
|
1631
1645
|
const { options: e } = this;
|
|
1632
|
-
|
|
1633
|
-
const { type: t = Ie, repeat: i = 0, repeatDelay: r = 0, repeatType:
|
|
1646
|
+
Yi(e);
|
|
1647
|
+
const { type: t = Ie, repeat: i = 0, repeatDelay: r = 0, repeatType: a, velocity: s = 0 } = e;
|
|
1634
1648
|
let { keyframes: o } = e;
|
|
1635
1649
|
const l = t || Ie;
|
|
1636
|
-
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(
|
|
1650
|
+
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, Oi(o[0], o[1])), o = [0, 100]);
|
|
1637
1651
|
const u = l(I(v({}, e), { keyframes: o }));
|
|
1638
|
-
|
|
1652
|
+
a === "mirror" && (this.mirroredGenerator = l(I(v({}, e), {
|
|
1639
1653
|
keyframes: [...o].reverse(),
|
|
1640
|
-
velocity: -
|
|
1654
|
+
velocity: -s
|
|
1641
1655
|
}))), u.calculatedDuration === null && (u.calculatedDuration = nn(u));
|
|
1642
1656
|
const { calculatedDuration: d } = u;
|
|
1643
1657
|
this.calculatedDuration = d, this.resolvedDuration = d + r, this.totalDuration = this.resolvedDuration * (i + 1) - r, this.generator = u;
|
|
@@ -1647,7 +1661,7 @@ class mn extends pn {
|
|
|
1647
1661
|
this.holdTime !== null ? this.currentTime = this.holdTime : this.currentTime = t;
|
|
1648
1662
|
}
|
|
1649
1663
|
tick(e, t = !1) {
|
|
1650
|
-
const { generator: i, totalDuration: r, mixKeyframes:
|
|
1664
|
+
const { generator: i, totalDuration: r, mixKeyframes: a, mirroredGenerator: s, resolvedDuration: o, calculatedDuration: l } = this;
|
|
1651
1665
|
if (this.startTime === null)
|
|
1652
1666
|
return i.next(0);
|
|
1653
1667
|
const { delay: u = 0, keyframes: d, repeat: h, repeatType: m, repeatDelay: p, type: g, onUpdate: b, finalKeyframe: y } = this.options;
|
|
@@ -1658,10 +1672,10 @@ class mn extends pn {
|
|
|
1658
1672
|
if (h) {
|
|
1659
1673
|
const w = Math.min(this.currentTime, r) / o;
|
|
1660
1674
|
let R = Math.floor(w), O = w % 1;
|
|
1661
|
-
!O && w >= 1 && (O = 1), O === 1 && R--, R = Math.min(R, h + 1), !!(R % 2) && (m === "reverse" ? (O = 1 - O, p && (O -= p / o)) : m === "mirror" && (M =
|
|
1675
|
+
!O && w >= 1 && (O = 1), O === 1 && R--, R = Math.min(R, h + 1), !!(R % 2) && (m === "reverse" ? (O = 1 - O, p && (O -= p / o)) : m === "mirror" && (M = s)), _ = xe(0, 1, O) * o;
|
|
1662
1676
|
}
|
|
1663
1677
|
const T = V ? { done: !1, value: d[0] } : M.next(_);
|
|
1664
|
-
|
|
1678
|
+
a && (T.value = a(T.value));
|
|
1665
1679
|
let { done: D } = T;
|
|
1666
1680
|
!V && l !== null && (D = this.playbackSpeed >= 0 ? this.currentTime >= r : this.currentTime <= 0);
|
|
1667
1681
|
const C = this.holdTime === null && (this.state === "finished" || this.state === "running" && D);
|
|
@@ -1683,7 +1697,7 @@ class mn extends pn {
|
|
|
1683
1697
|
}
|
|
1684
1698
|
set time(e) {
|
|
1685
1699
|
var t;
|
|
1686
|
-
e = /* @__PURE__ */
|
|
1700
|
+
e = /* @__PURE__ */ se(e), this.currentTime = e, this.startTime === null || this.holdTime !== null || this.playbackSpeed === 0 ? this.holdTime = e : this.driver && (this.startTime = this.driver.now() - e / this.playbackSpeed), (t = this.driver) == null || t.start(!1);
|
|
1687
1701
|
}
|
|
1688
1702
|
get speed() {
|
|
1689
1703
|
return this.playbackSpeed;
|
|
@@ -1694,11 +1708,11 @@ class mn extends pn {
|
|
|
1694
1708
|
this.playbackSpeed = e, t && (this.time = /* @__PURE__ */ le(this.currentTime));
|
|
1695
1709
|
}
|
|
1696
1710
|
play() {
|
|
1697
|
-
var r,
|
|
1711
|
+
var r, a;
|
|
1698
1712
|
if (this.isStopped)
|
|
1699
1713
|
return;
|
|
1700
|
-
const { driver: e =
|
|
1701
|
-
this.driver || (this.driver = e((
|
|
1714
|
+
const { driver: e = Wa, startTime: t } = this.options;
|
|
1715
|
+
this.driver || (this.driver = e((s) => this.tick(s))), (a = (r = this.options).onPlay) == null || a.call(r);
|
|
1702
1716
|
const i = this.driver.now();
|
|
1703
1717
|
this.state === "finished" ? (this.updateFinished(), this.startTime = i) : this.holdTime !== null ? this.startTime = i - this.holdTime : this.startTime || (this.startTime = t != null ? t : i), this.state === "finished" && this.speed < 0 && (this.startTime += this.calculatedDuration), this.holdTime = null, this.state = "running", this.driver.start();
|
|
1704
1718
|
}
|
|
@@ -1730,7 +1744,7 @@ class mn extends pn {
|
|
|
1730
1744
|
return this.options.allowFlatten && (this.options.type = "keyframes", this.options.ease = "linear", this.initAnimation()), (t = this.driver) == null || t.stop(), e.observe(this);
|
|
1731
1745
|
}
|
|
1732
1746
|
}
|
|
1733
|
-
function
|
|
1747
|
+
function bs(n) {
|
|
1734
1748
|
var e;
|
|
1735
1749
|
for (let t = 1; t < n.length; t++)
|
|
1736
1750
|
(e = n[t]) != null || (n[t] = n[t - 1]);
|
|
@@ -1738,7 +1752,7 @@ function ba(n) {
|
|
|
1738
1752
|
const Ce = (n) => n * 180 / Math.PI, jt = (n) => {
|
|
1739
1753
|
const e = Ce(Math.atan2(n[1], n[0]));
|
|
1740
1754
|
return Bt(e);
|
|
1741
|
-
},
|
|
1755
|
+
}, vs = {
|
|
1742
1756
|
x: 4,
|
|
1743
1757
|
y: 5,
|
|
1744
1758
|
translateX: 4,
|
|
@@ -1751,20 +1765,20 @@ const Ce = (n) => n * 180 / Math.PI, jt = (n) => {
|
|
|
1751
1765
|
skewX: (n) => Ce(Math.atan(n[1])),
|
|
1752
1766
|
skewY: (n) => Ce(Math.atan(n[2])),
|
|
1753
1767
|
skew: (n) => (Math.abs(n[1]) + Math.abs(n[2])) / 2
|
|
1754
|
-
}, Bt = (n) => (n = n % 360, n < 0 && (n += 360), n),
|
|
1768
|
+
}, Bt = (n) => (n = n % 360, n < 0 && (n += 360), n), Bn = jt, zn = (n) => Math.sqrt(n[0] * n[0] + n[1] * n[1]), $n = (n) => Math.sqrt(n[4] * n[4] + n[5] * n[5]), ys = {
|
|
1755
1769
|
x: 12,
|
|
1756
1770
|
y: 13,
|
|
1757
1771
|
z: 14,
|
|
1758
1772
|
translateX: 12,
|
|
1759
1773
|
translateY: 13,
|
|
1760
1774
|
translateZ: 14,
|
|
1761
|
-
scaleX:
|
|
1762
|
-
scaleY:
|
|
1763
|
-
scale: (n) => (
|
|
1775
|
+
scaleX: zn,
|
|
1776
|
+
scaleY: $n,
|
|
1777
|
+
scale: (n) => (zn(n) + $n(n)) / 2,
|
|
1764
1778
|
rotateX: (n) => Bt(Ce(Math.atan2(n[6], n[5]))),
|
|
1765
1779
|
rotateY: (n) => Bt(Ce(Math.atan2(-n[2], n[0]))),
|
|
1766
|
-
rotateZ:
|
|
1767
|
-
rotate:
|
|
1780
|
+
rotateZ: Bn,
|
|
1781
|
+
rotate: Bn,
|
|
1768
1782
|
skewX: (n) => Ce(Math.atan(n[4])),
|
|
1769
1783
|
skewY: (n) => Ce(Math.atan(n[1])),
|
|
1770
1784
|
skew: (n) => (Math.abs(n[1]) + Math.abs(n[4])) / 2
|
|
@@ -1778,32 +1792,32 @@ function $t(n, e) {
|
|
|
1778
1792
|
const t = n.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);
|
|
1779
1793
|
let i, r;
|
|
1780
1794
|
if (t)
|
|
1781
|
-
i =
|
|
1795
|
+
i = ys, r = t;
|
|
1782
1796
|
else {
|
|
1783
1797
|
const o = n.match(/^matrix\(([-\d.e\s,]+)\)$/u);
|
|
1784
|
-
i =
|
|
1798
|
+
i = vs, r = o;
|
|
1785
1799
|
}
|
|
1786
1800
|
if (!r)
|
|
1787
1801
|
return zt(e);
|
|
1788
|
-
const
|
|
1789
|
-
return typeof
|
|
1802
|
+
const a = i[e], s = r[1].split(",").map(Es);
|
|
1803
|
+
return typeof a == "function" ? a(s) : s[a];
|
|
1790
1804
|
}
|
|
1791
|
-
const
|
|
1805
|
+
const Cs = (n, e) => {
|
|
1792
1806
|
const { transform: t = "none" } = getComputedStyle(n);
|
|
1793
1807
|
return $t(t, e);
|
|
1794
1808
|
};
|
|
1795
|
-
function
|
|
1809
|
+
function Es(n) {
|
|
1796
1810
|
return parseFloat(n.trim());
|
|
1797
1811
|
}
|
|
1798
|
-
const
|
|
1799
|
-
function
|
|
1812
|
+
const Kn = (n) => n === Ne || n === L, ks = /* @__PURE__ */ new Set(["x", "y", "z"]), xs = Re.filter((n) => !ks.has(n));
|
|
1813
|
+
function ws(n) {
|
|
1800
1814
|
const e = [];
|
|
1801
|
-
return
|
|
1815
|
+
return xs.forEach((t) => {
|
|
1802
1816
|
const i = n.getValue(t);
|
|
1803
1817
|
i !== void 0 && (e.push([t, i.get()]), i.set(t.startsWith("scale") ? 1 : 0));
|
|
1804
1818
|
}), e;
|
|
1805
1819
|
}
|
|
1806
|
-
const
|
|
1820
|
+
const Ee = {
|
|
1807
1821
|
// Dimensions
|
|
1808
1822
|
width: ({ x: n }, { paddingLeft: e = "0", paddingRight: t = "0" }) => n.max - n.min - parseFloat(e) - parseFloat(t),
|
|
1809
1823
|
height: ({ y: n }, { paddingTop: e = "0", paddingBottom: t = "0" }) => n.max - n.min - parseFloat(e) - parseFloat(t),
|
|
@@ -1815,57 +1829,57 @@ const ke = {
|
|
|
1815
1829
|
x: (n, { transform: e }) => $t(e, "x"),
|
|
1816
1830
|
y: (n, { transform: e }) => $t(e, "y")
|
|
1817
1831
|
};
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
const
|
|
1832
|
+
Ee.translateX = Ee.x;
|
|
1833
|
+
Ee.translateY = Ee.y;
|
|
1834
|
+
const ke = /* @__PURE__ */ new Set();
|
|
1821
1835
|
let Kt = !1, qt = !1, Gt = !1;
|
|
1822
|
-
function
|
|
1836
|
+
function Ui() {
|
|
1823
1837
|
if (qt) {
|
|
1824
|
-
const n = Array.from(
|
|
1838
|
+
const n = Array.from(ke).filter((i) => i.needsMeasurement), e = new Set(n.map((i) => i.element)), t = /* @__PURE__ */ new Map();
|
|
1825
1839
|
e.forEach((i) => {
|
|
1826
|
-
const r =
|
|
1840
|
+
const r = ws(i);
|
|
1827
1841
|
r.length && (t.set(i, r), i.render());
|
|
1828
1842
|
}), n.forEach((i) => i.measureInitialState()), e.forEach((i) => {
|
|
1829
1843
|
i.render();
|
|
1830
1844
|
const r = t.get(i);
|
|
1831
|
-
r && r.forEach(([
|
|
1845
|
+
r && r.forEach(([a, s]) => {
|
|
1832
1846
|
var o;
|
|
1833
|
-
(o = i.getValue(
|
|
1847
|
+
(o = i.getValue(a)) == null || o.set(s);
|
|
1834
1848
|
});
|
|
1835
1849
|
}), n.forEach((i) => i.measureEndState()), n.forEach((i) => {
|
|
1836
1850
|
i.suspendedScrollY !== void 0 && window.scrollTo(0, i.suspendedScrollY);
|
|
1837
1851
|
});
|
|
1838
1852
|
}
|
|
1839
|
-
qt = !1, Kt = !1,
|
|
1853
|
+
qt = !1, Kt = !1, ke.forEach((n) => n.complete(Gt)), ke.clear();
|
|
1840
1854
|
}
|
|
1841
|
-
function
|
|
1842
|
-
|
|
1855
|
+
function Wi() {
|
|
1856
|
+
ke.forEach((n) => {
|
|
1843
1857
|
n.readKeyframes(), n.needsMeasurement && (qt = !0);
|
|
1844
1858
|
});
|
|
1845
1859
|
}
|
|
1846
|
-
function
|
|
1847
|
-
Gt = !0,
|
|
1860
|
+
function Ts() {
|
|
1861
|
+
Gt = !0, Wi(), Ui(), Gt = !1;
|
|
1848
1862
|
}
|
|
1849
1863
|
class fn {
|
|
1850
|
-
constructor(e, t, i, r,
|
|
1851
|
-
this.state = "pending", this.isAsync = !1, this.needsMeasurement = !1, this.unresolvedKeyframes = [...e], this.onComplete = t, this.name = i, this.motionValue = r, this.element =
|
|
1864
|
+
constructor(e, t, i, r, a, s = !1) {
|
|
1865
|
+
this.state = "pending", this.isAsync = !1, this.needsMeasurement = !1, this.unresolvedKeyframes = [...e], this.onComplete = t, this.name = i, this.motionValue = r, this.element = a, this.isAsync = s;
|
|
1852
1866
|
}
|
|
1853
1867
|
scheduleResolve() {
|
|
1854
|
-
this.state = "scheduled", this.isAsync ? (
|
|
1868
|
+
this.state = "scheduled", this.isAsync ? (ke.add(this), Kt || (Kt = !0, ue.read(Wi), ue.resolveKeyframes(Ui))) : (this.readKeyframes(), this.complete());
|
|
1855
1869
|
}
|
|
1856
1870
|
readKeyframes() {
|
|
1857
1871
|
const { unresolvedKeyframes: e, name: t, element: i, motionValue: r } = this;
|
|
1858
1872
|
if (e[0] === null) {
|
|
1859
|
-
const
|
|
1860
|
-
if (
|
|
1861
|
-
e[0] =
|
|
1873
|
+
const a = r == null ? void 0 : r.get(), s = e[e.length - 1];
|
|
1874
|
+
if (a !== void 0)
|
|
1875
|
+
e[0] = a;
|
|
1862
1876
|
else if (i && t) {
|
|
1863
|
-
const o = i.readValue(t,
|
|
1877
|
+
const o = i.readValue(t, s);
|
|
1864
1878
|
o != null && (e[0] = o);
|
|
1865
1879
|
}
|
|
1866
|
-
e[0] === void 0 && (e[0] =
|
|
1880
|
+
e[0] === void 0 && (e[0] = s), r && a === void 0 && r.set(e[0]);
|
|
1867
1881
|
}
|
|
1868
|
-
|
|
1882
|
+
bs(e);
|
|
1869
1883
|
}
|
|
1870
1884
|
setFinalKeyframe() {
|
|
1871
1885
|
}
|
|
@@ -1876,40 +1890,40 @@ class fn {
|
|
|
1876
1890
|
measureEndState() {
|
|
1877
1891
|
}
|
|
1878
1892
|
complete(e = !1) {
|
|
1879
|
-
this.state = "complete", this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, e),
|
|
1893
|
+
this.state = "complete", this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, e), ke.delete(this);
|
|
1880
1894
|
}
|
|
1881
1895
|
cancel() {
|
|
1882
|
-
this.state === "scheduled" && (
|
|
1896
|
+
this.state === "scheduled" && (ke.delete(this), this.state = "pending");
|
|
1883
1897
|
}
|
|
1884
1898
|
resume() {
|
|
1885
1899
|
this.state === "pending" && this.scheduleResolve();
|
|
1886
1900
|
}
|
|
1887
1901
|
}
|
|
1888
|
-
const
|
|
1889
|
-
function
|
|
1890
|
-
|
|
1902
|
+
const As = (n) => n.startsWith("--");
|
|
1903
|
+
function _s(n, e, t) {
|
|
1904
|
+
As(e) ? n.style.setProperty(e, t) : n.style[e] = t;
|
|
1891
1905
|
}
|
|
1892
1906
|
// @__NO_SIDE_EFFECTS__
|
|
1893
1907
|
function gn(n) {
|
|
1894
1908
|
let e;
|
|
1895
1909
|
return () => (e === void 0 && (e = n()), e);
|
|
1896
1910
|
}
|
|
1897
|
-
const
|
|
1898
|
-
function
|
|
1911
|
+
const Ls = /* @__PURE__ */ gn(() => window.ScrollTimeline !== void 0), Vs = {};
|
|
1912
|
+
function Is(n, e) {
|
|
1899
1913
|
const t = /* @__PURE__ */ gn(n);
|
|
1900
1914
|
return () => {
|
|
1901
1915
|
var i;
|
|
1902
|
-
return (i =
|
|
1916
|
+
return (i = Vs[e]) != null ? i : t();
|
|
1903
1917
|
};
|
|
1904
1918
|
}
|
|
1905
|
-
const
|
|
1919
|
+
const Zi = /* @__PURE__ */ Is(() => {
|
|
1906
1920
|
try {
|
|
1907
1921
|
document.createElement("div").animate({ opacity: 0 }, { easing: "linear(0, 1)" });
|
|
1908
1922
|
} catch (n) {
|
|
1909
1923
|
return !1;
|
|
1910
1924
|
}
|
|
1911
1925
|
return !0;
|
|
1912
|
-
}, "linearEasing"), Ue = ([n, e, t, i]) => `cubic-bezier(${n}, ${e}, ${t}, ${i})`,
|
|
1926
|
+
}, "linearEasing"), Ue = ([n, e, t, i]) => `cubic-bezier(${n}, ${e}, ${t}, ${i})`, qn = {
|
|
1913
1927
|
linear: "linear",
|
|
1914
1928
|
ease: "ease",
|
|
1915
1929
|
easeIn: "ease-in",
|
|
@@ -1920,43 +1934,43 @@ const Ui = /* @__PURE__ */ Ia(() => {
|
|
|
1920
1934
|
backIn: /* @__PURE__ */ Ue([0.31, 0.01, 0.66, -0.59]),
|
|
1921
1935
|
backOut: /* @__PURE__ */ Ue([0.33, 1.53, 0.69, 0.99])
|
|
1922
1936
|
};
|
|
1923
|
-
function
|
|
1937
|
+
function Ji(n, e) {
|
|
1924
1938
|
if (n)
|
|
1925
|
-
return typeof n == "function" ?
|
|
1939
|
+
return typeof n == "function" ? Zi() ? Ni(n, e) : "ease-out" : Hi(n) ? Ue(n) : Array.isArray(n) ? n.map((t) => Ji(t, e) || qn.easeOut) : qn[n];
|
|
1926
1940
|
}
|
|
1927
|
-
function
|
|
1941
|
+
function Ms(n, e, t, { delay: i = 0, duration: r = 300, repeat: a = 0, repeatType: s = "loop", ease: o = "easeOut", times: l } = {}, u = void 0) {
|
|
1928
1942
|
const d = {
|
|
1929
1943
|
[e]: t
|
|
1930
1944
|
};
|
|
1931
1945
|
l && (d.offset = l);
|
|
1932
|
-
const h =
|
|
1946
|
+
const h = Ji(o, r);
|
|
1933
1947
|
Array.isArray(h) && (d.easing = h);
|
|
1934
1948
|
const m = {
|
|
1935
1949
|
delay: i,
|
|
1936
1950
|
duration: r,
|
|
1937
1951
|
easing: Array.isArray(h) ? "linear" : h,
|
|
1938
1952
|
fill: "both",
|
|
1939
|
-
iterations:
|
|
1940
|
-
direction:
|
|
1953
|
+
iterations: a + 1,
|
|
1954
|
+
direction: s === "reverse" ? "alternate" : "normal"
|
|
1941
1955
|
};
|
|
1942
1956
|
return u && (m.pseudoElement = u), n.animate(d, m);
|
|
1943
1957
|
}
|
|
1944
|
-
function
|
|
1945
|
-
var i = t, { type: n } = i, e =
|
|
1946
|
-
var r,
|
|
1947
|
-
return tn(n) &&
|
|
1958
|
+
function Ps(t) {
|
|
1959
|
+
var i = t, { type: n } = i, e = ae(i, ["type"]);
|
|
1960
|
+
var r, a;
|
|
1961
|
+
return tn(n) && Zi() ? n.applyToOptions(e) : ((r = e.duration) != null || (e.duration = 300), (a = e.ease) != null || (e.ease = "easeOut"), e);
|
|
1948
1962
|
}
|
|
1949
|
-
class
|
|
1963
|
+
class Ds extends pn {
|
|
1950
1964
|
constructor(e) {
|
|
1951
1965
|
if (super(), this.finishedTime = null, this.isStopped = !1, !e)
|
|
1952
1966
|
return;
|
|
1953
|
-
const { element: t, name: i, keyframes: r, pseudoElement:
|
|
1954
|
-
this.isPseudoElement = !!
|
|
1955
|
-
const u =
|
|
1956
|
-
this.animation =
|
|
1957
|
-
if (this.finishedTime = this.time, !
|
|
1967
|
+
const { element: t, name: i, keyframes: r, pseudoElement: a, allowFlatten: s = !1, finalKeyframe: o, onComplete: l } = e;
|
|
1968
|
+
this.isPseudoElement = !!a, this.allowFlatten = s, this.options = e, ce(typeof e.type != "string", `animateMini doesn't support "type" as a string. Did you mean to import { spring } from "motion"?`);
|
|
1969
|
+
const u = Ps(e);
|
|
1970
|
+
this.animation = Ms(t, i, r, u, a), u.autoplay === !1 && this.animation.pause(), this.animation.onfinish = () => {
|
|
1971
|
+
if (this.finishedTime = this.time, !a) {
|
|
1958
1972
|
const d = hn(r, this.options, o, this.speed);
|
|
1959
|
-
this.updateMotionValue ? this.updateMotionValue(d) :
|
|
1973
|
+
this.updateMotionValue ? this.updateMotionValue(d) : _s(t, i, d), this.animation.cancel();
|
|
1960
1974
|
}
|
|
1961
1975
|
l == null || l(), this.notifyFinished();
|
|
1962
1976
|
};
|
|
@@ -2009,7 +2023,7 @@ class Da extends pn {
|
|
|
2009
2023
|
return /* @__PURE__ */ le(Number(this.animation.currentTime) || 0);
|
|
2010
2024
|
}
|
|
2011
2025
|
set time(e) {
|
|
2012
|
-
this.finishedTime = null, this.animation.currentTime = /* @__PURE__ */
|
|
2026
|
+
this.finishedTime = null, this.animation.currentTime = /* @__PURE__ */ se(e);
|
|
2013
2027
|
}
|
|
2014
2028
|
/**
|
|
2015
2029
|
* The playback speed of the animation.
|
|
@@ -2035,24 +2049,24 @@ class Da extends pn {
|
|
|
2035
2049
|
*/
|
|
2036
2050
|
attachTimeline({ timeline: e, observe: t }) {
|
|
2037
2051
|
var i;
|
|
2038
|
-
return this.allowFlatten && ((i = this.animation.effect) == null || i.updateTiming({ easing: "linear" })), this.animation.onfinish = null, e &&
|
|
2052
|
+
return this.allowFlatten && ((i = this.animation.effect) == null || i.updateTiming({ easing: "linear" })), this.animation.onfinish = null, e && Ls() ? (this.animation.timeline = e, De) : t(this);
|
|
2039
2053
|
}
|
|
2040
2054
|
}
|
|
2041
|
-
const
|
|
2042
|
-
anticipate:
|
|
2043
|
-
backInOut:
|
|
2044
|
-
circInOut:
|
|
2055
|
+
const Xi = {
|
|
2056
|
+
anticipate: qi,
|
|
2057
|
+
backInOut: Ki,
|
|
2058
|
+
circInOut: Gi
|
|
2045
2059
|
};
|
|
2046
|
-
function
|
|
2047
|
-
return n in
|
|
2060
|
+
function Rs(n) {
|
|
2061
|
+
return n in Xi;
|
|
2048
2062
|
}
|
|
2049
|
-
function
|
|
2050
|
-
typeof n.ease == "string" &&
|
|
2063
|
+
function Os(n) {
|
|
2064
|
+
typeof n.ease == "string" && Rs(n.ease) && (n.ease = Xi[n.ease]);
|
|
2051
2065
|
}
|
|
2052
|
-
const
|
|
2053
|
-
class
|
|
2066
|
+
const Gn = 10;
|
|
2067
|
+
class Ns extends Ds {
|
|
2054
2068
|
constructor(e) {
|
|
2055
|
-
|
|
2069
|
+
Os(e), Yi(e), super(e), e.startTime && (this.startTime = e.startTime), this.options = e;
|
|
2056
2070
|
}
|
|
2057
2071
|
/**
|
|
2058
2072
|
* WAAPI doesn't natively have any interruption capabilities.
|
|
@@ -2064,23 +2078,23 @@ class Na extends Da {
|
|
|
2064
2078
|
*/
|
|
2065
2079
|
updateMotionValue(e) {
|
|
2066
2080
|
var d;
|
|
2067
|
-
const u = this.options, { motionValue: t, onUpdate: i, onComplete: r, element:
|
|
2081
|
+
const u = this.options, { motionValue: t, onUpdate: i, onComplete: r, element: a } = u, s = ae(u, ["motionValue", "onUpdate", "onComplete", "element"]);
|
|
2068
2082
|
if (!t)
|
|
2069
2083
|
return;
|
|
2070
2084
|
if (e !== void 0) {
|
|
2071
2085
|
t.set(e);
|
|
2072
2086
|
return;
|
|
2073
2087
|
}
|
|
2074
|
-
const o = new mn(I(v({},
|
|
2088
|
+
const o = new mn(I(v({}, s), {
|
|
2075
2089
|
autoplay: !1
|
|
2076
|
-
})), l = /* @__PURE__ */
|
|
2077
|
-
t.setWithVelocity(o.sample(l -
|
|
2090
|
+
})), l = /* @__PURE__ */ se((d = this.finishedTime) != null ? d : this.time);
|
|
2091
|
+
t.setWithVelocity(o.sample(l - Gn).value, o.sample(l).value, Gn), o.stop();
|
|
2078
2092
|
}
|
|
2079
2093
|
}
|
|
2080
|
-
const
|
|
2094
|
+
const Hn = (n, e) => e === "zIndex" ? !1 : !!(typeof n == "number" || Array.isArray(n) || typeof n == "string" && // It's animatable if we have a string
|
|
2081
2095
|
(Se.test(n) || n === "0") && // And it contains numbers and/or colors
|
|
2082
2096
|
!n.startsWith("url("));
|
|
2083
|
-
function
|
|
2097
|
+
function Ss(n) {
|
|
2084
2098
|
const e = n[0];
|
|
2085
2099
|
if (n.length === 1)
|
|
2086
2100
|
return !0;
|
|
@@ -2088,45 +2102,45 @@ function Sa(n) {
|
|
|
2088
2102
|
if (n[t] !== e)
|
|
2089
2103
|
return !0;
|
|
2090
2104
|
}
|
|
2091
|
-
function
|
|
2105
|
+
function Fs(n, e, t, i) {
|
|
2092
2106
|
const r = n[0];
|
|
2093
2107
|
if (r === null)
|
|
2094
2108
|
return !1;
|
|
2095
2109
|
if (e === "display" || e === "visibility")
|
|
2096
2110
|
return !0;
|
|
2097
|
-
const
|
|
2098
|
-
return it(
|
|
2111
|
+
const a = n[n.length - 1], s = Hn(r, e), o = Hn(a, e);
|
|
2112
|
+
return it(s === o, `You are trying to animate ${e} from "${r}" to "${a}". ${r} is not an animatable value - to enable this animation set ${r} to a value animatable to ${a} via the \`style\` property.`), !s || !o ? !1 : Ss(n) || (t === "spring" || tn(t)) && i;
|
|
2099
2113
|
}
|
|
2100
|
-
function
|
|
2114
|
+
function Qi(n) {
|
|
2101
2115
|
return typeof n == "object" && n !== null;
|
|
2102
2116
|
}
|
|
2103
|
-
function
|
|
2104
|
-
return
|
|
2117
|
+
function js(n) {
|
|
2118
|
+
return Qi(n) && "offsetHeight" in n;
|
|
2105
2119
|
}
|
|
2106
|
-
const
|
|
2120
|
+
const Bs = /* @__PURE__ */ new Set([
|
|
2107
2121
|
"opacity",
|
|
2108
2122
|
"clipPath",
|
|
2109
2123
|
"filter",
|
|
2110
2124
|
"transform"
|
|
2111
2125
|
// TODO: Could be re-enabled now we have support for linear() easing
|
|
2112
2126
|
// "background-color"
|
|
2113
|
-
]),
|
|
2114
|
-
function $
|
|
2127
|
+
]), zs = /* @__PURE__ */ gn(() => Object.hasOwnProperty.call(Element.prototype, "animate"));
|
|
2128
|
+
function $s(n) {
|
|
2115
2129
|
var u;
|
|
2116
|
-
const { motionValue: e, name: t, repeatDelay: i, repeatType: r, damping:
|
|
2117
|
-
if (!
|
|
2130
|
+
const { motionValue: e, name: t, repeatDelay: i, repeatType: r, damping: a, type: s } = n;
|
|
2131
|
+
if (!js((u = e == null ? void 0 : e.owner) == null ? void 0 : u.current))
|
|
2118
2132
|
return !1;
|
|
2119
2133
|
const { onUpdate: o, transformTemplate: l } = e.owner.getProps();
|
|
2120
|
-
return
|
|
2134
|
+
return zs() && t && Bs.has(t) && (t !== "transform" || !l) && /**
|
|
2121
2135
|
* If we're outputting values to onUpdate then we can't use WAAPI as there's
|
|
2122
2136
|
* no way to read the value from WAAPI every frame.
|
|
2123
2137
|
*/
|
|
2124
|
-
!o && !i && r !== "mirror" &&
|
|
2138
|
+
!o && !i && r !== "mirror" && a !== 0 && s !== "inertia";
|
|
2125
2139
|
}
|
|
2126
|
-
const
|
|
2127
|
-
class
|
|
2140
|
+
const Ks = 40;
|
|
2141
|
+
class qs extends pn {
|
|
2128
2142
|
constructor(m) {
|
|
2129
|
-
var p = m, { autoplay: e = !0, delay: t = 0, type: i = "keyframes", repeat: r = 0, repeatDelay:
|
|
2143
|
+
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"]);
|
|
2130
2144
|
var y;
|
|
2131
2145
|
super(), this.stop = () => {
|
|
2132
2146
|
var k, V;
|
|
@@ -2137,8 +2151,8 @@ class qa extends pn {
|
|
|
2137
2151
|
delay: t,
|
|
2138
2152
|
type: i,
|
|
2139
2153
|
repeat: r,
|
|
2140
|
-
repeatDelay:
|
|
2141
|
-
repeatType:
|
|
2154
|
+
repeatDelay: a,
|
|
2155
|
+
repeatType: s,
|
|
2142
2156
|
name: l,
|
|
2143
2157
|
motionValue: u,
|
|
2144
2158
|
element: d
|
|
@@ -2147,14 +2161,14 @@ class qa extends pn {
|
|
|
2147
2161
|
}
|
|
2148
2162
|
onKeyframesResolved(e, t, i, r) {
|
|
2149
2163
|
this.keyframeResolver = void 0;
|
|
2150
|
-
const { name:
|
|
2151
|
-
this.resolvedAt = ee.now(),
|
|
2152
|
-
const h = r ? this.resolvedAt ? this.resolvedAt - this.createdAt >
|
|
2164
|
+
const { name: a, type: s, velocity: o, delay: l, isHandoff: u, onUpdate: d } = i;
|
|
2165
|
+
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);
|
|
2166
|
+
const h = r ? this.resolvedAt ? this.resolvedAt - this.createdAt > Ks ? this.resolvedAt : this.createdAt : this.createdAt : void 0, m = I(v({
|
|
2153
2167
|
startTime: h,
|
|
2154
2168
|
finalKeyframe: t
|
|
2155
2169
|
}, i), {
|
|
2156
2170
|
keyframes: e
|
|
2157
|
-
}), p = !u && $
|
|
2171
|
+
}), p = !u && $s(m) ? new Ns(I(v({}, m), {
|
|
2158
2172
|
element: m.motionValue.owner.current
|
|
2159
2173
|
})) : new mn(m);
|
|
2160
2174
|
p.finished.then(() => this.notifyFinished()).catch(De), this.pendingTimeline && (this.stopTimeline = p.attachTimeline(this.pendingTimeline), this.pendingTimeline = void 0), this._animation = p;
|
|
@@ -2168,7 +2182,7 @@ class qa extends pn {
|
|
|
2168
2182
|
}
|
|
2169
2183
|
get animation() {
|
|
2170
2184
|
var e;
|
|
2171
|
-
return this._animation || ((e = this.keyframeResolver) == null || e.resume(),
|
|
2185
|
+
return this._animation || ((e = this.keyframeResolver) == null || e.resume(), Ts()), this._animation;
|
|
2172
2186
|
}
|
|
2173
2187
|
get duration() {
|
|
2174
2188
|
return this.animation.duration;
|
|
@@ -2208,10 +2222,10 @@ class qa extends pn {
|
|
|
2208
2222
|
this._animation && this.animation.cancel(), (e = this.keyframeResolver) == null || e.cancel();
|
|
2209
2223
|
}
|
|
2210
2224
|
}
|
|
2211
|
-
const
|
|
2212
|
-
const o =
|
|
2225
|
+
const er = (n, e, t, i = {}, r, a) => (s) => {
|
|
2226
|
+
const o = Ai(i, n) || {}, l = o.delay || i.delay || 0;
|
|
2213
2227
|
let { elapsed: u = 0 } = i;
|
|
2214
|
-
u = u - /* @__PURE__ */
|
|
2228
|
+
u = u - /* @__PURE__ */ se(l);
|
|
2215
2229
|
const d = I(v({
|
|
2216
2230
|
keyframes: Array.isArray(t) ? t : [null, t],
|
|
2217
2231
|
ease: "easeOut",
|
|
@@ -2222,16 +2236,16 @@ const Xi = (n, e, t, i = {}, r, s) => (a) => {
|
|
|
2222
2236
|
e.set(m), o.onUpdate && o.onUpdate(m);
|
|
2223
2237
|
},
|
|
2224
2238
|
onComplete: () => {
|
|
2225
|
-
|
|
2239
|
+
s(), o.onComplete && o.onComplete();
|
|
2226
2240
|
},
|
|
2227
2241
|
name: n,
|
|
2228
2242
|
motionValue: e,
|
|
2229
|
-
element:
|
|
2243
|
+
element: a ? void 0 : r
|
|
2230
2244
|
});
|
|
2231
|
-
|
|
2245
|
+
wa(o) || Object.assign(d, xa(n, d)), d.duration && (d.duration = /* @__PURE__ */ se(d.duration)), d.repeatDelay && (d.repeatDelay = /* @__PURE__ */ se(d.repeatDelay)), d.from !== void 0 && (d.keyframes[0] = d.from);
|
|
2232
2246
|
let h = !1;
|
|
2233
|
-
if ((d.type === !1 || d.duration === 0 && !d.repeatDelay) && (d.duration = 0, d.delay === 0 && (h = !0)), (de.instantAnimations || de.skipAnimations) && (h = !0, d.duration = 0, d.delay = 0), d.allowFlatten = !o.type && !o.ease, h && !
|
|
2234
|
-
const m =
|
|
2247
|
+
if ((d.type === !1 || d.duration === 0 && !d.repeatDelay) && (d.duration = 0, d.delay === 0 && (h = !0)), (de.instantAnimations || de.skipAnimations) && (h = !0, d.duration = 0, d.delay = 0), d.allowFlatten = !o.type && !o.ease, h && !a && e.get() !== void 0) {
|
|
2248
|
+
const m = va(d.keyframes, o);
|
|
2235
2249
|
if (m !== void 0) {
|
|
2236
2250
|
ue.update(() => {
|
|
2237
2251
|
d.onUpdate(m), d.onComplete();
|
|
@@ -2239,8 +2253,8 @@ const Xi = (n, e, t, i = {}, r, s) => (a) => {
|
|
|
2239
2253
|
return;
|
|
2240
2254
|
}
|
|
2241
2255
|
}
|
|
2242
|
-
return o.isSync ? new mn(d) : new
|
|
2243
|
-
},
|
|
2256
|
+
return o.isSync ? new mn(d) : new qs(d);
|
|
2257
|
+
}, tr = /* @__PURE__ */ new Set([
|
|
2244
2258
|
"width",
|
|
2245
2259
|
"height",
|
|
2246
2260
|
"top",
|
|
@@ -2249,49 +2263,49 @@ const Xi = (n, e, t, i = {}, r, s) => (a) => {
|
|
|
2249
2263
|
"bottom",
|
|
2250
2264
|
...Re
|
|
2251
2265
|
]);
|
|
2252
|
-
function
|
|
2266
|
+
function Gs({ protectedKeys: n, needsAnimating: e }, t) {
|
|
2253
2267
|
const i = n.hasOwnProperty(t) && e[t] !== !0;
|
|
2254
2268
|
return e[t] = !1, i;
|
|
2255
2269
|
}
|
|
2256
|
-
function
|
|
2270
|
+
function Hs(n, e, { delay: t = 0, transitionOverride: i, type: r } = {}) {
|
|
2257
2271
|
var h;
|
|
2258
|
-
let d = e, { transition:
|
|
2259
|
-
i && (
|
|
2272
|
+
let d = e, { transition: a = n.getDefaultTransition(), transitionEnd: s } = d, o = ae(d, ["transition", "transitionEnd"]);
|
|
2273
|
+
i && (a = i);
|
|
2260
2274
|
const l = [], u = r && n.animationState && n.animationState.getState()[r];
|
|
2261
2275
|
for (const m in o) {
|
|
2262
2276
|
const p = n.getValue(m, (h = n.latestValues[m]) != null ? h : null), g = o[m];
|
|
2263
|
-
if (g === void 0 || u &&
|
|
2277
|
+
if (g === void 0 || u && Gs(u, m))
|
|
2264
2278
|
continue;
|
|
2265
2279
|
const b = v({
|
|
2266
2280
|
delay: t
|
|
2267
|
-
},
|
|
2281
|
+
}, Ai(a || {}, m)), y = p.get();
|
|
2268
2282
|
if (y !== void 0 && !p.isAnimating && !Array.isArray(g) && g === y && !b.velocity)
|
|
2269
2283
|
continue;
|
|
2270
2284
|
let k = !1;
|
|
2271
2285
|
if (window.MotionHandoffAnimation) {
|
|
2272
|
-
const _ =
|
|
2286
|
+
const _ = ga(n);
|
|
2273
2287
|
if (_) {
|
|
2274
2288
|
const M = window.MotionHandoffAnimation(_, m, ue);
|
|
2275
2289
|
M !== null && (b.startTime = M, k = !0);
|
|
2276
2290
|
}
|
|
2277
2291
|
}
|
|
2278
|
-
|
|
2292
|
+
pa(n, m), p.start(er(m, p, g, n.shouldReduceMotion && tr.has(m) ? { type: !1 } : b, n, k));
|
|
2279
2293
|
const V = p.animation;
|
|
2280
2294
|
V && l.push(V);
|
|
2281
2295
|
}
|
|
2282
|
-
return
|
|
2296
|
+
return s && Promise.all(l).then(() => {
|
|
2283
2297
|
ue.update(() => {
|
|
2284
|
-
|
|
2298
|
+
s && ua(n, s);
|
|
2285
2299
|
});
|
|
2286
2300
|
}), l;
|
|
2287
2301
|
}
|
|
2288
|
-
function
|
|
2302
|
+
function Ys({ top: n, left: e, right: t, bottom: i }) {
|
|
2289
2303
|
return {
|
|
2290
2304
|
x: { min: e, max: t },
|
|
2291
2305
|
y: { min: n, max: i }
|
|
2292
2306
|
};
|
|
2293
2307
|
}
|
|
2294
|
-
function
|
|
2308
|
+
function Us(n, e) {
|
|
2295
2309
|
if (!e)
|
|
2296
2310
|
return n;
|
|
2297
2311
|
const t = e({ x: n.left, y: n.top }), i = e({ x: n.right, y: n.bottom });
|
|
@@ -2302,10 +2316,10 @@ function Ua(n, e) {
|
|
|
2302
2316
|
right: i.x
|
|
2303
2317
|
};
|
|
2304
2318
|
}
|
|
2305
|
-
function
|
|
2306
|
-
return
|
|
2319
|
+
function Ws(n, e) {
|
|
2320
|
+
return Ys(Us(n.getBoundingClientRect(), e));
|
|
2307
2321
|
}
|
|
2308
|
-
const
|
|
2322
|
+
const Yn = {
|
|
2309
2323
|
animation: [
|
|
2310
2324
|
"animate",
|
|
2311
2325
|
"variants",
|
|
@@ -2325,26 +2339,26 @@ const Gn = {
|
|
|
2325
2339
|
inView: ["whileInView", "onViewportEnter", "onViewportLeave"],
|
|
2326
2340
|
layout: ["layout", "layoutId"]
|
|
2327
2341
|
}, Ht = {};
|
|
2328
|
-
for (const n in
|
|
2342
|
+
for (const n in Yn)
|
|
2329
2343
|
Ht[n] = {
|
|
2330
|
-
isEnabled: (e) =>
|
|
2344
|
+
isEnabled: (e) => Yn[n].some((t) => !!e[t])
|
|
2331
2345
|
};
|
|
2332
|
-
const
|
|
2333
|
-
x:
|
|
2334
|
-
y:
|
|
2335
|
-
}),
|
|
2336
|
-
function
|
|
2337
|
-
if (
|
|
2346
|
+
const Un = () => ({ min: 0, max: 0 }), bn = () => ({
|
|
2347
|
+
x: Un(),
|
|
2348
|
+
y: Un()
|
|
2349
|
+
}), Zs = typeof window != "undefined", Yt = { current: null }, nr = { current: !1 };
|
|
2350
|
+
function Js() {
|
|
2351
|
+
if (nr.current = !0, !!Zs)
|
|
2338
2352
|
if (window.matchMedia) {
|
|
2339
2353
|
const n = window.matchMedia("(prefers-reduced-motion)"), e = () => Yt.current = n.matches;
|
|
2340
2354
|
n.addListener(e), e();
|
|
2341
2355
|
} else
|
|
2342
2356
|
Yt.current = !1;
|
|
2343
2357
|
}
|
|
2344
|
-
function
|
|
2358
|
+
function Xs(n) {
|
|
2345
2359
|
return n !== null && typeof n == "object" && typeof n.start == "function";
|
|
2346
2360
|
}
|
|
2347
|
-
function
|
|
2361
|
+
function Qs(n) {
|
|
2348
2362
|
return typeof n == "string" || Array.isArray(n);
|
|
2349
2363
|
}
|
|
2350
2364
|
const eo = [
|
|
@@ -2356,53 +2370,53 @@ const eo = [
|
|
|
2356
2370
|
"whileDrag",
|
|
2357
2371
|
"exit"
|
|
2358
2372
|
], to = ["initial", ...eo];
|
|
2359
|
-
function
|
|
2360
|
-
return
|
|
2373
|
+
function ir(n) {
|
|
2374
|
+
return Xs(n.animate) || to.some((e) => Qs(n[e]));
|
|
2361
2375
|
}
|
|
2362
2376
|
function no(n) {
|
|
2363
|
-
return !!(
|
|
2377
|
+
return !!(ir(n) || n.variants);
|
|
2364
2378
|
}
|
|
2365
2379
|
function io(n, e, t) {
|
|
2366
2380
|
for (const i in e) {
|
|
2367
|
-
const r = e[i],
|
|
2381
|
+
const r = e[i], a = t[i];
|
|
2368
2382
|
if (J(r))
|
|
2369
2383
|
n.addValue(i, r);
|
|
2370
|
-
else if (J(
|
|
2384
|
+
else if (J(a))
|
|
2371
2385
|
n.addValue(i, Xe(r, { owner: n }));
|
|
2372
|
-
else if (
|
|
2386
|
+
else if (a !== r)
|
|
2373
2387
|
if (n.hasValue(i)) {
|
|
2374
|
-
const
|
|
2375
|
-
|
|
2388
|
+
const s = n.getValue(i);
|
|
2389
|
+
s.liveStyle === !0 ? s.jump(r) : s.hasAnimated || s.set(r);
|
|
2376
2390
|
} else {
|
|
2377
|
-
const
|
|
2378
|
-
n.addValue(i, Xe(
|
|
2391
|
+
const s = n.getStaticValue(i);
|
|
2392
|
+
n.addValue(i, Xe(s !== void 0 ? s : r, { owner: n }));
|
|
2379
2393
|
}
|
|
2380
2394
|
}
|
|
2381
2395
|
for (const i in t)
|
|
2382
2396
|
e[i] === void 0 && n.removeValue(i);
|
|
2383
2397
|
return e;
|
|
2384
2398
|
}
|
|
2385
|
-
const
|
|
2399
|
+
const rr = (n) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n), ar = (n) => /^0[^.\s]+$/u.test(n), ro = {
|
|
2386
2400
|
test: (n) => n === "auto",
|
|
2387
2401
|
parse: (n) => n
|
|
2388
|
-
},
|
|
2402
|
+
}, sr = (n) => (e) => e.test(n), or = [Ne, L, Me, me, Pa, Ma, ro], Wn = (n) => or.find(sr(n)), ao = [...or, U, Se], so = (n) => ao.find(sr(n)), oo = /* @__PURE__ */ new Set(["brightness", "contrast", "saturate", "opacity"]);
|
|
2389
2403
|
function lo(n) {
|
|
2390
2404
|
const [e, t] = n.slice(0, -1).split("(");
|
|
2391
2405
|
if (e === "drop-shadow")
|
|
2392
2406
|
return n;
|
|
2393
|
-
const [i] = t.match(
|
|
2407
|
+
const [i] = t.match(sn) || [];
|
|
2394
2408
|
if (!i)
|
|
2395
2409
|
return n;
|
|
2396
2410
|
const r = t.replace(i, "");
|
|
2397
|
-
let
|
|
2398
|
-
return i !== t && (
|
|
2411
|
+
let a = oo.has(e) ? 1 : 0;
|
|
2412
|
+
return i !== t && (a *= 100), e + "(" + a + r + ")";
|
|
2399
2413
|
}
|
|
2400
2414
|
const co = /\b([a-z-]*)\(.*?\)/gu, Ut = I(v({}, Se), {
|
|
2401
2415
|
getAnimatableNone: (n) => {
|
|
2402
2416
|
const e = n.match(co);
|
|
2403
2417
|
return e ? e.map(lo).join(" ") : n;
|
|
2404
2418
|
}
|
|
2405
|
-
}),
|
|
2419
|
+
}), Zn = I(v({}, Ne), {
|
|
2406
2420
|
transform: Math.round
|
|
2407
2421
|
}), uo = {
|
|
2408
2422
|
rotate: me,
|
|
@@ -2426,8 +2440,8 @@ const co = /\b([a-z-]*)\(.*?\)/gu, Ut = I(v({}, Se), {
|
|
|
2426
2440
|
perspective: L,
|
|
2427
2441
|
transformPerspective: L,
|
|
2428
2442
|
opacity: Qe,
|
|
2429
|
-
originX:
|
|
2430
|
-
originY:
|
|
2443
|
+
originX: Dn,
|
|
2444
|
+
originY: Dn,
|
|
2431
2445
|
originZ: L
|
|
2432
2446
|
}, vn = I(v({
|
|
2433
2447
|
// Border props
|
|
@@ -2466,11 +2480,11 @@ const co = /\b([a-z-]*)\(.*?\)/gu, Ut = I(v({}, Se), {
|
|
|
2466
2480
|
backgroundPositionX: L,
|
|
2467
2481
|
backgroundPositionY: L
|
|
2468
2482
|
}, uo), {
|
|
2469
|
-
zIndex:
|
|
2483
|
+
zIndex: Zn,
|
|
2470
2484
|
// SVG
|
|
2471
2485
|
fillOpacity: Qe,
|
|
2472
2486
|
strokeOpacity: Qe,
|
|
2473
|
-
numOctaves:
|
|
2487
|
+
numOctaves: Zn
|
|
2474
2488
|
}), ho = I(v({}, vn), {
|
|
2475
2489
|
// Color props
|
|
2476
2490
|
color: U,
|
|
@@ -2486,12 +2500,12 @@ const co = /\b([a-z-]*)\(.*?\)/gu, Ut = I(v({}, Se), {
|
|
|
2486
2500
|
borderLeftColor: U,
|
|
2487
2501
|
filter: Ut,
|
|
2488
2502
|
WebkitFilter: Ut
|
|
2489
|
-
}),
|
|
2490
|
-
function
|
|
2491
|
-
let t =
|
|
2503
|
+
}), lr = (n) => ho[n];
|
|
2504
|
+
function cr(n, e) {
|
|
2505
|
+
let t = lr(n);
|
|
2492
2506
|
return t !== Ut && (t = Se), t.getAnimatableNone ? t.getAnimatableNone(e) : void 0;
|
|
2493
2507
|
}
|
|
2494
|
-
const
|
|
2508
|
+
const Jn = [
|
|
2495
2509
|
"AnimationStart",
|
|
2496
2510
|
"AnimationComplete",
|
|
2497
2511
|
"Update",
|
|
@@ -2500,7 +2514,7 @@ const Wn = [
|
|
|
2500
2514
|
"LayoutAnimationStart",
|
|
2501
2515
|
"LayoutAnimationComplete"
|
|
2502
2516
|
];
|
|
2503
|
-
class
|
|
2517
|
+
class dr {
|
|
2504
2518
|
/**
|
|
2505
2519
|
* This method takes React props and returns found MotionValues. For example, HTML
|
|
2506
2520
|
* MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.
|
|
@@ -2511,23 +2525,23 @@ class lr {
|
|
|
2511
2525
|
scrapeMotionValuesFromProps(e, t, i) {
|
|
2512
2526
|
return {};
|
|
2513
2527
|
}
|
|
2514
|
-
constructor({ parent: e, props: t, presenceContext: i, reducedMotionConfig: r, blockInitialAnimation:
|
|
2528
|
+
constructor({ parent: e, props: t, presenceContext: i, reducedMotionConfig: r, blockInitialAnimation: a, visualState: s }, o = {}) {
|
|
2515
2529
|
this.current = null, this.children = /* @__PURE__ */ new Set(), this.isVariantNode = !1, this.isControllingVariants = !1, this.shouldReduceMotion = null, this.values = /* @__PURE__ */ new Map(), this.KeyframeResolver = fn, this.features = {}, this.valueSubscriptions = /* @__PURE__ */ new Map(), this.prevMotionValues = {}, this.events = {}, this.propEventSubscriptions = {}, this.notifyUpdate = () => this.notify("Update", this.latestValues), this.render = () => {
|
|
2516
2530
|
this.current && (this.triggerBuild(), this.renderInstance(this.current, this.renderState, this.props.style, this.projection));
|
|
2517
2531
|
}, this.renderScheduledAt = 0, this.scheduleRender = () => {
|
|
2518
2532
|
const p = ee.now();
|
|
2519
2533
|
this.renderScheduledAt < p && (this.renderScheduledAt = p, ue.render(this.render, !1, !0));
|
|
2520
2534
|
};
|
|
2521
|
-
const { latestValues: l, renderState: u } =
|
|
2522
|
-
this.latestValues = l, this.baseTarget = v({}, l), this.initialValues = t.initial ? v({}, 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 = !!
|
|
2523
|
-
const m = this.scrapeMotionValuesFromProps(t, {}, this), { willChange: d } = m, h =
|
|
2535
|
+
const { latestValues: l, renderState: u } = s;
|
|
2536
|
+
this.latestValues = l, this.baseTarget = v({}, l), this.initialValues = t.initial ? v({}, 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 = ir(t), this.isVariantNode = no(t), this.isVariantNode && (this.variantChildren = /* @__PURE__ */ new Set()), this.manuallyAnimateOnMount = !!(e && e.current);
|
|
2537
|
+
const m = this.scrapeMotionValuesFromProps(t, {}, this), { willChange: d } = m, h = ae(m, ["willChange"]);
|
|
2524
2538
|
for (const p in h) {
|
|
2525
2539
|
const g = h[p];
|
|
2526
2540
|
l[p] !== void 0 && J(g) && g.set(l[p], !1);
|
|
2527
2541
|
}
|
|
2528
2542
|
}
|
|
2529
2543
|
mount(e) {
|
|
2530
|
-
this.current = e, Je.set(e, this), this.projection && !this.projection.instance && this.projection.mount(e), this.parent && this.isVariantNode && !this.isControllingVariants && (this.removeFromVariantTree = this.parent.addVariantChild(this)), this.values.forEach((t, i) => this.bindToMotionValue(i, t)),
|
|
2544
|
+
this.current = e, Je.set(e, this), this.projection && !this.projection.instance && this.projection.mount(e), this.parent && this.isVariantNode && !this.isControllingVariants && (this.removeFromVariantTree = this.parent.addVariantChild(this)), this.values.forEach((t, i) => this.bindToMotionValue(i, t)), nr.current || Js(), this.shouldReduceMotion = this.reducedMotionConfig === "never" ? !1 : this.reducedMotionConfig === "always" ? !0 : Yt.current, process.env.NODE_ENV !== "production" && xi(this.shouldReduceMotion !== !0, "You have Reduced Motion enabled on your device. Animations may not appear as expected."), this.parent && this.parent.children.add(this), this.update(this.props, this.presenceContext);
|
|
2531
2545
|
}
|
|
2532
2546
|
unmount() {
|
|
2533
2547
|
this.projection && this.projection.unmount(), Rt(this.notifyUpdate), Rt(this.render), this.valueSubscriptions.forEach((e) => e()), this.valueSubscriptions.clear(), this.removeFromVariantTree && this.removeFromVariantTree(), this.parent && this.parent.children.delete(this);
|
|
@@ -2545,10 +2559,10 @@ class lr {
|
|
|
2545
2559
|
i && this.onBindTransform && this.onBindTransform();
|
|
2546
2560
|
const r = t.on("change", (o) => {
|
|
2547
2561
|
this.latestValues[e] = o, this.props.onUpdate && ue.preRender(this.notifyUpdate), i && this.projection && (this.projection.isTransformDirty = !0);
|
|
2548
|
-
}),
|
|
2549
|
-
let
|
|
2550
|
-
window.MotionCheckAppearSync && (
|
|
2551
|
-
r(),
|
|
2562
|
+
}), a = t.on("renderRequest", this.scheduleRender);
|
|
2563
|
+
let s;
|
|
2564
|
+
window.MotionCheckAppearSync && (s = window.MotionCheckAppearSync(this, e, t)), this.valueSubscriptions.set(e, () => {
|
|
2565
|
+
r(), a(), s && s(), t.owner && t.stop();
|
|
2552
2566
|
});
|
|
2553
2567
|
}
|
|
2554
2568
|
sortNodePosition(e) {
|
|
@@ -2562,8 +2576,8 @@ class lr {
|
|
|
2562
2576
|
continue;
|
|
2563
2577
|
const { isEnabled: i, Feature: r } = t;
|
|
2564
2578
|
if (!this.features[e] && r && i(this.props) && (this.features[e] = new r(this)), this.features[e]) {
|
|
2565
|
-
const
|
|
2566
|
-
|
|
2579
|
+
const a = this.features[e];
|
|
2580
|
+
a.isMounted ? a.update() : (a.mount(), a.isMounted = !0);
|
|
2567
2581
|
}
|
|
2568
2582
|
}
|
|
2569
2583
|
}
|
|
@@ -2590,11 +2604,11 @@ class lr {
|
|
|
2590
2604
|
*/
|
|
2591
2605
|
update(e, t) {
|
|
2592
2606
|
(e.transformTemplate || this.props.transformTemplate) && this.scheduleRender(), this.prevProps = this.props, this.props = e, this.prevPresenceContext = this.presenceContext, this.presenceContext = t;
|
|
2593
|
-
for (let i = 0; i <
|
|
2594
|
-
const r =
|
|
2607
|
+
for (let i = 0; i < Jn.length; i++) {
|
|
2608
|
+
const r = Jn[i];
|
|
2595
2609
|
this.propEventSubscriptions[r] && (this.propEventSubscriptions[r](), delete this.propEventSubscriptions[r]);
|
|
2596
|
-
const
|
|
2597
|
-
|
|
2610
|
+
const a = "on" + r, s = e[a];
|
|
2611
|
+
s && (this.propEventSubscriptions[r] = this.on(r, s));
|
|
2598
2612
|
}
|
|
2599
2613
|
this.prevMotionValues = io(this, this.scrapeMotionValuesFromProps(e, this.prevProps, this), this.prevMotionValues), this.handleChildMotionValue && this.handleChildMotionValue();
|
|
2600
2614
|
}
|
|
@@ -2662,7 +2676,7 @@ class lr {
|
|
|
2662
2676
|
readValue(e, t) {
|
|
2663
2677
|
var r;
|
|
2664
2678
|
let i = this.latestValues[e] !== void 0 || !this.current ? this.latestValues[e] : (r = this.getBaseTargetFromProps(this.props, e)) != null ? r : this.readValueFromInstance(this.current, e, this.options);
|
|
2665
|
-
return i != null && (typeof i == "string" && (
|
|
2679
|
+
return i != null && (typeof i == "string" && (rr(i) || ar(i)) ? i = parseFloat(i) : !so(i) && Se.test(t) && (i = cr(e, t)), this.setBaseTarget(e, J(i) ? i.get() : i)), J(i) ? i.get() : i;
|
|
2666
2680
|
}
|
|
2667
2681
|
/**
|
|
2668
2682
|
* Set the base target to later animate back to. This is currently
|
|
@@ -2676,12 +2690,12 @@ class lr {
|
|
|
2676
2690
|
* props.
|
|
2677
2691
|
*/
|
|
2678
2692
|
getBaseTarget(e) {
|
|
2679
|
-
var
|
|
2693
|
+
var a;
|
|
2680
2694
|
const { initial: t } = this.props;
|
|
2681
2695
|
let i;
|
|
2682
2696
|
if (typeof t == "string" || typeof t == "object") {
|
|
2683
|
-
const
|
|
2684
|
-
|
|
2697
|
+
const s = ki(this.props, t, (a = this.presenceContext) == null ? void 0 : a.custom);
|
|
2698
|
+
s && (i = s[e]);
|
|
2685
2699
|
}
|
|
2686
2700
|
if (t && i !== void 0)
|
|
2687
2701
|
return i;
|
|
@@ -2689,7 +2703,7 @@ class lr {
|
|
|
2689
2703
|
return r !== void 0 && !J(r) ? r : this.initialValues[e] !== void 0 && i === void 0 ? void 0 : this.baseTarget[e];
|
|
2690
2704
|
}
|
|
2691
2705
|
on(e, t) {
|
|
2692
|
-
return this.events[e] || (this.events[e] = new
|
|
2706
|
+
return this.events[e] || (this.events[e] = new wi()), this.events[e].add(t);
|
|
2693
2707
|
}
|
|
2694
2708
|
notify(e, ...t) {
|
|
2695
2709
|
this.events[e] && this.events[e].notify(...t);
|
|
@@ -2707,35 +2721,35 @@ function mo(n) {
|
|
|
2707
2721
|
return [`--${t != null ? t : i}`, r];
|
|
2708
2722
|
}
|
|
2709
2723
|
const fo = 4;
|
|
2710
|
-
function
|
|
2724
|
+
function ur(n, e, t = 1) {
|
|
2711
2725
|
ce(t <= fo, `Max CSS variable fallback depth detected in property "${n}". This may indicate a circular fallback dependency.`);
|
|
2712
2726
|
const [i, r] = mo(n);
|
|
2713
2727
|
if (!i)
|
|
2714
2728
|
return;
|
|
2715
|
-
const
|
|
2716
|
-
if (
|
|
2717
|
-
const
|
|
2718
|
-
return
|
|
2729
|
+
const a = window.getComputedStyle(e).getPropertyValue(i);
|
|
2730
|
+
if (a) {
|
|
2731
|
+
const s = a.trim();
|
|
2732
|
+
return rr(s) ? parseFloat(s) : s;
|
|
2719
2733
|
}
|
|
2720
|
-
return
|
|
2734
|
+
return an(r) ? ur(r, e, t + 1) : r;
|
|
2721
2735
|
}
|
|
2722
2736
|
function go(n) {
|
|
2723
|
-
return typeof n == "number" ? n === 0 : n !== null ? n === "none" || n === "0" ||
|
|
2737
|
+
return typeof n == "number" ? n === 0 : n !== null ? n === "none" || n === "0" || ar(n) : !0;
|
|
2724
2738
|
}
|
|
2725
2739
|
const bo = /* @__PURE__ */ new Set(["auto", "none", "0"]);
|
|
2726
2740
|
function vo(n, e, t) {
|
|
2727
2741
|
let i = 0, r;
|
|
2728
2742
|
for (; i < n.length && !r; ) {
|
|
2729
|
-
const
|
|
2730
|
-
typeof
|
|
2743
|
+
const a = n[i];
|
|
2744
|
+
typeof a == "string" && !bo.has(a) && et(a).values.length && (r = n[i]), i++;
|
|
2731
2745
|
}
|
|
2732
2746
|
if (r && t)
|
|
2733
|
-
for (const
|
|
2734
|
-
n[
|
|
2747
|
+
for (const a of e)
|
|
2748
|
+
n[a] = cr(t, r);
|
|
2735
2749
|
}
|
|
2736
2750
|
class yo extends fn {
|
|
2737
|
-
constructor(e, t, i, r,
|
|
2738
|
-
super(e, t, i, r,
|
|
2751
|
+
constructor(e, t, i, r, a) {
|
|
2752
|
+
super(e, t, i, r, a, !0);
|
|
2739
2753
|
}
|
|
2740
2754
|
readKeyframes() {
|
|
2741
2755
|
const { unresolvedKeyframes: e, element: t, name: i } = this;
|
|
@@ -2744,21 +2758,21 @@ class yo extends fn {
|
|
|
2744
2758
|
super.readKeyframes();
|
|
2745
2759
|
for (let l = 0; l < e.length; l++) {
|
|
2746
2760
|
let u = e[l];
|
|
2747
|
-
if (typeof u == "string" && (u = u.trim(),
|
|
2748
|
-
const d =
|
|
2761
|
+
if (typeof u == "string" && (u = u.trim(), an(u))) {
|
|
2762
|
+
const d = ur(u, t.current);
|
|
2749
2763
|
d !== void 0 && (e[l] = d), l === e.length - 1 && (this.finalKeyframe = u);
|
|
2750
2764
|
}
|
|
2751
2765
|
}
|
|
2752
|
-
if (this.resolveNoneKeyframes(), !
|
|
2766
|
+
if (this.resolveNoneKeyframes(), !tr.has(i) || e.length !== 2)
|
|
2753
2767
|
return;
|
|
2754
|
-
const [r,
|
|
2755
|
-
if (
|
|
2756
|
-
if (
|
|
2768
|
+
const [r, a] = e, s = Wn(r), o = Wn(a);
|
|
2769
|
+
if (s !== o)
|
|
2770
|
+
if (Kn(s) && Kn(o))
|
|
2757
2771
|
for (let l = 0; l < e.length; l++) {
|
|
2758
2772
|
const u = e[l];
|
|
2759
2773
|
typeof u == "string" && (e[l] = parseFloat(u));
|
|
2760
2774
|
}
|
|
2761
|
-
else
|
|
2775
|
+
else Ee[i] && (this.needsMeasurement = !0);
|
|
2762
2776
|
}
|
|
2763
2777
|
resolveNoneKeyframes() {
|
|
2764
2778
|
const { unresolvedKeyframes: e, name: t } = this, i = [];
|
|
@@ -2770,7 +2784,7 @@ class yo extends fn {
|
|
|
2770
2784
|
const { element: e, unresolvedKeyframes: t, name: i } = this;
|
|
2771
2785
|
if (!e || !e.current)
|
|
2772
2786
|
return;
|
|
2773
|
-
i === "height" && (this.suspendedScrollY = window.pageYOffset), this.measuredOrigin =
|
|
2787
|
+
i === "height" && (this.suspendedScrollY = window.pageYOffset), this.measuredOrigin = Ee[i](e.measureViewportBox(), window.getComputedStyle(e.current)), t[0] = this.measuredOrigin;
|
|
2774
2788
|
const r = t[t.length - 1];
|
|
2775
2789
|
r !== void 0 && e.getValue(i, r).jump(r, !1);
|
|
2776
2790
|
}
|
|
@@ -2781,13 +2795,13 @@ class yo extends fn {
|
|
|
2781
2795
|
return;
|
|
2782
2796
|
const r = e.getValue(t);
|
|
2783
2797
|
r && r.jump(this.measuredOrigin, !1);
|
|
2784
|
-
const
|
|
2785
|
-
i[
|
|
2798
|
+
const a = i.length - 1, s = i[a];
|
|
2799
|
+
i[a] = Ee[t](e.measureViewportBox(), window.getComputedStyle(e.current)), s !== null && this.finalKeyframe === void 0 && (this.finalKeyframe = s), (o = this.removedTransforms) != null && o.length && this.removedTransforms.forEach(([l, u]) => {
|
|
2786
2800
|
e.getValue(l).set(u);
|
|
2787
2801
|
}), this.resolveNoneKeyframes();
|
|
2788
2802
|
}
|
|
2789
2803
|
}
|
|
2790
|
-
class
|
|
2804
|
+
class hr extends dr {
|
|
2791
2805
|
constructor() {
|
|
2792
2806
|
super(...arguments), this.KeyframeResolver = yo;
|
|
2793
2807
|
}
|
|
@@ -2808,98 +2822,98 @@ class dr extends lr {
|
|
|
2808
2822
|
}));
|
|
2809
2823
|
}
|
|
2810
2824
|
}
|
|
2811
|
-
const
|
|
2825
|
+
const pr = (n, e) => e && typeof n == "number" ? e.transform(n) : n, Co = {
|
|
2812
2826
|
x: "translateX",
|
|
2813
2827
|
y: "translateY",
|
|
2814
2828
|
z: "translateZ",
|
|
2815
2829
|
transformPerspective: "perspective"
|
|
2816
|
-
},
|
|
2817
|
-
function
|
|
2830
|
+
}, Eo = Re.length;
|
|
2831
|
+
function ko(n, e, t) {
|
|
2818
2832
|
let i = "", r = !0;
|
|
2819
|
-
for (let
|
|
2820
|
-
const
|
|
2833
|
+
for (let a = 0; a < Eo; a++) {
|
|
2834
|
+
const s = Re[a], o = n[s];
|
|
2821
2835
|
if (o === void 0)
|
|
2822
2836
|
continue;
|
|
2823
2837
|
let l = !0;
|
|
2824
|
-
if (typeof o == "number" ? l = o === (
|
|
2825
|
-
const u =
|
|
2838
|
+
if (typeof o == "number" ? l = o === (s.startsWith("scale") ? 1 : 0) : l = parseFloat(o) === 0, !l || t) {
|
|
2839
|
+
const u = pr(o, vn[s]);
|
|
2826
2840
|
if (!l) {
|
|
2827
2841
|
r = !1;
|
|
2828
|
-
const d = Co[
|
|
2842
|
+
const d = Co[s] || s;
|
|
2829
2843
|
i += `${d}(${u}) `;
|
|
2830
2844
|
}
|
|
2831
|
-
t && (e[
|
|
2845
|
+
t && (e[s] = u);
|
|
2832
2846
|
}
|
|
2833
2847
|
}
|
|
2834
2848
|
return i = i.trim(), t ? i = t(e, r ? "" : i) : r && (i = "none"), i;
|
|
2835
2849
|
}
|
|
2836
|
-
function
|
|
2837
|
-
const { style: i, vars: r, transformOrigin:
|
|
2838
|
-
let
|
|
2850
|
+
function mr(n, e, t) {
|
|
2851
|
+
const { style: i, vars: r, transformOrigin: a } = n;
|
|
2852
|
+
let s = !1, o = !1;
|
|
2839
2853
|
for (const l in e) {
|
|
2840
2854
|
const u = e[l];
|
|
2841
2855
|
if (Oe.has(l)) {
|
|
2842
|
-
|
|
2856
|
+
s = !0;
|
|
2843
2857
|
continue;
|
|
2844
|
-
} else if (
|
|
2858
|
+
} else if (Li(l)) {
|
|
2845
2859
|
r[l] = u;
|
|
2846
2860
|
continue;
|
|
2847
2861
|
} else {
|
|
2848
|
-
const d =
|
|
2849
|
-
l.startsWith("origin") ? (o = !0,
|
|
2862
|
+
const d = pr(u, vn[l]);
|
|
2863
|
+
l.startsWith("origin") ? (o = !0, a[l] = d) : i[l] = d;
|
|
2850
2864
|
}
|
|
2851
2865
|
}
|
|
2852
|
-
if (e.transform || (
|
|
2853
|
-
const { originX: l = "50%", originY: u = "50%", originZ: d = 0 } =
|
|
2866
|
+
if (e.transform || (s || t ? i.transform = ko(e, n.transform, t) : i.transform && (i.transform = "none")), o) {
|
|
2867
|
+
const { originX: l = "50%", originY: u = "50%", originZ: d = 0 } = a;
|
|
2854
2868
|
i.transformOrigin = `${l} ${u} ${d}`;
|
|
2855
2869
|
}
|
|
2856
2870
|
}
|
|
2857
|
-
function
|
|
2871
|
+
function fr(n, { style: e, vars: t }, i, r) {
|
|
2858
2872
|
Object.assign(n.style, e, r && r.getProjectionStyles(i));
|
|
2859
|
-
for (const
|
|
2860
|
-
n.style.setProperty(
|
|
2873
|
+
for (const a in t)
|
|
2874
|
+
n.style.setProperty(a, t[a]);
|
|
2861
2875
|
}
|
|
2862
2876
|
const xo = {};
|
|
2863
2877
|
function wo(n, { layout: e, layoutId: t }) {
|
|
2864
2878
|
return Oe.has(n) || n.startsWith("origin") || (e || t !== void 0) && (!!xo[n] || n === "opacity");
|
|
2865
2879
|
}
|
|
2866
|
-
function
|
|
2867
|
-
var
|
|
2880
|
+
function gr(n, e, t) {
|
|
2881
|
+
var a;
|
|
2868
2882
|
const { style: i } = n, r = {};
|
|
2869
|
-
for (const
|
|
2870
|
-
(J(i[
|
|
2883
|
+
for (const s in i)
|
|
2884
|
+
(J(i[s]) || e.style && J(e.style[s]) || wo(s, n) || ((a = t == null ? void 0 : t.getValue(s)) == null ? void 0 : a.liveStyle) !== void 0) && (r[s] = i[s]);
|
|
2871
2885
|
return r;
|
|
2872
2886
|
}
|
|
2873
2887
|
function To(n) {
|
|
2874
2888
|
return window.getComputedStyle(n);
|
|
2875
2889
|
}
|
|
2876
|
-
class Ao extends
|
|
2890
|
+
class Ao extends hr {
|
|
2877
2891
|
constructor() {
|
|
2878
|
-
super(...arguments), this.type = "html", this.renderInstance =
|
|
2892
|
+
super(...arguments), this.type = "html", this.renderInstance = fr;
|
|
2879
2893
|
}
|
|
2880
2894
|
readValueFromInstance(e, t) {
|
|
2881
2895
|
var i;
|
|
2882
2896
|
if (Oe.has(t))
|
|
2883
|
-
return (i = this.projection) != null && i.isProjecting ? zt(t) :
|
|
2897
|
+
return (i = this.projection) != null && i.isProjecting ? zt(t) : Cs(e, t);
|
|
2884
2898
|
{
|
|
2885
|
-
const r = To(e),
|
|
2886
|
-
return typeof
|
|
2899
|
+
const r = To(e), a = (Li(t) ? r.getPropertyValue(t) : r[t]) || 0;
|
|
2900
|
+
return typeof a == "string" ? a.trim() : a;
|
|
2887
2901
|
}
|
|
2888
2902
|
}
|
|
2889
2903
|
measureInstanceViewportBox(e, { transformPagePoint: t }) {
|
|
2890
|
-
return
|
|
2904
|
+
return Ws(e, t);
|
|
2891
2905
|
}
|
|
2892
2906
|
build(e, t, i) {
|
|
2893
|
-
|
|
2907
|
+
mr(e, t, i.transformTemplate);
|
|
2894
2908
|
}
|
|
2895
2909
|
scrapeMotionValuesFromProps(e, t, i) {
|
|
2896
|
-
return
|
|
2910
|
+
return gr(e, t, i);
|
|
2897
2911
|
}
|
|
2898
2912
|
}
|
|
2899
2913
|
function _o(n, e) {
|
|
2900
2914
|
return n in e;
|
|
2901
2915
|
}
|
|
2902
|
-
class Lo extends
|
|
2916
|
+
class Lo extends dr {
|
|
2903
2917
|
constructor() {
|
|
2904
2918
|
super(...arguments), this.type = "object";
|
|
2905
2919
|
}
|
|
@@ -2937,10 +2951,10 @@ const Vo = {
|
|
|
2937
2951
|
};
|
|
2938
2952
|
function Mo(n, e, t = 1, i = 0, r = !0) {
|
|
2939
2953
|
n.pathLength = 1;
|
|
2940
|
-
const
|
|
2941
|
-
n[
|
|
2942
|
-
const
|
|
2943
|
-
n[
|
|
2954
|
+
const a = r ? Vo : Io;
|
|
2955
|
+
n[a.offset] = L.transform(-i);
|
|
2956
|
+
const s = L.transform(e), o = L.transform(t);
|
|
2957
|
+
n[a.array] = `${s} ${o}`;
|
|
2944
2958
|
}
|
|
2945
2959
|
function Po(n, h, l, u, d) {
|
|
2946
2960
|
var m = h, {
|
|
@@ -2948,9 +2962,9 @@ function Po(n, h, l, u, d) {
|
|
|
2948
2962
|
attrY: t,
|
|
2949
2963
|
attrScale: i,
|
|
2950
2964
|
pathLength: r,
|
|
2951
|
-
pathSpacing:
|
|
2952
|
-
pathOffset:
|
|
2953
|
-
} = m, o =
|
|
2965
|
+
pathSpacing: a = 1,
|
|
2966
|
+
pathOffset: s = 0
|
|
2967
|
+
} = m, o = ae(m, [
|
|
2954
2968
|
"attrX",
|
|
2955
2969
|
"attrY",
|
|
2956
2970
|
"attrScale",
|
|
@@ -2959,15 +2973,15 @@ function Po(n, h, l, u, d) {
|
|
|
2959
2973
|
"pathOffset"
|
|
2960
2974
|
]);
|
|
2961
2975
|
var b, y;
|
|
2962
|
-
if (
|
|
2976
|
+
if (mr(n, o, u), l) {
|
|
2963
2977
|
n.style.viewBox && (n.attrs.viewBox = n.style.viewBox);
|
|
2964
2978
|
return;
|
|
2965
2979
|
}
|
|
2966
2980
|
n.attrs = n.style, n.style = {};
|
|
2967
2981
|
const { attrs: p, style: g } = n;
|
|
2968
|
-
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 = (y = d == null ? void 0 : d.transformBox) != null ? y : "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,
|
|
2982
|
+
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 = (y = d == null ? void 0 : d.transformBox) != null ? y : "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);
|
|
2969
2983
|
}
|
|
2970
|
-
const
|
|
2984
|
+
const br = /* @__PURE__ */ new Set([
|
|
2971
2985
|
"baseFrequency",
|
|
2972
2986
|
"diffuseConstant",
|
|
2973
2987
|
"kernelMatrix",
|
|
@@ -2993,20 +3007,20 @@ const fr = /* @__PURE__ */ new Set([
|
|
|
2993
3007
|
"lengthAdjust"
|
|
2994
3008
|
]), Do = (n) => typeof n == "string" && n.toLowerCase() === "svg";
|
|
2995
3009
|
function Ro(n, e, t, i) {
|
|
2996
|
-
|
|
3010
|
+
fr(n, e, void 0, i);
|
|
2997
3011
|
for (const r in e.attrs)
|
|
2998
|
-
n.setAttribute(
|
|
3012
|
+
n.setAttribute(br.has(r) ? r : rn(r), e.attrs[r]);
|
|
2999
3013
|
}
|
|
3000
3014
|
function Oo(n, e, t) {
|
|
3001
|
-
const i =
|
|
3015
|
+
const i = gr(n, e, t);
|
|
3002
3016
|
for (const r in n)
|
|
3003
3017
|
if (J(n[r]) || J(e[r])) {
|
|
3004
|
-
const
|
|
3005
|
-
i[
|
|
3018
|
+
const a = Re.indexOf(r) !== -1 ? "attr" + r.charAt(0).toUpperCase() + r.substring(1) : r;
|
|
3019
|
+
i[a] = n[r];
|
|
3006
3020
|
}
|
|
3007
3021
|
return i;
|
|
3008
3022
|
}
|
|
3009
|
-
class No extends
|
|
3023
|
+
class No extends hr {
|
|
3010
3024
|
constructor() {
|
|
3011
3025
|
super(...arguments), this.type = "svg", this.isSVGTag = !1, this.measureInstanceViewportBox = bn;
|
|
3012
3026
|
}
|
|
@@ -3015,10 +3029,10 @@ class No extends dr {
|
|
|
3015
3029
|
}
|
|
3016
3030
|
readValueFromInstance(e, t) {
|
|
3017
3031
|
if (Oe.has(t)) {
|
|
3018
|
-
const i =
|
|
3032
|
+
const i = lr(t);
|
|
3019
3033
|
return i && i.default || 0;
|
|
3020
3034
|
}
|
|
3021
|
-
return t =
|
|
3035
|
+
return t = br.has(t) ? t : rn(t), e.getAttribute(t);
|
|
3022
3036
|
}
|
|
3023
3037
|
scrapeMotionValuesFromProps(e, t, i) {
|
|
3024
3038
|
return Oo(e, t, i);
|
|
@@ -3033,11 +3047,11 @@ class No extends dr {
|
|
|
3033
3047
|
this.isSVGTag = Do(e.tagName), super.mount(e);
|
|
3034
3048
|
}
|
|
3035
3049
|
}
|
|
3036
|
-
function
|
|
3037
|
-
return
|
|
3050
|
+
function vr(n) {
|
|
3051
|
+
return Qi(n) && "ownerSVGElement" in n;
|
|
3038
3052
|
}
|
|
3039
3053
|
function So(n) {
|
|
3040
|
-
return
|
|
3054
|
+
return vr(n) && n.tagName === "svg";
|
|
3041
3055
|
}
|
|
3042
3056
|
function Fo(n) {
|
|
3043
3057
|
const e = {
|
|
@@ -3053,7 +3067,7 @@ function Fo(n) {
|
|
|
3053
3067
|
},
|
|
3054
3068
|
latestValues: {}
|
|
3055
3069
|
}
|
|
3056
|
-
}, t =
|
|
3070
|
+
}, t = vr(n) && !So(n) ? new No(e) : new Ao(e);
|
|
3057
3071
|
t.mount(n), Je.set(n, t);
|
|
3058
3072
|
}
|
|
3059
3073
|
function jo(n) {
|
|
@@ -3071,31 +3085,31 @@ function jo(n) {
|
|
|
3071
3085
|
}
|
|
3072
3086
|
function Bo(n, e, t) {
|
|
3073
3087
|
const i = J(n) ? n : Xe(n);
|
|
3074
|
-
return i.start(
|
|
3088
|
+
return i.start(er("", i, e, t)), i.animation;
|
|
3075
3089
|
}
|
|
3076
3090
|
function zo(n, e) {
|
|
3077
3091
|
return J(n) || typeof n == "number" || typeof n == "string" && !Qt(e);
|
|
3078
3092
|
}
|
|
3079
|
-
function
|
|
3093
|
+
function yr(n, e, t, i) {
|
|
3080
3094
|
const r = [];
|
|
3081
3095
|
if (zo(n, e))
|
|
3082
3096
|
r.push(Bo(n, Qt(e) && e.default || e, t && (t.default || t)));
|
|
3083
3097
|
else {
|
|
3084
|
-
const
|
|
3085
|
-
ce(!!
|
|
3086
|
-
for (let o = 0; o <
|
|
3087
|
-
const l =
|
|
3098
|
+
const a = fi(n, e, i), s = a.length;
|
|
3099
|
+
ce(!!s, "No valid elements provided.");
|
|
3100
|
+
for (let o = 0; o < s; o++) {
|
|
3101
|
+
const l = a[o], u = l instanceof Element ? Fo : jo;
|
|
3088
3102
|
Je.has(l) || u(l);
|
|
3089
3103
|
const d = Je.get(l), h = v({}, t);
|
|
3090
|
-
"delay" in h && typeof h.delay == "function" && (h.delay = h.delay(o,
|
|
3104
|
+
"delay" in h && typeof h.delay == "function" && (h.delay = h.delay(o, s)), r.push(...Hs(d, I(v({}, e), { transition: h }), {}));
|
|
3091
3105
|
}
|
|
3092
3106
|
}
|
|
3093
3107
|
return r;
|
|
3094
3108
|
}
|
|
3095
3109
|
function $o(n, e, t) {
|
|
3096
3110
|
const i = [];
|
|
3097
|
-
return Zr(n, e, t, { spring: tt }).forEach(({ keyframes:
|
|
3098
|
-
i.push(...
|
|
3111
|
+
return Zr(n, e, t, { spring: tt }).forEach(({ keyframes: a, transition: s }, o) => {
|
|
3112
|
+
i.push(...yr(o, a, s));
|
|
3099
3113
|
}), i;
|
|
3100
3114
|
}
|
|
3101
3115
|
class Ko {
|
|
@@ -3174,8 +3188,8 @@ function Go(n) {
|
|
|
3174
3188
|
}
|
|
3175
3189
|
function Ho(n) {
|
|
3176
3190
|
function e(t, i, r) {
|
|
3177
|
-
let
|
|
3178
|
-
return Go(t) ?
|
|
3191
|
+
let a = [];
|
|
3192
|
+
return Go(t) ? a = $o(t, i, n) : a = yr(t, i, r, n), new qo(a);
|
|
3179
3193
|
}
|
|
3180
3194
|
return e;
|
|
3181
3195
|
}
|
|
@@ -3196,7 +3210,7 @@ function F(n, e) {
|
|
|
3196
3210
|
const t = e.trim().split(/\s+/).filter((i) => i.length > 0);
|
|
3197
3211
|
n.classList.add(...t);
|
|
3198
3212
|
}
|
|
3199
|
-
class
|
|
3213
|
+
class Cr {
|
|
3200
3214
|
constructor() {
|
|
3201
3215
|
c(this, "template", `
|
|
3202
3216
|
<svg class="${S.spinner}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 215 215" fill="none">
|
|
@@ -3218,24 +3232,24 @@ class vr {
|
|
|
3218
3232
|
return this.spinner;
|
|
3219
3233
|
}
|
|
3220
3234
|
}
|
|
3221
|
-
const il = "_loader_nwq3e_1",
|
|
3235
|
+
const il = "_loader_nwq3e_1", Xn = {
|
|
3222
3236
|
loader: il
|
|
3223
3237
|
};
|
|
3224
3238
|
class rl {
|
|
3225
3239
|
constructor() {
|
|
3226
3240
|
c(this, "loader");
|
|
3227
|
-
this.loader = document.createElement("div"), this.loader.classList.add(
|
|
3241
|
+
this.loader = document.createElement("div"), this.loader.classList.add(Xn.loader), this.loader.appendChild(new Cr().render());
|
|
3228
3242
|
}
|
|
3229
3243
|
setClassName(e) {
|
|
3230
|
-
e ? F(this.loader, e) : this.loader.className =
|
|
3244
|
+
e ? F(this.loader, e) : this.loader.className = Xn.loader;
|
|
3231
3245
|
}
|
|
3232
3246
|
render() {
|
|
3233
3247
|
return this.loader;
|
|
3234
3248
|
}
|
|
3235
3249
|
}
|
|
3236
|
-
const
|
|
3237
|
-
checkout:
|
|
3238
|
-
hidden:
|
|
3250
|
+
const al = "_checkout_mcuv2_1", sl = "_hidden_mcuv2_8", ol = "_formInitial_mcuv2_12", ll = "_btnsInitial_mcuv2_22", Z = {
|
|
3251
|
+
checkout: al,
|
|
3252
|
+
hidden: sl,
|
|
3239
3253
|
formInitial: ol,
|
|
3240
3254
|
btnsInitial: ll
|
|
3241
3255
|
}, cl = "_buttons_qc8am_1", dl = "_hidden_qc8am_8", ul = "_skeleton_qc8am_12", be = {
|
|
@@ -3246,10 +3260,10 @@ const sl = "_checkout_mcuv2_1", al = "_hidden_mcuv2_8", ol = "_formInitial_mcuv2
|
|
|
3246
3260
|
applePay: hl,
|
|
3247
3261
|
hidden: pl
|
|
3248
3262
|
};
|
|
3249
|
-
var Vt,
|
|
3263
|
+
var Vt, Qn;
|
|
3250
3264
|
function ml() {
|
|
3251
|
-
if (
|
|
3252
|
-
|
|
3265
|
+
if (Qn) return Vt;
|
|
3266
|
+
Qn = 1;
|
|
3253
3267
|
var n = {
|
|
3254
3268
|
visa: {
|
|
3255
3269
|
niceType: "Visa",
|
|
@@ -3444,22 +3458,22 @@ function ml() {
|
|
|
3444
3458
|
};
|
|
3445
3459
|
return Vt = n, Vt;
|
|
3446
3460
|
}
|
|
3447
|
-
var Be = {}, ze = {},
|
|
3448
|
-
function
|
|
3449
|
-
if (
|
|
3450
|
-
|
|
3461
|
+
var Be = {}, ze = {}, ei;
|
|
3462
|
+
function Er() {
|
|
3463
|
+
if (ei) return ze;
|
|
3464
|
+
ei = 1, Object.defineProperty(ze, "__esModule", { value: !0 }), ze.clone = void 0;
|
|
3451
3465
|
function n(e) {
|
|
3452
3466
|
return e ? JSON.parse(JSON.stringify(e)) : null;
|
|
3453
3467
|
}
|
|
3454
3468
|
return ze.clone = n, ze;
|
|
3455
3469
|
}
|
|
3456
|
-
var $e = {},
|
|
3470
|
+
var $e = {}, ti;
|
|
3457
3471
|
function fl() {
|
|
3458
|
-
if (
|
|
3459
|
-
|
|
3460
|
-
function n(i, r,
|
|
3461
|
-
var
|
|
3462
|
-
return r = parseInt(String(r).substr(0, o.length), 10),
|
|
3472
|
+
if (ti) return $e;
|
|
3473
|
+
ti = 1, Object.defineProperty($e, "__esModule", { value: !0 }), $e.matches = void 0;
|
|
3474
|
+
function n(i, r, a) {
|
|
3475
|
+
var s = String(r).length, o = i.substr(0, s), l = parseInt(o, 10);
|
|
3476
|
+
return r = parseInt(String(r).substr(0, o.length), 10), a = parseInt(String(a).substr(0, o.length), 10), l >= r && l <= a;
|
|
3463
3477
|
}
|
|
3464
3478
|
function e(i, r) {
|
|
3465
3479
|
return r = String(r), r.substring(0, i.length) === i.substring(0, r.length);
|
|
@@ -3469,37 +3483,37 @@ function fl() {
|
|
|
3469
3483
|
}
|
|
3470
3484
|
return $e.matches = t, $e;
|
|
3471
3485
|
}
|
|
3472
|
-
var
|
|
3486
|
+
var ni;
|
|
3473
3487
|
function gl() {
|
|
3474
|
-
if (
|
|
3475
|
-
|
|
3476
|
-
var n =
|
|
3477
|
-
function t(i, r,
|
|
3478
|
-
var
|
|
3479
|
-
for (
|
|
3480
|
-
var l = r.patterns[
|
|
3488
|
+
if (ni) return Be;
|
|
3489
|
+
ni = 1, Object.defineProperty(Be, "__esModule", { value: !0 }), Be.addMatchingCardsToResults = void 0;
|
|
3490
|
+
var n = Er(), e = fl();
|
|
3491
|
+
function t(i, r, a) {
|
|
3492
|
+
var s, o;
|
|
3493
|
+
for (s = 0; s < r.patterns.length; s++) {
|
|
3494
|
+
var l = r.patterns[s];
|
|
3481
3495
|
if ((0, e.matches)(i, l)) {
|
|
3482
3496
|
var u = (0, n.clone)(r);
|
|
3483
|
-
Array.isArray(l) ? o = String(l[0]).length : o = String(l).length, i.length >= o && (u.matchStrength = o),
|
|
3497
|
+
Array.isArray(l) ? o = String(l[0]).length : o = String(l).length, i.length >= o && (u.matchStrength = o), a.push(u);
|
|
3484
3498
|
break;
|
|
3485
3499
|
}
|
|
3486
3500
|
}
|
|
3487
3501
|
}
|
|
3488
3502
|
return Be.addMatchingCardsToResults = t, Be;
|
|
3489
3503
|
}
|
|
3490
|
-
var Ke = {},
|
|
3504
|
+
var Ke = {}, ii;
|
|
3491
3505
|
function bl() {
|
|
3492
|
-
if (
|
|
3493
|
-
|
|
3506
|
+
if (ii) return Ke;
|
|
3507
|
+
ii = 1, Object.defineProperty(Ke, "__esModule", { value: !0 }), Ke.isValidInputType = void 0;
|
|
3494
3508
|
function n(e) {
|
|
3495
3509
|
return typeof e == "string" || e instanceof String;
|
|
3496
3510
|
}
|
|
3497
3511
|
return Ke.isValidInputType = n, Ke;
|
|
3498
3512
|
}
|
|
3499
|
-
var qe = {},
|
|
3513
|
+
var qe = {}, ri;
|
|
3500
3514
|
function vl() {
|
|
3501
|
-
if (
|
|
3502
|
-
|
|
3515
|
+
if (ri) return qe;
|
|
3516
|
+
ri = 1, Object.defineProperty(qe, "__esModule", { value: !0 }), qe.findBestMatch = void 0;
|
|
3503
3517
|
function n(t) {
|
|
3504
3518
|
var i = t.filter(function(r) {
|
|
3505
3519
|
return r.matchStrength;
|
|
@@ -3513,10 +3527,10 @@ function vl() {
|
|
|
3513
3527
|
}
|
|
3514
3528
|
return qe.findBestMatch = e, qe;
|
|
3515
3529
|
}
|
|
3516
|
-
var Ge,
|
|
3530
|
+
var Ge, ai;
|
|
3517
3531
|
function yl() {
|
|
3518
|
-
if (
|
|
3519
|
-
|
|
3532
|
+
if (ai) return Ge;
|
|
3533
|
+
ai = 1;
|
|
3520
3534
|
var n = Ge && Ge.__assign || function() {
|
|
3521
3535
|
return n = Object.assign || function(g) {
|
|
3522
3536
|
for (var b, y = 1, k = arguments.length; y < k; y++) {
|
|
@@ -3525,7 +3539,7 @@ function yl() {
|
|
|
3525
3539
|
}
|
|
3526
3540
|
return g;
|
|
3527
3541
|
}, n.apply(this, arguments);
|
|
3528
|
-
}, e = ml(), t = gl(), i = bl(), r = vl(),
|
|
3542
|
+
}, e = ml(), t = gl(), i = bl(), r = vl(), a = Er(), s = {}, o = {
|
|
3529
3543
|
VISA: "visa",
|
|
3530
3544
|
MASTERCARD: "mastercard",
|
|
3531
3545
|
AMERICAN_EXPRESS: "american-express",
|
|
@@ -3551,13 +3565,13 @@ function yl() {
|
|
|
3551
3565
|
o.MIR,
|
|
3552
3566
|
o.HIPER,
|
|
3553
3567
|
o.HIPERCARD
|
|
3554
|
-
], u = (0,
|
|
3568
|
+
], u = (0, a.clone)(l);
|
|
3555
3569
|
function d(g) {
|
|
3556
|
-
return
|
|
3570
|
+
return s[g] || e[g];
|
|
3557
3571
|
}
|
|
3558
3572
|
function h() {
|
|
3559
3573
|
return u.map(function(g) {
|
|
3560
|
-
return (0,
|
|
3574
|
+
return (0, a.clone)(d(g));
|
|
3561
3575
|
});
|
|
3562
3576
|
}
|
|
3563
3577
|
function m(g, b) {
|
|
@@ -3581,26 +3595,26 @@ function yl() {
|
|
|
3581
3595
|
return y ? [y] : b;
|
|
3582
3596
|
}
|
|
3583
3597
|
return p.getTypeInfo = function(g) {
|
|
3584
|
-
return (0,
|
|
3598
|
+
return (0, a.clone)(d(g));
|
|
3585
3599
|
}, p.removeCard = function(g) {
|
|
3586
3600
|
var b = m(g);
|
|
3587
3601
|
u.splice(b, 1);
|
|
3588
3602
|
}, p.addCard = function(g) {
|
|
3589
3603
|
var b = m(g.type, !0);
|
|
3590
|
-
|
|
3604
|
+
s[g.type] = g, b === -1 && u.push(g.type);
|
|
3591
3605
|
}, p.updateCard = function(g, b) {
|
|
3592
|
-
var y =
|
|
3606
|
+
var y = s[g] || e[g];
|
|
3593
3607
|
if (!y)
|
|
3594
3608
|
throw new Error('"'.concat(g, "\" is not a recognized type. Use `addCard` instead.'"));
|
|
3595
3609
|
if (b.type && y.type !== b.type)
|
|
3596
3610
|
throw new Error("Cannot overwrite type parameter.");
|
|
3597
|
-
var k = (0,
|
|
3598
|
-
k = n(n({}, k), b),
|
|
3611
|
+
var k = (0, a.clone)(y);
|
|
3612
|
+
k = n(n({}, k), b), s[k.type] = k;
|
|
3599
3613
|
}, p.changeOrder = function(g, b) {
|
|
3600
3614
|
var y = m(g);
|
|
3601
3615
|
u.splice(y, 1), u.splice(b, 0, g);
|
|
3602
3616
|
}, p.resetModifications = function() {
|
|
3603
|
-
u = (0,
|
|
3617
|
+
u = (0, a.clone)(l), s = {};
|
|
3604
3618
|
}, p.types = o, Ge = p, Ge;
|
|
3605
3619
|
}
|
|
3606
3620
|
var Pe = yl();
|
|
@@ -3611,16 +3625,16 @@ Pe.updateCard("unionpay", {
|
|
|
3611
3625
|
gaps: [4, 8, 12, 16]
|
|
3612
3626
|
});
|
|
3613
3627
|
const Cl = (n, e) => {
|
|
3614
|
-
const t = Pe.getTypeInfo(e), i = n.replace(/\D/g, ""), r = (t == null ? void 0 : t.gaps) || [4, 8, 12],
|
|
3615
|
-
for (let l = 0;
|
|
3616
|
-
const u =
|
|
3628
|
+
const t = Pe.getTypeInfo(e), i = n.replace(/\D/g, ""), r = (t == null ? void 0 : t.gaps) || [4, 8, 12], a = t ? Math.max(...t.lengths) + r.length : 19, s = [0].concat(r, i.length), o = [];
|
|
3629
|
+
for (let l = 0; s[l] < i.length; l++) {
|
|
3630
|
+
const u = s[l], d = Math.min(s[l + 1], i.length);
|
|
3617
3631
|
o.push(i.slice(u, d));
|
|
3618
3632
|
}
|
|
3619
|
-
return o.join(" ").slice(0,
|
|
3620
|
-
},
|
|
3633
|
+
return o.join(" ").slice(0, a);
|
|
3634
|
+
}, El = (n, e) => {
|
|
3621
3635
|
const t = Pe.getTypeInfo(e), i = (t == null ? void 0 : t.code.size) || 4;
|
|
3622
3636
|
return n.replace(/\D/g, "").slice(0, i);
|
|
3623
|
-
},
|
|
3637
|
+
}, kl = (n) => {
|
|
3624
3638
|
const e = n.replace(/\D/g, "");
|
|
3625
3639
|
let t = e.slice(0, 2);
|
|
3626
3640
|
if (!t) return "";
|
|
@@ -3707,14 +3721,14 @@ const bt = [
|
|
|
3707
3721
|
}, Ll = (n) => {
|
|
3708
3722
|
var e, t;
|
|
3709
3723
|
return (t = (e = Fe.find((i) => i.name === "Maestro")) == null ? void 0 : e.pattern.test(n)) != null ? t : !1;
|
|
3710
|
-
},
|
|
3724
|
+
}, kr = (n) => bt.find((e) => e.pattern.test(n)) || null, si = (n) => bt.filter((e) => e.pattern.test(n)), Vl = (n) => {
|
|
3711
3725
|
let e = 0, t = !1;
|
|
3712
3726
|
for (let i = n.length - 1; i >= 0; i--) {
|
|
3713
3727
|
let r = parseInt(n[i]);
|
|
3714
3728
|
t && (r *= 2, r > 9 && (r -= 9)), e += r, t = !t;
|
|
3715
3729
|
}
|
|
3716
3730
|
return e % 10 === 0;
|
|
3717
|
-
},
|
|
3731
|
+
}, oi = (n, e) => {
|
|
3718
3732
|
const t = n.replace(/\D/g, "");
|
|
3719
3733
|
if (!t)
|
|
3720
3734
|
return { isValid: !1, cardType: null, error: Y.Empty };
|
|
@@ -3722,7 +3736,7 @@ const bt = [
|
|
|
3722
3736
|
return { isValid: !1, cardType: null, error: Y.Invalid };
|
|
3723
3737
|
if (xl(t) || wl(t) || Tl(t) || Al(t) || _l(t) || Ll(t))
|
|
3724
3738
|
return { isValid: !1, cardType: null, error: Y.Unsupported };
|
|
3725
|
-
const i =
|
|
3739
|
+
const i = kr(t);
|
|
3726
3740
|
if (i) {
|
|
3727
3741
|
if (t.length < i.minLength || t.length > i.maxLength)
|
|
3728
3742
|
return {
|
|
@@ -3763,7 +3777,7 @@ const bt = [
|
|
|
3763
3777
|
}, Ml = (n) => {
|
|
3764
3778
|
var e, t;
|
|
3765
3779
|
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(
|
|
3766
|
-
({ is_active: r, type:
|
|
3780
|
+
({ is_active: r, type: a }) => r && a === x.APPLE_PAY
|
|
3767
3781
|
)) ? null : {
|
|
3768
3782
|
amount: n.amount,
|
|
3769
3783
|
currency: n.currency,
|
|
@@ -3889,24 +3903,24 @@ var dt = { exports: {} }, He = {};
|
|
|
3889
3903
|
* This source code is licensed under the MIT license found in the
|
|
3890
3904
|
* LICENSE file in the root directory of this source tree.
|
|
3891
3905
|
*/
|
|
3892
|
-
var
|
|
3906
|
+
var li;
|
|
3893
3907
|
function Nl() {
|
|
3894
|
-
if (
|
|
3895
|
-
|
|
3908
|
+
if (li) return He;
|
|
3909
|
+
li = 1;
|
|
3896
3910
|
var n = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
|
|
3897
|
-
function t(i, r,
|
|
3898
|
-
var
|
|
3899
|
-
if (
|
|
3900
|
-
|
|
3911
|
+
function t(i, r, a) {
|
|
3912
|
+
var s = null;
|
|
3913
|
+
if (a !== void 0 && (s = "" + a), r.key !== void 0 && (s = "" + r.key), "key" in r) {
|
|
3914
|
+
a = {};
|
|
3901
3915
|
for (var o in r)
|
|
3902
|
-
o !== "key" && (
|
|
3903
|
-
} else
|
|
3904
|
-
return r =
|
|
3916
|
+
o !== "key" && (a[o] = r[o]);
|
|
3917
|
+
} else a = r;
|
|
3918
|
+
return r = a.ref, {
|
|
3905
3919
|
$$typeof: n,
|
|
3906
3920
|
type: i,
|
|
3907
|
-
key:
|
|
3921
|
+
key: s,
|
|
3908
3922
|
ref: r !== void 0 ? r : null,
|
|
3909
|
-
props:
|
|
3923
|
+
props: a
|
|
3910
3924
|
};
|
|
3911
3925
|
}
|
|
3912
3926
|
return He.Fragment = e, He.jsx = t, He.jsxs = t, He;
|
|
@@ -3921,9 +3935,9 @@ var Ye = {};
|
|
|
3921
3935
|
* This source code is licensed under the MIT license found in the
|
|
3922
3936
|
* LICENSE file in the root directory of this source tree.
|
|
3923
3937
|
*/
|
|
3924
|
-
var
|
|
3938
|
+
var ci;
|
|
3925
3939
|
function Sl() {
|
|
3926
|
-
return
|
|
3940
|
+
return ci || (ci = 1, process.env.NODE_ENV !== "production" && function() {
|
|
3927
3941
|
function n(f) {
|
|
3928
3942
|
if (f == null) return null;
|
|
3929
3943
|
if (typeof f == "function")
|
|
@@ -4002,10 +4016,10 @@ function Sl() {
|
|
|
4002
4016
|
var f = q.A;
|
|
4003
4017
|
return f === null ? null : f.getOwner();
|
|
4004
4018
|
}
|
|
4005
|
-
function
|
|
4019
|
+
function a() {
|
|
4006
4020
|
return Error("react-stack-top-frame");
|
|
4007
4021
|
}
|
|
4008
|
-
function
|
|
4022
|
+
function s(f) {
|
|
4009
4023
|
if (Te.call(f, "key")) {
|
|
4010
4024
|
var P = Object.getOwnPropertyDescriptor(f, "key").get;
|
|
4011
4025
|
if (P && P.isReactWarning) return !1;
|
|
@@ -4026,7 +4040,7 @@ function Sl() {
|
|
|
4026
4040
|
}
|
|
4027
4041
|
function l() {
|
|
4028
4042
|
var f = n(this.type);
|
|
4029
|
-
return
|
|
4043
|
+
return Et[f] || (Et[f] = !0, console.error(
|
|
4030
4044
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
4031
4045
|
)), f = this.props.ref, f !== void 0 ? f : null;
|
|
4032
4046
|
}
|
|
@@ -4093,7 +4107,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
4093
4107
|
z
|
|
4094
4108
|
), ne[z + G] = !0);
|
|
4095
4109
|
}
|
|
4096
|
-
if (z = null, N !== void 0 && (t(N), z = "" + N),
|
|
4110
|
+
if (z = null, N !== void 0 && (t(N), z = "" + N), s(P) && (t(P.key), z = "" + P.key), "key" in P) {
|
|
4097
4111
|
N = {};
|
|
4098
4112
|
for (var pe in P)
|
|
4099
4113
|
pe !== "key" && (N[pe] = P[pe]);
|
|
@@ -4115,7 +4129,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
4115
4129
|
function h(f) {
|
|
4116
4130
|
typeof f == "object" && f !== null && f.$$typeof === p && f._store && (f._store.validated = 1);
|
|
4117
4131
|
}
|
|
4118
|
-
var m =
|
|
4132
|
+
var m = Ar, p = Symbol.for("react.transitional.element"), g = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), y = Symbol.for("react.strict_mode"), k = Symbol.for("react.profiler"), V = Symbol.for("react.consumer"), _ = Symbol.for("react.context"), M = Symbol.for("react.forward_ref"), T = Symbol.for("react.suspense"), D = Symbol.for("react.suspense_list"), C = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), R = Symbol.for("react.activity"), O = 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() {
|
|
4119
4133
|
return null;
|
|
4120
4134
|
};
|
|
4121
4135
|
m = {
|
|
@@ -4123,10 +4137,10 @@ React keys must be passed directly to JSX without using spread:
|
|
|
4123
4137
|
return f();
|
|
4124
4138
|
}
|
|
4125
4139
|
};
|
|
4126
|
-
var he,
|
|
4140
|
+
var he, Et = {}, kt = m.react_stack_bottom_frame.bind(
|
|
4127
4141
|
m,
|
|
4128
|
-
|
|
4129
|
-
)(),
|
|
4142
|
+
a
|
|
4143
|
+
)(), st = fe(i(a)), ne = {};
|
|
4130
4144
|
Ye.Fragment = b, Ye.jsx = function(f, P, N, G, ie) {
|
|
4131
4145
|
var X = 1e4 > q.recentlyCreatedOwnerStacks++;
|
|
4132
4146
|
return d(
|
|
@@ -4136,8 +4150,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
4136
4150
|
!1,
|
|
4137
4151
|
G,
|
|
4138
4152
|
ie,
|
|
4139
|
-
X ? Error("react-stack-top-frame") :
|
|
4140
|
-
X ? fe(i(f)) :
|
|
4153
|
+
X ? Error("react-stack-top-frame") : kt,
|
|
4154
|
+
X ? fe(i(f)) : st
|
|
4141
4155
|
);
|
|
4142
4156
|
}, Ye.jsxs = function(f, P, N, G, ie) {
|
|
4143
4157
|
var X = 1e4 > q.recentlyCreatedOwnerStacks++;
|
|
@@ -4148,15 +4162,15 @@ React keys must be passed directly to JSX without using spread:
|
|
|
4148
4162
|
!0,
|
|
4149
4163
|
G,
|
|
4150
4164
|
ie,
|
|
4151
|
-
X ? Error("react-stack-top-frame") :
|
|
4152
|
-
X ? fe(i(f)) :
|
|
4165
|
+
X ? Error("react-stack-top-frame") : kt,
|
|
4166
|
+
X ? fe(i(f)) : st
|
|
4153
4167
|
);
|
|
4154
4168
|
};
|
|
4155
4169
|
}()), Ye;
|
|
4156
4170
|
}
|
|
4157
|
-
var
|
|
4171
|
+
var di;
|
|
4158
4172
|
function Fl() {
|
|
4159
|
-
return
|
|
4173
|
+
return di || (di = 1, process.env.NODE_ENV === "production" ? dt.exports = Nl() : dt.exports = Sl()), dt.exports;
|
|
4160
4174
|
}
|
|
4161
4175
|
Fl();
|
|
4162
4176
|
const jl = [
|
|
@@ -4189,23 +4203,23 @@ class Bl {
|
|
|
4189
4203
|
const t = this.config.state.transaction.getState(), i = this.config.state.translate.locale(), r = Ml(t);
|
|
4190
4204
|
if (!r)
|
|
4191
4205
|
return !1;
|
|
4192
|
-
const
|
|
4193
|
-
onError: (
|
|
4206
|
+
const a = e ? I(v({}, e), {
|
|
4207
|
+
onError: (s) => {
|
|
4194
4208
|
var l, u;
|
|
4195
4209
|
if (!this.isInitialized) {
|
|
4196
|
-
console.error("Apple Pay error:",
|
|
4210
|
+
console.error("Apple Pay error:", s);
|
|
4197
4211
|
return;
|
|
4198
4212
|
}
|
|
4199
4213
|
const o = this.config.state.translate.messages();
|
|
4200
|
-
|
|
4214
|
+
s != null && s.toLowerCase().includes("cancelled") ? (l = e.onCancel) == null || l.call(e) : (vt(s, o), (u = e.onError) == null || u.call(e, s));
|
|
4201
4215
|
},
|
|
4202
|
-
onSuccess: (
|
|
4216
|
+
onSuccess: (s) => {
|
|
4203
4217
|
var o;
|
|
4204
|
-
(o = e.onSuccess) == null || o.call(e,
|
|
4218
|
+
(o = e.onSuccess) == null || o.call(e, s);
|
|
4205
4219
|
}
|
|
4206
4220
|
}) : void 0;
|
|
4207
4221
|
return yield this.ev.initApple(
|
|
4208
|
-
I(v({},
|
|
4222
|
+
I(v({}, a), {
|
|
4209
4223
|
transaction: r,
|
|
4210
4224
|
supportedCardTypes: Pl(jl),
|
|
4211
4225
|
locale: Dl(i || "en"),
|
|
@@ -4266,22 +4280,22 @@ class ql {
|
|
|
4266
4280
|
const t = this.config.state.transaction.getState(), i = this.config.state.translate.locale(), r = Il(t);
|
|
4267
4281
|
if (!r)
|
|
4268
4282
|
return !1;
|
|
4269
|
-
const
|
|
4270
|
-
onError: (
|
|
4283
|
+
const a = e ? I(v({}, e), {
|
|
4284
|
+
onError: (s) => {
|
|
4271
4285
|
var o;
|
|
4272
4286
|
if (!this.isInitialized) {
|
|
4273
|
-
console.error("Google Pay error:",
|
|
4287
|
+
console.error("Google Pay error:", s);
|
|
4274
4288
|
return;
|
|
4275
4289
|
}
|
|
4276
|
-
vt(
|
|
4290
|
+
vt(s, this.config.state.translate.messages()), (o = e.onError) == null || o.call(e, s);
|
|
4277
4291
|
},
|
|
4278
|
-
onSuccess: (
|
|
4292
|
+
onSuccess: (s) => {
|
|
4279
4293
|
var o;
|
|
4280
|
-
(o = e.onSuccess) == null || o.call(e,
|
|
4294
|
+
(o = e.onSuccess) == null || o.call(e, s);
|
|
4281
4295
|
}
|
|
4282
4296
|
}) : void 0;
|
|
4283
4297
|
return yield this.ev.initGoogle(
|
|
4284
|
-
I(v({},
|
|
4298
|
+
I(v({}, a), {
|
|
4285
4299
|
transaction: r,
|
|
4286
4300
|
locale: Rl(i || "en"),
|
|
4287
4301
|
onPaymentAttempt: this.onPaymentAttempt
|
|
@@ -4318,19 +4332,19 @@ class Yl {
|
|
|
4318
4332
|
// init
|
|
4319
4333
|
init(e) {
|
|
4320
4334
|
return E(this, null, function* () {
|
|
4321
|
-
var
|
|
4335
|
+
var s, o;
|
|
4322
4336
|
if (!this.config)
|
|
4323
4337
|
return !1;
|
|
4324
4338
|
const t = this.config.state.transaction.getState(), i = this.config.state.checkout.getState(), r = () => E(this, null, function* () {
|
|
4325
4339
|
try {
|
|
4326
|
-
return yield
|
|
4340
|
+
return yield Nr(i.clientToken, i.environment, i.apiVersion);
|
|
4327
4341
|
} catch (l) {
|
|
4328
4342
|
throw l;
|
|
4329
4343
|
}
|
|
4330
4344
|
});
|
|
4331
4345
|
if (!t || Object.keys(t).length === 0)
|
|
4332
4346
|
return console.error("PayPal transaction data is empty or invalid"), !1;
|
|
4333
|
-
if (!((
|
|
4347
|
+
if (!((s = t == null ? void 0 : t.paypal_info) != null && s.client_id))
|
|
4334
4348
|
return !1;
|
|
4335
4349
|
try {
|
|
4336
4350
|
if (yield this.paypal.init({
|
|
@@ -4344,7 +4358,7 @@ class Yl {
|
|
|
4344
4358
|
} catch (l) {
|
|
4345
4359
|
return !1;
|
|
4346
4360
|
}
|
|
4347
|
-
const
|
|
4361
|
+
const a = e ? I(v({}, e), {
|
|
4348
4362
|
onError: (l) => {
|
|
4349
4363
|
var d, h;
|
|
4350
4364
|
if (this.emitAttemptOnce(), !this.isInitialized) {
|
|
@@ -4363,24 +4377,24 @@ class Yl {
|
|
|
4363
4377
|
}
|
|
4364
4378
|
}) : void 0;
|
|
4365
4379
|
try {
|
|
4366
|
-
yield this.paypal.render(this.element, I(v({},
|
|
4380
|
+
yield this.paypal.render(this.element, I(v({}, a), {
|
|
4367
4381
|
createBillingAgreement: r,
|
|
4368
4382
|
onClick: () => {
|
|
4369
4383
|
this.emitAttemptOnce();
|
|
4370
4384
|
},
|
|
4371
4385
|
onApprove: (u) => E(this, [u], function* ({ billingToken: l }) {
|
|
4372
4386
|
var d;
|
|
4373
|
-
(d =
|
|
4387
|
+
(d = a == null ? void 0 : a.onSuccess) == null || d.call(a, l || "");
|
|
4374
4388
|
}),
|
|
4375
4389
|
style: (o = this.customButtonStyles) == null ? void 0 : o.styles,
|
|
4376
4390
|
onCancel: () => {
|
|
4377
4391
|
var l;
|
|
4378
|
-
(l =
|
|
4392
|
+
(l = a == null ? void 0 : a.onCancel) == null || l.call(a);
|
|
4379
4393
|
},
|
|
4380
4394
|
onError: (l) => {
|
|
4381
4395
|
var d, h;
|
|
4382
4396
|
const u = this.isUserCancellationError(l);
|
|
4383
|
-
!u && l ? (d =
|
|
4397
|
+
!u && l ? (d = a == null ? void 0 : a.onError) == null || d.call(a, l) : u && ((h = a == null ? void 0 : a.onCancel) == null || h.call(a));
|
|
4384
4398
|
}
|
|
4385
4399
|
}));
|
|
4386
4400
|
} catch (l) {
|
|
@@ -4408,7 +4422,7 @@ class Yl {
|
|
|
4408
4422
|
"cancelled by user",
|
|
4409
4423
|
"user cancelled",
|
|
4410
4424
|
"popup close"
|
|
4411
|
-
].some((
|
|
4425
|
+
].some((a) => t.toLowerCase().includes(a));
|
|
4412
4426
|
}
|
|
4413
4427
|
setupInterceptOverlay() {
|
|
4414
4428
|
if (this.interceptOverlay) return;
|
|
@@ -4458,7 +4472,7 @@ class Ul {
|
|
|
4458
4472
|
return this.element;
|
|
4459
4473
|
}
|
|
4460
4474
|
}
|
|
4461
|
-
const Wl = "_button_1trim_1",
|
|
4475
|
+
const Wl = "_button_1trim_1", ui = {
|
|
4462
4476
|
button: Wl
|
|
4463
4477
|
};
|
|
4464
4478
|
class Zl {
|
|
@@ -4467,10 +4481,10 @@ class Zl {
|
|
|
4467
4481
|
c(this, "icon", new Ul());
|
|
4468
4482
|
this.config = e;
|
|
4469
4483
|
const t = this.config.state.styles.getState().WalletButton, i = this.config.state.translate;
|
|
4470
|
-
this.element = document.createElement("button"), this.element.classList.add(
|
|
4484
|
+
this.element = document.createElement("button"), this.element.classList.add(ui.button, ui.press), t != null && t.className && F(this.element, t.className), t != null && t.styles && Object.assign(this.element.style, t.styles);
|
|
4471
4485
|
const r = document.createElement("span");
|
|
4472
|
-
r.textContent = i.getState().messages.card.compact.button, this.element.append(this.icon.render(), r), i.subscribe(({ messages:
|
|
4473
|
-
r.textContent =
|
|
4486
|
+
r.textContent = i.getState().messages.card.compact.button, this.element.append(this.icon.render(), r), i.subscribe(({ messages: a }) => {
|
|
4487
|
+
r.textContent = a.card.compact.button;
|
|
4474
4488
|
});
|
|
4475
4489
|
}
|
|
4476
4490
|
addEventListener(e) {
|
|
@@ -4561,8 +4575,8 @@ class ic {
|
|
|
4561
4575
|
}
|
|
4562
4576
|
// handle venmo errors
|
|
4563
4577
|
handleVenmoError(e, t) {
|
|
4564
|
-
var i, r,
|
|
4565
|
-
this.isInitialized && ((i = e == null ? void 0 : e.message) != null && i.toLowerCase().includes("close") ? (r = t == null ? void 0 : t.onCancel) == null || r.call(t) : (
|
|
4578
|
+
var i, r, a;
|
|
4579
|
+
this.isInitialized && ((i = e == null ? void 0 : e.message) != null && i.toLowerCase().includes("close") ? (r = t == null ? void 0 : t.onCancel) == null || r.call(t) : (a = t == null ? void 0 : t.onError) == null || a.call(t, e));
|
|
4566
4580
|
}
|
|
4567
4581
|
// add event listener
|
|
4568
4582
|
addEventListener(e, t) {
|
|
@@ -4632,8 +4646,8 @@ class rc {
|
|
|
4632
4646
|
};
|
|
4633
4647
|
i.addEventListener("pointerdown", r, { capture: !0 }), i.addEventListener("click", r, { capture: !0 }), i.addEventListener(
|
|
4634
4648
|
"keydown",
|
|
4635
|
-
(
|
|
4636
|
-
((
|
|
4649
|
+
(a) => {
|
|
4650
|
+
((a == null ? void 0 : a.key) === "Enter" || (a == null ? void 0 : a.key) === " ") && r();
|
|
4637
4651
|
},
|
|
4638
4652
|
{ capture: !0 }
|
|
4639
4653
|
), i.addEventListener("focusin", r, { capture: !0 }), e == null || e.addEventListener("pointerdown", r, { capture: !0 }), e == null || e.addEventListener("click", r, { capture: !0 }), e == null || e.addEventListener("focusin", r, { capture: !0 });
|
|
@@ -4671,8 +4685,8 @@ class rc {
|
|
|
4671
4685
|
};
|
|
4672
4686
|
i.addEventListener("pointerdown", r, { capture: !0 }), i.addEventListener("click", r, { capture: !0 }), i.addEventListener(
|
|
4673
4687
|
"keydown",
|
|
4674
|
-
(
|
|
4675
|
-
((
|
|
4688
|
+
(a) => {
|
|
4689
|
+
((a == null ? void 0 : a.key) === "Enter" || (a == null ? void 0 : a.key) === " ") && r();
|
|
4676
4690
|
},
|
|
4677
4691
|
{ capture: !0 }
|
|
4678
4692
|
), i.addEventListener("focusin", r, { capture: !0 }), e == null || e.addEventListener("pointerdown", r, { capture: !0 }), e == null || e.addEventListener("click", r, { capture: !0 }), e == null || e.addEventListener("focusin", r, { capture: !0 });
|
|
@@ -4749,19 +4763,19 @@ class rc {
|
|
|
4749
4763
|
// init payment methods
|
|
4750
4764
|
initPaymentMethods() {
|
|
4751
4765
|
return E(this, null, function* () {
|
|
4752
|
-
const e = this.config.state.transaction.getState(), t = Jl(zl, (e == null ? void 0 : e.checkout_config) || [], (
|
|
4753
|
-
let r = t.filter(({ is_active:
|
|
4754
|
-
(i == null ? void 0 : i.variant) === "default" && (r = r.filter(({ type:
|
|
4755
|
-
const
|
|
4756
|
-
Promise.all(
|
|
4766
|
+
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();
|
|
4767
|
+
let r = t.filter(({ is_active: s }) => s);
|
|
4768
|
+
(i == null ? void 0 : i.variant) === "default" && (r = r.filter(({ type: s }) => s !== x.CARD));
|
|
4769
|
+
const a = this.initializeButtonInstances(r);
|
|
4770
|
+
Promise.all(a).then(() => {
|
|
4757
4771
|
this.handleOnFormLoaded();
|
|
4758
4772
|
}), this.handleReady();
|
|
4759
4773
|
});
|
|
4760
4774
|
}
|
|
4761
4775
|
// initialize button instances
|
|
4762
4776
|
initializeButtonInstances(e) {
|
|
4763
|
-
const t = e.map(({ type: h }) => h), i = t.includes(x.APPLE_PAY), r = t.includes(x.GOOGLE_PAY),
|
|
4764
|
-
i && !this.applePay && (this.applePay = new Bl(this.config)), r && !this.googlePay && (this.googlePay = new ql(this.config)),
|
|
4777
|
+
const t = e.map(({ type: h }) => h), i = t.includes(x.APPLE_PAY), r = t.includes(x.GOOGLE_PAY), a = t.includes(x.PAYPAL), s = t.includes(x.VENMO), o = t.includes(x.CARD);
|
|
4778
|
+
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(() => {
|
|
4765
4779
|
this.events.open.emit();
|
|
4766
4780
|
}));
|
|
4767
4781
|
const l = e.sort((h, m) => h.order - m.order), u = /* @__PURE__ */ new Map();
|
|
@@ -4805,7 +4819,7 @@ class rc {
|
|
|
4805
4819
|
return this.buttons;
|
|
4806
4820
|
}
|
|
4807
4821
|
}
|
|
4808
|
-
class
|
|
4822
|
+
class ac {
|
|
4809
4823
|
constructor(e) {
|
|
4810
4824
|
c(this, "template", `
|
|
4811
4825
|
<svg
|
|
@@ -4831,14 +4845,14 @@ class sc {
|
|
|
4831
4845
|
return this.element;
|
|
4832
4846
|
}
|
|
4833
4847
|
}
|
|
4834
|
-
const
|
|
4835
|
-
button:
|
|
4848
|
+
const sc = "_button_125my_1", oc = {
|
|
4849
|
+
button: sc
|
|
4836
4850
|
};
|
|
4837
4851
|
class lc {
|
|
4838
4852
|
constructor(e) {
|
|
4839
4853
|
c(this, "element");
|
|
4840
4854
|
c(this, "icon");
|
|
4841
|
-
this.element = document.createElement("div"), this.element.classList.add(oc.button), this.icon = new
|
|
4855
|
+
this.element = document.createElement("div"), this.element.classList.add(oc.button), this.icon = new ac(e), this.element.appendChild(this.icon.render());
|
|
4842
4856
|
}
|
|
4843
4857
|
addEventListener(e) {
|
|
4844
4858
|
return this.element.addEventListener("click", e);
|
|
@@ -4856,7 +4870,7 @@ const cc = "_button_1d7ly_1", dc = "_disabled_1d7ly_18", uc = "_hidden_1d7ly_28"
|
|
|
4856
4870
|
class pc {
|
|
4857
4871
|
constructor(e, t) {
|
|
4858
4872
|
c(this, "element");
|
|
4859
|
-
c(this, "spinner", new
|
|
4873
|
+
c(this, "spinner", new Cr());
|
|
4860
4874
|
c(this, "message", document.createElement("span"));
|
|
4861
4875
|
c(this, "iconElement");
|
|
4862
4876
|
this.element = document.createElement("button"), this.element.setAttribute("type", "button"), this.element.classList.add(oe.button, oe.press), t != null && t.className && F(this.element, t.className), t != null && t.styles && Object.assign(this.element.style, t.styles), t != null && t.iconSvg && (this.iconElement = document.createElement("div"), this.iconElement.classList.add(S.card), this.iconElement.innerHTML = t.iconSvg), this.spinner.addClass(oe.spinner), this.spinner.addClass(oe.hidden), this.message.textContent = e.messages().card.pay.button, this.element.append(this.spinner.render()), this.iconElement && this.element.append(this.iconElement), this.element.append(this.message), e.subscribe((i) => {
|
|
@@ -4877,13 +4891,13 @@ const mc = "_cardForm_1uc4x_1", fc = "_hidden_1uc4x_6", gc = "_topOffset_1uc4x_1
|
|
|
4877
4891
|
cardForm: mc,
|
|
4878
4892
|
hidden: fc,
|
|
4879
4893
|
topOffset: gc
|
|
4880
|
-
}, bc = "_wrapper_1xw0g_1", vc = "_inputContainer_1xw0g_5", yc = "_disabled_1xw0g_23", Cc = "_input_1xw0g_5",
|
|
4894
|
+
}, bc = "_wrapper_1xw0g_1", vc = "_inputContainer_1xw0g_5", yc = "_disabled_1xw0g_23", Cc = "_input_1xw0g_5", Ec = "_errorInput_1xw0g_18", kc = "_label_1xw0g_56", xc = "_labelError_1xw0g_67", wc = "_disabledInput_1xw0g_75", Tc = "_hidden_1xw0g_82", $ = {
|
|
4881
4895
|
wrapper: bc,
|
|
4882
4896
|
inputContainer: vc,
|
|
4883
4897
|
disabled: yc,
|
|
4884
4898
|
input: Cc,
|
|
4885
|
-
errorInput:
|
|
4886
|
-
label:
|
|
4899
|
+
errorInput: Ec,
|
|
4900
|
+
label: kc,
|
|
4887
4901
|
labelError: xc,
|
|
4888
4902
|
disabledInput: wc,
|
|
4889
4903
|
hidden: Tc
|
|
@@ -4928,9 +4942,9 @@ class Ac {
|
|
|
4928
4942
|
c(this, "events", {
|
|
4929
4943
|
change: new K()
|
|
4930
4944
|
});
|
|
4931
|
-
var r,
|
|
4945
|
+
var r, a, s, o, l, u, d, h, m;
|
|
4932
4946
|
const i = e.messages();
|
|
4933
|
-
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), (
|
|
4947
|
+
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) {
|
|
4934
4948
|
const p = (b) => b.replace(/[A-Z]/g, (y) => "-" + y.toLowerCase()), g = Object.entries(t.placeholder.styles).map(([b, y]) => `${p(b)}:${y};`).join("");
|
|
4935
4949
|
this.placeholderStyle.textContent = `#${this.id}::placeholder{${g}}`, this.element.appendChild(this.placeholderStyle);
|
|
4936
4950
|
}
|
|
@@ -5133,10 +5147,10 @@ class zc {
|
|
|
5133
5147
|
c(this, "events", {
|
|
5134
5148
|
change: new K()
|
|
5135
5149
|
});
|
|
5136
|
-
var r,
|
|
5150
|
+
var r, a, s, o, l, u, d, h, m;
|
|
5137
5151
|
this.translate = e;
|
|
5138
5152
|
const i = e.messages();
|
|
5139
|
-
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), (
|
|
5153
|
+
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) {
|
|
5140
5154
|
const p = (y) => y.replace(/[A-Z]/g, (k) => "-" + k.toLowerCase()), g = Object.entries(t.placeholder.styles).map(([y, k]) => `${p(y)}:${k} !important;`).join(""), b = `#${this.id}`;
|
|
5141
5155
|
this.placeholderStyle.textContent = `${b}::placeholder{${g}}
|
|
5142
5156
|
${b}::-webkit-input-placeholder{${g}}
|
|
@@ -5163,12 +5177,12 @@ ${b}::-ms-input-placeholder{${g}}
|
|
|
5163
5177
|
handleChange(e) {
|
|
5164
5178
|
if (this.isDisabled) return;
|
|
5165
5179
|
this.isRequired = !1, this.errorMessage = "", this.isChanged || (this.isChanged = !0);
|
|
5166
|
-
const t =
|
|
5180
|
+
const t = si(e).map((a) => a.type), i = kr(e), r = Cl(e, (i == null ? void 0 : i.type) || "");
|
|
5167
5181
|
this.supportedCardTypes = t.length ? t : this.initialCardTypes, r.replace(/\D/g, "").length === ((i == null ? void 0 : i.maxLength) || 16) && this.validate(r), this.input.value = r, this.events.change.emit({
|
|
5168
5182
|
card: r,
|
|
5169
5183
|
cardType: i == null ? void 0 : i.type,
|
|
5170
5184
|
cardTypes: t,
|
|
5171
|
-
isValid:
|
|
5185
|
+
isValid: oi(e, this.supportedCardTypes).isValid
|
|
5172
5186
|
}), this.render();
|
|
5173
5187
|
}
|
|
5174
5188
|
toggleLabelError(e) {
|
|
@@ -5213,11 +5227,11 @@ ${b}::-ms-input-placeholder{${g}}
|
|
|
5213
5227
|
var e;
|
|
5214
5228
|
return {
|
|
5215
5229
|
value: this.input.value,
|
|
5216
|
-
cardType: ((e =
|
|
5230
|
+
cardType: ((e = si(this.input.value)[0]) == null ? void 0 : e.type) || ""
|
|
5217
5231
|
};
|
|
5218
5232
|
}
|
|
5219
5233
|
validate(e) {
|
|
5220
|
-
const t = this.translate.messages(), { isValid: i, error: r } =
|
|
5234
|
+
const t = this.translate.messages(), { isValid: i, error: r } = oi(e, this.supportedCardTypes);
|
|
5221
5235
|
return i ? (this.isRequired = !1, this.errorMessage = "", this.render(), i) : (r === Y.Empty ? (this.errorMessage = "", this.isRequired = !0) : r === Y.Unsupported ? (this.errorMessage = t.card.number.error.unsupported, this.isRequired = !1) : (this.errorMessage = r === Y.Incomplete ? t.card.number.error.incomplete : t.card.number.error.invalid, this.isRequired = !1), this.render(), i);
|
|
5222
5236
|
}
|
|
5223
5237
|
render() {
|
|
@@ -5303,24 +5317,24 @@ class ed {
|
|
|
5303
5317
|
expiryChange: new K(),
|
|
5304
5318
|
cvcChange: new K()
|
|
5305
5319
|
});
|
|
5306
|
-
var
|
|
5320
|
+
var s, o, l, u, d, h, m, p, g, b, y, k, V, _, M, T, D;
|
|
5307
5321
|
this.translate = e;
|
|
5308
5322
|
const i = e.messages();
|
|
5309
|
-
this.element = document.createElement("div"), this.element.classList.add(A.securityContent), this.expiryInputContainer.classList.add(A.inputContainer), (
|
|
5323
|
+
this.element = document.createElement("div"), this.element.classList.add(A.securityContent), this.expiryInputContainer.classList.add(A.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(A.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(A.endContent), this.expiryEndContent.appendChild(this.expiryWarning.render()), this.expiryInputContainer.append(this.expiryInput, this.expiryEndContent), this.expiryLabel.setAttribute("for", this.expiryId), this.expiryLabel.classList.add(A.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(A.labelError, A.hidden), this.expiryLabel.append(this.expiryLabelText, this.expiryLabelError), this.expiryError.classList.add(A.error, A.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);
|
|
5310
5324
|
const r = document.createElement("div");
|
|
5311
5325
|
if (r.appendChild(this.expiryError), this.cvcInputContainer.classList.add(A.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(A.input), (y = t == null ? void 0 : t.field) != null && y.className && F(this.cvcInput, t.field.className), (k = t == null ? void 0 : t.field) != null && k.styles && Object.assign(this.cvcInput.style, t.field.styles), (V = t == null ? void 0 : t.placeholder) != null && V.styles && Object.keys(t.placeholder.styles).length) {
|
|
5312
5326
|
const C = (R) => R.replace(/[A-Z]/g, (O) => "-" + O.toLowerCase()), w = Object.entries(t.placeholder.styles).map(([R, O]) => `${C(R)}:${O};`).join("");
|
|
5313
5327
|
this.placeholderStyle.textContent = `#${this.expiryId}::placeholder{${w}}#${this.cvcId}::placeholder{${w}}`, this.element.appendChild(this.placeholderStyle);
|
|
5314
5328
|
}
|
|
5315
5329
|
this.cvcEndContent.classList.add(A.endContent), this.cvcEndContent.appendChild(this.cardCvc.render()), this.cvcInputContainer.append(this.cvcInput, this.cvcEndContent), this.cvcLabel.setAttribute("for", this.cvcId), this.cvcLabel.classList.add(A.label), (_ = t == null ? void 0 : t.label) != null && _.className && F(this.cvcLabel, t.label.className), (M = t == null ? void 0 : t.label) != null && M.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(A.labelError, A.hidden), (T = t == null ? void 0 : t.error) != null && T.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(A.error, A.hidden);
|
|
5316
|
-
const
|
|
5317
|
-
|
|
5330
|
+
const a = document.createElement("div");
|
|
5331
|
+
a.appendChild(this.cvcError), this.element.append(
|
|
5318
5332
|
this.expiryLabel,
|
|
5319
5333
|
this.cvcLabel,
|
|
5320
5334
|
this.expiryInputContainer,
|
|
5321
5335
|
this.cvcInputContainer,
|
|
5322
5336
|
r,
|
|
5323
|
-
|
|
5337
|
+
a
|
|
5324
5338
|
), this.expiryInput.addEventListener("input", (C) => {
|
|
5325
5339
|
C.preventDefault();
|
|
5326
5340
|
const R = this.expiryInput.value.replace(/\D/g, "");
|
|
@@ -5358,7 +5372,7 @@ class ed {
|
|
|
5358
5372
|
handleCvcChange(e) {
|
|
5359
5373
|
if (this.isDisabled) return;
|
|
5360
5374
|
this.isCvcRequired = !1, this.cvcErrorMessage = "", this.isCvcChanged || (this.isCvcChanged = !0);
|
|
5361
|
-
const t =
|
|
5375
|
+
const t = El(e, this.cardType || ""), i = Pe.getTypeInfo(this.cardType || "");
|
|
5362
5376
|
t.length === (i == null ? void 0 : i.code.size) && this.validateCvc(t), this.events.cvcChange.emit({
|
|
5363
5377
|
value: t,
|
|
5364
5378
|
isValid: this.cvcValidator(t) === null
|
|
@@ -5383,8 +5397,8 @@ class ed {
|
|
|
5383
5397
|
});
|
|
5384
5398
|
}
|
|
5385
5399
|
expiryValidator(e) {
|
|
5386
|
-
const t = !e, i = e.length < 7, r = /* @__PURE__ */ new Date(), [
|
|
5387
|
-
r.setFullYear(2e3 + parseInt(
|
|
5400
|
+
const t = !e, i = e.length < 7, r = /* @__PURE__ */ new Date(), [a, s] = e.split(" / ");
|
|
5401
|
+
r.setFullYear(2e3 + parseInt(s), parseInt(a) - 1, 31);
|
|
5388
5402
|
const o = r.getTime() < Date.now(), l = /* @__PURE__ */ new Date(), u = /* @__PURE__ */ new Date();
|
|
5389
5403
|
u.setFullYear(l.getFullYear() + 50);
|
|
5390
5404
|
const d = r.getTime() > u.getTime() || r.getFullYear() < l.getFullYear();
|
|
@@ -5408,7 +5422,7 @@ class ed {
|
|
|
5408
5422
|
handleExpiryChange(e) {
|
|
5409
5423
|
if (this.isDisabled) return;
|
|
5410
5424
|
this.isExpiryRequired = !1, this.expiryErrorMessage = "", this.isExpiryChanged || (this.isExpiryChanged = !0);
|
|
5411
|
-
const t =
|
|
5425
|
+
const t = kl(e);
|
|
5412
5426
|
t.length === 7 && this.validateExpiry(t), this.events.expiryChange.emit({
|
|
5413
5427
|
value: t,
|
|
5414
5428
|
isValid: this.expiryValidator(t) === null
|
|
@@ -5466,12 +5480,12 @@ class ed {
|
|
|
5466
5480
|
render() {
|
|
5467
5481
|
const e = this.isTouchSubmit || this.isExpiryChanged, t = e && !this.isDisabled && this.isExpiryRequired, i = e && !this.isDisabled && !!this.expiryErrorMessage;
|
|
5468
5482
|
this.toggleExpiryLabelError(t), this.toggleExpiryErrorMessage(i), !t && !i ? (this.expiryInputContainer.classList.remove(A.errorInput), this.expiryEndContent.classList.add(A.hidden)) : this.expiryEndContent.classList.remove(A.hidden);
|
|
5469
|
-
const r = this.isTouchSubmit || this.isCvcChanged,
|
|
5470
|
-
return this.toggleCvcLabelError(
|
|
5483
|
+
const r = this.isTouchSubmit || this.isCvcChanged, a = r && !this.isDisabled && this.isCvcRequired, s = r && !this.isDisabled && !!this.cvcErrorMessage;
|
|
5484
|
+
return this.toggleCvcLabelError(a), this.toggleCvcErrorMessage(s), !a && !s ? (this.cvcInputContainer.classList.remove(A.errorInput), this.cvcEndContent.innerHTML = "", this.cvcEndContent.appendChild(this.cardCvc.render())) : (this.cvcEndContent.innerHTML = "", this.cvcEndContent.appendChild(this.cvcWarning.render())), this.isDisabled ? (this.expiryInputContainer.classList.add(A.disabled), this.expiryInput.classList.add(A.disabledInput), this.cvcInputContainer.classList.add(A.disabled), this.cvcInput.classList.add(A.disabledInput)) : (this.expiryInputContainer.classList.remove(A.disabled), this.expiryInput.classList.remove(A.disabledInput), this.cvcInputContainer.classList.remove(A.disabled), this.cvcInput.classList.remove(A.disabledInput)), this.element;
|
|
5471
5485
|
}
|
|
5472
5486
|
}
|
|
5473
5487
|
class td {
|
|
5474
|
-
constructor({ translate: e, className: t, stylesState: i, isDefaultVariant: r, onPaymentAttempt:
|
|
5488
|
+
constructor({ translate: e, className: t, stylesState: i, isDefaultVariant: r, onPaymentAttempt: a }) {
|
|
5475
5489
|
c(this, "element");
|
|
5476
5490
|
c(this, "submit");
|
|
5477
5491
|
c(this, "back");
|
|
@@ -5484,8 +5498,8 @@ class td {
|
|
|
5484
5498
|
submit: new K(),
|
|
5485
5499
|
close: new K()
|
|
5486
5500
|
});
|
|
5487
|
-
const
|
|
5488
|
-
this.element = document.createElement("form"), this.onPaymentAttempt =
|
|
5501
|
+
const s = i.getState();
|
|
5502
|
+
this.element = document.createElement("form"), this.onPaymentAttempt = a, this.submit = new pc(e, s.SubmitButton), this.back = new lc(s.BackButton), this.number = new zc(e, s.Input), this.name = new Ac(e, s.Input), this.cardSecurity = new ed(e, s.Input), this.element.classList.add(ve.cardForm), t && F(this.element, t);
|
|
5489
5503
|
const o = this.back.render();
|
|
5490
5504
|
r && (this.isBackVisible = !1, o.classList.add(ve.hidden), this.element.classList.add(ve.topOffset)), this.element.append(
|
|
5491
5505
|
o,
|
|
@@ -5563,16 +5577,16 @@ class nd {
|
|
|
5563
5577
|
return this.element;
|
|
5564
5578
|
}
|
|
5565
5579
|
}
|
|
5566
|
-
const id = "_container_79xkl_1", rd = "_title_79xkl_5",
|
|
5580
|
+
const id = "_container_79xkl_1", rd = "_title_79xkl_5", hi = {
|
|
5567
5581
|
container: id,
|
|
5568
5582
|
title: rd
|
|
5569
5583
|
};
|
|
5570
|
-
class
|
|
5584
|
+
class ad {
|
|
5571
5585
|
constructor() {
|
|
5572
5586
|
c(this, "element");
|
|
5573
5587
|
c(this, "message", document.createElement("p"));
|
|
5574
5588
|
c(this, "icon", new nd());
|
|
5575
|
-
this.element = document.createElement("div"), this.element.classList.add(
|
|
5589
|
+
this.element = document.createElement("div"), this.element.classList.add(hi.container), this.message.classList.add(hi.title), this.element.append(this.icon.render(), this.message);
|
|
5576
5590
|
}
|
|
5577
5591
|
addClassName(e) {
|
|
5578
5592
|
F(this.element, e);
|
|
@@ -5584,8 +5598,8 @@ class sd {
|
|
|
5584
5598
|
return this.element;
|
|
5585
5599
|
}
|
|
5586
5600
|
}
|
|
5587
|
-
const
|
|
5588
|
-
container:
|
|
5601
|
+
const sd = "_container_g3abj_1", od = "_title_g3abj_12", pi = {
|
|
5602
|
+
container: sd,
|
|
5589
5603
|
title: od
|
|
5590
5604
|
}, Ze = class Ze {
|
|
5591
5605
|
constructor(e, t) {
|
|
@@ -5594,7 +5608,7 @@ const ad = "_container_g3abj_1", od = "_title_g3abj_12", ui = {
|
|
|
5594
5608
|
c(this, "icon", new yt());
|
|
5595
5609
|
c(this, "hasCustomMessage", !1);
|
|
5596
5610
|
c(this, "hasConfigMessage", !1);
|
|
5597
|
-
this.translate = e, this.element = document.createElement("div"), this.element.classList.add(
|
|
5611
|
+
this.translate = e, this.element = document.createElement("div"), this.element.classList.add(pi.container), this.message.classList.add(pi.title), t ? (this.message.textContent = t, this.hasCustomMessage = !0, this.hasConfigMessage = !0) : this.message.textContent = e.messages().status.error, this.element.append(this.icon.render(), this.message), this.translate.subscribe(({ messages: i }) => {
|
|
5598
5612
|
this.hasCustomMessage || (this.message.textContent = i.status.error);
|
|
5599
5613
|
}), Ze.instances.add(this);
|
|
5600
5614
|
}
|
|
@@ -5654,7 +5668,7 @@ class ld {
|
|
|
5654
5668
|
var i, r;
|
|
5655
5669
|
return (r = (i = this.config.state.checkout.getState()).onCheckoutAttempt) == null ? void 0 : r.call(i, t);
|
|
5656
5670
|
}
|
|
5657
|
-
}), this.success = new
|
|
5671
|
+
}), this.success = new ad(), this.success.addClassName(Z.hidden), this.error = new Wt(e.state.translate, e.state.checkout.getState().errorMessageText), this.error.hide(), this.container.append(this.loader.render(), this.buttons.render(), this.form.render()), this.checkout = document.createElement("div"), this.checkout.classList.add(Z.checkout), this.checkout.append(this.container, this.error.render(), this.success.render());
|
|
5658
5672
|
}
|
|
5659
5673
|
// init
|
|
5660
5674
|
init() {
|
|
@@ -5693,9 +5707,9 @@ class ld {
|
|
|
5693
5707
|
i != null ? i : Promise.resolve()
|
|
5694
5708
|
]), t < this.FORM_HEIGHT && (this.checkout.style.height = ""), this.isFormOpen = !0;
|
|
5695
5709
|
})), this.buttons.addEventListener("error", (e) => {
|
|
5696
|
-
const { onCheckoutFail: t, onCheckoutLoaded: i } = this.config.state.checkout.getState(), r = this.config.state.translate.messages(),
|
|
5697
|
-
this.showError(
|
|
5698
|
-
const
|
|
5710
|
+
const { onCheckoutFail: t, onCheckoutLoaded: i } = this.config.state.checkout.getState(), r = this.config.state.translate.messages(), a = vt(e, r);
|
|
5711
|
+
this.showError(a);
|
|
5712
|
+
const s = {
|
|
5699
5713
|
status: "failed",
|
|
5700
5714
|
status_reason: {
|
|
5701
5715
|
advice_code: "try_again_later",
|
|
@@ -5703,7 +5717,7 @@ class ld {
|
|
|
5703
5717
|
message: e.message || e
|
|
5704
5718
|
}
|
|
5705
5719
|
};
|
|
5706
|
-
!this.hasLoadedOnce && i && (this.hasLoadedOnce = !0, i({ success: !1, error:
|
|
5720
|
+
!this.hasLoadedOnce && i && (this.hasLoadedOnce = !0, i({ success: !1, error: s })), t == null || t(s);
|
|
5707
5721
|
}), this.buttons.addEventListener("success", (e) => {
|
|
5708
5722
|
const { clientToken: t } = this.config.state.checkout.getState();
|
|
5709
5723
|
switch (e.type) {
|
|
@@ -5720,28 +5734,28 @@ class ld {
|
|
|
5720
5734
|
return this.handleSuccess({ clientSession: t, braintree: { nonce: e } });
|
|
5721
5735
|
}
|
|
5722
5736
|
}), this.form.addEventListener("close", () => E(this, null, function* () {
|
|
5723
|
-
var
|
|
5737
|
+
var a, s;
|
|
5724
5738
|
if (this.isLoading) return;
|
|
5725
5739
|
this.hideError();
|
|
5726
5740
|
const e = this.checkout.getBoundingClientRect().height;
|
|
5727
5741
|
let t = null;
|
|
5728
|
-
this.closedHeight > 0 && e > this.closedHeight && (this.checkout.style.height = `${e}px`, t = (
|
|
5742
|
+
this.closedHeight > 0 && e > this.closedHeight && (this.checkout.style.height = `${e}px`, t = (a = this.checkout.animate(
|
|
5729
5743
|
{ minHeight: [`${e}px`, `${this.closedHeight}px`] },
|
|
5730
5744
|
{ duration: 250, easing: "ease-out", fill: "forwards" }
|
|
5731
|
-
).finished) != null ?
|
|
5745
|
+
).finished) != null ? a : Promise.resolve()), yield H(this.form.element, Le.close, Le.transition), this.form.element.classList.add(Z.hidden);
|
|
5732
5746
|
const { variant: r } = this.config.state.checkout.getState();
|
|
5733
5747
|
if (r !== "default") {
|
|
5734
5748
|
this.buttons.buttons.classList.add(Z.btnsInitial), this.buttons.buttons.classList.remove(Z.hidden);
|
|
5735
5749
|
const o = H(this.buttons.buttons, ut.open, ut.transition);
|
|
5736
5750
|
yield Promise.all([o, t != null ? t : Promise.resolve()]);
|
|
5737
5751
|
}
|
|
5738
|
-
this.closedHeight > 0 && (t = (
|
|
5752
|
+
this.closedHeight > 0 && (t = (s = this.checkout.animate(
|
|
5739
5753
|
{ minHeight: [`${e}px`, `${this.closedHeight}px`] },
|
|
5740
5754
|
{ duration: 250, easing: "ease-out", fill: "forwards" }
|
|
5741
|
-
).finished) != null ?
|
|
5755
|
+
).finished) != null ? s : Promise.resolve(), this.checkout.style.height = "auto"), this.isFormOpen = !1;
|
|
5742
5756
|
})), this.form.addEventListener("submit", (e) => E(this, null, function* () {
|
|
5743
5757
|
if (this.isLoading || (this.form.touchSubmit(), this.hideError(), !this.form.validate())) return;
|
|
5744
|
-
const i = e.number.replace(/\D/g, ""), r = this.config.state.checkout.getState(),
|
|
5758
|
+
const i = e.number.replace(/\D/g, ""), r = this.config.state.checkout.getState(), a = this.config.service.ev.getEv(), [s, o] = yield Promise.all([a.encrypt(i), a.encrypt(e.cvc)]), [l, u] = e.expiry.split("/");
|
|
5745
5759
|
yield this.handleSuccess({
|
|
5746
5760
|
clientSession: r.clientToken,
|
|
5747
5761
|
card: {
|
|
@@ -5750,7 +5764,7 @@ class ld {
|
|
|
5750
5764
|
expMonth: Number(l),
|
|
5751
5765
|
expYear: Number(u),
|
|
5752
5766
|
cardBrand: e.cardBrand || "",
|
|
5753
|
-
number:
|
|
5767
|
+
number: s,
|
|
5754
5768
|
cvc: o,
|
|
5755
5769
|
type: x.CARD,
|
|
5756
5770
|
metadata: {
|
|
@@ -5764,21 +5778,21 @@ class ld {
|
|
|
5764
5778
|
}
|
|
5765
5779
|
// handle error
|
|
5766
5780
|
handleError(e) {
|
|
5767
|
-
var
|
|
5781
|
+
var a;
|
|
5768
5782
|
const t = this.config.state.checkout.getState(), i = this.config.state.translate.messages(), r = vt(e, i);
|
|
5769
|
-
e && (this.showError(r), (
|
|
5783
|
+
e && (this.showError(r), (a = t.onCheckoutFail) == null || a.call(t, e)), this.setLoading(!1);
|
|
5770
5784
|
}
|
|
5771
5785
|
// handle success
|
|
5772
5786
|
handleSuccess(e) {
|
|
5773
5787
|
return E(this, null, function* () {
|
|
5774
|
-
var
|
|
5788
|
+
var a, s;
|
|
5775
5789
|
if (this.isLoading) return;
|
|
5776
5790
|
this.hideError(), this.setLoading(!0);
|
|
5777
5791
|
const t = this.config.state.checkout.getState(), i = this.config.state.translate.messages();
|
|
5778
5792
|
let r;
|
|
5779
5793
|
try {
|
|
5780
|
-
if (r = yield
|
|
5781
|
-
throw new Error(((
|
|
5794
|
+
if (r = yield Or(e, t.environment, t.apiVersion), r.error)
|
|
5795
|
+
throw new Error(((a = r.error) == null ? void 0 : a.message) || i.status.error);
|
|
5782
5796
|
if (r.three_ds_session_id) {
|
|
5783
5797
|
yield this.config.service.ev.initThreeDs({
|
|
5784
5798
|
threeDsId: r.three_ds_session_id,
|
|
@@ -5806,7 +5820,7 @@ class ld {
|
|
|
5806
5820
|
}
|
|
5807
5821
|
});
|
|
5808
5822
|
}
|
|
5809
|
-
(
|
|
5823
|
+
(s = t.onCheckoutComplete) == null || s.call(t, r);
|
|
5810
5824
|
});
|
|
5811
5825
|
}
|
|
5812
5826
|
// show success
|
|
@@ -5863,12 +5877,12 @@ class cd {
|
|
|
5863
5877
|
// init
|
|
5864
5878
|
init() {
|
|
5865
5879
|
return E(this, null, function* () {
|
|
5866
|
-
const { checkout: e, transaction: t, translate: i, styles: r } = this.config.state, { apiVersion:
|
|
5867
|
-
e.subscribe(({ clientToken:
|
|
5868
|
-
const h =
|
|
5869
|
-
l && i.locale() !== l && i.setLocale(l), u && i.overrides() !== u && i.setMessages(u), d && r.setState(d), t.updateTransaction(
|
|
5880
|
+
const { checkout: e, transaction: t, translate: i, styles: r } = this.config.state, { apiVersion: a } = e.getState();
|
|
5881
|
+
e.subscribe(({ clientToken: s, environment: o, locale: l, translate: u, styles: d }) => {
|
|
5882
|
+
const h = En.teamId, m = En.appIds[o];
|
|
5883
|
+
this.config.service.ev.preloadEvervault({ teamId: h, appId: m }).finally(), l && i.locale() !== l && i.setLocale(l), u && i.overrides() !== u && i.setMessages(u), d && r.setState(d), t.updateTransaction(s, o, a).then((p) => {
|
|
5870
5884
|
if (!p)
|
|
5871
|
-
throw new Error("
|
|
5885
|
+
throw new Error("Payment config not found");
|
|
5872
5886
|
return this.config.service.ev.initEv({ teamId: h, appId: m });
|
|
5873
5887
|
}).catch((p) => {
|
|
5874
5888
|
if (console.error(p), this.component) {
|
|
@@ -5934,12 +5948,12 @@ class md extends Ct {
|
|
|
5934
5948
|
if (this.clientToken === t) return this.getState();
|
|
5935
5949
|
this.clientToken = t;
|
|
5936
5950
|
try {
|
|
5937
|
-
const
|
|
5938
|
-
return this.setState(
|
|
5939
|
-
} catch (
|
|
5940
|
-
console.error("Failed to update transaction:",
|
|
5941
|
-
const
|
|
5942
|
-
throw
|
|
5951
|
+
const a = yield Sr(t, i, r);
|
|
5952
|
+
return this.setState(a), a;
|
|
5953
|
+
} catch (a) {
|
|
5954
|
+
console.error("Failed to update transaction:", a);
|
|
5955
|
+
const s = new Error("INVALID_SESSION");
|
|
5956
|
+
throw s.name = "INVALID_SESSION", s;
|
|
5943
5957
|
}
|
|
5944
5958
|
});
|
|
5945
5959
|
}
|
|
@@ -6202,7 +6216,7 @@ const fd = {
|
|
|
6202
6216
|
error: "Η μέθοδος πληρωμής σας απορρίφθηκε. Αυτό μπορεί να οφείλεται σε ανεπαρκή κεφάλαια, ληγμένα στοιχεία πληρωμής ή περιορισμούς ασφαλείας. Παρακαλούμε ελέγξτε τα στοιχεία πληρωμής σας ή δοκιμάστε μια διαφορετική μέθοδο πληρωμής.",
|
|
6203
6217
|
invalidSession: "Η συνεδρία πληρωμής σας έχει λήξει. Παρακαλούμε ανανεώστε τη σελίδα για να συνεχίσετε."
|
|
6204
6218
|
}
|
|
6205
|
-
},
|
|
6219
|
+
}, Ed = {
|
|
6206
6220
|
card: {
|
|
6207
6221
|
required: "REQUIRED",
|
|
6208
6222
|
number: {
|
|
@@ -6245,7 +6259,7 @@ const fd = {
|
|
|
6245
6259
|
error: "Your payment method was declined. This could be due to insufficient funds, expired payment details, or security restrictions. Please check your payment details or try a different payment method.",
|
|
6246
6260
|
invalidSession: "Your payment session has expired. Please refresh the page to continue."
|
|
6247
6261
|
}
|
|
6248
|
-
},
|
|
6262
|
+
}, kd = {
|
|
6249
6263
|
card: {
|
|
6250
6264
|
required: "OBLIGATORIO",
|
|
6251
6265
|
number: {
|
|
@@ -7494,13 +7508,13 @@ const fd = {
|
|
|
7494
7508
|
}
|
|
7495
7509
|
}, Zt = {
|
|
7496
7510
|
ar: fd,
|
|
7497
|
-
en:
|
|
7511
|
+
en: Ed,
|
|
7498
7512
|
bg: gd,
|
|
7499
7513
|
cs: bd,
|
|
7500
7514
|
da: vd,
|
|
7501
7515
|
de: yd,
|
|
7502
7516
|
el: Cd,
|
|
7503
|
-
es:
|
|
7517
|
+
es: kd,
|
|
7504
7518
|
et: xd,
|
|
7505
7519
|
fi: wd,
|
|
7506
7520
|
fil: Td,
|
|
@@ -7532,8 +7546,8 @@ const fd = {
|
|
|
7532
7546
|
}, Jt = () => {
|
|
7533
7547
|
const n = navigator == null ? void 0 : navigator.language.split("-")[0];
|
|
7534
7548
|
return Zt[n] || Zt.en;
|
|
7535
|
-
},
|
|
7536
|
-
var r,
|
|
7549
|
+
}, mi = (n, e = {}) => {
|
|
7550
|
+
var r, a;
|
|
7537
7551
|
if (!n) return Jt();
|
|
7538
7552
|
const t = Zt[n] || Jt();
|
|
7539
7553
|
return {
|
|
@@ -7554,7 +7568,7 @@ const fd = {
|
|
|
7554
7568
|
}),
|
|
7555
7569
|
status: {
|
|
7556
7570
|
error: ((r = e == null ? void 0 : e.status) == null ? void 0 : r.error) || t.status.error,
|
|
7557
|
-
invalidSession: ((
|
|
7571
|
+
invalidSession: ((a = e == null ? void 0 : e.status) == null ? void 0 : a.invalidSession) || t.status.invalidSession
|
|
7558
7572
|
}
|
|
7559
7573
|
};
|
|
7560
7574
|
};
|
|
@@ -7566,11 +7580,11 @@ class Jd extends Ct {
|
|
|
7566
7580
|
});
|
|
7567
7581
|
}
|
|
7568
7582
|
setMessages(e) {
|
|
7569
|
-
const t = this.locale(), i =
|
|
7583
|
+
const t = this.locale(), i = mi(t, e);
|
|
7570
7584
|
this.setState({ locale: t, messages: i, overrides: e });
|
|
7571
7585
|
}
|
|
7572
7586
|
setLocale(e) {
|
|
7573
|
-
const t = this.overrides(), i =
|
|
7587
|
+
const t = this.overrides(), i = mi(e, t);
|
|
7574
7588
|
this.setState({ locale: e, messages: i, overrides: t });
|
|
7575
7589
|
}
|
|
7576
7590
|
overrides() {
|
|
@@ -7623,11 +7637,11 @@ class Qd {
|
|
|
7623
7637
|
if (!e.isConnected)
|
|
7624
7638
|
throw new Error("PayPal parent element must be connected to DOM before render()");
|
|
7625
7639
|
if (this.paypal) {
|
|
7626
|
-
const
|
|
7640
|
+
const a = v(v({}, Xd), (t == null ? void 0 : t.style) || {}), s = I(v({
|
|
7627
7641
|
fundingSource: "paypal"
|
|
7628
7642
|
}, t), {
|
|
7629
|
-
style:
|
|
7630
|
-
}), o = (r = (i = this.paypal).Buttons) == null ? void 0 : r.call(i,
|
|
7643
|
+
style: a
|
|
7644
|
+
}), o = (r = (i = this.paypal).Buttons) == null ? void 0 : r.call(i, s);
|
|
7631
7645
|
if (!o)
|
|
7632
7646
|
throw new Error("PayPal Buttons instance is null");
|
|
7633
7647
|
yield o.render(e);
|
|
@@ -7648,15 +7662,15 @@ class eu {
|
|
|
7648
7662
|
throw new Error("Braintree can only be initialized in browser environment");
|
|
7649
7663
|
try {
|
|
7650
7664
|
const [t, i] = yield Promise.all([
|
|
7651
|
-
import("./client-Cz7Nq-cT.js").then((
|
|
7652
|
-
import("./data-collector-DPBfun3X.js").then((
|
|
7653
|
-
]), r = t.default,
|
|
7665
|
+
import("./client-Cz7Nq-cT.js").then((s) => s.c),
|
|
7666
|
+
import("./data-collector-DPBfun3X.js").then((s) => s.d)
|
|
7667
|
+
]), r = t.default, a = i.default;
|
|
7654
7668
|
this.client = yield r.create({ authorization: e.authorization });
|
|
7655
7669
|
try {
|
|
7656
|
-
const
|
|
7657
|
-
this.deviceData =
|
|
7658
|
-
} catch (
|
|
7659
|
-
console.warn("Braintree device data collection failed:",
|
|
7670
|
+
const s = yield a.create({ client: this.client, paypal: !0 });
|
|
7671
|
+
this.deviceData = s.deviceData || null;
|
|
7672
|
+
} catch (s) {
|
|
7673
|
+
console.warn("Braintree device data collection failed:", s), this.deviceData = null;
|
|
7660
7674
|
}
|
|
7661
7675
|
} catch (t) {
|
|
7662
7676
|
throw console.error("Failed to initialize Braintree client:", t), t;
|
|
@@ -7702,9 +7716,9 @@ class eu {
|
|
|
7702
7716
|
if (i)
|
|
7703
7717
|
t(i);
|
|
7704
7718
|
else {
|
|
7705
|
-
const
|
|
7719
|
+
const a = I(v({}, r), {
|
|
7706
7720
|
device_data: this.deviceData || void 0
|
|
7707
|
-
}),
|
|
7721
|
+
}), s = r, o = (s == null ? void 0 : s.billingAddress) || (s == null ? void 0 : s.billing_address);
|
|
7708
7722
|
if (o) {
|
|
7709
7723
|
const l = {
|
|
7710
7724
|
city: o.adminArea2,
|
|
@@ -7714,16 +7728,16 @@ class eu {
|
|
|
7714
7728
|
postal_code: o.postalCode,
|
|
7715
7729
|
state: o.adminArea1
|
|
7716
7730
|
};
|
|
7717
|
-
|
|
7731
|
+
a.billing_address = l;
|
|
7718
7732
|
}
|
|
7719
|
-
e(
|
|
7733
|
+
e(a);
|
|
7720
7734
|
}
|
|
7721
7735
|
});
|
|
7722
7736
|
});
|
|
7723
7737
|
});
|
|
7724
7738
|
}
|
|
7725
7739
|
}
|
|
7726
|
-
class
|
|
7740
|
+
class su {
|
|
7727
7741
|
constructor() {
|
|
7728
7742
|
c(this, "ev", new jr());
|
|
7729
7743
|
c(this, "paypal", new Qd());
|
|
@@ -7744,7 +7758,7 @@ class au {
|
|
|
7744
7758
|
}
|
|
7745
7759
|
}
|
|
7746
7760
|
export {
|
|
7747
|
-
|
|
7761
|
+
su as Core,
|
|
7748
7762
|
iu as PayNextCheckout,
|
|
7749
7763
|
x as PaymentMethod
|
|
7750
7764
|
};
|