@tesouro/embedded-components-react 0.7.34 → 0.7.36

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 (65) hide show
  1. package/README.md +10 -8
  2. package/dist/index.d.ts +31 -32
  3. package/dist/index.js +5 -5
  4. package/dist/lib/CounterpartsWidget.d.ts +0 -1
  5. package/dist/lib/CounterpartsWidgetPublic.d.ts +0 -1
  6. package/dist/lib/CustomersWidget.d.ts +0 -1
  7. package/dist/lib/{MarketingWidget.d.ts → OfferWidget.d.ts} +31 -31
  8. package/dist/lib/OfferWidget.js +6 -0
  9. package/dist/lib/ReceivablesWidget.d.ts +0 -1
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index33.js +109 -110
  11. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsPanel.js +2 -2
  12. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsTable.js +1 -1
  13. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableForm.js +1 -1
  14. package/dist/libs/tesouro-embedded-components-react/offer-widget/feature/dist/index.js +5 -0
  15. package/dist/libs/tesouro-embedded-components-react/{marketing-widget/feature/dist/lib/MarketingWidget/MarketingWidget.js → offer-widget/feature/dist/lib/OfferWidget/OfferWidget.js} +11 -11
  16. package/dist/libs/tesouro-embedded-components-react/{marketing-widget/feature/dist/lib/MarketingWidget → offer-widget/feature/dist/lib/OfferWidget}/labels.js +2 -2
  17. package/dist/libs/tesouro-embedded-components-react/{marketing-widget/feature/dist/lib/MarketingWidget/marketingApplicationView.js → offer-widget/feature/dist/lib/OfferWidget/offerApplicationView.js} +2 -2
  18. package/dist/libs/tesouro-embedded-components-react/offer-widget/feature/dist/lib/analytics/events.js +8 -0
  19. package/dist/libs/tesouro-embedded-components-react/{marketing-widget → offer-widget}/feature/dist/lib/testIds.js +2 -2
  20. package/dist/libs/tesouro-embedded-components-react/{marketing-widget → offer-widget}/feature/dist/mocks/labels.js +2 -2
  21. package/dist/libs/tesouro-embedded-components-react/{marketing-widget/feature/dist/mocks/marketing.js → offer-widget/feature/dist/mocks/offer.js} +3 -3
  22. package/dist/libs/tesouro-embedded-components-react/offer-widget/feature/dist/scenarios.js +2 -0
  23. package/dist/libs/tesouro-embedded-components-react/offer-widget/ui/dist/index.js +5 -0
  24. package/dist/libs/tesouro-embedded-components-react/offer-widget/ui/dist/index2.js +10 -0
  25. package/dist/libs/tesouro-embedded-components-react/{marketing-widget → offer-widget}/ui/dist/index3.js +2 -2
  26. package/dist/libs/tesouro-embedded-components-react/{marketing-widget → offer-widget}/ui/dist/index4.js +2 -2
  27. package/dist/libs/tesouro-embedded-components-react/{marketing-widget → offer-widget}/ui/dist/index5.js +2 -2
  28. package/dist/libs/tesouro-embedded-components-react/{marketing-widget → offer-widget}/ui/dist/index6.js +2 -2
  29. package/dist/libs/tesouro-embedded-components-react/{marketing-widget → offer-widget}/ui/dist/index7.js +5 -5
  30. package/dist/libs/tesouro-embedded-components-react/{marketing-widget → offer-widget}/ui/dist/index8.js +3 -3
  31. package/dist/libs/tesouro-embedded-components-react/{marketing-widget → offer-widget}/ui/dist/index9.js +6 -6
  32. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index.js +2 -4
  33. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index4.js +89 -2
  34. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index5.js +48 -50
  35. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +4 -6
  36. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +2 -3
  37. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/labels.js +0 -1
  38. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/subEntityForms.js +1 -1
  39. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useAddressForm.js +1 -1
  40. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js +2 -2
  41. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartForm.js +2 -2
  42. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useDeleteController.js +1 -1
  43. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/usePayableAchInstructions.js +1 -1
  44. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index.js +3 -6
  45. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index11.js +48 -7
  46. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index12.js +4 -48
  47. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index13.js +28 -6
  48. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  49. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/mocks/widgetSuite.js +2 -2
  50. package/dist/scenarios/index.d.ts +2 -2
  51. package/dist/scenarios/index.js +3 -3
  52. package/package.json +1 -1
  53. package/dist/lib/MarketingWidget.js +0 -6
  54. package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index.js +0 -5
  55. package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/lib/analytics/events.js +0 -8
  56. package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/scenarios.js +0 -2
  57. package/dist/libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index.js +0 -5
  58. package/dist/libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index2.js +0 -10
  59. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index6.js +0 -7
  60. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index7.js +0 -92
  61. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/CounterpartSelector.js +0 -7
  62. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartSelector.js +0 -8
  63. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index14.js +0 -4
  64. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index15.js +0 -28
  65. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index16.js +0 -4
@@ -1,7 +1,7 @@
1
1
  import { A_COMPLETE_BANK_ACCOUNT_APPLICATION as e } from "../../../../shared/data-access-mocks/dist/lib/fixtures.js";
2
2
  import { PROXY as t, initRoute as n, readRoute as r } from "../../../../shared/data-access-mocks/dist/mocks/scenarios/scenario.js";
3
- import { MARKETING_LABELS as i } from "./labels.js";
4
- //#region ../../libs/tesouro-embedded-components-react/marketing-widget/feature/dist/mocks/marketing.js
3
+ import { OFFER_LABELS as i } from "./labels.js";
4
+ //#region ../../libs/tesouro-embedded-components-react/offer-widget/feature/dist/mocks/offer.js
5
5
  var a = {
6
6
  status: "NOT_FOUND",
7
7
  organizationId: null,
@@ -31,4 +31,4 @@ var a = {
31
31
  u("existing-customer", {})
32
32
  ];
33
33
  //#endregion
34
- export { d as marketingScenarios };
34
+ export { d as offerScenarios };
@@ -0,0 +1,2 @@
1
+ import { offerScenarios as e } from "./mocks/offer.js";
2
+ export { e as offerScenarios };
@@ -0,0 +1,5 @@
1
+ import { OFFER_WIDGET_LABELS_EN as e } from "./index2.js";
2
+ import { OfferBenefitIcon as t, OfferWidgetStatusTone as n } from "./index3.js";
3
+ import "./index7.js";
4
+ import { OfferWidget as r } from "./index9.js";
5
+ export { e as OFFER_WIDGET_LABELS_EN, t as OfferBenefitIcon, r as OfferWidget, n as OfferWidgetStatusTone };
@@ -0,0 +1,10 @@
1
+ //#region ../../libs/tesouro-embedded-components-react/offer-widget/ui/dist/index2.js
2
+ var e = {
3
+ applyNow: "Apply now",
4
+ learnMore: "Learn more",
5
+ primaryCta: "Start application",
6
+ primaryCtaSubtext: "takes about 5 minutes",
7
+ dismissModalAriaLabel: "Close offer modal"
8
+ };
9
+ //#endregion
10
+ export { e as OFFER_WIDGET_LABELS_EN };
@@ -1,4 +1,4 @@
1
- //#region ../../libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index3.js
1
+ //#region ../../libs/tesouro-embedded-components-react/offer-widget/ui/dist/index3.js
2
2
  var e = {
3
3
  Sync: "sync",
4
4
  Users: "users",
@@ -11,4 +11,4 @@ var e = {
11
11
  Danger: "danger"
12
12
  };
13
13
  //#endregion
14
- export { e as MarketingBenefitIcon, t as MarketingWidgetStatusTone };
14
+ export { e as OfferBenefitIcon, t as OfferWidgetStatusTone };
@@ -1,6 +1,6 @@
1
- import { MarketingBenefitIcon as e } from "./index3.js";
1
+ import { OfferBenefitIcon as e } from "./index3.js";
2
2
  import { CreditCard as t, DollarSign as n, FileText as r, RefreshCw as i, Users as a } from "lucide-react";
3
- //#region ../../libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index4.js
3
+ //#region ../../libs/tesouro-embedded-components-react/offer-widget/ui/dist/index4.js
4
4
  var o = {
5
5
  [e.Sync]: i,
6
6
  [e.Users]: a,
@@ -1,6 +1,6 @@
1
1
  import { BENEFIT_ICON_COMPONENTS as e } from "./index4.js";
2
2
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
- //#region ../../libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index5.js
3
+ //#region ../../libs/tesouro-embedded-components-react/offer-widget/ui/dist/index5.js
4
4
  function r({ text: r, icon: i }) {
5
5
  let a = e[i];
6
6
  return /* @__PURE__ */ n("div", {
@@ -15,4 +15,4 @@ function r({ text: r, icon: i }) {
15
15
  });
16
16
  }
17
17
  //#endregion
18
- export { r as MarketingBenefitItem };
18
+ export { r as OfferBenefitItem };
@@ -1,5 +1,5 @@
1
1
  import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
- //#region ../../libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index6.js
2
+ //#region ../../libs/tesouro-embedded-components-react/offer-widget/ui/dist/index6.js
3
3
  function n({ header: n, steps: r }) {
4
4
  return r.length === 0 ? null : /* @__PURE__ */ t("div", {
5
5
  className: "ttw:mb-6",
@@ -37,4 +37,4 @@ function n({ header: n, steps: r }) {
37
37
  });
38
38
  }
39
39
  //#endregion
40
- export { n as MarketingWidgetHowItWorks };
40
+ export { n as OfferWidgetHowItWorks };
@@ -1,10 +1,10 @@
1
1
  import { Button as e, Dialog as t, DialogClose as n, DialogContent as r, DialogTitle as i } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { MARKETING_WIDGET_LABELS_EN as a } from "./index2.js";
3
- import { MarketingBenefitItem as o } from "./index5.js";
4
- import { MarketingWidgetHowItWorks as s } from "./index6.js";
2
+ import { OFFER_WIDGET_LABELS_EN as a } from "./index2.js";
3
+ import { OfferBenefitItem as o } from "./index5.js";
4
+ import { OfferWidgetHowItWorks as s } from "./index6.js";
5
5
  import { jsx as c, jsxs as l } from "react/jsx-runtime";
6
6
  import { ArrowRight as u, X as d } from "lucide-react";
7
- //#region ../../libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index7.js
7
+ //#region ../../libs/tesouro-embedded-components-react/offer-widget/ui/dist/index7.js
8
8
  function f({ open: f, vspLogo: p, providedByCaption: m, primaryModalHeader: h, howItWorksHeader: g, howItWorksSteps: _, fromDayOneHeader: v, benefits: y, onClose: b, onPrimaryCtaClick: x, labels: S, testIds: C }) {
9
9
  let w = {
10
10
  ...a,
@@ -95,4 +95,4 @@ function f({ open: f, vspLogo: p, providedByCaption: m, primaryModalHeader: h, h
95
95
  });
96
96
  }
97
97
  //#endregion
98
- export { f as MarketingWidgetModal };
98
+ export { f as OfferWidgetModal };
@@ -1,7 +1,7 @@
1
1
  import { Badge as e, cn as t } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { MarketingWidgetStatusTone as n } from "./index3.js";
2
+ import { OfferWidgetStatusTone as n } from "./index3.js";
3
3
  import { jsx as r, jsxs as i } from "react/jsx-runtime";
4
- //#region ../../libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index8.js
4
+ //#region ../../libs/tesouro-embedded-components-react/offer-widget/ui/dist/index8.js
5
5
  var a = {
6
6
  [n.Brand]: "ttw:border-transparent ttw:bg-primary/10 ttw:text-primary",
7
7
  [n.Warning]: "ttw:border-amber-100 ttw:bg-amber-100 ttw:text-amber-700",
@@ -33,4 +33,4 @@ function o({ statusMessage: n, testId: o }) {
33
33
  });
34
34
  }
35
35
  //#endregion
36
- export { o as MarketingWidgetStatus };
36
+ export { o as OfferWidgetStatus };
@@ -1,10 +1,10 @@
1
1
  import { Button as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { MARKETING_WIDGET_LABELS_EN as t } from "./index2.js";
3
- import { MarketingWidgetModal as n } from "./index7.js";
4
- import { MarketingWidgetStatus as r } from "./index8.js";
2
+ import { OFFER_WIDGET_LABELS_EN as t } from "./index2.js";
3
+ import { OfferWidgetModal as n } from "./index7.js";
4
+ import { OfferWidgetStatus as r } from "./index8.js";
5
5
  import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
6
- //#region ../../libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index9.js
7
- function s({ open: s, vspLogo: c, bankingText: l, primaryCaption: u, secondaryCaption: d, providedByCaption: f, primaryModalHeader: p, howItWorksHeader: m, howItWorksSteps: h, fromDayOneHeader: g, benefits: _, onOpenMarketingModal: v, onCloseMarketingModal: y, onPrimaryCtaClick: b, statusMessage: x, labels: S, testIds: C }) {
6
+ //#region ../../libs/tesouro-embedded-components-react/offer-widget/ui/dist/index9.js
7
+ function s({ open: s, vspLogo: c, bankingText: l, primaryCaption: u, secondaryCaption: d, providedByCaption: f, primaryModalHeader: p, howItWorksHeader: m, howItWorksSteps: h, fromDayOneHeader: g, benefits: _, onOpenOfferModal: v, onCloseOfferModal: y, onPrimaryCtaClick: b, statusMessage: x, labels: S, testIds: C }) {
8
8
  let w = {
9
9
  ...t,
10
10
  ...S
@@ -74,4 +74,4 @@ function s({ open: s, vspLogo: c, bankingText: l, primaryCaption: u, secondaryCa
74
74
  })] });
75
75
  }
76
76
  //#endregion
77
- export { s as MarketingWidget };
77
+ export { s as OfferWidget };
@@ -1,7 +1,5 @@
1
1
  import "./index2.js";
2
2
  import { useCounterpartQuery as e, useCounterpartsByIdsQuery as t, useCounterpartsQuery as n, useCreateCounterpartMutation as r, useDeleteCounterpartMutation as i, useUpdateCounterpartMutation as a } from "./index3.js";
3
- import "./index4.js";
4
- import { useCounterpartBankAccountsQuery as o, useCreateCounterpartBankAccountMutation as s, useDeleteCounterpartBankAccountMutation as c, useUpdateCounterpartBankAccountMutation as l } from "./index5.js";
5
- import "./index6.js";
6
- import { useCounterpartAddressesForRowsQuery as u, useCounterpartAddressesQuery as d, useCreateCounterpartAddressMutation as f, useUpdateCounterpartAddressMutation as p } from "./index7.js";
3
+ import { useCounterpartBankAccountsQuery as o, useCreateCounterpartBankAccountMutation as s, useDeleteCounterpartBankAccountMutation as c, useUpdateCounterpartBankAccountMutation as l } from "./index4.js";
4
+ import { useCounterpartAddressesForRowsQuery as u, useCounterpartAddressesQuery as d, useCreateCounterpartAddressMutation as f, useUpdateCounterpartAddressMutation as p } from "./index5.js";
7
5
  export { u as useCounterpartAddressesForRowsQuery, d as useCounterpartAddressesQuery, o as useCounterpartBankAccountsQuery, e as useCounterpartQuery, t as useCounterpartsByIdsQuery, n as useCounterpartsQuery, f as useCreateCounterpartAddressMutation, s as useCreateCounterpartBankAccountMutation, r as useCreateCounterpartMutation, c as useDeleteCounterpartBankAccountMutation, i as useDeleteCounterpartMutation, p as useUpdateCounterpartAddressMutation, l as useUpdateCounterpartBankAccountMutation, a as useUpdateCounterpartMutation };
@@ -2,6 +2,93 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
+ import { deleteCounterpartsIdBankAccountsId as e, patchCounterpartsIdBankAccountsId as t, postCounterpartsIdBankAccounts as n } from "../../../data-access/dist/lib/rest/sdk.gen.js";
6
+ import { getCounterpartsIdBankAccountsOptions as r } from "../../../data-access/dist/lib/rest/@tanstack/react-query.gen.js";
7
+ import { withAuthEpoch as i } from "../../../data-access/dist/lib/withAuthEpoch.js";
8
+ import { invalidateAllClients as a } from "../../../data-access/dist/lib/clientRegistry.js";
9
+ import { useEmbedApi as o } from "../../../data-access/dist/lib/EmbedApiContext.js";
10
+ import { organizationHeaders as s } from "../../../data-access/dist/lib/organizationHeaders.js";
5
11
  import "../../../data-access/dist/index.js";
6
- import "./index2.js";
7
- import "@tanstack/react-query";
12
+ import { counterpartBankAccountsInvalidationKey as c } from "./index2.js";
13
+ import { useMutation as l, useQuery as u } from "@tanstack/react-query";
14
+ //#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index4.js
15
+ function d(e, { enabled: t = !0 } = {}) {
16
+ let { client: n, organizationId: a, widgetToken: c, authEpoch: l, organizationStatus: d } = o(), f = !!(t && a && c && e), p = r({
17
+ client: n,
18
+ headers: s(a),
19
+ path: { counterpart_id: e ?? "" }
20
+ });
21
+ return u({
22
+ ...i(p, {
23
+ authEpoch: l,
24
+ organizationStatus: d
25
+ }),
26
+ enabled: f
27
+ });
28
+ }
29
+ function f() {
30
+ let { client: e, organizationId: t } = o();
31
+ return l({
32
+ mutationFn: async ({ path: r, body: i }) => {
33
+ let { data: a } = await n({
34
+ client: e,
35
+ headers: s(t),
36
+ path: r,
37
+ body: i,
38
+ throwOnError: !0
39
+ });
40
+ return a;
41
+ },
42
+ onSuccess: async (n, r) => {
43
+ await a(c({
44
+ client: e,
45
+ organizationId: t,
46
+ counterpartId: r.path.counterpart_id
47
+ }));
48
+ }
49
+ });
50
+ }
51
+ function p() {
52
+ let { client: e, organizationId: n } = o();
53
+ return l({
54
+ mutationFn: async ({ path: r, body: i }) => {
55
+ let { data: a } = await t({
56
+ client: e,
57
+ headers: s(n),
58
+ path: r,
59
+ body: i,
60
+ throwOnError: !0
61
+ });
62
+ return a;
63
+ },
64
+ onSuccess: async (t, r) => {
65
+ await a(c({
66
+ client: e,
67
+ organizationId: n,
68
+ counterpartId: r.path.counterpart_id
69
+ }));
70
+ }
71
+ });
72
+ }
73
+ function m() {
74
+ let { client: t, organizationId: n } = o();
75
+ return l({
76
+ mutationFn: async ({ path: r }) => {
77
+ await e({
78
+ client: t,
79
+ headers: s(n),
80
+ path: r,
81
+ throwOnError: !0
82
+ });
83
+ },
84
+ onSuccess: async (e, r) => {
85
+ await a(c({
86
+ client: t,
87
+ organizationId: n,
88
+ counterpartId: r.path.counterpart_id
89
+ }));
90
+ }
91
+ });
92
+ }
93
+ //#endregion
94
+ export { d as useCounterpartBankAccountsQuery, f as useCreateCounterpartBankAccountMutation, m as useDeleteCounterpartBankAccountMutation, p as useUpdateCounterpartBankAccountMutation };
@@ -2,59 +2,51 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { deleteCounterpartsIdBankAccountsId as e, patchCounterpartsIdBankAccountsId as t, postCounterpartsIdBankAccounts as n } from "../../../data-access/dist/lib/rest/sdk.gen.js";
6
- import { getCounterpartsIdBankAccountsOptions as r } from "../../../data-access/dist/lib/rest/@tanstack/react-query.gen.js";
7
- import { withAuthEpoch as i } from "../../../data-access/dist/lib/withAuthEpoch.js";
8
- import { invalidateAllClients as a } from "../../../data-access/dist/lib/clientRegistry.js";
9
- import { useEmbedApi as o } from "../../../data-access/dist/lib/EmbedApiContext.js";
10
- import { organizationHeaders as s } from "../../../data-access/dist/lib/organizationHeaders.js";
5
+ import { patchCounterpartsIdAddressesId as e, postCounterpartsIdAddresses as t } from "../../../data-access/dist/lib/rest/sdk.gen.js";
6
+ import { getCounterpartsIdAddressesOptions as n } from "../../../data-access/dist/lib/rest/@tanstack/react-query.gen.js";
7
+ import { withAuthEpoch as r } from "../../../data-access/dist/lib/withAuthEpoch.js";
8
+ import { invalidateAllClients as i } from "../../../data-access/dist/lib/clientRegistry.js";
9
+ import { useEmbedApi as a } from "../../../data-access/dist/lib/EmbedApiContext.js";
10
+ import { organizationHeaders as o } from "../../../data-access/dist/lib/organizationHeaders.js";
11
11
  import "../../../data-access/dist/index.js";
12
- import { counterpartBankAccountsInvalidationKey as c } from "./index2.js";
13
- import { useMutation as l, useQuery as u } from "@tanstack/react-query";
12
+ import { counterpartAddressesInvalidationKey as s, counterpartInvalidationKey as c } from "./index2.js";
13
+ import { useMutation as l, useQueries as u, useQuery as d } from "@tanstack/react-query";
14
14
  //#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index5.js
15
- function d(e, { enabled: t = !0 } = {}) {
16
- let { client: n, organizationId: a, widgetToken: c, authEpoch: l, organizationStatus: d } = o(), f = !!(t && a && c && e), p = r({
17
- client: n,
18
- headers: s(a),
15
+ function f(e) {
16
+ let { client: t, organizationId: i, widgetToken: s, authEpoch: c, organizationStatus: l } = a(), u = !!(i && s && e), f = n({
17
+ client: t,
18
+ headers: o(i),
19
19
  path: { counterpart_id: e ?? "" }
20
20
  });
21
- return u({
22
- ...i(p, {
23
- authEpoch: l,
24
- organizationStatus: d
21
+ return d({
22
+ ...r(f, {
23
+ authEpoch: c,
24
+ organizationStatus: l
25
25
  }),
26
- enabled: f
26
+ enabled: u
27
27
  });
28
28
  }
29
- function f() {
30
- let { client: e, organizationId: t } = o();
31
- return l({
32
- mutationFn: async ({ path: r, body: i }) => {
33
- let { data: a } = await n({
34
- client: e,
35
- headers: s(t),
36
- path: r,
37
- body: i,
38
- throwOnError: !0
39
- });
40
- return a;
41
- },
42
- onSuccess: async (n, r) => {
43
- await a(c({
44
- client: e,
45
- organizationId: t,
46
- counterpartId: r.path.counterpart_id
47
- }));
48
- }
49
- });
29
+ function p({ counterpartIds: e, enabled: t }) {
30
+ let { client: i, organizationId: s, widgetToken: c, authEpoch: l, organizationStatus: d } = a(), f = !!(s && c) && e.length > 0 && (t === !0 || t === void 0);
31
+ return u({ queries: e.map((e) => ({
32
+ ...r(n({
33
+ client: i,
34
+ headers: o(s),
35
+ path: { counterpart_id: e }
36
+ }), {
37
+ authEpoch: l,
38
+ organizationStatus: d
39
+ }),
40
+ enabled: f && !!e
41
+ })) });
50
42
  }
51
- function p() {
52
- let { client: e, organizationId: n } = o();
43
+ function m() {
44
+ let { client: e, organizationId: n } = a();
53
45
  return l({
54
46
  mutationFn: async ({ path: r, body: i }) => {
55
47
  let { data: a } = await t({
56
48
  client: e,
57
- headers: s(n),
49
+ headers: o(n),
58
50
  path: r,
59
51
  body: i,
60
52
  throwOnError: !0
@@ -62,27 +54,33 @@ function p() {
62
54
  return a;
63
55
  },
64
56
  onSuccess: async (t, r) => {
65
- await a(c({
57
+ await Promise.all([i(s({
66
58
  client: e,
67
59
  organizationId: n,
68
60
  counterpartId: r.path.counterpart_id
69
- }));
61
+ })), i(c({
62
+ client: e,
63
+ organizationId: n,
64
+ counterpartId: r.path.counterpart_id
65
+ }))]);
70
66
  }
71
67
  });
72
68
  }
73
- function m() {
74
- let { client: t, organizationId: n } = o();
69
+ function h() {
70
+ let { client: t, organizationId: n } = a();
75
71
  return l({
76
- mutationFn: async ({ path: r }) => {
77
- await e({
72
+ mutationFn: async ({ path: r, body: i }) => {
73
+ let { data: a } = await e({
78
74
  client: t,
79
- headers: s(n),
75
+ headers: o(n),
80
76
  path: r,
77
+ body: i,
81
78
  throwOnError: !0
82
79
  });
80
+ return a;
83
81
  },
84
82
  onSuccess: async (e, r) => {
85
- await a(c({
83
+ await i(s({
86
84
  client: t,
87
85
  organizationId: n,
88
86
  counterpartId: r.path.counterpart_id
@@ -91,4 +89,4 @@ function m() {
91
89
  });
92
90
  }
93
91
  //#endregion
94
- export { d as useCounterpartBankAccountsQuery, f as useCreateCounterpartBankAccountMutation, m as useDeleteCounterpartBankAccountMutation, p as useUpdateCounterpartBankAccountMutation };
92
+ export { p as useCounterpartAddressesForRowsQuery, f as useCounterpartAddressesQuery, m as useCreateCounterpartAddressMutation, h as useUpdateCounterpartAddressMutation };
@@ -1,21 +1,19 @@
1
1
  import "../../../util/dist/lib/apiErrors.js";
2
2
  import "../../ui/dist/index5.js";
3
3
  import { CounterpartFormFields as e, CounterpartFormSheet as t, useFocusFirstInvalidField as n } from "../../ui/dist/index10.js";
4
- import { BankAccountFormSheet as r } from "../../ui/dist/index12.js";
5
- import { ConfirmDeleteDialog as i } from "../../ui/dist/index15.js";
4
+ import { BankAccountFormSheet as r } from "../../ui/dist/index11.js";
5
+ import { ConfirmDeleteDialog as i } from "../../ui/dist/index13.js";
6
6
  import "../../ui/dist/index.js";
7
7
  import { COUNTERPART_MESSAGE_LABELS_EN as a } from "./lib/labels.js";
8
8
  import { addressResponseToFormValues as o, bankAccountToAchFormValues as s, buildAnalyticsMap as c, buildCounterpartFormTaxIdField as l, buildCounterpartRows as u, counterpartFormBankAccountToCreatePayload as d, counterpartFormBankAccountToUpdatePayload as f, counterpartToFormValues as p, emptyCounterpartFormValues as m, formatMoney as h, getAchInstructions as g, getCounterpartEmail as _, getCounterpartName as v, getPayableAchInstructions as y, hasCounterpartFormErrors as b, hasSelectedText as x, isAchCompatibleBankAccount as S, resolveCounterpartBankAccountWrite as C, validateAchFormValues as w, validateCounterpartForm as T } from "./lib/helpers.js";
9
9
  import { useCounterpartQuery as E, useCounterpartsByIdsQuery as D, useCounterpartsQuery as O, useCreateCounterpartMutation as k } from "../../data-access/dist/index3.js";
10
- import { useCreateCounterpartBankAccountMutation as A, useUpdateCounterpartBankAccountMutation as j } from "../../data-access/dist/index5.js";
11
- import { useCounterpartAddressesForRowsQuery as M, useCounterpartAddressesQuery as N } from "../../data-access/dist/index7.js";
10
+ import { useCreateCounterpartBankAccountMutation as A, useUpdateCounterpartBankAccountMutation as j } from "../../data-access/dist/index4.js";
11
+ import { useCounterpartAddressesForRowsQuery as M, useCounterpartAddressesQuery as N } from "../../data-access/dist/index5.js";
12
12
  import "../../data-access/dist/index.js";
13
13
  import { useAddressForm as P } from "./lib/useAddressForm.js";
14
14
  import { useCounterpartDetails as F } from "./lib/useCounterpartDetails.js";
15
15
  import { usePayableAchInstructions as I } from "./lib/usePayableAchInstructions.js";
16
16
  import { useCounterpartForm as L } from "./lib/useCounterpartForm.js";
17
- import "./lib/useCounterpartSelector.js";
18
- import "./lib/CounterpartSelector.js";
19
17
  import { useDeleteController as R } from "./lib/useDeleteController.js";
20
18
  import "./lib/useSubEntityForm.js";
21
19
  import { useBankAccountForm as z } from "./lib/subEntityForms.js";
@@ -120,11 +120,10 @@ function C(e, t = "USD", n) {
120
120
  let i = (e ?? []).filter((e) => e.currency === t && !!e.account_holder_name && !!e.routing_number && !!e.account_number);
121
121
  return i.find((e) => e.is_default_for_currency) ?? i[0];
122
122
  }
123
- function w(e, t = {}) {
124
- let n = e.line2.trim();
123
+ function w(e) {
125
124
  return {
126
125
  line1: e.line1.trim(),
127
- line2: t.keepEmptyOptionalFields ? n : n || void 0,
126
+ line2: e.line2.trim() || void 0,
128
127
  city: e.city.trim(),
129
128
  state: e.state || void 0,
130
129
  postal_code: e.postalCode.trim(),
@@ -14,7 +14,6 @@ var e = {
14
14
  accountHolderNameRequired: "Account holder name is required",
15
15
  routingNumberInvalid: "Enter a valid 9-digit ABA routing number",
16
16
  accountNumberInvalid: "Enter a valid account number",
17
- vatIdValueRequired: "VAT ID is required",
18
17
  genericError: "Something went wrong. Please try again.",
19
18
  amountsUnavailable: "Some amounts could not be loaded. Try refreshing the page.",
20
19
  deleteTitle: "Delete {name}?",
@@ -5,7 +5,7 @@
5
5
  import { toast as e } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
6
  import "../../../../ui/dist/index.js";
7
7
  import { bankAccountToAchFormValues as t, counterpartFormBankAccountToCreatePayload as n, counterpartFormBankAccountToUpdatePayload as r, emptyAchFormValues as i, hasAchFormErrors as a, resolveCounterpartBankAccountWrite as o, validateAchFormValues as s } from "./helpers.js";
8
- import { useCreateCounterpartBankAccountMutation as c, useUpdateCounterpartBankAccountMutation as l } from "../../../data-access/dist/index5.js";
8
+ import { useCreateCounterpartBankAccountMutation as c, useUpdateCounterpartBankAccountMutation as l } from "../../../data-access/dist/index4.js";
9
9
  import "../../../data-access/dist/index.js";
10
10
  import { useSubEntityForm as u } from "./useSubEntityForm.js";
11
11
  //#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/subEntityForms.js
@@ -6,7 +6,7 @@ import { toast as e } from "../../../../../../../packages/shared-ui-shadcn/dist/
6
6
  import { extractApiErrorMessage as t } from "../../../../util/dist/lib/apiErrors.js";
7
7
  import "../../../../ui/dist/index.js";
8
8
  import { addressFormToCreatePayload as n, addressFormToUpdatePayload as r, addressResponseToFormValues as i, validateAddressForm as a } from "./helpers.js";
9
- import { useCreateCounterpartAddressMutation as o, useUpdateCounterpartAddressMutation as s } from "../../../data-access/dist/index7.js";
9
+ import { useCreateCounterpartAddressMutation as o, useUpdateCounterpartAddressMutation as s } from "../../../data-access/dist/index5.js";
10
10
  import "../../../data-access/dist/index.js";
11
11
  import { useCallback as c, useState as l } from "react";
12
12
  //#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useAddressForm.js
@@ -4,8 +4,8 @@
4
4
  "use client";
5
5
  import { buildBankAccountItems as e, buildCounterpartDetailsView as t } from "./helpers.js";
6
6
  import { useCounterpartQuery as n } from "../../../data-access/dist/index3.js";
7
- import { useCounterpartBankAccountsQuery as r } from "../../../data-access/dist/index5.js";
8
- import { useCounterpartAddressesQuery as i } from "../../../data-access/dist/index7.js";
7
+ import { useCounterpartBankAccountsQuery as r } from "../../../data-access/dist/index4.js";
8
+ import { useCounterpartAddressesQuery as i } from "../../../data-access/dist/index5.js";
9
9
  import "../../../data-access/dist/index.js";
10
10
  import { useMemo as a } from "react";
11
11
  //#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js
@@ -5,8 +5,8 @@
5
5
  import { extractApiErrorMessage as e } from "../../../../util/dist/lib/apiErrors.js";
6
6
  import { addressFormToCreatePayload as t, addressFormToUpdatePayload as n, addressResponseToFormValues as r, bankAccountToAchFormValues as i, counterpartFormBankAccountToCreatePayload as a, counterpartFormBankAccountToUpdatePayload as o, counterpartFormToCreatePayload as s, counterpartFormToUpdatePayload as ee, counterpartToFormValues as c, emptyCounterpartFormValues as l, getAchInstructions as u, hasCounterpartFormAddressValues as d, hasCounterpartFormBankAccountValues as f, hasCounterpartFormErrors as p, resolveCounterpartBankAccountWrite as m, validateCounterpartForm as h, withoutUnchangedContactErrors as g } from "./helpers.js";
7
7
  import { useCreateCounterpartMutation as _, useUpdateCounterpartMutation as te } from "../../../data-access/dist/index3.js";
8
- import { useCreateCounterpartBankAccountMutation as v, useUpdateCounterpartBankAccountMutation as y } from "../../../data-access/dist/index5.js";
9
- import { useCreateCounterpartAddressMutation as ne, useUpdateCounterpartAddressMutation as re } from "../../../data-access/dist/index7.js";
8
+ import { useCreateCounterpartBankAccountMutation as v, useUpdateCounterpartBankAccountMutation as y } from "../../../data-access/dist/index4.js";
9
+ import { useCreateCounterpartAddressMutation as ne, useUpdateCounterpartAddressMutation as re } from "../../../data-access/dist/index5.js";
10
10
  import "../../../data-access/dist/index.js";
11
11
  import { useCallback as b, useLayoutEffect as ie, useState as x } from "react";
12
12
  //#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartForm.js
@@ -6,7 +6,7 @@ import { toast as e } from "../../../../../../../packages/shared-ui-shadcn/dist/
6
6
  import { extractApiErrorMessage as t } from "../../../../util/dist/lib/apiErrors.js";
7
7
  import "../../../../ui/dist/index.js";
8
8
  import { useDeleteCounterpartMutation as n } from "../../../data-access/dist/index3.js";
9
- import { useDeleteCounterpartBankAccountMutation as r } from "../../../data-access/dist/index5.js";
9
+ import { useDeleteCounterpartBankAccountMutation as r } from "../../../data-access/dist/index4.js";
10
10
  import "../../../data-access/dist/index.js";
11
11
  import { useCallback as i, useState as a } from "react";
12
12
  //#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useDeleteController.js
@@ -3,7 +3,7 @@
3
3
  "use client";
4
4
  "use client";
5
5
  import { getPayableAchInstructions as e } from "./helpers.js";
6
- import { useCounterpartBankAccountsQuery as t } from "../../../data-access/dist/index5.js";
6
+ import { useCounterpartBankAccountsQuery as t } from "../../../data-access/dist/index4.js";
7
7
  import "../../../data-access/dist/index.js";
8
8
  //#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/usePayableAchInstructions.js
9
9
  function n({ counterpartId: n, currency: r, currentBankAccountId: i, enabled: a = !0 } = {}) {
@@ -5,10 +5,7 @@ import { EMPTY_ADDRESS_FORM_VALUES as r } from "./index6.js";
5
5
  import { CounterpartAddressFields as i } from "./index7.js";
6
6
  import "./index8.js";
7
7
  import { CounterpartFormFields as a, CounterpartFormSheet as o, countErrors as s, useFocusFirstInvalidField as c } from "./index10.js";
8
- import "./index11.js";
9
- import { BankAccountFormSheet as l } from "./index12.js";
10
- import "./index13.js";
11
- import "./index14.js";
12
- import { ConfirmDeleteDialog as u } from "./index15.js";
13
- import "./index16.js";
8
+ import { BankAccountFormSheet as l } from "./index11.js";
9
+ import "./index12.js";
10
+ import { ConfirmDeleteDialog as u } from "./index13.js";
14
11
  export { e as ACH_FIELD_GROUP_LABELS_EN, n as AchFieldGroup, l as BankAccountFormSheet, t as COUNTERPART_FORM_SHEET_LABELS_EN, u as ConfirmDeleteDialog, i as CounterpartAddressFields, a as CounterpartFormFields, o as CounterpartFormSheet, r as EMPTY_ADDRESS_FORM_VALUES, s as countErrors, c as useFocusFirstInvalidField };
@@ -1,7 +1,48 @@
1
- import "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import "./index2.js";
3
- import "./index4.js";
4
- import "./index6.js";
5
- import "./index9.js";
6
- import "react";
7
- import "react/jsx-runtime";
1
+ import { Typography as e } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { BANK_ACCOUNT_FORM_SHEET_LABELS_EN as t } from "./index2.js";
3
+ import { AchFieldGroup as n } from "./index5.js";
4
+ import { FormSheet as r } from "./index9.js";
5
+ import { useId as i } from "react";
6
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
7
+ //#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index11.js
8
+ function s({ open: s, onOpenChange: c, mode: l, values: u, errors: d, highlightedFields: f, inProgress: p, submitDisabled: m, onChange: h, onSubmit: g, onCancel: _, labels: v }) {
9
+ let y = {
10
+ ...t,
11
+ ...v,
12
+ fieldMarkers: {
13
+ ...t.fieldMarkers,
14
+ ...v?.fieldMarkers
15
+ }
16
+ }, b = i();
17
+ return /* @__PURE__ */ o(r, {
18
+ open: s,
19
+ onOpenChange: c,
20
+ title: l === "edit" ? y.editTitle : y.createTitle,
21
+ formError: d?.form,
22
+ inProgress: p,
23
+ submitDisabled: m,
24
+ submitLabel: y.saveButton,
25
+ cancelLabel: y.cancelButton,
26
+ onSubmit: g,
27
+ onCancel: _,
28
+ children: [/* @__PURE__ */ a(n, {
29
+ idPrefix: b,
30
+ values: u,
31
+ errors: d,
32
+ highlighted: f,
33
+ onChange: h,
34
+ labels: {
35
+ accountHolderName: y.accountHolderNameLabel,
36
+ routingNumber: y.routingNumberLabel,
37
+ accountNumber: y.accountNumberLabel,
38
+ fieldMarkers: y.fieldMarkers
39
+ }
40
+ }), /* @__PURE__ */ a(e, {
41
+ variant: "body2",
42
+ color: "muted",
43
+ children: y.helperText
44
+ })]
45
+ });
46
+ }
47
+ //#endregion
48
+ export { s as BankAccountFormSheet, s as default };