@tesouro/embedded-components-react 0.4.20 → 0.4.21

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.
@@ -2,37 +2,42 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { useCounterpartsQuery as e } from "../../../shared/counterpart-management/data-access/dist/index3.js";
6
- import { useCreateCounterpartBankAccountMutation as t, useUpdateCounterpartBankAccountMutation as n } from "../../../shared/counterpart-management/data-access/dist/index5.js";
7
- import { usePayableSuggestionsQuery as r } from "../../data-access/dist/index17.js";
5
+ import { hasAnyScope as e } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
6
+ import { Scope as t } from "../../../shared/data-access/dist/lib/scopes.js";
7
+ import "../../../shared/data-access/dist/index.js";
8
+ import { useWidgetConfig as n } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
9
+ import "../../../shared/feature/dist/index.js";
10
+ import { useCounterpartsQuery as r } from "../../../shared/counterpart-management/data-access/dist/index3.js";
11
+ import { useCreateCounterpartBankAccountMutation as ee, useUpdateCounterpartBankAccountMutation as te } from "../../../shared/counterpart-management/data-access/dist/index5.js";
12
+ import { usePayableSuggestionsQuery as i } from "../../data-access/dist/index17.js";
8
13
  import "../../data-access/dist/index.js";
9
- import { maskAccountNumber as ee } from "./index21.js";
10
- import { counterpartFormBankAccountToCreatePayload as i, counterpartFormBankAccountToUpdatePayload as te, getAchInstructions as ne, getCounterpartEmail as a, getCounterpartName as o, getPayableAchInstructions as s, hasAchFormValues as c, resolveCounterpartBankAccountWrite as re, validateAchFormValues as ie } from "../../../shared/counterpart-management/feature/dist/lib/helpers.js";
11
- import { useCounterpartDetails as ae } from "../../../shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js";
14
+ import { maskAccountNumber as a } from "./index21.js";
15
+ import { counterpartFormBankAccountToCreatePayload as ne, counterpartFormBankAccountToUpdatePayload as re, getAchInstructions as ie, getCounterpartEmail as o, getCounterpartName as s, getPayableAchInstructions as c, hasAchFormValues as l, resolveCounterpartBankAccountWrite as ae, validateAchFormValues as oe } from "../../../shared/counterpart-management/feature/dist/lib/helpers.js";
16
+ import { useCounterpartDetails as se } from "../../../shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js";
12
17
  import "../../../shared/counterpart-management/feature/dist/index.js";
13
- import { VENDOR_SECTION_PROPS_LABELS_EN as oe } from "./index43.js";
14
- import { buildVendorPrefill as se } from "./index45.js";
15
- import { VendorInlineForm as ce } from "./index46.js";
16
- import { useCallback as l, useEffect as u, useMemo as d, useRef as f, useState as p } from "react";
17
- import { jsx as m } from "react/jsx-runtime";
18
+ import { VENDOR_SECTION_PROPS_LABELS_EN as ce } from "./index43.js";
19
+ import { buildVendorPrefill as le } from "./index45.js";
20
+ import { VendorInlineForm as ue } from "./index46.js";
21
+ import { useCallback as u, useEffect as d, useMemo as f, useRef as p, useState as m } from "react";
22
+ import { jsx as de } from "react/jsx-runtime";
18
23
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js
19
- var h = 10, le = 300, g = {
24
+ var fe = 10, h = 300, g = {
20
25
  accountHolderName: "",
21
26
  routingNumber: "",
22
27
  accountNumber: ""
23
28
  };
24
- function _({ payableId: _, counterpartId: v, payableCounterpartId: y, payableCounterpartBankAccountId: b, onCounterpartChange: x, requiredError: S, extractedVendor: C, labels: ue }) {
29
+ function _({ payableId: _, counterpartId: v, payableCounterpartId: y, payableCounterpartBankAccountId: b, isVendorKnown: x = !0, onCounterpartChange: S, requiredError: pe, extractedVendor: C, labels: me }) {
25
30
  let w = {
26
- ...oe,
27
- ...ue
28
- }, [T, E] = p(""), [D, de] = p(""), [O, k] = p(), [fe, A] = p(!1), [j, M] = p(g), N = f(j);
31
+ ...ce,
32
+ ...me
33
+ }, { initResponse: T } = n(), he = e(T?.scopes, [t.CounterpartReadOrg]), [E, D] = m(""), [ge, _e] = m(""), [O, k] = m(), [ve, A] = m(!1), [j, M] = m(g), N = p(j);
29
34
  N.current = j;
30
- let [pe, P] = p(!1), F = c(j) || pe, [I, L] = p(), [R, z] = p(), B = f(v), [V, me] = p(!1), H = l(() => {
35
+ let [P, F] = m(!1), I = l(j) || P, [ye, L] = m(), [R, z] = m(), B = p(v), [V, be] = m(!1), H = u(() => {
31
36
  A(!1), M(g), L(void 0), z(void 0);
32
- }, []), U = l((e) => {
33
- me(!0), x(e);
34
- }, [x]), W = r(_, { enabled: !!_ && !v && !y }).data?.suggested_counterpart?.id;
35
- u(() => {
37
+ }, []), U = u((e) => {
38
+ be(!0), S(e);
39
+ }, [S]), W = i(_, { enabled: !!_ && !v && !y }).data?.suggested_counterpart?.id;
40
+ d(() => {
36
41
  !V && !v && !y && W && U(W);
37
42
  }, [
38
43
  v,
@@ -40,40 +45,40 @@ function _({ payableId: _, counterpartId: v, payableCounterpartId: y, payableCou
40
45
  V,
41
46
  W,
42
47
  U
43
- ]), u(() => {
48
+ ]), d(() => {
44
49
  B.current !== v && (B.current = v, H());
45
- }, [v, H]), u(() => {
50
+ }, [v, H]), d(() => {
46
51
  let e = setTimeout(() => {
47
- de(T.trim());
48
- }, le);
52
+ _e(E.trim());
53
+ }, h);
49
54
  return () => clearTimeout(e);
50
- }, [T]);
51
- let G = e({
55
+ }, [E]);
56
+ let G = r({
52
57
  sort: "counterpart_name",
53
58
  order: "asc",
54
- limit: h,
55
- counterpart_name__icontains: D || void 0,
59
+ limit: fe,
60
+ counterpart_name__icontains: ge || void 0,
56
61
  is_vendor: !0,
57
- enabled: !!D
58
- }), K = ae({ selectedId: v }), q = t(), J = n(), Y = d(() => {
62
+ enabled: !O && !v && x && he
63
+ }), K = se({ selectedId: v }), q = ee(), J = te(), Y = f(() => {
59
64
  let e = K.counterpart;
60
65
  if (!e) return;
61
66
  if (K.isBankAccountsLoading) return {
62
- name: o(e),
63
- email: a(e),
67
+ name: s(e),
68
+ email: o(e),
64
69
  methodLabel: w.paymentMethodLoading,
65
70
  fields: []
66
71
  };
67
72
  if (K.isBankAccountsError) return {
68
- name: o(e),
69
- email: a(e),
73
+ name: s(e),
74
+ email: o(e),
70
75
  methodLabel: w.paymentMethodUnavailable,
71
76
  fields: []
72
77
  };
73
- let t = s(K.bankAccounts);
78
+ let t = c(K.bankAccounts);
74
79
  return {
75
- name: o(e),
76
- email: a(e),
80
+ name: s(e),
81
+ email: o(e),
77
82
  methodLabel: t ? w.achMethod : w.noMethod,
78
83
  fields: t ? [
79
84
  {
@@ -87,7 +92,7 @@ function _({ payableId: _, counterpartId: v, payableCounterpartId: y, payableCou
87
92
  {
88
93
  label: w.accountNumber,
89
94
  value: t.account_number ?? "",
90
- maskedValue: t.account_number ? ee(t.account_number) : ""
95
+ maskedValue: t.account_number ? a(t.account_number) : ""
91
96
  }
92
97
  ] : []
93
98
  };
@@ -97,10 +102,10 @@ function _({ payableId: _, counterpartId: v, payableCounterpartId: y, payableCou
97
102
  K.isBankAccountsError,
98
103
  K.isBankAccountsLoading,
99
104
  w
100
- ]), X = d(() => ne(K.bankAccounts), [K.bankAccounts]), Z = d(() => s(K.bankAccounts)?.id, [K.bankAccounts]), Q = l(async () => {
105
+ ]), X = f(() => ie(K.bankAccounts), [K.bankAccounts]), Z = f(() => c(K.bankAccounts)?.id, [K.bankAccounts]), Q = u(async () => {
101
106
  let e = N.current;
102
107
  if (!v) return { ok: !0 };
103
- if (!c(e)) return b && v === y ? {
108
+ if (!l(e)) return b && v === y ? {
104
109
  ok: !0,
105
110
  counterpartBankAccountId: b
106
111
  } : K.isBankAccountsLoading || K.isBankAccountsFetching || K.isBankAccountsError ? { ok: !1 } : {
@@ -108,23 +113,23 @@ function _({ payableId: _, counterpartId: v, payableCounterpartId: y, payableCou
108
113
  counterpartBankAccountId: Z
109
114
  };
110
115
  if (K.isBankAccountsLoading || K.isBankAccountsFetching || K.isBankAccountsError) return { ok: !1 };
111
- let t = ie(e);
116
+ let t = oe(e);
112
117
  if (Object.keys(t).length > 0) return L(t), A(!0), { ok: !1 };
113
118
  L(void 0);
114
- let n = re(K.bankAccounts, R ?? X?.id);
119
+ let n = ae(K.bankAccounts, R ?? X?.id);
115
120
  if (n.kind === "update") return await J.mutateAsync({
116
121
  path: {
117
122
  counterpart_id: v,
118
123
  bank_account_id: n.bankAccountId
119
124
  },
120
- body: te(e, { includeAchDefaults: n.includeAchDefaults })
125
+ body: re(e, { includeAchDefaults: n.includeAchDefaults })
121
126
  }), z(n.bankAccountId), {
122
127
  ok: !0,
123
128
  counterpartBankAccountId: n.bankAccountId
124
129
  };
125
130
  let r = await q.mutateAsync({
126
131
  path: { counterpart_id: v },
127
- body: i(e, { isDefaultForCurrency: n.isDefaultForCurrency })
132
+ body: ne(e, { isDefaultForCurrency: n.isDefaultForCurrency })
128
133
  });
129
134
  return z(r?.id), {
130
135
  ok: !0,
@@ -143,32 +148,32 @@ function _({ payableId: _, counterpartId: v, payableCounterpartId: y, payableCou
143
148
  b,
144
149
  y,
145
150
  J
146
- ]), he = d(() => (G.data?.data ?? []).map((e) => ({
147
- name: o(e),
148
- email: a(e),
151
+ ]), xe = f(() => (G.data?.data ?? []).map((e) => ({
152
+ name: s(e),
153
+ email: o(e),
149
154
  onSelect: () => U(e.id)
150
- })), [G.data, U]), ge = d(() => se(C), [C]), $ = l(() => {
151
- k(void 0), P(!1);
152
- }, []), _e = l((e) => {
153
- k(void 0), P(!1), U(e);
155
+ })), [G.data, U]), Se = f(() => le(C), [C]), $ = u(() => {
156
+ k(void 0), F(!1);
157
+ }, []), Ce = u((e) => {
158
+ k(void 0), F(!1), U(e);
154
159
  }, [U]);
155
160
  if (O) return {
156
161
  mode: "creating",
157
- newVendorForm: /* @__PURE__ */ m(ce, {
162
+ newVendorForm: /* @__PURE__ */ de(ue, {
158
163
  mode: O,
159
164
  counterpart: O === "edit" ? K.counterpart : void 0,
160
165
  primaryAddress: O === "edit" ? K.primaryAddress : void 0,
161
166
  bankAccounts: O === "edit" ? K.bankAccounts : void 0,
162
167
  isBankAccountsLoading: O === "edit" ? K.isBankAccountsLoading : void 0,
163
168
  isBankAccountsError: O === "edit" ? K.isBankAccountsError : void 0,
164
- initialName: O === "create" ? T : void 0,
165
- initialValues: O === "create" ? ge : void 0,
166
- onSaved: _e,
169
+ initialName: O === "create" ? E : void 0,
170
+ initialValues: O === "create" ? Se : void 0,
171
+ onSaved: Ce,
167
172
  onCancel: $,
168
- onDirtyChange: P
173
+ onDirtyChange: F
169
174
  }),
170
175
  onClear: $,
171
- hasUnsavedVendorChanges: F
176
+ hasUnsavedVendorChanges: I
172
177
  };
173
178
  if (Y) {
174
179
  let e = K.isBankAccountsLoading || K.isBankAccountsFetching || K.isBankAccountsError;
@@ -178,9 +183,9 @@ function _({ payableId: _, counterpartId: v, payableCounterpartId: y, payableCou
178
183
  onEdit: e ? void 0 : () => k("edit"),
179
184
  onClear: () => U(void 0),
180
185
  paymentInstructions: e ? void 0 : {
181
- isOpen: fe,
186
+ isOpen: ve,
182
187
  values: j,
183
- errors: I,
188
+ errors: ye,
184
189
  onOpen: () => {
185
190
  A(!0), X && (M({
186
191
  accountHolderName: X.account_holder_name ?? "",
@@ -196,21 +201,22 @@ function _({ payableId: _, counterpartId: v, payableCounterpartId: y, payableCou
196
201
  }
197
202
  },
198
203
  savePaymentInstructions: Q,
199
- hasUnsavedVendorChanges: F
204
+ hasUnsavedVendorChanges: I
200
205
  };
201
206
  }
207
+ let we = !x || !T || !!v && K.isLoading;
202
208
  return {
203
209
  mode: "selecting",
204
- error: G.isError ? w.searchFailed : K.isError ? w.vendorDetailsFailed : S,
210
+ error: G.isError ? w.searchFailed : K.isError ? w.vendorDetailsFailed : pe,
205
211
  search: {
206
- query: T,
207
- onQueryChange: E,
208
- isLoading: G.isLoading,
212
+ query: E,
213
+ onQueryChange: D,
214
+ isLoading: we || G.isFetching,
209
215
  onAddVendor: () => k("create"),
210
- results: he
216
+ results: xe
211
217
  },
212
218
  savePaymentInstructions: Q,
213
- hasUnsavedVendorChanges: F
219
+ hasUnsavedVendorChanges: I
214
220
  };
215
221
  }
216
222
  //#endregion
@@ -50,101 +50,102 @@ import { useVendorSectionProps as Fe } from "./index47.js";
50
50
  import { usePaymentInstructionsForm as Ie } from "./index48.js";
51
51
  import { billCreateTestIds as r } from "./index55.js";
52
52
  import { useCallback as i, useEffect as Le, useMemo as a, useRef as Re, useState as o } from "react";
53
- import { Fragment as ze, jsx as s, jsxs as Be } from "react/jsx-runtime";
54
- import { Trash2Icon as Ve } from "lucide-react";
53
+ import { Fragment as ze, jsx as s, jsxs as c } from "react/jsx-runtime";
54
+ import { Trash2Icon as Be } from "lucide-react";
55
55
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js
56
- function c({ open: c, onOpenChange: l, payableId: u, readOnly: d = !1, copy: f, onCollapse: He, poweredByBankName: Ue }) {
57
- let p = a(() => Se(f), [f]), [m, We] = o(), [h, g] = o(!1), [Ge, Ke] = o(!1), [qe, _] = o(!1), [Je, Ye] = o(), v = u ?? Je, y = oe(v, { pollWhileOcrProcessing: !0 }), b = ae(v), { initResponse: x } = re(), Xe = !!x, S = e(x?.scopes, [t.AccountingConfigReadOrg]), C = ee({ enabled: S }), w = y.data, Ze = !v || !!w, T = !d && Ze && !!v && w?.status !== "draft", Qe = !d && !!w && !Ae(w?.status), E = d || Qe, D = we({
58
- payable: w,
59
- lineItems: b.lineItems
60
- }), O = w?.counterpart_id;
56
+ function l({ open: l, onOpenChange: u, payableId: Ve, readOnly: d = !1, copy: He, onCollapse: Ue, poweredByBankName: We }) {
57
+ let f = a(() => Se(He), [He]), [p, Ge] = o(), [m, Ke] = o(!1), [qe, Je] = o(!1), [Ye, h] = o(!1), [Xe, Ze] = o(), g = Ve ?? Xe, _ = oe(g, { pollWhileOcrProcessing: !0 }), v = ae(g), { initResponse: y } = re(), Qe = !!y, b = e(y?.scopes, [t.AccountingConfigReadOrg]), x = ee({ enabled: b }), S = _.data, C = !g || !!S, w = !d && C && !!g && S?.status !== "draft", $e = !d && !!S && !Ae(S?.status), T = d || $e, E = we({
58
+ payable: S,
59
+ lineItems: v.lineItems
60
+ }), D = S?.counterpart_id;
61
61
  Le(() => {
62
- h || O && (We(O), g(!0));
63
- }, [h, O]);
64
- let $e = i((e) => {
65
- g(!0), We(e);
66
- }, []), k = Fe({
67
- payableId: d ? void 0 : v,
68
- counterpartId: d ? void 0 : m,
69
- payableCounterpartId: O,
70
- onCounterpartChange: $e,
71
- requiredError: D.errors?.vendor,
72
- payableCounterpartBankAccountId: w?.counterpart_bank_account_id ?? void 0,
73
- extractedVendor: w?.counterpart_raw_data ?? void 0
74
- }), et = !!(v && h) && !m, A = y.refetch, tt = i(async () => {
75
- let { data: e } = await A();
62
+ m || D && (Ge(D), Ke(!0));
63
+ }, [m, D]);
64
+ let et = i((e) => {
65
+ Ke(!0), Ge(e);
66
+ }, []), O = Fe({
67
+ payableId: d ? void 0 : g,
68
+ counterpartId: d ? void 0 : p,
69
+ payableCounterpartId: D,
70
+ isVendorKnown: !d && C,
71
+ onCounterpartChange: et,
72
+ requiredError: E.errors?.vendor,
73
+ payableCounterpartBankAccountId: S?.counterpart_bank_account_id ?? void 0,
74
+ extractedVendor: S?.counterpart_raw_data ?? void 0
75
+ }), tt = !!(g && m) && !p, k = _.refetch, nt = i(async () => {
76
+ let { data: e } = await k();
76
77
  return e?.status ?? void 0;
77
- }, [A]), nt = a(() => T ? { draftSaved: xe.submittedSaved } : void 0, [T]), j = Ce({
78
- payableId: u,
79
- form: D,
80
- labels: nt,
81
- counterpartId: m,
82
- clearCounterpart: et,
83
- prepareVendorForSave: k.savePaymentInstructions,
84
- onPayableCreated: Ye,
85
- onSaved: Ye,
86
- onDraftSaved: () => l(!1),
87
- onFinalized: () => l(!1),
88
- readSavedStatus: T ? tt : void 0
89
- }), rt = !!(j.isSavingDraft || j.isFinalizing), M = d ? v : void 0, N = De({
78
+ }, [k]), rt = a(() => w ? { draftSaved: xe.submittedSaved } : void 0, [w]), A = Ce({
79
+ payableId: Ve,
80
+ form: E,
81
+ labels: rt,
82
+ counterpartId: p,
83
+ clearCounterpart: tt,
84
+ prepareVendorForSave: O.savePaymentInstructions,
85
+ onPayableCreated: Ze,
86
+ onSaved: Ze,
87
+ onDraftSaved: () => u(!1),
88
+ onFinalized: () => u(!1),
89
+ readSavedStatus: w ? nt : void 0
90
+ }), j = !!(A.isSavingDraft || A.isFinalizing), M = d ? g : void 0, N = De({
90
91
  payableId: M,
91
- status: w?.status
92
- }), P = Re(null), F = ke({
93
- payableId: v,
94
- scheduledPaymentDate: w?.scheduled_payment_date,
95
- enabled: d || T
96
- }), it = ce(w), I = ge(x?.scopes), L = ve({
97
- counterpartId: d ? O : void 0,
98
- currency: w?.currency,
99
- currentBankAccountId: d ? w?.counterpart_bank_account_id ?? void 0 : void 0,
100
- enabled: I && d
101
- }), R = Ie({
92
+ status: S?.status
93
+ }), it = Re(null), P = ke({
94
+ payableId: g,
95
+ scheduledPaymentDate: S?.scheduled_payment_date,
96
+ enabled: d || w
97
+ }), at = ce(S), F = ge(y?.scopes), I = ve({
98
+ counterpartId: d ? D : void 0,
99
+ currency: S?.currency,
100
+ currentBankAccountId: d ? S?.counterpart_bank_account_id ?? void 0 : void 0,
101
+ enabled: F && d
102
+ }), L = Ie({
102
103
  payableId: M,
103
- counterpartId: d ? O : void 0,
104
- currentBankAccountId: w?.counterpart_bank_account_id ?? void 0,
105
- canReadCounterpartBankAccounts: I,
106
- saveErrorMessage: p.detail.paymentInstructionsSaveError,
107
- linkErrorMessage: p.detail.paymentInstructionsLinkError
108
- }), at = e(x?.scopes, [t.PayableWriteOrg]), ot = e(x?.scopes, [t.CounterpartWriteOrg]) && at, st = ot && se(w?.status) && !F.hasScheduledPayment && !F.isResolving, z = be({
104
+ counterpartId: d ? D : void 0,
105
+ currentBankAccountId: S?.counterpart_bank_account_id ?? void 0,
106
+ canReadCounterpartBankAccounts: F,
107
+ saveErrorMessage: f.detail.paymentInstructionsSaveError,
108
+ linkErrorMessage: f.detail.paymentInstructionsLinkError
109
+ }), ot = e(y?.scopes, [t.PayableWriteOrg]), R = e(y?.scopes, [t.CounterpartWriteOrg]) && ot, st = R && se(S?.status) && !P.hasScheduledPayment && !P.isResolving, z = be({
109
110
  payableId: M,
110
- amountDueMinorUnits: _e(w) ?? 0,
111
- amountToPayMinorUnits: w?.amount_to_pay ?? void 0,
112
- currencyCode: w?.currency ?? void 0,
113
- dueDate: w?.due_date,
114
- hasScheduledPayment: F.hasScheduledPayment,
115
- labels: p.markAsPaid
111
+ amountDueMinorUnits: _e(S) ?? 0,
112
+ amountToPayMinorUnits: S?.amount_to_pay ?? void 0,
113
+ currencyCode: S?.currency ?? void 0,
114
+ dueDate: S?.due_date,
115
+ hasScheduledPayment: P.hasScheduledPayment,
116
+ labels: f.markAsPaid
116
117
  }), B = Ee({
117
118
  payableId: M,
118
- approvalPolicyId: w?.approval_policy_id,
119
+ approvalPolicyId: S?.approval_policy_id,
119
120
  enabled: d,
120
- copy: p.approvalPolicyCopy
121
+ copy: f.approvalPolicyCopy
121
122
  }), ct = he({
122
- status: w?.status,
123
- scopes: x?.scopes,
123
+ status: S?.status,
124
+ scopes: y?.scopes,
124
125
  hasWaitingRequest: N.hasWaitingRequest,
125
126
  arePendingApproversUnknown: B.isLoading
126
127
  }), { actions: V, decisionDialog: lt, isActionPending: ut } = Oe({
127
- payableId: d || T ? v : void 0,
128
- status: w?.status,
128
+ payableId: d || w ? g : void 0,
129
+ status: S?.status,
129
130
  currentApprovalRequestId: N.id,
130
131
  hasWaitingRequest: N.hasWaitingRequest,
131
132
  arePendingApproversUnknown: B.isLoading,
132
- hasScheduledPayment: F.hasScheduledPayment,
133
- scheduledPaymentIntentId: F.scheduledPaymentIntentId,
134
- isScheduledPaymentUnknown: F.isResolving,
133
+ hasScheduledPayment: P.hasScheduledPayment,
134
+ scheduledPaymentIntentId: P.scheduledPaymentIntentId,
135
+ isScheduledPaymentUnknown: P.isResolving,
135
136
  pendingApprovers: B.pendingApprovers,
136
- labels: p.actions,
137
+ labels: f.actions,
137
138
  isMarkAsPaidPending: z.isPending,
138
139
  onMarkAsPaidSelect: z.open,
139
- onPayBillSelect: () => P.current?.open(),
140
- onActionSucceeded: T ? () => l(!1) : void 0
140
+ onPayBillSelect: () => it.current?.open(),
141
+ onActionSucceeded: w ? () => u(!1) : void 0
141
142
  }), H = je({
142
- payableId: v,
143
- status: w?.status,
143
+ payableId: g,
144
+ status: S?.status,
144
145
  enabled: !d,
145
- labels: p.deleteDraft,
146
- onDeleted: () => l(!1)
147
- }), U = rt || ut, W = y.isLoading || b.isResolving || C.isResolving || L.isLoading, G = y.isError || b.isError || C.isError, dt = a(() => [...H.menuItems, ...T || d && !W && !G ? V.menu.map((e) => ({
146
+ labels: f.deleteDraft,
147
+ onDeleted: () => u(!1)
148
+ }), U = j || ut, W = _.isLoading || v.isResolving || x.isResolving || I.isLoading, G = _.isError || v.isError || x.isError, dt = a(() => [...H.menuItems, ...w || d && !W && !G ? V.menu.map((e) => ({
148
149
  id: e.id,
149
150
  label: e.label,
150
151
  onSelect: e.onSelect,
@@ -154,194 +155,195 @@ function c({ open: c, onOpenChange: l, payableId: u, readOnly: d = !1, copy: f,
154
155
  })) : []], [
155
156
  V.menu,
156
157
  H.menuItems,
157
- T,
158
+ w,
158
159
  d,
159
160
  W,
160
161
  G
161
- ]), K = a(() => (C.data?.data ?? []).map((e) => ({
162
+ ]), K = a(() => (x.data?.data ?? []).map((e) => ({
162
163
  value: e.id,
163
164
  label: [e.nominal_code, e.name].filter(Boolean).join(" — ")
164
- })), [C.data]), q;
165
- Xe && (S ? C.isError ? q = p.lineItemsGlCodeUnavailable.loadError : !C.isResolving && K.length === 0 && (q = p.lineItemsGlCodeUnavailable.empty) : q = p.lineItemsGlCodeUnavailable.noAccess);
166
- let ft = !Xe || !!q || C.isResolving, pt = S && !C.isResolving && !C.isError, J = ie(M), mt = e(x?.scopes, [t.UserReadOrg]), ht = te({ enabled: d && mt }), gt = a(() => Ne(J.data?.data ?? [], ht.data?.data ?? [], p.history), [
165
+ })), [x.data]), q;
166
+ Qe && (b ? x.isError ? q = f.lineItemsGlCodeUnavailable.loadError : !x.isResolving && K.length === 0 && (q = f.lineItemsGlCodeUnavailable.empty) : q = f.lineItemsGlCodeUnavailable.noAccess);
167
+ let ft = !Qe || !!q || x.isResolving, pt = b && !x.isResolving && !x.isError, J = ie(M), mt = e(y?.scopes, [t.UserReadOrg]), ht = te({ enabled: d && mt }), gt = a(() => Ne(J.data?.data ?? [], ht.data?.data ?? [], f.history), [
167
168
  J.data,
168
169
  ht.data,
169
- p.history
170
+ f.history
170
171
  ]), _t = a(() => Te({
171
- records: F.paymentRecords,
172
+ records: P.paymentRecords,
172
173
  events: J.data?.data ?? [],
173
- currencyCode: w?.currency,
174
- labels: p.detail
174
+ currencyCode: S?.currency,
175
+ labels: f.detail
175
176
  }), [
176
- F.paymentRecords,
177
+ P.paymentRecords,
177
178
  J.data,
178
- w?.currency,
179
- p.detail
180
- ]), vt = a(() => d && w ? Me({
181
- payable: w,
182
- lineItems: b.lineItems,
179
+ S?.currency,
180
+ f.detail
181
+ ]), vt = a(() => d && S ? Me({
182
+ payable: S,
183
+ lineItems: v.lineItems,
183
184
  glCodeOptions: K,
184
185
  glCodeRosterAvailable: pt,
185
186
  history: gt,
186
187
  paymentHistory: _t,
187
188
  approvalPolicy: B.view,
188
- labels: p.detail,
189
- hasScheduledPayment: F.hasScheduledPayment,
190
- payableAchInstructions: L.achInstructions,
191
- payableAchInstructionsReadable: I && !L.isError
189
+ labels: f.detail,
190
+ hasScheduledPayment: P.hasScheduledPayment,
191
+ payableAchInstructions: I.achInstructions,
192
+ payableAchInstructionsReadable: F && !I.isError
192
193
  }) : void 0, [
193
- F.hasScheduledPayment,
194
+ P.hasScheduledPayment,
194
195
  B.view,
195
- I,
196
- p.detail,
196
+ F,
197
+ f.detail,
197
198
  K,
198
199
  pt,
199
200
  gt,
200
- b.lineItems,
201
- w,
202
- L.achInstructions,
203
- L.isError,
201
+ v.lineItems,
202
+ S,
203
+ I.achInstructions,
204
+ I.isError,
204
205
  _t,
205
206
  d
206
- ]), Y = w?.source_of_payable_data === "ocr", X = it?.name, yt = d ? X ? p.viewTitle(X) : p.readOnlyTitle : X && (Y || T) ? p.extractedTitle(X) : p.newTitle, bt = d && w?.created_at ? p.addedOn(ne(w.created_at.slice(0, 10))) : void 0, Z = i(() => {
207
- let e = D.isDirty || k.hasUnsavedVendorChanges || !!j.stagedFile || j.isFileDeletionPending;
208
- if (!E && e) {
209
- _(!0);
207
+ ]), Y = S?.source_of_payable_data === "ocr", X = at?.name, yt = d ? X ? f.viewTitle(X) : f.readOnlyTitle : X && (Y || w) ? f.extractedTitle(X) : f.newTitle, bt = d && S?.created_at ? f.addedOn(ne(S.created_at.slice(0, 10))) : void 0, Z = i(() => {
208
+ let e = E.isDirty || O.hasUnsavedVendorChanges || !!A.stagedFile || A.isFileDeletionPending;
209
+ if (!T && e) {
210
+ h(!0);
210
211
  return;
211
212
  }
212
- l(!1);
213
+ u(!1);
213
214
  }, [
214
- j.isFileDeletionPending,
215
- j.stagedFile,
216
- D.isDirty,
217
- E,
218
- l,
219
- k.hasUnsavedVendorChanges
215
+ A.isFileDeletionPending,
216
+ A.stagedFile,
217
+ E.isDirty,
218
+ T,
219
+ u,
220
+ O.hasUnsavedVendorChanges
220
221
  ]), xt = i(() => {
221
- _(!1), l(!1);
222
- }, [l]), Q = b.isResolving || k.mode === "creating", St = i(async () => {
222
+ h(!1), u(!1);
223
+ }, [u]), Q = v.isResolving || O.mode === "creating", St = i(async () => {
223
224
  if (Q) return;
224
- let e = await j.saveDraft();
225
- _(!1), e && l(!1);
225
+ let e = await A.saveDraft();
226
+ h(!1), e && u(!1);
226
227
  }, [
227
- j,
228
+ A,
228
229
  Q,
229
- l
230
+ u
230
231
  ]), $ = me({
231
- payable: w,
232
- onRemoved: () => l(!1),
233
- canManage: at
232
+ payable: S,
233
+ onRemoved: () => u(!1),
234
+ canManage: ot
234
235
  }), Ct = i((e) => {
235
- if (!(U || $.isBusy)) return e ? l(!0) : Z();
236
+ if (!(U || $.isBusy)) return e ? u(!0) : Z();
236
237
  }, [
237
238
  $.isBusy,
238
239
  U,
239
240
  Z,
240
- l
241
- ]), wt = $.isPossibleDuplicate, Tt = !d && Y && !Ge, Et = wt || Tt ? /* @__PURE__ */ Be(ze, { children: [wt ? /* @__PURE__ */ s(ue, {
241
+ u
242
+ ]), wt = $.isPossibleDuplicate, Tt = !d && Y && !qe, Et = wt || Tt ? /* @__PURE__ */ c(ze, { children: [wt ? /* @__PURE__ */ s(ue, {
242
243
  onNotADuplicate: $.onNotADuplicate,
243
244
  onRemoveBill: $.onRemoveBill,
244
245
  isActionDisabled: $.isBusy,
245
246
  labels: $.removeBillLabel ? { removeBillButton: $.removeBillLabel } : void 0,
246
247
  testId: r.duplicateNotice
247
- }) : null, Tt ? /* @__PURE__ */ s(de, { onDismiss: () => Ke(!0) }) : null] }) : void 0;
248
- return /* @__PURE__ */ Be(ze, { children: [
248
+ }) : null, Tt ? /* @__PURE__ */ s(de, { onDismiss: () => Je(!0) }) : null] }) : void 0;
249
+ return /* @__PURE__ */ c(ze, { children: [
249
250
  /* @__PURE__ */ s(le, {
250
- open: c,
251
+ open: l,
251
252
  onOpenChange: Ct,
252
253
  title: yt,
253
254
  subtitle: bt,
254
255
  notice: Et,
255
256
  vendor: {
256
- ...k,
257
+ ...O,
257
258
  testId: r.vendorSection
258
259
  },
259
- values: D.values,
260
- errors: D.errors,
261
- onChange: D.onChange,
260
+ values: E.values,
261
+ errors: E.errors,
262
+ onChange: E.onChange,
262
263
  lineItems: {
263
- items: D.lineItemRows,
264
+ items: E.lineItemRows,
264
265
  glCodeOptions: K,
265
266
  glCodeDisabled: ft,
266
267
  glCodeUnavailableMessage: q,
267
- discount: D.discount,
268
- onDiscountChange: D.onDiscountChange,
269
- tax: D.tax,
270
- onTaxChange: D.onTaxChange,
271
- total: D.total,
272
- onTotalChange: D.onTotalChange,
273
- onAddLineItem: D.onAddLineItem,
274
- errors: D.lineItemErrors,
275
- totalsErrors: D.totalsErrors,
268
+ discount: E.discount,
269
+ onDiscountChange: E.onDiscountChange,
270
+ tax: E.tax,
271
+ onTaxChange: E.onTaxChange,
272
+ total: E.total,
273
+ onTotalChange: E.onTotalChange,
274
+ onAddLineItem: E.onAddLineItem,
275
+ errors: E.lineItemErrors,
276
+ totalsErrors: E.totalsErrors,
276
277
  testId: r.lineItems
277
278
  },
278
279
  documentPanel: /* @__PURE__ */ s(Pe, {
279
- payableId: v,
280
- readOnly: E,
281
- isDocumentPending: !!v && !w?.file && (y.isLoading || w?.ocr_status === "processing"),
282
- file: w?.file ? {
283
- id: w.file.id,
284
- name: w.file.name,
285
- url: w.file.url,
286
- mimetype: w.file.mimetype
280
+ payableId: g,
281
+ readOnly: T,
282
+ isDocumentPending: !!g && !S?.file && (_.isLoading || S?.ocr_status === "processing"),
283
+ file: S?.file ? {
284
+ id: S.file.id,
285
+ name: S.file.name,
286
+ url: S.file.url,
287
+ mimetype: S.file.mimetype
287
288
  } : void 0,
288
289
  staging: {
289
- stagedFile: j.stagedFile,
290
- onFileStaged: j.stageFile,
291
- onClearStagedFile: j.clearStagedFile,
292
- isSaving: rt
290
+ stagedFile: A.stagedFile,
291
+ onFileStaged: A.stageFile,
292
+ onClearStagedFile: A.clearStagedFile,
293
+ isSaving: j
293
294
  },
294
295
  deletion: {
295
- isPending: j.isFileDeletionPending,
296
- onRequest: j.requestFileDeletion,
297
- onDetachNow: j.detachFileNow,
298
- isDeleting: j.isDeletingFile,
299
- hasFailed: j.hasFileDeletionFailed
296
+ isPending: A.isFileDeletionPending,
297
+ onRequest: A.requestFileDeletion,
298
+ onDetachNow: A.detachFileNow,
299
+ isDeleting: A.isDeletingFile,
300
+ hasFailed: A.hasFileDeletionFailed
300
301
  }
301
302
  }),
302
303
  menuItems: dt,
303
- readOnly: E,
304
+ readOnly: T,
304
305
  detail: d ? {
305
306
  view: vt,
306
307
  actions: V,
307
- scheduledSummary: F.hasScheduledPayment && F.scheduledDateLabel ? p.scheduledSummary(F.scheduledDateLabel) : void 0,
308
+ scheduledSummary: P.hasScheduledPayment && P.scheduledDateLabel ? f.scheduledSummary(P.scheduledDateLabel) : void 0,
308
309
  showApprovalOverrideNotice: ct,
309
- onEditPaymentInstructions: O && st ? R.open : void 0,
310
- paymentInstructionsForm: O && st ? {
311
- isOpen: R.isOpen,
312
- values: R.values,
313
- errors: R.errors,
314
- isSaving: R.isSaving,
315
- onOpen: R.open,
316
- onCancel: R.close,
317
- onChange: R.onChange,
318
- onSave: R.save
310
+ onEditPaymentInstructions: D && st ? L.open : void 0,
311
+ paymentInstructionsForm: D && (st || R && S?.status === "rejected") ? {
312
+ isOpen: L.isOpen,
313
+ values: L.values,
314
+ errors: L.errors,
315
+ isSaving: L.isSaving,
316
+ onOpen: L.open,
317
+ onCancel: L.close,
318
+ onChange: L.onChange,
319
+ onSave: L.save
319
320
  } : void 0,
321
+ hideMissingPaymentInstructions: S?.status === "paid" || S?.status === "canceled",
320
322
  isLoading: W,
321
323
  isError: G,
322
- paymentHistoryError: F.isError || J.isError,
323
- paymentHistoryLoading: F.isResolving || J.isLoading
324
+ paymentHistoryError: P.isError || J.isError,
325
+ paymentHistoryLoading: P.isResolving || J.isLoading
324
326
  } : void 0,
325
- isLineItemsLoading: b.isResolving,
327
+ isLineItemsLoading: v.isResolving,
326
328
  isSaving: U,
327
- isSavingDraft: j.isSavingDraft,
328
- isSubmitting: j.isFinalizing,
329
+ isSavingDraft: A.isSavingDraft,
330
+ isSubmitting: A.isFinalizing,
329
331
  onCancel: Z,
330
- onCollapse: d ? He : void 0,
331
- onSaveDraft: j.saveDraft,
332
- onFinalize: j.finalize,
333
- scrollToErrorToken: j.scrollToErrorToken,
334
- showSubmit: !E && Ze,
332
+ onCollapse: d ? Ue : void 0,
333
+ onSaveDraft: A.saveDraft,
334
+ onFinalize: A.finalize,
335
+ scrollToErrorToken: A.scrollToErrorToken,
336
+ showSubmit: !T && C,
335
337
  testId: r.dialog
336
338
  }),
337
339
  /* @__PURE__ */ s(pe, {
338
- open: qe,
340
+ open: Ye,
339
341
  onSaveDraft: St,
340
342
  onDiscard: xt,
341
- onCancel: () => _(!1),
342
- isSaving: j.isSavingDraft,
343
+ onCancel: () => h(!1),
344
+ isSaving: A.isSavingDraft,
343
345
  isSaveDraftDisabled: Q,
344
- labels: p.unsavedChanges,
346
+ labels: f.unsavedChanges,
345
347
  testId: r.unsavedDialog,
346
348
  saveDraftTestId: r.unsavedSaveDraft,
347
349
  discardTestId: r.unsavedDiscard,
@@ -349,14 +351,14 @@ function c({ open: c, onOpenChange: l, payableId: u, readOnly: d = !1, copy: f,
349
351
  }),
350
352
  /* @__PURE__ */ s(n, {
351
353
  ...lt,
352
- labels: { cancelButton: p.actions.decisionDialog.cancelButton },
354
+ labels: { cancelButton: f.actions.decisionDialog.cancelButton },
353
355
  testId: r.decisionDialog,
354
356
  confirmTestId: r.decisionConfirm,
355
357
  reasonTestId: r.decisionReason
356
358
  }),
357
359
  /* @__PURE__ */ s(n, {
358
360
  ...H.dialog,
359
- labels: { cancelButton: p.actions.decisionDialog.cancelButton },
361
+ labels: { cancelButton: f.actions.decisionDialog.cancelButton },
360
362
  testId: r.deleteDraftDialog,
361
363
  confirmTestId: r.deleteDraftConfirm
362
364
  }),
@@ -366,20 +368,20 @@ function c({ open: c, onOpenChange: l, payableId: u, readOnly: d = !1, copy: f,
366
368
  onConfirm: $.removeConfirmation.onConfirm,
367
369
  onCancel: $.removeConfirmation.onCancel,
368
370
  isPending: $.removeConfirmation.isPending,
369
- confirmIcon: /* @__PURE__ */ s(Ve, {}),
371
+ confirmIcon: /* @__PURE__ */ s(Be, {}),
370
372
  labels: { cancelButton: $.removeConfirmation.cancelButtonLabel },
371
373
  testId: r.duplicateRemoveDialog,
372
374
  confirmTestId: r.duplicateRemoveConfirm
373
375
  }),
374
376
  /* @__PURE__ */ s(fe, { ...z.dialogProps }),
375
- d && w ? /* @__PURE__ */ s(ye, {
376
- ref: P,
377
- payable: w,
378
- onMissingAchInstructions: ot ? R.open : void 0,
379
- poweredByBankName: Ue,
380
- labels: p.payBill
377
+ d && S ? /* @__PURE__ */ s(ye, {
378
+ ref: it,
379
+ payable: S,
380
+ onMissingAchInstructions: R ? L.open : void 0,
381
+ poweredByBankName: We,
382
+ labels: f.payBill
381
383
  }) : null
382
384
  ] });
383
385
  }
384
386
  //#endregion
385
- export { c as BillCreateDialog, c as default };
387
+ export { l as BillCreateDialog, l as default };
@@ -18,16 +18,16 @@ import { jsx as h, jsxs as g } from "react/jsx-runtime";
18
18
  import { AlertTriangle as _ } from "lucide-react";
19
19
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index30.js
20
20
  var v = "ttw:text-base ttw:font-semibold", y = "ttw:px-3 ttw:py-2", b = "ttw:flex ttw:items-center ttw:justify-between ttw:gap-4 ttw:border-b ttw:border-border ttw:py-3 ttw:last:border-b-0";
21
- function x({ view: x, actions: S = p, scheduledSummary: C, showApprovalOverrideNotice: w, paymentInstructionsForm: T, onEditPaymentInstructions: E, paymentHistoryError: D, paymentHistoryLoading: O, isLoading: k, isError: A, labels: j }) {
22
- let M = m(() => d(j), [j]), N = m(() => ({
23
- ...M.payToCard,
24
- payToHeading: x?.paidOnLabel ? M.payToHeadingPaid : M.payToHeading
25
- }), [M, x?.paidOnLabel]);
26
- if (A) return /* @__PURE__ */ h(a, {
27
- title: M.errorTitle,
28
- description: M.errorDescription
21
+ function x({ view: x, actions: S = p, scheduledSummary: C, showApprovalOverrideNotice: w, paymentInstructionsForm: T, hideMissingPaymentInstructions: E, onEditPaymentInstructions: D, paymentHistoryError: O, paymentHistoryLoading: k, isLoading: A, isError: j, labels: M }) {
22
+ let N = m(() => d(M), [M]), P = m(() => ({
23
+ ...N.payToCard,
24
+ payToHeading: x?.paidOnLabel ? N.payToHeadingPaid : N.payToHeading
25
+ }), [N, x?.paidOnLabel]);
26
+ if (j) return /* @__PURE__ */ h(a, {
27
+ title: N.errorTitle,
28
+ description: N.errorDescription
29
29
  });
30
- if (k || !x) return /* @__PURE__ */ g("div", {
30
+ if (A || !x) return /* @__PURE__ */ g("div", {
31
31
  "aria-hidden": !0,
32
32
  className: "ttw:flex ttw:flex-col ttw:gap-6",
33
33
  children: [
@@ -36,24 +36,24 @@ function x({ view: x, actions: S = p, scheduledSummary: C, showApprovalOverrideN
36
36
  /* @__PURE__ */ h(n, { className: "ttw:h-24 ttw:w-full" })
37
37
  ]
38
38
  });
39
- let P = x.payTo.fields.length === 0 && T;
39
+ let F = E || x.payTo.fields.length > 0 ? void 0 : T;
40
40
  return /* @__PURE__ */ g("div", {
41
41
  className: "ttw:flex ttw:flex-col ttw:gap-6",
42
42
  children: [
43
- P ? /* @__PURE__ */ g("div", {
43
+ F ? /* @__PURE__ */ g("div", {
44
44
  className: "ttw:flex ttw:items-center ttw:gap-3 ttw:rounded-md ttw:border ttw:border-amber-200 ttw:bg-amber-50 ttw:px-3 ttw:py-2.5",
45
45
  children: [
46
46
  /* @__PURE__ */ h(_, { className: "ttw:size-4 ttw:shrink-0 ttw:text-amber-800" }),
47
47
  /* @__PURE__ */ h("p", {
48
48
  className: "ttw:flex-1 ttw:text-sm ttw:text-foreground",
49
- children: M.missingPaymentInstructionsBanner
49
+ children: N.missingPaymentInstructionsBanner
50
50
  }),
51
51
  /* @__PURE__ */ h(t, {
52
52
  type: "button",
53
53
  variant: "outline",
54
54
  size: "sm",
55
- onClick: T.onOpen,
56
- children: M.addPaymentInstructions
55
+ onClick: F.onOpen,
56
+ children: N.addPaymentInstructions
57
57
  })
58
58
  ]
59
59
  }) : null,
@@ -66,7 +66,7 @@ function x({ view: x, actions: S = p, scheduledSummary: C, showApprovalOverrideN
66
66
  className: "ttw:flex ttw:flex-col ttw:gap-1",
67
67
  children: [/* @__PURE__ */ h("span", {
68
68
  className: "ttw:text-sm ttw:text-muted-foreground",
69
- children: M.amountDueHeading
69
+ children: N.amountDueHeading
70
70
  }), /* @__PURE__ */ h("span", {
71
71
  className: "ttw:text-3xl ttw:font-semibold",
72
72
  children: x.amountDue
@@ -75,7 +75,7 @@ function x({ view: x, actions: S = p, scheduledSummary: C, showApprovalOverrideN
75
75
  className: "ttw:flex ttw:flex-col ttw:gap-1",
76
76
  children: [/* @__PURE__ */ h("span", {
77
77
  className: "ttw:text-sm ttw:text-muted-foreground",
78
- children: M.amountPaidHeading
78
+ children: N.amountPaidHeading
79
79
  }), /* @__PURE__ */ h("span", {
80
80
  className: "ttw:text-3xl ttw:font-semibold ttw:text-emerald-600",
81
81
  children: x.amountPaid
@@ -85,7 +85,7 @@ function x({ view: x, actions: S = p, scheduledSummary: C, showApprovalOverrideN
85
85
  className: "ttw:flex ttw:flex-col ttw:gap-1",
86
86
  children: [/* @__PURE__ */ h("span", {
87
87
  className: "ttw:text-sm ttw:text-muted-foreground",
88
- children: M.amountDueHeading
88
+ children: N.amountDueHeading
89
89
  }), /* @__PURE__ */ h("span", {
90
90
  className: "ttw:text-3xl ttw:font-semibold",
91
91
  children: x.amountDue
@@ -98,7 +98,7 @@ function x({ view: x, actions: S = p, scheduledSummary: C, showApprovalOverrideN
98
98
  }) : /* @__PURE__ */ h(s, {
99
99
  status: x.status,
100
100
  tone: x.statusTone,
101
- labels: M.statusBadge
101
+ labels: N.statusBadge
102
102
  }) }),
103
103
  /* @__PURE__ */ g("div", {
104
104
  className: "ttw:grid ttw:grid-cols-2 ttw:gap-x-6",
@@ -106,7 +106,7 @@ function x({ view: x, actions: S = p, scheduledSummary: C, showApprovalOverrideN
106
106
  className: "ttw:flex ttw:flex-col",
107
107
  children: [/* @__PURE__ */ h("span", {
108
108
  className: "ttw:text-xs ttw:text-muted-foreground",
109
- children: M.invoiceDateLabel
109
+ children: N.invoiceDateLabel
110
110
  }), /* @__PURE__ */ h("span", {
111
111
  className: "ttw:text-sm ttw:font-medium",
112
112
  children: x.invoiceDateLabel
@@ -115,19 +115,19 @@ function x({ view: x, actions: S = p, scheduledSummary: C, showApprovalOverrideN
115
115
  className: "ttw:flex ttw:flex-col",
116
116
  children: [/* @__PURE__ */ h("span", {
117
117
  className: "ttw:text-xs ttw:text-muted-foreground",
118
- children: M.dueDateLabel
118
+ children: N.dueDateLabel
119
119
  }), /* @__PURE__ */ h(c, {
120
120
  className: "ttw:text-sm ttw:font-medium",
121
121
  value: x.dueDateLabel,
122
122
  tone: x.dueDateTone,
123
- labels: M.dueDate
123
+ labels: N.dueDate
124
124
  })]
125
125
  })]
126
126
  }),
127
127
  w ? /* @__PURE__ */ h(r, {
128
128
  variant: "caption",
129
129
  color: "muted",
130
- children: M.approvalOverrideNotice
130
+ children: N.approvalOverrideNotice
131
131
  }) : null,
132
132
  C ? /* @__PURE__ */ h("div", { children: /* @__PURE__ */ h(e, {
133
133
  variant: "outline",
@@ -141,9 +141,9 @@ function x({ view: x, actions: S = p, scheduledSummary: C, showApprovalOverrideN
141
141
  }),
142
142
  /* @__PURE__ */ h(u, {
143
143
  summary: x.payTo,
144
- onEdit: E,
144
+ onEdit: E ? void 0 : D,
145
145
  instructionsCollapsed: !0,
146
- paymentInstructions: T ? {
146
+ paymentInstructions: T && !E ? {
147
147
  isOpen: T.isOpen,
148
148
  values: T.values,
149
149
  errors: T.errors,
@@ -153,17 +153,17 @@ function x({ view: x, actions: S = p, scheduledSummary: C, showApprovalOverrideN
153
153
  onSave: T.onSave,
154
154
  onCancel: T.onCancel
155
155
  } : void 0,
156
- labels: N
156
+ labels: P
157
157
  }),
158
- x.paymentHistory.length || D || O ? /* @__PURE__ */ g("section", {
158
+ x.paymentHistory.length || O || k ? /* @__PURE__ */ g("section", {
159
159
  className: "ttw:flex ttw:flex-col ttw:gap-3",
160
160
  children: [/* @__PURE__ */ h("h3", {
161
161
  className: v,
162
- children: M.paymentHistoryHeading
163
- }), D ? /* @__PURE__ */ h("p", {
162
+ children: N.paymentHistoryHeading
163
+ }), O ? /* @__PURE__ */ h("p", {
164
164
  className: "ttw:text-sm ttw:text-muted-foreground",
165
- children: M.paymentHistoryErrorDescription
166
- }) : O ? /* @__PURE__ */ h(n, { className: "ttw:h-9 ttw:w-full" }) : /* @__PURE__ */ h(l, { records: x.paymentHistory })]
165
+ children: N.paymentHistoryErrorDescription
166
+ }) : k ? /* @__PURE__ */ h(n, { className: "ttw:h-9 ttw:w-full" }) : /* @__PURE__ */ h(l, { records: x.paymentHistory })]
167
167
  }) : null,
168
168
  /* @__PURE__ */ h("dl", {
169
169
  className: "ttw:flex ttw:flex-col",
@@ -185,15 +185,15 @@ function x({ view: x, actions: S = p, scheduledSummary: C, showApprovalOverrideN
185
185
  children: [
186
186
  /* @__PURE__ */ h("th", {
187
187
  className: i(y, "ttw:text-left ttw:font-normal"),
188
- children: M.descriptionAndGlCodeColumn
188
+ children: N.descriptionAndGlCodeColumn
189
189
  }),
190
190
  /* @__PURE__ */ h("th", {
191
191
  className: i(y, "ttw:text-right ttw:font-normal"),
192
- children: M.qtyPriceColumn
192
+ children: N.qtyPriceColumn
193
193
  }),
194
194
  /* @__PURE__ */ h("th", {
195
195
  className: i(y, "ttw:text-right ttw:font-normal"),
196
- children: M.amountColumn
196
+ children: N.amountColumn
197
197
  })
198
198
  ]
199
199
  }) }), /* @__PURE__ */ g("tbody", { children: [x.lineItems.map((e) => /* @__PURE__ */ g("tr", {
@@ -232,13 +232,13 @@ function x({ view: x, actions: S = p, scheduledSummary: C, showApprovalOverrideN
232
232
  }) }),
233
233
  x.approvalPolicy ? /* @__PURE__ */ h(o, {
234
234
  view: x.approvalPolicy,
235
- labels: M.approvalPolicy
235
+ labels: N.approvalPolicy
236
236
  }) : null,
237
237
  x.history.length ? /* @__PURE__ */ g("section", {
238
238
  className: "ttw:flex ttw:flex-col ttw:gap-3",
239
239
  children: [/* @__PURE__ */ h("h3", {
240
240
  className: v,
241
- children: M.historyHeading
241
+ children: N.historyHeading
242
242
  }), /* @__PURE__ */ h("ul", {
243
243
  className: "ttw:flex ttw:flex-col",
244
244
  children: x.history.map((e) => /* @__PURE__ */ g("li", {
@@ -3,7 +3,6 @@ var e = {
3
3
  fieldLabel: "Select or add vendor",
4
4
  triggerPlaceholder: "Select vendor",
5
5
  placeholder: "Search",
6
- searchHint: "Type a vendor name to search",
7
6
  loading: "Searching vendors...",
8
7
  emptyResults: "No vendors found",
9
8
  addVendorAction: "Add vendor"
@@ -64,7 +64,7 @@ function x({ query: x, onQueryChange: S, results: C, isLoading: w, onAddVendor:
64
64
  width: "30%"
65
65
  })]
66
66
  }, t))]
67
- }) : x ? C.length === 0 ? /* @__PURE__ */ h("div", {
67
+ }) : C.length === 0 ? /* @__PURE__ */ h("div", {
68
68
  className: d("ttw:flex ttw:items-center ttw:justify-center ttw:py-6 ttw:text-center ttw:text-sm", b),
69
69
  children: O.emptyResults
70
70
  }) : /* @__PURE__ */ h(t, { children: C.map((e, t) => /* @__PURE__ */ g(r, {
@@ -77,10 +77,7 @@ function x({ query: x, onQueryChange: S, results: C, isLoading: w, onAddVendor:
77
77
  className: "ttw:ml-auto ttw:text-muted-foreground",
78
78
  children: e.email
79
79
  })]
80
- }, `${e.name}:${e.email}:${t}`)) }) : /* @__PURE__ */ h("div", {
81
- className: d("ttw:flex ttw:items-center ttw:justify-center ttw:py-6 ttw:text-center ttw:text-sm ttw:text-muted-foreground", b),
82
- children: O.searchHint
83
- }),
80
+ }, `${e.name}:${e.email}:${t}`)) }),
84
81
  /* @__PURE__ */ h(a, {}),
85
82
  /* @__PURE__ */ g(r, {
86
83
  value: "__add_vendor__",
@@ -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.4.20", n = "e680bd5b652b943a74f77e84710ec84dda3c4568", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.4.21", n = "0da2780209174236718609ef642af344a370e56c", r = Object.freeze({
3
3
  library_name: e,
4
4
  library_version: t,
5
5
  library_sha: n
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tesouro/embedded-components-react",
3
- "version": "0.4.20",
3
+ "version": "0.4.21",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "packageDepSync": {