@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,19 +1,77 @@
1
- import { Dialog as e } from "./index229.js";
2
- import "./index230.js";
3
- import { FinanceFaqDetails as t } from "./index566.js";
4
- import { useState as n } from "react";
5
- import { Fragment as r, jsx as i, jsxs as a } from "@emotion/react/jsx-runtime";
1
+ import { jsx as e, jsxs as t } from "@emotion/react/jsx-runtime";
2
+ import { Box as n, Link as r, Typography as i } from "@mui/material";
3
+ import { useLingui as a } from "@lingui/react";
6
4
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index567.js
7
- var o = ({ children: o }) => {
8
- let [s, c] = n(!1);
9
- return /* @__PURE__ */ a(r, { children: [o({ openModal: () => {
10
- c(!0);
11
- } }), /* @__PURE__ */ i(e, {
12
- open: s,
13
- onClose: () => c(!1),
14
- alignDialog: "right",
15
- children: /* @__PURE__ */ i(t, {})
16
- })] });
5
+ var o = [
6
+ {
7
+ id: 1,
8
+ question: "Does enrolling in the program affect my credit score?",
9
+ answer: "Nope! During the onboarding process we will only conduct a soft pull on your credit report, which will not affect your personal credit score."
10
+ },
11
+ {
12
+ id: 2,
13
+ question: "Why do I need to provide my bank connection details?",
14
+ answer: "Securely connecting your business bank account allows us to review your cashflow and determine your best loan offers."
15
+ },
16
+ {
17
+ id: 3,
18
+ question: "When should I expect to receive a loan offer?",
19
+ answer: "Once you are enrolled into the program, we will be actively analyzing your financials and creating pre-approved offers that work best for your business needs. We do this to help you avoid debt trap. Loan offers are usually provided within less than 48 hours."
20
+ },
21
+ {
22
+ id: 4,
23
+ question: "How do I repay the loan?",
24
+ answer: "At the moment we support monthly loan repayment once you agree to the loan payment schedule. A fixed amount will be automatically deducted from the bank you linked during the onboarding.In the near future, you can also choose to pay back the loan as a fixed percentage of your daily sales until the loan is fully repaid."
25
+ }
26
+ ], s = () => {
27
+ let { i18n: s } = a();
28
+ return /* @__PURE__ */ t(n, {
29
+ p: 4,
30
+ children: [
31
+ /* @__PURE__ */ t(n, { children: [/* @__PURE__ */ e(i, {
32
+ variant: "h3",
33
+ children: s._("Simplified, fast funding for your growing business")
34
+ }), /* @__PURE__ */ e(i, {
35
+ variant: "subtitle2",
36
+ mt: 2,
37
+ children: s._("Get your business moving and accelerate growth with quick and easy access to funding. Multiple options available.")
38
+ })] }),
39
+ /* @__PURE__ */ t(n, {
40
+ mt: 5,
41
+ children: [/* @__PURE__ */ e(i, {
42
+ mb: 1,
43
+ variant: "h3",
44
+ children: s._("FAQ")
45
+ }), o.map((r) => /* @__PURE__ */ t(n, {
46
+ mt: 3,
47
+ children: [/* @__PURE__ */ e(i, {
48
+ variant: "subtitle2",
49
+ children: s._("{faqQuestion}", { faqQuestion: r.question })
50
+ }), /* @__PURE__ */ e(i, {
51
+ variant: "body1",
52
+ mt: 1,
53
+ children: s._("{faqAnswer}", { faqAnswer: r.answer })
54
+ })]
55
+ }, r.id))]
56
+ }),
57
+ /* @__PURE__ */ e(n, {
58
+ mt: 5,
59
+ children: /* @__PURE__ */ t(i, {
60
+ variant: "body2",
61
+ children: [
62
+ s._("All loans are subject to credit approval. Your terms may vary. Flourish Capital loans are issued by Kanmon. California Loans are made pursuant to a Department of Financial Protection and Innovation California Lenders Law License. Read more about Kanmon"),
63
+ " ",
64
+ /* @__PURE__ */ e(r, {
65
+ target: "_blank",
66
+ rel: "noopener noreferrer",
67
+ href: "https://kanmon.com",
68
+ children: s._("here.")
69
+ })
70
+ ]
71
+ })
72
+ })
73
+ ]
74
+ });
17
75
  };
18
76
  //#endregion
19
- export { o as FinanceFaqWrapper };
77
+ export { s as FinanceFaqDetails };
@@ -1,22 +1,19 @@
1
- import { jsx as e } from "@emotion/react/jsx-runtime";
2
- import { Box as t, useTheme as n } from "@mui/material";
1
+ import { Dialog as e } from "./index229.js";
2
+ import "./index230.js";
3
+ import { FinanceFaqDetails as t } from "./index567.js";
4
+ import { useState as n } from "react";
5
+ import { Fragment as r, jsx as i, jsxs as a } from "@emotion/react/jsx-runtime";
3
6
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index568.js
4
- var r = ({ progress: r }) => {
5
- let i = n();
6
- return /* @__PURE__ */ e(t, {
7
- sx: {
8
- backgroundColor: i.palette.divider,
9
- width: "100%",
10
- height: "6px",
11
- borderRadius: .5
12
- },
13
- children: /* @__PURE__ */ e(t, { sx: {
14
- backgroundColor: i.palette.primary.main,
15
- width: `${r}%`,
16
- height: "6px",
17
- borderRadius: .5
18
- } })
19
- });
7
+ var o = ({ children: o }) => {
8
+ let [s, c] = n(!1);
9
+ return /* @__PURE__ */ a(r, { children: [o({ openModal: () => {
10
+ c(!0);
11
+ } }), /* @__PURE__ */ i(e, {
12
+ open: s,
13
+ onClose: () => c(!1),
14
+ alignDialog: "right",
15
+ children: /* @__PURE__ */ i(t, {})
16
+ })] });
20
17
  };
21
18
  //#endregion
22
- export { r as FinanceProgressBar };
19
+ export { o as FinanceFaqWrapper };
@@ -1,8 +1,22 @@
1
- import { useMoniteContext as e } from "./index47.js";
1
+ import { jsx as e } from "@emotion/react/jsx-runtime";
2
+ import { Box as t, useTheme as n } from "@mui/material";
2
3
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index569.js
3
- var t = () => {
4
- let { api: t } = e();
5
- return t.finops.getFinancingOffers.useQuery();
4
+ var r = ({ progress: r }) => {
5
+ let i = n();
6
+ return /* @__PURE__ */ e(t, {
7
+ sx: {
8
+ backgroundColor: i.palette.divider,
9
+ width: "100%",
10
+ height: "6px",
11
+ borderRadius: .5
12
+ },
13
+ children: /* @__PURE__ */ e(t, { sx: {
14
+ backgroundColor: i.palette.primary.main,
15
+ width: `${r}%`,
16
+ height: "6px",
17
+ borderRadius: .5
18
+ } })
19
+ });
6
20
  };
7
21
  //#endregion
8
- export { t as useGetFinanceOffers };
22
+ export { r as FinanceProgressBar };
@@ -1,12 +1,8 @@
1
1
  import { useMoniteContext as e } from "./index47.js";
2
- import { toast as t } from "react-hot-toast";
3
- import { useLingui as n } from "@lingui/react";
4
2
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index570.js
5
- var r = () => {
6
- let { api: r } = e(), { i18n: i } = n();
7
- return r.finops.postFinancingTokens.useMutation({}, { onError: () => {
8
- t.error(i._("The financing service is currently unavailable. Please reload the page or try again later."));
9
- } });
3
+ var t = () => {
4
+ let { api: t } = e();
5
+ return t.finops.getFinancingOffers.useQuery();
10
6
  };
11
7
  //#endregion
12
- export { r as useGetFinancingConnectToken };
8
+ export { t as useGetFinanceOffers };
@@ -1,13 +1,12 @@
1
- import "./index237.js";
2
- import { createContext as e, useContext as t } from "react";
3
- import "@emotion/react/jsx-runtime";
4
- import "@lingui/react";
1
+ import { useMoniteContext as e } from "./index47.js";
2
+ import { toast as t } from "react-hot-toast";
3
+ import { useLingui as n } from "@lingui/react";
5
4
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index571.js
6
- var n = e(null);
7
- function r() {
8
- let e = t(n);
9
- if (!e) throw Error("Could not find KanmonContext. Make sure that you are using \"MoniteProvider\" component before calling this hook.");
10
- return e;
11
- }
5
+ var r = () => {
6
+ let { api: r } = e(), { i18n: i } = n();
7
+ return r.finops.postFinancingTokens.useMutation({}, { onError: () => {
8
+ t.error(i._("The financing service is currently unavailable. Please reload the page or try again later."));
9
+ } });
10
+ };
12
11
  //#endregion
13
- export { n as KanmonContext, r as useKanmonContext };
12
+ export { r as useGetFinancingConnectToken };
@@ -1,133 +1,13 @@
1
- import { useMoniteContext as e } from "./index47.js";
2
- import { useMyEntity as t } from "./index137.js";
3
- import "./index142.js";
4
- import { useComponentSettings as n } from "./index215.js";
5
- import "./index217.js";
6
- import { useKanmonContext as r } from "./index571.js";
7
- import { useGetFinanceOffers as i } from "./index569.js";
8
- import { useGetFinancingConnectToken as a } from "./index570.js";
9
- import { useEffect as o, useState as s } from "react";
10
- import { useLingui as c } from "@lingui/react";
11
- import l from "react-script-hook";
1
+ import "./index237.js";
2
+ import { createContext as e, useContext as t } from "react";
3
+ import "@emotion/react/jsx-runtime";
4
+ import "@lingui/react";
12
5
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index572.js
13
- var u = "https://cdn.sandbox.kanmon.dev/scripts/v2/kanmon-connect.js", d = "https://cdn.kanmon.dev/scripts/v2/kanmon-connect.js", f = {
14
- INIT: "init",
15
- IN_PROGRESS: "in_progress",
16
- PENDING_APPROVAL: "pending_approval",
17
- NO_OFFERS_AVAILABLE: "no_offers",
18
- SERVICING: "servicing",
19
- APPROVED: "approved",
20
- OFFER_ACCEPTED: "offer_accepted",
21
- OFFERS_EXPIRED: "offers_expired"
22
- }, p = () => {
23
- let { apiUrl: p, api: m, queryClient: h, entityId: g } = e(), { isKanmonInitialized: _, toggleKanmon: v, handleButtonText: y, buttonText: b } = r(), { onboardingCallbacks: x } = n(), { i18n: S } = c(), C = a(), { data: w } = i(), { isUSEntity: T } = t(), E = (() => {
24
- switch (w?.business_status) {
25
- case "NEW":
26
- default: return f.INIT;
27
- case "INPUT_REQUIRED": return f.IN_PROGRESS;
28
- case "ONBOARDED": return w?.offers?.length === 0 ? f.PENDING_APPROVAL : w?.offers?.[0]?.status === "NEW" ? f.APPROVED : w?.offers?.[0]?.status === "EXPIRED" ? f.OFFERS_EXPIRED : w?.offers?.[0]?.status === "ACCEPTED" ? f.OFFER_ACCEPTED : f.SERVICING;
29
- }
30
- })(), D = (() => {
31
- try {
32
- let e = new URL(p);
33
- return !["api.dev.monite.com", "api.sandbox.monite.com"].includes(e.hostname);
34
- } catch {
35
- return !0;
36
- }
37
- })() ? d : u, [O] = l({ src: D }), [k, A] = s(!1), j = (e) => {
38
- let t = {
39
- type: "receivable",
40
- status: "NEW",
41
- invoice_id: e?.platformInvoiceId,
42
- document_id: e?.platformInvoiceNumber,
43
- due_date: e?.invoiceDueDate,
44
- issue_date: e?.invoiceIssuedDate,
45
- total_amount: e?.invoiceAmountCents,
46
- currency: "USD",
47
- payer_type: e?.payorType,
48
- payer_business_name: e?.payorBusinessName,
49
- payer_first_name: e?.payorFirstName,
50
- payer_last_name: e?.payorLastName,
51
- requested_amount: e?.amountRequestedForFinancingCents,
52
- principal_amount: e?.principalAmountCents,
53
- repayment_amount: e?.repaymentAmountCents,
54
- advance_amount: e?.invoiceAdvanceAmountCents,
55
- advance_rate_percentage: e?.advanceRatePercentage * 100,
56
- fee_amount: e?.feeAmountCents,
57
- fee_percentage: e?.transactionFeePercentage * 100,
58
- repayment_schedule: {
59
- repayment_date: e?.repaymentSchedule?.schedule?.[0]?.repaymentDate,
60
- repayment_amount: e?.repaymentSchedule?.schedule?.[0]?.repaymentAmountCents,
61
- repayment_fee_amount: e?.repaymentSchedule?.schedule?.[0]?.repaymentFeeAmountCents,
62
- repayment_principal_amount: e?.repaymentSchedule?.schedule?.[0]?.repaymentPrincipalAmountCents
63
- }
64
- };
65
- m.finops.getFinancingInvoices.setQueryData(m.finops.getFinancingInvoices.getQueryKey({ query: {
66
- type: "receivable",
67
- invoice_id: e?.platformInvoiceId
68
- } }), (e) => ({
69
- ...e,
70
- data: [t]
71
- }), h), m.finops.getFinancingInvoices.setQueryData(m.finops.getFinancingInvoices.getQueryKey({ query: {} }), (e) => {
72
- let n = e?.data ? e.data : [];
73
- return {
74
- ...e,
75
- data: [t, ...n]
76
- };
77
- }, h);
78
- }, M = ({ connectToken: e }) => {
79
- window?.KANMON_CONNECT?.start({
80
- connectToken: e,
81
- onEvent: (e) => {
82
- if (e.eventType === "USER_STATE_CHANGED" || e.eventType === "USER_CONFIRMED_INVOICE") {
83
- if (e.eventType === "USER_CONFIRMED_INVOICE") j(e.data.invoice);
84
- else {
85
- switch (e.data.userState) {
86
- case "START_FLOW":
87
- y(S._("Apply for financing"));
88
- break;
89
- case "USER_INPUT_REQUIRED":
90
- e.data.section === "OFFER" ? y(S._("Review terms and sign")) : y(S._("Resume application"));
91
- break;
92
- case "WAITING_FOR_OFFERS":
93
- y(""), (w?.business_status === "INPUT_REQUIRED" || w?.business_status === "NEW") && x.onWorkingCapitalOnboardingComplete?.(g);
94
- break;
95
- case "OFFERS_EXPIRED":
96
- case "NO_OFFERS_EXTENDED":
97
- y("");
98
- break;
99
- case "SERVICING":
100
- y(S._("Financing menu")), w?.business_status === "ONBOARDED" && w?.offers?.[0]?.status === "NEW" && window.localStorage.setItem("isFinanceTabNew", "true");
101
- break;
102
- case "VIEW_OFFERS":
103
- case "OFFER_ACCEPTED": y(S._("Review terms and sign"));
104
- }
105
- m.finops.getFinancingOffers.invalidateQueries(h);
106
- }
107
- }
108
- }
109
- });
110
- };
111
- o(() => {
112
- !_ && !O && T && (async () => {
113
- A(!0);
114
- try {
115
- let e = await C.mutateAsync();
116
- M({ connectToken: e.connect_token }), v(!0);
117
- } catch {} finally {
118
- A(!1);
119
- }
120
- })();
121
- }, [O, T]);
122
- let N = O || k, P = T, F = w?.business_status === "ONBOARDED" && w?.offers?.[0]?.status === "CURRENT";
123
- return {
124
- buttonText: b,
125
- applicationState: E,
126
- offer: w?.offers?.[0],
127
- isLoading: N,
128
- isEnabled: P,
129
- isServicing: F
130
- };
131
- };
6
+ var n = e(null);
7
+ function r() {
8
+ let e = t(n);
9
+ if (!e) throw Error("Could not find KanmonContext. Make sure that you are using \"MoniteProvider\" component before calling this hook.");
10
+ return e;
11
+ }
132
12
  //#endregion
133
- export { f as FinancialApplicationState, p as useFinancing };
13
+ export { n as KanmonContext, r as useKanmonContext };
@@ -1,8 +1,133 @@
1
1
  import { useMoniteContext as e } from "./index47.js";
2
+ import { useMyEntity as t } from "./index137.js";
3
+ import "./index142.js";
4
+ import { useComponentSettings as n } from "./index215.js";
5
+ import "./index217.js";
6
+ import { useKanmonContext as r } from "./index572.js";
7
+ import { useGetFinanceOffers as i } from "./index570.js";
8
+ import { useGetFinancingConnectToken as a } from "./index571.js";
9
+ import { useEffect as o, useState as s } from "react";
10
+ import { useLingui as c } from "@lingui/react";
11
+ import l from "react-script-hook";
2
12
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index573.js
3
- var t = () => {
4
- let { api: t } = e();
5
- return t.finops.postFinancingInvoices.useMutation({}, { onError: () => {} });
13
+ var u = "https://cdn.sandbox.kanmon.dev/scripts/v2/kanmon-connect.js", d = "https://cdn.kanmon.dev/scripts/v2/kanmon-connect.js", f = {
14
+ INIT: "init",
15
+ IN_PROGRESS: "in_progress",
16
+ PENDING_APPROVAL: "pending_approval",
17
+ NO_OFFERS_AVAILABLE: "no_offers",
18
+ SERVICING: "servicing",
19
+ APPROVED: "approved",
20
+ OFFER_ACCEPTED: "offer_accepted",
21
+ OFFERS_EXPIRED: "offers_expired"
22
+ }, p = () => {
23
+ let { apiUrl: p, api: m, queryClient: h, entityId: g } = e(), { isKanmonInitialized: _, toggleKanmon: v, handleButtonText: y, buttonText: b } = r(), { onboardingCallbacks: x } = n(), { i18n: S } = c(), C = a(), { data: w } = i(), { isUSEntity: T } = t(), E = (() => {
24
+ switch (w?.business_status) {
25
+ case "NEW":
26
+ default: return f.INIT;
27
+ case "INPUT_REQUIRED": return f.IN_PROGRESS;
28
+ case "ONBOARDED": return w?.offers?.length === 0 ? f.PENDING_APPROVAL : w?.offers?.[0]?.status === "NEW" ? f.APPROVED : w?.offers?.[0]?.status === "EXPIRED" ? f.OFFERS_EXPIRED : w?.offers?.[0]?.status === "ACCEPTED" ? f.OFFER_ACCEPTED : f.SERVICING;
29
+ }
30
+ })(), D = (() => {
31
+ try {
32
+ let e = new URL(p);
33
+ return !["api.dev.monite.com", "api.sandbox.monite.com"].includes(e.hostname);
34
+ } catch {
35
+ return !0;
36
+ }
37
+ })() ? d : u, [O] = l({ src: D }), [k, A] = s(!1), j = (e) => {
38
+ let t = {
39
+ type: "receivable",
40
+ status: "NEW",
41
+ invoice_id: e?.platformInvoiceId,
42
+ document_id: e?.platformInvoiceNumber,
43
+ due_date: e?.invoiceDueDate,
44
+ issue_date: e?.invoiceIssuedDate,
45
+ total_amount: e?.invoiceAmountCents,
46
+ currency: "USD",
47
+ payer_type: e?.payorType,
48
+ payer_business_name: e?.payorBusinessName,
49
+ payer_first_name: e?.payorFirstName,
50
+ payer_last_name: e?.payorLastName,
51
+ requested_amount: e?.amountRequestedForFinancingCents,
52
+ principal_amount: e?.principalAmountCents,
53
+ repayment_amount: e?.repaymentAmountCents,
54
+ advance_amount: e?.invoiceAdvanceAmountCents,
55
+ advance_rate_percentage: e?.advanceRatePercentage * 100,
56
+ fee_amount: e?.feeAmountCents,
57
+ fee_percentage: e?.transactionFeePercentage * 100,
58
+ repayment_schedule: {
59
+ repayment_date: e?.repaymentSchedule?.schedule?.[0]?.repaymentDate,
60
+ repayment_amount: e?.repaymentSchedule?.schedule?.[0]?.repaymentAmountCents,
61
+ repayment_fee_amount: e?.repaymentSchedule?.schedule?.[0]?.repaymentFeeAmountCents,
62
+ repayment_principal_amount: e?.repaymentSchedule?.schedule?.[0]?.repaymentPrincipalAmountCents
63
+ }
64
+ };
65
+ m.finops.getFinancingInvoices.setQueryData(m.finops.getFinancingInvoices.getQueryKey({ query: {
66
+ type: "receivable",
67
+ invoice_id: e?.platformInvoiceId
68
+ } }), (e) => ({
69
+ ...e,
70
+ data: [t]
71
+ }), h), m.finops.getFinancingInvoices.setQueryData(m.finops.getFinancingInvoices.getQueryKey({ query: {} }), (e) => {
72
+ let n = e?.data ? e.data : [];
73
+ return {
74
+ ...e,
75
+ data: [t, ...n]
76
+ };
77
+ }, h);
78
+ }, M = ({ connectToken: e }) => {
79
+ window?.KANMON_CONNECT?.start({
80
+ connectToken: e,
81
+ onEvent: (e) => {
82
+ if (e.eventType === "USER_STATE_CHANGED" || e.eventType === "USER_CONFIRMED_INVOICE") {
83
+ if (e.eventType === "USER_CONFIRMED_INVOICE") j(e.data.invoice);
84
+ else {
85
+ switch (e.data.userState) {
86
+ case "START_FLOW":
87
+ y(S._("Apply for financing"));
88
+ break;
89
+ case "USER_INPUT_REQUIRED":
90
+ e.data.section === "OFFER" ? y(S._("Review terms and sign")) : y(S._("Resume application"));
91
+ break;
92
+ case "WAITING_FOR_OFFERS":
93
+ y(""), (w?.business_status === "INPUT_REQUIRED" || w?.business_status === "NEW") && x.onWorkingCapitalOnboardingComplete?.(g);
94
+ break;
95
+ case "OFFERS_EXPIRED":
96
+ case "NO_OFFERS_EXTENDED":
97
+ y("");
98
+ break;
99
+ case "SERVICING":
100
+ y(S._("Financing menu")), w?.business_status === "ONBOARDED" && w?.offers?.[0]?.status === "NEW" && window.localStorage.setItem("isFinanceTabNew", "true");
101
+ break;
102
+ case "VIEW_OFFERS":
103
+ case "OFFER_ACCEPTED": y(S._("Review terms and sign"));
104
+ }
105
+ m.finops.getFinancingOffers.invalidateQueries(h);
106
+ }
107
+ }
108
+ }
109
+ });
110
+ };
111
+ o(() => {
112
+ !_ && !O && T && (async () => {
113
+ A(!0);
114
+ try {
115
+ let e = await C.mutateAsync();
116
+ M({ connectToken: e.connect_token }), v(!0);
117
+ } catch {} finally {
118
+ A(!1);
119
+ }
120
+ })();
121
+ }, [O, T]);
122
+ let N = O || k, P = T, F = w?.business_status === "ONBOARDED" && w?.offers?.[0]?.status === "CURRENT";
123
+ return {
124
+ buttonText: b,
125
+ applicationState: E,
126
+ offer: w?.offers?.[0],
127
+ isLoading: N,
128
+ isEnabled: P,
129
+ isServicing: F
130
+ };
6
131
  };
7
132
  //#endregion
8
- export { t as useFinanceAnInvoice };
133
+ export { f as FinancialApplicationState, p as useFinancing };
@@ -1,8 +1,8 @@
1
1
  import { useMoniteContext as e } from "./index47.js";
2
2
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index574.js
3
- var t = (t, n = !0) => {
4
- let { api: r } = e();
5
- return r.finops.getFinancingInvoices.useQuery({ query: t }, { enabled: n });
3
+ var t = () => {
4
+ let { api: t } = e();
5
+ return t.finops.postFinancingInvoices.useMutation({}, { onError: () => {} });
6
6
  };
7
7
  //#endregion
8
- export { t as useGetFinancedInvoices };
8
+ export { t as useFinanceAnInvoice };
@@ -1,5 +1,8 @@
1
- import "./index569.js";
2
- import "./index570.js";
3
- import "./index572.js";
4
- import "./index573.js";
5
- import "./index574.js";
1
+ import { useMoniteContext as e } from "./index47.js";
2
+ //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index575.js
3
+ var t = (t, n = !0) => {
4
+ let { api: r } = e();
5
+ return r.finops.getFinancingInvoices.useQuery({ query: t }, { enabled: n });
6
+ };
7
+ //#endregion
8
+ export { t as useGetFinancedInvoices };