@tesouro/embedded-components-react 0.5.233 → 0.5.236

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.
Files changed (87) hide show
  1. package/README.md +19 -14
  2. package/dist/index.d.ts +175 -16
  3. package/dist/index.js +1 -1
  4. package/dist/lib/BankAccountOnboardingWidget.d.ts +39 -1
  5. package/dist/lib/ReceivablesWidget.d.ts +110 -1
  6. package/dist/lib/ReceivablesWidget.js +1 -1
  7. package/dist/lib/WidgetSuite.d.ts +65 -15
  8. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index.js +3 -2
  9. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index12.js +2 -1
  10. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index22.js +6 -0
  11. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index23.js +15 -11
  12. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index26.js +441 -409
  13. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index10.js +18 -14
  14. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +1 -1
  15. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index10.js +1 -1
  16. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index15.js +1 -1
  17. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index16.js +3 -3
  18. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index19.js +1 -1
  19. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index21.js +1 -1
  20. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index23.js +1 -1
  21. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index31.js +210 -208
  22. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index32.js +98 -40
  23. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index33.js +159 -39
  24. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index34.js +53 -77
  25. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index35.js +99 -132
  26. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index36.js +40 -341
  27. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index37.js +43 -0
  28. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index38.js +92 -0
  29. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index39.js +146 -0
  30. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index40.js +354 -0
  31. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index5.js +1 -1
  32. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +1 -1
  33. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +28 -24
  34. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index10.js +2 -37
  35. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index11.js +9 -214
  36. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index12.js +27 -159
  37. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +233 -14
  38. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +34 -22
  39. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +214 -2
  40. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js +153 -87
  41. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index17.js +16 -3
  42. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index18.js +22 -21
  43. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +2 -51
  44. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index2.js +30 -15
  45. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index20.js +90 -14
  46. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index21.js +3 -10
  47. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js +20 -69
  48. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +51 -33
  49. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index24.js +16 -17
  50. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +8 -14
  51. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +70 -30
  52. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +33 -14
  53. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index28.js +17 -25
  54. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js +12 -83
  55. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index3.js +9 -121
  56. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +28 -401
  57. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index31.js +16 -2
  58. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +22 -42
  59. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +80 -65
  60. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +383 -473
  61. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +2 -106
  62. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +48 -0
  63. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +72 -2
  64. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +498 -4
  65. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +106 -1
  66. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index4.js +141 -93
  67. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +2 -28
  68. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +4 -236
  69. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index43.js +0 -2
  70. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +90 -239
  71. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +24 -89
  72. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index46.js +231 -54
  73. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +3 -353
  74. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index48.js +249 -0
  75. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index49.js +93 -0
  76. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index5.js +3 -40
  77. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index50.js +59 -0
  78. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js +353 -0
  79. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index6.js +18 -2
  80. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index7.js +121 -9
  81. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index8.js +100 -27
  82. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index9.js +38 -233
  83. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  84. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index16.js +123 -92
  85. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index4.js +12 -5
  86. package/package.json +1 -1
  87. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +0 -100
@@ -1,235 +1,40 @@
1
- import { RECEIVABLE_BILLING_SECTION_LABELS_EN as e } from "./index7.js";
2
- import { RECEIVABLE_RECURRENCE_EMAIL_DIALOG_LABELS_EN as t, RECEIVABLE_RECURRENCE_SECTION_LABELS_EN as n } from "./index8.js";
1
+ import { Dialog as e, DialogContent as t } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { RECEIVABLE_ACTIONS_MODAL_LABELS_EN as n } from "./index6.js";
3
+ import { ReceivableActionsModalIssueStep as r } from "./index7.js";
4
+ import { ReceivableActionsModalProductsStep as i } from "./index8.js";
5
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
3
6
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index9.js
4
- var r = {
5
- draft: "Draft",
6
- issuing: "Issuing",
7
- issued: "Issued",
8
- failed: "Failed",
9
- accepted: "Accepted",
10
- expired: "Expired",
11
- declined: "Declined",
12
- recurring: "Recurring",
13
- partially_paid: "Partially paid",
14
- paid: "Paid",
15
- overdue: "Overdue",
16
- uncollectible: "Written off",
17
- canceled: "Cancelled",
18
- deleted: "Deleted",
19
- unknown: "Unknown"
20
- }, i = { all: "All invoices" }, a = {
21
- createButton: "Create",
22
- templateSettingsButton: "Template settings",
23
- searchPlaceholder: "Search by number or customer",
24
- statusFilterAll: "All statuses",
25
- statusCardsAll: i.all,
26
- tabInvoices: "Invoices",
27
- tabQuotes: "Quotes",
28
- tabCreditNotes: "Credit notes",
29
- columnDocument: "Document",
30
- columnCustomer: "Customer",
31
- columnStatus: "Status",
32
- columnIssueDate: "Issued",
33
- columnDueDate: "Due",
34
- columnTotal: "Total",
35
- columnAmountDue: "Amount due",
36
- columnActions: "Actions",
37
- openRow: (e) => `View document — ${e}`,
38
- sortByDocument: "Sort by document",
39
- sortByCustomer: "Sort by customer",
40
- sortByStatus: "Sort by status",
41
- sortByIssueDate: "Sort by issue date",
42
- sortByDueDate: "Sort by due date",
43
- sortByTotal: "Sort by total",
44
- actionEdit: "Edit",
45
- actionIssue: "Issue",
46
- actionSend: "Send",
47
- actionRecordPayment: "Record payment",
48
- actionMarkPaid: "Mark as paid",
49
- actionMarkUncollectible: "Mark uncollectible",
50
- actionAccept: "Accept",
51
- actionDecline: "Decline",
52
- actionCancel: "Cancel",
53
- actionClone: "Clone",
54
- actionDelete: "Delete",
55
- emptyTitle: "No receivables yet",
56
- emptyDescription: "Create your first invoice or quote.",
57
- emptyAction: "Create receivable",
58
- filterEmptyTitle: "No receivables found",
59
- filterEmptyDescription: "Try adjusting your search or filters.",
60
- errorTitle: "Failed to load receivables",
61
- errorDescription: "Something went wrong while fetching receivables. Please try again.",
62
- errorRetry: "Try again",
63
- statusBadge: r
64
- }, o = {
65
- ...e,
66
- ...n,
67
- ...t,
68
- createTitle: "Create receivable",
69
- editTitle: "Edit receivable",
70
- hiddenDescription: "Create an invoice or quote",
71
- documentTypeLabel: "Document type",
72
- typeInvoice: "Invoice",
73
- typeQuote: "Quote",
74
- customerLabel: "Customer",
75
- customerHint: "Create a customer first if the list is empty.",
76
- currencyLabel: "Currency",
77
- issueDateLabel: "Issue date",
78
- dueDateLabel: "Due date",
79
- lineItemsHeading: "Products and services",
80
- lineItemsDescription: "Add the products and services on this invoice. You'll have the option to save new items to your inventory.",
81
- productLabel: "Item name",
82
- quantityLabel: "Quantity",
83
- unitLabel: "Units",
84
- unitPlaceholder: "Select",
85
- unitNone: "None",
86
- manageUnitsOption: "Manage measure units",
87
- priceLabel: "Price",
88
- taxableLabel: "Taxable",
89
- taxRateLabel: "Tax rate",
90
- taxRatePlaceholder: "e.g. 6.25",
91
- taxRateSuffix: "%",
92
- discountLabel: "Discount",
93
- discountPercentageOption: "%",
94
- discountAmountOptionAriaLabel: "Flat discount",
95
- discountPercentageOptionAriaLabel: "Percentage discount",
96
- subtotalLabel: "Subtotal",
97
- discountTotalLabel: "Discount",
98
- nonTaxableSubtotalLabel: "Non-taxable subtotal",
99
- taxableSubtotalLabel: "Taxable subtotal",
100
- taxTotalLabel: "Tax",
101
- totalLabel: "Total",
102
- decreaseQuantityButton: "Decrease quantity",
103
- increaseQuantityButton: "Increase quantity",
104
- addLineItemButton: "Add item",
105
- removeLineItemButton: "Remove line item",
106
- cancelButton: "Cancel",
107
- notesHeading: "Notes",
108
- notesDescription: "Provide additional information for your customer.",
109
- optionalSuffix: "(optional)",
110
- openingNoteLabel: "Opening note to the customer",
111
- openingNotePlaceholder: "e.g., As discussed on our call, please find the attached invoice.",
112
- openingNoteDescription: "Appears above your line items. Use it to reference a discussion, agreement, or project.",
113
- closingNoteLabel: "Closing note to the customer",
114
- closingNotePlaceholder: "e.g., Thank you for your business!",
115
- closingNoteDescription: "Appears below your line items. Commonly used for thank you messages or payment instructions.",
116
- bankAccountHeading: "Payment instructions",
117
- bankAccountDescription: "Tells the customer how they can pay you. We'll include the selected info on the invoice",
118
- bankAccountLabel: "Bank account",
119
- bankAccountHint: "Display your bank account number and routing number",
120
- bankAccountSelectorLabel: "Bank account selector",
121
- bankAccountPlaceholder: "Select bank account",
122
- bankAccountAddOption: "Add a new account",
123
- bankAccountFormHeading: "Add a bank account",
124
- bankAccountRoutingNumberLabel: "Routing number",
125
- bankAccountRoutingNumberPlaceholder: "e.g. 123456789",
126
- bankAccountAccountNumberLabel: "Account number",
127
- bankAccountAccountNumberPlaceholder: "e.g. 123456789",
128
- bankAccountHolderNameLabel: "Account holder name",
129
- bankAccountHolderNamePlaceholder: "e.g. James Smith",
130
- bankAccountNicknameLabel: "Account nickname",
131
- bankAccountNicknamePlaceholder: "e.g. Empire Bank Checking",
132
- bankAccountCancelButton: "Cancel",
133
- bankAccountSaveButton: "Save account",
134
- bankAccountRestrictedTitle: "There are no bank accounts on file for this account",
135
- bankAccountRestrictedDescription: "A bank account is required in order to issue invoices. Contact your company admin to set one up.",
136
- attachmentsHeading: "Attachments",
137
- attachmentsDescription: "Associate additional documents with this invoice for your own reference or to share with the customer. e.g. contracts, photos, terms and conditions, etc.",
138
- attachmentsDropPrompt: "Drop your files here, or",
139
- attachmentsBrowseLink: "browse to upload",
140
- attachmentsFormatsHint: "PDF, DOC, JPG, PNG (max. 3MB)",
141
- remindersToggleLabel: "Payment reminders",
142
- remindersDescription: "Send reminders when an invoice is approaching its due date or past due.",
143
- remindersLibraryNote: "New reminders will be saved to your organization's library and can be managed via Invoice settings",
144
- reminderNumberOfDays: "Number of days",
145
- reminderBefore: "BEFORE",
146
- reminderAfter: "AFTER",
147
- reminderDueDate: "due date",
148
- reminderNone: "No reminder",
149
- reminderBeforeDueInputLabel: "Days before due date",
150
- reminderPlaceholder: "e.g., 3",
151
- reminderAddTermButton: "Add",
152
- reminderClearButton: "Clear",
153
- reminderSaveButton: "Save"
154
- }, s = {
155
- hiddenDescription: "Invoice details",
156
- loadingTitle: "Loading...",
157
- errorTitle: "Invoice not found",
158
- errorDescription: "We could not load this invoice. Please try again.",
159
- moreActionsLabel: "More actions",
160
- viewPdfButton: "View PDF",
161
- closeButton: "Close",
162
- invoiceDateCaption: "Invoice date",
163
- paymentHistoryHeading: "Payment history",
164
- paymentHistoryEmpty: "You've received no payments yet.",
165
- paymentHistoryTotalLabel: "Total received",
166
- paymentHistoryLoading: "Loading payment history",
167
- customerDetailsHeading: "Customer details",
168
- recurringAmountCaption: "Recurring amount",
169
- startsOnCaption: "Starts on",
170
- endsOnCaption: "Ends on",
171
- recurringSeriesRowLabel: "Recurring series",
172
- scheduleIssueDateColumn: "Issue date",
173
- scheduleAmountColumn: "Amount",
174
- scheduleStatusColumn: "Status",
175
- scheduleNumberColumn: "Number",
176
- scheduleEmpty: "No invoices are scheduled.",
177
- auditHistoryHeading: "Audit history",
178
- auditHistoryEmpty: "No history yet.",
179
- auditHistoryLoading: "Loading history",
180
- auditHistoryError: "The audit history could not be loaded.",
181
- auditHistoryNamesError: "Some names could not be loaded.",
182
- billingHeading: "Billing details",
183
- lineItemsHeading: "Line items",
184
- notesHeading: "Notes",
185
- notesOpeningLabel: "Opening note to customer",
186
- notesClosingLabel: "Closing note to customer",
187
- attachmentsHeading: "Attachments",
188
- attachmentsEmpty: "No attached files",
189
- attachmentsFileColumn: "File",
190
- attachmentsEmailedColumn: "Emailed",
191
- lineItemMultiplier: "x",
192
- lineItemEaLabel: "ea",
193
- noLineItems: "No line items.",
194
- editButton: "Edit",
195
- issueButton: "Issue",
196
- recordPaymentButton: "Record payment",
197
- sendButton: "Resend",
198
- acceptButton: "Accept",
199
- declineButton: "Decline",
200
- markPaidButton: "Mark as paid",
201
- markUncollectibleButton: "Mark as uncollectible",
202
- cancelButton: "Cancel invoice",
203
- cloneButton: "Duplicate",
204
- deleteButton: "Delete",
205
- pauseRecurrenceButton: "Pause series",
206
- resumeRecurrenceButton: "Resume series",
207
- cancelRecurrenceButton: "Cancel series",
208
- recurringBadge: "Recurring"
209
- }, c = {
210
- title: "Send receivable",
211
- description: "Send this document to the customer by email.",
212
- toLabel: "To",
213
- ccLabel: "CC",
214
- bccLabel: "BCC",
215
- subjectLabel: "Subject",
216
- bodyLabel: "Message",
217
- cancelButton: "Cancel",
218
- sendButton: "Send"
219
- }, l = {
220
- title: "Record payment",
221
- description: "Record a full or partial invoice payment.",
222
- modeLabel: "Payment type",
223
- fullPayment: "Full payment",
224
- partialPayment: "Partial payment",
225
- amountPaidLabel: "Amount paid",
226
- paidAtLabel: "Paid at",
227
- commentLabel: "Comment",
228
- cancelButton: "Cancel",
229
- submitButton: "Record payment"
230
- }, u = {
231
- cancelButton: "Cancel",
232
- confirmButton: "Confirm"
233
- };
7
+ function s({ idPrefix: s, open: c, view: l, onSkip: u, onSubjectChange: d, onMessageChange: f, onSend: p, onToggleItem: m, onToggleAll: h, onAllSelectedChange: g, onSaveItems: _, labels: v }) {
8
+ let y = {
9
+ ...n,
10
+ ...v
11
+ };
12
+ return /* @__PURE__ */ a(e, {
13
+ open: c && !!l,
14
+ onOpenChange: (e) => {
15
+ e || u();
16
+ },
17
+ children: /* @__PURE__ */ o(t, {
18
+ className: "ttw:gap-0 ttw:p-0 ttw:max-w-178 ttw:sm:max-w-178",
19
+ children: [l?.step === "issue" && /* @__PURE__ */ a(r, {
20
+ idPrefix: s,
21
+ view: l,
22
+ onSubjectChange: d,
23
+ onMessageChange: f,
24
+ onSkip: u,
25
+ onSend: p,
26
+ labels: y
27
+ }), l?.step === "products" && /* @__PURE__ */ a(i, {
28
+ view: l,
29
+ onToggleItem: m,
30
+ onToggleAll: h,
31
+ onAllSelectedChange: g,
32
+ onSkip: u,
33
+ onSave: _,
34
+ labels: y
35
+ })]
36
+ })
37
+ });
38
+ }
234
39
  //#endregion
235
- export { a as RECEIVABLES_SCREEN_LABELS_EN, u as RECEIVABLE_ACTION_DIALOG_LABELS_EN, s as RECEIVABLE_DETAILS_PANEL_LABELS_EN, o as RECEIVABLE_FORM_SHEET_LABELS_EN, l as RECEIVABLE_PAYMENT_DIALOG_LABELS_EN, c as RECEIVABLE_SEND_DIALOG_LABELS_EN, r as RECEIVABLE_STATUS_BADGE_LABELS_EN, i as RECEIVABLE_STATUS_CARDS_LABELS_EN };
40
+ export { s as ReceivableActionsModal };
@@ -1,5 +1,5 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
2
- var e = "@tesouro/embedded-components-react", t = "0.5.233", n = "d8e3ed5f8dda8d5dd06bcbdd8be210d004bd504c", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.5.236", n = "e7d53b04c08b3368cfb75b582c3579f10705e1a4", r = Object.freeze({
3
3
  library_name: e,
4
4
  library_version: t,
5
5
  library_sha: n
@@ -12,133 +12,164 @@ import { useEmbedApi as s } from "../../../shared/data-access/dist/lib/EmbedApiC
12
12
  import { hasAnyScope as c } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
13
13
  import { OnboardingSuppressionReason as l } from "../../../shared/data-access/dist/lib/onboardingSuppressionReason.js";
14
14
  import { useOrganizationOnboardingSuppression as u } from "../../../shared/data-access/dist/lib/useOrganizationOnboardingSuppression.js";
15
+ import { useOrganizationApplicationStatus as d } from "../../../shared/data-access/dist/lib/useOrganizationApplicationStatus.js";
15
16
  import "../../../shared/data-access/dist/index.js";
16
- import { ErrorState as d } from "../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
17
+ import { ErrorState as f } from "../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
17
18
  import "../../../shared/ui/dist/index.js";
18
- import { useAnalyticsTrack as f } from "../../../shared/feature/dist/lib/analytics/hooks.js";
19
- import { WidgetProvider as p } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
20
- import { useRefetchWidget as m, useWidgetConfig as h, useWidgetError as g, useWidgetInitStaleForToken as _, useWidgetLoading as v } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
19
+ import { useAnalyticsTrack as p } from "../../../shared/feature/dist/lib/analytics/hooks.js";
20
+ import { WidgetProvider as m } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
21
+ import { useRefetchWidget as h, useWidgetConfig as ee, useWidgetError as g, useWidgetInitStaleForToken as _, useWidgetLoading as v } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
22
+ import { deniedNoticeExpiresAt as te, selectBankAccountApplication as ne } from "../../../shared/feature/dist/lib/application/bankAccountApplication.js";
21
23
  import "../../../shared/feature/dist/index.js";
22
- import { WIDGET_SUITE_SECTIONS as y } from "./index15.js";
23
- import { WIDGET_NAME as b, WidgetSuiteAnalyticsEvent as x } from "./index2.js";
24
- import { needsDisclosureAcceptance as S } from "./index3.js";
25
- import { AcceptDisclosuresWidget as C } from "../../../accept-disclosures-widget/feature/dist/index5.js";
24
+ import { WIDGET_SUITE_SECTIONS as re } from "./index15.js";
25
+ import { WIDGET_NAME as y, WidgetSuiteAnalyticsEvent as b } from "./index2.js";
26
+ import { needsDisclosureAcceptance as x } from "./index3.js";
27
+ import { AcceptDisclosuresWidget as ie } from "../../../accept-disclosures-widget/feature/dist/index5.js";
26
28
  import "../../../accept-disclosures-widget/feature/dist/index.js";
27
- import { BankAccountOnboardingWidget as w } from "../../../bank-account-onboarding-widget/feature/dist/index26.js";
29
+ import { OnboardingApplicationView as S, onboardingApplicationViewFor as C } from "../../../bank-account-onboarding-widget/feature/dist/index23.js";
30
+ import { BankAccountOnboardingWidget as ae } from "../../../bank-account-onboarding-widget/feature/dist/index26.js";
28
31
  import "../../../bank-account-onboarding-widget/feature/dist/index.js";
29
- import { useCallback as T, useEffect as E, useMemo as D, useRef as O, useState as k } from "react";
30
- import { Fragment as A, jsx as j, jsxs as M } from "react/jsx-runtime";
32
+ import { useCallback as w, useEffect as T, useMemo as oe, useReducer as E, useRef as D, useState as O } from "react";
33
+ import { Fragment as se, jsx as k, jsxs as ce } from "react/jsx-runtime";
31
34
  //#region ../../libs/tesouro-embedded-components-react/widget-suite/feature/dist/index16.js
32
- var N = {
35
+ var A = {
33
36
  initFailed: "widget-suite-init-failed",
34
37
  disclosuresRefreshFailed: "widget-suite-disclosures-refresh-failed",
35
- applicationInFlight: "widget-suite-application-in-flight"
36
- };
37
- function P({ showSectionTitle: n = !0, onboardingDisclosureLinks: r }) {
38
- let { availableSections: a, activeSection: s, labels: c, navigate: f } = o(), { initResponse: p } = h(), b = g(), x = _(), D = v(), P = m(), F = u(), [I, L] = k(!1), R = F.isResolved || I, z = T((e) => f(e), [f]), [B, V] = k(!1), ee = T(() => V(!0), []), [te, ne] = k(!1), H = S(p), U = c.disclosure, W = c.onboardingGate, G = p?.status === "INVITED", K = p?.status === "ACTIVE" || p?.status === "INACTIVE", q = !!(p && x), J = q && (G || K), Y = !p && !b || J && !b, X = !!p && !Y && !q && !G && !K && R && F.reason === l.OrganizationApplicationComplete && !te, Z = O(!1), [re, Q] = k(!1);
39
- E(() => {
40
- !H && B && V(!1);
41
- }, [B, H]), E(() => {
42
- F.isResolved && !I && L(!0);
43
- }, [F.isResolved, I]), E(() => {
44
- X ? Z.current || (Z.current = !0, Q(!0), P()) : (Z.current = !1, Q(!1));
45
- }, [X, P]);
46
- let $ = () => /* @__PURE__ */ j(e, {
38
+ applicationUnavailable: "widget-suite-application-unavailable"
39
+ }, j = 2 ** 31 - 1;
40
+ function M({ showSectionTitle: n = !0, onboardingDisclosureLinks: r, onApplicantLatchChange: a, onResultScreenHeldChange: s }) {
41
+ let { availableSections: c, activeSection: p, labels: m, navigate: y } = o(), { initResponse: b } = ee(), M = g(), N = _(), P = v(), F = h(), I = u(), L = d(), R = oe(() => ne(L.applications), [L.applications]), z = D(null);
42
+ L.isResolved && (z.current = { application: R });
43
+ let B = L.isResolved ? R : z.current?.application ?? null, [le, ue] = E((e) => e + 1, 0), V = te(B);
44
+ T(() => {
45
+ if (V === null) return;
46
+ let e = V - Date.now();
47
+ if (e < 0) return;
48
+ let t = setTimeout(ue, Math.min(e + 1, j));
49
+ return () => clearTimeout(t);
50
+ }, [V, le]);
51
+ let H = C(B), [U, de] = O(!1), [W, fe] = O(!1), pe = I.isResolved || W, me = w((e) => y(e), [y]), [G, he] = O(!1), ge = w(() => he(!0), []), [K, _e] = O(!1), ve = K || U;
52
+ T(() => {
53
+ a(ve);
54
+ }, [ve, a]);
55
+ let [ye, be] = O(!1), xe = U && !ye;
56
+ T(() => {
57
+ s(xe);
58
+ }, [xe, s]);
59
+ let q = x(b), J = m.disclosure, Y = m.onboardingGate, X = b?.status === "INVITED", Se = b?.status === "ACTIVE" || b?.status === "INACTIVE", Ce = !!(b && N), we = Ce && (X || Se), Te = !b && !M || we && !M, Z = !!b && !Te && !Ce && !X && !Se && pe && I.reason === l.OrganizationApplicationComplete && !K, Q = D(!1), [Ee, De] = O(!1);
60
+ T(() => {
61
+ !q && G && he(!1);
62
+ }, [G, q]), T(() => {
63
+ I.isResolved && !W && fe(!0);
64
+ }, [I.isResolved, W]), T(() => {
65
+ Z ? Q.current || (Q.current = !0, De(!0), F()) : (Q.current = !1, De(!1));
66
+ }, [Z, F]);
67
+ let $ = () => /* @__PURE__ */ k(e, {
47
68
  isLoading: !0,
48
69
  sections: [],
49
70
  selectedSectionId: "",
50
- onSectionChange: z,
51
- labels: c.shell
71
+ onSectionChange: me,
72
+ labels: m.shell
52
73
  });
53
- if (Y) return $();
54
- if ((!p || J) && b) return /* @__PURE__ */ j(d, {
55
- title: U.initFailedState.title,
56
- description: U.initFailedState.body,
57
- retryLabel: U.initFailedState.retryButton,
58
- onRetry: P,
59
- testId: N.initFailed
74
+ if (Te) return $();
75
+ if ((!b || we) && M) return /* @__PURE__ */ k(f, {
76
+ title: J.initFailedState.title,
77
+ description: J.initFailedState.body,
78
+ retryLabel: J.initFailedState.retryButton,
79
+ onRetry: F,
80
+ testId: A.initFailed
60
81
  });
61
- let ie = () => B && b ? /* @__PURE__ */ j(d, {
62
- title: U.refreshFailedState.title,
63
- description: U.refreshFailedState.body,
64
- retryLabel: U.refreshFailedState.retryButton,
65
- onRetry: P,
66
- testId: N.disclosuresRefreshFailed
67
- }) : /* @__PURE__ */ j(C, { onAccepted: ee });
68
- if (G || K) {
69
- if (H) return ie();
70
- } else return R ? F.reason === l.OrganizationApplicationStartedByOther ? /* @__PURE__ */ j(d, {
71
- title: W.applicationInFlightState.title,
72
- description: W.applicationInFlightState.body,
73
- retryLabel: W.applicationInFlightState.retryButton,
74
- onRetry: F.refetch,
75
- testId: N.applicationInFlight
76
- }) : X ? b || re && !D ? /* @__PURE__ */ j(d, {
77
- title: U.initFailedState.title,
78
- description: U.initFailedState.body,
79
- retryLabel: U.initFailedState.retryButton,
80
- onRetry: P,
81
- testId: N.initFailed
82
- }) : $() : /* @__PURE__ */ j(w, {
82
+ let Oe = () => G && M ? /* @__PURE__ */ k(f, {
83
+ title: J.refreshFailedState.title,
84
+ description: J.refreshFailedState.body,
85
+ retryLabel: J.refreshFailedState.retryButton,
86
+ onRetry: F,
87
+ testId: A.disclosuresRefreshFailed
88
+ }) : /* @__PURE__ */ k(ie, { onAccepted: ge });
89
+ if (X || Se) {
90
+ if (q) return Oe();
91
+ } else return pe ? Z ? M || Ee && !P ? /* @__PURE__ */ k(f, {
92
+ title: J.initFailedState.title,
93
+ description: J.initFailedState.body,
94
+ retryLabel: J.initFailedState.retryButton,
95
+ onRetry: F,
96
+ testId: A.initFailed
97
+ }) : $() : !L.isResolved && H !== S.Form && !U ? $() : (H === S.Hidden || H === S.Form && I.isSuppressed) && B?.status !== "COMPLETE" && !U && !K ? /* @__PURE__ */ k(f, {
98
+ title: Y.applicationUnavailableState.title,
99
+ description: Y.applicationUnavailableState.body,
100
+ retryLabel: Y.applicationUnavailableState.retryButton,
101
+ onRetry: I.refetch,
102
+ testId: A.applicationUnavailable
103
+ }) : /* @__PURE__ */ k(ae, {
83
104
  isFullScreenInline: !0,
84
- onEmbeddedOnboardingCompletedSuccessfully: () => ne(!0),
105
+ showApplicationStatusRefresh: !0,
106
+ onResultPhaseChange: de,
107
+ onEmbeddedOnboardingCompletedSuccessfully: () => _e(!0),
85
108
  onNavigateToDashboard: () => {
86
- a.includes(i.Dashboard) && f(i.Dashboard), P();
109
+ be(!0), c.includes(i.Dashboard) && y(i.Dashboard), F();
87
110
  },
88
111
  disclosureLinks: r,
89
- ...c.onboarding
112
+ ...m.onboarding
90
113
  }) : $();
91
- let ae = p?.bankName?.trim(), oe = ae ? c.sectionTitle.bankTagline.replaceAll("{bankName}", ae) : void 0, se = a.map((e) => {
92
- let { Content: r, placesOwnTitle: a } = y[e], o = c.menu[e], s = e === i.Accounts ? void 0 : oe, l = (e) => /* @__PURE__ */ j(t, {
114
+ let ke = b?.bankName?.trim(), Ae = ke ? m.sectionTitle.bankTagline.replaceAll("{bankName}", ke) : void 0, je = c.map((e) => {
115
+ let { Content: r, placesOwnTitle: a } = re[e], o = m.menu[e], s = e === i.Accounts ? void 0 : Ae, c = (e) => /* @__PURE__ */ k(t, {
93
116
  title: o,
94
117
  bankTagline: s,
95
118
  children: e
96
- }), u = /* @__PURE__ */ j(r, {});
97
- return n && (u = a ? /* @__PURE__ */ j(r, { renderTitle: l }) : /* @__PURE__ */ M(A, { children: [l(), /* @__PURE__ */ j(r, {})] })), {
119
+ }), l = /* @__PURE__ */ k(r, {});
120
+ return n && (l = a ? /* @__PURE__ */ k(r, { renderTitle: c }) : /* @__PURE__ */ ce(se, { children: [c(), /* @__PURE__ */ k(r, {})] })), {
98
121
  id: e,
99
122
  label: o,
100
- content: u
123
+ content: l
101
124
  };
102
125
  });
103
- return /* @__PURE__ */ j(e, {
104
- sections: se,
105
- selectedSectionId: s ?? "",
106
- onSectionChange: z,
107
- labels: c.shell
126
+ return /* @__PURE__ */ k(e, {
127
+ sections: je,
128
+ selectedSectionId: p ?? "",
129
+ onSectionChange: me,
130
+ labels: m.shell
108
131
  });
109
132
  }
110
- function F({ sections: e = r, section: t, defaultSection: i, onSectionChange: o, labels: l, cardArtSrc: u, ...d }) {
111
- let p = f();
112
- E(() => {
113
- p(x.Mounted);
114
- }, [p]);
115
- let { initResponse: m } = h(), g = m?.scopes, { client: _, widgetToken: v } = s(), b = m?.userId ?? null, [S, C] = k(b), [w, T] = k(0);
116
- b !== S && (C(b), S !== null && T((e) => e + 1));
117
- let [O, A] = k(_);
118
- _ !== O && (A(_), T((e) => e + 1));
119
- let M = !!v, [N, F] = k(M);
120
- M !== N && (F(M), T((e) => e + 1));
121
- let I = m?.organizationId ?? null, [L, R] = k(I);
122
- I !== L && (R(I), L !== null && T((e) => e + 1));
123
- let z = D(() => n(l), [l]), B = e.filter((e) => {
124
- let t = y[e];
125
- return !!t && (!t.anyOfScopes || c(g, t.anyOfScopes));
133
+ function N({ sections: e = r, section: t, defaultSection: i, onSectionChange: o, labels: l, cardArtSrc: u, ...d }) {
134
+ let f = p();
135
+ T(() => {
136
+ f(b.Mounted);
137
+ }, [f]);
138
+ let { initResponse: m } = ee(), h = m?.scopes, { client: g, widgetToken: _ } = s(), v = m?.userId ?? null, [te, ne] = O(v), [y, x] = O(0);
139
+ v !== te && (ne(v), te !== null && x((e) => e + 1));
140
+ let [ie, S] = O(g);
141
+ g !== ie && (S(g), x((e) => e + 1));
142
+ let C = !!_, [ae, w] = O(C);
143
+ C !== ae && (w(C), x((e) => e + 1));
144
+ let E = m?.organizationId ?? null, [D, se] = O(E);
145
+ E !== D && (se(E), D !== null && x((e) => e + 1));
146
+ let [ce, A] = O(!1), [j, N] = O(!1), [P, F] = O(null), I = () => {
147
+ A(!1), x((e) => e + 1);
148
+ }, [L, R] = O(_);
149
+ _ !== L && (R(_), ce && v === null && E === null && C === !!L && (j ? F(y) : I())), P !== null && !j && (F(null), P === y && v === null && E === null && I());
150
+ let z = oe(() => n(l), [l]), B = e.filter((e) => {
151
+ let t = re[e];
152
+ return !!t && (!t.anyOfScopes || c(h, t.anyOfScopes));
126
153
  });
127
- return /* @__PURE__ */ j(a, {
154
+ return /* @__PURE__ */ k(a, {
128
155
  sections: e,
129
156
  availableSections: B,
130
- grantedScopes: g,
157
+ grantedScopes: h,
131
158
  labels: z,
132
159
  section: t,
133
160
  defaultSection: i,
134
161
  onSectionChange: o,
135
162
  cardArtSrc: u,
136
- children: /* @__PURE__ */ j(P, { ...d }, w)
163
+ children: /* @__PURE__ */ k(M, {
164
+ onApplicantLatchChange: A,
165
+ onResultScreenHeldChange: N,
166
+ ...d
167
+ }, y)
137
168
  });
138
169
  }
139
- function I({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: a, implementation: o, uiFramework: s, errorFallback: c, onError: l, analytics: u, disclosuresAcceptance: d, providerLabels: f, ...m }) {
140
- return /* @__PURE__ */ j(p, {
141
- widgetName: b,
170
+ function P({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: a, implementation: o, uiFramework: s, errorFallback: c, onError: l, analytics: u, disclosuresAcceptance: d, providerLabels: f, ...p }) {
171
+ return /* @__PURE__ */ k(m, {
172
+ widgetName: y,
142
173
  baseUrl: e,
143
174
  widgetToken: t,
144
175
  organizationId: n,
@@ -152,8 +183,8 @@ function I({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gat
152
183
  analytics: u,
153
184
  disclosuresAcceptance: d,
154
185
  providerLabels: f,
155
- children: /* @__PURE__ */ j(F, { ...m })
186
+ children: /* @__PURE__ */ k(N, { ...p })
156
187
  });
157
188
  }
158
189
  //#endregion
159
- export { N as WIDGET_SUITE_TEST_IDS, I as WidgetSuite, I as default };
190
+ export { A as WIDGET_SUITE_TEST_IDS, P as WidgetSuite, P as default };
@@ -27,11 +27,18 @@ var n = {
27
27
  retryButton: "Try again"
28
28
  }
29
29
  },
30
- onboardingGate: { applicationInFlightState: {
31
- title: "Application in progress",
32
- body: "Your organization's account application is already being set up by a teammate. Contact your organization admin for details.",
33
- retryButton: "Check again"
34
- } },
30
+ onboardingGate: {
31
+ applicationUnavailableState: {
32
+ title: "We can't show your application",
33
+ body: "Your organization's bank account application isn't available here. Contact your organization admin or the bank for details.",
34
+ retryButton: "Check again"
35
+ },
36
+ applicationInFlightState: {
37
+ title: "Application in progress",
38
+ body: "Your organization's account application is already being set up by a teammate. Contact your organization admin for details.",
39
+ retryButton: "Check again"
40
+ }
41
+ },
35
42
  sections: {
36
43
  dashboard: {},
37
44
  cards: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tesouro/embedded-components-react",
3
- "version": "0.5.233",
3
+ "version": "0.5.236",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "packageDepSync": {