@burdenoff/microfe-subscriberbot 2026.626.2 → 2026.629.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 (141) hide show
  1. package/dist/index.js +4 -4
  2. package/dist/subscriberbot/SubscriberBotRoot.js +61 -133
  3. package/dist/subscriberbot/SubscriberBotRoot.js.map +1 -1
  4. package/dist/subscriberbot/SubscriberBotRoutes.js +56 -187
  5. package/dist/subscriberbot/SubscriberBotRoutes.js.map +1 -1
  6. package/dist/subscriberbot/components/StateViews.js +49 -0
  7. package/dist/subscriberbot/components/StateViews.js.map +1 -0
  8. package/dist/subscriberbot/components/StatusBadge.js +45 -47
  9. package/dist/subscriberbot/components/StatusBadge.js.map +1 -1
  10. package/dist/subscriberbot/context/SubscriberBotContext.js +22 -30
  11. package/dist/subscriberbot/context/SubscriberBotContext.js.map +1 -1
  12. package/dist/subscriberbot/hooks/useSubscriberBotApi.js +342 -195
  13. package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
  14. package/dist/subscriberbot/index.js +1 -1
  15. package/dist/subscriberbot/pages/DashboardPage.js +269 -0
  16. package/dist/subscriberbot/pages/DashboardPage.js.map +1 -0
  17. package/dist/subscriberbot/pages/InboxPage.js +186 -0
  18. package/dist/subscriberbot/pages/InboxPage.js.map +1 -0
  19. package/dist/subscriberbot/pages/InvoicesPage.js +211 -0
  20. package/dist/subscriberbot/pages/InvoicesPage.js.map +1 -0
  21. package/dist/subscriberbot/pages/WorkflowsPage.js +236 -0
  22. package/dist/subscriberbot/pages/WorkflowsPage.js.map +1 -0
  23. package/dist/subscriberbot/pages/agents/AgentDetailPage.js +160 -0
  24. package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -0
  25. package/dist/subscriberbot/pages/agents/AgentNewPage.js +140 -0
  26. package/dist/subscriberbot/pages/agents/AgentNewPage.js.map +1 -0
  27. package/dist/subscriberbot/pages/agents/AgentsListPage.js +178 -0
  28. package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -0
  29. package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +179 -0
  30. package/dist/subscriberbot/pages/providers/ProviderDetailPage.js.map +1 -0
  31. package/dist/subscriberbot/pages/providers/ProviderNewPage.js +185 -0
  32. package/dist/subscriberbot/pages/providers/ProviderNewPage.js.map +1 -0
  33. package/dist/subscriberbot/pages/providers/ProvidersListPage.js +254 -0
  34. package/dist/subscriberbot/pages/providers/ProvidersListPage.js.map +1 -0
  35. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +306 -0
  36. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -0
  37. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js +253 -0
  38. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js.map +1 -0
  39. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +248 -0
  40. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -0
  41. package/dist/subscriberbot/utils/formatters.js +50 -32
  42. package/dist/subscriberbot/utils/formatters.js.map +1 -1
  43. package/package.json +1 -1
  44. package/dist/subscriberbot/components/InvestmentCard.js +0 -97
  45. package/dist/subscriberbot/components/InvestmentCard.js.map +0 -1
  46. package/dist/subscriberbot/components/RatingDisplay.js +0 -35
  47. package/dist/subscriberbot/components/RatingDisplay.js.map +0 -1
  48. package/dist/subscriberbot/mocks/data.js +0 -1517
  49. package/dist/subscriberbot/mocks/data.js.map +0 -1
  50. package/dist/subscriberbot/mocks/users.js +0 -34
  51. package/dist/subscriberbot/mocks/users.js.map +0 -1
  52. package/dist/subscriberbot/pages/HomePage.js +0 -930
  53. package/dist/subscriberbot/pages/HomePage.js.map +0 -1
  54. package/dist/subscriberbot/pages/admin/AdminAnalyticsPage.js +0 -651
  55. package/dist/subscriberbot/pages/admin/AdminAnalyticsPage.js.map +0 -1
  56. package/dist/subscriberbot/pages/admin/AdminDashboard.js +0 -679
  57. package/dist/subscriberbot/pages/admin/AdminDashboard.js.map +0 -1
  58. package/dist/subscriberbot/pages/admin/AdminFinancialPage.js +0 -427
  59. package/dist/subscriberbot/pages/admin/AdminFinancialPage.js.map +0 -1
  60. package/dist/subscriberbot/pages/admin/AdminOrdersPage.js +0 -665
  61. package/dist/subscriberbot/pages/admin/AdminOrdersPage.js.map +0 -1
  62. package/dist/subscriberbot/pages/admin/AdminProfilePage.js +0 -261
  63. package/dist/subscriberbot/pages/admin/AdminProfilePage.js.map +0 -1
  64. package/dist/subscriberbot/pages/admin/AdminSettingsPage.js +0 -654
  65. package/dist/subscriberbot/pages/admin/AdminSettingsPage.js.map +0 -1
  66. package/dist/subscriberbot/pages/admin/CartManagementPage.js +0 -874
  67. package/dist/subscriberbot/pages/admin/CartManagementPage.js.map +0 -1
  68. package/dist/subscriberbot/pages/admin/UserManagementPage.js +0 -898
  69. package/dist/subscriberbot/pages/admin/UserManagementPage.js.map +0 -1
  70. package/dist/subscriberbot/pages/cart-owner/AnalyticsDashboard.js +0 -839
  71. package/dist/subscriberbot/pages/cart-owner/AnalyticsDashboard.js.map +0 -1
  72. package/dist/subscriberbot/pages/cart-owner/BusinessSettingsPage.js +0 -705
  73. package/dist/subscriberbot/pages/cart-owner/BusinessSettingsPage.js.map +0 -1
  74. package/dist/subscriberbot/pages/cart-owner/CartOwnerDashboard.js +0 -802
  75. package/dist/subscriberbot/pages/cart-owner/CartOwnerDashboard.js.map +0 -1
  76. package/dist/subscriberbot/pages/cart-owner/CartOwnerProfilePage.js +0 -891
  77. package/dist/subscriberbot/pages/cart-owner/CartOwnerProfilePage.js.map +0 -1
  78. package/dist/subscriberbot/pages/cart-owner/CartServiceConfigPage.js +0 -633
  79. package/dist/subscriberbot/pages/cart-owner/CartServiceConfigPage.js.map +0 -1
  80. package/dist/subscriberbot/pages/cart-owner/InventoryManagementPage.js +0 -910
  81. package/dist/subscriberbot/pages/cart-owner/InventoryManagementPage.js.map +0 -1
  82. package/dist/subscriberbot/pages/cart-owner/OrderManagementPage.js +0 -879
  83. package/dist/subscriberbot/pages/cart-owner/OrderManagementPage.js.map +0 -1
  84. package/dist/subscriberbot/pages/cart-owner/StaffManagementPage.js +0 -838
  85. package/dist/subscriberbot/pages/cart-owner/StaffManagementPage.js.map +0 -1
  86. package/dist/subscriberbot/pages/common/HelpSupportPage.js +0 -1323
  87. package/dist/subscriberbot/pages/common/HelpSupportPage.js.map +0 -1
  88. package/dist/subscriberbot/pages/common/NotificationCenterPage.js +0 -672
  89. package/dist/subscriberbot/pages/common/NotificationCenterPage.js.map +0 -1
  90. package/dist/subscriberbot/pages/common/SettingsPage.js +0 -973
  91. package/dist/subscriberbot/pages/common/SettingsPage.js.map +0 -1
  92. package/dist/subscriberbot/pages/customer/BookingDetailsPage.js +0 -626
  93. package/dist/subscriberbot/pages/customer/BookingDetailsPage.js.map +0 -1
  94. package/dist/subscriberbot/pages/customer/CartDetailPage.js +0 -654
  95. package/dist/subscriberbot/pages/customer/CartDetailPage.js.map +0 -1
  96. package/dist/subscriberbot/pages/customer/CartDiscoveryPage.js +0 -555
  97. package/dist/subscriberbot/pages/customer/CartDiscoveryPage.js.map +0 -1
  98. package/dist/subscriberbot/pages/customer/CheckoutPage.js +0 -529
  99. package/dist/subscriberbot/pages/customer/CheckoutPage.js.map +0 -1
  100. package/dist/subscriberbot/pages/customer/CustomerDashboard.js +0 -532
  101. package/dist/subscriberbot/pages/customer/CustomerDashboard.js.map +0 -1
  102. package/dist/subscriberbot/pages/customer/CustomerProfilePage.js +0 -630
  103. package/dist/subscriberbot/pages/customer/CustomerProfilePage.js.map +0 -1
  104. package/dist/subscriberbot/pages/customer/DirectServiceBookingPage.js +0 -633
  105. package/dist/subscriberbot/pages/customer/DirectServiceBookingPage.js.map +0 -1
  106. package/dist/subscriberbot/pages/customer/FavoritesPage.js +0 -484
  107. package/dist/subscriberbot/pages/customer/FavoritesPage.js.map +0 -1
  108. package/dist/subscriberbot/pages/customer/OrderHistoryPage.js +0 -446
  109. package/dist/subscriberbot/pages/customer/OrderHistoryPage.js.map +0 -1
  110. package/dist/subscriberbot/pages/customer/OrderTrackingPage.js +0 -394
  111. package/dist/subscriberbot/pages/customer/OrderTrackingPage.js.map +0 -1
  112. package/dist/subscriberbot/pages/customer/PaymentMethodsPage.js +0 -495
  113. package/dist/subscriberbot/pages/customer/PaymentMethodsPage.js.map +0 -1
  114. package/dist/subscriberbot/pages/customer/ReviewsPage.js +0 -613
  115. package/dist/subscriberbot/pages/customer/ReviewsPage.js.map +0 -1
  116. package/dist/subscriberbot/pages/customer/SavedAddressesPage.js +0 -450
  117. package/dist/subscriberbot/pages/customer/SavedAddressesPage.js.map +0 -1
  118. package/dist/subscriberbot/pages/investor/InvestmentDetailsPage.js +0 -886
  119. package/dist/subscriberbot/pages/investor/InvestmentDetailsPage.js.map +0 -1
  120. package/dist/subscriberbot/pages/investor/InvestmentOpportunitiesPage.js +0 -947
  121. package/dist/subscriberbot/pages/investor/InvestmentOpportunitiesPage.js.map +0 -1
  122. package/dist/subscriberbot/pages/investor/InvestorAnalyticsPage.js +0 -687
  123. package/dist/subscriberbot/pages/investor/InvestorAnalyticsPage.js.map +0 -1
  124. package/dist/subscriberbot/pages/investor/InvestorDashboard.js +0 -451
  125. package/dist/subscriberbot/pages/investor/InvestorDashboard.js.map +0 -1
  126. package/dist/subscriberbot/pages/investor/InvestorInvestmentsPage.js +0 -406
  127. package/dist/subscriberbot/pages/investor/InvestorInvestmentsPage.js.map +0 -1
  128. package/dist/subscriberbot/pages/investor/InvestorPortfolioPage.js +0 -575
  129. package/dist/subscriberbot/pages/investor/InvestorPortfolioPage.js.map +0 -1
  130. package/dist/subscriberbot/pages/investor/InvestorProfilePage.js +0 -1070
  131. package/dist/subscriberbot/pages/investor/InvestorProfilePage.js.map +0 -1
  132. package/dist/subscriberbot/pages/worker/TaskDetailsPage.js +0 -535
  133. package/dist/subscriberbot/pages/worker/TaskDetailsPage.js.map +0 -1
  134. package/dist/subscriberbot/pages/worker/WorkerDashboard.js +0 -666
  135. package/dist/subscriberbot/pages/worker/WorkerDashboard.js.map +0 -1
  136. package/dist/subscriberbot/pages/worker/WorkerOrdersPage.js +0 -681
  137. package/dist/subscriberbot/pages/worker/WorkerOrdersPage.js.map +0 -1
  138. package/dist/subscriberbot/pages/worker/WorkerProfilePage.js +0 -692
  139. package/dist/subscriberbot/pages/worker/WorkerProfilePage.js.map +0 -1
  140. package/dist/subscriberbot/pages/worker/WorkerSchedulePage.js +0 -588
  141. package/dist/subscriberbot/pages/worker/WorkerSchedulePage.js.map +0 -1
@@ -1,666 +0,0 @@
1
- import { useSubscriberBot as e } from "../../context/SubscriberBotContext.js";
2
- import { cn as t } from "../../utils/cn.js";
3
- import { PageLayout as n } from "../../components/PageLayout.js";
4
- import { useUpdateWorkerTaskStatus as r, useWorkerClockInOut as i, useWorkerStats as a, useWorkerTasks as o } from "../../hooks/useSubscriberBotApi.js";
5
- import { formatCurrency as s } from "../../utils/formatters.js";
6
- import { useState as c } from "react";
7
- import { Boxes as l, CalendarDays as u, CheckCircle2 as d, ChefHat as f, ChevronRight as p, ClipboardList as m, Clock as h, Loader2 as g, MapPin as _, Package as v, Pause as y, Play as b, Sparkles as x, Star as S, Timer as C, TrendingUp as w, Truck as T, User as E, Zap as D } from "lucide-react";
8
- import { jsx as O, jsxs as k } from "react/jsx-runtime";
9
- import { EmphasisPanel as A, NextSteps as j, PagePurpose as M } from "@burdenoff/fe-libs/ui";
10
- //#region src/subscriberbot/pages/worker/WorkerDashboard.tsx
11
- var N = {
12
- high: "bg-status-error-bg/20 text-status-error-text",
13
- medium: "bg-status-warning-bg/20 text-status-warning-text",
14
- low: "bg-status-success-bg/20 text-status-success-text"
15
- }, P = {
16
- pending: "bg-secondary text-secondary-foreground",
17
- in_progress: "bg-status-info-bg/20 text-status-info-text",
18
- completed: "bg-status-success-bg/20 text-status-success-text"
19
- };
20
- function F(e) {
21
- switch (e) {
22
- case "delivery": return T;
23
- case "preparation": return f;
24
- case "inventory": return l;
25
- case "cleanup": return x;
26
- default: return m;
27
- }
28
- }
29
- var I = {
30
- high: 3,
31
- medium: 2,
32
- low: 1
33
- }, L = () => {
34
- let { navigateTo: l, currentUser: f } = e(), x = f?.id || "", { data: T = [], isLoading: L } = o(x), { data: R, isLoading: z } = a(x), B = r(), V = i(), [H, U] = c(null), [W, G] = c(!1), [K, q] = c(null), J = async (e, t) => {
35
- let n = "";
36
- switch (t) {
37
- case "start":
38
- n = "IN_PROGRESS", U(e);
39
- break;
40
- case "complete":
41
- n = "COMPLETED", H === e && U(null);
42
- break;
43
- case "pause":
44
- n = "PENDING", H === e && U(null);
45
- break;
46
- }
47
- try {
48
- await B.mutateAsync({
49
- taskId: e,
50
- status: n
51
- });
52
- } catch (e) {
53
- console.error("Failed to update task status:", e), alert("Failed to update task status. Please try again.");
54
- }
55
- }, Y = async () => {
56
- let e = W ? "CLOCK_OUT" : "CLOCK_IN";
57
- try {
58
- let t = await V.mutateAsync({
59
- workerId: x,
60
- action: e
61
- });
62
- if (t.success) {
63
- if (W) G(!1), q(null);
64
- else {
65
- let e = (/* @__PURE__ */ new Date()).toLocaleTimeString("en-IN", {
66
- hour: "2-digit",
67
- minute: "2-digit",
68
- hour12: !0
69
- });
70
- G(!0), q(e);
71
- }
72
- alert(t.message || `${W ? "Clocked out" : "Clocked in"} successfully`);
73
- }
74
- } catch (e) {
75
- console.error("Failed to clock in/out:", e), alert("Action failed. Please try again.");
76
- }
77
- };
78
- if (L || z) return /* @__PURE__ */ O(n, {
79
- title: "Dashboard",
80
- description: "Your work overview for today",
81
- children: /* @__PURE__ */ O("div", {
82
- className: "flex items-center justify-center py-24",
83
- children: /* @__PURE__ */ k("div", {
84
- className: "text-center",
85
- children: [/* @__PURE__ */ O(g, { className: "h-10 w-10 animate-spin text-text-secondary mx-auto mb-4" }), /* @__PURE__ */ O("p", {
86
- className: "text-sm text-text-secondary",
87
- children: "Loading your dashboard..."
88
- })]
89
- })
90
- })
91
- });
92
- let X = H ? T.find((e) => e.id === H) : null, Z = T.filter((e) => e.status !== "completed").sort((e, t) => (I[t.priority] ?? 0) - (I[e.priority] ?? 0)), Q = T.filter((e) => e.status === "completed");
93
- return /* @__PURE__ */ O(n, {
94
- title: "Dashboard",
95
- description: "Manage your tasks and assignments",
96
- titleGradient: !0,
97
- actions: /* @__PURE__ */ k("button", {
98
- type: "button",
99
- onClick: () => l("/worker/orders"),
100
- className: "inline-flex items-center gap-2 rounded-md bg-accent px-4 py-2 text-sm font-medium text-text-primary hover:bg-accent/80 transition-colors",
101
- children: ["View All Orders", /* @__PURE__ */ O(p, { className: "h-4 w-4" })]
102
- }),
103
- children: /* @__PURE__ */ k("div", {
104
- className: "space-y-6",
105
- children: [
106
- /* @__PURE__ */ O(M, {
107
- icon: /* @__PURE__ */ O(m, { className: "h-4 w-4" }),
108
- children: "Your shift at a glance. Clock in to start earning, see the tasks and orders assigned to you today, and track how many you've completed along with your earnings and rating. Jump to your current task to keep things moving, and check your schedule so you never miss a shift."
109
- }),
110
- /* @__PURE__ */ O(j, {
111
- storageKey: "subscriberbot-worker-dashboard",
112
- steps: [
113
- {
114
- id: "view-orders",
115
- label: "See your assigned orders",
116
- description: "Pick up and work through the orders waiting on you.",
117
- icon: /* @__PURE__ */ O(v, { className: "h-4 w-4" }),
118
- onClick: () => l("/worker/orders")
119
- },
120
- {
121
- id: "check-schedule",
122
- label: "Check your schedule",
123
- description: "Know your upcoming shifts and request changes if needed.",
124
- icon: /* @__PURE__ */ O(u, { className: "h-4 w-4" }),
125
- onClick: () => l("/worker/schedule")
126
- },
127
- {
128
- id: "update-profile",
129
- label: "Keep your profile current",
130
- description: "Update your availability and contact details.",
131
- icon: /* @__PURE__ */ O(E, { className: "h-4 w-4" }),
132
- onClick: () => l("/worker/profile")
133
- }
134
- ]
135
- }),
136
- /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("h2", {
137
- className: "text-base font-semibold text-text-primary mb-3",
138
- children: "Quick Actions"
139
- }), /* @__PURE__ */ k("div", {
140
- className: "grid grid-cols-2 lg:grid-cols-4 gap-3",
141
- children: [
142
- /* @__PURE__ */ k("button", {
143
- type: "button",
144
- onClick: () => l("/worker/orders"),
145
- className: "flex items-center justify-center gap-2 rounded-lg border border-border-seam bg-bg-surface px-4 py-3 text-sm font-medium text-text-primary hover:bg-bg-sunken transition-colors",
146
- children: [/* @__PURE__ */ O(v, { className: "h-4 w-4" }), "My Orders"]
147
- }),
148
- /* @__PURE__ */ k("button", {
149
- type: "button",
150
- onClick: () => l("/worker/schedule"),
151
- className: "flex items-center justify-center gap-2 rounded-lg border border-border-seam bg-bg-surface px-4 py-3 text-sm font-medium text-text-primary hover:bg-bg-sunken transition-colors",
152
- children: [/* @__PURE__ */ O(u, { className: "h-4 w-4" }), "Schedule"]
153
- }),
154
- /* @__PURE__ */ k("button", {
155
- type: "button",
156
- onClick: () => l("/worker/profile"),
157
- className: "flex items-center justify-center gap-2 rounded-lg border border-border-seam bg-bg-surface px-4 py-3 text-sm font-medium text-text-primary hover:bg-bg-sunken transition-colors",
158
- children: [/* @__PURE__ */ O(E, { className: "h-4 w-4" }), "Profile"]
159
- }),
160
- /* @__PURE__ */ k("button", {
161
- type: "button",
162
- onClick: Y,
163
- className: t("flex items-center justify-center gap-2 rounded-lg px-4 py-3 text-sm font-medium transition-colors", W ? "bg-status-error-bg/10 text-status-error-text border border-status-error-border/30 hover:bg-status-error-bg/20" : "bg-status-success-bg/10 text-status-success-text border border-status-success-border/30 hover:bg-status-success-bg/20"),
164
- children: [/* @__PURE__ */ O(C, { className: "h-4 w-4" }), W ? "Clock Out" : "Clock In"]
165
- })
166
- ]
167
- })] }),
168
- R && /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ k("div", {
169
- className: "flex items-center justify-between mb-3",
170
- children: [/* @__PURE__ */ O("h2", {
171
- className: "text-base font-semibold text-text-primary",
172
- children: "Today's Overview"
173
- }), W && K && /* @__PURE__ */ k("div", {
174
- className: "flex items-center gap-2 rounded-lg bg-status-success-bg/10 border border-status-success-border/20 px-3 py-1.5",
175
- children: [/* @__PURE__ */ k("span", {
176
- className: "relative flex h-2 w-2",
177
- children: [/* @__PURE__ */ O("span", { className: "animate-ping absolute inline-flex h-full w-full rounded-full bg-status-success-bg opacity-75" }), /* @__PURE__ */ O("span", { className: "relative inline-flex rounded-full h-2 w-2 bg-status-success-text" })]
178
- }), /* @__PURE__ */ k("span", {
179
- className: "text-xs font-medium text-status-success-text",
180
- children: ["Working since ", K]
181
- })]
182
- })]
183
- }), /* @__PURE__ */ k(A, {
184
- className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3",
185
- children: [
186
- /* @__PURE__ */ k("div", {
187
- className: "rounded-lg border border-border-seam bg-bg-surface p-4 shadow-sm",
188
- children: [
189
- /* @__PURE__ */ O("div", {
190
- className: "flex items-center gap-2 mb-2",
191
- children: /* @__PURE__ */ O("div", {
192
- className: "inline-flex rounded-md p-1.5 bg-status-success-bg/10 text-status-success-text",
193
- children: /* @__PURE__ */ O(d, { className: "h-4 w-4" })
194
- })
195
- }),
196
- /* @__PURE__ */ O("p", {
197
- className: "text-2xl font-bold text-status-success-text",
198
- children: R.tasksCompleted
199
- }),
200
- /* @__PURE__ */ O("p", {
201
- className: "text-xs text-text-secondary",
202
- children: "Completed"
203
- })
204
- ]
205
- }),
206
- /* @__PURE__ */ k("div", {
207
- className: "rounded-lg border border-border-seam bg-bg-surface p-4 shadow-sm",
208
- children: [
209
- /* @__PURE__ */ O("div", {
210
- className: "flex items-center gap-2 mb-2",
211
- children: /* @__PURE__ */ O("div", {
212
- className: "inline-flex rounded-md p-1.5 bg-status-info-bg/10 text-status-info-text",
213
- children: /* @__PURE__ */ O(b, { className: "h-4 w-4" })
214
- })
215
- }),
216
- /* @__PURE__ */ O("p", {
217
- className: "text-2xl font-bold text-status-info-text",
218
- children: R.tasksInProgress
219
- }),
220
- /* @__PURE__ */ O("p", {
221
- className: "text-xs text-text-secondary",
222
- children: "In Progress"
223
- })
224
- ]
225
- }),
226
- /* @__PURE__ */ k("div", {
227
- className: "rounded-lg border border-border-seam bg-bg-surface p-4 shadow-sm",
228
- children: [
229
- /* @__PURE__ */ O("div", {
230
- className: "flex items-center gap-2 mb-2",
231
- children: /* @__PURE__ */ O("div", {
232
- className: "inline-flex rounded-md p-1.5 bg-status-warning-bg/10 text-status-warning-text",
233
- children: /* @__PURE__ */ O(h, { className: "h-4 w-4" })
234
- })
235
- }),
236
- /* @__PURE__ */ O("p", {
237
- className: "text-2xl font-bold text-status-warning-text",
238
- children: R.tasksPending
239
- }),
240
- /* @__PURE__ */ O("p", {
241
- className: "text-xs text-text-secondary",
242
- children: "Pending"
243
- })
244
- ]
245
- }),
246
- /* @__PURE__ */ k("div", {
247
- className: "rounded-lg border border-border-seam bg-bg-surface p-4 shadow-sm",
248
- children: [
249
- /* @__PURE__ */ O("div", {
250
- className: "flex items-center gap-2 mb-2",
251
- children: /* @__PURE__ */ O("div", {
252
- className: "inline-flex rounded-md p-1.5 bg-accent-purple-subtle text-accent-purple",
253
- children: /* @__PURE__ */ O(C, { className: "h-4 w-4" })
254
- })
255
- }),
256
- /* @__PURE__ */ k("p", {
257
- className: "text-2xl font-bold text-accent-purple",
258
- children: [R.hoursWorked, "h"]
259
- }),
260
- /* @__PURE__ */ O("p", {
261
- className: "text-xs text-text-secondary",
262
- children: "Hours Worked"
263
- })
264
- ]
265
- }),
266
- /* @__PURE__ */ k("div", {
267
- className: "rounded-lg border border-border-seam bg-bg-surface p-4 shadow-sm",
268
- children: [
269
- /* @__PURE__ */ O("div", {
270
- className: "flex items-center gap-2 mb-2",
271
- children: /* @__PURE__ */ O("div", {
272
- className: "inline-flex rounded-md p-1.5 bg-accent-indigo-subtle text-accent-indigo",
273
- children: /* @__PURE__ */ O(D, { className: "h-4 w-4" })
274
- })
275
- }),
276
- /* @__PURE__ */ k("p", {
277
- className: "text-2xl font-bold text-accent-indigo",
278
- children: [R.efficiency, "%"]
279
- }),
280
- /* @__PURE__ */ O("p", {
281
- className: "text-xs text-text-secondary",
282
- children: "Efficiency"
283
- })
284
- ]
285
- }),
286
- /* @__PURE__ */ k("div", {
287
- className: "rounded-lg border border-border-seam bg-bg-surface p-4 shadow-sm",
288
- children: [
289
- /* @__PURE__ */ O("div", {
290
- className: "flex items-center gap-2 mb-2",
291
- children: /* @__PURE__ */ O("div", {
292
- className: "inline-flex rounded-md p-1.5 bg-status-warning-bg/10 text-status-warning-text",
293
- children: /* @__PURE__ */ O(S, { className: "h-4 w-4" })
294
- })
295
- }),
296
- /* @__PURE__ */ k("p", {
297
- className: "text-2xl font-bold text-status-warning-text",
298
- children: [R.rating, "/5"]
299
- }),
300
- /* @__PURE__ */ O("p", {
301
- className: "text-xs text-text-secondary",
302
- children: "Rating"
303
- })
304
- ]
305
- })
306
- ]
307
- })] }),
308
- X && /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("h2", {
309
- className: "text-base font-semibold text-text-primary mb-3",
310
- children: "Current Task"
311
- }), /* @__PURE__ */ O("div", {
312
- className: "rounded-lg border-2 border-status-info-border/40 bg-status-info-bg/5 p-6",
313
- children: /* @__PURE__ */ k("div", {
314
- className: "flex items-start justify-between mb-4",
315
- children: [/* @__PURE__ */ k("div", {
316
- className: "flex items-start gap-3",
317
- children: [/* @__PURE__ */ O("div", {
318
- className: "flex h-10 w-10 items-center justify-center rounded-lg bg-status-info-bg/10",
319
- children: /* @__PURE__ */ O(F(X.type), { className: "h-5 w-5 text-status-info-text" })
320
- }), /* @__PURE__ */ k("div", { children: [
321
- /* @__PURE__ */ O("h3", {
322
- className: "text-lg font-semibold text-text-primary",
323
- children: X.title
324
- }),
325
- /* @__PURE__ */ O("p", {
326
- className: "text-sm text-text-secondary mt-1",
327
- children: X.description
328
- }),
329
- /* @__PURE__ */ k("div", {
330
- className: "flex flex-wrap items-center gap-3 mt-2 text-sm text-text-secondary",
331
- children: [
332
- /* @__PURE__ */ k("span", {
333
- className: "flex items-center gap-1",
334
- children: [
335
- /* @__PURE__ */ O(h, { className: "h-3.5 w-3.5" }),
336
- X.estimatedTime,
337
- " min"
338
- ]
339
- }),
340
- X.dueTime && /* @__PURE__ */ k("span", {
341
- className: "flex items-center gap-1",
342
- children: [
343
- /* @__PURE__ */ O(C, { className: "h-3.5 w-3.5" }),
344
- "Due: ",
345
- X.dueTime
346
- ]
347
- }),
348
- X.location && /* @__PURE__ */ k("span", {
349
- className: "flex items-center gap-1",
350
- children: [/* @__PURE__ */ O(_, { className: "h-3.5 w-3.5" }), X.location]
351
- })
352
- ]
353
- })
354
- ] })]
355
- }), /* @__PURE__ */ k("div", {
356
- className: "flex gap-2 shrink-0",
357
- children: [/* @__PURE__ */ k("button", {
358
- type: "button",
359
- onClick: () => J(X.id, "complete"),
360
- className: "inline-flex items-center gap-1.5 rounded-md bg-status-success-bg/10 px-3 py-2 text-sm font-medium text-status-success-text hover:bg-status-success-bg/20 transition-colors",
361
- children: [/* @__PURE__ */ O(d, { className: "h-4 w-4" }), "Complete"]
362
- }), /* @__PURE__ */ k("button", {
363
- type: "button",
364
- onClick: () => J(X.id, "pause"),
365
- className: "inline-flex items-center gap-1.5 rounded-md bg-accent px-3 py-2 text-sm font-medium text-text-primary hover:bg-accent/80 transition-colors",
366
- children: [/* @__PURE__ */ O(y, { className: "h-4 w-4" }), "Pause"]
367
- })]
368
- })]
369
- })
370
- })] }),
371
- /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("h2", {
372
- className: "text-base font-semibold text-text-primary mb-3",
373
- children: "Assigned Tasks"
374
- }), /* @__PURE__ */ O("div", {
375
- className: "rounded-lg border border-border-seam bg-bg-surface shadow-sm overflow-hidden",
376
- children: Z.length > 0 ? /* @__PURE__ */ O("div", {
377
- className: "divide-y divide-border",
378
- children: Z.map((e) => /* @__PURE__ */ O("div", {
379
- className: "p-4 hover:bg-bg-sunken/30 transition-colors",
380
- children: /* @__PURE__ */ k("div", {
381
- className: "flex flex-col sm:flex-row sm:items-start sm:justify-between gap-3",
382
- children: [/* @__PURE__ */ k("div", {
383
- className: "flex items-start gap-3 flex-1 min-w-0",
384
- children: [/* @__PURE__ */ O("div", {
385
- className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-bg-sunken",
386
- children: /* @__PURE__ */ O(F(e.type), { className: "h-4.5 w-4.5 text-text-secondary" })
387
- }), /* @__PURE__ */ k("div", {
388
- className: "flex-1 min-w-0",
389
- children: [
390
- /* @__PURE__ */ k("div", {
391
- className: "flex flex-wrap items-center gap-2 mb-1",
392
- children: [
393
- /* @__PURE__ */ O("h3", {
394
- className: "text-sm font-medium text-text-primary",
395
- children: e.title
396
- }),
397
- /* @__PURE__ */ O("span", {
398
- className: t("inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium capitalize", N[e.priority]),
399
- children: e.priority
400
- }),
401
- /* @__PURE__ */ O("span", {
402
- className: t("inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium", P[e.status]),
403
- children: e.status.replace("_", " ")
404
- })
405
- ]
406
- }),
407
- /* @__PURE__ */ O("p", {
408
- className: "text-xs text-text-secondary line-clamp-1",
409
- children: e.description
410
- }),
411
- /* @__PURE__ */ k("div", {
412
- className: "flex flex-wrap items-center gap-3 mt-1.5 text-xs text-text-secondary",
413
- children: [
414
- /* @__PURE__ */ k("span", {
415
- className: "flex items-center gap-1",
416
- children: [/* @__PURE__ */ O(E, { className: "h-3 w-3" }), e.assignedBy]
417
- }),
418
- /* @__PURE__ */ k("span", {
419
- className: "flex items-center gap-1",
420
- children: [
421
- /* @__PURE__ */ O(h, { className: "h-3 w-3" }),
422
- e.estimatedTime,
423
- " min"
424
- ]
425
- }),
426
- e.dueTime && /* @__PURE__ */ k("span", {
427
- className: "flex items-center gap-1",
428
- children: [
429
- /* @__PURE__ */ O(C, { className: "h-3 w-3" }),
430
- "Due: ",
431
- e.dueTime
432
- ]
433
- }),
434
- e.location && /* @__PURE__ */ k("span", {
435
- className: "flex items-center gap-1",
436
- children: [/* @__PURE__ */ O(_, { className: "h-3 w-3" }), e.location]
437
- })
438
- ]
439
- })
440
- ]
441
- })]
442
- }), /* @__PURE__ */ k("div", {
443
- className: "flex gap-2 shrink-0",
444
- children: [
445
- e.status === "pending" && /* @__PURE__ */ k("button", {
446
- type: "button",
447
- onClick: () => J(e.id, "start"),
448
- disabled: H !== null,
449
- className: t("inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors", H === null ? "bg-status-info-bg/10 text-status-info-text hover:bg-status-info-bg/20" : "bg-bg-sunken text-text-secondary cursor-not-allowed"),
450
- children: [/* @__PURE__ */ O(b, { className: "h-3.5 w-3.5" }), "Start"]
451
- }),
452
- e.status === "in_progress" && e.id !== H && /* @__PURE__ */ k("button", {
453
- type: "button",
454
- onClick: () => U(e.id),
455
- className: "inline-flex items-center gap-1.5 rounded-md bg-accent px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-accent/80 transition-colors",
456
- children: [/* @__PURE__ */ O(b, { className: "h-3.5 w-3.5" }), "Resume"]
457
- }),
458
- /* @__PURE__ */ k("button", {
459
- type: "button",
460
- onClick: () => l(`/worker/task/${e.id}`),
461
- className: "inline-flex items-center gap-1.5 rounded-md bg-accent px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-accent/80 transition-colors",
462
- children: ["Details", /* @__PURE__ */ O(p, { className: "h-3.5 w-3.5" })]
463
- })
464
- ]
465
- })]
466
- })
467
- }, e.id))
468
- }) : /* @__PURE__ */ k("div", {
469
- className: "p-8 text-center",
470
- children: [/* @__PURE__ */ O(d, { className: "h-10 w-10 text-status-success-text opacity-40 mx-auto mb-2" }), /* @__PURE__ */ O("p", {
471
- className: "text-sm text-text-secondary",
472
- children: "All tasks completed!"
473
- })]
474
- })
475
- })] }),
476
- /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("h2", {
477
- className: "text-base font-semibold text-text-primary mb-3",
478
- children: "Recently Completed"
479
- }), /* @__PURE__ */ O("div", {
480
- className: "rounded-lg border border-border-seam bg-bg-surface p-5 shadow-sm",
481
- children: Q.length > 0 ? /* @__PURE__ */ O("div", {
482
- className: "space-y-3",
483
- children: Q.slice(0, 3).map((e) => /* @__PURE__ */ k("div", {
484
- className: "flex items-center gap-3 p-3 rounded-lg bg-status-success-bg/5 border border-status-success-border/10",
485
- children: [
486
- /* @__PURE__ */ O("div", {
487
- className: "flex h-8 w-8 items-center justify-center rounded-md bg-status-success-bg/10",
488
- children: /* @__PURE__ */ O(F(e.type), { className: "h-4 w-4 text-status-success-text" })
489
- }),
490
- /* @__PURE__ */ k("div", {
491
- className: "flex-1 min-w-0",
492
- children: [/* @__PURE__ */ O("p", {
493
- className: "text-sm font-medium text-text-primary",
494
- children: e.title
495
- }), /* @__PURE__ */ k("p", {
496
- className: "text-xs text-text-secondary",
497
- children: [
498
- "Completed at",
499
- " ",
500
- (/* @__PURE__ */ new Date()).toLocaleTimeString("en-IN", {
501
- hour: "2-digit",
502
- minute: "2-digit",
503
- hour12: !0
504
- })
505
- ]
506
- })]
507
- }),
508
- /* @__PURE__ */ O(d, { className: "h-4 w-4 text-status-success-text shrink-0" })
509
- ]
510
- }, e.id))
511
- }) : /* @__PURE__ */ O("p", {
512
- className: "text-sm text-text-secondary text-center py-4",
513
- children: "No completed tasks yet today"
514
- })
515
- })] }),
516
- /* @__PURE__ */ k("div", {
517
- className: "grid grid-cols-1 md:grid-cols-2 gap-6",
518
- children: [/* @__PURE__ */ k("div", {
519
- className: "rounded-lg border border-border-seam bg-bg-surface p-5 shadow-sm",
520
- children: [/* @__PURE__ */ k("h3", {
521
- className: "text-base font-semibold text-text-primary flex items-center gap-2 mb-4",
522
- children: [/* @__PURE__ */ O(w, { className: "h-4 w-4 text-text-secondary" }), "Performance This Week"]
523
- }), /* @__PURE__ */ k("div", {
524
- className: "space-y-3",
525
- children: [
526
- /* @__PURE__ */ k("div", {
527
- className: "flex items-center justify-between",
528
- children: [/* @__PURE__ */ O("span", {
529
- className: "text-sm text-text-secondary",
530
- children: "Tasks Completed"
531
- }), /* @__PURE__ */ O("span", {
532
- className: "text-sm font-medium text-text-primary",
533
- children: "47"
534
- })]
535
- }),
536
- /* @__PURE__ */ k("div", {
537
- className: "flex items-center justify-between",
538
- children: [/* @__PURE__ */ O("span", {
539
- className: "text-sm text-text-secondary",
540
- children: "Average Time per Task"
541
- }), /* @__PURE__ */ O("span", {
542
- className: "text-sm font-medium text-text-primary",
543
- children: "23 min"
544
- })]
545
- }),
546
- /* @__PURE__ */ k("div", {
547
- className: "flex items-center justify-between",
548
- children: [/* @__PURE__ */ O("span", {
549
- className: "text-sm text-text-secondary",
550
- children: "On-time Completion"
551
- }), /* @__PURE__ */ O("span", {
552
- className: "text-sm font-medium text-text-primary",
553
- children: "94%"
554
- })]
555
- }),
556
- /* @__PURE__ */ k("div", {
557
- className: "flex items-center justify-between",
558
- children: [/* @__PURE__ */ O("span", {
559
- className: "text-sm text-text-secondary",
560
- children: "Customer Feedback"
561
- }), /* @__PURE__ */ k("span", {
562
- className: "text-sm font-medium text-text-primary flex items-center gap-1",
563
- children: ["4.7/5", /* @__PURE__ */ O(S, { className: "h-3.5 w-3.5 fill-status-warning-text text-status-warning-text" })]
564
- })]
565
- })
566
- ]
567
- })]
568
- }), /* @__PURE__ */ k("div", {
569
- className: "rounded-lg border border-border-seam bg-bg-surface p-5 shadow-sm",
570
- children: [/* @__PURE__ */ k("h3", {
571
- className: "text-base font-semibold text-text-primary flex items-center gap-2 mb-4",
572
- children: [/* @__PURE__ */ O(u, { className: "h-4 w-4 text-text-secondary" }), "Shift Information"]
573
- }), /* @__PURE__ */ k("div", {
574
- className: "space-y-3",
575
- children: [
576
- /* @__PURE__ */ k("div", {
577
- className: "flex items-center justify-between",
578
- children: [/* @__PURE__ */ O("span", {
579
- className: "text-sm text-text-secondary",
580
- children: "Shift Start"
581
- }), /* @__PURE__ */ O("span", {
582
- className: "text-sm font-medium text-text-primary",
583
- children: "9:00 AM"
584
- })]
585
- }),
586
- /* @__PURE__ */ k("div", {
587
- className: "flex items-center justify-between",
588
- children: [/* @__PURE__ */ O("span", {
589
- className: "text-sm text-text-secondary",
590
- children: "Shift End"
591
- }), /* @__PURE__ */ O("span", {
592
- className: "text-sm font-medium text-text-primary",
593
- children: "6:00 PM"
594
- })]
595
- }),
596
- /* @__PURE__ */ k("div", {
597
- className: "flex items-center justify-between",
598
- children: [/* @__PURE__ */ O("span", {
599
- className: "text-sm text-text-secondary",
600
- children: "Break Time"
601
- }), /* @__PURE__ */ O("span", {
602
- className: "text-sm font-medium text-text-primary",
603
- children: "1:00 PM - 2:00 PM"
604
- })]
605
- }),
606
- /* @__PURE__ */ k("div", {
607
- className: "flex items-center justify-between",
608
- children: [/* @__PURE__ */ O("span", {
609
- className: "text-sm text-text-secondary",
610
- children: "Supervisor"
611
- }), /* @__PURE__ */ O("span", {
612
- className: "text-sm font-medium text-text-primary",
613
- children: "Rajesh Kumar"
614
- })]
615
- })
616
- ]
617
- })]
618
- })]
619
- }),
620
- /* @__PURE__ */ k("div", {
621
- className: "rounded-lg border border-border-seam bg-bg-surface p-5 shadow-sm",
622
- children: [/* @__PURE__ */ O("h2", {
623
- className: "text-base font-semibold text-text-primary mb-4",
624
- children: "Overall Performance"
625
- }), /* @__PURE__ */ k("div", {
626
- className: "grid grid-cols-2 gap-4 sm:grid-cols-4",
627
- children: [
628
- /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
629
- className: "text-xs text-text-secondary",
630
- children: "Total Deliveries"
631
- }), /* @__PURE__ */ O("p", {
632
- className: "text-lg font-bold text-text-primary",
633
- children: R?.totalDeliveries || 0
634
- })] }),
635
- /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
636
- className: "text-xs text-text-secondary",
637
- children: "Total Earnings"
638
- }), /* @__PURE__ */ O("p", {
639
- className: "text-lg font-bold text-text-primary",
640
- children: s(R?.totalEarnings || 0, { minimumFractionDigits: 0 })
641
- })] }),
642
- /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
643
- className: "text-xs text-text-secondary",
644
- children: "Average Rating"
645
- }), /* @__PURE__ */ k("p", {
646
- className: "text-lg font-bold text-text-primary flex items-center gap-1",
647
- children: [R?.averageRating || 0, /* @__PURE__ */ O(S, { className: "h-4 w-4 fill-status-warning-text text-status-warning-text" })]
648
- })] }),
649
- /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
650
- className: "text-xs text-text-secondary",
651
- children: "Completion Rate"
652
- }), /* @__PURE__ */ k("p", {
653
- className: "text-lg font-bold text-text-primary",
654
- children: [R?.completionRate || 0, "%"]
655
- })] })
656
- ]
657
- })]
658
- })
659
- ]
660
- })
661
- });
662
- };
663
- //#endregion
664
- export { L as WorkerDashboard };
665
-
666
- //# sourceMappingURL=WorkerDashboard.js.map