@burdenoff/microfe-billing 2026.1113.2 → 2026.1113.4

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 (118) hide show
  1. package/dist/billing/BillingRoot.js +83 -77
  2. package/dist/billing/BillingRoot.js.map +1 -1
  3. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js +78 -78
  4. package/dist/billing/modules/addons/pages/AddonCreatePage.js +70 -70
  5. package/dist/billing/modules/addons/pages/AddonDetailPage.js +72 -72
  6. package/dist/billing/modules/addons/pages/AddonEditPage.js +79 -79
  7. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +224 -224
  8. package/dist/billing/modules/addons/pages/AddonsListPage.js +186 -186
  9. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +168 -168
  10. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
  11. package/dist/billing/modules/analytics/pages/AnalyticsPage.js +88 -88
  12. package/dist/billing/modules/billing/hooks/index.js +5 -5
  13. package/dist/billing/modules/billing/hooks/useInvoices.js +39 -20
  14. package/dist/billing/modules/billing/hooks/useInvoices.js.map +1 -1
  15. package/dist/billing/modules/billing/index.js +14 -14
  16. package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.js +92 -92
  17. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +160 -160
  18. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -1
  19. package/dist/billing/modules/billing/pages/InvoicesListPage.js +100 -100
  20. package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.js +105 -105
  21. package/dist/billing/modules/billing/pages/PaymentMethodsPage.js +37 -37
  22. package/dist/billing/modules/billing/pages/RefundIssueLogsPage.js +41 -41
  23. package/dist/billing/modules/billing/pages/RefundsPage.js +334 -334
  24. package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
  25. package/dist/billing/modules/billing/pages/TransactionsPage.js +174 -174
  26. package/dist/billing/modules/billing/pages/TransactionsPage.js.map +1 -1
  27. package/dist/billing/modules/billing/pages/UserRefundsPage.js +24 -24
  28. package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
  29. package/dist/billing/modules/checkout/components/OrderSummary.js +71 -71
  30. package/dist/billing/modules/checkout/pages/CheckoutPage.js +646 -625
  31. package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
  32. package/dist/billing/modules/checkout/utils/checkoutOptions.d.ts +23 -0
  33. package/dist/billing/modules/checkout/utils/checkoutOptions.js +8 -0
  34. package/dist/billing/modules/checkout/utils/checkoutOptions.js.map +1 -0
  35. package/dist/billing/modules/coupons/pages/CouponDetailPage.js +112 -112
  36. package/dist/billing/modules/coupons/pages/CouponsListPage.js +118 -118
  37. package/dist/billing/modules/coupons/pages/CouponsListPage.js.map +1 -1
  38. package/dist/billing/modules/coupons/pages/CreateCouponPage.js +119 -119
  39. package/dist/billing/modules/coupons/pages/EditCouponPage.js +82 -82
  40. package/dist/billing/modules/credits/pages/AdminCreditsPage.js +30 -30
  41. package/dist/billing/modules/credits/pages/CreditTransactionsPage.js +77 -77
  42. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +187 -164
  43. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
  44. package/dist/billing/modules/credits/pages/CreditsPage.js +67 -67
  45. package/dist/billing/modules/dashboard/pages/OverviewPage.js +594 -442
  46. package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
  47. package/dist/billing/modules/dashboard/utils/overviewSummary.d.ts +46 -0
  48. package/dist/billing/modules/dashboard/utils/overviewSummary.js +37 -0
  49. package/dist/billing/modules/dashboard/utils/overviewSummary.js.map +1 -0
  50. package/dist/billing/modules/discounts/pages/DiscountsListPage.js +199 -199
  51. package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -1
  52. package/dist/billing/modules/earnings/components/PayoutDestinationList.d.ts +15 -0
  53. package/dist/billing/modules/earnings/components/PayoutDestinationList.js +66 -0
  54. package/dist/billing/modules/earnings/components/PayoutDestinationList.js.map +1 -0
  55. package/dist/billing/modules/earnings/components/PayoutErrorNotice.d.ts +7 -0
  56. package/dist/billing/modules/earnings/components/PayoutErrorNotice.js +19 -0
  57. package/dist/billing/modules/earnings/components/PayoutErrorNotice.js.map +1 -0
  58. package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.js +64 -64
  59. package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js +122 -122
  60. package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js.map +1 -1
  61. package/dist/billing/modules/earnings/pages/EarningsPage.js +123 -110
  62. package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
  63. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +178 -178
  64. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
  65. package/dist/billing/modules/earnings/pages/PayoutsPage.js +215 -157
  66. package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
  67. package/dist/billing/modules/earnings/utils/payoutDestination.d.ts +20 -0
  68. package/dist/billing/modules/earnings/utils/payoutDestination.js +27 -0
  69. package/dist/billing/modules/earnings/utils/payoutDestination.js.map +1 -0
  70. package/dist/billing/modules/earnings/utils/plainPayoutError.d.ts +10 -0
  71. package/dist/billing/modules/earnings/utils/plainPayoutError.js +50 -0
  72. package/dist/billing/modules/earnings/utils/plainPayoutError.js.map +1 -0
  73. package/dist/billing/modules/plans/pages/PlanAssignFreePage.js +54 -54
  74. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js +94 -94
  75. package/dist/billing/modules/plans/pages/PlanCreatePage.js +73 -73
  76. package/dist/billing/modules/plans/pages/PlanDetailPage.js +96 -96
  77. package/dist/billing/modules/plans/pages/PlanEditPage.js +16 -16
  78. package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
  79. package/dist/billing/modules/plans/pages/PlansBrowsePage.js +100 -100
  80. package/dist/billing/modules/plans/pages/PlansListPage.js +88 -88
  81. package/dist/billing/modules/promotions/pages/CreatePromotionPage.js +60 -60
  82. package/dist/billing/modules/promotions/pages/PromotionsListPage.js +37 -37
  83. package/dist/billing/modules/quota/pages/QuotaAssignFreePage.js +62 -62
  84. package/dist/billing/modules/quota/pages/QuotaPage.js +1 -1
  85. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +69 -69
  86. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js +76 -76
  87. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +80 -80
  88. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js +95 -95
  89. package/dist/billing/modules/settings/pages/SettingsPage.js +134 -134
  90. package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
  91. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +62 -62
  92. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
  93. package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js +36 -36
  94. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +534 -410
  95. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -1
  96. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +111 -111
  97. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js +166 -160
  98. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js.map +1 -1
  99. package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.d.ts +30 -0
  100. package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.js +20 -0
  101. package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.js.map +1 -0
  102. package/dist/billing/modules/subscriptions/utils/upgradeAccess.d.ts +10 -0
  103. package/dist/billing/modules/subscriptions/utils/upgradeAccess.js +7 -0
  104. package/dist/billing/modules/subscriptions/utils/upgradeAccess.js.map +1 -0
  105. package/dist/billing/modules/usage/pages/UsagePage.js +722 -591
  106. package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
  107. package/dist/billing/modules/usage/utils/usageHealth.d.ts +63 -0
  108. package/dist/billing/modules/usage/utils/usageHealth.js +43 -0
  109. package/dist/billing/modules/usage/utils/usageHealth.js.map +1 -0
  110. package/dist/billing/shared/components/EmptyState.js +3 -3
  111. package/dist/billing/shared/components/MoneyActionDialog.js +12 -12
  112. package/dist/billing/shared/ui/MetricCard.js +13 -13
  113. package/dist/billing/shared/utils/format.js +16 -4
  114. package/dist/billing/shared/utils/format.js.map +1 -1
  115. package/dist/billing/shared/utils/index.js +8 -8
  116. package/dist/generated/global-operations.js +294 -286
  117. package/dist/generated/global-operations.js.map +1 -1
  118. package/package.json +2 -2
@@ -1,31 +1,36 @@
1
1
  import { useBillingPermissions as e } from "../../../hooks/useBillingPermissions.js";
2
- import { AccessDenied as t } from "../../../shared/components/AccessDenied.js";
3
- import { PageHeader as n } from "../../../shared/components/PageHeader.js";
4
- import { ServerError as r } from "../../../shared/components/ServerError.js";
5
- import { MoneyActionDialog as ee } from "../../../shared/components/MoneyActionDialog.js";
6
- import { useIsFluidgridsVariant as te } from "../../../hooks/useBillingVariant.js";
2
+ import { useIsFluidgridsVariant as t } from "../../../hooks/useBillingVariant.js";
3
+ import { AccessDenied as ee } from "../../../shared/components/AccessDenied.js";
4
+ import { PageHeader as te } from "../../../shared/components/PageHeader.js";
5
+ import { ServerError as ne } from "../../../shared/components/ServerError.js";
6
+ import { MoneyActionDialog as re } from "../../../shared/components/MoneyActionDialog.js";
7
7
  import "../../../shared/components/index.js";
8
- import { formatCurrency as i, formatDateTime as a } from "../../../shared/utils/format.js";
9
- import { isServerError as o } from "../../../shared/utils/error.js";
10
- import { useBillingEventEmitter as s } from "../../../hooks/useBillingEventEmitter.js";
11
- import { useBilling as c } from "../../../providers/BillingProvider.js";
8
+ import { useTr as ie } from "../../../shared/hooks/useTr.js";
9
+ import { formatCurrency as n, formatDateTime as r } from "../../../shared/utils/format.js";
10
+ import { isServerError as i } from "../../../shared/utils/error.js";
11
+ import { useBillingEventEmitter as ae } from "../../../hooks/useBillingEventEmitter.js";
12
+ import { useBilling as oe } from "../../../providers/BillingProvider.js";
12
13
  import "../../../shared/utils/index.js";
13
- import { useGetDefaultBillingAccountSettingsQuery as l } from "../../../../generated/global-operations.js";
14
- import { addPayoutAccount as u, archivePayoutAccount as ne, fetchPayoutAccounts as re, fetchPayoutRequests as ie, requestPayout as ae, setDefaultPayoutAccount as oe, updatePayoutAccount as se } from "../api.js";
15
- import { PAYOUT_ACCOUNT_TONE_CLASSES as ce, isPayoutAccountPayable as d, payoutAccountStatusView as f, pickPayableAccountId as le } from "../payoutAccountStatus.js";
16
- import { useCallback as ue, useEffect as de, useMemo as fe, useState as p } from "react";
17
- import { Landmark as pe, RefreshCw as me, Send as he } from "lucide-react";
18
- import { Fragment as ge, jsx as m, jsxs as h } from "react/jsx-runtime";
19
- import { AlertDialog as _e, AlertDialogAction as ve, AlertDialogCancel as ye, AlertDialogContent as be, AlertDialogDescription as g, AlertDialogFooter as xe, AlertDialogHeader as Se, AlertDialogTitle as Ce, IllustratedEmptyState as _, PagePurpose as we, ResponsiveTable as Te } from "@burdenoff/fe-libs/ui";
14
+ import { useGetDefaultBillingAccountSettingsQuery as se } from "../../../../generated/global-operations.js";
15
+ import { addPayoutAccount as ce, archivePayoutAccount as le, fetchPayoutAccounts as ue, fetchPayoutRequests as de, requestPayout as fe, setDefaultPayoutAccount as pe, updatePayoutAccount as me } from "../api.js";
16
+ import { PAYOUT_ACCOUNT_TONE_CLASSES as he, isPayoutAccountPayable as a, payoutAccountStatusView as o, pickPayableAccountId as ge } from "../payoutAccountStatus.js";
17
+ import { PayoutDestinationList as _e } from "../components/PayoutDestinationList.js";
18
+ import { PayoutErrorNotice as s } from "../components/PayoutErrorNotice.js";
19
+ import { toPayoutDestinations as ve } from "../utils/payoutDestination.js";
20
+ import { plainPayoutError as c, rawErrorText as l } from "../utils/plainPayoutError.js";
21
+ import { useCallback as ye, useEffect as be, useMemo as xe, useState as u } from "react";
22
+ import { AlertDialog as Se, AlertDialogAction as Ce, AlertDialogCancel as we, AlertDialogContent as Te, AlertDialogDescription as Ee, AlertDialogFooter as De, AlertDialogHeader as Oe, AlertDialogTitle as ke, IllustratedEmptyState as d, PagePurpose as Ae, ResponsiveTable as je, ShowTechnicalDetails as f } from "@burdenoff/fe-libs/ui";
23
+ import { Landmark as Me, RefreshCw as Ne, Send as Pe } from "lucide-react";
24
+ import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
20
25
  // src/billing/modules/earnings/pages/PayoutsPage.tsx
21
- var Ee = [
26
+ var Fe = [
22
27
  {
23
28
  key: "amount",
24
29
  header: "Amount",
25
30
  priority: "primary",
26
31
  cell: (e) => /* @__PURE__ */ m("span", {
27
32
  className: "tabular-nums",
28
- children: i(e.requestedAmount, e.currency)
33
+ children: n(e.requestedAmount, e.currency)
29
34
  })
30
35
  },
31
36
  {
@@ -46,10 +51,10 @@ var Ee = [
46
51
  {
47
52
  key: "created",
48
53
  header: "Created",
49
- cell: (e) => a(e.createdAt)
54
+ cell: (e) => r(e.createdAt)
50
55
  }
51
- ], v = () => {
52
- let a = e(), v = te(), [De, y] = p(!1), [b, x] = p(!1), [S, C] = p(null), [w, T] = p(null), { emit: E } = s(), { apiGatewayUrl: D, authToken: O, orgId: k } = c(), { data: Oe } = l({}), A = Oe?.getDefaultBillingAccount?.id, [j, ke] = p([]), [M, Ae] = p([]), [N, P] = p(!0), [F, I] = p(null), [L, R] = p({
56
+ ], g = () => {
57
+ let r = e(), g = t(), _ = ie(), [Ie, v] = u(!1), [Le, y] = u(!1), [Re, b] = u(null), [x, S] = u(null), [C, w] = u(null), [T, E] = u(null), { emit: D } = ae(), { apiGatewayUrl: O, authToken: k, orgId: A } = oe(), { data: ze } = se({}), j = ze?.getDefaultBillingAccount?.id, [M, Be] = u([]), [N, Ve] = u([]), [P, F] = u(!0), [I, L] = u(null), [R, z] = u({
53
58
  label: "",
54
59
  type: "BANK_ACCOUNT",
55
60
  providerPreference: "AUTO",
@@ -61,57 +66,74 @@ var Ee = [
61
66
  routingNumber: "",
62
67
  ifsc: "",
63
68
  upiId: ""
64
- }), [z, B] = p(""), [V, H] = p(""), [U, W] = p(null), [G, K] = p(null), [q, J] = p(null), Y = fe(() => ({
65
- apiGatewayUrl: D,
66
- authToken: O,
67
- orgId: k
69
+ }), [B, V] = u(""), [H, U] = u(""), [W, G] = u(null), [He, K] = u(null), [q, J] = u(null), Y = xe(() => ({
70
+ apiGatewayUrl: O,
71
+ authToken: k,
72
+ orgId: A
68
73
  }), [
69
- D,
70
74
  O,
71
- k
72
- ]), X = ue(async () => {
73
- if (A) {
74
- P(!0), I(null);
75
+ k,
76
+ A
77
+ ]), X = ye(async () => {
78
+ if (j) {
79
+ F(!0), L(null);
75
80
  try {
76
- let [e, t] = await Promise.all([re(A, Y), ie(A, Y)]);
77
- ke(e), Ae(t), H((t) => le(e, t));
81
+ let [e, t] = await Promise.all([ue(j, Y), de(j, Y)]);
82
+ Be(e), Ve(t), U((t) => ge(e, t));
78
83
  } catch (e) {
79
- I(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load payout data"));
84
+ L(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load payout data"));
80
85
  } finally {
81
- P(!1);
86
+ F(!1);
82
87
  }
83
88
  }
84
- }, [A, Y]);
85
- if (de(() => {
89
+ }, [j, Y]);
90
+ if (be(() => {
86
91
  X();
87
- }, [X]), !a.canManagePaymentMethods) return /* @__PURE__ */ m(t, { message: "You don't have permission to manage payout accounts." });
88
- if (F && o(F)) return /* @__PURE__ */ m(r, {
89
- title: "Payout data unavailable",
90
- message: F.message,
91
- onRetry: () => void X(),
92
- showRetry: !0
93
- });
94
- let je = async () => {
95
- if (!A) return;
92
+ }, [X]), !r.canManagePaymentMethods) return /* @__PURE__ */ m(ee, { message: "You don't have permission to manage payout accounts." });
93
+ if (I && i(I)) {
94
+ let e = /* @__PURE__ */ m(ne, {
95
+ title: "Payout data unavailable",
96
+ message: g ? c(I, _) : I.message,
97
+ onRetry: () => void X(),
98
+ showRetry: !0
99
+ });
100
+ return g ? /* @__PURE__ */ h(p, { children: [e, /* @__PURE__ */ m("div", {
101
+ className: "px-6",
102
+ children: /* @__PURE__ */ m(f, {
103
+ copyable: !0,
104
+ children: l(I)
105
+ })
106
+ })] }) : e;
107
+ }
108
+ let Z = async (e) => {
109
+ if (!g) return e();
110
+ w(null);
111
+ try {
112
+ await e();
113
+ } catch (e) {
114
+ w(e);
115
+ }
116
+ }, Ue = async () => {
117
+ if (!j) return;
96
118
  J(null);
97
119
  let e = {
98
- billingAccountId: A,
99
- ...L
120
+ billingAccountId: j,
121
+ ...R
100
122
  };
101
- if (U) await se(U, e, Y), E("billing.payout_account.updated", {
123
+ if (W) await me(W, e, Y), D("billing.payout_account.updated", {
102
124
  route: "/billing/payouts",
103
- entityId: U,
125
+ entityId: W,
104
126
  source: "payouts"
105
127
  });
106
128
  else {
107
- let t = await u(e, Y);
108
- E("billing.payout_account.added", {
129
+ let t = await ce(e, Y);
130
+ D("billing.payout_account.added", {
109
131
  route: "/billing/payouts",
110
- entityId: A,
132
+ entityId: j,
111
133
  source: "payouts"
112
134
  }), J(t.status === "ACTIVE" ? "Payout account saved and ready to receive payouts." : "Payout account saved. It stays pending until the payout processor verifies it; you can request payouts to it once it is verified.");
113
135
  }
114
- R({
136
+ z({
115
137
  label: "",
116
138
  type: "BANK_ACCOUNT",
117
139
  providerPreference: "AUTO",
@@ -123,17 +145,17 @@ var Ee = [
123
145
  routingNumber: "",
124
146
  ifsc: "",
125
147
  upiId: ""
126
- }), W(null), await X();
127
- }, Me = async (e) => {
128
- J(null), await oe(e, Y), await X();
129
- }, Ne = async (e) => {
130
- J(null), await ne(e, Y), E("billing.payout_account.archived", {
148
+ }), G(null), await X();
149
+ }, We = async (e) => {
150
+ J(null), await pe(e, Y), await X();
151
+ }, Ge = async (e) => {
152
+ J(null), await le(e, Y), D("billing.payout_account.archived", {
131
153
  route: "/billing/payouts",
132
154
  entityId: e,
133
155
  source: "payouts"
134
156
  }), await X();
135
- }, Pe = (e) => {
136
- J(null), W(e.id), R((t) => ({
157
+ }, Ke = (e) => {
158
+ J(null), G(e.id), z((t) => ({
137
159
  ...t,
138
160
  label: e.label,
139
161
  type: e.type,
@@ -147,72 +169,83 @@ var Ee = [
147
169
  ifsc: "",
148
170
  upiId: ""
149
171
  }));
150
- }, Z = j.find((e) => e.id === V), Q = j.some(d), $ = async () => {
151
- A && V && z && Z && d(Z) && (await ae({
152
- billingAccountId: A,
153
- payoutAccountId: V,
154
- amount: Number(z),
155
- currency: Z.currency
156
- }, Y), E("billing.payout.requested", {
172
+ }, Q = M.find((e) => e.id === H), qe = M.some(a), $ = async () => {
173
+ j && H && B && Q && a(Q) && (await fe({
174
+ billingAccountId: j,
175
+ payoutAccountId: H,
176
+ amount: Number(B),
177
+ currency: Q.currency
178
+ }, Y), D("billing.payout.requested", {
157
179
  route: "/billing/payouts",
158
- entityId: V,
180
+ entityId: H,
159
181
  source: "payouts",
160
- amount: Number(z),
161
- currency: Z.currency
162
- }), B(""), await X());
163
- }, Fe = async () => {
164
- x(!0), C(null);
182
+ amount: Number(B),
183
+ currency: Q.currency
184
+ }), V(""), await X());
185
+ }, Je = async () => {
186
+ y(!0), b(null), S(null);
165
187
  try {
166
- await $(), y(!1), T({
188
+ await $(), v(!1), E({
167
189
  ok: !0,
168
- message: `Payout of ${i(Number(z), Z?.currency ?? "")} requested. We'll show its status below.`
190
+ message: `Payout of ${n(Number(B), Q?.currency ?? "")} requested. We'll show its status below.`
169
191
  });
170
192
  } catch (e) {
171
- C(e instanceof Error ? e.message : "The payout request failed.");
193
+ S(e), b(c(e, _));
172
194
  } finally {
173
- x(!1);
195
+ y(!1);
174
196
  }
175
197
  };
176
198
  return /* @__PURE__ */ h("div", {
177
199
  className: "space-y-6 p-6",
178
200
  children: [
179
- v && /* @__PURE__ */ m(ee, {
180
- open: De,
201
+ g && /* @__PURE__ */ m(re, {
202
+ open: Ie,
181
203
  title: "Review your payout",
182
204
  description: "The amount is moved out of your available balance when you confirm.",
183
- details: [{
184
- label: "Amount",
185
- value: i(Number(z), Z?.currency ?? "")
186
- }, {
187
- label: "Paid to",
188
- value: Z ? `${Z.label} · ${Z.currency}` : ""
189
- }],
205
+ details: [
206
+ {
207
+ label: "Amount",
208
+ value: n(Number(B), Q?.currency ?? "")
209
+ },
210
+ {
211
+ label: "Paid to",
212
+ value: Q ? `${Q.label} · ${Q.currency}` : ""
213
+ },
214
+ ...x && l(x) ? [{
215
+ label: _("billing.payoutError.technical", "Technical details"),
216
+ value: /* @__PURE__ */ m(f, {
217
+ copyable: !0,
218
+ children: l(x)
219
+ })
220
+ }] : []
221
+ ],
190
222
  confirmLabel: "Request payout",
191
223
  busyLabel: "Requesting…",
192
- isBusy: b,
193
- error: S,
194
- onConfirm: () => void Fe(),
195
- onCancel: () => y(!1)
224
+ isBusy: Le,
225
+ error: Re,
226
+ onConfirm: () => void Je(),
227
+ onCancel: () => v(!1)
196
228
  }),
197
- v && w && /* @__PURE__ */ m("div", {
198
- role: w.ok ? "status" : "alert",
199
- className: `rounded-md border p-3 text-sm ${w.ok ? "border-status-success-border text-status-success-text" : "border-status-error-border text-status-error-text"}`,
200
- children: w.message
229
+ g && T && /* @__PURE__ */ m("div", {
230
+ role: T.ok ? "status" : "alert",
231
+ className: `rounded-md border p-3 text-sm ${T.ok ? "border-status-success-border text-status-success-text" : "border-status-error-border text-status-error-text"}`,
232
+ children: T.message
201
233
  }),
202
- /* @__PURE__ */ m(n, {
234
+ /* @__PURE__ */ m(te, {
203
235
  title: "Payouts",
204
236
  description: "Register payout accounts, request withdrawals, and track disbursement status."
205
237
  }),
206
- /* @__PURE__ */ m(we, { children: "Get your earnings paid out to a real bank account or UPI. Register where you want to be paid, request a withdrawal of your available balance, and track each request from submission through to disbursement here." }),
238
+ /* @__PURE__ */ m(Ae, { children: "Get your earnings paid out to a real bank account or UPI. Register where you want to be paid, request a withdrawal of your available balance, and track each request from submission through to disbursement here." }),
207
239
  q ? /* @__PURE__ */ m("div", {
208
240
  role: "status",
209
241
  className: "rounded-lg border border-border-subtle bg-status-info-bg-subtle p-4 text-sm text-status-info-text",
210
242
  children: q
211
243
  }) : null,
212
- F && !o(F) ? /* @__PURE__ */ m("div", {
244
+ I && !i(I) ? g ? /* @__PURE__ */ m(s, { error: I }) : /* @__PURE__ */ m("div", {
213
245
  className: "rounded-lg border border-border-subtle bg-bg-surface p-4 text-sm text-status-error-text",
214
- children: F.message
246
+ children: I.message
215
247
  }) : null,
248
+ g && C ? /* @__PURE__ */ m(s, { error: C }) : null,
216
249
  /* @__PURE__ */ h("div", {
217
250
  className: "grid gap-6 xl:grid-cols-[1.05fr,1.95fr]",
218
251
  children: [/* @__PURE__ */ h("section", {
@@ -220,14 +253,14 @@ var Ee = [
220
253
  children: [
221
254
  /* @__PURE__ */ m("h2", {
222
255
  className: "mb-4 text-lg font-semibold text-text-primary",
223
- children: U ? "Edit payout account" : "Add payout account"
256
+ children: W ? "Edit payout account" : "Add payout account"
224
257
  }),
225
258
  /* @__PURE__ */ h("div", {
226
259
  className: "space-y-3",
227
260
  children: [
228
261
  /* @__PURE__ */ m("input", {
229
- value: L.label,
230
- onChange: (e) => R((t) => ({
262
+ value: R.label,
263
+ onChange: (e) => z((t) => ({
231
264
  ...t,
232
265
  label: e.target.value
233
266
  })),
@@ -237,8 +270,8 @@ var Ee = [
237
270
  /* @__PURE__ */ h("div", {
238
271
  className: "grid gap-3 md:grid-cols-2",
239
272
  children: [/* @__PURE__ */ h("select", {
240
- value: L.type,
241
- onChange: (e) => R((t) => ({
273
+ value: R.type,
274
+ onChange: (e) => z((t) => ({
242
275
  ...t,
243
276
  type: e.target.value
244
277
  })),
@@ -258,8 +291,8 @@ var Ee = [
258
291
  })
259
292
  ]
260
293
  }), /* @__PURE__ */ h("select", {
261
- value: L.providerPreference,
262
- onChange: (e) => R((t) => ({
294
+ value: R.providerPreference,
295
+ onChange: (e) => z((t) => ({
263
296
  ...t,
264
297
  providerPreference: e.target.value
265
298
  })),
@@ -287,16 +320,16 @@ var Ee = [
287
320
  /* @__PURE__ */ h("div", {
288
321
  className: "grid gap-3 md:grid-cols-2",
289
322
  children: [/* @__PURE__ */ m("input", {
290
- value: L.country,
291
- onChange: (e) => R((t) => ({
323
+ value: R.country,
324
+ onChange: (e) => z((t) => ({
292
325
  ...t,
293
326
  country: e.target.value.toUpperCase()
294
327
  })),
295
328
  placeholder: "Country",
296
329
  className: "rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
297
330
  }), /* @__PURE__ */ m("input", {
298
- value: L.currency,
299
- onChange: (e) => R((t) => ({
331
+ value: R.currency,
332
+ onChange: (e) => z((t) => ({
300
333
  ...t,
301
334
  currency: e.target.value.toUpperCase()
302
335
  })),
@@ -305,18 +338,18 @@ var Ee = [
305
338
  })]
306
339
  }),
307
340
  /* @__PURE__ */ m("input", {
308
- value: L.accountHolderName,
309
- onChange: (e) => R((t) => ({
341
+ value: R.accountHolderName,
342
+ onChange: (e) => z((t) => ({
310
343
  ...t,
311
344
  accountHolderName: e.target.value
312
345
  })),
313
346
  placeholder: "Account holder name",
314
347
  className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
315
348
  }),
316
- L.type === "BANK_ACCOUNT" ? /* @__PURE__ */ h(ge, { children: [
349
+ R.type === "BANK_ACCOUNT" ? /* @__PURE__ */ h(p, { children: [
317
350
  /* @__PURE__ */ m("input", {
318
- value: L.bankName,
319
- onChange: (e) => R((t) => ({
351
+ value: R.bankName,
352
+ onChange: (e) => z((t) => ({
320
353
  ...t,
321
354
  bankName: e.target.value
322
355
  })),
@@ -324,8 +357,8 @@ var Ee = [
324
357
  className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
325
358
  }),
326
359
  /* @__PURE__ */ m("input", {
327
- value: L.accountNumber,
328
- onChange: (e) => R((t) => ({
360
+ value: R.accountNumber,
361
+ onChange: (e) => z((t) => ({
329
362
  ...t,
330
363
  accountNumber: e.target.value
331
364
  })),
@@ -333,20 +366,20 @@ var Ee = [
333
366
  className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
334
367
  }),
335
368
  /* @__PURE__ */ m("input", {
336
- value: L.country === "IN" ? L.ifsc : L.routingNumber,
337
- onChange: (e) => R((t) => t.country === "IN" ? {
369
+ value: R.country === "IN" ? R.ifsc : R.routingNumber,
370
+ onChange: (e) => z((t) => t.country === "IN" ? {
338
371
  ...t,
339
372
  ifsc: e.target.value
340
373
  } : {
341
374
  ...t,
342
375
  routingNumber: e.target.value
343
376
  }),
344
- placeholder: L.country === "IN" ? "IFSC" : "Routing number",
377
+ placeholder: R.country === "IN" ? "IFSC" : "Routing number",
345
378
  className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
346
379
  })
347
- ] }) : L.type === "UPI" ? /* @__PURE__ */ m("input", {
348
- value: L.upiId,
349
- onChange: (e) => R((t) => ({
380
+ ] }) : R.type === "UPI" ? /* @__PURE__ */ m("input", {
381
+ value: R.upiId,
382
+ onChange: (e) => z((t) => ({
350
383
  ...t,
351
384
  upiId: e.target.value
352
385
  })),
@@ -357,14 +390,14 @@ var Ee = [
357
390
  }),
358
391
  /* @__PURE__ */ h("button", {
359
392
  type: "button",
360
- onClick: () => void je(),
393
+ onClick: () => void Z(Ue),
361
394
  className: "mt-4 inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text",
362
- children: [/* @__PURE__ */ m(pe, { className: "size-4" }), U ? "Update payout account" : "Save payout account"]
395
+ children: [/* @__PURE__ */ m(Me, { className: "size-4" }), W ? "Update payout account" : "Save payout account"]
363
396
  }),
364
- U ? /* @__PURE__ */ m("button", {
397
+ W ? /* @__PURE__ */ m("button", {
365
398
  type: "button",
366
399
  onClick: () => {
367
- W(null), R({
400
+ G(null), z({
368
401
  label: "",
369
402
  type: "BANK_ACCOUNT",
370
403
  providerPreference: "AUTO",
@@ -396,10 +429,10 @@ var Ee = [
396
429
  type: "button",
397
430
  onClick: () => void X(),
398
431
  className: "inline-flex items-center gap-2 rounded-md border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary",
399
- children: [/* @__PURE__ */ m(me, { className: "size-4" }), "Refresh"]
432
+ children: [/* @__PURE__ */ m(Ne, { className: "size-4" }), "Refresh"]
400
433
  })]
401
434
  }),
402
- j.length === 0 && !N ? /* @__PURE__ */ m(_, {
435
+ M.length === 0 && !P ? /* @__PURE__ */ m(d, {
403
436
  illustration: "empty-generic",
404
437
  title: "No payout accounts yet",
405
438
  description: "Add a payout account before requesting a withdrawal."
@@ -407,34 +440,34 @@ var Ee = [
407
440
  className: "space-y-3",
408
441
  children: [
409
442
  /* @__PURE__ */ h("select", {
410
- value: V,
411
- onChange: (e) => H(e.target.value),
443
+ value: H,
444
+ onChange: (e) => U(e.target.value),
412
445
  className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
413
- children: [Q ? null : /* @__PURE__ */ m("option", {
446
+ children: [qe ? null : /* @__PURE__ */ m("option", {
414
447
  value: "",
415
448
  children: "No verified payout account yet"
416
- }), j.map((e) => /* @__PURE__ */ h("option", {
449
+ }), M.map((e) => /* @__PURE__ */ h("option", {
417
450
  value: e.id,
418
- disabled: !d(e),
451
+ disabled: !a(e),
419
452
  children: [
420
453
  e.label,
421
454
  " · ",
422
455
  e.currency,
423
456
  " ·",
424
457
  " ",
425
- f(e.status).label
458
+ o(e.status).label
426
459
  ]
427
460
  }, e.id))]
428
461
  }),
429
- Q ? null : /* @__PURE__ */ m("p", {
462
+ qe ? null : /* @__PURE__ */ m("p", {
430
463
  className: "text-sm text-text-secondary",
431
464
  children: "Payouts can be requested once one of your payout accounts is verified."
432
465
  }),
433
466
  /* @__PURE__ */ h("label", {
434
467
  className: "block space-y-1 text-sm font-medium text-text-primary",
435
468
  children: [/* @__PURE__ */ m("span", { children: "Amount" }), /* @__PURE__ */ m("input", {
436
- value: z,
437
- onChange: (e) => B(e.target.value),
469
+ value: B,
470
+ onChange: (e) => V(e.target.value),
438
471
  inputMode: "decimal",
439
472
  placeholder: "0.00",
440
473
  className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm font-normal text-text-primary"
@@ -443,21 +476,46 @@ var Ee = [
443
476
  /* @__PURE__ */ h("button", {
444
477
  type: "button",
445
478
  onClick: () => {
446
- v ? (C(null), T(null), y(!0)) : $();
479
+ g ? (b(null), S(null), E(null), v(!0)) : $();
447
480
  },
448
- disabled: !Z || !d(Z),
481
+ disabled: !Q || !a(Q),
449
482
  className: "inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text disabled:cursor-not-allowed disabled:opacity-50",
450
- children: [/* @__PURE__ */ m(he, { className: "size-4" }), "Request payout"]
483
+ children: [/* @__PURE__ */ m(Pe, { className: "size-4" }), "Request payout"]
451
484
  })
452
485
  ]
453
486
  }),
454
- j.length > 0 ? /* @__PURE__ */ h("div", {
487
+ M.length > 0 ? /* @__PURE__ */ h("div", {
455
488
  className: "mt-4 space-y-3 rounded-md border border-border-subtle bg-bg-surface/60 p-3",
456
489
  children: [/* @__PURE__ */ m("h3", {
457
490
  className: "text-sm font-semibold text-text-primary",
458
491
  children: "Saved payout accounts"
459
- }), j.map((e) => {
460
- let t = f(e.status);
492
+ }), g ? /* @__PURE__ */ m(_e, {
493
+ destinations: ve(M),
494
+ renderActions: (e) => {
495
+ let t = M.find((t) => t.id === e.id);
496
+ return t ? /* @__PURE__ */ h(p, { children: [
497
+ /* @__PURE__ */ m("button", {
498
+ type: "button",
499
+ onClick: () => Ke(t),
500
+ className: "rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary",
501
+ children: _("billing.payouts.edit", "Edit")
502
+ }),
503
+ t.isDefault ? null : /* @__PURE__ */ m("button", {
504
+ type: "button",
505
+ onClick: () => void Z(() => We(t.id)),
506
+ className: "rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary",
507
+ children: _("billing.payouts.makeDefault", "Make default")
508
+ }),
509
+ /* @__PURE__ */ m("button", {
510
+ type: "button",
511
+ onClick: () => K(t.id),
512
+ className: "rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-status-error-text",
513
+ children: _("billing.payouts.archive", "Archive")
514
+ })
515
+ ] }) : null;
516
+ }
517
+ }) : /* @__PURE__ */ m(p, { children: M.map((e) => {
518
+ let t = o(e.status);
461
519
  return /* @__PURE__ */ h("div", {
462
520
  className: "flex flex-wrap items-center justify-between gap-3 rounded-md border border-border-subtle/70 bg-bg-surface px-3 py-2 text-sm",
463
521
  children: [/* @__PURE__ */ h("div", { children: [
@@ -468,7 +526,7 @@ var Ee = [
468
526
  " ",
469
527
  e.isDefault ? "• Default" : "",
470
528
  /* @__PURE__ */ m("span", {
471
- className: `inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${ce[t.tone]}`,
529
+ className: `inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${he[t.tone]}`,
472
530
  children: t.label
473
531
  })
474
532
  ]
@@ -490,13 +548,13 @@ var Ee = [
490
548
  children: [
491
549
  /* @__PURE__ */ m("button", {
492
550
  type: "button",
493
- onClick: () => Pe(e),
551
+ onClick: () => Ke(e),
494
552
  className: "rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary",
495
553
  children: "Edit"
496
554
  }),
497
555
  e.isDefault ? null : /* @__PURE__ */ m("button", {
498
556
  type: "button",
499
- onClick: () => void Me(e.id),
557
+ onClick: () => void Z(() => We(e.id)),
500
558
  className: "rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary",
501
559
  children: "Make default"
502
560
  }),
@@ -509,7 +567,7 @@ var Ee = [
509
567
  ]
510
568
  })]
511
569
  }, e.id);
512
- })]
570
+ }) })]
513
571
  }) : null
514
572
  ]
515
573
  }), /* @__PURE__ */ h("div", {
@@ -517,27 +575,27 @@ var Ee = [
517
575
  children: [/* @__PURE__ */ m("h2", {
518
576
  className: "mb-4 text-lg font-semibold text-text-primary",
519
577
  children: "Payout requests"
520
- }), M.length === 0 && !N ? /* @__PURE__ */ m(_, {
578
+ }), N.length === 0 && !P ? /* @__PURE__ */ m(d, {
521
579
  illustration: "empty-data",
522
580
  title: "No payout requests yet",
523
581
  description: "Your payout requests and processing updates will appear here."
524
- }) : /* @__PURE__ */ m(Te, {
525
- data: M,
582
+ }) : /* @__PURE__ */ m(je, {
583
+ data: N,
526
584
  rowKey: (e) => e.id,
527
- columns: Ee
585
+ columns: Fe
528
586
  })]
529
587
  })]
530
588
  })]
531
589
  }),
532
- /* @__PURE__ */ m(_e, {
533
- open: G !== null,
590
+ /* @__PURE__ */ m(Se, {
591
+ open: He !== null,
534
592
  onOpenChange: (e) => {
535
593
  e || K(null);
536
594
  },
537
- children: /* @__PURE__ */ h(be, { children: [/* @__PURE__ */ h(Se, { children: [/* @__PURE__ */ m(Ce, { children: "Archive payout account?" }), /* @__PURE__ */ m(g, { children: "Archive this payout account? You can add a new one at any time." })] }), /* @__PURE__ */ h(xe, { children: [/* @__PURE__ */ m(ye, { children: "Cancel" }), /* @__PURE__ */ m(ve, {
595
+ children: /* @__PURE__ */ h(Te, { children: [/* @__PURE__ */ h(Oe, { children: [/* @__PURE__ */ m(ke, { children: "Archive payout account?" }), /* @__PURE__ */ m(Ee, { children: "Archive this payout account? You can add a new one at any time." })] }), /* @__PURE__ */ h(De, { children: [/* @__PURE__ */ m(we, { children: "Cancel" }), /* @__PURE__ */ m(Ce, {
538
596
  onClick: () => {
539
- let e = G;
540
- K(null), e && Ne(e);
597
+ let e = He;
598
+ K(null), e && Z(() => Ge(e));
541
599
  },
542
600
  children: "Archive"
543
601
  })] })] })
@@ -545,6 +603,6 @@ var Ee = [
545
603
  ]
546
604
  });
547
605
  };
548
- export { v as PayoutsPage };
606
+ export { g as PayoutsPage };
549
607
 
550
608
  //# sourceMappingURL=PayoutsPage.js.map