@taxbit/react-sdk 0.4.3 → 0.4.4
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/taxbit-react-sdk.js
CHANGED
|
@@ -543,8 +543,8 @@ const Ua = (e, a) => `https://api.multi1.enterprise${a === "STAGING" ? "-staging
|
|
|
543
543
|
(e, a) => Fn - a
|
|
544
544
|
), Yt = qt.map((e) => ({
|
|
545
545
|
value: e
|
|
546
|
-
})), R = (e) => e === void 0 || e === "",
|
|
547
|
-
const n = !a && ((e == null ? void 0 : e.accountHolderUsAccountType) !== void 0 && (e == null ? void 0 : e.regardedOwnerUsPerson) === void 0 || (e == null ? void 0 : e.regardedOwnerUsPerson) === "yes") || !!(a != null && a.includes("W-9")), r = !a && ((e == null ? void 0 : e.accountHolderUsPerson) === "no" && (e == null ? void 0 : e.regardedOwnerUsPerson) === void 0 || (e == null ? void 0 : e.regardedOwnerUsPerson) === "no") || !!(a != null && a.includes("W-8BEN")) || !!(a != null && a.includes("W-8BEN-E")), o = !a && ((e == null ? void 0 : e.accountHolderForeignAccountType) === "individual" || (e == null ? void 0 : e.regardedOwnerForeignAccountType) === "individual") || !!(a != null && a.includes("W-8BEN")), s = !a && (!!(e != null && e.accountHolderForeignAccountType) && e.accountHolderForeignAccountType !== "individual" && e.accountHolderForeignAccountType !== "disregardedEntity" || !!(e != null && e.regardedOwnerForeignAccountType) && e.regardedOwnerForeignAccountType !== "individual") || !!(a != null && a.includes("W-8BEN-E")), d = !a && (e == null ? void 0 : e.accountHolderIsEuResident) !== void 0 || !!(a != null && a.includes("DAC7")), l = e.accountHolderForeignAccountType === "disregardedEntity" || e.accountHolderUsAccountType === "disregardedEntity" || e.accountHolderUsAccountType === "smllc" && e.accountHolderUsSmllcElection === "no", m = (e == null ? void 0 : e.accountHolderIsEuResident) === "yes" && (R(e == null ? void 0 : e.accountHolderTaxResidenceForeignTin1) && oe(e == null ? void 0 : e.accountHolderTaxResidenceCountry1) || !oe(e == null ? void 0 : e.accountHolderTaxResidenceCountry1)) && (R(e == null ? void 0 : e.accountHolderTaxResidenceForeignTin2) && oe(e == null ? void 0 : e.accountHolderTaxResidenceCountry2) || !oe(e == null ? void 0 : e.accountHolderTaxResidenceCountry2)) && (R(e == null ? void 0 : e.accountHolderTaxResidenceForeignTin3) && oe(e == null ? void 0 : e.accountHolderTaxResidenceCountry3) || !oe(e == null ? void 0 : e.accountHolderTaxResidenceCountry3)) && (R(e == null ? void 0 : e.accountHolderTaxResidenceForeignTin4) && oe(e == null ? void 0 : e.accountHolderTaxResidenceCountry4) || !oe(e == null ? void 0 : e.accountHolderTaxResidenceCountry4)) && (R(e == null ? void 0 : e.accountHolderTaxResidenceForeignTin5) && oe(e == null ? void 0 : e.accountHolderTaxResidenceCountry5) || !oe(e == null ? void 0 : e.accountHolderTaxResidenceCountry5)), k =
|
|
546
|
+
})), R = (e) => e === void 0 || e === "", U = (e) => !R(e), xa = (e, a) => {
|
|
547
|
+
const n = !a && ((e == null ? void 0 : e.accountHolderUsAccountType) !== void 0 && (e == null ? void 0 : e.regardedOwnerUsPerson) === void 0 || (e == null ? void 0 : e.regardedOwnerUsPerson) === "yes") || !!(a != null && a.includes("W-9")), r = !a && ((e == null ? void 0 : e.accountHolderUsPerson) === "no" && (e == null ? void 0 : e.regardedOwnerUsPerson) === void 0 || (e == null ? void 0 : e.regardedOwnerUsPerson) === "no") || !!(a != null && a.includes("W-8BEN")) || !!(a != null && a.includes("W-8BEN-E")), o = !a && ((e == null ? void 0 : e.accountHolderForeignAccountType) === "individual" || (e == null ? void 0 : e.regardedOwnerForeignAccountType) === "individual") || !!(a != null && a.includes("W-8BEN")), s = !a && (!!(e != null && e.accountHolderForeignAccountType) && e.accountHolderForeignAccountType !== "individual" && e.accountHolderForeignAccountType !== "disregardedEntity" || !!(e != null && e.regardedOwnerForeignAccountType) && e.regardedOwnerForeignAccountType !== "individual") || !!(a != null && a.includes("W-8BEN-E")), d = !a && (e == null ? void 0 : e.accountHolderIsEuResident) !== void 0 || !!(a != null && a.includes("DAC7")), l = e.accountHolderForeignAccountType === "disregardedEntity" || e.accountHolderUsAccountType === "disregardedEntity" || e.accountHolderUsAccountType === "smllc" && e.accountHolderUsSmllcElection === "no", m = (e == null ? void 0 : e.accountHolderIsEuResident) === "yes" && (R(e == null ? void 0 : e.accountHolderTaxResidenceForeignTin1) && oe(e == null ? void 0 : e.accountHolderTaxResidenceCountry1) || !oe(e == null ? void 0 : e.accountHolderTaxResidenceCountry1)) && (R(e == null ? void 0 : e.accountHolderTaxResidenceForeignTin2) && oe(e == null ? void 0 : e.accountHolderTaxResidenceCountry2) || !oe(e == null ? void 0 : e.accountHolderTaxResidenceCountry2)) && (R(e == null ? void 0 : e.accountHolderTaxResidenceForeignTin3) && oe(e == null ? void 0 : e.accountHolderTaxResidenceCountry3) || !oe(e == null ? void 0 : e.accountHolderTaxResidenceCountry3)) && (R(e == null ? void 0 : e.accountHolderTaxResidenceForeignTin4) && oe(e == null ? void 0 : e.accountHolderTaxResidenceCountry4) || !oe(e == null ? void 0 : e.accountHolderTaxResidenceCountry4)) && (R(e == null ? void 0 : e.accountHolderTaxResidenceForeignTin5) && oe(e == null ? void 0 : e.accountHolderTaxResidenceCountry5) || !oe(e == null ? void 0 : e.accountHolderTaxResidenceCountry5)), k = U(e == null ? void 0 : e.accountHolderTaxResidenceCountry1) || U(e == null ? void 0 : e.accountHolderTaxResidenceCountry2) || U(e == null ? void 0 : e.accountHolderTaxResidenceCountry3) || U(e == null ? void 0 : e.accountHolderTaxResidenceCountry4) || U(e == null ? void 0 : e.accountHolderTaxResidenceCountry5), g = (e == null ? void 0 : e.accountHolderIsIndividual) === "yes" || (e == null ? void 0 : e.accountHolderUsAccountType) === "individual" || (e == null ? void 0 : e.accountHolderForeignAccountType) === "individual" || (e == null ? void 0 : e.accountHolderUsAccountType) === "disregardedEntity" && ((e == null ? void 0 : e.regardedOwnerForeignAccountType) === "individual" || (e == null ? void 0 : e.regardedOwnerUsAccountType) === "individual") || (e == null ? void 0 : e.accountHolderForeignAccountType) === "disregardedEntity" && ((e == null ? void 0 : e.regardedOwnerForeignAccountType) === "individual" || (e == null ? void 0 : e.regardedOwnerUsAccountType) === "individual");
|
|
548
548
|
return {
|
|
549
549
|
accountHolderIsDisregarded: l,
|
|
550
550
|
hasNoEUTaxId: m,
|
|
@@ -724,7 +724,7 @@ const Ua = (e, a) => `https://api.multi1.enterprise${a === "STAGING" ? "-staging
|
|
|
724
724
|
qa(n)
|
|
725
725
|
]
|
|
726
726
|
)
|
|
727
|
-
), ir = "0.4.
|
|
727
|
+
), ir = "0.4.4", x = (e) => e === void 0 ? void 0 : e === "yes", nr = (e) => {
|
|
728
728
|
const a = {
|
|
729
729
|
city: e.accountHolderAddressCity,
|
|
730
730
|
country: e.accountHolderAddressCountry,
|
|
@@ -819,7 +819,7 @@ const Ua = (e, a) => `https://api.multi1.enterprise${a === "STAGING" ? "-staging
|
|
|
819
819
|
cityOfBirth: e.accountHolderCityOfBirth,
|
|
820
820
|
countryOfBirth: e.accountHolderCountryOfBirth,
|
|
821
821
|
financialAccountIdentifier: e.accountHolderFinancialAccountIdentifier,
|
|
822
|
-
financialAccountName:
|
|
822
|
+
financialAccountName: U(
|
|
823
823
|
e.accountHolderFinancialAccountIdentifier
|
|
824
824
|
) ? e.accountHolderFinancialAccountName : void 0,
|
|
825
825
|
ftin: e.accountHolderForeignTin,
|
|
@@ -914,7 +914,7 @@ const Ua = (e, a) => `https://api.multi1.enterprise${a === "STAGING" ? "-staging
|
|
|
914
914
|
))
|
|
915
915
|
return e;
|
|
916
916
|
}, ut = (e) => {
|
|
917
|
-
const { hasNoEUTaxId: a } = xa(e), n = (o) =>
|
|
917
|
+
const { hasNoEUTaxId: a } = xa(e), n = (o) => U(e[`accountHolderTaxResidenceForeignTin${o}`]) || e[`accountHolderTaxResidenceForeignTin${o}IsNotRequired`] === "yes", r = (o) => U(e[`accountHolderTaxResidenceCountry${o}`]) && R(e[`accountHolderTaxResidenceForeignTin${o}IsNotRequired`]);
|
|
918
918
|
return {
|
|
919
919
|
accountHolderUsPerson: !0,
|
|
920
920
|
accountHolderIsEuResident: !0,
|
|
@@ -1012,18 +1012,18 @@ const Ua = (e, a) => `https://api.multi1.enterprise${a === "STAGING" ? "-staging
|
|
|
1012
1012
|
"876543210",
|
|
1013
1013
|
"987654321",
|
|
1014
1014
|
"098765432"
|
|
1015
|
-
], Ra = /^\d{9}$|^\d{3}-\d{2}-\d{4}$|^\d{2}-\d{7}$/, Fa = /^[A-Za-z]\d[A-Za-z][ -]?\d[A-Za-z]\d$/, Ka = /^\d{5}$|^\d{5}-\d{4}$/, ct = (e) => /^(.)\1+$/.test(e), Ya = (e) =>
|
|
1015
|
+
], Ra = /^\d{9}$|^\d{3}-\d{2}-\d{4}$|^\d{2}-\d{7}$/, Fa = /^[A-Za-z]\d[A-Za-z][ -]?\d[A-Za-z]\d$/, Ka = /^\d{5}$|^\d{5}-\d{4}$/, ct = (e) => /^(.)\1+$/.test(e), Ya = (e) => U(e) && e.length >= 2 && e.length <= 22 && !ct(e), cr = (e) => U(e) && e.length >= 8 && e.length <= 14 && !ct(e), wa = (e) => (a) => {
|
|
1016
1016
|
const n = a[`accountHolderTaxResidenceForeignTin${e}`];
|
|
1017
|
-
if (!Ya(n) &&
|
|
1017
|
+
if (!Ya(n) && U(a[`accountHolderTaxResidenceCountry${e}`]) && R(
|
|
1018
1018
|
a[`accountHolderTaxResidenceForeignTin${e}IsNotRequired`]
|
|
1019
1019
|
))
|
|
1020
1020
|
return ["invalid"];
|
|
1021
|
-
if (
|
|
1021
|
+
if (U(n) && a[`accountHolderTaxResidenceCountry${e}`] === a.accountHolderVatCountry && n === a.accountHolderVatIdentificationNumber)
|
|
1022
1022
|
return ["mustNotMatchVatin"];
|
|
1023
1023
|
}, Va = {
|
|
1024
1024
|
accountHolderDateOfBirth: (e) => {
|
|
1025
1025
|
const a = e.accountHolderDateOfBirth;
|
|
1026
|
-
if (
|
|
1026
|
+
if (U(a)) {
|
|
1027
1027
|
if (!St(a))
|
|
1028
1028
|
return ["mustBeInDateFormat"];
|
|
1029
1029
|
if (!Nt(a))
|
|
@@ -1085,14 +1085,14 @@ const Ua = (e, a) => `https://api.multi1.enterprise${a === "STAGING" ? "-staging
|
|
|
1085
1085
|
const a = e.accountHolderBusinessRegistrationNumber;
|
|
1086
1086
|
if (e.accountHolderIsIndividual === "no" && !Ya(a))
|
|
1087
1087
|
return ["invalid"];
|
|
1088
|
-
if (
|
|
1088
|
+
if (U(a) && e.accountHolderBusinessRegistrationCountry === e.accountHolderVatCountry && a === e.accountHolderVatIdentificationNumber)
|
|
1089
1089
|
return ["mustNotMatchVatin"];
|
|
1090
1090
|
},
|
|
1091
1091
|
accountHolderTaxResidenceForeignTin1: (e) => {
|
|
1092
1092
|
const a = e.accountHolderTaxResidenceForeignTin1;
|
|
1093
1093
|
if (!Ya(a) && R(e.accountHolderTaxResidenceForeignTin1IsNotRequired))
|
|
1094
1094
|
return ["invalid"];
|
|
1095
|
-
if (
|
|
1095
|
+
if (U(a) && e.accountHolderTaxResidenceCountry1 === e.accountHolderVatCountry && a === e.accountHolderVatIdentificationNumber)
|
|
1096
1096
|
return ["mustNotMatchVatin"];
|
|
1097
1097
|
},
|
|
1098
1098
|
accountHolderTaxResidenceForeignTin2: wa("2"),
|
|
@@ -1130,9 +1130,9 @@ const Ua = (e, a) => `https://api.multi1.enterprise${a === "STAGING" ? "-staging
|
|
|
1130
1130
|
regardedOwnerUsTin: (e) => {
|
|
1131
1131
|
const a = e.regardedOwnerUsTin;
|
|
1132
1132
|
if ((e == null ? void 0 : e.regardedOwnerUsPerson) === "yes") {
|
|
1133
|
-
if (
|
|
1133
|
+
if (U(a) && !Ra.test(a))
|
|
1134
1134
|
return ["mustBeNineDigits"];
|
|
1135
|
-
if (
|
|
1135
|
+
if (U(a) && Pa.includes(a))
|
|
1136
1136
|
return ["invalid"];
|
|
1137
1137
|
} else if ((e == null ? void 0 : e.regardedOwnerUsPerson) === "no" && a !== void 0 && a !== "") {
|
|
1138
1138
|
if (!Ra.test(a))
|
|
@@ -1535,17 +1535,20 @@ const Ua = (e, a) => `https://api.multi1.enterprise${a === "STAGING" ? "-staging
|
|
|
1535
1535
|
});
|
|
1536
1536
|
};
|
|
1537
1537
|
return _(() => {
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1538
|
+
if (U(e)) {
|
|
1539
|
+
const A = {
|
|
1540
|
+
method: "GET",
|
|
1541
|
+
headers: Wa({ bearerToken: e })
|
|
1542
|
+
};
|
|
1543
|
+
fetch(c, A).then((f) => {
|
|
1544
|
+
if (f.ok)
|
|
1545
|
+
return f.json();
|
|
1546
|
+
throw f.status === 401 ? new Error("Unauthorized, please check your bearer token") : new Error("Something went wrong");
|
|
1547
|
+
}).then((f) => {
|
|
1548
|
+
s(La(f));
|
|
1549
|
+
});
|
|
1550
|
+
} else
|
|
1551
|
+
console.error("Bearer token is missing");
|
|
1549
1552
|
}, [e, c]), _(() => {
|
|
1550
1553
|
if (o && o.submissionStatus !== "NOT_SUBMITTED") {
|
|
1551
1554
|
const A = {
|
|
@@ -19563,9 +19566,9 @@ const pr = {
|
|
|
19563
19566
|
return !0;
|
|
19564
19567
|
const I = Kn(
|
|
19565
19568
|
parseInt(y),
|
|
19566
|
-
|
|
19569
|
+
U(B) ? parseInt(B) : void 0
|
|
19567
19570
|
);
|
|
19568
|
-
return
|
|
19571
|
+
return U(f) && I >= parseInt(f);
|
|
19569
19572
|
};
|
|
19570
19573
|
return {
|
|
19571
19574
|
mm: s,
|
|
@@ -19946,7 +19949,7 @@ const pr = {
|
|
|
19946
19949
|
children: r
|
|
19947
19950
|
}
|
|
19948
19951
|
) : null;
|
|
19949
|
-
},
|
|
19952
|
+
}, D = ({
|
|
19950
19953
|
name: e,
|
|
19951
19954
|
label: a,
|
|
19952
19955
|
subLabel: n,
|
|
@@ -20229,7 +20232,7 @@ const pr = {
|
|
|
20229
20232
|
showIf: d.accountHolderIsEuResident === "yes" || o || r
|
|
20230
20233
|
}
|
|
20231
20234
|
),
|
|
20232
|
-
/* @__PURE__ */ i.jsx(
|
|
20235
|
+
/* @__PURE__ */ i.jsx(D, { name: "accountHolderMailingAddressIsDifferent", label: !0 }),
|
|
20233
20236
|
/* @__PURE__ */ i.jsx(
|
|
20234
20237
|
Ga,
|
|
20235
20238
|
{
|
|
@@ -20297,7 +20300,7 @@ const pr = {
|
|
|
20297
20300
|
}
|
|
20298
20301
|
),
|
|
20299
20302
|
/* @__PURE__ */ i.jsx(
|
|
20300
|
-
|
|
20303
|
+
D,
|
|
20301
20304
|
{
|
|
20302
20305
|
label: !0,
|
|
20303
20306
|
name: c,
|
|
@@ -20344,7 +20347,7 @@ const pr = {
|
|
|
20344
20347
|
}
|
|
20345
20348
|
),
|
|
20346
20349
|
/* @__PURE__ */ i.jsx(
|
|
20347
|
-
|
|
20350
|
+
D,
|
|
20348
20351
|
{
|
|
20349
20352
|
name: "accountHolderForeignTinIsNotRequired",
|
|
20350
20353
|
onClick: m("accountHolderForeignTin"),
|
|
@@ -20381,7 +20384,7 @@ const pr = {
|
|
|
20381
20384
|
}
|
|
20382
20385
|
),
|
|
20383
20386
|
/* @__PURE__ */ i.jsx(
|
|
20384
|
-
|
|
20387
|
+
D,
|
|
20385
20388
|
{
|
|
20386
20389
|
label: !0,
|
|
20387
20390
|
name: "accountHolderVatIsNotRequired",
|
|
@@ -20656,7 +20659,7 @@ const pr = {
|
|
|
20656
20659
|
prefix: "regardedOwnerAddress"
|
|
20657
20660
|
}
|
|
20658
20661
|
),
|
|
20659
|
-
/* @__PURE__ */ i.jsx(
|
|
20662
|
+
/* @__PURE__ */ i.jsx(D, { name: "regardedOwnerMailingAddressIsDifferent", label: !0 }),
|
|
20660
20663
|
/* @__PURE__ */ i.jsx(
|
|
20661
20664
|
Ga,
|
|
20662
20665
|
{
|
|
@@ -20689,7 +20692,7 @@ const pr = {
|
|
|
20689
20692
|
/* @__PURE__ */ i.jsx(Ce, { name: "regardedOwnerUsTin", label: !0 }),
|
|
20690
20693
|
/* @__PURE__ */ i.jsx(Ce, { name: "regardedOwnerForeignTin", label: !0 }),
|
|
20691
20694
|
/* @__PURE__ */ i.jsx(
|
|
20692
|
-
|
|
20695
|
+
D,
|
|
20693
20696
|
{
|
|
20694
20697
|
name: "regardedOwnerForeignTinIsNotRequired",
|
|
20695
20698
|
label: !0,
|
|
@@ -21187,21 +21190,21 @@ const pr = {
|
|
|
21187
21190
|
/* @__PURE__ */ i.jsxs("main", { className: "taxbit-page-main", children: [
|
|
21188
21191
|
/* @__PURE__ */ i.jsx(Zo, {}),
|
|
21189
21192
|
/* @__PURE__ */ i.jsxs(se, { title: "Certify", showIf: r || n, children: [
|
|
21190
|
-
/* @__PURE__ */ i.jsx(
|
|
21191
|
-
/* @__PURE__ */ i.jsx(
|
|
21192
|
-
/* @__PURE__ */ i.jsx(
|
|
21193
|
-
/* @__PURE__ */ i.jsx(
|
|
21194
|
-
/* @__PURE__ */ i.jsx(
|
|
21195
|
-
/* @__PURE__ */ i.jsx(
|
|
21196
|
-
/* @__PURE__ */ i.jsx(
|
|
21197
|
-
/* @__PURE__ */ i.jsx(
|
|
21198
|
-
/* @__PURE__ */ i.jsx(
|
|
21199
|
-
/* @__PURE__ */ i.jsx(
|
|
21200
|
-
/* @__PURE__ */ i.jsx(
|
|
21193
|
+
/* @__PURE__ */ i.jsx(D, { name: "iCertifyToAll", label: !0 }),
|
|
21194
|
+
/* @__PURE__ */ i.jsx(D, { name: "iConfirmTheTaxIdIsCorrect", label: !0 }),
|
|
21195
|
+
/* @__PURE__ */ i.jsx(D, { name: "iAmNotSubjectToBackupWithholding", label: !0 }),
|
|
21196
|
+
/* @__PURE__ */ i.jsx(D, { name: "iAmACitizenOfTheUs", label: !0 }),
|
|
21197
|
+
/* @__PURE__ */ i.jsx(D, { name: "iAmExemptFromFatcaReporting", label: !0 }),
|
|
21198
|
+
/* @__PURE__ */ i.jsx(D, { name: "iConfirmTheEntityIsTheBeneficialOwner", label: !0 }),
|
|
21199
|
+
/* @__PURE__ */ i.jsx(D, { name: "iConfirmTheEntityIsNotAUsPerson", label: !0 }),
|
|
21200
|
+
/* @__PURE__ */ i.jsx(D, { name: "iConfirmIncomeIsNonUs", label: !0, subLabel: !0 }),
|
|
21201
|
+
/* @__PURE__ */ i.jsx(D, { name: "iConfirmTheBeneficialOwnerIsExempt", label: !0 }),
|
|
21202
|
+
/* @__PURE__ */ i.jsx(D, { name: "iConfirmTheInformationIsCorrectComplete", label: !0 }),
|
|
21203
|
+
/* @__PURE__ */ i.jsx(D, { name: "iAuthorizeWithholdingAgent", label: !0 })
|
|
21201
21204
|
] }),
|
|
21202
21205
|
/* @__PURE__ */ i.jsxs(se, { title: "Acknowledge and Sign", showIf: r || n, children: [
|
|
21203
|
-
/* @__PURE__ */ i.jsx(
|
|
21204
|
-
/* @__PURE__ */ i.jsx(
|
|
21206
|
+
/* @__PURE__ */ i.jsx(D, { name: "iAcknowlegeESignIsOk", label: !0 }),
|
|
21207
|
+
/* @__PURE__ */ i.jsx(D, { name: "iHaveLegalCapacityToSign", label: !0 }),
|
|
21205
21208
|
/* @__PURE__ */ i.jsx(Y, { label: !0, name: "signature" })
|
|
21206
21209
|
] })
|
|
21207
21210
|
] }),
|