amp-workflow-ui 0.1.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.
package/dist/index.js ADDED
@@ -0,0 +1,695 @@
1
+ 'use strict';
2
+
3
+ var React2 = require('react');
4
+ var jsxRuntime = require('react/jsx-runtime');
5
+ var Button2 = require('@mui/material/Button');
6
+ var Dialog = require('@mui/material/Dialog');
7
+ var styles = require('@mui/material/styles');
8
+ var useMediaQuery = require('@mui/material/useMediaQuery');
9
+ var DialogActions = require('@mui/material/DialogActions');
10
+ var DialogContent = require('@mui/material/DialogContent');
11
+ var material = require('@mui/material');
12
+ var HighlightOffIcon = require('@mui/icons-material/HighlightOff');
13
+ var system = require('@mui/system');
14
+ var moment = require('moment');
15
+
16
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
17
+
18
+ var React2__default = /*#__PURE__*/_interopDefault(React2);
19
+ var Button2__default = /*#__PURE__*/_interopDefault(Button2);
20
+ var Dialog__default = /*#__PURE__*/_interopDefault(Dialog);
21
+ var useMediaQuery__default = /*#__PURE__*/_interopDefault(useMediaQuery);
22
+ var DialogActions__default = /*#__PURE__*/_interopDefault(DialogActions);
23
+ var DialogContent__default = /*#__PURE__*/_interopDefault(DialogContent);
24
+ var HighlightOffIcon__default = /*#__PURE__*/_interopDefault(HighlightOffIcon);
25
+ var moment__default = /*#__PURE__*/_interopDefault(moment);
26
+
27
+ // src/context.tsx
28
+ var WorkflowContext = React2.createContext(null);
29
+ function WorkflowProvider({
30
+ value,
31
+ children
32
+ }) {
33
+ return /* @__PURE__ */ jsxRuntime.jsx(WorkflowContext.Provider, { value, children });
34
+ }
35
+ function useWorkflowContext() {
36
+ const ctx = React2.useContext(WorkflowContext);
37
+ if (!ctx) {
38
+ throw new Error("useWorkflowContext must be used within WorkflowProvider");
39
+ }
40
+ return ctx;
41
+ }
42
+ var StyledChipProps = material.styled(material.Chip)(({ theme }) => {
43
+ var _a, _b, _c, _d, _e, _f, _g;
44
+ return {
45
+ "&.MuiChip-colorPrimary": {
46
+ border: `1px solid ${theme.palette.primary.dark}`,
47
+ borderRadius: "8px",
48
+ height: "36px",
49
+ padding: "6px 4px",
50
+ background: `${(_b = (_a = theme.palette.customColors) == null ? void 0 : _a.customChipBackgroundColor) != null ? _b : "rgba(25,118,210,0.1)"}`,
51
+ color: `${(_d = (_c = theme.palette.customColors) == null ? void 0 : _c.customChipColor) != null ? _d : theme.palette.primary.dark}`,
52
+ width: "170px",
53
+ overflow: "hidden",
54
+ whiteSpace: "nowrap",
55
+ textOverflow: "ellipsis"
56
+ },
57
+ "&.MuiChip-colorDefault": {
58
+ border: `1px solid ${theme.palette.grey[300]} !important`,
59
+ borderRadius: "8px",
60
+ height: "36px",
61
+ padding: "6px 4px",
62
+ background: "none !important",
63
+ color: `${(_g = (_f = (_e = theme.palette) == null ? void 0 : _e.customColors) == null ? void 0 : _f.mainText) != null ? _g : theme.palette.text.primary} `,
64
+ width: "170px",
65
+ overflow: "hidden",
66
+ whiteSpace: "nowrap",
67
+ textOverflow: "ellipsis"
68
+ }
69
+ };
70
+ });
71
+ var TruncatedTypography = material.styled(material.Typography)(({ theme }) => ({
72
+ overflow: "hidden",
73
+ textOverflow: "ellipsis",
74
+ whiteSpace: "nowrap",
75
+ width: "200px",
76
+ [theme.breakpoints.down("sm")]: {
77
+ width: "80px"
78
+ }
79
+ }));
80
+ function ApprovalWorkflow({
81
+ selectedWorkflowsList = [],
82
+ userInfo
83
+ }) {
84
+ const theme = material.useTheme();
85
+ const { api, urlBuilder, loadingComponent } = useWorkflowContext();
86
+ const [selectedApprovalOtions, setSelectedApprovalOtions] = React2.useState(
87
+ selectedWorkflowsList.length ? "selected" : "Action Required"
88
+ );
89
+ const [expandedId, setExpandedId] = React2.useState(null);
90
+ const [sendDialog, setSendDialog] = React2__default.default.useState(null);
91
+ const [approveDialog, setApproveDialog] = React2__default.default.useState(null);
92
+ const [rejectDialog, setRejectDialog] = React2__default.default.useState(null);
93
+ const [onHoldDialog, setOnHoldDialog] = React2__default.default.useState(null);
94
+ const [expandedDetails, setExpandedDetails] = React2.useState([]);
95
+ const [statusCount, setStatusCount] = React2.useState({});
96
+ const [urlConfig, setUrlConfig] = React2.useState({});
97
+ const [allRequestArray, setAllRequestArray] = React2.useState([]);
98
+ const [pendingRequestArray, setPendingRequestArray] = React2.useState([]);
99
+ const [selectedRequestArray, setSelectedRequestArray] = React2.useState([]);
100
+ const [isLoading, setIsLoading] = React2.useState(false);
101
+ const handleProfileToggle = (option) => {
102
+ setSelectedApprovalOtions(option);
103
+ if (option === "Action Required") fetchPendingActivities();
104
+ if (option === "All Requests") fetchAllActivites();
105
+ if (option === "selected") fetchSelectedActivites();
106
+ };
107
+ const handleExpandClick = (id) => {
108
+ setExpandedId((prevId) => prevId === id ? null : id);
109
+ fetchExpandedActivityLogs(id);
110
+ };
111
+ const getStatus = (status) => {
112
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
113
+ switch (status) {
114
+ case "approved":
115
+ return {
116
+ title: "Approved",
117
+ color: theme.palette.success.light,
118
+ labelColor: theme.palette.success.main
119
+ };
120
+ case "rejected":
121
+ return {
122
+ title: "Rejected",
123
+ color: (_c = (_b = (_a = theme.palette) == null ? void 0 : _a.customColors) == null ? void 0 : _b.chipWarningContainer) != null ? _c : theme.palette.error.light,
124
+ labelColor: theme.palette.error.main
125
+ };
126
+ case "onhold":
127
+ return {
128
+ title: "On Hold",
129
+ color: (_f = (_e = (_d = theme.palette) == null ? void 0 : _d.customColors) == null ? void 0 : _e.chipPendingContainer) != null ? _f : theme.palette.warning.light,
130
+ labelColor: (_i = (_h = (_g = theme.palette) == null ? void 0 : _g.customColors) == null ? void 0 : _h.chipPendingText) != null ? _i : theme.palette.warning.main
131
+ };
132
+ case "pending":
133
+ default:
134
+ return {
135
+ title: "Pending",
136
+ color: (_l = (_k = (_j = theme.palette) == null ? void 0 : _j.customColors) == null ? void 0 : _k.approvalPrimaryChipBG) != null ? _l : theme.palette.info.light,
137
+ labelColor: (_o = (_n = (_m = theme.palette) == null ? void 0 : _m.customColors) == null ? void 0 : _n.approvalPrimaryChipText) != null ? _o : theme.palette.info.main
138
+ };
139
+ }
140
+ };
141
+ const approvalChipLabel = [
142
+ { label: "Action Required", icon: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "icon-document-forward" }), count: (statusCount == null ? void 0 : statusCount.pending_activities_count) || "" },
143
+ { label: "All Requests", icon: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "icon-document-copy" }), count: (statusCount == null ? void 0 : statusCount.total_activities_count) || "" }
144
+ ];
145
+ const fetchExpandedActivityLogs = (workflowLogId) => {
146
+ setExpandedDetails([]);
147
+ api.get({ url: `/workflow/workflow-activity-logs/${workflowLogId}`, serviceURL: "api" }).then((res) => setExpandedDetails(res == null ? void 0 : res.data));
148
+ };
149
+ const fetchPendingActivities = () => {
150
+ var _a;
151
+ setIsLoading(true);
152
+ api.get({ url: `/workflow/activity-workflow/${(_a = userInfo == null ? void 0 : userInfo.userInfo) == null ? void 0 : _a.id}?paginate=false&type=pending`, serviceURL: "api" }).then((res) => {
153
+ var _a2;
154
+ return setPendingRequestArray((_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.activities);
155
+ }).finally(() => setIsLoading(false));
156
+ };
157
+ const fetchAllActivites = () => {
158
+ var _a;
159
+ setIsLoading(true);
160
+ api.get({ url: `/workflow/activity-workflow/${(_a = userInfo == null ? void 0 : userInfo.userInfo) == null ? void 0 : _a.id}?paginate=false`, serviceURL: "api" }).then((res) => {
161
+ var _a2;
162
+ return setAllRequestArray((_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.activities);
163
+ }).finally(() => setIsLoading(false));
164
+ };
165
+ const fetchSelectedActivites = () => {
166
+ setIsLoading(true);
167
+ api.post({ url: `/workflow/bulk-details`, serviceURL: "api", data: { workflowIds: selectedWorkflowsList } }).then((res) => setSelectedRequestArray(res == null ? void 0 : res.data)).finally(() => setIsLoading(false));
168
+ };
169
+ const fetchStatusCount = () => {
170
+ var _a;
171
+ api.get({ url: `/workflow/status-count/${(_a = userInfo == null ? void 0 : userInfo.userInfo) == null ? void 0 : _a.id}`, serviceURL: "api" }).then((res) => {
172
+ var _a2;
173
+ setStatusCount((_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2[0]);
174
+ });
175
+ };
176
+ React2.useEffect(() => {
177
+ if (!sendDialog && !approveDialog && !onHoldDialog && !rejectDialog) {
178
+ fetchAllActivites();
179
+ fetchStatusCount();
180
+ fetchPendingActivities();
181
+ setExpandedDetails([]);
182
+ setExpandedId(null);
183
+ }
184
+ }, [sendDialog, approveDialog, onHoldDialog, rejectDialog, userInfo]);
185
+ React2.useEffect(() => {
186
+ api.get({ url: `/workflow/url-config`, serviceURL: "api" }).then((res) => {
187
+ const data = (res == null ? void 0 : res.data) || [];
188
+ const map = data.reduce((acc, { module_name, ...details }) => {
189
+ acc[module_name] = details;
190
+ return acc;
191
+ }, {});
192
+ setUrlConfig(map);
193
+ });
194
+ }, []);
195
+ React2.useEffect(() => {
196
+ if (selectedWorkflowsList.length && !selectedRequestArray.length) {
197
+ fetchSelectedActivites();
198
+ }
199
+ }, [selectedWorkflowsList]);
200
+ const buildRedirectionUrl = (info) => {
201
+ if (info == null ? void 0 : info.redirection_link) return info.redirection_link;
202
+ if (urlBuilder) return urlBuilder(info == null ? void 0 : info.module_name, info == null ? void 0 : info.module_id, urlConfig, info == null ? void 0 : info.reference_id);
203
+ const ref = urlConfig == null ? void 0 : urlConfig[info == null ? void 0 : info.module_name];
204
+ if ((ref == null ? void 0 : ref.base_url) && (ref == null ? void 0 : ref.sub_url)) {
205
+ const qs = new URLSearchParams();
206
+ if (info == null ? void 0 : info.reference_id) qs.set("reference_id", String(info == null ? void 0 : info.reference_id));
207
+ if (info == null ? void 0 : info.module_name) qs.set("module_name", String(info == null ? void 0 : info.module_name));
208
+ return `${ref.base_url}${ref.sub_url}${qs.toString() ? `?${qs.toString()}` : ""}`;
209
+ }
210
+ return "#";
211
+ };
212
+ if (isLoading && loadingComponent) return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: loadingComponent });
213
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(system.Box, { sx: { display: "flex", justifyContent: "center", flexWrap: "nowrap" }, children: /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { width: "100%", height: "100%" }, children: [
214
+ /* @__PURE__ */ jsxRuntime.jsx(system.Box, { sx: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { mt: 2, mb: 2 }, children: [
215
+ (selectedWorkflowsList == null ? void 0 : selectedWorkflowsList.length) ? /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: "Selected Workflows", children: /* @__PURE__ */ jsxRuntime.jsx(
216
+ StyledChipProps,
217
+ {
218
+ label: "Selected",
219
+ icon: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "icon-eye" }),
220
+ color: (selectedApprovalOtions == null ? void 0 : selectedApprovalOtions.includes("selected")) ? "primary" : "default",
221
+ variant: "filled",
222
+ sx: { mr: 4, mb: 4, "& .MuiChip-icon": { fontSize: "18px !important" } },
223
+ onClick: () => handleProfileToggle("selected")
224
+ }
225
+ ) }) : "",
226
+ approvalChipLabel.map(({ label, icon, count }, index) => /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: `${count} ${label}`, children: /* @__PURE__ */ jsxRuntime.jsx(
227
+ StyledChipProps,
228
+ {
229
+ label: `${count} ${label}`,
230
+ icon,
231
+ color: (selectedApprovalOtions == null ? void 0 : selectedApprovalOtions.includes(label)) ? "primary" : "default",
232
+ variant: "filled",
233
+ sx: { mr: 4, mb: 4, "& .MuiChip-icon": { fontSize: "18px !important" } },
234
+ onClick: () => handleProfileToggle(label)
235
+ }
236
+ ) }, index))
237
+ ] }) }),
238
+ selectedApprovalOtions === "selected" && /* @__PURE__ */ jsxRuntime.jsx(system.Box, { className: "fixedModal", sx: { overflowY: "auto", height: "calc(100vh - 180px)" }, children: selectedRequestArray && selectedRequestArray.map((info, index) => {
239
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H;
240
+ const currentLevel = info == null ? void 0 : info.levels.find((level_) => level_.id === (info == null ? void 0 : info.current_level));
241
+ currentLevel ? currentLevel.status_list : [];
242
+ const redir = buildRedirectionUrl(info);
243
+ return /* @__PURE__ */ jsxRuntime.jsxs(React2__default.default.Fragment, { children: [
244
+ /* @__PURE__ */ jsxRuntime.jsx(
245
+ material.Card,
246
+ {
247
+ sx: {
248
+ mb: 8,
249
+ "&.MuiCard-root.MuiPaper-elevation": {
250
+ boxShadow: "2px 2px 10px 0px #4C4E6426",
251
+ padding: "20px",
252
+ borderRadius: "10px"
253
+ }
254
+ },
255
+ children: /* @__PURE__ */ jsxRuntime.jsxs(material.CardContent, { sx: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
256
+ /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { children: [
257
+ /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: info.activityInstruction, children: /* @__PURE__ */ jsxRuntime.jsx(TruncatedTypography, { variant: "h6", color: "text.primary", sx: { textTransform: "capitalize", lineHeight: "22px" }, children: info.activity_name }) }),
258
+ /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: info.description_data, children: /* @__PURE__ */ jsxRuntime.jsx(
259
+ TruncatedTypography,
260
+ {
261
+ variant: "body2",
262
+ color: "customColors.mainText",
263
+ sx: { mt: "13px", textTransform: "capitalize", lineHeight: "15.4px" },
264
+ children: info.description_data
265
+ }
266
+ ) })
267
+ ] }),
268
+ /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { children: [
269
+ /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: "Links", children: /* @__PURE__ */ jsxRuntime.jsx(
270
+ TruncatedTypography,
271
+ {
272
+ variant: "caption",
273
+ color: "customColors.text3",
274
+ sx: { textTransform: "capitalize", lineHeight: "13.2px" },
275
+ children: "Links"
276
+ }
277
+ ) }),
278
+ /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: redir, children: /* @__PURE__ */ jsxRuntime.jsx("a", { href: redir, style: { cursor: "pointer", textDecoration: "none" }, target: "_blank", rel: "noreferrer", children: /* @__PURE__ */ jsxRuntime.jsx(
279
+ TruncatedTypography,
280
+ {
281
+ variant: "subtitle2",
282
+ color: "primary.dark",
283
+ sx: { mt: "13px", lineHeight: "15.4px" },
284
+ children: redir
285
+ }
286
+ ) }) })
287
+ ] }),
288
+ /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { children: [
289
+ /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: "Attachments", children: /* @__PURE__ */ jsxRuntime.jsx(
290
+ TruncatedTypography,
291
+ {
292
+ variant: "caption",
293
+ color: "customColors.text3",
294
+ sx: { textTransform: "capitalize", lineHeight: "13.2px" },
295
+ children: "Attachments"
296
+ }
297
+ ) }),
298
+ ((_a = info == null ? void 0 : info.attachment_links) == null ? void 0 : _a.length) ? info == null ? void 0 : info.attachment_links.map((link, idx) => /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: `Attachment ${idx + 1}`, children: /* @__PURE__ */ jsxRuntime.jsx("a", { href: link, style: { cursor: "pointer", textDecoration: "none" }, target: "_blank", rel: "noreferrer", children: /* @__PURE__ */ jsxRuntime.jsx(
299
+ TruncatedTypography,
300
+ {
301
+ variant: "subtitle2",
302
+ color: "primary.dark",
303
+ sx: { mt: "13px", textTransform: "capitalize", lineHeight: "15.4px" },
304
+ children: link || "N/A"
305
+ }
306
+ ) }) }, idx)) : /* @__PURE__ */ jsxRuntime.jsx(system.Box, { sx: { display: "flex", mt: 2, justifyContent: "center", alignItems: "center", lineHeight: "15.4px" }, children: "N/A" })
307
+ ] }),
308
+ /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { children: [
309
+ /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: "Date and Time", children: /* @__PURE__ */ jsxRuntime.jsx(
310
+ TruncatedTypography,
311
+ {
312
+ variant: "caption",
313
+ color: "customColors.text3",
314
+ sx: { textTransform: "capitalize", lineHeight: "13.2px" },
315
+ children: "TAT"
316
+ }
317
+ ) }),
318
+ /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: info.dateTime, children: /* @__PURE__ */ jsxRuntime.jsx(
319
+ TruncatedTypography,
320
+ {
321
+ variant: "subtitle2",
322
+ color: "customColors.mainText",
323
+ sx: { mt: "13px", textTransform: "capitalize", lineHeight: "15.4px" },
324
+ children: ((_c = (_b = info == null ? void 0 : info.levels) == null ? void 0 : _b.find((lvl) => lvl.id === (info == null ? void 0 : info.current_level))) == null ? void 0 : _c.tat_expiry) ? moment__default.default((_e = (_d = info == null ? void 0 : info.levels) == null ? void 0 : _d.find((lvl) => lvl.id === (info == null ? void 0 : info.current_level))) == null ? void 0 : _e.tat_expiry).utcOffset("UTC+05:30").format("DD/MM/YYYY HH:MM A") : "N/A"
325
+ }
326
+ ) })
327
+ ] }),
328
+ /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { children: [
329
+ /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: "Current active level of Workflow", children: /* @__PURE__ */ jsxRuntime.jsx(
330
+ TruncatedTypography,
331
+ {
332
+ variant: "caption",
333
+ color: "customColors.text3",
334
+ sx: { textTransform: "capitalize", lineHeight: "13.2px" },
335
+ children: "Current Level"
336
+ }
337
+ ) }),
338
+ /* @__PURE__ */ jsxRuntime.jsx(system.Box, { sx: { display: "flex", mt: 2, justifyContent: "center", alignItems: "center" }, children: (info == null ? void 0 : info.isLevelZero) ? "L0" : "L" + (((_g = (_f = info == null ? void 0 : info.levels) == null ? void 0 : _f.findIndex((lvl) => lvl.id === (info == null ? void 0 : info.current_level))) != null ? _g : -1) + 1 || "") })
339
+ ] }),
340
+ /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { mt: 2, display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
341
+ /* @__PURE__ */ jsxRuntime.jsx(
342
+ material.Chip,
343
+ {
344
+ variant: "filled",
345
+ sx: {
346
+ backgroundColor: `${(_n = getStatus(
347
+ ((_j = (_i = (_h = info == null ? void 0 : info.levels) == null ? void 0 : _h.find((lvl) => lvl.id === (info == null ? void 0 : info.current_level))) == null ? void 0 : _i.selected_status) == null ? void 0 : _j.status_id) === 1 ? "approved" : ((_m = (_l = (_k = info == null ? void 0 : info.levels) == null ? void 0 : _k.find((lvl) => lvl.id === (info == null ? void 0 : info.current_level))) == null ? void 0 : _l.selected_status) == null ? void 0 : _m.status_id) === 3 ? "rejected" : "pending"
348
+ )) == null ? void 0 : _n.color} !important`,
349
+ color: `${(_u = getStatus(
350
+ ((_q = (_p = (_o = info == null ? void 0 : info.levels) == null ? void 0 : _o.find((lvl) => lvl.id === (info == null ? void 0 : info.current_level))) == null ? void 0 : _p.selected_status) == null ? void 0 : _q.status_id) === 1 ? "approved" : ((_t = (_s = (_r = info == null ? void 0 : info.levels) == null ? void 0 : _r.find((lvl) => lvl.id === (info == null ? void 0 : info.current_level))) == null ? void 0 : _s.selected_status) == null ? void 0 : _t.status_id) === 3 ? "rejected" : "pending"
351
+ )) == null ? void 0 : _u.labelColor} !important`,
352
+ height: "40px",
353
+ padding: "8px",
354
+ borderRadius: "100px !important",
355
+ border: "0px !important",
356
+ "& .MuiChip-label": {
357
+ fontSize: "14px",
358
+ lineHeight: "15.4px",
359
+ fontWeight: "500",
360
+ textTransform: "capitalize"
361
+ }
362
+ },
363
+ label: `${((_x = (_w = (_v = info == null ? void 0 : info.levels) == null ? void 0 : _v.find((lvl) => lvl.id === (info == null ? void 0 : info.current_level))) == null ? void 0 : _w.selected_status) == null ? void 0 : _x.status_id) === 2 || (info == null ? void 0 : info.isLevelZero) || !((_z = (_y = info == null ? void 0 : info.levels) == null ? void 0 : _y.find((lvl) => lvl.id === (info == null ? void 0 : info.current_level))) == null ? void 0 : _z.selected_status) ? "pending" : (_C = (_B = (_A = info == null ? void 0 : info.levels) == null ? void 0 : _A.find((lvl) => lvl.id === (info == null ? void 0 : info.current_level))) == null ? void 0 : _B.selected_status) == null ? void 0 : _C.name}`
364
+ }
365
+ ),
366
+ /* @__PURE__ */ jsxRuntime.jsx(material.Divider, { orientation: "vertical", sx: { ml: 5, borderColor: (_E = (_D = theme.palette) == null ? void 0 : _D.customColors) == null ? void 0 : _E.text4, height: "50px" } }),
367
+ /* @__PURE__ */ jsxRuntime.jsx(
368
+ material.IconButton,
369
+ {
370
+ disableFocusRipple: true,
371
+ disableRipple: true,
372
+ color: "primary",
373
+ sx: {
374
+ ml: 5,
375
+ background: (_H = (_G = (_F = theme.palette) == null ? void 0 : _F.customColors) == null ? void 0 : _G.primaryLightest) != null ? _H : "rgba(25,118,210,0.08)",
376
+ boxShadow: "2px 2px 10px 0px #4C4E6426",
377
+ "& span": { color: theme.palette.primary.dark }
378
+ },
379
+ onClick: () => handleExpandClick(info._id),
380
+ children: expandedId === info._id ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "icon-arrow-down-1" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "icon-arrow-right-3" })
381
+ }
382
+ )
383
+ ] })
384
+ ] })
385
+ }
386
+ ),
387
+ expandedId === info._id && /* @__PURE__ */ jsxRuntime.jsx(material.Grid, { container: true, xs: 12, spacing: 5, children: /* @__PURE__ */ jsxRuntime.jsx(material.Grid, { item: true, xs: 12, sx: { transform: "translateX(3.9%)" }, children: !(expandedDetails == null ? void 0 : expandedDetails.length) ? /* @__PURE__ */ jsxRuntime.jsx(system.Box, { sx: { height: "200px", display: "flex", justifyContent: "center", alignItems: "center" }, children: /* @__PURE__ */ jsxRuntime.jsx(material.CircularProgress, { size: 40, sx: { color: theme.palette.primary.dark } }) }) : /* @__PURE__ */ jsxRuntime.jsx(system.Box, { sx: { pl: 2 }, children: expandedDetails == null ? void 0 : expandedDetails.map((item, idx) => {
388
+ var _a2;
389
+ return /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { mb: 2 }, children: [
390
+ /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", sx: { mr: 2 }, children: moment__default.default(item == null ? void 0 : item.created_at).format("DD-MM-YYYY HH:mm") }),
391
+ /* @__PURE__ */ jsxRuntime.jsxs(material.Typography, { variant: "body2", component: "span", children: [
392
+ item == null ? void 0 : item.type,
393
+ " - ",
394
+ ((_a2 = item == null ? void 0 : item.comment_reasons) == null ? void 0 : _a2.comment) || "No Comments"
395
+ ] })
396
+ ] }, idx);
397
+ }) }) }) })
398
+ ] }, index);
399
+ }) }),
400
+ selectedApprovalOtions === "All Requests" && /* @__PURE__ */ jsxRuntime.jsx(system.Box, { className: "fixedModal", sx: { overflowY: "auto", height: "calc(100vh - 180px)" }, children: allRequestArray && allRequestArray.map((info, index) => {
401
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B;
402
+ const currentLevel = info == null ? void 0 : info.levels.find((level_) => level_.id === (info == null ? void 0 : info.current_level));
403
+ currentLevel ? currentLevel.status_list : [];
404
+ const redir = buildRedirectionUrl(info);
405
+ return /* @__PURE__ */ jsxRuntime.jsxs(React2__default.default.Fragment, { children: [
406
+ /* @__PURE__ */ jsxRuntime.jsx(
407
+ material.Card,
408
+ {
409
+ sx: {
410
+ mb: 8,
411
+ "&.MuiCard-root.MuiPaper-elevation": {
412
+ boxShadow: "2px 2px 10px 0px #4C4E6426",
413
+ padding: "20px",
414
+ borderRadius: "10px"
415
+ }
416
+ },
417
+ children: /* @__PURE__ */ jsxRuntime.jsxs(material.CardContent, { sx: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
418
+ /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { children: [
419
+ /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: info.activityInstruction, children: /* @__PURE__ */ jsxRuntime.jsx(TruncatedTypography, { variant: "h6", color: "text.primary", sx: { textTransform: "capitalize", lineHeight: "22px" }, children: info.activity_name }) }),
420
+ /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: info.description_data, children: /* @__PURE__ */ jsxRuntime.jsx(
421
+ TruncatedTypography,
422
+ {
423
+ variant: "body2",
424
+ color: "customColors.mainText",
425
+ sx: { mt: "13px", textTransform: "capitalize", lineHeight: "15.4px" },
426
+ children: info.description_data
427
+ }
428
+ ) })
429
+ ] }),
430
+ /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { children: [
431
+ /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: "Links", children: /* @__PURE__ */ jsxRuntime.jsx(
432
+ TruncatedTypography,
433
+ {
434
+ variant: "caption",
435
+ color: "customColors.text3",
436
+ sx: { textTransform: "capitalize", lineHeight: "13.2px" },
437
+ children: "Links"
438
+ }
439
+ ) }),
440
+ /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: redir, children: /* @__PURE__ */ jsxRuntime.jsx("a", { href: redir, style: { cursor: "pointer", textDecoration: "none" }, target: "_blank", rel: "noreferrer", children: /* @__PURE__ */ jsxRuntime.jsx(
441
+ TruncatedTypography,
442
+ {
443
+ variant: "subtitle2",
444
+ color: "primary.dark",
445
+ sx: { mt: "13px", lineHeight: "15.4px" },
446
+ children: redir
447
+ }
448
+ ) }) })
449
+ ] }),
450
+ /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { children: [
451
+ /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: "Attachments", children: /* @__PURE__ */ jsxRuntime.jsx(
452
+ TruncatedTypography,
453
+ {
454
+ variant: "caption",
455
+ color: "customColors.text3",
456
+ sx: { textTransform: "capitalize", lineHeight: "13.2px" },
457
+ children: "Attachments"
458
+ }
459
+ ) }),
460
+ ((_a = info == null ? void 0 : info.attachment_links) == null ? void 0 : _a.length) ? info == null ? void 0 : info.attachment_links.map((link, idx) => /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: `Attachment ${idx + 1}`, children: /* @__PURE__ */ jsxRuntime.jsx("a", { href: link, style: { cursor: "pointer", textDecoration: "none" }, target: "_blank", rel: "noreferrer", children: /* @__PURE__ */ jsxRuntime.jsx(
461
+ TruncatedTypography,
462
+ {
463
+ variant: "subtitle2",
464
+ color: "primary.dark",
465
+ sx: { mt: "13px", textTransform: "capitalize", lineHeight: "15.4px" },
466
+ children: link || "N/A"
467
+ }
468
+ ) }) }, idx)) : /* @__PURE__ */ jsxRuntime.jsx(system.Box, { sx: { display: "flex", mt: 2, justifyContent: "center", alignItems: "center", lineHeight: "15.4px" }, children: "N/A" })
469
+ ] }),
470
+ /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { mt: 2, display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
471
+ /* @__PURE__ */ jsxRuntime.jsx(
472
+ material.Chip,
473
+ {
474
+ variant: "filled",
475
+ sx: {
476
+ backgroundColor: `${(_h = getStatus(
477
+ ((_d = (_c = (_b = info == null ? void 0 : info.levels) == null ? void 0 : _b.find((lvl) => lvl.id === (info == null ? void 0 : info.current_level))) == null ? void 0 : _c.selected_status) == null ? void 0 : _d.status_id) === 1 ? "approved" : ((_g = (_f = (_e = info == null ? void 0 : info.levels) == null ? void 0 : _e.find((lvl) => lvl.id === (info == null ? void 0 : info.current_level))) == null ? void 0 : _f.selected_status) == null ? void 0 : _g.status_id) === 3 ? "rejected" : "pending"
478
+ )) == null ? void 0 : _h.color} !important`,
479
+ color: `${(_o = getStatus(
480
+ ((_k = (_j = (_i = info == null ? void 0 : info.levels) == null ? void 0 : _i.find((lvl) => lvl.id === (info == null ? void 0 : info.current_level))) == null ? void 0 : _j.selected_status) == null ? void 0 : _k.status_id) === 1 ? "approved" : ((_n = (_m = (_l = info == null ? void 0 : info.levels) == null ? void 0 : _l.find((lvl) => lvl.id === (info == null ? void 0 : info.current_level))) == null ? void 0 : _m.selected_status) == null ? void 0 : _n.status_id) === 3 ? "rejected" : "pending"
481
+ )) == null ? void 0 : _o.labelColor} !important`,
482
+ height: "40px",
483
+ padding: "8px",
484
+ borderRadius: "100px !important",
485
+ border: "0px !important",
486
+ "& .MuiChip-label": {
487
+ fontSize: "14px",
488
+ lineHeight: "15.4px",
489
+ fontWeight: "500",
490
+ textTransform: "capitalize"
491
+ }
492
+ },
493
+ label: `${((_r = (_q = (_p = info == null ? void 0 : info.levels) == null ? void 0 : _p.find((lvl) => lvl.id === (info == null ? void 0 : info.current_level))) == null ? void 0 : _q.selected_status) == null ? void 0 : _r.status_id) === 2 || (info == null ? void 0 : info.isLevelZero) || !((_t = (_s = info == null ? void 0 : info.levels) == null ? void 0 : _s.find((lvl) => lvl.id === (info == null ? void 0 : info.current_level))) == null ? void 0 : _t.selected_status) ? "pending" : (_w = (_v = (_u = info == null ? void 0 : info.levels) == null ? void 0 : _u.find((lvl) => lvl.id === (info == null ? void 0 : info.current_level))) == null ? void 0 : _v.selected_status) == null ? void 0 : _w.name}`
494
+ }
495
+ ),
496
+ /* @__PURE__ */ jsxRuntime.jsx(material.Divider, { orientation: "vertical", sx: { ml: 5, borderColor: (_y = (_x = theme.palette) == null ? void 0 : _x.customColors) == null ? void 0 : _y.text4, height: "50px" } }),
497
+ /* @__PURE__ */ jsxRuntime.jsx(
498
+ material.IconButton,
499
+ {
500
+ disableFocusRipple: true,
501
+ disableRipple: true,
502
+ color: "primary",
503
+ sx: {
504
+ ml: 5,
505
+ background: (_B = (_A = (_z = theme.palette) == null ? void 0 : _z.customColors) == null ? void 0 : _A.primaryLightest) != null ? _B : "rgba(25,118,210,0.08)",
506
+ boxShadow: "2px 2px 10px 0px #4C4E6426",
507
+ "& span": { color: theme.palette.primary.dark }
508
+ },
509
+ onClick: () => handleExpandClick(info._id),
510
+ children: expandedId === info._id ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "icon-arrow-down-1" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "icon-arrow-right-3" })
511
+ }
512
+ )
513
+ ] })
514
+ ] })
515
+ }
516
+ ),
517
+ expandedId === info._id && /* @__PURE__ */ jsxRuntime.jsx(material.Grid, { container: true, xs: 12, spacing: 5, children: /* @__PURE__ */ jsxRuntime.jsx(material.Grid, { item: true, xs: 12, sx: { transform: "translateX(3.9%)" }, children: !(expandedDetails == null ? void 0 : expandedDetails.length) ? /* @__PURE__ */ jsxRuntime.jsx(system.Box, { sx: { height: "200px", display: "flex", justifyContent: "center", alignItems: "center" }, children: /* @__PURE__ */ jsxRuntime.jsx(material.CircularProgress, { size: 40, sx: { color: theme.palette.primary.dark } }) }) : /* @__PURE__ */ jsxRuntime.jsx(system.Box, { sx: { pl: 2 }, children: expandedDetails == null ? void 0 : expandedDetails.map((item, idx) => {
518
+ var _a2;
519
+ return /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { mb: 2 }, children: [
520
+ /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", sx: { mr: 2 }, children: moment__default.default(item == null ? void 0 : item.created_at).format("DD-MM-YYYY HH:mm") }),
521
+ /* @__PURE__ */ jsxRuntime.jsxs(material.Typography, { variant: "body2", component: "span", children: [
522
+ item == null ? void 0 : item.type,
523
+ " - ",
524
+ ((_a2 = item == null ? void 0 : item.comment_reasons) == null ? void 0 : _a2.comment) || "No Comments"
525
+ ] })
526
+ ] }, idx);
527
+ }) }) }) })
528
+ ] }, index);
529
+ }) }),
530
+ selectedApprovalOtions === "Action Required" && /* @__PURE__ */ jsxRuntime.jsx(system.Box, { className: "fixedModal", sx: { overflowY: "auto", height: "calc(100vh - 180px)" }, children: pendingRequestArray && pendingRequestArray.map((info, index) => {
531
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B;
532
+ const currentLevel = (_a = info == null ? void 0 : info.levels) == null ? void 0 : _a.find((level_) => level_.id === (info == null ? void 0 : info.current_level));
533
+ currentLevel ? currentLevel.status_list : [];
534
+ const redir = buildRedirectionUrl(info);
535
+ return /* @__PURE__ */ jsxRuntime.jsxs(React2__default.default.Fragment, { children: [
536
+ /* @__PURE__ */ jsxRuntime.jsx(
537
+ material.Card,
538
+ {
539
+ sx: {
540
+ mb: 8,
541
+ "&.MuiCard-root.MuiPaper-elevation": {
542
+ boxShadow: "2px 2px 10px 0px #4C4E6426",
543
+ padding: "20px",
544
+ borderRadius: "10px"
545
+ }
546
+ },
547
+ children: /* @__PURE__ */ jsxRuntime.jsxs(material.CardContent, { sx: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
548
+ /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { children: [
549
+ /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: info.title, children: /* @__PURE__ */ jsxRuntime.jsx(TruncatedTypography, { variant: "h6", color: "text.primary", sx: { textTransform: "capitalize", lineHeight: "22px" }, children: info.activity_name }) }),
550
+ /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: info.description_data, children: /* @__PURE__ */ jsxRuntime.jsx(
551
+ TruncatedTypography,
552
+ {
553
+ variant: "body2",
554
+ color: "customColors.mainText",
555
+ sx: { mt: "13px", textTransform: "capitalize", lineHeight: "15.4px" },
556
+ children: info.description_data
557
+ }
558
+ ) })
559
+ ] }),
560
+ /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { children: [
561
+ /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: "Links", children: /* @__PURE__ */ jsxRuntime.jsx(
562
+ TruncatedTypography,
563
+ {
564
+ variant: "caption",
565
+ color: "customColors.text3",
566
+ sx: { textTransform: "capitalize", lineHeight: "13.2px" },
567
+ children: "Links"
568
+ }
569
+ ) }),
570
+ /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: redir, children: /* @__PURE__ */ jsxRuntime.jsx("a", { href: redir, style: { cursor: "pointer", textDecoration: "none" }, target: "_blank", rel: "noreferrer", children: /* @__PURE__ */ jsxRuntime.jsx(
571
+ TruncatedTypography,
572
+ {
573
+ variant: "subtitle2",
574
+ color: "primary.dark",
575
+ sx: { mt: "13px", lineHeight: "15.4px" },
576
+ children: redir
577
+ }
578
+ ) }) })
579
+ ] }),
580
+ /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { mt: 2, display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
581
+ /* @__PURE__ */ jsxRuntime.jsx(
582
+ material.Chip,
583
+ {
584
+ variant: "filled",
585
+ sx: {
586
+ backgroundColor: `${(_h = getStatus(
587
+ ((_d = (_c = (_b = info == null ? void 0 : info.levels) == null ? void 0 : _b.find((lvl) => lvl.id === (info == null ? void 0 : info.current_level))) == null ? void 0 : _c.selected_status) == null ? void 0 : _d.status_id) === 1 ? "approved" : ((_g = (_f = (_e = info == null ? void 0 : info.levels) == null ? void 0 : _e.find((lvl) => lvl.id === (info == null ? void 0 : info.current_level))) == null ? void 0 : _f.selected_status) == null ? void 0 : _g.status_id) === 3 ? "rejected" : "pending"
588
+ )) == null ? void 0 : _h.color} !important`,
589
+ color: `${(_o = getStatus(
590
+ ((_k = (_j = (_i = info == null ? void 0 : info.levels) == null ? void 0 : _i.find((lvl) => lvl.id === (info == null ? void 0 : info.current_level))) == null ? void 0 : _j.selected_status) == null ? void 0 : _k.status_id) === 1 ? "approved" : ((_n = (_m = (_l = info == null ? void 0 : info.levels) == null ? void 0 : _l.find((lvl) => lvl.id === (info == null ? void 0 : info.current_level))) == null ? void 0 : _m.selected_status) == null ? void 0 : _n.status_id) === 3 ? "rejected" : "pending"
591
+ )) == null ? void 0 : _o.labelColor} !important`,
592
+ height: "40px",
593
+ padding: "8px",
594
+ borderRadius: "100px !important",
595
+ border: "0px !important",
596
+ "& .MuiChip-label": {
597
+ fontSize: "14px",
598
+ lineHeight: "15.4px",
599
+ fontWeight: "500",
600
+ textTransform: "capitalize"
601
+ }
602
+ },
603
+ label: `${((_r = (_q = (_p = info == null ? void 0 : info.levels) == null ? void 0 : _p.find((lvl) => lvl.id === (info == null ? void 0 : info.current_level))) == null ? void 0 : _q.selected_status) == null ? void 0 : _r.status_id) === 2 || (info == null ? void 0 : info.isLevelZero) || !((_t = (_s = info == null ? void 0 : info.levels) == null ? void 0 : _s.find((lvl) => lvl.id === (info == null ? void 0 : info.current_level))) == null ? void 0 : _t.selected_status) ? "pending" : (_w = (_v = (_u = info == null ? void 0 : info.levels) == null ? void 0 : _u.find((lvl) => lvl.id === (info == null ? void 0 : info.current_level))) == null ? void 0 : _v.selected_status) == null ? void 0 : _w.name}`
604
+ }
605
+ ),
606
+ /* @__PURE__ */ jsxRuntime.jsx(material.Divider, { orientation: "vertical", sx: { ml: 5, borderColor: (_y = (_x = theme.palette) == null ? void 0 : _x.customColors) == null ? void 0 : _y.text4, height: "50px" } }),
607
+ /* @__PURE__ */ jsxRuntime.jsx(
608
+ material.IconButton,
609
+ {
610
+ disableFocusRipple: true,
611
+ disableRipple: true,
612
+ color: "primary",
613
+ sx: {
614
+ ml: 5,
615
+ background: (_B = (_A = (_z = theme.palette) == null ? void 0 : _z.customColors) == null ? void 0 : _A.primaryLightest) != null ? _B : "rgba(25,118,210,0.08)",
616
+ boxShadow: "2px 2px 10px 0px #4C4E6426",
617
+ "& span": { color: theme.palette.primary.dark }
618
+ },
619
+ onClick: () => handleExpandClick(info._id),
620
+ children: expandedId === info._id ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "icon-arrow-down-1" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "icon-arrow-right-3" })
621
+ }
622
+ )
623
+ ] })
624
+ ] })
625
+ }
626
+ ),
627
+ expandedId === info._id && /* @__PURE__ */ jsxRuntime.jsx(material.Grid, { container: true, xs: 12, spacing: 5, children: /* @__PURE__ */ jsxRuntime.jsx(material.Grid, { item: true, xs: 12, sx: { transform: "translateX(3.9%)" }, children: !(expandedDetails == null ? void 0 : expandedDetails.length) ? /* @__PURE__ */ jsxRuntime.jsx(system.Box, { sx: { height: "200px", display: "flex", justifyContent: "center", alignItems: "center" }, children: /* @__PURE__ */ jsxRuntime.jsx(material.CircularProgress, { size: 40, sx: { color: theme.palette.primary.dark } }) }) : /* @__PURE__ */ jsxRuntime.jsx(system.Box, { sx: { pl: 2 }, children: expandedDetails == null ? void 0 : expandedDetails.map((item, idx) => {
628
+ var _a2;
629
+ return /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { mb: 2 }, children: [
630
+ /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", sx: { mr: 2 }, children: moment__default.default(item == null ? void 0 : item.created_at).format("DD-MM-YYYY HH:mm") }),
631
+ /* @__PURE__ */ jsxRuntime.jsxs(material.Typography, { variant: "body2", component: "span", children: [
632
+ item == null ? void 0 : item.type,
633
+ " - ",
634
+ ((_a2 = item == null ? void 0 : item.comment_reasons) == null ? void 0 : _a2.comment) || "No Comments"
635
+ ] })
636
+ ] }, idx);
637
+ }) }) }) })
638
+ ] }, index);
639
+ }) })
640
+ ] }) }) });
641
+ }
642
+ function DialogOpener({
643
+ openDialog,
644
+ handleClose,
645
+ userInfoData,
646
+ selectedWorkflowsList = []
647
+ }) {
648
+ const theme = styles.useTheme();
649
+ useMediaQuery__default.default(theme.breakpoints.down("lg"));
650
+ const [screenWidth, setScreenWidth] = React2.useState(typeof window !== "undefined" ? window.innerWidth : 0);
651
+ React2.useEffect(() => {
652
+ const updateScreenWidth = () => setScreenWidth(window.innerWidth);
653
+ window.addEventListener("resize", updateScreenWidth);
654
+ return () => window.removeEventListener("resize", updateScreenWidth);
655
+ }, []);
656
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs(
657
+ Dialog__default.default,
658
+ {
659
+ fullScreen: true,
660
+ open: openDialog,
661
+ onClose: () => handleClose && handleClose(),
662
+ "aria-labelledby": "responsive-dialog-title",
663
+ sx: { zIndex: 123 },
664
+ children: [
665
+ /* @__PURE__ */ jsxRuntime.jsxs(DialogContent__default.default, { children: [
666
+ /* @__PURE__ */ jsxRuntime.jsx(material.IconButton, { onClick: handleClose, disableFocusRipple: true, disableRipple: true, sx: { float: "right" }, children: /* @__PURE__ */ jsxRuntime.jsx(HighlightOffIcon__default.default, { style: { color: "#666666" } }) }),
667
+ /* @__PURE__ */ jsxRuntime.jsx(ApprovalWorkflow, { userInfo: userInfoData, selectedWorkflowsList })
668
+ ] }),
669
+ /* @__PURE__ */ jsxRuntime.jsx(DialogActions__default.default, { children: /* @__PURE__ */ jsxRuntime.jsx(
670
+ Button2__default.default,
671
+ {
672
+ variant: "contained",
673
+ color: "primary",
674
+ sx: { display: "flex", justifyContent: "flex-end", alignItems: "center" },
675
+ onClick: handleClose,
676
+ children: "Close"
677
+ }
678
+ ) })
679
+ ]
680
+ }
681
+ ) });
682
+ }
683
+ function DialogOpener2(props) {
684
+ const { api, urlBuilder, loadingComponent, userInfoData, ...rest } = props;
685
+ return /* @__PURE__ */ jsxRuntime.jsx(WorkflowProvider, { value: { api, urlBuilder, userInfo: userInfoData, loadingComponent }, children: /* @__PURE__ */ jsxRuntime.jsx(DialogOpener, { ...rest, userInfoData }) });
686
+ }
687
+ function ApprovalWorkflow2(props) {
688
+ const { api, urlBuilder, loadingComponent, userInfo, ...rest } = props;
689
+ return /* @__PURE__ */ jsxRuntime.jsx(WorkflowProvider, { value: { api, urlBuilder, userInfo, loadingComponent }, children: /* @__PURE__ */ jsxRuntime.jsx(ApprovalWorkflow, { userInfo, ...rest }) });
690
+ }
691
+
692
+ exports.ApprovalWorkflow = ApprovalWorkflow2;
693
+ exports.DialogOpener = DialogOpener2;
694
+ //# sourceMappingURL=index.js.map
695
+ //# sourceMappingURL=index.js.map