@tesouro/embedded-components-react 0.11.179 → 0.11.181

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/dist/index.css +22 -0
  2. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index.js +24 -23
  3. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index10.js +16 -18
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index11.js +3 -3
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index12.js +5 -7
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index13.js +2 -2
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index14.js +4 -3
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index15.js +13 -27
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index16.js +34 -19
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index17.js +23 -16
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index18.js +26 -12
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index19.js +12 -57
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index2.js +34 -85
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index20.js +48 -29
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index21.js +36 -20
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index22.js +20 -18
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index23.js +14 -37
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index24.js +31 -14
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index25.js +26 -2
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index26.js +2 -0
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index3.js +90 -20
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index4.js +30 -8
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index5.js +8 -74
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index6.js +60 -19
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index7.js +6 -5
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index8.js +12 -17
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index9.js +20 -12
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index.js +7 -7
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index10.js +17 -36
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index11.js +42 -54
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index12.js +89 -6
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index13.js +5 -21
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index14.js +15 -92
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index15.js +103 -10
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index16.js +10 -9
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index17.js +8 -7
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index18.js +7 -9
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index19.js +11 -29
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index20.js +24 -24
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index21.js +22 -14
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index22.js +14 -137
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index23.js +139 -13
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index24.js +12 -18
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index25.js +15 -32
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index26.js +39 -108
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index27.js +96 -80
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index28.js +94 -3
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index29.js +4 -57
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index30.js +56 -116
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index31.js +114 -197
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index32.js +194 -75
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index33.js +75 -67
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index34.js +69 -111
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index35.js +108 -459
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index36.js +450 -102
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index37.js +117 -9
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index38.js +8 -85
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index39.js +73 -67
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index4.js +1 -1
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index40.js +71 -246
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index41.js +251 -40
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index42.js +38 -237
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index43.js +244 -21
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index44.js +21 -529
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index45.js +530 -4
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index46.js +4 -44
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index47.js +41 -242
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index48.js +245 -3
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index49.js +3 -5
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index50.js +4 -63
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index51.js +64 -1
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index52.js +1 -0
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index9.js +6 -18
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index3.js +7 -3
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index.js +4 -4
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index10.js +14 -17
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index11.js +82 -13
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index12.js +47 -83
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index13.js +261 -47
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index14.js +23 -251
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index15.js +450 -25
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index16.js +286 -442
  83. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index17.js +4 -300
  84. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index18.js +5 -4
  85. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index19.js +37 -4
  86. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index20.js +1 -38
  87. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index5.js +11 -11
  88. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index7.js +88 -7
  89. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index8.js +17 -89
  90. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index9.js +18 -18
  91. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index10.js +4 -4
  92. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index18.js +0 -1
  93. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index20.js +263 -262
  94. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/invalidatePayableQueries/approvalDecisionQueries.js +22 -19
  95. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/invalidatePayableQueries/invalidatePayableQueries.js +20 -20
  96. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/queryKeys.js +32 -21
  97. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillsTab.js +2 -2
  98. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/mocks/labels.js +1 -1
  99. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/index.js +4 -4
  100. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +42 -42
  101. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +237 -215
  102. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +151 -135
  103. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  104. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/index.js +7 -5
  105. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/AttentionStrip/AttentionStrip.js +29 -0
  106. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/AttentionStrip/AttentionViewBar.js +33 -0
  107. package/package.json +1 -1
  108. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index21.js +0 -1
@@ -2,100 +2,23 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
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 { useAllOrganizationRolesQuery as n } from "../../../../shared/data-access/dist/lib/role/useAllOrganizationRolesQuery.js";
8
- import { useAllOrganizationUsersQuery as r } from "../../../../shared/data-access/dist/lib/user/useAllOrganizationUsersQuery.js";
9
- import "../../../../shared/data-access/dist/index.js";
10
- import { useWidgetConfig as i } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
11
- import "../../../../shared/feature/dist/index.js";
12
- import { useGetApprovalPoliciesQuery as a } from "../../../../shared/approval-policy/data-access/dist/lib/approvalPoliciesApi.js";
13
- import "../../../../shared/approval-policy/data-access/dist/index.js";
14
- import { usePayableApprovalRequestsQuery as o } from "../../data-access/dist/index2.js";
5
+ import { usePayableHistoryQuery as e } from "../../data-access/dist/index4.js";
15
6
  import "../../data-access/dist/index.js";
16
- import { currentApprovalRound as s } from "./index6.js";
17
- import { buildPendingApproverGroups as c } from "./index7.js";
18
- import { buildPendingApproverGroupsFromCardView as l } from "./index8.js";
19
- import { resolveApprovalPolicySection as u } from "./index11.js";
20
- import { isAwaitingPolicyAssignment as d } from "./index12.js";
21
- import { usePayableApprovalRoundStart as f } from "./index13.js";
22
- import { useMemo as p } from "react";
23
7
  // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index14.js
24
- var m = /* @__PURE__ */ new Set([
25
- "approve_in_progress",
26
- "waiting_to_be_paid",
27
- "partially_paid",
28
- "paid",
29
- "rejected"
30
- ]);
31
- function h({ payableId: h, approvalPolicyId: g, status: _, updatedAt: v, payableFetchedAt: y, enabled: b = !0, copy: x }) {
32
- let S = !!g, C = b && S, { initResponse: w } = i(), T = e(w?.scopes, [t.ApprovalPolicyReadOrg]), E = e(w?.scopes, [t.ApprovalRequestReadOrg]), D = e(w?.scopes, [t.RoleReadOrg]), O = e(w?.scopes, [t.UserReadOrg]), k = a({ enabled: C && T }), A = n({ enabled: C && D }), j = r({ enabled: C && O }), M = o(h, { enabled: C && E }), { roundStartedAt: N, snapshotPolicyName: P, isLoading: F, isError: I } = f({
33
- payableId: h,
34
- enabled: b
35
- }), L = d({
36
- id: h,
37
- status: _,
38
- approval_policy_id: g,
39
- updated_at: v
40
- }, y), R = !!N || I && m.has(_ ?? ""), z = p(() => {
41
- let e = /* @__PURE__ */ new Map();
42
- for (let t of A.data?.data ?? []) e.set(t.id, {
43
- label: t.name,
44
- kind: "role"
45
- });
46
- for (let t of j.data?.data ?? []) e.set(t.id, {
47
- label: t.name,
48
- kind: "user"
49
- });
50
- return e;
51
- }, [A.data, j.data]), B = p(() => s(M.data?.data, N), [M.data, N]), V = p(() => new Set(B.flatMap((e) => e.approved_by ?? [])), [B]), H = p(() => new Set(B.filter((e) => (e.approved_by ?? []).some((t) => !(e.user_ids ?? []).includes(t))).flatMap((e) => e.role_ids ?? [])), [B]), U = T && !k.isResolving && !k.isError ? k.data?.data : void 0, W = U && (!k.isFetching || U.some((e) => e.id === g)) ? U : void 0, G = p(() => {
52
- if (b && !F && (S || R) && !L && !(S && (T && k.isResolving || D && A.isResolving || O && j.isResolving || E && M.isLoading))) return u({
53
- approvalPolicyId: g,
54
- livePolicies: W,
55
- snapshotPolicyName: P,
56
- currentRound: B,
57
- lookup: z,
58
- approvedUserIds: V,
59
- approvedRoleIds: H,
60
- copy: x
61
- });
62
- }, [
63
- b,
64
- F,
65
- S,
66
- R,
67
- L,
68
- T,
69
- k.isResolving,
70
- D,
71
- A.isResolving,
72
- O,
73
- j.isResolving,
74
- E,
75
- M.isLoading,
76
- g,
77
- W,
78
- P,
79
- B,
80
- z,
81
- V,
82
- H,
83
- x
84
- ]), K = p(() => C ? G?.source === "live" ? l(G.view) : c({
85
- requestsNewestFirst: M.data?.data,
86
- roundStartedAt: N,
87
- lookup: z
88
- }) : [], [
89
- C,
90
- G,
91
- M.data,
92
- N,
93
- z
94
- ]);
8
+ var t = "submitted_for_approval", n = "approval_requested";
9
+ function r({ payableId: r, enabled: a = !0 }) {
10
+ let o = e(r, { enabled: a }), s, c;
11
+ for (let e of o.data?.data ?? []) e.event_type === t ? s = e.timestamp : e.event_type === n && (c = i(e.event_data));
95
12
  return {
96
- view: G?.view,
97
- pendingApprovers: K,
98
- isLoading: !!g && (!b || k.isResolving || A.isResolving || j.isResolving || M.isLoading || M.isError || !E)
13
+ roundStartedAt: s,
14
+ snapshotPolicyName: c,
15
+ isLoading: o.isLoading,
16
+ isError: o.isError
99
17
  };
100
18
  }
101
- export { h as useApprovalPolicyCardView };
19
+ function i(e) {
20
+ if (!e || typeof e != "object" || !("approval_policy_name" in e)) return;
21
+ let t = e.approval_policy_name;
22
+ return typeof t == "string" && t ? t : void 0;
23
+ }
24
+ export { r as usePayableApprovalRoundStart };
@@ -1,13 +1,106 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
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 { useAllOrganizationRolesQuery as n } from "../../../../shared/data-access/dist/lib/role/useAllOrganizationRolesQuery.js";
8
+ import { useAllOrganizationUsersQuery as r } from "../../../../shared/data-access/dist/lib/user/useAllOrganizationUsersQuery.js";
9
+ import "../../../../shared/data-access/dist/index.js";
10
+ import { useWidgetConfig as i } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
11
+ import "../../../../shared/feature/dist/index.js";
12
+ import { useGetApprovalPoliciesQuery as a } from "../../../../shared/approval-policy/data-access/dist/lib/approvalPoliciesApi.js";
13
+ import "../../../../shared/approval-policy/data-access/dist/index.js";
14
+ import { useApprovalProcessStepsQuery as o, usePayableApprovalProcessesQuery as s } from "../../data-access/dist/index2.js";
15
+ import { usePayableApprovalRequestsQuery as c } from "../../data-access/dist/index3.js";
16
+ import "../../data-access/dist/index.js";
17
+ import { currentApprovalRound as l } from "./index6.js";
18
+ import { buildPendingApproverGroups as u } from "./index7.js";
19
+ import { buildPendingApproverGroupsFromCardView as d } from "./index8.js";
20
+ import { currentApprovalProcess as f } from "./index9.js";
21
+ import { resolveApprovalPolicySection as p } from "./index12.js";
22
+ import { isAwaitingPolicyAssignment as ee } from "./index13.js";
23
+ import { usePayableApprovalRoundStart as m } from "./index14.js";
24
+ import { useMemo as h } from "react";
1
25
  // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index15.js
2
- function e(e) {
3
- return [e.nominal_code, e.name].filter(Boolean).join(" — ");
4
- }
5
- function t({ isInitResolved: e, canReadGlCodes: t, isResolving: n, isError: r, optionCount: i, labels: a }) {
6
- let o;
7
- return e ? t ? r ? o = a.loadError : !n && i === 0 && (o = a.empty) : o = a.noAccess : o = void 0, {
8
- unavailableMessage: o,
9
- disabled: !e || !!o || n,
10
- rosterAvailable: t && !n && !r
26
+ var g = /* @__PURE__ */ new Set([
27
+ "approve_in_progress",
28
+ "waiting_to_be_paid",
29
+ "partially_paid",
30
+ "paid",
31
+ "rejected"
32
+ ]);
33
+ function _({ payableId: _, approvalPolicyId: v, status: y, updatedAt: b, payableFetchedAt: x, enabled: S = !0, copy: C }) {
34
+ let w = !!v, T = S && w, { initResponse: E } = i(), D = e(E?.scopes, [t.ApprovalPolicyReadOrg]), O = e(E?.scopes, [t.ApprovalRequestReadOrg]), k = e(E?.scopes, [t.RoleReadOrg]), A = e(E?.scopes, [t.UserReadOrg]), j = a({ enabled: T && D }), M = n({ enabled: T && k }), N = r({ enabled: T && A }), P = c(_, { enabled: T && O }), { roundStartedAt: F, snapshotPolicyName: I, isLoading: L, isError: R } = m({
35
+ payableId: _,
36
+ enabled: S
37
+ }), z = ee({
38
+ id: _,
39
+ status: y,
40
+ approval_policy_id: v,
41
+ updated_at: b
42
+ }, x), B = !!F || R && g.has(y ?? ""), V = h(() => {
43
+ let e = /* @__PURE__ */ new Map();
44
+ for (let t of M.data?.data ?? []) e.set(t.id, {
45
+ label: t.name,
46
+ kind: "role"
47
+ });
48
+ for (let t of N.data?.data ?? []) e.set(t.id, {
49
+ label: t.name,
50
+ kind: "user"
51
+ });
52
+ return e;
53
+ }, [M.data, N.data]), H = h(() => l(P.data?.data, F), [P.data, F]), U = h(() => new Set(H.flatMap((e) => e.approved_by ?? [])), [H]), W = h(() => new Set(H.filter((e) => (e.approved_by ?? []).some((t) => !(e.user_ids ?? []).includes(t))).flatMap((e) => e.role_ids ?? [])), [H]), G = D && !j.isResolving && !j.isError ? j.data?.data : void 0, K = G && (!j.isFetching || G.some((e) => e.id === v)) ? G : void 0, q = !!K?.some((e) => e.id === v), J = s(v, _, { enabled: T && q }), Y = h(() => f(J.data?.data, F)?.id, [J.data, F]), X = o(v, Y, { enabled: T && q }), Z = Y ? X.data?.data : void 0, Q = J.isLoading || !!Y && X.isLoading, $ = h(() => {
54
+ if (S && !L && (w || B) && !z && !(w && (D && j.isResolving || k && M.isResolving || A && N.isResolving || O && P.isLoading || Q))) return p({
55
+ approvalPolicyId: v,
56
+ livePolicies: K,
57
+ snapshotPolicyName: I,
58
+ routedSteps: Z,
59
+ currentRound: H,
60
+ lookup: V,
61
+ approvedUserIds: U,
62
+ approvedRoleIds: W,
63
+ copy: C
64
+ });
65
+ }, [
66
+ S,
67
+ L,
68
+ w,
69
+ B,
70
+ z,
71
+ D,
72
+ j.isResolving,
73
+ k,
74
+ M.isResolving,
75
+ A,
76
+ N.isResolving,
77
+ O,
78
+ P.isLoading,
79
+ Q,
80
+ v,
81
+ K,
82
+ I,
83
+ Z,
84
+ H,
85
+ V,
86
+ U,
87
+ W,
88
+ C
89
+ ]), te = h(() => T ? $?.pendingApprovers ? $.pendingApprovers : $?.source === "live" ? d($.view) : u({
90
+ requestsNewestFirst: P.data?.data,
91
+ roundStartedAt: F,
92
+ lookup: V
93
+ }) : [], [
94
+ T,
95
+ $,
96
+ P.data,
97
+ F,
98
+ V
99
+ ]);
100
+ return {
101
+ view: $?.view,
102
+ pendingApprovers: te,
103
+ isLoading: !!v && (!S || j.isResolving || M.isResolving || N.isResolving || P.isLoading || Q || P.isError || !O)
11
104
  };
12
105
  }
13
- export { e as formatGlCodeLabel, t as resolveGlCodeAvailability };
106
+ export { _ as useApprovalPolicyCardView };
@@ -1,12 +1,13 @@
1
1
  // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index16.js
2
- function e({ isCapabilityUnknown: e, canApproveNow: t, canOverridePolicy: n, status: r, hasApprovalPolicy: i, pendingApproverNames: a, labels: o }) {
3
- if (e) return { showApprovalOverrideNotice: !1 };
4
- if (n) return { showApprovalOverrideNotice: !t };
5
- if (t || r !== "approve_in_progress" || !i) return { showApprovalOverrideNotice: !1 };
6
- let s = [...new Set(a)];
7
- return {
8
- showApprovalOverrideNotice: !1,
9
- awaitingApprovalNotice: s.length ? o.awaitingApprovalNotice(s) : o.awaitingApprovalUnknownNotice
2
+ function e(e) {
3
+ return [e.nominal_code, e.name].filter(Boolean).join(" — ");
4
+ }
5
+ function t({ isInitResolved: e, canReadGlCodes: t, isResolving: n, isError: r, optionCount: i, labels: a }) {
6
+ let o;
7
+ return e ? t ? r ? o = a.loadError : !n && i === 0 && (o = a.empty) : o = a.noAccess : o = void 0, {
8
+ unavailableMessage: o,
9
+ disabled: !e || !!o || n,
10
+ rosterAvailable: t && !n && !r
10
11
  };
11
12
  }
12
- export { e as resolveApprovalNotices };
13
+ export { e as formatGlCodeLabel, t as resolveGlCodeAvailability };
@@ -1,11 +1,12 @@
1
1
  // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index17.js
2
- function e(e, t) {
3
- if (!e) return;
4
- let { onOpen: n, canEditExisting: r, ...i } = e;
2
+ function e({ isCapabilityUnknown: e, canApproveNow: t, canOverridePolicy: n, status: r, hasApprovalPolicy: i, pendingApproverNames: a, labels: o }) {
3
+ if (e) return { showApprovalOverrideNotice: !1 };
4
+ if (n) return { showApprovalOverrideNotice: !t };
5
+ if (t || r !== "approve_in_progress" || !i) return { showApprovalOverrideNotice: !1 };
6
+ let s = [...new Set(a)];
5
7
  return {
6
- ...i,
7
- onEditExisting: t && r ? n : void 0,
8
- onAdd: t ? void 0 : n
8
+ showApprovalOverrideNotice: !1,
9
+ awaitingApprovalNotice: s.length ? o.awaitingApprovalNotice(s) : o.awaitingApprovalUnknownNotice
9
10
  };
10
11
  }
11
- export { e as resolvePaymentInstructionsGestures };
12
+ export { e as resolveApprovalNotices };
@@ -1,13 +1,11 @@
1
- import { formatRejectionDate as e } from "../../../../shared/util/dist/lib/formatRejectionDate.js";
2
- import "../../../../shared/util/dist/index.js";
3
1
  // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index18.js
4
- function t({ payableStatus: t, approvalRequests: n, userNames: r, payableUpdatedAt: i, labels: a, now: o }) {
5
- let s = n.find((e) => e.status === "rejected");
6
- if (!s) return t !== "rejected" || !i ? void 0 : { actorLabel: a.rejectedOn(e(i, o)) };
7
- let c = s.rejected_by ? r.get(s.rejected_by) : void 0, l = e(s.updated_at, o);
2
+ function e(e, t) {
3
+ if (!e) return;
4
+ let { onOpen: n, canEditExisting: r, ...i } = e;
8
5
  return {
9
- actorLabel: c ? a.rejectedByOn(c, l) : a.rejectedOn(l),
10
- message: s.reject_reason ? a.rejectionMessage(s.reject_reason) : void 0
6
+ ...i,
7
+ onEditExisting: t && r ? n : void 0,
8
+ onAdd: t ? void 0 : n
11
9
  };
12
10
  }
13
- export { t as resolveBillRejectionNotice };
11
+ export { e as resolvePaymentInstructionsGestures };
@@ -1,31 +1,13 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { usePayableApprovalRequestsQuery as e } from "../../data-access/dist/index2.js";
6
- import "../../data-access/dist/index.js";
7
- import { currentApprovalRound as t } from "./index6.js";
8
- import { usePayableApprovalRoundStart as n } from "./index13.js";
9
- import { resolveBillRejectionNotice as r } from "./index18.js";
10
- import { useMemo as i } from "react";
1
+ import { formatRejectionDate as e } from "../../../../shared/util/dist/lib/formatRejectionDate.js";
2
+ import "../../../../shared/util/dist/index.js";
11
3
  // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index19.js
12
- function a({ payableId: a, payableStatus: o, payableUpdatedAt: s, enabled: c, userNames: l, labels: u }) {
13
- let d = n({
14
- payableId: a,
15
- enabled: c
16
- }), f = e(a, { enabled: c }), p = i(() => t(f.data?.data, d.roundStartedAt), [f.data, d.roundStartedAt]);
17
- return i(() => r({
18
- payableStatus: o,
19
- approvalRequests: p,
20
- userNames: l,
21
- payableUpdatedAt: s,
22
- labels: u
23
- }), [
24
- o,
25
- s,
26
- p,
27
- l,
28
- u
29
- ]);
4
+ function t({ payableStatus: t, approvalRequests: n, userNames: r, payableUpdatedAt: i, labels: a, now: o }) {
5
+ let s = n.find((e) => e.status === "rejected");
6
+ if (!s) return t !== "rejected" || !i ? void 0 : { actorLabel: a.rejectedOn(e(i, o)) };
7
+ let c = s.rejected_by ? r.get(s.rejected_by) : void 0, l = e(s.updated_at, o);
8
+ return {
9
+ actorLabel: c ? a.rejectedByOn(c, l) : a.rejectedOn(l),
10
+ message: s.reject_reason ? a.rejectionMessage(s.reject_reason) : void 0
11
+ };
30
12
  }
31
- export { a as useBillRejectionNotice };
13
+ export { t as resolveBillRejectionNotice };
@@ -2,30 +2,30 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
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 { usePayableApprovalRequestsQuery as r } from "../../data-access/dist/index2.js";
5
+ import { usePayableApprovalRequestsQuery as e } from "../../data-access/dist/index3.js";
11
6
  import "../../data-access/dist/index.js";
12
- import { currentApprovalRound as i } from "./index6.js";
13
- import { usePayableApprovalRoundStart as a } from "./index13.js";
7
+ import { currentApprovalRound as t } from "./index6.js";
8
+ import { usePayableApprovalRoundStart as n } from "./index14.js";
9
+ import { resolveBillRejectionNotice as r } from "./index19.js";
10
+ import { useMemo as i } from "react";
14
11
  // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index20.js
15
- function o({ payableId: o, status: s }) {
16
- let { initResponse: c } = n(), l = e(c?.scopes, [t.ApprovalRequestReadOrg]), u = s === "approve_in_progress" && l, { roundStartedAt: d } = a({
17
- payableId: o,
18
- enabled: u
19
- }), f = c?.userId ?? void 0, p = (e) => e.caller_is_policy_approver ?? !!(f && e.user_ids.includes(f)), m = r(o, {
20
- enabled: u,
21
- hasAwaitedRequest: u ? (e) => i(e, d).some(p) : void 0,
22
- currentRoundStartedAt: d
23
- }), h = u ? i(m.data?.data, d) : [], g = h.some(p), _ = h.filter((e) => e.status === "waiting");
24
- return {
25
- id: _.filter(p).find((e) => !(f && (e.approved_by ?? []).includes(f)))?.id,
26
- isPolicyApprover: g,
27
- hasWaitingRequest: _.length > 0,
28
- isLoading: m.isLoading
29
- };
12
+ function a({ payableId: a, payableStatus: o, payableUpdatedAt: s, enabled: c, userNames: l, labels: u }) {
13
+ let d = n({
14
+ payableId: a,
15
+ enabled: c
16
+ }), f = e(a, { enabled: c }), p = i(() => t(f.data?.data, d.roundStartedAt), [f.data, d.roundStartedAt]);
17
+ return i(() => r({
18
+ payableStatus: o,
19
+ approvalRequests: p,
20
+ userNames: l,
21
+ payableUpdatedAt: s,
22
+ labels: u
23
+ }), [
24
+ o,
25
+ s,
26
+ p,
27
+ l,
28
+ u
29
+ ]);
30
30
  }
31
- export { o as useCurrentApprovalRequestId };
31
+ export { a as useBillRejectionNotice };
@@ -2,22 +2,30 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { buildPayableAuditHistory as e, hasUnattributedAuditRows as t } from "../../../../shared/util/dist/lib/auditHistory/buildPayableAuditHistory.js";
6
- import "../../../../shared/util/dist/index.js";
7
- import { usePayableHistoryQuery as n } from "../../data-access/dist/index3.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 { usePayableApprovalRequestsQuery as r } from "../../data-access/dist/index3.js";
8
11
  import "../../data-access/dist/index.js";
9
- import { useMemo as r } from "react";
12
+ import { currentApprovalRound as i } from "./index6.js";
13
+ import { usePayableApprovalRoundStart as a } from "./index14.js";
10
14
  // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index21.js
11
- function i({ payableId: i, userNames: a, isRosterError: o, labels: s }) {
12
- let c = n(i), l = r(() => e(c.data?.data ?? [], a, s), [
13
- c.data,
14
- a,
15
- s
16
- ]);
15
+ function o({ payableId: o, status: s }) {
16
+ let { initResponse: c } = n(), l = e(c?.scopes, [t.ApprovalRequestReadOrg]), u = s === "approve_in_progress" && l, { roundStartedAt: d } = a({
17
+ payableId: o,
18
+ enabled: u
19
+ }), f = c?.userId ?? void 0, p = (e) => e.caller_is_policy_approver ?? !!(f && e.user_ids.includes(f)), m = r(o, {
20
+ enabled: u,
21
+ hasAwaitedRequest: u ? (e) => i(e, d).some(p) : void 0,
22
+ currentRoundStartedAt: d
23
+ }), h = u ? i(m.data?.data, d) : [], g = h.some(p), _ = h.filter((e) => e.status === "waiting");
17
24
  return {
18
- historyQuery: c,
19
- rows: l,
20
- namesError: o && t(c.data?.data ?? [], l, a)
25
+ id: _.filter(p).find((e) => !(f && (e.approved_by ?? []).includes(f)))?.id,
26
+ isPolicyApprover: g,
27
+ hasWaitingRequest: _.length > 0,
28
+ isLoading: m.isLoading
21
29
  };
22
30
  }
23
- export { i as usePayableAuditHistory };
31
+ export { o as useCurrentApprovalRequestId };
@@ -2,145 +2,22 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { toast as e } from "../../../../../../node_modules/sonner/dist/index.js";
6
- import "../../../../shared/ui/dist/index.js";
7
- import { useWidgetConfig as t } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
8
- import "../../../../shared/feature/dist/index.js";
9
- import { useApprovePayableApprovalRequestMutation as n, useRejectPayableApprovalRequestMutation as r } from "../../data-access/dist/index2.js";
10
- import { useCancelPayableMutation as i } from "../../data-access/dist/index7.js";
11
- import { useCancelScheduledPaymentMutation as a } from "../../data-access/dist/index8.js";
12
- import { useForceApprovePayableMutation as o } from "../../data-access/dist/index12.js";
13
- import { useForceRejectPayableMutation as s } from "../../data-access/dist/index13.js";
14
- import { useReopenPayableMutation as c } from "../../data-access/dist/index14.js";
5
+ import { buildPayableAuditHistory as e, hasUnattributedAuditRows as t } from "../../../../shared/util/dist/lib/auditHistory/buildPayableAuditHistory.js";
6
+ import "../../../../shared/util/dist/index.js";
7
+ import { usePayableHistoryQuery as n } from "../../data-access/dist/index4.js";
15
8
  import "../../data-access/dist/index.js";
16
- import { getBillDetailActions as l } from "./index5.js";
17
- import { useState as u } from "react";
18
- import { BanIcon as d, HandIcon as f } from "lucide-react";
9
+ import { useMemo as r } from "react";
19
10
  // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index22.js
20
- function p({ payableId: d, status: f, currentApprovalRequestId: p, arePendingApproversUnknown: m, hasScheduledPayment: h, scheduledPaymentIntentId: g, isScheduledPaymentUnknown: v, isPayabilityUnknown: x, labels: S, isMarkAsPaidPending: C, hasApprovalPolicy: w = !0, hasWaitingRequest: T, pendingApprovers: E, onPayBillSelect: D, onMarkAsPaidSelect: O, onEditSelect: k, onActionSucceeded: A }) {
21
- let { initResponse: j } = t(), M = r(), N = n(), P = i(), F = a(), I = c(), L = o(), R = s(), z = C || M.isPending || N.isPending || P.isPending || F.isPending || I.isPending || L.isPending || R.isPending, [B, V] = u(), H = B && (B.id !== "cancelScheduledPayment" || B.scheduledPaymentIntentId === g) ? B : void 0, U = d && f ? l({
22
- status: f,
23
- scopes: j?.scopes,
24
- canDecideApprovalRequest: !!p,
25
- arePendingApproversUnknown: m,
26
- hasApprovalPolicy: w,
27
- hasWaitingRequest: T,
28
- hasScheduledPayment: h || v,
29
- scheduledPaymentIntentId: g,
30
- isPayabilityUnknown: x,
31
- canEdit: !!k,
32
- labels: S
33
- }) : [], W = (t) => ({
34
- onError: () => e.error(S.actionError),
35
- onSuccess: () => {
36
- let n = b(t) && !w ? `${t}NoApprovalPolicy` : t;
37
- e.success(S.actionSuccess[n]), A?.(t);
38
- }
39
- }), G = {
40
- reject: {
41
- isPending: M.isPending,
42
- run: (e) => p && M.mutate({
43
- path: { approval_request_id: p },
44
- body: e ? { reject_reason: e } : void 0
45
- }, W("reject"))
46
- },
47
- approve: {
48
- isPending: N.isPending,
49
- run: () => p && N.mutate({ path: { approval_request_id: p } }, W("approve"))
50
- },
51
- cancel: {
52
- isPending: P.isPending,
53
- run: () => d && P.mutate({ path: { payable_id: d } }, W("cancel"))
54
- },
55
- cancelScheduledPayment: {
56
- isPending: F.isPending,
57
- run: () => {
58
- let e = H?.scheduledPaymentIntentId;
59
- d && e && F.mutate({
60
- path: { payment_intent_id: e },
61
- payableId: d
62
- }, W("cancelScheduledPayment"));
63
- }
64
- },
65
- reopen: {
66
- isPending: I.isPending,
67
- run: () => d && I.mutate({ path: { payable_id: d } }, W("reopen"))
68
- },
69
- forceApprove: {
70
- isPending: L.isPending,
71
- run: () => d && L.mutate({ path: { payable_id: d } }, W("forceApprove"))
72
- },
73
- forceReject: {
74
- isPending: R.isPending,
75
- run: () => d && R.mutate({ path: { payable_id: d } }, W("forceReject"))
76
- }
77
- }, K = U.map((e) => ({
78
- ...e,
79
- disabled: z,
80
- loading: e.id === "markAsPaid" ? C : G[e.id]?.isPending ?? !1,
81
- onSelect: () => {
82
- !z && d && (e.id === "payBill" ? D() : e.id === "markAsPaid" ? O() : e.id === "edit" ? k?.() : y(e.id) ? V({
83
- id: e.id,
84
- scheduledPaymentIntentId: g
85
- }) : G[e.id]?.run());
86
- }
87
- }));
11
+ function i({ payableId: i, userNames: a, isRosterError: o, labels: s }) {
12
+ let c = n(i), l = r(() => e(c.data?.data ?? [], a, s), [
13
+ c.data,
14
+ a,
15
+ s
16
+ ]);
88
17
  return {
89
- isActionPending: z,
90
- actions: {
91
- row: K.filter((e) => e.surface === "row"),
92
- menu: K.filter((e) => e.surface === "menu")
93
- },
94
- decisionDialog: {
95
- open: !!H,
96
- copy: H ? {
97
- ...S.decisionDialog[H.id],
98
- ...b(H.id) && !w ? S.decisionDialog[H.id].noApprovalPolicy : void 0,
99
- presentation: _(H.id),
100
- pendingApprovers: b(H.id) ? E ?? [] : void 0
101
- } : void 0,
102
- isPending: H ? G[H.id]?.isPending ?? !1 : !1,
103
- onCancel: () => {
104
- z || V(void 0);
105
- },
106
- onConfirm: (e) => {
107
- H && !z && (G[H.id]?.run(e), V(void 0));
108
- }
109
- }
18
+ historyQuery: c,
19
+ rows: l,
20
+ namesError: o && t(c.data?.data ?? [], l, a)
110
21
  };
111
22
  }
112
- var m = {
113
- alignment: "center",
114
- icon: f,
115
- tone: "destructive",
116
- actionWidth: "equal"
117
- }, h = {
118
- alignment: "center",
119
- icon: d,
120
- tone: "destructive",
121
- actionWidth: "equal"
122
- }, g = {
123
- alignment: "center",
124
- icon: d,
125
- tone: "destructive",
126
- actionWidth: "equal"
127
- };
128
- function _(e) {
129
- if (b(e)) return m;
130
- if (e === "reject") return h;
131
- if (e === "cancel") return g;
132
- }
133
- var v = [
134
- "reject",
135
- "cancel",
136
- "cancelScheduledPayment",
137
- "forceApprove",
138
- "forceReject"
139
- ];
140
- function y(e) {
141
- return v.includes(e);
142
- }
143
- function b(e) {
144
- return e === "forceApprove" || e === "forceReject";
145
- }
146
- export { p as usePayableDetailActions };
23
+ export { i as usePayableAuditHistory };