@gearbox-protocol/ui-kit 4.0.0-next.43 → 4.0.0-next.45

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 (68) hide show
  1. package/dist/cjs/components/base/borrow-rate-block/borrow-rate-block.cjs +1 -1
  2. package/dist/cjs/components/base/index.cjs +1 -1
  3. package/dist/cjs/components/base/info-list/info-list.cjs +1 -1
  4. package/dist/cjs/components/base/liquidation-price-block/liquidation-price-block.cjs +1 -1
  5. package/dist/cjs/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.cjs +1 -1
  6. package/dist/cjs/components/base/position-assets/position-assets.cjs +1 -1
  7. package/dist/cjs/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.cjs +1 -1
  8. package/dist/cjs/components/base/time-to-liquidation-block/time-to-liquidation-block.cjs +1 -1
  9. package/dist/cjs/components/base/token-amount/token-amount.cjs +1 -1
  10. package/dist/cjs/components/base/values/constants.cjs +1 -1
  11. package/dist/cjs/components/base/values/index.cjs +1 -1
  12. package/dist/cjs/components/base/values/no-value.cjs +1 -0
  13. package/dist/cjs/components/base/values/pnl-value.cjs +1 -1
  14. package/dist/cjs/components/base/values/price-impact-value.cjs +1 -1
  15. package/dist/cjs/components/base/values/scalars.cjs +1 -1
  16. package/dist/cjs/components/base-table/base-table-line.cjs +1 -1
  17. package/dist/cjs/components/checkbox/checkbox-labeled.cjs +1 -1
  18. package/dist/cjs/components/client-adapters/styled-rounded-image/styled-rounded-image.cjs +1 -1
  19. package/dist/cjs/components/composites/pool-assets-table/pool-assets-table-row.cjs +1 -1
  20. package/dist/cjs/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.cjs +1 -1
  21. package/dist/cjs/components/compound-apy/compound-apy.cjs +1 -1
  22. package/dist/cjs/components/help-tip/help-tip.cjs +1 -1
  23. package/dist/cjs/components/index.cjs +1 -1
  24. package/dist/cjs/components/with-copy/with-copy.cjs +1 -1
  25. package/dist/cjs/index.cjs +1 -1
  26. package/dist/cjs/locale/en.json.cjs +1 -1
  27. package/dist/cjs/utils/format.cjs +1 -1
  28. package/dist/cjs/utils/index.cjs +1 -1
  29. package/dist/esm/components/base/borrow-rate-block/borrow-rate-block.js +3 -2
  30. package/dist/esm/components/base/index.js +63 -61
  31. package/dist/esm/components/base/info-list/info-list.js +8 -7
  32. package/dist/esm/components/base/liquidation-price-block/liquidation-price-block.js +46 -38
  33. package/dist/esm/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.js +74 -61
  34. package/dist/esm/components/base/position-assets/position-assets.js +45 -41
  35. package/dist/esm/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.js +86 -74
  36. package/dist/esm/components/base/time-to-liquidation-block/time-to-liquidation-block.js +40 -32
  37. package/dist/esm/components/base/token-amount/token-amount.js +32 -16
  38. package/dist/esm/components/base/values/constants.js +1 -0
  39. package/dist/esm/components/base/values/index.js +21 -19
  40. package/dist/esm/components/base/values/no-value.js +34 -0
  41. package/dist/esm/components/base/values/pnl-value.js +10 -9
  42. package/dist/esm/components/base/values/price-impact-value.js +6 -5
  43. package/dist/esm/components/base/values/scalars.js +23 -26
  44. package/dist/esm/components/base-table/base-table-line.js +44 -36
  45. package/dist/esm/components/checkbox/checkbox-labeled.js +1 -1
  46. package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +1 -1
  47. package/dist/esm/components/composites/pool-assets-table/pool-assets-table-row.js +47 -46
  48. package/dist/esm/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.js +26 -25
  49. package/dist/esm/components/compound-apy/compound-apy.js +48 -40
  50. package/dist/esm/components/help-tip/help-tip.js +64 -59
  51. package/dist/esm/components/index.js +624 -622
  52. package/dist/esm/components/with-copy/with-copy.js +1 -1
  53. package/dist/esm/index.js +814 -811
  54. package/dist/esm/locale/en.json.js +1 -0
  55. package/dist/esm/utils/format.js +14 -12
  56. package/dist/esm/utils/index.js +76 -75
  57. package/dist/globals.css +1 -1
  58. package/dist/types/components/base/apy-breakdown-body/apy-breakdown-body.d.ts +4 -3
  59. package/dist/types/components/base/liquidation-price-block/liquidation-price-block.d.ts +8 -1
  60. package/dist/types/components/base/position-assets/position-assets.d.ts +7 -1
  61. package/dist/types/components/base/time-to-liquidation-block/time-to-liquidation-block.d.ts +8 -1
  62. package/dist/types/components/base/values/constants.d.ts +1 -0
  63. package/dist/types/components/base/values/index.d.ts +1 -0
  64. package/dist/types/components/base/values/no-value.d.ts +25 -0
  65. package/dist/types/components/base/values/scalars.d.ts +7 -2
  66. package/dist/types/locale/en.json.d.ts +1 -0
  67. package/dist/types/utils/format.d.ts +8 -0
  68. package/package.json +1 -1
@@ -1,121 +1,134 @@
1
- import { jsxs as a, jsx as o, Fragment as v } from "react/jsx-runtime";
2
- import { ApyBreakdownBody as w, BREAKDOWN_DASH as t, formatBreakdownRate as p, ApyBreakdownRow as i, periodMessageId as c, ApyBreakdownDivider as g } from "../apy-breakdown-body/apy-breakdown-body.js";
3
- import { PointsIcon as f } from "../../points-icon/points-icon.js";
4
- import { TokenIcon as B } from "../../token-icon/token-icon.js";
5
- import { FormattedMessageTyped as s } from "../../typed-intl/index.js";
6
- import { totalApyOf as I, tokenRewardsOf as h, pointProgramsOf as b } from "../../../utils/apy-breakdown.js";
7
- import { PoolApyBreakdownCardTest as l } from "./constants.js";
8
- function D({
1
+ import { jsxs as p, jsx as e, Fragment as v } from "react/jsx-runtime";
2
+ import { ApyBreakdownBody as w, formatBreakdownRate as a, ApyBreakdownRow as i, periodMessageId as d, ApyBreakdownDivider as g, BREAKDOWN_DASH as f } from "../apy-breakdown-body/apy-breakdown-body.js";
3
+ import { NoValue as c } from "../values/no-value.js";
4
+ import "react";
5
+ import { totalApyOf as B, tokenRewardsOf as I, pointProgramsOf as h } from "../../../utils/apy-breakdown.js";
6
+ import "@gearbox-protocol/sdk/onchain";
7
+ import "clsx";
8
+ import "tailwind-merge";
9
+ import "sonner";
10
+ import "luxon";
11
+ import "../../../utils/z-index.js";
12
+ import { PointsIcon as b } from "../../points-icon/points-icon.js";
13
+ import "viem";
14
+ import { PoolApyBreakdownCardTest as t } from "./constants.js";
15
+ import { TokenIcon as C } from "../../token-icon/token-icon.js";
16
+ import "../../tooltip/simple-tooltip.js";
17
+ import "../../tooltip/tooltip.js";
18
+ import { FormattedMessageTyped as l } from "../../typed-intl/index.js";
19
+ import "../../badge/badge.js";
20
+ import "../../badge/chip.js";
21
+ function q({
9
22
  data: n,
10
- period: d
23
+ period: r
11
24
  }) {
12
- const r = n ? I(n) : void 0, m = n?.organicApy, y = n == null ? void 0 : (r ?? 0) - (m ?? 0), u = n ? h(n) : [], A = n ? b(n) : [], k = [...u.filter((e) => e.supplyApr != null), ...A];
13
- return /* @__PURE__ */ a(
25
+ const s = n ? B(n) : void 0, m = n?.organicApy, u = n == null ? void 0 : (s ?? 0) - (m ?? 0), y = n ? I(n) : [], A = n ? h(n) : [], k = [...y.filter((o) => o.supplyApr != null), ...A];
26
+ return /* @__PURE__ */ p(
14
27
  w,
15
28
  {
16
- testId: l.root,
17
- title: /* @__PURE__ */ o(
18
- s,
29
+ testId: t.root,
30
+ title: /* @__PURE__ */ e(
31
+ l,
19
32
  {
20
- messageId: c(
21
- d,
33
+ messageId: d(
34
+ r,
22
35
  "components.poolApyBreakdownCard.title",
23
36
  "components.poolApyBreakdownCard.title7d"
24
37
  )
25
38
  }
26
39
  ),
27
- chip: r == null ? t : p(r),
28
- chipPositive: (r ?? 0) > 0,
29
- chipTestId: l.net,
40
+ chip: s == null ? /* @__PURE__ */ e(c, { reason: r }) : a(s),
41
+ chipPositive: (s ?? 0) > 0,
42
+ chipTestId: t.net,
30
43
  children: [
31
- /* @__PURE__ */ o(
44
+ /* @__PURE__ */ e(
32
45
  i,
33
46
  {
34
- valueTestId: l.value,
35
- label: /* @__PURE__ */ o(
36
- s,
47
+ valueTestId: t.value,
48
+ label: /* @__PURE__ */ e(
49
+ l,
37
50
  {
38
- messageId: c(
39
- d,
51
+ messageId: d(
52
+ r,
40
53
  "components.poolApyBreakdownCard.organicApy",
41
54
  "components.poolApyBreakdownCard.organicApy7d"
42
55
  )
43
56
  }
44
57
  ),
45
- value: m == null ? t : p(m)
58
+ value: m == null ? /* @__PURE__ */ e(c, { reason: r }) : a(m)
46
59
  }
47
60
  ),
48
- /* @__PURE__ */ o(
61
+ /* @__PURE__ */ e(
49
62
  i,
50
63
  {
51
- valueTestId: l.value,
52
- label: /* @__PURE__ */ o(
53
- s,
64
+ valueTestId: t.value,
65
+ label: /* @__PURE__ */ e(
66
+ l,
54
67
  {
55
- messageId: c(
56
- d,
68
+ messageId: d(
69
+ r,
57
70
  "components.poolApyBreakdownCard.incentiveApy",
58
71
  "components.poolApyBreakdownCard.incentiveApy7d"
59
72
  )
60
73
  }
61
74
  ),
62
- value: y == null ? t : p(y)
75
+ value: u == null ? /* @__PURE__ */ e(c, { reason: r }) : a(u)
63
76
  }
64
77
  ),
65
- k.length > 0 ? /* @__PURE__ */ a(v, { children: [
66
- /* @__PURE__ */ o(g, {}),
67
- u.map(
68
- (e) => e.supplyApr == null ? null : /* @__PURE__ */ o(
78
+ k.length > 0 ? /* @__PURE__ */ p(v, { children: [
79
+ /* @__PURE__ */ e(g, {}),
80
+ y.map(
81
+ (o) => o.supplyApr == null ? null : /* @__PURE__ */ e(
69
82
  i,
70
83
  {
71
- valueTestId: l.reward,
72
- label: /* @__PURE__ */ a("span", { className: "inline-flex items-center gap-1.5", children: [
73
- /* @__PURE__ */ o("span", { children: /* @__PURE__ */ o(
74
- s,
84
+ valueTestId: t.reward,
85
+ label: /* @__PURE__ */ p("span", { className: "inline-flex items-center gap-1.5", children: [
86
+ /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(
87
+ l,
75
88
  {
76
89
  messageId: "components.apyParts.extraAPY",
77
- values: { symbol: e.token.symbol }
90
+ values: { symbol: o.token.symbol }
78
91
  }
79
92
  ) }),
80
- /* @__PURE__ */ o(
81
- B,
93
+ /* @__PURE__ */ e(
94
+ C,
82
95
  {
83
- token: e.token,
84
- symbol: e.token.symbol,
96
+ token: o.token,
97
+ symbol: o.token.symbol,
85
98
  size: 16,
86
99
  className: "shrink-0"
87
100
  }
88
101
  )
89
102
  ] }),
90
- value: p(e.supplyApr)
103
+ value: a(o.supplyApr)
91
104
  },
92
- `incentive-${e.token.address}-${e.supplyApr}`
105
+ `incentive-${o.token.address}-${o.supplyApr}`
93
106
  )
94
107
  ),
95
- A.map((e) => /* @__PURE__ */ o(
108
+ A.map((o) => /* @__PURE__ */ e(
96
109
  i,
97
110
  {
98
- valueTestId: l.points,
99
- label: /* @__PURE__ */ a("span", { className: "inline-flex items-center gap-1.5", children: [
100
- /* @__PURE__ */ o("span", { children: /* @__PURE__ */ o(
101
- s,
111
+ valueTestId: t.points,
112
+ label: /* @__PURE__ */ p("span", { className: "inline-flex items-center gap-1.5", children: [
113
+ /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(
114
+ l,
102
115
  {
103
116
  messageId: "components.yieldBreakdown.programPoints",
104
- values: { name: e.name }
117
+ values: { name: o.name }
105
118
  }
106
119
  ) }),
107
- /* @__PURE__ */ o(
108
- f,
120
+ /* @__PURE__ */ e(
121
+ b,
109
122
  {
110
- reward: { name: e.name, type: e.id },
123
+ reward: { name: o.name, type: o.id },
111
124
  size: 16,
112
125
  className: "shrink-0"
113
126
  }
114
127
  )
115
128
  ] }),
116
- value: e.multiplier != null ? `${e.multiplier}×` : t
129
+ value: o.multiplier != null ? `${o.multiplier}×` : f
117
130
  },
118
- e.id
131
+ o.id
119
132
  ))
120
133
  ] }) : null
121
134
  ]
@@ -123,6 +136,6 @@ function D({
123
136
  );
124
137
  }
125
138
  export {
126
- D as PoolApyBreakdownCard,
127
- l as PoolApyBreakdownCardTest
139
+ q as PoolApyBreakdownCard,
140
+ t as PoolApyBreakdownCardTest
128
141
  };
@@ -1,31 +1,34 @@
1
- import { jsx as n, jsxs as m, Fragment as p } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as m, Fragment as p } from "react/jsx-runtime";
2
2
  import { Stack as h } from "../stack/stack.js";
3
+ import "../../help-tip/help-tip.js";
3
4
  import "react";
5
+ import "react-intl";
4
6
  import "@gearbox-protocol/sdk/onchain";
5
7
  import "clsx";
6
8
  import "tailwind-merge";
7
9
  import "sonner";
10
+ import { APPROXIMATE_SYMBOL as f } from "../../../utils/format.js";
8
11
  import "luxon";
9
12
  import "../../../utils/z-index.js";
10
13
  import "../../points-icon/points-icon.js";
11
14
  import { TokenBigint as d } from "../values/scalars.js";
12
15
  import "../../badge/badge.js";
13
16
  import "../../badge/chip.js";
14
- import "react-intl";
15
- import { ShortString as f } from "../../short-string/short-string.js";
16
- import { TokenSymbol as u } from "../../token-symbol/token-symbol.js";
17
- import { Typography as k } from "../../typography/typography.js";
17
+ import { ShortString as u } from "../../short-string/short-string.js";
18
+ import { TokenSymbol as k } from "../../token-symbol/token-symbol.js";
19
+ import { Typography as v } from "../../typography/typography.js";
18
20
  import { PositionAssetsTest as c } from "./constants.js";
19
- const v = 1, g = 20;
20
- function X({
21
+ const g = 1, y = 20;
22
+ function I({
21
23
  assets: s,
22
- to: e,
24
+ to: r,
23
25
  empty: a,
24
- testId: i
26
+ approximate: l,
27
+ testId: o
25
28
  }) {
26
- const t = y(s, e), r = e !== void 0;
27
- return /* @__PURE__ */ n(h, { gap: "sm", align: "end", "data-testid": i ?? c.root, children: t.length === 0 ? a !== void 0 && /* @__PURE__ */ n(
28
- k,
29
+ const n = S(s, r), i = r !== void 0;
30
+ return /* @__PURE__ */ e(h, { gap: "sm", align: "end", "data-testid": o ?? c.root, children: n.length === 0 ? a !== void 0 && /* @__PURE__ */ e(
31
+ v,
29
32
  {
30
33
  variant: "caption",
31
34
  color: "secondary",
@@ -33,63 +36,64 @@ function X({
33
36
  "data-testid": c.empty,
34
37
  children: a
35
38
  }
36
- ) : t.map((o) => /* @__PURE__ */ m(
39
+ ) : n.map((t) => /* @__PURE__ */ m(
37
40
  "span",
38
41
  {
39
42
  className: "flex items-center gap-2",
40
43
  "data-testid": c.row,
41
44
  children: [
42
- /* @__PURE__ */ n(u, { size: 20, token: o.token }),
45
+ /* @__PURE__ */ e(k, { size: 20, token: t.token }),
43
46
  /* @__PURE__ */ m("span", { className: "flex items-center", children: [
44
- r && /* @__PURE__ */ m(p, { children: [
45
- /* @__PURE__ */ n("span", { className: "text-secondary-foreground line-through [&_*]:text-secondary-foreground [&_*]:line-through", children: /* @__PURE__ */ n(
47
+ i && /* @__PURE__ */ m(p, { children: [
48
+ /* @__PURE__ */ e("span", { className: "text-secondary-foreground line-through [&_*]:text-secondary-foreground [&_*]:line-through", children: /* @__PURE__ */ e(
46
49
  d,
47
50
  {
48
- data: o.value,
49
- token: o.token,
51
+ data: t.value,
52
+ token: t.token,
50
53
  showSymbol: !1
51
54
  }
52
55
  ) }),
53
- /* @__PURE__ */ n("span", { className: "px-1.5 text-gray-70", children: "→" })
56
+ /* @__PURE__ */ e("span", { className: "px-1.5 text-gray-70", children: "→" })
54
57
  ] }),
55
- /* @__PURE__ */ n(
58
+ l ? /* @__PURE__ */ e("span", { children: f }) : null,
59
+ /* @__PURE__ */ e(
56
60
  d,
57
61
  {
58
- data: r ? o.valueTo : o.value,
59
- token: o.token,
62
+ data: i ? t.valueTo : t.value,
63
+ token: t.token,
60
64
  showSymbol: !1
61
65
  }
62
66
  ),
63
- /* @__PURE__ */ n(f, { className: "ml-1", maxLength: g, children: o.token.symbol })
67
+ /* @__PURE__ */ e(u, { className: "ml-1", maxLength: y, children: t.token.symbol })
64
68
  ] })
65
69
  ]
66
70
  },
67
- o.token.address
71
+ t.token.address
68
72
  )) });
69
73
  }
70
- function y(s, e) {
71
- const a = /* @__PURE__ */ new Map(), i = (t, r) => {
72
- const o = t.token.address.toLowerCase(), l = a.get(o);
73
- a.set(o, {
74
- token: l?.token ?? t.token,
74
+ function S(s, r) {
75
+ const a = /* @__PURE__ */ new Map(), l = (o, n) => {
76
+ const i = o.token.address.toLowerCase(), t = a.get(i);
77
+ a.set(i, {
78
+ token: t?.token ?? o.token,
75
79
  // a token only the other side holds is a zero here, not a gap
76
- value: r === "from" ? t.value : l?.value ?? 0n,
77
- valueTo: r === "to" ? t.value : l?.valueTo ?? 0n,
78
- worth: x(l?.worth, t.valueUsd)
80
+ value: n === "from" ? o.value : t?.value ?? 0n,
81
+ valueTo: n === "to" ? o.value : t?.valueTo ?? 0n,
82
+ worth: x(t?.worth, o.valueUsd)
79
83
  });
80
84
  };
81
- for (const t of s ?? []) i(t, "from");
82
- for (const t of e ?? []) i(t, "to");
83
- return [...a.values()].filter((t) => t.worth === null || t.worth >= v).sort(
84
- (t, r) => (r.worth ?? 0) - (t.worth ?? 0) || // a tie has to break the same way every render, or the rows drift
85
- t.token.address.localeCompare(r.token.address)
85
+ for (const o of s ?? []) l(o, "from");
86
+ for (const o of r ?? []) l(o, "to");
87
+ return [...a.values()].filter((o) => o.worth === null || o.worth >= g).sort(
88
+ (o, n) => (n.worth ?? 0) - (o.worth ?? 0) || // a tie has to break the same way every render, or the rows drift
89
+ o.token.address.localeCompare(n.token.address)
86
90
  );
87
91
  }
88
- function x(s, e) {
89
- return s === void 0 ? e : s === null || e === null ? null : Math.max(s, e);
92
+ function x(s, r) {
93
+ return s === void 0 ? r : s === null || r === null ? null : Math.max(s, r);
90
94
  }
91
95
  export {
92
- X as PositionAssets,
96
+ I as PositionAssets,
93
97
  c as PositionAssetsTest,
94
- y as visibleAssets
98
+ S as visibleAssets
95
99
  };
@@ -1,105 +1,117 @@
1
- import { jsxs as A, jsx as t, Fragment as C } from "react/jsx-runtime";
1
+ import { jsxs as A, jsx as o, Fragment as C } from "react/jsx-runtime";
2
2
  import { calcNetStrategyApy as x, calcEffectiveBorrowApy as D } from "@gearbox-protocol/sdk/onchain";
3
- import { ApyBreakdownBody as P, BREAKDOWN_DASH as v, formatBreakdownRate as r, ApyBreakdownRow as w, periodMessageId as b, ApyBreakdownDivider as q } from "../apy-breakdown-body/apy-breakdown-body.js";
4
- import { PointsIcon as O } from "../../points-icon/points-icon.js";
5
- import { TokenIcon as S } from "../../token-icon/token-icon.js";
6
- import { FormattedMessageTyped as s } from "../../typed-intl/index.js";
7
- import { totalApyOf as L, positiveTokenRewardsOf as M, pointProgramsOf as $ } from "../../../utils/apy-breakdown.js";
3
+ import { ApyBreakdownBody as P, formatBreakdownRate as i, ApyBreakdownRow as v, periodMessageId as k, ApyBreakdownDivider as q, BREAKDOWN_DASH as O } from "../apy-breakdown-body/apy-breakdown-body.js";
4
+ import { NoValue as b } from "../values/no-value.js";
5
+ import "react";
6
+ import { totalApyOf as S, positiveTokenRewardsOf as L, pointProgramsOf as M } from "../../../utils/apy-breakdown.js";
7
+ import "clsx";
8
+ import "tailwind-merge";
9
+ import "sonner";
8
10
  import { formatLeverage as d } from "../../../utils/format-leverage.js";
11
+ import "luxon";
12
+ import "../../../utils/z-index.js";
13
+ import { PointsIcon as $ } from "../../points-icon/points-icon.js";
14
+ import "viem";
15
+ import { TokenIcon as j } from "../../token-icon/token-icon.js";
16
+ import { FormattedMessageTyped as r } from "../../typed-intl/index.js";
17
+ import "../../tooltip/simple-tooltip.js";
18
+ import "../../tooltip/tooltip.js";
19
+ import "../../badge/badge.js";
20
+ import "../../badge/chip.js";
9
21
  import { StrategyApyBreakdownCardTest as n } from "./constants.js";
10
- function j(c) {
11
- const { borrowApyAvg7D: o, quotaRateAvg7D: i, liquidationThreshold: m } = c;
12
- return o === void 0 || i === void 0 ? null : {
13
- borrowApy: o,
14
- quotaRate: i,
15
- liquidationThreshold: m
22
+ function z(c) {
23
+ const { borrowApyAvg7D: t, quotaRateAvg7D: p, liquidationThreshold: s } = c;
24
+ return t === void 0 || p === void 0 ? null : {
25
+ borrowApy: t,
26
+ quotaRate: p,
27
+ liquidationThreshold: s
16
28
  };
17
29
  }
18
- function J({
30
+ function so({
19
31
  data: c,
20
- leverage: o,
21
- showFormula: i = !1,
22
- period: m
32
+ leverage: t,
33
+ showFormula: p = !1,
34
+ period: s
23
35
  }) {
24
- const a = j(c), l = a && c.collateralApyAvg7D ? c.collateralApyAvg7D : void 0, f = a !== null && l !== void 0, g = f && a && l ? {
36
+ const a = z(c), l = a && c.collateralApyAvg7D ? c.collateralApyAvg7D : void 0, f = a !== null && l !== void 0, g = f && a && l ? {
25
37
  organicApy: x(
26
38
  a,
27
39
  l.organicApy,
28
- o
40
+ t
29
41
  ),
30
42
  totalApy: x(
31
43
  a,
32
44
  l.totalApy ?? l.organicApy,
33
- o
45
+ t
34
46
  ),
35
47
  ...l.rewards ? { rewards: l.rewards } : {}
36
- } : null, p = f && a ? D(a, o) : null, u = g === null ? null : L(g), I = u === null || p === null ? null : u + p, N = l ? M(l) : [], B = l ? $(l) : [], T = N.map((e) => ({
48
+ } : null, m = f && a ? D(a, t) : null, u = g === null ? null : S(g), I = u === null || m === null ? null : u + m, N = l ? L(l) : [], B = l ? M(l) : [], T = N.map((e) => ({
37
49
  reward: e,
38
- value: Math.round(o * (e.supplyApr ?? 0))
39
- })), y = I === null ? null : I - T.reduce((e, k) => e + k.value, 0), h = y !== null && o > 0 ? y / o : void 0, R = a && p !== null && o > 0 ? (p - a.borrowApy * (o - 1)) / o : void 0;
50
+ value: Math.round(t * (e.supplyApr ?? 0))
51
+ })), y = I === null ? null : I - T.reduce((e, w) => e + w.value, 0), h = y !== null && t > 0 ? y / t : void 0, R = a && m !== null && t > 0 ? (m - a.borrowApy * (t - 1)) / t : void 0;
40
52
  return /* @__PURE__ */ A(
41
53
  P,
42
54
  {
43
55
  testId: n.root,
44
- title: /* @__PURE__ */ t(
45
- s,
56
+ title: /* @__PURE__ */ o(
57
+ r,
46
58
  {
47
- messageId: b(
48
- m,
59
+ messageId: k(
60
+ s,
49
61
  "components.yieldBreakdown.titleNetAtLeverage",
50
62
  "components.yieldBreakdown.titleNetAtLeverage7d"
51
63
  ),
52
- values: { leverage: d(o) }
64
+ values: { leverage: d(t) }
53
65
  }
54
66
  ),
55
- chip: u === null ? v : r(u),
67
+ chip: u === null ? /* @__PURE__ */ o(b, { reason: s }) : i(u),
56
68
  chipPositive: (u ?? 0) > 0,
57
69
  chipTestId: n.net,
58
70
  children: [
59
- /* @__PURE__ */ t(
60
- w,
71
+ /* @__PURE__ */ o(
72
+ v,
61
73
  {
62
74
  testId: n.collateral,
63
75
  valueTestId: n.value,
64
76
  captionTestId: n.caption,
65
- label: /* @__PURE__ */ t(
66
- s,
77
+ label: /* @__PURE__ */ o(
78
+ r,
67
79
  {
68
- messageId: b(
69
- m,
80
+ messageId: k(
81
+ s,
70
82
  "components.yieldBreakdown.collateralApy",
71
83
  "components.yieldBreakdown.collateralApy7d"
72
84
  )
73
85
  }
74
86
  ),
75
- value: y === null ? v : r(y),
76
- subtext: i && h !== void 0 ? /* @__PURE__ */ t(
77
- s,
87
+ value: y === null ? /* @__PURE__ */ o(b, { reason: s }) : i(y),
88
+ subtext: p && h !== void 0 ? /* @__PURE__ */ o(
89
+ r,
78
90
  {
79
91
  messageId: "components.strategyApyBreakdownCard.formula",
80
92
  values: {
81
- leverage: d(o),
82
- base: r(h)
93
+ leverage: d(t),
94
+ base: i(h)
83
95
  }
84
96
  }
85
97
  ) : void 0
86
98
  }
87
99
  ),
88
- T.map(({ reward: e, value: k }) => /* @__PURE__ */ t(
89
- w,
100
+ T.map(({ reward: e, value: w }) => /* @__PURE__ */ o(
101
+ v,
90
102
  {
91
103
  valueTestId: n.value,
92
104
  captionTestId: n.caption,
93
105
  label: /* @__PURE__ */ A("span", { className: "inline-flex items-center gap-1.5", children: [
94
- /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(
95
- s,
106
+ /* @__PURE__ */ o("span", { children: /* @__PURE__ */ o(
107
+ r,
96
108
  {
97
109
  messageId: "components.apyParts.extraAPY",
98
110
  values: { symbol: e.token.symbol }
99
111
  }
100
112
  ) }),
101
- /* @__PURE__ */ t(
102
- S,
113
+ /* @__PURE__ */ o(
114
+ j,
103
115
  {
104
116
  token: e.token,
105
117
  symbol: e.token.symbol,
@@ -108,74 +120,74 @@ function J({
108
120
  }
109
121
  )
110
122
  ] }),
111
- value: r(k),
112
- subtext: i ? /* @__PURE__ */ t(
113
- s,
123
+ value: i(w),
124
+ subtext: p ? /* @__PURE__ */ o(
125
+ r,
114
126
  {
115
127
  messageId: "components.strategyApyBreakdownCard.formula",
116
128
  values: {
117
- leverage: d(o),
118
- base: r(e.supplyApr ?? 0)
129
+ leverage: d(t),
130
+ base: i(e.supplyApr ?? 0)
119
131
  }
120
132
  }
121
133
  ) : void 0
122
134
  },
123
135
  `incentive-${e.token.address}-${e.supplyApr ?? 0}`
124
136
  )),
125
- /* @__PURE__ */ t(
126
- w,
137
+ /* @__PURE__ */ o(
138
+ v,
127
139
  {
128
140
  muted: !0,
129
141
  testId: n.borrow,
130
142
  valueTestId: n.value,
131
143
  captionTestId: n.caption,
132
- label: /* @__PURE__ */ t(
133
- s,
144
+ label: /* @__PURE__ */ o(
145
+ r,
134
146
  {
135
- messageId: b(
136
- m,
147
+ messageId: k(
148
+ s,
137
149
  "components.yieldBreakdown.borrowRate",
138
150
  "components.yieldBreakdown.borrowRate7d"
139
151
  )
140
152
  }
141
153
  ),
142
- value: p === null ? v : r(-p),
143
- subtext: i && a && R !== void 0 ? /* @__PURE__ */ t(
144
- s,
154
+ value: m === null ? /* @__PURE__ */ o(b, { reason: s }) : i(-m),
155
+ subtext: p && a && R !== void 0 ? /* @__PURE__ */ o(
156
+ r,
145
157
  {
146
158
  messageId: "components.strategyApyBreakdownCard.borrowFormula",
147
159
  values: {
148
- leverage: d(o),
160
+ leverage: d(t),
149
161
  // What the position is charged per unit of itself: base
150
162
  // interest plus the quota, added before either is rounded, so
151
163
  // the caption is not the sum of two figures it also printed.
152
- totalRate: r(a.borrowApy + R),
164
+ totalRate: i(a.borrowApy + R),
153
165
  // Magnitudes, not signed rates: the row above already carries
154
166
  // the minus, and `− −0.88%` reads as arithmetic to decode
155
167
  // rather than a cost to understand.
156
- borrowRate: r(a.borrowApy)
168
+ borrowRate: i(a.borrowApy)
157
169
  }
158
170
  }
159
171
  ) : void 0
160
172
  }
161
173
  ),
162
174
  B.length > 0 ? /* @__PURE__ */ A(C, { children: [
163
- /* @__PURE__ */ t(q, {}),
164
- B.map((e) => /* @__PURE__ */ t(
165
- w,
175
+ /* @__PURE__ */ o(q, {}),
176
+ B.map((e) => /* @__PURE__ */ o(
177
+ v,
166
178
  {
167
179
  valueTestId: n.points,
168
180
  captionTestId: n.caption,
169
181
  label: /* @__PURE__ */ A("span", { className: "inline-flex items-center gap-1.5", children: [
170
- /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(
171
- s,
182
+ /* @__PURE__ */ o("span", { children: /* @__PURE__ */ o(
183
+ r,
172
184
  {
173
185
  messageId: "components.yieldBreakdown.programPoints",
174
186
  values: { name: e.name }
175
187
  }
176
188
  ) }),
177
- /* @__PURE__ */ t(
178
- O,
189
+ /* @__PURE__ */ o(
190
+ $,
179
191
  {
180
192
  reward: { name: e.name, type: e.id },
181
193
  size: 16,
@@ -183,13 +195,13 @@ function J({
183
195
  }
184
196
  )
185
197
  ] }),
186
- value: e.multiplier != null ? `${d(e.multiplier * o)}×` : v,
187
- subtext: i && e.multiplier != null ? /* @__PURE__ */ t(
188
- s,
198
+ value: e.multiplier != null ? `${d(e.multiplier * t)}×` : O,
199
+ subtext: p && e.multiplier != null ? /* @__PURE__ */ o(
200
+ r,
189
201
  {
190
202
  messageId: "components.strategyApyBreakdownCard.formula",
191
203
  values: {
192
- leverage: d(o),
204
+ leverage: d(t),
193
205
  base: d(e.multiplier)
194
206
  }
195
207
  }
@@ -203,6 +215,6 @@ function J({
203
215
  );
204
216
  }
205
217
  export {
206
- J as StrategyApyBreakdownCard,
218
+ so as StrategyApyBreakdownCard,
207
219
  n as StrategyApyBreakdownCardTest
208
220
  };