@carlonicora/nextjs-jsonapi 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{BlockNoteEditor-CDTU6DRN.js → BlockNoteEditor-3IZ7PMFM.js} +9 -9
- package/dist/{BlockNoteEditor-CDTU6DRN.js.map → BlockNoteEditor-3IZ7PMFM.js.map} +1 -1
- package/dist/{BlockNoteEditor-VVAY73V2.mjs → BlockNoteEditor-G4XNDV2O.mjs} +2 -2
- package/dist/billing/index.js +333 -333
- package/dist/billing/index.mjs +1 -1
- package/dist/{chunk-UGNLKDI6.js → chunk-5GVBUTS4.js} +229 -220
- package/dist/chunk-5GVBUTS4.js.map +1 -0
- package/dist/{chunk-J54546YC.mjs → chunk-WCX4CLRJ.mjs} +13 -4
- package/dist/{chunk-J54546YC.mjs.map → chunk-WCX4CLRJ.mjs.map} +1 -1
- 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/dist/features/tokenusage/index.js +75 -75
- package/dist/features/tokenusage/index.mjs +1 -1
- package/package.json +1 -1
- package/src/features/user/components/forms/UserEditor.tsx +11 -2
- package/dist/chunk-UGNLKDI6.js.map +0 -1
- /package/dist/{BlockNoteEditor-VVAY73V2.mjs.map → BlockNoteEditor-G4XNDV2O.mjs.map} +0 -0
package/dist/billing/index.js
CHANGED
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
|
|
63
63
|
|
|
64
64
|
|
|
65
|
-
var
|
|
65
|
+
var _chunk5GVBUTS4js = require('../chunk-5GVBUTS4.js');
|
|
66
66
|
|
|
67
67
|
|
|
68
68
|
|
|
@@ -131,41 +131,41 @@ function SubscriptionSummaryCard({
|
|
|
131
131
|
onManageClick
|
|
132
132
|
}) {
|
|
133
133
|
if (loading) {
|
|
134
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
135
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
136
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
134
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.Card, { children: [
|
|
135
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
136
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardTitle, { children: "Subscriptions" }),
|
|
137
137
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-4 w-4 text-muted-foreground" })
|
|
138
138
|
] }),
|
|
139
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
140
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
141
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
142
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
139
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.CardContent, { children: [
|
|
140
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Skeleton, { className: "h-6 w-32 mb-2" }),
|
|
141
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Skeleton, { className: "h-4 w-24 mb-1" }),
|
|
142
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Skeleton, { className: "h-4 w-40" })
|
|
143
143
|
] })
|
|
144
144
|
] });
|
|
145
145
|
}
|
|
146
146
|
if (error) {
|
|
147
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
148
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
149
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
147
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.Card, { children: [
|
|
148
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
149
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardTitle, { children: "Subscriptions" }),
|
|
150
150
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-4 w-4 text-muted-foreground" })
|
|
151
151
|
] }),
|
|
152
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
152
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
|
|
153
153
|
] });
|
|
154
154
|
}
|
|
155
155
|
const activeSubscriptions = subscriptions.filter(
|
|
156
156
|
(sub) => sub.status === "active" /* ACTIVE */ || sub.status === "trialing" /* TRIALING */
|
|
157
157
|
);
|
|
158
158
|
const primarySubscription = activeSubscriptions[0];
|
|
159
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
160
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
161
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
159
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onManageClick, children: [
|
|
160
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
161
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardTitle, { children: "Subscriptions" }),
|
|
162
162
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-4 w-4 text-muted-foreground" })
|
|
163
163
|
] }),
|
|
164
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
164
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardContent, { children: subscriptions.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
165
165
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: "No active plan" }),
|
|
166
166
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: "Subscribe to get started" }),
|
|
167
167
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
168
|
-
|
|
168
|
+
_chunk5GVBUTS4js.Button,
|
|
169
169
|
{
|
|
170
170
|
variant: "outline",
|
|
171
171
|
size: "sm",
|
|
@@ -184,7 +184,7 @@ function SubscriptionSummaryCard({
|
|
|
184
184
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
|
|
185
185
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold", children: formatPlanName(primarySubscription) }),
|
|
186
186
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
187
|
-
|
|
187
|
+
_chunk5GVBUTS4js.Badge,
|
|
188
188
|
{
|
|
189
189
|
variant: primarySubscription.cancelAtPeriodEnd ? "secondary" : getStatusBadgeVariant(primarySubscription.status),
|
|
190
190
|
children: primarySubscription.cancelAtPeriodEnd ? "Canceling" : primarySubscription.status
|
|
@@ -226,37 +226,37 @@ function PaymentMethodSummaryCard({
|
|
|
226
226
|
onManageClick
|
|
227
227
|
}) {
|
|
228
228
|
if (loading) {
|
|
229
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
230
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
231
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
229
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.Card, { children: [
|
|
230
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
231
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardTitle, { children: "Payment Method" }),
|
|
232
232
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Wallet, { className: "h-4 w-4 text-muted-foreground" })
|
|
233
233
|
] }),
|
|
234
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
235
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
236
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
234
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.CardContent, { children: [
|
|
235
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Skeleton, { className: "h-6 w-32 mb-2" }),
|
|
236
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Skeleton, { className: "h-4 w-24" })
|
|
237
237
|
] })
|
|
238
238
|
] });
|
|
239
239
|
}
|
|
240
240
|
if (error) {
|
|
241
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
242
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
243
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
241
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.Card, { children: [
|
|
242
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
243
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardTitle, { children: "Payment Method" }),
|
|
244
244
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Wallet, { className: "h-4 w-4 text-muted-foreground" })
|
|
245
245
|
] }),
|
|
246
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
246
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
|
|
247
247
|
] });
|
|
248
248
|
}
|
|
249
249
|
const defaultMethod = paymentMethods.find((pm) => pm.id === defaultPaymentMethodId) || paymentMethods[0];
|
|
250
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
251
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
252
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
250
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onManageClick, children: [
|
|
251
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
252
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardTitle, { children: "Payment Method" }),
|
|
253
253
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Wallet, { className: "h-4 w-4 text-muted-foreground" })
|
|
254
254
|
] }),
|
|
255
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
255
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardContent, { children: paymentMethods.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
256
256
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: "No payment method" }),
|
|
257
257
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: "Add a card to enable subscriptions" }),
|
|
258
258
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
259
|
-
|
|
259
|
+
_chunk5GVBUTS4js.Button,
|
|
260
260
|
{
|
|
261
261
|
variant: "outline",
|
|
262
262
|
size: "sm",
|
|
@@ -329,52 +329,52 @@ function CustomerInfoCard({ customer, loading, error }) {
|
|
|
329
329
|
}
|
|
330
330
|
}, "handlePortalClick");
|
|
331
331
|
if (loading) {
|
|
332
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
333
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
334
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
332
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.Card, { children: [
|
|
333
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
334
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardTitle, { children: "Billing Account" }),
|
|
335
335
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.User, { className: "h-4 w-4 text-muted-foreground" })
|
|
336
336
|
] }),
|
|
337
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
338
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
339
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
340
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
337
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.CardContent, { children: [
|
|
338
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Skeleton, { className: "h-6 w-32 mb-2" }),
|
|
339
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Skeleton, { className: "h-4 w-48 mb-1" }),
|
|
340
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Skeleton, { className: "h-4 w-24" })
|
|
341
341
|
] })
|
|
342
342
|
] });
|
|
343
343
|
}
|
|
344
344
|
if (error) {
|
|
345
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
346
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
347
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
345
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.Card, { children: [
|
|
346
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
347
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardTitle, { children: "Billing Account" }),
|
|
348
348
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.User, { className: "h-4 w-4 text-muted-foreground" })
|
|
349
349
|
] }),
|
|
350
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
350
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
|
|
351
351
|
] });
|
|
352
352
|
}
|
|
353
353
|
if (!customer) {
|
|
354
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
355
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
356
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
354
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.Card, { children: [
|
|
355
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
356
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardTitle, { children: "Billing Account" }),
|
|
357
357
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.User, { className: "h-4 w-4 text-muted-foreground" })
|
|
358
358
|
] }),
|
|
359
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
359
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.CardContent, { children: [
|
|
360
360
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: "Not set up" }),
|
|
361
361
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: "Billing account will be created when you subscribe" })
|
|
362
362
|
] })
|
|
363
363
|
] });
|
|
364
364
|
}
|
|
365
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
366
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
367
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
365
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.Card, { children: [
|
|
366
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
367
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardTitle, { children: "Billing Account" }),
|
|
368
368
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.User, { className: "h-4 w-4 text-muted-foreground" })
|
|
369
369
|
] }),
|
|
370
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
370
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
371
371
|
customer.name && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold", children: customer.name }),
|
|
372
372
|
customer.email && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: customer.email }),
|
|
373
373
|
customer.balance !== void 0 && customer.balance !== 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "text-sm", children: [
|
|
374
374
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground", children: "Credit Balance: " }),
|
|
375
375
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: customer.balance < 0 ? "text-success" : "text-destructive", children: formatBalance(customer.balance, customer.currency) })
|
|
376
376
|
] }),
|
|
377
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
377
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.Button, { variant: "outline", size: "sm", className: "mt-2", onClick: handlePortalClick, disabled: portalLoading, children: [
|
|
378
378
|
portalLoading ? "Loading..." : "Manage in Stripe Portal",
|
|
379
379
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ExternalLink, { className: "h-4 w-4 ml-1" })
|
|
380
380
|
] })
|
|
@@ -418,42 +418,42 @@ function formatAmount(amount, currency) {
|
|
|
418
418
|
_chunk7QVYU63Ejs.__name.call(void 0, formatAmount, "formatAmount");
|
|
419
419
|
function InvoicesSummaryCard({ invoices, loading, error, onViewAllClick }) {
|
|
420
420
|
if (loading) {
|
|
421
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
422
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
423
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
421
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.Card, { children: [
|
|
422
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
423
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardTitle, { children: "Recent Invoices" }),
|
|
424
424
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ReceiptIcon, { className: "h-4 w-4 text-muted-foreground" })
|
|
425
425
|
] }),
|
|
426
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
427
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
428
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
429
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
426
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.CardContent, { children: [
|
|
427
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Skeleton, { className: "h-6 w-24 mb-2" }),
|
|
428
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Skeleton, { className: "h-4 w-32 mb-1" }),
|
|
429
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Skeleton, { className: "h-4 w-20" })
|
|
430
430
|
] })
|
|
431
431
|
] });
|
|
432
432
|
}
|
|
433
433
|
if (error) {
|
|
434
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
435
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
436
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
434
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.Card, { children: [
|
|
435
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
436
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardTitle, { children: "Recent Invoices" }),
|
|
437
437
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ReceiptIcon, { className: "h-4 w-4 text-muted-foreground" })
|
|
438
438
|
] }),
|
|
439
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
439
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
|
|
440
440
|
] });
|
|
441
441
|
}
|
|
442
442
|
const latestInvoice = invoices[0];
|
|
443
443
|
const paidInvoices = invoices.filter((inv) => inv.status === "paid" /* PAID */);
|
|
444
444
|
const openInvoices = invoices.filter((inv) => inv.status === "open" /* OPEN */);
|
|
445
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
446
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
447
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
445
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onViewAllClick, children: [
|
|
446
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
447
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardTitle, { children: "Recent Invoices" }),
|
|
448
448
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ReceiptIcon, { className: "h-4 w-4 text-muted-foreground" })
|
|
449
449
|
] }),
|
|
450
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
450
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardContent, { children: invoices.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
451
451
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: "No invoices yet" }),
|
|
452
452
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: "Invoices will appear after your first billing cycle" })
|
|
453
453
|
] }) : latestInvoice ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
454
454
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
|
|
455
455
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold", children: formatAmount(latestInvoice.total, latestInvoice.currency) }),
|
|
456
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
456
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Badge, { variant: getStatusBadgeVariant2(latestInvoice.status), children: latestInvoice.status })
|
|
457
457
|
] }),
|
|
458
458
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: latestInvoice.stripeInvoiceNumber || `Invoice from ${formatDate2(latestInvoice.periodStart)}` }),
|
|
459
459
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-4 text-xs text-muted-foreground", children: [
|
|
@@ -493,24 +493,24 @@ function BillingUsageSummaryCard({
|
|
|
493
493
|
onViewDetailsClick
|
|
494
494
|
}) {
|
|
495
495
|
if (loading) {
|
|
496
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
497
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
498
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
496
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.Card, { children: [
|
|
497
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
498
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardTitle, { children: "Usage This Month" }),
|
|
499
499
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Activity, { className: "h-4 w-4 text-muted-foreground" })
|
|
500
500
|
] }),
|
|
501
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
502
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
503
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
501
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.CardContent, { children: [
|
|
502
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Skeleton, { className: "h-6 w-24 mb-2" }),
|
|
503
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Skeleton, { className: "h-4 w-32" })
|
|
504
504
|
] })
|
|
505
505
|
] });
|
|
506
506
|
}
|
|
507
507
|
if (error) {
|
|
508
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
509
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
510
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
508
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.Card, { children: [
|
|
509
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
510
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardTitle, { children: "Usage This Month" }),
|
|
511
511
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Activity, { className: "h-4 w-4 text-muted-foreground" })
|
|
512
512
|
] }),
|
|
513
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
513
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
|
|
514
514
|
] });
|
|
515
515
|
}
|
|
516
516
|
const totalUsage = Object.values(summaries).reduce((acc, summary) => {
|
|
@@ -518,12 +518,12 @@ function BillingUsageSummaryCard({
|
|
|
518
518
|
}, 0);
|
|
519
519
|
const primaryMeter = meters.find((m) => _optionalChain([summaries, 'access', _17 => _17[m.id], 'optionalAccess', _18 => _18.aggregatedValue]));
|
|
520
520
|
const primarySummary = primaryMeter ? summaries[primaryMeter.id] : null;
|
|
521
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
522
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
523
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
521
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onViewDetailsClick, children: [
|
|
522
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
523
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardTitle, { children: "Usage This Month" }),
|
|
524
524
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Activity, { className: "h-4 w-4 text-muted-foreground" })
|
|
525
525
|
] }),
|
|
526
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
526
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardContent, { children: meters.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
527
527
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: "No meters" }),
|
|
528
528
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: "No usage meters are configured" })
|
|
529
529
|
] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
@@ -629,7 +629,7 @@ function PaymentMethodForm({ onSuccess, onCancel, isLoading = false }) {
|
|
|
629
629
|
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..." }) });
|
|
630
630
|
}
|
|
631
631
|
if (!setupIntent && error) {
|
|
632
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
632
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Alert, { variant: "destructive", className: "bg-red-50 border-red-200", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.AlertDescription, { children: error }) });
|
|
633
633
|
}
|
|
634
634
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: handleSubmit, className: "flex flex-col gap-y-4", children: [
|
|
635
635
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rounded-md border border-gray-300 p-3", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -652,13 +652,13 @@ function PaymentMethodForm({ onSuccess, onCancel, isLoading = false }) {
|
|
|
652
652
|
}
|
|
653
653
|
) }),
|
|
654
654
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-2", children: [
|
|
655
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
656
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
655
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Checkbox, { id: "setAsDefault", checked: setAsDefault, onCheckedChange: (checked) => setSetAsDefault(!!checked) }),
|
|
656
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Label, { htmlFor: "setAsDefault", className: "cursor-pointer font-normal", children: "Set as default payment method" })
|
|
657
657
|
] }),
|
|
658
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
658
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Alert, { variant: "destructive", className: "bg-red-50 border-red-200", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.AlertDescription, { children: error }) }),
|
|
659
659
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-end gap-x-2", children: [
|
|
660
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
661
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
660
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Button, { type: "button", variant: "outline", onClick: onCancel, disabled: isSubmitting || isLoading, children: "Cancel" }),
|
|
661
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Button, { type: "submit", disabled: !stripe || isSubmitting || isLoading, children: isSubmitting ? "Processing..." : "Add Card" })
|
|
662
662
|
] })
|
|
663
663
|
] });
|
|
664
664
|
}
|
|
@@ -674,10 +674,10 @@ function PaymentMethodEditor({ open, onOpenChange, onSuccess }) {
|
|
|
674
674
|
const handleCancel = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
675
675
|
onOpenChange(false);
|
|
676
676
|
}, "handleCancel");
|
|
677
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
678
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
679
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
680
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
677
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.DialogContent, { className: "max-w-md", children: [
|
|
678
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.DialogHeader, { children: [
|
|
679
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.DialogTitle, { children: "Add Payment Method" }),
|
|
680
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.DialogDescription, { children: "Add a new payment method to your account. Your card information is securely processed by Stripe." })
|
|
681
681
|
] }),
|
|
682
682
|
open && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PaymentMethodForm, { onSuccess: handleSuccess, onCancel: handleCancel })
|
|
683
683
|
] }) });
|
|
@@ -738,16 +738,16 @@ function PaymentMethodCard({ paymentMethod, onUpdate }) {
|
|
|
738
738
|
}
|
|
739
739
|
}, "handleRemove");
|
|
740
740
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
741
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
742
|
-
isDefault && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
743
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
741
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.Card, { className: "relative", children: [
|
|
742
|
+
isDefault && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Badge, { variant: "softGreen", className: "absolute right-2 top-2", children: "Default" }),
|
|
743
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.CardHeader, { className: "flex flex-row items-center justify-between pb-2", children: [
|
|
744
744
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-2", children: [
|
|
745
745
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-2xl", children: brandIcon }),
|
|
746
746
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium capitalize", children: brand })
|
|
747
747
|
] }),
|
|
748
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
749
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
750
|
-
|
|
748
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.DropdownMenu, { children: [
|
|
749
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.DropdownMenuTrigger, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
750
|
+
_chunk5GVBUTS4js.Button,
|
|
751
751
|
{
|
|
752
752
|
render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", {}),
|
|
753
753
|
nativeButton: false,
|
|
@@ -758,10 +758,10 @@ function PaymentMethodCard({ paymentMethod, onUpdate }) {
|
|
|
758
758
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.MoreVertical, { className: "h-4 w-4" })
|
|
759
759
|
}
|
|
760
760
|
) }),
|
|
761
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
762
|
-
!isDefault && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
761
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.DropdownMenuContent, { align: "end", children: [
|
|
762
|
+
!isDefault && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.DropdownMenuItem, { onClick: handleSetDefault, disabled: loading, children: "Set as Default" }),
|
|
763
763
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
764
|
-
|
|
764
|
+
_chunk5GVBUTS4js.DropdownMenuItem,
|
|
765
765
|
{
|
|
766
766
|
onClick: () => setShowRemoveDialog(true),
|
|
767
767
|
disabled: loading,
|
|
@@ -772,7 +772,7 @@ function PaymentMethodCard({ paymentMethod, onUpdate }) {
|
|
|
772
772
|
] })
|
|
773
773
|
] })
|
|
774
774
|
] }),
|
|
775
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
775
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-1", children: [
|
|
776
776
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "text-lg font-semibold", children: [
|
|
777
777
|
"\u2022\u2022\u2022\u2022 ",
|
|
778
778
|
last4
|
|
@@ -785,17 +785,17 @@ function PaymentMethodCard({ paymentMethod, onUpdate }) {
|
|
|
785
785
|
] })
|
|
786
786
|
] }) })
|
|
787
787
|
] }),
|
|
788
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
789
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
790
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
791
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
788
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.AlertDialog, { open: showRemoveDialog, onOpenChange: setShowRemoveDialog, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.AlertDialogContent, { children: [
|
|
789
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.AlertDialogHeader, { children: [
|
|
790
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.AlertDialogTitle, { children: "Remove Payment Method" }),
|
|
791
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.AlertDialogDescription, { children: [
|
|
792
792
|
"Are you sure you want to remove this payment method? This action cannot be undone.",
|
|
793
793
|
isDefault && " This is your default payment method."
|
|
794
794
|
] })
|
|
795
795
|
] }),
|
|
796
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
797
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
798
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
796
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.AlertDialogFooter, { children: [
|
|
797
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.AlertDialogCancel, { disabled: loading, children: "Cancel" }),
|
|
798
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.AlertDialogAction, { onClick: handleRemove, disabled: loading, className: "bg-red-600 hover:bg-red-700", children: loading ? "Removing..." : "Remove" })
|
|
799
799
|
] })
|
|
800
800
|
] }) })
|
|
801
801
|
] });
|
|
@@ -838,14 +838,14 @@ function PaymentMethodsContainer() {
|
|
|
838
838
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-8 w-8" }),
|
|
839
839
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h1", { className: "text-primary text-3xl font-semibold", children: "Payment Methods" })
|
|
840
840
|
] }),
|
|
841
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
841
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Button, { onClick: () => setShowAddPaymentMethod(true), children: "Add Payment Method" })
|
|
842
842
|
] }),
|
|
843
843
|
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: [
|
|
844
844
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-16 w-16 text-muted-foreground" }),
|
|
845
845
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-center", children: [
|
|
846
846
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "mb-2 text-sm font-medium", children: "No payment methods" }),
|
|
847
847
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "mb-4 text-muted-foreground", children: "Add a payment method to enable subscriptions and secure checkout." }),
|
|
848
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
848
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Button, { onClick: () => setShowAddPaymentMethod(true), children: "Add Your First Card" })
|
|
849
849
|
] })
|
|
850
850
|
] }),
|
|
851
851
|
paymentMethods.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PaymentMethodsList, { paymentMethods, onUpdate: loadPaymentMethods }),
|
|
@@ -913,7 +913,7 @@ var statusConfig = {
|
|
|
913
913
|
};
|
|
914
914
|
function InvoiceStatusBadge({ status }) {
|
|
915
915
|
const config = statusConfig[status] || statusConfig["draft" /* DRAFT */];
|
|
916
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
916
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Badge, { variant: config.variant, children: config.label });
|
|
917
917
|
}
|
|
918
918
|
_chunk7QVYU63Ejs.__name.call(void 0, InvoiceStatusBadge, "InvoiceStatusBadge");
|
|
919
919
|
|
|
@@ -944,13 +944,13 @@ function InvoiceDetails({
|
|
|
944
944
|
return invoice.stripeInvoiceId.slice(-8);
|
|
945
945
|
}, "getInvoiceNumber");
|
|
946
946
|
const productName = _optionalChain([invoice, 'access', _29 => _29.subscription, 'optionalAccess', _30 => _30.price, 'optionalAccess', _31 => _31.product, 'optionalAccess', _32 => _32.name]) || "Subscription";
|
|
947
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
948
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
949
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
947
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.DialogContent, { className: "max-w-2xl", children: [
|
|
948
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.DialogHeader, { children: [
|
|
949
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.DialogTitle, { children: [
|
|
950
950
|
"Invoice ",
|
|
951
951
|
getInvoiceNumber()
|
|
952
952
|
] }),
|
|
953
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
953
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.DialogDescription, { children: formatDate3(invoice.periodStart) })
|
|
954
954
|
] }),
|
|
955
955
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-6", children: [
|
|
956
956
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-3", children: [
|
|
@@ -988,42 +988,42 @@ function InvoiceDetails({
|
|
|
988
988
|
] }) }),
|
|
989
989
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "tbody", { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "tr", { className: "border-t", children: [
|
|
990
990
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { className: "p-3", children: productName }),
|
|
991
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { className: "p-3 text-right", children:
|
|
991
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { className: "p-3 text-right", children: _chunk5GVBUTS4js.formatCurrency.call(void 0, invoice.subtotal, invoice.currency) })
|
|
992
992
|
] }) })
|
|
993
993
|
] }) })
|
|
994
994
|
] }),
|
|
995
995
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2 border-t pt-4", children: [
|
|
996
996
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between", children: [
|
|
997
997
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: "Subtotal:" }),
|
|
998
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm", children:
|
|
998
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm", children: _chunk5GVBUTS4js.formatCurrency.call(void 0, invoice.subtotal, invoice.currency) })
|
|
999
999
|
] }),
|
|
1000
1000
|
invoice.tax !== void 0 && invoice.tax > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between", children: [
|
|
1001
1001
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: "Tax:" }),
|
|
1002
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm", children:
|
|
1002
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm", children: _chunk5GVBUTS4js.formatCurrency.call(void 0, invoice.tax, invoice.currency) })
|
|
1003
1003
|
] }),
|
|
1004
1004
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between text-lg font-semibold border-t pt-2", children: [
|
|
1005
1005
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Total:" }),
|
|
1006
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children:
|
|
1006
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _chunk5GVBUTS4js.formatCurrency.call(void 0, invoice.total, invoice.currency) })
|
|
1007
1007
|
] }),
|
|
1008
1008
|
invoice.amountPaid > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between", children: [
|
|
1009
1009
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: "Amount Paid:" }),
|
|
1010
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm text-success", children:
|
|
1010
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm text-success", children: _chunk5GVBUTS4js.formatCurrency.call(void 0, invoice.amountPaid, invoice.currency) })
|
|
1011
1011
|
] }),
|
|
1012
1012
|
invoice.amountRemaining > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between", children: [
|
|
1013
1013
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: "Amount Due:" }),
|
|
1014
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm text-destructive", children:
|
|
1014
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm text-destructive", children: _chunk5GVBUTS4js.formatCurrency.call(void 0, invoice.amountRemaining, invoice.currency) })
|
|
1015
1015
|
] })
|
|
1016
1016
|
] }),
|
|
1017
1017
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-wrap gap-2 pt-4 border-t", children: [
|
|
1018
|
-
invoice.stripePdfUrl && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1018
|
+
invoice.stripePdfUrl && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.Button, { variant: "outline", onClick: handleDownloadPDF, children: [
|
|
1019
1019
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Download, { className: "mr-2 h-4 w-4" }),
|
|
1020
1020
|
"Download PDF"
|
|
1021
1021
|
] }),
|
|
1022
|
-
invoice.status === "open" /* OPEN */ && invoice.attempted && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1022
|
+
invoice.status === "open" /* OPEN */ && invoice.attempted && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.Button, { variant: "default", onClick: handleRetryPayment, children: [
|
|
1023
1023
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.RefreshCw, { className: "mr-2 h-4 w-4" }),
|
|
1024
1024
|
"Retry Payment"
|
|
1025
1025
|
] }),
|
|
1026
|
-
invoice.stripeHostedInvoiceUrl && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1026
|
+
invoice.stripeHostedInvoiceUrl && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.Button, { variant: "outline", onClick: handleViewInStripe, children: [
|
|
1027
1027
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ExternalLink, { className: "mr-2 h-4 w-4" }),
|
|
1028
1028
|
"View in Stripe"
|
|
1029
1029
|
] })
|
|
@@ -1047,30 +1047,30 @@ function InvoicesList({ invoices, onInvoicesChange }) {
|
|
|
1047
1047
|
return invoice.stripeInvoiceId.slice(-8);
|
|
1048
1048
|
}, "getInvoiceNumber");
|
|
1049
1049
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1050
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border rounded-lg overflow-clip", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1051
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1052
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1053
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1054
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1055
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1056
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1050
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border rounded-lg overflow-clip", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.Table, { children: [
|
|
1051
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableHeader, { className: "bg-muted", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.TableRow, { children: [
|
|
1052
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableHead, { children: "Invoice #" }),
|
|
1053
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableHead, { children: "Date" }),
|
|
1054
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableHead, { children: "Status" }),
|
|
1055
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableHead, { className: "text-right", children: "Amount" }),
|
|
1056
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableHead, { children: "Period" })
|
|
1057
1057
|
] }) }),
|
|
1058
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1058
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableBody, { children: invoices.map((invoice) => {
|
|
1059
1059
|
const invoiceNumber = getInvoiceNumber(invoice);
|
|
1060
1060
|
const date = formatDate3(invoice.periodStart);
|
|
1061
|
-
const amount =
|
|
1061
|
+
const amount = _chunk5GVBUTS4js.formatCurrency.call(void 0, invoice.total, invoice.currency);
|
|
1062
1062
|
const period = `${formatDate3(invoice.periodStart)} - ${formatDate3(invoice.periodEnd)}`;
|
|
1063
1063
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1064
|
-
|
|
1064
|
+
_chunk5GVBUTS4js.TableRow,
|
|
1065
1065
|
{
|
|
1066
1066
|
onClick: () => handleRowClick(invoice),
|
|
1067
1067
|
className: "cursor-pointer hover:bg-muted/50",
|
|
1068
1068
|
children: [
|
|
1069
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1070
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1071
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1072
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1073
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1069
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableCell, { className: "font-medium", children: invoiceNumber }),
|
|
1070
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableCell, { className: "text-muted-foreground text-xs", children: date }),
|
|
1071
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableCell, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InvoiceStatusBadge, { status: invoice.status }) }),
|
|
1072
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableCell, { className: "text-right font-medium", children: amount }),
|
|
1073
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableCell, { className: "text-muted-foreground text-xs", children: period })
|
|
1074
1074
|
]
|
|
1075
1075
|
},
|
|
1076
1076
|
invoice.id
|
|
@@ -1119,12 +1119,12 @@ function InvoicesContainer() {
|
|
|
1119
1119
|
setStatusFilter(value);
|
|
1120
1120
|
}, "handleFilterChange");
|
|
1121
1121
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-4", children: [
|
|
1122
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1123
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1124
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1125
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1126
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1127
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1122
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Tabs, { value: statusFilter, onValueChange: handleFilterChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.TabsList, { children: [
|
|
1123
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TabsTrigger, { value: "all", children: "All" }),
|
|
1124
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TabsTrigger, { value: "paid" /* PAID */, children: "Paid" }),
|
|
1125
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TabsTrigger, { value: "open" /* OPEN */, children: "Open" }),
|
|
1126
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TabsTrigger, { value: "void" /* VOID */, children: "Void" }),
|
|
1127
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TabsTrigger, { value: "uncollectible" /* UNCOLLECTIBLE */, children: "Uncollectible" })
|
|
1128
1128
|
] }) }),
|
|
1129
1129
|
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-center py-8 text-muted-foreground", children: "Loading invoices..." }),
|
|
1130
1130
|
!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: [
|
|
@@ -1184,19 +1184,19 @@ function CancelSubscriptionDialog({
|
|
|
1184
1184
|
}
|
|
1185
1185
|
}, "onSubmit");
|
|
1186
1186
|
const periodEndDate = formatDate3(subscription.currentPeriodEnd);
|
|
1187
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1188
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1189
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1190
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1187
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.DialogContent, { className: "max-w-md", children: [
|
|
1188
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.DialogHeader, { children: [
|
|
1189
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.DialogTitle, { children: "Cancel Subscription" }),
|
|
1190
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.DialogDescription, { children: "Are you sure you want to cancel this subscription? This action cannot be undone." })
|
|
1191
1191
|
] }),
|
|
1192
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1192
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Form, { ...form, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: form.handleSubmit(onSubmit), className: "flex flex-col gap-y-4", children: [
|
|
1193
1193
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bg-primary/10 border-primary/30 text-foreground rounded-lg border p-3 text-sm", children: [
|
|
1194
1194
|
"Your subscription will remain active until ",
|
|
1195
1195
|
periodEndDate,
|
|
1196
1196
|
". You can continue using the service until then."
|
|
1197
1197
|
] }),
|
|
1198
1198
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1199
|
-
|
|
1199
|
+
_chunk5GVBUTS4js.FormTextarea,
|
|
1200
1200
|
{
|
|
1201
1201
|
form,
|
|
1202
1202
|
id: "reason",
|
|
@@ -1206,8 +1206,8 @@ function CancelSubscriptionDialog({
|
|
|
1206
1206
|
}
|
|
1207
1207
|
),
|
|
1208
1208
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex gap-x-2 justify-end pt-2", children: [
|
|
1209
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1210
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1209
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Button, { type: "button", variant: "outline", onClick: () => onOpenChange(false), disabled: isSubmitting, children: "Keep Subscription" }),
|
|
1210
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Button, { type: "submit", variant: "destructive", disabled: isSubmitting, children: isSubmitting ? "Canceling..." : "Confirm Cancellation" })
|
|
1211
1211
|
] })
|
|
1212
1212
|
] }) })
|
|
1213
1213
|
] }) });
|
|
@@ -1256,7 +1256,7 @@ var cancelingConfig = {
|
|
|
1256
1256
|
};
|
|
1257
1257
|
function SubscriptionStatusBadge({ status, cancelAtPeriodEnd }) {
|
|
1258
1258
|
const config = cancelAtPeriodEnd ? cancelingConfig : statusConfig2[status] || statusConfig2["canceled" /* CANCELED */];
|
|
1259
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1259
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Badge, { variant: config.variant, children: config.label });
|
|
1260
1260
|
}
|
|
1261
1261
|
_chunk7QVYU63Ejs.__name.call(void 0, SubscriptionStatusBadge, "SubscriptionStatusBadge");
|
|
1262
1262
|
|
|
@@ -1283,7 +1283,7 @@ function formatPlanName2(price) {
|
|
|
1283
1283
|
_chunk7QVYU63Ejs.__name.call(void 0, formatPlanName2, "formatPlanName");
|
|
1284
1284
|
function formatBillingAmount(price) {
|
|
1285
1285
|
if (!_optionalChain([price, 'optionalAccess', _37 => _37.unitAmount])) return "N/A";
|
|
1286
|
-
return
|
|
1286
|
+
return _chunk5GVBUTS4js.formatCurrency.call(void 0, price.unitAmount, price.currency);
|
|
1287
1287
|
}
|
|
1288
1288
|
_chunk7QVYU63Ejs.__name.call(void 0, formatBillingAmount, "formatBillingAmount");
|
|
1289
1289
|
function SubscriptionDetails({
|
|
@@ -1329,10 +1329,10 @@ function SubscriptionDetails({
|
|
|
1329
1329
|
const canResume = subscription.status === "paused" /* PAUSED */;
|
|
1330
1330
|
const canCancel = subscription.status === "active" /* ACTIVE */ || subscription.status === "trialing" /* TRIALING */ || subscription.status === "paused" /* PAUSED */;
|
|
1331
1331
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1332
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1333
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1334
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1335
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1332
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.DialogContent, { className: "max-w-2xl", children: [
|
|
1333
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.DialogHeader, { children: [
|
|
1334
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.DialogTitle, { children: "Subscription Details" }),
|
|
1335
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.DialogDescription, { children: "View and manage your subscription" })
|
|
1336
1336
|
] }),
|
|
1337
1337
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-6", children: [
|
|
1338
1338
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-3", children: [
|
|
@@ -1374,11 +1374,11 @@ function SubscriptionDetails({
|
|
|
1374
1374
|
"."
|
|
1375
1375
|
] }) }),
|
|
1376
1376
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-wrap gap-2 pt-4 border-t", children: [
|
|
1377
|
-
onChangePlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1378
|
-
canPause && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1379
|
-
canResume && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1380
|
-
canCancel && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1381
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1377
|
+
onChangePlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Button, { variant: "default", onClick: () => onChangePlan(subscription), children: "Change Plan" }),
|
|
1378
|
+
canPause && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Button, { variant: "outline", onClick: handlePause, disabled: isProcessing, children: isProcessing ? "Pausing..." : "Pause" }),
|
|
1379
|
+
canResume && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Button, { variant: "outline", onClick: handleResume, disabled: isProcessing, children: isProcessing ? "Resuming..." : "Resume" }),
|
|
1380
|
+
canCancel && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Button, { variant: "destructive", onClick: () => setShowCancel(true), children: "Cancel" }),
|
|
1381
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Button, { variant: "outline", onClick: handleManageViaPortal, children: "Manage via Portal" })
|
|
1382
1382
|
] })
|
|
1383
1383
|
] })
|
|
1384
1384
|
] }) }),
|
|
@@ -1425,36 +1425,36 @@ function SubscriptionsList({ subscriptions, onSubscriptionsChange, onChangePlan
|
|
|
1425
1425
|
setSelectedSub(subscription);
|
|
1426
1426
|
}, "handleRowClick");
|
|
1427
1427
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1428
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border rounded-lg overflow-clip", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1429
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1430
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1431
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1432
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1433
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1434
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1428
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border rounded-lg overflow-clip", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.Table, { children: [
|
|
1429
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableHeader, { className: "bg-muted", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.TableRow, { children: [
|
|
1430
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableHead, { children: "Status" }),
|
|
1431
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableHead, { children: "Plan" }),
|
|
1432
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableHead, { children: "Period" }),
|
|
1433
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableHead, { className: "text-right", children: "Amount" }),
|
|
1434
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableHead, { className: "text-right", children: "Actions" })
|
|
1435
1435
|
] }) }),
|
|
1436
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1436
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableBody, { children: subscriptions.map((subscription) => {
|
|
1437
1437
|
const price = subscription.price;
|
|
1438
|
-
const amount = _optionalChain([price, 'optionalAccess', _42 => _42.unitAmount]) ?
|
|
1438
|
+
const amount = _optionalChain([price, 'optionalAccess', _42 => _42.unitAmount]) ? _chunk5GVBUTS4js.formatCurrency.call(void 0, price.unitAmount, price.currency) : "0";
|
|
1439
1439
|
const period = `${formatDate3(subscription.currentPeriodStart)} - ${formatDate3(subscription.currentPeriodEnd)}`;
|
|
1440
1440
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1441
|
-
|
|
1441
|
+
_chunk5GVBUTS4js.TableRow,
|
|
1442
1442
|
{
|
|
1443
1443
|
onClick: () => handleRowClick(subscription),
|
|
1444
1444
|
className: "cursor-pointer hover:bg-muted/50",
|
|
1445
1445
|
children: [
|
|
1446
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1446
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableCell, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1447
1447
|
SubscriptionStatusBadge,
|
|
1448
1448
|
{
|
|
1449
1449
|
status: subscription.status,
|
|
1450
1450
|
cancelAtPeriodEnd: subscription.cancelAtPeriodEnd
|
|
1451
1451
|
}
|
|
1452
1452
|
) }),
|
|
1453
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1454
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1455
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1456
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1457
|
-
|
|
1453
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableCell, { className: "font-medium", children: formatPlanName3(price) }),
|
|
1454
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableCell, { className: "text-muted-foreground text-sm", children: period }),
|
|
1455
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableCell, { className: "text-right font-medium", children: amount }),
|
|
1456
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableCell, { className: "text-right", children: (subscription.status === "active" /* ACTIVE */ || subscription.status === "trialing" /* TRIALING */) && onChangePlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1457
|
+
_chunk5GVBUTS4js.Button,
|
|
1458
1458
|
{
|
|
1459
1459
|
size: "sm",
|
|
1460
1460
|
variant: "outline",
|
|
@@ -1522,7 +1522,7 @@ function SubscriptionsContainer({ onOpenWizard, hasActiveRecurringSubscription }
|
|
|
1522
1522
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-8 w-8" }),
|
|
1523
1523
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h1", { className: "text-primary text-3xl font-semibold", children: "Subscriptions" })
|
|
1524
1524
|
] }),
|
|
1525
|
-
subscriptions.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1525
|
+
subscriptions.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Button, { onClick: () => _optionalChain([onOpenWizard, 'optionalCall', _43 => _43()]), children: hasActiveRecurringSubscription ? "Purchase Add-ons" : "Subscribe to a Plan" })
|
|
1526
1526
|
] }),
|
|
1527
1527
|
criticalSubscriptions.map((subscription) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BillingAlertBanner, { subscription }, subscription.id)),
|
|
1528
1528
|
subscriptions.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col items-center justify-center py-12 space-y-4", children: [
|
|
@@ -1530,7 +1530,7 @@ function SubscriptionsContainer({ onOpenWizard, hasActiveRecurringSubscription }
|
|
|
1530
1530
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-center", children: [
|
|
1531
1531
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-sm font-medium mb-2", children: "No Active Subscriptions" }),
|
|
1532
1532
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground mb-6", children: "Choose a subscription plan to get started with our services." }),
|
|
1533
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1533
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Button, { onClick: () => _optionalChain([onOpenWizard, 'optionalCall', _44 => _44()]), children: "Subscribe to a Plan" })
|
|
1534
1534
|
] })
|
|
1535
1535
|
] }),
|
|
1536
1536
|
subscriptions.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1551,9 +1551,9 @@ function IntervalToggle({ value, onChange, hasMonthly, hasYearly }) {
|
|
|
1551
1551
|
if (!hasMonthly || !hasYearly) {
|
|
1552
1552
|
return null;
|
|
1553
1553
|
}
|
|
1554
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1555
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1556
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1554
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Tabs, { value, onValueChange: (v) => onChange(v), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.TabsList, { children: [
|
|
1555
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TabsTrigger, { value: "month", children: "Monthly" }),
|
|
1556
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TabsTrigger, { value: "year", children: "Yearly" })
|
|
1557
1557
|
] }) });
|
|
1558
1558
|
}
|
|
1559
1559
|
_chunk7QVYU63Ejs.__name.call(void 0, IntervalToggle, "IntervalToggle");
|
|
@@ -1571,8 +1571,8 @@ function PricingCard({
|
|
|
1571
1571
|
}) {
|
|
1572
1572
|
const description = price.description || price.nickname || "Standard";
|
|
1573
1573
|
const features = price.features || [];
|
|
1574
|
-
const formattedPrice =
|
|
1575
|
-
const interval =
|
|
1574
|
+
const formattedPrice = _chunk5GVBUTS4js.formatCurrency.call(void 0, price.unitAmount, price.currency);
|
|
1575
|
+
const interval = _chunk5GVBUTS4js.formatInterval.call(void 0, price);
|
|
1576
1576
|
const handleKeyDown = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (e) => {
|
|
1577
1577
|
if ((e.key === "Enter" || e.key === " ") && !isDisabled && !isCurrentPlan) {
|
|
1578
1578
|
e.preventDefault();
|
|
@@ -1585,7 +1585,7 @@ function PricingCard({
|
|
|
1585
1585
|
}
|
|
1586
1586
|
}, "handleClick");
|
|
1587
1587
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1588
|
-
|
|
1588
|
+
_chunk5GVBUTS4js.Card,
|
|
1589
1589
|
{
|
|
1590
1590
|
role: "radio",
|
|
1591
1591
|
"aria-checked": isSelected,
|
|
@@ -1603,9 +1603,9 @@ function PricingCard({
|
|
|
1603
1603
|
isLoading && "pointer-events-none"
|
|
1604
1604
|
),
|
|
1605
1605
|
children: [
|
|
1606
|
-
isCurrentPlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1607
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1608
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1606
|
+
isCurrentPlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Badge, { variant: "secondary", className: "absolute top-2 right-2", children: "Current" }),
|
|
1607
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardHeader, { className: "pb-2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-sm font-medium", children: description }) }),
|
|
1608
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.CardContent, { className: "pb-4 grow", children: [
|
|
1609
1609
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mb-4", children: [
|
|
1610
1610
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-3xl font-bold", children: formattedPrice }),
|
|
1611
1611
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground ml-1", children: interval })
|
|
@@ -1615,8 +1615,8 @@ function PricingCard({
|
|
|
1615
1615
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm text-muted-foreground", children: feature })
|
|
1616
1616
|
] }, index)) })
|
|
1617
1617
|
] }),
|
|
1618
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1619
|
-
|
|
1618
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardFooter, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1619
|
+
_chunk5GVBUTS4js.Button,
|
|
1620
1620
|
{
|
|
1621
1621
|
variant: isCurrentPlan ? "secondary" : isSelected ? "default" : "outline",
|
|
1622
1622
|
className: "w-full",
|
|
@@ -1644,7 +1644,7 @@ function ProductPricingRow({
|
|
|
1644
1644
|
return null;
|
|
1645
1645
|
}
|
|
1646
1646
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-3", children: [
|
|
1647
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1647
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.SectionHeader, { children: product.name }),
|
|
1648
1648
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1649
1649
|
"div",
|
|
1650
1650
|
{
|
|
@@ -1744,15 +1744,15 @@ function ProductPricingList({
|
|
|
1744
1744
|
_chunk7QVYU63Ejs.__name.call(void 0, ProductPricingList, "ProductPricingList");
|
|
1745
1745
|
function ProductPricingListSkeleton() {
|
|
1746
1746
|
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: [
|
|
1747
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1747
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Skeleton, { className: "h-6 w-32" }),
|
|
1748
1748
|
/* @__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: [
|
|
1749
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1750
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1749
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Skeleton, { className: "h-6 w-24" }),
|
|
1750
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Skeleton, { className: "h-8 w-32" }),
|
|
1751
1751
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
1752
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1753
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1752
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Skeleton, { className: "h-4 w-full" }),
|
|
1753
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Skeleton, { className: "h-4 w-3/4" })
|
|
1754
1754
|
] }),
|
|
1755
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1755
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Skeleton, { className: "h-10 w-full" })
|
|
1756
1756
|
] }, cardIndex)) })
|
|
1757
1757
|
] }, rowIndex)) });
|
|
1758
1758
|
}
|
|
@@ -1766,18 +1766,18 @@ function ProrationPreview({ preview }) {
|
|
|
1766
1766
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
1767
1767
|
preview.lineItems.map((item, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between text-sm", children: [
|
|
1768
1768
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground", children: item.description }),
|
|
1769
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `font-medium ${item.amount < 0 ? "text-success" : "text-foreground"}`, children:
|
|
1769
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `font-medium ${item.amount < 0 ? "text-success" : "text-foreground"}`, children: _chunk5GVBUTS4js.formatCurrency.call(void 0, item.amount, preview.currency) })
|
|
1770
1770
|
] }, index)),
|
|
1771
1771
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border-primary/30 mt-2 border-t pt-2", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between font-semibold", children: [
|
|
1772
1772
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-foreground", children: "Net Due Today" }),
|
|
1773
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-foreground", children:
|
|
1773
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-foreground", children: _chunk5GVBUTS4js.formatCurrency.call(void 0, preview.immediateCharge, preview.currency) })
|
|
1774
1774
|
] }) }),
|
|
1775
1775
|
preview.lineItems.length > 0 && preview.lineItems[0].period && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-muted-foreground mt-2 text-xs", children: [
|
|
1776
1776
|
"Next invoice on ",
|
|
1777
1777
|
formatDate3(preview.lineItems[0].period.end),
|
|
1778
1778
|
" for",
|
|
1779
1779
|
" ",
|
|
1780
|
-
|
|
1780
|
+
_chunk5GVBUTS4js.formatCurrency.call(void 0, preview.amountDue, preview.currency)
|
|
1781
1781
|
] })
|
|
1782
1782
|
] })
|
|
1783
1783
|
] });
|
|
@@ -1799,16 +1799,16 @@ function SubscriptionConfirmation({ price, isLoading, onConfirm, onCancel }) {
|
|
|
1799
1799
|
productDescription && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-sm text-muted-foreground", children: productDescription })
|
|
1800
1800
|
] }),
|
|
1801
1801
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-lg font-semibold", children: [
|
|
1802
|
-
|
|
1803
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-normal text-muted-foreground", children:
|
|
1802
|
+
_chunk5GVBUTS4js.formatCurrency.call(void 0, price.unitAmount, price.currency),
|
|
1803
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-normal text-muted-foreground", children: _chunk5GVBUTS4js.formatInterval.call(void 0, price) })
|
|
1804
1804
|
] }),
|
|
1805
1805
|
features.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "space-y-1", children: features.map((feature, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2 text-sm ", children: [
|
|
1806
1806
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Check, { className: "h-4 w-4 text-primary" }),
|
|
1807
1807
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: feature })
|
|
1808
1808
|
] }, index)) }),
|
|
1809
1809
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-end gap-3 pt-2 border-t border-accent/30", children: [
|
|
1810
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1811
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1810
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Button, { variant: "outline", onClick: onCancel, disabled: isLoading, children: "Cancel" }),
|
|
1811
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Button, { onClick: onConfirm, disabled: isLoading, children: isLoading ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1812
1812
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Loader2, { className: "h-4 w-4 animate-spin mr-2" }),
|
|
1813
1813
|
"Processing..."
|
|
1814
1814
|
] }) : "Subscribe" })
|
|
@@ -2138,7 +2138,7 @@ function WizardStepPlanSelection({
|
|
|
2138
2138
|
onSelectPrice: handleSelectPrice
|
|
2139
2139
|
}
|
|
2140
2140
|
),
|
|
2141
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex justify-end pt-4 border-t", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2141
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex justify-end pt-4 border-t", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Button, { onClick: onNext, disabled: !selectedPrice || isProcessing, children: isProcessing ? "Loading..." : "Next: Review" }) })
|
|
2142
2142
|
] });
|
|
2143
2143
|
}
|
|
2144
2144
|
_chunk7QVYU63Ejs.__name.call(void 0, WizardStepPlanSelection, "WizardStepPlanSelection");
|
|
@@ -2199,7 +2199,7 @@ function PromoCodeInput({
|
|
|
2199
2199
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-success text-sm", children: formatDiscount(appliedCode) })
|
|
2200
2200
|
] }),
|
|
2201
2201
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2202
|
-
|
|
2202
|
+
_chunk5GVBUTS4js.Button,
|
|
2203
2203
|
{
|
|
2204
2204
|
variant: "ghost",
|
|
2205
2205
|
size: "sm",
|
|
@@ -2216,7 +2216,7 @@ function PromoCodeInput({
|
|
|
2216
2216
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
2217
2217
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex gap-2", children: [
|
|
2218
2218
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2219
|
-
|
|
2219
|
+
_chunk5GVBUTS4js.Input,
|
|
2220
2220
|
{
|
|
2221
2221
|
placeholder: "Enter promo code",
|
|
2222
2222
|
value: code,
|
|
@@ -2226,7 +2226,7 @@ function PromoCodeInput({
|
|
|
2226
2226
|
className: "flex-1"
|
|
2227
2227
|
}
|
|
2228
2228
|
),
|
|
2229
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2229
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.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" })
|
|
2230
2230
|
] }),
|
|
2231
2231
|
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error })
|
|
2232
2232
|
] });
|
|
@@ -2291,14 +2291,14 @@ function WizardStepReview({
|
|
|
2291
2291
|
return `${promotionCode.discountValue}% off`;
|
|
2292
2292
|
}
|
|
2293
2293
|
if (promotionCode.discountType === "amount_off" && promotionCode.discountValue) {
|
|
2294
|
-
return `${
|
|
2294
|
+
return `${_chunk5GVBUTS4js.formatCurrency.call(void 0, promotionCode.discountValue, promotionCode.currency || selectedPrice.currency)} off`;
|
|
2295
2295
|
}
|
|
2296
2296
|
return null;
|
|
2297
2297
|
}, "getDiscountDescription");
|
|
2298
2298
|
const discountDescription = getDiscountDescription();
|
|
2299
2299
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-6", children: [
|
|
2300
2300
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bg-muted/50 rounded-lg p-4 space-y-3", children: [
|
|
2301
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2301
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.SectionHeader, { children: "Selected Plan" }),
|
|
2302
2302
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between items-center", children: [
|
|
2303
2303
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
|
|
2304
2304
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "font-medium", children: _optionalChain([selectedPrice, 'access', _92 => _92.product, 'optionalAccess', _93 => _93.name]) }),
|
|
@@ -2306,10 +2306,10 @@ function WizardStepReview({
|
|
|
2306
2306
|
] }),
|
|
2307
2307
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-right", children: [
|
|
2308
2308
|
discountedPrice !== null ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2309
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground line-through", children:
|
|
2310
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-success text-lg font-semibold", children:
|
|
2311
|
-
discountDescription && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2312
|
-
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "font-semibold text-lg", children:
|
|
2309
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground line-through", children: _chunk5GVBUTS4js.formatCurrency.call(void 0, selectedPrice.unitAmount || 0, selectedPrice.currency) }),
|
|
2310
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-success text-lg font-semibold", children: _chunk5GVBUTS4js.formatCurrency.call(void 0, discountedPrice, selectedPrice.currency) }),
|
|
2311
|
+
discountDescription && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Badge, { variant: "softGreen", children: discountDescription })
|
|
2312
|
+
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "font-semibold text-lg", children: _chunk5GVBUTS4js.formatCurrency.call(void 0, selectedPrice.unitAmount || 0, selectedPrice.currency) }),
|
|
2313
2313
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: formatInterval2(selectedPrice) })
|
|
2314
2314
|
] })
|
|
2315
2315
|
] })
|
|
@@ -2324,9 +2324,9 @@ function WizardStepReview({
|
|
|
2324
2324
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between text-sm", children: [
|
|
2325
2325
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `${isTrialUpgrade ? "text-warning" : "text-muted-foreground"}`, children: isTrialUpgrade ? "Amount to charge now:" : "Amount due now:" }),
|
|
2326
2326
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `font-medium ${isTrialUpgrade ? "text-warning" : "text-foreground"}`, children: discountedImmediateCharge !== null ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2327
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "line-through text-muted-foreground mr-2", children:
|
|
2328
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-success", children:
|
|
2329
|
-
] }) :
|
|
2327
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "line-through text-muted-foreground mr-2", children: _chunk5GVBUTS4js.formatCurrency.call(void 0, prorationPreview.immediateCharge, prorationPreview.currency) }),
|
|
2328
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-success", children: _chunk5GVBUTS4js.formatCurrency.call(void 0, discountedImmediateCharge, prorationPreview.currency) })
|
|
2329
|
+
] }) : _chunk5GVBUTS4js.formatCurrency.call(void 0, prorationPreview.immediateCharge, prorationPreview.currency) })
|
|
2330
2330
|
] })
|
|
2331
2331
|
]
|
|
2332
2332
|
}
|
|
@@ -2350,15 +2350,15 @@ function WizardStepReview({
|
|
|
2350
2350
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h4", { className: "font-medium", children: "Payment Method" }),
|
|
2351
2351
|
/* @__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" })
|
|
2352
2352
|
] }),
|
|
2353
|
-
!hasPaymentMethod && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2353
|
+
!hasPaymentMethod && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Button, { variant: "outline", onClick: onAddPaymentMethod, children: "Add Payment Method" })
|
|
2354
2354
|
] }) }),
|
|
2355
|
-
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2355
|
+
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.Alert, { variant: "destructive", children: [
|
|
2356
2356
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.AlertCircle, { className: "h-4 w-4" }),
|
|
2357
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2357
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.AlertDescription, { children: error })
|
|
2358
2358
|
] }),
|
|
2359
2359
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between pt-4 border-t", children: [
|
|
2360
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2361
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2360
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Button, { variant: "outline", onClick: onBack, disabled: isProcessing, children: "Back" }),
|
|
2361
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Button, { onClick: hasPaymentMethod ? onConfirm : onAddPaymentMethod, disabled: isProcessing, children: isProcessing ? "Processing..." : hasPaymentMethod ? isChangingPlan ? "Confirm Plan Change" : "Subscribe Now" : "Add Payment Method" })
|
|
2362
2362
|
] })
|
|
2363
2363
|
] });
|
|
2364
2364
|
}
|
|
@@ -2369,7 +2369,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, WizardStepReview, "WizardStepReview");
|
|
|
2369
2369
|
function WizardStepPaymentMethod({ onBack, onSuccess, isProcessing }) {
|
|
2370
2370
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-6", children: [
|
|
2371
2371
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-center", children: [
|
|
2372
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2372
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.SectionHeader, { children: "Add Payment Method" }),
|
|
2373
2373
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: "Enter your card details to complete your subscription" })
|
|
2374
2374
|
] }),
|
|
2375
2375
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, PaymentMethodForm, { onSuccess, onCancel: onBack, isLoading: isProcessing })
|
|
@@ -2411,10 +2411,10 @@ function SubscriptionWizard({
|
|
|
2411
2411
|
const isChangePlanMode = !!subscription;
|
|
2412
2412
|
const dialogTitle = subscription ? "Change Subscription Plan" : isPurchasingAddons ? "Purchase Add-ons" : "Subscribe to a Plan";
|
|
2413
2413
|
const dialogDescription = subscription ? "Select a new plan for your subscription" : isPurchasingAddons ? "Select one-time products to purchase" : "Choose a subscription plan to get started";
|
|
2414
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2415
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2416
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2417
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2414
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.DialogContent, { className: "max-w-2xl", children: [
|
|
2415
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.DialogHeader, { children: [
|
|
2416
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.DialogTitle, { children: dialogTitle }),
|
|
2417
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.DialogDescription, { children: dialogDescription })
|
|
2418
2418
|
] }),
|
|
2419
2419
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, WizardProgressIndicator, { currentStep: state.step }),
|
|
2420
2420
|
state.step === "plan-selection" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -2497,15 +2497,15 @@ function UsageSummaryCard({ meter, summary }) {
|
|
|
2497
2497
|
const progressWidth = percentage !== null ? Math.min(percentage, 100) : 0;
|
|
2498
2498
|
const displayName = meter.displayName || meter.eventName;
|
|
2499
2499
|
const hasLimit = limit !== null && limit !== void 0;
|
|
2500
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2501
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2500
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.Card, { children: [
|
|
2501
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.CardHeader, { className: "flex flex-row items-center gap-x-3 pb-3", children: [
|
|
2502
2502
|
/* @__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" }) }),
|
|
2503
2503
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col", children: [
|
|
2504
2504
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-sm font-medium", children: displayName }),
|
|
2505
2505
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground text-xs", children: meter.id })
|
|
2506
2506
|
] })
|
|
2507
2507
|
] }),
|
|
2508
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2508
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.CardContent, { className: "flex flex-col gap-y-4", children: [
|
|
2509
2509
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
|
|
2510
2510
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-3xl font-bold", children: currentUsage.toLocaleString() }),
|
|
2511
2511
|
hasLimit && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "text-muted-foreground text-sm", children: [
|
|
@@ -2632,22 +2632,22 @@ function UsageHistoryTable({ usageRecords }) {
|
|
|
2632
2632
|
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." }) });
|
|
2633
2633
|
}
|
|
2634
2634
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
2635
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2636
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "overflow-clip rounded-lg border", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2637
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2638
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2639
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2640
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2641
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2635
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.SectionHeader, { level: 2, children: "Usage History" }),
|
|
2636
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "overflow-clip rounded-lg border", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.Table, { children: [
|
|
2637
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableHeader, { className: "bg-muted", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.TableRow, { children: [
|
|
2638
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableHead, { children: "Date & Time" }),
|
|
2639
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableHead, { children: "Meter Event" }),
|
|
2640
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableHead, { className: "text-right", children: "Quantity" }),
|
|
2641
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableHead, { children: "Event ID" })
|
|
2642
2642
|
] }) }),
|
|
2643
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2643
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableBody, { children: usageRecords.map((record) => {
|
|
2644
2644
|
const dateTime = formatDateTime(record.timestamp);
|
|
2645
2645
|
const quantity = record.quantity.toLocaleString();
|
|
2646
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2647
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2648
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2649
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2650
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2646
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.TableRow, { children: [
|
|
2647
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableCell, { className: "font-medium", children: dateTime }),
|
|
2648
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableCell, { className: "text-muted-foreground", children: record.meterEventName }),
|
|
2649
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableCell, { className: "text-right font-medium", children: quantity }),
|
|
2650
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableCell, { className: "text-muted-foreground text-sm tabular-nums", children: record.stripeEventId })
|
|
2651
2651
|
] }, record.id);
|
|
2652
2652
|
}) })
|
|
2653
2653
|
] }) })
|
|
@@ -2658,8 +2658,8 @@ _chunk7QVYU63Ejs.__name.call(void 0, UsageHistoryTable, "UsageHistoryTable");
|
|
|
2658
2658
|
// src/features/billing/components/modals/BillingDetailModal.tsx
|
|
2659
2659
|
|
|
2660
2660
|
function BillingDetailModal({ open, onOpenChange, title, children, className }) {
|
|
2661
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2662
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2661
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.DialogContent, { className: _nullishCoalesce(className, () => ( "max-w-4xl max-h-[90vh] overflow-y-auto")), children: [
|
|
2662
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.DialogHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.DialogTitle, { children: title }) }),
|
|
2663
2663
|
children
|
|
2664
2664
|
] }) });
|
|
2665
2665
|
}
|
|
@@ -2676,7 +2676,7 @@ function BillingAlertBanner({ subscription, onUpdatePayment, onAddPayment }) {
|
|
|
2676
2676
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-destructive text-sm font-medium", children: "Payment Failed" }),
|
|
2677
2677
|
/* @__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." })
|
|
2678
2678
|
] }),
|
|
2679
|
-
onUpdatePayment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2679
|
+
onUpdatePayment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Button, { variant: "outline", size: "sm", onClick: onUpdatePayment, className: "text-destructive border-red-300", children: "Update Payment Method" })
|
|
2680
2680
|
] });
|
|
2681
2681
|
}
|
|
2682
2682
|
if (subscription.status === "trialing" /* TRIALING */ && subscription.trialEnd) {
|
|
@@ -2696,7 +2696,7 @@ function BillingAlertBanner({ subscription, onUpdatePayment, onAddPayment }) {
|
|
|
2696
2696
|
". Add a payment method to continue your subscription."
|
|
2697
2697
|
] })
|
|
2698
2698
|
] }),
|
|
2699
|
-
onAddPayment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2699
|
+
onAddPayment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Button, { variant: "outline", size: "sm", onClick: onAddPayment, className: "text-warning border-yellow-300", children: "Add Payment Method" })
|
|
2700
2700
|
] });
|
|
2701
2701
|
}
|
|
2702
2702
|
}
|
|
@@ -2920,18 +2920,18 @@ function BillingDashboardContainer() {
|
|
|
2920
2920
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Wallet, { className: "h-8 w-8" }),
|
|
2921
2921
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h1", { className: "text-primary text-3xl font-semibold", children: "Billing" })
|
|
2922
2922
|
] }),
|
|
2923
|
-
isInitialLoading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2924
|
-
noCustomerExists && !isInitialLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2925
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2923
|
+
isInitialLoading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.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" }) }) }),
|
|
2924
|
+
noCustomerExists && !isInitialLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.Card, { children: [
|
|
2925
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.CardHeader, { className: "text-center", children: [
|
|
2926
2926
|
/* @__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" }) }),
|
|
2927
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2928
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2927
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardTitle, { children: "Set Up Billing" }),
|
|
2928
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardDescription, { children: "Your company doesn't have a billing account yet. Set one up to manage subscriptions, payment methods, and view invoices." })
|
|
2929
2929
|
] }),
|
|
2930
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2930
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardContent, { className: "flex justify-center pb-8", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Button, { onClick: handleCreateCustomer, disabled: creatingCustomer, size: "lg", children: creatingCustomer ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2931
2931
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Loader2, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
2932
2932
|
"Setting up..."
|
|
2933
2933
|
] }) : "Set Up Billing Account" }) }),
|
|
2934
|
-
errors.customer && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2934
|
+
errors.customer && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardContent, { className: "pt-0", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-center text-destructive text-xs/relaxed", children: errors.customer }) })
|
|
2935
2935
|
] }),
|
|
2936
2936
|
!noCustomerExists && !isInitialLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2937
2937
|
criticalSubscriptions.map((subscription) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -3103,12 +3103,12 @@ function PriceArchiver({ price }) {
|
|
|
3103
3103
|
const isArchived = !price.active;
|
|
3104
3104
|
const scope = isArchived ? "restore" : "archive";
|
|
3105
3105
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
3106
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3106
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.Button, { variant: "outline", size: "sm", onClick: () => setOpen(true), children: [
|
|
3107
3107
|
isArchived ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.RotateCcwIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ArchiveIcon, {}),
|
|
3108
3108
|
t(`billing.admin.prices.${scope}.confirm`)
|
|
3109
3109
|
] }),
|
|
3110
3110
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3111
|
-
|
|
3111
|
+
_chunk5GVBUTS4js.ConfirmDialog,
|
|
3112
3112
|
{
|
|
3113
3113
|
open,
|
|
3114
3114
|
onOpenChange: setOpen,
|
|
@@ -3122,7 +3122,7 @@ function PriceArchiver({ price }) {
|
|
|
3122
3122
|
if (isArchived) await restorePrice(price.id);
|
|
3123
3123
|
else await archivePrice(price.id);
|
|
3124
3124
|
} catch (error) {
|
|
3125
|
-
|
|
3125
|
+
_chunk5GVBUTS4js.errorToast.call(void 0, { title: t(`billing.admin.prices.${scope}.title`), error });
|
|
3126
3126
|
throw error;
|
|
3127
3127
|
}
|
|
3128
3128
|
}
|
|
@@ -3225,7 +3225,7 @@ function PriceEditorInternal({
|
|
|
3225
3225
|
{ id: "metered", text: t("billing.admin.prices.usage.metered") }
|
|
3226
3226
|
];
|
|
3227
3227
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3228
|
-
|
|
3228
|
+
_chunk5GVBUTS4js.EditorSheet,
|
|
3229
3229
|
{
|
|
3230
3230
|
form,
|
|
3231
3231
|
entityType: t("billing.admin.prices.entity"),
|
|
@@ -3280,13 +3280,13 @@ function PriceEditorInternal({
|
|
|
3280
3280
|
dialogOpen,
|
|
3281
3281
|
onDialogOpenChange,
|
|
3282
3282
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
3283
|
-
isEdit && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3284
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3285
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3283
|
+
isEdit && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.Alert, { children: [
|
|
3284
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.AlertTitle, { children: t("billing.admin.prices.immutability.title") }),
|
|
3285
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.AlertDescription, { children: t("billing.admin.prices.immutability.description") })
|
|
3286
3286
|
] }),
|
|
3287
3287
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-2 gap-x-4", children: [
|
|
3288
3288
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3289
|
-
|
|
3289
|
+
_chunk5GVBUTS4js.FormInput,
|
|
3290
3290
|
{
|
|
3291
3291
|
form,
|
|
3292
3292
|
id: "unitAmount",
|
|
@@ -3298,7 +3298,7 @@ function PriceEditorInternal({
|
|
|
3298
3298
|
}
|
|
3299
3299
|
),
|
|
3300
3300
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3301
|
-
|
|
3301
|
+
_chunk5GVBUTS4js.FormSelect,
|
|
3302
3302
|
{
|
|
3303
3303
|
form,
|
|
3304
3304
|
id: "currency",
|
|
@@ -3309,7 +3309,7 @@ function PriceEditorInternal({
|
|
|
3309
3309
|
)
|
|
3310
3310
|
] }),
|
|
3311
3311
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3312
|
-
|
|
3312
|
+
_chunk5GVBUTS4js.FormSelect,
|
|
3313
3313
|
{
|
|
3314
3314
|
form,
|
|
3315
3315
|
id: "interval",
|
|
@@ -3320,7 +3320,7 @@ function PriceEditorInternal({
|
|
|
3320
3320
|
),
|
|
3321
3321
|
isRecurring && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-2 gap-x-4", children: [
|
|
3322
3322
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3323
|
-
|
|
3323
|
+
_chunk5GVBUTS4js.FormInput,
|
|
3324
3324
|
{
|
|
3325
3325
|
form,
|
|
3326
3326
|
id: "intervalCount",
|
|
@@ -3331,7 +3331,7 @@ function PriceEditorInternal({
|
|
|
3331
3331
|
}
|
|
3332
3332
|
),
|
|
3333
3333
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3334
|
-
|
|
3334
|
+
_chunk5GVBUTS4js.FormSelect,
|
|
3335
3335
|
{
|
|
3336
3336
|
form,
|
|
3337
3337
|
id: "usageType",
|
|
@@ -3342,7 +3342,7 @@ function PriceEditorInternal({
|
|
|
3342
3342
|
)
|
|
3343
3343
|
] }),
|
|
3344
3344
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3345
|
-
|
|
3345
|
+
_chunk5GVBUTS4js.FormInput,
|
|
3346
3346
|
{
|
|
3347
3347
|
form,
|
|
3348
3348
|
id: "nickname",
|
|
@@ -3351,7 +3351,7 @@ function PriceEditorInternal({
|
|
|
3351
3351
|
}
|
|
3352
3352
|
),
|
|
3353
3353
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3354
|
-
|
|
3354
|
+
_chunk5GVBUTS4js.FormTextarea,
|
|
3355
3355
|
{
|
|
3356
3356
|
form,
|
|
3357
3357
|
id: "description",
|
|
@@ -3361,7 +3361,7 @@ function PriceEditorInternal({
|
|
|
3361
3361
|
}
|
|
3362
3362
|
),
|
|
3363
3363
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3364
|
-
|
|
3364
|
+
_chunk5GVBUTS4js.FormInput,
|
|
3365
3365
|
{
|
|
3366
3366
|
form,
|
|
3367
3367
|
id: "token",
|
|
@@ -3371,10 +3371,10 @@ function PriceEditorInternal({
|
|
|
3371
3371
|
}
|
|
3372
3372
|
),
|
|
3373
3373
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-2", children: [
|
|
3374
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3374
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.FieldLabel, { children: t("billing.admin.prices.fields.features") }),
|
|
3375
3375
|
form.watch("features").map((_, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex gap-2", children: [
|
|
3376
3376
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3377
|
-
|
|
3377
|
+
_chunk5GVBUTS4js.Input,
|
|
3378
3378
|
{
|
|
3379
3379
|
...form.register(`features.${index}`),
|
|
3380
3380
|
placeholder: t("billing.admin.prices.placeholders.feature", { index: index + 1 }),
|
|
@@ -3382,7 +3382,7 @@ function PriceEditorInternal({
|
|
|
3382
3382
|
}
|
|
3383
3383
|
),
|
|
3384
3384
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3385
|
-
|
|
3385
|
+
_chunk5GVBUTS4js.Button,
|
|
3386
3386
|
{
|
|
3387
3387
|
type: "button",
|
|
3388
3388
|
variant: "outline",
|
|
@@ -3397,7 +3397,7 @@ function PriceEditorInternal({
|
|
|
3397
3397
|
)
|
|
3398
3398
|
] }, index)),
|
|
3399
3399
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3400
|
-
|
|
3400
|
+
_chunk5GVBUTS4js.Button,
|
|
3401
3401
|
{
|
|
3402
3402
|
type: "button",
|
|
3403
3403
|
variant: "outline",
|
|
@@ -3412,12 +3412,12 @@ function PriceEditorInternal({
|
|
|
3412
3412
|
)
|
|
3413
3413
|
] }),
|
|
3414
3414
|
isRecurring && allFeatures.length > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-2", children: [
|
|
3415
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3415
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.FieldLabel, { children: t("billing.admin.prices.fields.platformFeatures") }),
|
|
3416
3416
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex max-h-48 flex-col gap-y-2 overflow-y-auto rounded-md border p-4", children: allFeatures.map((feature) => {
|
|
3417
3417
|
const isChecked = form.watch("featureIds").includes(feature.id);
|
|
3418
3418
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-2", children: [
|
|
3419
3419
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3420
|
-
|
|
3420
|
+
_chunk5GVBUTS4js.Checkbox,
|
|
3421
3421
|
{
|
|
3422
3422
|
id: `feature-${feature.id}`,
|
|
3423
3423
|
checked: isChecked,
|
|
@@ -3433,13 +3433,13 @@ function PriceEditorInternal({
|
|
|
3433
3433
|
}
|
|
3434
3434
|
}
|
|
3435
3435
|
),
|
|
3436
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3436
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.FieldLabel, { htmlFor: `feature-${feature.id}`, children: feature.name }),
|
|
3437
3437
|
feature.isCore && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("billing.admin.prices.help.core") })
|
|
3438
3438
|
] }, feature.id);
|
|
3439
3439
|
}) })
|
|
3440
3440
|
] }),
|
|
3441
3441
|
isRecurring && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3442
|
-
|
|
3442
|
+
_chunk5GVBUTS4js.FormCheckbox,
|
|
3443
3443
|
{
|
|
3444
3444
|
form,
|
|
3445
3445
|
id: "isTrial",
|
|
@@ -3482,7 +3482,7 @@ var defaultContextValue = {
|
|
|
3482
3482
|
productId: void 0
|
|
3483
3483
|
};
|
|
3484
3484
|
function priceLabel(price) {
|
|
3485
|
-
return _nullishCoalesce(price.nickname, () => ( `${
|
|
3485
|
+
return _nullishCoalesce(price.nickname, () => ( `${_chunk5GVBUTS4js.formatCurrency.call(void 0, price.unitAmount, price.currency)} ${_chunk5GVBUTS4js.formatInterval.call(void 0, price)}`.trim()));
|
|
3486
3486
|
}
|
|
3487
3487
|
_chunk7QVYU63Ejs.__name.call(void 0, priceLabel, "priceLabel");
|
|
3488
3488
|
var PriceProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({
|
|
@@ -3492,8 +3492,8 @@ var PriceProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({
|
|
|
3492
3492
|
productId: productIdProp
|
|
3493
3493
|
}) => {
|
|
3494
3494
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
3495
|
-
const generateUrl =
|
|
3496
|
-
const { hasRole } =
|
|
3495
|
+
const generateUrl = _chunk5GVBUTS4js.usePageUrlGenerator.call(void 0, );
|
|
3496
|
+
const { hasRole } = _chunk5GVBUTS4js.useCurrentUserContext.call(void 0, );
|
|
3497
3497
|
const [price, setPrice] = _react.useState.call(void 0,
|
|
3498
3498
|
dehydratedPrice ? _chunk53B6NPGAjs.rehydrate.call(void 0, _chunk53B6NPGAjs.Modules.StripePrice, dehydratedPrice) : void 0
|
|
3499
3499
|
);
|
|
@@ -3581,7 +3581,7 @@ var PriceProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({
|
|
|
3581
3581
|
}
|
|
3582
3582
|
return response;
|
|
3583
3583
|
}, "title");
|
|
3584
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3584
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PriceContext.Provider, { value, children }) });
|
|
3585
3585
|
}, "PriceProvider");
|
|
3586
3586
|
var usePriceContext = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => _nullishCoalesce(_react.useContext.call(void 0, PriceContext), () => ( defaultContextValue)), "usePriceContext");
|
|
3587
3587
|
|
|
@@ -3601,12 +3601,12 @@ function ProductArchiver({ product }) {
|
|
|
3601
3601
|
const isArchived = !product.active;
|
|
3602
3602
|
const scope = isArchived ? "restore" : "archive";
|
|
3603
3603
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
3604
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3604
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.Button, { variant: "outline", size: "sm", onClick: () => setOpen(true), children: [
|
|
3605
3605
|
isArchived ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.RotateCcwIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ArchiveIcon, {}),
|
|
3606
3606
|
t(`billing.admin.products.${scope}.confirm`)
|
|
3607
3607
|
] }),
|
|
3608
3608
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3609
|
-
|
|
3609
|
+
_chunk5GVBUTS4js.ConfirmDialog,
|
|
3610
3610
|
{
|
|
3611
3611
|
open,
|
|
3612
3612
|
onOpenChange: setOpen,
|
|
@@ -3620,7 +3620,7 @@ function ProductArchiver({ product }) {
|
|
|
3620
3620
|
if (isArchived) await restoreProduct(product.id);
|
|
3621
3621
|
else await archiveProduct(product.id);
|
|
3622
3622
|
} catch (error) {
|
|
3623
|
-
|
|
3623
|
+
_chunk5GVBUTS4js.errorToast.call(void 0, { title: t(`billing.admin.products.${scope}.title`), error });
|
|
3624
3624
|
throw error;
|
|
3625
3625
|
}
|
|
3626
3626
|
}
|
|
@@ -3673,7 +3673,7 @@ function ProductEditorInternal({
|
|
|
3673
3673
|
defaultValues: getDefaultValues()
|
|
3674
3674
|
});
|
|
3675
3675
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3676
|
-
|
|
3676
|
+
_chunk5GVBUTS4js.EditorSheet,
|
|
3677
3677
|
{
|
|
3678
3678
|
form,
|
|
3679
3679
|
entityType: t("billing.admin.products.entity"),
|
|
@@ -3696,7 +3696,7 @@ function ProductEditorInternal({
|
|
|
3696
3696
|
onDialogOpenChange,
|
|
3697
3697
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
3698
3698
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3699
|
-
|
|
3699
|
+
_chunk5GVBUTS4js.FormInput,
|
|
3700
3700
|
{
|
|
3701
3701
|
form,
|
|
3702
3702
|
id: "name",
|
|
@@ -3706,7 +3706,7 @@ function ProductEditorInternal({
|
|
|
3706
3706
|
}
|
|
3707
3707
|
),
|
|
3708
3708
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3709
|
-
|
|
3709
|
+
_chunk5GVBUTS4js.FormTextarea,
|
|
3710
3710
|
{
|
|
3711
3711
|
form,
|
|
3712
3712
|
id: "description",
|
|
@@ -3750,8 +3750,8 @@ var defaultContextValue2 = {
|
|
|
3750
3750
|
};
|
|
3751
3751
|
var ProductProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ children, dehydratedProduct, publishChrome = true }) => {
|
|
3752
3752
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
3753
|
-
const generateUrl =
|
|
3754
|
-
const { hasRole } =
|
|
3753
|
+
const generateUrl = _chunk5GVBUTS4js.usePageUrlGenerator.call(void 0, );
|
|
3754
|
+
const { hasRole } = _chunk5GVBUTS4js.useCurrentUserContext.call(void 0, );
|
|
3755
3755
|
const [product, setProduct] = _react.useState.call(void 0,
|
|
3756
3756
|
dehydratedProduct ? _chunk53B6NPGAjs.rehydrate.call(void 0, _chunk53B6NPGAjs.Modules.StripeProduct, dehydratedProduct) : void 0
|
|
3757
3757
|
);
|
|
@@ -3845,7 +3845,7 @@ var ProductProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ ch
|
|
|
3845
3845
|
}
|
|
3846
3846
|
return response;
|
|
3847
3847
|
}, "title");
|
|
3848
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3848
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductContext.Provider, { value, children }) });
|
|
3849
3849
|
}, "ProductProvider");
|
|
3850
3850
|
var useProductContext = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => _nullishCoalesce(_react.useContext.call(void 0, ProductContext), () => ( defaultContextValue2)), "useProductContext");
|
|
3851
3851
|
|
|
@@ -3854,56 +3854,56 @@ var useProductContext = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ()
|
|
|
3854
3854
|
|
|
3855
3855
|
function PriceDetails() {
|
|
3856
3856
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
3857
|
-
const generateUrl =
|
|
3857
|
+
const generateUrl = _chunk5GVBUTS4js.usePageUrlGenerator.call(void 0, );
|
|
3858
3858
|
const { price } = usePriceContext();
|
|
3859
3859
|
if (!price) return null;
|
|
3860
3860
|
const isRecurring = price.priceType === "recurring";
|
|
3861
3861
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-8", children: [
|
|
3862
3862
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
3863
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3863
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.SectionHeader, { children: t("billing.admin.prices.title") }),
|
|
3864
3864
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
|
|
3865
3865
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3866
|
-
|
|
3866
|
+
_chunk5GVBUTS4js.DetailField,
|
|
3867
3867
|
{
|
|
3868
3868
|
label: t("billing.admin.prices.fields.product"),
|
|
3869
|
-
value: price.product ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3869
|
+
value: price.product ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Link, { href: generateUrl({ page: _chunk53B6NPGAjs.Modules.StripeProduct, id: price.product.id }), children: price.product.name }) : "\u2014"
|
|
3870
3870
|
}
|
|
3871
3871
|
),
|
|
3872
3872
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3873
|
-
|
|
3873
|
+
_chunk5GVBUTS4js.DetailField,
|
|
3874
3874
|
{
|
|
3875
3875
|
label: t("billing.admin.prices.fields.status"),
|
|
3876
3876
|
value: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex flex-wrap items-center gap-1", children: [
|
|
3877
|
-
price.active ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3878
|
-
price.isTrial && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3877
|
+
price.active ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Badge, { variant: "softGreen", children: t("billing.admin.prices.status.active") }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Badge, { variant: "softGray", children: t("billing.admin.prices.status.archived") }),
|
|
3878
|
+
price.isTrial && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Badge, { variant: "softBlue", children: t("billing.admin.prices.badge.trial") })
|
|
3879
3879
|
] })
|
|
3880
3880
|
}
|
|
3881
3881
|
),
|
|
3882
3882
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3883
|
-
|
|
3883
|
+
_chunk5GVBUTS4js.DetailField,
|
|
3884
3884
|
{
|
|
3885
3885
|
label: t("billing.admin.prices.fields.amount"),
|
|
3886
|
-
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children:
|
|
3886
|
+
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: _chunk5GVBUTS4js.formatCurrency.call(void 0, price.unitAmount, price.currency) })
|
|
3887
3887
|
}
|
|
3888
3888
|
),
|
|
3889
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3889
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.DetailField, { label: t("billing.admin.prices.fields.currency"), value: price.currency.toUpperCase() }),
|
|
3890
3890
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3891
|
-
|
|
3891
|
+
_chunk5GVBUTS4js.DetailField,
|
|
3892
3892
|
{
|
|
3893
3893
|
label: t("billing.admin.prices.fields.type"),
|
|
3894
3894
|
value: isRecurring ? t("billing.admin.prices.type.recurring") : t("billing.admin.prices.type.oneTime")
|
|
3895
3895
|
}
|
|
3896
3896
|
),
|
|
3897
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3897
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.DetailField, { label: t("billing.admin.prices.fields.billing"), value: _chunk5GVBUTS4js.formatInterval.call(void 0, price) }),
|
|
3898
3898
|
isRecurring && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3899
|
-
|
|
3899
|
+
_chunk5GVBUTS4js.DetailField,
|
|
3900
3900
|
{
|
|
3901
3901
|
label: t("billing.admin.prices.fields.intervalCount"),
|
|
3902
3902
|
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: _nullishCoalesce(_optionalChain([price, 'access', _157 => _157.recurring, 'optionalAccess', _158 => _158.intervalCount]), () => ( 1)) })
|
|
3903
3903
|
}
|
|
3904
3904
|
),
|
|
3905
3905
|
isRecurring && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3906
|
-
|
|
3906
|
+
_chunk5GVBUTS4js.DetailField,
|
|
3907
3907
|
{
|
|
3908
3908
|
label: t("billing.admin.prices.fields.usageType"),
|
|
3909
3909
|
value: _optionalChain([price, 'access', _159 => _159.recurring, 'optionalAccess', _160 => _160.usageType]) === "metered" ? t("billing.admin.prices.usage.metered") : t("billing.admin.prices.usage.licensed")
|
|
@@ -3912,24 +3912,24 @@ function PriceDetails() {
|
|
|
3912
3912
|
] })
|
|
3913
3913
|
] }),
|
|
3914
3914
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
3915
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3915
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.SectionHeader, { children: t("billing.admin.prices.fields.platformFeatures") }),
|
|
3916
3916
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
|
|
3917
3917
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3918
|
-
|
|
3918
|
+
_chunk5GVBUTS4js.DetailField,
|
|
3919
3919
|
{
|
|
3920
3920
|
label: t("billing.admin.prices.fields.token"),
|
|
3921
3921
|
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: _nullishCoalesce(price.token, () => ( "\u2014")) })
|
|
3922
3922
|
}
|
|
3923
3923
|
),
|
|
3924
3924
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3925
|
-
|
|
3925
|
+
_chunk5GVBUTS4js.DetailField,
|
|
3926
3926
|
{
|
|
3927
3927
|
label: t("billing.admin.prices.fields.stripeId"),
|
|
3928
3928
|
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: price.stripePriceId })
|
|
3929
3929
|
}
|
|
3930
3930
|
),
|
|
3931
3931
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3932
|
-
|
|
3932
|
+
_chunk5GVBUTS4js.DetailField,
|
|
3933
3933
|
{
|
|
3934
3934
|
label: t("billing.admin.prices.fields.description"),
|
|
3935
3935
|
value: _nullishCoalesce(price.description, () => ( "\u2014")),
|
|
@@ -3937,7 +3937,7 @@ function PriceDetails() {
|
|
|
3937
3937
|
}
|
|
3938
3938
|
),
|
|
3939
3939
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3940
|
-
|
|
3940
|
+
_chunk5GVBUTS4js.DetailField,
|
|
3941
3941
|
{
|
|
3942
3942
|
label: t("billing.admin.prices.fields.features"),
|
|
3943
3943
|
className: "md:col-span-2",
|
|
@@ -3945,11 +3945,11 @@ function PriceDetails() {
|
|
|
3945
3945
|
}
|
|
3946
3946
|
),
|
|
3947
3947
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3948
|
-
|
|
3948
|
+
_chunk5GVBUTS4js.DetailField,
|
|
3949
3949
|
{
|
|
3950
3950
|
label: t("billing.admin.prices.fields.platformFeatures"),
|
|
3951
3951
|
className: "md:col-span-2",
|
|
3952
|
-
value: price.priceFeatures.length > 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "flex flex-wrap items-center gap-1", children: price.priceFeatures.map((feature) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3952
|
+
value: price.priceFeatures.length > 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "flex flex-wrap items-center gap-1", children: price.priceFeatures.map((feature) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Badge, { variant: "softGray", children: feature.name }, feature.id)) }) : "\u2014"
|
|
3953
3953
|
}
|
|
3954
3954
|
)
|
|
3955
3955
|
] })
|
|
@@ -3963,7 +3963,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, PriceDetails, "PriceDetails");
|
|
|
3963
3963
|
function PriceContainer() {
|
|
3964
3964
|
const { price } = usePriceContext();
|
|
3965
3965
|
if (!price) return null;
|
|
3966
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3966
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.RoundPageContainer, { module: _chunk53B6NPGAjs.Modules.StripePrice, id: price.id, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PriceDetails, {}) });
|
|
3967
3967
|
}
|
|
3968
3968
|
_chunk7QVYU63Ejs.__name.call(void 0, PriceContainer, "PriceContainer");
|
|
3969
3969
|
|
|
@@ -3975,7 +3975,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, PriceContainer, "PriceContainer");
|
|
|
3975
3975
|
function PricesList({ productId, fullWidth }) {
|
|
3976
3976
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
3977
3977
|
const { priceVersion } = usePriceContext();
|
|
3978
|
-
const data =
|
|
3978
|
+
const data = _chunk5GVBUTS4js.useDataListRetriever.call(void 0, {
|
|
3979
3979
|
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunk53B6NPGAjs.StripePriceService.listPrices({ ...params, productId }), "retriever"),
|
|
3980
3980
|
retrieverParams: {},
|
|
3981
3981
|
module: _chunk53B6NPGAjs.Modules.StripePrice
|
|
@@ -3985,7 +3985,7 @@ function PricesList({ productId, fullWidth }) {
|
|
|
3985
3985
|
}, [priceVersion]);
|
|
3986
3986
|
const functions = [/* @__PURE__ */ _jsxruntime.jsx.call(void 0, PriceEditor, { productId }, "create-price")];
|
|
3987
3987
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3988
|
-
|
|
3988
|
+
_chunk5GVBUTS4js.ContentListTable,
|
|
3989
3989
|
{
|
|
3990
3990
|
data,
|
|
3991
3991
|
fields: [
|
|
@@ -4000,7 +4000,7 @@ function PricesList({ productId, fullWidth }) {
|
|
|
4000
4000
|
fullWidth,
|
|
4001
4001
|
title: t("billing.admin.prices.title"),
|
|
4002
4002
|
emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4003
|
-
|
|
4003
|
+
_chunk5GVBUTS4js.EmptyState,
|
|
4004
4004
|
{
|
|
4005
4005
|
icon: _lucidereact.DollarSignIcon,
|
|
4006
4006
|
title: t("billing.admin.prices.empty.title"),
|
|
@@ -4023,18 +4023,18 @@ function ProductDetails() {
|
|
|
4023
4023
|
const { product } = useProductContext();
|
|
4024
4024
|
if (!product) return null;
|
|
4025
4025
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
4026
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4026
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.SectionHeader, { children: t("billing.admin.products.tabs.details") }),
|
|
4027
4027
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
|
|
4028
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4028
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.DetailField, { label: t("billing.admin.products.fields.name"), value: product.name }),
|
|
4029
4029
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4030
|
-
|
|
4030
|
+
_chunk5GVBUTS4js.DetailField,
|
|
4031
4031
|
{
|
|
4032
4032
|
label: t("billing.admin.products.fields.status"),
|
|
4033
|
-
value: product.active ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4033
|
+
value: product.active ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Badge, { variant: "softGreen", children: t("billing.admin.products.status.active") }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Badge, { variant: "softGray", children: t("billing.admin.products.status.archived") })
|
|
4034
4034
|
}
|
|
4035
4035
|
),
|
|
4036
4036
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4037
|
-
|
|
4037
|
+
_chunk5GVBUTS4js.DetailField,
|
|
4038
4038
|
{
|
|
4039
4039
|
label: t("billing.admin.products.fields.description"),
|
|
4040
4040
|
value: _nullishCoalesce(product.description, () => ( "\u2014")),
|
|
@@ -4042,14 +4042,14 @@ function ProductDetails() {
|
|
|
4042
4042
|
}
|
|
4043
4043
|
),
|
|
4044
4044
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4045
|
-
|
|
4045
|
+
_chunk5GVBUTS4js.DetailField,
|
|
4046
4046
|
{
|
|
4047
4047
|
label: t("billing.admin.products.fields.prices"),
|
|
4048
4048
|
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: product.stripePrices.length })
|
|
4049
4049
|
}
|
|
4050
4050
|
),
|
|
4051
4051
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4052
|
-
|
|
4052
|
+
_chunk5GVBUTS4js.DetailField,
|
|
4053
4053
|
{
|
|
4054
4054
|
label: t("billing.admin.products.fields.stripeId"),
|
|
4055
4055
|
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: product.stripeProductId })
|
|
@@ -4067,7 +4067,7 @@ function ProductContainer() {
|
|
|
4067
4067
|
const { product } = useProductContext();
|
|
4068
4068
|
if (!product) return null;
|
|
4069
4069
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4070
|
-
|
|
4070
|
+
_chunk5GVBUTS4js.RoundPageContainer,
|
|
4071
4071
|
{
|
|
4072
4072
|
module: _chunk53B6NPGAjs.Modules.StripeProduct,
|
|
4073
4073
|
id: product.id,
|
|
@@ -4102,7 +4102,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, ProductContainer, "ProductContainer");
|
|
|
4102
4102
|
function ProductsList({ fullWidth } = {}) {
|
|
4103
4103
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
4104
4104
|
const { catalogueVersion } = useProductContext();
|
|
4105
|
-
const data =
|
|
4105
|
+
const data = _chunk5GVBUTS4js.useDataListRetriever.call(void 0, {
|
|
4106
4106
|
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunk53B6NPGAjs.StripeProductService.listProducts(params), "retriever"),
|
|
4107
4107
|
retrieverParams: {},
|
|
4108
4108
|
module: _chunk53B6NPGAjs.Modules.StripeProduct
|
|
@@ -4112,7 +4112,7 @@ function ProductsList({ fullWidth } = {}) {
|
|
|
4112
4112
|
}, [catalogueVersion]);
|
|
4113
4113
|
const functions = [/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductEditor, {}, "create-product")];
|
|
4114
4114
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4115
|
-
|
|
4115
|
+
_chunk5GVBUTS4js.ContentListTable,
|
|
4116
4116
|
{
|
|
4117
4117
|
data,
|
|
4118
4118
|
fields: ["name" /* name */, "status" /* status */, "prices" /* prices */],
|
|
@@ -4121,7 +4121,7 @@ function ProductsList({ fullWidth } = {}) {
|
|
|
4121
4121
|
fullWidth,
|
|
4122
4122
|
title: t("billing.admin.products.title"),
|
|
4123
4123
|
emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4124
|
-
|
|
4124
|
+
_chunk5GVBUTS4js.EmptyState,
|
|
4125
4125
|
{
|
|
4126
4126
|
icon: _lucidereact.PackageIcon,
|
|
4127
4127
|
title: t("billing.admin.products.empty.title"),
|
|
@@ -4136,7 +4136,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, ProductsList, "ProductsList");
|
|
|
4136
4136
|
// src/features/billing/stripe-product/components/containers/ProductsListContainer.tsx
|
|
4137
4137
|
|
|
4138
4138
|
function ProductsListContainer() {
|
|
4139
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductProvider, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4139
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductProvider, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.RoundPageContainer, { module: _chunk53B6NPGAjs.Modules.StripeProduct, fullWidth: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductsList, { fullWidth: true }) }) });
|
|
4140
4140
|
}
|
|
4141
4141
|
_chunk7QVYU63Ejs.__name.call(void 0, ProductsListContainer, "ProductsListContainer");
|
|
4142
4142
|
|
|
@@ -4194,5 +4194,5 @@ _chunk7QVYU63Ejs.__name.call(void 0, ProductsListContainer, "ProductsListContain
|
|
|
4194
4194
|
|
|
4195
4195
|
|
|
4196
4196
|
|
|
4197
|
-
exports.BillingAlertBanner = BillingAlertBanner; exports.BillingDashboardContainer = BillingDashboardContainer; exports.BillingDetailModal = BillingDetailModal; exports.BillingUsageSummaryCard = BillingUsageSummaryCard; exports.CancelSubscriptionDialog = CancelSubscriptionDialog; exports.CustomerInfoCard = CustomerInfoCard; exports.IntervalToggle = IntervalToggle; exports.InvoiceDetails = InvoiceDetails; exports.InvoiceStatusBadge = InvoiceStatusBadge; exports.InvoicesContainer = InvoicesContainer; exports.InvoicesList = InvoicesList; exports.InvoicesSummaryCard = InvoicesSummaryCard; exports.PaymentMethodCard = PaymentMethodCard; exports.PaymentMethodEditor = PaymentMethodEditor; exports.PaymentMethodForm = PaymentMethodForm; exports.PaymentMethodSummaryCard = PaymentMethodSummaryCard; exports.PaymentMethodsContainer = PaymentMethodsContainer; exports.PaymentMethodsList = PaymentMethodsList; exports.PriceArchiver = PriceArchiver; exports.PriceContainer = PriceContainer; exports.PriceDetails = PriceDetails; exports.PriceEditor = PriceEditor; exports.PriceProvider = PriceProvider; exports.PricesList = PricesList; exports.PricingCard = PricingCard; exports.ProductArchiver = ProductArchiver; exports.ProductContainer = ProductContainer; exports.ProductDetails = ProductDetails; exports.ProductEditor = ProductEditor; exports.ProductPricingList = ProductPricingList; exports.ProductPricingRow = ProductPricingRow; exports.ProductProvider = ProductProvider; exports.ProductsList = ProductsList; exports.ProductsListContainer = ProductsListContainer; exports.PromoCodeInput = PromoCodeInput; exports.ProrationPreview = ProrationPreview; exports.StripeProvider = StripeProvider; exports.SubscriptionConfirmation = SubscriptionConfirmation; exports.SubscriptionDetails = SubscriptionDetails; exports.SubscriptionStatusBadge = SubscriptionStatusBadge; exports.SubscriptionSummaryCard = SubscriptionSummaryCard; exports.SubscriptionsContainer = SubscriptionsContainer; exports.SubscriptionsList = SubscriptionsList; exports.UsageContainer = UsageContainer; exports.UsageHistoryTable = UsageHistoryTable; exports.UsageSummaryCard = UsageSummaryCard; exports.UsageSummaryCards = UsageSummaryCards; exports.formatCurrency =
|
|
4197
|
+
exports.BillingAlertBanner = BillingAlertBanner; exports.BillingDashboardContainer = BillingDashboardContainer; exports.BillingDetailModal = BillingDetailModal; exports.BillingUsageSummaryCard = BillingUsageSummaryCard; exports.CancelSubscriptionDialog = CancelSubscriptionDialog; exports.CustomerInfoCard = CustomerInfoCard; exports.IntervalToggle = IntervalToggle; exports.InvoiceDetails = InvoiceDetails; exports.InvoiceStatusBadge = InvoiceStatusBadge; exports.InvoicesContainer = InvoicesContainer; exports.InvoicesList = InvoicesList; exports.InvoicesSummaryCard = InvoicesSummaryCard; exports.PaymentMethodCard = PaymentMethodCard; exports.PaymentMethodEditor = PaymentMethodEditor; exports.PaymentMethodForm = PaymentMethodForm; exports.PaymentMethodSummaryCard = PaymentMethodSummaryCard; exports.PaymentMethodsContainer = PaymentMethodsContainer; exports.PaymentMethodsList = PaymentMethodsList; exports.PriceArchiver = PriceArchiver; exports.PriceContainer = PriceContainer; exports.PriceDetails = PriceDetails; exports.PriceEditor = PriceEditor; exports.PriceProvider = PriceProvider; exports.PricesList = PricesList; exports.PricingCard = PricingCard; exports.ProductArchiver = ProductArchiver; exports.ProductContainer = ProductContainer; exports.ProductDetails = ProductDetails; exports.ProductEditor = ProductEditor; exports.ProductPricingList = ProductPricingList; exports.ProductPricingRow = ProductPricingRow; exports.ProductProvider = ProductProvider; exports.ProductsList = ProductsList; exports.ProductsListContainer = ProductsListContainer; exports.PromoCodeInput = PromoCodeInput; exports.ProrationPreview = ProrationPreview; exports.StripeProvider = StripeProvider; exports.SubscriptionConfirmation = SubscriptionConfirmation; exports.SubscriptionDetails = SubscriptionDetails; exports.SubscriptionStatusBadge = SubscriptionStatusBadge; exports.SubscriptionSummaryCard = SubscriptionSummaryCard; exports.SubscriptionsContainer = SubscriptionsContainer; exports.SubscriptionsList = SubscriptionsList; exports.UsageContainer = UsageContainer; exports.UsageHistoryTable = UsageHistoryTable; exports.UsageSummaryCard = UsageSummaryCard; exports.UsageSummaryCards = UsageSummaryCards; exports.formatCurrency = _chunk5GVBUTS4js.formatCurrency; exports.formatDate = formatDate3; exports.formatInterval = _chunk5GVBUTS4js.formatInterval; exports.isStripeConfigured = isStripeConfigured; exports.priceLabel = priceLabel; exports.usePriceContext = usePriceContext; exports.useProductContext = useProductContext;
|
|
4198
4198
|
//# sourceMappingURL=index.js.map
|