@tesouro/embedded-components-react 0.5.65 → 0.5.68

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.
@@ -8,40 +8,41 @@ import { getPayables as n } from "../../../shared/data-access/dist/lib/rest/sdk.
8
8
  import { getPayablesAnalyticsOptions as r, getPayablesIdOptions as i, getPayablesOptions as a, getPayablesQueryKey as o } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
9
9
  import { withAuthEpoch as s } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
10
10
  import "../../../shared/data-access/dist/index.js";
11
- import { payableOcrQueryOptions as c } from "./index4.js";
12
- import { payablePolicyAssignmentQueryOptions as l } from "./index16.js";
13
- import { queryOptions as u, useQuery as d } from "@tanstack/react-query";
11
+ import { OCR_POLL_INTERVAL_MS as c, payableOcrQueryOptions as l } from "./index4.js";
12
+ import { payablePolicyAssignmentQueryOptions as u } from "./index16.js";
13
+ import { queryOptions as d, useQuery as f } from "@tanstack/react-query";
14
14
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index17.js
15
- function f({ enabled: n, ...r } = {}) {
16
- let { client: i, organizationId: o, widgetToken: c, authEpoch: l } = e(), u = !!(o && c) && (n === !0 || n === void 0), f = a({
17
- client: i,
18
- headers: t(o),
19
- query: r
15
+ function p({ enabled: n, pollWhileOcrProcessing: r = !1, ...i } = {}) {
16
+ let { client: o, organizationId: l, widgetToken: u, authEpoch: d } = e(), p = !!(l && u) && (n === !0 || n === void 0), m = a({
17
+ client: o,
18
+ headers: t(l),
19
+ query: i
20
20
  });
21
- return d({
22
- ...s(f, l),
23
- enabled: u
21
+ return f({
22
+ ...s(m, d),
23
+ enabled: p,
24
+ ...r ? { refetchInterval: (e) => (e.state.data?.data ?? []).some((e) => e.ocr_status === "processing") ? c : !1 } : {}
24
25
  });
25
26
  }
26
- var p = 100;
27
- function m({ enabled: r } = {}) {
28
- let { client: i, organizationId: a, widgetToken: c, authEpoch: l } = e(), f = t(a), m = {
27
+ var m = 100;
28
+ function h({ enabled: r } = {}) {
29
+ let { client: i, organizationId: a, widgetToken: c, authEpoch: l } = e(), u = t(a), p = {
29
30
  duplicate_match_status: "suspected",
30
- limit: p
31
- }, h = u({
31
+ limit: m
32
+ }, h = d({
32
33
  queryKey: [...o({
33
34
  client: i,
34
- headers: f,
35
- query: m
35
+ headers: u,
36
+ query: p
36
37
  }), "all"],
37
38
  queryFn: async ({ signal: e }) => {
38
39
  let t = [], r = /* @__PURE__ */ new Set(), a;
39
40
  do {
40
41
  let { data: o } = await n({
41
42
  client: i,
42
- headers: f,
43
+ headers: u,
43
44
  query: {
44
- ...m,
45
+ ...p,
45
46
  pagination_token: a
46
47
  },
47
48
  signal: e,
@@ -54,33 +55,33 @@ function m({ enabled: r } = {}) {
54
55
  return { data: t };
55
56
  }
56
57
  });
57
- return d({
58
+ return f({
58
59
  ...s(h, l),
59
60
  enabled: !!(a && c) && r !== !1
60
61
  });
61
62
  }
62
- function h({ enabled: n } = {}) {
63
+ function g({ enabled: n } = {}) {
63
64
  let { client: i, organizationId: a, widgetToken: o, authEpoch: c } = e(), l = !!(a && o) && (n === !0 || n === void 0), u = r({
64
65
  client: i,
65
66
  headers: t(a)
66
67
  });
67
- return d({
68
+ return f({
68
69
  ...s(u, c),
69
70
  enabled: l
70
71
  });
71
72
  }
72
- function g(n, { enabled: r = !0, pollWhileOcrProcessing: a = !1, pollWhilePolicyAssignmentUnsettled: o = !1 } = {}) {
73
- let { client: u, organizationId: f, widgetToken: p, authEpoch: m } = e(), h = !!(f && p && n) && r, g = a ? c({
74
- client: u,
75
- organizationId: f,
73
+ function _(n, { enabled: r = !0, pollWhileOcrProcessing: a = !1, pollWhilePolicyAssignmentUnsettled: o = !1 } = {}) {
74
+ let { client: c, organizationId: d, widgetToken: p, authEpoch: m } = e(), h = !!(d && p && n) && r, g = a ? l({
75
+ client: c,
76
+ organizationId: d,
76
77
  payableId: n ?? ""
77
- }) : void 0, _ = o ? l({
78
- client: u,
79
- organizationId: f,
78
+ }) : void 0, _ = o ? u({
79
+ client: c,
80
+ organizationId: d,
80
81
  payableId: n ?? ""
81
82
  }) : void 0, v = g ?? _ ?? i({
82
- client: u,
83
- headers: t(f),
83
+ client: c,
84
+ headers: t(d),
84
85
  path: { payable_id: n ?? "" }
85
86
  }), y = g && _ ? {
86
87
  ...v,
@@ -89,10 +90,10 @@ function g(n, { enabled: r = !0, pollWhileOcrProcessing: a = !1, pollWhilePolicy
89
90
  return t.length ? Math.min(...t) : !1;
90
91
  }
91
92
  } : v;
92
- return d({
93
+ return f({
93
94
  ...s(y, m),
94
95
  enabled: h
95
96
  });
96
97
  }
97
98
  //#endregion
98
- export { m as useAllSuspectedDuplicatePayablesQuery, g as usePayableQuery, f as usePayablesQuery, h as usePayablesTotalCountQuery };
99
+ export { h as useAllSuspectedDuplicatePayablesQuery, _ as usePayableQuery, p as usePayablesQuery, g as usePayablesTotalCountQuery };
@@ -245,19 +245,20 @@ async function K({ client: e, organizationId: t, payableId: n }) {
245
245
  payableId: n
246
246
  }), o;
247
247
  }
248
- async function q({ client: e, organizationId: t, payableId: n }) {
249
- let i = Date.now() + S, o = !1;
250
- for (; !o && Date.now() < i;) {
248
+ var q = 9e4;
249
+ async function J({ client: e, organizationId: t, payableId: n }) {
250
+ let i = Date.now() + q, o = v, s = !1;
251
+ for (; !s && Date.now() < i;) {
251
252
  await new Promise((e) => {
252
- setTimeout(e, v);
253
- });
253
+ setTimeout(e, o);
254
+ }), o = E(o);
254
255
  try {
255
256
  let { data: i } = await a({
256
257
  client: e,
257
258
  headers: r(t),
258
259
  path: { payable_id: n }
259
260
  });
260
- o = i?.ocr_status !== "processing";
261
+ s = i?.ocr_status !== "processing";
261
262
  } catch {}
262
263
  }
263
264
  return await y({
@@ -265,7 +266,7 @@ async function q({ client: e, organizationId: t, payableId: n }) {
265
266
  organizationId: t,
266
267
  payableId: n,
267
268
  includeLineItems: !0
268
- }), o;
269
+ }), s;
269
270
  }
270
271
  //#endregion
271
- export { R as beginApprovalRequestWatch, k as invalidateApprovalDecisionQueries, x as invalidateDeletedPayableQueries, y as invalidatePayableQueries, z as reconcileApprovalDecisionQueries, K as reconcileCancelledPaymentQueries, W as reconcileScheduledPaymentQueries, H as reconcileSubmittedForApprovalQueries, q as reconcileUploadedPayableOcr };
272
+ export { R as beginApprovalRequestWatch, k as invalidateApprovalDecisionQueries, x as invalidateDeletedPayableQueries, y as invalidatePayableQueries, z as reconcileApprovalDecisionQueries, K as reconcileCancelledPaymentQueries, W as reconcileScheduledPaymentQueries, H as reconcileSubmittedForApprovalQueries, J as reconcileUploadedPayableOcr };
@@ -30,7 +30,9 @@ var v = {
30
30
  unreadableTax: "Enter a valid tax amount.",
31
31
  unreadableTotal: "Enter a valid total amount.",
32
32
  totalNotGreaterThanZero: "Total amount must be greater than $0.",
33
- poNumberTooLong: "PO number must be 255 characters or fewer."
33
+ poNumberTooLong: "PO number must be 255 characters or fewer.",
34
+ implausibleDate: "Enter a date within the last 10 years and next year.",
35
+ dueBeforeInvoiceDate: "Due date must be on or after the invoice date."
34
36
  }, y = {
35
37
  paymentInstructionsValue: (e) => `Account ending in ${e}`,
36
38
  noMethod: "No payment method on file",
@@ -157,7 +159,7 @@ var w = {
157
159
  createTitle: "New vendor",
158
160
  editTitle: "Edit vendor",
159
161
  switchVendorFieldLabel: "Switch to a different vendor",
160
- nameLabel: "Name",
162
+ nameLabel: "Business name",
161
163
  addAddress: "Add address (optional)",
162
164
  cancel: "Cancel",
163
165
  save: "Save",