@argusoft/medplat-app-shell 1.0.0

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.
@@ -0,0 +1,829 @@
1
+ import { jsxs as i, jsx as t } from "react/jsx-runtime";
2
+ import { useState as f, useEffect as Z, useRef as Qe, Suspense as Y, lazy as te } from "react";
3
+ import { G as B, u as Ve, H as Xe, M as Ke, a as Ze, A as et, C as tt, S as at, W as ot, Q as nt, g as st, r as rt, e as it, s as lt, b as dt, c as ee, d as Se, f as we } from "./index.lib-C7mD5d-r.js";
4
+ import { Typography as x, Chip as ct, IconButton as _e, Card as ft, Popover as ve } from "@mui/material";
5
+ import W from "@mui/material/Grid2";
6
+ import { Box as r } from "@mui/system";
7
+ import { saveAs as ht } from "file-saver";
8
+ import { useSelector as pt, useDispatch as mt } from "react-redux";
9
+ import * as A from "xlsx-js-style";
10
+ import { FontAwesomeIcon as G } from "@fortawesome/react-fontawesome";
11
+ import { faEllipsisVertical as Ce, faFileExcel as gt, faBars as ut } from "@fortawesome/free-solid-svg-icons";
12
+ import { useNavigate as xt } from "react-router";
13
+ import { useTheme as bt, alpha as o } from "@mui/material/styles";
14
+ const kt = te(() => import("./index.lib-C7mD5d-r.js").then((w) => w.l2)), Te = te(() => import("./index.lib-C7mD5d-r.js").then((w) => w.l3)), yt = te(() => import("./index.lib-C7mD5d-r.js").then((w) => w.l4)), At = () => {
15
+ var xe, be, ke;
16
+ const w = ["#dd4b39", "#00a65a", "#f39c12", "#00c0ef", "#333333", "#ffc90e"], [H, F] = f([]), [P, E] = f(!1), [j, We] = f(""), [_, J] = f([]), [T, Q] = f(null), [ae, Ie] = f(!1), [y, U] = f([]), [d, Ne] = f({}), [oe, Me] = f(!1), [ze, ne] = f(!0), [se, re] = f(!1), [I, V] = f({}), [O, ie] = f({}), [le, Be] = f([]), [L, Ae] = f({}), [Ee, Oe] = f([]), X = xt(), b = bt(), n = b.palette.mode === "dark", [$e, Re] = f([{ field: "index", label: "#", align: "left" }]), [De, de] = f(!1), [ce, He] = f(null), { user: v } = pt((e) => e.Authenticate), Fe = mt();
17
+ B.getEnv();
18
+ const K = async (e) => {
19
+ await lt([e]), await $(d);
20
+ }, fe = async () => {
21
+ var l;
22
+ const { data: e } = await st(), { data: s } = await rt({ userId: v == null ? void 0 : v.id });
23
+ s && V(s), (l = s == null ? void 0 : s.baskets) != null && l.length ? (F(e.filter((a) => !s.baskets.includes(a.id))), J(
24
+ e.filter((a) => s.baskets.includes(a.id)).map((a) => ({
25
+ ...a,
26
+ colorCode: a.colorCode || w[Math.floor(Math.random() * w.length)]
27
+ }))
28
+ )) : F(e);
29
+ };
30
+ Z(() => {
31
+ fe();
32
+ }, []);
33
+ const Pe = async (e) => {
34
+ Object.keys(I).length === 0 && (I.baskets = [], I.taskbar = "show");
35
+ const s = { ...I, baskets: [...I.baskets, e.id] };
36
+ V(s), await we({ preference: JSON.stringify(s), userId: v == null ? void 0 : v.id }), J((l) => [...l, e]), F((l) => l.filter((a) => a.id !== e.id));
37
+ }, je = (e) => e.isActionRequired ? [
38
+ {
39
+ label: "",
40
+ icon: /* @__PURE__ */ t(G, { icon: ut, size: "lg", "data-testid": "webtaskslist-button-menu" }),
41
+ menuItems: [
42
+ {
43
+ label: e != null && e.url_name ? "Fill the form" : e != null && e.modal_name ? "Perform Actions" : "Actions",
44
+ onClick: () => {
45
+ if (e != null && e.url_name) {
46
+ const s = (h) => h == null ? void 0 : h.replace(/-([a-z])/g, (k, u) => u.toUpperCase()), l = e.url_name.match(/^(.*?)\((\{.*\})\)$/);
47
+ l || X("notfound");
48
+ let a = l[1].replace(/\./g, "/");
49
+ a = s(a);
50
+ try {
51
+ const h = JSON.parse(l[2].replace(/'/g, '"')), { id: k, queryParams: u, ...m } = h, g = k ? `${a}/${k}` : a;
52
+ let c = "";
53
+ u ? c = `queryParams=${encodeURIComponent(JSON.stringify(u))}` : Object.keys(m).length > 0 && (c = new URLSearchParams(m).toString());
54
+ const D = (c ? `/${g}?${c}` : `/${g}`).replace(/^\/?techo\//, "medplat/");
55
+ X(`/ui/${D}`);
56
+ } catch (h) {
57
+ console.error("Navigation Error:", h), X("notfound");
58
+ }
59
+ } else e != null && e.modal_name ? (We(e == null ? void 0 : e.modal_name), E(!0), ie({
60
+ ...le.find((s) => s.taskId === e.taskId),
61
+ title: d.name
62
+ })) : (ie({
63
+ ...le.find((s) => s.taskId === e.taskId),
64
+ title: d.name
65
+ }), re(!0));
66
+ }
67
+ }
68
+ ].filter(Boolean)
69
+ // Filter out null/false items
70
+ }
71
+ ] : [], he = () => Me(!oe), $ = async (e) => {
72
+ Fe(dt(e.name)), Ne(e);
73
+ const { id: s, isLocationBasedFilterRequired: l } = e;
74
+ Ie(l);
75
+ const { data: a } = await ee(
76
+ { limit: 100, offset: 0, taskTypeId: s }
77
+ ).catch((c) => (console.error("🚀 ~ getWebTasksDetails ~ error:", c), Se({ message: "Unable to retrieve task details", type: "error" }), U([]), null));
78
+ ne(() => a.length && a.length === 100), Be(a), U(
79
+ a.map((c, C) => {
80
+ const { details: D, taskId: z, ...N } = c;
81
+ return { index: C + 1, ...D, taskId: z, ...N };
82
+ })
83
+ );
84
+ const h = ["modal_name", "url_name", "id", "widgetMessage"], u = Object.keys(a[0].details).filter((c) => !h.includes(c)).map((c) => ({
85
+ field: c,
86
+ label: c,
87
+ align: "left",
88
+ render: (C) => /* @__PURE__ */ t("div", { className: "w-48 h-full flex items-center h-full", children: /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: C == null ? void 0 : C[c] } }) })
89
+ })), m = a.some((c) => c.isActionRequired), g = [{ field: "index", label: "#", align: "left" }, ...u];
90
+ m && g.push({
91
+ field: "Actions",
92
+ label: "Actions",
93
+ align: "left"
94
+ }), Re(g), de(!0);
95
+ }, Ue = async (e, s) => {
96
+ try {
97
+ const l = e.map((z, N) => ({ "#": N + 1, ...z })), a = /* @__PURE__ */ new Date(), h = a.getMonth() + 1, k = `${d.name}-${a.getDate()}/${h} ${a.getHours()}:${a.getMinutes()} ${a.getFullYear().toString().slice(-2)}`, u = A.utils.json_to_sheet(l), m = {
98
+ font: { bold: !0 },
99
+ alignment: { horizontal: "center" }
100
+ };
101
+ if (l.length > 0) {
102
+ const z = A.utils.decode_range(u["!ref"]);
103
+ for (let N = z.s.c; N <= z.e.c; ++N) {
104
+ const ye = u[A.utils.encode_cell({ r: 0, c: N })];
105
+ ye && (ye.s = m);
106
+ }
107
+ }
108
+ const g = A.utils.book_new();
109
+ A.utils.book_append_sheet(g, u, "Sheet1");
110
+ const c = A.write(g, { bookType: "xlsx", type: "array" }), C = new Blob([c], {
111
+ type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
112
+ }), D = (C.size / (1024 * 1024)).toFixed(2);
113
+ ht(C, `${k}.xlsx`), me("file_download", {
114
+ file_type: "excel",
115
+ file_name: `${k}.xlsx`,
116
+ file_size: `${D} MB`,
117
+ filter_parameters: {
118
+ location_id: s || null,
119
+ taskTypeId: d.id
120
+ },
121
+ download_status: "success"
122
+ });
123
+ } catch (l) {
124
+ console.error("Error generating Excel file:", l), Se({ message: "Error generating Excel file", type: "error" });
125
+ }
126
+ }, Le = async () => {
127
+ var h, k;
128
+ const e = (k = (h = L == null ? void 0 : L.finalSelected) == null ? void 0 : h.optionSelected) == null ? void 0 : k.id, s = {
129
+ limit: null,
130
+ offset: 0,
131
+ taskTypeId: d.id
132
+ };
133
+ e && (s.locationId = e);
134
+ const { data: l } = await ee(s);
135
+ let a = [];
136
+ l && l.length > 0 && (a = l.map((u) => {
137
+ const m = { ...u.details };
138
+ return Object.keys(m).forEach((g) => {
139
+ m[g] === null ? m[g] = "" : typeof m[g] == "boolean" && (m[g] = m[g] ? "Yes" : "No");
140
+ }), m;
141
+ })), Ue(a, e);
142
+ }, S = Qe(null);
143
+ Z(() => {
144
+ S.current = y;
145
+ }, [y]);
146
+ const qe = async (e) => {
147
+ var s, l;
148
+ if (((s = S == null ? void 0 : S.current) == null ? void 0 : s.length) >= 100) {
149
+ const { data: a } = await ee(
150
+ {
151
+ limit: 100,
152
+ offset: (l = S == null ? void 0 : S.current) == null ? void 0 : l.length,
153
+ taskTypeId: e.id
154
+ }
155
+ );
156
+ a && (ne(() => a.length && a.length === 100), U([
157
+ ...S.current,
158
+ ...a.map((h, k) => {
159
+ var c;
160
+ const { details: u, taskId: m, ...g } = h;
161
+ return { index: ((c = S == null ? void 0 : S.current) == null ? void 0 : c.length) + k + 1, ...u, taskId: m, ...g };
162
+ })
163
+ ]));
164
+ }
165
+ }, Ye = async () => {
166
+ var e, s;
167
+ try {
168
+ if (H.some((a) => a.code === "TOTAL_AMOUNT_EARNED_BY_CHES")) {
169
+ const a = await it({
170
+ code: "TOTAL_AMOUNT_EARNED_BY_CHES_QUERY",
171
+ paramerter: {
172
+ locationId: null
173
+ }
174
+ });
175
+ a != null && a.data && He(((s = (e = a.data) == null ? void 0 : e.result) == null ? void 0 : s[0]["Grand Total Amount"]) || null);
176
+ }
177
+ } catch (l) {
178
+ console.error("Error in getting total amount earned:", l);
179
+ }
180
+ };
181
+ Z(() => {
182
+ Ye();
183
+ }, [H]);
184
+ const pe = async (e) => {
185
+ const s = I.baskets.filter((a) => a !== e.id), l = { ...I, baskets: s };
186
+ V(l), await we({ preference: JSON.stringify(l), userId: v == null ? void 0 : v.id }), J((a) => a.filter((h) => h.id !== e.id)), F((a) => [...a, e]);
187
+ }, me = Ve(), q = () => {
188
+ me("button_click", {
189
+ button_name: "hide taskbar",
190
+ button_type: "navigate",
191
+ button_id: "taskbar-hide-button"
192
+ }), Q(null);
193
+ }, Ge = async (e) => {
194
+ re(!1), e && fe();
195
+ }, Je = _.reduce((e, s) => e + (s.count || 0), 0), ge = [...H].sort((e, s) => e.orderNo === null ? 1 : s.orderNo === null ? -1 : e.orderNo - s.orderNo), p = (d == null ? void 0 : d.colorCode) || (n ? "#4da8da" : "#1c6fb7"), ue = ((xe = b.palette.custom) == null ? void 0 : xe.shellBorder) || o("#0f172a", 0.12), R = {
196
+ borderRadius: "24px",
197
+ border: `1px solid ${ue}`,
198
+ background: n ? b.palette.background.paper : "rgba(255,255,255,0.84)",
199
+ boxShadow: n ? "0 18px 36px rgba(0,0,0,0.3)" : "0 14px 30px rgba(148, 163, 184, 0.12)",
200
+ backdropFilter: "blur(14px)"
201
+ }, M = n ? o("#fff", 0.62) : "#6d8298";
202
+ return /* @__PURE__ */ i(
203
+ W,
204
+ {
205
+ container: !0,
206
+ spacing: 2,
207
+ className: "w-full m-0",
208
+ sx: {
209
+ position: "relative",
210
+ px: { xs: 0.25, md: 0.75 },
211
+ pb: 2.5
212
+ },
213
+ children: [
214
+ j === "health_workers_incorrect_details_modal" && /* @__PURE__ */ t(
215
+ Xe,
216
+ {
217
+ open: P,
218
+ onClose: () => {
219
+ E(!1);
220
+ },
221
+ task: O,
222
+ onSave: async (e) => await K(e)
223
+ }
224
+ ),
225
+ j === "maternal_death_verification_modal_mo" && /* @__PURE__ */ t(
226
+ Ke,
227
+ {
228
+ open: P,
229
+ onClose: () => {
230
+ E(!1);
231
+ },
232
+ task: O,
233
+ onSave: async (e) => await K(e)
234
+ }
235
+ ),
236
+ j === "cmtc_probable_confirmation_modal" && /* @__PURE__ */ t(
237
+ Ze,
238
+ {
239
+ open: P,
240
+ onClose: () => {
241
+ E(!1);
242
+ },
243
+ task: O,
244
+ onSave: async (e) => await K(e)
245
+ }
246
+ ),
247
+ j === "asha_data_quality_verification_modal" && /* @__PURE__ */ t(
248
+ et,
249
+ {
250
+ open: P,
251
+ onClose: () => {
252
+ E(!1);
253
+ },
254
+ task: O,
255
+ onSave: async () => await $(d)
256
+ }
257
+ ),
258
+ /* @__PURE__ */ t(Y, { children: se && /* @__PURE__ */ t(kt, { open: se, onClose: Ge, selectedTask: O }) }),
259
+ /* @__PURE__ */ t(W, { size: 12, children: /* @__PURE__ */ t(
260
+ r,
261
+ {
262
+ sx: {
263
+ ...R,
264
+ position: "relative",
265
+ overflow: "hidden",
266
+ mt: { xs: 0.5, md: 0.75 },
267
+ p: { xs: 1.75, md: 2.1 },
268
+ "&::before": {
269
+ content: '""',
270
+ position: "absolute",
271
+ inset: "auto auto -78px -62px",
272
+ width: 150,
273
+ height: 150,
274
+ borderRadius: "999px",
275
+ background: o(p, n ? 0.18 : 0.12),
276
+ filter: "blur(14px)"
277
+ },
278
+ "&::after": {
279
+ content: '""',
280
+ position: "absolute",
281
+ top: -86,
282
+ right: -22,
283
+ width: 130,
284
+ height: 130,
285
+ borderRadius: "999px",
286
+ background: o("#7dd3fc", n ? 0.08 : 0.07),
287
+ filter: "blur(16px)"
288
+ }
289
+ },
290
+ children: /* @__PURE__ */ i(
291
+ r,
292
+ {
293
+ sx: {
294
+ position: "relative",
295
+ zIndex: 1,
296
+ display: "flex",
297
+ alignItems: { xs: "flex-start", md: "center" },
298
+ justifyContent: "space-between",
299
+ gap: 2,
300
+ flexWrap: "wrap"
301
+ },
302
+ children: [
303
+ /* @__PURE__ */ i(r, { sx: { minWidth: 0 }, children: [
304
+ /* @__PURE__ */ t(
305
+ x,
306
+ {
307
+ variant: "h5",
308
+ sx: { fontWeight: 800, letterSpacing: "-0.03em", color: b.palette.text.primary },
309
+ children: "Dashboard"
310
+ }
311
+ ),
312
+ /* @__PURE__ */ t(
313
+ x,
314
+ {
315
+ sx: {
316
+ mt: 0.45,
317
+ maxWidth: 560,
318
+ color: M,
319
+ lineHeight: 1.5
320
+ },
321
+ children: "Pick a basket and the related tasks appear here. The page stays intentionally light so the work is easy to scan."
322
+ }
323
+ )
324
+ ] }),
325
+ /* @__PURE__ */ i(r, { className: "flex flex-wrap gap-2", sx: { alignItems: "center" }, children: [
326
+ /* @__PURE__ */ i(
327
+ r,
328
+ {
329
+ sx: {
330
+ px: 1.25,
331
+ py: 0.65,
332
+ borderRadius: "999px",
333
+ background: n ? o("#fff", 0.08) : o("#0f172a", 0.05),
334
+ color: n ? o("#fff", 0.86) : "#38506c",
335
+ fontSize: "0.78rem",
336
+ fontWeight: 700
337
+ },
338
+ children: [
339
+ H.length,
340
+ " baskets"
341
+ ]
342
+ }
343
+ ),
344
+ !B.isBahaar && /* @__PURE__ */ i(
345
+ r,
346
+ {
347
+ sx: {
348
+ px: 1.25,
349
+ py: 0.65,
350
+ borderRadius: "999px",
351
+ background: o(p, n ? 0.18 : 0.12),
352
+ color: n ? "#dbeafe" : p,
353
+ fontSize: "0.78rem",
354
+ fontWeight: 700
355
+ },
356
+ children: [
357
+ _.length,
358
+ " hidden"
359
+ ]
360
+ }
361
+ ),
362
+ /* @__PURE__ */ t(
363
+ r,
364
+ {
365
+ sx: {
366
+ px: 1.25,
367
+ py: 0.65,
368
+ borderRadius: "999px",
369
+ background: n ? o("#fff", 0.08) : o("#ffffff", 0.78),
370
+ color: n ? "#e2e8f0" : "#38506c",
371
+ fontSize: "0.78rem",
372
+ fontWeight: 700,
373
+ maxWidth: { xs: "100%", sm: 240 },
374
+ overflow: "hidden",
375
+ textOverflow: "ellipsis",
376
+ whiteSpace: "nowrap"
377
+ },
378
+ children: d != null && d.name ? d.name : "No basket selected"
379
+ }
380
+ )
381
+ ] })
382
+ ]
383
+ }
384
+ )
385
+ }
386
+ ) }),
387
+ /* @__PURE__ */ t(W, { size: { xs: 12, lg: B.isBahaar ? 12 : 9 }, children: /* @__PURE__ */ i(
388
+ r,
389
+ {
390
+ sx: {
391
+ ...R,
392
+ p: { xs: 1.75, md: 2.25 }
393
+ },
394
+ children: [
395
+ /* @__PURE__ */ i(r, { className: "flex items-start justify-between gap-4 flex-wrap", children: [
396
+ /* @__PURE__ */ i(r, { sx: { display: "flex", alignItems: "center", gap: 3 }, children: [
397
+ /* @__PURE__ */ i(r, { children: [
398
+ /* @__PURE__ */ t(x, { variant: "h6", sx: { fontWeight: 800, color: b.palette.text.primary }, children: "Workflow baskets" }),
399
+ /* @__PURE__ */ t(x, { sx: { mt: 0.4, color: M }, children: "Select a basket to load its task list." })
400
+ ] }),
401
+ ce && /* @__PURE__ */ t(
402
+ ct,
403
+ {
404
+ label: /* @__PURE__ */ i("span", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
405
+ /* @__PURE__ */ t("span", { style: { fontWeight: 900 }, children: "Total Earnings:" }),
406
+ /* @__PURE__ */ i("span", { style: { fontWeight: 600, letterSpacing: "0.5px" }, children: [
407
+ "₹ ",
408
+ ce
409
+ ] })
410
+ ] }),
411
+ sx: {
412
+ fontSize: "0.85rem",
413
+ px: 0.5,
414
+ py: 2,
415
+ borderRadius: "12px",
416
+ backgroundColor: n ? o("#10b981", 0.15) : o("#10b981", 0.1),
417
+ color: n ? "#34d399" : "#059669",
418
+ border: "1px solid",
419
+ borderColor: n ? o("#10b981", 0.3) : o("#10b981", 0.4),
420
+ boxShadow: "0 2px 8px rgba(16, 185, 129, 0.15)"
421
+ }
422
+ }
423
+ )
424
+ ] }),
425
+ /* @__PURE__ */ i(r, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
426
+ /* @__PURE__ */ i(
427
+ r,
428
+ {
429
+ sx: {
430
+ px: 1.3,
431
+ py: 0.65,
432
+ borderRadius: "999px",
433
+ background: n ? o("#fff", 0.08) : o("#0f172a", 0.05),
434
+ color: n ? o("#fff", 0.82) : "#38506c",
435
+ fontSize: "0.78rem",
436
+ fontWeight: 700
437
+ },
438
+ children: [
439
+ ge.length,
440
+ " available"
441
+ ]
442
+ }
443
+ ),
444
+ B.isBahaar && /* @__PURE__ */ t(
445
+ _e,
446
+ {
447
+ onClick: (e) => Q(e.currentTarget),
448
+ sx: {
449
+ width: 34,
450
+ height: 34,
451
+ background: n ? o("#fff", 0.08) : o(p, 0.1)
452
+ },
453
+ "data-testid": "bahaar-manage-tray-button",
454
+ children: /* @__PURE__ */ t(G, { icon: Ce, className: n ? "text-white" : "text-slate-700" })
455
+ }
456
+ )
457
+ ] })
458
+ ] }),
459
+ /* @__PURE__ */ t(W, { container: !0, spacing: 1.5, className: "mt-2", children: ge.map((e) => (e.colorCode = e.colorCode || w[Math.floor(Math.random() * w.length)], /* @__PURE__ */ t(Y, { children: /* @__PURE__ */ t(W, { item: !0, size: { xs: 12, sm: 6, md: 4, xl: 3 }, children: /* @__PURE__ */ t(
460
+ yt,
461
+ {
462
+ widgetData: e,
463
+ hidden: !1,
464
+ isSelected: e.id === (d == null ? void 0 : d.id),
465
+ onClick: () => $(e),
466
+ onArrowClick: () => Pe(e),
467
+ dataTestId: "Dashboard-Widget-Card"
468
+ }
469
+ ) }) }, e.id))) })
470
+ ]
471
+ }
472
+ ) }),
473
+ !B.isBahaar && /* @__PURE__ */ i(W, { size: { xs: 12, lg: 3 }, children: [
474
+ /* @__PURE__ */ i(
475
+ ft,
476
+ {
477
+ sx: {
478
+ ...R,
479
+ borderRadius: "24px",
480
+ overflow: "hidden",
481
+ background: n ? b.palette.background.paper : "linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(246,249,255,0.98) 100%)"
482
+ },
483
+ "data-testid": "taskbar-widget-card",
484
+ onClick: (e) => Q(e.currentTarget),
485
+ children: [
486
+ /* @__PURE__ */ i(r, { sx: { p: 2 }, children: [
487
+ /* @__PURE__ */ i(r, { className: "flex items-start justify-between gap-3", children: [
488
+ /* @__PURE__ */ i(r, { children: [
489
+ /* @__PURE__ */ t(
490
+ x,
491
+ {
492
+ sx: { fontSize: "0.82rem", fontWeight: 800, color: n ? o("#fff", 0.7) : "#60768f" },
493
+ children: "Hidden basket tray"
494
+ }
495
+ ),
496
+ /* @__PURE__ */ t(
497
+ x,
498
+ {
499
+ "data-testid": "dashboard-hidden-count",
500
+ sx: { mt: 0.8, fontSize: "1.75rem", fontWeight: 800, color: b.palette.text.primary },
501
+ children: Je
502
+ }
503
+ )
504
+ ] }),
505
+ /* @__PURE__ */ i(
506
+ r,
507
+ {
508
+ sx: {
509
+ px: 1.1,
510
+ py: 0.55,
511
+ borderRadius: "999px",
512
+ background: n ? o("#fff", 0.08) : o(p, 0.08),
513
+ color: n ? o("#fff", 0.84) : "#38506c",
514
+ fontSize: "0.72rem",
515
+ fontWeight: 700
516
+ },
517
+ children: [
518
+ _.length,
519
+ " items"
520
+ ]
521
+ }
522
+ )
523
+ ] }),
524
+ /* @__PURE__ */ t(x, { sx: { mt: 0.5, color: M, lineHeight: 1.55 }, children: "Hidden baskets stay here until you need them again." }),
525
+ /* @__PURE__ */ i(r, { className: "flex flex-wrap gap-2 mt-3", children: [
526
+ _.slice(0, 2).map((e) => /* @__PURE__ */ t(
527
+ r,
528
+ {
529
+ sx: {
530
+ px: 1.2,
531
+ py: 0.6,
532
+ borderRadius: "999px",
533
+ background: n ? o("#fff", 0.08) : o(p, 0.08),
534
+ color: n ? o("#fff", 0.86) : "#38506c",
535
+ fontSize: "0.74rem",
536
+ maxWidth: "100%"
537
+ },
538
+ children: e.name
539
+ },
540
+ e.id
541
+ )),
542
+ _.length > 2 && /* @__PURE__ */ i(
543
+ r,
544
+ {
545
+ sx: {
546
+ px: 1.2,
547
+ py: 0.6,
548
+ borderRadius: "999px",
549
+ background: n ? o("#fff", 0.08) : o(p, 0.08),
550
+ color: n ? o("#fff", 0.86) : "#38506c",
551
+ fontSize: "0.74rem"
552
+ },
553
+ children: [
554
+ "+",
555
+ _.length - 2,
556
+ " more"
557
+ ]
558
+ }
559
+ ),
560
+ _.length === 0 && /* @__PURE__ */ t(
561
+ r,
562
+ {
563
+ sx: {
564
+ px: 1.2,
565
+ py: 0.6,
566
+ borderRadius: "999px",
567
+ background: n ? o("#fff", 0.06) : o("#0f172a", 0.05),
568
+ color: n ? o("#fff", 0.62) : "#72859c",
569
+ fontSize: "0.74rem"
570
+ },
571
+ children: "Nothing hidden right now"
572
+ }
573
+ )
574
+ ] })
575
+ ] }),
576
+ /* @__PURE__ */ i(
577
+ r,
578
+ {
579
+ sx: {
580
+ px: 2,
581
+ py: 1.05,
582
+ display: "flex",
583
+ alignItems: "center",
584
+ justifyContent: "space-between",
585
+ background: n ? o("#fff", 0.05) : o(p, 0.06),
586
+ borderTop: `1px solid ${ue}`
587
+ },
588
+ children: [
589
+ /* @__PURE__ */ t(x, { sx: { fontWeight: 700, color: b.palette.text.primary }, children: "Manage tray" }),
590
+ /* @__PURE__ */ t(
591
+ _e,
592
+ {
593
+ sx: {
594
+ width: 34,
595
+ height: 34,
596
+ background: n ? o("#fff", 0.08) : o(p, 0.1)
597
+ },
598
+ children: /* @__PURE__ */ t(G, { icon: Ce, className: n ? "text-white" : "text-slate-700" })
599
+ }
600
+ )
601
+ ]
602
+ }
603
+ )
604
+ ]
605
+ }
606
+ ),
607
+ /* @__PURE__ */ t(
608
+ ve,
609
+ {
610
+ id: T ? "simple-popover" : void 0,
611
+ open: !!T,
612
+ anchorEl: T,
613
+ onClose: q,
614
+ anchorOrigin: {
615
+ vertical: "bottom",
616
+ horizontal: "right"
617
+ },
618
+ transformOrigin: {
619
+ vertical: "top",
620
+ horizontal: "right"
621
+ },
622
+ slotProps: {
623
+ paper: {
624
+ style: {
625
+ width: "450px",
626
+ borderRadius: "24px",
627
+ overflow: "hidden"
628
+ }
629
+ }
630
+ },
631
+ children: /* @__PURE__ */ t(Y, { children: /* @__PURE__ */ t(
632
+ Te,
633
+ {
634
+ show: T,
635
+ hiddenWidgets: _,
636
+ handleHideTaskbar: q,
637
+ handleUnhideWidget: pe,
638
+ onWidgetClick: $
639
+ }
640
+ ) })
641
+ }
642
+ )
643
+ ] }),
644
+ B.isBahaar && /* @__PURE__ */ t(
645
+ ve,
646
+ {
647
+ id: T ? "bahaar-popover" : void 0,
648
+ open: !!T,
649
+ anchorEl: T,
650
+ onClose: q,
651
+ anchorOrigin: {
652
+ vertical: "bottom",
653
+ horizontal: "right"
654
+ },
655
+ transformOrigin: {
656
+ vertical: "top",
657
+ horizontal: "right"
658
+ },
659
+ slotProps: {
660
+ paper: {
661
+ style: {
662
+ width: "450px",
663
+ borderRadius: "24px",
664
+ overflow: "hidden"
665
+ }
666
+ }
667
+ },
668
+ children: /* @__PURE__ */ t(Y, { children: /* @__PURE__ */ t(
669
+ Te,
670
+ {
671
+ show: T,
672
+ hiddenWidgets: _,
673
+ handleHideTaskbar: q,
674
+ handleUnhideWidget: pe,
675
+ onWidgetClick: $
676
+ }
677
+ ) })
678
+ }
679
+ ),
680
+ /* @__PURE__ */ t(W, { size: 12, children: /* @__PURE__ */ i(
681
+ r,
682
+ {
683
+ sx: {
684
+ ...R,
685
+ p: { xs: 1.75, md: 2.25 }
686
+ },
687
+ children: [
688
+ /* @__PURE__ */ i(r, { className: "flex items-start justify-between gap-4 flex-wrap", children: [
689
+ /* @__PURE__ */ i(r, { children: [
690
+ /* @__PURE__ */ t(x, { variant: "h6", sx: { fontWeight: 800, color: b.palette.text.primary }, children: (d == null ? void 0 : d.name) || "Task workspace" }),
691
+ /* @__PURE__ */ t(x, { sx: { mt: 0.4, color: M }, children: "Review tasks, act on pending work, and export when needed." })
692
+ ] }),
693
+ /* @__PURE__ */ i(r, { className: "flex items-center gap-3 flex-wrap", children: [
694
+ ae && /* @__PURE__ */ t(
695
+ "button",
696
+ {
697
+ onClick: he,
698
+ className: "cursor-pointer px-4 py-2 rounded-xl transition-all text-sm font-bold",
699
+ style: {
700
+ background: n ? o("#fff", 0.08) : o(p, 0.08),
701
+ color: n ? "#f8fafc" : p,
702
+ border: `1px solid ${o(p, 0.22)}`
703
+ },
704
+ children: "Filters"
705
+ }
706
+ ),
707
+ y.length > 0 && /* @__PURE__ */ i(
708
+ "button",
709
+ {
710
+ onClick: Le,
711
+ className: "cursor-pointer px-4 py-2 rounded-xl transition-all flex items-center gap-2 text-sm font-black",
712
+ style: {
713
+ background: `linear-gradient(135deg, ${p} 0%, ${n ? "#245c89" : "#0f4f8a"} 100%)`,
714
+ color: "#ffffff",
715
+ boxShadow: n ? "0 14px 28px rgba(2, 8, 23, 0.3)" : "0 14px 30px rgba(28, 111, 183, 0.22)"
716
+ },
717
+ "data-testid": "dashboard-webtaskslist-icon-pdf",
718
+ children: [
719
+ /* @__PURE__ */ t(G, { icon: gt, className: "mr-1" }),
720
+ "Export Excel"
721
+ ]
722
+ }
723
+ )
724
+ ] })
725
+ ] }),
726
+ ((be = y == null ? void 0 : y[0]) == null ? void 0 : be.widgetMessage) && /* @__PURE__ */ t(
727
+ r,
728
+ {
729
+ sx: {
730
+ mt: 2,
731
+ px: 1.35,
732
+ py: 1.1,
733
+ borderRadius: "16px",
734
+ background: n ? o("#fff", 0.06) : o(p, 0.06),
735
+ color: b.palette.text.primary
736
+ },
737
+ children: /* @__PURE__ */ t(
738
+ "div",
739
+ {
740
+ dangerouslySetInnerHTML: {
741
+ __html: (ke = y == null ? void 0 : y[0]) == null ? void 0 : ke.widgetMessage
742
+ }
743
+ }
744
+ )
745
+ }
746
+ ),
747
+ y.length > 0 ? /* @__PURE__ */ t(r, { sx: { mt: 2 }, children: /* @__PURE__ */ t(
748
+ tt,
749
+ {
750
+ columns: $e,
751
+ tableData: y,
752
+ actions: je,
753
+ paginationConfig: {
754
+ pagination: !0,
755
+ paginationType: "infinite-scroll",
756
+ hasMore: ze,
757
+ loadMore: () => qe(d)
758
+ },
759
+ styleConfig: { tableStyle: { maxHeight: 80 } },
760
+ scrollToTop: De,
761
+ setScrollToTop: de,
762
+ dataTestId: "widgetlist-table-customized"
763
+ }
764
+ ) }) : /* @__PURE__ */ i(
765
+ r,
766
+ {
767
+ sx: {
768
+ mt: 2,
769
+ borderRadius: "20px",
770
+ p: { xs: 2.25, md: 3.25 },
771
+ textAlign: "center",
772
+ border: `1px dashed ${o(p, 0.28)}`,
773
+ background: n ? o("#fff", 0.03) : o(p, 0.04)
774
+ },
775
+ children: [
776
+ /* @__PURE__ */ t(x, { sx: { fontSize: "1.05rem", fontWeight: 700, color: b.palette.text.primary }, children: "Select a basket to open the task table" }),
777
+ /* @__PURE__ */ t(x, { sx: { mt: 0.65, color: M }, children: "Task rows, filters, actions, and export controls will appear here." })
778
+ ]
779
+ }
780
+ )
781
+ ]
782
+ }
783
+ ) }),
784
+ ae && /* @__PURE__ */ t(
785
+ at,
786
+ {
787
+ title: "Filter",
788
+ showSideBarTitle: !1,
789
+ FormBody: ot,
790
+ handleOverlayState: he,
791
+ overlayOpen: oe,
792
+ dataTestId: "dashboard-webtasks-overlay-filter",
793
+ formProps: {
794
+ setWebTasksData: U,
795
+ selectedWidgetData: d,
796
+ locations: Ee,
797
+ setLocations: Oe,
798
+ selectedLocation: L,
799
+ setSelectedLocation: Ae
800
+ }
801
+ }
802
+ ),
803
+ /* @__PURE__ */ t(W, { size: 12, children: /* @__PURE__ */ i(
804
+ r,
805
+ {
806
+ sx: {
807
+ ...R,
808
+ px: { xs: 1, md: 1.5 },
809
+ py: { xs: 1.1, md: 1.35 },
810
+ background: n ? b.palette.background.paper : "rgba(255,255,255,0.72)",
811
+ boxShadow: "none"
812
+ },
813
+ children: [
814
+ /* @__PURE__ */ t(r, { className: "flex items-center justify-between gap-3 flex-wrap px-3 pt-1", children: /* @__PURE__ */ i(r, { children: [
815
+ /* @__PURE__ */ t(x, { sx: { fontWeight: 800, color: b.palette.text.primary }, children: "Quick links" }),
816
+ /* @__PURE__ */ t(x, { sx: { mt: 0.35, color: M }, children: "Your frequent destinations, kept close." })
817
+ ] }) }),
818
+ /* @__PURE__ */ t(nt, {})
819
+ ]
820
+ }
821
+ ) })
822
+ ]
823
+ }
824
+ );
825
+ };
826
+ export {
827
+ At as default
828
+ };
829
+ //# sourceMappingURL=DashboardUI-DFb9Rl9J.js.map