@burdenoff/microfe-billing 2026.1113.1 → 2026.1113.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/billing/BillingRoot.js +83 -77
- package/dist/billing/BillingRoot.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js +78 -78
- package/dist/billing/modules/addons/pages/AddonCreatePage.js +70 -70
- package/dist/billing/modules/addons/pages/AddonDetailPage.js +72 -72
- package/dist/billing/modules/addons/pages/AddonEditPage.js +79 -79
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +224 -224
- package/dist/billing/modules/addons/pages/AddonsListPage.js +186 -186
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +168 -168
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
- package/dist/billing/modules/analytics/pages/AnalyticsPage.js +88 -88
- package/dist/billing/modules/billing/hooks/index.js +5 -5
- package/dist/billing/modules/billing/hooks/useInvoices.js +39 -20
- package/dist/billing/modules/billing/hooks/useInvoices.js.map +1 -1
- package/dist/billing/modules/billing/index.js +14 -14
- package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.js +92 -92
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +160 -160
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/InvoicesListPage.js +100 -100
- package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.js +105 -105
- package/dist/billing/modules/billing/pages/PaymentMethodsPage.js +37 -37
- package/dist/billing/modules/billing/pages/RefundIssueLogsPage.js +41 -41
- package/dist/billing/modules/billing/pages/RefundsPage.js +334 -334
- package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/TransactionsPage.js +174 -174
- package/dist/billing/modules/billing/pages/TransactionsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/UserRefundsPage.js +24 -24
- package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
- package/dist/billing/modules/checkout/components/OrderSummary.js +71 -71
- package/dist/billing/modules/checkout/pages/CheckoutPage.js +646 -625
- package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
- package/dist/billing/modules/checkout/utils/checkoutOptions.d.ts +23 -0
- package/dist/billing/modules/checkout/utils/checkoutOptions.js +8 -0
- package/dist/billing/modules/checkout/utils/checkoutOptions.js.map +1 -0
- package/dist/billing/modules/coupons/pages/CouponDetailPage.js +112 -112
- package/dist/billing/modules/coupons/pages/CouponsListPage.js +118 -118
- package/dist/billing/modules/coupons/pages/CouponsListPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/CreateCouponPage.js +119 -119
- package/dist/billing/modules/coupons/pages/EditCouponPage.js +82 -82
- package/dist/billing/modules/credits/pages/AdminCreditsPage.js +30 -30
- package/dist/billing/modules/credits/pages/CreditTransactionsPage.js +77 -77
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +144 -144
- package/dist/billing/modules/credits/pages/CreditsPage.js +67 -67
- package/dist/billing/modules/dashboard/pages/OverviewPage.js +594 -442
- package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
- package/dist/billing/modules/dashboard/utils/overviewSummary.d.ts +46 -0
- package/dist/billing/modules/dashboard/utils/overviewSummary.js +37 -0
- package/dist/billing/modules/dashboard/utils/overviewSummary.js.map +1 -0
- package/dist/billing/modules/discounts/pages/DiscountsListPage.js +199 -199
- package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.js +64 -64
- package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js +122 -122
- package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/EarningsPage.js +102 -102
- package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +178 -178
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutsPage.js +107 -107
- package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanAssignFreePage.js +54 -54
- package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js +94 -94
- package/dist/billing/modules/plans/pages/PlanCreatePage.js +73 -73
- package/dist/billing/modules/plans/pages/PlanDetailPage.js +96 -96
- package/dist/billing/modules/plans/pages/PlanEditPage.js +16 -16
- package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlansBrowsePage.js +143 -143
- package/dist/billing/modules/plans/pages/PlansBrowsePage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlansListPage.js +88 -88
- package/dist/billing/modules/plans/utils/planAction.d.ts +9 -0
- package/dist/billing/modules/plans/utils/planAction.js +4 -1
- package/dist/billing/modules/plans/utils/planAction.js.map +1 -1
- package/dist/billing/modules/promotions/pages/CreatePromotionPage.js +60 -60
- package/dist/billing/modules/promotions/pages/PromotionsListPage.js +37 -37
- package/dist/billing/modules/quota/pages/QuotaAssignFreePage.js +62 -62
- package/dist/billing/modules/quota/pages/QuotaPage.js +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +69 -69
- package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js +76 -76
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +80 -80
- package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js +95 -95
- package/dist/billing/modules/settings/pages/SettingsPage.js +134 -134
- package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +62 -62
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js +36 -36
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +534 -410
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +111 -111
- package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js +166 -160
- package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.d.ts +30 -0
- package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.js +20 -0
- package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.js.map +1 -0
- package/dist/billing/modules/subscriptions/utils/upgradeAccess.d.ts +10 -0
- package/dist/billing/modules/subscriptions/utils/upgradeAccess.js +7 -0
- package/dist/billing/modules/subscriptions/utils/upgradeAccess.js.map +1 -0
- package/dist/billing/modules/usage/pages/UsagePage.js +722 -591
- package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
- package/dist/billing/modules/usage/utils/usageHealth.d.ts +63 -0
- package/dist/billing/modules/usage/utils/usageHealth.js +43 -0
- package/dist/billing/modules/usage/utils/usageHealth.js.map +1 -0
- package/dist/billing/shared/components/EmptyState.js +3 -3
- package/dist/billing/shared/components/MoneyActionDialog.js +12 -12
- package/dist/billing/shared/ui/MetricCard.js +13 -13
- package/dist/billing/shared/utils/format.js +16 -4
- package/dist/billing/shared/utils/format.js.map +1 -1
- package/dist/billing/shared/utils/index.js +8 -8
- package/dist/generated/global-operations.js +294 -286
- package/dist/generated/global-operations.js.map +1 -1
- package/package.json +2 -2
|
@@ -7,10 +7,10 @@ import { useAddonMutations as o, useAddons as s } from "../hooks/useAddons.js";
|
|
|
7
7
|
import { useDefaultBillingCurrency as c } from "../../../hooks/useDefaultBillingCurrency.js";
|
|
8
8
|
import { getPlanFeatureQuantity as l } from "../../../shared/utils/planFeatureQuantity.js";
|
|
9
9
|
import { useMemo as u, useState as d } from "react";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
10
|
+
import { IllustratedEmptyState as f, PagePurpose as p } from "@burdenoff/fe-libs/ui";
|
|
11
|
+
import { Minus as m, Plus as h, ShoppingCart as g, Trash2 as _, X as v } from "lucide-react";
|
|
12
|
+
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
13
|
+
import { useI18n as S } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
14
14
|
import { createPortal as C } from "react-dom";
|
|
15
15
|
import { ASSISTANT_BOTTOM_CHROME_CLEARANCE as w } from "@burdenoff/fe-libs/shared/assistant";
|
|
16
16
|
// src/billing/modules/addons/pages/AddonsListPage.tsx
|
|
@@ -41,23 +41,23 @@ function E(e, t = "USD") {
|
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
var D = () => {
|
|
44
|
-
let { t: r } =
|
|
44
|
+
let { t: r } = S(), i = (e, t) => {
|
|
45
45
|
let n = r(e);
|
|
46
46
|
return n === e ? t : n;
|
|
47
|
-
}, a = e(), l = t(), { addons: u, isLoading:
|
|
48
|
-
if (!l.canViewAddons) return /* @__PURE__ */
|
|
47
|
+
}, a = e(), l = t(), { addons: u, isLoading: m, error: h, refetch: g } = s(), { toggleAddon: _, isToggling: v } = o(), { addToCart: y, removeFromCart: C, updateQuantity: w, isInCart: T, getCartItem: E } = n(), [D, j] = d("grid"), [M, N] = d(!1), [P, F] = d("all"), I = c();
|
|
48
|
+
if (!l.canViewAddons) return /* @__PURE__ */ b("div", {
|
|
49
49
|
className: "flex items-center justify-center h-full min-h-[400px]",
|
|
50
|
-
children: /* @__PURE__ */
|
|
50
|
+
children: /* @__PURE__ */ x("div", {
|
|
51
51
|
className: "text-center space-y-2",
|
|
52
52
|
children: [
|
|
53
|
-
/* @__PURE__ */
|
|
53
|
+
/* @__PURE__ */ b("div", {
|
|
54
54
|
className: "size-12 mx-auto rounded-full bg-bg-sunken flex items-center justify-center",
|
|
55
|
-
children: /* @__PURE__ */
|
|
55
|
+
children: /* @__PURE__ */ b("svg", {
|
|
56
56
|
className: "size-6 text-text-muted",
|
|
57
57
|
fill: "none",
|
|
58
58
|
viewBox: "0 0 24 24",
|
|
59
59
|
stroke: "currentColor",
|
|
60
|
-
children: /* @__PURE__ */
|
|
60
|
+
children: /* @__PURE__ */ b("path", {
|
|
61
61
|
strokeLinecap: "round",
|
|
62
62
|
strokeLinejoin: "round",
|
|
63
63
|
strokeWidth: 2,
|
|
@@ -65,11 +65,11 @@ var D = () => {
|
|
|
65
65
|
})
|
|
66
66
|
})
|
|
67
67
|
}),
|
|
68
|
-
/* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ b("h2", {
|
|
69
69
|
className: "text-lg font-semibold text-text-primary",
|
|
70
70
|
children: i("billing.accessDenied.title", "Access Denied")
|
|
71
71
|
}),
|
|
72
|
-
/* @__PURE__ */
|
|
72
|
+
/* @__PURE__ */ b("p", {
|
|
73
73
|
className: "text-sm text-text-muted max-w-sm",
|
|
74
74
|
children: i("billing.addons.noViewPermission", "You don't have permission to view addons.")
|
|
75
75
|
})
|
|
@@ -78,7 +78,7 @@ var D = () => {
|
|
|
78
78
|
});
|
|
79
79
|
let L = u.filter((e) => !(!M && !e.isActive || P !== "all" && e.duration !== P)), R = async (e) => {
|
|
80
80
|
if (l.canManageAddons) try {
|
|
81
|
-
await
|
|
81
|
+
await _(e.id, !e.isActive), await g();
|
|
82
82
|
} catch (e) {
|
|
83
83
|
console.error("Failed to toggle addon:", e);
|
|
84
84
|
}
|
|
@@ -87,43 +87,43 @@ var D = () => {
|
|
|
87
87
|
}, B = (e) => {
|
|
88
88
|
a(`/addons/${e.id}/edit`);
|
|
89
89
|
};
|
|
90
|
-
return
|
|
90
|
+
return m && u.length === 0 ? /* @__PURE__ */ x("div", {
|
|
91
91
|
className: "space-y-6 p-6",
|
|
92
|
-
children: [/* @__PURE__ */
|
|
92
|
+
children: [/* @__PURE__ */ b("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ b("div", {
|
|
93
93
|
className: "grid grid-cols-1 md:grid-cols-3 gap-6",
|
|
94
94
|
children: [
|
|
95
95
|
1,
|
|
96
96
|
2,
|
|
97
97
|
3
|
|
98
|
-
].map((e) => /* @__PURE__ */
|
|
98
|
+
].map((e) => /* @__PURE__ */ x("div", {
|
|
99
99
|
className: "border border-border-subtle rounded-lg p-6 space-y-4",
|
|
100
100
|
children: [
|
|
101
|
-
/* @__PURE__ */
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ b("div", { className: "h-6 w-24 bg-bg-sunken animate-pulse rounded" }),
|
|
102
|
+
/* @__PURE__ */ b("div", { className: "h-8 w-32 bg-bg-sunken animate-pulse rounded" }),
|
|
103
|
+
/* @__PURE__ */ b("div", {
|
|
104
104
|
className: "space-y-2",
|
|
105
105
|
children: [
|
|
106
106
|
1,
|
|
107
107
|
2,
|
|
108
108
|
3
|
|
109
|
-
].map((e) => /* @__PURE__ */
|
|
109
|
+
].map((e) => /* @__PURE__ */ b("div", { className: "h-4 w-full bg-bg-sunken animate-pulse rounded" }, e))
|
|
110
110
|
})
|
|
111
111
|
]
|
|
112
112
|
}, e))
|
|
113
113
|
})]
|
|
114
|
-
}) :
|
|
114
|
+
}) : h ? /* @__PURE__ */ b("div", {
|
|
115
115
|
className: "flex items-center justify-center h-full min-h-[400px]",
|
|
116
|
-
children: /* @__PURE__ */
|
|
116
|
+
children: /* @__PURE__ */ x("div", {
|
|
117
117
|
className: "text-center space-y-4",
|
|
118
118
|
children: [
|
|
119
|
-
/* @__PURE__ */
|
|
119
|
+
/* @__PURE__ */ b("div", {
|
|
120
120
|
className: "size-12 mx-auto rounded-full bg-status-error-bg-subtle flex items-center justify-center",
|
|
121
|
-
children: /* @__PURE__ */
|
|
121
|
+
children: /* @__PURE__ */ b("svg", {
|
|
122
122
|
className: "size-6 text-status-error-text",
|
|
123
123
|
fill: "none",
|
|
124
124
|
viewBox: "0 0 24 24",
|
|
125
125
|
stroke: "currentColor",
|
|
126
|
-
children: /* @__PURE__ */
|
|
126
|
+
children: /* @__PURE__ */ b("path", {
|
|
127
127
|
strokeLinecap: "round",
|
|
128
128
|
strokeLinejoin: "round",
|
|
129
129
|
strokeWidth: 2,
|
|
@@ -131,50 +131,50 @@ var D = () => {
|
|
|
131
131
|
})
|
|
132
132
|
})
|
|
133
133
|
}),
|
|
134
|
-
/* @__PURE__ */
|
|
134
|
+
/* @__PURE__ */ b("h2", {
|
|
135
135
|
className: "text-lg font-semibold text-text-primary",
|
|
136
136
|
children: i("billing.addons.failedToLoad", "Failed to load addons")
|
|
137
137
|
}),
|
|
138
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ b("p", {
|
|
139
139
|
className: "text-sm text-text-muted",
|
|
140
|
-
children:
|
|
140
|
+
children: h.message
|
|
141
141
|
}),
|
|
142
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ b("button", {
|
|
143
143
|
type: "button",
|
|
144
|
-
onClick: () =>
|
|
144
|
+
onClick: () => g(),
|
|
145
145
|
className: "px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors",
|
|
146
146
|
children: "Try Again"
|
|
147
147
|
})
|
|
148
148
|
]
|
|
149
149
|
})
|
|
150
|
-
}) : /* @__PURE__ */
|
|
150
|
+
}) : /* @__PURE__ */ x("div", {
|
|
151
151
|
className: "space-y-6 p-6",
|
|
152
152
|
children: [
|
|
153
|
-
/* @__PURE__ */
|
|
153
|
+
/* @__PURE__ */ x("div", {
|
|
154
154
|
className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
|
|
155
|
-
children: [/* @__PURE__ */
|
|
156
|
-
/* @__PURE__ */
|
|
155
|
+
children: [/* @__PURE__ */ x("div", { children: [
|
|
156
|
+
/* @__PURE__ */ b("h1", {
|
|
157
157
|
className: "text-2xl md:text-3xl font-semibold tracking-tight text-text-primary",
|
|
158
158
|
children: i("billing.addons.title", "Addons")
|
|
159
159
|
}),
|
|
160
|
-
/* @__PURE__ */
|
|
160
|
+
/* @__PURE__ */ b("p", {
|
|
161
161
|
className: "text-sm text-text-muted mt-1",
|
|
162
162
|
children: i("billing.addons.subtitle", "Enhance your subscription with additional features")
|
|
163
163
|
}),
|
|
164
|
-
/* @__PURE__ */
|
|
164
|
+
/* @__PURE__ */ b(p, {
|
|
165
165
|
className: "mt-3",
|
|
166
166
|
children: i("billing.addons.listPurpose", "Manage the catalog of add-ons customers can buy alongside their subscriptions — including inactive ones. Create new add-ons, edit their price and the quotas they grant, and activate or deactivate them to control availability.")
|
|
167
167
|
})
|
|
168
|
-
] }), l.canManageAddons && /* @__PURE__ */
|
|
168
|
+
] }), l.canManageAddons && /* @__PURE__ */ x("button", {
|
|
169
169
|
type: "button",
|
|
170
170
|
onClick: () => a("/addons/new"),
|
|
171
171
|
className: "inline-flex items-center gap-2 px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors",
|
|
172
|
-
children: [/* @__PURE__ */
|
|
172
|
+
children: [/* @__PURE__ */ b("svg", {
|
|
173
173
|
className: "size-4",
|
|
174
174
|
fill: "none",
|
|
175
175
|
viewBox: "0 0 24 24",
|
|
176
176
|
stroke: "currentColor",
|
|
177
|
-
children: /* @__PURE__ */
|
|
177
|
+
children: /* @__PURE__ */ b("path", {
|
|
178
178
|
strokeLinecap: "round",
|
|
179
179
|
strokeLinejoin: "round",
|
|
180
180
|
strokeWidth: 2,
|
|
@@ -183,25 +183,25 @@ var D = () => {
|
|
|
183
183
|
}), "Create Addon"]
|
|
184
184
|
})]
|
|
185
185
|
}),
|
|
186
|
-
/* @__PURE__ */
|
|
186
|
+
/* @__PURE__ */ x("div", {
|
|
187
187
|
className: "flex flex-wrap items-center gap-4 pb-4 border-b border-border-subtle",
|
|
188
188
|
children: [
|
|
189
|
-
/* @__PURE__ */
|
|
189
|
+
/* @__PURE__ */ x("div", {
|
|
190
190
|
className: "inline-flex rounded-lg border border-border-subtle p-1 bg-bg-sunken/50",
|
|
191
191
|
children: [
|
|
192
|
-
/* @__PURE__ */
|
|
192
|
+
/* @__PURE__ */ b("button", {
|
|
193
193
|
type: "button",
|
|
194
194
|
onClick: () => F("all"),
|
|
195
195
|
className: `px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${P === "all" ? "bg-bg-surface text-text-primary shadow-sm" : "text-text-muted hover:text-text-primary"}`,
|
|
196
196
|
children: "All"
|
|
197
197
|
}),
|
|
198
|
-
/* @__PURE__ */
|
|
198
|
+
/* @__PURE__ */ b("button", {
|
|
199
199
|
type: "button",
|
|
200
200
|
onClick: () => F("monthly"),
|
|
201
201
|
className: `px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${P === "monthly" ? "bg-bg-surface text-text-primary shadow-sm" : "text-text-muted hover:text-text-primary"}`,
|
|
202
202
|
children: "Monthly"
|
|
203
203
|
}),
|
|
204
|
-
/* @__PURE__ */
|
|
204
|
+
/* @__PURE__ */ b("button", {
|
|
205
205
|
type: "button",
|
|
206
206
|
onClick: () => F("yearly"),
|
|
207
207
|
className: `px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${P === "yearly" ? "bg-bg-surface text-text-primary shadow-sm" : "text-text-muted hover:text-text-primary"}`,
|
|
@@ -209,48 +209,48 @@ var D = () => {
|
|
|
209
209
|
})
|
|
210
210
|
]
|
|
211
211
|
}),
|
|
212
|
-
l.canManageAddons && /* @__PURE__ */
|
|
212
|
+
l.canManageAddons && /* @__PURE__ */ x("label", {
|
|
213
213
|
className: "flex items-center gap-2 text-sm cursor-pointer",
|
|
214
|
-
children: [/* @__PURE__ */
|
|
214
|
+
children: [/* @__PURE__ */ b("input", {
|
|
215
215
|
type: "checkbox",
|
|
216
216
|
checked: M,
|
|
217
217
|
onChange: (e) => N(e.target.checked),
|
|
218
218
|
className: "size-4 rounded border-border-subtle text-text-link focus:ring-[var(--color-focus-ring)]"
|
|
219
|
-
}), /* @__PURE__ */
|
|
219
|
+
}), /* @__PURE__ */ b("span", {
|
|
220
220
|
className: "text-text-muted",
|
|
221
221
|
children: i("billing.addons.showInactive", "Show inactive addons")
|
|
222
222
|
})]
|
|
223
223
|
}),
|
|
224
|
-
/* @__PURE__ */
|
|
224
|
+
/* @__PURE__ */ x("div", {
|
|
225
225
|
className: "ml-auto inline-flex rounded-lg border border-border-subtle p-1 bg-bg-sunken/50",
|
|
226
|
-
children: [/* @__PURE__ */
|
|
226
|
+
children: [/* @__PURE__ */ b("button", {
|
|
227
227
|
type: "button",
|
|
228
228
|
onClick: () => j("grid"),
|
|
229
229
|
className: `p-1.5 rounded-md transition-colors ${D === "grid" ? "bg-bg-surface text-text-primary shadow-sm" : "text-text-muted hover:text-text-primary"}`,
|
|
230
230
|
title: "Grid view",
|
|
231
|
-
children: /* @__PURE__ */
|
|
231
|
+
children: /* @__PURE__ */ b("svg", {
|
|
232
232
|
className: "size-4",
|
|
233
233
|
fill: "none",
|
|
234
234
|
viewBox: "0 0 24 24",
|
|
235
235
|
stroke: "currentColor",
|
|
236
|
-
children: /* @__PURE__ */
|
|
236
|
+
children: /* @__PURE__ */ b("path", {
|
|
237
237
|
strokeLinecap: "round",
|
|
238
238
|
strokeLinejoin: "round",
|
|
239
239
|
strokeWidth: 2,
|
|
240
240
|
d: "M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"
|
|
241
241
|
})
|
|
242
242
|
})
|
|
243
|
-
}), /* @__PURE__ */
|
|
243
|
+
}), /* @__PURE__ */ b("button", {
|
|
244
244
|
type: "button",
|
|
245
245
|
onClick: () => j("list"),
|
|
246
246
|
className: `p-1.5 rounded-md transition-colors ${D === "list" ? "bg-bg-surface text-text-primary shadow-sm" : "text-text-muted hover:text-text-primary"}`,
|
|
247
247
|
title: "List view",
|
|
248
|
-
children: /* @__PURE__ */
|
|
248
|
+
children: /* @__PURE__ */ b("svg", {
|
|
249
249
|
className: "size-4",
|
|
250
250
|
fill: "none",
|
|
251
251
|
viewBox: "0 0 24 24",
|
|
252
252
|
stroke: "currentColor",
|
|
253
|
-
children: /* @__PURE__ */
|
|
253
|
+
children: /* @__PURE__ */ b("path", {
|
|
254
254
|
strokeLinecap: "round",
|
|
255
255
|
strokeLinejoin: "round",
|
|
256
256
|
strokeWidth: 2,
|
|
@@ -261,83 +261,83 @@ var D = () => {
|
|
|
261
261
|
})
|
|
262
262
|
]
|
|
263
263
|
}),
|
|
264
|
-
L.length === 0 ? /* @__PURE__ */
|
|
264
|
+
L.length === 0 ? /* @__PURE__ */ b(f, {
|
|
265
265
|
illustration: "empty-data",
|
|
266
266
|
title: i("billing.addons.noAddonsFound", "No addons found"),
|
|
267
267
|
description: M ? i("billing.addons.noAddonsFiltered", "No addons match your current filters.") : i("billing.addons.noActiveAddons", "There are no active addons available."),
|
|
268
|
-
action: l.canManageAddons ? /* @__PURE__ */
|
|
268
|
+
action: l.canManageAddons ? /* @__PURE__ */ b("button", {
|
|
269
269
|
type: "button",
|
|
270
270
|
onClick: () => a("/addons/new"),
|
|
271
271
|
className: "px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors",
|
|
272
272
|
children: i("billing.addons.createFirstAddon", "Create your first addon")
|
|
273
273
|
}) : void 0
|
|
274
|
-
}) : D === "grid" ? /* @__PURE__ */
|
|
274
|
+
}) : D === "grid" ? /* @__PURE__ */ b("div", {
|
|
275
275
|
className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",
|
|
276
276
|
children: L.map((e) => {
|
|
277
277
|
let t = E(e.id);
|
|
278
|
-
return /* @__PURE__ */
|
|
278
|
+
return /* @__PURE__ */ b(O, {
|
|
279
279
|
addon: e,
|
|
280
280
|
onView: z,
|
|
281
281
|
onEdit: B,
|
|
282
282
|
onToggle: R,
|
|
283
283
|
canManage: l.canManageAddons,
|
|
284
|
-
isToggling:
|
|
284
|
+
isToggling: v,
|
|
285
285
|
isInCart: T(e.id),
|
|
286
286
|
cartQuantity: t?.quantity || 0,
|
|
287
|
-
onAddToCart:
|
|
287
|
+
onAddToCart: y,
|
|
288
288
|
onUpdateQuantity: w,
|
|
289
289
|
onRemoveFromCart: C,
|
|
290
290
|
displayCurrency: I
|
|
291
291
|
}, e.id);
|
|
292
292
|
})
|
|
293
|
-
}) : /* @__PURE__ */
|
|
293
|
+
}) : /* @__PURE__ */ b("div", {
|
|
294
294
|
className: "space-y-3",
|
|
295
295
|
children: L.map((e) => {
|
|
296
296
|
let t = E(e.id);
|
|
297
|
-
return /* @__PURE__ */
|
|
297
|
+
return /* @__PURE__ */ b(k, {
|
|
298
298
|
addon: e,
|
|
299
299
|
onView: z,
|
|
300
300
|
onEdit: B,
|
|
301
301
|
onToggle: R,
|
|
302
302
|
canManage: l.canManageAddons,
|
|
303
|
-
isToggling:
|
|
303
|
+
isToggling: v,
|
|
304
304
|
isInCart: T(e.id),
|
|
305
305
|
cartQuantity: t?.quantity || 0,
|
|
306
|
-
onAddToCart:
|
|
306
|
+
onAddToCart: y,
|
|
307
307
|
onUpdateQuantity: w,
|
|
308
308
|
onRemoveFromCart: C,
|
|
309
309
|
displayCurrency: I
|
|
310
310
|
}, e.id);
|
|
311
311
|
})
|
|
312
312
|
}),
|
|
313
|
-
/* @__PURE__ */
|
|
313
|
+
/* @__PURE__ */ b(A, { displayCurrency: I })
|
|
314
314
|
]
|
|
315
315
|
});
|
|
316
|
-
}, O = ({ addon: e, onView: t, onEdit: n, onToggle: o, canManage: s, displayCurrency: c, isToggling: l, isInCart: d, cartQuantity:
|
|
316
|
+
}, O = ({ addon: e, onView: t, onEdit: n, onToggle: o, canManage: s, displayCurrency: c, isToggling: l, isInCart: d, cartQuantity: f, onAddToCart: p, onUpdateQuantity: v, onRemoveFromCart: y }) => {
|
|
317
317
|
let S = u(() => T(e.features || []), [e.features]);
|
|
318
|
-
return /* @__PURE__ */
|
|
318
|
+
return /* @__PURE__ */ x("div", {
|
|
319
319
|
className: `relative border rounded-card p-6 shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:border-border-strong hover:shadow-[var(--shadow-elevation-2)] flex flex-col h-full ${e.isActive ? d ? "border-action-primary-bg bg-[var(--color-accent-soft)]" : "border-border-subtle bg-bg-surface" : "border-dashed border-text-muted/30 bg-bg-sunken/30"}`,
|
|
320
320
|
children: [
|
|
321
|
-
!e.isActive && /* @__PURE__ */
|
|
321
|
+
!e.isActive && /* @__PURE__ */ b("span", {
|
|
322
322
|
className: "absolute top-4 right-4 px-2 py-1 text-xs font-medium bg-bg-sunken text-text-muted rounded",
|
|
323
323
|
children: "Inactive"
|
|
324
324
|
}),
|
|
325
|
-
d && e.isActive && /* @__PURE__ */
|
|
325
|
+
d && e.isActive && /* @__PURE__ */ x("span", {
|
|
326
326
|
className: "absolute top-4 right-4 px-2 py-1 text-xs font-medium bg-action-primary-bg text-action-primary-text rounded",
|
|
327
327
|
children: [
|
|
328
328
|
"In Cart (",
|
|
329
|
-
|
|
329
|
+
f,
|
|
330
330
|
")"
|
|
331
331
|
]
|
|
332
332
|
}),
|
|
333
|
-
/* @__PURE__ */
|
|
333
|
+
/* @__PURE__ */ b("div", {
|
|
334
334
|
className: "size-10 rounded-lg bg-[var(--color-accent-soft)] flex items-center justify-center mb-4",
|
|
335
|
-
children: /* @__PURE__ */
|
|
335
|
+
children: /* @__PURE__ */ b("svg", {
|
|
336
336
|
className: "size-5 text-text-link",
|
|
337
337
|
fill: "none",
|
|
338
338
|
viewBox: "0 0 24 24",
|
|
339
339
|
stroke: "currentColor",
|
|
340
|
-
children: /* @__PURE__ */
|
|
340
|
+
children: /* @__PURE__ */ b("path", {
|
|
341
341
|
strokeLinecap: "round",
|
|
342
342
|
strokeLinejoin: "round",
|
|
343
343
|
strokeWidth: 2,
|
|
@@ -345,55 +345,55 @@ var D = () => {
|
|
|
345
345
|
})
|
|
346
346
|
})
|
|
347
347
|
}),
|
|
348
|
-
/* @__PURE__ */
|
|
348
|
+
/* @__PURE__ */ x("div", {
|
|
349
349
|
className: "mb-4",
|
|
350
|
-
children: [/* @__PURE__ */
|
|
350
|
+
children: [/* @__PURE__ */ b("h3", {
|
|
351
351
|
className: "text-lg font-bold text-text-primary",
|
|
352
352
|
children: e.name
|
|
353
|
-
}), /* @__PURE__ */
|
|
353
|
+
}), /* @__PURE__ */ b("span", {
|
|
354
354
|
className: "text-sm text-text-muted",
|
|
355
355
|
children: a(e.duration)
|
|
356
356
|
})]
|
|
357
357
|
}),
|
|
358
|
-
/* @__PURE__ */
|
|
358
|
+
/* @__PURE__ */ x("div", {
|
|
359
359
|
className: "flex items-baseline gap-1 mb-4",
|
|
360
|
-
children: [/* @__PURE__ */
|
|
360
|
+
children: [/* @__PURE__ */ b("span", {
|
|
361
361
|
className: "text-2xl font-bold text-text-primary",
|
|
362
362
|
children: (() => {
|
|
363
363
|
let { price: t, currency: n } = E(e, c);
|
|
364
364
|
return r(t, n);
|
|
365
365
|
})()
|
|
366
|
-
}), /* @__PURE__ */
|
|
366
|
+
}), /* @__PURE__ */ x("span", {
|
|
367
367
|
className: "text-text-muted text-sm",
|
|
368
368
|
children: ["/ ", i(e.duration)]
|
|
369
369
|
})]
|
|
370
370
|
}),
|
|
371
|
-
S.length > 0 && /* @__PURE__ */
|
|
371
|
+
S.length > 0 && /* @__PURE__ */ x("ul", {
|
|
372
372
|
className: "space-y-2 mb-4",
|
|
373
|
-
children: [S.slice(0, 4).map((e) => /* @__PURE__ */
|
|
373
|
+
children: [S.slice(0, 4).map((e) => /* @__PURE__ */ x("li", {
|
|
374
374
|
className: "flex items-center justify-between text-sm",
|
|
375
|
-
children: [/* @__PURE__ */
|
|
375
|
+
children: [/* @__PURE__ */ x("div", {
|
|
376
376
|
className: "flex items-center gap-2",
|
|
377
|
-
children: [/* @__PURE__ */
|
|
377
|
+
children: [/* @__PURE__ */ b("svg", {
|
|
378
378
|
className: "size-4 text-status-success-text shrink-0",
|
|
379
379
|
fill: "none",
|
|
380
380
|
viewBox: "0 0 24 24",
|
|
381
381
|
stroke: "currentColor",
|
|
382
|
-
children: /* @__PURE__ */
|
|
382
|
+
children: /* @__PURE__ */ b("path", {
|
|
383
383
|
strokeLinecap: "round",
|
|
384
384
|
strokeLinejoin: "round",
|
|
385
385
|
strokeWidth: 2,
|
|
386
386
|
d: "M5 13l4 4L19 7"
|
|
387
387
|
})
|
|
388
|
-
}), /* @__PURE__ */
|
|
388
|
+
}), /* @__PURE__ */ b("span", {
|
|
389
389
|
className: "text-text-primary",
|
|
390
390
|
children: e.name
|
|
391
391
|
})]
|
|
392
|
-
}), /* @__PURE__ */
|
|
392
|
+
}), /* @__PURE__ */ b("span", {
|
|
393
393
|
className: "font-medium text-text-primary",
|
|
394
394
|
children: e.totalValue.toLocaleString()
|
|
395
395
|
})]
|
|
396
|
-
}, e.quotaId)), S.length > 4 && /* @__PURE__ */
|
|
396
|
+
}, e.quotaId)), S.length > 4 && /* @__PURE__ */ x("li", {
|
|
397
397
|
className: "text-sm text-text-muted pl-6",
|
|
398
398
|
children: [
|
|
399
399
|
"+",
|
|
@@ -402,58 +402,58 @@ var D = () => {
|
|
|
402
402
|
]
|
|
403
403
|
})]
|
|
404
404
|
}),
|
|
405
|
-
/* @__PURE__ */
|
|
405
|
+
/* @__PURE__ */ x("div", {
|
|
406
406
|
className: "space-y-2 pt-4 border-t border-border-subtle mt-auto",
|
|
407
407
|
children: [
|
|
408
|
-
e.isActive && (d ? /* @__PURE__ */
|
|
408
|
+
e.isActive && (d ? /* @__PURE__ */ x("div", {
|
|
409
409
|
className: "flex items-center justify-between gap-2",
|
|
410
|
-
children: [/* @__PURE__ */
|
|
410
|
+
children: [/* @__PURE__ */ x("div", {
|
|
411
411
|
className: "flex items-center gap-1",
|
|
412
412
|
children: [
|
|
413
|
-
/* @__PURE__ */
|
|
413
|
+
/* @__PURE__ */ b("button", {
|
|
414
414
|
type: "button",
|
|
415
|
-
onClick: () =>
|
|
415
|
+
onClick: () => v(e.id, f - 1),
|
|
416
416
|
className: "p-1.5 rounded border border-border-subtle hover:bg-bg-sunken transition-colors",
|
|
417
|
-
children: /* @__PURE__ */
|
|
417
|
+
children: /* @__PURE__ */ b(m, { className: "size-4" })
|
|
418
418
|
}),
|
|
419
|
-
/* @__PURE__ */
|
|
419
|
+
/* @__PURE__ */ b("span", {
|
|
420
420
|
className: "w-10 text-center font-medium",
|
|
421
|
-
children:
|
|
421
|
+
children: f
|
|
422
422
|
}),
|
|
423
|
-
/* @__PURE__ */
|
|
423
|
+
/* @__PURE__ */ b("button", {
|
|
424
424
|
type: "button",
|
|
425
|
-
onClick: () =>
|
|
425
|
+
onClick: () => v(e.id, f + 1),
|
|
426
426
|
className: "p-1.5 rounded border border-border-subtle hover:bg-bg-sunken transition-colors",
|
|
427
|
-
children: /* @__PURE__ */
|
|
427
|
+
children: /* @__PURE__ */ b(h, { className: "size-4" })
|
|
428
428
|
})
|
|
429
429
|
]
|
|
430
|
-
}), /* @__PURE__ */
|
|
430
|
+
}), /* @__PURE__ */ b("button", {
|
|
431
431
|
type: "button",
|
|
432
|
-
onClick: () =>
|
|
432
|
+
onClick: () => y(e.id),
|
|
433
433
|
className: "p-1.5 rounded text-status-error-text hover:bg-status-error-bg-subtle transition-colors",
|
|
434
434
|
title: "Remove from cart",
|
|
435
|
-
children: /* @__PURE__ */
|
|
435
|
+
children: /* @__PURE__ */ b(_, { className: "size-4" })
|
|
436
436
|
})]
|
|
437
|
-
}) : /* @__PURE__ */
|
|
437
|
+
}) : /* @__PURE__ */ x("button", {
|
|
438
438
|
type: "button",
|
|
439
|
-
onClick: () =>
|
|
439
|
+
onClick: () => p(e),
|
|
440
440
|
className: "w-full px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors flex items-center justify-center gap-2",
|
|
441
|
-
children: [/* @__PURE__ */
|
|
441
|
+
children: [/* @__PURE__ */ b(g, { className: "size-4" }), "Add to Cart"]
|
|
442
442
|
})),
|
|
443
|
-
/* @__PURE__ */
|
|
443
|
+
/* @__PURE__ */ b("button", {
|
|
444
444
|
type: "button",
|
|
445
445
|
onClick: () => t(e),
|
|
446
446
|
className: "w-full px-4 py-2 text-sm font-medium border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken transition-colors",
|
|
447
447
|
children: "View Details"
|
|
448
448
|
}),
|
|
449
|
-
s && /* @__PURE__ */
|
|
449
|
+
s && /* @__PURE__ */ x("div", {
|
|
450
450
|
className: "flex gap-2",
|
|
451
|
-
children: [/* @__PURE__ */
|
|
451
|
+
children: [/* @__PURE__ */ b("button", {
|
|
452
452
|
type: "button",
|
|
453
453
|
onClick: () => n(e),
|
|
454
454
|
className: "flex-1 px-3 py-2 text-sm font-medium border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken transition-colors",
|
|
455
455
|
children: "Edit"
|
|
456
|
-
}), /* @__PURE__ */
|
|
456
|
+
}), /* @__PURE__ */ b("button", {
|
|
457
457
|
type: "button",
|
|
458
458
|
onClick: () => o(e),
|
|
459
459
|
disabled: l,
|
|
@@ -465,19 +465,19 @@ var D = () => {
|
|
|
465
465
|
})
|
|
466
466
|
]
|
|
467
467
|
});
|
|
468
|
-
}, k = ({ addon: e, onView: t, onEdit: n, onToggle: a, canManage: o, displayCurrency: s, isToggling: c, isInCart: l, cartQuantity: d, onAddToCart:
|
|
468
|
+
}, k = ({ addon: e, onView: t, onEdit: n, onToggle: a, canManage: o, displayCurrency: s, isToggling: c, isInCart: l, cartQuantity: d, onAddToCart: f, onUpdateQuantity: p, onRemoveFromCart: v }) => {
|
|
469
469
|
let S = u(() => T(e.features || []), [e.features]);
|
|
470
|
-
return /* @__PURE__ */
|
|
470
|
+
return /* @__PURE__ */ x("div", {
|
|
471
471
|
className: `flex items-center gap-4 p-4 border rounded-card shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:border-border-strong hover:shadow-[var(--shadow-elevation-2)] ${e.isActive ? l ? "border-action-primary-bg bg-[var(--color-accent-soft)]" : "border-border-subtle bg-bg-surface" : "border-dashed border-text-muted/30 bg-bg-sunken/30"}`,
|
|
472
472
|
children: [
|
|
473
|
-
/* @__PURE__ */
|
|
473
|
+
/* @__PURE__ */ b("div", {
|
|
474
474
|
className: "size-10 rounded-lg bg-[var(--color-accent-soft)] flex items-center justify-center shrink-0",
|
|
475
|
-
children: /* @__PURE__ */
|
|
475
|
+
children: /* @__PURE__ */ b("svg", {
|
|
476
476
|
className: "size-5 text-text-link",
|
|
477
477
|
fill: "none",
|
|
478
478
|
viewBox: "0 0 24 24",
|
|
479
479
|
stroke: "currentColor",
|
|
480
|
-
children: /* @__PURE__ */
|
|
480
|
+
children: /* @__PURE__ */ b("path", {
|
|
481
481
|
strokeLinecap: "round",
|
|
482
482
|
strokeLinejoin: "round",
|
|
483
483
|
strokeWidth: 2,
|
|
@@ -485,20 +485,20 @@ var D = () => {
|
|
|
485
485
|
})
|
|
486
486
|
})
|
|
487
487
|
}),
|
|
488
|
-
/* @__PURE__ */
|
|
488
|
+
/* @__PURE__ */ x("div", {
|
|
489
489
|
className: "flex-1 min-w-0",
|
|
490
|
-
children: [/* @__PURE__ */
|
|
490
|
+
children: [/* @__PURE__ */ x("div", {
|
|
491
491
|
className: "flex items-center gap-2",
|
|
492
492
|
children: [
|
|
493
|
-
/* @__PURE__ */
|
|
493
|
+
/* @__PURE__ */ b("h3", {
|
|
494
494
|
className: "font-semibold text-text-primary truncate",
|
|
495
495
|
children: e.name
|
|
496
496
|
}),
|
|
497
|
-
!e.isActive && /* @__PURE__ */
|
|
497
|
+
!e.isActive && /* @__PURE__ */ b("span", {
|
|
498
498
|
className: "px-2 py-0.5 text-xs font-medium bg-bg-sunken text-text-muted rounded",
|
|
499
499
|
children: "Inactive"
|
|
500
500
|
}),
|
|
501
|
-
l && e.isActive && /* @__PURE__ */
|
|
501
|
+
l && e.isActive && /* @__PURE__ */ x("span", {
|
|
502
502
|
className: "px-2 py-0.5 text-xs font-medium bg-action-primary-bg text-action-primary-text rounded",
|
|
503
503
|
children: [
|
|
504
504
|
"In Cart (",
|
|
@@ -507,7 +507,7 @@ var D = () => {
|
|
|
507
507
|
]
|
|
508
508
|
})
|
|
509
509
|
]
|
|
510
|
-
}), /* @__PURE__ */
|
|
510
|
+
}), /* @__PURE__ */ x("p", {
|
|
511
511
|
className: "text-sm text-text-muted",
|
|
512
512
|
children: [
|
|
513
513
|
S.length,
|
|
@@ -516,65 +516,65 @@ var D = () => {
|
|
|
516
516
|
]
|
|
517
517
|
})]
|
|
518
518
|
}),
|
|
519
|
-
/* @__PURE__ */
|
|
519
|
+
/* @__PURE__ */ x("div", {
|
|
520
520
|
className: "text-right",
|
|
521
|
-
children: [/* @__PURE__ */
|
|
521
|
+
children: [/* @__PURE__ */ b("div", {
|
|
522
522
|
className: "font-semibold text-text-primary",
|
|
523
523
|
children: (() => {
|
|
524
524
|
let { price: t, currency: n } = E(e, s);
|
|
525
525
|
return r(t, n);
|
|
526
526
|
})()
|
|
527
|
-
}), /* @__PURE__ */
|
|
527
|
+
}), /* @__PURE__ */ x("div", {
|
|
528
528
|
className: "text-sm text-text-muted",
|
|
529
529
|
children: ["per ", i(e.duration)]
|
|
530
530
|
})]
|
|
531
531
|
}),
|
|
532
|
-
e.isActive && (l ? /* @__PURE__ */
|
|
532
|
+
e.isActive && (l ? /* @__PURE__ */ x("div", {
|
|
533
533
|
className: "flex items-center gap-1",
|
|
534
534
|
children: [
|
|
535
|
-
/* @__PURE__ */
|
|
535
|
+
/* @__PURE__ */ b("button", {
|
|
536
536
|
type: "button",
|
|
537
|
-
onClick: () =>
|
|
537
|
+
onClick: () => p(e.id, d - 1),
|
|
538
538
|
className: "p-1.5 rounded border border-border-subtle hover:bg-bg-sunken transition-colors",
|
|
539
|
-
children: /* @__PURE__ */
|
|
539
|
+
children: /* @__PURE__ */ b(m, { className: "size-4" })
|
|
540
540
|
}),
|
|
541
|
-
/* @__PURE__ */
|
|
541
|
+
/* @__PURE__ */ b("span", {
|
|
542
542
|
className: "w-8 text-center font-medium",
|
|
543
543
|
children: d
|
|
544
544
|
}),
|
|
545
|
-
/* @__PURE__ */
|
|
545
|
+
/* @__PURE__ */ b("button", {
|
|
546
546
|
type: "button",
|
|
547
|
-
onClick: () =>
|
|
547
|
+
onClick: () => p(e.id, d + 1),
|
|
548
548
|
className: "p-1.5 rounded border border-border-subtle hover:bg-bg-sunken transition-colors",
|
|
549
|
-
children: /* @__PURE__ */
|
|
549
|
+
children: /* @__PURE__ */ b(h, { className: "size-4" })
|
|
550
550
|
}),
|
|
551
|
-
/* @__PURE__ */
|
|
551
|
+
/* @__PURE__ */ b("button", {
|
|
552
552
|
type: "button",
|
|
553
|
-
onClick: () =>
|
|
553
|
+
onClick: () => v(e.id),
|
|
554
554
|
className: "p-1.5 rounded text-status-error-text hover:bg-status-error-bg-subtle transition-colors ml-1",
|
|
555
555
|
title: "Remove from cart",
|
|
556
|
-
children: /* @__PURE__ */
|
|
556
|
+
children: /* @__PURE__ */ b(_, { className: "size-4" })
|
|
557
557
|
})
|
|
558
558
|
]
|
|
559
|
-
}) : /* @__PURE__ */
|
|
559
|
+
}) : /* @__PURE__ */ x("button", {
|
|
560
560
|
type: "button",
|
|
561
|
-
onClick: () =>
|
|
561
|
+
onClick: () => f(e),
|
|
562
562
|
className: "px-3 py-1.5 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors flex items-center gap-1.5",
|
|
563
|
-
children: [/* @__PURE__ */
|
|
563
|
+
children: [/* @__PURE__ */ b(g, { className: "size-4" }), "Add"]
|
|
564
564
|
})),
|
|
565
|
-
/* @__PURE__ */
|
|
565
|
+
/* @__PURE__ */ x("div", {
|
|
566
566
|
className: "flex items-center gap-2",
|
|
567
|
-
children: [/* @__PURE__ */
|
|
567
|
+
children: [/* @__PURE__ */ b("button", {
|
|
568
568
|
type: "button",
|
|
569
569
|
onClick: () => t(e),
|
|
570
570
|
className: "px-3 py-1.5 text-sm font-medium border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken transition-colors",
|
|
571
571
|
children: "View"
|
|
572
|
-
}), o && /* @__PURE__ */ y
|
|
572
|
+
}), o && /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("button", {
|
|
573
573
|
type: "button",
|
|
574
574
|
onClick: () => n(e),
|
|
575
575
|
className: "px-3 py-1.5 text-sm font-medium border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken transition-colors",
|
|
576
576
|
children: "Edit"
|
|
577
|
-
}), /* @__PURE__ */
|
|
577
|
+
}), /* @__PURE__ */ b("button", {
|
|
578
578
|
type: "button",
|
|
579
579
|
onClick: () => a(e),
|
|
580
580
|
disabled: c,
|
|
@@ -585,23 +585,23 @@ var D = () => {
|
|
|
585
585
|
]
|
|
586
586
|
});
|
|
587
587
|
}, A = ({ displayCurrency: t }) => {
|
|
588
|
-
let a = e(), { items: o, isCartOpen: s, toggleCart: c, closeCart: l, removeFromCart: u, updateQuantity: d, clearCart:
|
|
589
|
-
return o.length === 0 && !s ? null : /* @__PURE__ */ y
|
|
588
|
+
let a = e(), { items: o, isCartOpen: s, toggleCart: c, closeCart: l, removeFromCart: u, updateQuantity: d, clearCart: f } = n(), p = o.reduce((e, t) => e + t.quantity, 0);
|
|
589
|
+
return o.length === 0 && !s ? null : /* @__PURE__ */ x(y, { children: [!s && o.length > 0 && C(/* @__PURE__ */ x("button", {
|
|
590
590
|
type: "button",
|
|
591
591
|
onClick: c,
|
|
592
592
|
style: { bottom: `calc(1.5rem + ${w})` },
|
|
593
593
|
className: "fixed left-6 sm:left-auto sm:right-6 z-50 flex items-center gap-2 px-4 py-3 bg-action-primary-bg text-action-primary-text rounded-full shadow-[var(--shadow-elevation-3)] hover:bg-action-primary-bgHover transition-all duration-200",
|
|
594
594
|
children: [
|
|
595
|
-
/* @__PURE__ */
|
|
596
|
-
/* @__PURE__ */
|
|
595
|
+
/* @__PURE__ */ b(g, { className: "size-5" }),
|
|
596
|
+
/* @__PURE__ */ x("span", {
|
|
597
597
|
className: "font-medium",
|
|
598
598
|
children: [
|
|
599
|
-
|
|
599
|
+
p,
|
|
600
600
|
" item",
|
|
601
|
-
|
|
601
|
+
p === 1 ? "" : "s"
|
|
602
602
|
]
|
|
603
603
|
}),
|
|
604
|
-
/* @__PURE__ */
|
|
604
|
+
/* @__PURE__ */ b("span", {
|
|
605
605
|
className: "px-2 py-0.5 bg-[var(--color-accent-soft)] rounded-full text-sm",
|
|
606
606
|
children: (() => {
|
|
607
607
|
let e = o.reduce((e, { addon: n, quantity: r }) => {
|
|
@@ -612,53 +612,53 @@ var D = () => {
|
|
|
612
612
|
})()
|
|
613
613
|
})
|
|
614
614
|
]
|
|
615
|
-
}), document.body), s && /* @__PURE__ */
|
|
615
|
+
}), document.body), s && /* @__PURE__ */ x("div", {
|
|
616
616
|
className: "fixed inset-0 z-50 flex items-end sm:items-center justify-center",
|
|
617
|
-
children: [/* @__PURE__ */
|
|
617
|
+
children: [/* @__PURE__ */ b("div", {
|
|
618
618
|
className: "absolute inset-0 bg-overlay-scrim",
|
|
619
619
|
onClick: l
|
|
620
|
-
}), /* @__PURE__ */
|
|
620
|
+
}), /* @__PURE__ */ x("div", {
|
|
621
621
|
className: "relative w-full max-w-md max-h-[80vh] bg-bg-elevated border border-border-subtle rounded-t-card sm:rounded-card shadow-[var(--shadow-elevation-4)] overflow-hidden",
|
|
622
622
|
children: [
|
|
623
|
-
/* @__PURE__ */
|
|
623
|
+
/* @__PURE__ */ x("div", {
|
|
624
624
|
className: "flex items-center justify-between px-4 py-3 border-b border-border-subtle bg-bg-sunken/30",
|
|
625
|
-
children: [/* @__PURE__ */
|
|
625
|
+
children: [/* @__PURE__ */ x("div", {
|
|
626
626
|
className: "flex items-center gap-2",
|
|
627
627
|
children: [
|
|
628
|
-
/* @__PURE__ */
|
|
629
|
-
/* @__PURE__ */
|
|
628
|
+
/* @__PURE__ */ b(g, { className: "size-5 text-text-primary" }),
|
|
629
|
+
/* @__PURE__ */ b("h3", {
|
|
630
630
|
className: "font-semibold text-text-primary",
|
|
631
631
|
children: "Your Cart"
|
|
632
632
|
}),
|
|
633
|
-
/* @__PURE__ */
|
|
633
|
+
/* @__PURE__ */ x("span", {
|
|
634
634
|
className: "px-2 py-0.5 text-xs bg-action-primary-bg text-action-primary-text rounded-full",
|
|
635
635
|
children: [
|
|
636
|
-
|
|
636
|
+
p,
|
|
637
637
|
" item",
|
|
638
|
-
|
|
638
|
+
p === 1 ? "" : "s"
|
|
639
639
|
]
|
|
640
640
|
})
|
|
641
641
|
]
|
|
642
|
-
}), /* @__PURE__ */
|
|
642
|
+
}), /* @__PURE__ */ b("button", {
|
|
643
643
|
type: "button",
|
|
644
644
|
onClick: l,
|
|
645
645
|
className: "p-1.5 rounded hover:bg-bg-sunken transition-colors",
|
|
646
|
-
children: /* @__PURE__ */ v
|
|
646
|
+
children: /* @__PURE__ */ b(v, { className: "size-5" })
|
|
647
647
|
})]
|
|
648
648
|
}),
|
|
649
|
-
/* @__PURE__ */
|
|
649
|
+
/* @__PURE__ */ b("div", {
|
|
650
650
|
className: "overflow-y-auto max-h-[50vh] divide-y divide-border-subtle",
|
|
651
|
-
children: o.map(({ addon: e, quantity: n }) => /* @__PURE__ */
|
|
651
|
+
children: o.map(({ addon: e, quantity: n }) => /* @__PURE__ */ x("div", {
|
|
652
652
|
className: "p-4 flex items-center gap-3",
|
|
653
653
|
children: [
|
|
654
|
-
/* @__PURE__ */
|
|
654
|
+
/* @__PURE__ */ b("div", {
|
|
655
655
|
className: "size-10 rounded-lg bg-[var(--color-accent-soft)] flex items-center justify-center shrink-0",
|
|
656
|
-
children: /* @__PURE__ */
|
|
656
|
+
children: /* @__PURE__ */ b("svg", {
|
|
657
657
|
className: "size-5 text-text-link",
|
|
658
658
|
fill: "none",
|
|
659
659
|
viewBox: "0 0 24 24",
|
|
660
660
|
stroke: "currentColor",
|
|
661
|
-
children: /* @__PURE__ */
|
|
661
|
+
children: /* @__PURE__ */ b("path", {
|
|
662
662
|
strokeLinecap: "round",
|
|
663
663
|
strokeLinejoin: "round",
|
|
664
664
|
strokeWidth: 2,
|
|
@@ -666,12 +666,12 @@ var D = () => {
|
|
|
666
666
|
})
|
|
667
667
|
})
|
|
668
668
|
}),
|
|
669
|
-
/* @__PURE__ */
|
|
669
|
+
/* @__PURE__ */ x("div", {
|
|
670
670
|
className: "flex-1 min-w-0",
|
|
671
|
-
children: [/* @__PURE__ */
|
|
671
|
+
children: [/* @__PURE__ */ b("h4", {
|
|
672
672
|
className: "font-medium text-text-primary truncate",
|
|
673
673
|
children: e.name
|
|
674
|
-
}), /* @__PURE__ */
|
|
674
|
+
}), /* @__PURE__ */ x("p", {
|
|
675
675
|
className: "text-sm text-text-muted",
|
|
676
676
|
children: [
|
|
677
677
|
(() => {
|
|
@@ -684,30 +684,30 @@ var D = () => {
|
|
|
684
684
|
]
|
|
685
685
|
})]
|
|
686
686
|
}),
|
|
687
|
-
/* @__PURE__ */
|
|
687
|
+
/* @__PURE__ */ x("div", {
|
|
688
688
|
className: "flex items-center gap-1",
|
|
689
689
|
children: [
|
|
690
|
-
/* @__PURE__ */
|
|
690
|
+
/* @__PURE__ */ b("button", {
|
|
691
691
|
type: "button",
|
|
692
692
|
onClick: () => d(e.id, n - 1),
|
|
693
693
|
className: "p-1 rounded border border-border-subtle hover:bg-bg-sunken transition-colors",
|
|
694
|
-
children: /* @__PURE__ */
|
|
694
|
+
children: /* @__PURE__ */ b(m, { className: "size-3" })
|
|
695
695
|
}),
|
|
696
|
-
/* @__PURE__ */
|
|
696
|
+
/* @__PURE__ */ b("span", {
|
|
697
697
|
className: "w-6 text-center text-sm font-medium",
|
|
698
698
|
children: n
|
|
699
699
|
}),
|
|
700
|
-
/* @__PURE__ */
|
|
700
|
+
/* @__PURE__ */ b("button", {
|
|
701
701
|
type: "button",
|
|
702
702
|
onClick: () => d(e.id, n + 1),
|
|
703
703
|
className: "p-1 rounded border border-border-subtle hover:bg-bg-sunken transition-colors",
|
|
704
|
-
children: /* @__PURE__ */
|
|
704
|
+
children: /* @__PURE__ */ b(h, { className: "size-3" })
|
|
705
705
|
})
|
|
706
706
|
]
|
|
707
707
|
}),
|
|
708
|
-
/* @__PURE__ */
|
|
708
|
+
/* @__PURE__ */ b("div", {
|
|
709
709
|
className: "text-right",
|
|
710
|
-
children: /* @__PURE__ */
|
|
710
|
+
children: /* @__PURE__ */ b("p", {
|
|
711
711
|
className: "font-medium text-text-primary",
|
|
712
712
|
children: (() => {
|
|
713
713
|
let { price: i, currency: a } = E(e, t);
|
|
@@ -715,23 +715,23 @@ var D = () => {
|
|
|
715
715
|
})()
|
|
716
716
|
})
|
|
717
717
|
}),
|
|
718
|
-
/* @__PURE__ */
|
|
718
|
+
/* @__PURE__ */ b("button", {
|
|
719
719
|
type: "button",
|
|
720
720
|
onClick: () => u(e.id),
|
|
721
721
|
className: "p-1.5 rounded text-status-error-text hover:bg-status-error-bg-subtle transition-colors",
|
|
722
|
-
children: /* @__PURE__ */
|
|
722
|
+
children: /* @__PURE__ */ b(_, { className: "size-4" })
|
|
723
723
|
})
|
|
724
724
|
]
|
|
725
725
|
}, e.id))
|
|
726
726
|
}),
|
|
727
|
-
/* @__PURE__ */
|
|
727
|
+
/* @__PURE__ */ x("div", {
|
|
728
728
|
className: "border-t border-border-subtle p-4 space-y-3 bg-bg-sunken/20",
|
|
729
|
-
children: [/* @__PURE__ */
|
|
729
|
+
children: [/* @__PURE__ */ x("div", {
|
|
730
730
|
className: "flex items-center justify-between text-lg font-semibold",
|
|
731
|
-
children: [/* @__PURE__ */
|
|
731
|
+
children: [/* @__PURE__ */ b("span", {
|
|
732
732
|
className: "text-text-primary",
|
|
733
733
|
children: "Total"
|
|
734
|
-
}), /* @__PURE__ */
|
|
734
|
+
}), /* @__PURE__ */ b("span", {
|
|
735
735
|
className: "text-text-primary",
|
|
736
736
|
children: (() => {
|
|
737
737
|
let e = o.reduce((e, { addon: n, quantity: r }) => {
|
|
@@ -741,14 +741,14 @@ var D = () => {
|
|
|
741
741
|
return r(e, t);
|
|
742
742
|
})()
|
|
743
743
|
})]
|
|
744
|
-
}), /* @__PURE__ */
|
|
744
|
+
}), /* @__PURE__ */ x("div", {
|
|
745
745
|
className: "flex gap-2",
|
|
746
|
-
children: [/* @__PURE__ */
|
|
746
|
+
children: [/* @__PURE__ */ b("button", {
|
|
747
747
|
type: "button",
|
|
748
|
-
onClick:
|
|
748
|
+
onClick: f,
|
|
749
749
|
className: "flex-1 px-4 py-2.5 text-sm font-medium border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken transition-colors",
|
|
750
750
|
children: "Clear Cart"
|
|
751
|
-
}), /* @__PURE__ */
|
|
751
|
+
}), /* @__PURE__ */ b("button", {
|
|
752
752
|
type: "button",
|
|
753
753
|
onClick: () => {
|
|
754
754
|
l(), a("/checkout/addons");
|