@tesouro/embedded-components-react 0.2.266 → 0.2.269

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 (97) hide show
  1. package/README.md +15 -12
  2. package/dist/experimental/WidgetSuite.d.ts +25 -1
  3. package/dist/experimental/index.d.ts +25 -1
  4. package/dist/index.css +45 -9
  5. package/dist/index.d.ts +46 -22
  6. package/dist/index.js +1 -1
  7. package/dist/lib/AcceptDisclosuresWidget.d.ts +25 -1
  8. package/dist/lib/BalancesWidget.d.ts +24 -0
  9. package/dist/lib/BankAccountOnboardingWidget.d.ts +25 -1
  10. package/dist/lib/BankAccountsWidget.d.ts +25 -1
  11. package/dist/lib/BillPayWidget.d.ts +24 -0
  12. package/dist/lib/BillPayWidget.js +1 -1
  13. package/dist/lib/CardDetailsWidget.d.ts +25 -1
  14. package/dist/lib/CardsWidget.d.ts +25 -1
  15. package/dist/lib/ChartOfAccountsWidget.d.ts +25 -1
  16. package/dist/lib/CounterpartsWidget.d.ts +25 -1
  17. package/dist/lib/CreateCardWidget.d.ts +25 -1
  18. package/dist/lib/ExpenseApprovalPoliciesWidget.d.ts +25 -1
  19. package/dist/lib/ExpenseManagementWidget.d.ts +25 -1
  20. package/dist/lib/ExpenseRequirementsWidget.d.ts +25 -1
  21. package/dist/lib/HelpWidget.d.ts +25 -1
  22. package/dist/lib/InsightsWidget.d.ts +24 -0
  23. package/dist/lib/InvoicingWidget.d.ts +25 -1
  24. package/dist/lib/LinkedAccountsWidget.d.ts +25 -1
  25. package/dist/lib/ProductsWidget.d.ts +25 -1
  26. package/dist/lib/ProfileWidget.d.ts +25 -1
  27. package/dist/lib/ReceiptMatchWidget.d.ts +25 -1
  28. package/dist/lib/ReceivablesWidget.d.ts +25 -1
  29. package/dist/lib/SettingsWidget.d.ts +25 -1
  30. package/dist/lib/TagsWidget.d.ts +25 -1
  31. package/dist/lib/TeamWidget.d.ts +25 -1
  32. package/dist/lib/TransfersWidget.d.ts +24 -0
  33. package/dist/lib/WidgetProvider.d.ts +25 -1
  34. package/dist/lib/WidgetProviderPublic.d.ts +24 -0
  35. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index4.js +9 -8
  36. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index17.js +122 -121
  37. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index8.js +9 -8
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +6 -6
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +99 -7
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js +7 -97
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +99 -4
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js +4 -4
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +2 -41
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +44 -1
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +1 -50
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +48 -6
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +9 -5
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +8 -91
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index2.js +6 -2
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +7 -3
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +100 -6
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +3 -9
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +6 -83
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +9 -3
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +83 -6
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +2 -111
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +8 -1
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +104 -16
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +1 -0
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +25 -0
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +37 -27
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +15 -116
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +126 -31
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +32 -69
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index12.js +0 -3
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js +34 -69
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index15.js +4 -0
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +261 -181
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +32 -33
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index7.js +2 -2
  71. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index6.js +9 -8
  72. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index8.js +9 -8
  73. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index8.js +9 -8
  74. package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index7.js +94 -93
  75. package/dist/libs/tesouro-embedded-components-react/expense-approval-policies-widget/feature/dist/lib/ExpenseApprovalPoliciesWidgetFeature.js +7 -6
  76. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index3.js +9 -8
  77. package/dist/libs/tesouro-embedded-components-react/expense-receipt-match-widget/feature/dist/lib/ReceiptMatchWidget.js +12 -11
  78. package/dist/libs/tesouro-embedded-components-react/expense-requirements-widget/feature/dist/lib/ExpenseRequirementsWidget.js +7 -6
  79. package/dist/libs/tesouro-embedded-components-react/gl-code-table-widget/feature/dist/index8.js +9 -8
  80. package/dist/libs/tesouro-embedded-components-react/help-widget/feature/dist/index3.js +9 -8
  81. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +9 -8
  82. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index3.js +10 -9
  83. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index9.js +9 -8
  84. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index8.js +9 -8
  85. package/dist/libs/tesouro-embedded-components-react/profile-widget/feature/dist/index4.js +9 -8
  86. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js +10 -9
  87. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +22 -21
  88. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/widgetGatewayHosts.js +14 -0
  89. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js +76 -67
  90. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js +107 -101
  91. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  92. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/client.js +12 -4
  93. package/dist/libs/tesouro-embedded-components-react/tags-widget/feature/dist/index11.js +9 -8
  94. package/dist/libs/tesouro-embedded-components-react/team-widget/feature/dist/index17.js +106 -105
  95. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index5.js +1 -1
  96. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index6.js +9 -8
  97. package/package.json +1 -1
@@ -9,32 +9,32 @@ import { useAnalyticsTrack as i } from "../../../shared/feature/dist/lib/analyti
9
9
  import { WidgetProvider as a } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
10
10
  import { getStateOptions as o } from "../../../shared/util/dist/lib/usStates.js";
11
11
  import { extractApiErrorMessage as s } from "../../../shared/util/dist/lib/apiErrors.js";
12
- import { useRefetchWidget as c, useWidgetConfig as l } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
13
- import { getNaicsOptions as u } from "../../../shared/feature/dist/lib/naicsCodeMap.js";
12
+ import { useRefetchWidget as ee, useWidgetConfig as c } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
13
+ import { getNaicsOptions as l } from "../../../shared/feature/dist/lib/naicsCodeMap.js";
14
14
  import "../../../shared/feature/dist/index.js";
15
- import { ADDITIONAL_OWNERS_LABELS_EN as d } from "../../ui/dist/index4.js";
16
- import { interpolateBankName as f } from "../../ui/dist/index6.js";
17
- import { ResultStep as ee } from "../../ui/dist/index11.js";
18
- import { MarketingWidget as te } from "../../ui/dist/index28.js";
15
+ import { ADDITIONAL_OWNERS_LABELS_EN as u } from "../../ui/dist/index4.js";
16
+ import { interpolateBankName as d } from "../../ui/dist/index6.js";
17
+ import { ResultStep as te } from "../../ui/dist/index11.js";
18
+ import { MarketingWidget as ne } from "../../ui/dist/index28.js";
19
19
  import "../../ui/dist/index.js";
20
- import { BusinessDetailsStep as ne } from "./index9.js";
21
- import { PersonalDetailsStep as re } from "./index11.js";
22
- import { AdditionalOwnersStep as ie } from "./index13.js";
23
- import { buildCreateApplicationBody as ae, buildUpdateApplicationBody as p } from "./index14.js";
24
- import { OnboardingAnalyticsEvent as m, WIDGET_NAME as h } from "./index15.js";
25
- import { DEFAULT_LABELS as g } from "./index16.js";
26
- import { ApplicationClientSecretProvider as oe, useApplicationClientSecret as se } from "../../data-access/dist/index2.js";
27
- import { useCreateApplication as ce } from "../../data-access/dist/index4.js";
28
- import { useUpdateApplication as le } from "../../data-access/dist/index6.js";
29
- import { useSubmitApplication as ue } from "../../data-access/dist/index7.js";
30
- import { usePollApplicationCompletion as de } from "../../data-access/dist/index8.js";
31
- import { OnboardingSuppressionReason as fe } from "../../data-access/dist/index9.js";
32
- import { useOrganizationOnboardingSuppression as pe } from "../../data-access/dist/index10.js";
20
+ import { BusinessDetailsStep as re } from "./index9.js";
21
+ import { PersonalDetailsStep as ie } from "./index11.js";
22
+ import { AdditionalOwnersStep as ae } from "./index13.js";
23
+ import { buildCreateApplicationBody as oe, buildUpdateApplicationBody as se } from "./index14.js";
24
+ import { OnboardingAnalyticsEvent as f, WIDGET_NAME as p } from "./index15.js";
25
+ import { DEFAULT_LABELS as m } from "./index16.js";
26
+ import { ApplicationClientSecretProvider as ce, useApplicationClientSecret as le } from "../../data-access/dist/index2.js";
27
+ import { useCreateApplication as ue } from "../../data-access/dist/index4.js";
28
+ import { useUpdateApplication as de } from "../../data-access/dist/index6.js";
29
+ import { useSubmitApplication as fe } from "../../data-access/dist/index7.js";
30
+ import { usePollApplicationCompletion as pe } from "../../data-access/dist/index8.js";
31
+ import { OnboardingSuppressionReason as h } from "../../data-access/dist/index9.js";
32
+ import { useOrganizationOnboardingSuppression as me } from "../../data-access/dist/index10.js";
33
33
  import "../../data-access/dist/index.js";
34
- import { useCallback as _, useEffect as v, useMemo as y, useRef as me, useState as b } from "react";
35
- import { Fragment as he, jsx as x, jsxs as S } from "react/jsx-runtime";
34
+ import { useCallback as g, useEffect as _, useMemo as v, useRef as he, useState as y } from "react";
35
+ import { Fragment as ge, jsx as b, jsxs as x } from "react/jsx-runtime";
36
36
  //#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index17.js
37
- var ge = {
37
+ var _e = {
38
38
  companyLegalName: "",
39
39
  companyDbaName: "",
40
40
  businessAddress: "",
@@ -48,7 +48,7 @@ var ge = {
48
48
  naicsCode: "",
49
49
  isAuthorized: null,
50
50
  isCheckboxChecked: !1
51
- }, _e = {
51
+ }, ve = {
52
52
  firstName: "",
53
53
  lastName: "",
54
54
  dateOfBirth: void 0,
@@ -62,7 +62,7 @@ var ge = {
62
62
  ownsOver25Percent: null,
63
63
  ownershipPercentage: null
64
64
  };
65
- function ve(e, t) {
65
+ function ye(e, t) {
66
66
  if (e === 0) return {
67
67
  title: t.businessReviewTitle,
68
68
  subtitle: t.businessReviewSubtitle
@@ -72,7 +72,7 @@ function ve(e, t) {
72
72
  subtitle: t.personalReviewSubtitle
73
73
  };
74
74
  let n = {
75
- ...d,
75
+ ...u,
76
76
  ...t.additionalOwners
77
77
  };
78
78
  return {
@@ -80,55 +80,55 @@ function ve(e, t) {
80
80
  subtitle: n.subheading
81
81
  };
82
82
  }
83
- function ye({ onEmbeddedOnboardingCompletedSuccessfully: a, onNavigateToDashboard: d, labels: h, initialBusinessDetails: oe, initialPersonalDetails: ye, initialAdditionalOwners: C, bankLogoSrc: be, disclosureLinks: xe, marketingContent: w = null, open: Se, defaultOpen: T, onOpenChange: Ce }) {
84
- let E = i();
85
- v(() => {
86
- E(m.Mounted);
87
- }, [E]);
88
- let D = {
89
- ...g,
90
- ...h,
83
+ function be({ onEmbeddedOnboardingCompletedSuccessfully: a, onNavigateToDashboard: u, labels: p, initialBusinessDetails: ce, initialPersonalDetails: be, initialAdditionalOwners: S, bankLogoSrc: xe, disclosureLinks: Se, marketingContent: C = null, open: Ce, defaultOpen: we, onOpenChange: w }) {
84
+ let T = i();
85
+ _(() => {
86
+ T(f.Mounted);
87
+ }, [T]);
88
+ let E = {
89
+ ...m,
90
+ ...p,
91
91
  stepIndicator: {
92
- ...g.stepIndicator,
93
- ...h?.stepIndicator
92
+ ...m.stepIndicator,
93
+ ...p?.stepIndicator
94
94
  },
95
- businessDetails: h?.businessDetails ?? {},
96
- personalDetails: h?.personalDetails ?? {},
97
- additionalOwners: h?.additionalOwners ?? {},
95
+ businessDetails: p?.businessDetails ?? {},
96
+ personalDetails: p?.personalDetails ?? {},
97
+ additionalOwners: p?.additionalOwners ?? {},
98
98
  result: {
99
- ...g.result,
100
- ...h?.result
99
+ ...m.result,
100
+ ...p?.result
101
101
  }
102
- }, O = l().initResponse, { termsHref: we, privacyHref: Te, electronicCommunicationHref: Ee, patriotActHref: De } = xe ?? {}, Oe = w !== null, k = Se === void 0, [ke, A] = b(!1), [Ae, je] = b(!0), [Me, Ne] = b(() => T ?? !1), Pe = be ?? w?.bankLogoSrc ?? void 0, Fe = k ? Me : Se, Ie = T ?? !1, j = _((e) => {
103
- k && Ne(e), Ce?.(e);
104
- }, [Ce, k]), Le = _(() => {
105
- E(m.OpenMarketing), A(!0);
106
- }, [E]), Re = _(() => {
107
- A(!1);
108
- }, []), ze = _(() => {
109
- E(m.BeginOnboarding), A(!1), j(!0);
110
- }, [j, E]), Be = _(() => {
111
- je(!1), a();
112
- }, [a]), Ve = c(), [M, N] = b(0), [He, Ue] = b(() => ({
113
- ...ge,
114
- ...oe
115
- })), [P, We] = b(() => ({
102
+ }, D = c().initResponse, { termsHref: Te, privacyHref: Ee, electronicCommunicationHref: De, patriotActHref: Oe } = Se ?? {}, ke = C !== null, O = Ce === void 0, [Ae, k] = y(!1), [je, Me] = y(!0), [Ne, Pe] = y(() => we ?? !1), Fe = xe ?? C?.bankLogoSrc ?? void 0, A = O ? Ne : Ce, Ie = we ?? !1, j = g((e) => {
103
+ O && Pe(e), w?.(e);
104
+ }, [w, O]), Le = g(() => {
105
+ T(f.OpenMarketing), k(!0);
106
+ }, [T]), Re = g(() => {
107
+ k(!1);
108
+ }, []), ze = g(() => {
109
+ T(f.BeginOnboarding), k(!1), j(!0);
110
+ }, [j, T]), Be = g(() => {
111
+ Me(!1), a();
112
+ }, [a]), Ve = ee(), [M, N] = y(0), [He, Ue] = y(() => ({
116
113
  ..._e,
117
- ...ye
118
- })), [Ge, Ke] = b(() => C ?? []), [F, qe] = b(null), [I, Je] = b(null), [L, Ye] = b(null), [R, Xe] = b(null), [Ze, z] = b(null), [B, V] = b(!1), [H, U] = b(null), W = ce(), G = le(), K = ue(), Qe = de(), { setClientSecret: $e } = se(), q = pe(), J = me(null);
119
- v(() => () => J.current?.abort(), []);
120
- let et = y(() => u(D.businessDetails.naicsTitles), [D.businessDetails.naicsTitles]), tt = y(() => o(D.businessDetails.stateTitles), [D.businessDetails.stateTitles]), nt = y(() => o(D.personalDetails.stateTitles), [D.personalDetails.stateTitles]), rt = y(() => o(D.additionalOwners.stateTitles), [D.additionalOwners.stateTitles]), Y = B || H !== null, X = O?.status === "ACTIVE" || O?.status === "INACTIVE", it = O?.status === "INVITED", Z = !!O && !Y && (X || it || q.isSuppressed), Q = Z ? X ? fe.UserAlreadyOnboarded : it ? fe.UserInvitedToOrganization : q.reason : null;
121
- if (v(() => {
122
- !Z || !Q || (E(m.Suppressed, { reason: Q }), console.info(`[onboarding] not shown: ${Q}`));
114
+ ...ce
115
+ })), [P, We] = y(() => ({
116
+ ...ve,
117
+ ...be
118
+ })), [Ge, Ke] = y(() => S ?? []), [F, qe] = y(null), [I, Je] = y(null), [L, Ye] = y(null), [R, Xe] = y(null), [Ze, z] = y(null), [B, V] = y(!1), [H, U] = y(null), W = ue(), G = de(), K = fe(), Qe = pe(), { setClientSecret: $e } = le(), q = me(), J = he(null);
119
+ _(() => () => J.current?.abort(), []);
120
+ let et = v(() => l(E.businessDetails.naicsTitles), [E.businessDetails.naicsTitles]), tt = v(() => o(E.businessDetails.stateTitles), [E.businessDetails.stateTitles]), nt = v(() => o(E.personalDetails.stateTitles), [E.personalDetails.stateTitles]), rt = v(() => o(E.additionalOwners.stateTitles), [E.additionalOwners.stateTitles]), Y = B || H !== null, it = D?.status === "ACTIVE" || D?.status === "INACTIVE", X = D?.status === "INVITED", Z = !!D && !Y && (it || X || q.isSuppressed), Q = Z ? it ? h.UserAlreadyOnboarded : X ? h.UserInvitedToOrganization : q.reason : null;
121
+ if (_(() => {
122
+ !Z || !Q || (T(f.Suppressed, { reason: Q }), console.info(`[onboarding] not shown: ${Q}`));
123
123
  }, [
124
124
  Z,
125
125
  Q,
126
- E
127
- ]), !O || !Y && (Z || !q.isResolved)) return null;
126
+ T
127
+ ]), !D || !Y && (Z || !q.isResolved)) return null;
128
128
  let at = F?.companyStructure === "SOLE_PROPRIETORSHIP", ot = [
129
- D.stepIndicator.business,
130
- D.stepIndicator.personal,
131
- D.stepIndicator.ownership
129
+ E.stepIndicator.business,
130
+ E.stepIndicator.personal,
131
+ E.stepIndicator.ownership
132
132
  ], st = M === 0 ? F : M === 1 ? I : M === 2 ? L : null, $ = W.isPending || G.isPending || K.isPending || B, ct = () => {
133
133
  z(null), N((e) => e === 0 ? 0 : e - 1);
134
134
  }, lt = () => {
@@ -141,7 +141,7 @@ function ye({ onEmbeddedOnboardingCompletedSuccessfully: a, onNavigateToDashboar
141
141
  try {
142
142
  let r = await K.mutateAsync({ path: { id: e } });
143
143
  if (t.signal.aborted) return;
144
- if (!r.id) throw Error(D.submitFailedError);
144
+ if (!r.id) throw Error(E.submitFailedError);
145
145
  n = !0, (await Qe(e, { signal: t.signal })).status === "complete" ? (U("success"), Ve(), Be()) : U("pending");
146
146
  } catch (e) {
147
147
  if (e instanceof DOMException && e.name === "AbortError") return;
@@ -157,7 +157,7 @@ function ye({ onEmbeddedOnboardingCompletedSuccessfully: a, onNavigateToDashboar
157
157
  if (!F) return;
158
158
  let e = R;
159
159
  if (!e) {
160
- let t = await W.mutateAsync({ body: ae(F) });
160
+ let t = await W.mutateAsync({ body: oe(F) });
161
161
  e = t.id, Xe(e), t.clientSecret && $e(t.clientSecret);
162
162
  }
163
163
  N(1);
@@ -165,7 +165,7 @@ function ye({ onEmbeddedOnboardingCompletedSuccessfully: a, onNavigateToDashboar
165
165
  if (!I || !F || !R) return;
166
166
  await G.mutateAsync({
167
167
  path: { id: R },
168
- body: p({
168
+ body: se({
169
169
  businessDetails: F,
170
170
  applicant: I
171
171
  })
@@ -174,28 +174,28 @@ function ye({ onEmbeddedOnboardingCompletedSuccessfully: a, onNavigateToDashboar
174
174
  if (!L || !R) return;
175
175
  await G.mutateAsync({
176
176
  path: { id: R },
177
- body: p({ businessOwners: L })
177
+ body: se({ businessOwners: L })
178
178
  }), await ut(R);
179
179
  }
180
180
  } catch (e) {
181
- let t = s(e) ?? (e instanceof Error ? e.message : void 0) ?? D.genericRetryError;
181
+ let t = s(e) ?? (e instanceof Error ? e.message : void 0) ?? E.genericRetryError;
182
182
  z(t);
183
183
  }
184
- }, ft = ve(Math.min(M, 2), D), pt = O.bankName?.trim() || D.fallbackBankName, mt = f(D.shellFdicDisclaimer, pt);
184
+ }, ft = ye(Math.min(M, 2), E), pt = D.bankName?.trim() || E.fallbackBankName, mt = d(E.shellFdicDisclaimer, pt);
185
185
  if (Y) {
186
- let r = F?.companyLegalName ?? "", i = O.bankName?.trim() || D.fallbackBankName, a = H ?? "pending", o = a === "success", s = {
187
- ...g.result,
188
- ...D.result
186
+ let r = F?.companyLegalName ?? "", i = D.bankName?.trim() || E.fallbackBankName, a = H ?? "pending", o = a === "success", s = {
187
+ ...m.result,
188
+ ...E.result
189
189
  };
190
- return /* @__PURE__ */ x(e, {
191
- open: Fe,
190
+ return /* @__PURE__ */ b(e, {
191
+ open: A,
192
192
  onOpenChange: j,
193
- children: /* @__PURE__ */ S(t, {
193
+ children: /* @__PURE__ */ x(t, {
194
194
  className: "ttw:grid ttw:max-h-[95vh] ttw:w-[720px] ttw:max-w-[calc(100vw-2rem)] ttw:grid-rows-[1fr] ttw:gap-0 ttw:overflow-hidden ttw:rounded-2xl ttw:p-0",
195
- children: [/* @__PURE__ */ x(n, {
195
+ children: [/* @__PURE__ */ b(n, {
196
196
  className: "ttw:sr-only",
197
- children: D.modalTitle
198
- }), /* @__PURE__ */ x(ee, {
197
+ children: E.modalTitle
198
+ }), /* @__PURE__ */ b(te, {
199
199
  status: a,
200
200
  isLoading: B,
201
201
  loadingMessage: s.loadingMessage,
@@ -205,32 +205,32 @@ function ye({ onEmbeddedOnboardingCompletedSuccessfully: a, onNavigateToDashboar
205
205
  followUpEmail: I?.workEmail ?? "",
206
206
  emailBoxLead: s.pendingEmailBoxLead,
207
207
  navigateToDashboardLabel: s.navigateToDashboard,
208
- bankLogoSrc: Pe,
209
- bankLogoAlt: f(s.bankLogoAlt, i),
210
- fdicDisclaimer: f(s.fdicDisclaimer, i),
211
- onNavigateToDashboard: d
208
+ bankLogoSrc: Fe,
209
+ bankLogoAlt: d(s.bankLogoAlt, i),
210
+ fdicDisclaimer: d(s.fdicDisclaimer, i),
211
+ onNavigateToDashboard: u
212
212
  })]
213
213
  })
214
214
  });
215
215
  }
216
- let ht = M === 2 ? D.submit : D.next, gt = st === null || $;
217
- return /* @__PURE__ */ S(he, { children: [Oe && Ae && w ? /* @__PURE__ */ x(te, {
218
- open: ke,
216
+ let ht = M === 2 ? E.submit : E.next, gt = st === null || $;
217
+ return /* @__PURE__ */ x(ge, { children: [ke && je && C ? /* @__PURE__ */ b(ne, {
218
+ open: Ae,
219
219
  isVisible: !0,
220
- vspLogo: w.vspLogo,
221
- bankingText: w.bankingText,
222
- primaryCaption: w.primaryCaption,
223
- secondaryCaption: w.secondaryCaption,
224
- providedByCaption: w.providedByCaption,
225
- modalPrimaryImg: w.modalPrimaryImg,
226
- primaryModalHeader: w.primaryModalHeader,
227
- benefits: w.benefits,
228
- appearance: w.appearance,
220
+ vspLogo: C.vspLogo,
221
+ bankingText: C.bankingText,
222
+ primaryCaption: C.primaryCaption,
223
+ secondaryCaption: C.secondaryCaption,
224
+ providedByCaption: C.providedByCaption,
225
+ modalPrimaryImg: C.modalPrimaryImg,
226
+ primaryModalHeader: C.primaryModalHeader,
227
+ benefits: C.benefits,
228
+ appearance: C.appearance,
229
229
  onOpenMarketingModal: Le,
230
230
  onCloseMarketingModal: Re,
231
231
  onPrimaryCtaClick: ze
232
- }) : null, /* @__PURE__ */ S(r, {
233
- open: Fe,
232
+ }) : null, /* @__PURE__ */ x(r, {
233
+ open: A,
234
234
  defaultOpen: Ie,
235
235
  onOpenChange: j,
236
236
  title: ft.title,
@@ -248,33 +248,33 @@ function ye({ onEmbeddedOnboardingCompletedSuccessfully: a, onNavigateToDashboar
248
248
  nextIcon: null,
249
249
  errorMessage: Ze,
250
250
  labels: {
251
- backButton: M === 0 ? D.cancel : D.back,
252
- cancelButton: D.cancel
251
+ backButton: M === 0 ? E.cancel : E.back,
252
+ cancelButton: E.cancel
253
253
  },
254
254
  children: [
255
- M === 0 ? /* @__PURE__ */ x(ne, {
255
+ M === 0 ? /* @__PURE__ */ b(re, {
256
256
  value: He,
257
257
  onValueChange: Ue,
258
258
  onSnapshotChange: qe,
259
259
  naicsOptions: et,
260
260
  stateOptions: tt,
261
261
  isSubmitting: $,
262
- labels: D.businessDetails,
262
+ labels: E.businessDetails,
263
263
  bankName: pt,
264
- termsHref: we,
265
- privacyHref: Te,
266
- electronicCommunicationHref: Ee,
267
- patriotActHref: De
264
+ termsHref: Te,
265
+ privacyHref: Ee,
266
+ electronicCommunicationHref: De,
267
+ patriotActHref: Oe
268
268
  }, "business") : null,
269
- M === 1 ? /* @__PURE__ */ x(re, {
269
+ M === 1 ? /* @__PURE__ */ b(ie, {
270
270
  value: P,
271
271
  onValueChange: We,
272
272
  onSnapshotChange: Je,
273
273
  stateOptions: nt,
274
274
  isSubmitting: $,
275
- labels: D.personalDetails
275
+ labels: E.personalDetails
276
276
  }, "personal") : null,
277
- M === 2 ? /* @__PURE__ */ x(ie, {
277
+ M === 2 ? /* @__PURE__ */ b(ae, {
278
278
  owners: Ge,
279
279
  onOwnersChange: Ke,
280
280
  primaryOwnerName: `${P.firstName} ${P.lastName}`.trim(),
@@ -282,30 +282,31 @@ function ye({ onEmbeddedOnboardingCompletedSuccessfully: a, onNavigateToDashboar
282
282
  stateOptions: rt,
283
283
  onSnapshotChange: Ye,
284
284
  isSubmitting: $,
285
- labels: D.additionalOwners
285
+ labels: E.additionalOwners
286
286
  }) : null
287
287
  ]
288
288
  })] });
289
289
  }
290
- function C({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, linkComponent: i, implementation: o, uiFramework: s, errorFallback: c, onError: l, analytics: u, ...d }) {
291
- return /* @__PURE__ */ x(a, {
290
+ function S({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: o, implementation: s, uiFramework: ee, errorFallback: c, onError: l, analytics: u, ...d }) {
291
+ return /* @__PURE__ */ b(a, {
292
292
  baseUrl: e,
293
293
  widgetToken: t,
294
294
  organizationId: n,
295
295
  configClient: r,
296
- linkComponent: i,
297
- implementation: o,
298
- uiFramework: s,
296
+ gatewayRouting: i,
297
+ linkComponent: o,
298
+ implementation: s,
299
+ uiFramework: ee,
299
300
  errorFallback: c,
300
301
  onError: l,
301
302
  analytics: u,
302
- widgetName: h,
303
- children: /* @__PURE__ */ x(be, { ...d })
303
+ widgetName: p,
304
+ children: /* @__PURE__ */ b(xe, { ...d })
304
305
  });
305
306
  }
306
- function be(e) {
307
- let { initResponse: t } = l(), n = t?.userId ?? null, [r, i] = b(n), [a, o] = b(0);
308
- return n !== r && (i(n), r !== null && n !== null && o((e) => e + 1)), /* @__PURE__ */ x(oe, { children: /* @__PURE__ */ x(ye, { ...e }, a) }, a);
307
+ function xe(e) {
308
+ let { initResponse: t } = c(), n = t?.userId ?? null, [r, i] = y(n), [a, o] = y(0);
309
+ return n !== r && (i(n), r !== null && n !== null && o((e) => e + 1)), /* @__PURE__ */ b(ce, { children: /* @__PURE__ */ b(be, { ...e }, a) }, a);
309
310
  }
310
311
  //#endregion
311
- export { C as BankAccountOnboardingWidget, C as default };
312
+ export { S as BankAccountOnboardingWidget, S as default };
@@ -45,20 +45,21 @@ function l({ labels: t, accountDetailsLabels: n, featureLabels: l, isBankingTagl
45
45
  ...C
46
46
  })] });
47
47
  }
48
- function u({ baseUrl: e, widgetToken: r, organizationId: i, configClient: a, linkComponent: o, implementation: c, uiFramework: u, errorFallback: d, onError: f, analytics: p, ...m }) {
48
+ function u({ baseUrl: e, widgetToken: r, organizationId: i, configClient: a, gatewayRouting: o, linkComponent: c, implementation: u, uiFramework: d, errorFallback: f, onError: p, analytics: m, ...h }) {
49
49
  return /* @__PURE__ */ s(t, {
50
50
  widgetName: n,
51
51
  baseUrl: e,
52
52
  widgetToken: r,
53
53
  organizationId: i,
54
54
  configClient: a,
55
- linkComponent: o,
56
- implementation: c,
57
- uiFramework: u,
58
- errorFallback: d,
59
- onError: f,
60
- analytics: p,
61
- children: /* @__PURE__ */ s(l, { ...m })
55
+ gatewayRouting: o,
56
+ linkComponent: c,
57
+ implementation: u,
58
+ uiFramework: d,
59
+ errorFallback: f,
60
+ onError: p,
61
+ analytics: m,
62
+ children: /* @__PURE__ */ s(l, { ...h })
62
63
  });
63
64
  }
64
65
  //#endregion
@@ -1,16 +1,16 @@
1
1
  import "./index2.js";
2
- import "./index7.js";
3
- import "./index9.js";
4
- import "./index11.js";
2
+ import "./index8.js";
3
+ import "./index10.js";
5
4
  import "./index12.js";
6
- import "./index16.js";
5
+ import "./index13.js";
7
6
  import "./index17.js";
8
- import "./index18.js";
9
7
  import "./index19.js";
10
8
  import "./index20.js";
11
9
  import "./index21.js";
12
10
  import "./index22.js";
13
11
  import "./index23.js";
14
12
  import "./index24.js";
15
- import { BillPayWidget as e } from "./index28.js";
13
+ import "./index25.js";
14
+ import "./index26.js";
15
+ import { BillPayWidget as e } from "./index30.js";
16
16
  export { e as BillPayWidget };
@@ -1,9 +1,101 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { calculateTotal as e, displayLineAmount as t } from "./index6.js";
6
+ import { emptyLineItem as n, mapPayableToBillForm as r } from "./index9.js";
7
+ import { useCallback as i, useEffect as a, useMemo as o, useState as s } from "react";
1
8
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js
2
- var e = {
3
- dialog: "bill-pay-bill-create-dialog",
4
- vendorSection: "bill-pay-bill-create-vendor",
5
- lineItems: "bill-pay-bill-create-line-items",
6
- documentPanel: "bill-pay-bill-create-document"
7
- };
9
+ function c({ payable: c, lineItems: l } = {}) {
10
+ let u = o(() => r({
11
+ payable: c ?? {},
12
+ lineItems: l ?? []
13
+ }), [c, l]), [d, f] = s(u.values), [p, m] = s(u.lineItems), [h, g] = s(u.discount), [_, v] = s(u.tax), [y, b] = s(), [x, S] = s(), [C, w] = s(), [T, E] = s(!1), [D, O] = s(!1), [k, A] = s(!1);
14
+ a(() => {
15
+ T || f(u.values);
16
+ }, [u]), a(() => {
17
+ D || m(u.lineItems);
18
+ }, [u]), a(() => {
19
+ k || (g(u.discount), v(u.tax));
20
+ }, [u]);
21
+ let j = i((e) => {
22
+ f((t) => ({
23
+ ...t,
24
+ ...e
25
+ })), E(!0);
26
+ }, []), M = i((e) => {
27
+ w((t) => {
28
+ if (!t?.[e]) return t;
29
+ let n = { ...t };
30
+ return delete n[e], Object.keys(n).length ? n : void 0;
31
+ });
32
+ }, []), N = i((e, n) => {
33
+ M(e), m((r) => r.map((r) => {
34
+ if (r.id !== e) return r;
35
+ let i = {
36
+ ...r,
37
+ ...n
38
+ };
39
+ return "amount" in n ? i : {
40
+ ...i,
41
+ amount: t(i.quantity, i.price)
42
+ };
43
+ })), O(!0), b(void 0);
44
+ }, [M]), P = i((e, n) => {
45
+ M(e), m((r) => r.map((r) => {
46
+ if (r.id !== e) return r;
47
+ let i = Number.parseFloat(r.quantity), a = String(Math.max(1, (Number.isFinite(i) ? i : 1) + n));
48
+ return {
49
+ ...r,
50
+ quantity: a,
51
+ amount: t(a, r.price)
52
+ };
53
+ })), O(!0), b(void 0);
54
+ }, [M]), F = i((e) => {
55
+ M(e), m((t) => t.length <= 1 ? t : t.filter((t) => t.id !== e)), O(!0), b(void 0);
56
+ }, [M]), I = i(() => {
57
+ m((e) => [...e, n()]), O(!0), b(void 0);
58
+ }, []), L = i((e) => {
59
+ g(e), A(!0), b(void 0);
60
+ }, []), R = i((e) => {
61
+ v(e), A(!0), b(void 0);
62
+ }, []), z = i((e) => {
63
+ b(e), A(!0);
64
+ }, []), B = o(() => p.map((e) => ({
65
+ ...e,
66
+ onChange: (t) => N(e.id, t),
67
+ onQuantityStep: (t) => P(e.id, t),
68
+ onRemove: () => F(e.id)
69
+ })), [
70
+ p,
71
+ N,
72
+ F,
73
+ P
74
+ ]), V = o(() => e(p, _, h), [
75
+ p,
76
+ _,
77
+ h
78
+ ]);
79
+ return {
80
+ values: d,
81
+ errors: x,
82
+ setErrors: S,
83
+ lineItemErrors: C,
84
+ setLineItemErrors: w,
85
+ onChange: j,
86
+ lineItems: p,
87
+ lineItemRows: B,
88
+ discount: h,
89
+ onDiscountChange: L,
90
+ tax: _,
91
+ onTaxChange: R,
92
+ total: y ?? V,
93
+ totalOverride: y,
94
+ onTotalChange: z,
95
+ onAddLineItem: I,
96
+ isTotalsDirty: k,
97
+ isDirty: T || D || k
98
+ };
99
+ }
8
100
  //#endregion
9
- export { e as billCreateTestIds };
101
+ export { c as useBillForm };
@@ -1,99 +1,9 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { useLedgerAccountsQuery as e } from "../../../shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js";
6
- import { usePaymentTermsQuery as t } from "../../../shared/data-access/dist/lib/reference-data/usePaymentTermsQuery.js";
7
- import "../../../shared/data-access/dist/index.js";
8
- import { BILL_CREATE_SCREEN_LABELS_EN as n } from "./index2.js";
9
- import { useAllPayableLineItemsQuery as r } from "../../data-access/dist/index6.js";
10
- import { usePayableQuery as i } from "../../data-access/dist/index10.js";
11
- import "../../data-access/dist/index.js";
12
- import { useBillCreateController as a } from "./index7.js";
13
- import { useBillForm as o } from "./index9.js";
14
- import { BillCreateScreen as s } from "../../ui/dist/index28.js";
15
- import { ExtractionNotice as c } from "../../ui/dist/index45.js";
16
- import "../../ui/dist/index.js";
17
- import { SourceDocumentContainer as l } from "./index3.js";
18
- import { useVendorSectionProps as u } from "./index5.js";
19
- import { billCreateTestIds as d } from "./index10.js";
20
- import { useCallback as f, useEffect as p, useMemo as m, useState as h } from "react";
21
- import { jsx as g } from "react/jsx-runtime";
22
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js
23
- function _({ open: _, onOpenChange: v, payableId: y, copy: b }) {
24
- let x = {
25
- ...n,
26
- ...b
27
- }, [S, C] = h(), [w, T] = h(!1), [E, D] = h(!1), [O, k] = h(), A = y ?? O, j = i(A, { pollWhileOcrProcessing: !0 }), M = r(A), N = e(), P = t(), F = j.data, I = o({
28
- payable: F,
29
- lineItems: M.lineItems
30
- }), L = F?.counterpart_id;
31
- p(() => {
32
- w || L && (C(L), T(!0));
33
- }, [w, L]);
34
- let R = f((e) => {
35
- T(!0), C(e);
36
- }, []), z = P.data?.data?.find((e) => e.id === I.values.paymentTerms), B = m(() => (P.data?.data ?? []).filter((e) => !!(e.id && e.name)).map((e) => ({
37
- value: e.id,
38
- label: e.name
39
- })), [P.data]), V = a({
40
- payableId: y,
41
- form: I,
42
- paymentTerm: z,
43
- counterpartId: S,
44
- onPayableCreated: k,
45
- onSaved: k,
46
- onDraftSaved: () => v(!1),
47
- onFinalized: () => v(!1)
48
- }), H = m(() => (N.data?.data ?? []).map((e) => ({
49
- value: e.id,
50
- label: [e.nominal_code, e.name].filter(Boolean).join(" — ")
51
- })), [N.data]), U = F?.source_of_payable_data === "ocr", W = F?.counterpart_raw_data?.name, G = () => {
52
- I.isDirty && !window.confirm(x.discardConfirm) || v(!1);
53
- }, K = u({
54
- payableId: A,
55
- counterpartId: S,
56
- payableCounterpartId: L,
57
- onCounterpartChange: R
58
- });
59
- return /* @__PURE__ */ g(s, {
60
- open: _,
61
- onOpenChange: (e) => e ? v(!0) : G(),
62
- title: U && W ? x.extractedTitle(W) : x.newTitle,
63
- notice: U && !E ? /* @__PURE__ */ g(c, { onDismiss: () => D(!0) }) : void 0,
64
- vendor: {
65
- ...K,
66
- testId: d.vendorSection
67
- },
68
- values: I.values,
69
- errors: I.errors,
70
- onChange: I.onChange,
71
- paymentTermOptions: B,
72
- lineItems: {
73
- items: I.lineItemRows,
74
- glCodeOptions: H,
75
- totalAmountLabel: I.totalAmountLabel,
76
- onAddLineItem: I.onAddLineItem,
77
- testId: d.lineItems
78
- },
79
- documentPanel: /* @__PURE__ */ g(l, {
80
- payableId: A,
81
- isDocumentPending: !!A && !F?.file && (j.isLoading || F?.ocr_status === "processing"),
82
- file: F?.file ? {
83
- id: F.file.id,
84
- name: F.file.name,
85
- url: F.file.url,
86
- mimetype: F.file.mimetype
87
- } : void 0
88
- }),
89
- isLineItemsLoading: M.isResolving,
90
- isSavingDraft: V.isSavingDraft,
91
- isFinalizing: V.isFinalizing,
92
- onCancel: G,
93
- onSaveDraft: V.saveDraft,
94
- onFinalize: V.finalize,
95
- testId: d.dialog
96
- });
97
- }
2
+ var e = {
3
+ dialog: "bill-pay-bill-create-dialog",
4
+ vendorSection: "bill-pay-bill-create-vendor",
5
+ lineItems: "bill-pay-bill-create-line-items",
6
+ documentPanel: "bill-pay-bill-create-document"
7
+ };
98
8
  //#endregion
99
- export { _ as BillCreateDialog, _ as default };
9
+ export { e as billCreateTestIds };