@tesouro/embedded-components-react 0.5.23 → 0.5.25

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 (40) hide show
  1. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js +2 -2
  2. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/data-access/dist/index10.js +25 -0
  3. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/data-access/dist/index2.js +24 -0
  4. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/data-access/dist/index3.js +13 -0
  5. package/dist/libs/tesouro-embedded-components-react/{tags-widget → settings-widget/tags}/data-access/dist/index4.js +6 -6
  6. package/dist/libs/tesouro-embedded-components-react/{tags-widget → settings-widget/tags}/data-access/dist/index5.js +6 -6
  7. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/data-access/dist/index6.js +33 -0
  8. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/data-access/dist/index7.js +19 -0
  9. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/data-access/dist/index8.js +22 -0
  10. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/data-access/dist/index9.js +26 -0
  11. package/dist/libs/tesouro-embedded-components-react/{tags-widget → settings-widget/tags}/feature/dist/index10.js +1 -1
  12. package/dist/libs/tesouro-embedded-components-react/{tags-widget → settings-widget/tags}/feature/dist/index11.js +4 -4
  13. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index2.js +5 -0
  14. package/dist/libs/tesouro-embedded-components-react/{tags-widget → settings-widget/tags}/feature/dist/index3.js +1 -1
  15. package/dist/libs/tesouro-embedded-components-react/{tags-widget → settings-widget/tags}/feature/dist/index4.js +1 -1
  16. package/dist/libs/tesouro-embedded-components-react/{tags-widget → settings-widget/tags}/feature/dist/index5.js +1 -1
  17. package/dist/libs/tesouro-embedded-components-react/{tags-widget → settings-widget/tags}/feature/dist/index6.js +1 -1
  18. package/dist/libs/tesouro-embedded-components-react/{tags-widget → settings-widget/tags}/feature/dist/index7.js +1 -1
  19. package/dist/libs/tesouro-embedded-components-react/{tags-widget → settings-widget/tags}/feature/dist/index8.js +2 -2
  20. package/dist/libs/tesouro-embedded-components-react/{tags-widget → settings-widget/tags}/feature/dist/index9.js +1 -1
  21. package/dist/libs/tesouro-embedded-components-react/{tags-widget → settings-widget/tags}/ui/dist/index2.js +1 -1
  22. package/dist/libs/tesouro-embedded-components-react/{tags-widget → settings-widget/tags}/ui/dist/index3.js +5 -5
  23. package/dist/libs/tesouro-embedded-components-react/{tags-widget → settings-widget/tags}/ui/dist/index4.js +2 -2
  24. package/dist/libs/tesouro-embedded-components-react/{tags-widget → settings-widget/tags}/ui/dist/index5.js +2 -2
  25. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +100 -99
  26. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/labels.js +1 -1
  27. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  28. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/lib/isValidAchAccountNumber.js +6 -0
  29. package/package.json +1 -1
  30. package/dist/libs/tesouro-embedded-components-react/tags-widget/data-access/dist/index10.js +0 -25
  31. package/dist/libs/tesouro-embedded-components-react/tags-widget/data-access/dist/index2.js +0 -24
  32. package/dist/libs/tesouro-embedded-components-react/tags-widget/data-access/dist/index3.js +0 -13
  33. package/dist/libs/tesouro-embedded-components-react/tags-widget/data-access/dist/index6.js +0 -33
  34. package/dist/libs/tesouro-embedded-components-react/tags-widget/data-access/dist/index7.js +0 -19
  35. package/dist/libs/tesouro-embedded-components-react/tags-widget/data-access/dist/index8.js +0 -22
  36. package/dist/libs/tesouro-embedded-components-react/tags-widget/data-access/dist/index9.js +0 -26
  37. package/dist/libs/tesouro-embedded-components-react/tags-widget/feature/dist/index2.js +0 -4
  38. /package/dist/libs/tesouro-embedded-components-react/{tags-widget → settings-widget/tags}/data-access/dist/index.js +0 -0
  39. /package/dist/libs/tesouro-embedded-components-react/{tags-widget → settings-widget/tags}/feature/dist/index.js +0 -0
  40. /package/dist/libs/tesouro-embedded-components-react/{tags-widget → settings-widget/tags}/ui/dist/index.js +0 -0
@@ -17,8 +17,8 @@ import { DEFAULT_FEATURE_LABELS as s } from "./index3.js";
17
17
  import { SettingsSection as c, mergeAdditionalSections as l } from "./index4.js";
18
18
  import { SettingsWidgetAnalyticsEvent as u, WIDGET_NAME as d } from "./index2.js";
19
19
  import { ExpenseSettingsTabs as f } from "./index5.js";
20
- import { TagsWidget as p } from "../../../tags-widget/feature/dist/index11.js";
21
- import "../../../tags-widget/feature/dist/index.js";
20
+ import { TagsWidget as p } from "../../tags/feature/dist/index11.js";
21
+ import "../../tags/feature/dist/index.js";
22
22
  import { BankDisclosuresWidget as m } from "../../../shared/bank-disclosures/feature/dist/lib/BankDisclosuresWidget/BankDisclosuresWidget.js";
23
23
  import "../../../shared/bank-disclosures/feature/dist/index.js";
24
24
  import { TeamWidget as h } from "../../team/feature/dist/index17.js";
@@ -0,0 +1,25 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { useEmbedApi as e } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
6
+ import { organizationHeaders as t } from "../../../../shared/data-access/dist/lib/organizationHeaders.js";
7
+ import { getEntityUsersOptions as n } from "../../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
8
+ import { withAuthEpoch as r } from "../../../../shared/data-access/dist/lib/withAuthEpoch.js";
9
+ import "../../../../shared/data-access/dist/index.js";
10
+ import { useQuery as i } from "@tanstack/react-query";
11
+ //#region ../../libs/tesouro-embedded-components-react/settings-widget/tags/data-access/dist/index10.js
12
+ var a = 100;
13
+ function o(o = a) {
14
+ let { client: s, organizationId: c, widgetToken: l, authEpoch: u } = e(), d = !!(c && l), f = n({
15
+ query: { limit: o },
16
+ client: s,
17
+ headers: t(c)
18
+ });
19
+ return i({
20
+ ...r(f, u),
21
+ enabled: d
22
+ });
23
+ }
24
+ //#endregion
25
+ export { o as useEntityUsersQuery };
@@ -0,0 +1,24 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { useEmbedApi as e } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
6
+ import { organizationHeaders as t } from "../../../../shared/data-access/dist/lib/organizationHeaders.js";
7
+ import { getTagsOptions as n } from "../../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
8
+ import { withAuthEpoch as r } from "../../../../shared/data-access/dist/lib/withAuthEpoch.js";
9
+ import "../../../../shared/data-access/dist/index.js";
10
+ import { useQuery as i } from "@tanstack/react-query";
11
+ //#region ../../libs/tesouro-embedded-components-react/settings-widget/tags/data-access/dist/index2.js
12
+ function a({ enabled: a, ...o } = {}) {
13
+ let { client: s, organizationId: c, widgetToken: l, authEpoch: u } = e(), d = !!(c && l) && (a === !0 || a === void 0), f = n({
14
+ query: o,
15
+ client: s,
16
+ headers: t(c)
17
+ });
18
+ return i({
19
+ ...r(f, u),
20
+ enabled: d
21
+ });
22
+ }
23
+ //#endregion
24
+ export { a as useTagsQuery };
@@ -0,0 +1,13 @@
1
+ import { organizationHeaders as e } from "../../../../shared/data-access/dist/lib/organizationHeaders.js";
2
+ import { getEntitiesIdSettingsQueryKey as t, getTagsQueryKey as n } from "../../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
3
+ import "../../../../shared/data-access/dist/index.js";
4
+ //#region ../../libs/tesouro-embedded-components-react/settings-widget/tags/data-access/dist/index3.js
5
+ var r = ({ client: t, organizationId: r }) => n({
6
+ client: t,
7
+ headers: e(r)
8
+ }), i = ({ client: e, entityId: n }) => t({
9
+ client: e,
10
+ path: { entity_id: n }
11
+ });
12
+ //#endregion
13
+ export { i as entitySettingsInvalidationKey, r as tagsInvalidationKey };
@@ -2,14 +2,14 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { invalidateAllClients as e } from "../../../shared/data-access/dist/lib/clientRegistry.js";
6
- import { useEmbedApi as t } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
7
- import { organizationHeaders as n } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
8
- import { postTags as r } from "../../../shared/data-access/dist/lib/rest/sdk.gen.js";
9
- import "../../../shared/data-access/dist/index.js";
5
+ import { invalidateAllClients as e } from "../../../../shared/data-access/dist/lib/clientRegistry.js";
6
+ import { useEmbedApi as t } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
7
+ import { organizationHeaders as n } from "../../../../shared/data-access/dist/lib/organizationHeaders.js";
8
+ import { postTags as r } from "../../../../shared/data-access/dist/lib/rest/sdk.gen.js";
9
+ import "../../../../shared/data-access/dist/index.js";
10
10
  import { tagsInvalidationKey as i } from "./index3.js";
11
11
  import { useMutation as a } from "@tanstack/react-query";
12
- //#region ../../libs/tesouro-embedded-components-react/tags-widget/data-access/dist/index4.js
12
+ //#region ../../libs/tesouro-embedded-components-react/settings-widget/tags/data-access/dist/index4.js
13
13
  function o() {
14
14
  let { client: o, organizationId: s } = t();
15
15
  return a({
@@ -2,14 +2,14 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { invalidateAllClients as e } from "../../../shared/data-access/dist/lib/clientRegistry.js";
6
- import { useEmbedApi as t } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
7
- import { organizationHeaders as n } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
8
- import { patchTagsId as r } from "../../../shared/data-access/dist/lib/rest/sdk.gen.js";
9
- import "../../../shared/data-access/dist/index.js";
5
+ import { invalidateAllClients as e } from "../../../../shared/data-access/dist/lib/clientRegistry.js";
6
+ import { useEmbedApi as t } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
7
+ import { organizationHeaders as n } from "../../../../shared/data-access/dist/lib/organizationHeaders.js";
8
+ import { patchTagsId as r } from "../../../../shared/data-access/dist/lib/rest/sdk.gen.js";
9
+ import "../../../../shared/data-access/dist/index.js";
10
10
  import { tagsInvalidationKey as i } from "./index3.js";
11
11
  import { useMutation as a } from "@tanstack/react-query";
12
- //#region ../../libs/tesouro-embedded-components-react/tags-widget/data-access/dist/index5.js
12
+ //#region ../../libs/tesouro-embedded-components-react/settings-widget/tags/data-access/dist/index5.js
13
13
  function o() {
14
14
  let { client: o, organizationId: s } = t();
15
15
  return a({
@@ -0,0 +1,33 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { invalidateAllClients as e } from "../../../../shared/data-access/dist/lib/clientRegistry.js";
6
+ import { useEmbedApi as t } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
7
+ import { organizationHeaders as n } from "../../../../shared/data-access/dist/lib/organizationHeaders.js";
8
+ import { deleteTagsId as r } from "../../../../shared/data-access/dist/lib/rest/sdk.gen.js";
9
+ import "../../../../shared/data-access/dist/index.js";
10
+ import { tagsInvalidationKey as i } from "./index3.js";
11
+ import { useMutation as a } from "@tanstack/react-query";
12
+ //#region ../../libs/tesouro-embedded-components-react/settings-widget/tags/data-access/dist/index6.js
13
+ function o() {
14
+ let { client: o, organizationId: s } = t();
15
+ return a({
16
+ mutationFn: async ({ path: e }) => {
17
+ await r({
18
+ client: o,
19
+ headers: n(s),
20
+ path: e,
21
+ throwOnError: !0
22
+ });
23
+ },
24
+ onSuccess: async () => {
25
+ await e(i({
26
+ client: o,
27
+ organizationId: s
28
+ }));
29
+ }
30
+ });
31
+ }
32
+ //#endregion
33
+ export { o as useDeleteTagMutation };
@@ -0,0 +1,19 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { useEmbedApi as e } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
6
+ import { getEntitiesMeOptions as t } from "../../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
7
+ import { withAuthEpoch as n } from "../../../../shared/data-access/dist/lib/withAuthEpoch.js";
8
+ import "../../../../shared/data-access/dist/index.js";
9
+ import { useQuery as r } from "@tanstack/react-query";
10
+ //#region ../../libs/tesouro-embedded-components-react/settings-widget/tags/data-access/dist/index7.js
11
+ function i() {
12
+ let { client: i, organizationId: a, widgetToken: o, authEpoch: s } = e(), c = !!(a && o), l = t({ client: i });
13
+ return r({
14
+ ...n(l, s),
15
+ enabled: c
16
+ });
17
+ }
18
+ //#endregion
19
+ export { i as useMyEntityQuery };
@@ -0,0 +1,22 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { useEmbedApi as e } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
6
+ import { getEntitiesIdSettingsOptions as t } from "../../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
7
+ import { withAuthEpoch as n } from "../../../../shared/data-access/dist/lib/withAuthEpoch.js";
8
+ import "../../../../shared/data-access/dist/index.js";
9
+ import { useQuery as r } from "@tanstack/react-query";
10
+ //#region ../../libs/tesouro-embedded-components-react/settings-widget/tags/data-access/dist/index8.js
11
+ function i(i) {
12
+ let { client: a, organizationId: o, widgetToken: s, authEpoch: c } = e(), l = !!(o && s && i), u = t({
13
+ client: a,
14
+ path: { entity_id: i ?? "" }
15
+ });
16
+ return r({
17
+ ...n(u, c),
18
+ enabled: l
19
+ });
20
+ }
21
+ //#endregion
22
+ export { i as useEntitySettingsQuery };
@@ -0,0 +1,26 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { invalidateAllClients as e } from "../../../../shared/data-access/dist/lib/clientRegistry.js";
6
+ import { useEmbedApi as t } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
7
+ import { patchEntitiesIdSettingsMutation as n } from "../../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
8
+ import "../../../../shared/data-access/dist/index.js";
9
+ import { entitySettingsInvalidationKey as r } from "./index3.js";
10
+ import { useMutation as i } from "@tanstack/react-query";
11
+ //#region ../../libs/tesouro-embedded-components-react/settings-widget/tags/data-access/dist/index9.js
12
+ function a() {
13
+ let { client: a } = t();
14
+ return i({
15
+ ...n({ client: a }),
16
+ onSuccess: async (t, n) => {
17
+ let i = n?.path?.entity_id;
18
+ i && await e(r({
19
+ client: a,
20
+ entityId: i
21
+ }));
22
+ }
23
+ });
24
+ }
25
+ //#endregion
26
+ export { a as useUpdateEntitySettingsMutation };
@@ -9,7 +9,7 @@ import { useTagDelete as r } from "./index7.js";
9
9
  import { useTagForm as i } from "./index8.js";
10
10
  import { useTagsTable as a } from "./index9.js";
11
11
  import { useCallback as o, useMemo as s, useState as c } from "react";
12
- //#region ../../libs/tesouro-embedded-components-react/tags-widget/feature/dist/index10.js
12
+ //#region ../../libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index10.js
13
13
  function l({ messageLabels: l }) {
14
14
  let u = s(() => ({
15
15
  ...e,
@@ -2,9 +2,9 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { useAnalyticsTrack as e } from "../../../shared/feature/dist/lib/analytics/hooks.js";
6
- import { WidgetProvider as t } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
7
- import "../../../shared/feature/dist/index.js";
5
+ import { useAnalyticsTrack as e } from "../../../../shared/feature/dist/lib/analytics/hooks.js";
6
+ import { WidgetProvider as t } from "../../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
7
+ import "../../../../shared/feature/dist/index.js";
8
8
  import { TagsWidgetAnalyticsEvent as n, WIDGET_NAME as r } from "./index2.js";
9
9
  import { PAGE_SIZE_OPTIONS as i } from "./index3.js";
10
10
  import { useTagsWidget as a } from "./index10.js";
@@ -14,7 +14,7 @@ import { TagDeleteDialog as c } from "../../ui/dist/index5.js";
14
14
  import "../../ui/dist/index.js";
15
15
  import { useEffect as l } from "react";
16
16
  import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
17
- //#region ../../libs/tesouro-embedded-components-react/tags-widget/feature/dist/index11.js
17
+ //#region ../../libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index11.js
18
18
  function p({ pageSizeOptions: t = i, screenLabels: r, formLabels: p, deleteLabels: m, messageLabels: h }) {
19
19
  let g = e();
20
20
  l(() => {
@@ -0,0 +1,5 @@
1
+ import { SETTINGS_WIDGET_NAME as e } from "../../../shared/util/dist/lib/widgetName.js";
2
+ //#region ../../libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index2.js
3
+ var t = `${e}.tags`, n = { Mounted: `${t}.mounted` };
4
+ //#endregion
5
+ export { n as TagsWidgetAnalyticsEvent, t as WIDGET_NAME };
@@ -1,4 +1,4 @@
1
- //#region ../../libs/tesouro-embedded-components-react/tags-widget/feature/dist/index3.js
1
+ //#region ../../libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index3.js
2
2
  var e = [
3
3
  10,
4
4
  25,
@@ -1,4 +1,4 @@
1
- //#region ../../libs/tesouro-embedded-components-react/tags-widget/feature/dist/index4.js
1
+ //#region ../../libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index4.js
2
2
  var e = {
3
3
  nameRequired: "Required",
4
4
  nameTooLong: "Value must be at most '255' characters",
@@ -1,5 +1,5 @@
1
1
  import { TAG_MESSAGE_LABELS_EN as e } from "./index4.js";
2
- //#region ../../libs/tesouro-embedded-components-react/tags-widget/feature/dist/index5.js
2
+ //#region ../../libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index5.js
3
3
  var t = [
4
4
  "document_type",
5
5
  "department",
@@ -8,7 +8,7 @@ import { useEntitySettingsQuery as r } from "../../data-access/dist/index8.js";
8
8
  import { useEntityUsersQuery as i } from "../../data-access/dist/index10.js";
9
9
  import "../../data-access/dist/index.js";
10
10
  import { useCallback as a, useMemo as o } from "react";
11
- //#region ../../libs/tesouro-embedded-components-react/tags-widget/feature/dist/index6.js
11
+ //#region ../../libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index6.js
12
12
  function s({ messages: s }) {
13
13
  let c = n().data?.id, l = r(c), u = i(), d = o(() => e(l.data?.payables_ocr_auto_tagging), [l.data]), f = o(() => t(u.data?.data), [u.data]), p = a(async () => (await l.refetch()).data ?? l.data, [l]), m = a(async () => {
14
14
  let e = await p();
@@ -7,7 +7,7 @@ import { useDeleteTagMutation as t } from "../../data-access/dist/index6.js";
7
7
  import { useUpdateEntitySettingsMutation as n } from "../../data-access/dist/index9.js";
8
8
  import "../../data-access/dist/index.js";
9
9
  import { useCallback as r, useState as i } from "react";
10
- //#region ../../libs/tesouro-embedded-components-react/tags-widget/feature/dist/index7.js
10
+ //#region ../../libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index7.js
11
11
  function a({ selectedTag: a, setSelectedTag: o, settings: s }) {
12
12
  let { entityId: c, requireFreshSettings: l } = s, u = t(), d = n(), [f, p] = i(!1), m = r((e) => {
13
13
  o(e), p(!0);
@@ -2,7 +2,7 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { extractApiErrorMessage as e } from "../../../shared/util/dist/lib/apiErrors.js";
5
+ import { extractApiErrorMessage as e } from "../../../../shared/util/dist/lib/apiErrors.js";
6
6
  import { EMPTY_FORM_VALUES as t } from "./index3.js";
7
7
  import { buildKeywordsByTagId as n, computeNextOcrAutoTagging as r, getCategoryOptions as i, hasFormErrors as a, isDuplicateTagNameError as o, validateTagForm as s } from "./index5.js";
8
8
  import { useCreateTagMutation as c } from "../../data-access/dist/index4.js";
@@ -10,7 +10,7 @@ import { useUpdateTagMutation as l } from "../../data-access/dist/index5.js";
10
10
  import { useUpdateEntitySettingsMutation as u } from "../../data-access/dist/index9.js";
11
11
  import "../../data-access/dist/index.js";
12
12
  import { useCallback as d, useMemo as f, useState as p } from "react";
13
- //#region ../../libs/tesouro-embedded-components-react/tags-widget/feature/dist/index8.js
13
+ //#region ../../libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index8.js
14
14
  function m({ selectedTag: m, setSelectedTag: h, settings: g, messages: _ }) {
15
15
  let { entityId: v, settingsData: y, refetchSettings: b, requireFreshSettings: x } = g, S = c(), C = l(), w = u(), [T, E] = p(!1), [D, O] = p("create"), [k, A] = p(t), [j, M] = p({});
16
16
  return {
@@ -6,7 +6,7 @@ import { buildTagRows as e, sortFieldForColumn as t } from "./index5.js";
6
6
  import { useTagsQuery as n } from "../../data-access/dist/index2.js";
7
7
  import "../../data-access/dist/index.js";
8
8
  import { useCallback as r, useMemo as i, useState as a } from "react";
9
- //#region ../../libs/tesouro-embedded-components-react/tags-widget/feature/dist/index9.js
9
+ //#region ../../libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index9.js
10
10
  function o({ keywordsByTagId: o, userNamesById: s }) {
11
11
  let [c, l] = a([{
12
12
  id: "createdAtLabel",
@@ -1,4 +1,4 @@
1
- //#region ../../libs/tesouro-embedded-components-react/tags-widget/ui/dist/index2.js
1
+ //#region ../../libs/tesouro-embedded-components-react/settings-widget/tags/ui/dist/index2.js
2
2
  var e = {
3
3
  createButton: "Create",
4
4
  columnName: "Name",
@@ -1,11 +1,11 @@
1
- import { Button as e, DataTable as t, DropdownMenu as n, DropdownMenuContent as r, DropdownMenuItem as i, DropdownMenuTrigger as a } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { EmptyState as o } from "../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
3
- import { ErrorState as s } from "../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
4
- import "../../../shared/ui/dist/index.js";
1
+ import { Button as e, DataTable as t, DropdownMenu as n, DropdownMenuContent as r, DropdownMenuItem as i, DropdownMenuTrigger as a } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { EmptyState as o } from "../../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
3
+ import { ErrorState as s } from "../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
4
+ import "../../../../shared/ui/dist/index.js";
5
5
  import { TAGS_SCREEN_LABELS_EN as c } from "./index2.js";
6
6
  import { jsx as l, jsxs as u } from "react/jsx-runtime";
7
7
  import { ArrowDownIcon as d, ArrowUpDownIcon as f, ArrowUpIcon as p, MoreVerticalIcon as m, PlusIcon as h, Trash2Icon as g } from "lucide-react";
8
- //#region ../../libs/tesouro-embedded-components-react/tags-widget/ui/dist/index3.js
8
+ //#region ../../libs/tesouro-embedded-components-react/settings-widget/tags/ui/dist/index3.js
9
9
  var _ = [
10
10
  10,
11
11
  25,
@@ -1,8 +1,8 @@
1
- import { Button as e, Input as t, InputTags as n, Label as r, Select as i, SelectContent as a, SelectItem as o, SelectTrigger as s, SelectValue as c, Sheet as l, SheetContent as u, SheetDescription as d, SheetFooter as f, SheetHeader as p, SheetTitle as m } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
1
+ import { Button as e, Input as t, InputTags as n, Label as r, Select as i, SelectContent as a, SelectItem as o, SelectTrigger as s, SelectValue as c, Sheet as l, SheetContent as u, SheetDescription as d, SheetFooter as f, SheetHeader as p, SheetTitle as m } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
2
  import { TAG_FORM_SHEET_LABELS_EN as h } from "./index2.js";
3
3
  import { useId as g } from "react";
4
4
  import { jsx as _, jsxs as v } from "react/jsx-runtime";
5
- //#region ../../libs/tesouro-embedded-components-react/tags-widget/ui/dist/index4.js
5
+ //#region ../../libs/tesouro-embedded-components-react/settings-widget/tags/ui/dist/index4.js
6
6
  function y({ open: y, onOpenChange: b, mode: x, values: S, errors: C, categoryOptions: w, tagName: T, inProgress: E, showDelete: D, onNameChange: O, onCategoryChange: k, onKeywordsChange: A, onKeywordsInputChange: j, onSubmit: M, onCancel: N, onDelete: P, labels: F }) {
7
7
  let I = {
8
8
  ...h,
@@ -1,7 +1,7 @@
1
- import { AlertDialog as e, AlertDialogContent as t, AlertDialogDescription as n, AlertDialogFooter as r, AlertDialogHeader as i, AlertDialogTitle as a, Button as o } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
1
+ import { AlertDialog as e, AlertDialogContent as t, AlertDialogDescription as n, AlertDialogFooter as r, AlertDialogHeader as i, AlertDialogTitle as a, Button as o } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
2
  import { TAG_DELETE_DIALOG_LABELS_EN as s } from "./index2.js";
3
3
  import { jsx as c, jsxs as l } from "react/jsx-runtime";
4
- //#region ../../libs/tesouro-embedded-components-react/tags-widget/ui/dist/index5.js
4
+ //#region ../../libs/tesouro-embedded-components-react/settings-widget/tags/ui/dist/index5.js
5
5
  function u({ open: u, onOpenChange: d, tagName: f, isDeleting: p, onConfirm: m, onCancel: h, labels: g }) {
6
6
  let _ = {
7
7
  ...s,
@@ -1,9 +1,10 @@
1
1
  import { formatMoneyExact as e } from "../../../../util/dist/lib/formatMoneyExact.js";
2
- import { EMPTY_ADDRESS_FORM_VALUES as t } from "../../../ui/dist/index6.js";
2
+ import { isValidAchAccountNumber as t } from "../../../../util/dist/lib/isValidAchAccountNumber.js";
3
+ import { EMPTY_ADDRESS_FORM_VALUES as n } from "../../../ui/dist/index6.js";
3
4
  import "../../../ui/dist/index.js";
4
- import { COUNTERPART_MESSAGE_LABELS_EN as n } from "./labels.js";
5
+ import { COUNTERPART_MESSAGE_LABELS_EN as r } from "./labels.js";
5
6
  //#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js
6
- var r = [
7
+ var i = [
7
8
  "USD",
8
9
  "EUR",
9
10
  "GBP",
@@ -17,13 +18,13 @@ var r = [
17
18
  "MXN",
18
19
  "SGD"
19
20
  ];
20
- function i(e) {
21
- return Array.from(/* @__PURE__ */ new Set([...r, ...e ? [e] : []])).sort().map((e) => ({
21
+ function a(e) {
22
+ return Array.from(/* @__PURE__ */ new Set([...i, ...e ? [e] : []])).sort().map((e) => ({
22
23
  value: e,
23
24
  label: e
24
25
  }));
25
26
  }
26
- function a(e) {
27
+ function o(e) {
27
28
  try {
28
29
  return new Intl.NumberFormat("en-US", {
29
30
  style: "currency",
@@ -33,56 +34,56 @@ function a(e) {
33
34
  return 2;
34
35
  }
35
36
  }
36
- function o(e, t) {
37
- return e / 10 ** a(t);
37
+ function s(e, t) {
38
+ return e / 10 ** o(t);
38
39
  }
39
- function s(t, n = "USD") {
40
- return e(o(t, n), { currencyCode: n });
40
+ function c(t, n = "USD") {
41
+ return e(s(t, n), { currencyCode: n });
41
42
  }
42
- var c = new Intl.DateTimeFormat(void 0, {
43
+ var l = new Intl.DateTimeFormat(void 0, {
43
44
  year: "numeric",
44
45
  month: "short",
45
46
  day: "numeric"
46
47
  });
47
- function l(e) {
48
+ function u(e) {
48
49
  if (!e) return "";
49
50
  let t = new Date(e);
50
- return Number.isNaN(t.getTime()) ? "" : c.format(t);
51
+ return Number.isNaN(t.getTime()) ? "" : l.format(t);
51
52
  }
52
- function u(e) {
53
+ function d(e) {
53
54
  if ("organization" in e) return e.organization.legal_name;
54
55
  let { first_name: t, last_name: n } = e.individual;
55
56
  return [t, n].filter(Boolean).join(" ").trim();
56
57
  }
57
- function d(e) {
58
+ function f(e) {
58
59
  return "organization" in e ? e.organization.email ?? "" : e.individual.email ?? "";
59
60
  }
60
- function f(e) {
61
+ function p(e) {
61
62
  return "organization" in e ? e.organization.phone ?? "" : e.individual.phone ?? "";
62
63
  }
63
- function p(e) {
64
+ function m(e) {
64
65
  let t = /* @__PURE__ */ new Map();
65
66
  for (let n of e ?? []) n.dimension_value && t.set(n.dimension_value, Math.round(n.metric_value));
66
67
  return t;
67
68
  }
68
- function m({ counterparts: e, addresses: t, billedAmounts: n, dueOrOwedAmounts: r, isBilledAmountLoading: i = !1, isDueOrOwedAmountLoading: a = !1 }) {
69
+ function h({ counterparts: e, addresses: t, billedAmounts: n, dueOrOwedAmounts: r, isBilledAmountLoading: i = !1, isDueOrOwedAmountLoading: a = !1 }) {
69
70
  return e.map((e) => {
70
- let o = n?.get(e.id) ?? 0, c = r?.get(e.id) ?? 0, l = o - c, d = i || a;
71
+ let o = n?.get(e.id) ?? 0, s = r?.get(e.id) ?? 0, l = o - s, u = i || a;
71
72
  return {
72
73
  id: e.id,
73
- name: u(e),
74
+ name: d(e),
74
75
  entityType: e.type,
75
- locationLabel: g(t?.get(e.id)),
76
- billedAmountLabel: n && !i ? s(o) : "",
77
- receivedOrPaidAmountLabel: n && r && !d ? s(l) : "",
78
- dueOrOwedAmountLabel: r && !a ? s(c) : "",
76
+ locationLabel: _(t?.get(e.id)),
77
+ billedAmountLabel: n && !i ? c(o) : "",
78
+ receivedOrPaidAmountLabel: n && r && !u ? c(l) : "",
79
+ dueOrOwedAmountLabel: r && !a ? c(s) : "",
79
80
  isBilledAmountLoading: i,
80
- isReceivedOrPaidAmountLoading: d,
81
+ isReceivedOrPaidAmountLoading: u,
81
82
  isDueOrOwedAmountLoading: a
82
83
  };
83
84
  });
84
85
  }
85
- function h(e) {
86
+ function g(e) {
86
87
  if (!e) return [];
87
88
  let t = [
88
89
  e.city,
@@ -96,27 +97,27 @@ function h(e) {
96
97
  e.country
97
98
  ].filter((e) => !!(e && e.trim()));
98
99
  }
99
- function g(e) {
100
+ function _(e) {
100
101
  return e ? [e.city, e.country].filter(Boolean).join(", ") : "";
101
102
  }
102
- function _({ counterpart: e, primaryAddress: t }) {
103
+ function v({ counterpart: e, primaryAddress: t }) {
103
104
  return {
104
- name: u(e),
105
+ name: d(e),
105
106
  entityType: e.type,
106
- email: d(e),
107
- phone: f(e),
107
+ email: f(e),
108
+ phone: p(e),
108
109
  taxId: e.tax_id ?? "",
109
- addressLines: h(t),
110
- createdAtLabel: l(e.created_at),
111
- updatedAtLabel: l(e.updated_at)
110
+ addressLines: g(t),
111
+ createdAtLabel: u(e.created_at),
112
+ updatedAtLabel: u(e.updated_at)
112
113
  };
113
114
  }
114
- function v(e) {
115
+ function y(e) {
115
116
  if (e) return `•••• ${e.slice(-4)}`;
116
117
  }
117
- function y(e) {
118
+ function b(e) {
118
119
  return (e ?? []).map((e) => {
119
- let t = v(e.iban || e.account_number || void 0), n = [e.currency, t].filter(Boolean).join(" · ");
120
+ let t = y(e.iban || e.account_number || void 0), n = [e.currency, t].filter(Boolean).join(" · ");
120
121
  return {
121
122
  id: e.id,
122
123
  primary: e.name || e.account_holder_name || e.currency,
@@ -125,17 +126,17 @@ function y(e) {
125
126
  };
126
127
  });
127
128
  }
128
- function b(e) {
129
+ function x(e) {
129
130
  let t = (e ?? []).filter((e) => e.currency === "USD" && (!!e.routing_number || !!e.account_number));
130
131
  return t.find((e) => e.is_default_for_currency) ?? t[0];
131
132
  }
132
- function x(e, t = "USD", n) {
133
- let r = n && (e ?? []).find((e) => e.id === n && R(e));
133
+ function S(e, t = "USD", n) {
134
+ let r = n && (e ?? []).find((e) => e.id === n && z(e));
134
135
  if (r) return r;
135
136
  let i = (e ?? []).filter((e) => e.currency === t && !!e.account_holder_name && !!e.routing_number && !!e.account_number);
136
137
  return i.find((e) => e.is_default_for_currency) ?? i[0];
137
138
  }
138
- function S(e, t = {}) {
139
+ function C(e, t = {}) {
139
140
  let n = e.line2.trim();
140
141
  return {
141
142
  line1: e.line1.trim(),
@@ -146,7 +147,7 @@ function S(e, t = {}) {
146
147
  country: "US"
147
148
  };
148
149
  }
149
- function C(e) {
150
+ function w(e) {
150
151
  return {
151
152
  line1: e.line1 ?? "",
152
153
  line2: e.line2 ?? "",
@@ -155,10 +156,10 @@ function C(e) {
155
156
  postalCode: e.postal_code ?? ""
156
157
  };
157
158
  }
158
- function w(e) {
159
- return S(e);
160
- }
161
159
  function T(e) {
160
+ return C(e);
161
+ }
162
+ function E(e) {
162
163
  return {
163
164
  line1: e.line1.trim(),
164
165
  line2: e.line2.trim(),
@@ -168,7 +169,7 @@ function T(e) {
168
169
  country: "US"
169
170
  };
170
171
  }
171
- function E(e = "organization", n) {
172
+ function D(e = "organization", t) {
172
173
  return {
173
174
  entityType: e,
174
175
  legalName: "",
@@ -178,8 +179,8 @@ function E(e = "organization", n) {
178
179
  email: "",
179
180
  phone: "",
180
181
  taxId: "",
181
- remindersEnabled: n === "customer",
182
- address: { ...t },
182
+ remindersEnabled: t === "customer",
183
+ address: { ...n },
183
184
  bankAccount: {
184
185
  accountHolderName: "",
185
186
  routingNumber: "",
@@ -187,11 +188,11 @@ function E(e = "organization", n) {
187
188
  }
188
189
  };
189
190
  }
190
- function D(e, t) {
191
- let n = E(e.type);
192
- return n.email = d(e), n.phone = f(e), n.taxId = e.tax_id ?? "", n.remindersEnabled = !!e.reminders_enabled, t && (n.address = C(t)), "organization" in e ? n.legalName = e.organization.legal_name : (n.firstName = e.individual.first_name, n.lastName = e.individual.last_name), n;
191
+ function O(e, t) {
192
+ let n = D(e.type);
193
+ return n.email = f(e), n.phone = p(e), n.taxId = e.tax_id ?? "", n.remindersEnabled = !!e.reminders_enabled, t && (n.address = w(t)), "organization" in e ? n.legalName = e.organization.legal_name : (n.firstName = e.individual.first_name, n.lastName = e.individual.last_name), n;
193
194
  }
194
- function O(e) {
195
+ function k(e) {
195
196
  return [
196
197
  e.line1,
197
198
  e.line2,
@@ -200,11 +201,11 @@ function O(e) {
200
201
  e.postalCode
201
202
  ].some((e) => e.trim().length > 0);
202
203
  }
203
- function k(e) {
204
- return O(e) ? S(e) : void 0;
204
+ function A(e) {
205
+ return k(e) ? C(e) : void 0;
205
206
  }
206
- function A(e, t) {
207
- let n = t === "customer", r = t === "vendor", i = k(e.address), a = e.taxId.trim() || void 0, o = e.email.trim(), s = e.phone.trim() || void 0, c = {
207
+ function j(e, t) {
208
+ let n = t === "customer", r = t === "vendor", i = A(e.address), a = e.taxId.trim() || void 0, o = e.email.trim(), s = e.phone.trim() || void 0, c = {
208
209
  is_customer: n,
209
210
  is_vendor: r,
210
211
  language: "en",
@@ -233,7 +234,7 @@ function A(e, t) {
233
234
  }
234
235
  };
235
236
  }
236
- function j(e, t) {
237
+ function M(e, t) {
237
238
  let n = e.taxId.trim(), r = e.email.trim(), i = e.phone.trim(), a = {
238
239
  language: "en",
239
240
  reminders_enabled: t === "customer" ? e.remindersEnabled : void 0,
@@ -257,20 +258,20 @@ function j(e, t) {
257
258
  }
258
259
  };
259
260
  }
260
- function M(e) {
261
- return O(e.address);
262
- }
263
261
  function N(e) {
262
+ return k(e.address);
263
+ }
264
+ function P(e) {
264
265
  return [
265
266
  e.accountHolderName,
266
267
  e.routingNumber,
267
268
  e.accountNumber
268
269
  ].some((e) => e.trim().length > 0);
269
270
  }
270
- function P(e) {
271
- return N(e.bankAccount);
271
+ function F(e) {
272
+ return P(e.bankAccount);
272
273
  }
273
- function F(e, t = {}) {
274
+ function I(e, t = {}) {
274
275
  return {
275
276
  account_holder_name: e.accountHolderName.trim() || void 0,
276
277
  account_number: e.accountNumber.trim() || void 0,
@@ -280,7 +281,7 @@ function F(e, t = {}) {
280
281
  is_default_for_currency: t.isDefaultForCurrency ?? !0
281
282
  };
282
283
  }
283
- function I(e, t = {}) {
284
+ function L(e, t = {}) {
284
285
  return {
285
286
  account_holder_name: e.accountHolderName.trim() || void 0,
286
287
  account_number: e.accountNumber.trim() || void 0,
@@ -291,7 +292,7 @@ function I(e, t = {}) {
291
292
  } : {}
292
293
  };
293
294
  }
294
- function L(e) {
295
+ function R(e) {
295
296
  return [
296
297
  e.account_number,
297
298
  e.iban,
@@ -300,19 +301,19 @@ function L(e) {
300
301
  e.bic
301
302
  ].every((e) => !e);
302
303
  }
303
- function R(e) {
304
- return !!(L(e) || e.currency === "USD" && (e.routing_number || e.account_number));
304
+ function z(e) {
305
+ return !!(R(e) || e.currency === "USD" && (e.routing_number || e.account_number));
305
306
  }
306
- function z(e, t) {
307
+ function B(e, t) {
307
308
  if (t) {
308
309
  let n = e?.find((e) => e.id === t);
309
310
  return {
310
311
  kind: "update",
311
312
  bankAccountId: t,
312
- includeAchDefaults: n ? L(n) : !1
313
+ includeAchDefaults: n ? R(n) : !1
313
314
  };
314
315
  }
315
- let n = e?.find(L);
316
+ let n = e?.find(R);
316
317
  return n ? {
317
318
  kind: "update",
318
319
  bankAccountId: n.id,
@@ -322,7 +323,7 @@ function z(e, t) {
322
323
  isDefaultForCurrency: !(e ?? []).some((e) => e.currency === "USD" && e.is_default_for_currency)
323
324
  };
324
325
  }
325
- function B() {
326
+ function V() {
326
327
  return {
327
328
  name: "",
328
329
  accountHolderName: "",
@@ -335,7 +336,7 @@ function B() {
335
336
  isDefault: !1
336
337
  };
337
338
  }
338
- function V(e) {
339
+ function H(e) {
339
340
  return {
340
341
  name: e.name ?? "",
341
342
  accountHolderName: e.account_holder_name ?? "",
@@ -348,7 +349,7 @@ function V(e) {
348
349
  isDefault: e.is_default_for_currency ?? !1
349
350
  };
350
351
  }
351
- function H(e) {
352
+ function U(e) {
352
353
  return {
353
354
  name: e.name.trim() || void 0,
354
355
  account_holder_name: e.accountHolderName.trim() || void 0,
@@ -362,7 +363,7 @@ function H(e) {
362
363
  is_default_for_currency: e.isDefault
363
364
  };
364
365
  }
365
- function U(e) {
366
+ function W(e) {
366
367
  return {
367
368
  name: e.name.trim(),
368
369
  account_holder_name: e.accountHolderName.trim(),
@@ -375,54 +376,54 @@ function U(e) {
375
376
  country: "US"
376
377
  };
377
378
  }
378
- function W(e) {
379
+ function G(e) {
379
380
  return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e);
380
381
  }
381
- function G(e, t) {
382
+ function K(e, t) {
382
383
  let n = {};
383
384
  return e.line1.trim().length === 0 && (n.line1 = t.addressLine1Required), e.city.trim().length === 0 && (n.city = t.cityRequired), e.state.trim().length === 0 && (n.state = t.stateRequired), e.postalCode.trim().length === 0 && (n.postalCode = t.postalCodeRequired), n;
384
385
  }
385
- function K(e) {
386
+ function q(e) {
386
387
  return Object.values(e).some(Boolean);
387
388
  }
388
- function q(e) {
389
+ function J(e) {
389
390
  if (!/^\d{9}$/.test(e)) return !1;
390
391
  let t = [...e].map(Number);
391
392
  return (3 * (t[0] + t[3] + t[6]) + 7 * (t[1] + t[4] + t[7]) + (t[2] + t[5] + t[8])) % 10 == 0;
392
393
  }
393
- function J(e, t = n) {
394
- let r = {}, i = e.accountHolderName.trim(), a = e.routingNumber.trim(), o = e.accountNumber.trim();
395
- return i.length === 0 && (r.accountHolderName = t.accountHolderNameRequired), (a.length === 0 || !q(a)) && (r.routingNumber = t.routingNumberInvalid), (o.length === 0 || !/^\d{9,12}$/.test(o)) && (r.accountNumber = t.accountNumberInvalid), r;
394
+ function Y(e, n = r) {
395
+ let i = {}, a = e.accountHolderName.trim(), o = e.routingNumber.trim(), s = e.accountNumber.trim();
396
+ return a.length === 0 && (i.accountHolderName = n.accountHolderNameRequired), (o.length === 0 || !J(o)) && (i.routingNumber = n.routingNumberInvalid), t(s) || (i.accountNumber = n.accountNumberInvalid), i;
396
397
  }
397
- function Y(e, t, r = n, i = "customer", a = !1) {
398
+ function X(e, t, n = r, i = "customer", a = !1) {
398
399
  let o = {};
399
- if (e.entityType === "organization" ? e.legalName.trim().length === 0 && (o.legalName = r.legalNameRequired) : (e.firstName.trim().length === 0 && (o.firstName = r.firstNameRequired), e.lastName.trim().length === 0 && (o.lastName = r.lastNameRequired)), e.email.trim().length === 0 ? o.email = r.emailRequired : W(e.email.trim()) || (o.email = r.emailInvalid), t === "create" && i === "vendor" || O(e.address)) {
400
- let t = G(e.address, r);
401
- K(t) && (o.address = t);
400
+ if (e.entityType === "organization" ? e.legalName.trim().length === 0 && (o.legalName = n.legalNameRequired) : (e.firstName.trim().length === 0 && (o.firstName = n.firstNameRequired), e.lastName.trim().length === 0 && (o.lastName = n.lastNameRequired)), e.email.trim().length === 0 ? o.email = n.emailRequired : G(e.email.trim()) || (o.email = n.emailInvalid), t === "create" && i === "vendor" || k(e.address)) {
401
+ let t = K(e.address, n);
402
+ q(t) && (o.address = t);
402
403
  }
403
- if (i === "vendor" && (a || P(e))) {
404
- let t = J(e.bankAccount, r);
405
- K(t) && (o.bankAccount = t);
404
+ if (i === "vendor" && (a || F(e))) {
405
+ let t = Y(e.bankAccount, n);
406
+ q(t) && (o.bankAccount = t);
406
407
  }
407
408
  return o;
408
409
  }
409
- function X(e) {
410
+ function Z(e) {
410
411
  let { address: t, bankAccount: n, ...r } = e;
411
- return K(r) || (t ? K(t) : !1) || (n ? K(n) : !1);
412
+ return q(r) || (t ? q(t) : !1) || (n ? q(n) : !1);
412
413
  }
413
- function Z(e, t = n) {
414
- let r = {};
415
- return e.name.trim().length === 0 && (r.name = t.bankAccountNameRequired), e.accountNumber.trim().length === 0 && e.iban.trim().length === 0 && (r.accountNumber = t.bankAccountIdentifierRequired), e.currency.trim().length === 0 && (r.currency = t.bankAccountCurrencyRequired), r;
414
+ function Q(e, t = r) {
415
+ let n = {};
416
+ return e.name.trim().length === 0 && (n.name = t.bankAccountNameRequired), e.accountNumber.trim().length === 0 && e.iban.trim().length === 0 && (n.accountNumber = t.bankAccountIdentifierRequired), e.currency.trim().length === 0 && (n.currency = t.bankAccountCurrencyRequired), n;
416
417
  }
417
- function Q(e) {
418
- return K(e);
418
+ function $(e) {
419
+ return q(e);
419
420
  }
420
- function $(e, t = n) {
421
- return G(e, t);
421
+ function ee(e, t = r) {
422
+ return K(e, t);
422
423
  }
423
- function ee() {
424
+ function te() {
424
425
  let e = globalThis.getSelection?.();
425
426
  return !!(e && e.toString().length > 0);
426
427
  }
427
428
  //#endregion
428
- export { w as addressFormToCreatePayload, T as addressFormToUpdatePayload, C as addressResponseToFormValues, H as bankAccountFormToCreatePayload, U as bankAccountFormToUpdatePayload, V as bankAccountToFormValues, p as buildAnalyticsMap, y as buildBankAccountItems, _ as buildCounterpartDetailsView, m as buildCounterpartRows, F as counterpartFormBankAccountToCreatePayload, I as counterpartFormBankAccountToUpdatePayload, A as counterpartFormToCreatePayload, j as counterpartFormToUpdatePayload, D as counterpartToFormValues, B as emptyBankAccountFormValues, E as emptyCounterpartFormValues, l as formatCounterpartDate, s as formatMoney, o as fromMinorUnits, b as getAchInstructions, d as getCounterpartEmail, u as getCounterpartName, i as getCurrencyOptions, x as getPayableAchInstructions, N as hasAchFormValues, Q as hasBankAccountFormErrors, M as hasCounterpartFormAddressValues, P as hasCounterpartFormBankAccountValues, X as hasCounterpartFormErrors, ee as hasSelectedText, R as isAchCompatibleBankAccount, z as resolveCounterpartBankAccountWrite, J as validateAchFormValues, $ as validateAddressForm, Z as validateBankAccountForm, Y as validateCounterpartForm };
429
+ export { T as addressFormToCreatePayload, E as addressFormToUpdatePayload, w as addressResponseToFormValues, U as bankAccountFormToCreatePayload, W as bankAccountFormToUpdatePayload, H as bankAccountToFormValues, m as buildAnalyticsMap, b as buildBankAccountItems, v as buildCounterpartDetailsView, h as buildCounterpartRows, I as counterpartFormBankAccountToCreatePayload, L as counterpartFormBankAccountToUpdatePayload, j as counterpartFormToCreatePayload, M as counterpartFormToUpdatePayload, O as counterpartToFormValues, V as emptyBankAccountFormValues, D as emptyCounterpartFormValues, u as formatCounterpartDate, c as formatMoney, s as fromMinorUnits, x as getAchInstructions, f as getCounterpartEmail, d as getCounterpartName, a as getCurrencyOptions, S as getPayableAchInstructions, P as hasAchFormValues, $ as hasBankAccountFormErrors, N as hasCounterpartFormAddressValues, F as hasCounterpartFormBankAccountValues, Z as hasCounterpartFormErrors, te as hasSelectedText, z as isAchCompatibleBankAccount, B as resolveCounterpartBankAccountWrite, Y as validateAchFormValues, ee as validateAddressForm, Q as validateBankAccountForm, X as validateCounterpartForm };
@@ -14,7 +14,7 @@ var e = {
14
14
  bankAccountCurrencyRequired: "Currency is required",
15
15
  accountHolderNameRequired: "Account holder name is required",
16
16
  routingNumberInvalid: "Enter a valid 9-digit ABA routing number",
17
- accountNumberInvalid: "Account number must be between 9 and 12 digits",
17
+ accountNumberInvalid: "Enter a valid account number",
18
18
  vatIdValueRequired: "VAT ID is required",
19
19
  genericError: "Something went wrong. Please try again.",
20
20
  deleteTitle: "Delete “{name}”?",
@@ -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.23", n = "2400d88199d2be9507ad5fe5306e5680d792b295", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.5.25", n = "be6455ffa75fc68ee8b0eae44daf86d8974c2aaf", r = Object.freeze({
3
3
  library_name: e,
4
4
  library_version: t,
5
5
  library_sha: n
@@ -0,0 +1,6 @@
1
+ //#region ../../libs/tesouro-embedded-components-react/shared/util/dist/lib/isValidAchAccountNumber.js
2
+ function e(e) {
3
+ return /^\d{1,17}$/.test(e.trim());
4
+ }
5
+ //#endregion
6
+ export { e as isValidAchAccountNumber };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tesouro/embedded-components-react",
3
- "version": "0.5.23",
3
+ "version": "0.5.25",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "packageDepSync": {
@@ -1,25 +0,0 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { useEmbedApi as e } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
6
- import { organizationHeaders as t } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
7
- import { getEntityUsersOptions as n } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
8
- import { withAuthEpoch as r } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
9
- import "../../../shared/data-access/dist/index.js";
10
- import { useQuery as i } from "@tanstack/react-query";
11
- //#region ../../libs/tesouro-embedded-components-react/tags-widget/data-access/dist/index10.js
12
- var a = 100;
13
- function o(o = a) {
14
- let { client: s, organizationId: c, widgetToken: l, authEpoch: u } = e(), d = !!(c && l), f = n({
15
- query: { limit: o },
16
- client: s,
17
- headers: t(c)
18
- });
19
- return i({
20
- ...r(f, u),
21
- enabled: d
22
- });
23
- }
24
- //#endregion
25
- export { o as useEntityUsersQuery };
@@ -1,24 +0,0 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { useEmbedApi as e } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
6
- import { organizationHeaders as t } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
7
- import { getTagsOptions as n } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
8
- import { withAuthEpoch as r } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
9
- import "../../../shared/data-access/dist/index.js";
10
- import { useQuery as i } from "@tanstack/react-query";
11
- //#region ../../libs/tesouro-embedded-components-react/tags-widget/data-access/dist/index2.js
12
- function a({ enabled: a, ...o } = {}) {
13
- let { client: s, organizationId: c, widgetToken: l, authEpoch: u } = e(), d = !!(c && l) && (a === !0 || a === void 0), f = n({
14
- query: o,
15
- client: s,
16
- headers: t(c)
17
- });
18
- return i({
19
- ...r(f, u),
20
- enabled: d
21
- });
22
- }
23
- //#endregion
24
- export { a as useTagsQuery };
@@ -1,13 +0,0 @@
1
- import { organizationHeaders as e } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
2
- import { getEntitiesIdSettingsQueryKey as t, getTagsQueryKey as n } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
3
- import "../../../shared/data-access/dist/index.js";
4
- //#region ../../libs/tesouro-embedded-components-react/tags-widget/data-access/dist/index3.js
5
- var r = ({ client: t, organizationId: r }) => n({
6
- client: t,
7
- headers: e(r)
8
- }), i = ({ client: e, entityId: n }) => t({
9
- client: e,
10
- path: { entity_id: n }
11
- });
12
- //#endregion
13
- export { i as entitySettingsInvalidationKey, r as tagsInvalidationKey };
@@ -1,33 +0,0 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { invalidateAllClients as e } from "../../../shared/data-access/dist/lib/clientRegistry.js";
6
- import { useEmbedApi as t } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
7
- import { organizationHeaders as n } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
8
- import { deleteTagsId as r } from "../../../shared/data-access/dist/lib/rest/sdk.gen.js";
9
- import "../../../shared/data-access/dist/index.js";
10
- import { tagsInvalidationKey as i } from "./index3.js";
11
- import { useMutation as a } from "@tanstack/react-query";
12
- //#region ../../libs/tesouro-embedded-components-react/tags-widget/data-access/dist/index6.js
13
- function o() {
14
- let { client: o, organizationId: s } = t();
15
- return a({
16
- mutationFn: async ({ path: e }) => {
17
- await r({
18
- client: o,
19
- headers: n(s),
20
- path: e,
21
- throwOnError: !0
22
- });
23
- },
24
- onSuccess: async () => {
25
- await e(i({
26
- client: o,
27
- organizationId: s
28
- }));
29
- }
30
- });
31
- }
32
- //#endregion
33
- export { o as useDeleteTagMutation };
@@ -1,19 +0,0 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { useEmbedApi as e } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
6
- import { getEntitiesMeOptions as t } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
7
- import { withAuthEpoch as n } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
8
- import "../../../shared/data-access/dist/index.js";
9
- import { useQuery as r } from "@tanstack/react-query";
10
- //#region ../../libs/tesouro-embedded-components-react/tags-widget/data-access/dist/index7.js
11
- function i() {
12
- let { client: i, organizationId: a, widgetToken: o, authEpoch: s } = e(), c = !!(a && o), l = t({ client: i });
13
- return r({
14
- ...n(l, s),
15
- enabled: c
16
- });
17
- }
18
- //#endregion
19
- export { i as useMyEntityQuery };
@@ -1,22 +0,0 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { useEmbedApi as e } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
6
- import { getEntitiesIdSettingsOptions as t } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
7
- import { withAuthEpoch as n } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
8
- import "../../../shared/data-access/dist/index.js";
9
- import { useQuery as r } from "@tanstack/react-query";
10
- //#region ../../libs/tesouro-embedded-components-react/tags-widget/data-access/dist/index8.js
11
- function i(i) {
12
- let { client: a, organizationId: o, widgetToken: s, authEpoch: c } = e(), l = !!(o && s && i), u = t({
13
- client: a,
14
- path: { entity_id: i ?? "" }
15
- });
16
- return r({
17
- ...n(u, c),
18
- enabled: l
19
- });
20
- }
21
- //#endregion
22
- export { i as useEntitySettingsQuery };
@@ -1,26 +0,0 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { invalidateAllClients as e } from "../../../shared/data-access/dist/lib/clientRegistry.js";
6
- import { useEmbedApi as t } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
7
- import { patchEntitiesIdSettingsMutation as n } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
8
- import "../../../shared/data-access/dist/index.js";
9
- import { entitySettingsInvalidationKey as r } from "./index3.js";
10
- import { useMutation as i } from "@tanstack/react-query";
11
- //#region ../../libs/tesouro-embedded-components-react/tags-widget/data-access/dist/index9.js
12
- function a() {
13
- let { client: a } = t();
14
- return i({
15
- ...n({ client: a }),
16
- onSuccess: async (t, n) => {
17
- let i = n?.path?.entity_id;
18
- i && await e(r({
19
- client: a,
20
- entityId: i
21
- }));
22
- }
23
- });
24
- }
25
- //#endregion
26
- export { a as useUpdateEntitySettingsMutation };
@@ -1,4 +0,0 @@
1
- //#region ../../libs/tesouro-embedded-components-react/tags-widget/feature/dist/index2.js
2
- var e = { Mounted: "tags.mounted" }, t = "tags";
3
- //#endregion
4
- export { e as TagsWidgetAnalyticsEvent, t as WIDGET_NAME };