@carlonicora/nextjs-jsonapi 1.137.1 → 1.137.2
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/{BlockNoteEditor-6LRARHTU.js → BlockNoteEditor-EQTXZTO4.js} +9 -9
- package/dist/{BlockNoteEditor-6LRARHTU.js.map → BlockNoteEditor-EQTXZTO4.js.map} +1 -1
- package/dist/{BlockNoteEditor-VN6XD25O.mjs → BlockNoteEditor-QLNAU7GK.mjs} +2 -2
- package/dist/billing/index.js +310 -310
- package/dist/billing/index.mjs +1 -1
- package/dist/{chunk-UW2XT3UI.mjs → chunk-QBCHQXLE.mjs} +19 -5
- package/dist/chunk-QBCHQXLE.mjs.map +1 -0
- package/dist/{chunk-T5XKILAQ.js → chunk-RVK3JB33.js} +19 -5
- package/dist/chunk-RVK3JB33.js.map +1 -0
- package/dist/client/index.js +2 -2
- package/dist/client/index.mjs +1 -1
- package/dist/components/index.js +2 -2
- package/dist/components/index.mjs +1 -1
- package/dist/contexts/index.js +2 -2
- package/dist/contexts/index.mjs +1 -1
- package/dist/features/help/index.js +31 -31
- package/dist/features/help/index.mjs +1 -1
- package/package.json +1 -1
- package/src/components/containers/RoundPageContainer.tsx +16 -2
- package/src/components/navigations/MobileNavigationBar.tsx +6 -1
- package/dist/chunk-T5XKILAQ.js.map +0 -1
- package/dist/chunk-UW2XT3UI.mjs.map +0 -1
- /package/dist/{BlockNoteEditor-VN6XD25O.mjs.map → BlockNoteEditor-QLNAU7GK.mjs.map} +0 -0
package/dist/billing/index.js
CHANGED
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
|
|
51
|
-
var
|
|
51
|
+
var _chunkRVK3JB33js = require('../chunk-RVK3JB33.js');
|
|
52
52
|
|
|
53
53
|
|
|
54
54
|
|
|
@@ -114,41 +114,41 @@ function SubscriptionSummaryCard({
|
|
|
114
114
|
onManageClick
|
|
115
115
|
}) {
|
|
116
116
|
if (loading) {
|
|
117
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
118
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
119
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
117
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.Card, { children: [
|
|
118
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
119
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.CardTitle, { children: "Subscriptions" }),
|
|
120
120
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-4 w-4 text-muted-foreground" })
|
|
121
121
|
] }),
|
|
122
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
123
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
124
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
125
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
122
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.CardContent, { children: [
|
|
123
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Skeleton, { className: "h-6 w-32 mb-2" }),
|
|
124
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Skeleton, { className: "h-4 w-24 mb-1" }),
|
|
125
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Skeleton, { className: "h-4 w-40" })
|
|
126
126
|
] })
|
|
127
127
|
] });
|
|
128
128
|
}
|
|
129
129
|
if (error) {
|
|
130
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
131
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
132
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
130
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.Card, { children: [
|
|
131
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
132
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.CardTitle, { children: "Subscriptions" }),
|
|
133
133
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-4 w-4 text-muted-foreground" })
|
|
134
134
|
] }),
|
|
135
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
135
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
|
|
136
136
|
] });
|
|
137
137
|
}
|
|
138
138
|
const activeSubscriptions = subscriptions.filter(
|
|
139
139
|
(sub) => sub.status === "active" /* ACTIVE */ || sub.status === "trialing" /* TRIALING */
|
|
140
140
|
);
|
|
141
141
|
const primarySubscription = activeSubscriptions[0];
|
|
142
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
143
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
144
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
142
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onManageClick, children: [
|
|
143
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
144
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.CardTitle, { children: "Subscriptions" }),
|
|
145
145
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-4 w-4 text-muted-foreground" })
|
|
146
146
|
] }),
|
|
147
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
147
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.CardContent, { children: subscriptions.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
148
148
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: "No active plan" }),
|
|
149
149
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: "Subscribe to get started" }),
|
|
150
150
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
151
|
-
|
|
151
|
+
_chunkRVK3JB33js.Button,
|
|
152
152
|
{
|
|
153
153
|
variant: "outline",
|
|
154
154
|
size: "sm",
|
|
@@ -167,7 +167,7 @@ function SubscriptionSummaryCard({
|
|
|
167
167
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
|
|
168
168
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold", children: formatPlanName(primarySubscription) }),
|
|
169
169
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
170
|
-
|
|
170
|
+
_chunkRVK3JB33js.Badge,
|
|
171
171
|
{
|
|
172
172
|
variant: primarySubscription.cancelAtPeriodEnd ? "secondary" : getStatusBadgeVariant(primarySubscription.status),
|
|
173
173
|
children: primarySubscription.cancelAtPeriodEnd ? "Canceling" : primarySubscription.status
|
|
@@ -209,37 +209,37 @@ function PaymentMethodSummaryCard({
|
|
|
209
209
|
onManageClick
|
|
210
210
|
}) {
|
|
211
211
|
if (loading) {
|
|
212
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
213
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
214
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
212
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.Card, { children: [
|
|
213
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
214
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.CardTitle, { children: "Payment Method" }),
|
|
215
215
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Wallet, { className: "h-4 w-4 text-muted-foreground" })
|
|
216
216
|
] }),
|
|
217
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
218
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
219
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
217
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.CardContent, { children: [
|
|
218
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Skeleton, { className: "h-6 w-32 mb-2" }),
|
|
219
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Skeleton, { className: "h-4 w-24" })
|
|
220
220
|
] })
|
|
221
221
|
] });
|
|
222
222
|
}
|
|
223
223
|
if (error) {
|
|
224
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
225
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
226
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
224
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.Card, { children: [
|
|
225
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
226
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.CardTitle, { children: "Payment Method" }),
|
|
227
227
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Wallet, { className: "h-4 w-4 text-muted-foreground" })
|
|
228
228
|
] }),
|
|
229
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
229
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
|
|
230
230
|
] });
|
|
231
231
|
}
|
|
232
232
|
const defaultMethod = paymentMethods.find((pm) => pm.id === defaultPaymentMethodId) || paymentMethods[0];
|
|
233
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
234
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
235
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
233
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onManageClick, children: [
|
|
234
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
235
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.CardTitle, { children: "Payment Method" }),
|
|
236
236
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Wallet, { className: "h-4 w-4 text-muted-foreground" })
|
|
237
237
|
] }),
|
|
238
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
238
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.CardContent, { children: paymentMethods.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
239
239
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: "No payment method" }),
|
|
240
240
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: "Add a card to enable subscriptions" }),
|
|
241
241
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
242
|
-
|
|
242
|
+
_chunkRVK3JB33js.Button,
|
|
243
243
|
{
|
|
244
244
|
variant: "outline",
|
|
245
245
|
size: "sm",
|
|
@@ -312,52 +312,52 @@ function CustomerInfoCard({ customer, loading, error }) {
|
|
|
312
312
|
}
|
|
313
313
|
}, "handlePortalClick");
|
|
314
314
|
if (loading) {
|
|
315
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
316
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
317
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
315
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.Card, { children: [
|
|
316
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
317
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.CardTitle, { children: "Billing Account" }),
|
|
318
318
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.User, { className: "h-4 w-4 text-muted-foreground" })
|
|
319
319
|
] }),
|
|
320
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
321
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
322
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
323
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
320
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.CardContent, { children: [
|
|
321
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Skeleton, { className: "h-6 w-32 mb-2" }),
|
|
322
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Skeleton, { className: "h-4 w-48 mb-1" }),
|
|
323
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Skeleton, { className: "h-4 w-24" })
|
|
324
324
|
] })
|
|
325
325
|
] });
|
|
326
326
|
}
|
|
327
327
|
if (error) {
|
|
328
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
329
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
330
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
328
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.Card, { children: [
|
|
329
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
330
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.CardTitle, { children: "Billing Account" }),
|
|
331
331
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.User, { className: "h-4 w-4 text-muted-foreground" })
|
|
332
332
|
] }),
|
|
333
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
333
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
|
|
334
334
|
] });
|
|
335
335
|
}
|
|
336
336
|
if (!customer) {
|
|
337
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
338
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
339
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
337
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.Card, { children: [
|
|
338
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
339
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.CardTitle, { children: "Billing Account" }),
|
|
340
340
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.User, { className: "h-4 w-4 text-muted-foreground" })
|
|
341
341
|
] }),
|
|
342
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
342
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.CardContent, { children: [
|
|
343
343
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: "Not set up" }),
|
|
344
344
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: "Billing account will be created when you subscribe" })
|
|
345
345
|
] })
|
|
346
346
|
] });
|
|
347
347
|
}
|
|
348
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
349
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
350
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
348
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.Card, { children: [
|
|
349
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
350
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.CardTitle, { children: "Billing Account" }),
|
|
351
351
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.User, { className: "h-4 w-4 text-muted-foreground" })
|
|
352
352
|
] }),
|
|
353
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
353
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
354
354
|
customer.name && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold", children: customer.name }),
|
|
355
355
|
customer.email && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: customer.email }),
|
|
356
356
|
customer.balance !== void 0 && customer.balance !== 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "text-sm", children: [
|
|
357
357
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground", children: "Credit Balance: " }),
|
|
358
358
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: customer.balance < 0 ? "text-success" : "text-destructive", children: formatBalance(customer.balance, customer.currency) })
|
|
359
359
|
] }),
|
|
360
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
360
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.Button, { variant: "outline", size: "sm", className: "mt-2", onClick: handlePortalClick, disabled: portalLoading, children: [
|
|
361
361
|
portalLoading ? "Loading..." : "Manage in Stripe Portal",
|
|
362
362
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ExternalLink, { className: "h-4 w-4 ml-1" })
|
|
363
363
|
] })
|
|
@@ -401,42 +401,42 @@ function formatAmount(amount, currency) {
|
|
|
401
401
|
_chunk7QVYU63Ejs.__name.call(void 0, formatAmount, "formatAmount");
|
|
402
402
|
function InvoicesSummaryCard({ invoices, loading, error, onViewAllClick }) {
|
|
403
403
|
if (loading) {
|
|
404
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
405
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
406
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
404
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.Card, { children: [
|
|
405
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
406
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.CardTitle, { children: "Recent Invoices" }),
|
|
407
407
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ReceiptIcon, { className: "h-4 w-4 text-muted-foreground" })
|
|
408
408
|
] }),
|
|
409
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
410
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
411
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
412
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
409
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.CardContent, { children: [
|
|
410
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Skeleton, { className: "h-6 w-24 mb-2" }),
|
|
411
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Skeleton, { className: "h-4 w-32 mb-1" }),
|
|
412
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Skeleton, { className: "h-4 w-20" })
|
|
413
413
|
] })
|
|
414
414
|
] });
|
|
415
415
|
}
|
|
416
416
|
if (error) {
|
|
417
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
418
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
419
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
417
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.Card, { children: [
|
|
418
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
419
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.CardTitle, { children: "Recent Invoices" }),
|
|
420
420
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ReceiptIcon, { className: "h-4 w-4 text-muted-foreground" })
|
|
421
421
|
] }),
|
|
422
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
422
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
|
|
423
423
|
] });
|
|
424
424
|
}
|
|
425
425
|
const latestInvoice = invoices[0];
|
|
426
426
|
const paidInvoices = invoices.filter((inv) => inv.status === "paid" /* PAID */);
|
|
427
427
|
const openInvoices = invoices.filter((inv) => inv.status === "open" /* OPEN */);
|
|
428
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
429
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
430
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
428
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onViewAllClick, children: [
|
|
429
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
430
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.CardTitle, { children: "Recent Invoices" }),
|
|
431
431
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ReceiptIcon, { className: "h-4 w-4 text-muted-foreground" })
|
|
432
432
|
] }),
|
|
433
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
433
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.CardContent, { children: invoices.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
434
434
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: "No invoices yet" }),
|
|
435
435
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: "Invoices will appear after your first billing cycle" })
|
|
436
436
|
] }) : latestInvoice ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
437
437
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
|
|
438
438
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold", children: formatAmount(latestInvoice.total, latestInvoice.currency) }),
|
|
439
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
439
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Badge, { variant: getStatusBadgeVariant2(latestInvoice.status), children: latestInvoice.status })
|
|
440
440
|
] }),
|
|
441
441
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: latestInvoice.stripeInvoiceNumber || `Invoice from ${formatDate2(latestInvoice.periodStart)}` }),
|
|
442
442
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-4 text-xs text-muted-foreground", children: [
|
|
@@ -476,24 +476,24 @@ function BillingUsageSummaryCard({
|
|
|
476
476
|
onViewDetailsClick
|
|
477
477
|
}) {
|
|
478
478
|
if (loading) {
|
|
479
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
480
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
481
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
479
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.Card, { children: [
|
|
480
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
481
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.CardTitle, { children: "Usage This Month" }),
|
|
482
482
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Activity, { className: "h-4 w-4 text-muted-foreground" })
|
|
483
483
|
] }),
|
|
484
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
485
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
486
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
484
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.CardContent, { children: [
|
|
485
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Skeleton, { className: "h-6 w-24 mb-2" }),
|
|
486
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Skeleton, { className: "h-4 w-32" })
|
|
487
487
|
] })
|
|
488
488
|
] });
|
|
489
489
|
}
|
|
490
490
|
if (error) {
|
|
491
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
492
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
493
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
491
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.Card, { children: [
|
|
492
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
493
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.CardTitle, { children: "Usage This Month" }),
|
|
494
494
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Activity, { className: "h-4 w-4 text-muted-foreground" })
|
|
495
495
|
] }),
|
|
496
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
496
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
|
|
497
497
|
] });
|
|
498
498
|
}
|
|
499
499
|
const totalUsage = Object.values(summaries).reduce((acc, summary) => {
|
|
@@ -501,12 +501,12 @@ function BillingUsageSummaryCard({
|
|
|
501
501
|
}, 0);
|
|
502
502
|
const primaryMeter = meters.find((m) => _optionalChain([summaries, 'access', _17 => _17[m.id], 'optionalAccess', _18 => _18.aggregatedValue]));
|
|
503
503
|
const primarySummary = primaryMeter ? summaries[primaryMeter.id] : null;
|
|
504
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
505
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
506
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
504
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onViewDetailsClick, children: [
|
|
505
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
506
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.CardTitle, { children: "Usage This Month" }),
|
|
507
507
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Activity, { className: "h-4 w-4 text-muted-foreground" })
|
|
508
508
|
] }),
|
|
509
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
509
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.CardContent, { children: meters.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
510
510
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: "No meters" }),
|
|
511
511
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: "No usage meters are configured" })
|
|
512
512
|
] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
@@ -612,7 +612,7 @@ function PaymentMethodForm({ onSuccess, onCancel, isLoading = false }) {
|
|
|
612
612
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex items-center justify-center py-8", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground", children: "Loading payment form..." }) });
|
|
613
613
|
}
|
|
614
614
|
if (!setupIntent && error) {
|
|
615
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
615
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Alert, { variant: "destructive", className: "bg-red-50 border-red-200", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.AlertDescription, { children: error }) });
|
|
616
616
|
}
|
|
617
617
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: handleSubmit, className: "flex flex-col gap-y-4", children: [
|
|
618
618
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rounded-md border border-gray-300 p-3", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -635,13 +635,13 @@ function PaymentMethodForm({ onSuccess, onCancel, isLoading = false }) {
|
|
|
635
635
|
}
|
|
636
636
|
) }),
|
|
637
637
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-2", children: [
|
|
638
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
639
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
638
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Checkbox, { id: "setAsDefault", checked: setAsDefault, onCheckedChange: (checked) => setSetAsDefault(!!checked) }),
|
|
639
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Label, { htmlFor: "setAsDefault", className: "cursor-pointer font-normal", children: "Set as default payment method" })
|
|
640
640
|
] }),
|
|
641
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
641
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Alert, { variant: "destructive", className: "bg-red-50 border-red-200", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.AlertDescription, { children: error }) }),
|
|
642
642
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-end gap-x-2", children: [
|
|
643
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
644
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
643
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Button, { type: "button", variant: "outline", onClick: onCancel, disabled: isSubmitting || isLoading, children: "Cancel" }),
|
|
644
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Button, { type: "submit", disabled: !stripe || isSubmitting || isLoading, children: isSubmitting ? "Processing..." : "Add Card" })
|
|
645
645
|
] })
|
|
646
646
|
] });
|
|
647
647
|
}
|
|
@@ -657,10 +657,10 @@ function PaymentMethodEditor({ open, onOpenChange, onSuccess }) {
|
|
|
657
657
|
const handleCancel = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
658
658
|
onOpenChange(false);
|
|
659
659
|
}, "handleCancel");
|
|
660
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
661
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
662
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
663
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
660
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.DialogContent, { className: "max-w-md", children: [
|
|
661
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.DialogHeader, { children: [
|
|
662
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.DialogTitle, { children: "Add Payment Method" }),
|
|
663
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.DialogDescription, { children: "Add a new payment method to your account. Your card information is securely processed by Stripe." })
|
|
664
664
|
] }),
|
|
665
665
|
open && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PaymentMethodForm, { onSuccess: handleSuccess, onCancel: handleCancel })
|
|
666
666
|
] }) });
|
|
@@ -721,16 +721,16 @@ function PaymentMethodCard({ paymentMethod, onUpdate }) {
|
|
|
721
721
|
}
|
|
722
722
|
}, "handleRemove");
|
|
723
723
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
724
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
725
|
-
isDefault && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
726
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
724
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.Card, { className: "relative", children: [
|
|
725
|
+
isDefault && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Badge, { variant: "softGreen", className: "absolute right-2 top-2", children: "Default" }),
|
|
726
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.CardHeader, { className: "flex flex-row items-center justify-between pb-2", children: [
|
|
727
727
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-2", children: [
|
|
728
728
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-2xl", children: brandIcon }),
|
|
729
729
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium capitalize", children: brand })
|
|
730
730
|
] }),
|
|
731
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
732
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
733
|
-
|
|
731
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.DropdownMenu, { children: [
|
|
732
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.DropdownMenuTrigger, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
733
|
+
_chunkRVK3JB33js.Button,
|
|
734
734
|
{
|
|
735
735
|
render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", {}),
|
|
736
736
|
nativeButton: false,
|
|
@@ -741,10 +741,10 @@ function PaymentMethodCard({ paymentMethod, onUpdate }) {
|
|
|
741
741
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.MoreVertical, { className: "h-4 w-4" })
|
|
742
742
|
}
|
|
743
743
|
) }),
|
|
744
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
745
|
-
!isDefault && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
744
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.DropdownMenuContent, { align: "end", children: [
|
|
745
|
+
!isDefault && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.DropdownMenuItem, { onClick: handleSetDefault, disabled: loading, children: "Set as Default" }),
|
|
746
746
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
747
|
-
|
|
747
|
+
_chunkRVK3JB33js.DropdownMenuItem,
|
|
748
748
|
{
|
|
749
749
|
onClick: () => setShowRemoveDialog(true),
|
|
750
750
|
disabled: loading,
|
|
@@ -755,7 +755,7 @@ function PaymentMethodCard({ paymentMethod, onUpdate }) {
|
|
|
755
755
|
] })
|
|
756
756
|
] })
|
|
757
757
|
] }),
|
|
758
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
758
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-1", children: [
|
|
759
759
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "text-lg font-semibold", children: [
|
|
760
760
|
"\u2022\u2022\u2022\u2022 ",
|
|
761
761
|
last4
|
|
@@ -768,17 +768,17 @@ function PaymentMethodCard({ paymentMethod, onUpdate }) {
|
|
|
768
768
|
] })
|
|
769
769
|
] }) })
|
|
770
770
|
] }),
|
|
771
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
772
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
773
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
774
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
771
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.AlertDialog, { open: showRemoveDialog, onOpenChange: setShowRemoveDialog, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.AlertDialogContent, { children: [
|
|
772
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.AlertDialogHeader, { children: [
|
|
773
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.AlertDialogTitle, { children: "Remove Payment Method" }),
|
|
774
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.AlertDialogDescription, { children: [
|
|
775
775
|
"Are you sure you want to remove this payment method? This action cannot be undone.",
|
|
776
776
|
isDefault && " This is your default payment method."
|
|
777
777
|
] })
|
|
778
778
|
] }),
|
|
779
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
780
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
781
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
779
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.AlertDialogFooter, { children: [
|
|
780
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.AlertDialogCancel, { disabled: loading, children: "Cancel" }),
|
|
781
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.AlertDialogAction, { onClick: handleRemove, disabled: loading, className: "bg-red-600 hover:bg-red-700", children: loading ? "Removing..." : "Remove" })
|
|
782
782
|
] })
|
|
783
783
|
] }) })
|
|
784
784
|
] });
|
|
@@ -821,14 +821,14 @@ function PaymentMethodsContainer() {
|
|
|
821
821
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-8 w-8" }),
|
|
822
822
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h1", { className: "text-primary text-3xl font-semibold", children: "Payment Methods" })
|
|
823
823
|
] }),
|
|
824
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
824
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Button, { onClick: () => setShowAddPaymentMethod(true), children: "Add Payment Method" })
|
|
825
825
|
] }),
|
|
826
826
|
paymentMethods.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col items-center justify-center gap-y-4 rounded-lg border-2 border-dashed border-gray-300 bg-muted/50 p-12", children: [
|
|
827
827
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-16 w-16 text-muted-foreground" }),
|
|
828
828
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-center", children: [
|
|
829
829
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "mb-2 text-sm font-medium", children: "No payment methods" }),
|
|
830
830
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "mb-4 text-muted-foreground", children: "Add a payment method to enable subscriptions and secure checkout." }),
|
|
831
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
831
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Button, { onClick: () => setShowAddPaymentMethod(true), children: "Add Your First Card" })
|
|
832
832
|
] })
|
|
833
833
|
] }),
|
|
834
834
|
paymentMethods.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PaymentMethodsList, { paymentMethods, onUpdate: loadPaymentMethods }),
|
|
@@ -926,7 +926,7 @@ var statusConfig = {
|
|
|
926
926
|
};
|
|
927
927
|
function InvoiceStatusBadge({ status }) {
|
|
928
928
|
const config = statusConfig[status] || statusConfig["draft" /* DRAFT */];
|
|
929
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
929
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Badge, { variant: config.variant, children: config.label });
|
|
930
930
|
}
|
|
931
931
|
_chunk7QVYU63Ejs.__name.call(void 0, InvoiceStatusBadge, "InvoiceStatusBadge");
|
|
932
932
|
|
|
@@ -957,13 +957,13 @@ function InvoiceDetails({
|
|
|
957
957
|
return invoice.stripeInvoiceId.slice(-8);
|
|
958
958
|
}, "getInvoiceNumber");
|
|
959
959
|
const productName = _optionalChain([invoice, 'access', _29 => _29.subscription, 'optionalAccess', _30 => _30.price, 'optionalAccess', _31 => _31.product, 'optionalAccess', _32 => _32.name]) || "Subscription";
|
|
960
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
961
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
962
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
960
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.DialogContent, { className: "max-w-2xl", children: [
|
|
961
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.DialogHeader, { children: [
|
|
962
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.DialogTitle, { children: [
|
|
963
963
|
"Invoice ",
|
|
964
964
|
getInvoiceNumber()
|
|
965
965
|
] }),
|
|
966
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
966
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.DialogDescription, { children: formatDate3(invoice.periodStart) })
|
|
967
967
|
] }),
|
|
968
968
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-6", children: [
|
|
969
969
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-3", children: [
|
|
@@ -1028,15 +1028,15 @@ function InvoiceDetails({
|
|
|
1028
1028
|
] })
|
|
1029
1029
|
] }),
|
|
1030
1030
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-wrap gap-2 pt-4 border-t", children: [
|
|
1031
|
-
invoice.stripePdfUrl && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1031
|
+
invoice.stripePdfUrl && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.Button, { variant: "outline", onClick: handleDownloadPDF, children: [
|
|
1032
1032
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Download, { className: "mr-2 h-4 w-4" }),
|
|
1033
1033
|
"Download PDF"
|
|
1034
1034
|
] }),
|
|
1035
|
-
invoice.status === "open" /* OPEN */ && invoice.attempted && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1035
|
+
invoice.status === "open" /* OPEN */ && invoice.attempted && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.Button, { variant: "default", onClick: handleRetryPayment, children: [
|
|
1036
1036
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.RefreshCw, { className: "mr-2 h-4 w-4" }),
|
|
1037
1037
|
"Retry Payment"
|
|
1038
1038
|
] }),
|
|
1039
|
-
invoice.stripeHostedInvoiceUrl && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1039
|
+
invoice.stripeHostedInvoiceUrl && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.Button, { variant: "outline", onClick: handleViewInStripe, children: [
|
|
1040
1040
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ExternalLink, { className: "mr-2 h-4 w-4" }),
|
|
1041
1041
|
"View in Stripe"
|
|
1042
1042
|
] })
|
|
@@ -1060,30 +1060,30 @@ function InvoicesList({ invoices, onInvoicesChange }) {
|
|
|
1060
1060
|
return invoice.stripeInvoiceId.slice(-8);
|
|
1061
1061
|
}, "getInvoiceNumber");
|
|
1062
1062
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1063
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border rounded-lg overflow-clip", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1064
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1065
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1066
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1067
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1068
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1069
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1063
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border rounded-lg overflow-clip", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.Table, { children: [
|
|
1064
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TableHeader, { className: "bg-muted", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.TableRow, { children: [
|
|
1065
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TableHead, { children: "Invoice #" }),
|
|
1066
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TableHead, { children: "Date" }),
|
|
1067
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TableHead, { children: "Status" }),
|
|
1068
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TableHead, { className: "text-right", children: "Amount" }),
|
|
1069
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TableHead, { children: "Period" })
|
|
1070
1070
|
] }) }),
|
|
1071
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1071
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TableBody, { children: invoices.map((invoice) => {
|
|
1072
1072
|
const invoiceNumber = getInvoiceNumber(invoice);
|
|
1073
1073
|
const date = formatDate3(invoice.periodStart);
|
|
1074
1074
|
const amount = formatCurrency(invoice.total, invoice.currency);
|
|
1075
1075
|
const period = `${formatDate3(invoice.periodStart)} - ${formatDate3(invoice.periodEnd)}`;
|
|
1076
1076
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1077
|
-
|
|
1077
|
+
_chunkRVK3JB33js.TableRow,
|
|
1078
1078
|
{
|
|
1079
1079
|
onClick: () => handleRowClick(invoice),
|
|
1080
1080
|
className: "cursor-pointer hover:bg-muted/50",
|
|
1081
1081
|
children: [
|
|
1082
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1083
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1084
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1085
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1086
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1082
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TableCell, { className: "font-medium", children: invoiceNumber }),
|
|
1083
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TableCell, { className: "text-muted-foreground text-xs", children: date }),
|
|
1084
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TableCell, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InvoiceStatusBadge, { status: invoice.status }) }),
|
|
1085
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TableCell, { className: "text-right font-medium", children: amount }),
|
|
1086
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TableCell, { className: "text-muted-foreground text-xs", children: period })
|
|
1087
1087
|
]
|
|
1088
1088
|
},
|
|
1089
1089
|
invoice.id
|
|
@@ -1132,12 +1132,12 @@ function InvoicesContainer() {
|
|
|
1132
1132
|
setStatusFilter(value);
|
|
1133
1133
|
}, "handleFilterChange");
|
|
1134
1134
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-4", children: [
|
|
1135
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1136
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1137
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1138
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1139
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1140
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1135
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Tabs, { value: statusFilter, onValueChange: handleFilterChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.TabsList, { children: [
|
|
1136
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TabsTrigger, { value: "all", children: "All" }),
|
|
1137
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TabsTrigger, { value: "paid" /* PAID */, children: "Paid" }),
|
|
1138
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TabsTrigger, { value: "open" /* OPEN */, children: "Open" }),
|
|
1139
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TabsTrigger, { value: "void" /* VOID */, children: "Void" }),
|
|
1140
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TabsTrigger, { value: "uncollectible" /* UNCOLLECTIBLE */, children: "Uncollectible" })
|
|
1141
1141
|
] }) }),
|
|
1142
1142
|
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-center py-8 text-muted-foreground", children: "Loading invoices..." }),
|
|
1143
1143
|
!loading && invoices.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "border border-dashed border-gray-300 rounded-lg p-8 text-center", children: [
|
|
@@ -1197,19 +1197,19 @@ function CancelSubscriptionDialog({
|
|
|
1197
1197
|
}
|
|
1198
1198
|
}, "onSubmit");
|
|
1199
1199
|
const periodEndDate = formatDate3(subscription.currentPeriodEnd);
|
|
1200
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1201
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1202
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1203
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1200
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.DialogContent, { className: "max-w-md", children: [
|
|
1201
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.DialogHeader, { children: [
|
|
1202
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.DialogTitle, { children: "Cancel Subscription" }),
|
|
1203
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.DialogDescription, { children: "Are you sure you want to cancel this subscription? This action cannot be undone." })
|
|
1204
1204
|
] }),
|
|
1205
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1205
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Form, { ...form, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: form.handleSubmit(onSubmit), className: "flex flex-col gap-y-4", children: [
|
|
1206
1206
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bg-blue-50 border border-blue-200 rounded-lg p-3 text-sm text-blue-800", children: [
|
|
1207
1207
|
"Your subscription will remain active until ",
|
|
1208
1208
|
periodEndDate,
|
|
1209
1209
|
". You can continue using the service until then."
|
|
1210
1210
|
] }),
|
|
1211
1211
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1212
|
-
|
|
1212
|
+
_chunkRVK3JB33js.FormTextarea,
|
|
1213
1213
|
{
|
|
1214
1214
|
form,
|
|
1215
1215
|
id: "reason",
|
|
@@ -1219,8 +1219,8 @@ function CancelSubscriptionDialog({
|
|
|
1219
1219
|
}
|
|
1220
1220
|
),
|
|
1221
1221
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex gap-x-2 justify-end pt-2", children: [
|
|
1222
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1223
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1222
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Button, { type: "button", variant: "outline", onClick: () => onOpenChange(false), disabled: isSubmitting, children: "Keep Subscription" }),
|
|
1223
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Button, { type: "submit", variant: "destructive", disabled: isSubmitting, children: isSubmitting ? "Canceling..." : "Confirm Cancellation" })
|
|
1224
1224
|
] })
|
|
1225
1225
|
] }) })
|
|
1226
1226
|
] }) });
|
|
@@ -1269,7 +1269,7 @@ var cancelingConfig = {
|
|
|
1269
1269
|
};
|
|
1270
1270
|
function SubscriptionStatusBadge({ status, cancelAtPeriodEnd }) {
|
|
1271
1271
|
const config = cancelAtPeriodEnd ? cancelingConfig : statusConfig2[status] || statusConfig2["canceled" /* CANCELED */];
|
|
1272
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1272
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Badge, { variant: config.variant, children: config.label });
|
|
1273
1273
|
}
|
|
1274
1274
|
_chunk7QVYU63Ejs.__name.call(void 0, SubscriptionStatusBadge, "SubscriptionStatusBadge");
|
|
1275
1275
|
|
|
@@ -1342,10 +1342,10 @@ function SubscriptionDetails({
|
|
|
1342
1342
|
const canResume = subscription.status === "paused" /* PAUSED */;
|
|
1343
1343
|
const canCancel = subscription.status === "active" /* ACTIVE */ || subscription.status === "trialing" /* TRIALING */ || subscription.status === "paused" /* PAUSED */;
|
|
1344
1344
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1345
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1346
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1347
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1348
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1345
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.DialogContent, { className: "max-w-2xl", children: [
|
|
1346
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.DialogHeader, { children: [
|
|
1347
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.DialogTitle, { children: "Subscription Details" }),
|
|
1348
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.DialogDescription, { children: "View and manage your subscription" })
|
|
1349
1349
|
] }),
|
|
1350
1350
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-6", children: [
|
|
1351
1351
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-3", children: [
|
|
@@ -1387,11 +1387,11 @@ function SubscriptionDetails({
|
|
|
1387
1387
|
"."
|
|
1388
1388
|
] }) }),
|
|
1389
1389
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-wrap gap-2 pt-4 border-t", children: [
|
|
1390
|
-
onChangePlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1391
|
-
canPause && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1392
|
-
canResume && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1393
|
-
canCancel && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1394
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1390
|
+
onChangePlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Button, { variant: "default", onClick: () => onChangePlan(subscription), children: "Change Plan" }),
|
|
1391
|
+
canPause && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Button, { variant: "outline", onClick: handlePause, disabled: isProcessing, children: isProcessing ? "Pausing..." : "Pause" }),
|
|
1392
|
+
canResume && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Button, { variant: "outline", onClick: handleResume, disabled: isProcessing, children: isProcessing ? "Resuming..." : "Resume" }),
|
|
1393
|
+
canCancel && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Button, { variant: "destructive", onClick: () => setShowCancel(true), children: "Cancel" }),
|
|
1394
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Button, { variant: "outline", onClick: handleManageViaPortal, children: "Manage via Portal" })
|
|
1395
1395
|
] })
|
|
1396
1396
|
] })
|
|
1397
1397
|
] }) }),
|
|
@@ -1438,36 +1438,36 @@ function SubscriptionsList({ subscriptions, onSubscriptionsChange, onChangePlan
|
|
|
1438
1438
|
setSelectedSub(subscription);
|
|
1439
1439
|
}, "handleRowClick");
|
|
1440
1440
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1441
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border rounded-lg overflow-clip", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1442
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1443
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1444
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1445
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1446
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1447
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1441
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border rounded-lg overflow-clip", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.Table, { children: [
|
|
1442
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TableHeader, { className: "bg-muted", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.TableRow, { children: [
|
|
1443
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TableHead, { children: "Status" }),
|
|
1444
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TableHead, { children: "Plan" }),
|
|
1445
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TableHead, { children: "Period" }),
|
|
1446
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TableHead, { className: "text-right", children: "Amount" }),
|
|
1447
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TableHead, { className: "text-right", children: "Actions" })
|
|
1448
1448
|
] }) }),
|
|
1449
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1449
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TableBody, { children: subscriptions.map((subscription) => {
|
|
1450
1450
|
const price = subscription.price;
|
|
1451
1451
|
const amount = _optionalChain([price, 'optionalAccess', _42 => _42.unitAmount]) ? formatCurrency(price.unitAmount, price.currency) : "0";
|
|
1452
1452
|
const period = `${formatDate3(subscription.currentPeriodStart)} - ${formatDate3(subscription.currentPeriodEnd)}`;
|
|
1453
1453
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1454
|
-
|
|
1454
|
+
_chunkRVK3JB33js.TableRow,
|
|
1455
1455
|
{
|
|
1456
1456
|
onClick: () => handleRowClick(subscription),
|
|
1457
1457
|
className: "cursor-pointer hover:bg-muted/50",
|
|
1458
1458
|
children: [
|
|
1459
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1459
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TableCell, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1460
1460
|
SubscriptionStatusBadge,
|
|
1461
1461
|
{
|
|
1462
1462
|
status: subscription.status,
|
|
1463
1463
|
cancelAtPeriodEnd: subscription.cancelAtPeriodEnd
|
|
1464
1464
|
}
|
|
1465
1465
|
) }),
|
|
1466
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1467
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1468
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1469
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1470
|
-
|
|
1466
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TableCell, { className: "font-medium", children: formatPlanName3(price) }),
|
|
1467
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TableCell, { className: "text-muted-foreground text-sm", children: period }),
|
|
1468
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TableCell, { className: "text-right font-medium", children: amount }),
|
|
1469
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TableCell, { className: "text-right", children: (subscription.status === "active" /* ACTIVE */ || subscription.status === "trialing" /* TRIALING */) && onChangePlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1470
|
+
_chunkRVK3JB33js.Button,
|
|
1471
1471
|
{
|
|
1472
1472
|
size: "sm",
|
|
1473
1473
|
variant: "outline",
|
|
@@ -1535,7 +1535,7 @@ function SubscriptionsContainer({ onOpenWizard, hasActiveRecurringSubscription }
|
|
|
1535
1535
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-8 w-8" }),
|
|
1536
1536
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h1", { className: "text-primary text-3xl font-semibold", children: "Subscriptions" })
|
|
1537
1537
|
] }),
|
|
1538
|
-
subscriptions.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1538
|
+
subscriptions.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Button, { onClick: () => _optionalChain([onOpenWizard, 'optionalCall', _43 => _43()]), children: hasActiveRecurringSubscription ? "Purchase Add-ons" : "Subscribe to a Plan" })
|
|
1539
1539
|
] }),
|
|
1540
1540
|
criticalSubscriptions.map((subscription) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BillingAlertBanner, { subscription }, subscription.id)),
|
|
1541
1541
|
subscriptions.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col items-center justify-center py-12 space-y-4", children: [
|
|
@@ -1543,7 +1543,7 @@ function SubscriptionsContainer({ onOpenWizard, hasActiveRecurringSubscription }
|
|
|
1543
1543
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-center", children: [
|
|
1544
1544
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-sm font-medium mb-2", children: "No Active Subscriptions" }),
|
|
1545
1545
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground mb-6", children: "Choose a subscription plan to get started with our services." }),
|
|
1546
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1546
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Button, { onClick: () => _optionalChain([onOpenWizard, 'optionalCall', _44 => _44()]), children: "Subscribe to a Plan" })
|
|
1547
1547
|
] })
|
|
1548
1548
|
] }),
|
|
1549
1549
|
subscriptions.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1564,9 +1564,9 @@ function IntervalToggle({ value, onChange, hasMonthly, hasYearly }) {
|
|
|
1564
1564
|
if (!hasMonthly || !hasYearly) {
|
|
1565
1565
|
return null;
|
|
1566
1566
|
}
|
|
1567
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1568
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1569
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1567
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Tabs, { value, onValueChange: (v) => onChange(v), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.TabsList, { children: [
|
|
1568
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TabsTrigger, { value: "month", children: "Monthly" }),
|
|
1569
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TabsTrigger, { value: "year", children: "Yearly" })
|
|
1570
1570
|
] }) });
|
|
1571
1571
|
}
|
|
1572
1572
|
_chunk7QVYU63Ejs.__name.call(void 0, IntervalToggle, "IntervalToggle");
|
|
@@ -1598,7 +1598,7 @@ function PricingCard({
|
|
|
1598
1598
|
}
|
|
1599
1599
|
}, "handleClick");
|
|
1600
1600
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1601
|
-
|
|
1601
|
+
_chunkRVK3JB33js.Card,
|
|
1602
1602
|
{
|
|
1603
1603
|
role: "radio",
|
|
1604
1604
|
"aria-checked": isSelected,
|
|
@@ -1616,9 +1616,9 @@ function PricingCard({
|
|
|
1616
1616
|
isLoading && "pointer-events-none"
|
|
1617
1617
|
),
|
|
1618
1618
|
children: [
|
|
1619
|
-
isCurrentPlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1620
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1621
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1619
|
+
isCurrentPlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Badge, { variant: "secondary", className: "absolute top-2 right-2", children: "Current" }),
|
|
1620
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.CardHeader, { className: "pb-2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-sm font-medium", children: description }) }),
|
|
1621
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.CardContent, { className: "pb-4 grow", children: [
|
|
1622
1622
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mb-4", children: [
|
|
1623
1623
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-3xl font-bold", children: formattedPrice }),
|
|
1624
1624
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground ml-1", children: interval })
|
|
@@ -1628,8 +1628,8 @@ function PricingCard({
|
|
|
1628
1628
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm text-muted-foreground", children: feature })
|
|
1629
1629
|
] }, index)) })
|
|
1630
1630
|
] }),
|
|
1631
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1632
|
-
|
|
1631
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.CardFooter, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1632
|
+
_chunkRVK3JB33js.Button,
|
|
1633
1633
|
{
|
|
1634
1634
|
variant: isCurrentPlan ? "secondary" : isSelected ? "default" : "outline",
|
|
1635
1635
|
className: "w-full",
|
|
@@ -1657,7 +1657,7 @@ function ProductPricingRow({
|
|
|
1657
1657
|
return null;
|
|
1658
1658
|
}
|
|
1659
1659
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-3", children: [
|
|
1660
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1660
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.SectionHeader, { children: product.name }),
|
|
1661
1661
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1662
1662
|
"div",
|
|
1663
1663
|
{
|
|
@@ -1757,15 +1757,15 @@ function ProductPricingList({
|
|
|
1757
1757
|
_chunk7QVYU63Ejs.__name.call(void 0, ProductPricingList, "ProductPricingList");
|
|
1758
1758
|
function ProductPricingListSkeleton() {
|
|
1759
1759
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "space-y-6", children: [1, 2].map((rowIndex) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-3", children: [
|
|
1760
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1760
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Skeleton, { className: "h-6 w-32" }),
|
|
1761
1761
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4", children: [1, 2, 3].map((cardIndex) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "p-4 rounded-lg border animate-pulse space-y-3", children: [
|
|
1762
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1763
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1762
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Skeleton, { className: "h-6 w-24" }),
|
|
1763
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Skeleton, { className: "h-8 w-32" }),
|
|
1764
1764
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
1765
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1766
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1765
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Skeleton, { className: "h-4 w-full" }),
|
|
1766
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Skeleton, { className: "h-4 w-3/4" })
|
|
1767
1767
|
] }),
|
|
1768
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1768
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Skeleton, { className: "h-10 w-full" })
|
|
1769
1769
|
] }, cardIndex)) })
|
|
1770
1770
|
] }, rowIndex)) });
|
|
1771
1771
|
}
|
|
@@ -1820,8 +1820,8 @@ function SubscriptionConfirmation({ price, isLoading, onConfirm, onCancel }) {
|
|
|
1820
1820
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: feature })
|
|
1821
1821
|
] }, index)) }),
|
|
1822
1822
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-end gap-3 pt-2 border-t border-accent/30", children: [
|
|
1823
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1824
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1823
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Button, { variant: "outline", onClick: onCancel, disabled: isLoading, children: "Cancel" }),
|
|
1824
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Button, { onClick: onConfirm, disabled: isLoading, children: isLoading ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1825
1825
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Loader2, { className: "h-4 w-4 animate-spin mr-2" }),
|
|
1826
1826
|
"Processing..."
|
|
1827
1827
|
] }) : "Subscribe" })
|
|
@@ -2151,7 +2151,7 @@ function WizardStepPlanSelection({
|
|
|
2151
2151
|
onSelectPrice: handleSelectPrice
|
|
2152
2152
|
}
|
|
2153
2153
|
),
|
|
2154
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex justify-end pt-4 border-t", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2154
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex justify-end pt-4 border-t", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Button, { onClick: onNext, disabled: !selectedPrice || isProcessing, children: isProcessing ? "Loading..." : "Next: Review" }) })
|
|
2155
2155
|
] });
|
|
2156
2156
|
}
|
|
2157
2157
|
_chunk7QVYU63Ejs.__name.call(void 0, WizardStepPlanSelection, "WizardStepPlanSelection");
|
|
@@ -2212,7 +2212,7 @@ function PromoCodeInput({
|
|
|
2212
2212
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-success text-sm", children: formatDiscount(appliedCode) })
|
|
2213
2213
|
] }),
|
|
2214
2214
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2215
|
-
|
|
2215
|
+
_chunkRVK3JB33js.Button,
|
|
2216
2216
|
{
|
|
2217
2217
|
variant: "ghost",
|
|
2218
2218
|
size: "sm",
|
|
@@ -2229,7 +2229,7 @@ function PromoCodeInput({
|
|
|
2229
2229
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
2230
2230
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex gap-2", children: [
|
|
2231
2231
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2232
|
-
|
|
2232
|
+
_chunkRVK3JB33js.Input,
|
|
2233
2233
|
{
|
|
2234
2234
|
placeholder: "Enter promo code",
|
|
2235
2235
|
value: code,
|
|
@@ -2239,7 +2239,7 @@ function PromoCodeInput({
|
|
|
2239
2239
|
className: "flex-1"
|
|
2240
2240
|
}
|
|
2241
2241
|
),
|
|
2242
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2242
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Button, { variant: "outline", onClick: handleApply, disabled: disabled || isValidating || !code.trim(), children: isValidating ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Loader2, { className: "h-4 w-4 animate-spin" }) : "Apply" })
|
|
2243
2243
|
] }),
|
|
2244
2244
|
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error })
|
|
2245
2245
|
] });
|
|
@@ -2311,7 +2311,7 @@ function WizardStepReview({
|
|
|
2311
2311
|
const discountDescription = getDiscountDescription();
|
|
2312
2312
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-6", children: [
|
|
2313
2313
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bg-muted/50 rounded-lg p-4 space-y-3", children: [
|
|
2314
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2314
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.SectionHeader, { children: "Selected Plan" }),
|
|
2315
2315
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between items-center", children: [
|
|
2316
2316
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
|
|
2317
2317
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "font-medium", children: _optionalChain([selectedPrice, 'access', _92 => _92.product, 'optionalAccess', _93 => _93.name]) }),
|
|
@@ -2321,7 +2321,7 @@ function WizardStepReview({
|
|
|
2321
2321
|
discountedPrice !== null ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2322
2322
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground line-through", children: formatCurrency(selectedPrice.unitAmount || 0, selectedPrice.currency) }),
|
|
2323
2323
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-success text-lg font-semibold", children: formatCurrency(discountedPrice, selectedPrice.currency) }),
|
|
2324
|
-
discountDescription && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2324
|
+
discountDescription && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Badge, { variant: "softGreen", children: discountDescription })
|
|
2325
2325
|
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "font-semibold text-lg", children: formatCurrency(selectedPrice.unitAmount || 0, selectedPrice.currency) }),
|
|
2326
2326
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: formatInterval2(selectedPrice) })
|
|
2327
2327
|
] })
|
|
@@ -2363,15 +2363,15 @@ function WizardStepReview({
|
|
|
2363
2363
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h4", { className: "font-medium", children: "Payment Method" }),
|
|
2364
2364
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: hasPaymentMethod ? "A payment method is on file" : "No payment method on file" })
|
|
2365
2365
|
] }),
|
|
2366
|
-
!hasPaymentMethod && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2366
|
+
!hasPaymentMethod && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Button, { variant: "outline", onClick: onAddPaymentMethod, children: "Add Payment Method" })
|
|
2367
2367
|
] }) }),
|
|
2368
|
-
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2368
|
+
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.Alert, { variant: "destructive", children: [
|
|
2369
2369
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.AlertCircle, { className: "h-4 w-4" }),
|
|
2370
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2370
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.AlertDescription, { children: error })
|
|
2371
2371
|
] }),
|
|
2372
2372
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between pt-4 border-t", children: [
|
|
2373
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2374
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2373
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Button, { variant: "outline", onClick: onBack, disabled: isProcessing, children: "Back" }),
|
|
2374
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Button, { onClick: hasPaymentMethod ? onConfirm : onAddPaymentMethod, disabled: isProcessing, children: isProcessing ? "Processing..." : hasPaymentMethod ? isChangingPlan ? "Confirm Plan Change" : "Subscribe Now" : "Add Payment Method" })
|
|
2375
2375
|
] })
|
|
2376
2376
|
] });
|
|
2377
2377
|
}
|
|
@@ -2382,7 +2382,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, WizardStepReview, "WizardStepReview");
|
|
|
2382
2382
|
function WizardStepPaymentMethod({ onBack, onSuccess, isProcessing }) {
|
|
2383
2383
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-6", children: [
|
|
2384
2384
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-center", children: [
|
|
2385
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2385
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.SectionHeader, { children: "Add Payment Method" }),
|
|
2386
2386
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: "Enter your card details to complete your subscription" })
|
|
2387
2387
|
] }),
|
|
2388
2388
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, PaymentMethodForm, { onSuccess, onCancel: onBack, isLoading: isProcessing })
|
|
@@ -2424,10 +2424,10 @@ function SubscriptionWizard({
|
|
|
2424
2424
|
const isChangePlanMode = !!subscription;
|
|
2425
2425
|
const dialogTitle = subscription ? "Change Subscription Plan" : isPurchasingAddons ? "Purchase Add-ons" : "Subscribe to a Plan";
|
|
2426
2426
|
const dialogDescription = subscription ? "Select a new plan for your subscription" : isPurchasingAddons ? "Select one-time products to purchase" : "Choose a subscription plan to get started";
|
|
2427
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2428
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2429
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2430
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2427
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.DialogContent, { className: "max-w-2xl", children: [
|
|
2428
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.DialogHeader, { children: [
|
|
2429
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.DialogTitle, { children: dialogTitle }),
|
|
2430
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.DialogDescription, { children: dialogDescription })
|
|
2431
2431
|
] }),
|
|
2432
2432
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, WizardProgressIndicator, { currentStep: state.step }),
|
|
2433
2433
|
state.step === "plan-selection" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -2510,15 +2510,15 @@ function UsageSummaryCard({ meter, summary }) {
|
|
|
2510
2510
|
const progressWidth = percentage !== null ? Math.min(percentage, 100) : 0;
|
|
2511
2511
|
const displayName = meter.displayName || meter.eventName;
|
|
2512
2512
|
const hasLimit = limit !== null && limit !== void 0;
|
|
2513
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2514
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2513
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.Card, { children: [
|
|
2514
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.CardHeader, { className: "flex flex-row items-center gap-x-3 pb-3", children: [
|
|
2515
2515
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex h-10 w-10 items-center justify-center rounded-lg bg-blue-100 text-blue-600", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Activity, { className: "h-5 w-5" }) }),
|
|
2516
2516
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col", children: [
|
|
2517
2517
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-sm font-medium", children: displayName }),
|
|
2518
2518
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground text-xs", children: meter.id })
|
|
2519
2519
|
] })
|
|
2520
2520
|
] }),
|
|
2521
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2521
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.CardContent, { className: "flex flex-col gap-y-4", children: [
|
|
2522
2522
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
|
|
2523
2523
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-3xl font-bold", children: currentUsage.toLocaleString() }),
|
|
2524
2524
|
hasLimit && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "text-muted-foreground text-sm", children: [
|
|
@@ -2645,22 +2645,22 @@ function UsageHistoryTable({ usageRecords }) {
|
|
|
2645
2645
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rounded-lg border p-8 text-center", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground", children: "No usage history available." }) });
|
|
2646
2646
|
}
|
|
2647
2647
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
2648
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2649
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "overflow-clip rounded-lg border", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2650
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2651
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2652
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2653
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2654
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2648
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.SectionHeader, { level: 2, children: "Usage History" }),
|
|
2649
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "overflow-clip rounded-lg border", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.Table, { children: [
|
|
2650
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TableHeader, { className: "bg-muted", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.TableRow, { children: [
|
|
2651
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TableHead, { children: "Date & Time" }),
|
|
2652
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TableHead, { children: "Meter Event" }),
|
|
2653
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TableHead, { className: "text-right", children: "Quantity" }),
|
|
2654
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TableHead, { children: "Event ID" })
|
|
2655
2655
|
] }) }),
|
|
2656
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2656
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TableBody, { children: usageRecords.map((record) => {
|
|
2657
2657
|
const dateTime = formatDateTime(record.timestamp);
|
|
2658
2658
|
const quantity = record.quantity.toLocaleString();
|
|
2659
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2660
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2661
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2662
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2663
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2659
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.TableRow, { children: [
|
|
2660
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TableCell, { className: "font-medium", children: dateTime }),
|
|
2661
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TableCell, { className: "text-muted-foreground", children: record.meterEventName }),
|
|
2662
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TableCell, { className: "text-right font-medium", children: quantity }),
|
|
2663
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.TableCell, { className: "text-muted-foreground text-sm tabular-nums", children: record.stripeEventId })
|
|
2664
2664
|
] }, record.id);
|
|
2665
2665
|
}) })
|
|
2666
2666
|
] }) })
|
|
@@ -2671,8 +2671,8 @@ _chunk7QVYU63Ejs.__name.call(void 0, UsageHistoryTable, "UsageHistoryTable");
|
|
|
2671
2671
|
// src/features/billing/components/modals/BillingDetailModal.tsx
|
|
2672
2672
|
|
|
2673
2673
|
function BillingDetailModal({ open, onOpenChange, title, children, className }) {
|
|
2674
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2675
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2674
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.DialogContent, { className: _nullishCoalesce(className, () => ( "max-w-4xl max-h-[90vh] overflow-y-auto")), children: [
|
|
2675
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.DialogHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.DialogTitle, { children: title }) }),
|
|
2676
2676
|
children
|
|
2677
2677
|
] }) });
|
|
2678
2678
|
}
|
|
@@ -2689,7 +2689,7 @@ function BillingAlertBanner({ subscription, onUpdatePayment, onAddPayment }) {
|
|
|
2689
2689
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-destructive text-sm font-medium", children: "Payment Failed" }),
|
|
2690
2690
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive mt-1 text-sm", children: "Your last payment failed. Please update your payment method to avoid service interruption." })
|
|
2691
2691
|
] }),
|
|
2692
|
-
onUpdatePayment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2692
|
+
onUpdatePayment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Button, { variant: "outline", size: "sm", onClick: onUpdatePayment, className: "text-destructive border-red-300", children: "Update Payment Method" })
|
|
2693
2693
|
] });
|
|
2694
2694
|
}
|
|
2695
2695
|
if (subscription.status === "trialing" /* TRIALING */ && subscription.trialEnd) {
|
|
@@ -2709,7 +2709,7 @@ function BillingAlertBanner({ subscription, onUpdatePayment, onAddPayment }) {
|
|
|
2709
2709
|
". Add a payment method to continue your subscription."
|
|
2710
2710
|
] })
|
|
2711
2711
|
] }),
|
|
2712
|
-
onAddPayment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2712
|
+
onAddPayment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Button, { variant: "outline", size: "sm", onClick: onAddPayment, className: "text-warning border-yellow-300", children: "Add Payment Method" })
|
|
2713
2713
|
] });
|
|
2714
2714
|
}
|
|
2715
2715
|
}
|
|
@@ -2933,18 +2933,18 @@ function BillingDashboardContainer() {
|
|
|
2933
2933
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Wallet, { className: "h-8 w-8" }),
|
|
2934
2934
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h1", { className: "text-primary text-3xl font-semibold", children: "Billing" })
|
|
2935
2935
|
] }),
|
|
2936
|
-
isInitialLoading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2937
|
-
noCustomerExists && !isInitialLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2938
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2936
|
+
isInitialLoading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.CardContent, { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Loader2, { className: "h-8 w-8 animate-spin text-muted-foreground" }) }) }),
|
|
2937
|
+
noCustomerExists && !isInitialLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.Card, { children: [
|
|
2938
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.CardHeader, { className: "text-center", children: [
|
|
2939
2939
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-primary/10", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-8 w-8 text-primary" }) }),
|
|
2940
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2941
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2940
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.CardTitle, { children: "Set Up Billing" }),
|
|
2941
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.CardDescription, { children: "Your company doesn't have a billing account yet. Set one up to manage subscriptions, payment methods, and view invoices." })
|
|
2942
2942
|
] }),
|
|
2943
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2943
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.CardContent, { className: "flex justify-center pb-8", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Button, { onClick: handleCreateCustomer, disabled: creatingCustomer, size: "lg", children: creatingCustomer ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2944
2944
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Loader2, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
2945
2945
|
"Setting up..."
|
|
2946
2946
|
] }) : "Set Up Billing Account" }) }),
|
|
2947
|
-
errors.customer && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2947
|
+
errors.customer && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.CardContent, { className: "pt-0", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-center text-destructive text-xs/relaxed", children: errors.customer }) })
|
|
2948
2948
|
] }),
|
|
2949
2949
|
!noCustomerExists && !isInitialLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2950
2950
|
criticalSubscriptions.map((subscription) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -3260,10 +3260,10 @@ function PriceEditor({ productId, price, open, onOpenChange, onSuccess }) {
|
|
|
3260
3260
|
{ id: "licensed", text: "Licensed (per unit)" },
|
|
3261
3261
|
{ id: "metered", text: "Metered (usage-based)" }
|
|
3262
3262
|
];
|
|
3263
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3264
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3265
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3266
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3263
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.DialogContent, { className: "max-w-2xl", children: [
|
|
3264
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.DialogHeader, { children: [
|
|
3265
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.DialogTitle, { children: isEditMode ? "Edit Price" : "Create Price" }),
|
|
3266
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.DialogDescription, { children: isEditMode ? "Update the price details. Note: Only nickname and active status can be changed." : "Create a new price for this product" })
|
|
3267
3267
|
] }),
|
|
3268
3268
|
isEditMode && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bg-blue-50 border border-blue-200 rounded-lg p-4 flex gap-x-3", children: [
|
|
3269
3269
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.AlertCircle, { className: "h-5 w-5 text-blue-600 flex-shrink-0 mt-0.5" }),
|
|
@@ -3272,10 +3272,10 @@ function PriceEditor({ productId, price, open, onOpenChange, onSuccess }) {
|
|
|
3272
3272
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { children: "Due to Stripe's architecture, only the nickname and active status can be modified after creation. To change amount, currency, or billing interval, create a new price." })
|
|
3273
3273
|
] })
|
|
3274
3274
|
] }),
|
|
3275
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3275
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Form, { ...form, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: form.handleSubmit(onSubmit), className: "flex flex-col gap-y-4", children: [
|
|
3276
3276
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-2 gap-x-4", children: [
|
|
3277
3277
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3278
|
-
|
|
3278
|
+
_chunkRVK3JB33js.FormInput,
|
|
3279
3279
|
{
|
|
3280
3280
|
form,
|
|
3281
3281
|
id: "unitAmount",
|
|
@@ -3285,10 +3285,10 @@ function PriceEditor({ productId, price, open, onOpenChange, onSuccess }) {
|
|
|
3285
3285
|
isRequired: true
|
|
3286
3286
|
}
|
|
3287
3287
|
),
|
|
3288
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3288
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.FormSelect, { form, id: "currency", name: "Currency", values: currencyOptions, disabled: isEditMode })
|
|
3289
3289
|
] }),
|
|
3290
3290
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3291
|
-
|
|
3291
|
+
_chunkRVK3JB33js.FormSelect,
|
|
3292
3292
|
{
|
|
3293
3293
|
form,
|
|
3294
3294
|
id: "interval",
|
|
@@ -3299,7 +3299,7 @@ function PriceEditor({ productId, price, open, onOpenChange, onSuccess }) {
|
|
|
3299
3299
|
),
|
|
3300
3300
|
isRecurring && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-2 gap-x-4", children: [
|
|
3301
3301
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3302
|
-
|
|
3302
|
+
_chunkRVK3JB33js.FormInput,
|
|
3303
3303
|
{
|
|
3304
3304
|
form,
|
|
3305
3305
|
id: "intervalCount",
|
|
@@ -3310,7 +3310,7 @@ function PriceEditor({ productId, price, open, onOpenChange, onSuccess }) {
|
|
|
3310
3310
|
}
|
|
3311
3311
|
),
|
|
3312
3312
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3313
|
-
|
|
3313
|
+
_chunkRVK3JB33js.FormSelect,
|
|
3314
3314
|
{
|
|
3315
3315
|
form,
|
|
3316
3316
|
id: "usageType",
|
|
@@ -3321,7 +3321,7 @@ function PriceEditor({ productId, price, open, onOpenChange, onSuccess }) {
|
|
|
3321
3321
|
)
|
|
3322
3322
|
] }),
|
|
3323
3323
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3324
|
-
|
|
3324
|
+
_chunkRVK3JB33js.FormInput,
|
|
3325
3325
|
{
|
|
3326
3326
|
form,
|
|
3327
3327
|
id: "nickname",
|
|
@@ -3330,7 +3330,7 @@ function PriceEditor({ productId, price, open, onOpenChange, onSuccess }) {
|
|
|
3330
3330
|
}
|
|
3331
3331
|
),
|
|
3332
3332
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3333
|
-
|
|
3333
|
+
_chunkRVK3JB33js.FormTextarea,
|
|
3334
3334
|
{
|
|
3335
3335
|
form,
|
|
3336
3336
|
id: "description",
|
|
@@ -3339,13 +3339,13 @@ function PriceEditor({ productId, price, open, onOpenChange, onSuccess }) {
|
|
|
3339
3339
|
className: "min-h-24"
|
|
3340
3340
|
}
|
|
3341
3341
|
),
|
|
3342
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3342
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.FormInput, { form, id: "token", name: "Token (optional)", placeholder: "Enter token value" }),
|
|
3343
3343
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
3344
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3344
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Label, { children: "Features (optional)" }),
|
|
3345
3345
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
3346
3346
|
form.watch("features").map((_, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex gap-2", children: [
|
|
3347
3347
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3348
|
-
|
|
3348
|
+
_chunkRVK3JB33js.Input,
|
|
3349
3349
|
{
|
|
3350
3350
|
...form.register(`features.${index}`),
|
|
3351
3351
|
placeholder: `Feature ${index + 1}`,
|
|
@@ -3353,7 +3353,7 @@ function PriceEditor({ productId, price, open, onOpenChange, onSuccess }) {
|
|
|
3353
3353
|
}
|
|
3354
3354
|
),
|
|
3355
3355
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3356
|
-
|
|
3356
|
+
_chunkRVK3JB33js.Button,
|
|
3357
3357
|
{
|
|
3358
3358
|
type: "button",
|
|
3359
3359
|
variant: "outline",
|
|
@@ -3370,7 +3370,7 @@ function PriceEditor({ productId, price, open, onOpenChange, onSuccess }) {
|
|
|
3370
3370
|
)
|
|
3371
3371
|
] }, index)),
|
|
3372
3372
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3373
|
-
|
|
3373
|
+
_chunkRVK3JB33js.Button,
|
|
3374
3374
|
{
|
|
3375
3375
|
type: "button",
|
|
3376
3376
|
variant: "outline",
|
|
@@ -3389,7 +3389,7 @@ function PriceEditor({ productId, price, open, onOpenChange, onSuccess }) {
|
|
|
3389
3389
|
] })
|
|
3390
3390
|
] }),
|
|
3391
3391
|
isRecurring && allFeatures.length > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
3392
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3392
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Label, { children: "Platform Features" }),
|
|
3393
3393
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border rounded-md p-4 space-y-2 max-h-48 overflow-y-auto", children: allFeatures.map((feature) => {
|
|
3394
3394
|
const isCore = feature.isCore;
|
|
3395
3395
|
const isChecked = form.watch("featureIds").includes(feature.id);
|
|
@@ -3431,9 +3431,9 @@ function PriceEditor({ productId, price, open, onOpenChange, onSuccess }) {
|
|
|
3431
3431
|
] }, feature.id);
|
|
3432
3432
|
}) })
|
|
3433
3433
|
] }),
|
|
3434
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3434
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.FormCheckbox, { form, id: "active", name: "Active" }),
|
|
3435
3435
|
isRecurring && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3436
|
-
|
|
3436
|
+
_chunkRVK3JB33js.FormCheckbox,
|
|
3437
3437
|
{
|
|
3438
3438
|
form,
|
|
3439
3439
|
id: "isTrial",
|
|
@@ -3441,7 +3441,7 @@ function PriceEditor({ productId, price, open, onOpenChange, onSuccess }) {
|
|
|
3441
3441
|
description: "Mark this as the trial subscription plan (only one price should be marked as trial)"
|
|
3442
3442
|
}
|
|
3443
3443
|
),
|
|
3444
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3444
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.CommonEditorButtons, { isEdit: isEditMode, form, disabled: isSubmitting, setOpen: onOpenChange })
|
|
3445
3445
|
] }) })
|
|
3446
3446
|
] }) });
|
|
3447
3447
|
}
|
|
@@ -3527,12 +3527,12 @@ function PricesList({ productId, onPricesChange }) {
|
|
|
3527
3527
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-4", children: [
|
|
3528
3528
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center justify-between mb-4", children: [
|
|
3529
3529
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h4", { className: "text-lg font-semibold", children: "Prices" }),
|
|
3530
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3530
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Button, { size: "sm", onClick: () => setShowCreatePrice(true), children: "Add Price" })
|
|
3531
3531
|
] }),
|
|
3532
3532
|
prices.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bg-background flex flex-col items-center justify-center gap-y-3 rounded-lg border border-dashed p-8", children: [
|
|
3533
3533
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.DollarSign, { className: "text-muted-foreground h-12 w-12" }),
|
|
3534
3534
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground text-sm", children: "No prices yet. Add a price to enable subscriptions." }),
|
|
3535
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3535
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Button, { size: "sm", onClick: () => setShowCreatePrice(true), children: "Add Price" })
|
|
3536
3536
|
] }),
|
|
3537
3537
|
prices.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4", children: prices.map((price) => {
|
|
3538
3538
|
const isArchiving = archivingPriceId === price.id;
|
|
@@ -3541,9 +3541,9 @@ function PricesList({ productId, onPricesChange }) {
|
|
|
3541
3541
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-start justify-between mb-3", children: [
|
|
3542
3542
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.DollarSign, { className: "h-5 w-5 text-primary" }),
|
|
3543
3543
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex gap-1", children: [
|
|
3544
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3544
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Button, { variant: "ghost", size: "sm", onClick: () => setEditingPrice(price), className: "h-8 w-8 p-0", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Edit, { className: "h-4 w-4" }) }),
|
|
3545
3545
|
price.active ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3546
|
-
|
|
3546
|
+
_chunkRVK3JB33js.Button,
|
|
3547
3547
|
{
|
|
3548
3548
|
variant: "ghost",
|
|
3549
3549
|
size: "sm",
|
|
@@ -3553,7 +3553,7 @@ function PricesList({ productId, onPricesChange }) {
|
|
|
3553
3553
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Archive, { className: "h-4 w-4" })
|
|
3554
3554
|
}
|
|
3555
3555
|
) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3556
|
-
|
|
3556
|
+
_chunkRVK3JB33js.Button,
|
|
3557
3557
|
{
|
|
3558
3558
|
variant: "ghost",
|
|
3559
3559
|
size: "sm",
|
|
@@ -3572,9 +3572,9 @@ function PricesList({ productId, onPricesChange }) {
|
|
|
3572
3572
|
] }) }),
|
|
3573
3573
|
_optionalChain([price, 'access', _158 => _158.metadata, 'optionalAccess', _159 => _159.nickname]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm font-medium mb-2", children: price.metadata.nickname }),
|
|
3574
3574
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-wrap gap-2", children: [
|
|
3575
|
-
price.active ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3576
|
-
_optionalChain([price, 'access', _160 => _160.recurring, 'optionalAccess', _161 => _161.usageType]) === "metered" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3577
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3575
|
+
price.active ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Badge, { variant: "softGreen", children: "Active" }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Badge, { variant: "softGray", children: "Inactive" }),
|
|
3576
|
+
_optionalChain([price, 'access', _160 => _160.recurring, 'optionalAccess', _161 => _161.usageType]) === "metered" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Badge, { variant: "softBlue", children: "Metered" }),
|
|
3577
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Badge, { variant: "softGray", className: "uppercase", children: price.currency })
|
|
3578
3578
|
] })
|
|
3579
3579
|
] }, price.id);
|
|
3580
3580
|
}) }),
|
|
@@ -3604,20 +3604,20 @@ function PricesList({ productId, onPricesChange }) {
|
|
|
3604
3604
|
}
|
|
3605
3605
|
}
|
|
3606
3606
|
),
|
|
3607
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3608
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3609
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3610
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3607
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.AlertDialog, { open: !!priceToArchive, onOpenChange: (open) => !open && setPriceToArchive(null), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.AlertDialogContent, { children: [
|
|
3608
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.AlertDialogHeader, { children: [
|
|
3609
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.AlertDialogTitle, { children: "Archive Price" }),
|
|
3610
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.AlertDialogDescription, { children: [
|
|
3611
3611
|
"Are you sure you want to archive the price for",
|
|
3612
3612
|
" ",
|
|
3613
3613
|
priceToArchive && `${formatCurrency(priceToArchive.unitAmount, priceToArchive.currency)} ${formatInterval2(priceToArchive)}`,
|
|
3614
3614
|
"? This will prevent new subscriptions but existing ones will continue."
|
|
3615
3615
|
] })
|
|
3616
3616
|
] }),
|
|
3617
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3618
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3617
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.AlertDialogFooter, { children: [
|
|
3618
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.AlertDialogCancel, { disabled: !!archivingPriceId, children: "Cancel" }),
|
|
3619
3619
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3620
|
-
|
|
3620
|
+
_chunkRVK3JB33js.AlertDialogAction,
|
|
3621
3621
|
{
|
|
3622
3622
|
onClick: handleArchive,
|
|
3623
3623
|
disabled: !!archivingPriceId,
|
|
@@ -3627,20 +3627,20 @@ function PricesList({ productId, onPricesChange }) {
|
|
|
3627
3627
|
)
|
|
3628
3628
|
] })
|
|
3629
3629
|
] }) }),
|
|
3630
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3631
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3632
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3633
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3630
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.AlertDialog, { open: !!priceToReactivate, onOpenChange: (open) => !open && setPriceToReactivate(null), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.AlertDialogContent, { children: [
|
|
3631
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.AlertDialogHeader, { children: [
|
|
3632
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.AlertDialogTitle, { children: "Reactivate Price" }),
|
|
3633
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.AlertDialogDescription, { children: [
|
|
3634
3634
|
"Are you sure you want to reactivate the price for",
|
|
3635
3635
|
" ",
|
|
3636
3636
|
priceToReactivate && `${formatCurrency(priceToReactivate.unitAmount, priceToReactivate.currency)} ${formatInterval2(priceToReactivate)}`,
|
|
3637
3637
|
"? This will allow new subscriptions again."
|
|
3638
3638
|
] })
|
|
3639
3639
|
] }),
|
|
3640
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3641
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3640
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.AlertDialogFooter, { children: [
|
|
3641
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.AlertDialogCancel, { disabled: !!reactivatingPriceId, children: "Cancel" }),
|
|
3642
3642
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3643
|
-
|
|
3643
|
+
_chunkRVK3JB33js.AlertDialogAction,
|
|
3644
3644
|
{
|
|
3645
3645
|
onClick: handleReactivate,
|
|
3646
3646
|
disabled: !!reactivatingPriceId,
|
|
@@ -3706,15 +3706,15 @@ function ProductEditor({ product, open, onOpenChange, onSuccess }) {
|
|
|
3706
3706
|
setIsSubmitting(false);
|
|
3707
3707
|
}
|
|
3708
3708
|
}, "onSubmit");
|
|
3709
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3710
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3711
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3712
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3709
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.DialogContent, { className: "max-w-2xl", children: [
|
|
3710
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.DialogHeader, { children: [
|
|
3711
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.DialogTitle, { children: product ? "Edit Product" : "Create Product" }),
|
|
3712
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.DialogDescription, { children: product ? `Update the details for ${product.name}` : "Create a new product to offer to your customers" })
|
|
3713
3713
|
] }),
|
|
3714
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3715
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3714
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Form, { ...form, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: form.handleSubmit(onSubmit), className: "flex flex-col gap-y-4", children: [
|
|
3715
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.FormInput, { form, id: "name", name: "Product Name", placeholder: "Enter product name", isRequired: true }),
|
|
3716
3716
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3717
|
-
|
|
3717
|
+
_chunkRVK3JB33js.FormTextarea,
|
|
3718
3718
|
{
|
|
3719
3719
|
form,
|
|
3720
3720
|
id: "description",
|
|
@@ -3723,8 +3723,8 @@ function ProductEditor({ product, open, onOpenChange, onSuccess }) {
|
|
|
3723
3723
|
className: "min-h-32"
|
|
3724
3724
|
}
|
|
3725
3725
|
),
|
|
3726
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3727
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3726
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.FormCheckbox, { form, id: "active", name: "Active" }),
|
|
3727
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.CommonEditorButtons, { isEdit: !!product, form, disabled: isSubmitting, setOpen: onOpenChange })
|
|
3728
3728
|
] }) })
|
|
3729
3729
|
] }) });
|
|
3730
3730
|
}
|
|
@@ -3785,18 +3785,18 @@ function ProductsList({ products, onProductsChange }) {
|
|
|
3785
3785
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex-1", children: [
|
|
3786
3786
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-3", children: [
|
|
3787
3787
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-sm font-medium", children: product.name }),
|
|
3788
|
-
product.active ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3788
|
+
product.active ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Badge, { variant: "softGreen", children: "Active" }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Badge, { variant: "softGray", children: "Inactive" })
|
|
3789
3789
|
] }),
|
|
3790
3790
|
product.description && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground text-sm mt-1", children: product.description })
|
|
3791
3791
|
] })
|
|
3792
3792
|
] }),
|
|
3793
3793
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-2", children: [
|
|
3794
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3794
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.Button, { variant: "outline", size: "sm", onClick: () => setEditingProduct(product), children: [
|
|
3795
3795
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Edit, { className: "h-4 w-4 mr-1" }),
|
|
3796
3796
|
"Edit"
|
|
3797
3797
|
] }),
|
|
3798
3798
|
product.active ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3799
|
-
|
|
3799
|
+
_chunkRVK3JB33js.Button,
|
|
3800
3800
|
{
|
|
3801
3801
|
variant: "outline",
|
|
3802
3802
|
size: "sm",
|
|
@@ -3808,7 +3808,7 @@ function ProductsList({ products, onProductsChange }) {
|
|
|
3808
3808
|
]
|
|
3809
3809
|
}
|
|
3810
3810
|
) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3811
|
-
|
|
3811
|
+
_chunkRVK3JB33js.Button,
|
|
3812
3812
|
{
|
|
3813
3813
|
variant: "outline",
|
|
3814
3814
|
size: "sm",
|
|
@@ -3820,7 +3820,7 @@ function ProductsList({ products, onProductsChange }) {
|
|
|
3820
3820
|
]
|
|
3821
3821
|
}
|
|
3822
3822
|
),
|
|
3823
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3823
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Button, { variant: "ghost", size: "sm", onClick: () => toggleExpand(product.id), children: isExpanded ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ChevronUp, { className: "h-5 w-5" }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ChevronDown, { className: "h-5 w-5" }) })
|
|
3824
3824
|
] })
|
|
3825
3825
|
] }),
|
|
3826
3826
|
isExpanded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border-t bg-muted/30 p-6", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PricesList, { productId: product.id, onPricesChange: onProductsChange }) })
|
|
@@ -3838,19 +3838,19 @@ function ProductsList({ products, onProductsChange }) {
|
|
|
3838
3838
|
}
|
|
3839
3839
|
}
|
|
3840
3840
|
),
|
|
3841
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3842
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3843
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3844
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3841
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.AlertDialog, { open: !!productToArchive, onOpenChange: (open) => !open && setProductToArchive(null), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.AlertDialogContent, { children: [
|
|
3842
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.AlertDialogHeader, { children: [
|
|
3843
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.AlertDialogTitle, { children: "Archive Product" }),
|
|
3844
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.AlertDialogDescription, { children: [
|
|
3845
3845
|
'Are you sure you want to archive "',
|
|
3846
3846
|
_optionalChain([productToArchive, 'optionalAccess', _165 => _165.name]),
|
|
3847
3847
|
'"? This will deactivate it and it will no longer be available for new subscriptions.'
|
|
3848
3848
|
] })
|
|
3849
3849
|
] }),
|
|
3850
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3851
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3850
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.AlertDialogFooter, { children: [
|
|
3851
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.AlertDialogCancel, { disabled: !!archivingProductId, children: "Cancel" }),
|
|
3852
3852
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3853
|
-
|
|
3853
|
+
_chunkRVK3JB33js.AlertDialogAction,
|
|
3854
3854
|
{
|
|
3855
3855
|
onClick: handleArchive,
|
|
3856
3856
|
disabled: !!archivingProductId,
|
|
@@ -3860,19 +3860,19 @@ function ProductsList({ products, onProductsChange }) {
|
|
|
3860
3860
|
)
|
|
3861
3861
|
] })
|
|
3862
3862
|
] }) }),
|
|
3863
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3864
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3865
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3866
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3863
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.AlertDialog, { open: !!productToReactivate, onOpenChange: (open) => !open && setProductToReactivate(null), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.AlertDialogContent, { children: [
|
|
3864
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.AlertDialogHeader, { children: [
|
|
3865
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.AlertDialogTitle, { children: "Reactivate Product" }),
|
|
3866
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.AlertDialogDescription, { children: [
|
|
3867
3867
|
'Are you sure you want to reactivate "',
|
|
3868
3868
|
_optionalChain([productToReactivate, 'optionalAccess', _166 => _166.name]),
|
|
3869
3869
|
'"? This will make it available for new subscriptions again.'
|
|
3870
3870
|
] })
|
|
3871
3871
|
] }),
|
|
3872
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3873
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3872
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRVK3JB33js.AlertDialogFooter, { children: [
|
|
3873
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.AlertDialogCancel, { disabled: !!reactivatingProductId, children: "Cancel" }),
|
|
3874
3874
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3875
|
-
|
|
3875
|
+
_chunkRVK3JB33js.AlertDialogAction,
|
|
3876
3876
|
{
|
|
3877
3877
|
onClick: handleReactivate,
|
|
3878
3878
|
disabled: !!reactivatingProductId,
|
|
@@ -3889,7 +3889,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, ProductsList, "ProductsList");
|
|
|
3889
3889
|
// src/features/billing/stripe-product/components/containers/ProductsAdminContainer.tsx
|
|
3890
3890
|
|
|
3891
3891
|
function ProductsAdminContainer() {
|
|
3892
|
-
const { hasRole } =
|
|
3892
|
+
const { hasRole } = _chunkRVK3JB33js.useCurrentUserContext.call(void 0, );
|
|
3893
3893
|
const [products, setProducts] = _react.useState.call(void 0, []);
|
|
3894
3894
|
const [loading, setLoading] = _react.useState.call(void 0, true);
|
|
3895
3895
|
const [showCreateProduct, setShowCreateProduct] = _react.useState.call(void 0, false);
|
|
@@ -3919,14 +3919,14 @@ function ProductsAdminContainer() {
|
|
|
3919
3919
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Package, { className: "h-8 w-8" }),
|
|
3920
3920
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h1", { className: "text-primary text-3xl font-semibold", children: "Product & Price Management" })
|
|
3921
3921
|
] }),
|
|
3922
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3922
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Button, { onClick: () => setShowCreateProduct(true), children: "Create Product" })
|
|
3923
3923
|
] }),
|
|
3924
3924
|
products.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bg-muted/50 flex flex-col items-center justify-center gap-y-4 rounded-lg border-2 border-dashed p-12", children: [
|
|
3925
3925
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Package, { className: "text-muted-foreground h-16 w-16" }),
|
|
3926
3926
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-center", children: [
|
|
3927
3927
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "mb-2 text-sm font-medium", children: "No products yet" }),
|
|
3928
3928
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground mb-4", children: "Create your first product to start offering subscriptions to your customers." }),
|
|
3929
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3929
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRVK3JB33js.Button, { onClick: () => setShowCreateProduct(true), children: "Create Your First Product" })
|
|
3930
3930
|
] })
|
|
3931
3931
|
] }),
|
|
3932
3932
|
products.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductsList, { products, onProductsChange: loadProducts }),
|