@burdenoff/microfe-labsofscience 2026.626.1 → 2026.628.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 (172) hide show
  1. package/dist/index.js +4 -4
  2. package/dist/labsofscience/LabsOfScienceRoot.js +68 -124
  3. package/dist/labsofscience/LabsOfScienceRoot.js.map +1 -1
  4. package/dist/labsofscience/LabsOfScienceRoutes.js +61 -185
  5. package/dist/labsofscience/LabsOfScienceRoutes.js.map +1 -1
  6. package/dist/labsofscience/components/QueryStates.js +40 -0
  7. package/dist/labsofscience/components/QueryStates.js.map +1 -0
  8. package/dist/labsofscience/components/StatusBadge.js +40 -23
  9. package/dist/labsofscience/components/StatusBadge.js.map +1 -1
  10. package/dist/labsofscience/context/LabsOfScienceContext.js +22 -30
  11. package/dist/labsofscience/context/LabsOfScienceContext.js.map +1 -1
  12. package/dist/labsofscience/hooks/useLabsOfScienceApi.js +500 -172
  13. package/dist/labsofscience/hooks/useLabsOfScienceApi.js.map +1 -1
  14. package/dist/labsofscience/pages/OverviewPage.js +195 -0
  15. package/dist/labsofscience/pages/OverviewPage.js.map +1 -0
  16. package/dist/labsofscience/pages/datasets/DatasetDetailPage.js +162 -0
  17. package/dist/labsofscience/pages/datasets/DatasetDetailPage.js.map +1 -0
  18. package/dist/labsofscience/pages/datasets/DatasetFormDialog.js +137 -0
  19. package/dist/labsofscience/pages/datasets/DatasetFormDialog.js.map +1 -0
  20. package/dist/labsofscience/pages/datasets/DatasetsListPage.js +155 -0
  21. package/dist/labsofscience/pages/datasets/DatasetsListPage.js.map +1 -0
  22. package/dist/labsofscience/pages/experiments/ExperimentDetailPage.js +220 -0
  23. package/dist/labsofscience/pages/experiments/ExperimentDetailPage.js.map +1 -0
  24. package/dist/labsofscience/pages/experiments/ExperimentFormDialog.js +170 -0
  25. package/dist/labsofscience/pages/experiments/ExperimentFormDialog.js.map +1 -0
  26. package/dist/labsofscience/pages/experiments/ExperimentsListPage.js +134 -0
  27. package/dist/labsofscience/pages/experiments/ExperimentsListPage.js.map +1 -0
  28. package/dist/labsofscience/pages/experiments/RunDialogs.js +180 -0
  29. package/dist/labsofscience/pages/experiments/RunDialogs.js.map +1 -0
  30. package/dist/labsofscience/pages/instruments/InstrumentDetailPage.js +130 -0
  31. package/dist/labsofscience/pages/instruments/InstrumentDetailPage.js.map +1 -0
  32. package/dist/labsofscience/pages/instruments/InstrumentFormDialog.js +132 -0
  33. package/dist/labsofscience/pages/instruments/InstrumentFormDialog.js.map +1 -0
  34. package/dist/labsofscience/pages/instruments/InstrumentsListPage.js +126 -0
  35. package/dist/labsofscience/pages/instruments/InstrumentsListPage.js.map +1 -0
  36. package/dist/labsofscience/pages/inventory/AdjustInventoryDialog.js +89 -0
  37. package/dist/labsofscience/pages/inventory/AdjustInventoryDialog.js.map +1 -0
  38. package/dist/labsofscience/pages/inventory/InventoryDetailPage.js +138 -0
  39. package/dist/labsofscience/pages/inventory/InventoryDetailPage.js.map +1 -0
  40. package/dist/labsofscience/pages/inventory/InventoryFormDialog.js +211 -0
  41. package/dist/labsofscience/pages/inventory/InventoryFormDialog.js.map +1 -0
  42. package/dist/labsofscience/pages/inventory/InventoryListPage.js +178 -0
  43. package/dist/labsofscience/pages/inventory/InventoryListPage.js.map +1 -0
  44. package/dist/labsofscience/pages/notebook/NotebookEntryFormDialog.js +118 -0
  45. package/dist/labsofscience/pages/notebook/NotebookEntryFormDialog.js.map +1 -0
  46. package/dist/labsofscience/pages/notebook/NotebookListPage.js +144 -0
  47. package/dist/labsofscience/pages/notebook/NotebookListPage.js.map +1 -0
  48. package/dist/labsofscience/pages/pipelines/PipelineFormDialog.js +146 -0
  49. package/dist/labsofscience/pages/pipelines/PipelineFormDialog.js.map +1 -0
  50. package/dist/labsofscience/pages/pipelines/PipelinesPage.js +212 -0
  51. package/dist/labsofscience/pages/pipelines/PipelinesPage.js.map +1 -0
  52. package/dist/labsofscience/pages/pipelines/RunPipelineDialog.js +109 -0
  53. package/dist/labsofscience/pages/pipelines/RunPipelineDialog.js.map +1 -0
  54. package/dist/labsofscience/pages/projects/ProjectDetailPage.js +174 -0
  55. package/dist/labsofscience/pages/projects/ProjectDetailPage.js.map +1 -0
  56. package/dist/labsofscience/pages/projects/ProjectFormDialog.js +169 -0
  57. package/dist/labsofscience/pages/projects/ProjectFormDialog.js.map +1 -0
  58. package/dist/labsofscience/pages/projects/ProjectsListPage.js +141 -0
  59. package/dist/labsofscience/pages/projects/ProjectsListPage.js.map +1 -0
  60. package/dist/labsofscience/pages/protocols/ProtocolDetailPage.js +133 -0
  61. package/dist/labsofscience/pages/protocols/ProtocolDetailPage.js.map +1 -0
  62. package/dist/labsofscience/pages/protocols/ProtocolFormDialog.js +151 -0
  63. package/dist/labsofscience/pages/protocols/ProtocolFormDialog.js.map +1 -0
  64. package/dist/labsofscience/pages/protocols/ProtocolsListPage.js +140 -0
  65. package/dist/labsofscience/pages/protocols/ProtocolsListPage.js.map +1 -0
  66. package/dist/labsofscience/pages/shared/DetailComponents.js +64 -0
  67. package/dist/labsofscience/pages/shared/DetailComponents.js.map +1 -0
  68. package/dist/labsofscience/pages/shared/tags.js +16 -0
  69. package/dist/labsofscience/pages/shared/tags.js.map +1 -0
  70. package/dist/labsofscience/store/labsofscienceStore.js +6 -11
  71. package/dist/labsofscience/store/labsofscienceStore.js.map +1 -1
  72. package/dist/labsofscience/utils/formatters.js +28 -13
  73. package/dist/labsofscience/utils/formatters.js.map +1 -1
  74. package/package.json +1 -1
  75. package/dist/labsofscience/components/InvestmentCard.js +0 -98
  76. package/dist/labsofscience/components/InvestmentCard.js.map +0 -1
  77. package/dist/labsofscience/components/RatingDisplay.js +0 -35
  78. package/dist/labsofscience/components/RatingDisplay.js.map +0 -1
  79. package/dist/labsofscience/mocks/data.js +0 -1517
  80. package/dist/labsofscience/mocks/data.js.map +0 -1
  81. package/dist/labsofscience/mocks/users.js +0 -34
  82. package/dist/labsofscience/mocks/users.js.map +0 -1
  83. package/dist/labsofscience/pages/HomePage.js +0 -940
  84. package/dist/labsofscience/pages/HomePage.js.map +0 -1
  85. package/dist/labsofscience/pages/admin/AdminAnalyticsPage.js +0 -651
  86. package/dist/labsofscience/pages/admin/AdminAnalyticsPage.js.map +0 -1
  87. package/dist/labsofscience/pages/admin/AdminDashboard.js +0 -672
  88. package/dist/labsofscience/pages/admin/AdminDashboard.js.map +0 -1
  89. package/dist/labsofscience/pages/admin/AdminFinancialPage.js +0 -427
  90. package/dist/labsofscience/pages/admin/AdminFinancialPage.js.map +0 -1
  91. package/dist/labsofscience/pages/admin/AdminOrdersPage.js +0 -665
  92. package/dist/labsofscience/pages/admin/AdminOrdersPage.js.map +0 -1
  93. package/dist/labsofscience/pages/admin/AdminProfilePage.js +0 -261
  94. package/dist/labsofscience/pages/admin/AdminProfilePage.js.map +0 -1
  95. package/dist/labsofscience/pages/admin/AdminSettingsPage.js +0 -651
  96. package/dist/labsofscience/pages/admin/AdminSettingsPage.js.map +0 -1
  97. package/dist/labsofscience/pages/admin/CartManagementPage.js +0 -874
  98. package/dist/labsofscience/pages/admin/CartManagementPage.js.map +0 -1
  99. package/dist/labsofscience/pages/admin/UserManagementPage.js +0 -898
  100. package/dist/labsofscience/pages/admin/UserManagementPage.js.map +0 -1
  101. package/dist/labsofscience/pages/cart-owner/AnalyticsDashboard.js +0 -839
  102. package/dist/labsofscience/pages/cart-owner/AnalyticsDashboard.js.map +0 -1
  103. package/dist/labsofscience/pages/cart-owner/BusinessSettingsPage.js +0 -705
  104. package/dist/labsofscience/pages/cart-owner/BusinessSettingsPage.js.map +0 -1
  105. package/dist/labsofscience/pages/cart-owner/CartOwnerDashboard.js +0 -791
  106. package/dist/labsofscience/pages/cart-owner/CartOwnerDashboard.js.map +0 -1
  107. package/dist/labsofscience/pages/cart-owner/CartOwnerProfilePage.js +0 -891
  108. package/dist/labsofscience/pages/cart-owner/CartOwnerProfilePage.js.map +0 -1
  109. package/dist/labsofscience/pages/cart-owner/CartServiceConfigPage.js +0 -636
  110. package/dist/labsofscience/pages/cart-owner/CartServiceConfigPage.js.map +0 -1
  111. package/dist/labsofscience/pages/cart-owner/InventoryManagementPage.js +0 -911
  112. package/dist/labsofscience/pages/cart-owner/InventoryManagementPage.js.map +0 -1
  113. package/dist/labsofscience/pages/cart-owner/OrderManagementPage.js +0 -879
  114. package/dist/labsofscience/pages/cart-owner/OrderManagementPage.js.map +0 -1
  115. package/dist/labsofscience/pages/cart-owner/StaffManagementPage.js +0 -839
  116. package/dist/labsofscience/pages/cart-owner/StaffManagementPage.js.map +0 -1
  117. package/dist/labsofscience/pages/common/HelpSupportPage.js +0 -1324
  118. package/dist/labsofscience/pages/common/HelpSupportPage.js.map +0 -1
  119. package/dist/labsofscience/pages/common/NotificationCenterPage.js +0 -672
  120. package/dist/labsofscience/pages/common/NotificationCenterPage.js.map +0 -1
  121. package/dist/labsofscience/pages/common/SettingsPage.js +0 -973
  122. package/dist/labsofscience/pages/common/SettingsPage.js.map +0 -1
  123. package/dist/labsofscience/pages/customer/BookingDetailsPage.js +0 -637
  124. package/dist/labsofscience/pages/customer/BookingDetailsPage.js.map +0 -1
  125. package/dist/labsofscience/pages/customer/CartDetailPage.js +0 -653
  126. package/dist/labsofscience/pages/customer/CartDetailPage.js.map +0 -1
  127. package/dist/labsofscience/pages/customer/CartDiscoveryPage.js +0 -559
  128. package/dist/labsofscience/pages/customer/CartDiscoveryPage.js.map +0 -1
  129. package/dist/labsofscience/pages/customer/CheckoutPage.js +0 -530
  130. package/dist/labsofscience/pages/customer/CheckoutPage.js.map +0 -1
  131. package/dist/labsofscience/pages/customer/CustomerDashboard.js +0 -531
  132. package/dist/labsofscience/pages/customer/CustomerDashboard.js.map +0 -1
  133. package/dist/labsofscience/pages/customer/CustomerProfilePage.js +0 -658
  134. package/dist/labsofscience/pages/customer/CustomerProfilePage.js.map +0 -1
  135. package/dist/labsofscience/pages/customer/DirectServiceBookingPage.js +0 -633
  136. package/dist/labsofscience/pages/customer/DirectServiceBookingPage.js.map +0 -1
  137. package/dist/labsofscience/pages/customer/FavoritesPage.js +0 -484
  138. package/dist/labsofscience/pages/customer/FavoritesPage.js.map +0 -1
  139. package/dist/labsofscience/pages/customer/OrderHistoryPage.js +0 -445
  140. package/dist/labsofscience/pages/customer/OrderHistoryPage.js.map +0 -1
  141. package/dist/labsofscience/pages/customer/OrderTrackingPage.js +0 -425
  142. package/dist/labsofscience/pages/customer/OrderTrackingPage.js.map +0 -1
  143. package/dist/labsofscience/pages/customer/PaymentMethodsPage.js +0 -495
  144. package/dist/labsofscience/pages/customer/PaymentMethodsPage.js.map +0 -1
  145. package/dist/labsofscience/pages/customer/ReviewsPage.js +0 -613
  146. package/dist/labsofscience/pages/customer/ReviewsPage.js.map +0 -1
  147. package/dist/labsofscience/pages/customer/SavedAddressesPage.js +0 -450
  148. package/dist/labsofscience/pages/customer/SavedAddressesPage.js.map +0 -1
  149. package/dist/labsofscience/pages/investor/InvestmentDetailsPage.js +0 -881
  150. package/dist/labsofscience/pages/investor/InvestmentDetailsPage.js.map +0 -1
  151. package/dist/labsofscience/pages/investor/InvestmentOpportunitiesPage.js +0 -946
  152. package/dist/labsofscience/pages/investor/InvestmentOpportunitiesPage.js.map +0 -1
  153. package/dist/labsofscience/pages/investor/InvestorAnalyticsPage.js +0 -687
  154. package/dist/labsofscience/pages/investor/InvestorAnalyticsPage.js.map +0 -1
  155. package/dist/labsofscience/pages/investor/InvestorDashboard.js +0 -455
  156. package/dist/labsofscience/pages/investor/InvestorDashboard.js.map +0 -1
  157. package/dist/labsofscience/pages/investor/InvestorInvestmentsPage.js +0 -406
  158. package/dist/labsofscience/pages/investor/InvestorInvestmentsPage.js.map +0 -1
  159. package/dist/labsofscience/pages/investor/InvestorPortfolioPage.js +0 -575
  160. package/dist/labsofscience/pages/investor/InvestorPortfolioPage.js.map +0 -1
  161. package/dist/labsofscience/pages/investor/InvestorProfilePage.js +0 -1070
  162. package/dist/labsofscience/pages/investor/InvestorProfilePage.js.map +0 -1
  163. package/dist/labsofscience/pages/worker/TaskDetailsPage.js +0 -537
  164. package/dist/labsofscience/pages/worker/TaskDetailsPage.js.map +0 -1
  165. package/dist/labsofscience/pages/worker/WorkerDashboard.js +0 -665
  166. package/dist/labsofscience/pages/worker/WorkerDashboard.js.map +0 -1
  167. package/dist/labsofscience/pages/worker/WorkerOrdersPage.js +0 -681
  168. package/dist/labsofscience/pages/worker/WorkerOrdersPage.js.map +0 -1
  169. package/dist/labsofscience/pages/worker/WorkerProfilePage.js +0 -692
  170. package/dist/labsofscience/pages/worker/WorkerProfilePage.js.map +0 -1
  171. package/dist/labsofscience/pages/worker/WorkerSchedulePage.js +0 -588
  172. package/dist/labsofscience/pages/worker/WorkerSchedulePage.js.map +0 -1
@@ -1,681 +0,0 @@
1
- import { useLabsOfScience as e } from "../../context/LabsOfScienceContext.js";
2
- import { cn as t } from "../../utils/cn.js";
3
- import { PageLayout as n } from "../../components/PageLayout.js";
4
- import { StatusBadge as r } from "../../components/StatusBadge.js";
5
- import { EmptyState as i } from "../../components/EmptyState.js";
6
- import { formatCurrency as a } from "../../utils/formatters.js";
7
- import { useCallback as o, useEffect as s, useState as c } from "react";
8
- import { AlertTriangle as l, ArrowRight as u, CheckCircle2 as d, ChefHat as f, ClipboardList as p, CreditCard as m, Loader2 as h, MapPin as g, Navigation as _, Package as v, Phone as y, PlayCircle as b, ShoppingBag as x, Star as S, Truck as C } from "lucide-react";
9
- import { jsx as w, jsxs as T } from "react/jsx-runtime";
10
- import { EmphasisPanel as E, PagePurpose as D } from "@burdenoff/fe-libs/ui";
11
- //#region src/labsofscience/pages/worker/WorkerOrdersPage.tsx
12
- var O = [
13
- {
14
- id: "task-001",
15
- orderId: "ORD-2024-001",
16
- cartId: "cart-001",
17
- cartName: "South Indian Express",
18
- type: "delivery",
19
- status: "pending",
20
- priority: "high",
21
- customerName: "Rahul Sharma",
22
- customerPhone: "+91-98765-43210",
23
- items: [{
24
- name: "Masala Dosa",
25
- quantity: 2
26
- }, {
27
- name: "Filter Coffee",
28
- quantity: 2
29
- }],
30
- address: {
31
- addressLine1: "123, MG Road",
32
- addressLine2: "Near Central Mall",
33
- landmark: "Opposite SBI Bank",
34
- city: "Bangalore",
35
- pincode: "560001"
36
- },
37
- estimatedTime: new Date(Date.now() + 1800 * 1e3).toISOString(),
38
- assignedTime: (/* @__PURE__ */ new Date(Date.now() - 300 * 1e3)).toISOString(),
39
- distance: 3.5,
40
- specialInstructions: "Please call before delivery",
41
- payment: {
42
- method: "Cash",
43
- amount: 295,
44
- status: "pending"
45
- }
46
- },
47
- {
48
- id: "task-002",
49
- orderId: "ORD-2024-002",
50
- cartId: "cart-001",
51
- cartName: "South Indian Express",
52
- type: "pickup",
53
- status: "in_progress",
54
- priority: "medium",
55
- customerName: "Priya Patel",
56
- customerPhone: "+91-98765-43211",
57
- items: [{
58
- name: "Idli Sambar",
59
- quantity: 3
60
- }],
61
- estimatedTime: new Date(Date.now() + 900 * 1e3).toISOString(),
62
- assignedTime: (/* @__PURE__ */ new Date(Date.now() - 600 * 1e3)).toISOString(),
63
- specialInstructions: "",
64
- payment: {
65
- method: "Online",
66
- amount: 198,
67
- status: "completed"
68
- }
69
- },
70
- {
71
- id: "task-003",
72
- orderId: "ORD-2024-003",
73
- cartId: "cart-002",
74
- cartName: "Chaat Corner",
75
- type: "preparation",
76
- status: "pending",
77
- priority: "urgent",
78
- customerName: "Amit Kumar",
79
- customerPhone: "+91-98765-43212",
80
- items: [{
81
- name: "Pani Puri",
82
- quantity: 2
83
- }, {
84
- name: "Bhel Puri",
85
- quantity: 1
86
- }],
87
- estimatedTime: new Date(Date.now() + 1200 * 1e3).toISOString(),
88
- assignedTime: (/* @__PURE__ */ new Date(Date.now() - 120 * 1e3)).toISOString(),
89
- specialInstructions: "Extra spicy",
90
- payment: {
91
- method: "UPI",
92
- amount: 150,
93
- status: "completed"
94
- }
95
- },
96
- {
97
- id: "task-004",
98
- orderId: "ORD-2024-004",
99
- cartId: "cart-003",
100
- cartName: "Biryani Pot",
101
- type: "delivery",
102
- status: "completed",
103
- priority: "medium",
104
- customerName: "Deepa Nair",
105
- customerPhone: "+91-98765-43213",
106
- items: [{
107
- name: "Chicken Biryani",
108
- quantity: 1
109
- }, {
110
- name: "Raita",
111
- quantity: 1
112
- }],
113
- address: {
114
- addressLine1: "456, Brigade Road",
115
- city: "Bangalore",
116
- pincode: "560025"
117
- },
118
- estimatedTime: (/* @__PURE__ */ new Date(Date.now() - 1800 * 1e3)).toISOString(),
119
- assignedTime: (/* @__PURE__ */ new Date(Date.now() - 5400 * 1e3)).toISOString(),
120
- distance: 2.1,
121
- payment: {
122
- method: "Online",
123
- amount: 340,
124
- status: "completed"
125
- }
126
- }
127
- ];
128
- function k(e) {
129
- let t = /* @__PURE__ */ new Date(), n = new Date(e), r = Math.floor((n.getTime() - t.getTime()) / (1e3 * 60));
130
- return r < 0 ? "Overdue" : r < 60 ? `${r} min` : `${Math.floor(r / 60)}h ${r % 60}m`;
131
- }
132
- function A(e) {
133
- switch (e) {
134
- case "delivery": return {
135
- icon: C,
136
- label: "Delivery",
137
- style: "bg-[color-mix(in_oklab,var(--color-accent-purple)_14%,transparent)] text-accent-purple"
138
- };
139
- case "pickup": return {
140
- icon: x,
141
- label: "Pickup",
142
- style: "bg-status-info-bg-subtle text-status-info-text"
143
- };
144
- case "preparation": return {
145
- icon: f,
146
- label: "Preparation",
147
- style: "bg-status-success-bg-subtle text-status-success-text"
148
- };
149
- default: return {
150
- icon: v,
151
- label: e,
152
- style: "bg-secondary text-secondary-foreground"
153
- };
154
- }
155
- }
156
- function j(e) {
157
- switch (e) {
158
- case "urgent": return "bg-status-error-bg-subtle text-status-error-text";
159
- case "high": return "bg-status-warning-bg-subtle text-status-warning-text";
160
- case "medium": return "bg-status-warning-bg-subtle text-status-warning-text";
161
- case "low": return "bg-status-success-bg-subtle text-status-success-text";
162
- default: return "bg-secondary text-secondary-foreground";
163
- }
164
- }
165
- var M = () => {
166
- let { navigateTo: f } = e(), [v, x] = c(!0), [C, M] = c([]), [N, P] = c(null), [F, I] = c({
167
- status: "",
168
- type: "",
169
- priority: "",
170
- sortBy: "priority"
171
- }), [L, R] = c({
172
- totalTasks: 0,
173
- completedToday: 0,
174
- pendingTasks: 0,
175
- averageTime: 0,
176
- earnings: 0,
177
- rating: 4.8
178
- }), [, z] = c(0);
179
- s(() => {
180
- let e = setInterval(() => z((e) => e + 1), 6e4);
181
- return () => clearInterval(e);
182
- }, []);
183
- let B = o(() => {
184
- x(!0), setTimeout(() => {
185
- let e = [...O];
186
- F.status && (e = e.filter((e) => e.status === F.status)), F.type && (e = e.filter((e) => e.type === F.type)), F.priority && (e = e.filter((e) => e.priority === F.priority));
187
- let t = {
188
- urgent: 0,
189
- high: 1,
190
- medium: 2,
191
- low: 3
192
- };
193
- switch (F.sortBy) {
194
- case "priority":
195
- e.sort((e, n) => (t[e.priority] ?? 4) - (t[n.priority] ?? 4));
196
- break;
197
- case "time":
198
- e.sort((e, t) => new Date(e.estimatedTime).getTime() - new Date(t.estimatedTime).getTime());
199
- break;
200
- case "distance":
201
- e.sort((e, t) => (e.distance ?? 999) - (t.distance ?? 999));
202
- break;
203
- }
204
- M(e), P(O.find((e) => e.status === "in_progress") ?? null), R({
205
- totalTasks: 45,
206
- completedToday: 12,
207
- pendingTasks: 3,
208
- averageTime: 22,
209
- earnings: 2450,
210
- rating: 4.8
211
- }), x(!1);
212
- }, 600);
213
- }, [F]);
214
- s(() => {
215
- B();
216
- }, [B]);
217
- let V = (e, t) => {
218
- I((n) => ({
219
- ...n,
220
- [e]: t
221
- }));
222
- }, H = (e) => {
223
- let t = O.find((t) => t.id === e);
224
- t && (t.status = "in_progress", P(t), B());
225
- }, U = (e) => {
226
- let t = O.find((t) => t.id === e);
227
- t && (t.status = "completed"), P(null), B(), alert("Task completed successfully");
228
- }, W = (e) => {
229
- window.location.href = `tel:${e.replace(/\s/g, "")}`;
230
- }, G = (e) => {
231
- if (e.address) {
232
- let t = encodeURIComponent(`${e.address.addressLine1}, ${e.address.city}`);
233
- window.open(`https://maps.google.com?q=${t}`, "_blank");
234
- }
235
- };
236
- return v ? /* @__PURE__ */ w(n, {
237
- title: "My Orders",
238
- description: "Manage your assigned orders",
239
- children: /* @__PURE__ */ w("div", {
240
- className: "flex items-center justify-center py-24",
241
- children: /* @__PURE__ */ T("div", {
242
- className: "text-center",
243
- children: [/* @__PURE__ */ w(h, { className: "h-10 w-10 animate-spin text-text-secondary mx-auto mb-4" }), /* @__PURE__ */ w("p", {
244
- className: "text-sm text-text-secondary",
245
- children: "Loading tasks..."
246
- })]
247
- })
248
- })
249
- }) : /* @__PURE__ */ w(n, {
250
- title: "My Orders",
251
- description: "Manage your assigned orders",
252
- children: /* @__PURE__ */ T("div", {
253
- className: "space-y-6",
254
- children: [
255
- /* @__PURE__ */ w(D, {
256
- icon: /* @__PURE__ */ w(p, { className: "h-4 w-4" }),
257
- children: "Your work queue for the day. Pick up assigned deliveries and service jobs, see what's pending versus done, accept and complete them, and watch your earnings and rating climb — tap any order to get full details, directions and the customer's contact."
258
- }),
259
- /* @__PURE__ */ T(E, {
260
- className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3",
261
- children: [
262
- /* @__PURE__ */ T("div", {
263
- className: "rounded-lg border border-border-seam bg-bg-surface p-4 shadow-sm",
264
- children: [/* @__PURE__ */ w("p", {
265
- className: "text-xs text-text-secondary",
266
- children: "Today's Tasks"
267
- }), /* @__PURE__ */ w("p", {
268
- className: "text-2xl font-bold text-text-primary",
269
- children: L.totalTasks
270
- })]
271
- }),
272
- /* @__PURE__ */ T("div", {
273
- className: "rounded-lg border border-status-success-border bg-status-success-bg-subtle p-4 shadow-sm",
274
- children: [/* @__PURE__ */ w("p", {
275
- className: "text-xs text-status-success-text",
276
- children: "Completed"
277
- }), /* @__PURE__ */ w("p", {
278
- className: "text-2xl font-bold text-status-success-text",
279
- children: L.completedToday
280
- })]
281
- }),
282
- /* @__PURE__ */ T("div", {
283
- className: "rounded-lg border border-status-warning-border bg-status-warning-bg-subtle p-4 shadow-sm",
284
- children: [/* @__PURE__ */ w("p", {
285
- className: "text-xs text-status-warning-text",
286
- children: "Pending"
287
- }), /* @__PURE__ */ w("p", {
288
- className: "text-2xl font-bold text-status-warning-text",
289
- children: L.pendingTasks
290
- })]
291
- }),
292
- /* @__PURE__ */ T("div", {
293
- className: "rounded-lg border border-border-seam bg-bg-surface p-4 shadow-sm",
294
- children: [/* @__PURE__ */ w("p", {
295
- className: "text-xs text-text-secondary",
296
- children: "Avg Time"
297
- }), /* @__PURE__ */ T("p", {
298
- className: "text-2xl font-bold text-text-primary",
299
- children: [L.averageTime, " min"]
300
- })]
301
- }),
302
- /* @__PURE__ */ T("div", {
303
- className: "rounded-lg border border-border-seam bg-bg-surface p-4 shadow-sm",
304
- children: [/* @__PURE__ */ w("p", {
305
- className: "text-xs text-text-secondary",
306
- children: "Today's Earnings"
307
- }), /* @__PURE__ */ w("p", {
308
- className: "text-2xl font-bold text-text-primary",
309
- children: a(L.earnings, { minimumFractionDigits: 0 })
310
- })]
311
- }),
312
- /* @__PURE__ */ T("div", {
313
- className: "rounded-lg border border-border-seam bg-bg-surface p-4 shadow-sm",
314
- children: [/* @__PURE__ */ w("p", {
315
- className: "text-xs text-text-secondary",
316
- children: "Rating"
317
- }), /* @__PURE__ */ T("p", {
318
- className: "text-2xl font-bold text-text-primary flex items-center gap-1",
319
- children: [/* @__PURE__ */ w(S, { className: "h-4 w-4 fill-status-warning-text text-status-warning-text" }), L.rating]
320
- })]
321
- })
322
- ]
323
- }),
324
- N && /* @__PURE__ */ T("div", {
325
- className: "rounded-lg border-2 border-status-info-border bg-status-info-bg-subtle p-5",
326
- children: [/* @__PURE__ */ w("h2", {
327
- className: "text-base font-semibold text-status-info-text mb-4",
328
- children: "Current Task"
329
- }), /* @__PURE__ */ T("div", {
330
- className: "rounded-lg border border-border-seam bg-bg-surface p-4",
331
- children: [/* @__PURE__ */ T("div", {
332
- className: "flex items-center justify-between mb-4",
333
- children: [/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ T("div", {
334
- className: "flex items-center gap-2 flex-wrap",
335
- children: [
336
- /* @__PURE__ */ T("h3", {
337
- className: "text-sm font-semibold text-text-primary",
338
- children: ["Order #", N.orderId]
339
- }),
340
- (() => {
341
- let e = A(N.type), n = e.icon;
342
- return /* @__PURE__ */ T("span", {
343
- className: t("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] font-medium", e.style),
344
- children: [/* @__PURE__ */ w(n, { className: "h-3 w-3" }), e.label]
345
- });
346
- })(),
347
- /* @__PURE__ */ w("span", {
348
- className: t("inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium capitalize", j(N.priority)),
349
- children: N.priority
350
- })
351
- ]
352
- }), /* @__PURE__ */ w("p", {
353
- className: "text-xs text-text-secondary mt-1",
354
- children: N.cartName
355
- })] }), /* @__PURE__ */ T("div", {
356
- className: "text-right",
357
- children: [/* @__PURE__ */ w("p", {
358
- className: "text-xl font-bold text-status-info-text",
359
- children: k(N.estimatedTime)
360
- }), /* @__PURE__ */ w("p", {
361
- className: "text-xs text-text-secondary",
362
- children: "Time remaining"
363
- })]
364
- })]
365
- }), /* @__PURE__ */ T("div", {
366
- className: "border-t border-border-seam pt-4",
367
- children: [
368
- /* @__PURE__ */ T("div", {
369
- className: "grid grid-cols-1 md:grid-cols-2 gap-4",
370
- children: [/* @__PURE__ */ T("div", { children: [
371
- /* @__PURE__ */ w("p", {
372
- className: "text-xs font-medium text-text-secondary",
373
- children: "Customer"
374
- }),
375
- /* @__PURE__ */ w("p", {
376
- className: "text-sm font-medium text-text-primary",
377
- children: N.customerName
378
- }),
379
- N.address && /* @__PURE__ */ T("p", {
380
- className: "text-xs text-text-secondary mt-1",
381
- children: [
382
- N.address.addressLine1,
383
- ", ",
384
- N.address.city
385
- ]
386
- })
387
- ] }), /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
388
- className: "text-xs font-medium text-text-secondary",
389
- children: "Items"
390
- }), /* @__PURE__ */ w("div", {
391
- className: "space-y-0.5",
392
- children: N.items.map((e, t) => /* @__PURE__ */ T("p", {
393
- className: "text-xs text-text-primary",
394
- children: [
395
- e.quantity,
396
- "x ",
397
- e.name
398
- ]
399
- }, t))
400
- })] })]
401
- }),
402
- N.specialInstructions && /* @__PURE__ */ T("div", {
403
- className: "mt-3 p-3 rounded-md bg-status-warning-bg-subtle border border-status-warning-border",
404
- children: [/* @__PURE__ */ T("p", {
405
- className: "text-xs font-medium text-status-warning-text flex items-center gap-1",
406
- children: [/* @__PURE__ */ w(l, { className: "h-3 w-3" }), "Special Instructions:"]
407
- }), /* @__PURE__ */ w("p", {
408
- className: "text-xs text-status-warning-text mt-0.5",
409
- children: N.specialInstructions
410
- })]
411
- }),
412
- /* @__PURE__ */ T("div", {
413
- className: "flex flex-wrap gap-2 mt-4",
414
- children: [
415
- /* @__PURE__ */ T("button", {
416
- type: "button",
417
- onClick: () => W(N.customerPhone),
418
- className: "inline-flex items-center gap-1.5 rounded-md bg-accent px-3 py-2 text-xs font-medium text-text-primary hover:bg-accent/80 transition-colors",
419
- children: [/* @__PURE__ */ w(y, { className: "h-3.5 w-3.5" }), "Call Customer"]
420
- }),
421
- N.type === "delivery" && N.address && /* @__PURE__ */ T("button", {
422
- type: "button",
423
- onClick: () => G(N),
424
- className: "inline-flex items-center gap-1.5 rounded-md bg-accent px-3 py-2 text-xs font-medium text-text-primary hover:bg-accent/80 transition-colors",
425
- children: [/* @__PURE__ */ w(_, { className: "h-3.5 w-3.5" }), "Navigate"]
426
- }),
427
- /* @__PURE__ */ T("button", {
428
- type: "button",
429
- onClick: () => U(N.id),
430
- className: "ml-auto inline-flex items-center gap-1.5 rounded-md bg-status-success-bg-subtle px-3 py-2 text-xs font-medium text-status-success-text hover:bg-status-success-bg-subtle transition-colors",
431
- children: [/* @__PURE__ */ w(d, { className: "h-3.5 w-3.5" }), "Complete Task"]
432
- })
433
- ]
434
- })
435
- ]
436
- })]
437
- })]
438
- }),
439
- /* @__PURE__ */ w("div", {
440
- className: "rounded-lg border border-border-seam bg-bg-surface p-4 shadow-sm",
441
- children: /* @__PURE__ */ T("div", {
442
- className: "grid grid-cols-1 md:grid-cols-4 gap-3",
443
- children: [
444
- /* @__PURE__ */ T("select", {
445
- value: F.status,
446
- onChange: (e) => V("status", e.target.value),
447
- className: "w-full rounded-md border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-status-info-border",
448
- children: [
449
- /* @__PURE__ */ w("option", {
450
- value: "",
451
- children: "All Tasks"
452
- }),
453
- /* @__PURE__ */ w("option", {
454
- value: "pending",
455
- children: "Pending Tasks"
456
- }),
457
- /* @__PURE__ */ w("option", {
458
- value: "in_progress",
459
- children: "In Progress"
460
- }),
461
- /* @__PURE__ */ w("option", {
462
- value: "completed",
463
- children: "Completed"
464
- })
465
- ]
466
- }),
467
- /* @__PURE__ */ T("select", {
468
- value: F.type,
469
- onChange: (e) => V("type", e.target.value),
470
- className: "w-full rounded-md border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-status-info-border",
471
- children: [
472
- /* @__PURE__ */ w("option", {
473
- value: "",
474
- children: "All Types"
475
- }),
476
- /* @__PURE__ */ w("option", {
477
- value: "delivery",
478
- children: "Delivery"
479
- }),
480
- /* @__PURE__ */ w("option", {
481
- value: "pickup",
482
- children: "Pickup"
483
- }),
484
- /* @__PURE__ */ w("option", {
485
- value: "preparation",
486
- children: "Preparation"
487
- })
488
- ]
489
- }),
490
- /* @__PURE__ */ T("select", {
491
- value: F.priority,
492
- onChange: (e) => V("priority", e.target.value),
493
- className: "w-full rounded-md border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-status-info-border",
494
- children: [
495
- /* @__PURE__ */ w("option", {
496
- value: "",
497
- children: "All Priorities"
498
- }),
499
- /* @__PURE__ */ w("option", {
500
- value: "urgent",
501
- children: "Urgent"
502
- }),
503
- /* @__PURE__ */ w("option", {
504
- value: "high",
505
- children: "High"
506
- }),
507
- /* @__PURE__ */ w("option", {
508
- value: "medium",
509
- children: "Medium"
510
- }),
511
- /* @__PURE__ */ w("option", {
512
- value: "low",
513
- children: "Low"
514
- })
515
- ]
516
- }),
517
- /* @__PURE__ */ T("select", {
518
- value: F.sortBy,
519
- onChange: (e) => V("sortBy", e.target.value),
520
- className: "w-full rounded-md border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-status-info-border",
521
- children: [
522
- /* @__PURE__ */ w("option", {
523
- value: "priority",
524
- children: "Sort by Priority"
525
- }),
526
- /* @__PURE__ */ w("option", {
527
- value: "time",
528
- children: "Sort by Time"
529
- }),
530
- /* @__PURE__ */ w("option", {
531
- value: "distance",
532
- children: "Sort by Distance"
533
- })
534
- ]
535
- })
536
- ]
537
- })
538
- }),
539
- C.length === 0 ? /* @__PURE__ */ w(i, {
540
- illustration: "empty-data",
541
- icon: /* @__PURE__ */ w(p, { className: "h-12 w-12" }),
542
- title: "No tasks available",
543
- description: "Check back later for new tasks"
544
- }) : /* @__PURE__ */ w("div", {
545
- className: "space-y-3",
546
- children: C.map((e) => {
547
- let n = A(e.type), i = n.icon;
548
- return /* @__PURE__ */ T("div", {
549
- className: "rounded-lg border border-border-seam bg-bg-surface p-5 shadow-sm hover:shadow-md transition-shadow",
550
- children: [
551
- /* @__PURE__ */ T("div", {
552
- className: "flex items-center justify-between mb-3",
553
- children: [/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ T("div", {
554
- className: "flex items-center gap-2 flex-wrap",
555
- children: [
556
- /* @__PURE__ */ T("h3", {
557
- className: "text-sm font-semibold text-text-primary",
558
- children: ["Order #", e.orderId]
559
- }),
560
- /* @__PURE__ */ T("span", {
561
- className: t("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] font-medium", n.style),
562
- children: [/* @__PURE__ */ w(i, { className: "h-3 w-3" }), n.label]
563
- }),
564
- /* @__PURE__ */ w("span", {
565
- className: t("inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium capitalize", j(e.priority)),
566
- children: e.priority
567
- })
568
- ]
569
- }), /* @__PURE__ */ T("p", {
570
- className: "text-xs text-text-secondary mt-1",
571
- children: [
572
- e.cartName,
573
- " · ",
574
- e.customerName
575
- ]
576
- })] }), /* @__PURE__ */ T("div", {
577
- className: "text-right",
578
- children: [/* @__PURE__ */ w("p", {
579
- className: "text-lg font-bold text-text-primary",
580
- children: a(e.payment.amount, { minimumFractionDigits: 0 })
581
- }), /* @__PURE__ */ w("p", {
582
- className: t("text-xs", e.payment.status === "completed" ? "text-status-success-text" : "text-status-warning-text"),
583
- children: /* @__PURE__ */ T("span", {
584
- className: "flex items-center gap-1 justify-end",
585
- children: [/* @__PURE__ */ w(m, { className: "h-3 w-3" }), e.payment.status === "completed" ? "Paid" : "COD"]
586
- })
587
- })]
588
- })]
589
- }),
590
- /* @__PURE__ */ T("div", {
591
- className: "grid grid-cols-1 md:grid-cols-3 gap-3 mb-3 text-sm",
592
- children: [
593
- /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
594
- className: "text-xs text-text-secondary",
595
- children: "Items"
596
- }), /* @__PURE__ */ w("div", {
597
- className: "text-xs text-text-primary",
598
- children: e.items.map((t, n) => /* @__PURE__ */ T("span", { children: [
599
- t.quantity,
600
- "x ",
601
- t.name,
602
- n < e.items.length - 1 && ", "
603
- ] }, n))
604
- })] }),
605
- e.address && /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
606
- className: "text-xs text-text-secondary",
607
- children: "Delivery Address"
608
- }), /* @__PURE__ */ w("p", {
609
- className: "text-xs text-text-primary",
610
- children: e.address.addressLine1
611
- })] }),
612
- /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
613
- className: "text-xs text-text-secondary",
614
- children: "Time"
615
- }), /* @__PURE__ */ w("p", {
616
- className: t("text-xs font-medium", k(e.estimatedTime) === "Overdue" ? "text-status-error-text" : "text-text-primary"),
617
- children: k(e.estimatedTime)
618
- })] })
619
- ]
620
- }),
621
- e.status === "pending" && /* @__PURE__ */ T("div", {
622
- className: "flex items-center flex-wrap gap-2 border-t border-border-seam pt-3",
623
- children: [
624
- /* @__PURE__ */ T("button", {
625
- type: "button",
626
- onClick: () => H(e.id),
627
- disabled: N !== null,
628
- className: t("inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors", N === null ? "bg-status-info-bg-subtle text-status-info-text hover:bg-status-info-bg-subtle" : "bg-bg-sunken text-text-secondary cursor-not-allowed"),
629
- children: [/* @__PURE__ */ w(b, { className: "h-3.5 w-3.5" }), N ? "Complete current first" : "Start Task"]
630
- }),
631
- /* @__PURE__ */ T("button", {
632
- type: "button",
633
- onClick: () => W(e.customerPhone),
634
- 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",
635
- children: [/* @__PURE__ */ w(y, { className: "h-3.5 w-3.5" }), "Call"]
636
- }),
637
- e.type === "delivery" && e.distance != null && /* @__PURE__ */ T("span", {
638
- className: "ml-auto text-xs text-text-secondary flex items-center gap-1",
639
- children: [
640
- /* @__PURE__ */ w(g, { className: "h-3 w-3" }),
641
- e.distance,
642
- " km away"
643
- ]
644
- })
645
- ]
646
- }),
647
- e.status === "in_progress" && e.id !== N?.id && /* @__PURE__ */ T("div", {
648
- className: "flex items-center gap-2 border-t border-border-seam pt-3",
649
- children: [/* @__PURE__ */ T("button", {
650
- type: "button",
651
- onClick: () => U(e.id),
652
- className: "inline-flex items-center gap-1.5 rounded-md bg-status-success-bg-subtle px-3 py-1.5 text-xs font-medium text-status-success-text hover:bg-status-success-bg-subtle transition-colors",
653
- children: [/* @__PURE__ */ w(d, { className: "h-3.5 w-3.5" }), "Complete"]
654
- }), /* @__PURE__ */ T("button", {
655
- type: "button",
656
- onClick: () => f(`/worker/task/${e.id}`),
657
- 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",
658
- children: ["Details", /* @__PURE__ */ w(u, { className: "h-3.5 w-3.5" })]
659
- })]
660
- }),
661
- e.status === "completed" && /* @__PURE__ */ T("div", {
662
- className: "flex items-center gap-2 border-t border-border-seam pt-3",
663
- children: [/* @__PURE__ */ w(r, { status: "completed" }), /* @__PURE__ */ T("button", {
664
- type: "button",
665
- onClick: () => f(`/worker/task/${e.id}`),
666
- className: "ml-auto 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",
667
- children: ["Details", /* @__PURE__ */ w(u, { className: "h-3.5 w-3.5" })]
668
- })]
669
- })
670
- ]
671
- }, e.id);
672
- })
673
- })
674
- ]
675
- })
676
- });
677
- };
678
- //#endregion
679
- export { M as WorkerOrdersPage };
680
-
681
- //# sourceMappingURL=WorkerOrdersPage.js.map