@tesouro/embedded-components-react 0.2.326 → 0.2.328

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 (134) hide show
  1. package/dist/index.css +3 -0
  2. package/dist/index.d.ts +59 -59
  3. package/dist/index.js +1 -1
  4. package/dist/lib/BillPayWidget.js +1 -1
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index.js +10 -10
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index10.js +119 -33
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index4.js +50 -21
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index5.js +39 -17
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index8.js +1 -1
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index9.js +17 -12
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +10 -10
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +2 -2
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +45 -17
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js +4 -21
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +9 -24
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +42 -9
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +25 -50
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +49 -5
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +91 -63
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +20 -49
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +52 -7
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +5 -35
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +67 -113
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +46 -53
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +80 -205
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +32 -192
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +117 -62
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +54 -45
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +205 -31
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +184 -143
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +63 -33
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +46 -100
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +32 -7
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +146 -182
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +38 -4
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +102 -24
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +10 -80
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +200 -78
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +2 -1
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +27 -2
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +78 -41
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +132 -1
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +3 -53
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +2 -9
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +43 -16
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +1 -8
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +50 -77
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +8 -145
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +18 -5
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +6 -6
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +78 -7
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +138 -75
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +2 -0
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +6 -6
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +7 -113
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +85 -1
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +2 -24
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +8 -0
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +115 -0
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +1 -0
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +25 -0
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +2 -2
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +33 -25
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index12.js +13 -12
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js +58 -13
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index14.js +2 -24
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index15.js +22 -2
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +23 -31
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index17.js +1 -262
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +15 -2
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index19.js +23 -6
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js +2 -49
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +41 -1
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +271 -20
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index23.js +2 -286
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +9 -2
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +47 -14
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +2 -120
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index27.js +22 -2
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +284 -8
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index29.js +2 -96
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index30.js +16 -2
  83. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index31.js +118 -11
  84. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index32.js +1 -57
  85. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index33.js +10 -2
  86. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index34.js +93 -51
  87. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index35.js +1 -138
  88. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index36.js +12 -1
  89. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index37.js +56 -5
  90. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index38.js +2 -44
  91. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index39.js +53 -1
  92. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index40.js +137 -2
  93. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index41.js +2 -16
  94. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index42.js +7 -2
  95. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index43.js +42 -59
  96. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index44.js +2 -238
  97. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index45.js +2 -202
  98. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index46.js +61 -8
  99. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index47.js +2 -8
  100. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index48.js +2 -91
  101. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index49.js +16 -0
  102. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index50.js +1 -1
  103. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index51.js +67 -4
  104. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index52.js +248 -25
  105. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index53.js +204 -2
  106. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index54.js +6 -3
  107. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index55.js +6 -32
  108. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index56.js +93 -2
  109. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index58.js +1 -105
  110. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index59.js +7 -2
  111. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index60.js +28 -16
  112. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index61.js +2 -10
  113. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index62.js +4 -167
  114. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index63.js +34 -2
  115. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index64.js +2 -14
  116. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index65.js +10 -87
  117. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index66.js +105 -1
  118. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index67.js +2 -0
  119. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index68.js +18 -0
  120. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index69.js +10 -0
  121. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index70.js +170 -0
  122. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index71.js +2 -0
  123. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index72.js +14 -0
  124. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index73.js +89 -0
  125. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index74.js +2 -0
  126. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/data-access/dist/lib/approvalPoliciesApi.js +20 -20
  127. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/index.js +4 -4
  128. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +21 -21
  129. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +142 -102
  130. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/zod.gen.js +8 -3
  131. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  132. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index7.js +1 -1
  133. package/package.json +1 -1
  134. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index57.js +0 -12
@@ -1,208 +1,83 @@
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";
7
- import { AchFieldGroup as n } from "../../../shared/counterpart-management/ui/dist/index5.js";
8
- import { CounterpartFormFields as r, useFocusFirstInvalidField as i } from "../../../shared/counterpart-management/ui/dist/index9.js";
9
- import { VENDOR_INLINE_FORM_LABELS_EN as a } from "./index22.js";
10
- import { COUNTERPART_MESSAGE_LABELS_EN as o } from "../../../shared/counterpart-management/feature/dist/lib/labels.js";
11
- import { useCounterpartForm as s } from "../../../shared/counterpart-management/feature/dist/lib/useCounterpartForm.js";
12
- import "../../../shared/counterpart-management/feature/dist/index.js";
13
- import { useCallback as c, useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
14
- import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
15
- import { Landmark as g, Plus as _, X as v } from "lucide-react";
16
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js
17
- function y({ mode: y, counterpart: b, primaryAddress: x, bankAccounts: S, isBankAccountsLoading: C, isBankAccountsError: w, initialName: T, onSaved: E, onCancel: D, onDirtyChange: O, labels: k }) {
18
- let A = {
19
- ...a,
20
- ...k
21
- }, [j, M] = f("none"), [N, P] = f(b?.id), [F, I] = f(!1), [L, R] = f(!1);
22
- l(() => {
23
- O?.(L);
24
- }, [L, O]);
25
- let z = u(() => t(), []), B = d(j), V = d(!1), H = s({
26
- view: j,
27
- setView: M,
28
- selectedId: N,
29
- setSelectedId: P,
30
- messages: o,
31
- counterpartType: "vendor",
32
- counterpart: b,
33
- primaryAddress: x,
34
- bankAccounts: S,
35
- isBankAccountsLoading: C,
36
- isBankAccountsError: w
37
- }), { openCreate: U, openEdit: W, setValues: G } = H, K = i(H.errors);
38
- l(() => {
39
- y === "edit" ? W() : U();
40
- }, [
41
- y,
42
- U,
43
- W
44
- ]), l(() => {
45
- B.current !== "none" && j === "none" && N && E(N), B.current = j;
46
- }, [
47
- j,
48
- N,
49
- E
50
- ]), l(() => {
51
- y !== "create" || V.current || (V.current = !0, G((e) => ({
52
- ...e,
53
- entityType: "organization",
54
- legalName: T?.trim() || e.legalName
55
- })));
56
- }, [
57
- y,
58
- T,
59
- G
60
- ]), l(() => {
61
- y === "edit" && (H.values.bankAccount.routingNumber || H.values.bankAccount.accountNumber) && I(!0);
62
- }, [
63
- y,
64
- H.values.bankAccount.accountNumber,
65
- H.values.bankAccount.routingNumber
66
- ]), l(() => {
67
- H.sectionsToExpand.bankAccount && I(!0);
68
- }, [H.sectionsToExpand.bankAccount]);
69
- let q = c((e) => {
70
- R(!0), G((t) => e.entityType === "individual" && t.entityType !== "individual" ? {
71
- ...t,
72
- ...e,
73
- firstName: t.firstName || t.legalName,
74
- legalName: t.legalName
75
- } : e.entityType === "organization" && t.entityType !== "organization" ? {
76
- ...t,
77
- ...e,
78
- legalName: t.legalName || [t.firstName, t.lastName].filter(Boolean).join(" ")
79
- } : {
80
- ...t,
81
- ...e
82
- });
83
- }, [G]);
84
- return /* @__PURE__ */ h("div", {
85
- ref: K,
86
- className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:rounded-lg ttw:border ttw:border-border ttw:bg-card ttw:p-4",
87
- children: [
88
- /* @__PURE__ */ h("div", {
89
- className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-2",
90
- children: [/* @__PURE__ */ m("p", {
91
- className: "ttw:text-base ttw:font-semibold ttw:text-foreground",
92
- children: y === "edit" ? A.editTitle : A.createTitle
93
- }), /* @__PURE__ */ m(e, {
94
- type: "button",
95
- variant: "ghost",
96
- size: "icon",
97
- "aria-label": A.close,
98
- onClick: D,
99
- children: /* @__PURE__ */ m(v, { className: "ttw:size-4" })
100
- })]
101
- }),
102
- /* @__PURE__ */ m(r, {
103
- mode: y,
104
- counterpartMode: "vendor",
105
- values: H.values,
106
- errors: H.errors,
107
- stateOptions: z,
108
- onChange: q,
109
- onAddressChange: (e) => {
110
- R(!0), G((t) => ({
111
- ...t,
112
- address: {
113
- ...t.address,
114
- ...e
115
- }
116
- }));
117
- },
118
- sections: {
119
- entityType: !0,
120
- profileHeading: !1,
121
- title: !1,
122
- taxId: !1,
123
- address: "collapsible",
124
- bankAccount: !1
125
- },
126
- sectionsToExpand: H.sectionsToExpand,
127
- onAddressExpand: H.expandAddress,
128
- labels: { businessNameLabel: A.nameLabel }
129
- }),
130
- /* @__PURE__ */ h("div", {
131
- className: "ttw:flex ttw:flex-col ttw:gap-1",
132
- children: [/* @__PURE__ */ m("p", {
133
- className: "ttw:text-sm ttw:font-semibold ttw:text-foreground",
134
- children: A.paymentMethodsHeading
135
- }), /* @__PURE__ */ m("p", {
136
- className: "ttw:text-sm ttw:text-muted-foreground",
137
- children: A.paymentMethodsDescription
138
- })]
139
- }),
140
- /* @__PURE__ */ h("div", {
141
- className: "ttw:flex ttw:gap-3 ttw:rounded-lg ttw:border ttw:border-border ttw:p-3",
142
- children: [/* @__PURE__ */ m("span", {
143
- className: "ttw:flex ttw:size-8 ttw:shrink-0 ttw:items-center ttw:justify-center ttw:rounded-md ttw:bg-primary",
144
- children: /* @__PURE__ */ m(g, {
145
- "aria-hidden": !0,
146
- className: "ttw:size-4 ttw:text-white"
147
- })
148
- }), /* @__PURE__ */ h("div", {
149
- className: "ttw:flex ttw:flex-1 ttw:flex-col ttw:gap-3",
150
- children: [/* @__PURE__ */ h("div", {
151
- className: "ttw:flex ttw:flex-col ttw:gap-0.5",
152
- children: [/* @__PURE__ */ m("p", {
153
- className: "ttw:text-sm ttw:font-medium ttw:text-foreground",
154
- children: A.achTitle
155
- }), /* @__PURE__ */ m("p", {
156
- className: "ttw:text-sm ttw:text-muted-foreground",
157
- children: A.achDescription
158
- })]
159
- }), F ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(n, {
160
- idPrefix: "vendor-inline-ach",
161
- values: H.values.bankAccount,
162
- errors: H.errors?.bankAccount,
163
- onChange: (e) => {
164
- R(!0), G((t) => ({
165
- ...t,
166
- bankAccount: {
167
- ...t.bankAccount,
168
- ...e
169
- }
170
- }));
171
- },
172
- labels: {
173
- accountHolderName: A.accountHolderNameLabel,
174
- routingNumber: A.routingNumberLabel,
175
- accountNumber: A.accountNumberLabel
176
- }
177
- }), /* @__PURE__ */ m("p", {
178
- className: "ttw:text-sm ttw:text-muted-foreground",
179
- children: A.achHelp
180
- })] }) : /* @__PURE__ */ h(e, {
181
- type: "button",
182
- variant: "link",
183
- className: "ttw:w-fit ttw:px-0",
184
- onClick: () => I(!0),
185
- children: [/* @__PURE__ */ m(_, { className: "ttw:size-4" }), A.addBankAccount]
186
- })]
187
- })]
188
- }),
189
- /* @__PURE__ */ h("div", {
190
- className: "ttw:flex ttw:justify-end ttw:gap-2",
191
- children: [/* @__PURE__ */ m(e, {
192
- type: "button",
193
- variant: "outline",
194
- onClick: D,
195
- children: A.cancel
196
- }), /* @__PURE__ */ m(e, {
197
- type: "button",
198
- onClick: H.submit,
199
- loading: H.isSubmitting,
200
- disabled: H.isSubmitting,
201
- children: A.save
202
- })]
203
- })
204
- ]
205
- });
2
+ var e = {
3
+ payBill: "Pay bill",
4
+ markAsPaid: "Mark as paid",
5
+ reject: "Reject",
6
+ approve: "Approve",
7
+ cancel: "Cancel bill",
8
+ reopen: "Reopen bill",
9
+ forceApprove: "Approve without policy",
10
+ forceReject: "Reject without policy",
11
+ decisionDialog: {
12
+ reject: {
13
+ title: "Reject this bill?",
14
+ description: "The bill goes back as rejected and nobody else is asked to approve it.",
15
+ confirmButton: "Reject bill",
16
+ reason: {
17
+ label: "Reason",
18
+ placeholder: "Tell the submitter what needs to change",
19
+ optionalHint: "Optional"
20
+ }
21
+ },
22
+ forceApprove: {
23
+ title: "Approve outside the approval policy?",
24
+ description: "The bill becomes ready to pay straight away. Approvers who have not signed off yet will not be asked to.",
25
+ warning: "You are not one of this bill's approvers under its approval policy.",
26
+ confirmButton: "Approve anyway"
27
+ },
28
+ forceReject: {
29
+ title: "Reject outside the approval policy?",
30
+ description: "The bill is rejected straight away, before its approvers have finished signing off.",
31
+ warning: "You are not one of this bill's approvers under its approval policy.",
32
+ confirmButton: "Reject anyway"
33
+ },
34
+ cancelButton: "Back"
35
+ },
36
+ actionError: "Couldn't update this bill. Try again."
37
+ }, t = (e) => `Payment scheduled for ${e}`;
38
+ function n(e, t) {
39
+ let n = e.reason || t?.reason ? {
40
+ ...e.reason,
41
+ ...t?.reason
42
+ } : void 0, r = {
43
+ ...e,
44
+ ...t,
45
+ reason: n
46
+ };
47
+ return n || delete r.reason, r;
48
+ }
49
+ function r(e, t) {
50
+ return {
51
+ ...e,
52
+ ...t,
53
+ reject: n(e.reject, t?.reject),
54
+ forceApprove: n(e.forceApprove, t?.forceApprove),
55
+ forceReject: n(e.forceReject, t?.forceReject)
56
+ };
57
+ }
58
+ function i(t) {
59
+ let n = e, r = (e) => {
60
+ let r = n.decisionDialog[e], i = t?.decisionDialog?.[e];
61
+ return {
62
+ ...r,
63
+ ...i,
64
+ reason: r.reason ? {
65
+ ...r.reason,
66
+ ...i?.reason
67
+ } : void 0
68
+ };
69
+ };
70
+ return {
71
+ ...n,
72
+ ...t,
73
+ decisionDialog: {
74
+ ...n.decisionDialog,
75
+ ...t?.decisionDialog,
76
+ reject: r("reject"),
77
+ forceApprove: r("forceApprove"),
78
+ forceReject: r("forceReject")
79
+ }
80
+ };
206
81
  }
207
82
  //#endregion
208
- export { y as VendorInlineForm, y as default };
83
+ export { e as BILL_DETAIL_ACTIONS_LABELS_EN, t as SCHEDULED_SUMMARY_LABEL_EN, i as mergeBillDetailActionsLabels, r as mergeDecisionDialogCopy };
@@ -1,198 +1,38 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { maskAccountNumber as e } from "./index5.js";
6
- import { usePayableSuggestionsQuery as t } from "../../data-access/dist/index14.js";
7
- import "../../data-access/dist/index.js";
8
- import { VENDOR_SECTION_PROPS_LABELS_EN as n } from "./index22.js";
9
- import { counterpartFormBankAccountToCreatePayload as ee, counterpartFormBankAccountToUpdatePayload as r, getAchInstructions as i, getCounterpartEmail as a, getCounterpartName as o, getPayableAchInstructions as s, hasAchFormValues as c, resolveCounterpartBankAccountWrite as te, validateAchFormValues as ne } from "../../../shared/counterpart-management/feature/dist/lib/helpers.js";
10
- import { useCounterpartsQuery as re } from "../../../shared/counterpart-management/data-access/dist/index3.js";
11
- import { useCreateCounterpartBankAccountMutation as ie, useUpdateCounterpartBankAccountMutation as l } from "../../../shared/counterpart-management/data-access/dist/index5.js";
12
- import { useCounterpartDetails as ae } from "../../../shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js";
13
- import "../../../shared/counterpart-management/feature/dist/index.js";
14
- import { VendorInlineForm as oe } from "./index24.js";
15
- import { useCallback as u, useEffect as d, useMemo as f, useRef as p, useState as m } from "react";
16
- import { jsx as h } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as t } from "react/jsx-runtime";
17
2
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js
18
- var se = 10, ce = 300, g = {
19
- accountHolderName: "",
20
- routingNumber: "",
21
- accountNumber: ""
3
+ var n = {
4
+ previewUnavailable: "Preview not available for this file type.",
5
+ openFile: "Open file"
22
6
  };
23
- function _({ payableId: _, counterpartId: v, payableCounterpartId: y, onCounterpartChange: b, requiredError: x, labels: S }) {
24
- let C = {
7
+ function r(r, i = {}) {
8
+ if (r.mimetype === "application/pdf") return /* @__PURE__ */ e("iframe", {
9
+ src: `${r.url}#toolbar=0&navpanes=0`,
10
+ title: r.name,
11
+ referrerPolicy: "no-referrer",
12
+ className: "ttw:h-full ttw:w-full ttw:border-0"
13
+ });
14
+ if (r.mimetype.startsWith("image/")) return /* @__PURE__ */ e("img", {
15
+ src: r.url,
16
+ alt: r.name,
17
+ className: "ttw:max-h-full ttw:max-w-full ttw:object-contain"
18
+ });
19
+ let a = {
25
20
  ...n,
26
- ...S
27
- }, [w, T] = m(""), [E, D] = m(""), [O, k] = m(), [le, A] = m(!1), [j, M] = m(g), N = p(j);
28
- N.current = j;
29
- let [ue, P] = m(!1), F = c(j) || ue, [I, L] = m(), [R, z] = m(), B = p(v), [V, H] = m(!1), U = u(() => {
30
- A(!1), M(g), L(void 0), z(void 0);
31
- }, []), W = u((e) => {
32
- H(!0), b(e);
33
- }, [b]), G = t(_, { enabled: !!_ && !v && !y }).data?.suggested_counterpart?.id;
34
- d(() => {
35
- !V && !v && !y && G && W(G);
36
- }, [
37
- v,
38
- y,
39
- V,
40
- G,
41
- W
42
- ]), d(() => {
43
- B.current !== v && (B.current = v, U());
44
- }, [v, U]), d(() => {
45
- let e = setTimeout(() => {
46
- D(w.trim());
47
- }, ce);
48
- return () => clearTimeout(e);
49
- }, [w]);
50
- let K = re({
51
- sort: "counterpart_name",
52
- order: "asc",
53
- limit: se,
54
- counterpart_name__icontains: E || void 0,
55
- is_vendor: !0,
56
- enabled: !!E
57
- }), q = ae({ selectedId: v }), J = ie(), Y = l(), X = f(() => {
58
- let t = q.counterpart;
59
- if (!t) return;
60
- if (q.isBankAccountsLoading) return {
61
- name: o(t),
62
- email: a(t),
63
- methodLabel: C.paymentMethodLoading,
64
- fields: []
65
- };
66
- if (q.isBankAccountsError) return {
67
- name: o(t),
68
- email: a(t),
69
- methodLabel: C.paymentMethodUnavailable,
70
- fields: []
71
- };
72
- let n = s(q.bankAccounts);
73
- return {
74
- name: o(t),
75
- email: a(t),
76
- methodLabel: n ? C.achMethod : C.noMethod,
77
- fields: n ? [
78
- {
79
- label: C.accountHolder,
80
- value: n.account_holder_name ?? ""
81
- },
82
- {
83
- label: C.routingNumber,
84
- value: n.routing_number ?? ""
85
- },
86
- {
87
- label: C.accountNumber,
88
- value: n.account_number ?? "",
89
- maskedValue: n.account_number ? e(n.account_number) : ""
90
- }
91
- ] : []
92
- };
93
- }, [
94
- q.bankAccounts,
95
- q.counterpart,
96
- q.isBankAccountsError,
97
- q.isBankAccountsLoading,
98
- C
99
- ]), Z = f(() => i(q.bankAccounts), [q.bankAccounts]), Q = u(async () => {
100
- let e = N.current;
101
- if (!v || !c(e)) return !0;
102
- if (q.isBankAccountsLoading || q.isBankAccountsError) return !1;
103
- let t = ne(e);
104
- if (Object.keys(t).length > 0) return L(t), A(!0), !1;
105
- L(void 0);
106
- let n = te(q.bankAccounts, R ?? Z?.id);
107
- if (n.kind === "update") return await Y.mutateAsync({
108
- path: {
109
- counterpart_id: v,
110
- bank_account_id: n.bankAccountId
111
- },
112
- body: r(e, { includeAchDefaults: n.includeAchDefaults })
113
- }), z(n.bankAccountId), !0;
114
- let i = await J.mutateAsync({
115
- path: { counterpart_id: v },
116
- body: ee(e)
117
- });
118
- return z(i?.id), !0;
119
- }, [
120
- Z,
121
- v,
122
- J,
123
- q.bankAccounts,
124
- q.isBankAccountsError,
125
- q.isBankAccountsLoading,
126
- R,
127
- Y
128
- ]), de = f(() => (K.data?.data ?? []).map((e) => ({
129
- name: o(e),
130
- email: a(e),
131
- onSelect: () => W(e.id)
132
- })), [K.data, W]), $ = u(() => {
133
- k(void 0), P(!1);
134
- }, []), fe = u((e) => {
135
- k(void 0), P(!1), W(e);
136
- }, [W]);
137
- if (O) return {
138
- mode: "creating",
139
- newVendorForm: /* @__PURE__ */ h(oe, {
140
- mode: O,
141
- counterpart: O === "edit" ? q.counterpart : void 0,
142
- primaryAddress: O === "edit" ? q.primaryAddress : void 0,
143
- bankAccounts: O === "edit" ? q.bankAccounts : void 0,
144
- isBankAccountsLoading: O === "edit" ? q.isBankAccountsLoading : void 0,
145
- isBankAccountsError: O === "edit" ? q.isBankAccountsError : void 0,
146
- initialName: O === "create" ? w : void 0,
147
- onSaved: fe,
148
- onCancel: $,
149
- onDirtyChange: P
150
- }),
151
- onClear: $,
152
- hasUnsavedVendorChanges: F
153
- };
154
- if (X) {
155
- let e = q.isBankAccountsLoading || q.isBankAccountsError;
156
- return {
157
- mode: "resolved",
158
- summary: X,
159
- onEdit: e ? void 0 : () => k("edit"),
160
- onClear: () => W(void 0),
161
- paymentInstructions: e ? void 0 : {
162
- isOpen: le,
163
- values: j,
164
- errors: I,
165
- onOpen: () => {
166
- A(!0), Z && (M({
167
- accountHolderName: Z.account_holder_name ?? "",
168
- routingNumber: Z.routing_number ?? "",
169
- accountNumber: Z.account_number ?? ""
170
- }), z(Z.id));
171
- },
172
- onChange: (e) => {
173
- M((t) => ({
174
- ...t,
175
- ...e
176
- })), L(void 0);
177
- }
178
- },
179
- savePaymentInstructions: Q,
180
- hasUnsavedVendorChanges: F
181
- };
182
- }
183
- return {
184
- mode: "selecting",
185
- error: K.isError ? C.searchFailed : q.isError ? C.vendorDetailsFailed : x,
186
- search: {
187
- query: w,
188
- onQueryChange: T,
189
- isLoading: K.isLoading,
190
- onAddVendor: () => k("create"),
191
- results: de
192
- },
193
- savePaymentInstructions: Q,
194
- hasUnsavedVendorChanges: F
21
+ ...i
195
22
  };
23
+ return /* @__PURE__ */ t("div", {
24
+ className: "ttw:flex ttw:h-full ttw:w-full ttw:flex-col ttw:items-center ttw:justify-center ttw:gap-2 ttw:p-4 ttw:text-center",
25
+ children: [/* @__PURE__ */ e("p", {
26
+ className: "ttw:text-sm ttw:text-muted-foreground",
27
+ children: a.previewUnavailable
28
+ }), /* @__PURE__ */ e("a", {
29
+ href: r.url,
30
+ target: "_blank",
31
+ rel: "noreferrer",
32
+ className: "ttw:text-sm ttw:font-medium ttw:text-primary ttw:underline ttw:underline-offset-2",
33
+ children: a.openFile
34
+ })]
35
+ });
196
36
  }
197
37
  //#endregion
198
- export { _ as useVendorSectionProps };
38
+ export { n as SOURCE_DOCUMENT_PREVIEW_LABELS_EN, r as createSourceDocumentPreview };