@carlonicora/nextjs-jsonapi 3.20.0 → 3.21.0
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-CTRQ6JWE.mjs → BlockNoteEditor-CSLA3M32.mjs} +2 -2
- package/dist/{BlockNoteEditor-2WFPGK64.js → BlockNoteEditor-NRI2TZXY.js} +9 -9
- package/dist/{BlockNoteEditor-2WFPGK64.js.map → BlockNoteEditor-NRI2TZXY.js.map} +1 -1
- package/dist/billing/index.js +335 -335
- package/dist/billing/index.mjs +1 -1
- package/dist/{chunk-CJHBL5AN.mjs → chunk-HSVAW3DQ.mjs} +45 -19
- package/dist/chunk-HSVAW3DQ.mjs.map +1 -0
- package/dist/{chunk-IQMJAYCJ.js → chunk-U32IWQZM.js} +144 -118
- package/dist/chunk-U32IWQZM.js.map +1 -0
- package/dist/client/index.js +2 -2
- package/dist/client/index.mjs +1 -1
- package/dist/components/index.d.mts +7 -1
- package/dist/components/index.d.ts +7 -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/components/tables/ContentListTable.tsx +86 -26
- package/src/components/tables/__tests__/ContentListTable.spec.tsx +133 -10
- package/src/shadcnui/ui/badge.tsx +2 -0
- package/dist/chunk-CJHBL5AN.mjs.map +0 -1
- package/dist/chunk-IQMJAYCJ.js.map +0 -1
- /package/dist/{BlockNoteEditor-CTRQ6JWE.mjs.map → BlockNoteEditor-CSLA3M32.mjs.map} +0 -0
package/dist/billing/index.js
CHANGED
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
|
|
63
63
|
|
|
64
64
|
|
|
65
|
-
var
|
|
65
|
+
var _chunkU32IWQZMjs = require('../chunk-U32IWQZM.js');
|
|
66
66
|
|
|
67
67
|
|
|
68
68
|
|
|
@@ -132,41 +132,41 @@ function SubscriptionSummaryCard({
|
|
|
132
132
|
onManageClick
|
|
133
133
|
}) {
|
|
134
134
|
if (loading) {
|
|
135
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
136
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
137
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
135
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.Card, { children: [
|
|
136
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
137
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.CardTitle, { children: "Subscriptions" }),
|
|
138
138
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-4 w-4 text-muted-foreground" })
|
|
139
139
|
] }),
|
|
140
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
141
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
142
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
143
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
140
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.CardContent, { children: [
|
|
141
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Skeleton, { className: "h-6 w-32 mb-2" }),
|
|
142
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Skeleton, { className: "h-4 w-24 mb-1" }),
|
|
143
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Skeleton, { className: "h-4 w-40" })
|
|
144
144
|
] })
|
|
145
145
|
] });
|
|
146
146
|
}
|
|
147
147
|
if (error) {
|
|
148
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
149
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
150
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
148
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.Card, { children: [
|
|
149
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
150
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.CardTitle, { children: "Subscriptions" }),
|
|
151
151
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-4 w-4 text-muted-foreground" })
|
|
152
152
|
] }),
|
|
153
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
153
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
|
|
154
154
|
] });
|
|
155
155
|
}
|
|
156
156
|
const activeSubscriptions = subscriptions.filter(
|
|
157
157
|
(sub) => sub.status === "active" /* ACTIVE */ || sub.status === "trialing" /* TRIALING */
|
|
158
158
|
);
|
|
159
159
|
const primarySubscription = activeSubscriptions[0];
|
|
160
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
161
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
162
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
160
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onManageClick, children: [
|
|
161
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
162
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.CardTitle, { children: "Subscriptions" }),
|
|
163
163
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-4 w-4 text-muted-foreground" })
|
|
164
164
|
] }),
|
|
165
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
165
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.CardContent, { children: subscriptions.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
166
166
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: "No active plan" }),
|
|
167
167
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: "Subscribe to get started" }),
|
|
168
168
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
169
|
-
|
|
169
|
+
_chunkU32IWQZMjs.Button,
|
|
170
170
|
{
|
|
171
171
|
variant: "outline",
|
|
172
172
|
size: "sm",
|
|
@@ -185,7 +185,7 @@ function SubscriptionSummaryCard({
|
|
|
185
185
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
|
|
186
186
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold", children: formatPlanName(primarySubscription) }),
|
|
187
187
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
188
|
-
|
|
188
|
+
_chunkU32IWQZMjs.Badge,
|
|
189
189
|
{
|
|
190
190
|
variant: primarySubscription.cancelAtPeriodEnd ? "secondary" : getStatusBadgeVariant(primarySubscription.status),
|
|
191
191
|
children: primarySubscription.cancelAtPeriodEnd ? "Canceling" : primarySubscription.status
|
|
@@ -227,37 +227,37 @@ function PaymentMethodSummaryCard({
|
|
|
227
227
|
onManageClick
|
|
228
228
|
}) {
|
|
229
229
|
if (loading) {
|
|
230
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
231
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
232
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
230
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.Card, { children: [
|
|
231
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
232
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.CardTitle, { children: "Payment Method" }),
|
|
233
233
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Wallet, { className: "h-4 w-4 text-muted-foreground" })
|
|
234
234
|
] }),
|
|
235
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
236
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
237
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
235
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.CardContent, { children: [
|
|
236
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Skeleton, { className: "h-6 w-32 mb-2" }),
|
|
237
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Skeleton, { className: "h-4 w-24" })
|
|
238
238
|
] })
|
|
239
239
|
] });
|
|
240
240
|
}
|
|
241
241
|
if (error) {
|
|
242
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
243
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
244
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
242
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.Card, { children: [
|
|
243
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
244
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.CardTitle, { children: "Payment Method" }),
|
|
245
245
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Wallet, { className: "h-4 w-4 text-muted-foreground" })
|
|
246
246
|
] }),
|
|
247
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
247
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
|
|
248
248
|
] });
|
|
249
249
|
}
|
|
250
250
|
const defaultMethod = paymentMethods.find((pm) => pm.id === defaultPaymentMethodId) || paymentMethods[0];
|
|
251
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
252
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
253
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
251
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onManageClick, children: [
|
|
252
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
253
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.CardTitle, { children: "Payment Method" }),
|
|
254
254
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Wallet, { className: "h-4 w-4 text-muted-foreground" })
|
|
255
255
|
] }),
|
|
256
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
256
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.CardContent, { children: paymentMethods.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
257
257
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: "No payment method" }),
|
|
258
258
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: "Add a card to enable subscriptions" }),
|
|
259
259
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
260
|
-
|
|
260
|
+
_chunkU32IWQZMjs.Button,
|
|
261
261
|
{
|
|
262
262
|
variant: "outline",
|
|
263
263
|
size: "sm",
|
|
@@ -330,52 +330,52 @@ function CustomerInfoCard({ customer, loading, error }) {
|
|
|
330
330
|
}
|
|
331
331
|
}, "handlePortalClick");
|
|
332
332
|
if (loading) {
|
|
333
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
334
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
335
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
333
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.Card, { children: [
|
|
334
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
335
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.CardTitle, { children: "Billing Account" }),
|
|
336
336
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.User, { className: "h-4 w-4 text-muted-foreground" })
|
|
337
337
|
] }),
|
|
338
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
339
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
340
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
341
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
338
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.CardContent, { children: [
|
|
339
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Skeleton, { className: "h-6 w-32 mb-2" }),
|
|
340
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Skeleton, { className: "h-4 w-48 mb-1" }),
|
|
341
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Skeleton, { className: "h-4 w-24" })
|
|
342
342
|
] })
|
|
343
343
|
] });
|
|
344
344
|
}
|
|
345
345
|
if (error) {
|
|
346
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
347
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
348
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
346
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.Card, { children: [
|
|
347
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
348
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.CardTitle, { children: "Billing Account" }),
|
|
349
349
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.User, { className: "h-4 w-4 text-muted-foreground" })
|
|
350
350
|
] }),
|
|
351
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
351
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
|
|
352
352
|
] });
|
|
353
353
|
}
|
|
354
354
|
if (!customer) {
|
|
355
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
356
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
357
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
355
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.Card, { children: [
|
|
356
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
357
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.CardTitle, { children: "Billing Account" }),
|
|
358
358
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.User, { className: "h-4 w-4 text-muted-foreground" })
|
|
359
359
|
] }),
|
|
360
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
360
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.CardContent, { children: [
|
|
361
361
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: "Not set up" }),
|
|
362
362
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: "Billing account will be created when you subscribe" })
|
|
363
363
|
] })
|
|
364
364
|
] });
|
|
365
365
|
}
|
|
366
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
367
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
368
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
366
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.Card, { children: [
|
|
367
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
368
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.CardTitle, { children: "Billing Account" }),
|
|
369
369
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.User, { className: "h-4 w-4 text-muted-foreground" })
|
|
370
370
|
] }),
|
|
371
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
371
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
372
372
|
customer.name && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold", children: customer.name }),
|
|
373
373
|
customer.email && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: customer.email }),
|
|
374
374
|
customer.balance !== void 0 && customer.balance !== 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "text-sm", children: [
|
|
375
375
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground", children: "Credit Balance: " }),
|
|
376
376
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: customer.balance < 0 ? "text-success" : "text-destructive", children: formatBalance(customer.balance, customer.currency) })
|
|
377
377
|
] }),
|
|
378
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
378
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.Button, { variant: "outline", size: "sm", className: "mt-2", onClick: handlePortalClick, disabled: portalLoading, children: [
|
|
379
379
|
portalLoading ? "Loading..." : "Manage in Stripe Portal",
|
|
380
380
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ExternalLink, { className: "h-4 w-4 ms-1" })
|
|
381
381
|
] })
|
|
@@ -419,42 +419,42 @@ function formatAmount(amount, currency) {
|
|
|
419
419
|
_chunk7QVYU63Ejs.__name.call(void 0, formatAmount, "formatAmount");
|
|
420
420
|
function InvoicesSummaryCard({ invoices, loading, error, onViewAllClick }) {
|
|
421
421
|
if (loading) {
|
|
422
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
423
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
424
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
422
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.Card, { children: [
|
|
423
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
424
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.CardTitle, { children: "Recent Invoices" }),
|
|
425
425
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ReceiptIcon, { className: "h-4 w-4 text-muted-foreground" })
|
|
426
426
|
] }),
|
|
427
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
428
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
429
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
430
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
427
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.CardContent, { children: [
|
|
428
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Skeleton, { className: "h-6 w-24 mb-2" }),
|
|
429
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Skeleton, { className: "h-4 w-32 mb-1" }),
|
|
430
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Skeleton, { className: "h-4 w-20" })
|
|
431
431
|
] })
|
|
432
432
|
] });
|
|
433
433
|
}
|
|
434
434
|
if (error) {
|
|
435
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
436
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
437
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
435
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.Card, { children: [
|
|
436
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
437
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.CardTitle, { children: "Recent Invoices" }),
|
|
438
438
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ReceiptIcon, { className: "h-4 w-4 text-muted-foreground" })
|
|
439
439
|
] }),
|
|
440
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
440
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
|
|
441
441
|
] });
|
|
442
442
|
}
|
|
443
443
|
const latestInvoice = invoices[0];
|
|
444
444
|
const paidInvoices = invoices.filter((inv) => inv.status === "paid" /* PAID */);
|
|
445
445
|
const openInvoices = invoices.filter((inv) => inv.status === "open" /* OPEN */);
|
|
446
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
447
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
448
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
446
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onViewAllClick, children: [
|
|
447
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
448
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.CardTitle, { children: "Recent Invoices" }),
|
|
449
449
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ReceiptIcon, { className: "h-4 w-4 text-muted-foreground" })
|
|
450
450
|
] }),
|
|
451
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
451
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.CardContent, { children: invoices.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
452
452
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: "No invoices yet" }),
|
|
453
453
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: "Invoices will appear after your first billing cycle" })
|
|
454
454
|
] }) : latestInvoice ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
455
455
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
|
|
456
456
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold", children: formatAmount(latestInvoice.total, latestInvoice.currency) }),
|
|
457
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
457
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Badge, { variant: getStatusBadgeVariant2(latestInvoice.status), children: latestInvoice.status })
|
|
458
458
|
] }),
|
|
459
459
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: latestInvoice.stripeInvoiceNumber || `Invoice from ${formatDate2(latestInvoice.periodStart)}` }),
|
|
460
460
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-4 text-xs text-muted-foreground", children: [
|
|
@@ -494,24 +494,24 @@ function BillingUsageSummaryCard({
|
|
|
494
494
|
onViewDetailsClick
|
|
495
495
|
}) {
|
|
496
496
|
if (loading) {
|
|
497
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
498
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
499
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
497
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.Card, { children: [
|
|
498
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
499
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.CardTitle, { children: "Usage This Month" }),
|
|
500
500
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Activity, { className: "h-4 w-4 text-muted-foreground" })
|
|
501
501
|
] }),
|
|
502
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
503
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
504
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
502
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.CardContent, { children: [
|
|
503
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Skeleton, { className: "h-6 w-24 mb-2" }),
|
|
504
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Skeleton, { className: "h-4 w-32" })
|
|
505
505
|
] })
|
|
506
506
|
] });
|
|
507
507
|
}
|
|
508
508
|
if (error) {
|
|
509
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
510
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
511
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
509
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.Card, { children: [
|
|
510
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
511
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.CardTitle, { children: "Usage This Month" }),
|
|
512
512
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Activity, { className: "h-4 w-4 text-muted-foreground" })
|
|
513
513
|
] }),
|
|
514
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
514
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
|
|
515
515
|
] });
|
|
516
516
|
}
|
|
517
517
|
const totalUsage = Object.values(summaries).reduce((acc, summary) => {
|
|
@@ -519,12 +519,12 @@ function BillingUsageSummaryCard({
|
|
|
519
519
|
}, 0);
|
|
520
520
|
const primaryMeter = meters.find((m) => _optionalChain([summaries, 'access', _17 => _17[m.id], 'optionalAccess', _18 => _18.aggregatedValue]));
|
|
521
521
|
const primarySummary = primaryMeter ? summaries[primaryMeter.id] : null;
|
|
522
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
523
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
524
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
522
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onViewDetailsClick, children: [
|
|
523
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
524
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.CardTitle, { children: "Usage This Month" }),
|
|
525
525
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Activity, { className: "h-4 w-4 text-muted-foreground" })
|
|
526
526
|
] }),
|
|
527
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
527
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.CardContent, { children: meters.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
528
528
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: "No meters" }),
|
|
529
529
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: "No usage meters are configured" })
|
|
530
530
|
] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
@@ -630,7 +630,7 @@ function PaymentMethodForm({ onSuccess, onCancel, isLoading = false }) {
|
|
|
630
630
|
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..." }) });
|
|
631
631
|
}
|
|
632
632
|
if (!setupIntent && error) {
|
|
633
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
633
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Alert, { variant: "destructive", className: "bg-red-50 border-red-200", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.AlertDescription, { children: error }) });
|
|
634
634
|
}
|
|
635
635
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: handleSubmit, className: "flex flex-col gap-y-4", children: [
|
|
636
636
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rounded-md border border-gray-300 p-3", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -653,13 +653,13 @@ function PaymentMethodForm({ onSuccess, onCancel, isLoading = false }) {
|
|
|
653
653
|
}
|
|
654
654
|
) }),
|
|
655
655
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-2", children: [
|
|
656
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
657
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
656
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Checkbox, { id: "setAsDefault", checked: setAsDefault, onCheckedChange: (checked) => setSetAsDefault(!!checked) }),
|
|
657
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Label, { htmlFor: "setAsDefault", className: "cursor-pointer font-normal", children: "Set as default payment method" })
|
|
658
658
|
] }),
|
|
659
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
659
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Alert, { variant: "destructive", className: "bg-red-50 border-red-200", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.AlertDescription, { children: error }) }),
|
|
660
660
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-end gap-x-2", children: [
|
|
661
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
662
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
661
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Button, { type: "button", variant: "outline", onClick: onCancel, disabled: isSubmitting || isLoading, children: "Cancel" }),
|
|
662
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Button, { type: "submit", disabled: !stripe || isSubmitting || isLoading, children: isSubmitting ? "Processing..." : "Add Card" })
|
|
663
663
|
] })
|
|
664
664
|
] });
|
|
665
665
|
}
|
|
@@ -675,10 +675,10 @@ function PaymentMethodEditor({ open, onOpenChange, onSuccess }) {
|
|
|
675
675
|
const handleCancel = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
676
676
|
onOpenChange(false);
|
|
677
677
|
}, "handleCancel");
|
|
678
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
679
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
680
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
681
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
678
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.DialogContent, { className: "max-w-md", children: [
|
|
679
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.DialogHeader, { children: [
|
|
680
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.DialogTitle, { children: "Add Payment Method" }),
|
|
681
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.DialogDescription, { children: "Add a new payment method to your account. Your card information is securely processed by Stripe." })
|
|
682
682
|
] }),
|
|
683
683
|
open && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PaymentMethodForm, { onSuccess: handleSuccess, onCancel: handleCancel })
|
|
684
684
|
] }) });
|
|
@@ -739,16 +739,16 @@ function PaymentMethodCard({ paymentMethod, onUpdate }) {
|
|
|
739
739
|
}
|
|
740
740
|
}, "handleRemove");
|
|
741
741
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
742
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
743
|
-
isDefault && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
744
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
742
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.Card, { className: "relative", children: [
|
|
743
|
+
isDefault && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Badge, { variant: "softGreen", className: "absolute end-2 top-2", children: "Default" }),
|
|
744
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.CardHeader, { className: "flex flex-row items-center justify-between pb-2", children: [
|
|
745
745
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-2", children: [
|
|
746
746
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-2xl", children: brandIcon }),
|
|
747
747
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium capitalize", children: brand })
|
|
748
748
|
] }),
|
|
749
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
750
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
751
|
-
|
|
749
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.DropdownMenu, { children: [
|
|
750
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.DropdownMenuTrigger, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
751
|
+
_chunkU32IWQZMjs.Button,
|
|
752
752
|
{
|
|
753
753
|
render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", {}),
|
|
754
754
|
nativeButton: false,
|
|
@@ -759,10 +759,10 @@ function PaymentMethodCard({ paymentMethod, onUpdate }) {
|
|
|
759
759
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.MoreVertical, { className: "h-4 w-4" })
|
|
760
760
|
}
|
|
761
761
|
) }),
|
|
762
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
763
|
-
!isDefault && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
762
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.DropdownMenuContent, { align: "end", children: [
|
|
763
|
+
!isDefault && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.DropdownMenuItem, { onClick: handleSetDefault, disabled: loading, children: "Set as Default" }),
|
|
764
764
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
765
|
-
|
|
765
|
+
_chunkU32IWQZMjs.DropdownMenuItem,
|
|
766
766
|
{
|
|
767
767
|
onClick: () => setShowRemoveDialog(true),
|
|
768
768
|
disabled: loading,
|
|
@@ -773,7 +773,7 @@ function PaymentMethodCard({ paymentMethod, onUpdate }) {
|
|
|
773
773
|
] })
|
|
774
774
|
] })
|
|
775
775
|
] }),
|
|
776
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
776
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-1", children: [
|
|
777
777
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "text-lg font-semibold", children: [
|
|
778
778
|
"\u2022\u2022\u2022\u2022 ",
|
|
779
779
|
last4
|
|
@@ -786,17 +786,17 @@ function PaymentMethodCard({ paymentMethod, onUpdate }) {
|
|
|
786
786
|
] })
|
|
787
787
|
] }) })
|
|
788
788
|
] }),
|
|
789
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
790
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
791
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
792
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
789
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.AlertDialog, { open: showRemoveDialog, onOpenChange: setShowRemoveDialog, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.AlertDialogContent, { children: [
|
|
790
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.AlertDialogHeader, { children: [
|
|
791
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.AlertDialogTitle, { children: "Remove Payment Method" }),
|
|
792
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.AlertDialogDescription, { children: [
|
|
793
793
|
"Are you sure you want to remove this payment method? This action cannot be undone.",
|
|
794
794
|
isDefault && " This is your default payment method."
|
|
795
795
|
] })
|
|
796
796
|
] }),
|
|
797
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
798
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
799
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
797
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.AlertDialogFooter, { children: [
|
|
798
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.AlertDialogCancel, { disabled: loading, children: "Cancel" }),
|
|
799
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.AlertDialogAction, { onClick: handleRemove, disabled: loading, className: "bg-red-600 hover:bg-red-700", children: loading ? "Removing..." : "Remove" })
|
|
800
800
|
] })
|
|
801
801
|
] }) })
|
|
802
802
|
] });
|
|
@@ -839,14 +839,14 @@ function PaymentMethodsContainer() {
|
|
|
839
839
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-8 w-8" }),
|
|
840
840
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h1", { className: "text-primary text-3xl font-semibold", children: "Payment Methods" })
|
|
841
841
|
] }),
|
|
842
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
842
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Button, { onClick: () => setShowAddPaymentMethod(true), children: "Add Payment Method" })
|
|
843
843
|
] }),
|
|
844
844
|
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: [
|
|
845
845
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-16 w-16 text-muted-foreground" }),
|
|
846
846
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-center", children: [
|
|
847
847
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "mb-2 text-sm font-medium", children: "No payment methods" }),
|
|
848
848
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "mb-4 text-muted-foreground", children: "Add a payment method to enable subscriptions and secure checkout." }),
|
|
849
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
849
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Button, { onClick: () => setShowAddPaymentMethod(true), children: "Add Your First Card" })
|
|
850
850
|
] })
|
|
851
851
|
] }),
|
|
852
852
|
paymentMethods.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PaymentMethodsList, { paymentMethods, onUpdate: loadPaymentMethods }),
|
|
@@ -914,7 +914,7 @@ var statusConfig = {
|
|
|
914
914
|
};
|
|
915
915
|
function InvoiceStatusBadge({ status }) {
|
|
916
916
|
const config = statusConfig[status] || statusConfig["draft" /* DRAFT */];
|
|
917
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
917
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Badge, { variant: config.variant, children: config.label });
|
|
918
918
|
}
|
|
919
919
|
_chunk7QVYU63Ejs.__name.call(void 0, InvoiceStatusBadge, "InvoiceStatusBadge");
|
|
920
920
|
|
|
@@ -945,13 +945,13 @@ function InvoiceDetails({
|
|
|
945
945
|
return invoice.stripeInvoiceId.slice(-8);
|
|
946
946
|
}, "getInvoiceNumber");
|
|
947
947
|
const productName = _optionalChain([invoice, 'access', _29 => _29.subscription, 'optionalAccess', _30 => _30.price, 'optionalAccess', _31 => _31.product, 'optionalAccess', _32 => _32.name]) || "Subscription";
|
|
948
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
949
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
950
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
948
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.DialogContent, { className: "max-w-2xl", children: [
|
|
949
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.DialogHeader, { children: [
|
|
950
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.DialogTitle, { children: [
|
|
951
951
|
"Invoice ",
|
|
952
952
|
getInvoiceNumber()
|
|
953
953
|
] }),
|
|
954
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
954
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.DialogDescription, { children: formatDate3(invoice.periodStart) })
|
|
955
955
|
] }),
|
|
956
956
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-6", children: [
|
|
957
957
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-3", children: [
|
|
@@ -989,42 +989,42 @@ function InvoiceDetails({
|
|
|
989
989
|
] }) }),
|
|
990
990
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "tbody", { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "tr", { className: "border-t", children: [
|
|
991
991
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { className: "p-3", children: productName }),
|
|
992
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { className: "p-3 text-end", children:
|
|
992
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { className: "p-3 text-end", children: _chunkU32IWQZMjs.formatCurrency.call(void 0, invoice.subtotal, invoice.currency) })
|
|
993
993
|
] }) })
|
|
994
994
|
] }) })
|
|
995
995
|
] }),
|
|
996
996
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2 border-t pt-4", children: [
|
|
997
997
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between", children: [
|
|
998
998
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: "Subtotal:" }),
|
|
999
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm", children:
|
|
999
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm", children: _chunkU32IWQZMjs.formatCurrency.call(void 0, invoice.subtotal, invoice.currency) })
|
|
1000
1000
|
] }),
|
|
1001
1001
|
invoice.tax !== void 0 && invoice.tax > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between", children: [
|
|
1002
1002
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: "Tax:" }),
|
|
1003
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm", children:
|
|
1003
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm", children: _chunkU32IWQZMjs.formatCurrency.call(void 0, invoice.tax, invoice.currency) })
|
|
1004
1004
|
] }),
|
|
1005
1005
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between text-lg font-semibold border-t pt-2", children: [
|
|
1006
1006
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Total:" }),
|
|
1007
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children:
|
|
1007
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _chunkU32IWQZMjs.formatCurrency.call(void 0, invoice.total, invoice.currency) })
|
|
1008
1008
|
] }),
|
|
1009
1009
|
invoice.amountPaid > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between", children: [
|
|
1010
1010
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: "Amount Paid:" }),
|
|
1011
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm text-success", children:
|
|
1011
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm text-success", children: _chunkU32IWQZMjs.formatCurrency.call(void 0, invoice.amountPaid, invoice.currency) })
|
|
1012
1012
|
] }),
|
|
1013
1013
|
invoice.amountRemaining > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between", children: [
|
|
1014
1014
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: "Amount Due:" }),
|
|
1015
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm text-destructive", children:
|
|
1015
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm text-destructive", children: _chunkU32IWQZMjs.formatCurrency.call(void 0, invoice.amountRemaining, invoice.currency) })
|
|
1016
1016
|
] })
|
|
1017
1017
|
] }),
|
|
1018
1018
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-wrap gap-2 pt-4 border-t", children: [
|
|
1019
|
-
invoice.stripePdfUrl && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1019
|
+
invoice.stripePdfUrl && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.Button, { variant: "outline", onClick: handleDownloadPDF, children: [
|
|
1020
1020
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Download, { className: "me-2 h-4 w-4" }),
|
|
1021
1021
|
"Download PDF"
|
|
1022
1022
|
] }),
|
|
1023
|
-
invoice.status === "open" /* OPEN */ && invoice.attempted && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1023
|
+
invoice.status === "open" /* OPEN */ && invoice.attempted && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.Button, { variant: "default", onClick: handleRetryPayment, children: [
|
|
1024
1024
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.RefreshCw, { className: "me-2 h-4 w-4" }),
|
|
1025
1025
|
"Retry Payment"
|
|
1026
1026
|
] }),
|
|
1027
|
-
invoice.stripeHostedInvoiceUrl && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1027
|
+
invoice.stripeHostedInvoiceUrl && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.Button, { variant: "outline", onClick: handleViewInStripe, children: [
|
|
1028
1028
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ExternalLink, { className: "me-2 h-4 w-4" }),
|
|
1029
1029
|
"View in Stripe"
|
|
1030
1030
|
] })
|
|
@@ -1048,30 +1048,30 @@ function InvoicesList({ invoices, onInvoicesChange }) {
|
|
|
1048
1048
|
return invoice.stripeInvoiceId.slice(-8);
|
|
1049
1049
|
}, "getInvoiceNumber");
|
|
1050
1050
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1051
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border rounded-lg overflow-clip", children: /* @__PURE__ */ _jsxruntime.jsxs.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,
|
|
1057
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1051
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border rounded-lg overflow-clip", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.Table, { children: [
|
|
1052
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TableHeader, { className: "bg-muted", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.TableRow, { children: [
|
|
1053
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TableHead, { children: "Invoice #" }),
|
|
1054
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TableHead, { children: "Date" }),
|
|
1055
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TableHead, { children: "Status" }),
|
|
1056
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TableHead, { className: "text-end", children: "Amount" }),
|
|
1057
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TableHead, { children: "Period" })
|
|
1058
1058
|
] }) }),
|
|
1059
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1059
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TableBody, { children: invoices.map((invoice) => {
|
|
1060
1060
|
const invoiceNumber = getInvoiceNumber(invoice);
|
|
1061
1061
|
const date = formatDate3(invoice.periodStart);
|
|
1062
|
-
const amount =
|
|
1062
|
+
const amount = _chunkU32IWQZMjs.formatCurrency.call(void 0, invoice.total, invoice.currency);
|
|
1063
1063
|
const period = `${formatDate3(invoice.periodStart)} - ${formatDate3(invoice.periodEnd)}`;
|
|
1064
1064
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1065
|
-
|
|
1065
|
+
_chunkU32IWQZMjs.TableRow,
|
|
1066
1066
|
{
|
|
1067
1067
|
onClick: () => handleRowClick(invoice),
|
|
1068
1068
|
className: "cursor-pointer hover:bg-muted/50",
|
|
1069
1069
|
children: [
|
|
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,
|
|
1074
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1070
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TableCell, { className: "font-medium", children: invoiceNumber }),
|
|
1071
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TableCell, { className: "text-muted-foreground text-xs", children: date }),
|
|
1072
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TableCell, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InvoiceStatusBadge, { status: invoice.status }) }),
|
|
1073
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TableCell, { className: "text-end font-medium", children: amount }),
|
|
1074
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TableCell, { className: "text-muted-foreground text-xs", children: period })
|
|
1075
1075
|
]
|
|
1076
1076
|
},
|
|
1077
1077
|
invoice.id
|
|
@@ -1120,12 +1120,12 @@ function InvoicesContainer() {
|
|
|
1120
1120
|
setStatusFilter(value);
|
|
1121
1121
|
}, "handleFilterChange");
|
|
1122
1122
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-4", children: [
|
|
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,
|
|
1128
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1123
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Tabs, { value: statusFilter, onValueChange: handleFilterChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.TabsList, { children: [
|
|
1124
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TabsTrigger, { value: "all", children: "All" }),
|
|
1125
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TabsTrigger, { value: "paid" /* PAID */, children: "Paid" }),
|
|
1126
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TabsTrigger, { value: "open" /* OPEN */, children: "Open" }),
|
|
1127
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TabsTrigger, { value: "void" /* VOID */, children: "Void" }),
|
|
1128
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TabsTrigger, { value: "uncollectible" /* UNCOLLECTIBLE */, children: "Uncollectible" })
|
|
1129
1129
|
] }) }),
|
|
1130
1130
|
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-center py-8 text-muted-foreground", children: "Loading invoices..." }),
|
|
1131
1131
|
!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: [
|
|
@@ -1185,19 +1185,19 @@ function CancelSubscriptionDialog({
|
|
|
1185
1185
|
}
|
|
1186
1186
|
}, "onSubmit");
|
|
1187
1187
|
const periodEndDate = formatDate3(subscription.currentPeriodEnd);
|
|
1188
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1189
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1190
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1191
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1188
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.DialogContent, { className: "max-w-md", children: [
|
|
1189
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.DialogHeader, { children: [
|
|
1190
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.DialogTitle, { children: "Cancel Subscription" }),
|
|
1191
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.DialogDescription, { children: "Are you sure you want to cancel this subscription? This action cannot be undone." })
|
|
1192
1192
|
] }),
|
|
1193
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1193
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Form, { ...form, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: form.handleSubmit(onSubmit), className: "flex flex-col gap-y-4", children: [
|
|
1194
1194
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bg-primary/10 border-primary/30 text-foreground rounded-lg border p-3 text-sm", children: [
|
|
1195
1195
|
"Your subscription will remain active until ",
|
|
1196
1196
|
periodEndDate,
|
|
1197
1197
|
". You can continue using the service until then."
|
|
1198
1198
|
] }),
|
|
1199
1199
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1200
|
-
|
|
1200
|
+
_chunkU32IWQZMjs.FormTextarea,
|
|
1201
1201
|
{
|
|
1202
1202
|
form,
|
|
1203
1203
|
id: "reason",
|
|
@@ -1207,8 +1207,8 @@ function CancelSubscriptionDialog({
|
|
|
1207
1207
|
}
|
|
1208
1208
|
),
|
|
1209
1209
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex gap-x-2 justify-end pt-2", children: [
|
|
1210
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1211
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1210
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Button, { type: "button", variant: "outline", onClick: () => onOpenChange(false), disabled: isSubmitting, children: "Keep Subscription" }),
|
|
1211
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Button, { type: "submit", variant: "destructive", disabled: isSubmitting, children: isSubmitting ? "Canceling..." : "Confirm Cancellation" })
|
|
1212
1212
|
] })
|
|
1213
1213
|
] }) })
|
|
1214
1214
|
] }) });
|
|
@@ -1257,7 +1257,7 @@ var cancelingConfig = {
|
|
|
1257
1257
|
};
|
|
1258
1258
|
function SubscriptionStatusBadge({ status, cancelAtPeriodEnd }) {
|
|
1259
1259
|
const config = cancelAtPeriodEnd ? cancelingConfig : statusConfig2[status] || statusConfig2["canceled" /* CANCELED */];
|
|
1260
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1260
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Badge, { variant: config.variant, children: config.label });
|
|
1261
1261
|
}
|
|
1262
1262
|
_chunk7QVYU63Ejs.__name.call(void 0, SubscriptionStatusBadge, "SubscriptionStatusBadge");
|
|
1263
1263
|
|
|
@@ -1284,7 +1284,7 @@ function formatPlanName2(price) {
|
|
|
1284
1284
|
_chunk7QVYU63Ejs.__name.call(void 0, formatPlanName2, "formatPlanName");
|
|
1285
1285
|
function formatBillingAmount(price) {
|
|
1286
1286
|
if (!_optionalChain([price, 'optionalAccess', _37 => _37.unitAmount])) return "N/A";
|
|
1287
|
-
return
|
|
1287
|
+
return _chunkU32IWQZMjs.formatCurrency.call(void 0, price.unitAmount, price.currency);
|
|
1288
1288
|
}
|
|
1289
1289
|
_chunk7QVYU63Ejs.__name.call(void 0, formatBillingAmount, "formatBillingAmount");
|
|
1290
1290
|
function SubscriptionDetails({
|
|
@@ -1330,10 +1330,10 @@ function SubscriptionDetails({
|
|
|
1330
1330
|
const canResume = subscription.status === "paused" /* PAUSED */;
|
|
1331
1331
|
const canCancel = subscription.status === "active" /* ACTIVE */ || subscription.status === "trialing" /* TRIALING */ || subscription.status === "paused" /* PAUSED */;
|
|
1332
1332
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1333
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1334
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1335
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1336
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1333
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.DialogContent, { className: "max-w-2xl", children: [
|
|
1334
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.DialogHeader, { children: [
|
|
1335
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.DialogTitle, { children: "Subscription Details" }),
|
|
1336
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.DialogDescription, { children: "View and manage your subscription" })
|
|
1337
1337
|
] }),
|
|
1338
1338
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-6", children: [
|
|
1339
1339
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-3", children: [
|
|
@@ -1375,11 +1375,11 @@ function SubscriptionDetails({
|
|
|
1375
1375
|
"."
|
|
1376
1376
|
] }) }),
|
|
1377
1377
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-wrap gap-2 pt-4 border-t", children: [
|
|
1378
|
-
onChangePlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1379
|
-
canPause && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1380
|
-
canResume && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1381
|
-
canCancel && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1382
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1378
|
+
onChangePlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Button, { variant: "default", onClick: () => onChangePlan(subscription), children: "Change Plan" }),
|
|
1379
|
+
canPause && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Button, { variant: "outline", onClick: handlePause, disabled: isProcessing, children: isProcessing ? "Pausing..." : "Pause" }),
|
|
1380
|
+
canResume && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Button, { variant: "outline", onClick: handleResume, disabled: isProcessing, children: isProcessing ? "Resuming..." : "Resume" }),
|
|
1381
|
+
canCancel && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Button, { variant: "destructive", onClick: () => setShowCancel(true), children: "Cancel" }),
|
|
1382
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Button, { variant: "outline", onClick: handleManageViaPortal, children: "Manage via Portal" })
|
|
1383
1383
|
] })
|
|
1384
1384
|
] })
|
|
1385
1385
|
] }) }),
|
|
@@ -1426,36 +1426,36 @@ function SubscriptionsList({ subscriptions, onSubscriptionsChange, onChangePlan
|
|
|
1426
1426
|
setSelectedSub(subscription);
|
|
1427
1427
|
}, "handleRowClick");
|
|
1428
1428
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1429
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border rounded-lg overflow-clip", children: /* @__PURE__ */ _jsxruntime.jsxs.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,
|
|
1435
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1429
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border rounded-lg overflow-clip", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.Table, { children: [
|
|
1430
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TableHeader, { className: "bg-muted", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.TableRow, { children: [
|
|
1431
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TableHead, { children: "Status" }),
|
|
1432
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TableHead, { children: "Plan" }),
|
|
1433
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TableHead, { children: "Period" }),
|
|
1434
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TableHead, { className: "text-end", children: "Amount" }),
|
|
1435
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TableHead, { className: "text-end", children: "Actions" })
|
|
1436
1436
|
] }) }),
|
|
1437
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1437
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TableBody, { children: subscriptions.map((subscription) => {
|
|
1438
1438
|
const price = subscription.price;
|
|
1439
|
-
const amount = _optionalChain([price, 'optionalAccess', _42 => _42.unitAmount]) ?
|
|
1439
|
+
const amount = _optionalChain([price, 'optionalAccess', _42 => _42.unitAmount]) ? _chunkU32IWQZMjs.formatCurrency.call(void 0, price.unitAmount, price.currency) : "0";
|
|
1440
1440
|
const period = `${formatDate3(subscription.currentPeriodStart)} - ${formatDate3(subscription.currentPeriodEnd)}`;
|
|
1441
1441
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1442
|
-
|
|
1442
|
+
_chunkU32IWQZMjs.TableRow,
|
|
1443
1443
|
{
|
|
1444
1444
|
onClick: () => handleRowClick(subscription),
|
|
1445
1445
|
className: "cursor-pointer hover:bg-muted/50",
|
|
1446
1446
|
children: [
|
|
1447
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1447
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TableCell, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1448
1448
|
SubscriptionStatusBadge,
|
|
1449
1449
|
{
|
|
1450
1450
|
status: subscription.status,
|
|
1451
1451
|
cancelAtPeriodEnd: subscription.cancelAtPeriodEnd
|
|
1452
1452
|
}
|
|
1453
1453
|
) }),
|
|
1454
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1455
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1456
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1457
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1458
|
-
|
|
1454
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TableCell, { className: "font-medium", children: formatPlanName3(price) }),
|
|
1455
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TableCell, { className: "text-muted-foreground text-sm", children: period }),
|
|
1456
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TableCell, { className: "text-end font-medium", children: amount }),
|
|
1457
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TableCell, { className: "text-end", children: (subscription.status === "active" /* ACTIVE */ || subscription.status === "trialing" /* TRIALING */) && onChangePlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1458
|
+
_chunkU32IWQZMjs.Button,
|
|
1459
1459
|
{
|
|
1460
1460
|
size: "sm",
|
|
1461
1461
|
variant: "outline",
|
|
@@ -1523,7 +1523,7 @@ function SubscriptionsContainer({ onOpenWizard, hasActiveRecurringSubscription }
|
|
|
1523
1523
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-8 w-8" }),
|
|
1524
1524
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h1", { className: "text-primary text-3xl font-semibold", children: "Subscriptions" })
|
|
1525
1525
|
] }),
|
|
1526
|
-
subscriptions.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1526
|
+
subscriptions.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Button, { onClick: () => _optionalChain([onOpenWizard, 'optionalCall', _43 => _43()]), children: hasActiveRecurringSubscription ? "Purchase Add-ons" : "Subscribe to a Plan" })
|
|
1527
1527
|
] }),
|
|
1528
1528
|
criticalSubscriptions.map((subscription) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BillingAlertBanner, { subscription }, subscription.id)),
|
|
1529
1529
|
subscriptions.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col items-center justify-center py-12 space-y-4", children: [
|
|
@@ -1531,7 +1531,7 @@ function SubscriptionsContainer({ onOpenWizard, hasActiveRecurringSubscription }
|
|
|
1531
1531
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-center", children: [
|
|
1532
1532
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-sm font-medium mb-2", children: "No Active Subscriptions" }),
|
|
1533
1533
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground mb-6", children: "Choose a subscription plan to get started with our services." }),
|
|
1534
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1534
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Button, { onClick: () => _optionalChain([onOpenWizard, 'optionalCall', _44 => _44()]), children: "Subscribe to a Plan" })
|
|
1535
1535
|
] })
|
|
1536
1536
|
] }),
|
|
1537
1537
|
subscriptions.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1552,9 +1552,9 @@ function IntervalToggle({ value, onChange, hasMonthly, hasYearly }) {
|
|
|
1552
1552
|
if (!hasMonthly || !hasYearly) {
|
|
1553
1553
|
return null;
|
|
1554
1554
|
}
|
|
1555
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1556
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1557
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1555
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Tabs, { value, onValueChange: (v) => onChange(v), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.TabsList, { children: [
|
|
1556
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TabsTrigger, { value: "month", children: "Monthly" }),
|
|
1557
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TabsTrigger, { value: "year", children: "Yearly" })
|
|
1558
1558
|
] }) });
|
|
1559
1559
|
}
|
|
1560
1560
|
_chunk7QVYU63Ejs.__name.call(void 0, IntervalToggle, "IntervalToggle");
|
|
@@ -1572,8 +1572,8 @@ function PricingCard({
|
|
|
1572
1572
|
}) {
|
|
1573
1573
|
const description = price.description || price.nickname || "Standard";
|
|
1574
1574
|
const features = price.features || [];
|
|
1575
|
-
const formattedPrice =
|
|
1576
|
-
const interval =
|
|
1575
|
+
const formattedPrice = _chunkU32IWQZMjs.formatCurrency.call(void 0, price.unitAmount, price.currency);
|
|
1576
|
+
const interval = _chunkU32IWQZMjs.formatInterval.call(void 0, price);
|
|
1577
1577
|
const handleKeyDown = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (e) => {
|
|
1578
1578
|
if ((e.key === "Enter" || e.key === " ") && !isDisabled && !isCurrentPlan) {
|
|
1579
1579
|
e.preventDefault();
|
|
@@ -1586,7 +1586,7 @@ function PricingCard({
|
|
|
1586
1586
|
}
|
|
1587
1587
|
}, "handleClick");
|
|
1588
1588
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1589
|
-
|
|
1589
|
+
_chunkU32IWQZMjs.Card,
|
|
1590
1590
|
{
|
|
1591
1591
|
role: "radio",
|
|
1592
1592
|
"aria-checked": isSelected,
|
|
@@ -1604,9 +1604,9 @@ function PricingCard({
|
|
|
1604
1604
|
isLoading && "pointer-events-none"
|
|
1605
1605
|
),
|
|
1606
1606
|
children: [
|
|
1607
|
-
isCurrentPlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1608
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1609
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1607
|
+
isCurrentPlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Badge, { variant: "secondary", className: "absolute top-2 end-2", children: "Current" }),
|
|
1608
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.CardHeader, { className: "pb-2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-sm font-medium", children: description }) }),
|
|
1609
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.CardContent, { className: "pb-4 grow", children: [
|
|
1610
1610
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mb-4", children: [
|
|
1611
1611
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-3xl font-bold", children: formattedPrice }),
|
|
1612
1612
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground ms-1", children: interval })
|
|
@@ -1616,8 +1616,8 @@ function PricingCard({
|
|
|
1616
1616
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm text-muted-foreground", children: feature })
|
|
1617
1617
|
] }, index)) })
|
|
1618
1618
|
] }),
|
|
1619
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1620
|
-
|
|
1619
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.CardFooter, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1620
|
+
_chunkU32IWQZMjs.Button,
|
|
1621
1621
|
{
|
|
1622
1622
|
variant: isCurrentPlan ? "secondary" : isSelected ? "default" : "outline",
|
|
1623
1623
|
className: "w-full",
|
|
@@ -1645,7 +1645,7 @@ function ProductPricingRow({
|
|
|
1645
1645
|
return null;
|
|
1646
1646
|
}
|
|
1647
1647
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-3", children: [
|
|
1648
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1648
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.SectionHeader, { children: product.name }),
|
|
1649
1649
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1650
1650
|
"div",
|
|
1651
1651
|
{
|
|
@@ -1745,15 +1745,15 @@ function ProductPricingList({
|
|
|
1745
1745
|
_chunk7QVYU63Ejs.__name.call(void 0, ProductPricingList, "ProductPricingList");
|
|
1746
1746
|
function ProductPricingListSkeleton() {
|
|
1747
1747
|
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: [
|
|
1748
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1748
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Skeleton, { className: "h-6 w-32" }),
|
|
1749
1749
|
/* @__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: [
|
|
1750
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1751
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1750
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Skeleton, { className: "h-6 w-24" }),
|
|
1751
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Skeleton, { className: "h-8 w-32" }),
|
|
1752
1752
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
1753
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1754
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1753
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Skeleton, { className: "h-4 w-full" }),
|
|
1754
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Skeleton, { className: "h-4 w-3/4" })
|
|
1755
1755
|
] }),
|
|
1756
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1756
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Skeleton, { className: "h-10 w-full" })
|
|
1757
1757
|
] }, cardIndex)) })
|
|
1758
1758
|
] }, rowIndex)) });
|
|
1759
1759
|
}
|
|
@@ -1767,18 +1767,18 @@ function ProrationPreview({ preview }) {
|
|
|
1767
1767
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
1768
1768
|
preview.lineItems.map((item, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between text-sm", children: [
|
|
1769
1769
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground", children: item.description }),
|
|
1770
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `font-medium ${item.amount < 0 ? "text-success" : "text-foreground"}`, children:
|
|
1770
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `font-medium ${item.amount < 0 ? "text-success" : "text-foreground"}`, children: _chunkU32IWQZMjs.formatCurrency.call(void 0, item.amount, preview.currency) })
|
|
1771
1771
|
] }, index)),
|
|
1772
1772
|
/* @__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: [
|
|
1773
1773
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-foreground", children: "Net Due Today" }),
|
|
1774
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-foreground", children:
|
|
1774
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-foreground", children: _chunkU32IWQZMjs.formatCurrency.call(void 0, preview.immediateCharge, preview.currency) })
|
|
1775
1775
|
] }) }),
|
|
1776
1776
|
preview.lineItems.length > 0 && preview.lineItems[0].period && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-muted-foreground mt-2 text-xs", children: [
|
|
1777
1777
|
"Next invoice on ",
|
|
1778
1778
|
formatDate3(preview.lineItems[0].period.end),
|
|
1779
1779
|
" for",
|
|
1780
1780
|
" ",
|
|
1781
|
-
|
|
1781
|
+
_chunkU32IWQZMjs.formatCurrency.call(void 0, preview.amountDue, preview.currency)
|
|
1782
1782
|
] })
|
|
1783
1783
|
] })
|
|
1784
1784
|
] });
|
|
@@ -1800,16 +1800,16 @@ function SubscriptionConfirmation({ price, isLoading, onConfirm, onCancel }) {
|
|
|
1800
1800
|
productDescription && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-sm text-muted-foreground", children: productDescription })
|
|
1801
1801
|
] }),
|
|
1802
1802
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-lg font-semibold", children: [
|
|
1803
|
-
|
|
1804
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-normal text-muted-foreground", children:
|
|
1803
|
+
_chunkU32IWQZMjs.formatCurrency.call(void 0, price.unitAmount, price.currency),
|
|
1804
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-normal text-muted-foreground", children: _chunkU32IWQZMjs.formatInterval.call(void 0, price) })
|
|
1805
1805
|
] }),
|
|
1806
1806
|
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: [
|
|
1807
1807
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Check, { className: "h-4 w-4 text-primary" }),
|
|
1808
1808
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: feature })
|
|
1809
1809
|
] }, index)) }),
|
|
1810
1810
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-end gap-3 pt-2 border-t border-accent/30", children: [
|
|
1811
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1812
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1811
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Button, { variant: "outline", onClick: onCancel, disabled: isLoading, children: "Cancel" }),
|
|
1812
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Button, { onClick: onConfirm, disabled: isLoading, children: isLoading ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1813
1813
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Loader2, { className: "h-4 w-4 animate-spin me-2" }),
|
|
1814
1814
|
"Processing..."
|
|
1815
1815
|
] }) : "Subscribe" })
|
|
@@ -2139,7 +2139,7 @@ function WizardStepPlanSelection({
|
|
|
2139
2139
|
onSelectPrice: handleSelectPrice
|
|
2140
2140
|
}
|
|
2141
2141
|
),
|
|
2142
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex justify-end pt-4 border-t", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2142
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex justify-end pt-4 border-t", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Button, { onClick: onNext, disabled: !selectedPrice || isProcessing, children: isProcessing ? "Loading..." : "Next: Review" }) })
|
|
2143
2143
|
] });
|
|
2144
2144
|
}
|
|
2145
2145
|
_chunk7QVYU63Ejs.__name.call(void 0, WizardStepPlanSelection, "WizardStepPlanSelection");
|
|
@@ -2200,7 +2200,7 @@ function PromoCodeInput({
|
|
|
2200
2200
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-success text-sm", children: formatDiscount(appliedCode) })
|
|
2201
2201
|
] }),
|
|
2202
2202
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2203
|
-
|
|
2203
|
+
_chunkU32IWQZMjs.Button,
|
|
2204
2204
|
{
|
|
2205
2205
|
variant: "ghost",
|
|
2206
2206
|
size: "sm",
|
|
@@ -2217,7 +2217,7 @@ function PromoCodeInput({
|
|
|
2217
2217
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
2218
2218
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex gap-2", children: [
|
|
2219
2219
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2220
|
-
|
|
2220
|
+
_chunkU32IWQZMjs.Input,
|
|
2221
2221
|
{
|
|
2222
2222
|
placeholder: "Enter promo code",
|
|
2223
2223
|
value: code,
|
|
@@ -2227,7 +2227,7 @@ function PromoCodeInput({
|
|
|
2227
2227
|
className: "flex-1"
|
|
2228
2228
|
}
|
|
2229
2229
|
),
|
|
2230
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2230
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.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" })
|
|
2231
2231
|
] }),
|
|
2232
2232
|
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error })
|
|
2233
2233
|
] });
|
|
@@ -2292,14 +2292,14 @@ function WizardStepReview({
|
|
|
2292
2292
|
return `${promotionCode.discountValue}% off`;
|
|
2293
2293
|
}
|
|
2294
2294
|
if (promotionCode.discountType === "amount_off" && promotionCode.discountValue) {
|
|
2295
|
-
return `${
|
|
2295
|
+
return `${_chunkU32IWQZMjs.formatCurrency.call(void 0, promotionCode.discountValue, promotionCode.currency || selectedPrice.currency)} off`;
|
|
2296
2296
|
}
|
|
2297
2297
|
return null;
|
|
2298
2298
|
}, "getDiscountDescription");
|
|
2299
2299
|
const discountDescription = getDiscountDescription();
|
|
2300
2300
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-6", children: [
|
|
2301
2301
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bg-muted/50 rounded-lg p-4 space-y-3", children: [
|
|
2302
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2302
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.SectionHeader, { children: "Selected Plan" }),
|
|
2303
2303
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between items-center", children: [
|
|
2304
2304
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
|
|
2305
2305
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "font-medium", children: _optionalChain([selectedPrice, 'access', _92 => _92.product, 'optionalAccess', _93 => _93.name]) }),
|
|
@@ -2307,10 +2307,10 @@ function WizardStepReview({
|
|
|
2307
2307
|
] }),
|
|
2308
2308
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-end", children: [
|
|
2309
2309
|
discountedPrice !== null ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2310
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground line-through", children:
|
|
2311
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-success text-lg font-semibold", children:
|
|
2312
|
-
discountDescription && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2313
|
-
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "font-semibold text-lg", children:
|
|
2310
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground line-through", children: _chunkU32IWQZMjs.formatCurrency.call(void 0, selectedPrice.unitAmount || 0, selectedPrice.currency) }),
|
|
2311
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-success text-lg font-semibold", children: _chunkU32IWQZMjs.formatCurrency.call(void 0, discountedPrice, selectedPrice.currency) }),
|
|
2312
|
+
discountDescription && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Badge, { variant: "softGreen", children: discountDescription })
|
|
2313
|
+
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "font-semibold text-lg", children: _chunkU32IWQZMjs.formatCurrency.call(void 0, selectedPrice.unitAmount || 0, selectedPrice.currency) }),
|
|
2314
2314
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: formatInterval2(selectedPrice) })
|
|
2315
2315
|
] })
|
|
2316
2316
|
] })
|
|
@@ -2325,9 +2325,9 @@ function WizardStepReview({
|
|
|
2325
2325
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between text-sm", children: [
|
|
2326
2326
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `${isTrialUpgrade ? "text-warning" : "text-muted-foreground"}`, children: isTrialUpgrade ? "Amount to charge now:" : "Amount due now:" }),
|
|
2327
2327
|
/* @__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: [
|
|
2328
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "line-through text-muted-foreground me-2", children:
|
|
2329
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-success", children:
|
|
2330
|
-
] }) :
|
|
2328
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "line-through text-muted-foreground me-2", children: _chunkU32IWQZMjs.formatCurrency.call(void 0, prorationPreview.immediateCharge, prorationPreview.currency) }),
|
|
2329
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-success", children: _chunkU32IWQZMjs.formatCurrency.call(void 0, discountedImmediateCharge, prorationPreview.currency) })
|
|
2330
|
+
] }) : _chunkU32IWQZMjs.formatCurrency.call(void 0, prorationPreview.immediateCharge, prorationPreview.currency) })
|
|
2331
2331
|
] })
|
|
2332
2332
|
]
|
|
2333
2333
|
}
|
|
@@ -2351,15 +2351,15 @@ function WizardStepReview({
|
|
|
2351
2351
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h4", { className: "font-medium", children: "Payment Method" }),
|
|
2352
2352
|
/* @__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" })
|
|
2353
2353
|
] }),
|
|
2354
|
-
!hasPaymentMethod && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2354
|
+
!hasPaymentMethod && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Button, { variant: "outline", onClick: onAddPaymentMethod, children: "Add Payment Method" })
|
|
2355
2355
|
] }) }),
|
|
2356
|
-
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2356
|
+
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.Alert, { variant: "destructive", children: [
|
|
2357
2357
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.AlertCircle, { className: "h-4 w-4" }),
|
|
2358
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2358
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.AlertDescription, { children: error })
|
|
2359
2359
|
] }),
|
|
2360
2360
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between pt-4 border-t", children: [
|
|
2361
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2362
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2361
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Button, { variant: "outline", onClick: onBack, disabled: isProcessing, children: "Back" }),
|
|
2362
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Button, { onClick: hasPaymentMethod ? onConfirm : onAddPaymentMethod, disabled: isProcessing, children: isProcessing ? "Processing..." : hasPaymentMethod ? isChangingPlan ? "Confirm Plan Change" : "Subscribe Now" : "Add Payment Method" })
|
|
2363
2363
|
] })
|
|
2364
2364
|
] });
|
|
2365
2365
|
}
|
|
@@ -2370,7 +2370,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, WizardStepReview, "WizardStepReview");
|
|
|
2370
2370
|
function WizardStepPaymentMethod({ onBack, onSuccess, isProcessing }) {
|
|
2371
2371
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-6", children: [
|
|
2372
2372
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-center", children: [
|
|
2373
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2373
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.SectionHeader, { children: "Add Payment Method" }),
|
|
2374
2374
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: "Enter your card details to complete your subscription" })
|
|
2375
2375
|
] }),
|
|
2376
2376
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, PaymentMethodForm, { onSuccess, onCancel: onBack, isLoading: isProcessing })
|
|
@@ -2412,10 +2412,10 @@ function SubscriptionWizard({
|
|
|
2412
2412
|
const isChangePlanMode = !!subscription;
|
|
2413
2413
|
const dialogTitle = subscription ? "Change Subscription Plan" : isPurchasingAddons ? "Purchase Add-ons" : "Subscribe to a Plan";
|
|
2414
2414
|
const dialogDescription = subscription ? "Select a new plan for your subscription" : isPurchasingAddons ? "Select one-time products to purchase" : "Choose a subscription plan to get started";
|
|
2415
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2416
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2417
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2418
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2415
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.DialogContent, { className: "max-w-2xl", children: [
|
|
2416
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.DialogHeader, { children: [
|
|
2417
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.DialogTitle, { children: dialogTitle }),
|
|
2418
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.DialogDescription, { children: dialogDescription })
|
|
2419
2419
|
] }),
|
|
2420
2420
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, WizardProgressIndicator, { currentStep: state.step }),
|
|
2421
2421
|
state.step === "plan-selection" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -2498,15 +2498,15 @@ function UsageSummaryCard({ meter, summary }) {
|
|
|
2498
2498
|
const progressWidth = percentage !== null ? Math.min(percentage, 100) : 0;
|
|
2499
2499
|
const displayName = meter.displayName || meter.eventName;
|
|
2500
2500
|
const hasLimit = limit !== null && limit !== void 0;
|
|
2501
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2502
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2501
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.Card, { children: [
|
|
2502
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.CardHeader, { className: "flex flex-row items-center gap-x-3 pb-3", children: [
|
|
2503
2503
|
/* @__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" }) }),
|
|
2504
2504
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col", children: [
|
|
2505
2505
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-sm font-medium", children: displayName }),
|
|
2506
2506
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground text-xs", children: meter.id })
|
|
2507
2507
|
] })
|
|
2508
2508
|
] }),
|
|
2509
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2509
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.CardContent, { className: "flex flex-col gap-y-4", children: [
|
|
2510
2510
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
|
|
2511
2511
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-3xl font-bold", children: currentUsage.toLocaleString() }),
|
|
2512
2512
|
hasLimit && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "text-muted-foreground text-sm", children: [
|
|
@@ -2633,22 +2633,22 @@ function UsageHistoryTable({ usageRecords }) {
|
|
|
2633
2633
|
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." }) });
|
|
2634
2634
|
}
|
|
2635
2635
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
2636
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2637
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "overflow-clip rounded-lg border", children: /* @__PURE__ */ _jsxruntime.jsxs.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,
|
|
2642
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2636
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.SectionHeader, { level: 2, children: "Usage History" }),
|
|
2637
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "overflow-clip rounded-lg border", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.Table, { children: [
|
|
2638
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TableHeader, { className: "bg-muted", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.TableRow, { children: [
|
|
2639
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TableHead, { children: "Date & Time" }),
|
|
2640
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TableHead, { children: "Meter Event" }),
|
|
2641
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TableHead, { className: "text-end", children: "Quantity" }),
|
|
2642
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TableHead, { children: "Event ID" })
|
|
2643
2643
|
] }) }),
|
|
2644
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2644
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TableBody, { children: usageRecords.map((record) => {
|
|
2645
2645
|
const dateTime = formatDateTime(record.timestamp);
|
|
2646
2646
|
const quantity = record.quantity.toLocaleString();
|
|
2647
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2648
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2649
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2650
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2651
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2647
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.TableRow, { children: [
|
|
2648
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TableCell, { className: "font-medium", children: dateTime }),
|
|
2649
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TableCell, { className: "text-muted-foreground", children: record.meterEventName }),
|
|
2650
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TableCell, { className: "text-end font-medium", children: quantity }),
|
|
2651
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.TableCell, { className: "text-muted-foreground text-sm tabular-nums", children: record.stripeEventId })
|
|
2652
2652
|
] }, record.id);
|
|
2653
2653
|
}) })
|
|
2654
2654
|
] }) })
|
|
@@ -2659,8 +2659,8 @@ _chunk7QVYU63Ejs.__name.call(void 0, UsageHistoryTable, "UsageHistoryTable");
|
|
|
2659
2659
|
// src/features/billing/components/modals/BillingDetailModal.tsx
|
|
2660
2660
|
|
|
2661
2661
|
function BillingDetailModal({ open, onOpenChange, title, children, className }) {
|
|
2662
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2663
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2662
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.DialogContent, { className: _nullishCoalesce(className, () => ( "max-w-4xl max-h-[90vh] overflow-y-auto")), children: [
|
|
2663
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.DialogHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.DialogTitle, { children: title }) }),
|
|
2664
2664
|
children
|
|
2665
2665
|
] }) });
|
|
2666
2666
|
}
|
|
@@ -2677,7 +2677,7 @@ function BillingAlertBanner({ subscription, onUpdatePayment, onAddPayment }) {
|
|
|
2677
2677
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-destructive text-sm font-medium", children: "Payment Failed" }),
|
|
2678
2678
|
/* @__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." })
|
|
2679
2679
|
] }),
|
|
2680
|
-
onUpdatePayment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2680
|
+
onUpdatePayment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Button, { variant: "outline", size: "sm", onClick: onUpdatePayment, className: "text-destructive border-red-300", children: "Update Payment Method" })
|
|
2681
2681
|
] });
|
|
2682
2682
|
}
|
|
2683
2683
|
if (subscription.status === "trialing" /* TRIALING */ && subscription.trialEnd) {
|
|
@@ -2697,7 +2697,7 @@ function BillingAlertBanner({ subscription, onUpdatePayment, onAddPayment }) {
|
|
|
2697
2697
|
". Add a payment method to continue your subscription."
|
|
2698
2698
|
] })
|
|
2699
2699
|
] }),
|
|
2700
|
-
onAddPayment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2700
|
+
onAddPayment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Button, { variant: "outline", size: "sm", onClick: onAddPayment, className: "text-warning border-yellow-300", children: "Add Payment Method" })
|
|
2701
2701
|
] });
|
|
2702
2702
|
}
|
|
2703
2703
|
}
|
|
@@ -2921,18 +2921,18 @@ function BillingDashboardContainer() {
|
|
|
2921
2921
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Wallet, { className: "h-8 w-8" }),
|
|
2922
2922
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h1", { className: "text-primary text-3xl font-semibold", children: "Billing" })
|
|
2923
2923
|
] }),
|
|
2924
|
-
isInitialLoading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2925
|
-
noCustomerExists && !isInitialLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2926
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2924
|
+
isInitialLoading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.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" }) }) }),
|
|
2925
|
+
noCustomerExists && !isInitialLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.Card, { children: [
|
|
2926
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.CardHeader, { className: "text-center", children: [
|
|
2927
2927
|
/* @__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" }) }),
|
|
2928
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2929
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2928
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.CardTitle, { children: "Set Up Billing" }),
|
|
2929
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.CardDescription, { children: "Your company doesn't have a billing account yet. Set one up to manage subscriptions, payment methods, and view invoices." })
|
|
2930
2930
|
] }),
|
|
2931
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2931
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.CardContent, { className: "flex justify-center pb-8", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Button, { onClick: handleCreateCustomer, disabled: creatingCustomer, size: "lg", children: creatingCustomer ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2932
2932
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Loader2, { className: "me-2 h-4 w-4 animate-spin" }),
|
|
2933
2933
|
"Setting up..."
|
|
2934
2934
|
] }) : "Set Up Billing Account" }) }),
|
|
2935
|
-
errors.customer && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2935
|
+
errors.customer && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.CardContent, { className: "pt-0", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-center text-destructive text-xs/relaxed", children: errors.customer }) })
|
|
2936
2936
|
] }),
|
|
2937
2937
|
!noCustomerExists && !isInitialLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2938
2938
|
criticalSubscriptions.map((subscription) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -3104,12 +3104,12 @@ function PriceArchiver({ price }) {
|
|
|
3104
3104
|
const isArchived = !price.active;
|
|
3105
3105
|
const scope = isArchived ? "restore" : "archive";
|
|
3106
3106
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
3107
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3107
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.Button, { variant: "outline", size: "sm", onClick: () => setOpen(true), children: [
|
|
3108
3108
|
isArchived ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.RotateCcwIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ArchiveIcon, {}),
|
|
3109
3109
|
t(`billing.admin.prices.${scope}.confirm`)
|
|
3110
3110
|
] }),
|
|
3111
3111
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3112
|
-
|
|
3112
|
+
_chunkU32IWQZMjs.ConfirmDialog,
|
|
3113
3113
|
{
|
|
3114
3114
|
open,
|
|
3115
3115
|
onOpenChange: setOpen,
|
|
@@ -3123,7 +3123,7 @@ function PriceArchiver({ price }) {
|
|
|
3123
3123
|
if (isArchived) await restorePrice(price.id);
|
|
3124
3124
|
else await archivePrice(price.id);
|
|
3125
3125
|
} catch (error) {
|
|
3126
|
-
|
|
3126
|
+
_chunkU32IWQZMjs.errorToast.call(void 0, { title: t(`billing.admin.prices.${scope}.title`), error });
|
|
3127
3127
|
throw error;
|
|
3128
3128
|
}
|
|
3129
3129
|
}
|
|
@@ -3296,7 +3296,7 @@ function PriceEditorInternal({
|
|
|
3296
3296
|
{ id: "metered", text: t("billing.admin.prices.usage.metered") }
|
|
3297
3297
|
];
|
|
3298
3298
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3299
|
-
|
|
3299
|
+
_chunkU32IWQZMjs.EditorSheet,
|
|
3300
3300
|
{
|
|
3301
3301
|
form,
|
|
3302
3302
|
entityType: t("billing.admin.prices.entity"),
|
|
@@ -3351,13 +3351,13 @@ function PriceEditorInternal({
|
|
|
3351
3351
|
dialogOpen,
|
|
3352
3352
|
onDialogOpenChange,
|
|
3353
3353
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
3354
|
-
isEdit && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3355
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3356
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3354
|
+
isEdit && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.Alert, { children: [
|
|
3355
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.AlertTitle, { children: t("billing.admin.prices.immutability.title") }),
|
|
3356
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.AlertDescription, { children: t("billing.admin.prices.immutability.description") })
|
|
3357
3357
|
] }),
|
|
3358
3358
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-2 gap-x-4", children: [
|
|
3359
3359
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3360
|
-
|
|
3360
|
+
_chunkU32IWQZMjs.FormInput,
|
|
3361
3361
|
{
|
|
3362
3362
|
form,
|
|
3363
3363
|
id: "unitAmount",
|
|
@@ -3369,7 +3369,7 @@ function PriceEditorInternal({
|
|
|
3369
3369
|
}
|
|
3370
3370
|
),
|
|
3371
3371
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3372
|
-
|
|
3372
|
+
_chunkU32IWQZMjs.FormSelect,
|
|
3373
3373
|
{
|
|
3374
3374
|
form,
|
|
3375
3375
|
id: "currency",
|
|
@@ -3380,7 +3380,7 @@ function PriceEditorInternal({
|
|
|
3380
3380
|
)
|
|
3381
3381
|
] }),
|
|
3382
3382
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3383
|
-
|
|
3383
|
+
_chunkU32IWQZMjs.FormSelect,
|
|
3384
3384
|
{
|
|
3385
3385
|
form,
|
|
3386
3386
|
id: "interval",
|
|
@@ -3391,7 +3391,7 @@ function PriceEditorInternal({
|
|
|
3391
3391
|
),
|
|
3392
3392
|
isRecurring && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-2 gap-x-4", children: [
|
|
3393
3393
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3394
|
-
|
|
3394
|
+
_chunkU32IWQZMjs.FormInput,
|
|
3395
3395
|
{
|
|
3396
3396
|
form,
|
|
3397
3397
|
id: "intervalCount",
|
|
@@ -3402,7 +3402,7 @@ function PriceEditorInternal({
|
|
|
3402
3402
|
}
|
|
3403
3403
|
),
|
|
3404
3404
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3405
|
-
|
|
3405
|
+
_chunkU32IWQZMjs.FormSelect,
|
|
3406
3406
|
{
|
|
3407
3407
|
form,
|
|
3408
3408
|
id: "usageType",
|
|
@@ -3413,7 +3413,7 @@ function PriceEditorInternal({
|
|
|
3413
3413
|
)
|
|
3414
3414
|
] }),
|
|
3415
3415
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3416
|
-
|
|
3416
|
+
_chunkU32IWQZMjs.FormInput,
|
|
3417
3417
|
{
|
|
3418
3418
|
form,
|
|
3419
3419
|
id: "nickname",
|
|
@@ -3422,7 +3422,7 @@ function PriceEditorInternal({
|
|
|
3422
3422
|
}
|
|
3423
3423
|
),
|
|
3424
3424
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3425
|
-
|
|
3425
|
+
_chunkU32IWQZMjs.FormTextarea,
|
|
3426
3426
|
{
|
|
3427
3427
|
form,
|
|
3428
3428
|
id: "description",
|
|
@@ -3432,7 +3432,7 @@ function PriceEditorInternal({
|
|
|
3432
3432
|
}
|
|
3433
3433
|
),
|
|
3434
3434
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3435
|
-
|
|
3435
|
+
_chunkU32IWQZMjs.FormInput,
|
|
3436
3436
|
{
|
|
3437
3437
|
form,
|
|
3438
3438
|
id: "token",
|
|
@@ -3442,10 +3442,10 @@ function PriceEditorInternal({
|
|
|
3442
3442
|
}
|
|
3443
3443
|
),
|
|
3444
3444
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-2", children: [
|
|
3445
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3445
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.FieldLabel, { children: t("billing.admin.prices.fields.features") }),
|
|
3446
3446
|
form.watch("features").map((_, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex gap-2", children: [
|
|
3447
3447
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3448
|
-
|
|
3448
|
+
_chunkU32IWQZMjs.Input,
|
|
3449
3449
|
{
|
|
3450
3450
|
...form.register(`features.${index}`),
|
|
3451
3451
|
placeholder: t("billing.admin.prices.placeholders.feature", { index: index + 1 }),
|
|
@@ -3453,7 +3453,7 @@ function PriceEditorInternal({
|
|
|
3453
3453
|
}
|
|
3454
3454
|
),
|
|
3455
3455
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3456
|
-
|
|
3456
|
+
_chunkU32IWQZMjs.Button,
|
|
3457
3457
|
{
|
|
3458
3458
|
type: "button",
|
|
3459
3459
|
variant: "outline",
|
|
@@ -3468,7 +3468,7 @@ function PriceEditorInternal({
|
|
|
3468
3468
|
)
|
|
3469
3469
|
] }, index)),
|
|
3470
3470
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3471
|
-
|
|
3471
|
+
_chunkU32IWQZMjs.Button,
|
|
3472
3472
|
{
|
|
3473
3473
|
type: "button",
|
|
3474
3474
|
variant: "outline",
|
|
@@ -3483,12 +3483,12 @@ function PriceEditorInternal({
|
|
|
3483
3483
|
)
|
|
3484
3484
|
] }),
|
|
3485
3485
|
isRecurring && allFeatures.length > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-2", children: [
|
|
3486
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3486
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.FieldLabel, { children: t("billing.admin.prices.fields.platformFeatures") }),
|
|
3487
3487
|
/* @__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) => {
|
|
3488
3488
|
const isChecked = form.watch("featureIds").includes(feature.id);
|
|
3489
3489
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-2", children: [
|
|
3490
3490
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3491
|
-
|
|
3491
|
+
_chunkU32IWQZMjs.Checkbox,
|
|
3492
3492
|
{
|
|
3493
3493
|
id: `feature-${feature.id}`,
|
|
3494
3494
|
checked: isChecked,
|
|
@@ -3504,13 +3504,13 @@ function PriceEditorInternal({
|
|
|
3504
3504
|
}
|
|
3505
3505
|
}
|
|
3506
3506
|
),
|
|
3507
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3507
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.FieldLabel, { htmlFor: `feature-${feature.id}`, children: feature.name }),
|
|
3508
3508
|
feature.isCore && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("billing.admin.prices.help.core") })
|
|
3509
3509
|
] }, feature.id);
|
|
3510
3510
|
}) })
|
|
3511
3511
|
] }),
|
|
3512
3512
|
isRecurring && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3513
|
-
|
|
3513
|
+
_chunkU32IWQZMjs.FormCheckbox,
|
|
3514
3514
|
{
|
|
3515
3515
|
form,
|
|
3516
3516
|
id: "isTrial",
|
|
@@ -3553,7 +3553,7 @@ var defaultContextValue = {
|
|
|
3553
3553
|
productId: void 0
|
|
3554
3554
|
};
|
|
3555
3555
|
function priceLabel(price) {
|
|
3556
|
-
return _nullishCoalesce(price.nickname, () => ( `${
|
|
3556
|
+
return _nullishCoalesce(price.nickname, () => ( `${_chunkU32IWQZMjs.formatCurrency.call(void 0, price.unitAmount, price.currency)} ${_chunkU32IWQZMjs.formatInterval.call(void 0, price)}`.trim()));
|
|
3557
3557
|
}
|
|
3558
3558
|
_chunk7QVYU63Ejs.__name.call(void 0, priceLabel, "priceLabel");
|
|
3559
3559
|
var PriceProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({
|
|
@@ -3563,8 +3563,8 @@ var PriceProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({
|
|
|
3563
3563
|
productId: productIdProp
|
|
3564
3564
|
}) => {
|
|
3565
3565
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
3566
|
-
const generateUrl =
|
|
3567
|
-
const { hasRole } =
|
|
3566
|
+
const generateUrl = _chunkU32IWQZMjs.usePageUrlGenerator.call(void 0, );
|
|
3567
|
+
const { hasRole } = _chunkU32IWQZMjs.useCurrentUserContext.call(void 0, );
|
|
3568
3568
|
const [price, setPrice] = _react.useState.call(void 0,
|
|
3569
3569
|
dehydratedPrice ? _chunkMWZCCOTSjs.rehydrate.call(void 0, _chunkMWZCCOTSjs.Modules.StripePrice, dehydratedPrice) : void 0
|
|
3570
3570
|
);
|
|
@@ -3652,7 +3652,7 @@ var PriceProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({
|
|
|
3652
3652
|
}
|
|
3653
3653
|
return response;
|
|
3654
3654
|
}, "title");
|
|
3655
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3655
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PriceContext.Provider, { value, children }) });
|
|
3656
3656
|
}, "PriceProvider");
|
|
3657
3657
|
var usePriceContext = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => _nullishCoalesce(_react.useContext.call(void 0, PriceContext), () => ( defaultContextValue)), "usePriceContext");
|
|
3658
3658
|
|
|
@@ -3672,12 +3672,12 @@ function ProductArchiver({ product }) {
|
|
|
3672
3672
|
const isArchived = !product.active;
|
|
3673
3673
|
const scope = isArchived ? "restore" : "archive";
|
|
3674
3674
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
3675
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3675
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.Button, { variant: "outline", size: "sm", onClick: () => setOpen(true), children: [
|
|
3676
3676
|
isArchived ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.RotateCcwIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ArchiveIcon, {}),
|
|
3677
3677
|
t(`billing.admin.products.${scope}.confirm`)
|
|
3678
3678
|
] }),
|
|
3679
3679
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3680
|
-
|
|
3680
|
+
_chunkU32IWQZMjs.ConfirmDialog,
|
|
3681
3681
|
{
|
|
3682
3682
|
open,
|
|
3683
3683
|
onOpenChange: setOpen,
|
|
@@ -3691,7 +3691,7 @@ function ProductArchiver({ product }) {
|
|
|
3691
3691
|
if (isArchived) await restoreProduct(product.id);
|
|
3692
3692
|
else await archiveProduct(product.id);
|
|
3693
3693
|
} catch (error) {
|
|
3694
|
-
|
|
3694
|
+
_chunkU32IWQZMjs.errorToast.call(void 0, { title: t(`billing.admin.products.${scope}.title`), error });
|
|
3695
3695
|
throw error;
|
|
3696
3696
|
}
|
|
3697
3697
|
}
|
|
@@ -3744,7 +3744,7 @@ function ProductEditorInternal({
|
|
|
3744
3744
|
defaultValues: getDefaultValues()
|
|
3745
3745
|
});
|
|
3746
3746
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3747
|
-
|
|
3747
|
+
_chunkU32IWQZMjs.EditorSheet,
|
|
3748
3748
|
{
|
|
3749
3749
|
form,
|
|
3750
3750
|
entityType: t("billing.admin.products.entity"),
|
|
@@ -3767,7 +3767,7 @@ function ProductEditorInternal({
|
|
|
3767
3767
|
onDialogOpenChange,
|
|
3768
3768
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
3769
3769
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3770
|
-
|
|
3770
|
+
_chunkU32IWQZMjs.FormInput,
|
|
3771
3771
|
{
|
|
3772
3772
|
form,
|
|
3773
3773
|
id: "name",
|
|
@@ -3777,7 +3777,7 @@ function ProductEditorInternal({
|
|
|
3777
3777
|
}
|
|
3778
3778
|
),
|
|
3779
3779
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3780
|
-
|
|
3780
|
+
_chunkU32IWQZMjs.FormTextarea,
|
|
3781
3781
|
{
|
|
3782
3782
|
form,
|
|
3783
3783
|
id: "description",
|
|
@@ -3821,8 +3821,8 @@ var defaultContextValue2 = {
|
|
|
3821
3821
|
};
|
|
3822
3822
|
var ProductProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ children, dehydratedProduct, publishChrome = true }) => {
|
|
3823
3823
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
3824
|
-
const generateUrl =
|
|
3825
|
-
const { hasRole } =
|
|
3824
|
+
const generateUrl = _chunkU32IWQZMjs.usePageUrlGenerator.call(void 0, );
|
|
3825
|
+
const { hasRole } = _chunkU32IWQZMjs.useCurrentUserContext.call(void 0, );
|
|
3826
3826
|
const [product, setProduct] = _react.useState.call(void 0,
|
|
3827
3827
|
dehydratedProduct ? _chunkMWZCCOTSjs.rehydrate.call(void 0, _chunkMWZCCOTSjs.Modules.StripeProduct, dehydratedProduct) : void 0
|
|
3828
3828
|
);
|
|
@@ -3916,7 +3916,7 @@ var ProductProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ ch
|
|
|
3916
3916
|
}
|
|
3917
3917
|
return response;
|
|
3918
3918
|
}, "title");
|
|
3919
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3919
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductContext.Provider, { value, children }) });
|
|
3920
3920
|
}, "ProductProvider");
|
|
3921
3921
|
var useProductContext = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => _nullishCoalesce(_react.useContext.call(void 0, ProductContext), () => ( defaultContextValue2)), "useProductContext");
|
|
3922
3922
|
|
|
@@ -3925,56 +3925,56 @@ var useProductContext = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ()
|
|
|
3925
3925
|
|
|
3926
3926
|
function PriceDetails() {
|
|
3927
3927
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
3928
|
-
const generateUrl =
|
|
3928
|
+
const generateUrl = _chunkU32IWQZMjs.usePageUrlGenerator.call(void 0, );
|
|
3929
3929
|
const { price } = usePriceContext();
|
|
3930
3930
|
if (!price) return null;
|
|
3931
3931
|
const isRecurring = price.priceType === "recurring";
|
|
3932
3932
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-8", children: [
|
|
3933
3933
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
3934
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3934
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.SectionHeader, { children: t("billing.admin.prices.title") }),
|
|
3935
3935
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
|
|
3936
3936
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3937
|
-
|
|
3937
|
+
_chunkU32IWQZMjs.DetailField,
|
|
3938
3938
|
{
|
|
3939
3939
|
label: t("billing.admin.prices.fields.product"),
|
|
3940
|
-
value: price.product ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3940
|
+
value: price.product ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Link, { href: generateUrl({ page: _chunkMWZCCOTSjs.Modules.StripeProduct, id: price.product.id }), children: price.product.name }) : "\u2014"
|
|
3941
3941
|
}
|
|
3942
3942
|
),
|
|
3943
3943
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3944
|
-
|
|
3944
|
+
_chunkU32IWQZMjs.DetailField,
|
|
3945
3945
|
{
|
|
3946
3946
|
label: t("billing.admin.prices.fields.status"),
|
|
3947
3947
|
value: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex flex-wrap items-center gap-1", children: [
|
|
3948
|
-
price.active ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3949
|
-
price.isTrial && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3948
|
+
price.active ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Badge, { variant: "softGreen", children: t("billing.admin.prices.status.active") }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Badge, { variant: "softGray", children: t("billing.admin.prices.status.archived") }),
|
|
3949
|
+
price.isTrial && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Badge, { variant: "softBlue", children: t("billing.admin.prices.badge.trial") })
|
|
3950
3950
|
] })
|
|
3951
3951
|
}
|
|
3952
3952
|
),
|
|
3953
3953
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3954
|
-
|
|
3954
|
+
_chunkU32IWQZMjs.DetailField,
|
|
3955
3955
|
{
|
|
3956
3956
|
label: t("billing.admin.prices.fields.amount"),
|
|
3957
|
-
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children:
|
|
3957
|
+
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: _chunkU32IWQZMjs.formatCurrency.call(void 0, price.unitAmount, price.currency) })
|
|
3958
3958
|
}
|
|
3959
3959
|
),
|
|
3960
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3960
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.DetailField, { label: t("billing.admin.prices.fields.currency"), value: price.currency.toUpperCase() }),
|
|
3961
3961
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3962
|
-
|
|
3962
|
+
_chunkU32IWQZMjs.DetailField,
|
|
3963
3963
|
{
|
|
3964
3964
|
label: t("billing.admin.prices.fields.type"),
|
|
3965
3965
|
value: isRecurring ? t("billing.admin.prices.type.recurring") : t("billing.admin.prices.type.oneTime")
|
|
3966
3966
|
}
|
|
3967
3967
|
),
|
|
3968
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3968
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.DetailField, { label: t("billing.admin.prices.fields.billing"), value: _chunkU32IWQZMjs.formatInterval.call(void 0, price) }),
|
|
3969
3969
|
isRecurring && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3970
|
-
|
|
3970
|
+
_chunkU32IWQZMjs.DetailField,
|
|
3971
3971
|
{
|
|
3972
3972
|
label: t("billing.admin.prices.fields.intervalCount"),
|
|
3973
3973
|
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: _nullishCoalesce(_optionalChain([price, 'access', _160 => _160.recurring, 'optionalAccess', _161 => _161.intervalCount]), () => ( 1)) })
|
|
3974
3974
|
}
|
|
3975
3975
|
),
|
|
3976
3976
|
isRecurring && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3977
|
-
|
|
3977
|
+
_chunkU32IWQZMjs.DetailField,
|
|
3978
3978
|
{
|
|
3979
3979
|
label: t("billing.admin.prices.fields.usageType"),
|
|
3980
3980
|
value: _optionalChain([price, 'access', _162 => _162.recurring, 'optionalAccess', _163 => _163.usageType]) === "metered" ? t("billing.admin.prices.usage.metered") : t("billing.admin.prices.usage.licensed")
|
|
@@ -3983,24 +3983,24 @@ function PriceDetails() {
|
|
|
3983
3983
|
] })
|
|
3984
3984
|
] }),
|
|
3985
3985
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
3986
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3986
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.SectionHeader, { children: t("billing.admin.prices.fields.platformFeatures") }),
|
|
3987
3987
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
|
|
3988
3988
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3989
|
-
|
|
3989
|
+
_chunkU32IWQZMjs.DetailField,
|
|
3990
3990
|
{
|
|
3991
3991
|
label: t("billing.admin.prices.fields.token"),
|
|
3992
3992
|
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: _nullishCoalesce(price.token, () => ( "\u2014")) })
|
|
3993
3993
|
}
|
|
3994
3994
|
),
|
|
3995
3995
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3996
|
-
|
|
3996
|
+
_chunkU32IWQZMjs.DetailField,
|
|
3997
3997
|
{
|
|
3998
3998
|
label: t("billing.admin.prices.fields.stripeId"),
|
|
3999
3999
|
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: price.stripePriceId })
|
|
4000
4000
|
}
|
|
4001
4001
|
),
|
|
4002
4002
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4003
|
-
|
|
4003
|
+
_chunkU32IWQZMjs.DetailField,
|
|
4004
4004
|
{
|
|
4005
4005
|
label: t("billing.admin.prices.fields.description"),
|
|
4006
4006
|
value: _nullishCoalesce(price.description, () => ( "\u2014")),
|
|
@@ -4008,7 +4008,7 @@ function PriceDetails() {
|
|
|
4008
4008
|
}
|
|
4009
4009
|
),
|
|
4010
4010
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4011
|
-
|
|
4011
|
+
_chunkU32IWQZMjs.DetailField,
|
|
4012
4012
|
{
|
|
4013
4013
|
label: t("billing.admin.prices.fields.features"),
|
|
4014
4014
|
className: "md:col-span-2",
|
|
@@ -4016,11 +4016,11 @@ function PriceDetails() {
|
|
|
4016
4016
|
}
|
|
4017
4017
|
),
|
|
4018
4018
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4019
|
-
|
|
4019
|
+
_chunkU32IWQZMjs.DetailField,
|
|
4020
4020
|
{
|
|
4021
4021
|
label: t("billing.admin.prices.fields.platformFeatures"),
|
|
4022
4022
|
className: "md:col-span-2",
|
|
4023
|
-
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,
|
|
4023
|
+
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, _chunkU32IWQZMjs.Badge, { variant: "softGray", children: feature.name }, feature.id)) }) : "\u2014"
|
|
4024
4024
|
}
|
|
4025
4025
|
)
|
|
4026
4026
|
] })
|
|
@@ -4034,7 +4034,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, PriceDetails, "PriceDetails");
|
|
|
4034
4034
|
function PriceContainer() {
|
|
4035
4035
|
const { price } = usePriceContext();
|
|
4036
4036
|
if (!price) return null;
|
|
4037
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4037
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.RoundPageContainer, { module: _chunkMWZCCOTSjs.Modules.StripePrice, id: price.id, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PriceDetails, {}) });
|
|
4038
4038
|
}
|
|
4039
4039
|
_chunk7QVYU63Ejs.__name.call(void 0, PriceContainer, "PriceContainer");
|
|
4040
4040
|
|
|
@@ -4159,7 +4159,7 @@ function PricesList({ productId, fullWidth }) {
|
|
|
4159
4159
|
const importInputRef = _react.useRef.call(void 0, null);
|
|
4160
4160
|
const [seed, setSeed] = _react.useState.call(void 0, void 0);
|
|
4161
4161
|
const [seedNonce, setSeedNonce] = _react.useState.call(void 0, 0);
|
|
4162
|
-
const data =
|
|
4162
|
+
const data = _chunkU32IWQZMjs.useDataListRetriever.call(void 0, {
|
|
4163
4163
|
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkMWZCCOTSjs.StripePriceService.listPrices({ ...params, productId }), "retriever"),
|
|
4164
4164
|
retrieverParams: {},
|
|
4165
4165
|
module: _chunkMWZCCOTSjs.Modules.StripePrice
|
|
@@ -4197,7 +4197,7 @@ function PricesList({ productId, fullWidth }) {
|
|
|
4197
4197
|
openSeededEditor(transfer.price);
|
|
4198
4198
|
} catch (error) {
|
|
4199
4199
|
console.error("[PricesList] price import failed", error);
|
|
4200
|
-
|
|
4200
|
+
_chunkU32IWQZMjs.errorToast.call(void 0, {
|
|
4201
4201
|
title: t("billing.admin.prices.import.errors.title"),
|
|
4202
4202
|
error: t("billing.admin.prices.import.errors.invalid")
|
|
4203
4203
|
});
|
|
@@ -4216,7 +4216,7 @@ function PricesList({ productId, fullWidth }) {
|
|
|
4216
4216
|
"create-price"
|
|
4217
4217
|
),
|
|
4218
4218
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _react.Fragment, { children: [
|
|
4219
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
4219
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU32IWQZMjs.Button, { variant: "outline", size: "sm", type: "button", onClick: () => _optionalChain([importInputRef, 'access', _178 => _178.current, 'optionalAccess', _179 => _179.click, 'call', _180 => _180()]), children: [
|
|
4220
4220
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.UploadIcon, {}),
|
|
4221
4221
|
t("billing.admin.prices.actions.import")
|
|
4222
4222
|
] }),
|
|
@@ -4234,7 +4234,7 @@ function PricesList({ productId, fullWidth }) {
|
|
|
4234
4234
|
];
|
|
4235
4235
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
4236
4236
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4237
|
-
|
|
4237
|
+
_chunkU32IWQZMjs.ContentListTable,
|
|
4238
4238
|
{
|
|
4239
4239
|
data,
|
|
4240
4240
|
fields: [
|
|
@@ -4251,7 +4251,7 @@ function PricesList({ productId, fullWidth }) {
|
|
|
4251
4251
|
fullWidth,
|
|
4252
4252
|
title: t("billing.admin.prices.title"),
|
|
4253
4253
|
emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4254
|
-
|
|
4254
|
+
_chunkU32IWQZMjs.EmptyState,
|
|
4255
4255
|
{
|
|
4256
4256
|
icon: _lucidereact.DollarSignIcon,
|
|
4257
4257
|
title: t("billing.admin.prices.empty.title"),
|
|
@@ -4291,18 +4291,18 @@ function ProductDetails() {
|
|
|
4291
4291
|
const { product } = useProductContext();
|
|
4292
4292
|
if (!product) return null;
|
|
4293
4293
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
4294
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4294
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.SectionHeader, { children: t("billing.admin.products.tabs.details") }),
|
|
4295
4295
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
|
|
4296
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4296
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.DetailField, { label: t("billing.admin.products.fields.name"), value: product.name }),
|
|
4297
4297
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4298
|
-
|
|
4298
|
+
_chunkU32IWQZMjs.DetailField,
|
|
4299
4299
|
{
|
|
4300
4300
|
label: t("billing.admin.products.fields.status"),
|
|
4301
|
-
value: product.active ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4301
|
+
value: product.active ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Badge, { variant: "softGreen", children: t("billing.admin.products.status.active") }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.Badge, { variant: "softGray", children: t("billing.admin.products.status.archived") })
|
|
4302
4302
|
}
|
|
4303
4303
|
),
|
|
4304
4304
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4305
|
-
|
|
4305
|
+
_chunkU32IWQZMjs.DetailField,
|
|
4306
4306
|
{
|
|
4307
4307
|
label: t("billing.admin.products.fields.description"),
|
|
4308
4308
|
value: _nullishCoalesce(product.description, () => ( "\u2014")),
|
|
@@ -4310,14 +4310,14 @@ function ProductDetails() {
|
|
|
4310
4310
|
}
|
|
4311
4311
|
),
|
|
4312
4312
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4313
|
-
|
|
4313
|
+
_chunkU32IWQZMjs.DetailField,
|
|
4314
4314
|
{
|
|
4315
4315
|
label: t("billing.admin.products.fields.prices"),
|
|
4316
4316
|
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: product.stripePrices.length })
|
|
4317
4317
|
}
|
|
4318
4318
|
),
|
|
4319
4319
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4320
|
-
|
|
4320
|
+
_chunkU32IWQZMjs.DetailField,
|
|
4321
4321
|
{
|
|
4322
4322
|
label: t("billing.admin.products.fields.stripeId"),
|
|
4323
4323
|
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: product.stripeProductId })
|
|
@@ -4335,7 +4335,7 @@ function ProductContainer() {
|
|
|
4335
4335
|
const { product } = useProductContext();
|
|
4336
4336
|
if (!product) return null;
|
|
4337
4337
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4338
|
-
|
|
4338
|
+
_chunkU32IWQZMjs.RoundPageContainer,
|
|
4339
4339
|
{
|
|
4340
4340
|
module: _chunkMWZCCOTSjs.Modules.StripeProduct,
|
|
4341
4341
|
id: product.id,
|
|
@@ -4370,7 +4370,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, ProductContainer, "ProductContainer");
|
|
|
4370
4370
|
function ProductsList({ fullWidth } = {}) {
|
|
4371
4371
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
4372
4372
|
const { catalogueVersion } = useProductContext();
|
|
4373
|
-
const data =
|
|
4373
|
+
const data = _chunkU32IWQZMjs.useDataListRetriever.call(void 0, {
|
|
4374
4374
|
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkMWZCCOTSjs.StripeProductService.listProducts(params), "retriever"),
|
|
4375
4375
|
retrieverParams: {},
|
|
4376
4376
|
module: _chunkMWZCCOTSjs.Modules.StripeProduct
|
|
@@ -4380,7 +4380,7 @@ function ProductsList({ fullWidth } = {}) {
|
|
|
4380
4380
|
}, [catalogueVersion]);
|
|
4381
4381
|
const functions = [/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductEditor, {}, "create-product")];
|
|
4382
4382
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4383
|
-
|
|
4383
|
+
_chunkU32IWQZMjs.ContentListTable,
|
|
4384
4384
|
{
|
|
4385
4385
|
data,
|
|
4386
4386
|
fields: ["name" /* name */, "status" /* status */, "prices" /* prices */],
|
|
@@ -4389,7 +4389,7 @@ function ProductsList({ fullWidth } = {}) {
|
|
|
4389
4389
|
fullWidth,
|
|
4390
4390
|
title: t("billing.admin.products.title"),
|
|
4391
4391
|
emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4392
|
-
|
|
4392
|
+
_chunkU32IWQZMjs.EmptyState,
|
|
4393
4393
|
{
|
|
4394
4394
|
icon: _lucidereact.PackageIcon,
|
|
4395
4395
|
title: t("billing.admin.products.empty.title"),
|
|
@@ -4404,7 +4404,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, ProductsList, "ProductsList");
|
|
|
4404
4404
|
// src/features/billing/stripe-product/components/containers/ProductsListContainer.tsx
|
|
4405
4405
|
|
|
4406
4406
|
function ProductsListContainer() {
|
|
4407
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductProvider, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4407
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductProvider, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU32IWQZMjs.RoundPageContainer, { module: _chunkMWZCCOTSjs.Modules.StripeProduct, fullWidth: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductsList, { fullWidth: true }) }) });
|
|
4408
4408
|
}
|
|
4409
4409
|
_chunk7QVYU63Ejs.__name.call(void 0, ProductsListContainer, "ProductsListContainer");
|
|
4410
4410
|
|
|
@@ -4462,5 +4462,5 @@ _chunk7QVYU63Ejs.__name.call(void 0, ProductsListContainer, "ProductsListContain
|
|
|
4462
4462
|
|
|
4463
4463
|
|
|
4464
4464
|
|
|
4465
|
-
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 =
|
|
4465
|
+
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 = _chunkU32IWQZMjs.formatCurrency; exports.formatDate = formatDate3; exports.formatInterval = _chunkU32IWQZMjs.formatInterval; exports.isStripeConfigured = isStripeConfigured; exports.priceLabel = priceLabel; exports.usePriceContext = usePriceContext; exports.useProductContext = useProductContext;
|
|
4466
4466
|
//# sourceMappingURL=index.js.map
|