@tesouro/embedded-components-react 0.5.252 → 0.5.255

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 (67) hide show
  1. package/dist/index.d.ts +95 -79
  2. package/dist/lib/ReceivablesWidget.d.ts +25 -9
  3. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index24.js +4 -1
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index27.js +214 -209
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index35.js +162 -145
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index14.js +2 -2
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index15.js +2 -2
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index31.js +1 -1
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index33.js +2 -2
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index34.js +3 -3
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index37.js +2 -2
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index48.js +1 -1
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index49.js +1 -1
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index5.js +2 -2
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index17.js +32 -23
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index18.js +2 -2
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index2.js +1 -1
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index20.js +5 -5
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index3.js +1 -1
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidgetNative/BillPayWidgetNative.js +48 -48
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidgetNative/BillsTab.js +32 -24
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidgetNative/labels.js +2 -2
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index5.js +1 -1
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index6.js +1 -1
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +19 -21
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index10.js +38 -51
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index12.js +12 -2
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js +11 -39
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index14.js +18 -2
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index15.js +2 -14
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +9 -16
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index17.js +78 -2
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index19.js +2 -78
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js +29 -0
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +4 -2
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +26 -25
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index23.js +2 -4
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +5 -28
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +34 -2
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +2 -7
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index6.js +16 -11
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index7.js +54 -2
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index8.js +1 -0
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index9.js +2 -16
  45. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +2 -2
  46. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index10.js +16 -17
  47. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +15 -11
  48. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/details.js +89 -88
  49. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/helpers.js +55 -74
  50. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/labels.js +8 -1
  51. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/paymentRecord.js +71 -0
  52. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActions.js +123 -164
  53. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableDetails.js +40 -37
  54. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablePaymentRecord.js +91 -0
  55. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesTable.js +83 -78
  56. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js +7 -3
  57. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/mocks/receivables.js +2 -1
  58. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +15 -8
  59. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +206 -89
  60. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +2 -2
  61. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +38 -38
  62. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  63. package/dist/packages/shared-ui-shadcn/dist/index.js +8 -7
  64. package/package.json +1 -1
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +0 -11
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index27.js +0 -34
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +0 -2
@@ -62,49 +62,54 @@ function qe(e) {
62
62
  let t = [...new Set(e)];
63
63
  return t.length > 0 ? t : void 0;
64
64
  }
65
- function Je({ open: Je, onOpenChange: f, payableId: p, initialCounterpartId: Ye, readOnly: m = !1, copy: Xe, onCollapse: Ze, onEdit: Qe, onOpenBill: h, renderPaymentFlows: $e }) {
66
- let g = l(() => he(Xe), [Xe]), et = p ? void 0 : Ye, [tt, nt] = u(et), [rt, it] = u(!!et), [at, ot] = u(!1), [st, _] = u(!1), [ct, v] = u(), y = c((e) => {
67
- v(() => e);
68
- }, []), [lt, ut] = u(), b = p ?? lt, x = be(b, { pollWhileOcrProcessing: !0 }), S = ve(b), { initResponse: C } = te(), dt = !!C, ft = i(C?.scopes, [a.AccountingConfigReadOrg]), w = ee({ enabled: ft }), T = x.data, E = !b || !!T, D = !m && E && !!b && T?.status !== "draft", pt = !m && !!T && !oe(T?.status), O = m || pt, k = Se({
65
+ function Je({ open: Je, onOpenChange: f, payableId: Ye, initialCounterpartId: Xe, readOnly: p = !1, copy: m, onCollapse: Ze, onEdit: Qe, onOpenBill: h, renderPaymentFlows: $e }) {
66
+ let g = l(() => he(m), [m]), _ = m?.messages, et = l(() => ({
67
+ ...me,
68
+ ..._
69
+ }), [_]), tt = Ye ? void 0 : Xe, [nt, rt] = u(tt), [it, at] = u(!!tt), [ot, st] = u(!1), [ct, v] = u(!1), [lt, ut] = u(), y = c((e) => {
70
+ ut(() => e);
71
+ }, []), [dt, ft] = u(), b = Ye ?? dt, x = be(b, { pollWhileOcrProcessing: !0 }), S = ve(b), { initResponse: C } = te(), pt = !!C, mt = i(C?.scopes, [a.AccountingConfigReadOrg]), w = ee({ enabled: mt }), T = x.data, E = !b || !!T, D = !p && E && !!b && T?.status !== "draft", ht = !p && !!T && !oe(T?.status), O = p || ht, k = Se({
69
72
  payable: T,
70
- lineItems: S.lineItems
73
+ lineItems: S.lineItems,
74
+ labels: et
71
75
  }), A = T?.counterpart_id ?? void 0;
72
76
  He(() => {
73
- rt || A && (nt(A), it(!0));
74
- }, [rt, A]);
75
- let mt = c((e) => {
76
- it(!0), nt(e);
77
+ it || A && (rt(A), at(!0));
78
+ }, [it, A]);
79
+ let gt = c((e) => {
80
+ at(!0), rt(e);
77
81
  }, []), j = Ne({
78
82
  payableId: b,
79
83
  scheduledPaymentDate: T?.scheduled_payment_date,
80
- enabled: m || D
81
- }), ht = re(), M = l(() => j.hasScheduledPayment && j.scheduledDate ? ae(j.scheduledDate, g.scheduledRelativeDay, ht) : void 0, [
84
+ enabled: p || D
85
+ }), _t = re(), M = l(() => j.hasScheduledPayment && j.scheduledDate ? ae(j.scheduledDate, g.scheduledRelativeDay, _t) : void 0, [
82
86
  j.hasScheduledPayment,
83
87
  j.scheduledDate,
84
88
  g.scheduledRelativeDay,
85
- ht
86
- ]), N = De(C?.scopes), gt = i(C?.scopes, [a.PayableWriteOrg]), _t = i(C?.scopes, [a.CounterpartWriteOrg]) && gt, P = _t && ie(T?.status) && !j.hasScheduledPayment && !j.isResolving, vt = P && N, yt = P || _t && T?.status === "rejected", bt = !m && E && (!b || T?.status === "draft") && !j.hasScheduledPayment && !j.isResolving, F = ze({
89
+ _t
90
+ ]), N = De(C?.scopes), vt = i(C?.scopes, [a.PayableWriteOrg]), yt = i(C?.scopes, [a.CounterpartWriteOrg]) && vt, P = yt && ie(T?.status) && !j.hasScheduledPayment && !j.isResolving, bt = P && N, xt = P || yt && T?.status === "rejected", St = !p && E && (!b || T?.status === "draft") && !j.hasScheduledPayment && !j.isResolving, F = ze({
87
91
  payableId: b,
88
- counterpartId: m ? A : tt,
92
+ counterpartId: p ? A : nt,
89
93
  payableCounterpartId: A,
90
- isVendorKnown: m ? !!T : E,
91
- onCounterpartChange: mt,
94
+ isVendorKnown: p ? !!T : E,
95
+ onCounterpartChange: gt,
92
96
  requiredError: k.errors?.vendor,
93
97
  payableCounterpartBankAccountId: T?.counterpart_bank_account_id ?? void 0,
94
98
  extractedVendor: T?.counterpart_raw_data ?? void 0,
95
- readOnly: m,
96
- canEditVendor: !m || vt,
97
- canEditPaymentInstructions: !m || P,
98
- canAddPaymentInstructions: !m || yt,
99
- confirmDiscard: y
100
- }), I = F.activePayToOperation === "missingInstructions" ? bt || yt : F.activePayToOperation === "existingInstructions" ? bt || P : F.activePayToOperation === "vendor" && m ? vt : !1, xt = !!(b && rt) && !tt, L = x.refetch, St = c(async () => {
99
+ readOnly: p,
100
+ canEditVendor: !p || bt,
101
+ canEditPaymentInstructions: !p || P,
102
+ canAddPaymentInstructions: !p || xt,
103
+ confirmDiscard: y,
104
+ labels: m?.vendorSection
105
+ }), I = F.activePayToOperation === "missingInstructions" ? St || xt : F.activePayToOperation === "existingInstructions" ? St || P : F.activePayToOperation === "vendor" && p ? bt : !1, Ct = !!(b && it) && !nt, L = x.refetch, wt = c(async () => {
101
106
  let { data: e } = await L();
102
107
  return e?.status ?? void 0;
103
- }, [L]), Ct = ye(), [R, wt] = u(!1), z = Ue(void 0), Tt = c(async () => {
108
+ }, [L]), Tt = ye(), [R, Et] = u(!1), z = Ue(void 0), Dt = c(async () => {
104
109
  if (z.current) return z.current;
105
110
  let t = (async () => {
106
111
  if (I) {
107
- wt(!0);
112
+ Et(!0);
108
113
  try {
109
114
  let t;
110
115
  try {
@@ -128,10 +133,10 @@ function Je({ open: Je, onOpenChange: f, payableId: p, initialCounterpartId: Ye,
128
133
  }
129
134
  };
130
135
  try {
131
- await Ct.mutateAsync(t);
136
+ await Tt.mutateAsync(t);
132
137
  } catch {
133
138
  try {
134
- await Ct.mutateAsync(t);
139
+ await Tt.mutateAsync(t);
135
140
  } catch {
136
141
  e.error(g.detail.paymentInstructionsLinkError);
137
142
  return;
@@ -142,7 +147,7 @@ function Je({ open: Je, onOpenChange: f, payableId: p, initialCounterpartId: Ye,
142
147
  }
143
148
  F.finalizePayToSave(), await L();
144
149
  } finally {
145
- wt(!1);
150
+ Et(!1);
146
151
  }
147
152
  }
148
153
  })();
@@ -156,7 +161,7 @@ function Je({ open: Je, onOpenChange: f, payableId: p, initialCounterpartId: Ye,
156
161
  I,
157
162
  g.detail.paymentInstructionsLinkError,
158
163
  g.detail.paymentInstructionsSaveError,
159
- Ct,
164
+ Tt,
160
165
  T?.counterpart_bank_account_id,
161
166
  T?.counterpart_id,
162
167
  b,
@@ -165,69 +170,76 @@ function Je({ open: Je, onOpenChange: f, payableId: p, initialCounterpartId: Ye,
165
170
  ]), B = l(() => I ? F.mode === "creating" && Ve(F.newVendorForm) ? {
166
171
  ...F,
167
172
  newVendorForm: Be(F.newVendorForm, {
168
- onSave: Tt,
173
+ onSave: Dt,
169
174
  isSaving: R
170
175
  })
171
176
  } : F.mode === "resolved" && F.paymentInstructions ? {
172
177
  ...F,
173
178
  paymentInstructions: {
174
179
  ...F.paymentInstructions,
175
- onSave: Tt,
180
+ onSave: Dt,
176
181
  isSaving: R
177
182
  }
178
183
  } : F : F, [
179
184
  I,
180
185
  R,
181
- Tt,
186
+ Dt,
182
187
  F
183
188
  ]);
184
189
  He(() => {
185
- m && F.isEditingPayTo && !I && F.discardPayToEdits();
190
+ p && F.isEditingPayTo && !I && F.discardPayToEdits();
186
191
  }, [
187
192
  I,
188
- m,
193
+ p,
189
194
  F.discardPayToEdits,
190
195
  F.isEditingPayTo
191
196
  ]);
192
- let Et = l(() => D ? { draftSaved: me.submittedSaved } : void 0, [D]), V = xe({
193
- payableId: p,
197
+ let Ot = l(() => D ? {
198
+ ..._,
199
+ draftSaved: et.submittedSaved
200
+ } : _, [
201
+ D,
202
+ _,
203
+ et.submittedSaved
204
+ ]), V = xe({
205
+ payableId: Ye,
194
206
  form: k,
195
- labels: Et,
196
- counterpartId: tt,
207
+ labels: Ot,
208
+ counterpartId: nt,
197
209
  isVendorPending: F.mode === "creating" || F.isPendingVendor,
198
- clearCounterpart: xt,
210
+ clearCounterpart: Ct,
199
211
  prepareVendorForSave: F.prepareVendorForSave,
200
- onPayableCreated: ut,
201
- onSaved: ut,
212
+ onPayableCreated: ft,
213
+ onSaved: ft,
202
214
  onDraftSaved: () => f(!1),
203
215
  onFinalized: () => f(!1),
204
- readSavedStatus: D ? St : void 0
205
- }), Dt = !!(V.isSavingDraft || V.isFinalizing || F.isVendorSavePending), H = m ? b : void 0, U = je({
216
+ readSavedStatus: D ? wt : void 0
217
+ }), kt = !!(V.isSavingDraft || V.isFinalizing || F.isVendorSavePending), H = p ? b : void 0, U = je({
206
218
  payableId: H,
207
219
  status: T?.status
208
- }), Ot = Ue(null), [kt, At] = u(!1), jt = se(T), W = Re({
209
- counterpartId: m ? A : void 0,
220
+ }), At = Ue(null), [jt, Mt] = u(!1), Nt = se(T), W = Re({
221
+ counterpartId: p ? A : void 0,
210
222
  currency: T?.currency,
211
- currentBankAccountId: m ? T?.counterpart_bank_account_id ?? void 0 : void 0,
212
- enabled: N && m
223
+ currentBankAccountId: p ? T?.counterpart_bank_account_id ?? void 0 : void 0,
224
+ enabled: N && p
213
225
  }), G = ke({
214
226
  payableId: H,
215
227
  approvalPolicyId: T?.approval_policy_id,
216
- enabled: m,
228
+ enabled: p,
217
229
  copy: g.approvalPolicyCopy
218
- }), Mt = Ee({
230
+ }), Pt = Ee({
219
231
  status: T?.status,
220
232
  scopes: C?.scopes,
221
233
  arePendingApproversUnknown: G.isLoading,
222
234
  hasApprovalPolicy: !!T?.approval_policy_id,
223
235
  hasWaitingRequest: U.hasWaitingRequest
224
- }), Nt = !!U.id, Pt = U.isLoading || G.isLoading, Ft = l(() => qe(G.pendingApprovers.flatMap((e) => e.names)), [G.pendingApprovers]), It = m || D ? b : void 0, Lt = m ? Qe : void 0, K = c((e) => {
236
+ }), Ft = !!U.id, It = U.isLoading || G.isLoading, Lt = l(() => qe(G.pendingApprovers.flatMap((e) => e.names)), [G.pendingApprovers]), Rt = p || D ? b : void 0, zt = p ? Qe : void 0, K = c((e) => {
225
237
  let t = () => {
226
238
  F.discardPayToEdits(), e?.();
227
239
  };
228
240
  F.hasUnsavedVendorChanges ? y(t) : t();
229
- }, [y, F]), { actions: Rt, decisionDialog: zt, isActionPending: Bt } = Me({
230
- payableId: It,
241
+ }, [y, F]), { actions: Bt, decisionDialog: Vt, isActionPending: Ht } = Me({
242
+ payableId: Rt,
231
243
  status: T?.status,
232
244
  currentApprovalRequestId: U.id,
233
245
  arePendingApproversUnknown: G.isLoading,
@@ -239,24 +251,24 @@ function Je({ open: Je, onOpenChange: f, payableId: p, initialCounterpartId: Ye,
239
251
  hasWaitingRequest: U.hasWaitingRequest,
240
252
  pendingApprovers: G.pendingApprovers,
241
253
  labels: g.actions,
242
- isMarkAsPaidPending: kt,
243
- onMarkAsPaidSelect: () => Ot.current?.openMarkAsPaid(),
244
- onPayBillSelect: () => K(() => Ot.current?.openPayBill()),
245
- onEditSelect: Lt,
254
+ isMarkAsPaidPending: jt,
255
+ onMarkAsPaidSelect: () => At.current?.openMarkAsPaid(),
256
+ onPayBillSelect: () => K(() => At.current?.openPayBill()),
257
+ onEditSelect: zt,
246
258
  onActionSucceeded: (e) => {
247
259
  if (e === "reopen") {
248
- Lt?.();
260
+ zt?.();
249
261
  return;
250
262
  }
251
263
  D && f(!1);
252
264
  }
253
- }), Vt = Pe({
265
+ }), Ut = Pe({
254
266
  payableId: b,
255
267
  status: T?.status,
256
- enabled: !m,
268
+ enabled: !p,
257
269
  labels: g.deleteDraft,
258
270
  onDeleted: () => f(!1)
259
- }), Ht = Dt || Bt, Ut = T?.ocr_status === "processing", Wt = x.isLoading || S.isResolving || Ut, Gt = x.isLoading || S.isResolving || w.isResolving || W.isLoading, Kt = x.isError || S.isError || w.isError, qt = l(() => [...Vt.menuItems, ...D || m && !Gt && !Kt ? Rt.menu.map((e) => ({
271
+ }), Wt = kt || Ht, Gt = T?.ocr_status === "processing", Kt = x.isLoading || S.isResolving || Gt, qt = x.isLoading || S.isResolving || w.isResolving || W.isLoading, Jt = x.isError || S.isError || w.isError, Yt = l(() => [...Ut.menuItems, ...D || p && !qt && !Jt ? Bt.menu.map((e) => ({
260
272
  id: e.id,
261
273
  label: e.label,
262
274
  onSelect: e.onSelect,
@@ -264,37 +276,37 @@ function Je({ open: Je, onOpenChange: f, payableId: p, initialCounterpartId: Ye,
264
276
  icon: e.icon,
265
277
  sectionHeading: e.sectionHeading
266
278
  })) : []], [
267
- Rt.menu,
268
- Vt.menuItems,
279
+ Bt.menu,
280
+ Ut.menuItems,
269
281
  D,
270
- m,
271
- Gt,
272
- Kt
282
+ p,
283
+ qt,
284
+ Jt
273
285
  ]), q = l(() => (w.data?.data ?? []).map((e) => ({
274
286
  value: e.id,
275
287
  label: [e.nominal_code, e.name].filter(Boolean).join(" — ")
276
288
  })), [w.data]), J;
277
- dt && (ft ? w.isError ? J = g.lineItemsGlCodeUnavailable.loadError : !w.isResolving && q.length === 0 && (J = g.lineItemsGlCodeUnavailable.empty) : J = g.lineItemsGlCodeUnavailable.noAccess);
278
- let Jt = !dt || !!J || w.isResolving, Yt = ft && !w.isResolving && !w.isError, Y = _e(H), Xt = T?.status === "rejected" || !m && D, Zt = i(C?.scopes, [a.ApprovalRequestReadOrg]), Qt = Xt && Zt, $t = i(C?.scopes, [a.UserReadOrg]), { userNames: X, isError: en, isResolving: tn } = ne({ enabled: (m || Xt) && $t }), nn = l(() => n(Y.data?.data ?? [], X, g.history), [
289
+ pt && (mt ? w.isError ? J = g.lineItemsGlCodeUnavailable.loadError : !w.isResolving && q.length === 0 && (J = g.lineItemsGlCodeUnavailable.empty) : J = g.lineItemsGlCodeUnavailable.noAccess);
290
+ let Xt = !pt || !!J || w.isResolving, Zt = mt && !w.isResolving && !w.isError, Y = _e(H), Qt = T?.status === "rejected" || !p && D, $t = i(C?.scopes, [a.ApprovalRequestReadOrg]), en = Qt && $t, tn = i(C?.scopes, [a.UserReadOrg]), { userNames: X, isError: nn, isResolving: rn } = ne({ enabled: (p || Qt) && tn }), an = l(() => n(Y.data?.data ?? [], X, g.history), [
279
291
  Y.data,
280
292
  X,
281
293
  g.history
282
- ]), rn = $t && en && r(Y.data?.data ?? [], nn, X), an = Oe({
294
+ ]), on = tn && nn && r(Y.data?.data ?? [], an, X), sn = Oe({
283
295
  payableId: b,
284
- enabled: Qt
285
- }), on = ge(b, { enabled: Qt }), sn = l(() => we(on.data?.data, an.roundStartedAt), [on.data, an.roundStartedAt]), Z = l(() => Ae({
296
+ enabled: en
297
+ }), cn = ge(b, { enabled: en }), ln = l(() => we(cn.data?.data, sn.roundStartedAt), [cn.data, sn.roundStartedAt]), Z = l(() => Ae({
286
298
  payableStatus: T?.status,
287
- approvalRequests: sn,
299
+ approvalRequests: ln,
288
300
  userNames: X,
289
301
  payableUpdatedAt: T?.updated_at,
290
302
  labels: g.detail
291
303
  }), [
292
304
  T?.status,
293
305
  T?.updated_at,
294
- sn,
306
+ ln,
295
307
  X,
296
308
  g.detail
297
- ]), cn = l(() => Ce({
309
+ ]), un = l(() => Ce({
298
310
  records: j.paymentRecords,
299
311
  events: Y.data?.data ?? [],
300
312
  currencyCode: T?.currency,
@@ -304,15 +316,15 @@ function Je({ open: Je, onOpenChange: f, payableId: p, initialCounterpartId: Ye,
304
316
  Y.data,
305
317
  T?.currency,
306
318
  g.detail
307
- ]), ln = l(() => {
308
- if (!m || !T) return;
319
+ ]), dn = l(() => {
320
+ if (!p || !T) return;
309
321
  let e = Fe({
310
322
  payable: T,
311
323
  lineItems: S.lineItems,
312
324
  glCodeOptions: q,
313
- glCodeRosterAvailable: Yt,
314
- history: nn,
315
- paymentHistory: cn,
325
+ glCodeRosterAvailable: Zt,
326
+ history: an,
327
+ paymentHistory: un,
316
328
  approvalPolicy: G.view,
317
329
  labels: g.detail,
318
330
  hasScheduledPayment: j.hasScheduledPayment,
@@ -330,33 +342,33 @@ function Je({ open: Je, onOpenChange: f, payableId: p, initialCounterpartId: Ye,
330
342
  N,
331
343
  g.detail,
332
344
  q,
333
- Yt,
334
- nn,
345
+ Zt,
346
+ an,
335
347
  S.lineItems,
336
348
  T,
337
349
  W.achInstructions,
338
350
  W.isError,
339
- cn,
340
- m,
351
+ un,
352
+ p,
341
353
  Z,
342
354
  F.mode,
343
355
  F.summary
344
- ]), un = T?.source_of_payable_data === "ocr", Q = jt?.name, dn = m ? Q ? g.viewTitle(Q) : g.readOnlyTitle : Q && (un || D) ? g.extractedTitle(Q) : g.newTitle, fn = m && T?.created_at ? g.addedOn(t(T.created_at.slice(0, 10))) : void 0, pn = c(() => {
345
- if (m && F.isEditingPayTo) {
356
+ ]), fn = T?.source_of_payable_data === "ocr", Q = Nt?.name, pn = p ? Q ? g.viewTitle(Q) : g.readOnlyTitle : Q && (fn || D) ? g.extractedTitle(Q) : g.newTitle, mn = p && T?.created_at ? g.addedOn(t(T.created_at.slice(0, 10))) : void 0, hn = c(() => {
357
+ if (p && F.isEditingPayTo) {
346
358
  K(() => f(!1));
347
359
  return;
348
360
  }
349
361
  let e = k.isDirty || F.hasUnsavedVendorChanges || !!V.stagedFile || V.isFileDeletionPending;
350
362
  switch (Ie({
351
- isUnsavedPromptOpen: st,
363
+ isUnsavedPromptOpen: ct,
352
364
  isLocked: O,
353
365
  isDirty: e
354
366
  })) {
355
367
  case "dismiss-prompt":
356
- _(!1);
368
+ v(!1);
357
369
  return;
358
370
  case "prompt":
359
- _(!0);
371
+ v(!0);
360
372
  return;
361
373
  default: f(!1);
362
374
  }
@@ -365,16 +377,16 @@ function Je({ open: Je, onOpenChange: f, payableId: p, initialCounterpartId: Ye,
365
377
  V.stagedFile,
366
378
  k.isDirty,
367
379
  O,
368
- st,
380
+ ct,
369
381
  K,
370
382
  f,
371
- m,
383
+ p,
372
384
  F.hasUnsavedVendorChanges,
373
385
  F.isEditingPayTo
374
- ]), mn = c((e, t) => {
386
+ ]), gn = c((e, t) => {
375
387
  if (!h) return;
376
388
  let n = () => h(e, t);
377
- if (m && F.isEditingPayTo) {
389
+ if (p && F.isEditingPayTo) {
378
390
  K(n);
379
391
  return;
380
392
  }
@@ -388,10 +400,10 @@ function Je({ open: Je, onOpenChange: f, payableId: p, initialCounterpartId: Ye,
388
400
  O,
389
401
  K,
390
402
  h,
391
- m,
403
+ p,
392
404
  F.hasUnsavedVendorChanges,
393
405
  F.isEditingPayTo
394
- ]), hn = c(() => {
406
+ ]), _n = c(() => {
395
407
  if (F.isEditingPayTo) {
396
408
  K(Ze);
397
409
  return;
@@ -401,34 +413,34 @@ function Je({ open: Je, onOpenChange: f, payableId: p, initialCounterpartId: Ye,
401
413
  K,
402
414
  Ze,
403
415
  F.isEditingPayTo
404
- ]), gn = c(() => {
405
- _(!1), f(!1);
406
- }, [f]), _n = Wt || F.mode === "creating", vn = c(async () => {
407
- if (_n) return;
416
+ ]), vn = c(() => {
417
+ v(!1), f(!1);
418
+ }, [f]), yn = Kt || F.mode === "creating", bn = c(async () => {
419
+ if (yn) return;
408
420
  let e = await V.saveDraft();
409
- _(!1), e && f(!1);
421
+ v(!1), e && f(!1);
410
422
  }, [
411
423
  V,
412
- _n,
424
+ yn,
413
425
  f
414
426
  ]), $ = Te({
415
427
  payable: T,
416
- onOpenPayable: h ? mn : void 0,
428
+ onOpenPayable: h ? gn : void 0,
417
429
  onRemoved: () => f(!1),
418
- canManage: gt
419
- }), yn = c((e) => {
420
- if (!(Ht || $.isBusy)) return e ? f(!0) : pn();
430
+ canManage: vt
431
+ }), xn = c((e) => {
432
+ if (!(Wt || $.isBusy)) return e ? f(!0) : hn();
421
433
  }, [
422
434
  $.isBusy,
423
- Ht,
424
- pn,
435
+ Wt,
436
+ hn,
425
437
  f
426
- ]), bn = $.isPossibleDuplicate, xn = !m && un && !at, Sn = !m && !!Z, Cn = Sn || bn || xn ? /* @__PURE__ */ Ge(We, { children: [
427
- Sn && Z ? /* @__PURE__ */ d(ue, {
438
+ ]), Sn = $.isPossibleDuplicate, Cn = !p && fn && !ot, wn = !p && !!Z, Tn = wn || Sn || Cn ? /* @__PURE__ */ Ge(We, { children: [
439
+ wn && Z ? /* @__PURE__ */ d(ue, {
428
440
  ...Z,
429
441
  labels: g.rejectedBanner
430
442
  }) : null,
431
- bn ? /* @__PURE__ */ d(le, {
443
+ Sn ? /* @__PURE__ */ d(le, {
432
444
  onNotADuplicate: $.onNotADuplicate,
433
445
  onRemoveBill: $.onRemoveBill,
434
446
  isActionDisabled: $.isBusy,
@@ -438,15 +450,18 @@ function Je({ open: Je, onOpenChange: f, payableId: p, initialCounterpartId: Ye,
438
450
  labels: $.removeBillLabel ? { removeBillButton: $.removeBillLabel } : void 0,
439
451
  testId: s.duplicateNotice
440
452
  }) : null,
441
- xn ? /* @__PURE__ */ d(fe, { onDismiss: () => ot(!0) }) : null
453
+ Cn ? /* @__PURE__ */ d(fe, {
454
+ onDismiss: () => st(!0),
455
+ labels: m?.extractionNotice
456
+ }) : null
442
457
  ] }) : void 0;
443
458
  return /* @__PURE__ */ Ge(We, { children: [
444
459
  /* @__PURE__ */ d(ce, {
445
460
  open: Je,
446
- onOpenChange: yn,
447
- title: dn,
448
- subtitle: fn,
449
- notice: Cn,
461
+ onOpenChange: xn,
462
+ title: pn,
463
+ subtitle: mn,
464
+ notice: Tn,
450
465
  vendor: {
451
466
  ...B,
452
467
  testId: s.vendorSection
@@ -457,7 +472,7 @@ function Je({ open: Je, onOpenChange: f, payableId: p, initialCounterpartId: Ye,
457
472
  lineItems: {
458
473
  items: k.lineItemRows,
459
474
  glCodeOptions: q,
460
- glCodeDisabled: Jt,
475
+ glCodeDisabled: Xt,
461
476
  glCodeUnavailableMessage: J,
462
477
  discount: k.discount,
463
478
  onDiscountChange: k.onDiscountChange,
@@ -487,7 +502,7 @@ function Je({ open: Je, onOpenChange: f, payableId: p, initialCounterpartId: Ye,
487
502
  stagedFile: V.stagedFile,
488
503
  onFileStaged: V.stageFile,
489
504
  onClearStagedFile: V.clearStagedFile,
490
- isSaving: Dt
505
+ isSaving: kt
491
506
  },
492
507
  deletion: {
493
508
  isPending: V.isFileDeletionPending,
@@ -495,18 +510,19 @@ function Je({ open: Je, onOpenChange: f, payableId: p, initialCounterpartId: Ye,
495
510
  onDetachNow: V.detachFileNow,
496
511
  isDeleting: V.isDeletingFile,
497
512
  hasFailed: V.hasFileDeletionFailed
498
- }
513
+ },
514
+ labels: m?.sourceDocument
499
515
  }),
500
- menuItems: qt,
516
+ menuItems: Yt,
501
517
  readOnly: O,
502
- detail: m ? {
503
- view: ln,
504
- actions: Rt,
518
+ detail: p ? {
519
+ view: dn,
520
+ actions: Bt,
505
521
  scheduledSummary: M ? g.scheduledSummary(M.label) : void 0,
506
522
  scheduledSummaryDate: M?.absoluteLabel,
507
523
  scheduledStatusLabel: M ? g.scheduledStatusBadge(M.label) : void 0,
508
- showApprovalOverrideNotice: !Pt && Mt,
509
- awaitingApprovalNotice: !Pt && !Nt && !Mt && T?.status === "approve_in_progress" && T?.approval_policy_id ? Ft ? g.awaitingApprovalNotice(Ft) : g.awaitingApprovalUnknownNotice : void 0,
524
+ showApprovalOverrideNotice: !It && Pt,
525
+ awaitingApprovalNotice: !It && !Ft && !Pt && T?.status === "approve_in_progress" && T?.approval_policy_id ? Lt ? g.awaitingApprovalNotice(Lt) : g.awaitingApprovalUnknownNotice : void 0,
510
526
  payTo: {
511
527
  onEdit: B.mode === "resolved" ? B.onEdit : void 0,
512
528
  paymentInstructions: B.paymentInstructions,
@@ -514,33 +530,34 @@ function Je({ open: Je, onOpenChange: f, payableId: p, initialCounterpartId: Ye,
514
530
  editForm: B.mode === "creating" ? B.newVendorForm : void 0
515
531
  },
516
532
  hideMissingPaymentInstructions: T?.status === "paid" || T?.status === "canceled",
517
- isLoading: Gt,
518
- isError: Kt,
533
+ isLoading: qt,
534
+ isError: Jt,
519
535
  paymentHistoryError: j.isError || Y.isError,
520
536
  paymentHistoryLoading: j.isResolving || Y.isLoading,
521
537
  historyError: Y.isError,
522
- historyLoading: Y.isLoading || tn,
523
- historyNamesError: rn
538
+ historyLoading: Y.isLoading || rn,
539
+ historyNamesError: on
524
540
  } : void 0,
525
- isLineItemsLoading: Wt,
526
- isSaving: Ht || R,
541
+ isLineItemsLoading: Kt,
542
+ isSaving: Wt || R,
527
543
  isSavingDraft: V.isSavingDraft,
528
544
  isSubmitting: V.isFinalizing,
529
- onCancel: pn,
530
- onCollapse: m ? hn : void 0,
545
+ onCancel: hn,
546
+ onCollapse: p ? _n : void 0,
531
547
  onSaveDraft: V.saveDraft,
532
548
  onFinalize: V.finalize,
533
549
  scrollToErrorToken: V.scrollToErrorToken,
534
550
  showSubmit: !O && E,
535
- testId: s.dialog
551
+ testId: s.dialog,
552
+ labels: m?.screen
536
553
  }),
537
554
  /* @__PURE__ */ d(pe, {
538
- open: st,
539
- onSaveDraft: vn,
540
- onDiscard: gn,
541
- onCancel: () => _(!1),
555
+ open: ct,
556
+ onSaveDraft: bn,
557
+ onDiscard: vn,
558
+ onCancel: () => v(!1),
542
559
  isSaving: V.isSavingDraft,
543
- isSaveDraftDisabled: _n,
560
+ isSaveDraftDisabled: yn,
544
561
  labels: g.unsavedChanges,
545
562
  testId: s.unsavedDialog,
546
563
  saveDraftTestId: s.unsavedSaveDraft,
@@ -548,25 +565,25 @@ function Je({ open: Je, onOpenChange: f, payableId: p, initialCounterpartId: Ye,
548
565
  closeTestId: s.unsavedClose
549
566
  }),
550
567
  /* @__PURE__ */ d(de, {
551
- open: !!ct,
568
+ open: !!lt,
552
569
  onDiscard: () => {
553
- let e = ct;
554
- v(void 0), e?.();
570
+ let e = lt;
571
+ ut(void 0), e?.();
555
572
  },
556
- onKeepEditing: () => v(void 0),
573
+ onKeepEditing: () => ut(void 0),
557
574
  labels: g.discardChanges,
558
575
  testId: s.discardDialog,
559
576
  discardTestId: s.discardConfirm
560
577
  }),
561
578
  /* @__PURE__ */ d(o, {
562
- ...zt,
579
+ ...Vt,
563
580
  labels: { cancelButton: g.actions.decisionDialog.cancelButton },
564
581
  testId: s.decisionDialog,
565
582
  confirmTestId: s.decisionConfirm,
566
583
  reasonTestId: s.decisionReason
567
584
  }),
568
585
  /* @__PURE__ */ d(o, {
569
- ...Vt.dialog,
586
+ ...Ut.dialog,
570
587
  labels: { cancelButton: g.actions.decisionDialog.cancelButton },
571
588
  testId: s.deleteDraftDialog,
572
589
  confirmTestId: s.deleteDraftConfirm
@@ -601,13 +618,13 @@ function Je({ open: Je, onOpenChange: f, payableId: p, initialCounterpartId: Ye,
601
618
  labels: { cancelButton: $.keepRowConfirmation.cancelButtonLabel }
602
619
  }),
603
620
  $e?.({
604
- ref: Ot,
621
+ ref: At,
605
622
  payable: T,
606
623
  payableId: H,
607
- isPayBillEnabled: m,
624
+ isPayBillEnabled: p,
608
625
  hasScheduledPayment: j.hasScheduledPayment,
609
- onMissingAchInstructions: _t ? F.openPaymentInstructions : void 0,
610
- onMarkAsPaidPendingChange: At
626
+ onMissingAchInstructions: yt ? F.openPaymentInstructions : void 0,
627
+ onMarkAsPaidPendingChange: Mt
611
628
  })
612
629
  ] });
613
630
  }
@@ -3,8 +3,8 @@ import { APPROVAL_POLICY_CARD_LABELS_EN as r } from "./index2.js";
3
3
  import "./index4.js";
4
4
  import { VENDOR_SUMMARY_CARD_LABELS_EN as i } from "./index11.js";
5
5
  import "./index13.js";
6
- import { BILL_STATUS_BADGE_LABELS_EN as a } from "../../../ui/dist/index15.js";
7
- import { DUE_DATE_VALUE_LABELS_EN as o } from "../../../ui/dist/index23.js";
6
+ import { BILL_STATUS_BADGE_LABELS_EN as a } from "../../../ui/dist/index12.js";
7
+ import { DUE_DATE_VALUE_LABELS_EN as o } from "../../../ui/dist/index21.js";
8
8
  import "../../../ui/dist/index.js";
9
9
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index14.js
10
10
  var s = {
@@ -10,8 +10,8 @@ import "./index9.js";
10
10
  import { VendorSummaryCard as d } from "./index12.js";
11
11
  import "./index13.js";
12
12
  import { BillActionButtons as f, NO_BILL_ACTIONS as p } from "../../../ui/dist/index2.js";
13
- import { BillStatusBadge as m } from "../../../ui/dist/index16.js";
14
- import { DueDateValue as h } from "../../../ui/dist/index24.js";
13
+ import { BillStatusBadge as m } from "../../../ui/dist/index14.js";
14
+ import { DueDateValue as h } from "../../../ui/dist/index22.js";
15
15
  import "../../../ui/dist/index.js";
16
16
  import { mergeBillDetailBodyLabels as g } from "./index14.js";
17
17
  import { ScheduledSummaryBadge as _ } from "./index5.js";
@@ -1,7 +1,7 @@
1
1
  import { Button as e, Dialog as t, DialogContent as n, DialogDescription as r, DialogHeader as i, DialogTitle as a, DropdownMenu as o, DropdownMenuContent as s, DropdownMenuGroup as c, DropdownMenuItem as l, DropdownMenuLabel as ee, DropdownMenuSeparator as u, DropdownMenuTrigger as d, RequiredFieldsLegend as f } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
2
  import { InlineErrorAlert as te } from "../../../../shared/ui/dist/lib/InlineErrorAlert/InlineErrorAlert.js";
3
3
  import "../../../../shared/ui/dist/index.js";
4
- import { groupBySectionHeading as p } from "../../../ui/dist/index9.js";
4
+ import { groupBySectionHeading as p } from "../../../ui/dist/index6.js";
5
5
  import "../../../ui/dist/index.js";
6
6
  import { BillDetailBody as m } from "./index15.js";
7
7
  import "./index16.js";
@@ -1,7 +1,7 @@
1
1
  import { APPROVAL_POLICY_CARD_LABELS_EN as e } from "./index2.js";
2
2
  import "./index4.js";
3
- import { BILL_STATUS_BADGE_LABELS_EN as t } from "../../../ui/dist/index15.js";
4
- import { DUE_DATE_VALUE_LABELS_EN as n } from "../../../ui/dist/index23.js";
3
+ import { BILL_STATUS_BADGE_LABELS_EN as t } from "../../../ui/dist/index12.js";
4
+ import { DUE_DATE_VALUE_LABELS_EN as n } from "../../../ui/dist/index21.js";
5
5
  import "../../../ui/dist/index.js";
6
6
  import { BILL_AUDIT_HISTORY_SECTION_LABELS_EN as r } from "./index14.js";
7
7
  import "./index16.js";