@tesouro/embedded-components-react 0.4.25 → 0.4.27
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/experimental/RemoteCheckCapture.d.ts +741 -0
- package/dist/experimental/RemoteCheckCapture.js +3 -0
- package/dist/experimental/index.d.ts +740 -1
- package/dist/experimental/index.js +3 -0
- package/dist/index.css +3 -0
- package/dist/index.d.ts +75 -1
- package/dist/index.js +38 -38
- package/dist/lib/WidgetProvider.d.ts +22 -1
- package/dist/lib/WidgetProvider.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/data-access/dist/index.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/data-access/dist/index2.js +28 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/data-access/dist/index3.js +53 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/data-access/dist/index4.js +55 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/data-access/dist/index5.js +60 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/feature/dist/index.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/feature/dist/lib/RemoteCheckCaptureWidget/RemoteCheckCaptureWidget.js +81 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/feature/dist/lib/RemoteCheckCaptureWidget/permissions.js +15 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/feature/dist/lib/RemoteCheckCaptureWidget/testIds.js +32 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/feature/dist/lib/RemoteCheckCaptureWidget/useRemoteCheckCaptureWidget.js +270 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/feature/dist/lib/analytics/events.js +7 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/ui/dist/index.js +9 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/ui/dist/index10.js +70 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/ui/dist/index2.js +20 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/ui/dist/index3.js +31 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/ui/dist/index4.js +244 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/ui/dist/index5.js +11 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/ui/dist/index6.js +156 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/ui/dist/index7.js +22 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/ui/dist/index8.js +159 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/ui/dist/index9.js +11 -0
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +25 -25
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +190 -183
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +156 -144
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/zod.gen.js +2219 -2220
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/transportInterceptors.js +16 -3
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/util/dist/lib/formatMoneyExact.js +6 -6
- package/package.json +1 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/remote-check-capture/feature/dist/lib/RemoteCheckCaptureWidget/testIds.js
|
|
2
|
+
var e = {
|
|
3
|
+
root: "remote-check-capture-widget-root",
|
|
4
|
+
collectPaymentButton: "remote-check-capture-collect-payment-button",
|
|
5
|
+
detailsScreen: {
|
|
6
|
+
backButton: "remote-check-capture-details-back-button",
|
|
7
|
+
customerSelect: "remote-check-capture-details-customer-select",
|
|
8
|
+
invoiceSelect: "remote-check-capture-details-invoice-select",
|
|
9
|
+
clearInvoiceButton: "remote-check-capture-details-clear-invoice-button",
|
|
10
|
+
amountInput: "remote-check-capture-details-amount-input",
|
|
11
|
+
continueButton: "remote-check-capture-details-continue-button"
|
|
12
|
+
},
|
|
13
|
+
captureScreen: {
|
|
14
|
+
captureButton: "remote-check-capture-capture-button",
|
|
15
|
+
retryButton: "remote-check-capture-capture-retry-button"
|
|
16
|
+
},
|
|
17
|
+
reviewScreen: {
|
|
18
|
+
backButton: "remote-check-capture-review-back-button",
|
|
19
|
+
frontImage: "remote-check-capture-review-front-image",
|
|
20
|
+
backImage: "remote-check-capture-review-back-image",
|
|
21
|
+
retakeFrontButton: "remote-check-capture-review-retake-front-button",
|
|
22
|
+
retakeBackButton: "remote-check-capture-review-retake-back-button",
|
|
23
|
+
completeDepositButton: "remote-check-capture-review-complete-deposit-button"
|
|
24
|
+
},
|
|
25
|
+
completeScreen: {
|
|
26
|
+
depositAnotherCheckButton: "remote-check-capture-complete-deposit-another-button",
|
|
27
|
+
tryAgainButton: "remote-check-capture-complete-try-again-button",
|
|
28
|
+
doneButton: "remote-check-capture-complete-done-button"
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
32
|
+
export { e as remoteCheckCaptureWidgetTestIds };
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { toast as e } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { useAllBankAccountsQuery as t } from "../../../../../shared/data-access/dist/lib/bank-account/useAllBankAccountsQuery.js";
|
|
7
|
+
import "../../../../../shared/data-access/dist/index.js";
|
|
8
|
+
import "../../../../../shared/ui/dist/index.js";
|
|
9
|
+
import { useAnalyticsTrack as n } from "../../../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
10
|
+
import { amountOutputToMajorUnits as r, minorExponentForCurrency as i } from "../../../../../shared/util/dist/lib/amountOutputToMajorUnits.js";
|
|
11
|
+
import { formatCalendarDate as a } from "../../../../../shared/util/dist/lib/formatCalendarDate.js";
|
|
12
|
+
import { formatMoneyExact as o } from "../../../../../shared/util/dist/lib/formatMoneyExact.js";
|
|
13
|
+
import { parseDecimalAmountToMinorUnits as s } from "../../../../../shared/util/dist/lib/parseDecimalAmountToMinorUnits.js";
|
|
14
|
+
import { useWidgetConfig as c } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
15
|
+
import "../../../../../shared/feature/dist/index.js";
|
|
16
|
+
import { RemoteCheckCaptureWidgetAnalyticsEvent as l } from "../analytics/events.js";
|
|
17
|
+
import { remoteCheckCaptureWidgetTestIds as u } from "./testIds.js";
|
|
18
|
+
import { canCollectRemoteCheckDeposit as ee } from "./permissions.js";
|
|
19
|
+
import { DEFAULT_CHECK_AMOUNT_AND_DETAIL_SCREEN_LABELS as te } from "../../../../ui/dist/index3.js";
|
|
20
|
+
import { CheckCaptureSide as d } from "../../../../ui/dist/index6.js";
|
|
21
|
+
import { DEFAULT_REVIEW_DEPOSIT_SCREEN_LABELS as ne } from "../../../../ui/dist/index7.js";
|
|
22
|
+
import { DEFAULT_DEPOSIT_COMPLETE_SCREEN_LABELS as f } from "../../../../ui/dist/index9.js";
|
|
23
|
+
import "../../../../ui/dist/index.js";
|
|
24
|
+
import { useCreateCheckDepositMutation as re } from "../../../../data-access/dist/index3.js";
|
|
25
|
+
import { useCustomersQuery as ie } from "../../../../data-access/dist/index4.js";
|
|
26
|
+
import { useInvoicesQuery as ae } from "../../../../data-access/dist/index5.js";
|
|
27
|
+
import "../../../../data-access/dist/index.js";
|
|
28
|
+
import { useEffect as p, useState as m } from "react";
|
|
29
|
+
//#region ../../libs/tesouro-embedded-components-react/remote-check-capture/feature/dist/lib/RemoteCheckCaptureWidget/useRemoteCheckCaptureWidget.js
|
|
30
|
+
var h = {
|
|
31
|
+
Details: "details",
|
|
32
|
+
Capture: "capture",
|
|
33
|
+
Review: "review",
|
|
34
|
+
Complete: "complete"
|
|
35
|
+
}, g = 2;
|
|
36
|
+
function oe(e, t = /* @__PURE__ */ new Date()) {
|
|
37
|
+
let n = new Date(t), r = g;
|
|
38
|
+
for (; r > 0;) {
|
|
39
|
+
n.setDate(n.getDate() + 1);
|
|
40
|
+
let e = n.getDay();
|
|
41
|
+
e !== 0 && e !== 6 && --r;
|
|
42
|
+
}
|
|
43
|
+
return `${new Intl.DateTimeFormat("en-US", {
|
|
44
|
+
weekday: "short",
|
|
45
|
+
month: "short",
|
|
46
|
+
day: "numeric"
|
|
47
|
+
}).format(n)} ${e}`;
|
|
48
|
+
}
|
|
49
|
+
function _(e, t) {
|
|
50
|
+
return `${e.nickname?.trim() || t} ••${e.accountNumber.slice(-4)}`;
|
|
51
|
+
}
|
|
52
|
+
function v(e, t) {
|
|
53
|
+
return e?.account_number ? `${e.bank_name?.trim() || t} ••${e.account_number.slice(-4)}` : null;
|
|
54
|
+
}
|
|
55
|
+
function se(e, t, n) {
|
|
56
|
+
if (e.bank_account_id) {
|
|
57
|
+
let r = t.find((t) => t.id === e.bank_account_id), i = r && _(r, n) || v(e.bank_account_snapshot, n) || n;
|
|
58
|
+
return {
|
|
59
|
+
id: e.bank_account_id,
|
|
60
|
+
label: i
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
let r = e.bank_account_snapshot?.account_number?.slice(-4);
|
|
64
|
+
if (!r) return null;
|
|
65
|
+
let i = t.filter((e) => e.accountNumber.slice(-4) === r), [a] = i;
|
|
66
|
+
return i.length === 1 && a ? {
|
|
67
|
+
id: a.id,
|
|
68
|
+
label: _(a, n)
|
|
69
|
+
} : null;
|
|
70
|
+
}
|
|
71
|
+
function ce(e) {
|
|
72
|
+
return "organization" in e ? e.organization.legal_name : `${e.individual.first_name} ${e.individual.last_name}`.trim();
|
|
73
|
+
}
|
|
74
|
+
function le(e, t) {
|
|
75
|
+
let n = i(e.currency), s = o(r({
|
|
76
|
+
value: e.amount_due ?? e.total_amount ?? 0,
|
|
77
|
+
currencyCode: e.currency
|
|
78
|
+
}), {
|
|
79
|
+
currencyCode: e.currency,
|
|
80
|
+
minimumFractionDigits: n,
|
|
81
|
+
maximumFractionDigits: n
|
|
82
|
+
}), c = e.due_date ? ` · ${t} ${a(e.due_date)}` : "";
|
|
83
|
+
return `${e.document_id ?? e.id}${c} · ${s}`;
|
|
84
|
+
}
|
|
85
|
+
function y(e, t) {
|
|
86
|
+
if (t === null) return null;
|
|
87
|
+
let n = e.findIndex((e) => e.id === t);
|
|
88
|
+
return n === -1 ? null : n;
|
|
89
|
+
}
|
|
90
|
+
function ue(e, t) {
|
|
91
|
+
let n = e.indexOf("."), r = e.lastIndexOf(".");
|
|
92
|
+
if (n === -1 || n !== r) return e;
|
|
93
|
+
let a = i(t);
|
|
94
|
+
return a === 0 ? e.slice(0, n) : e.slice(0, n + 1 + a);
|
|
95
|
+
}
|
|
96
|
+
function de(e, t) {
|
|
97
|
+
let n = s(e, t);
|
|
98
|
+
if (n === null) return `${t} ${e}`;
|
|
99
|
+
let a = i(t);
|
|
100
|
+
return o(r({
|
|
101
|
+
value: n,
|
|
102
|
+
currencyCode: t
|
|
103
|
+
}), {
|
|
104
|
+
currencyCode: t,
|
|
105
|
+
minimumFractionDigits: a,
|
|
106
|
+
maximumFractionDigits: a
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
function fe(e) {
|
|
110
|
+
return new Intl.NumberFormat("en-US", {
|
|
111
|
+
style: "currency",
|
|
112
|
+
currency: e,
|
|
113
|
+
currencyDisplay: "narrowSymbol"
|
|
114
|
+
}).formatToParts(0).find((e) => e.type === "currency")?.value ?? e;
|
|
115
|
+
}
|
|
116
|
+
function pe({ labels: r, onDepositComplete: i } = {}) {
|
|
117
|
+
let a = r?.details, o = {
|
|
118
|
+
...te,
|
|
119
|
+
...a
|
|
120
|
+
}, g = n(), { initResponse: v } = c(), pe = ee(v?.scopes);
|
|
121
|
+
p(() => {
|
|
122
|
+
g(l.Mounted);
|
|
123
|
+
}, [g]);
|
|
124
|
+
let [b, me] = m(!1), [x, S] = m(h.Details), [C, w] = m(d.Front), [T, E] = m(""), [D, O] = m(""), [k, A] = m(null), [j, M] = m(null), [N, P] = m(null), [F, I] = m(""), [L, R] = m(null), z = t({ enabled: b }), B = (z.data?.data ?? []).filter((e) => e.status === "ACTIVE"), V = ie({ enabled: b }), H = V.customers, U = k === null ? null : H.find((e) => e.id === k) ?? null, he = y(H, k), ge = ae({
|
|
125
|
+
counterpartId: U?.id,
|
|
126
|
+
enabled: b && !!U
|
|
127
|
+
}), W = ge.invoices, G = re(), _e = U ? W.map((e) => le(e, o.invoiceDueDatePrefix)) : [], K = U && j !== null ? W.find((e) => e.id === j) ?? null : null, ve = y(W, j), q = U !== null, J = K ? se(K, B, o.defaultAccountName) : null, Y = q ? null : B.find((e) => e.id === N) ?? null, X = K?.currency ?? Y?.balance.currencyCode ?? "USD";
|
|
128
|
+
p(() => {
|
|
129
|
+
I((e) => ue(e, X));
|
|
130
|
+
}, [X]);
|
|
131
|
+
let ye = q ? J ? [J.label] : [] : B.map((e) => _(e, o.defaultAccountName)), be = q ? J ? 0 : null : y(B, N), Z = q ? J : Y ? {
|
|
132
|
+
id: Y.id,
|
|
133
|
+
label: _(Y, o.defaultAccountName)
|
|
134
|
+
} : null, Q = () => {
|
|
135
|
+
S(h.Details), w(d.Front), E(""), O(""), A(null), M(null), P(null), I(""), R(null), G.reset();
|
|
136
|
+
}, $ = (e) => {
|
|
137
|
+
!e && G.isPending || (me(e), e || Q());
|
|
138
|
+
}, xe = () => {
|
|
139
|
+
g(l.CollectPaymentClicked), Q(), me(!0);
|
|
140
|
+
}, Se = () => {
|
|
141
|
+
let t = s(F, X);
|
|
142
|
+
if (!Z || t === null) {
|
|
143
|
+
e.error(Z ? o.invalidAmountErrorToast : o.noDepositAccountErrorToast);
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
let n = de(F, X), r = Z.label;
|
|
147
|
+
G.mutate({
|
|
148
|
+
path: { id: Z.id },
|
|
149
|
+
body: {
|
|
150
|
+
amount: t,
|
|
151
|
+
currencyCode: X,
|
|
152
|
+
...K ? { invoiceId: K.id } : {}
|
|
153
|
+
}
|
|
154
|
+
}, {
|
|
155
|
+
onSuccess: () => {
|
|
156
|
+
R({
|
|
157
|
+
isSuccess: !0,
|
|
158
|
+
formattedAmount: n,
|
|
159
|
+
depositAccountLabel: r
|
|
160
|
+
}), S(h.Complete), i?.();
|
|
161
|
+
},
|
|
162
|
+
onError: (e) => {
|
|
163
|
+
console.error("[remote-check-capture] check deposit failed", e), R({
|
|
164
|
+
isSuccess: !1,
|
|
165
|
+
formattedAmount: n,
|
|
166
|
+
depositAccountLabel: r
|
|
167
|
+
}), S(h.Complete);
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
}, Ce = x === h.Review ? r?.review?.title ?? ne.title : x === h.Complete ? L?.isSuccess === !1 ? r?.complete?.errorTitle ?? f.errorTitle : r?.complete?.title ?? f.title : o.title, we = !!(T && D), Te = {
|
|
171
|
+
labels: {
|
|
172
|
+
...a,
|
|
173
|
+
currencyPrefix: a?.currencyPrefix ?? fe(X),
|
|
174
|
+
...we ? { continueButton: o.continueToReviewButton } : {}
|
|
175
|
+
},
|
|
176
|
+
testIds: u.detailsScreen,
|
|
177
|
+
customerOptions: H.map(ce),
|
|
178
|
+
selectedCustomerIndex: he,
|
|
179
|
+
onCustomerSelect: (e) => {
|
|
180
|
+
A(H[e]?.id ?? null), M(null), I("");
|
|
181
|
+
},
|
|
182
|
+
onCustomerClear: () => {
|
|
183
|
+
A(null), M(null), P(null);
|
|
184
|
+
},
|
|
185
|
+
customerLoadError: V.isError,
|
|
186
|
+
invoiceOptions: _e,
|
|
187
|
+
invoiceSelectDisabled: U === null,
|
|
188
|
+
invoiceLoadError: U !== null && ge.isError,
|
|
189
|
+
selectedInvoiceIndex: ve,
|
|
190
|
+
onInvoiceSelect: (e) => {
|
|
191
|
+
M(W[e]?.id ?? null);
|
|
192
|
+
},
|
|
193
|
+
onInvoiceClear: () => M(null),
|
|
194
|
+
accountOptions: ye,
|
|
195
|
+
selectedAccountIndex: be,
|
|
196
|
+
onAccountSelect: (e) => {
|
|
197
|
+
P(B[e]?.id ?? null);
|
|
198
|
+
},
|
|
199
|
+
accountSelectDisabled: q,
|
|
200
|
+
accountLoadError: q ? K !== null && J === null && !z.isLoading : z.isError,
|
|
201
|
+
amount: F,
|
|
202
|
+
onAmountChange: (e) => {
|
|
203
|
+
I(ue(e, X));
|
|
204
|
+
},
|
|
205
|
+
limitsHint: o.amountLimitsHint.replaceAll("{currencySymbol}", fe(X)),
|
|
206
|
+
onBack: () => $(!1),
|
|
207
|
+
onContinue: () => {
|
|
208
|
+
if (we) {
|
|
209
|
+
S(h.Review);
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
w(d.Front), S(h.Capture);
|
|
213
|
+
},
|
|
214
|
+
continueDisabled: s(F, X) === null || Z === null || (U === null ? N === null : ve === null)
|
|
215
|
+
}, Ee = x === h.Capture ? {
|
|
216
|
+
labels: r?.capture,
|
|
217
|
+
testIds: u.captureScreen,
|
|
218
|
+
side: C,
|
|
219
|
+
onCapture: (e) => {
|
|
220
|
+
C === d.Front ? (E(e), D ? S(h.Review) : w(d.Back)) : (O(e), T ? S(h.Review) : w(d.Front));
|
|
221
|
+
}
|
|
222
|
+
} : null, De = x === h.Review ? {
|
|
223
|
+
labels: r?.review,
|
|
224
|
+
testIds: u.reviewScreen,
|
|
225
|
+
frontImage: T,
|
|
226
|
+
backImage: D,
|
|
227
|
+
amount: de(F, X),
|
|
228
|
+
depositTo: Z?.label ?? "",
|
|
229
|
+
customer: U ? ce(U) : "",
|
|
230
|
+
invoice: K ? le(K, o.invoiceDueDatePrefix) : void 0,
|
|
231
|
+
availableDate: oe(r?.review?.availabilityEstimateSuffix ?? ne.availabilityEstimateSuffix),
|
|
232
|
+
onBack: () => S(h.Details),
|
|
233
|
+
onRetakeFront: () => {
|
|
234
|
+
w(d.Front), S(h.Capture);
|
|
235
|
+
},
|
|
236
|
+
onRetakeBack: () => {
|
|
237
|
+
w(d.Back), S(h.Capture);
|
|
238
|
+
},
|
|
239
|
+
onCompleteDeposit: Se,
|
|
240
|
+
isSubmitting: G.isPending
|
|
241
|
+
} : null, Oe = x === h.Complete && L ? {
|
|
242
|
+
labels: r?.complete,
|
|
243
|
+
testIds: u.completeScreen,
|
|
244
|
+
isSuccess: L.isSuccess,
|
|
245
|
+
amount: L.formattedAmount,
|
|
246
|
+
depositAccount: L.depositAccountLabel,
|
|
247
|
+
onDepositAnotherCheck: () => {
|
|
248
|
+
Q();
|
|
249
|
+
},
|
|
250
|
+
onTryAgain: () => {
|
|
251
|
+
R(null), S(h.Review);
|
|
252
|
+
},
|
|
253
|
+
onDone: () => $(!1)
|
|
254
|
+
} : null;
|
|
255
|
+
return {
|
|
256
|
+
open: b,
|
|
257
|
+
onOpenChange: $,
|
|
258
|
+
onCollectPaymentClick: xe,
|
|
259
|
+
collectPaymentButtonLabel: o.collectPaymentButton,
|
|
260
|
+
canCollectDeposit: pe,
|
|
261
|
+
step: x,
|
|
262
|
+
modalTitle: Ce,
|
|
263
|
+
detailsScreenProps: Te,
|
|
264
|
+
captureScreenProps: Ee,
|
|
265
|
+
reviewScreenProps: De,
|
|
266
|
+
completeScreenProps: Oe
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
//#endregion
|
|
270
|
+
export { h as RemoteCheckCaptureFlowStep, pe as useRemoteCheckCaptureWidget };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/remote-check-capture/feature/dist/lib/analytics/events.js
|
|
2
|
+
var e = {
|
|
3
|
+
Mounted: "remote_check_capture_widget.mounted",
|
|
4
|
+
CollectPaymentClicked: "remote_check_capture_widget.collect_payment_clicked"
|
|
5
|
+
}, t = "remote_check_capture_widget";
|
|
6
|
+
//#endregion
|
|
7
|
+
export { e as RemoteCheckCaptureWidgetAnalyticsEvent, t as WIDGET_NAME };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DEFAULT_CHECK_AMOUNT_AND_DETAIL_SCREEN_LABELS as e } from "./index3.js";
|
|
2
|
+
import { CheckAmountAndDetailScreen as t } from "./index4.js";
|
|
3
|
+
import "./index5.js";
|
|
4
|
+
import { CheckCaptureScreen as n, CheckCaptureSide as r } from "./index6.js";
|
|
5
|
+
import { DEFAULT_REVIEW_DEPOSIT_SCREEN_LABELS as i } from "./index7.js";
|
|
6
|
+
import { ReviewDepositScreen as a } from "./index8.js";
|
|
7
|
+
import { DEFAULT_DEPOSIT_COMPLETE_SCREEN_LABELS as o } from "./index9.js";
|
|
8
|
+
import { DepositCompleteScreen as s } from "./index10.js";
|
|
9
|
+
export { t as CheckAmountAndDetailScreen, n as CheckCaptureScreen, r as CheckCaptureSide, e as DEFAULT_CHECK_AMOUNT_AND_DETAIL_SCREEN_LABELS, o as DEFAULT_DEPOSIT_COMPLETE_SCREEN_LABELS, i as DEFAULT_REVIEW_DEPOSIT_SCREEN_LABELS, s as DepositCompleteScreen, a as ReviewDepositScreen };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { Button as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { DEFAULT_DEPOSIT_COMPLETE_SCREEN_LABELS as t } from "./index9.js";
|
|
7
|
+
import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
8
|
+
import { Check as a, X as o } from "lucide-react";
|
|
9
|
+
//#region ../../libs/tesouro-embedded-components-react/remote-check-capture/ui/dist/index10.js
|
|
10
|
+
function s({ labels: s, testIds: c, isSuccess: l, amount: u, depositAccount: d, onDepositAnotherCheck: f, onTryAgain: p, onDone: m }) {
|
|
11
|
+
let h = {
|
|
12
|
+
...t,
|
|
13
|
+
...s
|
|
14
|
+
};
|
|
15
|
+
return /* @__PURE__ */ i("div", {
|
|
16
|
+
className: "ttw:flex ttw:h-full ttw:w-full ttw:flex-col ttw:items-center ttw:overflow-auto ttw:bg-background ttw:p-6 ttw:text-center",
|
|
17
|
+
children: [/* @__PURE__ */ i("div", {
|
|
18
|
+
className: "ttw:flex ttw:min-h-0 ttw:flex-1 ttw:flex-col ttw:items-center ttw:justify-center",
|
|
19
|
+
children: [
|
|
20
|
+
l ? /* @__PURE__ */ r("div", {
|
|
21
|
+
"aria-hidden": "true",
|
|
22
|
+
className: "ttw:flex ttw:size-20 ttw:shrink-0 ttw:items-center ttw:justify-center ttw:rounded-full ttw:bg-emerald-100",
|
|
23
|
+
children: /* @__PURE__ */ r(a, {
|
|
24
|
+
className: "ttw:size-10 ttw:text-emerald-700",
|
|
25
|
+
strokeWidth: 2.5
|
|
26
|
+
})
|
|
27
|
+
}) : /* @__PURE__ */ r("div", {
|
|
28
|
+
"aria-hidden": "true",
|
|
29
|
+
className: "ttw:flex ttw:size-20 ttw:shrink-0 ttw:items-center ttw:justify-center ttw:rounded-full ttw:bg-destructive/10",
|
|
30
|
+
children: /* @__PURE__ */ r(o, {
|
|
31
|
+
className: "ttw:size-10 ttw:text-destructive",
|
|
32
|
+
strokeWidth: 2.5
|
|
33
|
+
})
|
|
34
|
+
}),
|
|
35
|
+
/* @__PURE__ */ r("h2", {
|
|
36
|
+
className: "ttw:mt-6 ttw:text-xl ttw:font-bold ttw:text-foreground",
|
|
37
|
+
children: l ? h.title : h.errorTitle
|
|
38
|
+
}),
|
|
39
|
+
l ? /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ r("p", {
|
|
40
|
+
className: "ttw:mt-2 ttw:text-2xl ttw:font-bold ttw:text-foreground",
|
|
41
|
+
children: u
|
|
42
|
+
}), /* @__PURE__ */ r("p", {
|
|
43
|
+
className: "ttw:mt-1 ttw:text-sm ttw:text-muted-foreground",
|
|
44
|
+
children: d
|
|
45
|
+
})] }) : /* @__PURE__ */ r("p", {
|
|
46
|
+
className: "ttw:mt-2 ttw:max-w-sm ttw:text-sm ttw:text-muted-foreground",
|
|
47
|
+
children: h.errorMessage
|
|
48
|
+
})
|
|
49
|
+
]
|
|
50
|
+
}), /* @__PURE__ */ i("div", {
|
|
51
|
+
className: "ttw:flex ttw:w-full ttw:shrink-0 ttw:flex-col ttw:gap-3",
|
|
52
|
+
children: [/* @__PURE__ */ r(e, {
|
|
53
|
+
type: "button",
|
|
54
|
+
onClick: l ? f : p,
|
|
55
|
+
"data-testid": l ? c?.depositAnotherCheckButton : c?.tryAgainButton,
|
|
56
|
+
className: "ttw:h-14 ttw:w-full ttw:rounded-xl ttw:text-base ttw:font-semibold",
|
|
57
|
+
children: l ? h.depositAnotherCheckButton : h.tryAgainButton
|
|
58
|
+
}), /* @__PURE__ */ r(e, {
|
|
59
|
+
type: "button",
|
|
60
|
+
variant: "outline",
|
|
61
|
+
onClick: m,
|
|
62
|
+
"data-testid": c?.doneButton,
|
|
63
|
+
className: "ttw:h-14 ttw:w-full ttw:rounded-xl ttw:text-base ttw:font-semibold",
|
|
64
|
+
children: h.doneButton
|
|
65
|
+
})]
|
|
66
|
+
})]
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
//#endregion
|
|
70
|
+
export { s as DepositCompleteScreen };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/remote-check-capture/ui/dist/index2.js
|
|
2
|
+
var e = /[\d.]/;
|
|
3
|
+
function t(e) {
|
|
4
|
+
let t = e.replace(/[^\d.]/g, ""), n = t.indexOf(".");
|
|
5
|
+
n !== -1 && (t = t.slice(0, n + 1) + t.slice(n + 1).replace(/\./g, ""));
|
|
6
|
+
let [r, i] = t.split("."), a = r.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
7
|
+
return i === void 0 ? a : `${a}.${i.slice(0, 4)}`;
|
|
8
|
+
}
|
|
9
|
+
function n(t, n) {
|
|
10
|
+
let r = 0;
|
|
11
|
+
for (let i = 0; i < n && i < t.length; i++) e.test(t[i]) && (r += 1);
|
|
12
|
+
return r;
|
|
13
|
+
}
|
|
14
|
+
function r(e, t) {
|
|
15
|
+
let n = 0;
|
|
16
|
+
for (let r = 0; r < e.length; r++) if (e[r] !== "," && (n += 1, n >= t)) return r + 1;
|
|
17
|
+
return e.length;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { n as countKeptCharsBefore, r as cursorAfterKeptChars, t as formatGroupedAmountInput };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/remote-check-capture/ui/dist/index3.js
|
|
2
|
+
var e = {
|
|
3
|
+
title: "Deposit a check",
|
|
4
|
+
backButton: "Back",
|
|
5
|
+
customerLabel: "Customer (optional)",
|
|
6
|
+
customerPlaceholder: "Select a customer",
|
|
7
|
+
customerNoneOption: "None",
|
|
8
|
+
clearCustomer: "Clear customer",
|
|
9
|
+
customerLoadErrorMessage: "Unable to load customers. Please try again.",
|
|
10
|
+
invoiceLabel: "Invoice (optional)",
|
|
11
|
+
invoicePlaceholder: "Select an invoice",
|
|
12
|
+
invoiceNoneOption: "None",
|
|
13
|
+
clearInvoice: "Clear invoice",
|
|
14
|
+
invoiceLoadErrorMessage: "Unable to load invoices. Please try again.",
|
|
15
|
+
accountLabel: "Deposit to account",
|
|
16
|
+
accountPlaceholder: "Select an account",
|
|
17
|
+
accountDeterminedByInvoicePlaceholder: "Determined by invoice",
|
|
18
|
+
accountLoadErrorMessage: "Unable to load accounts. Please try again.",
|
|
19
|
+
checkAmountLabel: "Check amount",
|
|
20
|
+
currencyPrefix: "$",
|
|
21
|
+
amountLimitsHint: "Your limits: {currencySymbol}10,000 per check · {currencySymbol}25,000 monthly",
|
|
22
|
+
continueButton: "Continue to capture",
|
|
23
|
+
continueToReviewButton: "Continue to review",
|
|
24
|
+
collectPaymentButton: "Collect payment",
|
|
25
|
+
invalidAmountErrorToast: "The check amount isn't valid — check for stray digits or misplaced commas and try again.",
|
|
26
|
+
noDepositAccountErrorToast: "No deposit account is available for this organization.",
|
|
27
|
+
invoiceDueDatePrefix: "due",
|
|
28
|
+
defaultAccountName: "Business Checking"
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
export { e as DEFAULT_CHECK_AMOUNT_AND_DETAIL_SCREEN_LABELS };
|