@tesouro/embedded-components-react 0.11.179 → 0.11.181

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 (108) hide show
  1. package/dist/index.css +22 -0
  2. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index.js +24 -23
  3. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index10.js +16 -18
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index11.js +3 -3
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index12.js +5 -7
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index13.js +2 -2
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index14.js +4 -3
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index15.js +13 -27
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index16.js +34 -19
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index17.js +23 -16
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index18.js +26 -12
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index19.js +12 -57
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index2.js +34 -85
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index20.js +48 -29
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index21.js +36 -20
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index22.js +20 -18
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index23.js +14 -37
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index24.js +31 -14
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index25.js +26 -2
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index26.js +2 -0
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index3.js +90 -20
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index4.js +30 -8
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index5.js +8 -74
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index6.js +60 -19
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index7.js +6 -5
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index8.js +12 -17
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index9.js +20 -12
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index.js +7 -7
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index10.js +17 -36
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index11.js +42 -54
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index12.js +89 -6
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index13.js +5 -21
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index14.js +15 -92
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index15.js +103 -10
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index16.js +10 -9
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index17.js +8 -7
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index18.js +7 -9
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index19.js +11 -29
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index20.js +24 -24
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index21.js +22 -14
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index22.js +14 -137
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index23.js +139 -13
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index24.js +12 -18
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index25.js +15 -32
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index26.js +39 -108
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index27.js +96 -80
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index28.js +94 -3
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index29.js +4 -57
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index30.js +56 -116
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index31.js +114 -197
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index32.js +194 -75
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index33.js +75 -67
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index34.js +69 -111
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index35.js +108 -459
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index36.js +450 -102
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index37.js +117 -9
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index38.js +8 -85
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index39.js +73 -67
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index4.js +1 -1
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index40.js +71 -246
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index41.js +251 -40
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index42.js +38 -237
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index43.js +244 -21
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index44.js +21 -529
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index45.js +530 -4
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index46.js +4 -44
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index47.js +41 -242
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index48.js +245 -3
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index49.js +3 -5
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index50.js +4 -63
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index51.js +64 -1
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index52.js +1 -0
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index9.js +6 -18
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index3.js +7 -3
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index.js +4 -4
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index10.js +14 -17
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index11.js +82 -13
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index12.js +47 -83
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index13.js +261 -47
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index14.js +23 -251
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index15.js +450 -25
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index16.js +286 -442
  83. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index17.js +4 -300
  84. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index18.js +5 -4
  85. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index19.js +37 -4
  86. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index20.js +1 -38
  87. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index5.js +11 -11
  88. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index7.js +88 -7
  89. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index8.js +17 -89
  90. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index9.js +18 -18
  91. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index10.js +4 -4
  92. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index18.js +0 -1
  93. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index20.js +263 -262
  94. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/invalidatePayableQueries/approvalDecisionQueries.js +22 -19
  95. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/invalidatePayableQueries/invalidatePayableQueries.js +20 -20
  96. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/queryKeys.js +32 -21
  97. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillsTab.js +2 -2
  98. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/mocks/labels.js +1 -1
  99. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/index.js +4 -4
  100. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +42 -42
  101. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +237 -215
  102. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +151 -135
  103. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  104. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/index.js +7 -5
  105. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/AttentionStrip/AttentionStrip.js +29 -0
  106. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/AttentionStrip/AttentionViewBar.js +33 -0
  107. package/package.json +1 -1
  108. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index21.js +0 -1
@@ -1,74 +1,82 @@
1
- import { isStateValid as e } from "../../../../shared/util/dist/lib/usStates.js";
2
- import "../../../../shared/util/dist/index.js";
3
- import { emptyCounterpartFormValues as t, hasCounterpartFormErrors as n, validateCounterpartForm as r } from "../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
4
- import "../../../../shared/counterpart-management/feature/dist/index.js";
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { createSourceDocumentPreview as e } from "./index31.js";
6
+ import { SourceDocumentPanel as t } from "../../ui/dist/index49.js";
7
+ import "../../ui/dist/index.js";
8
+ import { SOURCE_DOCUMENT_CONTAINER_LABELS_EN as n } from "./index32.js";
9
+ import { useAttachPayableFileMutation as r } from "../../data-access/dist/index7.js";
10
+ import "../../data-access/dist/index.js";
11
+ import { useEffect as i, useState as a } from "react";
12
+ import { jsx as o } from "react/jsx-runtime";
5
13
  // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index33.js
6
- function i(e) {
7
- return e?.trim() ?? "";
8
- }
9
- function a(t) {
10
- let n = i(t).toUpperCase();
11
- return e(n) ? n : "";
12
- }
13
- function o(e) {
14
- let t = i(e.bank_account?.account_holder_name), n = i(e.bank_account?.routing_number), r = i(e.bank_account?.account_number);
15
- if (t || n || r) return {
16
- accountHolderName: t || i(e.name),
17
- routingNumber: n,
18
- accountNumber: r
19
- };
20
- }
21
14
  function s(e) {
22
- if (!e) return;
23
- let t = {
24
- legalName: i(e.name),
25
- email: i(e.email),
26
- phone: i(e.phone),
27
- address: {
28
- line1: i(e.address?.line1),
29
- line2: i(e.address?.line2),
30
- city: i(e.address?.city),
31
- state: a(e.address?.state),
32
- postalCode: i(e.address?.postal_code)
33
- },
34
- bankAccount: o(e)
35
- };
36
- return t.legalName || t.email || t.phone || Object.values(t.address).some(Boolean) || t.bankAccount ? t : void 0;
37
- }
38
- function c(e) {
39
- let a = s(e);
40
- if (!a || i(e?.address?.country).toUpperCase() !== "US") return !1;
41
- let o = t("organization", "vendor");
42
- return !n(r({
43
- ...o,
44
- ...a,
45
- bankAccount: {
46
- accountHolderName: i(e?.bank_account?.account_holder_name),
47
- routingNumber: i(e?.bank_account?.routing_number),
48
- accountNumber: i(e?.bank_account?.account_number)
15
+ let [t, n] = a();
16
+ return i(() => {
17
+ if (!e) {
18
+ n(void 0);
19
+ return;
49
20
  }
50
- }, void 0, "vendor"));
21
+ let t = URL.createObjectURL(e);
22
+ return n(t), () => URL.revokeObjectURL(t);
23
+ }, [e]), t;
51
24
  }
52
- function l(e, t, n) {
53
- let r = (e) => i(e) || void 0, { address: a } = e;
54
- return {
25
+ function c({ payableId: i, file: a, isDocumentPending: c, pendingFileName: l, readOnly: u, staging: d, deletion: f, labels: p }) {
26
+ let { stagedFile: m, onFileStaged: h, onClearStagedFile: g, isSaving: _ } = d ?? {}, { isPending: v, onRequest: y, onDetachNow: b, isDeleting: x, hasFailed: S } = f ?? {}, C = {
55
27
  ...n,
56
- name: r(e.entityType === "individual" ? `${e.firstName} ${e.lastName}` : e.legalName),
57
- email: r(e.email),
58
- phone: r(e.phone),
59
- address: {
60
- ...n?.address,
61
- line1: r(a.line1),
62
- line2: r(a.line2),
63
- city: r(a.city),
64
- state: r(a.state),
65
- postal_code: r(a.postalCode)
66
- },
67
- bank_account: {
68
- account_holder_name: r(t.accountHolderName),
69
- routing_number: r(t.routingNumber),
70
- account_number: r(t.accountNumber)
28
+ ...p,
29
+ preview: {
30
+ ...n.preview,
31
+ ...p?.preview
32
+ }
33
+ }, w = r(), T = s(m), E = !!(a && !v || m);
34
+ if (!E && (c || w.isPending)) return /* @__PURE__ */ o(t, {
35
+ mode: "loading",
36
+ fileName: l,
37
+ labels: p?.panel
38
+ });
39
+ if (!E && u) return /* @__PURE__ */ o("div", {
40
+ className: "ttw:rounded-lg ttw:border ttw:border-border ttw:bg-card ttw:p-4 ttw:text-sm ttw:text-muted-foreground",
41
+ children: C.noDocument
42
+ });
43
+ if (!E) return /* @__PURE__ */ o(t, {
44
+ mode: "upload",
45
+ labels: p?.panel,
46
+ uploadStatus: w.isPending || x ? "uploading" : "idle",
47
+ uploadErrorMessage: w.isError ? C.attachFailed : S ? C.deleteFailed : void 0,
48
+ noticeMessage: v && !S ? C.pendingDeletionNotice : void 0,
49
+ onFilesSelected: (e) => {
50
+ let [t] = e;
51
+ if (t) {
52
+ if (i) {
53
+ let e = () => w.mutate({
54
+ path: { payable_id: i },
55
+ file: t
56
+ });
57
+ if (v && b) {
58
+ b().then(e, () => void 0);
59
+ return;
60
+ }
61
+ e();
62
+ } else h?.(t);
63
+ }
71
64
  }
72
- };
65
+ });
66
+ let D = a?.name ?? m?.name ?? "", O = e(a || {
67
+ name: D,
68
+ url: T ?? "",
69
+ mimetype: m?.type ?? ""
70
+ }, C.preview);
71
+ return /* @__PURE__ */ o(t, {
72
+ mode: "document",
73
+ labels: p?.panel,
74
+ fileName: D,
75
+ preview: O,
76
+ isDeleting: x,
77
+ deleteErrorMessage: S ? C.deleteFailed : void 0,
78
+ onDownload: a ? () => window.open(a.url, "_blank", "noopener,noreferrer") : void 0,
79
+ onDelete: u ? void 0 : a && i ? y : _ ? void 0 : g
80
+ });
73
81
  }
74
- export { s as buildVendorPrefill, c as canAutoCreateVendor, l as toCounterpartRawData };
82
+ export { c as SourceDocumentContainer, c as default };
@@ -1,116 +1,74 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { Button as e } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import { getStateOptions as t } from "../../../../shared/util/dist/lib/usStates.js";
1
+ import { isStateValid as e } from "../../../../shared/util/dist/lib/usStates.js";
7
2
  import "../../../../shared/util/dist/index.js";
8
- import { AchFieldGroup as n } from "../../../../shared/counterpart-management/ui/dist/index5.js";
9
- import { CounterpartFormFields as r, countErrors as i, useFocusFirstInvalidField as a } from "../../../../shared/counterpart-management/ui/dist/index10.js";
10
- import "../../../../shared/counterpart-management/ui/dist/index.js";
11
- import { VendorSearchCombobox as o } from "../../ui/dist/index24.js";
12
- import "../../ui/dist/index.js";
13
- import { mergeVendorInlineFormLabels as s } from "./index31.js";
3
+ import { emptyCounterpartFormValues as t, hasCounterpartFormErrors as n, validateCounterpartForm as r } from "../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
14
4
  import "../../../../shared/counterpart-management/feature/dist/index.js";
15
- import { useMemo as c } from "react";
16
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
17
5
  // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index34.js
18
- function d({ mode: d, values: f, errors: p, onChange: m, onAddressChange: h, onCancel: g, onSave: _, isSaving: v = !1, search: y, paymentInstructions: b, labels: x }) {
19
- let S = c(() => s(x), [x]), C = c(() => t(), []), w = a(p ?? {}), T = i({
20
- ...p,
21
- form: void 0,
22
- bankAccount: void 0
23
- }) + i(b?.errors), E = y?.query.trim() ?? "", D = f.entityType === "individual" ? `${f.firstName} ${f.lastName}`.trim() : f.legalName, O = y && d === "create" ? /* @__PURE__ */ l(o, {
24
- ...y,
25
- onAddVendor: E && E !== D.trim() ? y.onAddVendor : void 0,
26
- selectedLabel: D,
27
- badge: S.newVendorBadge,
28
- helperText: S.unmatchedVendorHelper,
29
- resultsHeading: S.resultsHeading,
30
- addVendorDescription: S.addAsNewVendorDescription,
31
- labels: {
32
- fieldLabel: S.vendorFieldLabel,
33
- addVendorAction: S.addAsNewVendor(E)
6
+ function i(e) {
7
+ return e?.trim() ?? "";
8
+ }
9
+ function a(t) {
10
+ let n = i(t).toUpperCase();
11
+ return e(n) ? n : "";
12
+ }
13
+ function o(e) {
14
+ let t = i(e.bank_account?.account_holder_name), n = i(e.bank_account?.routing_number), r = i(e.bank_account?.account_number);
15
+ if (t || n || r) return {
16
+ accountHolderName: t || i(e.name),
17
+ routingNumber: n,
18
+ accountNumber: r
19
+ };
20
+ }
21
+ function s(e) {
22
+ if (!e) return;
23
+ let t = {
24
+ legalName: i(e.name),
25
+ email: i(e.email),
26
+ phone: i(e.phone),
27
+ address: {
28
+ line1: i(e.address?.line1),
29
+ line2: i(e.address?.line2),
30
+ city: i(e.address?.city),
31
+ state: a(e.address?.state),
32
+ postalCode: i(e.address?.postal_code)
33
+ },
34
+ bankAccount: o(e)
35
+ };
36
+ return t.legalName || t.email || t.phone || Object.values(t.address).some(Boolean) || t.bankAccount ? t : void 0;
37
+ }
38
+ function c(e) {
39
+ let a = s(e);
40
+ if (!a || i(e?.address?.country).toUpperCase() !== "US") return !1;
41
+ let o = t("organization", "vendor");
42
+ return !n(r({
43
+ ...o,
44
+ ...a,
45
+ bankAccount: {
46
+ accountHolderName: i(e?.bank_account?.account_holder_name),
47
+ routingNumber: i(e?.bank_account?.routing_number),
48
+ accountNumber: i(e?.bank_account?.account_number)
49
+ }
50
+ }, void 0, "vendor"));
51
+ }
52
+ function l(e, t, n) {
53
+ let r = (e) => i(e) || void 0, { address: a } = e;
54
+ return {
55
+ ...n,
56
+ name: r(e.entityType === "individual" ? `${e.firstName} ${e.lastName}` : e.legalName),
57
+ email: r(e.email),
58
+ phone: r(e.phone),
59
+ address: {
60
+ ...n?.address,
61
+ line1: r(a.line1),
62
+ line2: r(a.line2),
63
+ city: r(a.city),
64
+ state: r(a.state),
65
+ postal_code: r(a.postalCode)
66
+ },
67
+ bank_account: {
68
+ account_holder_name: r(t.accountHolderName),
69
+ routing_number: r(t.routingNumber),
70
+ account_number: r(t.accountNumber)
34
71
  }
35
- }) : null;
36
- return /* @__PURE__ */ u("div", {
37
- ref: w,
38
- className: "ttw:flex ttw:flex-col ttw:gap-4",
39
- children: [O, /* @__PURE__ */ u("div", {
40
- className: "ttw:flex ttw:flex-col ttw:gap-6 ttw:rounded-lg ttw:border ttw:border-primary ttw:bg-surface-subtle ttw:p-6 ttw:[&_[data-slot=input]]:bg-background ttw:[&_[data-slot=select-trigger]]:bg-background",
41
- children: [
42
- /* @__PURE__ */ u("div", {
43
- className: "ttw:flex ttw:items-baseline ttw:justify-between ttw:gap-2",
44
- children: [/* @__PURE__ */ l("p", {
45
- className: "ttw:text-base ttw:font-semibold ttw:text-foreground",
46
- children: d === "edit" ? S.editTitle : S.createTitle
47
- }), T > 0 ? /* @__PURE__ */ l("p", {
48
- className: "ttw:text-sm ttw:text-destructive",
49
- children: S.fieldsNeedAttention(T)
50
- }) : null]
51
- }),
52
- y && d === "edit" ? /* @__PURE__ */ l(o, {
53
- ...y,
54
- labels: { fieldLabel: S.switchVendorFieldLabel }
55
- }) : null,
56
- /* @__PURE__ */ l(r, {
57
- mode: d,
58
- counterpartMode: "vendor",
59
- values: f,
60
- errors: p,
61
- stateOptions: C,
62
- onChange: m,
63
- onAddressChange: h,
64
- sections: {
65
- entityType: !0,
66
- profileHeading: !1,
67
- addressHeading: !1,
68
- title: !1,
69
- taxId: !1,
70
- address: !0,
71
- bankAccount: !1
72
- },
73
- labels: { businessNameLabel: S.nameLabel }
74
- }),
75
- b ? /* @__PURE__ */ u("div", {
76
- className: "ttw:flex ttw:flex-col ttw:gap-3",
77
- children: [/* @__PURE__ */ u("div", {
78
- className: "ttw:flex ttw:flex-col ttw:gap-1",
79
- children: [/* @__PURE__ */ l("p", {
80
- className: "ttw:text-sm ttw:font-semibold ttw:text-foreground",
81
- children: S.paymentInstructionsHeading
82
- }), /* @__PURE__ */ l("p", {
83
- className: "ttw:text-sm ttw:text-muted-foreground",
84
- children: b.isExtracted ? S.paymentInstructionsExtracted : S.paymentInstructionsDescription
85
- })]
86
- }), /* @__PURE__ */ l(n, {
87
- idPrefix: "vendor-inline-ach",
88
- values: b.values,
89
- errors: b.errors,
90
- onChange: b.onChange,
91
- labels: S.ach
92
- })]
93
- }) : null,
94
- /* @__PURE__ */ u("div", {
95
- className: "ttw:flex ttw:justify-end ttw:gap-2",
96
- children: [/* @__PURE__ */ l(e, {
97
- type: "button",
98
- variant: "outline",
99
- onClick: g,
100
- "aria-label": S.cancelAriaLabel,
101
- disabled: v,
102
- children: S.cancel
103
- }), _ ? /* @__PURE__ */ l(e, {
104
- type: "button",
105
- onClick: _,
106
- "aria-label": S.saveAriaLabel,
107
- loading: v,
108
- disabled: v,
109
- children: S.save
110
- }) : null]
111
- })
112
- ]
113
- })]
114
- });
72
+ };
115
73
  }
116
- export { d as VendorInlineForm, d as default };
74
+ export { s as buildVendorPrefill, c as canAutoCreateVendor, l as toCounterpartRawData };