@tesouro/embedded-components-react 0.3.20 → 0.3.22

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 (154) hide show
  1. package/dist/index.css +9 -0
  2. package/dist/lib/monite-sdk.js +18 -18
  3. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index3.js +1 -1
  4. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index.js +19 -19
  5. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index422.js +1 -1
  6. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index479.js +16 -20
  7. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index480.js +13 -12
  8. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index481.js +19 -97
  9. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index482.js +98 -42
  10. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index483.js +43 -27
  11. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index484.js +30 -1
  12. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index485.js +1 -17
  13. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index486.js +11 -10
  14. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index487.js +14 -4
  15. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index488.js +4 -13
  16. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index489.js +7 -7
  17. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index490.js +18 -9
  18. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index491.js +8 -105
  19. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index492.js +102 -35
  20. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index493.js +36 -45
  21. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index494.js +44 -71
  22. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index495.js +72 -100
  23. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index496.js +99 -43
  24. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index497.js +35 -178
  25. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index498.js +171 -125
  26. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index499.js +134 -123
  27. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index500.js +125 -73
  28. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index501.js +63 -232
  29. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index502.js +248 -8
  30. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index503.js +8 -6
  31. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index504.js +5 -456
  32. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index505.js +455 -21
  33. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index506.js +17 -12
  34. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index507.js +13 -49
  35. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index508.js +51 -43
  36. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index509.js +46 -14
  37. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index510.js +13 -41
  38. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index511.js +39 -144
  39. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index512.js +143 -112
  40. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index513.js +114 -39
  41. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index514.js +33 -25
  42. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index515.js +32 -19
  43. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index516.js +3 -3
  44. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index517.js +19 -21
  45. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index518.js +20 -72
  46. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index519.js +73 -17
  47. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index520.js +18 -172
  48. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index521.js +149 -116
  49. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index522.js +136 -30
  50. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index523.js +31 -115
  51. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index524.js +116 -19
  52. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index525.js +10 -36
  53. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index526.js +46 -14
  54. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index527.js +13 -23
  55. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index528.js +21 -25
  56. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index529.js +26 -36
  57. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index530.js +36 -77
  58. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index531.js +77 -50
  59. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index532.js +50 -33
  60. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index533.js +34 -89
  61. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index534.js +86 -48
  62. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index535.js +54 -1
  63. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index536.js +1 -40
  64. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index537.js +40 -1
  65. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index538.js +0 -135
  66. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index539.js +129 -102
  67. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index540.js +105 -50
  68. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index541.js +48 -779
  69. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index542.js +780 -87
  70. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index543.js +84 -97
  71. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index544.js +105 -6
  72. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index545.js +6 -27
  73. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index546.js +23 -11
  74. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index547.js +13 -2
  75. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index548.js +2 -25
  76. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index549.js +25 -14
  77. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index550.js +14 -171
  78. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index551.js +163 -200
  79. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index552.js +204 -78
  80. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index553.js +82 -17
  81. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index554.js +17 -158
  82. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index555.js +146 -85
  83. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index556.js +95 -42
  84. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index557.js +46 -4
  85. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index558.js +4 -16
  86. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index559.js +13 -24
  87. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index560.js +27 -1
  88. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index561.js +0 -186
  89. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index562.js +186 -0
  90. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index563.js +0 -42
  91. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index564.js +41 -3
  92. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index565.js +5 -24
  93. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index566.js +20 -73
  94. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index567.js +74 -16
  95. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index568.js +16 -19
  96. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index569.js +19 -5
  97. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index570.js +4 -8
  98. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index571.js +10 -11
  99. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index572.js +11 -131
  100. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index573.js +129 -4
  101. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index574.js +4 -4
  102. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index575.js +8 -5
  103. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index576.js +4 -221
  104. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index577.js +219 -11
  105. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index578.js +12 -34
  106. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index579.js +32 -181
  107. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index580.js +168 -189
  108. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index581.js +192 -88
  109. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index582.js +97 -61
  110. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index583.js +63 -54
  111. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index584.js +46 -83
  112. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index585.js +91 -40
  113. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index586.js +39 -75
  114. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index587.js +63 -71
  115. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index588.js +85 -12
  116. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index589.js +12 -24
  117. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index590.js +25 -16
  118. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index591.js +14 -2
  119. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index592.js +4 -23
  120. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index593.js +23 -0
  121. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index594.js +1 -24
  122. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index595.js +24 -4
  123. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index596.js +4 -13
  124. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index597.js +9 -13
  125. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index598.js +13 -4
  126. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index599.js +4 -8
  127. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index600.js +8 -4
  128. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index601.js +8 -6
  129. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index602.js +6 -22
  130. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index603.js +17 -68
  131. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index604.js +66 -113
  132. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index605.js +104 -64
  133. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index606.js +72 -138
  134. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index607.js +144 -28
  135. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index608.js +28 -16
  136. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index609.js +14 -87
  137. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index610.js +91 -3
  138. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index611.js +3 -26
  139. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index612.js +22 -67
  140. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index613.js +71 -1
  141. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index614.js +0 -65
  142. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index615.js +66 -29
  143. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index616.js +30 -2
  144. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index617.js +2 -34
  145. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index618.js +33 -15
  146. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index619.js +14 -29
  147. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index620.js +29 -26
  148. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index621.js +30 -2
  149. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index622.js +2 -97
  150. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index623.js +97 -0
  151. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js +1 -1
  152. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  153. package/dist/libs/tesouro-embedded-components-react/shared/monite-wrapper/feature/dist/lib/MoniteWrapper.js +1 -1
  154. package/package.json +1 -1
@@ -1,185 +1,36 @@
1
- import { useMoniteContext as e } from "./index47.js";
2
- import { useCurrencies as t } from "./index63.js";
3
- import "./index217.js";
4
- import "./index93.js";
5
- import { InvoiceStatusChip as n } from "./index238.js";
6
- import { useKanmonContext as r } from "./index571.js";
7
- import { FinancedInvoiceStatusChip as i } from "./index578.js";
8
- import { Fragment as a, jsx as o, jsxs as s } from "@emotion/react/jsx-runtime";
9
- import { Box as c, Button as l, Divider as u, Typography as d, darken as f, useTheme as p } from "@mui/material";
10
- import { useLingui as m } from "@lingui/react";
1
+ import { BACKGROUND_FINANCE_STATUS_MUI_MAP as e, FINANCE_INVOICE_STATUS_TO_MUI_ICON_MAP as t, ROW_TO_TAG_FINANCE_STATUS_MUI_MAP as n } from "./index19.js";
2
+ import { getCommonStatusLabel as r } from "./index578.js";
3
+ import { jsx as i } from "@emotion/react/jsx-runtime";
4
+ import { Chip as a } from "@mui/material";
5
+ import { useLingui as o } from "@lingui/react";
6
+ import s from "@mui/icons-material/Circle";
7
+ import { styled as c, useThemeProps as l } from "@mui/material/styles";
11
8
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index579.js
12
- var h = ({ invoice: h, offers: g, financedInvoice: _, enableNavigate: v = !1, handleNavigate: y }) => {
13
- let { i18n: b } = m(), { locale: x } = e(), { startFinanceSession: S } = r(), { formatCurrencyToDisplay: C } = t(), w = p(), T = x.dateFormat, E = _ ? b.date(_.issue_date, T) : "—", D = _ ? C(_.total_amount, _.currency) : "-", O = g?.[0]?.pricing_plans?.reduce((e, t, n) => (t?.fee_percentage === _?.fee_percentage && t?.advance_rate_percentage === _?.advance_rate_percentage && (e = {
14
- pricingPlanIndex: n,
15
- data: t
16
- }), e), null), k = _?.repayment_schedule?.repayment_date ? b.date(_.repayment_schedule.repayment_date, T) : "—", A = _?.advance_amount ? C(_.advance_amount, _.currency) : "-", j = _?.fee_amount ? C(_.fee_amount, _.currency) : "-", M = _?.repayment_amount ? C(_.repayment_amount, _.currency) : "-", N = _?.status === "REJECTED" || _?.status === "NEW", P = _?.status === "FUNDED" || _?.status === "LATE";
17
- return /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ s(c, {
9
+ var u = ({ ref: a, ...c }) => {
10
+ let { status: u, variant: f, icon: p, size: m } = l({
11
+ props: c,
12
+ name: "MoniteFinancedInvoiceStatusChip"
13
+ }), { i18n: h } = o(), g = t[u];
14
+ return /* @__PURE__ */ i(d, {
15
+ ref: a,
18
16
  sx: {
19
- p: 4,
20
- display: "flex",
21
- flexDirection: "column",
22
- gap: 4
17
+ width: "auto",
18
+ color: n[u],
19
+ bgcolor: e[u]
23
20
  },
24
- children: [
25
- /* @__PURE__ */ o(d, {
26
- variant: "h3",
27
- children: b._("Funding details")
28
- }),
29
- /* @__PURE__ */ s(c, { children: [/* @__PURE__ */ o(d, {
30
- variant: "h2",
31
- fontWeight: 600,
32
- fontSize: 32,
33
- children: D
34
- }), /* @__PURE__ */ o(d, {
35
- fontWeight: 500,
36
- variant: "body1",
37
- children: b._("{issueDate}", { issueDate: E })
38
- })] }),
39
- /* @__PURE__ */ s(c, {
40
- sx: {
41
- display: "flex",
42
- gap: 3
43
- },
44
- children: [
45
- /* @__PURE__ */ s(c, {
46
- width: "100%",
47
- children: [/* @__PURE__ */ o(d, {
48
- variant: "body1",
49
- color: f(w.palette.grey[50], .4),
50
- mb: .5,
51
- fontWeight: 400,
52
- children: b._("Financing plan {value}", { value: (O?.pricingPlanIndex ?? 0) + 1 })
53
- }), /* @__PURE__ */ o(d, {
54
- variant: "body1",
55
- fontWeight: 400,
56
- children: b._("{value}% advance rate, Pay in {pricingPlan} days, {value1}% fee", {
57
- value: (O?.data?.advance_rate_percentage ?? 0) / 100,
58
- pricingPlan: O?.data?.repayment_duration_days,
59
- value1: (O?.data?.fee_percentage ?? 0) / 100
60
- })
61
- })]
62
- }),
63
- /* @__PURE__ */ s(c, {
64
- width: "100%",
65
- children: [/* @__PURE__ */ o(d, {
66
- variant: "body1",
67
- color: f(w.palette.grey[50], .4),
68
- mb: .5,
69
- fontWeight: 400,
70
- children: b._("Repayment on")
71
- }), /* @__PURE__ */ o(d, {
72
- variant: "body1",
73
- fontWeight: 400,
74
- children: b._("{repaymentDate}", { repaymentDate: k })
75
- })]
76
- }),
77
- /* @__PURE__ */ s(c, {
78
- width: "100%",
79
- children: [/* @__PURE__ */ o(d, {
80
- variant: "body1",
81
- color: f(w.palette.grey[50], .4),
82
- mb: .5,
83
- fontWeight: 400,
84
- children: b._("Status")
85
- }), /* @__PURE__ */ o(i, {
86
- icon: !0,
87
- status: _?.status ?? "DEFAULTED"
88
- })]
89
- })
90
- ]
91
- }),
92
- /* @__PURE__ */ o(u, {}),
93
- /* @__PURE__ */ s(c, {
94
- sx: {
95
- display: "grid",
96
- gridTemplateColumns: "minmax(140px, auto) 1fr",
97
- flexDirection: "column",
98
- rowGap: 1,
99
- columnGap: 2
100
- },
101
- children: [
102
- /* @__PURE__ */ o(d, {
103
- variant: "body1",
104
- color: f(w.palette.grey[50], .4),
105
- children: b._("{isRequestedSum}", { isRequestedSum: N ? "Requested sum" : "Received sum" })
106
- }),
107
- /* @__PURE__ */ o(d, {
108
- variant: "body1",
109
- children: A
110
- }),
111
- /* @__PURE__ */ o(d, {
112
- variant: "body1",
113
- color: f(w.palette.grey[50], .4),
114
- children: b._("Service Fee")
115
- }),
116
- /* @__PURE__ */ o(d, {
117
- variant: "body1",
118
- children: j
119
- }),
120
- /* @__PURE__ */ o(d, {
121
- variant: "body1",
122
- color: f(w.palette.grey[50], .4),
123
- children: b._("Repayment sum")
124
- }),
125
- /* @__PURE__ */ o(d, {
126
- variant: "body1",
127
- children: M
128
- })
129
- ]
130
- }),
131
- /* @__PURE__ */ o(u, {}),
132
- /* @__PURE__ */ s(c, {
133
- sx: {
134
- borderRadius: "16px",
135
- px: 3,
136
- py: 2.5,
137
- border: `1px solid ${w.palette.divider}`,
138
- display: "flex",
139
- gap: 2,
140
- justifyContent: "space-between",
141
- alignItems: "center",
142
- cursor: v ? "pointer" : "default"
143
- },
144
- ...v && y && { onClick: () => y(h.id) },
145
- children: [/* @__PURE__ */ s(c, { children: [/* @__PURE__ */ o(d, {
146
- variant: "body1",
147
- fontWeight: 500,
148
- children: b._("Invoice {invoiceDocument_id}", { invoiceDocument_id: h.document_id || "INV-auto" })
149
- }), /* @__PURE__ */ o(d, {
150
- color: w.palette.text.secondary,
151
- variant: "body2",
152
- children: b._("For {invoiceAmount} | Issued {issueDate}", {
153
- invoiceAmount: D,
154
- issueDate: E
155
- })
156
- })] }), /* @__PURE__ */ o(c, { children: /* @__PURE__ */ o(n, { status: h.status }) })]
157
- })
158
- ]
159
- }), P && /* @__PURE__ */ o(c, {
160
- sx: {
161
- mt: "auto",
162
- borderTop: `1px solid ${w.palette.divider}`,
163
- px: 4,
164
- py: 2,
165
- display: "flex",
166
- alignItems: "center",
167
- justifyContent: "flex-end"
168
- },
169
- children: /* @__PURE__ */ o(l, {
170
- variant: "contained",
171
- color: "primary",
172
- onClick: () => S({ component: "PAY_NOW" }),
173
- sx: {
174
- py: 1.25,
175
- px: 1.5,
176
- height: 32,
177
- fontSize: 14,
178
- ml: "auto"
179
- },
180
- children: b._("Repay now")
181
- })
182
- })] });
183
- };
21
+ icon: p && g ? /* @__PURE__ */ i(g, { sx: {
22
+ fontSize: 16,
23
+ fill: n[u]
24
+ } }) : /* @__PURE__ */ i(s, { sx: { fontSize: "10px !important" } }),
25
+ label: r(h, u),
26
+ size: m,
27
+ status: u,
28
+ variant: f ?? "filled"
29
+ });
30
+ }, d = c(a, {
31
+ name: "MoniteFinancedInvoiceStatusChip",
32
+ slot: "root",
33
+ shouldForwardProp: () => !0
34
+ })({});
184
35
  //#endregion
185
- export { h as FinanceDetails };
36
+ export { u as FinancedInvoiceStatusChip };
@@ -1,206 +1,185 @@
1
- import { ScopedCssBaselineContainerClassName as e } from "./index31.js";
2
- import { useMoniteContext as t } from "./index47.js";
3
- import { useCurrencies as n } from "./index63.js";
4
- import { useGetReceivableById as r } from "./index141.js";
5
- import { useAutosizeGridColumns as i } from "./index210.js";
6
- import { Dialog as a } from "./index229.js";
7
- import "./index230.js";
8
- import { MoniteScopedProviders as o } from "./index237.js";
9
- import { GetNoRowsOverlay as s } from "./index246.js";
10
- import { TablePagination as c } from "./index342.js";
11
- import { classNames as l } from "./index344.js";
12
- import { ReceivableCursorFields as u } from "./index453.js";
13
- import { useKanmonContext as d } from "./index571.js";
14
- import { useGetFinancedInvoices as f } from "./index574.js";
15
- import "./index575.js";
16
- import { FinancedInvoiceStatusChip as p } from "./index578.js";
17
- import { FinanceDetails as m } from "./index579.js";
18
- import { useMemo as h, useState as g } from "react";
19
- import { jsx as _, jsxs as v } from "@emotion/react/jsx-runtime";
20
- import { Box as y, Button as b, Typography as x } from "@mui/material";
21
- import { useLingui as S } from "@lingui/react";
22
- import { DataGrid as C } from "@mui/x-data-grid";
1
+ import { useMoniteContext as e } from "./index47.js";
2
+ import { useCurrencies as t } from "./index63.js";
3
+ import "./index217.js";
4
+ import "./index93.js";
5
+ import { InvoiceStatusChip as n } from "./index238.js";
6
+ import { useKanmonContext as r } from "./index572.js";
7
+ import { FinancedInvoiceStatusChip as i } from "./index579.js";
8
+ import { Fragment as a, jsx as o, jsxs as s } from "@emotion/react/jsx-runtime";
9
+ import { Box as c, Button as l, Divider as u, Typography as d, darken as f, useTheme as p } from "@mui/material";
10
+ import { useLingui as m } from "@lingui/react";
23
11
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index580.js
24
- var w = (e) => /* @__PURE__ */ _(o, { children: /* @__PURE__ */ _(T, { ...e }) }), T = ({ onRowClick: o, query: w, offers: T }) => {
25
- let { i18n: E } = S(), { locale: D, componentSettings: O } = t(), { startFinanceSession: k } = d(), [A, j] = g(!1), [M, N] = g(null), { data: P } = r(M?.invoice_id ?? "", !!M?.invoice_id), [F, I] = g(void 0), [L, R] = g(O.receivables.pageSizeOptions?.[0] ?? 10), [z, B] = g({
26
- field: w?.sort ?? "created_at",
27
- sort: w?.order ?? "desc"
28
- }), { formatCurrencyToDisplay: V } = n(), { data: H, isLoading: U, isError: W, refetch: G } = f({
29
- order: z?.sort,
30
- limit: L,
31
- pagination_token: F
32
- }), K = H?.data, q = (e) => {
33
- B(e[0]), I(void 0);
34
- }, J = D.dateFormat, Y = h(() => [
35
- {
36
- field: "document_id",
37
- headerName: E._("Number"),
38
- sortable: !1,
39
- width: 140,
40
- renderCell: ({ value: e }) => e ? /* @__PURE__ */ _("span", {
41
- className: "Monite-TextOverflowContainer",
42
- children: e
43
- }) : /* @__PURE__ */ _("span", {
44
- className: "Monite-TextOverflowContainer",
45
- children: /* @__PURE__ */ _(x, {
46
- color: "text.secondary",
47
- component: "span",
48
- fontSize: "inherit",
49
- children: E._("INV-auto")
50
- })
51
- })
52
- },
53
- {
54
- field: "payer_type",
55
- headerName: E._("Customer"),
56
- display: "flex",
57
- width: 250,
58
- renderCell: (e) => /* @__PURE__ */ _(x, { children: e.row.payer_type == "BUSINESS" ? e.row.payer_business_name : `${e.row.payer_first_name} ${e.row.payer_last_name}` })
59
- },
60
- {
61
- field: "status",
62
- headerName: E._("Status"),
63
- sortable: u.includes("status"),
64
- width: 160,
65
- renderCell: ({ value: e }) => /* @__PURE__ */ _(p, {
66
- icon: !0,
67
- status: e
68
- })
69
- },
70
- {
71
- field: "total_amount",
72
- headerName: E._("Amount due"),
73
- headerAlign: "right",
74
- align: "right",
75
- width: 120,
76
- valueGetter: (e, t) => {
77
- let n = t.repayment_schedule?.repayment_amount;
78
- return n ? V(n, t.currency) : "-";
79
- }
80
- },
81
- {
82
- field: "repayment_schedule",
83
- headerName: E._("Loan sum"),
84
- headerAlign: "right",
85
- align: "right",
86
- width: 120,
87
- valueGetter: (e, t) => {
88
- let n = t.repayment_schedule?.repayment_principal_amount;
89
- return n ? V(n, t.currency) : "-";
90
- }
91
- },
92
- {
93
- field: "issue_date",
94
- headerName: E._("Financing date"),
95
- sortable: !1,
96
- width: 140,
97
- valueFormatter: (e) => e ? E.date(e, J) : "—"
98
- },
99
- {
100
- field: "repayment_date",
101
- headerName: E._("Repayment date"),
102
- sortable: !1,
103
- width: 120,
104
- valueGetter: (e, t) => {
105
- let n = t.repayment_schedule?.repayment_date;
106
- return n ? E.date(n, J) : "-";
107
- }
108
- },
109
- {
110
- field: "",
111
- headerName: E._("Payment"),
112
- sortable: !1,
113
- width: 120,
114
- renderCell: (e) => e.row.status === "FUNDED" || e.row.status === "LATE" ? /* @__PURE__ */ _(b, {
115
- variant: "contained",
116
- color: "primary",
117
- onClick: (e) => {
118
- e.stopPropagation(), k({ component: "PAY_NOW" });
119
- },
120
- sx: {
121
- py: 1.25,
122
- px: 1.5,
123
- height: 32,
124
- fontSize: 14
125
- },
126
- children: E._("Repay now")
127
- }) : null
128
- }
129
- ], [
130
- V,
131
- E,
132
- J,
133
- k
134
- ]), X = i(K, Y, !1, "FinancedInvoicesTable");
135
- return /* @__PURE__ */ v(y, {
136
- className: l(e, "Monite-FinancedInvoicesTable"),
12
+ var h = ({ invoice: h, offers: g, financedInvoice: _, enableNavigate: v = !1, handleNavigate: y }) => {
13
+ let { i18n: b } = m(), { locale: x } = e(), { startFinanceSession: S } = r(), { formatCurrencyToDisplay: C } = t(), w = p(), T = x.dateFormat, E = _ ? b.date(_.issue_date, T) : "—", D = _ ? C(_.total_amount, _.currency) : "-", O = g?.[0]?.pricing_plans?.reduce((e, t, n) => (t?.fee_percentage === _?.fee_percentage && t?.advance_rate_percentage === _?.advance_rate_percentage && (e = {
14
+ pricingPlanIndex: n,
15
+ data: t
16
+ }), e), null), k = _?.repayment_schedule?.repayment_date ? b.date(_.repayment_schedule.repayment_date, T) : "—", A = _?.advance_amount ? C(_.advance_amount, _.currency) : "-", j = _?.fee_amount ? C(_.fee_amount, _.currency) : "-", M = _?.repayment_amount ? C(_.repayment_amount, _.currency) : "-", N = _?.status === "REJECTED" || _?.status === "NEW", P = _?.status === "FUNDED" || _?.status === "LATE";
17
+ return /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ s(c, {
137
18
  sx: {
19
+ p: 4,
138
20
  display: "flex",
139
21
  flexDirection: "column",
140
- overflow: "hidden",
141
- height: "inherit",
142
- minHeight: "500px"
22
+ gap: 4
143
23
  },
144
24
  children: [
145
- /* @__PURE__ */ _(x, {
146
- mb: 2,
147
- variant: "subtitle1",
148
- children: E._("Financed invoices")
25
+ /* @__PURE__ */ o(d, {
26
+ variant: "h3",
27
+ children: b._("Funding details")
149
28
  }),
150
- /* @__PURE__ */ _(C, {
151
- apiRef: X,
152
- rowSelection: !1,
153
- disableColumnFilter: !0,
154
- loading: U,
155
- onSortModelChange: q,
156
- onRowClick: (e) => {
157
- j(!0), N?.(e.row);
29
+ /* @__PURE__ */ s(c, { children: [/* @__PURE__ */ o(d, {
30
+ variant: "h2",
31
+ fontWeight: 600,
32
+ fontSize: 32,
33
+ children: D
34
+ }), /* @__PURE__ */ o(d, {
35
+ fontWeight: 500,
36
+ variant: "body1",
37
+ children: b._("{issueDate}", { issueDate: E })
38
+ })] }),
39
+ /* @__PURE__ */ s(c, {
40
+ sx: {
41
+ display: "flex",
42
+ gap: 3
158
43
  },
159
- slots: {
160
- pagination: () => /* @__PURE__ */ _(c, {
161
- pageSizeOptions: O.receivables.pageSizeOptions,
162
- nextPage: H?.next_pagination_token,
163
- prevPage: H?.prev_pagination_token,
164
- paginationModel: {
165
- pageSize: L,
166
- page: F
167
- },
168
- onPaginationModelChange: ({ page: e, pageSize: t }) => {
169
- R(t), I(e ?? void 0);
170
- }
44
+ children: [
45
+ /* @__PURE__ */ s(c, {
46
+ width: "100%",
47
+ children: [/* @__PURE__ */ o(d, {
48
+ variant: "body1",
49
+ color: f(w.palette.grey[50], .4),
50
+ mb: .5,
51
+ fontWeight: 400,
52
+ children: b._("Financing plan {value}", { value: (O?.pricingPlanIndex ?? 0) + 1 })
53
+ }), /* @__PURE__ */ o(d, {
54
+ variant: "body1",
55
+ fontWeight: 400,
56
+ children: b._("{value}% advance rate, Pay in {pricingPlan} days, {value1}% fee", {
57
+ value: (O?.data?.advance_rate_percentage ?? 0) / 100,
58
+ pricingPlan: O?.data?.repayment_duration_days,
59
+ value1: (O?.data?.fee_percentage ?? 0) / 100
60
+ })
61
+ })]
171
62
  }),
172
- noRowsOverlay: () => /* @__PURE__ */ _(s, {
173
- isLoading: U,
174
- dataLength: K?.length || 0,
175
- isFiltering: !1,
176
- isSearching: !1,
177
- isError: W,
178
- refetch: G,
179
- entityName: E._("Financed Invoices"),
180
- actionOptions: [E._("Invoice")],
181
- type: "no-data"
63
+ /* @__PURE__ */ s(c, {
64
+ width: "100%",
65
+ children: [/* @__PURE__ */ o(d, {
66
+ variant: "body1",
67
+ color: f(w.palette.grey[50], .4),
68
+ mb: .5,
69
+ fontWeight: 400,
70
+ children: b._("Repayment on")
71
+ }), /* @__PURE__ */ o(d, {
72
+ variant: "body1",
73
+ fontWeight: 400,
74
+ children: b._("{repaymentDate}", { repaymentDate: k })
75
+ })]
76
+ }),
77
+ /* @__PURE__ */ s(c, {
78
+ width: "100%",
79
+ children: [/* @__PURE__ */ o(d, {
80
+ variant: "body1",
81
+ color: f(w.palette.grey[50], .4),
82
+ mb: .5,
83
+ fontWeight: 400,
84
+ children: b._("Status")
85
+ }), /* @__PURE__ */ o(i, {
86
+ icon: !0,
87
+ status: _?.status ?? "DEFAULTED"
88
+ })]
182
89
  })
90
+ ]
91
+ }),
92
+ /* @__PURE__ */ o(u, {}),
93
+ /* @__PURE__ */ s(c, {
94
+ sx: {
95
+ display: "grid",
96
+ gridTemplateColumns: "minmax(140px, auto) 1fr",
97
+ flexDirection: "column",
98
+ rowGap: 1,
99
+ columnGap: 2
183
100
  },
184
- columns: Y,
185
- getRowId: (e) => e.document_id,
186
- rows: K ?? []
101
+ children: [
102
+ /* @__PURE__ */ o(d, {
103
+ variant: "body1",
104
+ color: f(w.palette.grey[50], .4),
105
+ children: b._("{isRequestedSum}", { isRequestedSum: N ? "Requested sum" : "Received sum" })
106
+ }),
107
+ /* @__PURE__ */ o(d, {
108
+ variant: "body1",
109
+ children: A
110
+ }),
111
+ /* @__PURE__ */ o(d, {
112
+ variant: "body1",
113
+ color: f(w.palette.grey[50], .4),
114
+ children: b._("Service Fee")
115
+ }),
116
+ /* @__PURE__ */ o(d, {
117
+ variant: "body1",
118
+ children: j
119
+ }),
120
+ /* @__PURE__ */ o(d, {
121
+ variant: "body1",
122
+ color: f(w.palette.grey[50], .4),
123
+ children: b._("Repayment sum")
124
+ }),
125
+ /* @__PURE__ */ o(d, {
126
+ variant: "body1",
127
+ children: M
128
+ })
129
+ ]
187
130
  }),
188
- P && M && /* @__PURE__ */ _(a, {
189
- open: A,
190
- onClose: () => {
191
- j(!1), N(null);
131
+ /* @__PURE__ */ o(u, {}),
132
+ /* @__PURE__ */ s(c, {
133
+ sx: {
134
+ borderRadius: "16px",
135
+ px: 3,
136
+ py: 2.5,
137
+ border: `1px solid ${w.palette.divider}`,
138
+ display: "flex",
139
+ gap: 2,
140
+ justifyContent: "space-between",
141
+ alignItems: "center",
142
+ cursor: v ? "pointer" : "default"
192
143
  },
193
- alignDialog: "right",
194
- children: /* @__PURE__ */ _(m, {
195
- invoice: P,
196
- offers: T ?? [],
197
- financedInvoice: M,
198
- enableNavigate: !0,
199
- handleNavigate: o
200
- })
144
+ ...v && y && { onClick: () => y(h.id) },
145
+ children: [/* @__PURE__ */ s(c, { children: [/* @__PURE__ */ o(d, {
146
+ variant: "body1",
147
+ fontWeight: 500,
148
+ children: b._("Invoice {invoiceDocument_id}", { invoiceDocument_id: h.document_id || "INV-auto" })
149
+ }), /* @__PURE__ */ o(d, {
150
+ color: w.palette.text.secondary,
151
+ variant: "body2",
152
+ children: b._("For {invoiceAmount} | Issued {issueDate}", {
153
+ invoiceAmount: D,
154
+ issueDate: E
155
+ })
156
+ })] }), /* @__PURE__ */ o(c, { children: /* @__PURE__ */ o(n, { status: h.status }) })]
201
157
  })
202
158
  ]
203
- });
159
+ }), P && /* @__PURE__ */ o(c, {
160
+ sx: {
161
+ mt: "auto",
162
+ borderTop: `1px solid ${w.palette.divider}`,
163
+ px: 4,
164
+ py: 2,
165
+ display: "flex",
166
+ alignItems: "center",
167
+ justifyContent: "flex-end"
168
+ },
169
+ children: /* @__PURE__ */ o(l, {
170
+ variant: "contained",
171
+ color: "primary",
172
+ onClick: () => S({ component: "PAY_NOW" }),
173
+ sx: {
174
+ py: 1.25,
175
+ px: 1.5,
176
+ height: 32,
177
+ fontSize: 14,
178
+ ml: "auto"
179
+ },
180
+ children: b._("Repay now")
181
+ })
182
+ })] });
204
183
  };
205
184
  //#endregion
206
- export { w as FinancedInvoicesTable };
185
+ export { h as FinanceDetails };