@burdenoff/microfe-billing 2026.516.1 → 2026.517.1
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.
- package/dist/billing/BillingUserRoutes.js +1 -1
- package/dist/billing/BillingUserRoutes.js.map +1 -1
- package/dist/billing/modules/billing/hooks/useInvoices.d.ts +0 -1
- package/dist/billing/modules/billing/hooks/useInvoices.d.ts.map +1 -1
- package/dist/billing/modules/billing/hooks/useInvoices.js +20 -26
- package/dist/billing/modules/billing/hooks/useInvoices.js.map +1 -1
- package/dist/billing/modules/billing/pages/InvoicesListPage.d.ts.map +1 -1
- package/dist/billing/modules/billing/pages/InvoicesListPage.js +176 -170
- package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/RefundsPage.js +1 -1
- package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
- package/dist/billing/modules/checkout/components/OrderSummary.js +4 -4
- package/dist/billing/modules/checkout/components/OrderSummary.js.map +1 -1
- package/dist/billing/modules/checkout/pages/CheckoutPage.d.ts.map +1 -1
- package/dist/billing/modules/checkout/pages/CheckoutPage.js +2 -2
- package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.d.ts.map +1 -1
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +178 -209
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
- package/dist/billing/modules/dashboard/pages/OverviewPage.js +2 -2
- package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
- package/dist/billing/modules/discounts/pages/DiscountsListPage.js +2 -2
- package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -1
- package/dist/billing/modules/earnings/api.d.ts +0 -4
- package/dist/billing/modules/earnings/api.d.ts.map +1 -1
- package/dist/billing/modules/earnings/api.js +10 -14
- package/dist/billing/modules/earnings/api.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.d.ts.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +233 -523
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaPage.js +1 -1
- package/dist/billing/modules/quota/pages/QuotaPage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.d.ts.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +44 -101
- package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.d.ts.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +46 -105
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/hooks/useSubscriptions.d.ts +1 -1
- package/dist/billing/modules/subscriptions/hooks/useSubscriptions.d.ts.map +1 -1
- package/dist/billing/modules/subscriptions/hooks/useSubscriptions.js +15 -16
- package/dist/billing/modules/subscriptions/hooks/useSubscriptions.js.map +1 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.d.ts.map +1 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +165 -158
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js.map +1 -1
- package/dist/billing/modules/usage/pages/UsagePage.d.ts.map +1 -1
- package/dist/billing/modules/usage/pages/UsagePage.js +3 -3
- package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
- package/dist/billing/shared/types/graphql.d.ts +0 -2
- package/dist/billing/shared/types/graphql.d.ts.map +1 -1
- package/dist/billing/shared/types/graphql.js.map +1 -1
- package/dist/generated/global-operations.d.ts +0 -48
- package/dist/generated/global-operations.d.ts.map +1 -1
- package/dist/generated/global-operations.js +293 -310
- package/dist/generated/global-operations.js.map +1 -1
- package/dist/generated/global-types.d.ts +0 -9
- package/dist/generated/global-types.d.ts.map +1 -1
- package/dist/generated/global-types.js.map +1 -1
- package/package.json +1 -1
|
@@ -7,60 +7,67 @@ import { useBillingNavigate as l } from "../../../hooks/useBillingNavigate.js";
|
|
|
7
7
|
import { withBillingAccountId as u } from "../../../shared/utils/navigation.js";
|
|
8
8
|
import { useBillingAccounts as d, usePaginatedSubscriptions as f } from "../hooks/useSubscriptions.js";
|
|
9
9
|
import "../hooks/index.js";
|
|
10
|
-
import {
|
|
11
|
-
import { Fragment as
|
|
12
|
-
import { useI18n as
|
|
10
|
+
import { useState as p } from "react";
|
|
11
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
12
|
+
import { useI18n as _ } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
13
13
|
//#region src/billing/modules/subscriptions/pages/SubscriptionsListPage.tsx
|
|
14
|
-
var
|
|
15
|
-
let { t: n } =
|
|
14
|
+
var v = ["expired", "upgraded"], y = 10, b = () => {
|
|
15
|
+
let { t: n } = _(), r = (e, t) => {
|
|
16
16
|
let r = n(e);
|
|
17
17
|
return r === e ? t : r;
|
|
18
|
-
}, i = l(), a = c(), { orgId: o } = e(), { billingAccounts: s, isLoading:
|
|
18
|
+
}, i = l(), a = c(), { orgId: o } = e(), { billingAccounts: s, isLoading: b } = d(), { selectedAccountId: S, setSelectedAccountId: C } = t({
|
|
19
19
|
orgId: o,
|
|
20
20
|
billingAccounts: s,
|
|
21
21
|
syncFromUrl: !0,
|
|
22
22
|
urlParamName: "billingAccountId"
|
|
23
|
-
}), [
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
23
|
+
}), [w, T] = p(!1), [E, D] = p("all"), [O, k] = p(""), [A, j] = p(1), { subscriptions: M, activeSubscriptions: N, totalCount: P, totalPages: F, isLoading: I, error: L, refetch: R } = f(S ?? void 0, A, y), z = s.find((e) => e.id === S), B = (e) => {
|
|
24
|
+
C(e.id), T(!1), j(1);
|
|
25
|
+
}, V = (e) => {
|
|
26
|
+
j(e);
|
|
27
|
+
}, H = M.filter((e) => {
|
|
28
|
+
if (E !== "all") {
|
|
29
|
+
if (E === "inactive") {
|
|
30
|
+
if (!v.includes(e.status)) return !1;
|
|
31
|
+
} else if (e.status !== E) return !1;
|
|
32
|
+
}
|
|
33
|
+
if (O) {
|
|
34
|
+
let t = O.toLowerCase();
|
|
35
|
+
return (e.plan?.name?.toLowerCase() || "").includes(t) || e.id.toLowerCase().includes(t);
|
|
36
|
+
}
|
|
37
|
+
return !0;
|
|
38
|
+
}), U = b || I;
|
|
39
|
+
return a.canViewSubscriptions ? U && !z ? /* @__PURE__ */ g("div", {
|
|
33
40
|
className: "space-y-6 p-6",
|
|
34
|
-
children: [/* @__PURE__ */
|
|
41
|
+
children: [/* @__PURE__ */ h("div", { className: "h-8 w-48 bg-muted animate-pulse rounded" }), /* @__PURE__ */ h("div", {
|
|
35
42
|
className: "space-y-4",
|
|
36
43
|
children: [
|
|
37
44
|
1,
|
|
38
45
|
2,
|
|
39
46
|
3
|
|
40
|
-
].map((e) => /* @__PURE__ */
|
|
47
|
+
].map((e) => /* @__PURE__ */ h("div", {
|
|
41
48
|
className: "border border-border rounded-lg p-6",
|
|
42
|
-
children: /* @__PURE__ */
|
|
49
|
+
children: /* @__PURE__ */ g("div", {
|
|
43
50
|
className: "flex items-center gap-4",
|
|
44
|
-
children: [/* @__PURE__ */
|
|
51
|
+
children: [/* @__PURE__ */ h("div", { className: "h-12 w-12 bg-muted animate-pulse rounded" }), /* @__PURE__ */ g("div", {
|
|
45
52
|
className: "flex-1 space-y-2",
|
|
46
|
-
children: [/* @__PURE__ */
|
|
53
|
+
children: [/* @__PURE__ */ h("div", { className: "h-5 w-32 bg-muted animate-pulse rounded" }), /* @__PURE__ */ h("div", { className: "h-4 w-48 bg-muted animate-pulse rounded" })]
|
|
47
54
|
})]
|
|
48
55
|
})
|
|
49
56
|
}, e))
|
|
50
57
|
})]
|
|
51
|
-
}) :
|
|
58
|
+
}) : L ? /* @__PURE__ */ h("div", {
|
|
52
59
|
className: "flex items-center justify-center h-full min-h-[400px]",
|
|
53
|
-
children: /* @__PURE__ */
|
|
60
|
+
children: /* @__PURE__ */ g("div", {
|
|
54
61
|
className: "text-center space-y-4",
|
|
55
62
|
children: [
|
|
56
|
-
/* @__PURE__ */
|
|
63
|
+
/* @__PURE__ */ h("div", {
|
|
57
64
|
className: "w-12 h-12 mx-auto rounded-full bg-destructive/10 flex items-center justify-center",
|
|
58
|
-
children: /* @__PURE__ */
|
|
65
|
+
children: /* @__PURE__ */ h("svg", {
|
|
59
66
|
className: "w-6 h-6 text-destructive",
|
|
60
67
|
fill: "none",
|
|
61
68
|
viewBox: "0 0 24 24",
|
|
62
69
|
stroke: "currentColor",
|
|
63
|
-
children: /* @__PURE__ */
|
|
70
|
+
children: /* @__PURE__ */ h("path", {
|
|
64
71
|
strokeLinecap: "round",
|
|
65
72
|
strokeLinejoin: "round",
|
|
66
73
|
strokeWidth: 2,
|
|
@@ -68,41 +75,41 @@ var b = ["expired", "upgraded"], x = 10, S = () => {
|
|
|
68
75
|
})
|
|
69
76
|
})
|
|
70
77
|
}),
|
|
71
|
-
/* @__PURE__ */
|
|
78
|
+
/* @__PURE__ */ h("h2", {
|
|
72
79
|
className: "text-lg font-semibold text-foreground",
|
|
73
80
|
children: "Failed to load subscriptions"
|
|
74
81
|
}),
|
|
75
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ h("p", {
|
|
76
83
|
className: "text-sm text-muted-foreground",
|
|
77
|
-
children:
|
|
84
|
+
children: L.message
|
|
78
85
|
}),
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
onClick: () =>
|
|
86
|
+
/* @__PURE__ */ h("button", {
|
|
87
|
+
onClick: () => R(),
|
|
81
88
|
className: "px-4 py-2 text-sm font-medium bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors",
|
|
82
89
|
children: "Try Again"
|
|
83
90
|
})
|
|
84
91
|
]
|
|
85
92
|
})
|
|
86
|
-
}) : /* @__PURE__ */
|
|
93
|
+
}) : /* @__PURE__ */ g("div", {
|
|
87
94
|
className: "space-y-6 p-6",
|
|
88
95
|
children: [
|
|
89
|
-
/* @__PURE__ */
|
|
96
|
+
/* @__PURE__ */ g("div", {
|
|
90
97
|
className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
|
|
91
|
-
children: [/* @__PURE__ */
|
|
98
|
+
children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("h1", {
|
|
92
99
|
className: "text-2xl font-bold text-foreground",
|
|
93
100
|
children: r("billing.subscriptions.title", "Subscriptions")
|
|
94
|
-
}), /* @__PURE__ */
|
|
101
|
+
}), /* @__PURE__ */ h("p", {
|
|
95
102
|
className: "text-sm text-muted-foreground mt-1",
|
|
96
103
|
children: r("billing.subscriptions.subtitle", "Manage your active and past subscriptions")
|
|
97
|
-
})] }), a.canCreateSubscription && /* @__PURE__ */
|
|
104
|
+
})] }), a.canCreateSubscription && /* @__PURE__ */ g("button", {
|
|
98
105
|
onClick: () => i("/plans"),
|
|
99
106
|
className: "inline-flex items-center gap-2 px-4 py-2 text-sm font-medium bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors",
|
|
100
|
-
children: [/* @__PURE__ */
|
|
107
|
+
children: [/* @__PURE__ */ h("svg", {
|
|
101
108
|
className: "w-4 h-4",
|
|
102
109
|
fill: "none",
|
|
103
110
|
viewBox: "0 0 24 24",
|
|
104
111
|
stroke: "currentColor",
|
|
105
|
-
children: /* @__PURE__ */
|
|
112
|
+
children: /* @__PURE__ */ h("path", {
|
|
106
113
|
strokeLinecap: "round",
|
|
107
114
|
strokeLinejoin: "round",
|
|
108
115
|
strokeWidth: 2,
|
|
@@ -111,89 +118,89 @@ var b = ["expired", "upgraded"], x = 10, S = () => {
|
|
|
111
118
|
}), "New Subscription"]
|
|
112
119
|
})]
|
|
113
120
|
}),
|
|
114
|
-
s.length > 1 && /* @__PURE__ */
|
|
121
|
+
s.length > 1 && /* @__PURE__ */ g("div", {
|
|
115
122
|
className: "relative",
|
|
116
|
-
children: [/* @__PURE__ */
|
|
117
|
-
onClick: () =>
|
|
123
|
+
children: [/* @__PURE__ */ g("button", {
|
|
124
|
+
onClick: () => T(!w),
|
|
118
125
|
className: "w-full sm:w-auto flex items-center justify-between gap-3 px-4 py-3 border border-border rounded-lg bg-card hover:bg-muted/50 transition-colors",
|
|
119
|
-
children: [/* @__PURE__ */
|
|
126
|
+
children: [/* @__PURE__ */ g("div", {
|
|
120
127
|
className: "flex items-center gap-3",
|
|
121
|
-
children: [/* @__PURE__ */
|
|
128
|
+
children: [/* @__PURE__ */ h("div", {
|
|
122
129
|
className: "w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center",
|
|
123
|
-
children: /* @__PURE__ */
|
|
130
|
+
children: /* @__PURE__ */ h("svg", {
|
|
124
131
|
className: "w-4 h-4 text-primary",
|
|
125
132
|
fill: "none",
|
|
126
133
|
viewBox: "0 0 24 24",
|
|
127
134
|
stroke: "currentColor",
|
|
128
|
-
children: /* @__PURE__ */
|
|
135
|
+
children: /* @__PURE__ */ h("path", {
|
|
129
136
|
strokeLinecap: "round",
|
|
130
137
|
strokeLinejoin: "round",
|
|
131
138
|
strokeWidth: 2,
|
|
132
139
|
d: "M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"
|
|
133
140
|
})
|
|
134
141
|
})
|
|
135
|
-
}), /* @__PURE__ */
|
|
142
|
+
}), /* @__PURE__ */ g("div", {
|
|
136
143
|
className: "text-left",
|
|
137
|
-
children: [/* @__PURE__ */
|
|
144
|
+
children: [/* @__PURE__ */ h("p", {
|
|
138
145
|
className: "text-sm font-medium text-foreground",
|
|
139
|
-
children:
|
|
140
|
-
}), /* @__PURE__ */
|
|
146
|
+
children: z?.name || "Select Account"
|
|
147
|
+
}), /* @__PURE__ */ h("p", {
|
|
141
148
|
className: "text-xs text-muted-foreground",
|
|
142
|
-
children:
|
|
149
|
+
children: z?.email
|
|
143
150
|
})]
|
|
144
151
|
})]
|
|
145
|
-
}), /* @__PURE__ */
|
|
146
|
-
className: `w-4 h-4 text-muted-foreground transition-transform ${
|
|
152
|
+
}), /* @__PURE__ */ h("svg", {
|
|
153
|
+
className: `w-4 h-4 text-muted-foreground transition-transform ${w ? "rotate-180" : ""}`,
|
|
147
154
|
fill: "none",
|
|
148
155
|
viewBox: "0 0 24 24",
|
|
149
156
|
stroke: "currentColor",
|
|
150
|
-
children: /* @__PURE__ */
|
|
157
|
+
children: /* @__PURE__ */ h("path", {
|
|
151
158
|
strokeLinecap: "round",
|
|
152
159
|
strokeLinejoin: "round",
|
|
153
160
|
strokeWidth: 2,
|
|
154
161
|
d: "M19 9l-7 7-7-7"
|
|
155
162
|
})
|
|
156
163
|
})]
|
|
157
|
-
}),
|
|
164
|
+
}), w && /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("div", {
|
|
158
165
|
className: "fixed inset-0 z-10",
|
|
159
|
-
onClick: () =>
|
|
160
|
-
}), /* @__PURE__ */
|
|
166
|
+
onClick: () => T(!1)
|
|
167
|
+
}), /* @__PURE__ */ h("div", {
|
|
161
168
|
className: "absolute top-full left-0 right-0 sm:right-auto mt-1 w-full sm:w-80 bg-popover border border-border rounded-lg shadow-lg z-20 py-1 max-h-60 overflow-y-auto",
|
|
162
|
-
children: s.map((e) => /* @__PURE__ */
|
|
163
|
-
onClick: () =>
|
|
169
|
+
children: s.map((e) => /* @__PURE__ */ g("button", {
|
|
170
|
+
onClick: () => B(e),
|
|
164
171
|
className: "w-full flex items-center justify-between gap-3 px-4 py-3 hover:bg-muted transition-colors",
|
|
165
|
-
children: [/* @__PURE__ */
|
|
172
|
+
children: [/* @__PURE__ */ g("div", {
|
|
166
173
|
className: "flex items-center gap-3 min-w-0",
|
|
167
|
-
children: [/* @__PURE__ */
|
|
174
|
+
children: [/* @__PURE__ */ h("div", {
|
|
168
175
|
className: "w-8 h-8 rounded-lg bg-muted flex items-center justify-center flex-shrink-0",
|
|
169
|
-
children: /* @__PURE__ */
|
|
176
|
+
children: /* @__PURE__ */ h("svg", {
|
|
170
177
|
className: "w-4 h-4 text-muted-foreground",
|
|
171
178
|
fill: "none",
|
|
172
179
|
viewBox: "0 0 24 24",
|
|
173
180
|
stroke: "currentColor",
|
|
174
|
-
children: /* @__PURE__ */
|
|
181
|
+
children: /* @__PURE__ */ h("path", {
|
|
175
182
|
strokeLinecap: "round",
|
|
176
183
|
strokeLinejoin: "round",
|
|
177
184
|
strokeWidth: 2,
|
|
178
185
|
d: "M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"
|
|
179
186
|
})
|
|
180
187
|
})
|
|
181
|
-
}), /* @__PURE__ */
|
|
188
|
+
}), /* @__PURE__ */ g("div", {
|
|
182
189
|
className: "text-left min-w-0",
|
|
183
|
-
children: [/* @__PURE__ */
|
|
190
|
+
children: [/* @__PURE__ */ h("p", {
|
|
184
191
|
className: "text-sm font-medium text-foreground truncate",
|
|
185
192
|
children: e.name
|
|
186
|
-
}), /* @__PURE__ */
|
|
193
|
+
}), /* @__PURE__ */ h("p", {
|
|
187
194
|
className: "text-xs text-muted-foreground truncate",
|
|
188
195
|
children: e.email
|
|
189
196
|
})]
|
|
190
197
|
})]
|
|
191
|
-
}),
|
|
198
|
+
}), z?.id === e.id && /* @__PURE__ */ h("svg", {
|
|
192
199
|
className: "w-4 h-4 text-primary flex-shrink-0",
|
|
193
200
|
fill: "none",
|
|
194
201
|
viewBox: "0 0 24 24",
|
|
195
202
|
stroke: "currentColor",
|
|
196
|
-
children: /* @__PURE__ */
|
|
203
|
+
children: /* @__PURE__ */ h("path", {
|
|
197
204
|
strokeLinecap: "round",
|
|
198
205
|
strokeLinejoin: "round",
|
|
199
206
|
strokeWidth: 2,
|
|
@@ -203,100 +210,100 @@ var b = ["expired", "upgraded"], x = 10, S = () => {
|
|
|
203
210
|
}, e.id))
|
|
204
211
|
})] })]
|
|
205
212
|
}),
|
|
206
|
-
|
|
213
|
+
z && /* @__PURE__ */ g("div", {
|
|
207
214
|
className: "grid grid-cols-1 sm:grid-cols-3 gap-4",
|
|
208
215
|
children: [
|
|
209
|
-
/* @__PURE__ */
|
|
216
|
+
/* @__PURE__ */ g("div", {
|
|
210
217
|
className: "border border-border rounded-lg bg-card p-4",
|
|
211
|
-
children: [/* @__PURE__ */
|
|
218
|
+
children: [/* @__PURE__ */ h("p", {
|
|
212
219
|
className: "text-sm text-muted-foreground",
|
|
213
220
|
children: "Account"
|
|
214
|
-
}), /* @__PURE__ */
|
|
221
|
+
}), /* @__PURE__ */ h("p", {
|
|
215
222
|
className: "text-lg font-semibold text-foreground mt-1",
|
|
216
|
-
children:
|
|
223
|
+
children: z.name
|
|
217
224
|
})]
|
|
218
225
|
}),
|
|
219
|
-
/* @__PURE__ */
|
|
226
|
+
/* @__PURE__ */ g("div", {
|
|
220
227
|
className: "border border-border rounded-lg bg-card p-4",
|
|
221
|
-
children: [/* @__PURE__ */
|
|
228
|
+
children: [/* @__PURE__ */ h("p", {
|
|
222
229
|
className: "text-sm text-muted-foreground",
|
|
223
230
|
children: "Active Subscriptions"
|
|
224
|
-
}), /* @__PURE__ */
|
|
231
|
+
}), /* @__PURE__ */ h("p", {
|
|
225
232
|
className: "text-lg font-semibold text-status-success-text mt-1",
|
|
226
|
-
children:
|
|
233
|
+
children: N.length
|
|
227
234
|
})]
|
|
228
235
|
}),
|
|
229
|
-
/* @__PURE__ */
|
|
236
|
+
/* @__PURE__ */ g("div", {
|
|
230
237
|
className: "border border-border rounded-lg bg-card p-4",
|
|
231
|
-
children: [/* @__PURE__ */
|
|
238
|
+
children: [/* @__PURE__ */ h("p", {
|
|
232
239
|
className: "text-sm text-muted-foreground",
|
|
233
240
|
children: "Credit Balance"
|
|
234
|
-
}), /* @__PURE__ */
|
|
241
|
+
}), /* @__PURE__ */ g("p", {
|
|
235
242
|
className: "text-lg font-semibold text-foreground mt-1",
|
|
236
|
-
children: [(
|
|
243
|
+
children: [(z.creditAmount || 0).toLocaleString(), " Credits"]
|
|
237
244
|
})]
|
|
238
245
|
})
|
|
239
246
|
]
|
|
240
247
|
}),
|
|
241
|
-
/* @__PURE__ */
|
|
242
|
-
className: "flex flex-
|
|
248
|
+
/* @__PURE__ */ g("div", {
|
|
249
|
+
className: "flex flex-wrap items-center gap-4 pb-4 border-b border-border",
|
|
243
250
|
children: [
|
|
244
|
-
/* @__PURE__ */
|
|
245
|
-
className: "inline-flex rounded-lg border border-border p-1 bg-muted/50
|
|
251
|
+
/* @__PURE__ */ h("div", {
|
|
252
|
+
className: "inline-flex rounded-lg border border-border p-1 bg-muted/50",
|
|
246
253
|
children: [
|
|
247
254
|
"all",
|
|
248
255
|
"active",
|
|
249
256
|
"canceled",
|
|
250
257
|
"inactive"
|
|
251
|
-
].map((e) => /* @__PURE__ */
|
|
252
|
-
onClick: () =>
|
|
253
|
-
className: `px-3 py-1.5 text-sm font-medium rounded-md transition-colors capitalize ${
|
|
258
|
+
].map((e) => /* @__PURE__ */ h("button", {
|
|
259
|
+
onClick: () => D(e),
|
|
260
|
+
className: `px-3 py-1.5 text-sm font-medium rounded-md transition-colors capitalize ${E === e ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"}`,
|
|
254
261
|
children: e === "inactive" ? "Inactive" : e
|
|
255
262
|
}, e))
|
|
256
263
|
}),
|
|
257
|
-
/* @__PURE__ */
|
|
258
|
-
className: "relative flex-1 min-w-
|
|
259
|
-
children: [/* @__PURE__ */
|
|
264
|
+
/* @__PURE__ */ g("div", {
|
|
265
|
+
className: "relative flex-1 min-w-[200px] max-w-md",
|
|
266
|
+
children: [/* @__PURE__ */ h("svg", {
|
|
260
267
|
className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground",
|
|
261
268
|
fill: "none",
|
|
262
269
|
viewBox: "0 0 24 24",
|
|
263
270
|
stroke: "currentColor",
|
|
264
|
-
children: /* @__PURE__ */
|
|
271
|
+
children: /* @__PURE__ */ h("path", {
|
|
265
272
|
strokeLinecap: "round",
|
|
266
273
|
strokeLinejoin: "round",
|
|
267
274
|
strokeWidth: 2,
|
|
268
275
|
d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
|
|
269
276
|
})
|
|
270
|
-
}), /* @__PURE__ */
|
|
277
|
+
}), /* @__PURE__ */ h("input", {
|
|
271
278
|
type: "text",
|
|
272
279
|
placeholder: r("billing.subscriptions.searchPlaceholder", "Search subscriptions..."),
|
|
273
|
-
value:
|
|
274
|
-
onChange: (e) =>
|
|
280
|
+
value: O,
|
|
281
|
+
onChange: (e) => k(e.target.value),
|
|
275
282
|
className: "w-full pl-[3.25rem] pr-4 py-2 text-sm border border-border rounded-md bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent"
|
|
276
283
|
})]
|
|
277
284
|
}),
|
|
278
|
-
/* @__PURE__ */
|
|
285
|
+
/* @__PURE__ */ g("div", {
|
|
279
286
|
className: "text-sm text-muted-foreground",
|
|
280
287
|
children: [
|
|
281
|
-
|
|
288
|
+
P,
|
|
282
289
|
" subscription",
|
|
283
|
-
|
|
290
|
+
P === 1 ? "" : "s",
|
|
284
291
|
" total"
|
|
285
292
|
]
|
|
286
293
|
})
|
|
287
294
|
]
|
|
288
295
|
}),
|
|
289
|
-
|
|
296
|
+
H.length === 0 ? /* @__PURE__ */ g("div", {
|
|
290
297
|
className: "flex flex-col items-center justify-center py-12 border border-dashed border-border rounded-lg",
|
|
291
298
|
children: [
|
|
292
|
-
/* @__PURE__ */
|
|
299
|
+
/* @__PURE__ */ h("div", {
|
|
293
300
|
className: "w-12 h-12 rounded-full bg-muted flex items-center justify-center mb-4",
|
|
294
|
-
children: /* @__PURE__ */
|
|
301
|
+
children: /* @__PURE__ */ h("svg", {
|
|
295
302
|
className: "w-6 h-6 text-muted-foreground",
|
|
296
303
|
fill: "none",
|
|
297
304
|
viewBox: "0 0 24 24",
|
|
298
305
|
stroke: "currentColor",
|
|
299
|
-
children: /* @__PURE__ */
|
|
306
|
+
children: /* @__PURE__ */ h("path", {
|
|
300
307
|
strokeLinecap: "round",
|
|
301
308
|
strokeLinejoin: "round",
|
|
302
309
|
strokeWidth: 2,
|
|
@@ -304,41 +311,41 @@ var b = ["expired", "upgraded"], x = 10, S = () => {
|
|
|
304
311
|
})
|
|
305
312
|
})
|
|
306
313
|
}),
|
|
307
|
-
/* @__PURE__ */
|
|
314
|
+
/* @__PURE__ */ h("h3", {
|
|
308
315
|
className: "text-lg font-medium text-foreground",
|
|
309
316
|
children: r("billing.subscriptions.noSubscriptionsFound", "No subscriptions found")
|
|
310
317
|
}),
|
|
311
|
-
/* @__PURE__ */
|
|
318
|
+
/* @__PURE__ */ h("p", {
|
|
312
319
|
className: "text-sm text-muted-foreground mt-1",
|
|
313
|
-
children:
|
|
320
|
+
children: E !== "all" || O ? "No subscriptions match your filters." : "You don't have any subscriptions yet."
|
|
314
321
|
}),
|
|
315
|
-
a.canCreateSubscription &&
|
|
322
|
+
a.canCreateSubscription && E === "all" && !O && /* @__PURE__ */ h("button", {
|
|
316
323
|
onClick: () => i("/plans"),
|
|
317
324
|
className: "mt-4 px-4 py-2 text-sm font-medium bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors",
|
|
318
325
|
children: "Browse Plans"
|
|
319
326
|
})
|
|
320
327
|
]
|
|
321
|
-
}) : /* @__PURE__ */
|
|
328
|
+
}) : /* @__PURE__ */ h("div", {
|
|
322
329
|
className: "space-y-4",
|
|
323
|
-
children:
|
|
330
|
+
children: H.map((e) => /* @__PURE__ */ h(x, {
|
|
324
331
|
subscription: e,
|
|
325
332
|
onView: () => i(u(`/subscriptions/${e.id}`, e.billingAccountId)),
|
|
326
333
|
canCancel: a.canCancelSubscription
|
|
327
334
|
}, e.id))
|
|
328
335
|
}),
|
|
329
|
-
|
|
336
|
+
F > 1 && /* @__PURE__ */ g("div", {
|
|
330
337
|
className: "flex items-center justify-center gap-2 pt-4",
|
|
331
338
|
children: [
|
|
332
|
-
/* @__PURE__ */
|
|
333
|
-
onClick: () =>
|
|
334
|
-
disabled:
|
|
339
|
+
/* @__PURE__ */ h("button", {
|
|
340
|
+
onClick: () => V(A - 1),
|
|
341
|
+
disabled: A === 1,
|
|
335
342
|
className: "px-3 py-1.5 text-sm border border-border rounded-md disabled:opacity-50 disabled:cursor-not-allowed hover:bg-muted transition-colors",
|
|
336
|
-
children: /* @__PURE__ */
|
|
343
|
+
children: /* @__PURE__ */ h("svg", {
|
|
337
344
|
className: "w-4 h-4",
|
|
338
345
|
fill: "none",
|
|
339
346
|
viewBox: "0 0 24 24",
|
|
340
347
|
stroke: "currentColor",
|
|
341
|
-
children: /* @__PURE__ */
|
|
348
|
+
children: /* @__PURE__ */ h("path", {
|
|
342
349
|
strokeLinecap: "round",
|
|
343
350
|
strokeLinejoin: "round",
|
|
344
351
|
strokeWidth: 2,
|
|
@@ -346,30 +353,30 @@ var b = ["expired", "upgraded"], x = 10, S = () => {
|
|
|
346
353
|
})
|
|
347
354
|
})
|
|
348
355
|
}),
|
|
349
|
-
/* @__PURE__ */
|
|
356
|
+
/* @__PURE__ */ h("div", {
|
|
350
357
|
className: "flex items-center gap-1",
|
|
351
|
-
children: Array.from({ length:
|
|
352
|
-
let t = e === 1 || e ===
|
|
353
|
-
return n || r ? /* @__PURE__ */
|
|
358
|
+
children: Array.from({ length: F }, (e, t) => t + 1).map((e) => {
|
|
359
|
+
let t = e === 1 || e === F || Math.abs(e - A) <= 1, n = e === A - 2 && A > 3, r = e === A + 2 && A < F - 2;
|
|
360
|
+
return n || r ? /* @__PURE__ */ h("span", {
|
|
354
361
|
className: "px-2 text-muted-foreground",
|
|
355
362
|
children: "..."
|
|
356
|
-
}, e) : t ? /* @__PURE__ */
|
|
357
|
-
onClick: () =>
|
|
358
|
-
className: `px-3 py-1.5 text-sm rounded-md transition-colors ${e ===
|
|
363
|
+
}, e) : t ? /* @__PURE__ */ h("button", {
|
|
364
|
+
onClick: () => V(e),
|
|
365
|
+
className: `px-3 py-1.5 text-sm rounded-md transition-colors ${e === A ? "bg-primary text-primary-foreground" : "border border-border hover:bg-muted"}`,
|
|
359
366
|
children: e
|
|
360
367
|
}, e) : null;
|
|
361
368
|
})
|
|
362
369
|
}),
|
|
363
|
-
/* @__PURE__ */
|
|
364
|
-
onClick: () =>
|
|
365
|
-
disabled:
|
|
370
|
+
/* @__PURE__ */ h("button", {
|
|
371
|
+
onClick: () => V(A + 1),
|
|
372
|
+
disabled: A === F,
|
|
366
373
|
className: "px-3 py-1.5 text-sm border border-border rounded-md disabled:opacity-50 disabled:cursor-not-allowed hover:bg-muted transition-colors",
|
|
367
|
-
children: /* @__PURE__ */
|
|
374
|
+
children: /* @__PURE__ */ h("svg", {
|
|
368
375
|
className: "w-4 h-4",
|
|
369
376
|
fill: "none",
|
|
370
377
|
viewBox: "0 0 24 24",
|
|
371
378
|
stroke: "currentColor",
|
|
372
|
-
children: /* @__PURE__ */
|
|
379
|
+
children: /* @__PURE__ */ h("path", {
|
|
373
380
|
strokeLinecap: "round",
|
|
374
381
|
strokeLinejoin: "round",
|
|
375
382
|
strokeWidth: 2,
|
|
@@ -380,19 +387,19 @@ var b = ["expired", "upgraded"], x = 10, S = () => {
|
|
|
380
387
|
]
|
|
381
388
|
})
|
|
382
389
|
]
|
|
383
|
-
}) : /* @__PURE__ */
|
|
390
|
+
}) : /* @__PURE__ */ h("div", {
|
|
384
391
|
className: "flex items-center justify-center h-full min-h-[400px]",
|
|
385
|
-
children: /* @__PURE__ */
|
|
392
|
+
children: /* @__PURE__ */ g("div", {
|
|
386
393
|
className: "text-center space-y-2",
|
|
387
394
|
children: [
|
|
388
|
-
/* @__PURE__ */
|
|
395
|
+
/* @__PURE__ */ h("div", {
|
|
389
396
|
className: "w-12 h-12 mx-auto rounded-full bg-muted flex items-center justify-center",
|
|
390
|
-
children: /* @__PURE__ */
|
|
397
|
+
children: /* @__PURE__ */ h("svg", {
|
|
391
398
|
className: "w-6 h-6 text-muted-foreground",
|
|
392
399
|
fill: "none",
|
|
393
400
|
viewBox: "0 0 24 24",
|
|
394
401
|
stroke: "currentColor",
|
|
395
|
-
children: /* @__PURE__ */
|
|
402
|
+
children: /* @__PURE__ */ h("path", {
|
|
396
403
|
strokeLinecap: "round",
|
|
397
404
|
strokeLinejoin: "round",
|
|
398
405
|
strokeWidth: 2,
|
|
@@ -400,36 +407,36 @@ var b = ["expired", "upgraded"], x = 10, S = () => {
|
|
|
400
407
|
})
|
|
401
408
|
})
|
|
402
409
|
}),
|
|
403
|
-
/* @__PURE__ */
|
|
410
|
+
/* @__PURE__ */ h("h2", {
|
|
404
411
|
className: "text-lg font-semibold text-foreground",
|
|
405
412
|
children: "Access Denied"
|
|
406
413
|
}),
|
|
407
|
-
/* @__PURE__ */
|
|
414
|
+
/* @__PURE__ */ h("p", {
|
|
408
415
|
className: "text-sm text-muted-foreground max-w-sm",
|
|
409
416
|
children: "You don't have permission to view subscriptions."
|
|
410
417
|
})
|
|
411
418
|
]
|
|
412
419
|
})
|
|
413
420
|
});
|
|
414
|
-
},
|
|
421
|
+
}, x = ({ subscription: e, onView: t, canCancel: c }) => {
|
|
415
422
|
let l = e.plan, u = s(e.status), d = e.status === "active", f = new Date(e.endDate), p = /* @__PURE__ */ new Date(), m = Math.max(0, Math.ceil((f.getTime() - p.getTime()) / (1e3 * 60 * 60 * 24)));
|
|
416
|
-
return /* @__PURE__ */
|
|
423
|
+
return /* @__PURE__ */ h("div", {
|
|
417
424
|
className: "border border-border rounded-lg bg-card hover:shadow-md transition-shadow cursor-pointer",
|
|
418
425
|
onClick: t,
|
|
419
|
-
children: /* @__PURE__ */
|
|
426
|
+
children: /* @__PURE__ */ g("div", {
|
|
420
427
|
className: "p-6",
|
|
421
428
|
children: [
|
|
422
|
-
/* @__PURE__ */
|
|
429
|
+
/* @__PURE__ */ g("div", {
|
|
423
430
|
className: "flex flex-col sm:flex-row sm:items-center gap-4",
|
|
424
431
|
children: [
|
|
425
|
-
/* @__PURE__ */
|
|
432
|
+
/* @__PURE__ */ h("div", {
|
|
426
433
|
className: "w-12 h-12 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",
|
|
427
|
-
children: /* @__PURE__ */
|
|
434
|
+
children: /* @__PURE__ */ h("svg", {
|
|
428
435
|
className: "w-6 h-6 text-primary",
|
|
429
436
|
fill: "none",
|
|
430
437
|
viewBox: "0 0 24 24",
|
|
431
438
|
stroke: "currentColor",
|
|
432
|
-
children: /* @__PURE__ */
|
|
439
|
+
children: /* @__PURE__ */ h("path", {
|
|
433
440
|
strokeLinecap: "round",
|
|
434
441
|
strokeLinejoin: "round",
|
|
435
442
|
strokeWidth: 2,
|
|
@@ -437,49 +444,49 @@ var b = ["expired", "upgraded"], x = 10, S = () => {
|
|
|
437
444
|
})
|
|
438
445
|
})
|
|
439
446
|
}),
|
|
440
|
-
/* @__PURE__ */
|
|
447
|
+
/* @__PURE__ */ g("div", {
|
|
441
448
|
className: "flex-1 min-w-0",
|
|
442
|
-
children: [/* @__PURE__ */
|
|
449
|
+
children: [/* @__PURE__ */ g("div", {
|
|
443
450
|
className: "flex items-center gap-2 flex-wrap",
|
|
444
|
-
children: [/* @__PURE__ */
|
|
451
|
+
children: [/* @__PURE__ */ h("h3", {
|
|
445
452
|
className: "font-semibold text-foreground",
|
|
446
453
|
children: l?.name || "Unknown Plan"
|
|
447
|
-
}), /* @__PURE__ */
|
|
454
|
+
}), /* @__PURE__ */ h("span", {
|
|
448
455
|
className: `px-2 py-0.5 text-xs font-medium rounded ${o(u)}`,
|
|
449
456
|
children: a(e.status)
|
|
450
457
|
})]
|
|
451
|
-
}), /* @__PURE__ */
|
|
458
|
+
}), /* @__PURE__ */ g("div", {
|
|
452
459
|
className: "flex items-center gap-4 mt-1 text-sm text-muted-foreground",
|
|
453
460
|
children: [
|
|
454
|
-
/* @__PURE__ */
|
|
461
|
+
/* @__PURE__ */ g("span", { children: [
|
|
455
462
|
l ? n(l.price, l.currency) : "—",
|
|
456
463
|
" /",
|
|
457
464
|
" ",
|
|
458
465
|
l ? i(l.duration) : "—"
|
|
459
466
|
] }),
|
|
460
|
-
/* @__PURE__ */
|
|
467
|
+
/* @__PURE__ */ h("span", {
|
|
461
468
|
className: "hidden sm:inline",
|
|
462
469
|
children: "•"
|
|
463
470
|
}),
|
|
464
|
-
/* @__PURE__ */
|
|
471
|
+
/* @__PURE__ */ g("span", {
|
|
465
472
|
className: "hidden sm:inline",
|
|
466
473
|
children: ["Started ", r(e.startDate, "short")]
|
|
467
474
|
})
|
|
468
475
|
]
|
|
469
476
|
})]
|
|
470
477
|
}),
|
|
471
|
-
/* @__PURE__ */
|
|
478
|
+
/* @__PURE__ */ g("div", {
|
|
472
479
|
className: "flex items-center gap-4",
|
|
473
|
-
children: [d && /* @__PURE__ */
|
|
480
|
+
children: [d && /* @__PURE__ */ g("div", {
|
|
474
481
|
className: "text-right",
|
|
475
|
-
children: [/* @__PURE__ */
|
|
482
|
+
children: [/* @__PURE__ */ g("p", {
|
|
476
483
|
className: "text-sm font-medium text-foreground",
|
|
477
484
|
children: [m, " days"]
|
|
478
|
-
}), /* @__PURE__ */
|
|
485
|
+
}), /* @__PURE__ */ h("p", {
|
|
479
486
|
className: "text-xs text-muted-foreground",
|
|
480
487
|
children: "remaining"
|
|
481
488
|
})]
|
|
482
|
-
}), /* @__PURE__ */
|
|
489
|
+
}), /* @__PURE__ */ h("button", {
|
|
483
490
|
onClick: (e) => {
|
|
484
491
|
e.stopPropagation(), t();
|
|
485
492
|
},
|
|
@@ -489,9 +496,9 @@ var b = ["expired", "upgraded"], x = 10, S = () => {
|
|
|
489
496
|
})
|
|
490
497
|
]
|
|
491
498
|
}),
|
|
492
|
-
e.addonSubscriptions && e.addonSubscriptions.length > 0 && /* @__PURE__ */
|
|
499
|
+
e.addonSubscriptions && e.addonSubscriptions.length > 0 && /* @__PURE__ */ h("div", {
|
|
493
500
|
className: "mt-4 pt-4 border-t border-border",
|
|
494
|
-
children: /* @__PURE__ */
|
|
501
|
+
children: /* @__PURE__ */ g("p", {
|
|
495
502
|
className: "text-sm text-muted-foreground",
|
|
496
503
|
children: [
|
|
497
504
|
e.addonSubscriptions.length,
|
|
@@ -501,14 +508,14 @@ var b = ["expired", "upgraded"], x = 10, S = () => {
|
|
|
501
508
|
]
|
|
502
509
|
})
|
|
503
510
|
}),
|
|
504
|
-
e.canceledAt && /* @__PURE__ */
|
|
511
|
+
e.canceledAt && /* @__PURE__ */ h("div", {
|
|
505
512
|
className: "mt-4 pt-4 border-t border-border",
|
|
506
|
-
children: /* @__PURE__ */
|
|
513
|
+
children: /* @__PURE__ */ g("p", {
|
|
507
514
|
className: "text-sm text-muted-foreground",
|
|
508
515
|
children: [
|
|
509
516
|
"Canceled on ",
|
|
510
517
|
r(e.canceledAt),
|
|
511
|
-
e.cancellationReason && /* @__PURE__ */
|
|
518
|
+
e.cancellationReason && /* @__PURE__ */ g("span", { children: [" — ", e.cancellationReason] })
|
|
512
519
|
]
|
|
513
520
|
})
|
|
514
521
|
})
|
|
@@ -517,6 +524,6 @@ var b = ["expired", "upgraded"], x = 10, S = () => {
|
|
|
517
524
|
});
|
|
518
525
|
};
|
|
519
526
|
//#endregion
|
|
520
|
-
export {
|
|
527
|
+
export { b as SubscriptionsListPage };
|
|
521
528
|
|
|
522
529
|
//# sourceMappingURL=SubscriptionsListPage.js.map
|