@carlonicora/nextjs-jsonapi 4.2.0 → 4.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{BlockNoteEditor-HXAHDJA7.mjs → BlockNoteEditor-FROUKBVK.mjs} +2 -2
- package/dist/{BlockNoteEditor-LLCZDFLZ.js → BlockNoteEditor-SWO3X5CC.js} +9 -9
- package/dist/{BlockNoteEditor-LLCZDFLZ.js.map → BlockNoteEditor-SWO3X5CC.js.map} +1 -1
- package/dist/billing/index.js +371 -371
- package/dist/billing/index.mjs +1 -1
- package/dist/{chunk-2VXDZRYY.mjs → chunk-AICMLKWN.mjs} +21 -8
- package/dist/chunk-AICMLKWN.mjs.map +1 -0
- package/dist/{chunk-VDVIUDY5.js → chunk-GYW7LLBQ.js} +369 -356
- package/dist/chunk-GYW7LLBQ.js.map +1 -0
- package/dist/client/index.js +2 -2
- package/dist/client/index.mjs +1 -1
- package/dist/components/index.js +2 -2
- package/dist/components/index.mjs +1 -1
- package/dist/contexts/index.js +2 -2
- package/dist/contexts/index.mjs +1 -1
- package/dist/features/analytics/index.js +88 -88
- package/dist/features/analytics/index.mjs +1 -1
- package/dist/features/help/index.js +31 -31
- package/dist/features/help/index.mjs +1 -1
- package/dist/features/tokenusage/index.js +75 -75
- package/dist/features/tokenusage/index.mjs +1 -1
- package/package.json +1 -1
- package/src/components/tables/__tests__/ContentListTable.spec.tsx +1 -1
- package/src/hooks/__tests__/{useDataListRetriever.test.ts → useDataListRetriever.spec.ts} +57 -0
- package/src/hooks/useDataListRetriever.ts +38 -9
- package/src/shadcnui/ui/__tests__/{confirm-dialog.test.tsx → confirm-dialog.spec.tsx} +1 -1
- package/src/shadcnui/ui/__tests__/{cursor-controls.test.tsx → cursor-controls.spec.tsx} +1 -1
- package/src/shadcnui/ui/__tests__/{cursor-menu-items.test.tsx → cursor-menu-items.spec.tsx} +1 -1
- package/src/shadcnui/ui/__tests__/{empty-state.test.tsx → empty-state.spec.tsx} +1 -1
- package/src/shadcnui/ui/__tests__/{spinner.test.tsx → spinner.spec.tsx} +1 -1
- package/dist/chunk-2VXDZRYY.mjs.map +0 -1
- package/dist/chunk-VDVIUDY5.js.map +0 -1
- /package/dist/{BlockNoteEditor-HXAHDJA7.mjs.map → BlockNoteEditor-FROUKBVK.mjs.map} +0 -0
- /package/scripts/{check-rtl-classes.test.ts → check-rtl-classes.spec.ts} +0 -0
- /package/src/client/__tests__/{JsonApiClient.test.ts → JsonApiClient.spec.ts} +0 -0
- /package/src/client/__tests__/{request.test.ts → request.spec.ts} +0 -0
- /package/src/client/hooks/__tests__/{useJsonApiGet.test.tsx → useJsonApiGet.spec.tsx} +0 -0
- /package/src/client/hooks/__tests__/{useJsonApiMutation.test.tsx → useJsonApiMutation.spec.tsx} +0 -0
- /package/src/client/hooks/__tests__/{useRehydration.test.ts → useRehydration.spec.ts} +0 -0
- /package/src/components/editors/__tests__/{BlockNoteEditorAiActions.test.ts → BlockNoteEditorAiActions.spec.ts} +0 -0
- /package/src/components/editors/__tests__/{BlockNoteEditorMentionInlineContent.test.ts → BlockNoteEditorMentionInlineContent.spec.ts} +0 -0
- /package/src/components/forms/__tests__/{CommonEditorDiscardDialog.test.tsx → CommonEditorDiscardDialog.spec.tsx} +0 -0
- /package/src/components/forms/__tests__/{EditorSheet.test.tsx → EditorSheet.spec.tsx} +0 -0
- /package/src/components/forms/__tests__/{FormCheckbox.test.tsx → FormCheckbox.spec.tsx} +0 -0
- /package/src/components/forms/__tests__/{FormDate.test.tsx → FormDate.spec.tsx} +0 -0
- /package/src/components/forms/__tests__/{FormInput.test.tsx → FormInput.spec.tsx} +0 -0
- /package/src/components/forms/__tests__/{FormSelect.test.tsx → FormSelect.spec.tsx} +0 -0
- /package/src/components/forms/__tests__/{useEditorDialog.test.ts → useEditorDialog.spec.ts} +0 -0
- /package/src/components/grids/__tests__/{ContentListGrid.test.tsx → ContentListGrid.spec.tsx} +0 -0
- /package/src/components/tables/__tests__/{ContentListTable.test.tsx → ContentListTable.rendering.spec.tsx} +0 -0
- /package/src/contexts/__tests__/{DirectionContext.test.tsx → DirectionContext.spec.tsx} +0 -0
- /package/src/contexts/__tests__/{SessionContext.test.tsx → SessionContext.spec.tsx} +0 -0
- /package/src/contexts/__tests__/{SocketContext.session.test.tsx → SocketContext.session.spec.tsx} +0 -0
- /package/src/core/abstracts/__tests__/{AbstractService.locale.test.ts → AbstractService.locale.spec.ts} +0 -0
- /package/src/core/endpoint/__tests__/{EndpointCreator.test.ts → EndpointCreator.spec.ts} +0 -0
- /package/src/core/factories/__tests__/{JsonApiDataFactory.test.ts → JsonApiDataFactory.spec.ts} +0 -0
- /package/src/core/factories/__tests__/{RehydrationFactory.test.ts → RehydrationFactory.spec.ts} +0 -0
- /package/src/core/registry/__tests__/{DataClassRegistry.test.ts → DataClassRegistry.spec.ts} +0 -0
- /package/src/core/registry/__tests__/{ModuleRegistrar.test.ts → ModuleRegistrar.spec.ts} +0 -0
- /package/src/core/registry/__tests__/{viewportStore.test.ts → viewportStore.spec.ts} +0 -0
- /package/src/core/utils/__tests__/{translateResponse.test.ts → translateResponse.spec.ts} +0 -0
- /package/src/features/ai-connection/data/__tests__/{ai-connection.test.ts → ai-connection.spec.ts} +0 -0
- /package/src/features/company/data/{company.test.ts → company.spec.ts} +0 -0
- /package/src/features/company/hooks/{useSubscriptionStatus.test.ts → useSubscriptionStatus.spec.ts} +0 -0
- /package/src/features/user/data/__tests__/{user.test.ts → user.spec.ts} +0 -0
- /package/src/hooks/__tests__/{useDebounce.test.ts → useDebounce.spec.ts} +0 -0
- /package/src/hooks/__tests__/{useSocket.render.test.ts → useSocket.render.spec.ts} +0 -0
- /package/src/i18n/__tests__/{config.test.ts → config.spec.ts} +0 -0
- /package/src/lib/__tests__/{direction.test.ts → direction.spec.ts} +0 -0
- /package/src/next-config/__tests__/{createNextConfig.test.ts → createNextConfig.spec.ts} +0 -0
- /package/src/server/__tests__/{JsonApiServer.test.ts → JsonApiServer.spec.ts} +0 -0
- /package/src/server/__tests__/{ServerSession.read.test.ts → ServerSession.read.spec.ts} +0 -0
- /package/src/server/__tests__/{cache.test.ts → cache.spec.ts} +0 -0
- /package/src/server/__tests__/{cachedGet.test.ts → cachedGet.spec.ts} +0 -0
- /package/src/server/__tests__/{request.test.ts → request.spec.ts} +0 -0
- /package/src/shadcnui/ui/__tests__/{sidebar.menu-skeleton.test.tsx → sidebar.menu-skeleton.spec.tsx} +0 -0
- /package/src/shadcnui/ui/__tests__/{sidebar.session.test.tsx → sidebar.session.spec.tsx} +0 -0
- /package/src/shadcnui/ui/__tests__/{use-ui-text.test.tsx → use-ui-text.spec.tsx} +0 -0
- /package/src/unified/__tests__/{JsonApiGet.cache.test.ts → JsonApiGet.cache.spec.ts} +0 -0
- /package/src/unified/__tests__/{JsonApiRequest.test.ts → JsonApiRequest.spec.ts} +0 -0
- /package/src/utils/__tests__/{date-formatter.test.ts → date-formatter.spec.ts} +0 -0
- /package/src/utils/__tests__/{exists.test.ts → exists.spec.ts} +0 -0
- /package/src/utils/__tests__/{italian-validators.test.ts → italian-validators.spec.ts} +0 -0
- /package/src/utils/__tests__/{map-thenable.test.ts → map-thenable.spec.ts} +0 -0
- /package/src/utils/__tests__/{use-mobile.test.tsx → use-mobile.spec.tsx} +0 -0
- /package/src/utils/{cn.test.ts → cn.spec.ts} +0 -0
- /package/src/utils/{isRemoteImageSrc.test.ts → isRemoteImageSrc.spec.ts} +0 -0
package/dist/billing/index.js
CHANGED
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
|
|
66
66
|
|
|
67
67
|
|
|
68
|
-
var
|
|
68
|
+
var _chunkGYW7LLBQjs = require('../chunk-GYW7LLBQ.js');
|
|
69
69
|
|
|
70
70
|
|
|
71
71
|
var _chunkGPXYQMOZjs = require('../chunk-GPXYQMOZ.js');
|
|
@@ -134,43 +134,43 @@ function SubscriptionSummaryCard({
|
|
|
134
134
|
onManageClick
|
|
135
135
|
}) {
|
|
136
136
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
137
|
-
const fmt =
|
|
137
|
+
const fmt = _chunkGYW7LLBQjs.useBillingFormatOptions.call(void 0, );
|
|
138
138
|
if (loading) {
|
|
139
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
140
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
141
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
139
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.Card, { children: [
|
|
140
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
141
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.CardTitle, { children: t("billing.ui.subscriptions.title") }),
|
|
142
142
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-4 w-4 text-muted-foreground" })
|
|
143
143
|
] }),
|
|
144
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
145
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
146
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
147
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
144
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.CardContent, { children: [
|
|
145
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Skeleton, { className: "h-6 w-32 mb-2" }),
|
|
146
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Skeleton, { className: "h-4 w-24 mb-1" }),
|
|
147
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Skeleton, { className: "h-4 w-40" })
|
|
148
148
|
] })
|
|
149
149
|
] });
|
|
150
150
|
}
|
|
151
151
|
if (error) {
|
|
152
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
153
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
154
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
152
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.Card, { children: [
|
|
153
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
154
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.CardTitle, { children: t("billing.ui.subscriptions.title") }),
|
|
155
155
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-4 w-4 text-muted-foreground" })
|
|
156
156
|
] }),
|
|
157
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
157
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
|
|
158
158
|
] });
|
|
159
159
|
}
|
|
160
160
|
const activeSubscriptions = subscriptions.filter(
|
|
161
161
|
(sub) => sub.status === "active" /* ACTIVE */ || sub.status === "trialing" /* TRIALING */
|
|
162
162
|
);
|
|
163
163
|
const primarySubscription = activeSubscriptions[0];
|
|
164
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
165
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
166
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
164
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onManageClick, children: [
|
|
165
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
166
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.CardTitle, { children: t("billing.ui.subscriptions.title") }),
|
|
167
167
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-4 w-4 text-muted-foreground" })
|
|
168
168
|
] }),
|
|
169
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
169
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.CardContent, { children: subscriptions.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
170
170
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: t("billing.ui.cards.subscriptions.empty_title") }),
|
|
171
171
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: t("billing.ui.cards.subscriptions.empty_description") }),
|
|
172
172
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
173
|
-
|
|
173
|
+
_chunkGYW7LLBQjs.Button,
|
|
174
174
|
{
|
|
175
175
|
variant: "outline",
|
|
176
176
|
size: "sm",
|
|
@@ -189,7 +189,7 @@ function SubscriptionSummaryCard({
|
|
|
189
189
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
|
|
190
190
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold", children: formatPlanName(primarySubscription, t("billing.ui.cards.subscriptions.fallback_name")) }),
|
|
191
191
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
192
|
-
|
|
192
|
+
_chunkGYW7LLBQjs.Badge,
|
|
193
193
|
{
|
|
194
194
|
variant: primarySubscription.cancelAtPeriodEnd ? "secondary" : getStatusBadgeVariant(primarySubscription.status),
|
|
195
195
|
children: primarySubscription.cancelAtPeriodEnd ? t("billing.ui.cards.subscriptions.canceling") : SUBSCRIPTION_STATUSES.includes(primarySubscription.status) ? t(`billing.ui.subscription_status.${primarySubscription.status}`) : primarySubscription.status
|
|
@@ -197,11 +197,11 @@ function SubscriptionSummaryCard({
|
|
|
197
197
|
)
|
|
198
198
|
] }),
|
|
199
199
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: !_optionalChain([primarySubscription, 'access', _8 => _8.price, 'optionalAccess', _9 => _9.isTrial]) ? t("billing.ui.cards.subscriptions.ends_on", {
|
|
200
|
-
date:
|
|
200
|
+
date: _chunkGYW7LLBQjs.formatDate.call(void 0, primarySubscription.currentPeriodEnd, fmt)
|
|
201
201
|
}) : primarySubscription.cancelAtPeriodEnd ? t("billing.ui.cards.subscriptions.cancels_on", {
|
|
202
|
-
date:
|
|
202
|
+
date: _chunkGYW7LLBQjs.formatDate.call(void 0, primarySubscription.currentPeriodEnd, fmt)
|
|
203
203
|
}) : t("billing.ui.cards.subscriptions.renews_on", {
|
|
204
|
-
date:
|
|
204
|
+
date: _chunkGYW7LLBQjs.formatDate.call(void 0, primarySubscription.currentPeriodEnd, fmt)
|
|
205
205
|
}) }),
|
|
206
206
|
activeSubscriptions.length > 1 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: t("billing.ui.cards.subscriptions.more", { count: activeSubscriptions.length - 1 }) })
|
|
207
207
|
] }) : null })
|
|
@@ -235,37 +235,37 @@ function PaymentMethodSummaryCard({
|
|
|
235
235
|
}) {
|
|
236
236
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
237
237
|
if (loading) {
|
|
238
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
239
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
240
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
238
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.Card, { children: [
|
|
239
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
240
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.CardTitle, { children: t("billing.ui.payment_method.title") }),
|
|
241
241
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Wallet, { className: "h-4 w-4 text-muted-foreground" })
|
|
242
242
|
] }),
|
|
243
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
244
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
245
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
243
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.CardContent, { children: [
|
|
244
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Skeleton, { className: "h-6 w-32 mb-2" }),
|
|
245
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Skeleton, { className: "h-4 w-24" })
|
|
246
246
|
] })
|
|
247
247
|
] });
|
|
248
248
|
}
|
|
249
249
|
if (error) {
|
|
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, _chunkGYW7LLBQjs.Card, { children: [
|
|
251
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
252
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.CardTitle, { children: t("billing.ui.payment_method.title") }),
|
|
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, _chunkGYW7LLBQjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
|
|
256
256
|
] });
|
|
257
257
|
}
|
|
258
258
|
const defaultMethod = paymentMethods.find((pm) => pm.id === defaultPaymentMethodId) || paymentMethods[0];
|
|
259
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
260
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
261
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
259
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onManageClick, children: [
|
|
260
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
261
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.CardTitle, { children: t("billing.ui.payment_method.title") }),
|
|
262
262
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Wallet, { className: "h-4 w-4 text-muted-foreground" })
|
|
263
263
|
] }),
|
|
264
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
264
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.CardContent, { children: paymentMethods.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
265
265
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: t("billing.ui.cards.payment_method.empty_title") }),
|
|
266
266
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: t("billing.ui.cards.payment_method.empty_description") }),
|
|
267
267
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
268
|
-
|
|
268
|
+
_chunkGYW7LLBQjs.Button,
|
|
269
269
|
{
|
|
270
270
|
variant: "outline",
|
|
271
271
|
size: "sm",
|
|
@@ -329,45 +329,45 @@ 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, _chunkGYW7LLBQjs.Card, { children: [
|
|
333
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
334
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.CardTitle, { children: t("billing.ui.cards.customer.title") }),
|
|
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, _chunkGYW7LLBQjs.CardContent, { children: [
|
|
338
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Skeleton, { className: "h-6 w-32 mb-2" }),
|
|
339
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Skeleton, { className: "h-4 w-48 mb-1" }),
|
|
340
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.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, _chunkGYW7LLBQjs.Card, { children: [
|
|
346
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
347
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.CardTitle, { children: t("billing.ui.cards.customer.title") }),
|
|
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, _chunkGYW7LLBQjs.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, _chunkGYW7LLBQjs.Card, { children: [
|
|
355
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
356
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.CardTitle, { children: t("billing.ui.cards.customer.title") }),
|
|
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, _chunkGYW7LLBQjs.CardContent, { children: [
|
|
360
360
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: t("billing.ui.cards.customer.not_set_up") }),
|
|
361
361
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: t("billing.ui.cards.customer.not_set_up_description") })
|
|
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, _chunkGYW7LLBQjs.Card, { children: [
|
|
366
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
367
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.CardTitle, { children: t("billing.ui.cards.customer.title") }),
|
|
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, _chunkGYW7LLBQjs.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: [
|
|
@@ -377,7 +377,7 @@ function CustomerInfoCard({ customer, loading, error }) {
|
|
|
377
377
|
] }),
|
|
378
378
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: customer.balance < 0 ? "text-success" : "text-destructive", children: formatBalance(customer.balance, customer.currency, locale) })
|
|
379
379
|
] }),
|
|
380
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
380
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.Button, { variant: "outline", size: "sm", className: "mt-2", onClick: handlePortalClick, disabled: portalLoading, children: [
|
|
381
381
|
portalLoading ? t("common.loading") : t("billing.ui.cards.customer.manage_portal"),
|
|
382
382
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ExternalLink, { className: "h-4 w-4 ms-1" })
|
|
383
383
|
] })
|
|
@@ -415,46 +415,46 @@ function formatAmount(amount, currency, locale) {
|
|
|
415
415
|
_chunk7QVYU63Ejs.__name.call(void 0, formatAmount, "formatAmount");
|
|
416
416
|
function InvoicesSummaryCard({ invoices, loading, error, onViewAllClick }) {
|
|
417
417
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
418
|
-
const fmt =
|
|
418
|
+
const fmt = _chunkGYW7LLBQjs.useBillingFormatOptions.call(void 0, );
|
|
419
419
|
if (loading) {
|
|
420
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
421
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
422
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
420
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.Card, { children: [
|
|
421
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
422
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.CardTitle, { children: t("billing.ui.cards.invoices.title") }),
|
|
423
423
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ReceiptIcon, { className: "h-4 w-4 text-muted-foreground" })
|
|
424
424
|
] }),
|
|
425
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
426
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
427
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
428
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
425
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.CardContent, { children: [
|
|
426
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Skeleton, { className: "h-6 w-24 mb-2" }),
|
|
427
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Skeleton, { className: "h-4 w-32 mb-1" }),
|
|
428
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Skeleton, { className: "h-4 w-20" })
|
|
429
429
|
] })
|
|
430
430
|
] });
|
|
431
431
|
}
|
|
432
432
|
if (error) {
|
|
433
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
434
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
435
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
433
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.Card, { children: [
|
|
434
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
435
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.CardTitle, { children: t("billing.ui.cards.invoices.title") }),
|
|
436
436
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ReceiptIcon, { className: "h-4 w-4 text-muted-foreground" })
|
|
437
437
|
] }),
|
|
438
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
438
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
|
|
439
439
|
] });
|
|
440
440
|
}
|
|
441
441
|
const latestInvoice = invoices[0];
|
|
442
442
|
const paidInvoices = invoices.filter((inv) => inv.status === "paid" /* PAID */);
|
|
443
443
|
const openInvoices = invoices.filter((inv) => inv.status === "open" /* OPEN */);
|
|
444
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
445
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
446
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
444
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onViewAllClick, children: [
|
|
445
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
446
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.CardTitle, { children: t("billing.ui.cards.invoices.title") }),
|
|
447
447
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ReceiptIcon, { className: "h-4 w-4 text-muted-foreground" })
|
|
448
448
|
] }),
|
|
449
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
449
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.CardContent, { children: invoices.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
450
450
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: t("billing.ui.invoices.empty_title") }),
|
|
451
451
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: t("billing.ui.cards.invoices.empty_description") })
|
|
452
452
|
] }) : latestInvoice ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
453
453
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
|
|
454
454
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold", children: formatAmount(latestInvoice.total, latestInvoice.currency, fmt.locale) }),
|
|
455
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
455
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Badge, { variant: getStatusBadgeVariant2(latestInvoice.status), children: INVOICE_STATUSES.includes(latestInvoice.status) ? t(`billing.ui.invoice_status.${latestInvoice.status}`) : latestInvoice.status })
|
|
456
456
|
] }),
|
|
457
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: latestInvoice.stripeInvoiceNumber || t("billing.ui.cards.invoices.invoice_from", { date:
|
|
457
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: latestInvoice.stripeInvoiceNumber || t("billing.ui.cards.invoices.invoice_from", { date: _chunkGYW7LLBQjs.formatDate.call(void 0, latestInvoice.periodStart, fmt) }) }),
|
|
458
458
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-4 text-xs text-muted-foreground", children: [
|
|
459
459
|
paidInvoices.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: t("billing.ui.cards.invoices.paid_count", { count: paidInvoices.length }) }),
|
|
460
460
|
openInvoices.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-warning", children: t("billing.ui.cards.invoices.open_count", { count: openInvoices.length }) }),
|
|
@@ -489,24 +489,24 @@ function BillingUsageSummaryCard({
|
|
|
489
489
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
490
490
|
const locale = _chunk4ORLPEK7js.useI18nLocale.call(void 0, );
|
|
491
491
|
if (loading) {
|
|
492
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
493
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
494
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
492
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.Card, { children: [
|
|
493
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
494
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.CardTitle, { children: t("billing.ui.cards.usage.title") }),
|
|
495
495
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Activity, { className: "h-4 w-4 text-muted-foreground" })
|
|
496
496
|
] }),
|
|
497
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
498
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
499
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
497
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.CardContent, { children: [
|
|
498
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Skeleton, { className: "h-6 w-24 mb-2" }),
|
|
499
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Skeleton, { className: "h-4 w-32" })
|
|
500
500
|
] })
|
|
501
501
|
] });
|
|
502
502
|
}
|
|
503
503
|
if (error) {
|
|
504
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
505
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
506
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
504
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.Card, { children: [
|
|
505
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
506
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.CardTitle, { children: t("billing.ui.cards.usage.title") }),
|
|
507
507
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Activity, { className: "h-4 w-4 text-muted-foreground" })
|
|
508
508
|
] }),
|
|
509
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
509
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
|
|
510
510
|
] });
|
|
511
511
|
}
|
|
512
512
|
const totalUsage = Object.values(summaries).reduce((acc, summary) => {
|
|
@@ -514,12 +514,12 @@ function BillingUsageSummaryCard({
|
|
|
514
514
|
}, 0);
|
|
515
515
|
const primaryMeter = meters.find((m) => _optionalChain([summaries, 'access', _17 => _17[m.id], 'optionalAccess', _18 => _18.aggregatedValue]));
|
|
516
516
|
const primarySummary = primaryMeter ? summaries[primaryMeter.id] : null;
|
|
517
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
518
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
519
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
517
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onViewDetailsClick, children: [
|
|
518
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
519
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.CardTitle, { children: t("billing.ui.cards.usage.title") }),
|
|
520
520
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Activity, { className: "h-4 w-4 text-muted-foreground" })
|
|
521
521
|
] }),
|
|
522
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
522
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.CardContent, { children: meters.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
523
523
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: t("billing.ui.cards.usage.no_meters") }),
|
|
524
524
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: t("billing.ui.cards.usage.no_meters_description") })
|
|
525
525
|
] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
@@ -625,7 +625,7 @@ function PaymentMethodForm({ onSuccess, onCancel, isLoading = false }) {
|
|
|
625
625
|
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: t("billing.ui.payment_form.loading") }) });
|
|
626
626
|
}
|
|
627
627
|
if (!setupIntent && error) {
|
|
628
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
628
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Alert, { variant: "destructive", className: "bg-red-50 border-red-200", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.AlertDescription, { children: error }) });
|
|
629
629
|
}
|
|
630
630
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: handleSubmit, className: "flex flex-col gap-y-4", children: [
|
|
631
631
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rounded-md border border-gray-300 p-3", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -648,13 +648,13 @@ function PaymentMethodForm({ onSuccess, onCancel, isLoading = false }) {
|
|
|
648
648
|
}
|
|
649
649
|
) }),
|
|
650
650
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-2", children: [
|
|
651
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
652
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
651
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Checkbox, { id: "setAsDefault", checked: setAsDefault, onCheckedChange: (checked) => setSetAsDefault(!!checked) }),
|
|
652
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Label, { htmlFor: "setAsDefault", className: "cursor-pointer font-normal", children: t("billing.ui.payment_form.set_default") })
|
|
653
653
|
] }),
|
|
654
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
654
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Alert, { variant: "destructive", className: "bg-red-50 border-red-200", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.AlertDescription, { children: error }) }),
|
|
655
655
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-end gap-x-2", children: [
|
|
656
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
657
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
656
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Button, { type: "button", variant: "outline", onClick: onCancel, disabled: isSubmitting || isLoading, children: t("ui.buttons.cancel") }),
|
|
657
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Button, { type: "submit", disabled: !stripe || isSubmitting || isLoading, children: isSubmitting ? t("billing.ui.wizard.review.processing") : t("billing.ui.cards.payment_method.add_card") })
|
|
658
658
|
] })
|
|
659
659
|
] });
|
|
660
660
|
}
|
|
@@ -671,10 +671,10 @@ function PaymentMethodEditor({ open, onOpenChange, onSuccess }) {
|
|
|
671
671
|
const handleCancel = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
672
672
|
onOpenChange(false);
|
|
673
673
|
}, "handleCancel");
|
|
674
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
675
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
676
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
677
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
674
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.DialogContent, { className: "max-w-md", children: [
|
|
675
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.DialogHeader, { children: [
|
|
676
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.DialogTitle, { children: t("billing.ui.payment_methods.add") }),
|
|
677
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.DialogDescription, { children: t("billing.ui.payment_methods.add_description") })
|
|
678
678
|
] }),
|
|
679
679
|
open && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PaymentMethodForm, { onSuccess: handleSuccess, onCancel: handleCancel })
|
|
680
680
|
] }) });
|
|
@@ -737,16 +737,16 @@ function PaymentMethodCard({ paymentMethod, onUpdate }) {
|
|
|
737
737
|
}
|
|
738
738
|
}, "handleRemove");
|
|
739
739
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
740
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
741
|
-
isDefault && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
742
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
740
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.Card, { className: "relative", children: [
|
|
741
|
+
isDefault && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Badge, { variant: "softGreen", className: "absolute end-2 top-2", children: t("billing.ui.payment_methods.default") }),
|
|
742
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.CardHeader, { className: "flex flex-row items-center justify-between pb-2", children: [
|
|
743
743
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-2", children: [
|
|
744
744
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-2xl", children: brandIcon }),
|
|
745
745
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium capitalize", children: brand })
|
|
746
746
|
] }),
|
|
747
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
748
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
749
|
-
|
|
747
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.DropdownMenu, { children: [
|
|
748
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.DropdownMenuTrigger, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
749
|
+
_chunkGYW7LLBQjs.Button,
|
|
750
750
|
{
|
|
751
751
|
render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", {}),
|
|
752
752
|
nativeButton: false,
|
|
@@ -757,10 +757,10 @@ function PaymentMethodCard({ paymentMethod, onUpdate }) {
|
|
|
757
757
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.MoreVertical, { className: "h-4 w-4" })
|
|
758
758
|
}
|
|
759
759
|
) }),
|
|
760
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
761
|
-
!isDefault && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
760
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.DropdownMenuContent, { align: "end", children: [
|
|
761
|
+
!isDefault && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.DropdownMenuItem, { onClick: handleSetDefault, disabled: loading, children: t("billing.ui.payment_methods.set_default") }),
|
|
762
762
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
763
|
-
|
|
763
|
+
_chunkGYW7LLBQjs.DropdownMenuItem,
|
|
764
764
|
{
|
|
765
765
|
onClick: () => setShowRemoveDialog(true),
|
|
766
766
|
disabled: loading,
|
|
@@ -771,7 +771,7 @@ function PaymentMethodCard({ paymentMethod, onUpdate }) {
|
|
|
771
771
|
] })
|
|
772
772
|
] })
|
|
773
773
|
] }),
|
|
774
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
774
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-1", children: [
|
|
775
775
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "text-lg font-semibold", children: [
|
|
776
776
|
"\u2022\u2022\u2022\u2022 ",
|
|
777
777
|
last4
|
|
@@ -779,17 +779,17 @@ function PaymentMethodCard({ paymentMethod, onUpdate }) {
|
|
|
779
779
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: t("billing.ui.payment_method.expires", { date: `${String(expMonth).padStart(2, "0")}/${expYear}` }) })
|
|
780
780
|
] }) })
|
|
781
781
|
] }),
|
|
782
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
783
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
784
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
785
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
782
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.AlertDialog, { open: showRemoveDialog, onOpenChange: setShowRemoveDialog, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.AlertDialogContent, { children: [
|
|
783
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.AlertDialogHeader, { children: [
|
|
784
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.AlertDialogTitle, { children: t("billing.ui.payment_methods.remove_title") }),
|
|
785
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.AlertDialogDescription, { children: [
|
|
786
786
|
t("billing.ui.payment_methods.remove_description"),
|
|
787
787
|
isDefault && ` ${t("billing.ui.payment_methods.remove_default_warning")}`
|
|
788
788
|
] })
|
|
789
789
|
] }),
|
|
790
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
791
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
792
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
790
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.AlertDialogFooter, { children: [
|
|
791
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.AlertDialogCancel, { disabled: loading, children: t("ui.buttons.cancel") }),
|
|
792
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.AlertDialogAction, { onClick: handleRemove, disabled: loading, className: "bg-red-600 hover:bg-red-700", children: loading ? t("billing.ui.payment_methods.removing") : t("ui.buttons.remove") })
|
|
793
793
|
] })
|
|
794
794
|
] }) })
|
|
795
795
|
] });
|
|
@@ -833,14 +833,14 @@ function PaymentMethodsContainer() {
|
|
|
833
833
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-8 w-8" }),
|
|
834
834
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h1", { className: "text-primary text-3xl font-semibold", children: t("billing.ui.payment_methods.title") })
|
|
835
835
|
] }),
|
|
836
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
836
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Button, { onClick: () => setShowAddPaymentMethod(true), children: t("billing.ui.payment_methods.add") })
|
|
837
837
|
] }),
|
|
838
838
|
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: [
|
|
839
839
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-16 w-16 text-muted-foreground" }),
|
|
840
840
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-center", children: [
|
|
841
841
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "mb-2 text-sm font-medium", children: t("billing.ui.payment_methods.empty_title") }),
|
|
842
842
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "mb-4 text-muted-foreground", children: t("billing.ui.payment_methods.empty_description") }),
|
|
843
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
843
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Button, { onClick: () => setShowAddPaymentMethod(true), children: t("billing.ui.payment_methods.add_first") })
|
|
844
844
|
] })
|
|
845
845
|
] }),
|
|
846
846
|
paymentMethods.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PaymentMethodsList, { paymentMethods, onUpdate: loadPaymentMethods }),
|
|
@@ -896,7 +896,7 @@ var statusConfig = {
|
|
|
896
896
|
function InvoiceStatusBadge({ status }) {
|
|
897
897
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
898
898
|
const config = statusConfig[status] || statusConfig["draft" /* DRAFT */];
|
|
899
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
899
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Badge, { variant: config.variant, children: t(config.label) });
|
|
900
900
|
}
|
|
901
901
|
_chunk7QVYU63Ejs.__name.call(void 0, InvoiceStatusBadge, "InvoiceStatusBadge");
|
|
902
902
|
|
|
@@ -909,7 +909,7 @@ function InvoiceDetails({
|
|
|
909
909
|
onInvoiceChange: _onInvoiceChange
|
|
910
910
|
}) {
|
|
911
911
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
912
|
-
const fmt =
|
|
912
|
+
const fmt = _chunkGYW7LLBQjs.useBillingFormatOptions.call(void 0, );
|
|
913
913
|
const handleDownloadPDF = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
914
914
|
if (invoice.stripePdfUrl) {
|
|
915
915
|
window.open(invoice.stripePdfUrl, "_blank");
|
|
@@ -929,10 +929,10 @@ function InvoiceDetails({
|
|
|
929
929
|
return invoice.stripeInvoiceId.slice(-8);
|
|
930
930
|
}, "getInvoiceNumber");
|
|
931
931
|
const productName = _optionalChain([invoice, 'access', _29 => _29.subscription, 'optionalAccess', _30 => _30.price, 'optionalAccess', _31 => _31.product, 'optionalAccess', _32 => _32.name]) || t("billing.ui.cards.subscriptions.fallback_name");
|
|
932
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
933
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
934
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
935
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
932
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.DialogContent, { className: "max-w-2xl", children: [
|
|
933
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.DialogHeader, { children: [
|
|
934
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.DialogTitle, { children: t("billing.ui.invoice.title", { number: getInvoiceNumber() }) }),
|
|
935
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.DialogDescription, { children: _chunkGYW7LLBQjs.formatDate.call(void 0, invoice.periodStart, fmt) })
|
|
936
936
|
] }),
|
|
937
937
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-6", children: [
|
|
938
938
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-3", children: [
|
|
@@ -943,18 +943,18 @@ function InvoiceDetails({
|
|
|
943
943
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
|
|
944
944
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("billing.ui.invoice.billing_period") }),
|
|
945
945
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "text-sm", children: [
|
|
946
|
-
|
|
946
|
+
_chunkGYW7LLBQjs.formatDate.call(void 0, invoice.periodStart, fmt),
|
|
947
947
|
" - ",
|
|
948
|
-
|
|
948
|
+
_chunkGYW7LLBQjs.formatDate.call(void 0, invoice.periodEnd, fmt)
|
|
949
949
|
] })
|
|
950
950
|
] }),
|
|
951
951
|
invoice.dueDate && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
|
|
952
952
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("billing.ui.invoice.due_date") }),
|
|
953
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm", children:
|
|
953
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm", children: _chunkGYW7LLBQjs.formatDate.call(void 0, invoice.dueDate, fmt) })
|
|
954
954
|
] }),
|
|
955
955
|
invoice.paidAt && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
|
|
956
956
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("billing.ui.invoice.paid_date") }),
|
|
957
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm", children:
|
|
957
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm", children: _chunkGYW7LLBQjs.formatDate.call(void 0, invoice.paidAt, fmt) })
|
|
958
958
|
] }),
|
|
959
959
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
|
|
960
960
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("billing.ui.invoice.attempt_count") }),
|
|
@@ -970,42 +970,42 @@ function InvoiceDetails({
|
|
|
970
970
|
] }) }),
|
|
971
971
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "tbody", { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "tr", { className: "border-t", children: [
|
|
972
972
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { className: "p-3", children: productName }),
|
|
973
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { className: "p-3 text-end", children:
|
|
973
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { className: "p-3 text-end", children: _chunkGYW7LLBQjs.formatCurrency.call(void 0, invoice.subtotal, invoice.currency, fmt) })
|
|
974
974
|
] }) })
|
|
975
975
|
] }) })
|
|
976
976
|
] }),
|
|
977
977
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2 border-t pt-4", children: [
|
|
978
978
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between", children: [
|
|
979
979
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("billing.ui.invoice.subtotal") }),
|
|
980
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm", children:
|
|
980
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm", children: _chunkGYW7LLBQjs.formatCurrency.call(void 0, invoice.subtotal, invoice.currency, fmt) })
|
|
981
981
|
] }),
|
|
982
982
|
invoice.tax !== void 0 && invoice.tax > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between", children: [
|
|
983
983
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("billing.ui.invoice.tax") }),
|
|
984
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm", children:
|
|
984
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm", children: _chunkGYW7LLBQjs.formatCurrency.call(void 0, invoice.tax, invoice.currency, fmt) })
|
|
985
985
|
] }),
|
|
986
986
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between text-lg font-semibold border-t pt-2", children: [
|
|
987
987
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: t("billing.ui.invoice.total") }),
|
|
988
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children:
|
|
988
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _chunkGYW7LLBQjs.formatCurrency.call(void 0, invoice.total, invoice.currency, fmt) })
|
|
989
989
|
] }),
|
|
990
990
|
invoice.amountPaid > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between", children: [
|
|
991
991
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("billing.ui.invoice.amount_paid") }),
|
|
992
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm text-success", children:
|
|
992
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm text-success", children: _chunkGYW7LLBQjs.formatCurrency.call(void 0, invoice.amountPaid, invoice.currency, fmt) })
|
|
993
993
|
] }),
|
|
994
994
|
invoice.amountRemaining > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between", children: [
|
|
995
995
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("billing.ui.invoice.amount_due") }),
|
|
996
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm text-destructive", children:
|
|
996
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm text-destructive", children: _chunkGYW7LLBQjs.formatCurrency.call(void 0, invoice.amountRemaining, invoice.currency, fmt) })
|
|
997
997
|
] })
|
|
998
998
|
] }),
|
|
999
999
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-wrap gap-2 pt-4 border-t", children: [
|
|
1000
|
-
invoice.stripePdfUrl && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1000
|
+
invoice.stripePdfUrl && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.Button, { variant: "outline", onClick: handleDownloadPDF, children: [
|
|
1001
1001
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Download, { className: "me-2 h-4 w-4" }),
|
|
1002
1002
|
t("billing.ui.invoice.download_pdf")
|
|
1003
1003
|
] }),
|
|
1004
|
-
invoice.status === "open" /* OPEN */ && invoice.attempted && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1004
|
+
invoice.status === "open" /* OPEN */ && invoice.attempted && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.Button, { variant: "default", onClick: handleRetryPayment, children: [
|
|
1005
1005
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.RefreshCw, { className: "me-2 h-4 w-4" }),
|
|
1006
1006
|
t("billing.ui.invoice.retry_payment")
|
|
1007
1007
|
] }),
|
|
1008
|
-
invoice.stripeHostedInvoiceUrl && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1008
|
+
invoice.stripeHostedInvoiceUrl && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.Button, { variant: "outline", onClick: handleViewInStripe, children: [
|
|
1009
1009
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ExternalLink, { className: "me-2 h-4 w-4" }),
|
|
1010
1010
|
t("billing.ui.invoice.view_in_stripe")
|
|
1011
1011
|
] })
|
|
@@ -1019,7 +1019,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, InvoiceDetails, "InvoiceDetails");
|
|
|
1019
1019
|
|
|
1020
1020
|
function InvoicesList({ invoices, onInvoicesChange }) {
|
|
1021
1021
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1022
|
-
const fmt =
|
|
1022
|
+
const fmt = _chunkGYW7LLBQjs.useBillingFormatOptions.call(void 0, );
|
|
1023
1023
|
const [selectedInvoice, setSelectedInvoice] = _react.useState.call(void 0, null);
|
|
1024
1024
|
const handleRowClick = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (invoice) => {
|
|
1025
1025
|
setSelectedInvoice(invoice);
|
|
@@ -1031,30 +1031,30 @@ function InvoicesList({ invoices, onInvoicesChange }) {
|
|
|
1031
1031
|
return invoice.stripeInvoiceId.slice(-8);
|
|
1032
1032
|
}, "getInvoiceNumber");
|
|
1033
1033
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1034
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border rounded-lg overflow-clip", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1035
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1036
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1037
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1038
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1039
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1040
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1034
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border rounded-lg overflow-clip", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.Table, { children: [
|
|
1035
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TableHeader, { className: "bg-muted", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.TableRow, { children: [
|
|
1036
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TableHead, { children: t("billing.ui.columns.invoice_number") }),
|
|
1037
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TableHead, { children: t("billing.ui.columns.date") }),
|
|
1038
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TableHead, { children: t("billing.ui.columns.status") }),
|
|
1039
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TableHead, { className: "text-end", children: t("billing.ui.columns.amount") }),
|
|
1040
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TableHead, { children: t("billing.ui.columns.period") })
|
|
1041
1041
|
] }) }),
|
|
1042
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1042
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TableBody, { children: invoices.map((invoice) => {
|
|
1043
1043
|
const invoiceNumber = getInvoiceNumber(invoice);
|
|
1044
|
-
const date =
|
|
1045
|
-
const amount =
|
|
1046
|
-
const period = `${
|
|
1044
|
+
const date = _chunkGYW7LLBQjs.formatDate.call(void 0, invoice.periodStart, fmt);
|
|
1045
|
+
const amount = _chunkGYW7LLBQjs.formatCurrency.call(void 0, invoice.total, invoice.currency, fmt);
|
|
1046
|
+
const period = `${_chunkGYW7LLBQjs.formatDate.call(void 0, invoice.periodStart, fmt)} - ${_chunkGYW7LLBQjs.formatDate.call(void 0, invoice.periodEnd, fmt)}`;
|
|
1047
1047
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1048
|
-
|
|
1048
|
+
_chunkGYW7LLBQjs.TableRow,
|
|
1049
1049
|
{
|
|
1050
1050
|
onClick: () => handleRowClick(invoice),
|
|
1051
1051
|
className: "cursor-pointer hover:bg-muted/50",
|
|
1052
1052
|
children: [
|
|
1053
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1054
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1055
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1056
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1057
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1053
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TableCell, { className: "font-medium", children: invoiceNumber }),
|
|
1054
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TableCell, { className: "text-muted-foreground text-xs", children: date }),
|
|
1055
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TableCell, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InvoiceStatusBadge, { status: invoice.status }) }),
|
|
1056
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TableCell, { className: "text-end font-medium", children: amount }),
|
|
1057
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TableCell, { className: "text-muted-foreground text-xs", children: period })
|
|
1058
1058
|
]
|
|
1059
1059
|
},
|
|
1060
1060
|
invoice.id
|
|
@@ -1104,12 +1104,12 @@ function InvoicesContainer() {
|
|
|
1104
1104
|
setStatusFilter(value);
|
|
1105
1105
|
}, "handleFilterChange");
|
|
1106
1106
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-4", children: [
|
|
1107
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1108
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1109
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1110
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1111
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1112
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1107
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Tabs, { value: statusFilter, onValueChange: handleFilterChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.TabsList, { children: [
|
|
1108
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TabsTrigger, { value: "all", children: t("billing.ui.invoices.filter_all") }),
|
|
1109
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TabsTrigger, { value: "paid" /* PAID */, children: t("billing.ui.invoice_status.paid") }),
|
|
1110
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TabsTrigger, { value: "open" /* OPEN */, children: t("billing.ui.invoice_status.open") }),
|
|
1111
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TabsTrigger, { value: "void" /* VOID */, children: t("billing.ui.invoice_status.void") }),
|
|
1112
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TabsTrigger, { value: "uncollectible" /* UNCOLLECTIBLE */, children: t("billing.ui.invoice_status.uncollectible") })
|
|
1113
1113
|
] }) }),
|
|
1114
1114
|
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-center py-8 text-muted-foreground", children: t("billing.ui.invoices.loading") }),
|
|
1115
1115
|
!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: [
|
|
@@ -1151,7 +1151,7 @@ function CancelSubscriptionDialog({
|
|
|
1151
1151
|
onSuccess
|
|
1152
1152
|
}) {
|
|
1153
1153
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1154
|
-
const fmt =
|
|
1154
|
+
const fmt = _chunkGYW7LLBQjs.useBillingFormatOptions.call(void 0, );
|
|
1155
1155
|
const [isSubmitting, setIsSubmitting] = _react.useState.call(void 0, false);
|
|
1156
1156
|
const form = _reacthookform.useForm.call(void 0, {
|
|
1157
1157
|
resolver: _zod.zodResolver.call(void 0, formSchema),
|
|
@@ -1174,16 +1174,16 @@ function CancelSubscriptionDialog({
|
|
|
1174
1174
|
setIsSubmitting(false);
|
|
1175
1175
|
}
|
|
1176
1176
|
}, "onSubmit");
|
|
1177
|
-
const periodEndDate =
|
|
1178
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1179
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1180
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1181
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1177
|
+
const periodEndDate = _chunkGYW7LLBQjs.formatDate.call(void 0, subscription.currentPeriodEnd, fmt);
|
|
1178
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.DialogContent, { className: "max-w-md", children: [
|
|
1179
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.DialogHeader, { children: [
|
|
1180
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.DialogTitle, { children: t("billing.ui.subscription.cancel.title") }),
|
|
1181
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.DialogDescription, { children: t("billing.ui.subscription.cancel.description") })
|
|
1182
1182
|
] }),
|
|
1183
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1183
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Form, { ...form, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: form.handleSubmit(onSubmit), className: "flex flex-col gap-y-4", children: [
|
|
1184
1184
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "bg-primary/10 border-primary/30 text-foreground rounded-lg border p-3 text-sm", children: t("billing.ui.subscription.cancel.remains_active", { date: periodEndDate }) }),
|
|
1185
1185
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1186
|
-
|
|
1186
|
+
_chunkGYW7LLBQjs.FormTextarea,
|
|
1187
1187
|
{
|
|
1188
1188
|
form,
|
|
1189
1189
|
id: "reason",
|
|
@@ -1193,8 +1193,8 @@ function CancelSubscriptionDialog({
|
|
|
1193
1193
|
}
|
|
1194
1194
|
),
|
|
1195
1195
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex gap-x-2 justify-end pt-2", children: [
|
|
1196
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1197
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1196
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Button, { type: "button", variant: "outline", onClick: () => onOpenChange(false), disabled: isSubmitting, children: t("billing.ui.subscription.cancel.keep") }),
|
|
1197
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Button, { type: "submit", variant: "destructive", disabled: isSubmitting, children: isSubmitting ? t("billing.ui.subscription.cancel.canceling") : t("billing.ui.subscription.cancel.confirm") })
|
|
1198
1198
|
] })
|
|
1199
1199
|
] }) })
|
|
1200
1200
|
] }) });
|
|
@@ -1245,7 +1245,7 @@ var cancelingConfig = {
|
|
|
1245
1245
|
function SubscriptionStatusBadge({ status, cancelAtPeriodEnd }) {
|
|
1246
1246
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1247
1247
|
const config = cancelAtPeriodEnd ? cancelingConfig : statusConfig2[status] || statusConfig2["canceled" /* CANCELED */];
|
|
1248
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1248
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Badge, { variant: config.variant, children: t(config.label) });
|
|
1249
1249
|
}
|
|
1250
1250
|
_chunk7QVYU63Ejs.__name.call(void 0, SubscriptionStatusBadge, "SubscriptionStatusBadge");
|
|
1251
1251
|
|
|
@@ -1272,7 +1272,7 @@ function formatPlanName2(price, t) {
|
|
|
1272
1272
|
_chunk7QVYU63Ejs.__name.call(void 0, formatPlanName2, "formatPlanName");
|
|
1273
1273
|
function formatBillingAmount(price, notAvailable, fmt) {
|
|
1274
1274
|
if (!_optionalChain([price, 'optionalAccess', _37 => _37.unitAmount])) return notAvailable;
|
|
1275
|
-
return
|
|
1275
|
+
return _chunkGYW7LLBQjs.formatCurrency.call(void 0, price.unitAmount, price.currency, fmt);
|
|
1276
1276
|
}
|
|
1277
1277
|
_chunk7QVYU63Ejs.__name.call(void 0, formatBillingAmount, "formatBillingAmount");
|
|
1278
1278
|
function SubscriptionDetails({
|
|
@@ -1283,7 +1283,7 @@ function SubscriptionDetails({
|
|
|
1283
1283
|
onChangePlan
|
|
1284
1284
|
}) {
|
|
1285
1285
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1286
|
-
const fmt =
|
|
1286
|
+
const fmt = _chunkGYW7LLBQjs.useBillingFormatOptions.call(void 0, );
|
|
1287
1287
|
const [showCancel, setShowCancel] = _react.useState.call(void 0, false);
|
|
1288
1288
|
const [isProcessing, setIsProcessing] = _react.useState.call(void 0, false);
|
|
1289
1289
|
const handlePause = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
@@ -1320,10 +1320,10 @@ function SubscriptionDetails({
|
|
|
1320
1320
|
const canResume = subscription.status === "paused" /* PAUSED */;
|
|
1321
1321
|
const canCancel = subscription.status === "active" /* ACTIVE */ || subscription.status === "trialing" /* TRIALING */ || subscription.status === "paused" /* PAUSED */;
|
|
1322
1322
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1323
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1324
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1325
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1326
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1323
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.DialogContent, { className: "max-w-2xl", children: [
|
|
1324
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.DialogHeader, { children: [
|
|
1325
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.DialogTitle, { children: t("billing.ui.subscription.details_title") }),
|
|
1326
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.DialogDescription, { children: t("billing.ui.subscription.details_description") })
|
|
1327
1327
|
] }),
|
|
1328
1328
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-6", children: [
|
|
1329
1329
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-3", children: [
|
|
@@ -1349,24 +1349,24 @@ function SubscriptionDetails({
|
|
|
1349
1349
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "space-y-2", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between", children: [
|
|
1350
1350
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("billing.ui.subscription.current_period") }),
|
|
1351
1351
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "text-sm", children: [
|
|
1352
|
-
|
|
1352
|
+
_chunkGYW7LLBQjs.formatDate.call(void 0, subscription.currentPeriodStart, fmt),
|
|
1353
1353
|
" - ",
|
|
1354
|
-
|
|
1354
|
+
_chunkGYW7LLBQjs.formatDate.call(void 0, subscription.currentPeriodEnd, fmt)
|
|
1355
1355
|
] })
|
|
1356
1356
|
] }) }),
|
|
1357
1357
|
subscription.trialEnd && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between", children: [
|
|
1358
1358
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("billing.ui.subscription.trial_ends") }),
|
|
1359
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm", children:
|
|
1359
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm", children: _chunkGYW7LLBQjs.formatDate.call(void 0, subscription.trialEnd, fmt) })
|
|
1360
1360
|
] }),
|
|
1361
1361
|
subscription.cancelAtPeriodEnd && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "bg-warning/15 border-warning/30 rounded-lg border p-3", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-warning text-xs/relaxed", children: t("billing.ui.subscription.cancel_at_period_end", {
|
|
1362
|
-
date:
|
|
1362
|
+
date: _chunkGYW7LLBQjs.formatDate.call(void 0, subscription.currentPeriodEnd, fmt)
|
|
1363
1363
|
}) }) }),
|
|
1364
1364
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-wrap gap-2 pt-4 border-t", children: [
|
|
1365
|
-
onChangePlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1366
|
-
canPause && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1367
|
-
canResume && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1368
|
-
canCancel && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1369
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1365
|
+
onChangePlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Button, { variant: "default", onClick: () => onChangePlan(subscription), children: t("billing.ui.subscription.change_plan") }),
|
|
1366
|
+
canPause && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Button, { variant: "outline", onClick: handlePause, disabled: isProcessing, children: isProcessing ? t("billing.ui.subscription.pausing") : t("billing.ui.subscription.pause") }),
|
|
1367
|
+
canResume && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Button, { variant: "outline", onClick: handleResume, disabled: isProcessing, children: isProcessing ? t("billing.ui.subscription.resuming") : t("billing.ui.subscription.resume") }),
|
|
1368
|
+
canCancel && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Button, { variant: "destructive", onClick: () => setShowCancel(true), children: t("ui.buttons.cancel") }),
|
|
1369
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Button, { variant: "outline", onClick: handleManageViaPortal, children: t("billing.ui.subscription.manage_portal") })
|
|
1370
1370
|
] })
|
|
1371
1371
|
] })
|
|
1372
1372
|
] }) }),
|
|
@@ -1409,42 +1409,42 @@ function formatPlanName3(price, t) {
|
|
|
1409
1409
|
_chunk7QVYU63Ejs.__name.call(void 0, formatPlanName3, "formatPlanName");
|
|
1410
1410
|
function SubscriptionsList({ subscriptions, onSubscriptionsChange, onChangePlan }) {
|
|
1411
1411
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1412
|
-
const fmt =
|
|
1412
|
+
const fmt = _chunkGYW7LLBQjs.useBillingFormatOptions.call(void 0, );
|
|
1413
1413
|
const [selectedSub, setSelectedSub] = _react.useState.call(void 0, null);
|
|
1414
1414
|
const handleRowClick = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (subscription) => {
|
|
1415
1415
|
setSelectedSub(subscription);
|
|
1416
1416
|
}, "handleRowClick");
|
|
1417
1417
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1418
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border rounded-lg overflow-clip", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1419
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1420
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1421
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1422
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1423
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1424
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1418
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border rounded-lg overflow-clip", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.Table, { children: [
|
|
1419
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TableHeader, { className: "bg-muted", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.TableRow, { children: [
|
|
1420
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TableHead, { children: t("billing.ui.columns.status") }),
|
|
1421
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TableHead, { children: t("billing.ui.columns.plan") }),
|
|
1422
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TableHead, { children: t("billing.ui.columns.period") }),
|
|
1423
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TableHead, { className: "text-end", children: t("billing.ui.columns.amount") }),
|
|
1424
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TableHead, { className: "text-end", children: t("billing.ui.columns.actions") })
|
|
1425
1425
|
] }) }),
|
|
1426
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1426
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TableBody, { children: subscriptions.map((subscription) => {
|
|
1427
1427
|
const price = subscription.price;
|
|
1428
|
-
const amount = _optionalChain([price, 'optionalAccess', _42 => _42.unitAmount]) ?
|
|
1429
|
-
const period = `${
|
|
1428
|
+
const amount = _optionalChain([price, 'optionalAccess', _42 => _42.unitAmount]) ? _chunkGYW7LLBQjs.formatCurrency.call(void 0, price.unitAmount, price.currency, fmt) : "0";
|
|
1429
|
+
const period = `${_chunkGYW7LLBQjs.formatDate.call(void 0, subscription.currentPeriodStart, fmt)} - ${_chunkGYW7LLBQjs.formatDate.call(void 0, subscription.currentPeriodEnd, fmt)}`;
|
|
1430
1430
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1431
|
-
|
|
1431
|
+
_chunkGYW7LLBQjs.TableRow,
|
|
1432
1432
|
{
|
|
1433
1433
|
onClick: () => handleRowClick(subscription),
|
|
1434
1434
|
className: "cursor-pointer hover:bg-muted/50",
|
|
1435
1435
|
children: [
|
|
1436
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1436
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TableCell, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1437
1437
|
SubscriptionStatusBadge,
|
|
1438
1438
|
{
|
|
1439
1439
|
status: subscription.status,
|
|
1440
1440
|
cancelAtPeriodEnd: subscription.cancelAtPeriodEnd
|
|
1441
1441
|
}
|
|
1442
1442
|
) }),
|
|
1443
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1444
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1445
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1446
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1447
|
-
|
|
1443
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TableCell, { className: "font-medium", children: formatPlanName3(price, t) }),
|
|
1444
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TableCell, { className: "text-muted-foreground text-sm", children: period }),
|
|
1445
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TableCell, { className: "text-end font-medium", children: amount }),
|
|
1446
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TableCell, { className: "text-end", children: (subscription.status === "active" /* ACTIVE */ || subscription.status === "trialing" /* TRIALING */) && onChangePlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1447
|
+
_chunkGYW7LLBQjs.Button,
|
|
1448
1448
|
{
|
|
1449
1449
|
size: "sm",
|
|
1450
1450
|
variant: "outline",
|
|
@@ -1513,7 +1513,7 @@ function SubscriptionsContainer({ onOpenWizard, hasActiveRecurringSubscription }
|
|
|
1513
1513
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-8 w-8" }),
|
|
1514
1514
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h1", { className: "text-primary text-3xl font-semibold", children: t("billing.ui.subscriptions.title") })
|
|
1515
1515
|
] }),
|
|
1516
|
-
subscriptions.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1516
|
+
subscriptions.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Button, { onClick: () => _optionalChain([onOpenWizard, 'optionalCall', _43 => _43()]), children: hasActiveRecurringSubscription ? t("billing.ui.subscriptions.purchase_addons") : t("billing.ui.subscriptions.subscribe") })
|
|
1517
1517
|
] }),
|
|
1518
1518
|
criticalSubscriptions.map((subscription) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BillingAlertBanner, { subscription }, subscription.id)),
|
|
1519
1519
|
subscriptions.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col items-center justify-center py-12 space-y-4", children: [
|
|
@@ -1521,7 +1521,7 @@ function SubscriptionsContainer({ onOpenWizard, hasActiveRecurringSubscription }
|
|
|
1521
1521
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-center", children: [
|
|
1522
1522
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-sm font-medium mb-2", children: t("billing.ui.subscriptions.empty_title") }),
|
|
1523
1523
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground mb-6", children: t("billing.ui.subscriptions.empty_description") }),
|
|
1524
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1524
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Button, { onClick: () => _optionalChain([onOpenWizard, 'optionalCall', _44 => _44()]), children: t("billing.ui.subscriptions.subscribe") })
|
|
1525
1525
|
] })
|
|
1526
1526
|
] }),
|
|
1527
1527
|
subscriptions.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1544,9 +1544,9 @@ function IntervalToggle({ value, onChange, hasMonthly, hasYearly }) {
|
|
|
1544
1544
|
if (!hasMonthly || !hasYearly) {
|
|
1545
1545
|
return null;
|
|
1546
1546
|
}
|
|
1547
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1548
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1549
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1547
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Tabs, { value, onValueChange: (v) => onChange(v), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.TabsList, { children: [
|
|
1548
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TabsTrigger, { value: "month", children: t("billing.admin.prices.interval.month") }),
|
|
1549
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TabsTrigger, { value: "year", children: t("billing.admin.prices.interval.year") })
|
|
1550
1550
|
] }) });
|
|
1551
1551
|
}
|
|
1552
1552
|
_chunk7QVYU63Ejs.__name.call(void 0, IntervalToggle, "IntervalToggle");
|
|
@@ -1564,11 +1564,11 @@ function PricingCard({
|
|
|
1564
1564
|
onSelect
|
|
1565
1565
|
}) {
|
|
1566
1566
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1567
|
-
const fmt =
|
|
1567
|
+
const fmt = _chunkGYW7LLBQjs.useBillingFormatOptions.call(void 0, );
|
|
1568
1568
|
const description = price.description || price.nickname || t("billing.ui.pricing.standard");
|
|
1569
1569
|
const features = price.features || [];
|
|
1570
|
-
const formattedPrice =
|
|
1571
|
-
const interval =
|
|
1570
|
+
const formattedPrice = _chunkGYW7LLBQjs.formatCurrency.call(void 0, price.unitAmount, price.currency, fmt);
|
|
1571
|
+
const interval = _chunkGYW7LLBQjs.formatInterval.call(void 0, price, fmt);
|
|
1572
1572
|
const handleKeyDown = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (e) => {
|
|
1573
1573
|
if ((e.key === "Enter" || e.key === " ") && !isDisabled && !isCurrentPlan) {
|
|
1574
1574
|
e.preventDefault();
|
|
@@ -1581,7 +1581,7 @@ function PricingCard({
|
|
|
1581
1581
|
}
|
|
1582
1582
|
}, "handleClick");
|
|
1583
1583
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1584
|
-
|
|
1584
|
+
_chunkGYW7LLBQjs.Card,
|
|
1585
1585
|
{
|
|
1586
1586
|
role: "radio",
|
|
1587
1587
|
"aria-checked": isSelected,
|
|
@@ -1599,9 +1599,9 @@ function PricingCard({
|
|
|
1599
1599
|
isLoading && "pointer-events-none"
|
|
1600
1600
|
),
|
|
1601
1601
|
children: [
|
|
1602
|
-
isCurrentPlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1603
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1604
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1602
|
+
isCurrentPlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Badge, { variant: "secondary", className: "absolute top-2 end-2", children: t("billing.ui.pricing.current") }),
|
|
1603
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.CardHeader, { className: "pb-2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-sm font-medium", children: description }) }),
|
|
1604
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.CardContent, { className: "pb-4 grow", children: [
|
|
1605
1605
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mb-4", children: [
|
|
1606
1606
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-3xl font-bold", children: formattedPrice }),
|
|
1607
1607
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground ms-1", children: interval })
|
|
@@ -1611,8 +1611,8 @@ function PricingCard({
|
|
|
1611
1611
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm text-muted-foreground", children: feature })
|
|
1612
1612
|
] }, index)) })
|
|
1613
1613
|
] }),
|
|
1614
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1615
|
-
|
|
1614
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.CardFooter, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1615
|
+
_chunkGYW7LLBQjs.Button,
|
|
1616
1616
|
{
|
|
1617
1617
|
variant: isCurrentPlan ? "secondary" : isSelected ? "default" : "outline",
|
|
1618
1618
|
className: "w-full",
|
|
@@ -1645,7 +1645,7 @@ function ProductPricingRow({
|
|
|
1645
1645
|
return null;
|
|
1646
1646
|
}
|
|
1647
1647
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-3", children: [
|
|
1648
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1648
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.SectionHeader, { children: product.name }),
|
|
1649
1649
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1650
1650
|
"div",
|
|
1651
1651
|
{
|
|
@@ -1746,15 +1746,15 @@ function ProductPricingList({
|
|
|
1746
1746
|
_chunk7QVYU63Ejs.__name.call(void 0, ProductPricingList, "ProductPricingList");
|
|
1747
1747
|
function ProductPricingListSkeleton() {
|
|
1748
1748
|
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: [
|
|
1749
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1749
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Skeleton, { className: "h-6 w-32" }),
|
|
1750
1750
|
/* @__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: [
|
|
1751
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1752
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1751
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Skeleton, { className: "h-6 w-24" }),
|
|
1752
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Skeleton, { className: "h-8 w-32" }),
|
|
1753
1753
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
1754
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1755
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1754
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Skeleton, { className: "h-4 w-full" }),
|
|
1755
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Skeleton, { className: "h-4 w-3/4" })
|
|
1756
1756
|
] }),
|
|
1757
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1757
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Skeleton, { className: "h-10 w-full" })
|
|
1758
1758
|
] }, cardIndex)) })
|
|
1759
1759
|
] }, rowIndex)) });
|
|
1760
1760
|
}
|
|
@@ -1765,21 +1765,21 @@ _chunk7QVYU63Ejs.__name.call(void 0, ProductPricingListSkeleton, "ProductPricing
|
|
|
1765
1765
|
|
|
1766
1766
|
function ProrationPreview({ preview }) {
|
|
1767
1767
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1768
|
-
const fmt =
|
|
1768
|
+
const fmt = _chunkGYW7LLBQjs.useBillingFormatOptions.call(void 0, );
|
|
1769
1769
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bg-primary/10 border-primary/30 rounded-lg border p-4", children: [
|
|
1770
1770
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h4", { className: "text-primary mb-3 font-semibold", children: t("billing.ui.proration.title") }),
|
|
1771
1771
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
1772
1772
|
preview.lineItems.map((item, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between text-sm", children: [
|
|
1773
1773
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground", children: item.description }),
|
|
1774
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `font-medium ${item.amount < 0 ? "text-success" : "text-foreground"}`, children:
|
|
1774
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `font-medium ${item.amount < 0 ? "text-success" : "text-foreground"}`, children: _chunkGYW7LLBQjs.formatCurrency.call(void 0, item.amount, preview.currency, fmt) })
|
|
1775
1775
|
] }, index)),
|
|
1776
1776
|
/* @__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: [
|
|
1777
1777
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-foreground", children: t("billing.ui.proration.net_due_today") }),
|
|
1778
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-foreground", children:
|
|
1778
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-foreground", children: _chunkGYW7LLBQjs.formatCurrency.call(void 0, preview.immediateCharge, preview.currency, fmt) })
|
|
1779
1779
|
] }) }),
|
|
1780
1780
|
preview.lineItems.length > 0 && preview.lineItems[0].period && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-muted-foreground mt-2 text-xs", children: t("billing.ui.proration.next_invoice", {
|
|
1781
|
-
date:
|
|
1782
|
-
amount:
|
|
1781
|
+
date: _chunkGYW7LLBQjs.formatDate.call(void 0, preview.lineItems[0].period.end, fmt),
|
|
1782
|
+
amount: _chunkGYW7LLBQjs.formatCurrency.call(void 0, preview.amountDue, preview.currency, fmt)
|
|
1783
1783
|
}) })
|
|
1784
1784
|
] })
|
|
1785
1785
|
] });
|
|
@@ -1792,7 +1792,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, ProrationPreview, "ProrationPreview");
|
|
|
1792
1792
|
|
|
1793
1793
|
function SubscriptionConfirmation({ price, isLoading, onConfirm, onCancel }) {
|
|
1794
1794
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1795
|
-
const fmt =
|
|
1795
|
+
const fmt = _chunkGYW7LLBQjs.useBillingFormatOptions.call(void 0, );
|
|
1796
1796
|
const productName = _optionalChain([price, 'access', _50 => _50.product, 'optionalAccess', _51 => _51.name]) || price.nickname || t("billing.ui.wizard.review.selected_plan");
|
|
1797
1797
|
const productDescription = _optionalChain([price, 'access', _52 => _52.product, 'optionalAccess', _53 => _53.description]) || price.description;
|
|
1798
1798
|
const features = price.features || [];
|
|
@@ -1804,16 +1804,16 @@ function SubscriptionConfirmation({ price, isLoading, onConfirm, onCancel }) {
|
|
|
1804
1804
|
productDescription && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-sm text-muted-foreground", children: productDescription })
|
|
1805
1805
|
] }),
|
|
1806
1806
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-lg font-semibold", children: [
|
|
1807
|
-
|
|
1808
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-normal text-muted-foreground", children:
|
|
1807
|
+
_chunkGYW7LLBQjs.formatCurrency.call(void 0, price.unitAmount, price.currency, fmt),
|
|
1808
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-normal text-muted-foreground", children: _chunkGYW7LLBQjs.formatInterval.call(void 0, price, fmt) })
|
|
1809
1809
|
] }),
|
|
1810
1810
|
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: [
|
|
1811
1811
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Check, { className: "h-4 w-4 text-primary" }),
|
|
1812
1812
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: feature })
|
|
1813
1813
|
] }, index)) }),
|
|
1814
1814
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-end gap-3 pt-2 border-t border-accent/30", children: [
|
|
1815
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1816
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1815
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Button, { variant: "outline", onClick: onCancel, disabled: isLoading, children: t("ui.buttons.cancel") }),
|
|
1816
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Button, { onClick: onConfirm, disabled: isLoading, children: isLoading ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1817
1817
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Loader2, { className: "h-4 w-4 animate-spin me-2" }),
|
|
1818
1818
|
t("billing.ui.wizard.review.processing")
|
|
1819
1819
|
] }) : t("billing.ui.confirmation.subscribe") })
|
|
@@ -2158,7 +2158,7 @@ function WizardStepPlanSelection({
|
|
|
2158
2158
|
onSelectPrice: handleSelectPrice
|
|
2159
2159
|
}
|
|
2160
2160
|
),
|
|
2161
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex justify-end pt-4 border-t", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2161
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex justify-end pt-4 border-t", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Button, { onClick: onNext, disabled: !selectedPrice || isProcessing, children: isProcessing ? t("common.loading") : t("billing.ui.wizard.next_review") }) })
|
|
2162
2162
|
] });
|
|
2163
2163
|
}
|
|
2164
2164
|
_chunk7QVYU63Ejs.__name.call(void 0, WizardStepPlanSelection, "WizardStepPlanSelection");
|
|
@@ -2200,7 +2200,7 @@ function PromoCodeInput({
|
|
|
2200
2200
|
}
|
|
2201
2201
|
const amount = (result.discountValue || 0) / 100;
|
|
2202
2202
|
const currency = _optionalChain([result, 'access', _80 => _80.currency, 'optionalAccess', _81 => _81.toUpperCase, 'call', _82 => _82()]) || "USD";
|
|
2203
|
-
return t("billing.ui.wizard.review.amount_off", { amount: `${currency} ${
|
|
2203
|
+
return t("billing.ui.wizard.review.amount_off", { amount: `${currency} ${_chunkGYW7LLBQjs.formatFixed.call(void 0, amount, locale, 2)}` });
|
|
2204
2204
|
}, "formatDiscount");
|
|
2205
2205
|
const formatDuration = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (result) => {
|
|
2206
2206
|
switch (result.duration) {
|
|
@@ -2223,7 +2223,7 @@ function PromoCodeInput({
|
|
|
2223
2223
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-success text-sm", children: formatDiscount(appliedCode) })
|
|
2224
2224
|
] }),
|
|
2225
2225
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2226
|
-
|
|
2226
|
+
_chunkGYW7LLBQjs.Button,
|
|
2227
2227
|
{
|
|
2228
2228
|
variant: "ghost",
|
|
2229
2229
|
size: "sm",
|
|
@@ -2240,7 +2240,7 @@ function PromoCodeInput({
|
|
|
2240
2240
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
2241
2241
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex gap-2", children: [
|
|
2242
2242
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2243
|
-
|
|
2243
|
+
_chunkGYW7LLBQjs.Input,
|
|
2244
2244
|
{
|
|
2245
2245
|
placeholder: t("billing.ui.promo_code.placeholder"),
|
|
2246
2246
|
value: code,
|
|
@@ -2250,7 +2250,7 @@ function PromoCodeInput({
|
|
|
2250
2250
|
className: "flex-1"
|
|
2251
2251
|
}
|
|
2252
2252
|
),
|
|
2253
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2253
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.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" }) : t("billing.ui.promo_code.apply") })
|
|
2254
2254
|
] }),
|
|
2255
2255
|
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error })
|
|
2256
2256
|
] });
|
|
@@ -2277,7 +2277,7 @@ function WizardStepReview({
|
|
|
2277
2277
|
isTrialUpgrade
|
|
2278
2278
|
}) {
|
|
2279
2279
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
2280
|
-
const fmt =
|
|
2280
|
+
const fmt = _chunkGYW7LLBQjs.useBillingFormatOptions.call(void 0, );
|
|
2281
2281
|
if (!selectedPrice) {
|
|
2282
2282
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-center py-8 text-muted-foreground", children: t("billing.ui.wizard.review.no_plan") });
|
|
2283
2283
|
}
|
|
@@ -2318,7 +2318,7 @@ function WizardStepReview({
|
|
|
2318
2318
|
}
|
|
2319
2319
|
if (promotionCode.discountType === "amount_off" && promotionCode.discountValue) {
|
|
2320
2320
|
return t("billing.ui.wizard.review.amount_off", {
|
|
2321
|
-
amount:
|
|
2321
|
+
amount: _chunkGYW7LLBQjs.formatCurrency.call(void 0, promotionCode.discountValue, promotionCode.currency || selectedPrice.currency, fmt)
|
|
2322
2322
|
});
|
|
2323
2323
|
}
|
|
2324
2324
|
return null;
|
|
@@ -2326,7 +2326,7 @@ function WizardStepReview({
|
|
|
2326
2326
|
const discountDescription = getDiscountDescription();
|
|
2327
2327
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-6", children: [
|
|
2328
2328
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bg-muted/50 rounded-lg p-4 space-y-3", children: [
|
|
2329
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2329
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.SectionHeader, { children: t("billing.ui.wizard.review.selected_plan") }),
|
|
2330
2330
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between items-center", children: [
|
|
2331
2331
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
|
|
2332
2332
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "font-medium", children: _optionalChain([selectedPrice, 'access', _92 => _92.product, 'optionalAccess', _93 => _93.name]) }),
|
|
@@ -2334,10 +2334,10 @@ function WizardStepReview({
|
|
|
2334
2334
|
] }),
|
|
2335
2335
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-end", children: [
|
|
2336
2336
|
discountedPrice !== null ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2337
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground line-through", children:
|
|
2338
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-success text-lg font-semibold", children:
|
|
2339
|
-
discountDescription && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2340
|
-
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "font-semibold text-lg", children:
|
|
2337
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground line-through", children: _chunkGYW7LLBQjs.formatCurrency.call(void 0, selectedPrice.unitAmount || 0, selectedPrice.currency, fmt) }),
|
|
2338
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-success text-lg font-semibold", children: _chunkGYW7LLBQjs.formatCurrency.call(void 0, discountedPrice, selectedPrice.currency, fmt) }),
|
|
2339
|
+
discountDescription && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Badge, { variant: "softGreen", children: discountDescription })
|
|
2340
|
+
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "font-semibold text-lg", children: _chunkGYW7LLBQjs.formatCurrency.call(void 0, selectedPrice.unitAmount || 0, selectedPrice.currency, fmt) }),
|
|
2341
2341
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: formatInterval2(selectedPrice) })
|
|
2342
2342
|
] })
|
|
2343
2343
|
] })
|
|
@@ -2352,9 +2352,9 @@ function WizardStepReview({
|
|
|
2352
2352
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between text-sm", children: [
|
|
2353
2353
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `${isTrialUpgrade ? "text-warning" : "text-muted-foreground"}`, children: isTrialUpgrade ? t("billing.ui.wizard.review.charge_now") : t("billing.ui.wizard.review.due_now") }),
|
|
2354
2354
|
/* @__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: [
|
|
2355
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "line-through text-muted-foreground me-2", children:
|
|
2356
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-success", children:
|
|
2357
|
-
] }) :
|
|
2355
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "line-through text-muted-foreground me-2", children: _chunkGYW7LLBQjs.formatCurrency.call(void 0, prorationPreview.immediateCharge, prorationPreview.currency, fmt) }),
|
|
2356
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-success", children: _chunkGYW7LLBQjs.formatCurrency.call(void 0, discountedImmediateCharge, prorationPreview.currency, fmt) })
|
|
2357
|
+
] }) : _chunkGYW7LLBQjs.formatCurrency.call(void 0, prorationPreview.immediateCharge, prorationPreview.currency, fmt) })
|
|
2358
2358
|
] })
|
|
2359
2359
|
]
|
|
2360
2360
|
}
|
|
@@ -2378,15 +2378,15 @@ function WizardStepReview({
|
|
|
2378
2378
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h4", { className: "font-medium", children: t("billing.ui.payment_method.title") }),
|
|
2379
2379
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: hasPaymentMethod ? t("billing.ui.wizard.review.payment_on_file") : t("billing.ui.wizard.review.no_payment_on_file") })
|
|
2380
2380
|
] }),
|
|
2381
|
-
!hasPaymentMethod && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2381
|
+
!hasPaymentMethod && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Button, { variant: "outline", onClick: onAddPaymentMethod, children: t("billing.ui.payment_methods.add") })
|
|
2382
2382
|
] }) }),
|
|
2383
|
-
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2383
|
+
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.Alert, { variant: "destructive", children: [
|
|
2384
2384
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.AlertCircle, { className: "h-4 w-4" }),
|
|
2385
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2385
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.AlertDescription, { children: error })
|
|
2386
2386
|
] }),
|
|
2387
2387
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between pt-4 border-t", children: [
|
|
2388
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2389
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2388
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Button, { variant: "outline", onClick: onBack, disabled: isProcessing, children: t("billing.ui.wizard.back") }),
|
|
2389
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Button, { onClick: hasPaymentMethod ? onConfirm : onAddPaymentMethod, disabled: isProcessing, children: isProcessing ? t("billing.ui.wizard.review.processing") : hasPaymentMethod ? isChangingPlan ? t("billing.ui.wizard.review.confirm_change") : t("billing.ui.wizard.review.subscribe_now") : t("billing.ui.payment_methods.add") })
|
|
2390
2390
|
] })
|
|
2391
2391
|
] });
|
|
2392
2392
|
}
|
|
@@ -2399,7 +2399,7 @@ function WizardStepPaymentMethod({ onBack, onSuccess, isProcessing }) {
|
|
|
2399
2399
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
2400
2400
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-6", children: [
|
|
2401
2401
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-center", children: [
|
|
2402
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2402
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.SectionHeader, { children: t("billing.ui.payment_methods.add") }),
|
|
2403
2403
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: t("billing.ui.wizard.payment_description") })
|
|
2404
2404
|
] }),
|
|
2405
2405
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, PaymentMethodForm, { onSuccess, onCancel: onBack, isLoading: isProcessing })
|
|
@@ -2442,10 +2442,10 @@ function SubscriptionWizard({
|
|
|
2442
2442
|
const isChangePlanMode = !!subscription;
|
|
2443
2443
|
const dialogTitle = subscription ? t("billing.ui.wizard.change_title") : isPurchasingAddons ? t("billing.ui.subscriptions.purchase_addons") : t("billing.ui.subscriptions.subscribe");
|
|
2444
2444
|
const dialogDescription = subscription ? t("billing.ui.wizard.change_description") : isPurchasingAddons ? t("billing.ui.wizard.addons_description") : t("billing.ui.wizard.subscribe_description");
|
|
2445
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2446
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2447
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2448
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2445
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.DialogContent, { className: "max-w-2xl", children: [
|
|
2446
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.DialogHeader, { children: [
|
|
2447
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.DialogTitle, { children: dialogTitle }),
|
|
2448
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.DialogDescription, { children: dialogDescription })
|
|
2449
2449
|
] }),
|
|
2450
2450
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, WizardProgressIndicator, { currentStep: state.step }),
|
|
2451
2451
|
state.step === "plan-selection" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -2524,7 +2524,7 @@ function formatDate2(date, { locale, t }) {
|
|
|
2524
2524
|
_chunk7QVYU63Ejs.__name.call(void 0, formatDate2, "formatDate");
|
|
2525
2525
|
function UsageSummaryCard({ meter, summary }) {
|
|
2526
2526
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
2527
|
-
const fmt =
|
|
2527
|
+
const fmt = _chunkGYW7LLBQjs.useBillingFormatOptions.call(void 0, );
|
|
2528
2528
|
const currentUsage = _nullishCoalesce(_optionalChain([summary, 'optionalAccess', _96 => _96.aggregatedValue]), () => ( 0));
|
|
2529
2529
|
const limit = meter.limit;
|
|
2530
2530
|
const percentage = limit && limit > 0 ? currentUsage / limit * 100 : null;
|
|
@@ -2532,15 +2532,15 @@ function UsageSummaryCard({ meter, summary }) {
|
|
|
2532
2532
|
const progressWidth = percentage !== null ? Math.min(percentage, 100) : 0;
|
|
2533
2533
|
const displayName = meter.displayName || meter.eventName;
|
|
2534
2534
|
const hasLimit = limit !== null && limit !== void 0;
|
|
2535
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2536
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2535
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.Card, { children: [
|
|
2536
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.CardHeader, { className: "flex flex-row items-center gap-x-3 pb-3", children: [
|
|
2537
2537
|
/* @__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" }) }),
|
|
2538
2538
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col", children: [
|
|
2539
2539
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-sm font-medium", children: displayName }),
|
|
2540
2540
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground text-xs", children: meter.id })
|
|
2541
2541
|
] })
|
|
2542
2542
|
] }),
|
|
2543
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2543
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.CardContent, { className: "flex flex-col gap-y-4", children: [
|
|
2544
2544
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
|
|
2545
2545
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-3xl font-bold", children: currentUsage.toLocaleString(fmt.locale) }),
|
|
2546
2546
|
hasLimit && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground text-sm", children: t("billing.ui.usage.of_limit_used", { limit: limit.toLocaleString(fmt.locale) }) })
|
|
@@ -2548,7 +2548,7 @@ function UsageSummaryCard({ meter, summary }) {
|
|
|
2548
2548
|
hasLimit ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-2", children: [
|
|
2549
2549
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "h-2 w-full overflow-hidden rounded-full bg-gray-200", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: `h-full transition-all ${progressColor}`, style: { width: `${progressWidth}%` } }) }),
|
|
2550
2550
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground text-sm", children: t("billing.ui.usage.percent_used", {
|
|
2551
|
-
value: percentage !== null ?
|
|
2551
|
+
value: percentage !== null ? _chunkGYW7LLBQjs.formatFixed.call(void 0, percentage, fmt.locale, 1) : ""
|
|
2552
2552
|
}) })
|
|
2553
2553
|
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground text-sm", children: t("billing.ui.usage.no_limit") }),
|
|
2554
2554
|
summary && summary.start && summary.end && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border-t pt-3", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground text-xs", children: t("billing.ui.usage.period", {
|
|
@@ -2659,27 +2659,27 @@ function formatDateTime(date, { locale, t }) {
|
|
|
2659
2659
|
_chunk7QVYU63Ejs.__name.call(void 0, formatDateTime, "formatDateTime");
|
|
2660
2660
|
function UsageHistoryTable({ usageRecords }) {
|
|
2661
2661
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
2662
|
-
const fmt =
|
|
2662
|
+
const fmt = _chunkGYW7LLBQjs.useBillingFormatOptions.call(void 0, );
|
|
2663
2663
|
if (usageRecords.length === 0) {
|
|
2664
2664
|
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: t("billing.ui.usage.history_empty") }) });
|
|
2665
2665
|
}
|
|
2666
2666
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
2667
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2668
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "overflow-clip rounded-lg border", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2669
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2670
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2671
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2672
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2673
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2667
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.SectionHeader, { level: 2, children: t("billing.ui.usage.history_title") }),
|
|
2668
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "overflow-clip rounded-lg border", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.Table, { children: [
|
|
2669
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TableHeader, { className: "bg-muted", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.TableRow, { children: [
|
|
2670
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TableHead, { children: t("billing.ui.columns.date_time") }),
|
|
2671
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TableHead, { children: t("billing.ui.columns.meter_event") }),
|
|
2672
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TableHead, { className: "text-end", children: t("billing.ui.columns.quantity") }),
|
|
2673
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TableHead, { children: t("billing.ui.columns.event_id") })
|
|
2674
2674
|
] }) }),
|
|
2675
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2675
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TableBody, { children: usageRecords.map((record) => {
|
|
2676
2676
|
const dateTime = formatDateTime(record.timestamp, fmt);
|
|
2677
2677
|
const quantity = record.quantity.toLocaleString(fmt.locale);
|
|
2678
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2679
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2680
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2681
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2682
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2678
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.TableRow, { children: [
|
|
2679
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TableCell, { className: "font-medium", children: dateTime }),
|
|
2680
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TableCell, { className: "text-muted-foreground", children: record.meterEventName }),
|
|
2681
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TableCell, { className: "text-end font-medium", children: quantity }),
|
|
2682
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.TableCell, { className: "text-muted-foreground text-sm tabular-nums", children: record.stripeEventId })
|
|
2683
2683
|
] }, record.id);
|
|
2684
2684
|
}) })
|
|
2685
2685
|
] }) })
|
|
@@ -2690,8 +2690,8 @@ _chunk7QVYU63Ejs.__name.call(void 0, UsageHistoryTable, "UsageHistoryTable");
|
|
|
2690
2690
|
// src/features/billing/components/modals/BillingDetailModal.tsx
|
|
2691
2691
|
|
|
2692
2692
|
function BillingDetailModal({ open, onOpenChange, title, children, className }) {
|
|
2693
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2694
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2693
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.DialogContent, { className: _nullishCoalesce(className, () => ( "max-w-4xl max-h-[90vh] overflow-y-auto")), children: [
|
|
2694
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.DialogHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.DialogTitle, { children: title }) }),
|
|
2695
2695
|
children
|
|
2696
2696
|
] }) });
|
|
2697
2697
|
}
|
|
@@ -2710,7 +2710,7 @@ function BillingAlertBanner({ subscription, onUpdatePayment, onAddPayment }) {
|
|
|
2710
2710
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-destructive text-sm font-medium", children: t("billing.ui.alert.payment_failed_title") }),
|
|
2711
2711
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive mt-1 text-sm", children: t("billing.ui.alert.payment_failed_description") })
|
|
2712
2712
|
] }),
|
|
2713
|
-
onUpdatePayment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2713
|
+
onUpdatePayment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Button, { variant: "outline", size: "sm", onClick: onUpdatePayment, className: "text-destructive border-red-300", children: t("billing.ui.alert.update_payment_method") })
|
|
2714
2714
|
] });
|
|
2715
2715
|
}
|
|
2716
2716
|
if (subscription.status === "trialing" /* TRIALING */ && subscription.trialEnd) {
|
|
@@ -2724,7 +2724,7 @@ function BillingAlertBanner({ subscription, onUpdatePayment, onAddPayment }) {
|
|
|
2724
2724
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-warning text-sm font-medium", children: t("billing.ui.alert.trial_ending_title") }),
|
|
2725
2725
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-warning mt-1 text-sm", children: t("billing.ui.alert.trial_ending_description", { count: daysRemaining }) })
|
|
2726
2726
|
] }),
|
|
2727
|
-
onAddPayment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2727
|
+
onAddPayment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Button, { variant: "outline", size: "sm", onClick: onAddPayment, className: "text-warning border-yellow-300", children: t("billing.ui.payment_methods.add") })
|
|
2728
2728
|
] });
|
|
2729
2729
|
}
|
|
2730
2730
|
}
|
|
@@ -2949,18 +2949,18 @@ function BillingDashboardContainer() {
|
|
|
2949
2949
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Wallet, { className: "h-8 w-8" }),
|
|
2950
2950
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h1", { className: "text-primary text-3xl font-semibold", children: t("billing.title") })
|
|
2951
2951
|
] }),
|
|
2952
|
-
isInitialLoading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2953
|
-
noCustomerExists && !isInitialLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2954
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2952
|
+
isInitialLoading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.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" }) }) }),
|
|
2953
|
+
noCustomerExists && !isInitialLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.Card, { children: [
|
|
2954
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.CardHeader, { className: "text-center", children: [
|
|
2955
2955
|
/* @__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" }) }),
|
|
2956
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2957
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2956
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.CardTitle, { children: t("billing.ui.dashboard.setup_title") }),
|
|
2957
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.CardDescription, { children: t("billing.ui.dashboard.setup_description") })
|
|
2958
2958
|
] }),
|
|
2959
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2959
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.CardContent, { className: "flex justify-center pb-8", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Button, { onClick: handleCreateCustomer, disabled: creatingCustomer, size: "lg", children: creatingCustomer ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2960
2960
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Loader2, { className: "me-2 h-4 w-4 animate-spin" }),
|
|
2961
2961
|
t("billing.ui.dashboard.setting_up")
|
|
2962
2962
|
] }) : t("billing.ui.dashboard.setup_button") }) }),
|
|
2963
|
-
errors.customer && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2963
|
+
errors.customer && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.CardContent, { className: "pt-0", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-center text-destructive text-xs/relaxed", children: t(errors.customer) }) })
|
|
2964
2964
|
] }),
|
|
2965
2965
|
!noCustomerExists && !isInitialLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2966
2966
|
criticalSubscriptions.map((subscription) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -3127,18 +3127,18 @@ _chunk7QVYU63Ejs.__name.call(void 0, isStripeConfigured, "isStripeConfigured");
|
|
|
3127
3127
|
|
|
3128
3128
|
function PriceArchiver({ price }) {
|
|
3129
3129
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
3130
|
-
const fmt =
|
|
3130
|
+
const fmt = _chunkGYW7LLBQjs.useBillingFormatOptions.call(void 0, );
|
|
3131
3131
|
const { archivePrice, restorePrice } = usePriceContext();
|
|
3132
3132
|
const [open, setOpen] = _react.useState.call(void 0, false);
|
|
3133
3133
|
const isArchived = !price.active;
|
|
3134
3134
|
const scope = isArchived ? "restore" : "archive";
|
|
3135
3135
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
3136
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3136
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.Button, { variant: "outline", size: "sm", onClick: () => setOpen(true), children: [
|
|
3137
3137
|
isArchived ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.RotateCcwIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ArchiveIcon, {}),
|
|
3138
3138
|
t(`billing.admin.prices.${scope}.confirm`)
|
|
3139
3139
|
] }),
|
|
3140
3140
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3141
|
-
|
|
3141
|
+
_chunkGYW7LLBQjs.ConfirmDialog,
|
|
3142
3142
|
{
|
|
3143
3143
|
open,
|
|
3144
3144
|
onOpenChange: setOpen,
|
|
@@ -3152,7 +3152,7 @@ function PriceArchiver({ price }) {
|
|
|
3152
3152
|
if (isArchived) await restorePrice(price.id);
|
|
3153
3153
|
else await archivePrice(price.id);
|
|
3154
3154
|
} catch (error) {
|
|
3155
|
-
|
|
3155
|
+
_chunkGYW7LLBQjs.errorToast.call(void 0, { title: t(`billing.admin.prices.${scope}.title`), error });
|
|
3156
3156
|
throw error;
|
|
3157
3157
|
}
|
|
3158
3158
|
}
|
|
@@ -3184,7 +3184,7 @@ function PriceEditorInternal({
|
|
|
3184
3184
|
onDialogOpenChange
|
|
3185
3185
|
}) {
|
|
3186
3186
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
3187
|
-
const fmt =
|
|
3187
|
+
const fmt = _chunkGYW7LLBQjs.useBillingFormatOptions.call(void 0, );
|
|
3188
3188
|
const router = _chunk4ORLPEK7js.useI18nRouter.call(void 0, );
|
|
3189
3189
|
const { createPrice, updatePrice, productId: contextProductId } = usePriceContext();
|
|
3190
3190
|
const [allFeatures, setAllFeatures] = _react.useState.call(void 0, []);
|
|
@@ -3326,7 +3326,7 @@ function PriceEditorInternal({
|
|
|
3326
3326
|
{ id: "metered", text: t("billing.admin.prices.usage.metered") }
|
|
3327
3327
|
];
|
|
3328
3328
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3329
|
-
|
|
3329
|
+
_chunkGYW7LLBQjs.EditorSheet,
|
|
3330
3330
|
{
|
|
3331
3331
|
form,
|
|
3332
3332
|
entityType: t("billing.admin.prices.entity"),
|
|
@@ -3381,13 +3381,13 @@ function PriceEditorInternal({
|
|
|
3381
3381
|
dialogOpen,
|
|
3382
3382
|
onDialogOpenChange,
|
|
3383
3383
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
3384
|
-
isEdit && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3385
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3386
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3384
|
+
isEdit && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.Alert, { children: [
|
|
3385
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.AlertTitle, { children: t("billing.admin.prices.immutability.title") }),
|
|
3386
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.AlertDescription, { children: t("billing.admin.prices.immutability.description") })
|
|
3387
3387
|
] }),
|
|
3388
3388
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-2 gap-x-4", children: [
|
|
3389
3389
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3390
|
-
|
|
3390
|
+
_chunkGYW7LLBQjs.FormInput,
|
|
3391
3391
|
{
|
|
3392
3392
|
form,
|
|
3393
3393
|
id: "unitAmount",
|
|
@@ -3399,7 +3399,7 @@ function PriceEditorInternal({
|
|
|
3399
3399
|
}
|
|
3400
3400
|
),
|
|
3401
3401
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3402
|
-
|
|
3402
|
+
_chunkGYW7LLBQjs.FormSelect,
|
|
3403
3403
|
{
|
|
3404
3404
|
form,
|
|
3405
3405
|
id: "currency",
|
|
@@ -3410,7 +3410,7 @@ function PriceEditorInternal({
|
|
|
3410
3410
|
)
|
|
3411
3411
|
] }),
|
|
3412
3412
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3413
|
-
|
|
3413
|
+
_chunkGYW7LLBQjs.FormSelect,
|
|
3414
3414
|
{
|
|
3415
3415
|
form,
|
|
3416
3416
|
id: "interval",
|
|
@@ -3421,7 +3421,7 @@ function PriceEditorInternal({
|
|
|
3421
3421
|
),
|
|
3422
3422
|
isRecurring && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-2 gap-x-4", children: [
|
|
3423
3423
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3424
|
-
|
|
3424
|
+
_chunkGYW7LLBQjs.FormInput,
|
|
3425
3425
|
{
|
|
3426
3426
|
form,
|
|
3427
3427
|
id: "intervalCount",
|
|
@@ -3432,7 +3432,7 @@ function PriceEditorInternal({
|
|
|
3432
3432
|
}
|
|
3433
3433
|
),
|
|
3434
3434
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3435
|
-
|
|
3435
|
+
_chunkGYW7LLBQjs.FormSelect,
|
|
3436
3436
|
{
|
|
3437
3437
|
form,
|
|
3438
3438
|
id: "usageType",
|
|
@@ -3443,7 +3443,7 @@ function PriceEditorInternal({
|
|
|
3443
3443
|
)
|
|
3444
3444
|
] }),
|
|
3445
3445
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3446
|
-
|
|
3446
|
+
_chunkGYW7LLBQjs.FormInput,
|
|
3447
3447
|
{
|
|
3448
3448
|
form,
|
|
3449
3449
|
id: "nickname",
|
|
@@ -3452,7 +3452,7 @@ function PriceEditorInternal({
|
|
|
3452
3452
|
}
|
|
3453
3453
|
),
|
|
3454
3454
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3455
|
-
|
|
3455
|
+
_chunkGYW7LLBQjs.FormTextarea,
|
|
3456
3456
|
{
|
|
3457
3457
|
form,
|
|
3458
3458
|
id: "description",
|
|
@@ -3462,7 +3462,7 @@ function PriceEditorInternal({
|
|
|
3462
3462
|
}
|
|
3463
3463
|
),
|
|
3464
3464
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3465
|
-
|
|
3465
|
+
_chunkGYW7LLBQjs.FormInput,
|
|
3466
3466
|
{
|
|
3467
3467
|
form,
|
|
3468
3468
|
id: "token",
|
|
@@ -3472,10 +3472,10 @@ function PriceEditorInternal({
|
|
|
3472
3472
|
}
|
|
3473
3473
|
),
|
|
3474
3474
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-2", children: [
|
|
3475
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3475
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.FieldLabel, { children: t("billing.admin.prices.fields.features") }),
|
|
3476
3476
|
form.watch("features").map((_, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex gap-2", children: [
|
|
3477
3477
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3478
|
-
|
|
3478
|
+
_chunkGYW7LLBQjs.Input,
|
|
3479
3479
|
{
|
|
3480
3480
|
...form.register(`features.${index}`),
|
|
3481
3481
|
placeholder: t("billing.admin.prices.placeholders.feature", { index: index + 1 }),
|
|
@@ -3483,7 +3483,7 @@ function PriceEditorInternal({
|
|
|
3483
3483
|
}
|
|
3484
3484
|
),
|
|
3485
3485
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3486
|
-
|
|
3486
|
+
_chunkGYW7LLBQjs.Button,
|
|
3487
3487
|
{
|
|
3488
3488
|
type: "button",
|
|
3489
3489
|
variant: "outline",
|
|
@@ -3498,7 +3498,7 @@ function PriceEditorInternal({
|
|
|
3498
3498
|
)
|
|
3499
3499
|
] }, index)),
|
|
3500
3500
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3501
|
-
|
|
3501
|
+
_chunkGYW7LLBQjs.Button,
|
|
3502
3502
|
{
|
|
3503
3503
|
type: "button",
|
|
3504
3504
|
variant: "outline",
|
|
@@ -3513,12 +3513,12 @@ function PriceEditorInternal({
|
|
|
3513
3513
|
)
|
|
3514
3514
|
] }),
|
|
3515
3515
|
isRecurring && allFeatures.length > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-2", children: [
|
|
3516
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3516
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.FieldLabel, { children: t("billing.admin.prices.fields.platformFeatures") }),
|
|
3517
3517
|
/* @__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) => {
|
|
3518
3518
|
const isChecked = form.watch("featureIds").includes(feature.id);
|
|
3519
3519
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-2", children: [
|
|
3520
3520
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3521
|
-
|
|
3521
|
+
_chunkGYW7LLBQjs.Checkbox,
|
|
3522
3522
|
{
|
|
3523
3523
|
id: `feature-${feature.id}`,
|
|
3524
3524
|
checked: isChecked,
|
|
@@ -3534,13 +3534,13 @@ function PriceEditorInternal({
|
|
|
3534
3534
|
}
|
|
3535
3535
|
}
|
|
3536
3536
|
),
|
|
3537
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3537
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.FieldLabel, { htmlFor: `feature-${feature.id}`, children: feature.name }),
|
|
3538
3538
|
feature.isCore && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("billing.admin.prices.help.core") })
|
|
3539
3539
|
] }, feature.id);
|
|
3540
3540
|
}) })
|
|
3541
3541
|
] }),
|
|
3542
3542
|
isRecurring && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3543
|
-
|
|
3543
|
+
_chunkGYW7LLBQjs.FormCheckbox,
|
|
3544
3544
|
{
|
|
3545
3545
|
form,
|
|
3546
3546
|
id: "isTrial",
|
|
@@ -3583,7 +3583,7 @@ var defaultContextValue = {
|
|
|
3583
3583
|
productId: void 0
|
|
3584
3584
|
};
|
|
3585
3585
|
function priceLabel(price, fmt = {}) {
|
|
3586
|
-
return _nullishCoalesce(price.nickname, () => ( `${
|
|
3586
|
+
return _nullishCoalesce(price.nickname, () => ( `${_chunkGYW7LLBQjs.formatCurrency.call(void 0, price.unitAmount, price.currency, fmt)} ${_chunkGYW7LLBQjs.formatInterval.call(void 0, price, fmt)}`.trim()));
|
|
3587
3587
|
}
|
|
3588
3588
|
_chunk7QVYU63Ejs.__name.call(void 0, priceLabel, "priceLabel");
|
|
3589
3589
|
var PriceProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({
|
|
@@ -3593,9 +3593,9 @@ var PriceProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({
|
|
|
3593
3593
|
productId: productIdProp
|
|
3594
3594
|
}) => {
|
|
3595
3595
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
3596
|
-
const fmt =
|
|
3597
|
-
const generateUrl =
|
|
3598
|
-
const { hasRole } =
|
|
3596
|
+
const fmt = _chunkGYW7LLBQjs.useBillingFormatOptions.call(void 0, );
|
|
3597
|
+
const generateUrl = _chunkGYW7LLBQjs.usePageUrlGenerator.call(void 0, );
|
|
3598
|
+
const { hasRole } = _chunkGYW7LLBQjs.useCurrentUserContext.call(void 0, );
|
|
3599
3599
|
const [price, setPrice] = _react.useState.call(void 0,
|
|
3600
3600
|
dehydratedPrice ? _chunk4ORLPEK7js.rehydrate.call(void 0, _chunk4ORLPEK7js.Modules.StripePrice, dehydratedPrice) : void 0
|
|
3601
3601
|
);
|
|
@@ -3683,7 +3683,7 @@ var PriceProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({
|
|
|
3683
3683
|
}
|
|
3684
3684
|
return response;
|
|
3685
3685
|
}, "title");
|
|
3686
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3686
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PriceContext.Provider, { value, children }) });
|
|
3687
3687
|
}, "PriceProvider");
|
|
3688
3688
|
var usePriceContext = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => _nullishCoalesce(_react.useContext.call(void 0, PriceContext), () => ( defaultContextValue)), "usePriceContext");
|
|
3689
3689
|
|
|
@@ -3703,12 +3703,12 @@ function ProductArchiver({ product }) {
|
|
|
3703
3703
|
const isArchived = !product.active;
|
|
3704
3704
|
const scope = isArchived ? "restore" : "archive";
|
|
3705
3705
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
3706
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3706
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.Button, { variant: "outline", size: "sm", onClick: () => setOpen(true), children: [
|
|
3707
3707
|
isArchived ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.RotateCcwIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ArchiveIcon, {}),
|
|
3708
3708
|
t(`billing.admin.products.${scope}.confirm`)
|
|
3709
3709
|
] }),
|
|
3710
3710
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3711
|
-
|
|
3711
|
+
_chunkGYW7LLBQjs.ConfirmDialog,
|
|
3712
3712
|
{
|
|
3713
3713
|
open,
|
|
3714
3714
|
onOpenChange: setOpen,
|
|
@@ -3722,7 +3722,7 @@ function ProductArchiver({ product }) {
|
|
|
3722
3722
|
if (isArchived) await restoreProduct(product.id);
|
|
3723
3723
|
else await archiveProduct(product.id);
|
|
3724
3724
|
} catch (error) {
|
|
3725
|
-
|
|
3725
|
+
_chunkGYW7LLBQjs.errorToast.call(void 0, { title: t(`billing.admin.products.${scope}.title`), error });
|
|
3726
3726
|
throw error;
|
|
3727
3727
|
}
|
|
3728
3728
|
}
|
|
@@ -3775,7 +3775,7 @@ function ProductEditorInternal({
|
|
|
3775
3775
|
defaultValues: getDefaultValues()
|
|
3776
3776
|
});
|
|
3777
3777
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3778
|
-
|
|
3778
|
+
_chunkGYW7LLBQjs.EditorSheet,
|
|
3779
3779
|
{
|
|
3780
3780
|
form,
|
|
3781
3781
|
entityType: t("billing.admin.products.entity"),
|
|
@@ -3798,7 +3798,7 @@ function ProductEditorInternal({
|
|
|
3798
3798
|
onDialogOpenChange,
|
|
3799
3799
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
3800
3800
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3801
|
-
|
|
3801
|
+
_chunkGYW7LLBQjs.FormInput,
|
|
3802
3802
|
{
|
|
3803
3803
|
form,
|
|
3804
3804
|
id: "name",
|
|
@@ -3808,7 +3808,7 @@ function ProductEditorInternal({
|
|
|
3808
3808
|
}
|
|
3809
3809
|
),
|
|
3810
3810
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3811
|
-
|
|
3811
|
+
_chunkGYW7LLBQjs.FormTextarea,
|
|
3812
3812
|
{
|
|
3813
3813
|
form,
|
|
3814
3814
|
id: "description",
|
|
@@ -3852,8 +3852,8 @@ var defaultContextValue2 = {
|
|
|
3852
3852
|
};
|
|
3853
3853
|
var ProductProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ children, dehydratedProduct, publishChrome = true }) => {
|
|
3854
3854
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
3855
|
-
const generateUrl =
|
|
3856
|
-
const { hasRole } =
|
|
3855
|
+
const generateUrl = _chunkGYW7LLBQjs.usePageUrlGenerator.call(void 0, );
|
|
3856
|
+
const { hasRole } = _chunkGYW7LLBQjs.useCurrentUserContext.call(void 0, );
|
|
3857
3857
|
const [product, setProduct] = _react.useState.call(void 0,
|
|
3858
3858
|
dehydratedProduct ? _chunk4ORLPEK7js.rehydrate.call(void 0, _chunk4ORLPEK7js.Modules.StripeProduct, dehydratedProduct) : void 0
|
|
3859
3859
|
);
|
|
@@ -3947,7 +3947,7 @@ var ProductProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ ch
|
|
|
3947
3947
|
}
|
|
3948
3948
|
return response;
|
|
3949
3949
|
}, "title");
|
|
3950
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3950
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductContext.Provider, { value, children }) });
|
|
3951
3951
|
}, "ProductProvider");
|
|
3952
3952
|
var useProductContext = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => _nullishCoalesce(_react.useContext.call(void 0, ProductContext), () => ( defaultContextValue2)), "useProductContext");
|
|
3953
3953
|
|
|
@@ -3956,57 +3956,57 @@ var useProductContext = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ()
|
|
|
3956
3956
|
|
|
3957
3957
|
function PriceDetails() {
|
|
3958
3958
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
3959
|
-
const fmt =
|
|
3960
|
-
const generateUrl =
|
|
3959
|
+
const fmt = _chunkGYW7LLBQjs.useBillingFormatOptions.call(void 0, );
|
|
3960
|
+
const generateUrl = _chunkGYW7LLBQjs.usePageUrlGenerator.call(void 0, );
|
|
3961
3961
|
const { price } = usePriceContext();
|
|
3962
3962
|
if (!price) return null;
|
|
3963
3963
|
const isRecurring = price.priceType === "recurring";
|
|
3964
3964
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-8", children: [
|
|
3965
3965
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
3966
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3966
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.SectionHeader, { children: t("billing.admin.prices.title") }),
|
|
3967
3967
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
|
|
3968
3968
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3969
|
-
|
|
3969
|
+
_chunkGYW7LLBQjs.DetailField,
|
|
3970
3970
|
{
|
|
3971
3971
|
label: t("billing.admin.prices.fields.product"),
|
|
3972
|
-
value: price.product ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3972
|
+
value: price.product ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Link, { href: generateUrl({ page: _chunk4ORLPEK7js.Modules.StripeProduct, id: price.product.id }), children: price.product.name }) : "\u2014"
|
|
3973
3973
|
}
|
|
3974
3974
|
),
|
|
3975
3975
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3976
|
-
|
|
3976
|
+
_chunkGYW7LLBQjs.DetailField,
|
|
3977
3977
|
{
|
|
3978
3978
|
label: t("billing.admin.prices.fields.status"),
|
|
3979
3979
|
value: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex flex-wrap items-center gap-1", children: [
|
|
3980
|
-
price.active ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3981
|
-
price.isTrial && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3980
|
+
price.active ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Badge, { variant: "softGreen", children: t("billing.admin.prices.status.active") }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Badge, { variant: "softGray", children: t("billing.admin.prices.status.archived") }),
|
|
3981
|
+
price.isTrial && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Badge, { variant: "softBlue", children: t("billing.admin.prices.badge.trial") })
|
|
3982
3982
|
] })
|
|
3983
3983
|
}
|
|
3984
3984
|
),
|
|
3985
3985
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3986
|
-
|
|
3986
|
+
_chunkGYW7LLBQjs.DetailField,
|
|
3987
3987
|
{
|
|
3988
3988
|
label: t("billing.admin.prices.fields.amount"),
|
|
3989
|
-
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children:
|
|
3989
|
+
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: _chunkGYW7LLBQjs.formatCurrency.call(void 0, price.unitAmount, price.currency, fmt) })
|
|
3990
3990
|
}
|
|
3991
3991
|
),
|
|
3992
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3992
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.DetailField, { label: t("billing.admin.prices.fields.currency"), value: price.currency.toUpperCase() }),
|
|
3993
3993
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3994
|
-
|
|
3994
|
+
_chunkGYW7LLBQjs.DetailField,
|
|
3995
3995
|
{
|
|
3996
3996
|
label: t("billing.admin.prices.fields.type"),
|
|
3997
3997
|
value: isRecurring ? t("billing.admin.prices.type.recurring") : t("billing.admin.prices.type.oneTime")
|
|
3998
3998
|
}
|
|
3999
3999
|
),
|
|
4000
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4000
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.DetailField, { label: t("billing.admin.prices.fields.billing"), value: _chunkGYW7LLBQjs.formatInterval.call(void 0, price, fmt) }),
|
|
4001
4001
|
isRecurring && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4002
|
-
|
|
4002
|
+
_chunkGYW7LLBQjs.DetailField,
|
|
4003
4003
|
{
|
|
4004
4004
|
label: t("billing.admin.prices.fields.intervalCount"),
|
|
4005
4005
|
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: _nullishCoalesce(_optionalChain([price, 'access', _158 => _158.recurring, 'optionalAccess', _159 => _159.intervalCount]), () => ( 1)) })
|
|
4006
4006
|
}
|
|
4007
4007
|
),
|
|
4008
4008
|
isRecurring && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4009
|
-
|
|
4009
|
+
_chunkGYW7LLBQjs.DetailField,
|
|
4010
4010
|
{
|
|
4011
4011
|
label: t("billing.admin.prices.fields.usageType"),
|
|
4012
4012
|
value: _optionalChain([price, 'access', _160 => _160.recurring, 'optionalAccess', _161 => _161.usageType]) === "metered" ? t("billing.admin.prices.usage.metered") : t("billing.admin.prices.usage.licensed")
|
|
@@ -4015,24 +4015,24 @@ function PriceDetails() {
|
|
|
4015
4015
|
] })
|
|
4016
4016
|
] }),
|
|
4017
4017
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
4018
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4018
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.SectionHeader, { children: t("billing.admin.prices.fields.platformFeatures") }),
|
|
4019
4019
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
|
|
4020
4020
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4021
|
-
|
|
4021
|
+
_chunkGYW7LLBQjs.DetailField,
|
|
4022
4022
|
{
|
|
4023
4023
|
label: t("billing.admin.prices.fields.token"),
|
|
4024
4024
|
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: _nullishCoalesce(price.token, () => ( "\u2014")) })
|
|
4025
4025
|
}
|
|
4026
4026
|
),
|
|
4027
4027
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4028
|
-
|
|
4028
|
+
_chunkGYW7LLBQjs.DetailField,
|
|
4029
4029
|
{
|
|
4030
4030
|
label: t("billing.admin.prices.fields.stripeId"),
|
|
4031
4031
|
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: price.stripePriceId })
|
|
4032
4032
|
}
|
|
4033
4033
|
),
|
|
4034
4034
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4035
|
-
|
|
4035
|
+
_chunkGYW7LLBQjs.DetailField,
|
|
4036
4036
|
{
|
|
4037
4037
|
label: t("billing.admin.prices.fields.description"),
|
|
4038
4038
|
value: _nullishCoalesce(price.description, () => ( "\u2014")),
|
|
@@ -4040,7 +4040,7 @@ function PriceDetails() {
|
|
|
4040
4040
|
}
|
|
4041
4041
|
),
|
|
4042
4042
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4043
|
-
|
|
4043
|
+
_chunkGYW7LLBQjs.DetailField,
|
|
4044
4044
|
{
|
|
4045
4045
|
label: t("billing.admin.prices.fields.features"),
|
|
4046
4046
|
className: "md:col-span-2",
|
|
@@ -4048,11 +4048,11 @@ function PriceDetails() {
|
|
|
4048
4048
|
}
|
|
4049
4049
|
),
|
|
4050
4050
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4051
|
-
|
|
4051
|
+
_chunkGYW7LLBQjs.DetailField,
|
|
4052
4052
|
{
|
|
4053
4053
|
label: t("billing.admin.prices.fields.platformFeatures"),
|
|
4054
4054
|
className: "md:col-span-2",
|
|
4055
|
-
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,
|
|
4055
|
+
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, _chunkGYW7LLBQjs.Badge, { variant: "softGray", children: feature.name }, feature.id)) }) : "\u2014"
|
|
4056
4056
|
}
|
|
4057
4057
|
)
|
|
4058
4058
|
] })
|
|
@@ -4066,7 +4066,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, PriceDetails, "PriceDetails");
|
|
|
4066
4066
|
function PriceContainer() {
|
|
4067
4067
|
const { price } = usePriceContext();
|
|
4068
4068
|
if (!price) return null;
|
|
4069
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4069
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.RoundPageContainer, { module: _chunk4ORLPEK7js.Modules.StripePrice, id: price.id, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PriceDetails, {}) });
|
|
4070
4070
|
}
|
|
4071
4071
|
_chunk7QVYU63Ejs.__name.call(void 0, PriceContainer, "PriceContainer");
|
|
4072
4072
|
|
|
@@ -4191,7 +4191,7 @@ function PricesList({ productId, fullWidth }) {
|
|
|
4191
4191
|
const importInputRef = _react.useRef.call(void 0, null);
|
|
4192
4192
|
const [seed, setSeed] = _react.useState.call(void 0, void 0);
|
|
4193
4193
|
const [seedNonce, setSeedNonce] = _react.useState.call(void 0, 0);
|
|
4194
|
-
const data =
|
|
4194
|
+
const data = _chunkGYW7LLBQjs.useDataListRetriever.call(void 0, {
|
|
4195
4195
|
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunk4ORLPEK7js.StripePriceService.listPrices({ ...params, productId }), "retriever"),
|
|
4196
4196
|
retrieverParams: {},
|
|
4197
4197
|
module: _chunk4ORLPEK7js.Modules.StripePrice
|
|
@@ -4229,7 +4229,7 @@ function PricesList({ productId, fullWidth }) {
|
|
|
4229
4229
|
openSeededEditor(transfer.price);
|
|
4230
4230
|
} catch (error) {
|
|
4231
4231
|
console.error("[PricesList] price import failed", error);
|
|
4232
|
-
|
|
4232
|
+
_chunkGYW7LLBQjs.errorToast.call(void 0, {
|
|
4233
4233
|
title: t("billing.admin.prices.import.errors.title"),
|
|
4234
4234
|
error: t("billing.admin.prices.import.errors.invalid")
|
|
4235
4235
|
});
|
|
@@ -4248,7 +4248,7 @@ function PricesList({ productId, fullWidth }) {
|
|
|
4248
4248
|
"create-price"
|
|
4249
4249
|
),
|
|
4250
4250
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _react.Fragment, { children: [
|
|
4251
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
4251
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGYW7LLBQjs.Button, { variant: "outline", size: "sm", type: "button", onClick: () => _optionalChain([importInputRef, 'access', _176 => _176.current, 'optionalAccess', _177 => _177.click, 'call', _178 => _178()]), children: [
|
|
4252
4252
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.UploadIcon, {}),
|
|
4253
4253
|
t("billing.admin.prices.actions.import")
|
|
4254
4254
|
] }),
|
|
@@ -4266,7 +4266,7 @@ function PricesList({ productId, fullWidth }) {
|
|
|
4266
4266
|
];
|
|
4267
4267
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
4268
4268
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4269
|
-
|
|
4269
|
+
_chunkGYW7LLBQjs.ContentListTable,
|
|
4270
4270
|
{
|
|
4271
4271
|
data,
|
|
4272
4272
|
fields: [
|
|
@@ -4283,7 +4283,7 @@ function PricesList({ productId, fullWidth }) {
|
|
|
4283
4283
|
fullWidth,
|
|
4284
4284
|
title: t("billing.admin.prices.title"),
|
|
4285
4285
|
emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4286
|
-
|
|
4286
|
+
_chunkGYW7LLBQjs.EmptyState,
|
|
4287
4287
|
{
|
|
4288
4288
|
icon: _lucidereact.DollarSignIcon,
|
|
4289
4289
|
title: t("billing.admin.prices.empty.title"),
|
|
@@ -4323,18 +4323,18 @@ function ProductDetails() {
|
|
|
4323
4323
|
const { product } = useProductContext();
|
|
4324
4324
|
if (!product) return null;
|
|
4325
4325
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
4326
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4326
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.SectionHeader, { children: t("billing.admin.products.tabs.details") }),
|
|
4327
4327
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
|
|
4328
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4328
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.DetailField, { label: t("billing.admin.products.fields.name"), value: product.name }),
|
|
4329
4329
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4330
|
-
|
|
4330
|
+
_chunkGYW7LLBQjs.DetailField,
|
|
4331
4331
|
{
|
|
4332
4332
|
label: t("billing.admin.products.fields.status"),
|
|
4333
|
-
value: product.active ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4333
|
+
value: product.active ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Badge, { variant: "softGreen", children: t("billing.admin.products.status.active") }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.Badge, { variant: "softGray", children: t("billing.admin.products.status.archived") })
|
|
4334
4334
|
}
|
|
4335
4335
|
),
|
|
4336
4336
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4337
|
-
|
|
4337
|
+
_chunkGYW7LLBQjs.DetailField,
|
|
4338
4338
|
{
|
|
4339
4339
|
label: t("billing.admin.products.fields.description"),
|
|
4340
4340
|
value: _nullishCoalesce(product.description, () => ( "\u2014")),
|
|
@@ -4342,14 +4342,14 @@ function ProductDetails() {
|
|
|
4342
4342
|
}
|
|
4343
4343
|
),
|
|
4344
4344
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4345
|
-
|
|
4345
|
+
_chunkGYW7LLBQjs.DetailField,
|
|
4346
4346
|
{
|
|
4347
4347
|
label: t("billing.admin.products.fields.prices"),
|
|
4348
4348
|
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: product.stripePrices.length })
|
|
4349
4349
|
}
|
|
4350
4350
|
),
|
|
4351
4351
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4352
|
-
|
|
4352
|
+
_chunkGYW7LLBQjs.DetailField,
|
|
4353
4353
|
{
|
|
4354
4354
|
label: t("billing.admin.products.fields.stripeId"),
|
|
4355
4355
|
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: product.stripeProductId })
|
|
@@ -4367,7 +4367,7 @@ function ProductContainer() {
|
|
|
4367
4367
|
const { product } = useProductContext();
|
|
4368
4368
|
if (!product) return null;
|
|
4369
4369
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4370
|
-
|
|
4370
|
+
_chunkGYW7LLBQjs.RoundPageContainer,
|
|
4371
4371
|
{
|
|
4372
4372
|
module: _chunk4ORLPEK7js.Modules.StripeProduct,
|
|
4373
4373
|
id: product.id,
|
|
@@ -4402,7 +4402,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, ProductContainer, "ProductContainer");
|
|
|
4402
4402
|
function ProductsList({ fullWidth } = {}) {
|
|
4403
4403
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
4404
4404
|
const { catalogueVersion } = useProductContext();
|
|
4405
|
-
const data =
|
|
4405
|
+
const data = _chunkGYW7LLBQjs.useDataListRetriever.call(void 0, {
|
|
4406
4406
|
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunk4ORLPEK7js.StripeProductService.listProducts(params), "retriever"),
|
|
4407
4407
|
retrieverParams: {},
|
|
4408
4408
|
module: _chunk4ORLPEK7js.Modules.StripeProduct
|
|
@@ -4412,7 +4412,7 @@ function ProductsList({ fullWidth } = {}) {
|
|
|
4412
4412
|
}, [catalogueVersion]);
|
|
4413
4413
|
const functions = [/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductEditor, {}, "create-product")];
|
|
4414
4414
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4415
|
-
|
|
4415
|
+
_chunkGYW7LLBQjs.ContentListTable,
|
|
4416
4416
|
{
|
|
4417
4417
|
data,
|
|
4418
4418
|
fields: ["name" /* name */, "status" /* status */, "prices" /* prices */],
|
|
@@ -4421,7 +4421,7 @@ function ProductsList({ fullWidth } = {}) {
|
|
|
4421
4421
|
fullWidth,
|
|
4422
4422
|
title: t("billing.admin.products.title"),
|
|
4423
4423
|
emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4424
|
-
|
|
4424
|
+
_chunkGYW7LLBQjs.EmptyState,
|
|
4425
4425
|
{
|
|
4426
4426
|
icon: _lucidereact.PackageIcon,
|
|
4427
4427
|
title: t("billing.admin.products.empty.title"),
|
|
@@ -4436,7 +4436,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, ProductsList, "ProductsList");
|
|
|
4436
4436
|
// src/features/billing/stripe-product/components/containers/ProductsListContainer.tsx
|
|
4437
4437
|
|
|
4438
4438
|
function ProductsListContainer() {
|
|
4439
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductProvider, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4439
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductProvider, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGYW7LLBQjs.RoundPageContainer, { module: _chunk4ORLPEK7js.Modules.StripeProduct, fullWidth: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductsList, { fullWidth: true }) }) });
|
|
4440
4440
|
}
|
|
4441
4441
|
_chunk7QVYU63Ejs.__name.call(void 0, ProductsListContainer, "ProductsListContainer");
|
|
4442
4442
|
|
|
@@ -4501,5 +4501,5 @@ _chunk7QVYU63Ejs.__name.call(void 0, ProductsListContainer, "ProductsListContain
|
|
|
4501
4501
|
|
|
4502
4502
|
|
|
4503
4503
|
|
|
4504
|
-
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.SubscriptionWizard = SubscriptionWizard; exports.SubscriptionsContainer = SubscriptionsContainer; exports.SubscriptionsList = SubscriptionsList; exports.UsageContainer = UsageContainer; exports.UsageHistoryTable = UsageHistoryTable; exports.UsageSummaryCard = UsageSummaryCard; exports.UsageSummaryCards = UsageSummaryCards; exports.WizardProgressIndicator = WizardProgressIndicator; exports.WizardStepPaymentMethod = WizardStepPaymentMethod; exports.WizardStepPlanSelection = WizardStepPlanSelection; exports.WizardStepReview = WizardStepReview; exports.formatCurrency =
|
|
4504
|
+
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.SubscriptionWizard = SubscriptionWizard; exports.SubscriptionsContainer = SubscriptionsContainer; exports.SubscriptionsList = SubscriptionsList; exports.UsageContainer = UsageContainer; exports.UsageHistoryTable = UsageHistoryTable; exports.UsageSummaryCard = UsageSummaryCard; exports.UsageSummaryCards = UsageSummaryCards; exports.WizardProgressIndicator = WizardProgressIndicator; exports.WizardStepPaymentMethod = WizardStepPaymentMethod; exports.WizardStepPlanSelection = WizardStepPlanSelection; exports.WizardStepReview = WizardStepReview; exports.formatCurrency = _chunkGYW7LLBQjs.formatCurrency; exports.formatDate = _chunkGYW7LLBQjs.formatDate; exports.formatFixed = _chunkGYW7LLBQjs.formatFixed; exports.formatInterval = _chunkGYW7LLBQjs.formatInterval; exports.isStripeConfigured = isStripeConfigured; exports.priceLabel = priceLabel; exports.useBillingFormatOptions = _chunkGYW7LLBQjs.useBillingFormatOptions; exports.usePriceContext = usePriceContext; exports.useProductContext = useProductContext;
|
|
4505
4505
|
//# sourceMappingURL=index.js.map
|