@burdenoff/microfe-adaptercloud 2026.614.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/README.md +12 -0
  2. package/dist/adaptercloud/AdapterCloudRoot.js +177 -0
  3. package/dist/adaptercloud/AdapterCloudRoot.js.map +1 -0
  4. package/dist/adaptercloud/AdapterCloudRoutes.js +215 -0
  5. package/dist/adaptercloud/AdapterCloudRoutes.js.map +1 -0
  6. package/dist/adaptercloud/components/EmptyState.js +28 -0
  7. package/dist/adaptercloud/components/EmptyState.js.map +1 -0
  8. package/dist/adaptercloud/components/InvestmentCard.js +96 -0
  9. package/dist/adaptercloud/components/InvestmentCard.js.map +1 -0
  10. package/dist/adaptercloud/components/MetricsCard.js +46 -0
  11. package/dist/adaptercloud/components/MetricsCard.js.map +1 -0
  12. package/dist/adaptercloud/components/PageLayout.js +26 -0
  13. package/dist/adaptercloud/components/PageLayout.js.map +1 -0
  14. package/dist/adaptercloud/components/RatingDisplay.js +35 -0
  15. package/dist/adaptercloud/components/RatingDisplay.js.map +1 -0
  16. package/dist/adaptercloud/components/StatusBadge.js +45 -0
  17. package/dist/adaptercloud/components/StatusBadge.js.map +1 -0
  18. package/dist/adaptercloud/context/AdapterCloudContext.js +93 -0
  19. package/dist/adaptercloud/context/AdapterCloudContext.js.map +1 -0
  20. package/dist/adaptercloud/context/index.js +1 -0
  21. package/dist/adaptercloud/hooks/useAdapterCloudApi.js +223 -0
  22. package/dist/adaptercloud/hooks/useAdapterCloudApi.js.map +1 -0
  23. package/dist/adaptercloud/index.js +7 -0
  24. package/dist/adaptercloud/mocks/data.js +1517 -0
  25. package/dist/adaptercloud/mocks/data.js.map +1 -0
  26. package/dist/adaptercloud/mocks/users.js +34 -0
  27. package/dist/adaptercloud/mocks/users.js.map +1 -0
  28. package/dist/adaptercloud/pages/HomePage.js +921 -0
  29. package/dist/adaptercloud/pages/HomePage.js.map +1 -0
  30. package/dist/adaptercloud/pages/admin/AdminAnalyticsPage.js +645 -0
  31. package/dist/adaptercloud/pages/admin/AdminAnalyticsPage.js.map +1 -0
  32. package/dist/adaptercloud/pages/admin/AdminDashboard.js +639 -0
  33. package/dist/adaptercloud/pages/admin/AdminDashboard.js.map +1 -0
  34. package/dist/adaptercloud/pages/admin/AdminFinancialPage.js +421 -0
  35. package/dist/adaptercloud/pages/admin/AdminFinancialPage.js.map +1 -0
  36. package/dist/adaptercloud/pages/admin/AdminOrdersPage.js +660 -0
  37. package/dist/adaptercloud/pages/admin/AdminOrdersPage.js.map +1 -0
  38. package/dist/adaptercloud/pages/admin/AdminProfilePage.js +259 -0
  39. package/dist/adaptercloud/pages/admin/AdminProfilePage.js.map +1 -0
  40. package/dist/adaptercloud/pages/admin/AdminSettingsPage.js +649 -0
  41. package/dist/adaptercloud/pages/admin/AdminSettingsPage.js.map +1 -0
  42. package/dist/adaptercloud/pages/admin/CartManagementPage.js +869 -0
  43. package/dist/adaptercloud/pages/admin/CartManagementPage.js.map +1 -0
  44. package/dist/adaptercloud/pages/admin/UserManagementPage.js +893 -0
  45. package/dist/adaptercloud/pages/admin/UserManagementPage.js.map +1 -0
  46. package/dist/adaptercloud/pages/cart-owner/AnalyticsDashboard.js +834 -0
  47. package/dist/adaptercloud/pages/cart-owner/AnalyticsDashboard.js.map +1 -0
  48. package/dist/adaptercloud/pages/cart-owner/BusinessSettingsPage.js +700 -0
  49. package/dist/adaptercloud/pages/cart-owner/BusinessSettingsPage.js.map +1 -0
  50. package/dist/adaptercloud/pages/cart-owner/CartOwnerDashboard.js +760 -0
  51. package/dist/adaptercloud/pages/cart-owner/CartOwnerDashboard.js.map +1 -0
  52. package/dist/adaptercloud/pages/cart-owner/CartOwnerProfilePage.js +886 -0
  53. package/dist/adaptercloud/pages/cart-owner/CartOwnerProfilePage.js.map +1 -0
  54. package/dist/adaptercloud/pages/cart-owner/CartServiceConfigPage.js +631 -0
  55. package/dist/adaptercloud/pages/cart-owner/CartServiceConfigPage.js.map +1 -0
  56. package/dist/adaptercloud/pages/cart-owner/InventoryManagementPage.js +913 -0
  57. package/dist/adaptercloud/pages/cart-owner/InventoryManagementPage.js.map +1 -0
  58. package/dist/adaptercloud/pages/cart-owner/OrderManagementPage.js +881 -0
  59. package/dist/adaptercloud/pages/cart-owner/OrderManagementPage.js.map +1 -0
  60. package/dist/adaptercloud/pages/cart-owner/StaffManagementPage.js +833 -0
  61. package/dist/adaptercloud/pages/cart-owner/StaffManagementPage.js.map +1 -0
  62. package/dist/adaptercloud/pages/common/HelpSupportPage.js +1325 -0
  63. package/dist/adaptercloud/pages/common/HelpSupportPage.js.map +1 -0
  64. package/dist/adaptercloud/pages/common/NotificationCenterPage.js +665 -0
  65. package/dist/adaptercloud/pages/common/NotificationCenterPage.js.map +1 -0
  66. package/dist/adaptercloud/pages/common/SettingsPage.js +964 -0
  67. package/dist/adaptercloud/pages/common/SettingsPage.js.map +1 -0
  68. package/dist/adaptercloud/pages/customer/BookingDetailsPage.js +593 -0
  69. package/dist/adaptercloud/pages/customer/BookingDetailsPage.js.map +1 -0
  70. package/dist/adaptercloud/pages/customer/CartDetailPage.js +620 -0
  71. package/dist/adaptercloud/pages/customer/CartDetailPage.js.map +1 -0
  72. package/dist/adaptercloud/pages/customer/CartDiscoveryPage.js +547 -0
  73. package/dist/adaptercloud/pages/customer/CartDiscoveryPage.js.map +1 -0
  74. package/dist/adaptercloud/pages/customer/CheckoutPage.js +532 -0
  75. package/dist/adaptercloud/pages/customer/CheckoutPage.js.map +1 -0
  76. package/dist/adaptercloud/pages/customer/CustomerDashboard.js +496 -0
  77. package/dist/adaptercloud/pages/customer/CustomerDashboard.js.map +1 -0
  78. package/dist/adaptercloud/pages/customer/CustomerProfilePage.js +621 -0
  79. package/dist/adaptercloud/pages/customer/CustomerProfilePage.js.map +1 -0
  80. package/dist/adaptercloud/pages/customer/DirectServiceBookingPage.js +623 -0
  81. package/dist/adaptercloud/pages/customer/DirectServiceBookingPage.js.map +1 -0
  82. package/dist/adaptercloud/pages/customer/FavoritesPage.js +477 -0
  83. package/dist/adaptercloud/pages/customer/FavoritesPage.js.map +1 -0
  84. package/dist/adaptercloud/pages/customer/OrderHistoryPage.js +438 -0
  85. package/dist/adaptercloud/pages/customer/OrderHistoryPage.js.map +1 -0
  86. package/dist/adaptercloud/pages/customer/OrderTrackingPage.js +388 -0
  87. package/dist/adaptercloud/pages/customer/OrderTrackingPage.js.map +1 -0
  88. package/dist/adaptercloud/pages/customer/PaymentMethodsPage.js +488 -0
  89. package/dist/adaptercloud/pages/customer/PaymentMethodsPage.js.map +1 -0
  90. package/dist/adaptercloud/pages/customer/ReviewsPage.js +606 -0
  91. package/dist/adaptercloud/pages/customer/ReviewsPage.js.map +1 -0
  92. package/dist/adaptercloud/pages/customer/SavedAddressesPage.js +443 -0
  93. package/dist/adaptercloud/pages/customer/SavedAddressesPage.js.map +1 -0
  94. package/dist/adaptercloud/pages/investor/InvestmentDetailsPage.js +849 -0
  95. package/dist/adaptercloud/pages/investor/InvestmentDetailsPage.js.map +1 -0
  96. package/dist/adaptercloud/pages/investor/InvestmentOpportunitiesPage.js +939 -0
  97. package/dist/adaptercloud/pages/investor/InvestmentOpportunitiesPage.js.map +1 -0
  98. package/dist/adaptercloud/pages/investor/InvestorAnalyticsPage.js +681 -0
  99. package/dist/adaptercloud/pages/investor/InvestorAnalyticsPage.js.map +1 -0
  100. package/dist/adaptercloud/pages/investor/InvestorDashboard.js +419 -0
  101. package/dist/adaptercloud/pages/investor/InvestorDashboard.js.map +1 -0
  102. package/dist/adaptercloud/pages/investor/InvestorInvestmentsPage.js +399 -0
  103. package/dist/adaptercloud/pages/investor/InvestorInvestmentsPage.js.map +1 -0
  104. package/dist/adaptercloud/pages/investor/InvestorPortfolioPage.js +569 -0
  105. package/dist/adaptercloud/pages/investor/InvestorPortfolioPage.js.map +1 -0
  106. package/dist/adaptercloud/pages/investor/InvestorProfilePage.js +1065 -0
  107. package/dist/adaptercloud/pages/investor/InvestorProfilePage.js.map +1 -0
  108. package/dist/adaptercloud/pages/worker/TaskDetailsPage.js +496 -0
  109. package/dist/adaptercloud/pages/worker/TaskDetailsPage.js.map +1 -0
  110. package/dist/adaptercloud/pages/worker/WorkerDashboard.js +634 -0
  111. package/dist/adaptercloud/pages/worker/WorkerDashboard.js.map +1 -0
  112. package/dist/adaptercloud/pages/worker/WorkerOrdersPage.js +675 -0
  113. package/dist/adaptercloud/pages/worker/WorkerOrdersPage.js.map +1 -0
  114. package/dist/adaptercloud/pages/worker/WorkerProfilePage.js +687 -0
  115. package/dist/adaptercloud/pages/worker/WorkerProfilePage.js.map +1 -0
  116. package/dist/adaptercloud/pages/worker/WorkerSchedulePage.js +578 -0
  117. package/dist/adaptercloud/pages/worker/WorkerSchedulePage.js.map +1 -0
  118. package/dist/adaptercloud/store/adaptercloudStore.js +38 -0
  119. package/dist/adaptercloud/store/adaptercloudStore.js.map +1 -0
  120. package/dist/adaptercloud/store/index.js +1 -0
  121. package/dist/adaptercloud/utils/cn.js +10 -0
  122. package/dist/adaptercloud/utils/cn.js.map +1 -0
  123. package/dist/adaptercloud/utils/formatters.js +51 -0
  124. package/dist/adaptercloud/utils/formatters.js.map +1 -0
  125. package/dist/adaptercloud/utils/navigation.js +9 -0
  126. package/dist/adaptercloud/utils/navigation.js.map +1 -0
  127. package/dist/index.js +7 -0
  128. package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +18 -0
  129. package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js.map +1 -0
  130. package/dist/node_modules/.bun/tailwind-merge@3.5.0/node_modules/tailwind-merge/dist/bundle-mjs.js +1674 -0
  131. package/dist/node_modules/.bun/tailwind-merge@3.5.0/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
  132. package/package.json +106 -0
@@ -0,0 +1,645 @@
1
+ import { useAdapterCloud as e } from "../../context/AdapterCloudContext.js";
2
+ import { cn as t } from "../../utils/cn.js";
3
+ import { PageLayout as n } from "../../components/PageLayout.js";
4
+ import { MetricsCard as r } from "../../components/MetricsCard.js";
5
+ import { formatCurrency as i } from "../../utils/formatters.js";
6
+ import { useEffect as a, useState as o } from "react";
7
+ import { Award as s, BarChart3 as c, IndianRupee as l, Loader2 as u, ShoppingBag as d, Star as f, Timer as p, Users as m, Zap as h } from "lucide-react";
8
+ import { jsx as g, jsxs as _ } from "react/jsx-runtime";
9
+ //#region src/adaptercloud/pages/admin/AdminAnalyticsPage.tsx
10
+ function v() {
11
+ let { currentUser: v } = e(), [y, b] = o(null), [x, S] = o(!0), [C, w] = o("month"), [T, E] = o("overview");
12
+ a(() => {
13
+ S(!0);
14
+ let e = setTimeout(() => {
15
+ b({
16
+ revenue: {
17
+ total: 125e5,
18
+ growth: 15.2,
19
+ thisMonth: 21e5,
20
+ lastMonth: 185e4
21
+ },
22
+ orders: {
23
+ total: 45230,
24
+ growth: 8.7,
25
+ pending: 156,
26
+ completed: 44890,
27
+ cancelled: 184,
28
+ averageOrderValue: 276,
29
+ ordersToday: 89
30
+ },
31
+ users: {
32
+ total: 12450,
33
+ growth: 12.3,
34
+ active: 9870,
35
+ newThisMonth: 456,
36
+ customers: 9850,
37
+ cartOwners: 1240,
38
+ workers: 890,
39
+ investors: 470
40
+ },
41
+ carts: {
42
+ total: 1240,
43
+ active: 1156,
44
+ pending: 84,
45
+ topPerforming: [
46
+ {
47
+ id: "c1",
48
+ name: "South Indian Express",
49
+ revenue: 285e3,
50
+ orders: 1250,
51
+ rating: 4.8
52
+ },
53
+ {
54
+ id: "c2",
55
+ name: "Mumbai Street Chaat",
56
+ revenue: 245e3,
57
+ orders: 980,
58
+ rating: 4.7
59
+ },
60
+ {
61
+ id: "c3",
62
+ name: "Delhi Paratha Corner",
63
+ revenue: 198e3,
64
+ orders: 876,
65
+ rating: 4.6
66
+ },
67
+ {
68
+ id: "c4",
69
+ name: "Bangalore Dosa House",
70
+ revenue: 176e3,
71
+ orders: 743,
72
+ rating: 4.9
73
+ },
74
+ {
75
+ id: "c5",
76
+ name: "Kolkata Fish Fry",
77
+ revenue: 154e3,
78
+ orders: 632,
79
+ rating: 4.5
80
+ }
81
+ ]
82
+ },
83
+ performance: {
84
+ averageDeliveryTime: 28,
85
+ customerSatisfaction: 4.6,
86
+ platformFee: 8.5,
87
+ operatingCosts: 21e5,
88
+ netProfit: 85e4
89
+ },
90
+ geography: { topCities: [
91
+ {
92
+ city: "Bangalore",
93
+ orders: 15670,
94
+ revenue: 425e4
95
+ },
96
+ {
97
+ city: "Mumbai",
98
+ orders: 12340,
99
+ revenue: 389e4
100
+ },
101
+ {
102
+ city: "Delhi",
103
+ orders: 9870,
104
+ revenue: 298e4
105
+ },
106
+ {
107
+ city: "Hyderabad",
108
+ orders: 7650,
109
+ revenue: 214e4
110
+ },
111
+ {
112
+ city: "Chennai",
113
+ orders: 6540,
114
+ revenue: 189e4
115
+ }
116
+ ] }
117
+ }), S(!1);
118
+ }, 800);
119
+ return () => clearTimeout(e);
120
+ }, [C]);
121
+ let D = (e) => e >= 1e7 ? `₹${(e / 1e7).toFixed(1)}Cr` : e >= 1e5 ? `₹${(e / 1e5).toFixed(1)}L` : i(e, { minimumFractionDigits: 0 }), O = (e) => e === 0 ? /* @__PURE__ */ g(s, { className: "h-5 w-5 text-yellow-500" }) : e === 1 ? /* @__PURE__ */ g(s, { className: "h-5 w-5 text-gray-400" }) : e === 2 ? /* @__PURE__ */ g(s, { className: "h-5 w-5 text-amber-700" }) : /* @__PURE__ */ g(c, { className: "h-5 w-5 text-muted-foreground" });
122
+ if (x || !y) return /* @__PURE__ */ g(n, {
123
+ title: "Platform Analytics",
124
+ description: "Loading analytics...",
125
+ children: /* @__PURE__ */ _("div", {
126
+ className: "flex flex-col items-center justify-center py-20",
127
+ children: [/* @__PURE__ */ g(u, { className: "h-10 w-10 animate-spin text-muted-foreground mb-4" }), /* @__PURE__ */ g("p", {
128
+ className: "text-muted-foreground",
129
+ children: "Loading analytics..."
130
+ })]
131
+ })
132
+ });
133
+ let k = [
134
+ {
135
+ key: "overview",
136
+ label: "Overview",
137
+ icon: c
138
+ },
139
+ {
140
+ key: "revenue",
141
+ label: "Revenue",
142
+ icon: l
143
+ },
144
+ {
145
+ key: "users",
146
+ label: "Users",
147
+ icon: m
148
+ },
149
+ {
150
+ key: "performance",
151
+ label: "Performance",
152
+ icon: h
153
+ }
154
+ ];
155
+ return /* @__PURE__ */ _(n, {
156
+ title: "Platform Analytics",
157
+ description: "Comprehensive platform metrics and trends",
158
+ children: [
159
+ /* @__PURE__ */ _("div", {
160
+ className: "flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-6",
161
+ children: [/* @__PURE__ */ _("select", {
162
+ value: C,
163
+ onChange: (e) => w(e.target.value),
164
+ className: "rounded-lg border border-border bg-card py-2 px-3 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring w-fit",
165
+ children: [
166
+ /* @__PURE__ */ g("option", {
167
+ value: "today",
168
+ children: "Today"
169
+ }),
170
+ /* @__PURE__ */ g("option", {
171
+ value: "week",
172
+ children: "This Week"
173
+ }),
174
+ /* @__PURE__ */ g("option", {
175
+ value: "month",
176
+ children: "This Month"
177
+ }),
178
+ /* @__PURE__ */ g("option", {
179
+ value: "quarter",
180
+ children: "This Quarter"
181
+ }),
182
+ /* @__PURE__ */ g("option", {
183
+ value: "year",
184
+ children: "This Year"
185
+ })
186
+ ]
187
+ }), /* @__PURE__ */ _("span", {
188
+ className: "text-sm text-muted-foreground",
189
+ children: ["Last updated: ", (/* @__PURE__ */ new Date()).toLocaleString("en-IN")]
190
+ })]
191
+ }),
192
+ /* @__PURE__ */ _("div", {
193
+ className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-8",
194
+ children: [
195
+ /* @__PURE__ */ g(r, {
196
+ icon: /* @__PURE__ */ g(l, { className: "h-5 w-5" }),
197
+ value: D(y.revenue.total),
198
+ label: "Total Revenue",
199
+ trend: "up",
200
+ trendValue: `+${y.revenue.growth}%`
201
+ }),
202
+ /* @__PURE__ */ g(r, {
203
+ icon: /* @__PURE__ */ g(d, { className: "h-5 w-5" }),
204
+ value: y.orders.total.toLocaleString("en-IN"),
205
+ label: "Total Orders",
206
+ trend: "up",
207
+ trendValue: `+${y.orders.growth}%`
208
+ }),
209
+ /* @__PURE__ */ g(r, {
210
+ icon: /* @__PURE__ */ g(m, { className: "h-5 w-5" }),
211
+ value: y.users.active.toLocaleString("en-IN"),
212
+ label: "Active Users",
213
+ trend: "up",
214
+ trendValue: `+${y.users.growth}%`
215
+ }),
216
+ /* @__PURE__ */ g(r, {
217
+ icon: /* @__PURE__ */ g(c, { className: "h-5 w-5" }),
218
+ value: y.carts.active.toLocaleString("en-IN"),
219
+ label: "Active Carts",
220
+ trendValue: `${y.carts.pending} pending`
221
+ })
222
+ ]
223
+ }),
224
+ /* @__PURE__ */ _("div", {
225
+ className: "rounded-lg border border-border bg-card mb-8",
226
+ children: [/* @__PURE__ */ g("div", {
227
+ className: "border-b border-border",
228
+ children: /* @__PURE__ */ g("nav", {
229
+ className: "flex -mb-px overflow-x-auto",
230
+ children: k.map((e) => {
231
+ let n = e.icon;
232
+ return /* @__PURE__ */ _("button", {
233
+ type: "button",
234
+ onClick: () => E(e.key),
235
+ className: t("flex items-center gap-2 py-3 px-4 sm:px-6 text-sm font-medium whitespace-nowrap border-b-2 transition-colors", T === e.key ? "border-primary text-primary" : "border-transparent text-muted-foreground hover:text-foreground"),
236
+ children: [/* @__PURE__ */ g(n, { className: "h-4 w-4" }), /* @__PURE__ */ g("span", {
237
+ className: "hidden sm:inline",
238
+ children: e.label
239
+ })]
240
+ }, e.key);
241
+ })
242
+ })
243
+ }), /* @__PURE__ */ _("div", {
244
+ className: "p-4 sm:p-6",
245
+ children: [
246
+ T === "overview" && /* @__PURE__ */ _("div", {
247
+ className: "space-y-8",
248
+ children: [/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("h3", {
249
+ className: "text-lg font-semibold text-foreground mb-4",
250
+ children: "Order Status Distribution"
251
+ }), /* @__PURE__ */ _("div", {
252
+ className: "grid grid-cols-1 sm:grid-cols-3 gap-4",
253
+ children: [
254
+ /* @__PURE__ */ _("div", {
255
+ className: "rounded-lg border border-green-500/30 bg-green-500/10 p-4",
256
+ children: [
257
+ /* @__PURE__ */ g("p", {
258
+ className: "text-sm text-green-600 dark:text-green-400",
259
+ children: "Completed Orders"
260
+ }),
261
+ /* @__PURE__ */ g("p", {
262
+ className: "text-2xl font-bold text-green-700 dark:text-green-300",
263
+ children: y.orders.completed.toLocaleString("en-IN")
264
+ }),
265
+ /* @__PURE__ */ _("p", {
266
+ className: "text-sm text-green-600/80 dark:text-green-400/80",
267
+ children: [(y.orders.completed / y.orders.total * 100).toFixed(1), "% of total"]
268
+ })
269
+ ]
270
+ }),
271
+ /* @__PURE__ */ _("div", {
272
+ className: "rounded-lg border border-yellow-500/30 bg-yellow-500/10 p-4",
273
+ children: [
274
+ /* @__PURE__ */ g("p", {
275
+ className: "text-sm text-yellow-600 dark:text-yellow-400",
276
+ children: "Pending Orders"
277
+ }),
278
+ /* @__PURE__ */ g("p", {
279
+ className: "text-2xl font-bold text-yellow-700 dark:text-yellow-300",
280
+ children: y.orders.pending.toLocaleString("en-IN")
281
+ }),
282
+ /* @__PURE__ */ _("p", {
283
+ className: "text-sm text-yellow-600/80 dark:text-yellow-400/80",
284
+ children: [(y.orders.pending / y.orders.total * 100).toFixed(1), "% of total"]
285
+ })
286
+ ]
287
+ }),
288
+ /* @__PURE__ */ _("div", {
289
+ className: "rounded-lg border border-red-500/30 bg-red-500/10 p-4",
290
+ children: [
291
+ /* @__PURE__ */ g("p", {
292
+ className: "text-sm text-red-600 dark:text-red-400",
293
+ children: "Cancelled Orders"
294
+ }),
295
+ /* @__PURE__ */ g("p", {
296
+ className: "text-2xl font-bold text-red-700 dark:text-red-300",
297
+ children: y.orders.cancelled.toLocaleString("en-IN")
298
+ }),
299
+ /* @__PURE__ */ _("p", {
300
+ className: "text-sm text-red-600/80 dark:text-red-400/80",
301
+ children: [(y.orders.cancelled / y.orders.total * 100).toFixed(1), "% of total"]
302
+ })
303
+ ]
304
+ })
305
+ ]
306
+ })] }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("h3", {
307
+ className: "text-lg font-semibold text-foreground mb-4",
308
+ children: "Top Performing Carts"
309
+ }), /* @__PURE__ */ g("div", {
310
+ className: "rounded-lg border border-border overflow-hidden",
311
+ children: /* @__PURE__ */ _("table", {
312
+ className: "w-full",
313
+ children: [/* @__PURE__ */ g("thead", { children: /* @__PURE__ */ _("tr", {
314
+ className: "border-b border-border bg-muted/50",
315
+ children: [
316
+ /* @__PURE__ */ g("th", {
317
+ className: "px-4 py-3 text-left text-xs font-medium text-muted-foreground uppercase",
318
+ children: "Cart Name"
319
+ }),
320
+ /* @__PURE__ */ g("th", {
321
+ className: "px-4 py-3 text-right text-xs font-medium text-muted-foreground uppercase",
322
+ children: "Revenue"
323
+ }),
324
+ /* @__PURE__ */ g("th", {
325
+ className: "px-4 py-3 text-right text-xs font-medium text-muted-foreground uppercase",
326
+ children: "Orders"
327
+ }),
328
+ /* @__PURE__ */ g("th", {
329
+ className: "px-4 py-3 text-right text-xs font-medium text-muted-foreground uppercase",
330
+ children: "Rating"
331
+ })
332
+ ]
333
+ }) }), /* @__PURE__ */ g("tbody", {
334
+ className: "divide-y divide-border",
335
+ children: y.carts.topPerforming.map((e, t) => /* @__PURE__ */ _("tr", {
336
+ className: "hover:bg-accent/50 transition-colors",
337
+ children: [
338
+ /* @__PURE__ */ g("td", {
339
+ className: "px-4 py-3",
340
+ children: /* @__PURE__ */ _("div", {
341
+ className: "flex items-center gap-2",
342
+ children: [O(t), /* @__PURE__ */ g("span", {
343
+ className: "text-sm font-medium text-foreground",
344
+ children: e.name
345
+ })]
346
+ })
347
+ }),
348
+ /* @__PURE__ */ g("td", {
349
+ className: "px-4 py-3 text-sm text-right font-medium text-foreground",
350
+ children: D(e.revenue)
351
+ }),
352
+ /* @__PURE__ */ g("td", {
353
+ className: "px-4 py-3 text-sm text-right text-foreground",
354
+ children: e.orders.toLocaleString("en-IN")
355
+ }),
356
+ /* @__PURE__ */ g("td", {
357
+ className: "px-4 py-3 text-sm text-right text-foreground",
358
+ children: /* @__PURE__ */ _("span", {
359
+ className: "flex items-center justify-end gap-1",
360
+ children: [/* @__PURE__ */ g(f, { className: "h-3.5 w-3.5 fill-yellow-400 text-yellow-400" }), e.rating]
361
+ })
362
+ })
363
+ ]
364
+ }, e.id))
365
+ })]
366
+ })
367
+ })] })]
368
+ }),
369
+ T === "revenue" && /* @__PURE__ */ _("div", {
370
+ className: "space-y-8",
371
+ children: [/* @__PURE__ */ _("div", {
372
+ className: "grid grid-cols-1 md:grid-cols-3 gap-4",
373
+ children: [
374
+ /* @__PURE__ */ _("div", {
375
+ className: "rounded-lg border border-blue-500/30 bg-blue-500/10 p-6",
376
+ children: [/* @__PURE__ */ g("h4", {
377
+ className: "text-sm font-medium text-blue-600 dark:text-blue-400 mb-2",
378
+ children: "This Month"
379
+ }), /* @__PURE__ */ g("p", {
380
+ className: "text-2xl font-bold text-blue-700 dark:text-blue-300",
381
+ children: D(y.revenue.thisMonth)
382
+ })]
383
+ }),
384
+ /* @__PURE__ */ _("div", {
385
+ className: "rounded-lg border border-border bg-muted/30 p-6",
386
+ children: [/* @__PURE__ */ g("h4", {
387
+ className: "text-sm font-medium text-muted-foreground mb-2",
388
+ children: "Last Month"
389
+ }), /* @__PURE__ */ g("p", {
390
+ className: "text-2xl font-bold text-foreground",
391
+ children: D(y.revenue.lastMonth)
392
+ })]
393
+ }),
394
+ /* @__PURE__ */ _("div", {
395
+ className: "rounded-lg border border-green-500/30 bg-green-500/10 p-6",
396
+ children: [/* @__PURE__ */ g("h4", {
397
+ className: "text-sm font-medium text-green-600 dark:text-green-400 mb-2",
398
+ children: "Average Order Value"
399
+ }), /* @__PURE__ */ _("p", {
400
+ className: "text-2xl font-bold text-green-700 dark:text-green-300",
401
+ children: ["₹", y.orders.averageOrderValue]
402
+ })]
403
+ })
404
+ ]
405
+ }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("h3", {
406
+ className: "text-lg font-semibold text-foreground mb-4",
407
+ children: "Revenue by City"
408
+ }), /* @__PURE__ */ g("div", {
409
+ className: "space-y-3",
410
+ children: y.geography.topCities.map((e, t) => /* @__PURE__ */ _("div", {
411
+ className: "flex items-center justify-between p-4 rounded-lg border border-border bg-muted/30",
412
+ children: [/* @__PURE__ */ _("div", {
413
+ className: "flex items-center gap-3",
414
+ children: [O(t), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
415
+ className: "font-medium text-foreground",
416
+ children: e.city
417
+ }), /* @__PURE__ */ _("p", {
418
+ className: "text-sm text-muted-foreground",
419
+ children: [e.orders.toLocaleString("en-IN"), " orders"]
420
+ })] })]
421
+ }), /* @__PURE__ */ _("div", {
422
+ className: "text-right",
423
+ children: [/* @__PURE__ */ g("p", {
424
+ className: "font-bold text-foreground",
425
+ children: D(e.revenue)
426
+ }), /* @__PURE__ */ _("p", {
427
+ className: "text-sm text-muted-foreground",
428
+ children: [(e.revenue / y.revenue.total * 100).toFixed(1), "%"]
429
+ })]
430
+ })]
431
+ }, e.city))
432
+ })] })]
433
+ }),
434
+ T === "users" && /* @__PURE__ */ _("div", {
435
+ className: "space-y-8",
436
+ children: [/* @__PURE__ */ g("div", {
437
+ className: "grid grid-cols-1 md:grid-cols-4 gap-4",
438
+ children: [
439
+ {
440
+ label: "Customers",
441
+ value: y.users.customers,
442
+ color: "blue"
443
+ },
444
+ {
445
+ label: "Cart Owners",
446
+ value: y.users.cartOwners,
447
+ color: "green"
448
+ },
449
+ {
450
+ label: "Workers",
451
+ value: y.users.workers,
452
+ color: "yellow"
453
+ },
454
+ {
455
+ label: "Investors",
456
+ value: y.users.investors,
457
+ color: "purple"
458
+ }
459
+ ].map((e) => /* @__PURE__ */ _("div", {
460
+ className: t("rounded-lg border p-4", `border-${e.color}-500/30 bg-${e.color}-500/10`),
461
+ children: [
462
+ /* @__PURE__ */ g("h4", {
463
+ className: t("text-sm font-medium", `text-${e.color}-600 dark:text-${e.color}-400`),
464
+ children: e.label
465
+ }),
466
+ /* @__PURE__ */ g("p", {
467
+ className: t("text-2xl font-bold", `text-${e.color}-700 dark:text-${e.color}-300`),
468
+ children: e.value.toLocaleString("en-IN")
469
+ }),
470
+ /* @__PURE__ */ _("p", {
471
+ className: t("text-sm", `text-${e.color}-600/80 dark:text-${e.color}-400/80`),
472
+ children: [(e.value / y.users.total * 100).toFixed(1), "%"]
473
+ })
474
+ ]
475
+ }, e.label))
476
+ }), /* @__PURE__ */ _("div", {
477
+ className: "rounded-lg border border-border bg-muted/20 p-6",
478
+ children: [/* @__PURE__ */ g("h3", {
479
+ className: "text-lg font-semibold text-foreground mb-4",
480
+ children: "User Growth Insights"
481
+ }), /* @__PURE__ */ _("div", {
482
+ className: "grid grid-cols-1 md:grid-cols-2 gap-6",
483
+ children: [/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
484
+ className: "text-sm text-muted-foreground mb-2",
485
+ children: "New Users This Month"
486
+ }), /* @__PURE__ */ g("p", {
487
+ className: "text-3xl font-bold text-blue-600 dark:text-blue-400",
488
+ children: y.users.newThisMonth
489
+ })] }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
490
+ className: "text-sm text-muted-foreground mb-2",
491
+ children: "Active Users Rate"
492
+ }), /* @__PURE__ */ _("p", {
493
+ className: "text-3xl font-bold text-green-600 dark:text-green-400",
494
+ children: [(y.users.active / y.users.total * 100).toFixed(1), "%"]
495
+ })] })]
496
+ })]
497
+ })]
498
+ }),
499
+ T === "performance" && /* @__PURE__ */ _("div", {
500
+ className: "space-y-8",
501
+ children: [
502
+ /* @__PURE__ */ _("div", {
503
+ className: "grid grid-cols-1 md:grid-cols-3 gap-6",
504
+ children: [
505
+ /* @__PURE__ */ _("div", {
506
+ className: "rounded-lg border border-border bg-card p-6",
507
+ children: [
508
+ /* @__PURE__ */ _("div", {
509
+ className: "flex items-center gap-2 mb-2",
510
+ children: [/* @__PURE__ */ g(p, { className: "h-4 w-4 text-muted-foreground" }), /* @__PURE__ */ g("h4", {
511
+ className: "text-sm font-medium text-muted-foreground",
512
+ children: "Avg Delivery Time"
513
+ })]
514
+ }),
515
+ /* @__PURE__ */ _("p", {
516
+ className: "text-3xl font-bold text-foreground",
517
+ children: [y.performance.averageDeliveryTime, " min"]
518
+ }),
519
+ /* @__PURE__ */ g("p", {
520
+ className: "text-sm text-muted-foreground mt-1",
521
+ children: "Target: < 30 min"
522
+ })
523
+ ]
524
+ }),
525
+ /* @__PURE__ */ _("div", {
526
+ className: "rounded-lg border border-border bg-card p-6",
527
+ children: [
528
+ /* @__PURE__ */ _("div", {
529
+ className: "flex items-center gap-2 mb-2",
530
+ children: [/* @__PURE__ */ g(f, { className: "h-4 w-4 text-muted-foreground" }), /* @__PURE__ */ g("h4", {
531
+ className: "text-sm font-medium text-muted-foreground",
532
+ children: "Customer Satisfaction"
533
+ })]
534
+ }),
535
+ /* @__PURE__ */ _("p", {
536
+ className: "text-3xl font-bold text-foreground flex items-center gap-1",
537
+ children: [/* @__PURE__ */ g(f, { className: "h-6 w-6 fill-yellow-400 text-yellow-400" }), y.performance.customerSatisfaction]
538
+ }),
539
+ /* @__PURE__ */ g("p", {
540
+ className: "text-sm text-muted-foreground mt-1",
541
+ children: "Based on ratings"
542
+ })
543
+ ]
544
+ }),
545
+ /* @__PURE__ */ _("div", {
546
+ className: "rounded-lg border border-border bg-card p-6",
547
+ children: [
548
+ /* @__PURE__ */ _("div", {
549
+ className: "flex items-center gap-2 mb-2",
550
+ children: [/* @__PURE__ */ g(l, { className: "h-4 w-4 text-muted-foreground" }), /* @__PURE__ */ g("h4", {
551
+ className: "text-sm font-medium text-muted-foreground",
552
+ children: "Platform Fee"
553
+ })]
554
+ }),
555
+ /* @__PURE__ */ _("p", {
556
+ className: "text-3xl font-bold text-foreground",
557
+ children: [y.performance.platformFee, "%"]
558
+ }),
559
+ /* @__PURE__ */ g("p", {
560
+ className: "text-sm text-muted-foreground mt-1",
561
+ children: "Per transaction"
562
+ })
563
+ ]
564
+ })
565
+ ]
566
+ }),
567
+ /* @__PURE__ */ _("div", {
568
+ className: "rounded-lg border border-border bg-muted/20 p-6",
569
+ children: [
570
+ /* @__PURE__ */ g("h3", {
571
+ className: "text-lg font-semibold text-foreground mb-4",
572
+ children: "Financial Performance"
573
+ }),
574
+ /* @__PURE__ */ _("div", {
575
+ className: "grid grid-cols-1 md:grid-cols-3 gap-6",
576
+ children: [
577
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
578
+ className: "text-sm text-muted-foreground mb-2",
579
+ children: "Operating Costs"
580
+ }), /* @__PURE__ */ g("p", {
581
+ className: "text-2xl font-bold text-red-600 dark:text-red-400",
582
+ children: D(y.performance.operatingCosts)
583
+ })] }),
584
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
585
+ className: "text-sm text-muted-foreground mb-2",
586
+ children: "Total Revenue"
587
+ }), /* @__PURE__ */ g("p", {
588
+ className: "text-2xl font-bold text-blue-600 dark:text-blue-400",
589
+ children: D(y.revenue.total)
590
+ })] }),
591
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
592
+ className: "text-sm text-muted-foreground mb-2",
593
+ children: "Net Profit"
594
+ }), /* @__PURE__ */ g("p", {
595
+ className: "text-2xl font-bold text-green-600 dark:text-green-400",
596
+ children: D(y.performance.netProfit)
597
+ })] })
598
+ ]
599
+ }),
600
+ /* @__PURE__ */ _("div", {
601
+ className: "mt-4 rounded-lg border border-border bg-card p-4",
602
+ children: [/* @__PURE__ */ g("p", {
603
+ className: "text-sm text-muted-foreground",
604
+ children: "Profit Margin"
605
+ }), /* @__PURE__ */ _("p", {
606
+ className: "text-xl font-bold text-foreground",
607
+ children: [(y.performance.netProfit / y.revenue.total * 100).toFixed(1), "%"]
608
+ })]
609
+ })
610
+ ]
611
+ }),
612
+ /* @__PURE__ */ _("div", {
613
+ className: "rounded-lg border border-border bg-card p-6",
614
+ children: [/* @__PURE__ */ g("h3", {
615
+ className: "text-lg font-semibold text-foreground mb-4",
616
+ children: "Today's Performance"
617
+ }), /* @__PURE__ */ _("div", {
618
+ className: "grid grid-cols-1 md:grid-cols-2 gap-6",
619
+ children: [/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
620
+ className: "text-sm text-muted-foreground mb-2",
621
+ children: "Orders Today"
622
+ }), /* @__PURE__ */ g("p", {
623
+ className: "text-3xl font-bold text-blue-600 dark:text-blue-400",
624
+ children: y.orders.ordersToday
625
+ })] }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
626
+ className: "text-sm text-muted-foreground mb-2",
627
+ children: "Estimated Revenue"
628
+ }), /* @__PURE__ */ g("p", {
629
+ className: "text-3xl font-bold text-green-600 dark:text-green-400",
630
+ children: D(y.orders.ordersToday * y.orders.averageOrderValue)
631
+ })] })]
632
+ })]
633
+ })
634
+ ]
635
+ })
636
+ ]
637
+ })]
638
+ })
639
+ ]
640
+ });
641
+ }
642
+ //#endregion
643
+ export { v as AdminAnalyticsPage };
644
+
645
+ //# sourceMappingURL=AdminAnalyticsPage.js.map