@carlonicora/nextjs-jsonapi 3.3.1 → 3.3.3
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-JLMXCPGB.js → BlockNoteEditor-4LBUVIW6.js} +20 -20
- package/dist/{BlockNoteEditor-JLMXCPGB.js.map → BlockNoteEditor-4LBUVIW6.js.map} +1 -1
- package/dist/{BlockNoteEditor-G5A34EXN.mjs → BlockNoteEditor-CSPPZOZQ.mjs} +5 -5
- package/dist/{JsonApiRequest-2OQCZAK6.mjs → JsonApiRequest-ADNIGXTP.mjs} +2 -2
- package/dist/JsonApiRequest-WWGSGV2I.js +26 -0
- package/dist/{JsonApiRequest-6TYNBVUL.js.map → JsonApiRequest-WWGSGV2I.js.map} +1 -1
- package/dist/billing/index.js +399 -399
- package/dist/billing/index.mjs +4 -4
- package/dist/{chunk-5AKDE5UW.js → chunk-2PEPIH26.js} +941 -938
- package/dist/chunk-2PEPIH26.js.map +1 -0
- package/dist/{chunk-PGARO3JT.mjs → chunk-KW6LYVFJ.mjs} +8 -7
- package/dist/chunk-KW6LYVFJ.mjs.map +1 -0
- package/dist/{chunk-UYENG3GT.js → chunk-OHG2YWNA.js} +22 -27
- package/dist/chunk-OHG2YWNA.js.map +1 -0
- package/dist/{chunk-LCMVARSP.mjs → chunk-RUEY6XSS.mjs} +8 -13
- package/dist/chunk-RUEY6XSS.mjs.map +1 -0
- package/dist/{chunk-CMGXH5SA.mjs → chunk-RVASYIQG.mjs} +47 -3
- package/dist/chunk-RVASYIQG.mjs.map +1 -0
- package/dist/{chunk-YKFXQOQA.js → chunk-S2C5V2XZ.js} +33 -32
- package/dist/chunk-S2C5V2XZ.js.map +1 -0
- package/dist/{chunk-O4LTJAAM.mjs → chunk-SVCOFVQF.mjs} +15 -12
- package/dist/chunk-SVCOFVQF.mjs.map +1 -0
- package/dist/{chunk-PFAZPP54.js → chunk-W42MYR3Y.js} +59 -15
- package/dist/chunk-W42MYR3Y.js.map +1 -0
- package/dist/client/index.js +5 -5
- package/dist/client/index.mjs +4 -4
- package/dist/components/index.js +5 -5
- package/dist/components/index.mjs +4 -4
- package/dist/contexts/index.js +5 -5
- package/dist/contexts/index.mjs +4 -4
- package/dist/core/index.d.mts +59 -1
- package/dist/core/index.d.ts +59 -1
- package/dist/core/index.js +5 -3
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +4 -2
- package/dist/features/help/index.js +38 -38
- package/dist/features/help/index.mjs +4 -4
- package/dist/features/tokenusage/index.js +102 -102
- package/dist/features/tokenusage/index.mjs +4 -4
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -3
- package/dist/server/index.js +15 -14
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +5 -4
- package/dist/server/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/client/JsonApiClient.ts +3 -2
- package/src/client/config.ts +5 -10
- package/src/components/forms/FormPlaceAutocomplete.tsx +2 -1
- package/src/core/env.ts +73 -0
- package/src/core/index.ts +1 -0
- package/src/features/auth/utils/AuthCookies.ts +2 -1
- package/src/features/company/components/forms/CompanyEditor.tsx +2 -3
- package/src/hooks/usePushNotifications.ts +2 -1
- package/src/hooks/useSocket.ts +4 -3
- package/src/server/JsonApiServer.ts +3 -2
- package/src/unified/JsonApiRequest.ts +3 -2
- package/dist/JsonApiRequest-6TYNBVUL.js +0 -26
- package/dist/chunk-5AKDE5UW.js.map +0 -1
- package/dist/chunk-CMGXH5SA.mjs.map +0 -1
- package/dist/chunk-LCMVARSP.mjs.map +0 -1
- package/dist/chunk-O4LTJAAM.mjs.map +0 -1
- package/dist/chunk-PFAZPP54.js.map +0 -1
- package/dist/chunk-PGARO3JT.mjs.map +0 -1
- package/dist/chunk-UYENG3GT.js.map +0 -1
- package/dist/chunk-YKFXQOQA.js.map +0 -1
- /package/dist/{BlockNoteEditor-G5A34EXN.mjs.map → BlockNoteEditor-CSPPZOZQ.mjs.map} +0 -0
- /package/dist/{JsonApiRequest-2OQCZAK6.mjs.map → JsonApiRequest-ADNIGXTP.mjs.map} +0 -0
package/dist/billing/index.js
CHANGED
|
@@ -62,12 +62,12 @@
|
|
|
62
62
|
|
|
63
63
|
|
|
64
64
|
|
|
65
|
-
var
|
|
65
|
+
var _chunk2PEPIH26js = require('../chunk-2PEPIH26.js');
|
|
66
66
|
|
|
67
67
|
|
|
68
68
|
|
|
69
69
|
|
|
70
|
-
var
|
|
70
|
+
var _chunkOHG2YWNAjs = require('../chunk-OHG2YWNA.js');
|
|
71
71
|
|
|
72
72
|
|
|
73
73
|
|
|
@@ -80,10 +80,10 @@ var _chunkUYENG3GTjs = require('../chunk-UYENG3GT.js');
|
|
|
80
80
|
|
|
81
81
|
|
|
82
82
|
|
|
83
|
-
var
|
|
83
|
+
var _chunkS2C5V2XZjs = require('../chunk-S2C5V2XZ.js');
|
|
84
84
|
require('../chunk-LXKSUWAV.js');
|
|
85
85
|
require('../chunk-IBS6NI7D.js');
|
|
86
|
-
require('../chunk-
|
|
86
|
+
require('../chunk-W42MYR3Y.js');
|
|
87
87
|
require('../chunk-3EPNHTMH.js');
|
|
88
88
|
|
|
89
89
|
|
|
@@ -131,41 +131,41 @@ function SubscriptionSummaryCard({
|
|
|
131
131
|
onManageClick
|
|
132
132
|
}) {
|
|
133
133
|
if (loading) {
|
|
134
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
135
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
136
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
134
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.Card, { children: [
|
|
135
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
136
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.CardTitle, { children: "Subscriptions" }),
|
|
137
137
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-4 w-4 text-muted-foreground" })
|
|
138
138
|
] }),
|
|
139
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
140
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
141
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
142
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
139
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.CardContent, { children: [
|
|
140
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Skeleton, { className: "h-6 w-32 mb-2" }),
|
|
141
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Skeleton, { className: "h-4 w-24 mb-1" }),
|
|
142
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Skeleton, { className: "h-4 w-40" })
|
|
143
143
|
] })
|
|
144
144
|
] });
|
|
145
145
|
}
|
|
146
146
|
if (error) {
|
|
147
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
148
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
149
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
147
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.Card, { children: [
|
|
148
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
149
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.CardTitle, { children: "Subscriptions" }),
|
|
150
150
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-4 w-4 text-muted-foreground" })
|
|
151
151
|
] }),
|
|
152
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
152
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
|
|
153
153
|
] });
|
|
154
154
|
}
|
|
155
155
|
const activeSubscriptions = subscriptions.filter(
|
|
156
156
|
(sub) => sub.status === "active" /* ACTIVE */ || sub.status === "trialing" /* TRIALING */
|
|
157
157
|
);
|
|
158
158
|
const primarySubscription = activeSubscriptions[0];
|
|
159
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
160
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
161
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
159
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onManageClick, children: [
|
|
160
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
161
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.CardTitle, { children: "Subscriptions" }),
|
|
162
162
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-4 w-4 text-muted-foreground" })
|
|
163
163
|
] }),
|
|
164
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
164
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.CardContent, { children: subscriptions.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
165
165
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: "No active plan" }),
|
|
166
166
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: "Subscribe to get started" }),
|
|
167
167
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
168
|
-
|
|
168
|
+
_chunk2PEPIH26js.Button,
|
|
169
169
|
{
|
|
170
170
|
variant: "outline",
|
|
171
171
|
size: "sm",
|
|
@@ -184,7 +184,7 @@ function SubscriptionSummaryCard({
|
|
|
184
184
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
|
|
185
185
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold", children: formatPlanName(primarySubscription) }),
|
|
186
186
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
187
|
-
|
|
187
|
+
_chunk2PEPIH26js.Badge,
|
|
188
188
|
{
|
|
189
189
|
variant: primarySubscription.cancelAtPeriodEnd ? "secondary" : getStatusBadgeVariant(primarySubscription.status),
|
|
190
190
|
children: primarySubscription.cancelAtPeriodEnd ? "Canceling" : primarySubscription.status
|
|
@@ -226,37 +226,37 @@ function PaymentMethodSummaryCard({
|
|
|
226
226
|
onManageClick
|
|
227
227
|
}) {
|
|
228
228
|
if (loading) {
|
|
229
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
230
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
231
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
229
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.Card, { children: [
|
|
230
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
231
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.CardTitle, { children: "Payment Method" }),
|
|
232
232
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Wallet, { className: "h-4 w-4 text-muted-foreground" })
|
|
233
233
|
] }),
|
|
234
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
235
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
236
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
234
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.CardContent, { children: [
|
|
235
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Skeleton, { className: "h-6 w-32 mb-2" }),
|
|
236
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Skeleton, { className: "h-4 w-24" })
|
|
237
237
|
] })
|
|
238
238
|
] });
|
|
239
239
|
}
|
|
240
240
|
if (error) {
|
|
241
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
242
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
243
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
241
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.Card, { children: [
|
|
242
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
243
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.CardTitle, { children: "Payment Method" }),
|
|
244
244
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Wallet, { className: "h-4 w-4 text-muted-foreground" })
|
|
245
245
|
] }),
|
|
246
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
246
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
|
|
247
247
|
] });
|
|
248
248
|
}
|
|
249
249
|
const defaultMethod = paymentMethods.find((pm) => pm.id === defaultPaymentMethodId) || paymentMethods[0];
|
|
250
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
251
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
252
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
250
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onManageClick, children: [
|
|
251
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
252
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.CardTitle, { children: "Payment Method" }),
|
|
253
253
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Wallet, { className: "h-4 w-4 text-muted-foreground" })
|
|
254
254
|
] }),
|
|
255
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
255
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.CardContent, { children: paymentMethods.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
256
256
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: "No payment method" }),
|
|
257
257
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: "Add a card to enable subscriptions" }),
|
|
258
258
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
259
|
-
|
|
259
|
+
_chunk2PEPIH26js.Button,
|
|
260
260
|
{
|
|
261
261
|
variant: "outline",
|
|
262
262
|
size: "sm",
|
|
@@ -320,7 +320,7 @@ function CustomerInfoCard({ customer, loading, error }) {
|
|
|
320
320
|
e.stopPropagation();
|
|
321
321
|
setPortalLoading(true);
|
|
322
322
|
try {
|
|
323
|
-
const { url } = await
|
|
323
|
+
const { url } = await _chunkS2C5V2XZjs.StripeCustomerService.createPortalSession();
|
|
324
324
|
window.open(url, "_blank");
|
|
325
325
|
} catch (err) {
|
|
326
326
|
console.error("[CustomerInfoCard] Failed to create portal session:", err);
|
|
@@ -329,52 +329,52 @@ function CustomerInfoCard({ customer, loading, error }) {
|
|
|
329
329
|
}
|
|
330
330
|
}, "handlePortalClick");
|
|
331
331
|
if (loading) {
|
|
332
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
333
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
334
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
332
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.Card, { children: [
|
|
333
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
334
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.CardTitle, { children: "Billing Account" }),
|
|
335
335
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.User, { className: "h-4 w-4 text-muted-foreground" })
|
|
336
336
|
] }),
|
|
337
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
338
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
339
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
340
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
337
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.CardContent, { children: [
|
|
338
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Skeleton, { className: "h-6 w-32 mb-2" }),
|
|
339
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Skeleton, { className: "h-4 w-48 mb-1" }),
|
|
340
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Skeleton, { className: "h-4 w-24" })
|
|
341
341
|
] })
|
|
342
342
|
] });
|
|
343
343
|
}
|
|
344
344
|
if (error) {
|
|
345
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
346
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
347
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
345
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.Card, { children: [
|
|
346
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
347
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.CardTitle, { children: "Billing Account" }),
|
|
348
348
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.User, { className: "h-4 w-4 text-muted-foreground" })
|
|
349
349
|
] }),
|
|
350
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
350
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
|
|
351
351
|
] });
|
|
352
352
|
}
|
|
353
353
|
if (!customer) {
|
|
354
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
355
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
356
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
354
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.Card, { children: [
|
|
355
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
356
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.CardTitle, { children: "Billing Account" }),
|
|
357
357
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.User, { className: "h-4 w-4 text-muted-foreground" })
|
|
358
358
|
] }),
|
|
359
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
359
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.CardContent, { children: [
|
|
360
360
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: "Not set up" }),
|
|
361
361
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: "Billing account will be created when you subscribe" })
|
|
362
362
|
] })
|
|
363
363
|
] });
|
|
364
364
|
}
|
|
365
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
366
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
367
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
365
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.Card, { children: [
|
|
366
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
367
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.CardTitle, { children: "Billing Account" }),
|
|
368
368
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.User, { className: "h-4 w-4 text-muted-foreground" })
|
|
369
369
|
] }),
|
|
370
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
370
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
371
371
|
customer.name && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold", children: customer.name }),
|
|
372
372
|
customer.email && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: customer.email }),
|
|
373
373
|
customer.balance !== void 0 && customer.balance !== 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "text-sm", children: [
|
|
374
374
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground", children: "Credit Balance: " }),
|
|
375
375
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: customer.balance < 0 ? "text-success" : "text-destructive", children: formatBalance(customer.balance, customer.currency) })
|
|
376
376
|
] }),
|
|
377
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
377
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.Button, { variant: "outline", size: "sm", className: "mt-2", onClick: handlePortalClick, disabled: portalLoading, children: [
|
|
378
378
|
portalLoading ? "Loading..." : "Manage in Stripe Portal",
|
|
379
379
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ExternalLink, { className: "h-4 w-4 ml-1" })
|
|
380
380
|
] })
|
|
@@ -418,42 +418,42 @@ function formatAmount(amount, currency) {
|
|
|
418
418
|
_chunk7QVYU63Ejs.__name.call(void 0, formatAmount, "formatAmount");
|
|
419
419
|
function InvoicesSummaryCard({ invoices, loading, error, onViewAllClick }) {
|
|
420
420
|
if (loading) {
|
|
421
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
422
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
423
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
421
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.Card, { children: [
|
|
422
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
423
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.CardTitle, { children: "Recent Invoices" }),
|
|
424
424
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ReceiptIcon, { className: "h-4 w-4 text-muted-foreground" })
|
|
425
425
|
] }),
|
|
426
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
427
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
428
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
429
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
426
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.CardContent, { children: [
|
|
427
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Skeleton, { className: "h-6 w-24 mb-2" }),
|
|
428
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Skeleton, { className: "h-4 w-32 mb-1" }),
|
|
429
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Skeleton, { className: "h-4 w-20" })
|
|
430
430
|
] })
|
|
431
431
|
] });
|
|
432
432
|
}
|
|
433
433
|
if (error) {
|
|
434
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
435
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
436
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
434
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.Card, { children: [
|
|
435
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
436
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.CardTitle, { children: "Recent Invoices" }),
|
|
437
437
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ReceiptIcon, { className: "h-4 w-4 text-muted-foreground" })
|
|
438
438
|
] }),
|
|
439
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
439
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
|
|
440
440
|
] });
|
|
441
441
|
}
|
|
442
442
|
const latestInvoice = invoices[0];
|
|
443
443
|
const paidInvoices = invoices.filter((inv) => inv.status === "paid" /* PAID */);
|
|
444
444
|
const openInvoices = invoices.filter((inv) => inv.status === "open" /* OPEN */);
|
|
445
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
446
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
447
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
445
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onViewAllClick, children: [
|
|
446
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
447
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.CardTitle, { children: "Recent Invoices" }),
|
|
448
448
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ReceiptIcon, { className: "h-4 w-4 text-muted-foreground" })
|
|
449
449
|
] }),
|
|
450
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
450
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.CardContent, { children: invoices.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
451
451
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: "No invoices yet" }),
|
|
452
452
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: "Invoices will appear after your first billing cycle" })
|
|
453
453
|
] }) : latestInvoice ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
454
454
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
|
|
455
455
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold", children: formatAmount(latestInvoice.total, latestInvoice.currency) }),
|
|
456
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
456
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Badge, { variant: getStatusBadgeVariant2(latestInvoice.status), children: latestInvoice.status })
|
|
457
457
|
] }),
|
|
458
458
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: latestInvoice.stripeInvoiceNumber || `Invoice from ${formatDate2(latestInvoice.periodStart)}` }),
|
|
459
459
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-4 text-xs text-muted-foreground", children: [
|
|
@@ -493,24 +493,24 @@ function BillingUsageSummaryCard({
|
|
|
493
493
|
onViewDetailsClick
|
|
494
494
|
}) {
|
|
495
495
|
if (loading) {
|
|
496
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
497
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
498
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
496
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.Card, { children: [
|
|
497
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
498
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.CardTitle, { children: "Usage This Month" }),
|
|
499
499
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Activity, { className: "h-4 w-4 text-muted-foreground" })
|
|
500
500
|
] }),
|
|
501
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
502
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
503
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
501
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.CardContent, { children: [
|
|
502
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Skeleton, { className: "h-6 w-24 mb-2" }),
|
|
503
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Skeleton, { className: "h-4 w-32" })
|
|
504
504
|
] })
|
|
505
505
|
] });
|
|
506
506
|
}
|
|
507
507
|
if (error) {
|
|
508
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
509
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
510
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
508
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.Card, { children: [
|
|
509
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
510
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.CardTitle, { children: "Usage This Month" }),
|
|
511
511
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Activity, { className: "h-4 w-4 text-muted-foreground" })
|
|
512
512
|
] }),
|
|
513
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
513
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
|
|
514
514
|
] });
|
|
515
515
|
}
|
|
516
516
|
const totalUsage = Object.values(summaries).reduce((acc, summary) => {
|
|
@@ -518,12 +518,12 @@ function BillingUsageSummaryCard({
|
|
|
518
518
|
}, 0);
|
|
519
519
|
const primaryMeter = meters.find((m) => _optionalChain([summaries, 'access', _17 => _17[m.id], 'optionalAccess', _18 => _18.aggregatedValue]));
|
|
520
520
|
const primarySummary = primaryMeter ? summaries[primaryMeter.id] : null;
|
|
521
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
522
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
523
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
521
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onViewDetailsClick, children: [
|
|
522
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
523
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.CardTitle, { children: "Usage This Month" }),
|
|
524
524
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Activity, { className: "h-4 w-4 text-muted-foreground" })
|
|
525
525
|
] }),
|
|
526
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
526
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.CardContent, { children: meters.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
527
527
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: "No meters" }),
|
|
528
528
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: "No usage meters are configured" })
|
|
529
529
|
] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
@@ -575,7 +575,7 @@ function PaymentMethodForm({ onSuccess, onCancel, isLoading = false }) {
|
|
|
575
575
|
const fetchSetupIntent = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
576
576
|
setLoading(true);
|
|
577
577
|
try {
|
|
578
|
-
const intent = await
|
|
578
|
+
const intent = await _chunkS2C5V2XZjs.StripeCustomerService.createSetupIntent();
|
|
579
579
|
setSetupIntent(intent);
|
|
580
580
|
} catch (err) {
|
|
581
581
|
console.error("[PaymentMethodForm] Failed to create setup intent:", err);
|
|
@@ -613,7 +613,7 @@ function PaymentMethodForm({ onSuccess, onCancel, isLoading = false }) {
|
|
|
613
613
|
return;
|
|
614
614
|
}
|
|
615
615
|
if (setAsDefault && _optionalChain([confirmedSetupIntent, 'optionalAccess', _19 => _19.payment_method])) {
|
|
616
|
-
await
|
|
616
|
+
await _chunkS2C5V2XZjs.StripeCustomerService.setDefaultPaymentMethod({
|
|
617
617
|
paymentMethodId: typeof confirmedSetupIntent.payment_method === "string" ? confirmedSetupIntent.payment_method : confirmedSetupIntent.payment_method.id
|
|
618
618
|
});
|
|
619
619
|
}
|
|
@@ -629,7 +629,7 @@ function PaymentMethodForm({ onSuccess, onCancel, isLoading = false }) {
|
|
|
629
629
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex items-center justify-center py-8", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground", children: "Loading payment form..." }) });
|
|
630
630
|
}
|
|
631
631
|
if (!setupIntent && error) {
|
|
632
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
632
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Alert, { variant: "destructive", className: "bg-red-50 border-red-200", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.AlertDescription, { children: error }) });
|
|
633
633
|
}
|
|
634
634
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: handleSubmit, className: "flex flex-col gap-y-4", children: [
|
|
635
635
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rounded-md border border-gray-300 p-3", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -652,13 +652,13 @@ function PaymentMethodForm({ onSuccess, onCancel, isLoading = false }) {
|
|
|
652
652
|
}
|
|
653
653
|
) }),
|
|
654
654
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-2", children: [
|
|
655
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
656
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
655
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Checkbox, { id: "setAsDefault", checked: setAsDefault, onCheckedChange: (checked) => setSetAsDefault(!!checked) }),
|
|
656
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Label, { htmlFor: "setAsDefault", className: "cursor-pointer font-normal", children: "Set as default payment method" })
|
|
657
657
|
] }),
|
|
658
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
658
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Alert, { variant: "destructive", className: "bg-red-50 border-red-200", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.AlertDescription, { children: error }) }),
|
|
659
659
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-end gap-x-2", children: [
|
|
660
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
661
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
660
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Button, { type: "button", variant: "outline", onClick: onCancel, disabled: isSubmitting || isLoading, children: "Cancel" }),
|
|
661
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Button, { type: "submit", disabled: !stripe || isSubmitting || isLoading, children: isSubmitting ? "Processing..." : "Add Card" })
|
|
662
662
|
] })
|
|
663
663
|
] });
|
|
664
664
|
}
|
|
@@ -674,10 +674,10 @@ function PaymentMethodEditor({ open, onOpenChange, onSuccess }) {
|
|
|
674
674
|
const handleCancel = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
675
675
|
onOpenChange(false);
|
|
676
676
|
}, "handleCancel");
|
|
677
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
678
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
679
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
680
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
677
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.DialogContent, { className: "max-w-md", children: [
|
|
678
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.DialogHeader, { children: [
|
|
679
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.DialogTitle, { children: "Add Payment Method" }),
|
|
680
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.DialogDescription, { children: "Add a new payment method to your account. Your card information is securely processed by Stripe." })
|
|
681
681
|
] }),
|
|
682
682
|
open && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PaymentMethodForm, { onSuccess: handleSuccess, onCancel: handleCancel })
|
|
683
683
|
] }) });
|
|
@@ -701,7 +701,7 @@ function PaymentMethodCard({ paymentMethod, onUpdate }) {
|
|
|
701
701
|
_react.useEffect.call(void 0, () => {
|
|
702
702
|
const loadCustomer = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
703
703
|
try {
|
|
704
|
-
const fetchedCustomer = await
|
|
704
|
+
const fetchedCustomer = await _chunkS2C5V2XZjs.StripeCustomerService.getCustomer();
|
|
705
705
|
setCustomer(fetchedCustomer);
|
|
706
706
|
} catch (error) {
|
|
707
707
|
console.error("[PaymentMethodCard] Failed to load customer:", error);
|
|
@@ -718,7 +718,7 @@ function PaymentMethodCard({ paymentMethod, onUpdate }) {
|
|
|
718
718
|
const handleSetDefault = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
719
719
|
setLoading(true);
|
|
720
720
|
try {
|
|
721
|
-
await
|
|
721
|
+
await _chunkS2C5V2XZjs.StripeCustomerService.setDefaultPaymentMethod({ paymentMethodId: paymentMethod.id });
|
|
722
722
|
onUpdate();
|
|
723
723
|
} catch (error) {
|
|
724
724
|
console.error("[PaymentMethodCard] Failed to set as default:", error);
|
|
@@ -729,7 +729,7 @@ function PaymentMethodCard({ paymentMethod, onUpdate }) {
|
|
|
729
729
|
const handleRemove = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
730
730
|
setLoading(true);
|
|
731
731
|
try {
|
|
732
|
-
await
|
|
732
|
+
await _chunkS2C5V2XZjs.StripeCustomerService.removePaymentMethod({ paymentMethodId: paymentMethod.id });
|
|
733
733
|
setShowRemoveDialog(false);
|
|
734
734
|
onUpdate();
|
|
735
735
|
} catch (error) {
|
|
@@ -738,16 +738,16 @@ function PaymentMethodCard({ paymentMethod, onUpdate }) {
|
|
|
738
738
|
}
|
|
739
739
|
}, "handleRemove");
|
|
740
740
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
741
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
742
|
-
isDefault && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
743
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
741
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.Card, { className: "relative", children: [
|
|
742
|
+
isDefault && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Badge, { variant: "softGreen", className: "absolute right-2 top-2", children: "Default" }),
|
|
743
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.CardHeader, { className: "flex flex-row items-center justify-between pb-2", children: [
|
|
744
744
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-2", children: [
|
|
745
745
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-2xl", children: brandIcon }),
|
|
746
746
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium capitalize", children: brand })
|
|
747
747
|
] }),
|
|
748
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
749
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
750
|
-
|
|
748
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.DropdownMenu, { children: [
|
|
749
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.DropdownMenuTrigger, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
750
|
+
_chunk2PEPIH26js.Button,
|
|
751
751
|
{
|
|
752
752
|
render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", {}),
|
|
753
753
|
nativeButton: false,
|
|
@@ -758,10 +758,10 @@ function PaymentMethodCard({ paymentMethod, onUpdate }) {
|
|
|
758
758
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.MoreVertical, { className: "h-4 w-4" })
|
|
759
759
|
}
|
|
760
760
|
) }),
|
|
761
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
762
|
-
!isDefault && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
761
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.DropdownMenuContent, { align: "end", children: [
|
|
762
|
+
!isDefault && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.DropdownMenuItem, { onClick: handleSetDefault, disabled: loading, children: "Set as Default" }),
|
|
763
763
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
764
|
-
|
|
764
|
+
_chunk2PEPIH26js.DropdownMenuItem,
|
|
765
765
|
{
|
|
766
766
|
onClick: () => setShowRemoveDialog(true),
|
|
767
767
|
disabled: loading,
|
|
@@ -772,7 +772,7 @@ function PaymentMethodCard({ paymentMethod, onUpdate }) {
|
|
|
772
772
|
] })
|
|
773
773
|
] })
|
|
774
774
|
] }),
|
|
775
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
775
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-1", children: [
|
|
776
776
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "text-lg font-semibold", children: [
|
|
777
777
|
"\u2022\u2022\u2022\u2022 ",
|
|
778
778
|
last4
|
|
@@ -785,17 +785,17 @@ function PaymentMethodCard({ paymentMethod, onUpdate }) {
|
|
|
785
785
|
] })
|
|
786
786
|
] }) })
|
|
787
787
|
] }),
|
|
788
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
789
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
790
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
791
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
788
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.AlertDialog, { open: showRemoveDialog, onOpenChange: setShowRemoveDialog, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.AlertDialogContent, { children: [
|
|
789
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.AlertDialogHeader, { children: [
|
|
790
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.AlertDialogTitle, { children: "Remove Payment Method" }),
|
|
791
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.AlertDialogDescription, { children: [
|
|
792
792
|
"Are you sure you want to remove this payment method? This action cannot be undone.",
|
|
793
793
|
isDefault && " This is your default payment method."
|
|
794
794
|
] })
|
|
795
795
|
] }),
|
|
796
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
797
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
798
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
796
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.AlertDialogFooter, { children: [
|
|
797
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.AlertDialogCancel, { disabled: loading, children: "Cancel" }),
|
|
798
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.AlertDialogAction, { onClick: handleRemove, disabled: loading, className: "bg-red-600 hover:bg-red-700", children: loading ? "Removing..." : "Remove" })
|
|
799
799
|
] })
|
|
800
800
|
] }) })
|
|
801
801
|
] });
|
|
@@ -818,7 +818,7 @@ function PaymentMethodsContainer() {
|
|
|
818
818
|
const loadPaymentMethods = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
819
819
|
setLoading(true);
|
|
820
820
|
try {
|
|
821
|
-
const fetchedPaymentMethods = await
|
|
821
|
+
const fetchedPaymentMethods = await _chunkS2C5V2XZjs.StripeCustomerService.listPaymentMethods();
|
|
822
822
|
setPaymentMethods(fetchedPaymentMethods);
|
|
823
823
|
} catch (error) {
|
|
824
824
|
console.error("[PaymentMethodsContainer] Failed to load payment methods:", error);
|
|
@@ -838,14 +838,14 @@ function PaymentMethodsContainer() {
|
|
|
838
838
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-8 w-8" }),
|
|
839
839
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h1", { className: "text-primary text-3xl font-semibold", children: "Payment Methods" })
|
|
840
840
|
] }),
|
|
841
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
841
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Button, { onClick: () => setShowAddPaymentMethod(true), children: "Add Payment Method" })
|
|
842
842
|
] }),
|
|
843
843
|
paymentMethods.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col items-center justify-center gap-y-4 rounded-lg border-2 border-dashed border-gray-300 bg-muted/50 p-12", children: [
|
|
844
844
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-16 w-16 text-muted-foreground" }),
|
|
845
845
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-center", children: [
|
|
846
846
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "mb-2 text-sm font-medium", children: "No payment methods" }),
|
|
847
847
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "mb-4 text-muted-foreground", children: "Add a payment method to enable subscriptions and secure checkout." }),
|
|
848
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
848
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Button, { onClick: () => setShowAddPaymentMethod(true), children: "Add Your First Card" })
|
|
849
849
|
] })
|
|
850
850
|
] }),
|
|
851
851
|
paymentMethods.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PaymentMethodsList, { paymentMethods, onUpdate: loadPaymentMethods }),
|
|
@@ -913,7 +913,7 @@ var statusConfig = {
|
|
|
913
913
|
};
|
|
914
914
|
function InvoiceStatusBadge({ status }) {
|
|
915
915
|
const config = statusConfig[status] || statusConfig["draft" /* DRAFT */];
|
|
916
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
916
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Badge, { variant: config.variant, children: config.label });
|
|
917
917
|
}
|
|
918
918
|
_chunk7QVYU63Ejs.__name.call(void 0, InvoiceStatusBadge, "InvoiceStatusBadge");
|
|
919
919
|
|
|
@@ -944,13 +944,13 @@ function InvoiceDetails({
|
|
|
944
944
|
return invoice.stripeInvoiceId.slice(-8);
|
|
945
945
|
}, "getInvoiceNumber");
|
|
946
946
|
const productName = _optionalChain([invoice, 'access', _29 => _29.subscription, 'optionalAccess', _30 => _30.price, 'optionalAccess', _31 => _31.product, 'optionalAccess', _32 => _32.name]) || "Subscription";
|
|
947
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
948
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
949
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
947
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.DialogContent, { className: "max-w-2xl", children: [
|
|
948
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.DialogHeader, { children: [
|
|
949
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.DialogTitle, { children: [
|
|
950
950
|
"Invoice ",
|
|
951
951
|
getInvoiceNumber()
|
|
952
952
|
] }),
|
|
953
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
953
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.DialogDescription, { children: formatDate3(invoice.periodStart) })
|
|
954
954
|
] }),
|
|
955
955
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-6", children: [
|
|
956
956
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-3", children: [
|
|
@@ -988,42 +988,42 @@ function InvoiceDetails({
|
|
|
988
988
|
] }) }),
|
|
989
989
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "tbody", { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "tr", { className: "border-t", children: [
|
|
990
990
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { className: "p-3", children: productName }),
|
|
991
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { className: "p-3 text-right", children:
|
|
991
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { className: "p-3 text-right", children: _chunk2PEPIH26js.formatCurrency.call(void 0, invoice.subtotal, invoice.currency) })
|
|
992
992
|
] }) })
|
|
993
993
|
] }) })
|
|
994
994
|
] }),
|
|
995
995
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2 border-t pt-4", children: [
|
|
996
996
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between", children: [
|
|
997
997
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: "Subtotal:" }),
|
|
998
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm", children:
|
|
998
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm", children: _chunk2PEPIH26js.formatCurrency.call(void 0, invoice.subtotal, invoice.currency) })
|
|
999
999
|
] }),
|
|
1000
1000
|
invoice.tax !== void 0 && invoice.tax > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between", children: [
|
|
1001
1001
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: "Tax:" }),
|
|
1002
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm", children:
|
|
1002
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm", children: _chunk2PEPIH26js.formatCurrency.call(void 0, invoice.tax, invoice.currency) })
|
|
1003
1003
|
] }),
|
|
1004
1004
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between text-lg font-semibold border-t pt-2", children: [
|
|
1005
1005
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Total:" }),
|
|
1006
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children:
|
|
1006
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _chunk2PEPIH26js.formatCurrency.call(void 0, invoice.total, invoice.currency) })
|
|
1007
1007
|
] }),
|
|
1008
1008
|
invoice.amountPaid > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between", children: [
|
|
1009
1009
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: "Amount Paid:" }),
|
|
1010
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm text-success", children:
|
|
1010
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm text-success", children: _chunk2PEPIH26js.formatCurrency.call(void 0, invoice.amountPaid, invoice.currency) })
|
|
1011
1011
|
] }),
|
|
1012
1012
|
invoice.amountRemaining > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between", children: [
|
|
1013
1013
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: "Amount Due:" }),
|
|
1014
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm text-destructive", children:
|
|
1014
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm text-destructive", children: _chunk2PEPIH26js.formatCurrency.call(void 0, invoice.amountRemaining, invoice.currency) })
|
|
1015
1015
|
] })
|
|
1016
1016
|
] }),
|
|
1017
1017
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-wrap gap-2 pt-4 border-t", children: [
|
|
1018
|
-
invoice.stripePdfUrl && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1018
|
+
invoice.stripePdfUrl && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.Button, { variant: "outline", onClick: handleDownloadPDF, children: [
|
|
1019
1019
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Download, { className: "mr-2 h-4 w-4" }),
|
|
1020
1020
|
"Download PDF"
|
|
1021
1021
|
] }),
|
|
1022
|
-
invoice.status === "open" /* OPEN */ && invoice.attempted && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1022
|
+
invoice.status === "open" /* OPEN */ && invoice.attempted && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.Button, { variant: "default", onClick: handleRetryPayment, children: [
|
|
1023
1023
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.RefreshCw, { className: "mr-2 h-4 w-4" }),
|
|
1024
1024
|
"Retry Payment"
|
|
1025
1025
|
] }),
|
|
1026
|
-
invoice.stripeHostedInvoiceUrl && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1026
|
+
invoice.stripeHostedInvoiceUrl && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.Button, { variant: "outline", onClick: handleViewInStripe, children: [
|
|
1027
1027
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ExternalLink, { className: "mr-2 h-4 w-4" }),
|
|
1028
1028
|
"View in Stripe"
|
|
1029
1029
|
] })
|
|
@@ -1047,30 +1047,30 @@ function InvoicesList({ invoices, onInvoicesChange }) {
|
|
|
1047
1047
|
return invoice.stripeInvoiceId.slice(-8);
|
|
1048
1048
|
}, "getInvoiceNumber");
|
|
1049
1049
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1050
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border rounded-lg overflow-clip", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1051
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1052
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1053
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1054
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1055
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1056
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1050
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border rounded-lg overflow-clip", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.Table, { children: [
|
|
1051
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TableHeader, { className: "bg-muted", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.TableRow, { children: [
|
|
1052
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TableHead, { children: "Invoice #" }),
|
|
1053
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TableHead, { children: "Date" }),
|
|
1054
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TableHead, { children: "Status" }),
|
|
1055
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TableHead, { className: "text-right", children: "Amount" }),
|
|
1056
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TableHead, { children: "Period" })
|
|
1057
1057
|
] }) }),
|
|
1058
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1058
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TableBody, { children: invoices.map((invoice) => {
|
|
1059
1059
|
const invoiceNumber = getInvoiceNumber(invoice);
|
|
1060
1060
|
const date = formatDate3(invoice.periodStart);
|
|
1061
|
-
const amount =
|
|
1061
|
+
const amount = _chunk2PEPIH26js.formatCurrency.call(void 0, invoice.total, invoice.currency);
|
|
1062
1062
|
const period = `${formatDate3(invoice.periodStart)} - ${formatDate3(invoice.periodEnd)}`;
|
|
1063
1063
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1064
|
-
|
|
1064
|
+
_chunk2PEPIH26js.TableRow,
|
|
1065
1065
|
{
|
|
1066
1066
|
onClick: () => handleRowClick(invoice),
|
|
1067
1067
|
className: "cursor-pointer hover:bg-muted/50",
|
|
1068
1068
|
children: [
|
|
1069
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1070
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1071
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1072
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1073
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1069
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TableCell, { className: "font-medium", children: invoiceNumber }),
|
|
1070
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TableCell, { className: "text-muted-foreground text-xs", children: date }),
|
|
1071
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TableCell, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InvoiceStatusBadge, { status: invoice.status }) }),
|
|
1072
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TableCell, { className: "text-right font-medium", children: amount }),
|
|
1073
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TableCell, { className: "text-muted-foreground text-xs", children: period })
|
|
1074
1074
|
]
|
|
1075
1075
|
},
|
|
1076
1076
|
invoice.id
|
|
@@ -1103,7 +1103,7 @@ function InvoicesContainer() {
|
|
|
1103
1103
|
setLoading(true);
|
|
1104
1104
|
try {
|
|
1105
1105
|
const params = statusFilter !== "all" ? { status: statusFilter } : void 0;
|
|
1106
|
-
const data = await
|
|
1106
|
+
const data = await _chunkS2C5V2XZjs.StripeInvoiceService.listInvoices(params);
|
|
1107
1107
|
setInvoices(data);
|
|
1108
1108
|
} catch (error) {
|
|
1109
1109
|
console.error("[InvoicesContainer] Failed to load invoices:", error);
|
|
@@ -1119,12 +1119,12 @@ function InvoicesContainer() {
|
|
|
1119
1119
|
setStatusFilter(value);
|
|
1120
1120
|
}, "handleFilterChange");
|
|
1121
1121
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-4", children: [
|
|
1122
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1123
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1124
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1125
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1126
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1127
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1122
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Tabs, { value: statusFilter, onValueChange: handleFilterChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.TabsList, { children: [
|
|
1123
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TabsTrigger, { value: "all", children: "All" }),
|
|
1124
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TabsTrigger, { value: "paid" /* PAID */, children: "Paid" }),
|
|
1125
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TabsTrigger, { value: "open" /* OPEN */, children: "Open" }),
|
|
1126
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TabsTrigger, { value: "void" /* VOID */, children: "Void" }),
|
|
1127
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TabsTrigger, { value: "uncollectible" /* UNCOLLECTIBLE */, children: "Uncollectible" })
|
|
1128
1128
|
] }) }),
|
|
1129
1129
|
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-center py-8 text-muted-foreground", children: "Loading invoices..." }),
|
|
1130
1130
|
!loading && invoices.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "border border-dashed border-gray-300 rounded-lg p-8 text-center", children: [
|
|
@@ -1171,7 +1171,7 @@ function CancelSubscriptionDialog({
|
|
|
1171
1171
|
const onSubmit = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async (_values) => {
|
|
1172
1172
|
setIsSubmitting(true);
|
|
1173
1173
|
try {
|
|
1174
|
-
await
|
|
1174
|
+
await _chunkS2C5V2XZjs.StripeSubscriptionService.cancelSubscription({
|
|
1175
1175
|
id: subscription.id,
|
|
1176
1176
|
cancelImmediately: false
|
|
1177
1177
|
});
|
|
@@ -1184,19 +1184,19 @@ function CancelSubscriptionDialog({
|
|
|
1184
1184
|
}
|
|
1185
1185
|
}, "onSubmit");
|
|
1186
1186
|
const periodEndDate = formatDate3(subscription.currentPeriodEnd);
|
|
1187
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1188
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1189
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1190
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1187
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.DialogContent, { className: "max-w-md", children: [
|
|
1188
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.DialogHeader, { children: [
|
|
1189
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.DialogTitle, { children: "Cancel Subscription" }),
|
|
1190
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.DialogDescription, { children: "Are you sure you want to cancel this subscription? This action cannot be undone." })
|
|
1191
1191
|
] }),
|
|
1192
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1192
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Form, { ...form, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: form.handleSubmit(onSubmit), className: "flex flex-col gap-y-4", children: [
|
|
1193
1193
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bg-primary/10 border-primary/30 text-foreground rounded-lg border p-3 text-sm", children: [
|
|
1194
1194
|
"Your subscription will remain active until ",
|
|
1195
1195
|
periodEndDate,
|
|
1196
1196
|
". You can continue using the service until then."
|
|
1197
1197
|
] }),
|
|
1198
1198
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1199
|
-
|
|
1199
|
+
_chunk2PEPIH26js.FormTextarea,
|
|
1200
1200
|
{
|
|
1201
1201
|
form,
|
|
1202
1202
|
id: "reason",
|
|
@@ -1206,8 +1206,8 @@ function CancelSubscriptionDialog({
|
|
|
1206
1206
|
}
|
|
1207
1207
|
),
|
|
1208
1208
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex gap-x-2 justify-end pt-2", children: [
|
|
1209
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1210
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1209
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Button, { type: "button", variant: "outline", onClick: () => onOpenChange(false), disabled: isSubmitting, children: "Keep Subscription" }),
|
|
1210
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Button, { type: "submit", variant: "destructive", disabled: isSubmitting, children: isSubmitting ? "Canceling..." : "Confirm Cancellation" })
|
|
1211
1211
|
] })
|
|
1212
1212
|
] }) })
|
|
1213
1213
|
] }) });
|
|
@@ -1256,7 +1256,7 @@ var cancelingConfig = {
|
|
|
1256
1256
|
};
|
|
1257
1257
|
function SubscriptionStatusBadge({ status, cancelAtPeriodEnd }) {
|
|
1258
1258
|
const config = cancelAtPeriodEnd ? cancelingConfig : statusConfig2[status] || statusConfig2["canceled" /* CANCELED */];
|
|
1259
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1259
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Badge, { variant: config.variant, children: config.label });
|
|
1260
1260
|
}
|
|
1261
1261
|
_chunk7QVYU63Ejs.__name.call(void 0, SubscriptionStatusBadge, "SubscriptionStatusBadge");
|
|
1262
1262
|
|
|
@@ -1283,7 +1283,7 @@ function formatPlanName2(price) {
|
|
|
1283
1283
|
_chunk7QVYU63Ejs.__name.call(void 0, formatPlanName2, "formatPlanName");
|
|
1284
1284
|
function formatBillingAmount(price) {
|
|
1285
1285
|
if (!_optionalChain([price, 'optionalAccess', _37 => _37.unitAmount])) return "N/A";
|
|
1286
|
-
return
|
|
1286
|
+
return _chunk2PEPIH26js.formatCurrency.call(void 0, price.unitAmount, price.currency);
|
|
1287
1287
|
}
|
|
1288
1288
|
_chunk7QVYU63Ejs.__name.call(void 0, formatBillingAmount, "formatBillingAmount");
|
|
1289
1289
|
function SubscriptionDetails({
|
|
@@ -1298,7 +1298,7 @@ function SubscriptionDetails({
|
|
|
1298
1298
|
const handlePause = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
1299
1299
|
setIsProcessing(true);
|
|
1300
1300
|
try {
|
|
1301
|
-
await
|
|
1301
|
+
await _chunkS2C5V2XZjs.StripeSubscriptionService.pauseSubscription({ subscriptionId: subscription.id });
|
|
1302
1302
|
onSubscriptionChange();
|
|
1303
1303
|
} catch (error) {
|
|
1304
1304
|
console.error("[SubscriptionDetails] Failed to pause subscription:", error);
|
|
@@ -1309,7 +1309,7 @@ function SubscriptionDetails({
|
|
|
1309
1309
|
const handleResume = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
1310
1310
|
setIsProcessing(true);
|
|
1311
1311
|
try {
|
|
1312
|
-
await
|
|
1312
|
+
await _chunkS2C5V2XZjs.StripeSubscriptionService.resumeSubscription({ subscriptionId: subscription.id });
|
|
1313
1313
|
onSubscriptionChange();
|
|
1314
1314
|
} catch (error) {
|
|
1315
1315
|
console.error("[SubscriptionDetails] Failed to resume subscription:", error);
|
|
@@ -1319,7 +1319,7 @@ function SubscriptionDetails({
|
|
|
1319
1319
|
}, "handleResume");
|
|
1320
1320
|
const handleManageViaPortal = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
1321
1321
|
try {
|
|
1322
|
-
const { url } = await
|
|
1322
|
+
const { url } = await _chunkS2C5V2XZjs.StripeCustomerService.createPortalSession();
|
|
1323
1323
|
window.open(url, "_blank");
|
|
1324
1324
|
} catch (error) {
|
|
1325
1325
|
console.error("[SubscriptionDetails] Failed to create portal session:", error);
|
|
@@ -1329,10 +1329,10 @@ function SubscriptionDetails({
|
|
|
1329
1329
|
const canResume = subscription.status === "paused" /* PAUSED */;
|
|
1330
1330
|
const canCancel = subscription.status === "active" /* ACTIVE */ || subscription.status === "trialing" /* TRIALING */ || subscription.status === "paused" /* PAUSED */;
|
|
1331
1331
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1332
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1333
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1334
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1335
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1332
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.DialogContent, { className: "max-w-2xl", children: [
|
|
1333
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.DialogHeader, { children: [
|
|
1334
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.DialogTitle, { children: "Subscription Details" }),
|
|
1335
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.DialogDescription, { children: "View and manage your subscription" })
|
|
1336
1336
|
] }),
|
|
1337
1337
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-6", children: [
|
|
1338
1338
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-3", children: [
|
|
@@ -1374,11 +1374,11 @@ function SubscriptionDetails({
|
|
|
1374
1374
|
"."
|
|
1375
1375
|
] }) }),
|
|
1376
1376
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-wrap gap-2 pt-4 border-t", children: [
|
|
1377
|
-
onChangePlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1378
|
-
canPause && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1379
|
-
canResume && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1380
|
-
canCancel && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1381
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1377
|
+
onChangePlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Button, { variant: "default", onClick: () => onChangePlan(subscription), children: "Change Plan" }),
|
|
1378
|
+
canPause && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Button, { variant: "outline", onClick: handlePause, disabled: isProcessing, children: isProcessing ? "Pausing..." : "Pause" }),
|
|
1379
|
+
canResume && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Button, { variant: "outline", onClick: handleResume, disabled: isProcessing, children: isProcessing ? "Resuming..." : "Resume" }),
|
|
1380
|
+
canCancel && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Button, { variant: "destructive", onClick: () => setShowCancel(true), children: "Cancel" }),
|
|
1381
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Button, { variant: "outline", onClick: handleManageViaPortal, children: "Manage via Portal" })
|
|
1382
1382
|
] })
|
|
1383
1383
|
] })
|
|
1384
1384
|
] }) }),
|
|
@@ -1425,36 +1425,36 @@ function SubscriptionsList({ subscriptions, onSubscriptionsChange, onChangePlan
|
|
|
1425
1425
|
setSelectedSub(subscription);
|
|
1426
1426
|
}, "handleRowClick");
|
|
1427
1427
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1428
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border rounded-lg overflow-clip", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1429
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1430
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1431
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1432
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1433
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1434
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1428
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border rounded-lg overflow-clip", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.Table, { children: [
|
|
1429
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TableHeader, { className: "bg-muted", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.TableRow, { children: [
|
|
1430
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TableHead, { children: "Status" }),
|
|
1431
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TableHead, { children: "Plan" }),
|
|
1432
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TableHead, { children: "Period" }),
|
|
1433
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TableHead, { className: "text-right", children: "Amount" }),
|
|
1434
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TableHead, { className: "text-right", children: "Actions" })
|
|
1435
1435
|
] }) }),
|
|
1436
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1436
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TableBody, { children: subscriptions.map((subscription) => {
|
|
1437
1437
|
const price = subscription.price;
|
|
1438
|
-
const amount = _optionalChain([price, 'optionalAccess', _42 => _42.unitAmount]) ?
|
|
1438
|
+
const amount = _optionalChain([price, 'optionalAccess', _42 => _42.unitAmount]) ? _chunk2PEPIH26js.formatCurrency.call(void 0, price.unitAmount, price.currency) : "0";
|
|
1439
1439
|
const period = `${formatDate3(subscription.currentPeriodStart)} - ${formatDate3(subscription.currentPeriodEnd)}`;
|
|
1440
1440
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1441
|
-
|
|
1441
|
+
_chunk2PEPIH26js.TableRow,
|
|
1442
1442
|
{
|
|
1443
1443
|
onClick: () => handleRowClick(subscription),
|
|
1444
1444
|
className: "cursor-pointer hover:bg-muted/50",
|
|
1445
1445
|
children: [
|
|
1446
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1446
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TableCell, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1447
1447
|
SubscriptionStatusBadge,
|
|
1448
1448
|
{
|
|
1449
1449
|
status: subscription.status,
|
|
1450
1450
|
cancelAtPeriodEnd: subscription.cancelAtPeriodEnd
|
|
1451
1451
|
}
|
|
1452
1452
|
) }),
|
|
1453
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1454
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1455
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1456
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1457
|
-
|
|
1453
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TableCell, { className: "font-medium", children: formatPlanName3(price) }),
|
|
1454
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TableCell, { className: "text-muted-foreground text-sm", children: period }),
|
|
1455
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TableCell, { className: "text-right font-medium", children: amount }),
|
|
1456
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TableCell, { className: "text-right", children: (subscription.status === "active" /* ACTIVE */ || subscription.status === "trialing" /* TRIALING */) && onChangePlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1457
|
+
_chunk2PEPIH26js.Button,
|
|
1458
1458
|
{
|
|
1459
1459
|
size: "sm",
|
|
1460
1460
|
variant: "outline",
|
|
@@ -1499,7 +1499,7 @@ function SubscriptionsContainer({ onOpenWizard, hasActiveRecurringSubscription }
|
|
|
1499
1499
|
const loadSubscriptions = _react.useCallback.call(void 0, async () => {
|
|
1500
1500
|
setLoading(true);
|
|
1501
1501
|
try {
|
|
1502
|
-
const fetchedSubscriptions = await
|
|
1502
|
+
const fetchedSubscriptions = await _chunkS2C5V2XZjs.StripeSubscriptionService.listSubscriptions();
|
|
1503
1503
|
setSubscriptions(fetchedSubscriptions);
|
|
1504
1504
|
} catch (error) {
|
|
1505
1505
|
console.error("[SubscriptionsContainer] Failed to load subscriptions:", error);
|
|
@@ -1522,7 +1522,7 @@ function SubscriptionsContainer({ onOpenWizard, hasActiveRecurringSubscription }
|
|
|
1522
1522
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-8 w-8" }),
|
|
1523
1523
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h1", { className: "text-primary text-3xl font-semibold", children: "Subscriptions" })
|
|
1524
1524
|
] }),
|
|
1525
|
-
subscriptions.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1525
|
+
subscriptions.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Button, { onClick: () => _optionalChain([onOpenWizard, 'optionalCall', _43 => _43()]), children: hasActiveRecurringSubscription ? "Purchase Add-ons" : "Subscribe to a Plan" })
|
|
1526
1526
|
] }),
|
|
1527
1527
|
criticalSubscriptions.map((subscription) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BillingAlertBanner, { subscription }, subscription.id)),
|
|
1528
1528
|
subscriptions.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col items-center justify-center py-12 space-y-4", children: [
|
|
@@ -1530,7 +1530,7 @@ function SubscriptionsContainer({ onOpenWizard, hasActiveRecurringSubscription }
|
|
|
1530
1530
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-center", children: [
|
|
1531
1531
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-sm font-medium mb-2", children: "No Active Subscriptions" }),
|
|
1532
1532
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground mb-6", children: "Choose a subscription plan to get started with our services." }),
|
|
1533
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1533
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Button, { onClick: () => _optionalChain([onOpenWizard, 'optionalCall', _44 => _44()]), children: "Subscribe to a Plan" })
|
|
1534
1534
|
] })
|
|
1535
1535
|
] }),
|
|
1536
1536
|
subscriptions.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1551,9 +1551,9 @@ function IntervalToggle({ value, onChange, hasMonthly, hasYearly }) {
|
|
|
1551
1551
|
if (!hasMonthly || !hasYearly) {
|
|
1552
1552
|
return null;
|
|
1553
1553
|
}
|
|
1554
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1555
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1556
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1554
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Tabs, { value, onValueChange: (v) => onChange(v), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.TabsList, { children: [
|
|
1555
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TabsTrigger, { value: "month", children: "Monthly" }),
|
|
1556
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TabsTrigger, { value: "year", children: "Yearly" })
|
|
1557
1557
|
] }) });
|
|
1558
1558
|
}
|
|
1559
1559
|
_chunk7QVYU63Ejs.__name.call(void 0, IntervalToggle, "IntervalToggle");
|
|
@@ -1571,8 +1571,8 @@ function PricingCard({
|
|
|
1571
1571
|
}) {
|
|
1572
1572
|
const description = price.description || price.nickname || "Standard";
|
|
1573
1573
|
const features = price.features || [];
|
|
1574
|
-
const formattedPrice =
|
|
1575
|
-
const interval =
|
|
1574
|
+
const formattedPrice = _chunk2PEPIH26js.formatCurrency.call(void 0, price.unitAmount, price.currency);
|
|
1575
|
+
const interval = _chunk2PEPIH26js.formatInterval.call(void 0, price);
|
|
1576
1576
|
const handleKeyDown = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (e) => {
|
|
1577
1577
|
if ((e.key === "Enter" || e.key === " ") && !isDisabled && !isCurrentPlan) {
|
|
1578
1578
|
e.preventDefault();
|
|
@@ -1585,7 +1585,7 @@ function PricingCard({
|
|
|
1585
1585
|
}
|
|
1586
1586
|
}, "handleClick");
|
|
1587
1587
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1588
|
-
|
|
1588
|
+
_chunk2PEPIH26js.Card,
|
|
1589
1589
|
{
|
|
1590
1590
|
role: "radio",
|
|
1591
1591
|
"aria-checked": isSelected,
|
|
@@ -1593,7 +1593,7 @@ function PricingCard({
|
|
|
1593
1593
|
tabIndex: isDisabled ? -1 : 0,
|
|
1594
1594
|
onKeyDown: handleKeyDown,
|
|
1595
1595
|
onClick: handleClick,
|
|
1596
|
-
className:
|
|
1596
|
+
className: _chunkS2C5V2XZjs.cn.call(void 0,
|
|
1597
1597
|
"relative cursor-pointer transition-all duration-200 flex flex-col h-full",
|
|
1598
1598
|
"focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
1599
1599
|
isCurrentPlan && "bg-muted/30",
|
|
@@ -1603,9 +1603,9 @@ function PricingCard({
|
|
|
1603
1603
|
isLoading && "pointer-events-none"
|
|
1604
1604
|
),
|
|
1605
1605
|
children: [
|
|
1606
|
-
isCurrentPlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1607
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1608
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1606
|
+
isCurrentPlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Badge, { variant: "secondary", className: "absolute top-2 right-2", children: "Current" }),
|
|
1607
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.CardHeader, { className: "pb-2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-sm font-medium", children: description }) }),
|
|
1608
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.CardContent, { className: "pb-4 grow", children: [
|
|
1609
1609
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mb-4", children: [
|
|
1610
1610
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-3xl font-bold", children: formattedPrice }),
|
|
1611
1611
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground ml-1", children: interval })
|
|
@@ -1615,8 +1615,8 @@ function PricingCard({
|
|
|
1615
1615
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm text-muted-foreground", children: feature })
|
|
1616
1616
|
] }, index)) })
|
|
1617
1617
|
] }),
|
|
1618
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1619
|
-
|
|
1618
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.CardFooter, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1619
|
+
_chunk2PEPIH26js.Button,
|
|
1620
1620
|
{
|
|
1621
1621
|
variant: isCurrentPlan ? "secondary" : isSelected ? "default" : "outline",
|
|
1622
1622
|
className: "w-full",
|
|
@@ -1644,7 +1644,7 @@ function ProductPricingRow({
|
|
|
1644
1644
|
return null;
|
|
1645
1645
|
}
|
|
1646
1646
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-3", children: [
|
|
1647
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1647
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.SectionHeader, { children: product.name }),
|
|
1648
1648
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1649
1649
|
"div",
|
|
1650
1650
|
{
|
|
@@ -1744,15 +1744,15 @@ function ProductPricingList({
|
|
|
1744
1744
|
_chunk7QVYU63Ejs.__name.call(void 0, ProductPricingList, "ProductPricingList");
|
|
1745
1745
|
function ProductPricingListSkeleton() {
|
|
1746
1746
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "space-y-6", children: [1, 2].map((rowIndex) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-3", children: [
|
|
1747
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1747
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Skeleton, { className: "h-6 w-32" }),
|
|
1748
1748
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4", children: [1, 2, 3].map((cardIndex) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "p-4 rounded-lg border animate-pulse space-y-3", children: [
|
|
1749
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1750
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1749
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Skeleton, { className: "h-6 w-24" }),
|
|
1750
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Skeleton, { className: "h-8 w-32" }),
|
|
1751
1751
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
1752
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1753
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1752
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Skeleton, { className: "h-4 w-full" }),
|
|
1753
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Skeleton, { className: "h-4 w-3/4" })
|
|
1754
1754
|
] }),
|
|
1755
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1755
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Skeleton, { className: "h-10 w-full" })
|
|
1756
1756
|
] }, cardIndex)) })
|
|
1757
1757
|
] }, rowIndex)) });
|
|
1758
1758
|
}
|
|
@@ -1766,18 +1766,18 @@ function ProrationPreview({ preview }) {
|
|
|
1766
1766
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
1767
1767
|
preview.lineItems.map((item, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between text-sm", children: [
|
|
1768
1768
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground", children: item.description }),
|
|
1769
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `font-medium ${item.amount < 0 ? "text-success" : "text-foreground"}`, children:
|
|
1769
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `font-medium ${item.amount < 0 ? "text-success" : "text-foreground"}`, children: _chunk2PEPIH26js.formatCurrency.call(void 0, item.amount, preview.currency) })
|
|
1770
1770
|
] }, index)),
|
|
1771
1771
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border-primary/30 mt-2 border-t pt-2", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between font-semibold", children: [
|
|
1772
1772
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-foreground", children: "Net Due Today" }),
|
|
1773
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-foreground", children:
|
|
1773
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-foreground", children: _chunk2PEPIH26js.formatCurrency.call(void 0, preview.immediateCharge, preview.currency) })
|
|
1774
1774
|
] }) }),
|
|
1775
1775
|
preview.lineItems.length > 0 && preview.lineItems[0].period && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-muted-foreground mt-2 text-xs", children: [
|
|
1776
1776
|
"Next invoice on ",
|
|
1777
1777
|
formatDate3(preview.lineItems[0].period.end),
|
|
1778
1778
|
" for",
|
|
1779
1779
|
" ",
|
|
1780
|
-
|
|
1780
|
+
_chunk2PEPIH26js.formatCurrency.call(void 0, preview.amountDue, preview.currency)
|
|
1781
1781
|
] })
|
|
1782
1782
|
] })
|
|
1783
1783
|
] });
|
|
@@ -1799,16 +1799,16 @@ function SubscriptionConfirmation({ price, isLoading, onConfirm, onCancel }) {
|
|
|
1799
1799
|
productDescription && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-sm text-muted-foreground", children: productDescription })
|
|
1800
1800
|
] }),
|
|
1801
1801
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-lg font-semibold", children: [
|
|
1802
|
-
|
|
1803
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-normal text-muted-foreground", children:
|
|
1802
|
+
_chunk2PEPIH26js.formatCurrency.call(void 0, price.unitAmount, price.currency),
|
|
1803
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-normal text-muted-foreground", children: _chunk2PEPIH26js.formatInterval.call(void 0, price) })
|
|
1804
1804
|
] }),
|
|
1805
1805
|
features.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "space-y-1", children: features.map((feature, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2 text-sm ", children: [
|
|
1806
1806
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Check, { className: "h-4 w-4 text-primary" }),
|
|
1807
1807
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: feature })
|
|
1808
1808
|
] }, index)) }),
|
|
1809
1809
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-end gap-3 pt-2 border-t border-accent/30", children: [
|
|
1810
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1811
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1810
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Button, { variant: "outline", onClick: onCancel, disabled: isLoading, children: "Cancel" }),
|
|
1811
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Button, { onClick: onConfirm, disabled: isLoading, children: isLoading ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1812
1812
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Loader2, { className: "h-4 w-4 animate-spin mr-2" }),
|
|
1813
1813
|
"Processing..."
|
|
1814
1814
|
] }) : "Subscribe" })
|
|
@@ -1879,7 +1879,7 @@ function useSubscriptionWizard({ subscription, onSuccess, onClose }) {
|
|
|
1879
1879
|
onCloseRef.current = onClose;
|
|
1880
1880
|
const checkPaymentMethod = _react.useCallback.call(void 0, async () => {
|
|
1881
1881
|
try {
|
|
1882
|
-
const methods = await
|
|
1882
|
+
const methods = await _chunkS2C5V2XZjs.StripeCustomerService.listPaymentMethods();
|
|
1883
1883
|
dispatch({ type: "SET_HAS_PAYMENT_METHOD", hasMethod: methods.length > 0 });
|
|
1884
1884
|
} catch (error) {
|
|
1885
1885
|
console.error("[useSubscriptionWizard] Failed to check payment methods:", error);
|
|
@@ -1903,7 +1903,7 @@ function useSubscriptionWizard({ subscription, onSuccess, onClose }) {
|
|
|
1903
1903
|
const isTrialUpgrade = _optionalChain([subscription, 'optionalAccess', _55 => _55.status]) === "trialing" /* TRIALING */;
|
|
1904
1904
|
dispatch({ type: "SET_IS_TRIAL_SUBSCRIPTION", isTrial: isTrialUpgrade });
|
|
1905
1905
|
if (isTrialUpgrade && !state.hasPaymentMethod) {
|
|
1906
|
-
const methods = await
|
|
1906
|
+
const methods = await _chunkS2C5V2XZjs.StripeCustomerService.listPaymentMethods();
|
|
1907
1907
|
if (methods.length === 0) {
|
|
1908
1908
|
dispatch({ type: "SET_STEP", step: "payment-method" });
|
|
1909
1909
|
dispatch({
|
|
@@ -1914,7 +1914,7 @@ function useSubscriptionWizard({ subscription, onSuccess, onClose }) {
|
|
|
1914
1914
|
}
|
|
1915
1915
|
}
|
|
1916
1916
|
if (subscription && state.selectedPrice.id !== _optionalChain([subscription, 'access', _56 => _56.price, 'optionalAccess', _57 => _57.id])) {
|
|
1917
|
-
const preview = await
|
|
1917
|
+
const preview = await _chunkS2C5V2XZjs.StripeSubscriptionService.getProrationPreview({
|
|
1918
1918
|
subscriptionId: subscription.id,
|
|
1919
1919
|
newPriceId: state.selectedPrice.id
|
|
1920
1920
|
});
|
|
@@ -1939,14 +1939,14 @@ function useSubscriptionWizard({ subscription, onSuccess, onClose }) {
|
|
|
1939
1939
|
newPriceId: state.selectedPrice.id,
|
|
1940
1940
|
promotionCode: _optionalChain([state, 'access', _59 => _59.promotionCode, 'optionalAccess', _60 => _60.promotionCodeId])
|
|
1941
1941
|
};
|
|
1942
|
-
await
|
|
1942
|
+
await _chunkS2C5V2XZjs.StripeSubscriptionService.changePlan(changePlanParams);
|
|
1943
1943
|
} else {
|
|
1944
1944
|
const createParams = {
|
|
1945
1945
|
id: _uuid.v4.call(void 0, ),
|
|
1946
1946
|
priceId: state.selectedPrice.id,
|
|
1947
1947
|
promotionCode: _optionalChain([state, 'access', _61 => _61.promotionCode, 'optionalAccess', _62 => _62.promotionCodeId])
|
|
1948
1948
|
};
|
|
1949
|
-
await
|
|
1949
|
+
await _chunkS2C5V2XZjs.StripeSubscriptionService.createSubscription(createParams);
|
|
1950
1950
|
}
|
|
1951
1951
|
onSuccessRef.current();
|
|
1952
1952
|
onCloseRef.current();
|
|
@@ -1980,7 +1980,7 @@ function useSubscriptionWizard({ subscription, onSuccess, onClose }) {
|
|
|
1980
1980
|
dispatch({ type: "SET_VALIDATING_PROMO_CODE", isValidating: true });
|
|
1981
1981
|
dispatch({ type: "SET_PROMO_CODE_ERROR", error: null });
|
|
1982
1982
|
try {
|
|
1983
|
-
const result = await
|
|
1983
|
+
const result = await _chunkS2C5V2XZjs.StripePromotionCodeService.validatePromotionCode({
|
|
1984
1984
|
code,
|
|
1985
1985
|
stripePriceId: _optionalChain([state, 'access', _70 => _70.selectedPrice, 'optionalAccess', _71 => _71.id])
|
|
1986
1986
|
});
|
|
@@ -2087,7 +2087,7 @@ function WizardStepPlanSelection({
|
|
|
2087
2087
|
_react.useEffect.call(void 0, () => {
|
|
2088
2088
|
const loadProducts = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
2089
2089
|
try {
|
|
2090
|
-
const fetchedProducts = await
|
|
2090
|
+
const fetchedProducts = await _chunkS2C5V2XZjs.StripeProductService.listProducts({ active: true });
|
|
2091
2091
|
setProducts(fetchedProducts);
|
|
2092
2092
|
} catch (error) {
|
|
2093
2093
|
console.error("[WizardStepPlanSelection] Failed to load products:", error);
|
|
@@ -2138,7 +2138,7 @@ function WizardStepPlanSelection({
|
|
|
2138
2138
|
onSelectPrice: handleSelectPrice
|
|
2139
2139
|
}
|
|
2140
2140
|
),
|
|
2141
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex justify-end pt-4 border-t", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2141
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex justify-end pt-4 border-t", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Button, { onClick: onNext, disabled: !selectedPrice || isProcessing, children: isProcessing ? "Loading..." : "Next: Review" }) })
|
|
2142
2142
|
] });
|
|
2143
2143
|
}
|
|
2144
2144
|
_chunk7QVYU63Ejs.__name.call(void 0, WizardStepPlanSelection, "WizardStepPlanSelection");
|
|
@@ -2199,7 +2199,7 @@ function PromoCodeInput({
|
|
|
2199
2199
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-success text-sm", children: formatDiscount(appliedCode) })
|
|
2200
2200
|
] }),
|
|
2201
2201
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2202
|
-
|
|
2202
|
+
_chunk2PEPIH26js.Button,
|
|
2203
2203
|
{
|
|
2204
2204
|
variant: "ghost",
|
|
2205
2205
|
size: "sm",
|
|
@@ -2216,7 +2216,7 @@ function PromoCodeInput({
|
|
|
2216
2216
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
2217
2217
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex gap-2", children: [
|
|
2218
2218
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2219
|
-
|
|
2219
|
+
_chunk2PEPIH26js.Input,
|
|
2220
2220
|
{
|
|
2221
2221
|
placeholder: "Enter promo code",
|
|
2222
2222
|
value: code,
|
|
@@ -2226,7 +2226,7 @@ function PromoCodeInput({
|
|
|
2226
2226
|
className: "flex-1"
|
|
2227
2227
|
}
|
|
2228
2228
|
),
|
|
2229
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2229
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Button, { variant: "outline", onClick: handleApply, disabled: disabled || isValidating || !code.trim(), children: isValidating ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Loader2, { className: "h-4 w-4 animate-spin" }) : "Apply" })
|
|
2230
2230
|
] }),
|
|
2231
2231
|
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error })
|
|
2232
2232
|
] });
|
|
@@ -2291,14 +2291,14 @@ function WizardStepReview({
|
|
|
2291
2291
|
return `${promotionCode.discountValue}% off`;
|
|
2292
2292
|
}
|
|
2293
2293
|
if (promotionCode.discountType === "amount_off" && promotionCode.discountValue) {
|
|
2294
|
-
return `${
|
|
2294
|
+
return `${_chunk2PEPIH26js.formatCurrency.call(void 0, promotionCode.discountValue, promotionCode.currency || selectedPrice.currency)} off`;
|
|
2295
2295
|
}
|
|
2296
2296
|
return null;
|
|
2297
2297
|
}, "getDiscountDescription");
|
|
2298
2298
|
const discountDescription = getDiscountDescription();
|
|
2299
2299
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-6", children: [
|
|
2300
2300
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bg-muted/50 rounded-lg p-4 space-y-3", children: [
|
|
2301
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2301
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.SectionHeader, { children: "Selected Plan" }),
|
|
2302
2302
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between items-center", children: [
|
|
2303
2303
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
|
|
2304
2304
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "font-medium", children: _optionalChain([selectedPrice, 'access', _92 => _92.product, 'optionalAccess', _93 => _93.name]) }),
|
|
@@ -2306,10 +2306,10 @@ function WizardStepReview({
|
|
|
2306
2306
|
] }),
|
|
2307
2307
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-right", children: [
|
|
2308
2308
|
discountedPrice !== null ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2309
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground line-through", children:
|
|
2310
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-success text-lg font-semibold", children:
|
|
2311
|
-
discountDescription && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2312
|
-
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "font-semibold text-lg", children:
|
|
2309
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground line-through", children: _chunk2PEPIH26js.formatCurrency.call(void 0, selectedPrice.unitAmount || 0, selectedPrice.currency) }),
|
|
2310
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-success text-lg font-semibold", children: _chunk2PEPIH26js.formatCurrency.call(void 0, discountedPrice, selectedPrice.currency) }),
|
|
2311
|
+
discountDescription && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Badge, { variant: "softGreen", children: discountDescription })
|
|
2312
|
+
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "font-semibold text-lg", children: _chunk2PEPIH26js.formatCurrency.call(void 0, selectedPrice.unitAmount || 0, selectedPrice.currency) }),
|
|
2313
2313
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: formatInterval2(selectedPrice) })
|
|
2314
2314
|
] })
|
|
2315
2315
|
] })
|
|
@@ -2324,9 +2324,9 @@ function WizardStepReview({
|
|
|
2324
2324
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between text-sm", children: [
|
|
2325
2325
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `${isTrialUpgrade ? "text-warning" : "text-muted-foreground"}`, children: isTrialUpgrade ? "Amount to charge now:" : "Amount due now:" }),
|
|
2326
2326
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `font-medium ${isTrialUpgrade ? "text-warning" : "text-foreground"}`, children: discountedImmediateCharge !== null ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2327
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "line-through text-muted-foreground mr-2", children:
|
|
2328
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-success", children:
|
|
2329
|
-
] }) :
|
|
2327
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "line-through text-muted-foreground mr-2", children: _chunk2PEPIH26js.formatCurrency.call(void 0, prorationPreview.immediateCharge, prorationPreview.currency) }),
|
|
2328
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-success", children: _chunk2PEPIH26js.formatCurrency.call(void 0, discountedImmediateCharge, prorationPreview.currency) })
|
|
2329
|
+
] }) : _chunk2PEPIH26js.formatCurrency.call(void 0, prorationPreview.immediateCharge, prorationPreview.currency) })
|
|
2330
2330
|
] })
|
|
2331
2331
|
]
|
|
2332
2332
|
}
|
|
@@ -2350,15 +2350,15 @@ function WizardStepReview({
|
|
|
2350
2350
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h4", { className: "font-medium", children: "Payment Method" }),
|
|
2351
2351
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: hasPaymentMethod ? "A payment method is on file" : "No payment method on file" })
|
|
2352
2352
|
] }),
|
|
2353
|
-
!hasPaymentMethod && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2353
|
+
!hasPaymentMethod && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Button, { variant: "outline", onClick: onAddPaymentMethod, children: "Add Payment Method" })
|
|
2354
2354
|
] }) }),
|
|
2355
|
-
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2355
|
+
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.Alert, { variant: "destructive", children: [
|
|
2356
2356
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.AlertCircle, { className: "h-4 w-4" }),
|
|
2357
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2357
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.AlertDescription, { children: error })
|
|
2358
2358
|
] }),
|
|
2359
2359
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between pt-4 border-t", children: [
|
|
2360
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2361
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2360
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Button, { variant: "outline", onClick: onBack, disabled: isProcessing, children: "Back" }),
|
|
2361
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Button, { onClick: hasPaymentMethod ? onConfirm : onAddPaymentMethod, disabled: isProcessing, children: isProcessing ? "Processing..." : hasPaymentMethod ? isChangingPlan ? "Confirm Plan Change" : "Subscribe Now" : "Add Payment Method" })
|
|
2362
2362
|
] })
|
|
2363
2363
|
] });
|
|
2364
2364
|
}
|
|
@@ -2369,7 +2369,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, WizardStepReview, "WizardStepReview");
|
|
|
2369
2369
|
function WizardStepPaymentMethod({ onBack, onSuccess, isProcessing }) {
|
|
2370
2370
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-6", children: [
|
|
2371
2371
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-center", children: [
|
|
2372
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2372
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.SectionHeader, { children: "Add Payment Method" }),
|
|
2373
2373
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: "Enter your card details to complete your subscription" })
|
|
2374
2374
|
] }),
|
|
2375
2375
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, PaymentMethodForm, { onSuccess, onCancel: onBack, isLoading: isProcessing })
|
|
@@ -2411,10 +2411,10 @@ function SubscriptionWizard({
|
|
|
2411
2411
|
const isChangePlanMode = !!subscription;
|
|
2412
2412
|
const dialogTitle = subscription ? "Change Subscription Plan" : isPurchasingAddons ? "Purchase Add-ons" : "Subscribe to a Plan";
|
|
2413
2413
|
const dialogDescription = subscription ? "Select a new plan for your subscription" : isPurchasingAddons ? "Select one-time products to purchase" : "Choose a subscription plan to get started";
|
|
2414
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2415
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2416
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2417
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2414
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.DialogContent, { className: "max-w-2xl", children: [
|
|
2415
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.DialogHeader, { children: [
|
|
2416
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.DialogTitle, { children: dialogTitle }),
|
|
2417
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.DialogDescription, { children: dialogDescription })
|
|
2418
2418
|
] }),
|
|
2419
2419
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, WizardProgressIndicator, { currentStep: state.step }),
|
|
2420
2420
|
state.step === "plan-selection" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -2497,15 +2497,15 @@ function UsageSummaryCard({ meter, summary }) {
|
|
|
2497
2497
|
const progressWidth = percentage !== null ? Math.min(percentage, 100) : 0;
|
|
2498
2498
|
const displayName = meter.displayName || meter.eventName;
|
|
2499
2499
|
const hasLimit = limit !== null && limit !== void 0;
|
|
2500
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2501
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2500
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.Card, { children: [
|
|
2501
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.CardHeader, { className: "flex flex-row items-center gap-x-3 pb-3", children: [
|
|
2502
2502
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex h-10 w-10 items-center justify-center rounded-lg bg-blue-100 text-blue-600", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Activity, { className: "h-5 w-5" }) }),
|
|
2503
2503
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col", children: [
|
|
2504
2504
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-sm font-medium", children: displayName }),
|
|
2505
2505
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground text-xs", children: meter.id })
|
|
2506
2506
|
] })
|
|
2507
2507
|
] }),
|
|
2508
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2508
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.CardContent, { className: "flex flex-col gap-y-4", children: [
|
|
2509
2509
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
|
|
2510
2510
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-3xl font-bold", children: currentUsage.toLocaleString() }),
|
|
2511
2511
|
hasLimit && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "text-muted-foreground text-sm", children: [
|
|
@@ -2552,14 +2552,14 @@ function UsageContainer() {
|
|
|
2552
2552
|
const loadUsageData = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
2553
2553
|
setLoading(true);
|
|
2554
2554
|
try {
|
|
2555
|
-
const fetchedSubscriptions = await
|
|
2555
|
+
const fetchedSubscriptions = await _chunkS2C5V2XZjs.StripeSubscriptionService.listSubscriptions();
|
|
2556
2556
|
setSubscriptions(fetchedSubscriptions);
|
|
2557
2557
|
const hasMeteredSubscriptions2 = fetchedSubscriptions.some((sub) => _optionalChain([sub, 'access', _99 => _99.price, 'optionalAccess', _100 => _100.recurring, 'optionalAccess', _101 => _101.usageType]) === "metered");
|
|
2558
2558
|
if (!hasMeteredSubscriptions2) {
|
|
2559
2559
|
setLoading(false);
|
|
2560
2560
|
return;
|
|
2561
2561
|
}
|
|
2562
|
-
const fetchedMeters = await
|
|
2562
|
+
const fetchedMeters = await _chunkS2C5V2XZjs.StripeUsageService.listMeters();
|
|
2563
2563
|
setMeters(fetchedMeters);
|
|
2564
2564
|
const summariesMap = {};
|
|
2565
2565
|
const now = /* @__PURE__ */ new Date();
|
|
@@ -2567,7 +2567,7 @@ function UsageContainer() {
|
|
|
2567
2567
|
const endOfMonth = new Date(now.getFullYear(), now.getMonth() + 1, 0, 23, 59, 59, 999);
|
|
2568
2568
|
for (const meter of fetchedMeters) {
|
|
2569
2569
|
try {
|
|
2570
|
-
const meterSummaries = await
|
|
2570
|
+
const meterSummaries = await _chunkS2C5V2XZjs.StripeUsageService.getMeterSummaries({
|
|
2571
2571
|
meterId: meter.id,
|
|
2572
2572
|
startTime: startOfMonth,
|
|
2573
2573
|
endTime: endOfMonth
|
|
@@ -2632,22 +2632,22 @@ function UsageHistoryTable({ usageRecords }) {
|
|
|
2632
2632
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rounded-lg border p-8 text-center", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground", children: "No usage history available." }) });
|
|
2633
2633
|
}
|
|
2634
2634
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
2635
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2636
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "overflow-clip rounded-lg border", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2637
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2638
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2639
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2640
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2641
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2635
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.SectionHeader, { level: 2, children: "Usage History" }),
|
|
2636
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "overflow-clip rounded-lg border", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.Table, { children: [
|
|
2637
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TableHeader, { className: "bg-muted", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.TableRow, { children: [
|
|
2638
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TableHead, { children: "Date & Time" }),
|
|
2639
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TableHead, { children: "Meter Event" }),
|
|
2640
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TableHead, { className: "text-right", children: "Quantity" }),
|
|
2641
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TableHead, { children: "Event ID" })
|
|
2642
2642
|
] }) }),
|
|
2643
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2643
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TableBody, { children: usageRecords.map((record) => {
|
|
2644
2644
|
const dateTime = formatDateTime(record.timestamp);
|
|
2645
2645
|
const quantity = record.quantity.toLocaleString();
|
|
2646
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2647
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2648
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2649
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2650
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2646
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.TableRow, { children: [
|
|
2647
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TableCell, { className: "font-medium", children: dateTime }),
|
|
2648
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TableCell, { className: "text-muted-foreground", children: record.meterEventName }),
|
|
2649
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TableCell, { className: "text-right font-medium", children: quantity }),
|
|
2650
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.TableCell, { className: "text-muted-foreground text-sm tabular-nums", children: record.stripeEventId })
|
|
2651
2651
|
] }, record.id);
|
|
2652
2652
|
}) })
|
|
2653
2653
|
] }) })
|
|
@@ -2658,8 +2658,8 @@ _chunk7QVYU63Ejs.__name.call(void 0, UsageHistoryTable, "UsageHistoryTable");
|
|
|
2658
2658
|
// src/features/billing/components/modals/BillingDetailModal.tsx
|
|
2659
2659
|
|
|
2660
2660
|
function BillingDetailModal({ open, onOpenChange, title, children, className }) {
|
|
2661
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2662
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2661
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.DialogContent, { className: _nullishCoalesce(className, () => ( "max-w-4xl max-h-[90vh] overflow-y-auto")), children: [
|
|
2662
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.DialogHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.DialogTitle, { children: title }) }),
|
|
2663
2663
|
children
|
|
2664
2664
|
] }) });
|
|
2665
2665
|
}
|
|
@@ -2676,7 +2676,7 @@ function BillingAlertBanner({ subscription, onUpdatePayment, onAddPayment }) {
|
|
|
2676
2676
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-destructive text-sm font-medium", children: "Payment Failed" }),
|
|
2677
2677
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive mt-1 text-sm", children: "Your last payment failed. Please update your payment method to avoid service interruption." })
|
|
2678
2678
|
] }),
|
|
2679
|
-
onUpdatePayment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2679
|
+
onUpdatePayment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Button, { variant: "outline", size: "sm", onClick: onUpdatePayment, className: "text-destructive border-red-300", children: "Update Payment Method" })
|
|
2680
2680
|
] });
|
|
2681
2681
|
}
|
|
2682
2682
|
if (subscription.status === "trialing" /* TRIALING */ && subscription.trialEnd) {
|
|
@@ -2696,7 +2696,7 @@ function BillingAlertBanner({ subscription, onUpdatePayment, onAddPayment }) {
|
|
|
2696
2696
|
". Add a payment method to continue your subscription."
|
|
2697
2697
|
] })
|
|
2698
2698
|
] }),
|
|
2699
|
-
onAddPayment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2699
|
+
onAddPayment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Button, { variant: "outline", size: "sm", onClick: onAddPayment, className: "text-warning border-yellow-300", children: "Add Payment Method" })
|
|
2700
2700
|
] });
|
|
2701
2701
|
}
|
|
2702
2702
|
}
|
|
@@ -2747,7 +2747,7 @@ function BillingDashboardContainer() {
|
|
|
2747
2747
|
setNoCustomerExists(false);
|
|
2748
2748
|
let customer = null;
|
|
2749
2749
|
try {
|
|
2750
|
-
customer = await
|
|
2750
|
+
customer = await _chunkS2C5V2XZjs.StripeCustomerService.getCustomer();
|
|
2751
2751
|
setData((prev) => ({ ...prev, customer }));
|
|
2752
2752
|
setErrors((prev) => ({ ...prev, customer: null }));
|
|
2753
2753
|
setNoCustomerExists(false);
|
|
@@ -2773,7 +2773,7 @@ function BillingDashboardContainer() {
|
|
|
2773
2773
|
}
|
|
2774
2774
|
const fetchSubscriptions = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
2775
2775
|
try {
|
|
2776
|
-
const subscriptions2 = await
|
|
2776
|
+
const subscriptions2 = await _chunkS2C5V2XZjs.StripeSubscriptionService.listSubscriptions();
|
|
2777
2777
|
setData((prev) => ({ ...prev, subscriptions: subscriptions2 }));
|
|
2778
2778
|
setErrors((prev) => ({ ...prev, subscriptions: null }));
|
|
2779
2779
|
return subscriptions2;
|
|
@@ -2787,7 +2787,7 @@ function BillingDashboardContainer() {
|
|
|
2787
2787
|
}, "fetchSubscriptions");
|
|
2788
2788
|
const fetchPaymentMethods = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
2789
2789
|
try {
|
|
2790
|
-
const paymentMethods = await
|
|
2790
|
+
const paymentMethods = await _chunkS2C5V2XZjs.StripeCustomerService.listPaymentMethods();
|
|
2791
2791
|
setData((prev) => ({ ...prev, paymentMethods }));
|
|
2792
2792
|
setErrors((prev) => ({ ...prev, paymentMethods: null }));
|
|
2793
2793
|
} catch (error) {
|
|
@@ -2799,7 +2799,7 @@ function BillingDashboardContainer() {
|
|
|
2799
2799
|
}, "fetchPaymentMethods");
|
|
2800
2800
|
const fetchInvoices = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
2801
2801
|
try {
|
|
2802
|
-
const invoices = await
|
|
2802
|
+
const invoices = await _chunkS2C5V2XZjs.StripeInvoiceService.listInvoices();
|
|
2803
2803
|
setData((prev) => ({ ...prev, invoices }));
|
|
2804
2804
|
setErrors((prev) => ({ ...prev, invoices: null }));
|
|
2805
2805
|
} catch (error) {
|
|
@@ -2822,7 +2822,7 @@ function BillingDashboardContainer() {
|
|
|
2822
2822
|
const handleCreateCustomer = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
2823
2823
|
setCreatingCustomer(true);
|
|
2824
2824
|
try {
|
|
2825
|
-
await
|
|
2825
|
+
await _chunkS2C5V2XZjs.StripeCustomerService.createCustomer();
|
|
2826
2826
|
setNoCustomerExists(false);
|
|
2827
2827
|
await fetchAllData();
|
|
2828
2828
|
} catch (error) {
|
|
@@ -2834,7 +2834,7 @@ function BillingDashboardContainer() {
|
|
|
2834
2834
|
}, "handleCreateCustomer");
|
|
2835
2835
|
const fetchUsageData = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
2836
2836
|
try {
|
|
2837
|
-
const meters = await
|
|
2837
|
+
const meters = await _chunkS2C5V2XZjs.StripeUsageService.listMeters();
|
|
2838
2838
|
setData((prev) => ({ ...prev, meters }));
|
|
2839
2839
|
const summariesMap = {};
|
|
2840
2840
|
const now = /* @__PURE__ */ new Date();
|
|
@@ -2842,7 +2842,7 @@ function BillingDashboardContainer() {
|
|
|
2842
2842
|
const endOfMonth = new Date(now.getFullYear(), now.getMonth() + 1, 0, 23, 59, 59, 999);
|
|
2843
2843
|
for (const meter of meters) {
|
|
2844
2844
|
try {
|
|
2845
|
-
const meterSummaries = await
|
|
2845
|
+
const meterSummaries = await _chunkS2C5V2XZjs.StripeUsageService.getMeterSummaries({
|
|
2846
2846
|
meterId: meter.id,
|
|
2847
2847
|
startTime: startOfMonth,
|
|
2848
2848
|
endTime: endOfMonth
|
|
@@ -2920,18 +2920,18 @@ function BillingDashboardContainer() {
|
|
|
2920
2920
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Wallet, { className: "h-8 w-8" }),
|
|
2921
2921
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h1", { className: "text-primary text-3xl font-semibold", children: "Billing" })
|
|
2922
2922
|
] }),
|
|
2923
|
-
isInitialLoading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2924
|
-
noCustomerExists && !isInitialLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2925
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2923
|
+
isInitialLoading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.CardContent, { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Loader2, { className: "h-8 w-8 animate-spin text-muted-foreground" }) }) }),
|
|
2924
|
+
noCustomerExists && !isInitialLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.Card, { children: [
|
|
2925
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.CardHeader, { className: "text-center", children: [
|
|
2926
2926
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-primary/10", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-8 w-8 text-primary" }) }),
|
|
2927
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2928
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2927
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.CardTitle, { children: "Set Up Billing" }),
|
|
2928
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.CardDescription, { children: "Your company doesn't have a billing account yet. Set one up to manage subscriptions, payment methods, and view invoices." })
|
|
2929
2929
|
] }),
|
|
2930
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2930
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.CardContent, { className: "flex justify-center pb-8", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Button, { onClick: handleCreateCustomer, disabled: creatingCustomer, size: "lg", children: creatingCustomer ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2931
2931
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Loader2, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
2932
2932
|
"Setting up..."
|
|
2933
2933
|
] }) : "Set Up Billing Account" }) }),
|
|
2934
|
-
errors.customer && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2934
|
+
errors.customer && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.CardContent, { className: "pt-0", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-center text-destructive text-xs/relaxed", children: errors.customer }) })
|
|
2935
2935
|
] }),
|
|
2936
2936
|
!noCustomerExists && !isInitialLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2937
2937
|
criticalSubscriptions.map((subscription) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -3073,7 +3073,7 @@ function getStripePromise(publishableKey) {
|
|
|
3073
3073
|
}
|
|
3074
3074
|
_chunk7QVYU63Ejs.__name.call(void 0, getStripePromise, "getStripePromise");
|
|
3075
3075
|
function StripeProvider({ children }) {
|
|
3076
|
-
const publishableKey =
|
|
3076
|
+
const publishableKey = _chunkOHG2YWNAjs.getStripePublishableKey.call(void 0, );
|
|
3077
3077
|
const stripePromise = _react.useMemo.call(void 0, () => getStripePromise(publishableKey), [publishableKey]);
|
|
3078
3078
|
const options = _react.useMemo.call(void 0, () => ({}), []);
|
|
3079
3079
|
if (!publishableKey) {
|
|
@@ -3083,7 +3083,7 @@ function StripeProvider({ children }) {
|
|
|
3083
3083
|
}
|
|
3084
3084
|
_chunk7QVYU63Ejs.__name.call(void 0, StripeProvider, "StripeProvider");
|
|
3085
3085
|
function isStripeConfigured() {
|
|
3086
|
-
return !!
|
|
3086
|
+
return !!_chunkOHG2YWNAjs.getStripePublishableKey.call(void 0, );
|
|
3087
3087
|
}
|
|
3088
3088
|
_chunk7QVYU63Ejs.__name.call(void 0, isStripeConfigured, "isStripeConfigured");
|
|
3089
3089
|
|
|
@@ -3103,12 +3103,12 @@ function PriceArchiver({ price }) {
|
|
|
3103
3103
|
const isArchived = !price.active;
|
|
3104
3104
|
const scope = isArchived ? "restore" : "archive";
|
|
3105
3105
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
3106
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3106
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.Button, { variant: "outline", size: "sm", onClick: () => setOpen(true), children: [
|
|
3107
3107
|
isArchived ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.RotateCcwIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ArchiveIcon, {}),
|
|
3108
3108
|
t(`billing.admin.prices.${scope}.confirm`)
|
|
3109
3109
|
] }),
|
|
3110
3110
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3111
|
-
|
|
3111
|
+
_chunk2PEPIH26js.ConfirmDialog,
|
|
3112
3112
|
{
|
|
3113
3113
|
open,
|
|
3114
3114
|
onOpenChange: setOpen,
|
|
@@ -3122,7 +3122,7 @@ function PriceArchiver({ price }) {
|
|
|
3122
3122
|
if (isArchived) await restorePrice(price.id);
|
|
3123
3123
|
else await archivePrice(price.id);
|
|
3124
3124
|
} catch (error) {
|
|
3125
|
-
|
|
3125
|
+
_chunk2PEPIH26js.errorToast.call(void 0, { title: t(`billing.admin.prices.${scope}.title`), error });
|
|
3126
3126
|
throw error;
|
|
3127
3127
|
}
|
|
3128
3128
|
}
|
|
@@ -3153,14 +3153,14 @@ function PriceEditorInternal({
|
|
|
3153
3153
|
onDialogOpenChange
|
|
3154
3154
|
}) {
|
|
3155
3155
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
3156
|
-
const router =
|
|
3156
|
+
const router = _chunkOHG2YWNAjs.useI18nRouter.call(void 0, );
|
|
3157
3157
|
const { createPrice, updatePrice, productId: contextProductId } = usePriceContext();
|
|
3158
3158
|
const [allFeatures, setAllFeatures] = _react.useState.call(void 0, []);
|
|
3159
3159
|
const isEdit = !!price;
|
|
3160
3160
|
const targetProductId = _nullishCoalesce(_nullishCoalesce(productId, () => ( _optionalChain([price, 'optionalAccess', _117 => _117.product, 'optionalAccess', _118 => _118.id]))), () => ( contextProductId));
|
|
3161
3161
|
_react.useEffect.call(void 0, () => {
|
|
3162
3162
|
const fetchFeatures = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
3163
|
-
setAllFeatures(await
|
|
3163
|
+
setAllFeatures(await _chunkS2C5V2XZjs.FeatureService.findMany({}));
|
|
3164
3164
|
}, "fetchFeatures");
|
|
3165
3165
|
void fetchFeatures();
|
|
3166
3166
|
}, []);
|
|
@@ -3246,13 +3246,13 @@ function PriceEditorInternal({
|
|
|
3246
3246
|
{ id: "metered", text: t("billing.admin.prices.usage.metered") }
|
|
3247
3247
|
];
|
|
3248
3248
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3249
|
-
|
|
3249
|
+
_chunk2PEPIH26js.EditorSheet,
|
|
3250
3250
|
{
|
|
3251
3251
|
form,
|
|
3252
3252
|
entityType: t("billing.admin.prices.entity"),
|
|
3253
3253
|
entityName: price ? priceLabel(price) : void 0,
|
|
3254
3254
|
isEdit,
|
|
3255
|
-
module:
|
|
3255
|
+
module: _chunkS2C5V2XZjs.Modules.StripePrice,
|
|
3256
3256
|
size: "lg",
|
|
3257
3257
|
propagateChanges,
|
|
3258
3258
|
onSuccess,
|
|
@@ -3301,13 +3301,13 @@ function PriceEditorInternal({
|
|
|
3301
3301
|
dialogOpen,
|
|
3302
3302
|
onDialogOpenChange,
|
|
3303
3303
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
3304
|
-
isEdit && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3305
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3306
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3304
|
+
isEdit && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.Alert, { children: [
|
|
3305
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.AlertTitle, { children: t("billing.admin.prices.immutability.title") }),
|
|
3306
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.AlertDescription, { children: t("billing.admin.prices.immutability.description") })
|
|
3307
3307
|
] }),
|
|
3308
3308
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-2 gap-x-4", children: [
|
|
3309
3309
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3310
|
-
|
|
3310
|
+
_chunk2PEPIH26js.FormInput,
|
|
3311
3311
|
{
|
|
3312
3312
|
form,
|
|
3313
3313
|
id: "unitAmount",
|
|
@@ -3319,7 +3319,7 @@ function PriceEditorInternal({
|
|
|
3319
3319
|
}
|
|
3320
3320
|
),
|
|
3321
3321
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3322
|
-
|
|
3322
|
+
_chunk2PEPIH26js.FormSelect,
|
|
3323
3323
|
{
|
|
3324
3324
|
form,
|
|
3325
3325
|
id: "currency",
|
|
@@ -3330,7 +3330,7 @@ function PriceEditorInternal({
|
|
|
3330
3330
|
)
|
|
3331
3331
|
] }),
|
|
3332
3332
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3333
|
-
|
|
3333
|
+
_chunk2PEPIH26js.FormSelect,
|
|
3334
3334
|
{
|
|
3335
3335
|
form,
|
|
3336
3336
|
id: "interval",
|
|
@@ -3341,7 +3341,7 @@ function PriceEditorInternal({
|
|
|
3341
3341
|
),
|
|
3342
3342
|
isRecurring && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-2 gap-x-4", children: [
|
|
3343
3343
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3344
|
-
|
|
3344
|
+
_chunk2PEPIH26js.FormInput,
|
|
3345
3345
|
{
|
|
3346
3346
|
form,
|
|
3347
3347
|
id: "intervalCount",
|
|
@@ -3352,7 +3352,7 @@ function PriceEditorInternal({
|
|
|
3352
3352
|
}
|
|
3353
3353
|
),
|
|
3354
3354
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3355
|
-
|
|
3355
|
+
_chunk2PEPIH26js.FormSelect,
|
|
3356
3356
|
{
|
|
3357
3357
|
form,
|
|
3358
3358
|
id: "usageType",
|
|
@@ -3363,7 +3363,7 @@ function PriceEditorInternal({
|
|
|
3363
3363
|
)
|
|
3364
3364
|
] }),
|
|
3365
3365
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3366
|
-
|
|
3366
|
+
_chunk2PEPIH26js.FormInput,
|
|
3367
3367
|
{
|
|
3368
3368
|
form,
|
|
3369
3369
|
id: "nickname",
|
|
@@ -3372,7 +3372,7 @@ function PriceEditorInternal({
|
|
|
3372
3372
|
}
|
|
3373
3373
|
),
|
|
3374
3374
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3375
|
-
|
|
3375
|
+
_chunk2PEPIH26js.FormTextarea,
|
|
3376
3376
|
{
|
|
3377
3377
|
form,
|
|
3378
3378
|
id: "description",
|
|
@@ -3382,7 +3382,7 @@ function PriceEditorInternal({
|
|
|
3382
3382
|
}
|
|
3383
3383
|
),
|
|
3384
3384
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3385
|
-
|
|
3385
|
+
_chunk2PEPIH26js.FormInput,
|
|
3386
3386
|
{
|
|
3387
3387
|
form,
|
|
3388
3388
|
id: "token",
|
|
@@ -3392,10 +3392,10 @@ function PriceEditorInternal({
|
|
|
3392
3392
|
}
|
|
3393
3393
|
),
|
|
3394
3394
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-2", children: [
|
|
3395
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3395
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.FieldLabel, { children: t("billing.admin.prices.fields.features") }),
|
|
3396
3396
|
form.watch("features").map((_, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex gap-2", children: [
|
|
3397
3397
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3398
|
-
|
|
3398
|
+
_chunk2PEPIH26js.Input,
|
|
3399
3399
|
{
|
|
3400
3400
|
...form.register(`features.${index}`),
|
|
3401
3401
|
placeholder: t("billing.admin.prices.placeholders.feature", { index: index + 1 }),
|
|
@@ -3403,7 +3403,7 @@ function PriceEditorInternal({
|
|
|
3403
3403
|
}
|
|
3404
3404
|
),
|
|
3405
3405
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3406
|
-
|
|
3406
|
+
_chunk2PEPIH26js.Button,
|
|
3407
3407
|
{
|
|
3408
3408
|
type: "button",
|
|
3409
3409
|
variant: "outline",
|
|
@@ -3418,7 +3418,7 @@ function PriceEditorInternal({
|
|
|
3418
3418
|
)
|
|
3419
3419
|
] }, index)),
|
|
3420
3420
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3421
|
-
|
|
3421
|
+
_chunk2PEPIH26js.Button,
|
|
3422
3422
|
{
|
|
3423
3423
|
type: "button",
|
|
3424
3424
|
variant: "outline",
|
|
@@ -3433,12 +3433,12 @@ function PriceEditorInternal({
|
|
|
3433
3433
|
)
|
|
3434
3434
|
] }),
|
|
3435
3435
|
isRecurring && allFeatures.length > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-2", children: [
|
|
3436
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3436
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.FieldLabel, { children: t("billing.admin.prices.fields.platformFeatures") }),
|
|
3437
3437
|
/* @__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) => {
|
|
3438
3438
|
const isChecked = form.watch("featureIds").includes(feature.id);
|
|
3439
3439
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-2", children: [
|
|
3440
3440
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3441
|
-
|
|
3441
|
+
_chunk2PEPIH26js.Checkbox,
|
|
3442
3442
|
{
|
|
3443
3443
|
id: `feature-${feature.id}`,
|
|
3444
3444
|
checked: isChecked,
|
|
@@ -3454,13 +3454,13 @@ function PriceEditorInternal({
|
|
|
3454
3454
|
}
|
|
3455
3455
|
}
|
|
3456
3456
|
),
|
|
3457
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3457
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.FieldLabel, { htmlFor: `feature-${feature.id}`, children: feature.name }),
|
|
3458
3458
|
feature.isCore && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("billing.admin.prices.help.core") })
|
|
3459
3459
|
] }, feature.id);
|
|
3460
3460
|
}) })
|
|
3461
3461
|
] }),
|
|
3462
3462
|
isRecurring && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3463
|
-
|
|
3463
|
+
_chunk2PEPIH26js.FormCheckbox,
|
|
3464
3464
|
{
|
|
3465
3465
|
form,
|
|
3466
3466
|
id: "isTrial",
|
|
@@ -3503,7 +3503,7 @@ var defaultContextValue = {
|
|
|
3503
3503
|
productId: void 0
|
|
3504
3504
|
};
|
|
3505
3505
|
function priceLabel(price) {
|
|
3506
|
-
return _nullishCoalesce(price.nickname, () => ( `${
|
|
3506
|
+
return _nullishCoalesce(price.nickname, () => ( `${_chunk2PEPIH26js.formatCurrency.call(void 0, price.unitAmount, price.currency)} ${_chunk2PEPIH26js.formatInterval.call(void 0, price)}`.trim()));
|
|
3507
3507
|
}
|
|
3508
3508
|
_chunk7QVYU63Ejs.__name.call(void 0, priceLabel, "priceLabel");
|
|
3509
3509
|
var PriceProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({
|
|
@@ -3513,21 +3513,21 @@ var PriceProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({
|
|
|
3513
3513
|
productId: productIdProp
|
|
3514
3514
|
}) => {
|
|
3515
3515
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
3516
|
-
const generateUrl =
|
|
3517
|
-
const { hasRole } =
|
|
3516
|
+
const generateUrl = _chunk2PEPIH26js.usePageUrlGenerator.call(void 0, );
|
|
3517
|
+
const { hasRole } = _chunk2PEPIH26js.useCurrentUserContext.call(void 0, );
|
|
3518
3518
|
const [price, setPrice] = _react.useState.call(void 0,
|
|
3519
|
-
dehydratedPrice ?
|
|
3519
|
+
dehydratedPrice ? _chunkS2C5V2XZjs.rehydrate.call(void 0, _chunkS2C5V2XZjs.Modules.StripePrice, dehydratedPrice) : void 0
|
|
3520
3520
|
);
|
|
3521
3521
|
const [priceVersion, setPriceVersion] = _react.useState.call(void 0, 0);
|
|
3522
3522
|
const refreshPrices = _react.useCallback.call(void 0, () => setPriceVersion((value2) => value2 + 1), []);
|
|
3523
3523
|
const productId = _nullishCoalesce(productIdProp, () => ( _optionalChain([price, 'optionalAccess', _138 => _138.product, 'optionalAccess', _139 => _139.id])));
|
|
3524
3524
|
const reloadPrice = _react.useCallback.call(void 0, async () => {
|
|
3525
3525
|
if (!_optionalChain([price, 'optionalAccess', _140 => _140.id])) return;
|
|
3526
|
-
setPrice(await
|
|
3526
|
+
setPrice(await _chunkS2C5V2XZjs.StripePriceService.getPrice({ id: price.id }));
|
|
3527
3527
|
}, [_optionalChain([price, 'optionalAccess', _141 => _141.id])]);
|
|
3528
3528
|
const createPrice = _react.useCallback.call(void 0,
|
|
3529
3529
|
async (input) => {
|
|
3530
|
-
const saved = await
|
|
3530
|
+
const saved = await _chunkS2C5V2XZjs.StripePriceService.createPrice(input);
|
|
3531
3531
|
refreshPrices();
|
|
3532
3532
|
return saved;
|
|
3533
3533
|
},
|
|
@@ -3535,7 +3535,7 @@ var PriceProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({
|
|
|
3535
3535
|
);
|
|
3536
3536
|
const updatePrice = _react.useCallback.call(void 0,
|
|
3537
3537
|
async (input) => {
|
|
3538
|
-
const saved = await
|
|
3538
|
+
const saved = await _chunkS2C5V2XZjs.StripePriceService.updatePrice(input);
|
|
3539
3539
|
setPrice(saved);
|
|
3540
3540
|
refreshPrices();
|
|
3541
3541
|
return saved;
|
|
@@ -3546,7 +3546,7 @@ var PriceProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({
|
|
|
3546
3546
|
async (id) => {
|
|
3547
3547
|
const target = _nullishCoalesce(id, () => ( _optionalChain([price, 'optionalAccess', _142 => _142.id])));
|
|
3548
3548
|
if (!target) return;
|
|
3549
|
-
await
|
|
3549
|
+
await _chunkS2C5V2XZjs.StripePriceService.archivePrice({ id: target });
|
|
3550
3550
|
await reloadPrice();
|
|
3551
3551
|
refreshPrices();
|
|
3552
3552
|
},
|
|
@@ -3556,7 +3556,7 @@ var PriceProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({
|
|
|
3556
3556
|
async (id) => {
|
|
3557
3557
|
const target = _nullishCoalesce(id, () => ( _optionalChain([price, 'optionalAccess', _144 => _144.id])));
|
|
3558
3558
|
if (!target) return;
|
|
3559
|
-
await
|
|
3559
|
+
await _chunkS2C5V2XZjs.StripePriceService.reactivatePrice({ id: target });
|
|
3560
3560
|
await reloadPrice();
|
|
3561
3561
|
refreshPrices();
|
|
3562
3562
|
},
|
|
@@ -3580,12 +3580,12 @@ var PriceProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({
|
|
|
3580
3580
|
if (!publishChrome) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PriceContext.Provider, { value, children });
|
|
3581
3581
|
const breadcrumb = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
3582
3582
|
const items = [
|
|
3583
|
-
{ name: t("billing.admin.products.title"), href: generateUrl({ page:
|
|
3583
|
+
{ name: t("billing.admin.products.title"), href: generateUrl({ page: _chunkS2C5V2XZjs.Modules.StripeProduct }) }
|
|
3584
3584
|
];
|
|
3585
3585
|
if (_optionalChain([price, 'optionalAccess', _146 => _146.product]))
|
|
3586
3586
|
items.push({
|
|
3587
3587
|
name: price.product.name,
|
|
3588
|
-
href: generateUrl({ page:
|
|
3588
|
+
href: generateUrl({ page: _chunkS2C5V2XZjs.Modules.StripeProduct, id: price.product.id })
|
|
3589
3589
|
});
|
|
3590
3590
|
if (price) items.push({ name: priceLabel(price) });
|
|
3591
3591
|
return items;
|
|
@@ -3594,7 +3594,7 @@ var PriceProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({
|
|
|
3594
3594
|
const response = { type: t("billing.admin.prices.title") };
|
|
3595
3595
|
if (!price) return response;
|
|
3596
3596
|
response.element = priceLabel(price);
|
|
3597
|
-
if (hasRole(
|
|
3597
|
+
if (hasRole(_chunkOHG2YWNAjs.getRoleId.call(void 0, ).Administrator)) {
|
|
3598
3598
|
response.functions = [
|
|
3599
3599
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, PriceArchiver, { price }, "priceArchiver"),
|
|
3600
3600
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, PriceEditor, { price, propagateChanges: setPrice }, "priceEditor")
|
|
@@ -3602,7 +3602,7 @@ var PriceProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({
|
|
|
3602
3602
|
}
|
|
3603
3603
|
return response;
|
|
3604
3604
|
}, "title");
|
|
3605
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3605
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PriceContext.Provider, { value, children }) });
|
|
3606
3606
|
}, "PriceProvider");
|
|
3607
3607
|
var usePriceContext = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => _nullishCoalesce(_react.useContext.call(void 0, PriceContext), () => ( defaultContextValue)), "usePriceContext");
|
|
3608
3608
|
|
|
@@ -3622,12 +3622,12 @@ function ProductArchiver({ product }) {
|
|
|
3622
3622
|
const isArchived = !product.active;
|
|
3623
3623
|
const scope = isArchived ? "restore" : "archive";
|
|
3624
3624
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
3625
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3625
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2PEPIH26js.Button, { variant: "outline", size: "sm", onClick: () => setOpen(true), children: [
|
|
3626
3626
|
isArchived ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.RotateCcwIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ArchiveIcon, {}),
|
|
3627
3627
|
t(`billing.admin.products.${scope}.confirm`)
|
|
3628
3628
|
] }),
|
|
3629
3629
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3630
|
-
|
|
3630
|
+
_chunk2PEPIH26js.ConfirmDialog,
|
|
3631
3631
|
{
|
|
3632
3632
|
open,
|
|
3633
3633
|
onOpenChange: setOpen,
|
|
@@ -3641,7 +3641,7 @@ function ProductArchiver({ product }) {
|
|
|
3641
3641
|
if (isArchived) await restoreProduct(product.id);
|
|
3642
3642
|
else await archiveProduct(product.id);
|
|
3643
3643
|
} catch (error) {
|
|
3644
|
-
|
|
3644
|
+
_chunk2PEPIH26js.errorToast.call(void 0, { title: t(`billing.admin.products.${scope}.title`), error });
|
|
3645
3645
|
throw error;
|
|
3646
3646
|
}
|
|
3647
3647
|
}
|
|
@@ -3670,7 +3670,7 @@ function ProductEditorInternal({
|
|
|
3670
3670
|
onDialogOpenChange
|
|
3671
3671
|
}) {
|
|
3672
3672
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
3673
|
-
const router =
|
|
3673
|
+
const router = _chunkOHG2YWNAjs.useI18nRouter.call(void 0, );
|
|
3674
3674
|
const { createProduct, updateProduct } = useProductContext();
|
|
3675
3675
|
const isEdit = !!product;
|
|
3676
3676
|
const formSchema2 = _react.useMemo.call(void 0,
|
|
@@ -3694,13 +3694,13 @@ function ProductEditorInternal({
|
|
|
3694
3694
|
defaultValues: getDefaultValues()
|
|
3695
3695
|
});
|
|
3696
3696
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3697
|
-
|
|
3697
|
+
_chunk2PEPIH26js.EditorSheet,
|
|
3698
3698
|
{
|
|
3699
3699
|
form,
|
|
3700
3700
|
entityType: t("billing.admin.products.entity"),
|
|
3701
3701
|
entityName: _optionalChain([product, 'optionalAccess', _150 => _150.name]),
|
|
3702
3702
|
isEdit,
|
|
3703
|
-
module:
|
|
3703
|
+
module: _chunkS2C5V2XZjs.Modules.StripeProduct,
|
|
3704
3704
|
size: "md",
|
|
3705
3705
|
propagateChanges,
|
|
3706
3706
|
onSuccess,
|
|
@@ -3717,7 +3717,7 @@ function ProductEditorInternal({
|
|
|
3717
3717
|
onDialogOpenChange,
|
|
3718
3718
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
3719
3719
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3720
|
-
|
|
3720
|
+
_chunk2PEPIH26js.FormInput,
|
|
3721
3721
|
{
|
|
3722
3722
|
form,
|
|
3723
3723
|
id: "name",
|
|
@@ -3727,7 +3727,7 @@ function ProductEditorInternal({
|
|
|
3727
3727
|
}
|
|
3728
3728
|
),
|
|
3729
3729
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3730
|
-
|
|
3730
|
+
_chunk2PEPIH26js.FormTextarea,
|
|
3731
3731
|
{
|
|
3732
3732
|
form,
|
|
3733
3733
|
id: "description",
|
|
@@ -3771,20 +3771,20 @@ var defaultContextValue2 = {
|
|
|
3771
3771
|
};
|
|
3772
3772
|
var ProductProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ children, dehydratedProduct, publishChrome = true }) => {
|
|
3773
3773
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
3774
|
-
const generateUrl =
|
|
3775
|
-
const { hasRole } =
|
|
3774
|
+
const generateUrl = _chunk2PEPIH26js.usePageUrlGenerator.call(void 0, );
|
|
3775
|
+
const { hasRole } = _chunk2PEPIH26js.useCurrentUserContext.call(void 0, );
|
|
3776
3776
|
const [product, setProduct] = _react.useState.call(void 0,
|
|
3777
|
-
dehydratedProduct ?
|
|
3777
|
+
dehydratedProduct ? _chunkS2C5V2XZjs.rehydrate.call(void 0, _chunkS2C5V2XZjs.Modules.StripeProduct, dehydratedProduct) : void 0
|
|
3778
3778
|
);
|
|
3779
3779
|
const [catalogueVersion, setCatalogueVersion] = _react.useState.call(void 0, 0);
|
|
3780
3780
|
const refreshCatalogue = _react.useCallback.call(void 0, () => setCatalogueVersion((value2) => value2 + 1), []);
|
|
3781
3781
|
const reloadProduct = _react.useCallback.call(void 0, async () => {
|
|
3782
3782
|
if (!_optionalChain([product, 'optionalAccess', _151 => _151.id])) return;
|
|
3783
|
-
setProduct(await
|
|
3783
|
+
setProduct(await _chunkS2C5V2XZjs.StripeProductService.getProduct({ id: product.id }));
|
|
3784
3784
|
}, [_optionalChain([product, 'optionalAccess', _152 => _152.id])]);
|
|
3785
3785
|
const createProduct = _react.useCallback.call(void 0,
|
|
3786
3786
|
async (input) => {
|
|
3787
|
-
const saved = await
|
|
3787
|
+
const saved = await _chunkS2C5V2XZjs.StripeProductService.createProduct(input);
|
|
3788
3788
|
refreshCatalogue();
|
|
3789
3789
|
return saved;
|
|
3790
3790
|
},
|
|
@@ -3792,7 +3792,7 @@ var ProductProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ ch
|
|
|
3792
3792
|
);
|
|
3793
3793
|
const updateProduct = _react.useCallback.call(void 0,
|
|
3794
3794
|
async (input) => {
|
|
3795
|
-
const saved = await
|
|
3795
|
+
const saved = await _chunkS2C5V2XZjs.StripeProductService.updateProduct(input);
|
|
3796
3796
|
setProduct(saved);
|
|
3797
3797
|
refreshCatalogue();
|
|
3798
3798
|
return saved;
|
|
@@ -3803,7 +3803,7 @@ var ProductProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ ch
|
|
|
3803
3803
|
async (id) => {
|
|
3804
3804
|
const target = _nullishCoalesce(id, () => ( _optionalChain([product, 'optionalAccess', _153 => _153.id])));
|
|
3805
3805
|
if (!target) return;
|
|
3806
|
-
await
|
|
3806
|
+
await _chunkS2C5V2XZjs.StripeProductService.archiveProduct({ id: target });
|
|
3807
3807
|
await reloadProduct();
|
|
3808
3808
|
refreshCatalogue();
|
|
3809
3809
|
},
|
|
@@ -3813,7 +3813,7 @@ var ProductProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ ch
|
|
|
3813
3813
|
async (id) => {
|
|
3814
3814
|
const target = _nullishCoalesce(id, () => ( _optionalChain([product, 'optionalAccess', _155 => _155.id])));
|
|
3815
3815
|
if (!target) return;
|
|
3816
|
-
await
|
|
3816
|
+
await _chunkS2C5V2XZjs.StripeProductService.reactivateProduct({ id: target });
|
|
3817
3817
|
await reloadProduct();
|
|
3818
3818
|
refreshCatalogue();
|
|
3819
3819
|
},
|
|
@@ -3848,7 +3848,7 @@ var ProductProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ ch
|
|
|
3848
3848
|
{
|
|
3849
3849
|
name: t("billing.admin.products.title"),
|
|
3850
3850
|
// Linked only when it is NOT the current page.
|
|
3851
|
-
...product ? { href: generateUrl({ page:
|
|
3851
|
+
...product ? { href: generateUrl({ page: _chunkS2C5V2XZjs.Modules.StripeProduct }) } : {}
|
|
3852
3852
|
}
|
|
3853
3853
|
];
|
|
3854
3854
|
if (product) items.push({ name: product.name });
|
|
@@ -3858,7 +3858,7 @@ var ProductProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ ch
|
|
|
3858
3858
|
const response = { type: t("billing.admin.products.title") };
|
|
3859
3859
|
if (!product) return response;
|
|
3860
3860
|
response.element = product.name;
|
|
3861
|
-
if (hasRole(
|
|
3861
|
+
if (hasRole(_chunkOHG2YWNAjs.getRoleId.call(void 0, ).Administrator)) {
|
|
3862
3862
|
response.functions = [
|
|
3863
3863
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductArchiver, { product }, "productArchiver"),
|
|
3864
3864
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductEditor, { product, propagateChanges: setProduct }, "productEditor")
|
|
@@ -3866,7 +3866,7 @@ var ProductProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ ch
|
|
|
3866
3866
|
}
|
|
3867
3867
|
return response;
|
|
3868
3868
|
}, "title");
|
|
3869
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3869
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductContext.Provider, { value, children }) });
|
|
3870
3870
|
}, "ProductProvider");
|
|
3871
3871
|
var useProductContext = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => _nullishCoalesce(_react.useContext.call(void 0, ProductContext), () => ( defaultContextValue2)), "useProductContext");
|
|
3872
3872
|
|
|
@@ -3875,56 +3875,56 @@ var useProductContext = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ()
|
|
|
3875
3875
|
|
|
3876
3876
|
function PriceDetails() {
|
|
3877
3877
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
3878
|
-
const generateUrl =
|
|
3878
|
+
const generateUrl = _chunk2PEPIH26js.usePageUrlGenerator.call(void 0, );
|
|
3879
3879
|
const { price } = usePriceContext();
|
|
3880
3880
|
if (!price) return null;
|
|
3881
3881
|
const isRecurring = price.priceType === "recurring";
|
|
3882
3882
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-8", children: [
|
|
3883
3883
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
3884
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3884
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.SectionHeader, { children: t("billing.admin.prices.title") }),
|
|
3885
3885
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
|
|
3886
3886
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3887
|
-
|
|
3887
|
+
_chunk2PEPIH26js.DetailField,
|
|
3888
3888
|
{
|
|
3889
3889
|
label: t("billing.admin.prices.fields.product"),
|
|
3890
|
-
value: price.product ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3890
|
+
value: price.product ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Link, { href: generateUrl({ page: _chunkS2C5V2XZjs.Modules.StripeProduct, id: price.product.id }), children: price.product.name }) : "\u2014"
|
|
3891
3891
|
}
|
|
3892
3892
|
),
|
|
3893
3893
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3894
|
-
|
|
3894
|
+
_chunk2PEPIH26js.DetailField,
|
|
3895
3895
|
{
|
|
3896
3896
|
label: t("billing.admin.prices.fields.status"),
|
|
3897
3897
|
value: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex flex-wrap items-center gap-1", children: [
|
|
3898
|
-
price.active ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3899
|
-
price.isTrial && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3898
|
+
price.active ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Badge, { variant: "softGreen", children: t("billing.admin.prices.status.active") }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Badge, { variant: "softGray", children: t("billing.admin.prices.status.archived") }),
|
|
3899
|
+
price.isTrial && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Badge, { variant: "softBlue", children: t("billing.admin.prices.badge.trial") })
|
|
3900
3900
|
] })
|
|
3901
3901
|
}
|
|
3902
3902
|
),
|
|
3903
3903
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3904
|
-
|
|
3904
|
+
_chunk2PEPIH26js.DetailField,
|
|
3905
3905
|
{
|
|
3906
3906
|
label: t("billing.admin.prices.fields.amount"),
|
|
3907
|
-
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children:
|
|
3907
|
+
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: _chunk2PEPIH26js.formatCurrency.call(void 0, price.unitAmount, price.currency) })
|
|
3908
3908
|
}
|
|
3909
3909
|
),
|
|
3910
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3910
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.DetailField, { label: t("billing.admin.prices.fields.currency"), value: price.currency.toUpperCase() }),
|
|
3911
3911
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3912
|
-
|
|
3912
|
+
_chunk2PEPIH26js.DetailField,
|
|
3913
3913
|
{
|
|
3914
3914
|
label: t("billing.admin.prices.fields.type"),
|
|
3915
3915
|
value: isRecurring ? t("billing.admin.prices.type.recurring") : t("billing.admin.prices.type.oneTime")
|
|
3916
3916
|
}
|
|
3917
3917
|
),
|
|
3918
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3918
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.DetailField, { label: t("billing.admin.prices.fields.billing"), value: _chunk2PEPIH26js.formatInterval.call(void 0, price) }),
|
|
3919
3919
|
isRecurring && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3920
|
-
|
|
3920
|
+
_chunk2PEPIH26js.DetailField,
|
|
3921
3921
|
{
|
|
3922
3922
|
label: t("billing.admin.prices.fields.intervalCount"),
|
|
3923
3923
|
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: _nullishCoalesce(_optionalChain([price, 'access', _157 => _157.recurring, 'optionalAccess', _158 => _158.intervalCount]), () => ( 1)) })
|
|
3924
3924
|
}
|
|
3925
3925
|
),
|
|
3926
3926
|
isRecurring && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3927
|
-
|
|
3927
|
+
_chunk2PEPIH26js.DetailField,
|
|
3928
3928
|
{
|
|
3929
3929
|
label: t("billing.admin.prices.fields.usageType"),
|
|
3930
3930
|
value: _optionalChain([price, 'access', _159 => _159.recurring, 'optionalAccess', _160 => _160.usageType]) === "metered" ? t("billing.admin.prices.usage.metered") : t("billing.admin.prices.usage.licensed")
|
|
@@ -3933,24 +3933,24 @@ function PriceDetails() {
|
|
|
3933
3933
|
] })
|
|
3934
3934
|
] }),
|
|
3935
3935
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
3936
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3936
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.SectionHeader, { children: t("billing.admin.prices.fields.platformFeatures") }),
|
|
3937
3937
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
|
|
3938
3938
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3939
|
-
|
|
3939
|
+
_chunk2PEPIH26js.DetailField,
|
|
3940
3940
|
{
|
|
3941
3941
|
label: t("billing.admin.prices.fields.token"),
|
|
3942
3942
|
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: _nullishCoalesce(price.token, () => ( "\u2014")) })
|
|
3943
3943
|
}
|
|
3944
3944
|
),
|
|
3945
3945
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3946
|
-
|
|
3946
|
+
_chunk2PEPIH26js.DetailField,
|
|
3947
3947
|
{
|
|
3948
3948
|
label: t("billing.admin.prices.fields.stripeId"),
|
|
3949
3949
|
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: price.stripePriceId })
|
|
3950
3950
|
}
|
|
3951
3951
|
),
|
|
3952
3952
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3953
|
-
|
|
3953
|
+
_chunk2PEPIH26js.DetailField,
|
|
3954
3954
|
{
|
|
3955
3955
|
label: t("billing.admin.prices.fields.description"),
|
|
3956
3956
|
value: _nullishCoalesce(price.description, () => ( "\u2014")),
|
|
@@ -3958,7 +3958,7 @@ function PriceDetails() {
|
|
|
3958
3958
|
}
|
|
3959
3959
|
),
|
|
3960
3960
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3961
|
-
|
|
3961
|
+
_chunk2PEPIH26js.DetailField,
|
|
3962
3962
|
{
|
|
3963
3963
|
label: t("billing.admin.prices.fields.features"),
|
|
3964
3964
|
className: "md:col-span-2",
|
|
@@ -3966,11 +3966,11 @@ function PriceDetails() {
|
|
|
3966
3966
|
}
|
|
3967
3967
|
),
|
|
3968
3968
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3969
|
-
|
|
3969
|
+
_chunk2PEPIH26js.DetailField,
|
|
3970
3970
|
{
|
|
3971
3971
|
label: t("billing.admin.prices.fields.platformFeatures"),
|
|
3972
3972
|
className: "md:col-span-2",
|
|
3973
|
-
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,
|
|
3973
|
+
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, _chunk2PEPIH26js.Badge, { variant: "softGray", children: feature.name }, feature.id)) }) : "\u2014"
|
|
3974
3974
|
}
|
|
3975
3975
|
)
|
|
3976
3976
|
] })
|
|
@@ -3984,7 +3984,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, PriceDetails, "PriceDetails");
|
|
|
3984
3984
|
function PriceContainer() {
|
|
3985
3985
|
const { price } = usePriceContext();
|
|
3986
3986
|
if (!price) return null;
|
|
3987
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3987
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.RoundPageContainer, { module: _chunkS2C5V2XZjs.Modules.StripePrice, id: price.id, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PriceDetails, {}) });
|
|
3988
3988
|
}
|
|
3989
3989
|
_chunk7QVYU63Ejs.__name.call(void 0, PriceContainer, "PriceContainer");
|
|
3990
3990
|
|
|
@@ -3996,17 +3996,17 @@ _chunk7QVYU63Ejs.__name.call(void 0, PriceContainer, "PriceContainer");
|
|
|
3996
3996
|
function PricesList({ productId, fullWidth }) {
|
|
3997
3997
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
3998
3998
|
const { priceVersion } = usePriceContext();
|
|
3999
|
-
const data =
|
|
4000
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
3999
|
+
const data = _chunk2PEPIH26js.useDataListRetriever.call(void 0, {
|
|
4000
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkS2C5V2XZjs.StripePriceService.listPrices({ ...params, productId }), "retriever"),
|
|
4001
4001
|
retrieverParams: {},
|
|
4002
|
-
module:
|
|
4002
|
+
module: _chunkS2C5V2XZjs.Modules.StripePrice
|
|
4003
4003
|
});
|
|
4004
4004
|
_react.useEffect.call(void 0, () => {
|
|
4005
4005
|
if (priceVersion > 0) void data.refresh();
|
|
4006
4006
|
}, [priceVersion]);
|
|
4007
4007
|
const functions = [/* @__PURE__ */ _jsxruntime.jsx.call(void 0, PriceEditor, { productId }, "create-price")];
|
|
4008
4008
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4009
|
-
|
|
4009
|
+
_chunk2PEPIH26js.ContentListTable,
|
|
4010
4010
|
{
|
|
4011
4011
|
data,
|
|
4012
4012
|
fields: [
|
|
@@ -4016,12 +4016,12 @@ function PricesList({ productId, fullWidth }) {
|
|
|
4016
4016
|
"token" /* token */,
|
|
4017
4017
|
"status" /* status */
|
|
4018
4018
|
],
|
|
4019
|
-
tableGeneratorType:
|
|
4019
|
+
tableGeneratorType: _chunkS2C5V2XZjs.Modules.StripePrice,
|
|
4020
4020
|
functions,
|
|
4021
4021
|
fullWidth,
|
|
4022
4022
|
title: t("billing.admin.prices.title"),
|
|
4023
4023
|
emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4024
|
-
|
|
4024
|
+
_chunk2PEPIH26js.EmptyState,
|
|
4025
4025
|
{
|
|
4026
4026
|
icon: _lucidereact.DollarSignIcon,
|
|
4027
4027
|
title: t("billing.admin.prices.empty.title"),
|
|
@@ -4044,18 +4044,18 @@ function ProductDetails() {
|
|
|
4044
4044
|
const { product } = useProductContext();
|
|
4045
4045
|
if (!product) return null;
|
|
4046
4046
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
4047
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4047
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.SectionHeader, { children: t("billing.admin.products.tabs.details") }),
|
|
4048
4048
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
|
|
4049
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4049
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.DetailField, { label: t("billing.admin.products.fields.name"), value: product.name }),
|
|
4050
4050
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4051
|
-
|
|
4051
|
+
_chunk2PEPIH26js.DetailField,
|
|
4052
4052
|
{
|
|
4053
4053
|
label: t("billing.admin.products.fields.status"),
|
|
4054
|
-
value: product.active ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4054
|
+
value: product.active ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Badge, { variant: "softGreen", children: t("billing.admin.products.status.active") }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.Badge, { variant: "softGray", children: t("billing.admin.products.status.archived") })
|
|
4055
4055
|
}
|
|
4056
4056
|
),
|
|
4057
4057
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4058
|
-
|
|
4058
|
+
_chunk2PEPIH26js.DetailField,
|
|
4059
4059
|
{
|
|
4060
4060
|
label: t("billing.admin.products.fields.description"),
|
|
4061
4061
|
value: _nullishCoalesce(product.description, () => ( "\u2014")),
|
|
@@ -4063,14 +4063,14 @@ function ProductDetails() {
|
|
|
4063
4063
|
}
|
|
4064
4064
|
),
|
|
4065
4065
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4066
|
-
|
|
4066
|
+
_chunk2PEPIH26js.DetailField,
|
|
4067
4067
|
{
|
|
4068
4068
|
label: t("billing.admin.products.fields.prices"),
|
|
4069
4069
|
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: product.stripePrices.length })
|
|
4070
4070
|
}
|
|
4071
4071
|
),
|
|
4072
4072
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4073
|
-
|
|
4073
|
+
_chunk2PEPIH26js.DetailField,
|
|
4074
4074
|
{
|
|
4075
4075
|
label: t("billing.admin.products.fields.stripeId"),
|
|
4076
4076
|
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: product.stripeProductId })
|
|
@@ -4088,9 +4088,9 @@ function ProductContainer() {
|
|
|
4088
4088
|
const { product } = useProductContext();
|
|
4089
4089
|
if (!product) return null;
|
|
4090
4090
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4091
|
-
|
|
4091
|
+
_chunk2PEPIH26js.RoundPageContainer,
|
|
4092
4092
|
{
|
|
4093
|
-
module:
|
|
4093
|
+
module: _chunkS2C5V2XZjs.Modules.StripeProduct,
|
|
4094
4094
|
id: product.id,
|
|
4095
4095
|
tabs: [
|
|
4096
4096
|
{
|
|
@@ -4099,7 +4099,7 @@ function ProductContainer() {
|
|
|
4099
4099
|
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductDetails, {})
|
|
4100
4100
|
},
|
|
4101
4101
|
{
|
|
4102
|
-
key:
|
|
4102
|
+
key: _chunkS2C5V2XZjs.Modules.StripePrice,
|
|
4103
4103
|
label: t("billing.admin.prices.title"),
|
|
4104
4104
|
// publishChrome={false}: SharedProvider REPLACES its value for the
|
|
4105
4105
|
// subtree (SharedContext.tsx:35-37), so a nested provider publishing
|
|
@@ -4123,26 +4123,26 @@ _chunk7QVYU63Ejs.__name.call(void 0, ProductContainer, "ProductContainer");
|
|
|
4123
4123
|
function ProductsList({ fullWidth } = {}) {
|
|
4124
4124
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
4125
4125
|
const { catalogueVersion } = useProductContext();
|
|
4126
|
-
const data =
|
|
4127
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
4126
|
+
const data = _chunk2PEPIH26js.useDataListRetriever.call(void 0, {
|
|
4127
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkS2C5V2XZjs.StripeProductService.listProducts(params), "retriever"),
|
|
4128
4128
|
retrieverParams: {},
|
|
4129
|
-
module:
|
|
4129
|
+
module: _chunkS2C5V2XZjs.Modules.StripeProduct
|
|
4130
4130
|
});
|
|
4131
4131
|
_react.useEffect.call(void 0, () => {
|
|
4132
4132
|
if (catalogueVersion > 0) void data.refresh();
|
|
4133
4133
|
}, [catalogueVersion]);
|
|
4134
4134
|
const functions = [/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductEditor, {}, "create-product")];
|
|
4135
4135
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4136
|
-
|
|
4136
|
+
_chunk2PEPIH26js.ContentListTable,
|
|
4137
4137
|
{
|
|
4138
4138
|
data,
|
|
4139
4139
|
fields: ["name" /* name */, "status" /* status */, "prices" /* prices */],
|
|
4140
|
-
tableGeneratorType:
|
|
4140
|
+
tableGeneratorType: _chunkS2C5V2XZjs.Modules.StripeProduct,
|
|
4141
4141
|
functions,
|
|
4142
4142
|
fullWidth,
|
|
4143
4143
|
title: t("billing.admin.products.title"),
|
|
4144
4144
|
emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4145
|
-
|
|
4145
|
+
_chunk2PEPIH26js.EmptyState,
|
|
4146
4146
|
{
|
|
4147
4147
|
icon: _lucidereact.PackageIcon,
|
|
4148
4148
|
title: t("billing.admin.products.empty.title"),
|
|
@@ -4157,7 +4157,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, ProductsList, "ProductsList");
|
|
|
4157
4157
|
// src/features/billing/stripe-product/components/containers/ProductsListContainer.tsx
|
|
4158
4158
|
|
|
4159
4159
|
function ProductsListContainer() {
|
|
4160
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductProvider, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4160
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductProvider, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2PEPIH26js.RoundPageContainer, { module: _chunkS2C5V2XZjs.Modules.StripeProduct, fullWidth: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductsList, { fullWidth: true }) }) });
|
|
4161
4161
|
}
|
|
4162
4162
|
_chunk7QVYU63Ejs.__name.call(void 0, ProductsListContainer, "ProductsListContainer");
|
|
4163
4163
|
|
|
@@ -4215,5 +4215,5 @@ _chunk7QVYU63Ejs.__name.call(void 0, ProductsListContainer, "ProductsListContain
|
|
|
4215
4215
|
|
|
4216
4216
|
|
|
4217
4217
|
|
|
4218
|
-
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 =
|
|
4218
|
+
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 = _chunk2PEPIH26js.formatCurrency; exports.formatDate = formatDate3; exports.formatInterval = _chunk2PEPIH26js.formatInterval; exports.isStripeConfigured = isStripeConfigured; exports.priceLabel = priceLabel; exports.usePriceContext = usePriceContext; exports.useProductContext = useProductContext;
|
|
4219
4219
|
//# sourceMappingURL=index.js.map
|