@tesouro/embedded-components-react 0.4.12 → 0.4.14

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 (164) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/lib/BillPayWidget.js +1 -1
  3. package/dist/lib/monite-sdk.d.ts +204 -468
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +14 -14
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +37 -78
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js +98 -7
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +81 -15
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js +7 -26
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +16 -61
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +26 -2
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +63 -65
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +2 -6
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +66 -5
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +2 -2
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index2.js +6 -24
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +4 -32
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +3 -41
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +28 -166
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +40 -44
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +173 -1
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +45 -47
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +1 -7
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +45 -11
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +4 -8
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +13 -14
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index3.js +55 -22
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +8 -66
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +7 -19
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +58 -126
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +15 -11
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +134 -4
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +14 -31
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +4 -5
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +39 -87
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +78 -67
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +78 -48
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index4.js +24 -57
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +47 -91
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +119 -33
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +33 -168
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +170 -75
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +75 -21
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +23 -210
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +199 -203
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +198 -89
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +105 -13
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +12 -47
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index5.js +23 -6
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +47 -31
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +27 -198
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +198 -30
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +30 -234
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +240 -19
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +19 -342
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +364 -4
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +4 -34
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +32 -167
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +186 -3
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +56 -5
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +3 -4
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +2 -44
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +46 -1
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +1 -8
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +6 -9
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +9 -92
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +94 -3
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +3 -128
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +125 -8
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +8 -7
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +5 -69
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +8 -46
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +43 -18
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +20 -28
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +27 -82
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +83 -47
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +47 -250
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +239 -101
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +107 -202
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +209 -3
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +4 -8
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +5 -43
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +6 -113
  83. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +115 -1
  84. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +0 -24
  85. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index83.js +25 -0
  86. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +64 -89
  87. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +40 -37
  88. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index100.js +10 -0
  89. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index101.js +52 -0
  90. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index102.js +2 -0
  91. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index15.js +2 -5
  92. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +12 -62
  93. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index17.js +12 -1
  94. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +16 -12
  95. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index19.js +2 -12
  96. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js +2 -16
  97. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +30 -2
  98. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +2 -4
  99. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index23.js +28 -26
  100. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +0 -1
  101. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +6 -5
  102. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +161 -154
  103. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index31.js +16 -21
  104. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index32.js +47 -337
  105. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index34.js +20 -13
  106. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index35.js +327 -107
  107. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index37.js +13 -9
  108. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index38.js +113 -92
  109. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index40.js +9 -10
  110. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index41.js +95 -55
  111. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index43.js +9 -51
  112. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index44.js +56 -10
  113. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index45.js +2 -160
  114. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index46.js +54 -1
  115. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index47.js +11 -2
  116. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index48.js +178 -37
  117. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index49.js +1 -1
  118. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index50.js +2 -5
  119. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index51.js +37 -88
  120. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index53.js +5 -2
  121. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index54.js +88 -12
  122. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index56.js +2 -84
  123. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index57.js +11 -282
  124. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index58.js +2 -13
  125. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index59.js +87 -0
  126. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index60.js +294 -6
  127. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index61.js +9 -35
  128. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index62.js +0 -1
  129. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index63.js +5 -36
  130. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index64.js +37 -10
  131. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index65.js +2 -201
  132. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index66.js +39 -3
  133. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index67.js +3 -8
  134. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index68.js +187 -333
  135. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index69.js +3 -10
  136. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index70.js +13 -4
  137. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index71.js +335 -81
  138. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index72.js +10 -0
  139. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index73.js +8 -2
  140. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index74.js +87 -121
  141. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index76.js +2 -89
  142. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index77.js +127 -2
  143. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index78.js +25 -4
  144. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index79.js +85 -26
  145. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index81.js +3 -3
  146. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +26 -30
  147. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index84.js +4 -9
  148. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index85.js +30 -102
  149. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index87.js +9 -14
  150. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index88.js +85 -104
  151. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index90.js +10 -11
  152. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index91.js +123 -8
  153. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index92.js +2 -170
  154. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index93.js +18 -2
  155. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index94.js +7 -11
  156. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index95.js +158 -96
  157. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index96.js +1 -1
  158. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index97.js +11 -7
  159. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index98.js +100 -44
  160. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index618.js +1 -1
  161. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  162. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
  163. package/package.json +7 -7
  164. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index75.js +0 -28
@@ -1,31 +1,31 @@
1
- import "./index2.js";
2
- import "./index3.js";
3
1
  import "./index4.js";
2
+ import "./index5.js";
4
3
  import "./index6.js";
5
- import "./index7.js";
6
4
  import "./index8.js";
7
5
  import "./index9.js";
8
6
  import "./index10.js";
9
7
  import "./index11.js";
10
- import "./index23.js";
11
- import "./index24.js";
12
- import "./index37.js";
13
- import "./index42.js";
14
- import "./index51.js";
15
- import "./index53.js";
16
- import "./index55.js";
8
+ import "./index12.js";
9
+ import "./index13.js";
10
+ import "./index25.js";
11
+ import "./index26.js";
12
+ import "./index38.js";
13
+ import "./index43.js";
14
+ import "./index52.js";
15
+ import "./index54.js";
17
16
  import "./index56.js";
18
17
  import "./index57.js";
19
18
  import "./index58.js";
20
19
  import "./index59.js";
21
- import "./index63.js";
20
+ import "./index60.js";
22
21
  import "./index64.js";
23
22
  import "./index65.js";
24
23
  import "./index66.js";
25
24
  import "./index67.js";
26
- import "./index70.js";
27
- import "./index76.js";
25
+ import "./index68.js";
26
+ import "./index71.js";
28
27
  import "./index77.js";
29
28
  import "./index78.js";
30
- import { BillPayWidget as e } from "./index82.js";
29
+ import "./index79.js";
30
+ import { BillPayWidget as e } from "./index83.js";
31
31
  export { e as BillPayWidget };
@@ -2,86 +2,45 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import "../../../shared/ui/dist/index.js";
7
- import { DUPLICATE_BILLS_LABELS_EN as t } from "./index2.js";
8
- import { DuplicateVerdict as n, suspectedPayableDuplicates as r, useApplyDuplicateVerdictsMutation as i } from "../../data-access/dist/index7.js";
9
- import "../../data-access/dist/index.js";
10
- import { payableRemoval as a } from "./index6.js";
11
- import { useCallback as o, useMemo as s, useState as c } from "react";
5
+ import { useCallback as e, useEffect as t, useState as n } from "react";
12
6
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js
13
- function l({ payable: l, canManage: u = !0, onRemoved: d, labels: f }) {
14
- let p = s(() => ({
15
- ...t,
16
- ...f
17
- }), [f]), m = r(l), [h] = m, g = l?.id, _ = i(), [v, y] = c(!1), b = a(l?.status), x = o(async (t, n, r) => {
18
- if (!(!m.length || !g)) try {
19
- await _.mutateAsync({
20
- verdict: t,
21
- targets: m.map((e) => ({
22
- payableId: g,
23
- duplicateId: e.id,
24
- matchedPayableId: e.matched_payable_id,
25
- removeBy: b
26
- }))
27
- }), e.success(n), r?.();
28
- } catch {
29
- e.error(p.verdictFailedToast);
30
- }
31
- }, [
32
- _,
33
- p,
34
- m,
35
- g,
36
- b
37
- ]), S = b === "delete" ? {
38
- button: p.deleteBillButton,
39
- title: p.deleteConfirmTitle,
40
- description: p.deleteConfirmDescription,
41
- confirmButton: p.deleteConfirmButton,
42
- backButton: p.deleteConfirmBackButton,
43
- toast: p.deletedToast
44
- } : b === "confirm" ? {
45
- button: p.confirmBillButton,
46
- title: p.cancelConfirmTitle,
47
- description: p.cancelConfirmDescription,
48
- confirmButton: p.confirmBillButton,
49
- backButton: p.cancelConfirmBackButton,
50
- toast: p.confirmedToast
51
- } : {
52
- button: p.cancelBillButton,
53
- title: p.cancelConfirmTitle,
54
- description: p.cancelConfirmDescription,
55
- confirmButton: p.cancelConfirmButton,
56
- backButton: p.cancelConfirmBackButton,
57
- toast: p.cancelledToast
58
- }, C = o(async () => {
59
- await x(n.Remove, S.toast, d), y(!1);
60
- }, [
61
- x,
62
- d,
63
- S.toast
64
- ]), w = u && !!(h && g), T = w && !!b;
7
+ function r({ reviewIds: r }) {
8
+ let [i, a] = n(/* @__PURE__ */ new Set());
9
+ t(() => {
10
+ let e = new Set(r);
11
+ a((t) => {
12
+ let n = new Set([...t].filter((t) => e.has(t)));
13
+ return n.size === t.size ? t : n;
14
+ });
15
+ }, [r]);
16
+ let o = e((e) => {
17
+ a((t) => {
18
+ let n = new Set(t);
19
+ return n.delete(e) || n.add(e), n;
20
+ });
21
+ }, []), s = e((e) => {
22
+ a((t) => {
23
+ let n = new Set(t), r = e.every((e) => n.has(e));
24
+ return e.forEach((e) => {
25
+ r ? n.delete(e) : n.add(e);
26
+ }), n;
27
+ });
28
+ }, []), c = e((e) => {
29
+ a((t) => {
30
+ let n = new Set(t);
31
+ return e.forEach((e) => n.delete(e)), n;
32
+ });
33
+ }, []);
65
34
  return {
66
- isPossibleDuplicate: !!h,
67
- onNotADuplicate: w ? () => void x(n.Keep, p.dismissedToast) : void 0,
68
- onRemoveBill: T ? b === "delete" ? () => y(!0) : () => void C() : void 0,
69
- removeBillLabel: T ? S.button : void 0,
70
- removeConfirmation: {
71
- open: v,
72
- copy: {
73
- title: S.title,
74
- description: S.description,
75
- confirmButton: S.confirmButton,
76
- presentation: { tone: "destructive" }
77
- },
78
- onConfirm: () => void C(),
79
- onCancel: () => y(!1),
80
- isPending: _.isPending,
81
- cancelButtonLabel: S.backButton
82
- },
83
- isBusy: _.isPending
35
+ isSelected: e((e) => i.has(e), [i]),
36
+ toggle: o,
37
+ toggleAll: s,
38
+ checkedState: e((e) => {
39
+ let t = e.filter((e) => i.has(e)).length;
40
+ return t === 0 ? !1 : t === e.length || "indeterminate";
41
+ }, [i]),
42
+ deselect: c
84
43
  };
85
44
  }
86
45
  //#endregion
87
- export { l as usePayableDuplicateReview };
46
+ export { r as useDuplicateBillsSelection };
@@ -1,7 +1,98 @@
1
- import "./index2.js";
2
- import "./index3.js";
3
- import "./index6.js";
4
- import "./index7.js";
5
- import "./index8.js";
6
- import "./index9.js";
7
- import "./index10.js";
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import "../../../shared/ui/dist/index.js";
7
+ import { DUPLICATE_BILLS_LABELS_EN as t } from "./index4.js";
8
+ import { DuplicateVerdict as n, useApplyDuplicateVerdictsMutation as r } from "../../data-access/dist/index7.js";
9
+ import "../../data-access/dist/index.js";
10
+ import { useDuplicateBills as i } from "./index9.js";
11
+ import { useDuplicateBillsSelection as a } from "./index10.js";
12
+ import { DuplicateBillsDialog as o } from "../../ui/dist/index79.js";
13
+ import "../../ui/dist/index.js";
14
+ import { useMemo as s, useState as c } from "react";
15
+ import { jsx as l } from "react/jsx-runtime";
16
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js
17
+ function u({ open: u, onOpenChange: d, enabled: f = !0, canManageDuplicates: p = !0, onOpenBill: m, labels: h, dialogLabels: g }) {
18
+ let _ = s(() => ({
19
+ ...t,
20
+ ...h
21
+ }), [h]), v = i({ enabled: f }), y = s(() => v.groups.flatMap((e) => e.bills.map((e) => e.id)), [v.groups]), b = a({ reviewIds: y }), x = r(), [S, C] = c(), [w, T] = c(), E = s(() => {
22
+ let [e] = v.groups;
23
+ if (e) return w ? v.groups.some((e) => e.id === w.id) ? w.id : (v.groups[w.index] ?? v.groups[v.groups.length - 1]).id : e.id;
24
+ }, [w, v.groups]), D = (e) => e.bills.filter((e) => b.isSelected(e.id)), O = async (t, n, r, i) => {
25
+ let a = D(t);
26
+ if (a.length === 0) throw Error("Duplicate review action taken with no bills selected — keeping and removing both need a subject.");
27
+ let o = a.flatMap((e) => e.matches.map((t) => ({
28
+ payableId: e.id,
29
+ duplicateId: t.matchId,
30
+ matchedPayableId: t.matchedPayableId,
31
+ removeBy: e.removeBy
32
+ })));
33
+ C({
34
+ groupId: t.id,
35
+ action: r
36
+ });
37
+ try {
38
+ await x.mutateAsync({
39
+ verdict: n,
40
+ targets: o
41
+ }), e.success(i), b.deselect(a.map((e) => e.id));
42
+ } catch {
43
+ e.error(_.verdictFailedToast);
44
+ } finally {
45
+ C(void 0);
46
+ }
47
+ }, k = v.groups.map((e) => {
48
+ let t = e.bills.map((e) => e.id), r = D(e), i = {
49
+ vendorLabel: e.vendorLabel,
50
+ count: e.bills.length
51
+ };
52
+ return {
53
+ id: e.id,
54
+ titleLabel: e.vendorLabel,
55
+ countLabel: String(e.bills.length),
56
+ accessibleLabel: _.reviewGroup(i),
57
+ selectAllLabel: _.selectGroup(i),
58
+ selectAllChecked: b.checkedState(t),
59
+ onToggleAllRows: () => b.toggleAll(t),
60
+ rows: e.bills.map((e) => ({
61
+ id: e.id,
62
+ status: e.status,
63
+ statusTone: e.statusTone,
64
+ removalOutcome: e.removeBy === "delete" || e.removeBy === "cancel" ? e.removeBy : void 0,
65
+ invoiceNumberLabel: e.invoiceNumberLabel,
66
+ amountLabel: e.amountLabel,
67
+ invoiceDateLabel: e.invoiceDateLabel,
68
+ addedOnLabel: e.addedOnLabel,
69
+ selectLabel: _.selectRow(e),
70
+ openLabel: _.openRow(e),
71
+ isSelected: b.isSelected(e.id),
72
+ onToggleSelected: () => b.toggle(e.id),
73
+ onOpen: () => m?.(e.id)
74
+ })),
75
+ onKeepSelected: p ? () => void O(e, n.Keep, "keep", _.dismissedToast) : void 0,
76
+ onRemoveDuplicates: p ? () => void O(e, n.Remove, "remove", _.removedToast) : void 0,
77
+ isActionDisabled: r.length === 0,
78
+ isRemoveUnavailable: r.some((e) => !e.removeBy),
79
+ pendingAction: S?.groupId === e.id ? S.action : void 0
80
+ };
81
+ });
82
+ return /* @__PURE__ */ l(o, {
83
+ open: u,
84
+ onOpenChange: d,
85
+ groups: k,
86
+ isLoading: v.isLoading,
87
+ isError: v.isError,
88
+ expandedGroupId: E,
89
+ onExpandedGroupChange: (e) => T({
90
+ id: e,
91
+ index: v.groups.findIndex((t) => t.id === e)
92
+ }),
93
+ isBusy: !!S,
94
+ labels: g
95
+ });
96
+ }
97
+ //#endregion
98
+ export { u as DuplicateBillsContainer, u as default };
@@ -1,21 +1,87 @@
1
- import { MARK_AS_PAID_DIALOG_LABELS_EN as e } from "../../ui/dist/index87.js";
2
- import "../../ui/dist/index.js";
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import "../../../shared/ui/dist/index.js";
7
+ import { DUPLICATE_BILLS_LABELS_EN as t } from "./index4.js";
8
+ import { DuplicateVerdict as n, suspectedPayableDuplicates as r, useApplyDuplicateVerdictsMutation as i } from "../../data-access/dist/index7.js";
9
+ import "../../data-access/dist/index.js";
10
+ import { payableRemoval as a } from "./index8.js";
11
+ import { useCallback as o, useMemo as s, useState as c } from "react";
3
12
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js
4
- var t = {
5
- dueDateSuffix: (e) => `by ${e}`,
6
- paidToast: "Bill marked as paid",
7
- submitError: "Couldn't mark this bill as paid. Try again.",
8
- dialog: e
9
- };
10
- function n(e) {
11
- return {
13
+ function l({ payable: l, canManage: u = !0, onRemoved: d, labels: f }) {
14
+ let p = s(() => ({
12
15
  ...t,
13
- ...e,
14
- dialog: {
15
- ...t.dialog,
16
- ...e?.dialog
16
+ ...f
17
+ }), [f]), m = r(l), [h] = m, g = l?.id, _ = i(), [v, y] = c(!1), b = a(l?.status), x = o(async (t, n, r) => {
18
+ if (!(!m.length || !g)) try {
19
+ await _.mutateAsync({
20
+ verdict: t,
21
+ targets: m.map((e) => ({
22
+ payableId: g,
23
+ duplicateId: e.id,
24
+ matchedPayableId: e.matched_payable_id,
25
+ removeBy: b
26
+ }))
27
+ }), e.success(n), r?.();
28
+ } catch {
29
+ e.error(p.verdictFailedToast);
17
30
  }
31
+ }, [
32
+ _,
33
+ p,
34
+ m,
35
+ g,
36
+ b
37
+ ]), S = b === "delete" ? {
38
+ button: p.deleteBillButton,
39
+ title: p.deleteConfirmTitle,
40
+ description: p.deleteConfirmDescription,
41
+ confirmButton: p.deleteConfirmButton,
42
+ backButton: p.deleteConfirmBackButton,
43
+ toast: p.deletedToast
44
+ } : b === "confirm" ? {
45
+ button: p.confirmBillButton,
46
+ title: p.cancelConfirmTitle,
47
+ description: p.cancelConfirmDescription,
48
+ confirmButton: p.confirmBillButton,
49
+ backButton: p.cancelConfirmBackButton,
50
+ toast: p.confirmedToast
51
+ } : {
52
+ button: p.cancelBillButton,
53
+ title: p.cancelConfirmTitle,
54
+ description: p.cancelConfirmDescription,
55
+ confirmButton: p.cancelConfirmButton,
56
+ backButton: p.cancelConfirmBackButton,
57
+ toast: p.cancelledToast
58
+ }, C = o(async () => {
59
+ await x(n.Remove, S.toast, d), y(!1);
60
+ }, [
61
+ x,
62
+ d,
63
+ S.toast
64
+ ]), w = u && !!(h && g), T = w && !!b;
65
+ return {
66
+ isPossibleDuplicate: !!h,
67
+ onNotADuplicate: w ? () => void x(n.Keep, p.dismissedToast) : void 0,
68
+ onRemoveBill: T ? b === "delete" ? () => y(!0) : () => void C() : void 0,
69
+ removeBillLabel: T ? S.button : void 0,
70
+ removeConfirmation: {
71
+ open: v,
72
+ copy: {
73
+ title: S.title,
74
+ description: S.description,
75
+ confirmButton: S.confirmButton,
76
+ presentation: { tone: "destructive" }
77
+ },
78
+ onConfirm: () => void C(),
79
+ onCancel: () => y(!1),
80
+ isPending: _.isPending,
81
+ cancelButtonLabel: S.backButton
82
+ },
83
+ isBusy: _.isPending
18
84
  };
19
85
  }
20
86
  //#endregion
21
- export { t as MARK_AS_PAID_FLOW_LABELS_EN, n as mergeMarkAsPaidFlowLabels };
87
+ export { l as usePayableDuplicateReview };
@@ -1,26 +1,7 @@
1
- //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js
2
- var e = new Intl.DateTimeFormat("en-CA", {
3
- timeZone: "America/New_York",
4
- year: "numeric",
5
- month: "2-digit",
6
- day: "2-digit"
7
- });
8
- function t(t = /* @__PURE__ */ new Date()) {
9
- let n = e.formatToParts(t), r = Object.fromEntries(n.map((e) => [e.type, e.value]));
10
- return `${r.year}-${r.month}-${r.day}`;
11
- }
12
- function n(e) {
13
- return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
14
- }
15
- function r(e, r = /* @__PURE__ */ new Date()) {
16
- return n(e) === t(r);
17
- }
18
- function i(e = /* @__PURE__ */ new Date()) {
19
- let [n, r, i] = t(e).split("-").map(Number);
20
- return new Date(n, r - 1, i);
21
- }
22
- function a(e, r = /* @__PURE__ */ new Date()) {
23
- return n(e) < t(r);
24
- }
25
- //#endregion
26
- export { n as dateToCalendarKey, i as getDefaultPaymentDate, t as getEasternDateKey, a as isPastEasternDate, r as isTodayInEastern };
1
+ import "./index4.js";
2
+ import "./index5.js";
3
+ import "./index8.js";
4
+ import "./index9.js";
5
+ import "./index10.js";
6
+ import "./index11.js";
7
+ import "./index12.js";
@@ -1,66 +1,21 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import "../../../shared/ui/dist/index.js";
7
- import { formatCalendarDate as t } from "../../../shared/util/dist/lib/formatCalendarDate.js";
8
- import { formatMoneyExact as n } from "../../../shared/util/dist/lib/formatMoneyExact.js";
9
- import { extractApiErrorMessage as r } from "../../../shared/util/dist/lib/apiErrors.js";
10
- import { useMarkPayableAsPaidMutation as i } from "../../data-access/dist/index13.js";
11
- import "../../data-access/dist/index.js";
12
- import { dateToCalendarKey as a, getDefaultPaymentDate as o, isTodayInEastern as s } from "./index13.js";
13
- import { mergeMarkAsPaidFlowLabels as c } from "./index12.js";
14
- import { useEffect as l, useState as u } from "react";
1
+ import { MARK_AS_PAID_DIALOG_LABELS_EN as e } from "../../ui/dist/index90.js";
2
+ import "../../ui/dist/index.js";
15
3
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js
16
- function d({ payableId: d, amountDueMinorUnits: f, amountToPayMinorUnits: p, currencyCode: m, dueDate: h, hasScheduledPayment: g, testId: _, labels: v }) {
17
- let y = c(v), b = i(), [x, S] = u(!1), [C, w] = u(void 0), [T, E] = u(""), D = x && !g, O = n(f / 100, { currencyCode: m }), k = n((p ?? f) / 100, { currencyCode: m }), A = C ? t(a(C)) : void 0, j = h ? y.dueDateSuffix(t(h)) : void 0, M = () => {
18
- S(!1), w(void 0), E("");
19
- };
20
- return l(() => {
21
- g && (S(!1), w(void 0), E(""));
22
- }, [g]), {
23
- open: () => {
24
- w(o()), E(""), S(!0);
25
- },
26
- isPending: b.isPending,
27
- dialogProps: {
28
- open: D,
29
- amountDue: O,
30
- dueDateSuffix: j,
31
- paymentAmount: k,
32
- selectedDate: C,
33
- selectedDateLabel: A,
34
- isToday: C ? s(C) : !1,
35
- comment: T,
36
- isSubmitting: b.isPending,
37
- onDateChange: w,
38
- onCommentChange: E,
39
- onConfirm: () => {
40
- !d || !C || b.isPending || g || b.mutate({
41
- path: { payable_id: d },
42
- body: {
43
- paid_at: `${a(C)}T12:00:00.000Z`,
44
- is_external: !0,
45
- ...T.trim() ? { comment: T.trim() } : {}
46
- }
47
- }, {
48
- onSuccess: () => {
49
- e.success(y.paidToast), M();
50
- },
51
- onError: (t) => {
52
- e.error(r(t) ?? y.submitError);
53
- }
54
- });
55
- },
56
- onCancel: () => {
57
- b.isPending || M();
58
- },
59
- testId: _ ? `${_}-mark-as-paid-dialog` : void 0,
60
- confirmTestId: _ ? `${_}-mark-as-paid-confirm` : void 0,
61
- labels: y.dialog
4
+ var t = {
5
+ dueDateSuffix: (e) => `by ${e}`,
6
+ paidToast: "Bill marked as paid",
7
+ submitError: "Couldn't mark this bill as paid. Try again.",
8
+ dialog: e
9
+ };
10
+ function n(e) {
11
+ return {
12
+ ...t,
13
+ ...e,
14
+ dialog: {
15
+ ...t.dialog,
16
+ ...e?.dialog
62
17
  }
63
18
  };
64
19
  }
65
20
  //#endregion
66
- export { d as useMarkAsPaidFlow };
21
+ export { t as MARK_AS_PAID_FLOW_LABELS_EN, n as mergeMarkAsPaidFlowLabels };
@@ -1,2 +1,26 @@
1
- import "./index12.js";
2
- import "./index14.js";
1
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js
2
+ var e = new Intl.DateTimeFormat("en-CA", {
3
+ timeZone: "America/New_York",
4
+ year: "numeric",
5
+ month: "2-digit",
6
+ day: "2-digit"
7
+ });
8
+ function t(t = /* @__PURE__ */ new Date()) {
9
+ let n = e.formatToParts(t), r = Object.fromEntries(n.map((e) => [e.type, e.value]));
10
+ return `${r.year}-${r.month}-${r.day}`;
11
+ }
12
+ function n(e) {
13
+ return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
14
+ }
15
+ function r(e, r = /* @__PURE__ */ new Date()) {
16
+ return n(e) === t(r);
17
+ }
18
+ function i(e = /* @__PURE__ */ new Date()) {
19
+ let [n, r, i] = t(e).split("-").map(Number);
20
+ return new Date(n, r - 1, i);
21
+ }
22
+ function a(e, r = /* @__PURE__ */ new Date()) {
23
+ return n(e) < t(r);
24
+ }
25
+ //#endregion
26
+ export { n as dateToCalendarKey, i as getDefaultPaymentDate, t as getEasternDateKey, a as isPastEasternDate, r as isTodayInEastern };
@@ -1,68 +1,66 @@
1
- import { hasAnyScope as e } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
2
- import { Scope as t } from "../../../shared/data-access/dist/lib/scopes.js";
3
- import "../../../shared/data-access/dist/index.js";
4
- import { BanIcon as n, CalendarXIcon as r, RotateCcwIcon as i, ThumbsDownIcon as a, ThumbsUpIcon as o } from "lucide-react";
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import "../../../shared/ui/dist/index.js";
7
+ import { formatCalendarDate as t } from "../../../shared/util/dist/lib/formatCalendarDate.js";
8
+ import { formatMoneyExact as n } from "../../../shared/util/dist/lib/formatMoneyExact.js";
9
+ import { extractApiErrorMessage as r } from "../../../shared/util/dist/lib/apiErrors.js";
10
+ import { useMarkPayableAsPaidMutation as i } from "../../data-access/dist/index13.js";
11
+ import "../../data-access/dist/index.js";
12
+ import { dateToCalendarKey as a, getDefaultPaymentDate as o, isTodayInEastern as s } from "./index15.js";
13
+ import { mergeMarkAsPaidFlowLabels as c } from "./index14.js";
14
+ import { useEffect as l, useState as u } from "react";
5
15
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js
6
- function s(n) {
7
- return e(n, [t.CounterpartReadOrg]);
8
- }
9
- function c({ status: c, scopes: l, canDecideApprovalRequest: u, hasScheduledPayment: d, scheduledPaymentIntentId: f, isPolicyApprover: p, hasWaitingRequest: m, arePendingApproversUnknown: h, labels: g }) {
10
- let _ = e(l, [t.PayablePayOrg]), v = e(l, [t.BankAccountReadOrg]), y = s(l), b = e(l, [t.PaymentRailAch]), x = e(l, [t.PayableWriteOrg]), S = _, C = e(l, [t.PayableApproveOrg]), w = [];
11
- c === "approve_in_progress" && u && (w.push({
12
- id: "approve",
13
- label: g.approve,
14
- variant: "default",
15
- surface: "row"
16
- }), w.push({
17
- id: "reject",
18
- label: g.reject,
19
- variant: "ghost",
20
- surface: "row"
21
- })), c === "approve_in_progress" && m && C && !p && !h && (w.push({
22
- id: "forceApprove",
23
- label: g.forceApprove,
24
- variant: "ghost",
25
- surface: "menu",
26
- icon: o,
27
- sectionHeading: g.policyOverridesHeading
28
- }), w.push({
29
- id: "forceReject",
30
- label: g.forceReject,
31
- variant: "ghost",
32
- surface: "menu",
33
- icon: a,
34
- sectionHeading: g.policyOverridesHeading
35
- }));
36
- let T = c === "waiting_to_be_paid" && _ && !d, E = c === "waiting_to_be_paid" && _ && v && y && b && !d;
37
- return T && w.push({
38
- id: "markAsPaid",
39
- label: g.markAsPaid,
40
- variant: "outline",
41
- surface: "row"
42
- }), E && w.push({
43
- id: "payBill",
44
- label: g.payBill,
45
- variant: "default",
46
- surface: "row"
47
- }), c === "new" && x && w.push({
48
- id: "cancel",
49
- label: g.cancel,
50
- variant: "ghost",
51
- surface: "menu",
52
- icon: n
53
- }), (c === "rejected" || c === "waiting_to_be_paid" && !d) && x && w.push({
54
- id: "reopen",
55
- label: g.reopen,
56
- variant: "ghost",
57
- surface: "menu",
58
- icon: i
59
- }), c === "waiting_to_be_paid" && d && f && S && w.push({
60
- id: "cancelScheduledPayment",
61
- label: g.cancelScheduledPayment,
62
- variant: "ghost",
63
- surface: "menu",
64
- icon: r
65
- }), w;
16
+ function d({ payableId: d, amountDueMinorUnits: f, amountToPayMinorUnits: p, currencyCode: m, dueDate: h, hasScheduledPayment: g, testId: _, labels: v }) {
17
+ let y = c(v), b = i(), [x, S] = u(!1), [C, w] = u(void 0), [T, E] = u(""), D = x && !g, O = n(f / 100, { currencyCode: m }), k = n((p ?? f) / 100, { currencyCode: m }), A = C ? t(a(C)) : void 0, j = h ? y.dueDateSuffix(t(h)) : void 0, M = () => {
18
+ S(!1), w(void 0), E("");
19
+ };
20
+ return l(() => {
21
+ g && (S(!1), w(void 0), E(""));
22
+ }, [g]), {
23
+ open: () => {
24
+ w(o()), E(""), S(!0);
25
+ },
26
+ isPending: b.isPending,
27
+ dialogProps: {
28
+ open: D,
29
+ amountDue: O,
30
+ dueDateSuffix: j,
31
+ paymentAmount: k,
32
+ selectedDate: C,
33
+ selectedDateLabel: A,
34
+ isToday: C ? s(C) : !1,
35
+ comment: T,
36
+ isSubmitting: b.isPending,
37
+ onDateChange: w,
38
+ onCommentChange: E,
39
+ onConfirm: () => {
40
+ !d || !C || b.isPending || g || b.mutate({
41
+ path: { payable_id: d },
42
+ body: {
43
+ paid_at: `${a(C)}T12:00:00.000Z`,
44
+ is_external: !0,
45
+ ...T.trim() ? { comment: T.trim() } : {}
46
+ }
47
+ }, {
48
+ onSuccess: () => {
49
+ e.success(y.paidToast), M();
50
+ },
51
+ onError: (t) => {
52
+ e.error(r(t) ?? y.submitError);
53
+ }
54
+ });
55
+ },
56
+ onCancel: () => {
57
+ b.isPending || M();
58
+ },
59
+ testId: _ ? `${_}-mark-as-paid-dialog` : void 0,
60
+ confirmTestId: _ ? `${_}-mark-as-paid-confirm` : void 0,
61
+ labels: y.dialog
62
+ }
63
+ };
66
64
  }
67
65
  //#endregion
68
- export { s as canReadCounterpartBankAccounts, c as getBillDetailActions };
66
+ export { d as useMarkAsPaidFlow };