@nice2dev/ui-money 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +677 -665
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var tt = Object.defineProperty;
|
|
2
2
|
var rt = (t, e, r) => e in t ? tt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
-
var
|
|
4
|
-
import nt, { useState as
|
|
5
|
-
import { jsxs as
|
|
6
|
-
import { useNiceTranslation as
|
|
3
|
+
var G = (t, e, r) => rt(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import nt, { useState as H, useRef as at, useEffect as ct, useMemo as K, useCallback as j, forwardRef as se, useId as _e } from "react";
|
|
5
|
+
import { jsxs as _, jsx as c, Fragment as it } from "react/jsx-runtime";
|
|
6
|
+
import { useNiceTranslation as oe, NiceIcon as Pe, useControllableState as Me, NiceTutorialButton as st, resolveTutorial as ot } from "@nice2dev/ui-core";
|
|
7
7
|
const fe = [
|
|
8
8
|
// ── Majors ─────────────────────────────────────
|
|
9
9
|
{ code: "USD", numeric: 840, symbol: "$", name: "US Dollar", decimals: 2, symbolFirst: !0 },
|
|
@@ -227,7 +227,7 @@ const fe = [
|
|
|
227
227
|
{ code: "USDC", numeric: 0, symbol: "USDC", name: "USD Coin", decimals: 6 },
|
|
228
228
|
{ code: "USDT", numeric: 0, symbol: "USDT", name: "Tether", decimals: 6 }
|
|
229
229
|
], Le = new Map(fe.map((t) => [t.code, t]));
|
|
230
|
-
function
|
|
230
|
+
function re(t) {
|
|
231
231
|
return Le.get(t.toUpperCase());
|
|
232
232
|
}
|
|
233
233
|
function er(t) {
|
|
@@ -235,12 +235,12 @@ function er(t) {
|
|
|
235
235
|
const e = fe.findIndex((r) => r.code === t.code);
|
|
236
236
|
e >= 0 ? fe[e] = t : fe.push(t);
|
|
237
237
|
}
|
|
238
|
-
function
|
|
239
|
-
const r =
|
|
238
|
+
function ce(t, e) {
|
|
239
|
+
const r = re(e), n = (r == null ? void 0 : r.decimals) ?? 2, a = Math.pow(10, n);
|
|
240
240
|
return { amount: (t < 0 ? -1 : 1) * Math.round(Math.abs(t) * a), currency: e.toUpperCase() };
|
|
241
241
|
}
|
|
242
242
|
function He(t) {
|
|
243
|
-
const e =
|
|
243
|
+
const e = re(t.currency), r = (e == null ? void 0 : e.decimals) ?? 2;
|
|
244
244
|
return t.amount / Math.pow(10, r);
|
|
245
245
|
}
|
|
246
246
|
function lt(t, e) {
|
|
@@ -256,7 +256,7 @@ function ye(t, e) {
|
|
|
256
256
|
function dt(t, e) {
|
|
257
257
|
return $e(t, e, "subtract"), { amount: t.amount - e.amount, currency: t.currency };
|
|
258
258
|
}
|
|
259
|
-
function
|
|
259
|
+
function Se(t, e) {
|
|
260
260
|
return {
|
|
261
261
|
amount: (t.amount * e < 0 ? -1 : 1) * Math.round(Math.abs(t.amount * e)),
|
|
262
262
|
currency: t.currency
|
|
@@ -275,7 +275,7 @@ function ar(t) {
|
|
|
275
275
|
return { amount: -t.amount, currency: t.currency };
|
|
276
276
|
}
|
|
277
277
|
function ie(t, e = {}) {
|
|
278
|
-
const r =
|
|
278
|
+
const r = re(t.currency), n = e.decimals ?? (r == null ? void 0 : r.decimals) ?? 2, a = t.amount / Math.pow(10, n);
|
|
279
279
|
try {
|
|
280
280
|
return new Intl.NumberFormat(e.locale, {
|
|
281
281
|
style: "currency",
|
|
@@ -301,7 +301,7 @@ function ut(t, e) {
|
|
|
301
301
|
let s, o = "";
|
|
302
302
|
d === -1 ? s = r : (s = r.slice(0, d).replace(/[.,]/g, ""), o = r.slice(d + 1).replace(/[.,]/g, ""));
|
|
303
303
|
const l = `${s}.${o || "0"}`, y = parseFloat(l);
|
|
304
|
-
return Number.isFinite(y) ?
|
|
304
|
+
return Number.isFinite(y) ? ce(n ? -y : y, e) : null;
|
|
305
305
|
}
|
|
306
306
|
function ke(t) {
|
|
307
307
|
const e = (t || "").replace(/\D/g, "");
|
|
@@ -367,7 +367,7 @@ function qe(t, e = {}) {
|
|
|
367
367
|
}
|
|
368
368
|
class ir {
|
|
369
369
|
constructor(e) {
|
|
370
|
-
|
|
370
|
+
G(this, "id", "static");
|
|
371
371
|
this.rates = e;
|
|
372
372
|
}
|
|
373
373
|
async getRate(e, r) {
|
|
@@ -395,9 +395,9 @@ class ir {
|
|
|
395
395
|
}
|
|
396
396
|
class Ce {
|
|
397
397
|
constructor(e = {}) {
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
398
|
+
G(this, "cache", /* @__PURE__ */ new Map());
|
|
399
|
+
G(this, "fetchImpl");
|
|
400
|
+
G(this, "ttl");
|
|
401
401
|
this.fetchImpl = e.fetchImpl ?? fetch, this.ttl = e.cacheTtl ?? 6e4;
|
|
402
402
|
}
|
|
403
403
|
cacheKey(e, r) {
|
|
@@ -417,7 +417,7 @@ class Ce {
|
|
|
417
417
|
class pt extends Ce {
|
|
418
418
|
constructor(r = {}) {
|
|
419
419
|
super(r);
|
|
420
|
-
|
|
420
|
+
G(this, "id", "frankfurter");
|
|
421
421
|
}
|
|
422
422
|
async getRate(r, n) {
|
|
423
423
|
const a = r.toUpperCase(), i = n.toUpperCase();
|
|
@@ -432,14 +432,14 @@ class pt extends Ce {
|
|
|
432
432
|
const l = await o.json(), y = l.rates[i];
|
|
433
433
|
if (y == null)
|
|
434
434
|
throw new Error(`Frankfurter: no rate for ${a}/${i}`);
|
|
435
|
-
const
|
|
436
|
-
return this.setCached(
|
|
435
|
+
const N = { base: a, quote: i, rate: y, asOf: l.date };
|
|
436
|
+
return this.setCached(N), N;
|
|
437
437
|
}
|
|
438
438
|
}
|
|
439
439
|
class yt extends Ce {
|
|
440
440
|
constructor(r, n = {}) {
|
|
441
441
|
super(n);
|
|
442
|
-
|
|
442
|
+
G(this, "id", "openexchangerates");
|
|
443
443
|
this.appId = r;
|
|
444
444
|
}
|
|
445
445
|
async getRate(r, n) {
|
|
@@ -452,25 +452,25 @@ class yt extends Ce {
|
|
|
452
452
|
const s = `https://openexchangerates.org/api/latest.json?app_id=${this.appId}`, o = await this.fetchImpl(s);
|
|
453
453
|
if (!o.ok)
|
|
454
454
|
throw new Error(`OpenExchangeRates HTTP ${o.status}`);
|
|
455
|
-
const l = await o.json(), y = l.rates[a],
|
|
456
|
-
if (y == null ||
|
|
455
|
+
const l = await o.json(), y = l.rates[a], N = l.rates[i];
|
|
456
|
+
if (y == null || N == null)
|
|
457
457
|
throw new Error(`OpenExchangeRates: missing rate for ${a} or ${i}`);
|
|
458
|
-
const
|
|
458
|
+
const b = {
|
|
459
459
|
base: a,
|
|
460
460
|
quote: i,
|
|
461
|
-
rate:
|
|
461
|
+
rate: N / y,
|
|
462
462
|
asOf: new Date(l.timestamp * 1e3).toISOString()
|
|
463
463
|
};
|
|
464
|
-
return this.setCached(
|
|
464
|
+
return this.setCached(b), b;
|
|
465
465
|
}
|
|
466
466
|
}
|
|
467
467
|
class ht extends Ce {
|
|
468
468
|
constructor(r = {}) {
|
|
469
469
|
super(r);
|
|
470
|
-
|
|
470
|
+
G(this, "id", "exchangerate.host");
|
|
471
471
|
}
|
|
472
472
|
async getRate(r, n) {
|
|
473
|
-
var
|
|
473
|
+
var b;
|
|
474
474
|
const a = r.toUpperCase(), i = n.toUpperCase();
|
|
475
475
|
if (a === i)
|
|
476
476
|
return { base: a, quote: i, rate: 1, asOf: (/* @__PURE__ */ new Date()).toISOString() };
|
|
@@ -480,15 +480,15 @@ class ht extends Ce {
|
|
|
480
480
|
const s = `https://api.exchangerate.host/convert?from=${a}&to=${i}`, o = await this.fetchImpl(s);
|
|
481
481
|
if (!o.ok)
|
|
482
482
|
throw new Error(`exchangerate.host HTTP ${o.status}`);
|
|
483
|
-
const l = await o.json(), y = ((
|
|
484
|
-
return this.setCached(
|
|
483
|
+
const l = await o.json(), y = ((b = l.info) == null ? void 0 : b.rate) ?? l.result, N = { base: a, quote: i, rate: y, asOf: l.date };
|
|
484
|
+
return this.setCached(N), N;
|
|
485
485
|
}
|
|
486
486
|
}
|
|
487
487
|
class bt extends Ce {
|
|
488
488
|
constructor(r = {}) {
|
|
489
489
|
super(r);
|
|
490
|
-
|
|
491
|
-
|
|
490
|
+
G(this, "id", "nbp");
|
|
491
|
+
G(this, "table");
|
|
492
492
|
this.table = r.table ?? "A";
|
|
493
493
|
}
|
|
494
494
|
async getRate(r, n) {
|
|
@@ -498,15 +498,15 @@ class bt extends Ce {
|
|
|
498
498
|
const d = this.getCached(a, i);
|
|
499
499
|
if (d)
|
|
500
500
|
return d;
|
|
501
|
-
const s = async (
|
|
502
|
-
var
|
|
503
|
-
if (
|
|
501
|
+
const s = async (N) => {
|
|
502
|
+
var w;
|
|
503
|
+
if (N === "PLN")
|
|
504
504
|
return { rate: 1, date: (/* @__PURE__ */ new Date()).toISOString().slice(0, 10) };
|
|
505
|
-
const
|
|
505
|
+
const b = `https://api.nbp.pl/api/exchangerates/rates/${this.table}/${N}/?format=json`, u = await this.fetchImpl(b);
|
|
506
506
|
if (!u.ok)
|
|
507
507
|
return null;
|
|
508
|
-
const
|
|
509
|
-
return
|
|
508
|
+
const h = (w = (await u.json()).rates) == null ? void 0 : w[0];
|
|
509
|
+
return h ? { rate: h.mid ?? h.ask ?? 0, date: h.effectiveDate } : null;
|
|
510
510
|
}, o = await s(a), l = await s(i);
|
|
511
511
|
if (!o || !l || o.rate === 0)
|
|
512
512
|
throw new Error(`NBP: missing rate for ${a} or ${i}`);
|
|
@@ -522,13 +522,13 @@ class bt extends Ce {
|
|
|
522
522
|
class ft extends pt {
|
|
523
523
|
constructor() {
|
|
524
524
|
super(...arguments);
|
|
525
|
-
|
|
525
|
+
G(this, "id", "ecb");
|
|
526
526
|
}
|
|
527
527
|
}
|
|
528
528
|
class _t extends ht {
|
|
529
529
|
constructor() {
|
|
530
530
|
super(...arguments);
|
|
531
|
-
|
|
531
|
+
G(this, "id", "free-forex");
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
534
|
const sr = (t = {}) => new bt(t), or = (t = {}) => new ft(t), lr = (t) => new yt(t.apiKey, t), dr = (t = {}) => new _t(t);
|
|
@@ -536,7 +536,7 @@ async function gt(t, e, r) {
|
|
|
536
536
|
const n = e.toUpperCase();
|
|
537
537
|
if (t.currency.toUpperCase() === n)
|
|
538
538
|
return t;
|
|
539
|
-
const a =
|
|
539
|
+
const a = re(t.currency), i = re(n), d = (a == null ? void 0 : a.decimals) ?? 2, s = (i == null ? void 0 : i.decimals) ?? 2, { rate: o } = await r.getRate(t.currency, n), y = t.amount / Math.pow(10, d) * o;
|
|
540
540
|
return {
|
|
541
541
|
currency: n,
|
|
542
542
|
amount: Math.round(y * Math.pow(10, s))
|
|
@@ -544,11 +544,11 @@ async function gt(t, e, r) {
|
|
|
544
544
|
}
|
|
545
545
|
class vt {
|
|
546
546
|
constructor(e = {}) {
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
547
|
+
G(this, "id");
|
|
548
|
+
G(this, "name");
|
|
549
|
+
G(this, "supportedCurrencies");
|
|
550
|
+
G(this, "minimums");
|
|
551
|
+
G(this, "counter", 0);
|
|
552
552
|
this.id = e.id ?? "mock", this.name = e.name ?? "Mock Processor", this.supportedCurrencies = e.supportedCurrencies ?? "*";
|
|
553
553
|
}
|
|
554
554
|
newId(e) {
|
|
@@ -658,13 +658,13 @@ function Ct(t) {
|
|
|
658
658
|
function Dt(t) {
|
|
659
659
|
return V("mollie", "Mollie", "*", t);
|
|
660
660
|
}
|
|
661
|
-
function
|
|
661
|
+
function Pt(t) {
|
|
662
662
|
return V("braintree", "Braintree", "*", t);
|
|
663
663
|
}
|
|
664
|
-
function
|
|
664
|
+
function Mt(t) {
|
|
665
665
|
return V("razorpay", "Razorpay", ["INR", "USD", "EUR", "GBP", "AED"], t);
|
|
666
666
|
}
|
|
667
|
-
function
|
|
667
|
+
function St(t) {
|
|
668
668
|
return V(
|
|
669
669
|
"payu",
|
|
670
670
|
"PayU",
|
|
@@ -672,7 +672,7 @@ function It(t) {
|
|
|
672
672
|
t
|
|
673
673
|
);
|
|
674
674
|
}
|
|
675
|
-
function
|
|
675
|
+
function It(t) {
|
|
676
676
|
return V("przelewy24", "Przelewy24", ["PLN", "EUR"], t);
|
|
677
677
|
}
|
|
678
678
|
function $t(t = {}) {
|
|
@@ -701,25 +701,25 @@ function At(t) {
|
|
|
701
701
|
t
|
|
702
702
|
);
|
|
703
703
|
}
|
|
704
|
-
const
|
|
704
|
+
const Tt = {
|
|
705
705
|
mock: () => new vt(),
|
|
706
706
|
stripe: () => Nt(),
|
|
707
707
|
paypal: () => wt(),
|
|
708
708
|
adyen: () => kt(),
|
|
709
709
|
square: () => Ct(),
|
|
710
710
|
mollie: () => Dt(),
|
|
711
|
-
braintree: () =>
|
|
712
|
-
razorpay: () =>
|
|
713
|
-
payu: () =>
|
|
714
|
-
przelewy24: () =>
|
|
711
|
+
braintree: () => Pt(),
|
|
712
|
+
razorpay: () => Mt(),
|
|
713
|
+
payu: () => St(),
|
|
714
|
+
przelewy24: () => It(),
|
|
715
715
|
tpay: () => $t(),
|
|
716
716
|
autopay: () => xt(),
|
|
717
717
|
blik: () => Rt(),
|
|
718
718
|
klarna: () => Ut(),
|
|
719
719
|
"coinbase-commerce": () => At()
|
|
720
720
|
};
|
|
721
|
-
function
|
|
722
|
-
const e =
|
|
721
|
+
function Et(t) {
|
|
722
|
+
const e = Tt[t];
|
|
723
723
|
return e ? e().supportedCurrencies : "*";
|
|
724
724
|
}
|
|
725
725
|
function Ft(t) {
|
|
@@ -940,12 +940,12 @@ const qt = [
|
|
|
940
940
|
qt.map((t) => {
|
|
941
941
|
const { currencyKey: e, ...r } = t, n = {
|
|
942
942
|
...r,
|
|
943
|
-
supportedCurrencies:
|
|
943
|
+
supportedCurrencies: Et(e ?? t.id),
|
|
944
944
|
webhookPath: Ft(t.id)
|
|
945
945
|
};
|
|
946
946
|
return [t.id, n];
|
|
947
947
|
})
|
|
948
|
-
),
|
|
948
|
+
), Ot = /* @__PURE__ */ Object.values(
|
|
949
949
|
we
|
|
950
950
|
);
|
|
951
951
|
function ur(t) {
|
|
@@ -953,95 +953,95 @@ function ur(t) {
|
|
|
953
953
|
}
|
|
954
954
|
function mr(t, e) {
|
|
955
955
|
const r = K(
|
|
956
|
-
() => "amount" in t ? t :
|
|
956
|
+
() => "amount" in t ? t : ce(
|
|
957
957
|
t.major,
|
|
958
958
|
t.currency
|
|
959
959
|
),
|
|
960
960
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
961
961
|
[]
|
|
962
|
-
), [n, a] =
|
|
963
|
-
(
|
|
962
|
+
), [n, a] = H(r), i = j(
|
|
963
|
+
(b) => a((u) => ce(b, u.currency)),
|
|
964
964
|
[]
|
|
965
|
-
), d =
|
|
966
|
-
a((u) => ({ ...u, currency:
|
|
967
|
-
}, []), s =
|
|
968
|
-
(
|
|
965
|
+
), d = j((b) => {
|
|
966
|
+
a((u) => ({ ...u, currency: b.toUpperCase() }));
|
|
967
|
+
}, []), s = j((b) => a((u) => ye(u, b)), []), o = j(
|
|
968
|
+
(b) => a((u) => dt(u, b)),
|
|
969
969
|
[]
|
|
970
|
-
), l =
|
|
971
|
-
(
|
|
970
|
+
), l = j(
|
|
971
|
+
(b) => a((u) => Se(u, b)),
|
|
972
972
|
[]
|
|
973
|
-
), y = K(() => ie(n, { locale: e }), [n, e]),
|
|
974
|
-
return { money: n, setMoney: a, setMajor: i, setCurrency: d, add: s, subtract: o, scale: l, formatted: y, major:
|
|
973
|
+
), y = K(() => ie(n, { locale: e }), [n, e]), N = K(() => He(n), [n]);
|
|
974
|
+
return { money: n, setMoney: a, setMajor: i, setCurrency: d, add: s, subtract: o, scale: l, formatted: y, major: N };
|
|
975
975
|
}
|
|
976
|
-
function
|
|
977
|
-
const [n, a] =
|
|
976
|
+
function Ie(t, e, r) {
|
|
977
|
+
const [n, a] = H(null), [i, d] = H(null), [s, o] = H(!1), l = at(0), y = t == null ? void 0 : t.amount, N = t == null ? void 0 : t.currency;
|
|
978
978
|
return ct(() => {
|
|
979
|
-
if (
|
|
979
|
+
if (y === void 0 || N === void 0) {
|
|
980
980
|
a(null);
|
|
981
981
|
return;
|
|
982
982
|
}
|
|
983
|
-
const
|
|
984
|
-
o(!0), d(null), gt(
|
|
985
|
-
l.current ===
|
|
986
|
-
}).catch((
|
|
987
|
-
l.current ===
|
|
983
|
+
const b = ++l.current;
|
|
984
|
+
o(!0), d(null), gt({ amount: y, currency: N }, e, r).then((u) => {
|
|
985
|
+
l.current === b && a(u);
|
|
986
|
+
}).catch((u) => {
|
|
987
|
+
l.current === b && (d(u instanceof Error ? u : new Error(String(u))), a(null));
|
|
988
988
|
}).finally(() => {
|
|
989
|
-
l.current ===
|
|
989
|
+
l.current === b && o(!1);
|
|
990
990
|
});
|
|
991
|
-
}, [
|
|
991
|
+
}, [y, N, e, r]), { converted: n, loading: s, error: i };
|
|
992
992
|
}
|
|
993
|
-
function
|
|
994
|
-
const [e, r] =
|
|
993
|
+
function Kt(t) {
|
|
994
|
+
const [e, r] = H("idle"), [n, a] = H(null), [i, d] = H(null), s = j(() => {
|
|
995
995
|
r("idle"), a(null), d(null);
|
|
996
|
-
}, []), o =
|
|
997
|
-
async (
|
|
996
|
+
}, []), o = j(
|
|
997
|
+
async (b) => {
|
|
998
998
|
r("authorizing"), d(null);
|
|
999
999
|
try {
|
|
1000
|
-
const u = await t.authorize(
|
|
1000
|
+
const u = await t.authorize(b);
|
|
1001
1001
|
return a(u), r(u.status), u;
|
|
1002
1002
|
} catch (u) {
|
|
1003
|
-
const
|
|
1004
|
-
throw d(
|
|
1003
|
+
const f = u instanceof Error ? u : new Error(String(u));
|
|
1004
|
+
throw d(f), r("failed"), f;
|
|
1005
1005
|
}
|
|
1006
1006
|
},
|
|
1007
1007
|
[t]
|
|
1008
|
-
), l =
|
|
1009
|
-
async (
|
|
1010
|
-
const
|
|
1011
|
-
if (!
|
|
1008
|
+
), l = j(
|
|
1009
|
+
async (b, u) => {
|
|
1010
|
+
const f = b ?? (n == null ? void 0 : n.id);
|
|
1011
|
+
if (!f)
|
|
1012
1012
|
throw new Error("No authorization id to capture");
|
|
1013
1013
|
r("capturing");
|
|
1014
1014
|
try {
|
|
1015
|
-
const
|
|
1016
|
-
return a(
|
|
1017
|
-
} catch (
|
|
1018
|
-
const
|
|
1019
|
-
throw d(
|
|
1015
|
+
const h = await t.capture(f, u);
|
|
1016
|
+
return a(h), r(h.status), h;
|
|
1017
|
+
} catch (h) {
|
|
1018
|
+
const w = h instanceof Error ? h : new Error(String(h));
|
|
1019
|
+
throw d(w), r("failed"), w;
|
|
1020
1020
|
}
|
|
1021
1021
|
},
|
|
1022
1022
|
[t, n == null ? void 0 : n.id]
|
|
1023
|
-
), y =
|
|
1024
|
-
async (
|
|
1025
|
-
const u =
|
|
1023
|
+
), y = j(
|
|
1024
|
+
async (b) => {
|
|
1025
|
+
const u = b ?? (n == null ? void 0 : n.id);
|
|
1026
1026
|
if (!u)
|
|
1027
1027
|
throw new Error("No payment id to cancel");
|
|
1028
|
-
const
|
|
1029
|
-
return a(
|
|
1028
|
+
const f = await t.cancel(u);
|
|
1029
|
+
return a(f), r(f.status), f;
|
|
1030
1030
|
},
|
|
1031
1031
|
[t, n == null ? void 0 : n.id]
|
|
1032
|
-
),
|
|
1033
|
-
async (
|
|
1034
|
-
const
|
|
1035
|
-
if (!
|
|
1032
|
+
), N = j(
|
|
1033
|
+
async (b, u) => {
|
|
1034
|
+
const f = b ?? (n == null ? void 0 : n.id);
|
|
1035
|
+
if (!f)
|
|
1036
1036
|
throw new Error("No payment id to refund");
|
|
1037
|
-
const
|
|
1038
|
-
return a(
|
|
1037
|
+
const h = await t.refund(f, u);
|
|
1038
|
+
return a(h), r(h.status), h;
|
|
1039
1039
|
},
|
|
1040
1040
|
[t, n == null ? void 0 : n.id]
|
|
1041
1041
|
);
|
|
1042
|
-
return { status: e, response: n, error: i, authorize: o, capture: l, cancel: y, refund:
|
|
1042
|
+
return { status: e, response: n, error: i, authorize: o, capture: l, cancel: y, refund: N, reset: s };
|
|
1043
1043
|
}
|
|
1044
|
-
const
|
|
1044
|
+
const Oe = /* @__PURE__ */ se(
|
|
1045
1045
|
function({
|
|
1046
1046
|
value: e,
|
|
1047
1047
|
amount: r,
|
|
@@ -1053,34 +1053,44 @@ const Ke = /* @__PURE__ */ se(
|
|
|
1053
1053
|
convertTo: o,
|
|
1054
1054
|
exchangeProvider: l,
|
|
1055
1055
|
className: y,
|
|
1056
|
-
style:
|
|
1057
|
-
"aria-label":
|
|
1056
|
+
style: N,
|
|
1057
|
+
"aria-label": b
|
|
1058
1058
|
}, u) {
|
|
1059
|
-
const
|
|
1059
|
+
const { t: f } = oe(), h = K(() => {
|
|
1060
1060
|
if (e)
|
|
1061
1061
|
return e;
|
|
1062
1062
|
if (r != null && n) {
|
|
1063
|
-
const
|
|
1063
|
+
const v = re(n), S = (v == null ? void 0 : v.decimals) ?? 2;
|
|
1064
1064
|
return {
|
|
1065
|
-
amount: Math.round(r * Math.pow(10,
|
|
1065
|
+
amount: Math.round(r * Math.pow(10, S)),
|
|
1066
1066
|
currency: n.toUpperCase()
|
|
1067
1067
|
};
|
|
1068
1068
|
}
|
|
1069
1069
|
return null;
|
|
1070
|
-
}, [e, r, n]),
|
|
1071
|
-
o && l ?
|
|
1070
|
+
}, [e, r, n]), w = K(() => h ? h.amount === 0 && s != null ? s : ie(h, { locale: a, currencyDisplay: i }) : "", [h, a, i, s]), { converted: x } = Ie(
|
|
1071
|
+
o && l ? h : null,
|
|
1072
1072
|
o ?? "",
|
|
1073
1073
|
l
|
|
1074
1074
|
);
|
|
1075
|
-
if (!
|
|
1075
|
+
if (!h)
|
|
1076
1076
|
return null;
|
|
1077
|
-
const
|
|
1078
|
-
return /* @__PURE__ */
|
|
1079
|
-
/* @__PURE__ */ c("span", { className: "nice-money__value", children:
|
|
1080
|
-
|
|
1081
|
-
"
|
|
1082
|
-
|
|
1083
|
-
|
|
1077
|
+
const m = h.amount < 0, g = "nice-money" + (d && m ? " nice-money--negative" : "") + (y ? ` ${y}` : "");
|
|
1078
|
+
return /* @__PURE__ */ _("span", { ref: u, className: g, style: N, "aria-label": b, children: [
|
|
1079
|
+
/* @__PURE__ */ c("span", { className: "nice-money__value", children: w }),
|
|
1080
|
+
x && /* @__PURE__ */ _(
|
|
1081
|
+
"span",
|
|
1082
|
+
{
|
|
1083
|
+
className: "nice-money__converted",
|
|
1084
|
+
"aria-label": f("money.convertedTo", "Converted to {currency}").replace(
|
|
1085
|
+
"{currency}",
|
|
1086
|
+
String(x.currency)
|
|
1087
|
+
),
|
|
1088
|
+
children: [
|
|
1089
|
+
" ≈ ",
|
|
1090
|
+
ie(x, { locale: a })
|
|
1091
|
+
]
|
|
1092
|
+
}
|
|
1093
|
+
)
|
|
1084
1094
|
] });
|
|
1085
1095
|
}
|
|
1086
1096
|
), pr = fe.map((t) => t.code).sort(), Ge = /* @__PURE__ */ se(function({
|
|
@@ -1094,93 +1104,93 @@ const Ke = /* @__PURE__ */ se(
|
|
|
1094
1104
|
compact: o = !1,
|
|
1095
1105
|
disabled: l,
|
|
1096
1106
|
readOnly: y,
|
|
1097
|
-
loading:
|
|
1098
|
-
accessMode:
|
|
1107
|
+
loading: N,
|
|
1108
|
+
accessMode: b,
|
|
1099
1109
|
label: u,
|
|
1100
|
-
helperText:
|
|
1101
|
-
error:
|
|
1102
|
-
required:
|
|
1103
|
-
size:
|
|
1104
|
-
labelPlacement:
|
|
1105
|
-
labelWidth:
|
|
1106
|
-
controlWidth:
|
|
1107
|
-
className:
|
|
1108
|
-
style:
|
|
1109
|
-
id:
|
|
1110
|
-
name:
|
|
1111
|
-
title:
|
|
1112
|
-
"data-testid":
|
|
1110
|
+
helperText: f,
|
|
1111
|
+
error: h,
|
|
1112
|
+
required: w,
|
|
1113
|
+
size: x = "md",
|
|
1114
|
+
labelPlacement: m = "top",
|
|
1115
|
+
labelWidth: g,
|
|
1116
|
+
controlWidth: v,
|
|
1117
|
+
className: S,
|
|
1118
|
+
style: A,
|
|
1119
|
+
id: P,
|
|
1120
|
+
name: M,
|
|
1121
|
+
title: q,
|
|
1122
|
+
"data-testid": I,
|
|
1113
1123
|
"aria-label": W,
|
|
1114
|
-
placeholder:
|
|
1115
|
-
},
|
|
1116
|
-
const { t:
|
|
1117
|
-
if (!
|
|
1124
|
+
placeholder: B
|
|
1125
|
+
}, D) {
|
|
1126
|
+
const { t: T } = oe(), O = b === "hidden", X = l || b === "disabled" || N, ne = y || b === "readOnly", Y = _e(), Z = P ?? `nice-cs-${Y}`, [Q, ae] = H(""), E = i ?? n.length > 8, k = K(() => {
|
|
1127
|
+
if (!Q.trim())
|
|
1118
1128
|
return n;
|
|
1119
|
-
const
|
|
1129
|
+
const $ = Q.trim().toLowerCase();
|
|
1120
1130
|
return n.filter(
|
|
1121
|
-
(
|
|
1131
|
+
(R) => R.code.toLowerCase().includes($) || R.name.toLowerCase().includes($) || R.symbol.toLowerCase().includes($)
|
|
1122
1132
|
);
|
|
1123
|
-
}, [n,
|
|
1124
|
-
const
|
|
1125
|
-
return a.map((
|
|
1126
|
-
}, [a]),
|
|
1127
|
-
(
|
|
1128
|
-
const
|
|
1129
|
-
|
|
1133
|
+
}, [n, Q]), p = K(() => {
|
|
1134
|
+
const $ = /* @__PURE__ */ new Set();
|
|
1135
|
+
return a.map((R) => re(R)).filter((R) => !!R && !$.has(R.code) && !!$.add(R.code));
|
|
1136
|
+
}, [a]), F = j(
|
|
1137
|
+
($) => {
|
|
1138
|
+
const R = $.target.value, de = re(R);
|
|
1139
|
+
de && (r == null || r(R, de));
|
|
1130
1140
|
},
|
|
1131
1141
|
[r]
|
|
1132
|
-
),
|
|
1142
|
+
), z = ($) => {
|
|
1133
1143
|
if (o)
|
|
1134
|
-
return `${s ?
|
|
1135
|
-
const
|
|
1136
|
-
return s &&
|
|
1137
|
-
}, C = `nice-currency-selector nice-currency-selector--${
|
|
1138
|
-
width: typeof
|
|
1144
|
+
return `${s ? $.symbol + " " : ""}${$.code}`;
|
|
1145
|
+
const R = [];
|
|
1146
|
+
return s && R.push($.symbol), d && R.push($.code), R.push("—", $.name), R.join(" ");
|
|
1147
|
+
}, C = `nice-currency-selector nice-currency-selector--${x} nice-currency-selector--label-${m}` + (o ? " nice-currency-selector--compact" : "") + (h ? " nice-currency-selector--error" : "") + (X ? " nice-currency-selector--disabled" : "") + (S ? ` ${S}` : ""), L = m === "left" && g != null ? { width: typeof g == "number" ? `${g}px` : g, flex: "none" } : void 0, le = v != null ? {
|
|
1148
|
+
width: typeof v == "number" ? `${v}px` : v,
|
|
1139
1149
|
flex: "none"
|
|
1140
1150
|
} : void 0;
|
|
1141
|
-
return
|
|
1142
|
-
u && /* @__PURE__ */
|
|
1151
|
+
return O ? null : /* @__PURE__ */ _("div", { ref: D, className: C, style: A, title: q, "data-testid": I, children: [
|
|
1152
|
+
u && /* @__PURE__ */ _("label", { htmlFor: Z, className: "nice-currency-selector__label", style: L, children: [
|
|
1143
1153
|
u,
|
|
1144
|
-
|
|
1154
|
+
w && /* @__PURE__ */ c("span", { className: "nice-currency-selector__required", "aria-hidden": !0, children: "*" })
|
|
1145
1155
|
] }),
|
|
1146
|
-
/* @__PURE__ */
|
|
1156
|
+
/* @__PURE__ */ _("div", { className: "nice-currency-selector__inner", style: le, children: [
|
|
1147
1157
|
E && /* @__PURE__ */ c(
|
|
1148
1158
|
"input",
|
|
1149
1159
|
{
|
|
1150
1160
|
type: "search",
|
|
1151
1161
|
className: "nice-currency-selector__search",
|
|
1152
|
-
placeholder:
|
|
1153
|
-
value:
|
|
1154
|
-
onChange: (
|
|
1155
|
-
disabled:
|
|
1156
|
-
"aria-label":
|
|
1162
|
+
placeholder: T("currencySelector.searchCurrency", "Search currency…"),
|
|
1163
|
+
value: Q,
|
|
1164
|
+
onChange: ($) => ae($.target.value),
|
|
1165
|
+
disabled: X || ne,
|
|
1166
|
+
"aria-label": T("currencySelector.searchCurrency2", "Search currency")
|
|
1157
1167
|
}
|
|
1158
1168
|
),
|
|
1159
|
-
/* @__PURE__ */
|
|
1169
|
+
/* @__PURE__ */ _(
|
|
1160
1170
|
"select",
|
|
1161
1171
|
{
|
|
1162
|
-
id:
|
|
1163
|
-
name:
|
|
1172
|
+
id: Z,
|
|
1173
|
+
name: M,
|
|
1164
1174
|
className: "nice-currency-selector__select",
|
|
1165
1175
|
value: e ?? "",
|
|
1166
|
-
onChange:
|
|
1167
|
-
disabled:
|
|
1168
|
-
required:
|
|
1169
|
-
"aria-invalid": !!
|
|
1170
|
-
"aria-label": W ?? (typeof u == "string" ? u : "Currency"),
|
|
1176
|
+
onChange: F,
|
|
1177
|
+
disabled: X || ne,
|
|
1178
|
+
required: w,
|
|
1179
|
+
"aria-invalid": !!h,
|
|
1180
|
+
"aria-label": W ?? (typeof u == "string" ? u : T("currencySelector.currency", "Currency")),
|
|
1171
1181
|
children: [
|
|
1172
|
-
!e && /* @__PURE__ */ c("option", { value: "", children:
|
|
1173
|
-
|
|
1174
|
-
/* @__PURE__ */ c("optgroup", { label:
|
|
1182
|
+
!e && /* @__PURE__ */ c("option", { value: "", children: B ?? T("currencySelector.selectCurrency", "Select currency…") }),
|
|
1183
|
+
p.length > 0 && /* @__PURE__ */ c("optgroup", { label: T("currencySelector.recent", "Recent"), children: p.map(($) => /* @__PURE__ */ c("option", { value: $.code, children: z($) }, `r-${$.code}`)) }),
|
|
1184
|
+
/* @__PURE__ */ c("optgroup", { label: p.length > 0 ? T("currencySelector.all", "All") : "", children: k.map(($) => /* @__PURE__ */ c("option", { value: $.code, children: z($) }, $.code)) })
|
|
1175
1185
|
]
|
|
1176
1186
|
}
|
|
1177
1187
|
)
|
|
1178
1188
|
] }),
|
|
1179
|
-
(
|
|
1189
|
+
(h || f) && /* @__PURE__ */ c(
|
|
1180
1190
|
"span",
|
|
1181
1191
|
{
|
|
1182
|
-
className:
|
|
1183
|
-
children:
|
|
1192
|
+
className: h ? "nice-currency-selector__error" : "nice-currency-selector__helper",
|
|
1193
|
+
children: h ?? f
|
|
1184
1194
|
}
|
|
1185
1195
|
)
|
|
1186
1196
|
] });
|
|
@@ -1196,39 +1206,39 @@ const Ke = /* @__PURE__ */ se(
|
|
|
1196
1206
|
max: o,
|
|
1197
1207
|
step: l,
|
|
1198
1208
|
locale: y,
|
|
1199
|
-
placeholder:
|
|
1200
|
-
label:
|
|
1209
|
+
placeholder: N,
|
|
1210
|
+
label: b,
|
|
1201
1211
|
helperText: u,
|
|
1202
|
-
error:
|
|
1203
|
-
size:
|
|
1204
|
-
disabled:
|
|
1205
|
-
readOnly:
|
|
1206
|
-
required:
|
|
1207
|
-
loading:
|
|
1208
|
-
accessMode:
|
|
1209
|
-
labelPlacement:
|
|
1210
|
-
errorPlacement:
|
|
1211
|
-
labelWidth:
|
|
1212
|
-
controlWidth:
|
|
1213
|
-
submitOnEnter:
|
|
1214
|
-
onSubmit:
|
|
1212
|
+
error: f,
|
|
1213
|
+
size: h = "md",
|
|
1214
|
+
disabled: w,
|
|
1215
|
+
readOnly: x,
|
|
1216
|
+
required: m,
|
|
1217
|
+
loading: g,
|
|
1218
|
+
accessMode: v,
|
|
1219
|
+
labelPlacement: S = "top",
|
|
1220
|
+
errorPlacement: A = "bottom",
|
|
1221
|
+
labelWidth: P,
|
|
1222
|
+
controlWidth: M,
|
|
1223
|
+
submitOnEnter: q,
|
|
1224
|
+
onSubmit: I,
|
|
1215
1225
|
showFormattedPreview: W = !0,
|
|
1216
|
-
showSteppers:
|
|
1217
|
-
className:
|
|
1218
|
-
style:
|
|
1219
|
-
id:
|
|
1220
|
-
name:
|
|
1221
|
-
title:
|
|
1222
|
-
"data-testid":
|
|
1223
|
-
onBlur:
|
|
1224
|
-
onFocus:
|
|
1225
|
-
liveGrouping:
|
|
1226
|
+
showSteppers: B = !1,
|
|
1227
|
+
className: D,
|
|
1228
|
+
style: T,
|
|
1229
|
+
id: O,
|
|
1230
|
+
name: X,
|
|
1231
|
+
title: ne,
|
|
1232
|
+
"data-testid": Y,
|
|
1233
|
+
onBlur: Z,
|
|
1234
|
+
onFocus: Q,
|
|
1235
|
+
liveGrouping: ae,
|
|
1226
1236
|
multiplierShortcuts: E = !0,
|
|
1227
|
-
onValidationError:
|
|
1228
|
-
},
|
|
1229
|
-
const { t:
|
|
1237
|
+
onValidationError: k
|
|
1238
|
+
}, p) {
|
|
1239
|
+
const { t: F } = oe(), z = w || v === "disabled" || g, C = x || v === "readOnly", L = v === "hidden", le = _e(), $ = O ?? `nice-money-${le}`, R = ((e == null ? void 0 : e.currency) ?? n ?? "USD").toUpperCase(), de = re(R), ee = (de == null ? void 0 : de.decimals) ?? 2, xe = l ?? 1 / Math.pow(10, ee), [De, ge] = H(
|
|
1230
1240
|
() => e ? (e.amount / Math.pow(10, ee)).toFixed(ee) : ""
|
|
1231
|
-
), [ve, Re] =
|
|
1241
|
+
), [ve, Re] = H(!1);
|
|
1232
1242
|
nt.useEffect(() => {
|
|
1233
1243
|
if (ve)
|
|
1234
1244
|
return;
|
|
@@ -1236,108 +1246,108 @@ const Ke = /* @__PURE__ */ se(
|
|
|
1236
1246
|
ge("");
|
|
1237
1247
|
return;
|
|
1238
1248
|
}
|
|
1239
|
-
const
|
|
1240
|
-
ge((e.amount / Math.pow(10,
|
|
1249
|
+
const U = re(e.currency), J = (U == null ? void 0 : U.decimals) ?? 2;
|
|
1250
|
+
ge((e.amount / Math.pow(10, J)).toFixed(J));
|
|
1241
1251
|
}, [e, ve]);
|
|
1242
|
-
const Ue =
|
|
1243
|
-
(
|
|
1244
|
-
let
|
|
1252
|
+
const Ue = j(
|
|
1253
|
+
(U) => {
|
|
1254
|
+
let J = U;
|
|
1245
1255
|
if (E) {
|
|
1246
|
-
const
|
|
1247
|
-
if (
|
|
1248
|
-
const
|
|
1256
|
+
const me = U.trim().match(/^([+-]?\d+(?:[.,]\d+)?)\s*([kKmMbB])$/);
|
|
1257
|
+
if (me) {
|
|
1258
|
+
const pe = me[2].toLowerCase() === "k" ? 1e3 : me[2].toLowerCase() === "m" ? 1e6 : 1e9, Fe = Number(me[1].replace(",", ".")) * pe;
|
|
1249
1259
|
if (!Number.isFinite(Fe)) {
|
|
1250
|
-
|
|
1260
|
+
k == null || k(new Error("overflow"));
|
|
1251
1261
|
return;
|
|
1252
1262
|
}
|
|
1253
|
-
|
|
1263
|
+
J = String(Fe);
|
|
1254
1264
|
}
|
|
1255
1265
|
}
|
|
1256
|
-
const
|
|
1257
|
-
if (!
|
|
1266
|
+
const te = ut(J, R);
|
|
1267
|
+
if (!te) {
|
|
1258
1268
|
r == null || r(null);
|
|
1259
1269
|
return;
|
|
1260
1270
|
}
|
|
1261
|
-
if (!Number.isSafeInteger(
|
|
1262
|
-
|
|
1271
|
+
if (!Number.isSafeInteger(te.amount)) {
|
|
1272
|
+
k == null || k(new Error("overflow: amount exceeds Number.MAX_SAFE_INTEGER"));
|
|
1263
1273
|
return;
|
|
1264
1274
|
}
|
|
1265
|
-
const
|
|
1266
|
-
if (s != null &&
|
|
1267
|
-
|
|
1275
|
+
const ue = te.amount / Math.pow(10, ee);
|
|
1276
|
+
if (s != null && ue < s) {
|
|
1277
|
+
k == null || k(new Error(`min: ${s}`)), r == null || r(ce(s, R));
|
|
1268
1278
|
return;
|
|
1269
1279
|
}
|
|
1270
|
-
if (o != null &&
|
|
1271
|
-
|
|
1280
|
+
if (o != null && ue > o) {
|
|
1281
|
+
k == null || k(new Error(`max: ${o}`)), r == null || r(ce(o, R));
|
|
1272
1282
|
return;
|
|
1273
1283
|
}
|
|
1274
|
-
r == null || r(
|
|
1284
|
+
r == null || r(te);
|
|
1275
1285
|
},
|
|
1276
|
-
[
|
|
1277
|
-
), Je =
|
|
1278
|
-
(
|
|
1279
|
-
const
|
|
1280
|
-
ge(
|
|
1286
|
+
[R, ee, s, o, r, E, k]
|
|
1287
|
+
), Je = j(
|
|
1288
|
+
(U) => {
|
|
1289
|
+
const J = U.target.value;
|
|
1290
|
+
ge(J), Ue(J);
|
|
1281
1291
|
},
|
|
1282
1292
|
[Ue]
|
|
1283
|
-
), Ae =
|
|
1284
|
-
(
|
|
1285
|
-
const
|
|
1286
|
-
r == null || r(
|
|
1293
|
+
), Ae = j(
|
|
1294
|
+
(U) => {
|
|
1295
|
+
const te = (e ? e.amount / Math.pow(10, ee) : 0) + U, ue = Math.min(o ?? 1 / 0, Math.max(s ?? -1 / 0, te));
|
|
1296
|
+
r == null || r(ce(ue, R));
|
|
1287
1297
|
},
|
|
1288
|
-
[e, ee, s, o,
|
|
1298
|
+
[e, ee, s, o, R, r]
|
|
1289
1299
|
), Ne = K(() => {
|
|
1290
|
-
var
|
|
1300
|
+
var U, J;
|
|
1291
1301
|
try {
|
|
1292
|
-
const
|
|
1293
|
-
return { group:
|
|
1302
|
+
const te = new Intl.NumberFormat(y).formatToParts(12345.6), ue = ((U = te.find((pe) => pe.type === "group")) == null ? void 0 : U.value) ?? ",", me = ((J = te.find((pe) => pe.type === "decimal")) == null ? void 0 : J.value) ?? ".";
|
|
1303
|
+
return { group: ue, decimal: me };
|
|
1294
1304
|
} catch {
|
|
1295
1305
|
return { group: ",", decimal: "." };
|
|
1296
1306
|
}
|
|
1297
|
-
}, [y]),
|
|
1298
|
-
if (!
|
|
1307
|
+
}, [y]), Te = ae ?? !!Ne.group, Xe = K(() => {
|
|
1308
|
+
if (!Te || ve === !1)
|
|
1299
1309
|
return De;
|
|
1300
|
-
const
|
|
1301
|
-
new RegExp(`[${
|
|
1310
|
+
const U = Ne.decimal, J = Ne.group, te = De.replace(
|
|
1311
|
+
new RegExp(`[${J.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&")}]`, "g"),
|
|
1302
1312
|
""
|
|
1303
|
-
), [
|
|
1304
|
-
if (!
|
|
1305
|
-
return
|
|
1306
|
-
const
|
|
1307
|
-
return
|
|
1308
|
-
}, [De, ve,
|
|
1309
|
-
|
|
1310
|
-
}, We =
|
|
1311
|
-
width: typeof
|
|
1313
|
+
), [ue, me] = te.split(U);
|
|
1314
|
+
if (!ue)
|
|
1315
|
+
return te;
|
|
1316
|
+
const pe = ue.replace(/\B(?=(\d{3})+(?!\d))/g, J);
|
|
1317
|
+
return me != null ? `${pe}${U}${me}` : pe;
|
|
1318
|
+
}, [De, ve, Te, Ne]), Ee = K(() => e ? ie(e, { locale: y }) : "", [e, y]), he = typeof f == "string" ? f : void 0, Qe = `nice-money-input nice-money-input--${h} nice-money-input--label-${S} nice-money-input--error-${A}` + (he ? " nice-money-input--error" : "") + (z ? " nice-money-input--disabled" : "") + (g ? " nice-money-input--loading" : "") + (D ? ` ${D}` : ""), Ve = (U) => {
|
|
1319
|
+
q && U.key === "Enter" && I && (U.preventDefault(), I());
|
|
1320
|
+
}, We = S === "left" && P != null ? { width: typeof P == "number" ? `${P}px` : P, flex: "none" } : void 0, et = M != null ? {
|
|
1321
|
+
width: typeof M == "number" ? `${M}px` : M,
|
|
1312
1322
|
flex: "none"
|
|
1313
1323
|
} : void 0;
|
|
1314
|
-
return L ? null : /* @__PURE__ */
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1324
|
+
return L ? null : /* @__PURE__ */ _("div", { ref: p, className: Qe, style: T, title: ne, "data-testid": Y, children: [
|
|
1325
|
+
b && /* @__PURE__ */ _("label", { htmlFor: $, className: "nice-money-input__label", style: We, children: [
|
|
1326
|
+
b,
|
|
1327
|
+
m && /* @__PURE__ */ c("span", { className: "nice-money-input__required", "aria-hidden": !0, children: "*" })
|
|
1318
1328
|
] }),
|
|
1319
|
-
/* @__PURE__ */
|
|
1329
|
+
/* @__PURE__ */ _("div", { className: "nice-money-input__row", style: et, children: [
|
|
1320
1330
|
!d && /* @__PURE__ */ c(
|
|
1321
1331
|
Ge,
|
|
1322
1332
|
{
|
|
1323
|
-
value:
|
|
1333
|
+
value: R,
|
|
1324
1334
|
compact: !0,
|
|
1325
|
-
options: i ? i.map(
|
|
1326
|
-
onChange: (
|
|
1327
|
-
disabled:
|
|
1335
|
+
options: i ? i.map(re).filter((U) => !!U) : void 0,
|
|
1336
|
+
onChange: (U) => a == null ? void 0 : a(U),
|
|
1337
|
+
disabled: z || C,
|
|
1328
1338
|
className: "nice-money-input__currency",
|
|
1329
|
-
"aria-label":
|
|
1339
|
+
"aria-label": F("moneyInput.currency", "Currency")
|
|
1330
1340
|
}
|
|
1331
1341
|
),
|
|
1332
|
-
d && /* @__PURE__ */ c("span", { className: "nice-money-input__symbol", "aria-hidden": !0, children: (
|
|
1333
|
-
|
|
1342
|
+
d && /* @__PURE__ */ c("span", { className: "nice-money-input__symbol", "aria-hidden": !0, children: (de == null ? void 0 : de.symbol) ?? R }),
|
|
1343
|
+
B && /* @__PURE__ */ c(
|
|
1334
1344
|
"button",
|
|
1335
1345
|
{
|
|
1336
1346
|
type: "button",
|
|
1337
1347
|
className: "nice-money-input__step nice-money-input__step--down",
|
|
1338
1348
|
onClick: () => Ae(-xe),
|
|
1339
|
-
disabled:
|
|
1340
|
-
"aria-label":
|
|
1349
|
+
disabled: z || C || s != null && e != null && e.amount / Math.pow(10, ee) <= s,
|
|
1350
|
+
"aria-label": F("moneyInput.decreaseAmount", "Decrease amount"),
|
|
1341
1351
|
tabIndex: -1,
|
|
1342
1352
|
children: "−"
|
|
1343
1353
|
}
|
|
@@ -1345,8 +1355,8 @@ const Ke = /* @__PURE__ */ se(
|
|
|
1345
1355
|
/* @__PURE__ */ c(
|
|
1346
1356
|
"input",
|
|
1347
1357
|
{
|
|
1348
|
-
id:
|
|
1349
|
-
name:
|
|
1358
|
+
id: $,
|
|
1359
|
+
name: X,
|
|
1350
1360
|
type: "text",
|
|
1351
1361
|
inputMode: "decimal",
|
|
1352
1362
|
autoComplete: "transaction-amount",
|
|
@@ -1354,39 +1364,39 @@ const Ke = /* @__PURE__ */ se(
|
|
|
1354
1364
|
value: Xe,
|
|
1355
1365
|
onChange: Je,
|
|
1356
1366
|
onKeyDown: Ve,
|
|
1357
|
-
onFocus: (
|
|
1358
|
-
Re(!0),
|
|
1367
|
+
onFocus: (U) => {
|
|
1368
|
+
Re(!0), Q == null || Q(U);
|
|
1359
1369
|
},
|
|
1360
|
-
onBlur: (
|
|
1361
|
-
Re(!1), e && ge((e.amount / Math.pow(10, ee)).toFixed(ee)),
|
|
1370
|
+
onBlur: (U) => {
|
|
1371
|
+
Re(!1), e && ge((e.amount / Math.pow(10, ee)).toFixed(ee)), Z == null || Z(U);
|
|
1362
1372
|
},
|
|
1363
|
-
placeholder:
|
|
1364
|
-
disabled:
|
|
1373
|
+
placeholder: N ?? `0${ee > 0 ? "." + "0".repeat(ee) : ""}`,
|
|
1374
|
+
disabled: z,
|
|
1365
1375
|
readOnly: C,
|
|
1366
|
-
required:
|
|
1376
|
+
required: m,
|
|
1367
1377
|
"aria-invalid": !!he,
|
|
1368
|
-
"aria-describedby": he || u ? `${
|
|
1378
|
+
"aria-describedby": he || u ? `${$}-help` : void 0
|
|
1369
1379
|
}
|
|
1370
1380
|
),
|
|
1371
|
-
|
|
1381
|
+
B && /* @__PURE__ */ c(
|
|
1372
1382
|
"button",
|
|
1373
1383
|
{
|
|
1374
1384
|
type: "button",
|
|
1375
1385
|
className: "nice-money-input__step nice-money-input__step--up",
|
|
1376
1386
|
onClick: () => Ae(xe),
|
|
1377
|
-
disabled:
|
|
1378
|
-
"aria-label":
|
|
1387
|
+
disabled: z || C || o != null && e != null && e.amount / Math.pow(10, ee) >= o,
|
|
1388
|
+
"aria-label": F("moneyInput.increaseAmount", "Increase amount"),
|
|
1379
1389
|
tabIndex: -1,
|
|
1380
1390
|
children: "+"
|
|
1381
1391
|
}
|
|
1382
1392
|
),
|
|
1383
|
-
|
|
1393
|
+
g && /* @__PURE__ */ c("span", { className: "nice-money-input__spinner", "aria-hidden": !0, children: /* @__PURE__ */ c(Pe, { name: "refresh", size: 14 }) })
|
|
1384
1394
|
] }),
|
|
1385
|
-
W &&
|
|
1395
|
+
W && Ee && /* @__PURE__ */ c("span", { className: "nice-money-input__preview", "aria-live": "polite", children: Ee }),
|
|
1386
1396
|
(he || u) && /* @__PURE__ */ c(
|
|
1387
1397
|
"span",
|
|
1388
1398
|
{
|
|
1389
|
-
id: `${
|
|
1399
|
+
id: `${$}-help`,
|
|
1390
1400
|
className: he ? "nice-money-input__error" : "nice-money-input__helper",
|
|
1391
1401
|
children: he ?? u
|
|
1392
1402
|
}
|
|
@@ -1404,183 +1414,183 @@ const Ke = /* @__PURE__ */ se(
|
|
|
1404
1414
|
size: o = "md",
|
|
1405
1415
|
disabled: l,
|
|
1406
1416
|
readOnly: y,
|
|
1407
|
-
loading:
|
|
1408
|
-
accessMode:
|
|
1417
|
+
loading: N,
|
|
1418
|
+
accessMode: b,
|
|
1409
1419
|
label: u,
|
|
1410
|
-
helperText:
|
|
1411
|
-
error:
|
|
1412
|
-
required:
|
|
1413
|
-
className:
|
|
1414
|
-
style:
|
|
1415
|
-
id:
|
|
1416
|
-
title:
|
|
1417
|
-
"data-testid":
|
|
1418
|
-
},
|
|
1419
|
-
const { t:
|
|
1420
|
+
helperText: f,
|
|
1421
|
+
error: h,
|
|
1422
|
+
required: w,
|
|
1423
|
+
className: x,
|
|
1424
|
+
style: m,
|
|
1425
|
+
id: g,
|
|
1426
|
+
title: v,
|
|
1427
|
+
"data-testid": S
|
|
1428
|
+
}, A) {
|
|
1429
|
+
const { t: P } = oe(), M = b === "hidden", q = l || b === "disabled" || N, I = y || b === "readOnly", W = _e(), B = g ?? `nice-cc-${W}`, [D, T] = H({
|
|
1420
1430
|
number: !1,
|
|
1421
1431
|
expiry: !1,
|
|
1422
1432
|
cvc: !1,
|
|
1423
1433
|
holder: !1,
|
|
1424
1434
|
postal: !1
|
|
1425
|
-
}),
|
|
1435
|
+
}), O = K(() => ke(e.number), [e.number]), X = K(
|
|
1426
1436
|
() => qe(e, { requireHolder: a ?? n }),
|
|
1427
1437
|
[e, a, n]
|
|
1428
|
-
),
|
|
1438
|
+
), ne = !d || d.includes(O) || O === "unknown", Y = j(
|
|
1429
1439
|
(C) => {
|
|
1430
|
-
const L = { ...e, ...C },
|
|
1431
|
-
r == null || r(L,
|
|
1440
|
+
const L = { ...e, ...C }, le = qe(L, { requireHolder: a ?? n });
|
|
1441
|
+
r == null || r(L, le);
|
|
1432
1442
|
},
|
|
1433
1443
|
[e, a, n, r]
|
|
1434
|
-
),
|
|
1444
|
+
), Z = j(
|
|
1435
1445
|
(C) => {
|
|
1436
1446
|
const L = C.target.value.replace(/\D/g, "").slice(0, 19);
|
|
1437
|
-
|
|
1447
|
+
Y({ number: L });
|
|
1438
1448
|
},
|
|
1439
|
-
[
|
|
1440
|
-
),
|
|
1449
|
+
[Y]
|
|
1450
|
+
), Q = j(
|
|
1441
1451
|
(C) => {
|
|
1442
1452
|
const L = C.target.value.replace(/\D/g, "").slice(0, 4);
|
|
1443
|
-
let
|
|
1444
|
-
L.length >= 3 ?
|
|
1453
|
+
let le = L;
|
|
1454
|
+
L.length >= 3 ? le = `${L.slice(0, 2)}/${L.slice(2)}` : L.length === 2 && (le = `${L}/`), Y({ expiry: le });
|
|
1445
1455
|
},
|
|
1446
|
-
[
|
|
1447
|
-
),
|
|
1456
|
+
[Y]
|
|
1457
|
+
), ae = j(
|
|
1448
1458
|
(C) => {
|
|
1449
|
-
const L = C.target.value.replace(/\D/g, "").slice(0, be(
|
|
1450
|
-
|
|
1459
|
+
const L = C.target.value.replace(/\D/g, "").slice(0, be(O));
|
|
1460
|
+
Y({ cvc: L });
|
|
1451
1461
|
},
|
|
1452
|
-
[
|
|
1453
|
-
), E = K(() => mt(e.number,
|
|
1454
|
-
return
|
|
1455
|
-
u && /* @__PURE__ */
|
|
1462
|
+
[O, Y]
|
|
1463
|
+
), E = K(() => mt(e.number, O), [e.number, O]), k = D.number && e.number.length > 0 && (ze(e.number) ? ne ? void 0 : "Card brand not accepted" : X.errors.number), p = D.expiry && e.expiry.length > 0 && !Ye(e.expiry) ? X.errors.expiry : void 0, F = D.cvc && e.cvc.length > 0 && e.cvc.length !== be(O) ? X.errors.cvc : void 0, z = `nice-credit-card nice-credit-card--${o}` + (q ? " nice-credit-card--disabled" : "") + (N ? " nice-credit-card--loading" : "") + (h ? " nice-credit-card--error" : "") + (x ? ` ${x}` : "");
|
|
1464
|
+
return M ? null : /* @__PURE__ */ _("div", { ref: A, className: z, style: m, title: v, "data-testid": S, children: [
|
|
1465
|
+
u && /* @__PURE__ */ _("div", { className: "nice-credit-card__title", children: [
|
|
1456
1466
|
u,
|
|
1457
|
-
|
|
1467
|
+
w && /* @__PURE__ */ c("span", { className: "nice-credit-card__required", "aria-hidden": !0, children: "*" })
|
|
1458
1468
|
] }),
|
|
1459
|
-
/* @__PURE__ */ c("div", { className: "nice-credit-card__row", children: /* @__PURE__ */
|
|
1460
|
-
/* @__PURE__ */ c("span", { className: "nice-credit-card__label", children:
|
|
1461
|
-
/* @__PURE__ */
|
|
1469
|
+
/* @__PURE__ */ c("div", { className: "nice-credit-card__row", children: /* @__PURE__ */ _("label", { className: "nice-credit-card__field nice-credit-card__field--number", children: [
|
|
1470
|
+
/* @__PURE__ */ c("span", { className: "nice-credit-card__label", children: P("creditCardInput.cardNumber", "Card number") }),
|
|
1471
|
+
/* @__PURE__ */ _("span", { className: "nice-credit-card__input-wrapper", children: [
|
|
1462
1472
|
/* @__PURE__ */ c(
|
|
1463
1473
|
"input",
|
|
1464
1474
|
{
|
|
1465
|
-
id: `${
|
|
1475
|
+
id: `${B}-number`,
|
|
1466
1476
|
type: "text",
|
|
1467
1477
|
inputMode: "numeric",
|
|
1468
1478
|
autoComplete: "cc-number",
|
|
1469
|
-
placeholder:
|
|
1479
|
+
placeholder: O === "amex" ? "3782 822463 10005" : "1234 1234 1234 1234",
|
|
1470
1480
|
value: E,
|
|
1471
|
-
onChange:
|
|
1472
|
-
onBlur: () =>
|
|
1473
|
-
disabled:
|
|
1474
|
-
readOnly:
|
|
1475
|
-
"aria-invalid": !!
|
|
1476
|
-
"aria-describedby":
|
|
1481
|
+
onChange: Z,
|
|
1482
|
+
onBlur: () => T((C) => ({ ...C, number: !0 })),
|
|
1483
|
+
disabled: q,
|
|
1484
|
+
readOnly: I,
|
|
1485
|
+
"aria-invalid": !!k,
|
|
1486
|
+
"aria-describedby": k ? `${B}-number-err` : void 0,
|
|
1477
1487
|
className: "nice-credit-card__input",
|
|
1478
|
-
maxLength:
|
|
1488
|
+
maxLength: O === "amex" ? 17 : 23
|
|
1479
1489
|
}
|
|
1480
1490
|
),
|
|
1481
|
-
s && /* @__PURE__ */ c(Ht, { brand:
|
|
1491
|
+
s && /* @__PURE__ */ c(Ht, { brand: O })
|
|
1482
1492
|
] }),
|
|
1483
|
-
|
|
1493
|
+
k && /* @__PURE__ */ c("span", { id: `${B}-number-err`, className: "nice-credit-card__error", children: k })
|
|
1484
1494
|
] }) }),
|
|
1485
|
-
/* @__PURE__ */
|
|
1486
|
-
/* @__PURE__ */
|
|
1487
|
-
/* @__PURE__ */ c("span", { className: "nice-credit-card__label", children:
|
|
1495
|
+
/* @__PURE__ */ _("div", { className: "nice-credit-card__row nice-credit-card__row--split", children: [
|
|
1496
|
+
/* @__PURE__ */ _("label", { className: "nice-credit-card__field", children: [
|
|
1497
|
+
/* @__PURE__ */ c("span", { className: "nice-credit-card__label", children: P("creditCardInput.expiry", "Expiry") }),
|
|
1488
1498
|
/* @__PURE__ */ c(
|
|
1489
1499
|
"input",
|
|
1490
1500
|
{
|
|
1491
|
-
id: `${
|
|
1501
|
+
id: `${B}-expiry`,
|
|
1492
1502
|
type: "text",
|
|
1493
1503
|
inputMode: "numeric",
|
|
1494
1504
|
autoComplete: "cc-exp",
|
|
1495
|
-
placeholder:
|
|
1505
|
+
placeholder: P("creditCardInput.mmYy", "MM/YY"),
|
|
1496
1506
|
value: e.expiry,
|
|
1497
|
-
onChange:
|
|
1507
|
+
onChange: Q,
|
|
1498
1508
|
onBlur: () => {
|
|
1499
|
-
|
|
1509
|
+
T((L) => ({ ...L, expiry: !0 }));
|
|
1500
1510
|
const C = je(e.expiry);
|
|
1501
|
-
C && C !== e.expiry &&
|
|
1511
|
+
C && C !== e.expiry && Y({ expiry: C });
|
|
1502
1512
|
},
|
|
1503
|
-
disabled:
|
|
1504
|
-
readOnly:
|
|
1505
|
-
"aria-invalid": !!
|
|
1506
|
-
"aria-describedby":
|
|
1513
|
+
disabled: q,
|
|
1514
|
+
readOnly: I,
|
|
1515
|
+
"aria-invalid": !!p,
|
|
1516
|
+
"aria-describedby": p ? `${B}-expiry-err` : void 0,
|
|
1507
1517
|
className: "nice-credit-card__input",
|
|
1508
1518
|
maxLength: 5
|
|
1509
1519
|
}
|
|
1510
1520
|
),
|
|
1511
|
-
|
|
1521
|
+
p && /* @__PURE__ */ c("span", { id: `${B}-expiry-err`, className: "nice-credit-card__error", children: p })
|
|
1512
1522
|
] }),
|
|
1513
|
-
/* @__PURE__ */
|
|
1514
|
-
/* @__PURE__ */ c("span", { className: "nice-credit-card__label", children:
|
|
1523
|
+
/* @__PURE__ */ _("label", { className: "nice-credit-card__field", children: [
|
|
1524
|
+
/* @__PURE__ */ c("span", { className: "nice-credit-card__label", children: O === "amex" ? P("creditCardInput.cid", "CID") : P("creditCardInput.cvc", "CVC") }),
|
|
1515
1525
|
/* @__PURE__ */ c(
|
|
1516
1526
|
"input",
|
|
1517
1527
|
{
|
|
1518
|
-
id: `${
|
|
1528
|
+
id: `${B}-cvc`,
|
|
1519
1529
|
type: "text",
|
|
1520
1530
|
inputMode: "numeric",
|
|
1521
1531
|
autoComplete: "cc-csc",
|
|
1522
|
-
placeholder: "•".repeat(be(
|
|
1532
|
+
placeholder: "•".repeat(be(O)),
|
|
1523
1533
|
value: e.cvc,
|
|
1524
|
-
onChange:
|
|
1525
|
-
onBlur: () =>
|
|
1526
|
-
disabled:
|
|
1527
|
-
readOnly:
|
|
1528
|
-
"aria-invalid": !!
|
|
1529
|
-
"aria-describedby":
|
|
1534
|
+
onChange: ae,
|
|
1535
|
+
onBlur: () => T((C) => ({ ...C, cvc: !0 })),
|
|
1536
|
+
disabled: q,
|
|
1537
|
+
readOnly: I,
|
|
1538
|
+
"aria-invalid": !!F,
|
|
1539
|
+
"aria-describedby": F ? `${B}-cvc-err` : void 0,
|
|
1530
1540
|
className: "nice-credit-card__input",
|
|
1531
|
-
maxLength: be(
|
|
1541
|
+
maxLength: be(O)
|
|
1532
1542
|
}
|
|
1533
1543
|
),
|
|
1534
|
-
|
|
1544
|
+
F && /* @__PURE__ */ c("span", { id: `${B}-cvc-err`, className: "nice-credit-card__error", children: F })
|
|
1535
1545
|
] })
|
|
1536
1546
|
] }),
|
|
1537
|
-
n && /* @__PURE__ */ c("div", { className: "nice-credit-card__row", children: /* @__PURE__ */
|
|
1538
|
-
/* @__PURE__ */ c("span", { className: "nice-credit-card__label", children:
|
|
1547
|
+
n && /* @__PURE__ */ c("div", { className: "nice-credit-card__row", children: /* @__PURE__ */ _("label", { className: "nice-credit-card__field", children: [
|
|
1548
|
+
/* @__PURE__ */ c("span", { className: "nice-credit-card__label", children: P("creditCardInput.cardholderName", "Cardholder name") }),
|
|
1539
1549
|
/* @__PURE__ */ c(
|
|
1540
1550
|
"input",
|
|
1541
1551
|
{
|
|
1542
|
-
id: `${
|
|
1552
|
+
id: `${B}-holder`,
|
|
1543
1553
|
type: "text",
|
|
1544
1554
|
autoComplete: "cc-name",
|
|
1545
|
-
placeholder:
|
|
1555
|
+
placeholder: P("creditCardInput.janeDoe", "Jane Doe"),
|
|
1546
1556
|
value: e.holderName ?? "",
|
|
1547
|
-
onChange: (C) =>
|
|
1548
|
-
onBlur: () =>
|
|
1549
|
-
disabled:
|
|
1550
|
-
readOnly:
|
|
1557
|
+
onChange: (C) => Y({ holderName: C.target.value }),
|
|
1558
|
+
onBlur: () => T((C) => ({ ...C, holder: !0 })),
|
|
1559
|
+
disabled: q,
|
|
1560
|
+
readOnly: I,
|
|
1551
1561
|
className: "nice-credit-card__input",
|
|
1552
1562
|
maxLength: 120
|
|
1553
1563
|
}
|
|
1554
1564
|
)
|
|
1555
1565
|
] }) }),
|
|
1556
|
-
i && /* @__PURE__ */ c("div", { className: "nice-credit-card__row", children: /* @__PURE__ */
|
|
1557
|
-
/* @__PURE__ */ c("span", { className: "nice-credit-card__label", children:
|
|
1566
|
+
i && /* @__PURE__ */ c("div", { className: "nice-credit-card__row", children: /* @__PURE__ */ _("label", { className: "nice-credit-card__field", children: [
|
|
1567
|
+
/* @__PURE__ */ c("span", { className: "nice-credit-card__label", children: P("creditCardInput.postalCode", "Postal code") }),
|
|
1558
1568
|
/* @__PURE__ */ c(
|
|
1559
1569
|
"input",
|
|
1560
1570
|
{
|
|
1561
|
-
id: `${
|
|
1571
|
+
id: `${B}-postal`,
|
|
1562
1572
|
type: "text",
|
|
1563
1573
|
autoComplete: "postal-code",
|
|
1564
1574
|
value: e.postalCode ?? "",
|
|
1565
|
-
onChange: (C) =>
|
|
1566
|
-
onBlur: () =>
|
|
1567
|
-
disabled:
|
|
1568
|
-
readOnly:
|
|
1575
|
+
onChange: (C) => Y({ postalCode: C.target.value }),
|
|
1576
|
+
onBlur: () => T((C) => ({ ...C, postal: !0 })),
|
|
1577
|
+
disabled: q,
|
|
1578
|
+
readOnly: I,
|
|
1569
1579
|
className: "nice-credit-card__input",
|
|
1570
1580
|
maxLength: 16
|
|
1571
1581
|
}
|
|
1572
1582
|
)
|
|
1573
1583
|
] }) }),
|
|
1574
|
-
(
|
|
1584
|
+
(h || f) && /* @__PURE__ */ c(
|
|
1575
1585
|
"div",
|
|
1576
1586
|
{
|
|
1577
|
-
className:
|
|
1578
|
-
role:
|
|
1579
|
-
children:
|
|
1587
|
+
className: h ? "nice-credit-card__form-error" : "nice-credit-card__helper",
|
|
1588
|
+
role: h ? "alert" : void 0,
|
|
1589
|
+
children: h ?? f
|
|
1580
1590
|
}
|
|
1581
1591
|
)
|
|
1582
1592
|
] });
|
|
1583
|
-
}),
|
|
1593
|
+
}), Ke = {
|
|
1584
1594
|
visa: "VISA",
|
|
1585
1595
|
mastercard: "MasterCard",
|
|
1586
1596
|
amex: "AMEX",
|
|
@@ -1599,8 +1609,8 @@ function Ht({ brand: t }) {
|
|
|
1599
1609
|
"span",
|
|
1600
1610
|
{
|
|
1601
1611
|
className: `nice-credit-card__brand nice-credit-card__brand--${t}`,
|
|
1602
|
-
"aria-label":
|
|
1603
|
-
children:
|
|
1612
|
+
"aria-label": Ke[t],
|
|
1613
|
+
children: Ke[t]
|
|
1604
1614
|
}
|
|
1605
1615
|
);
|
|
1606
1616
|
}
|
|
@@ -1614,128 +1624,123 @@ const yr = /* @__PURE__ */ se(
|
|
|
1614
1624
|
description: d,
|
|
1615
1625
|
metadata: s,
|
|
1616
1626
|
autoCapture: o = !0,
|
|
1617
|
-
submitLabel: l
|
|
1627
|
+
submitLabel: l,
|
|
1618
1628
|
onSuccess: y,
|
|
1619
|
-
onError:
|
|
1620
|
-
consents:
|
|
1629
|
+
onError: N,
|
|
1630
|
+
consents: b,
|
|
1621
1631
|
className: u,
|
|
1622
|
-
style:
|
|
1623
|
-
},
|
|
1624
|
-
const { t:
|
|
1625
|
-
var
|
|
1626
|
-
const
|
|
1627
|
-
return
|
|
1628
|
-
}, [e,
|
|
1629
|
-
var
|
|
1630
|
-
const
|
|
1631
|
-
return
|
|
1632
|
-
}, [e,
|
|
1633
|
-
async (
|
|
1634
|
-
if (
|
|
1635
|
-
|
|
1632
|
+
style: f
|
|
1633
|
+
}, h) {
|
|
1634
|
+
const { t: w } = oe(), x = l ?? w("paymentForm.pay", "Pay"), [m, g] = H(r), [v, S] = H(r.currency), [A, P] = H({ number: "", expiry: "", cvc: "" }), [M, q] = H(null), [I, W] = H(!1), [B, D] = H(null), T = Kt(e), O = K(() => e.supportedCurrencies === "*" ? !0 : e.supportedCurrencies.includes(m.currency.toUpperCase()), [e, m.currency]), X = K(() => {
|
|
1635
|
+
var k;
|
|
1636
|
+
const E = (k = e.minimums) == null ? void 0 : k[m.currency.toUpperCase()];
|
|
1637
|
+
return E == null || m.amount >= E;
|
|
1638
|
+
}, [e, m]), ne = K(() => {
|
|
1639
|
+
var k;
|
|
1640
|
+
const E = (k = e.minimums) == null ? void 0 : k[m.currency.toUpperCase()];
|
|
1641
|
+
return E == null ? null : { amount: E, currency: m.currency };
|
|
1642
|
+
}, [e, m.currency]), Y = !!(M != null && M.isValid), Z = !I && O && X && Y, Q = j(
|
|
1643
|
+
async (E) => {
|
|
1644
|
+
if (E.preventDefault(), !!Z) {
|
|
1645
|
+
D(null), W(!0);
|
|
1636
1646
|
try {
|
|
1637
|
-
const
|
|
1638
|
-
amount:
|
|
1639
|
-
card:
|
|
1647
|
+
const k = {
|
|
1648
|
+
amount: m,
|
|
1649
|
+
card: A,
|
|
1640
1650
|
customer: a,
|
|
1641
1651
|
description: d,
|
|
1642
1652
|
metadata: s,
|
|
1643
1653
|
idempotencyKey: zt()
|
|
1644
|
-
},
|
|
1645
|
-
if (o &&
|
|
1646
|
-
const
|
|
1647
|
-
y == null || y(
|
|
1654
|
+
}, p = await T.authorize(k);
|
|
1655
|
+
if (o && p.status === "authorized") {
|
|
1656
|
+
const F = await T.capture(p.id, m);
|
|
1657
|
+
y == null || y(F);
|
|
1648
1658
|
} else
|
|
1649
|
-
y == null || y(
|
|
1650
|
-
} catch (
|
|
1651
|
-
const
|
|
1652
|
-
|
|
1659
|
+
y == null || y(p);
|
|
1660
|
+
} catch (k) {
|
|
1661
|
+
const p = k instanceof Error ? k : new Error(String(k));
|
|
1662
|
+
D(p.message), N == null || N(p);
|
|
1653
1663
|
} finally {
|
|
1654
|
-
|
|
1664
|
+
W(!1);
|
|
1655
1665
|
}
|
|
1656
1666
|
}
|
|
1657
1667
|
},
|
|
1658
1668
|
[
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1669
|
+
Z,
|
|
1670
|
+
m,
|
|
1671
|
+
A,
|
|
1662
1672
|
a,
|
|
1663
1673
|
d,
|
|
1664
1674
|
s,
|
|
1665
1675
|
o,
|
|
1666
|
-
|
|
1676
|
+
T,
|
|
1667
1677
|
y,
|
|
1668
|
-
|
|
1678
|
+
N
|
|
1669
1679
|
]
|
|
1670
|
-
),
|
|
1671
|
-
return /* @__PURE__ */
|
|
1680
|
+
), ae = re(m.currency);
|
|
1681
|
+
return /* @__PURE__ */ _(
|
|
1672
1682
|
"form",
|
|
1673
1683
|
{
|
|
1674
|
-
ref:
|
|
1684
|
+
ref: h,
|
|
1675
1685
|
className: "nice-payment-form" + (u ? ` ${u}` : ""),
|
|
1676
|
-
style:
|
|
1677
|
-
onSubmit:
|
|
1678
|
-
"aria-busy":
|
|
1686
|
+
style: f,
|
|
1687
|
+
onSubmit: Q,
|
|
1688
|
+
"aria-busy": I,
|
|
1679
1689
|
children: [
|
|
1680
1690
|
/* @__PURE__ */ c("div", { className: "nice-payment-form__amount", children: n ? /* @__PURE__ */ c(
|
|
1681
1691
|
Ze,
|
|
1682
1692
|
{
|
|
1683
|
-
label:
|
|
1684
|
-
value:
|
|
1685
|
-
currency:
|
|
1693
|
+
label: w("paymentForm.amount", "Amount"),
|
|
1694
|
+
value: m,
|
|
1695
|
+
currency: v,
|
|
1686
1696
|
currencies: i,
|
|
1687
|
-
onChange: (
|
|
1688
|
-
onCurrencyChange: (
|
|
1689
|
-
|
|
1697
|
+
onChange: (E) => E && g(E),
|
|
1698
|
+
onCurrencyChange: (E) => {
|
|
1699
|
+
S(E), g((k) => ({ ...k, currency: E }));
|
|
1690
1700
|
},
|
|
1691
|
-
disabled:
|
|
1701
|
+
disabled: I,
|
|
1692
1702
|
required: !0,
|
|
1693
1703
|
showFormattedPreview: !0
|
|
1694
1704
|
}
|
|
1695
|
-
) : /* @__PURE__ */
|
|
1696
|
-
/* @__PURE__ */ c("span", { className: "nice-payment-form__total-label", children:
|
|
1697
|
-
/* @__PURE__ */ c(
|
|
1705
|
+
) : /* @__PURE__ */ _("div", { className: "nice-payment-form__total", children: [
|
|
1706
|
+
/* @__PURE__ */ c("span", { className: "nice-payment-form__total-label", children: w("paymentForm.total", "Total") }),
|
|
1707
|
+
/* @__PURE__ */ c(Oe, { value: m })
|
|
1698
1708
|
] }) }),
|
|
1699
1709
|
d && /* @__PURE__ */ c("p", { className: "nice-payment-form__description", children: d }),
|
|
1700
1710
|
/* @__PURE__ */ c("div", { className: "nice-payment-form__card", children: /* @__PURE__ */ c(
|
|
1701
1711
|
Lt,
|
|
1702
1712
|
{
|
|
1703
|
-
value:
|
|
1704
|
-
onChange: (
|
|
1705
|
-
|
|
1713
|
+
value: A,
|
|
1714
|
+
onChange: (E, k) => {
|
|
1715
|
+
P(E), q(k);
|
|
1706
1716
|
},
|
|
1707
|
-
disabled:
|
|
1717
|
+
disabled: I
|
|
1708
1718
|
}
|
|
1709
1719
|
) }),
|
|
1710
|
-
!
|
|
1711
|
-
|
|
1712
|
-
"
|
|
1713
|
-
(J == null ? void 0 : J.name) ?? p.currency,
|
|
1714
|
-
"."
|
|
1715
|
-
] }),
|
|
1716
|
-
!F && Q && /* @__PURE__ */ b("div", { className: "nice-payment-form__warning", role: "alert", children: [
|
|
1717
|
-
N("paymentForm.minimumChargeForIs", "Minimum charge for {name} is").replace(
|
|
1720
|
+
!O && /* @__PURE__ */ c("div", { className: "nice-payment-form__warning", role: "alert", children: w("paymentForm.doesNotAccept", "{provider} does not accept {currency}.").replace("{provider}", String(e.name)).replace("{currency}", String((ae == null ? void 0 : ae.name) ?? m.currency)) }),
|
|
1721
|
+
!X && ne && /* @__PURE__ */ _("div", { className: "nice-payment-form__warning", role: "alert", children: [
|
|
1722
|
+
w("paymentForm.minimumChargeForIs", "Minimum charge for {name} is").replace(
|
|
1718
1723
|
"{name}",
|
|
1719
1724
|
String(e.name)
|
|
1720
1725
|
),
|
|
1721
1726
|
" ",
|
|
1722
|
-
/* @__PURE__ */ c(
|
|
1727
|
+
/* @__PURE__ */ c(Oe, { value: ne }),
|
|
1723
1728
|
"."
|
|
1724
1729
|
] }),
|
|
1725
|
-
|
|
1726
|
-
|
|
1730
|
+
b && /* @__PURE__ */ c("div", { className: "nice-payment-form__consents", children: b }),
|
|
1731
|
+
B && /* @__PURE__ */ c("div", { className: "nice-payment-form__error", role: "alert", children: B }),
|
|
1727
1732
|
/* @__PURE__ */ c(
|
|
1728
1733
|
"button",
|
|
1729
1734
|
{
|
|
1730
1735
|
type: "submit",
|
|
1731
1736
|
className: "nice-payment-form__submit",
|
|
1732
|
-
disabled: !
|
|
1733
|
-
"aria-disabled": !
|
|
1734
|
-
children:
|
|
1737
|
+
disabled: !Z,
|
|
1738
|
+
"aria-disabled": !Z,
|
|
1739
|
+
children: I ? w("paymentForm.processing", "Processing…") : x
|
|
1735
1740
|
}
|
|
1736
1741
|
),
|
|
1737
|
-
/* @__PURE__ */
|
|
1738
|
-
|
|
1742
|
+
/* @__PURE__ */ _("p", { className: "nice-payment-form__processor", children: [
|
|
1743
|
+
w("paymentForm.securedBy", "Secured by"),
|
|
1739
1744
|
" ",
|
|
1740
1745
|
/* @__PURE__ */ c("strong", { children: e.name })
|
|
1741
1746
|
] })
|
|
@@ -1759,11 +1764,11 @@ const hr = /* @__PURE__ */ se(
|
|
|
1759
1764
|
locale: o,
|
|
1760
1765
|
className: l,
|
|
1761
1766
|
style: y
|
|
1762
|
-
},
|
|
1763
|
-
const { t:
|
|
1764
|
-
return /* @__PURE__ */
|
|
1767
|
+
}, N) {
|
|
1768
|
+
const { t: b } = oe(), u = r && r.currency === e.currency && r.amount > e.amount, f = K(() => !u || !r ? null : Math.round((r.amount - e.amount) / r.amount * 100), [u, r, e.amount]), h = `nice-price-tag nice-price-tag--${s}` + (l ? ` ${l}` : "");
|
|
1769
|
+
return /* @__PURE__ */ _("div", { ref: N, className: h, style: y, children: [
|
|
1765
1770
|
a && /* @__PURE__ */ c("span", { className: "nice-price-tag__prefix", children: a }),
|
|
1766
|
-
/* @__PURE__ */
|
|
1771
|
+
/* @__PURE__ */ _("span", { className: "nice-price-tag__main", children: [
|
|
1767
1772
|
/* @__PURE__ */ c("span", { className: "nice-price-tag__amount", children: ie(e, { locale: o }) }),
|
|
1768
1773
|
n && /* @__PURE__ */ c("span", { className: "nice-price-tag__period", children: n })
|
|
1769
1774
|
] }),
|
|
@@ -1771,15 +1776,22 @@ const hr = /* @__PURE__ */ se(
|
|
|
1771
1776
|
"span",
|
|
1772
1777
|
{
|
|
1773
1778
|
className: "nice-price-tag__original",
|
|
1774
|
-
"aria-label":
|
|
1779
|
+
"aria-label": b("priceTag.originalPrice", "Original price"),
|
|
1775
1780
|
children: /* @__PURE__ */ c("s", { children: ie(r, { locale: o }) })
|
|
1776
1781
|
}
|
|
1777
1782
|
),
|
|
1778
|
-
u && d &&
|
|
1779
|
-
"
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
+
u && d && f != null && f > 0 && /* @__PURE__ */ _(
|
|
1784
|
+
"span",
|
|
1785
|
+
{
|
|
1786
|
+
className: "nice-price-tag__discount",
|
|
1787
|
+
"aria-label": b("priceTag.percentOff", "{pct} percent off").replace("{pct}", String(f)),
|
|
1788
|
+
children: [
|
|
1789
|
+
"−",
|
|
1790
|
+
f,
|
|
1791
|
+
"%"
|
|
1792
|
+
]
|
|
1793
|
+
}
|
|
1794
|
+
),
|
|
1783
1795
|
i && /* @__PURE__ */ c("span", { className: "nice-price-tag__suffix", children: i })
|
|
1784
1796
|
] });
|
|
1785
1797
|
}
|
|
@@ -1794,75 +1806,75 @@ const hr = /* @__PURE__ */ se(
|
|
|
1794
1806
|
locale: o,
|
|
1795
1807
|
showRateLine: l = !0,
|
|
1796
1808
|
className: y,
|
|
1797
|
-
style:
|
|
1798
|
-
},
|
|
1799
|
-
const { t: u } =
|
|
1809
|
+
style: N
|
|
1810
|
+
}, b) {
|
|
1811
|
+
const { t: u } = oe(), [f, h] = Me({
|
|
1800
1812
|
value: e,
|
|
1801
1813
|
defaultValue: r,
|
|
1802
1814
|
fallbackValue: jt,
|
|
1803
1815
|
onChange: n,
|
|
1804
1816
|
componentName: "NiceCurrencyConverter"
|
|
1805
|
-
}), [
|
|
1817
|
+
}), [w, x] = Me({
|
|
1806
1818
|
value: a,
|
|
1807
1819
|
defaultValue: i,
|
|
1808
|
-
fallbackValue:
|
|
1820
|
+
fallbackValue: f.currency,
|
|
1809
1821
|
onChange: d,
|
|
1810
1822
|
componentName: "NiceCurrencyConverter"
|
|
1811
|
-
}), { converted:
|
|
1812
|
-
() => ({ amount: Math.pow(10, 2), currency:
|
|
1813
|
-
[
|
|
1814
|
-
), { converted:
|
|
1815
|
-
l ?
|
|
1816
|
-
|
|
1823
|
+
}), { converted: m, loading: g, error: v } = Ie(f, w, s), S = K(
|
|
1824
|
+
() => ({ amount: Math.pow(10, 2), currency: f.currency }),
|
|
1825
|
+
[f.currency]
|
|
1826
|
+
), { converted: A } = Ie(
|
|
1827
|
+
l ? S : null,
|
|
1828
|
+
w,
|
|
1817
1829
|
s
|
|
1818
1830
|
);
|
|
1819
|
-
return /* @__PURE__ */
|
|
1831
|
+
return /* @__PURE__ */ _(
|
|
1820
1832
|
"div",
|
|
1821
1833
|
{
|
|
1822
|
-
ref:
|
|
1834
|
+
ref: b,
|
|
1823
1835
|
className: "nice-currency-converter" + (y ? ` ${y}` : ""),
|
|
1824
|
-
style:
|
|
1836
|
+
style: N,
|
|
1825
1837
|
children: [
|
|
1826
1838
|
/* @__PURE__ */ c("div", { className: "nice-currency-converter__row", children: /* @__PURE__ */ c(
|
|
1827
1839
|
Ze,
|
|
1828
1840
|
{
|
|
1829
1841
|
label: u("currencyConverter.from", "From"),
|
|
1830
|
-
value:
|
|
1831
|
-
onChange: (
|
|
1832
|
-
currency:
|
|
1833
|
-
onCurrencyChange: (
|
|
1842
|
+
value: f,
|
|
1843
|
+
onChange: (P) => P && h(P),
|
|
1844
|
+
currency: f.currency,
|
|
1845
|
+
onCurrencyChange: (P) => h({ ...f, currency: P }),
|
|
1834
1846
|
showFormattedPreview: !1
|
|
1835
1847
|
}
|
|
1836
1848
|
) }),
|
|
1837
|
-
/* @__PURE__ */
|
|
1838
|
-
/* @__PURE__ */ c("label", { className: "nice-currency-converter__label", children: "To" }),
|
|
1839
|
-
/* @__PURE__ */
|
|
1849
|
+
/* @__PURE__ */ _("div", { className: "nice-currency-converter__row", children: [
|
|
1850
|
+
/* @__PURE__ */ c("label", { className: "nice-currency-converter__label", children: u("currencyConverter.to", "To") }),
|
|
1851
|
+
/* @__PURE__ */ _("div", { className: "nice-currency-converter__output", children: [
|
|
1840
1852
|
/* @__PURE__ */ c(
|
|
1841
1853
|
Ge,
|
|
1842
1854
|
{
|
|
1843
|
-
value:
|
|
1844
|
-
onChange: (
|
|
1855
|
+
value: w,
|
|
1856
|
+
onChange: (P) => x(P),
|
|
1845
1857
|
compact: !0
|
|
1846
1858
|
}
|
|
1847
1859
|
),
|
|
1848
|
-
/* @__PURE__ */ c("span", { className: "nice-currency-converter__amount", children:
|
|
1860
|
+
/* @__PURE__ */ c("span", { className: "nice-currency-converter__amount", children: g ? "…" : v ? "—" : m ? ie(m, { locale: o }) : "" })
|
|
1849
1861
|
] })
|
|
1850
1862
|
] }),
|
|
1851
|
-
l &&
|
|
1863
|
+
l && A && /* @__PURE__ */ _("p", { className: "nice-currency-converter__rate", children: [
|
|
1852
1864
|
"1 ",
|
|
1853
|
-
|
|
1865
|
+
f.currency,
|
|
1854
1866
|
" = ",
|
|
1855
|
-
ie(
|
|
1867
|
+
ie(A, { locale: o }),
|
|
1856
1868
|
" ",
|
|
1857
|
-
/* @__PURE__ */
|
|
1869
|
+
/* @__PURE__ */ _("span", { className: "nice-currency-converter__inverse", children: [
|
|
1858
1870
|
"· 1 ",
|
|
1859
|
-
|
|
1871
|
+
w,
|
|
1860
1872
|
" =",
|
|
1861
1873
|
" ",
|
|
1862
|
-
ie(
|
|
1874
|
+
ie(ce(1 / He(A), f.currency), { locale: o })
|
|
1863
1875
|
] })
|
|
1864
1876
|
] }),
|
|
1865
|
-
|
|
1877
|
+
v && /* @__PURE__ */ c("p", { className: "nice-currency-converter__error", role: "alert", children: v.message })
|
|
1866
1878
|
]
|
|
1867
1879
|
}
|
|
1868
1880
|
);
|
|
@@ -1882,82 +1894,82 @@ const fr = /* @__PURE__ */ se(
|
|
|
1882
1894
|
density: o = "comfortable",
|
|
1883
1895
|
className: l,
|
|
1884
1896
|
style: y,
|
|
1885
|
-
id:
|
|
1886
|
-
},
|
|
1887
|
-
const u = {
|
|
1888
|
-
label: (s == null ? void 0 : s.label) ?? "Item",
|
|
1897
|
+
id: N
|
|
1898
|
+
}, b) {
|
|
1899
|
+
const { t: u } = oe(), f = {
|
|
1900
|
+
label: (s == null ? void 0 : s.label) ?? u("taxBreakdown.item", "Item"),
|
|
1889
1901
|
rate: (s == null ? void 0 : s.rate) ?? "VAT",
|
|
1890
1902
|
net: (s == null ? void 0 : s.net) ?? "Net",
|
|
1891
1903
|
vat: (s == null ? void 0 : s.vat) ?? "Tax",
|
|
1892
1904
|
gross: (s == null ? void 0 : s.gross) ?? "Gross",
|
|
1893
1905
|
total: (s == null ? void 0 : s.total) ?? "Total"
|
|
1894
|
-
},
|
|
1906
|
+
}, h = K(() => {
|
|
1895
1907
|
if (n === "total") {
|
|
1896
|
-
const
|
|
1897
|
-
for (const
|
|
1898
|
-
let
|
|
1899
|
-
|
|
1908
|
+
const m = /* @__PURE__ */ new Map();
|
|
1909
|
+
for (const v of e) {
|
|
1910
|
+
let S = m.get(v.vatRate);
|
|
1911
|
+
S || (S = [], m.set(v.vatRate, S)), S.push(v.netAmount);
|
|
1900
1912
|
}
|
|
1901
|
-
const
|
|
1902
|
-
for (const [
|
|
1903
|
-
const
|
|
1904
|
-
|
|
1913
|
+
const g = [];
|
|
1914
|
+
for (const [v, S] of m) {
|
|
1915
|
+
const A = S.reduce((q, I) => ye(q, I), ce(0, S[0].currency)), P = Be(Se(A, v)), M = ye(A, P);
|
|
1916
|
+
g.push({ rate: v, net: A, vat: P, gross: M });
|
|
1905
1917
|
}
|
|
1906
|
-
return
|
|
1918
|
+
return g;
|
|
1907
1919
|
}
|
|
1908
|
-
return e.map((
|
|
1909
|
-
const
|
|
1910
|
-
return { label:
|
|
1920
|
+
return e.map((m) => {
|
|
1921
|
+
const g = Be(Se(m.netAmount, m.vatRate)), v = ye(m.netAmount, g);
|
|
1922
|
+
return { label: m.label, rate: m.vatRate, net: m.netAmount, vat: g, gross: v };
|
|
1911
1923
|
});
|
|
1912
|
-
}, [e, n]),
|
|
1913
|
-
if (
|
|
1924
|
+
}, [e, n]), w = K(() => {
|
|
1925
|
+
if (h.length === 0)
|
|
1914
1926
|
return null;
|
|
1915
|
-
const
|
|
1916
|
-
let
|
|
1917
|
-
for (const
|
|
1918
|
-
|
|
1919
|
-
return { net:
|
|
1920
|
-
}, [
|
|
1921
|
-
return /* @__PURE__ */
|
|
1927
|
+
const m = h[0].net.currency;
|
|
1928
|
+
let g = ce(0, m), v = ce(0, m), S = ce(0, m);
|
|
1929
|
+
for (const A of h)
|
|
1930
|
+
g = ye(g, A.net), v = ye(v, A.vat), S = ye(S, A.gross);
|
|
1931
|
+
return { net: g, vat: v, gross: S };
|
|
1932
|
+
}, [h]), x = (m) => ie(m, { locale: r });
|
|
1933
|
+
return /* @__PURE__ */ _(
|
|
1922
1934
|
"table",
|
|
1923
1935
|
{
|
|
1924
|
-
ref:
|
|
1925
|
-
id:
|
|
1936
|
+
ref: b,
|
|
1937
|
+
id: N,
|
|
1926
1938
|
className: `nice-tax-breakdown nice-tax-breakdown--${o} ${l ?? ""}`,
|
|
1927
1939
|
style: y,
|
|
1928
1940
|
role: "table",
|
|
1929
|
-
"aria-label":
|
|
1941
|
+
"aria-label": f.total,
|
|
1930
1942
|
children: [
|
|
1931
|
-
/* @__PURE__ */ c("thead", { children: /* @__PURE__ */
|
|
1932
|
-
|
|
1933
|
-
!d && /* @__PURE__ */ c("th", { scope: "col", className: "nice-tax-breakdown__rate", children:
|
|
1934
|
-
/* @__PURE__ */ c("th", { scope: "col", className: "nice-tax-breakdown__num", children:
|
|
1935
|
-
/* @__PURE__ */ c("th", { scope: "col", className: "nice-tax-breakdown__num", children:
|
|
1936
|
-
/* @__PURE__ */ c("th", { scope: "col", className: "nice-tax-breakdown__num", children:
|
|
1943
|
+
/* @__PURE__ */ c("thead", { children: /* @__PURE__ */ _("tr", { children: [
|
|
1944
|
+
h.some((m) => m.label !== void 0) && /* @__PURE__ */ c("th", { scope: "col", children: f.label }),
|
|
1945
|
+
!d && /* @__PURE__ */ c("th", { scope: "col", className: "nice-tax-breakdown__rate", children: f.rate }),
|
|
1946
|
+
/* @__PURE__ */ c("th", { scope: "col", className: "nice-tax-breakdown__num", children: f.net }),
|
|
1947
|
+
/* @__PURE__ */ c("th", { scope: "col", className: "nice-tax-breakdown__num", children: f.vat }),
|
|
1948
|
+
/* @__PURE__ */ c("th", { scope: "col", className: "nice-tax-breakdown__num", children: f.gross })
|
|
1937
1949
|
] }) }),
|
|
1938
|
-
/* @__PURE__ */ c("tbody", { children:
|
|
1939
|
-
|
|
1940
|
-
!d && /* @__PURE__ */
|
|
1941
|
-
(
|
|
1950
|
+
/* @__PURE__ */ c("tbody", { children: h.map((m, g) => /* @__PURE__ */ _("tr", { children: [
|
|
1951
|
+
h.some((v) => v.label !== void 0) && /* @__PURE__ */ c("td", { children: m.label ?? "" }),
|
|
1952
|
+
!d && /* @__PURE__ */ _("td", { className: "nice-tax-breakdown__rate", children: [
|
|
1953
|
+
(m.rate * 100).toLocaleString(r, { maximumFractionDigits: 2 }),
|
|
1942
1954
|
"%"
|
|
1943
1955
|
] }),
|
|
1944
|
-
/* @__PURE__ */ c("td", { className: "nice-tax-breakdown__num", children:
|
|
1945
|
-
/* @__PURE__ */ c("td", { className: "nice-tax-breakdown__num", children:
|
|
1946
|
-
/* @__PURE__ */ c("td", { className: "nice-tax-breakdown__num", children:
|
|
1947
|
-
] }, `${
|
|
1948
|
-
a &&
|
|
1949
|
-
|
|
1950
|
-
!d && /* @__PURE__ */ c("td", { children:
|
|
1951
|
-
/* @__PURE__ */ c("td", { className: "nice-tax-breakdown__num", children:
|
|
1952
|
-
/* @__PURE__ */ c("td", { className: "nice-tax-breakdown__num", children:
|
|
1953
|
-
/* @__PURE__ */ c("td", { className: "nice-tax-breakdown__num", children:
|
|
1956
|
+
/* @__PURE__ */ c("td", { className: "nice-tax-breakdown__num", children: x(m.net) }),
|
|
1957
|
+
/* @__PURE__ */ c("td", { className: "nice-tax-breakdown__num", children: x(m.vat) }),
|
|
1958
|
+
/* @__PURE__ */ c("td", { className: "nice-tax-breakdown__num", children: x(m.gross) })
|
|
1959
|
+
] }, `${m.rate}-${g}`)) }),
|
|
1960
|
+
a && w && /* @__PURE__ */ c("tfoot", { children: i && /* @__PURE__ */ _("tr", { className: "nice-tax-breakdown__totals", children: [
|
|
1961
|
+
h.some((m) => m.label !== void 0) && /* @__PURE__ */ c("td", { children: f.total }),
|
|
1962
|
+
!d && /* @__PURE__ */ c("td", { children: h.some((m) => m.label !== void 0) ? null : f.total }),
|
|
1963
|
+
/* @__PURE__ */ c("td", { className: "nice-tax-breakdown__num", children: x(w.net) }),
|
|
1964
|
+
/* @__PURE__ */ c("td", { className: "nice-tax-breakdown__num", children: x(w.vat) }),
|
|
1965
|
+
/* @__PURE__ */ c("td", { className: "nice-tax-breakdown__num", children: x(w.gross) })
|
|
1954
1966
|
] }) })
|
|
1955
1967
|
]
|
|
1956
1968
|
}
|
|
1957
1969
|
);
|
|
1958
1970
|
}
|
|
1959
1971
|
), Gt = [], _r = /* @__PURE__ */ se(function(e, r) {
|
|
1960
|
-
const { t: n } =
|
|
1972
|
+
const { t: n } = oe(), {
|
|
1961
1973
|
methods: a = Gt,
|
|
1962
1974
|
value: i,
|
|
1963
1975
|
onChange: d,
|
|
@@ -1965,64 +1977,64 @@ const fr = /* @__PURE__ */ se(
|
|
|
1965
1977
|
columns: o = 2,
|
|
1966
1978
|
currency: l,
|
|
1967
1979
|
label: y,
|
|
1968
|
-
name:
|
|
1969
|
-
readOnly:
|
|
1980
|
+
name: N,
|
|
1981
|
+
readOnly: b = !1,
|
|
1970
1982
|
className: u,
|
|
1971
|
-
style:
|
|
1972
|
-
id:
|
|
1973
|
-
accessMode:
|
|
1974
|
-
"data-testid":
|
|
1975
|
-
} = e,
|
|
1983
|
+
style: f,
|
|
1984
|
+
id: h,
|
|
1985
|
+
accessMode: w,
|
|
1986
|
+
"data-testid": x
|
|
1987
|
+
} = e, m = _e(), g = N ?? `nice-pm-${m}`, v = K(() => {
|
|
1976
1988
|
if (!l)
|
|
1977
1989
|
return a;
|
|
1978
|
-
const
|
|
1990
|
+
const M = l.toUpperCase();
|
|
1979
1991
|
return a.filter(
|
|
1980
|
-
(
|
|
1992
|
+
(q) => !q.currencies || q.currencies.map((I) => I.toUpperCase()).includes(M)
|
|
1981
1993
|
);
|
|
1982
1994
|
}, [a, l]);
|
|
1983
|
-
if (
|
|
1995
|
+
if (w === "hidden")
|
|
1984
1996
|
return null;
|
|
1985
|
-
const
|
|
1986
|
-
return /* @__PURE__ */
|
|
1997
|
+
const S = b || w === "disabled" || w === "readOnly", A = `nice-payment-method-selector nice-payment-method-selector--${s}` + (u ? ` ${u}` : ""), P = s === "grid" ? { gridTemplateColumns: `repeat(${o}, minmax(0, 1fr))` } : void 0;
|
|
1998
|
+
return /* @__PURE__ */ _("div", { ref: r, id: h, className: A, style: f, "data-testid": x, children: [
|
|
1987
1999
|
y && /* @__PURE__ */ c("div", { className: "nice-payment-method-selector__label", children: y }),
|
|
1988
|
-
/* @__PURE__ */
|
|
2000
|
+
/* @__PURE__ */ _(
|
|
1989
2001
|
"div",
|
|
1990
2002
|
{
|
|
1991
2003
|
className: "nice-payment-method-selector__options",
|
|
1992
|
-
style:
|
|
2004
|
+
style: P,
|
|
1993
2005
|
role: "radiogroup",
|
|
1994
|
-
"aria-label": y ?? "Payment method",
|
|
2006
|
+
"aria-label": y ?? n("paymentMethodSelector.paymentMethod", "Payment method"),
|
|
1995
2007
|
children: [
|
|
1996
|
-
|
|
1997
|
-
const
|
|
1998
|
-
return /* @__PURE__ */
|
|
2008
|
+
v.map((M) => {
|
|
2009
|
+
const q = M.id === i, I = S || M.disabled;
|
|
2010
|
+
return /* @__PURE__ */ _(
|
|
1999
2011
|
"label",
|
|
2000
2012
|
{
|
|
2001
|
-
className: "nice-payment-method-selector__option" + (
|
|
2013
|
+
className: "nice-payment-method-selector__option" + (q ? " nice-payment-method-selector__option--selected" : "") + (I ? " nice-payment-method-selector__option--disabled" : ""),
|
|
2002
2014
|
children: [
|
|
2003
2015
|
/* @__PURE__ */ c(
|
|
2004
2016
|
"input",
|
|
2005
2017
|
{
|
|
2006
2018
|
type: "radio",
|
|
2007
2019
|
className: "nice-payment-method-selector__radio",
|
|
2008
|
-
name:
|
|
2009
|
-
value:
|
|
2010
|
-
checked:
|
|
2011
|
-
disabled:
|
|
2012
|
-
onChange: () => d == null ? void 0 : d(
|
|
2020
|
+
name: g,
|
|
2021
|
+
value: M.id,
|
|
2022
|
+
checked: q,
|
|
2023
|
+
disabled: I,
|
|
2024
|
+
onChange: () => d == null ? void 0 : d(M.id)
|
|
2013
2025
|
}
|
|
2014
2026
|
),
|
|
2015
|
-
|
|
2016
|
-
/* @__PURE__ */
|
|
2017
|
-
/* @__PURE__ */ c("span", { className: "nice-payment-method-selector__name", children:
|
|
2018
|
-
|
|
2027
|
+
M.icon && /* @__PURE__ */ c("span", { className: "nice-payment-method-selector__icon", children: M.icon }),
|
|
2028
|
+
/* @__PURE__ */ _("span", { className: "nice-payment-method-selector__text", children: [
|
|
2029
|
+
/* @__PURE__ */ c("span", { className: "nice-payment-method-selector__name", children: M.label }),
|
|
2030
|
+
M.description && /* @__PURE__ */ c("span", { className: "nice-payment-method-selector__desc", children: M.description })
|
|
2019
2031
|
] })
|
|
2020
2032
|
]
|
|
2021
2033
|
},
|
|
2022
|
-
|
|
2034
|
+
M.id
|
|
2023
2035
|
);
|
|
2024
2036
|
}),
|
|
2025
|
-
|
|
2037
|
+
v.length === 0 && /* @__PURE__ */ c("div", { className: "nice-payment-method-selector__empty", children: n("paymentMethodSelector.noMethodsAvailable", "No methods available.") })
|
|
2026
2038
|
]
|
|
2027
2039
|
}
|
|
2028
2040
|
)
|
|
@@ -2042,7 +2054,7 @@ const fr = /* @__PURE__ */ se(
|
|
|
2042
2054
|
credentials: {},
|
|
2043
2055
|
enabledMethods: []
|
|
2044
2056
|
}, gr = /* @__PURE__ */ se(function(e, r) {
|
|
2045
|
-
const { t: n } =
|
|
2057
|
+
const { t: n } = oe(), {
|
|
2046
2058
|
value: a,
|
|
2047
2059
|
defaultValue: i,
|
|
2048
2060
|
onChange: d,
|
|
@@ -2050,69 +2062,69 @@ const fr = /* @__PURE__ */ se(
|
|
|
2050
2062
|
onTestConnection: o,
|
|
2051
2063
|
showWebhookUrl: l = !0,
|
|
2052
2064
|
baseUrl: y,
|
|
2053
|
-
readOnly:
|
|
2054
|
-
testLabel:
|
|
2065
|
+
readOnly: N = !1,
|
|
2066
|
+
testLabel: b = n("paymentProviderConfig.testConnection", "Test connection"),
|
|
2055
2067
|
tutorial: u,
|
|
2056
|
-
className:
|
|
2057
|
-
style:
|
|
2058
|
-
id:
|
|
2059
|
-
accessMode:
|
|
2060
|
-
"data-testid":
|
|
2061
|
-
} = e, [
|
|
2068
|
+
className: f,
|
|
2069
|
+
style: h,
|
|
2070
|
+
id: w,
|
|
2071
|
+
accessMode: x,
|
|
2072
|
+
"data-testid": m
|
|
2073
|
+
} = e, [g, v] = Me({
|
|
2062
2074
|
value: a,
|
|
2063
2075
|
defaultValue: i,
|
|
2064
2076
|
fallbackValue: Jt,
|
|
2065
2077
|
onChange: d,
|
|
2066
2078
|
componentName: "NicePaymentProviderConfig"
|
|
2067
|
-
}),
|
|
2068
|
-
if (
|
|
2079
|
+
}), S = _e(), [A, P] = H(/* @__PURE__ */ new Set()), [M, q] = H(!1), [I, W] = H(null), B = K(() => s ? s.map((p) => we[p]).filter((p) => !!p) : Ot, [s]), D = we[g.providerId];
|
|
2080
|
+
if (x === "hidden")
|
|
2069
2081
|
return null;
|
|
2070
|
-
const
|
|
2071
|
-
W(null),
|
|
2072
|
-
},
|
|
2073
|
-
|
|
2074
|
-
},
|
|
2075
|
-
const
|
|
2076
|
-
|
|
2077
|
-
},
|
|
2078
|
-
|
|
2079
|
-
const
|
|
2080
|
-
return
|
|
2082
|
+
const T = N || x === "disabled" || x === "readOnly", O = (p) => {
|
|
2083
|
+
W(null), P(/* @__PURE__ */ new Set()), v({ providerId: p, mode: g.mode, credentials: {}, enabledMethods: [] });
|
|
2084
|
+
}, X = (p, F) => {
|
|
2085
|
+
v({ ...g, credentials: { ...g.credentials, [p]: F } });
|
|
2086
|
+
}, ne = (p) => {
|
|
2087
|
+
const F = new Set(g.enabledMethods ?? []);
|
|
2088
|
+
F.has(p) ? F.delete(p) : F.add(p), v({ ...g, enabledMethods: [...F] });
|
|
2089
|
+
}, Y = (p) => {
|
|
2090
|
+
P((F) => {
|
|
2091
|
+
const z = new Set(F);
|
|
2092
|
+
return z.has(p) ? z.delete(p) : z.add(p), z;
|
|
2081
2093
|
});
|
|
2082
|
-
},
|
|
2094
|
+
}, Z = async () => {
|
|
2083
2095
|
if (o) {
|
|
2084
|
-
|
|
2096
|
+
q(!0), W(null);
|
|
2085
2097
|
try {
|
|
2086
|
-
W(await o(
|
|
2087
|
-
} catch (
|
|
2088
|
-
W({ ok: !1, message:
|
|
2098
|
+
W(await o(g));
|
|
2099
|
+
} catch (p) {
|
|
2100
|
+
W({ ok: !1, message: p instanceof Error ? p.message : String(p) });
|
|
2089
2101
|
} finally {
|
|
2090
|
-
|
|
2102
|
+
q(!1);
|
|
2091
2103
|
}
|
|
2092
2104
|
}
|
|
2093
|
-
},
|
|
2094
|
-
(
|
|
2105
|
+
}, Q = D != null && D.webhookPath ? `${(y ?? "").replace(/\/$/, "")}${D.webhookPath}` : "", ae = (D == null ? void 0 : D.supportedCurrencies) === "*" ? n("paymentProviderConfig.allCurrencies", "All currencies") : ((D == null ? void 0 : D.supportedCurrencies) ?? []).join(", "), E = "nice-payment-provider-config" + (f ? ` ${f}` : ""), k = ((D == null ? void 0 : D.credentials) ?? []).filter(
|
|
2106
|
+
(p) => !p.testOnly || g.mode === "test"
|
|
2095
2107
|
);
|
|
2096
|
-
return /* @__PURE__ */
|
|
2108
|
+
return /* @__PURE__ */ _("div", { ref: r, id: w, className: E, style: h, "data-testid": m, children: [
|
|
2097
2109
|
u && /* @__PURE__ */ c("div", { className: "nice-payment-provider-config__tutorial", children: /* @__PURE__ */ c(st, { steps: ot(u, Zt) }) }),
|
|
2098
|
-
/* @__PURE__ */
|
|
2099
|
-
/* @__PURE__ */
|
|
2110
|
+
/* @__PURE__ */ _("div", { className: "nice-payment-provider-config__row", children: [
|
|
2111
|
+
/* @__PURE__ */ _("label", { className: "nice-payment-provider-config__field", children: [
|
|
2100
2112
|
/* @__PURE__ */ c("span", { className: "nice-payment-provider-config__field-label", children: n("paymentProviderConfig.provider", "Provider") }),
|
|
2101
|
-
/* @__PURE__ */
|
|
2113
|
+
/* @__PURE__ */ _(
|
|
2102
2114
|
"select",
|
|
2103
2115
|
{
|
|
2104
2116
|
className: "nice-payment-provider-config__select",
|
|
2105
|
-
value:
|
|
2106
|
-
disabled:
|
|
2107
|
-
onChange: (
|
|
2117
|
+
value: g.providerId,
|
|
2118
|
+
disabled: T,
|
|
2119
|
+
onChange: (p) => O(p.target.value),
|
|
2108
2120
|
children: [
|
|
2109
|
-
/* @__PURE__ */ c("option", { value: "", children: "— select provider —" }),
|
|
2110
|
-
|
|
2121
|
+
/* @__PURE__ */ c("option", { value: "", children: n("paymentProviderConfig.selectProvider", "— select provider —") }),
|
|
2122
|
+
B.map((p) => /* @__PURE__ */ c("option", { value: p.id, children: p.name }, p.id))
|
|
2111
2123
|
]
|
|
2112
2124
|
}
|
|
2113
2125
|
)
|
|
2114
2126
|
] }),
|
|
2115
|
-
(
|
|
2127
|
+
(D == null ? void 0 : D.hasTestMode) && /* @__PURE__ */ _(
|
|
2116
2128
|
"div",
|
|
2117
2129
|
{
|
|
2118
2130
|
className: "nice-payment-provider-config__mode",
|
|
@@ -2123,9 +2135,9 @@ const fr = /* @__PURE__ */ se(
|
|
|
2123
2135
|
"button",
|
|
2124
2136
|
{
|
|
2125
2137
|
type: "button",
|
|
2126
|
-
className: "nice-payment-provider-config__mode-btn" + (
|
|
2127
|
-
onClick: () =>
|
|
2128
|
-
disabled:
|
|
2138
|
+
className: "nice-payment-provider-config__mode-btn" + (g.mode === "test" ? " nice-payment-provider-config__mode-btn--active" : ""),
|
|
2139
|
+
onClick: () => v({ ...g, mode: "test" }),
|
|
2140
|
+
disabled: T,
|
|
2129
2141
|
children: n("paymentProviderConfig.test", "Test")
|
|
2130
2142
|
}
|
|
2131
2143
|
),
|
|
@@ -2133,9 +2145,9 @@ const fr = /* @__PURE__ */ se(
|
|
|
2133
2145
|
"button",
|
|
2134
2146
|
{
|
|
2135
2147
|
type: "button",
|
|
2136
|
-
className: "nice-payment-provider-config__mode-btn" + (
|
|
2137
|
-
onClick: () =>
|
|
2138
|
-
disabled:
|
|
2148
|
+
className: "nice-payment-provider-config__mode-btn" + (g.mode === "live" ? " nice-payment-provider-config__mode-btn--active" : ""),
|
|
2149
|
+
onClick: () => v({ ...g, mode: "live" }),
|
|
2150
|
+
disabled: T,
|
|
2139
2151
|
children: n("paymentProviderConfig.live", "Live")
|
|
2140
2152
|
}
|
|
2141
2153
|
)
|
|
@@ -2143,84 +2155,84 @@ const fr = /* @__PURE__ */ se(
|
|
|
2143
2155
|
}
|
|
2144
2156
|
)
|
|
2145
2157
|
] }),
|
|
2146
|
-
|
|
2147
|
-
/* @__PURE__ */
|
|
2148
|
-
/* @__PURE__ */ c("span", { className: "nice-payment-provider-config__badge", children:
|
|
2149
|
-
/* @__PURE__ */ c("span", { className: "nice-payment-provider-config__currencies", children:
|
|
2158
|
+
D && /* @__PURE__ */ _(it, { children: [
|
|
2159
|
+
/* @__PURE__ */ _("div", { className: "nice-payment-provider-config__meta", children: [
|
|
2160
|
+
/* @__PURE__ */ c("span", { className: "nice-payment-provider-config__badge", children: D.type }),
|
|
2161
|
+
/* @__PURE__ */ c("span", { className: "nice-payment-provider-config__currencies", children: ae })
|
|
2150
2162
|
] }),
|
|
2151
|
-
/* @__PURE__ */ c("div", { className: "nice-payment-provider-config__credentials", children:
|
|
2152
|
-
const
|
|
2153
|
-
return /* @__PURE__ */
|
|
2154
|
-
/* @__PURE__ */
|
|
2155
|
-
|
|
2156
|
-
|
|
2163
|
+
/* @__PURE__ */ c("div", { className: "nice-payment-provider-config__credentials", children: k.map((p) => {
|
|
2164
|
+
const F = `${S}-${p.key}`, z = p.secret, C = A.has(p.key);
|
|
2165
|
+
return /* @__PURE__ */ _("div", { className: "nice-payment-provider-config__field", children: [
|
|
2166
|
+
/* @__PURE__ */ _("label", { className: "nice-payment-provider-config__field-label", htmlFor: F, children: [
|
|
2167
|
+
p.label,
|
|
2168
|
+
p.required && /* @__PURE__ */ c("span", { className: "nice-payment-provider-config__required", children: " *" })
|
|
2157
2169
|
] }),
|
|
2158
|
-
/* @__PURE__ */
|
|
2170
|
+
/* @__PURE__ */ _("div", { className: "nice-payment-provider-config__input-wrap", children: [
|
|
2159
2171
|
/* @__PURE__ */ c(
|
|
2160
2172
|
"input",
|
|
2161
2173
|
{
|
|
2162
|
-
id:
|
|
2163
|
-
type:
|
|
2174
|
+
id: F,
|
|
2175
|
+
type: z && !C ? "password" : "text",
|
|
2164
2176
|
className: "nice-payment-provider-config__input",
|
|
2165
|
-
value:
|
|
2166
|
-
readOnly:
|
|
2167
|
-
autoComplete:
|
|
2168
|
-
onChange: (L) =>
|
|
2177
|
+
value: g.credentials[p.key] ?? "",
|
|
2178
|
+
readOnly: T,
|
|
2179
|
+
autoComplete: z ? "new-password" : "off",
|
|
2180
|
+
onChange: (L) => X(p.key, L.target.value)
|
|
2169
2181
|
}
|
|
2170
2182
|
),
|
|
2171
|
-
|
|
2183
|
+
z && /* @__PURE__ */ c(
|
|
2172
2184
|
"button",
|
|
2173
2185
|
{
|
|
2174
2186
|
type: "button",
|
|
2175
2187
|
className: "nice-payment-provider-config__reveal",
|
|
2176
|
-
onClick: () =>
|
|
2177
|
-
"aria-label": C ? "Hide" : "Reveal",
|
|
2188
|
+
onClick: () => Y(p.key),
|
|
2189
|
+
"aria-label": C ? n("paymentProviderConfig.hide", "Hide") : n("paymentProviderConfig.reveal", "Reveal"),
|
|
2178
2190
|
"aria-pressed": C,
|
|
2179
|
-
children: /* @__PURE__ */ c(
|
|
2191
|
+
children: /* @__PURE__ */ c(Pe, { name: C ? "eye-off" : "eye", size: 14 })
|
|
2180
2192
|
}
|
|
2181
2193
|
)
|
|
2182
2194
|
] }),
|
|
2183
|
-
|
|
2184
|
-
] },
|
|
2195
|
+
p.help && /* @__PURE__ */ c("span", { className: "nice-payment-provider-config__help", children: p.help })
|
|
2196
|
+
] }, p.key);
|
|
2185
2197
|
}) }),
|
|
2186
|
-
|
|
2198
|
+
D.supportedMethods && D.supportedMethods.length > 0 && /* @__PURE__ */ _("div", { className: "nice-payment-provider-config__methods", children: [
|
|
2187
2199
|
/* @__PURE__ */ c("span", { className: "nice-payment-provider-config__field-label", children: n("paymentProviderConfig.enabledMethods", "Enabled methods") }),
|
|
2188
|
-
/* @__PURE__ */ c("div", { className: "nice-payment-provider-config__method-list", children:
|
|
2200
|
+
/* @__PURE__ */ c("div", { className: "nice-payment-provider-config__method-list", children: D.supportedMethods.map((p) => /* @__PURE__ */ _("label", { className: "nice-payment-provider-config__method", children: [
|
|
2189
2201
|
/* @__PURE__ */ c(
|
|
2190
2202
|
"input",
|
|
2191
2203
|
{
|
|
2192
2204
|
type: "checkbox",
|
|
2193
|
-
checked: (
|
|
2194
|
-
disabled:
|
|
2195
|
-
onChange: () =>
|
|
2205
|
+
checked: (g.enabledMethods ?? []).includes(p),
|
|
2206
|
+
disabled: T,
|
|
2207
|
+
onChange: () => ne(p)
|
|
2196
2208
|
}
|
|
2197
2209
|
),
|
|
2198
|
-
|
|
2199
|
-
] },
|
|
2210
|
+
p
|
|
2211
|
+
] }, p)) })
|
|
2200
2212
|
] }),
|
|
2201
|
-
l &&
|
|
2213
|
+
l && D.webhookPath && /* @__PURE__ */ _("div", { className: "nice-payment-provider-config__field", children: [
|
|
2202
2214
|
/* @__PURE__ */ c("span", { className: "nice-payment-provider-config__field-label", children: n("paymentProviderConfig.webhookUrl", "Webhook URL") }),
|
|
2203
|
-
/* @__PURE__ */ c("code", { className: "nice-payment-provider-config__webhook", children:
|
|
2215
|
+
/* @__PURE__ */ c("code", { className: "nice-payment-provider-config__webhook", children: Q })
|
|
2204
2216
|
] }),
|
|
2205
|
-
o && /* @__PURE__ */
|
|
2217
|
+
o && /* @__PURE__ */ _("div", { className: "nice-payment-provider-config__test", children: [
|
|
2206
2218
|
/* @__PURE__ */ c(
|
|
2207
2219
|
"button",
|
|
2208
2220
|
{
|
|
2209
2221
|
type: "button",
|
|
2210
2222
|
className: "nice-payment-provider-config__test-btn",
|
|
2211
|
-
onClick: () => void
|
|
2212
|
-
disabled:
|
|
2213
|
-
children:
|
|
2223
|
+
onClick: () => void Z(),
|
|
2224
|
+
disabled: T || M,
|
|
2225
|
+
children: M ? n("paymentProviderConfig.testing", "Testing…") : b
|
|
2214
2226
|
}
|
|
2215
2227
|
),
|
|
2216
|
-
|
|
2228
|
+
I && /* @__PURE__ */ _(
|
|
2217
2229
|
"span",
|
|
2218
2230
|
{
|
|
2219
|
-
className: "nice-payment-provider-config__test-result nice-payment-provider-config__test-result--" + (
|
|
2231
|
+
className: "nice-payment-provider-config__test-result nice-payment-provider-config__test-result--" + (I.ok ? "ok" : "error"),
|
|
2220
2232
|
children: [
|
|
2221
|
-
/* @__PURE__ */ c(
|
|
2233
|
+
/* @__PURE__ */ c(Pe, { name: I.ok ? "check" : "close", size: 14 }),
|
|
2222
2234
|
" ",
|
|
2223
|
-
|
|
2235
|
+
I.message ?? (I.ok ? n("paymentProviderConfig.ok", "OK") : n("paymentProviderConfig.failed", "Failed"))
|
|
2224
2236
|
]
|
|
2225
2237
|
}
|
|
2226
2238
|
)
|
|
@@ -2236,14 +2248,14 @@ export {
|
|
|
2236
2248
|
vt as MockPaymentProcessor,
|
|
2237
2249
|
fe as NICE_CURRENCY_CATALOG,
|
|
2238
2250
|
pr as NICE_CURRENCY_CODES,
|
|
2239
|
-
|
|
2240
|
-
|
|
2251
|
+
Tt as NICE_PAYMENT_PROCESSORS,
|
|
2252
|
+
Ot as NICE_PAYMENT_PROVIDER_LIST,
|
|
2241
2253
|
we as NICE_PAYMENT_PROVIDER_PROFILES,
|
|
2242
2254
|
bt as NbpRatesProvider,
|
|
2243
2255
|
Lt as NiceCreditCardInput,
|
|
2244
2256
|
br as NiceCurrencyConverter,
|
|
2245
2257
|
Ge as NiceCurrencySelector,
|
|
2246
|
-
|
|
2258
|
+
Oe as NiceMoney,
|
|
2247
2259
|
Ze as NiceMoneyInput,
|
|
2248
2260
|
yr as NicePaymentForm,
|
|
2249
2261
|
_r as NicePaymentMethodSelector,
|
|
@@ -2261,7 +2273,7 @@ export {
|
|
|
2261
2273
|
lr as createOpenExchangeRatesProvider,
|
|
2262
2274
|
ke as detectCardBrand,
|
|
2263
2275
|
be as expectedCvcLength,
|
|
2264
|
-
|
|
2276
|
+
re as findCurrency,
|
|
2265
2277
|
ur as findPaymentProviderProfile,
|
|
2266
2278
|
mt as formatCardNumber,
|
|
2267
2279
|
ie as formatMoney,
|
|
@@ -2273,27 +2285,27 @@ export {
|
|
|
2273
2285
|
kt as makeAdyenAdapter,
|
|
2274
2286
|
xt as makeAutopayAdapter,
|
|
2275
2287
|
Rt as makeBlikAdapter,
|
|
2276
|
-
|
|
2288
|
+
Pt as makeBraintreeAdapter,
|
|
2277
2289
|
At as makeCoinbaseCommerceAdapter,
|
|
2278
2290
|
Ut as makeKlarnaAdapter,
|
|
2279
2291
|
Dt as makeMollieAdapter,
|
|
2280
2292
|
wt as makePayPalAdapter,
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2293
|
+
St as makePayUAdapter,
|
|
2294
|
+
It as makePrzelewy24Adapter,
|
|
2295
|
+
Mt as makeRazorpayAdapter,
|
|
2284
2296
|
Ct as makeSquareAdapter,
|
|
2285
2297
|
Nt as makeStripeAdapter,
|
|
2286
2298
|
$t as makeTpayAdapter,
|
|
2287
2299
|
cr as maskCardNumber,
|
|
2288
|
-
|
|
2300
|
+
Se as multiplyMoney,
|
|
2289
2301
|
ar as negateMoney,
|
|
2290
2302
|
je as normaliseExpiry,
|
|
2291
2303
|
ut as parseMoney,
|
|
2292
2304
|
er as registerCurrency,
|
|
2293
2305
|
dt as subtractMoney,
|
|
2294
|
-
|
|
2295
|
-
|
|
2306
|
+
ce as toMoney,
|
|
2307
|
+
Ie as useNiceExchangeRate,
|
|
2296
2308
|
mr as useNiceMoney,
|
|
2297
|
-
|
|
2309
|
+
Kt as useNicePayment,
|
|
2298
2310
|
qe as validateCreditCard
|
|
2299
2311
|
};
|