@acuteinfo/common-screens 1.0.60 → 1.0.62

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 CHANGED
@@ -1,3235 +1,2 @@
1
- import 'regenerator-runtime/runtime';
2
- import './assets/index~NFLKLAwc.css';
3
- import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
4
- import { TextField, GradientButton, utilFunction, usePopupContext, ClearCacheProvider, queryClient, Alert, GridWrapper, SearchBar } from '@acuteinfo/common-base';
5
- import { useState, useRef, useEffect, Fragment, useMemo, useReducer, useCallback } from 'react';
6
- import { makeStyles } from '@mui/styles';
7
- import Visibility from '@mui/icons-material/Visibility';
8
- import VisibilityOff from '@mui/icons-material/VisibilityOff';
9
- import { Container, Grid, InputAdornment, IconButton, CircularProgress, FormHelperText, Typography, Tooltip, tooltipClasses, Stack, Box, Avatar, Button, alpha, AppBar, Toolbar, List, ListItemIcon, ListItem, ListItemText, Collapse, Drawer } from '@mui/material';
10
- import { useTranslation } from 'react-i18next';
11
- import OTPInput, { ResendOTP } from 'otp-input-react';
12
- import IconButton$1 from '@mui/material/IconButton';
13
- import clsx from 'clsx';
14
- import { useSnackbar } from 'notistack';
15
- import FingerprintSharpIcon from '@mui/icons-material/FingerprintSharp';
16
- import './assets/verify~MOgwPpDY.css';
17
- import CryptoJS from 'crypto-js';
18
- import './assets/styles~ILuxAzHT.css';
19
- import { useQuery, useMutation } from 'react-query';
20
- import bank_logo_default from './assets/BecomePartnerImg~cwVtJhaB.svg';
21
- import Waving_hand from './assets/waving-hand~JqQoivUD.png';
22
- import { styled } from '@mui/material/styles';
23
- import USER_PROFILE_DEFAULT from './assets/profile-default~evuVPsgu.png';
24
- import LogoutIcon from '@mui/icons-material/Logout';
25
- import MenuOutlinedIcon from '@mui/icons-material/MenuOutlined';
26
- import { format } from 'date-fns';
27
- import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
28
- import ScrollBar from 'react-perfect-scrollbar';
29
- import { ExpandLess, ExpandMore } from '@mui/icons-material';
30
- import ArrowBackIosNewIcon from '@mui/icons-material/ArrowBackIosNew';
31
- import { library } from '@fortawesome/fontawesome-svg-core';
32
- import { faHandsHelping, faUsers, faBars, faBalanceScale, faHandHoldingHeart, faTasks, faCog, faHome, faTh, faUsersCog, faCircle, faUserCircle, faHashtag, faThumbtack, faSquare, faLink, faQuestion, faPlus, faTable, faLocationArrow, faHeadset, faGears, faArrowDown, faArrowUp, faSpinner, faCircleExclamation, faRotateRight, faUserLock, faUserClock, faGripHorizontal, faFileLines, faGear, faHeadphones, faUsersGear, faMessage, faUnlock, faUserPlus, faUserCheck, faKey, faIdCard, faIdBadge, faCheck, faCheckDouble, faCircleCheck, faCircleXmark, faUserTag, faAddressCard, faChartColumn, faUserPen, faHandHolding, faHandHoldingMedical, faObjectGroup, faTowerCell, faTowerObservation, faBuilding, faMailBulk, faLandmarkFlag, faCreditCard, faHospitalSymbol, faPlugCircleBolt, faCodeBranch, faPersonCircleCheck, faBank, faServer, faNotesMedical, faPenToSquare, faBarsProgress, faFileExport, faA, faB, faC, faD, faE, faF, faG, faH, faI, faJ, faK, faL, faM, faN, faO, faP, faQ, faR, faS, faT, faU, faV, faW, faX, faY, faZ } from '@fortawesome/free-solid-svg-icons';
33
- import 'lodash';
34
-
35
- const useStyles$3 = makeStyles((theme) => ({
36
- wrapper: {
37
- minHeight: "100vh",
38
- boxShadow: "0 3px 6px rgba(0,0,0,0.03)",
39
- // background: "#fff",
40
- background: "var(--white)",
41
- },
42
- loginEmp: {
43
- background: "#fff",
44
- padding: theme.spacing(2, 4),
45
- display: "flex",
46
- maxWidth: "400px",
47
- margin: "auto",
48
- boxShadow: "0 0 20px rgba(0,0,0,0.06)",
49
- borderRadius: "8px",
50
- [theme.breakpoints.down("sm")]: {
51
- width: "100%",
52
- },
53
- },
54
- formWrap: {
55
- marginTop: theme.spacing(2),
56
- },
57
- loginBtn: {
58
- minWidth: "100% !important",
59
- margin: theme.spacing(2, 0),
60
- fontSize: "1rem",
61
- padding: "10px .75rem",
62
- background: "rgb(128,0,0)",
63
- border: 0,
64
- color: "#fff !important",
65
- fontWeight: 600,
66
- letterSpacing: "0.02857em",
67
- boxShadow: "none",
68
- textTransform: "capitalize",
69
- alignSelf: "flex-end",
70
- "&:hover": {
71
- background: "#fedad8",
72
- boxShadow: "none",
73
- },
74
- },
75
- OTPTimer: {
76
- marginTop: "10px",
77
- color: theme.palette.primary.main,
78
- fontWeight: 600,
79
- },
80
- resendLink: {
81
- marginTop: "10px",
82
- cursor: "pointer",
83
- color: theme.palette.secondary.main,
84
- fontWeight: 600,
85
- fontSize: "0.875 rem",
86
- },
87
- logo: {
88
- marginBottom: theme.spacing(1),
89
- },
90
- loginLeft: {
91
- [theme.breakpoints.down("sm")]: {
92
- display: "none",
93
- },
94
- },
95
- loginRight: {
96
- background: "#fff",
97
- padding: theme.spacing(2, 4),
98
- display: "flex",
99
- maxWidth: "400px",
100
- margin: "auto",
101
- boxShadow: "0 0 20px rgba(0,0,0,0.06)",
102
- borderRadius: "8px",
103
- [theme.breakpoints.down("sm")]: {
104
- width: "100%",
105
- },
106
- "& img": {
107
- alignSelf: "center",
108
- },
109
- },
110
- loginImg: {},
111
- verifybutton: {
112
- alignSelf: "center",
113
- // marginBottom: "10px",
114
- // marginTop: "10px",
115
- padding: "5px",
116
- },
117
- otpButtons: {
118
- // padding: "10px",
119
- },
120
- divflex: {
121
- display: "flex",
122
- },
123
- otpinputpadding: {
124
- "& input": {
125
- marginRight: "25px !important",
126
- border: "1.42444px solid var(--theme-color3)",
127
- borderRadius: "10px",
128
- width: "45px !important",
129
- height: "45px !important",
130
- marginBottom: "15px",
131
- boxShadow: "0px 5.69775px 11.3955px rgba(66, 99, 199, 0.16)",
132
- },
133
- },
134
- ibtnvisible: {
135
- // padding: "7px !important",
136
- // alignItems: "baseline",
137
- marginBottom: "15px",
138
- },
139
- btnvisibleoff: {
140
- display: "none",
141
- },
142
- OTPalignName: {
143
- display: "flex",
144
- alignItems: "center",
145
- // justifyContent: "space-between",
146
- marginBottom: "12px",
147
- color: "#1C1C1C",
148
- fonWeight: "400",
149
- fontSize: "17px",
150
- lineHeight: "33px",
151
- },
152
- resendOTPalign: {
153
- color: "var(--theme-color3)",
154
- fonWeight: "400",
155
- fontSize: "17px",
156
- lineHeight: "33px",
157
- margin: "0 auto",
158
- // marginTop: "15px",
159
- // display: "block !important",
160
- },
161
- resendbtnLink: {
162
- textDecoration: "underline",
163
- color: "var(--theme-color3)",
164
- cursor: "pointer",
165
- "&:hover": {
166
- textDecoration: "underline",
167
- color: "var(--theme-color3)",
168
- },
169
- },
170
- dialogTitleClass: {
171
- background: "var(--primary-bg)",
172
- padding: "6px 15px !important",
173
- margin: "10px",
174
- color: "var(--white)",
175
- borderRadius: "4px",
176
- "& h2": {
177
- fontWeight: "500 !important",
178
- },
179
- },
180
- lang_svg: {
181
- marginRight: "10px",
182
- width: "22px",
183
- height: "22px",
184
- },
185
- dialogContent: {
186
- padding: "0px 15px",
187
- "& p": {
188
- whiteSpace: "pre-wrap",
189
- color: "black",
190
- marginTop: "8px",
191
- marginBottom: "6px",
192
- },
193
- },
194
- button: {
195
- display: "flex",
196
- alignItems: "center",
197
- justifyContent: "center",
198
- flexDirection: "column",
199
- margin: "6px",
200
- background: "var(--theme-color1)",
201
- "&:hover": {
202
- background: "var(--theme-color1) !important",
203
- },
204
- },
205
- }));
206
-
207
- const UsernamePasswordField = ({ classes, loginState, verifyUsernamePassword, forgotPasswordEndpoint, }) => {
208
- const [input, setInput] = useState({ userName: "", password: "" });
209
- const [showPasswordTime, setShowPasswordTime] = useState(0);
210
- const showPassword = Date.now() < showPasswordTime;
211
- const [, forceUpdate] = useState();
212
- const timerRef = useRef(null);
213
- const { t } = useTranslation();
214
- useEffect(() => {
215
- return () => clearTimeout(timerRef.current);
216
- }, []);
217
- const handleChange = (event) => {
218
- const name = event.target.name;
219
- const value = event.target.value;
220
- if (name === "userName" && value) {
221
- loginState.isUsernameError = false;
222
- }
223
- if (name === "password" && value) {
224
- loginState.isPasswordError = false;
225
- }
226
- setInput((values) => ({ ...values, [name]: value }));
227
- };
228
- const inputRef = useRef(null);
229
- const inputPassRef = useRef(null);
230
- const inputButtonRef = useRef(null);
231
- useEffect(() => {
232
- let timeoutCd;
233
- if (loginState.isUsernameError) {
234
- timeoutCd = setTimeout(() => {
235
- inputRef?.current?.focus?.();
236
- }, 1000);
237
- }
238
- else if (loginState.isPasswordError) {
239
- timeoutCd = setTimeout(() => {
240
- inputPassRef?.current?.focus?.();
241
- }, 1000);
242
- }
243
- return () => {
244
- if (timeoutCd) {
245
- clearTimeout(timeoutCd);
246
- }
247
- };
248
- }, [loginState.isUsernameError, loginState.isPasswordError]);
249
- useEffect(() => {
250
- let timeoutCd;
251
- if (loginState?.otpmodelClose ?? false) {
252
- setInput((values) => ({ ...values, password: "" }));
253
- timeoutCd = setTimeout(() => {
254
- inputPassRef?.current?.focus?.();
255
- }, 1500);
256
- }
257
- return () => {
258
- if (timeoutCd) {
259
- clearTimeout(timeoutCd);
260
- }
261
- };
262
- }, [loginState.otpmodelClose]);
263
- return (jsx(Fragment, { children: jsx(Container, { maxWidth: "xs", children: jsxs(Grid, { alignItems: "center", style: { paddingTop: "20px" }, children: [jsx("div", { style: {
264
- color: "#000000 !important",
265
- fontSize: "30px",
266
- fontWeight: "600",
267
- // fontFamily: "Poppins",
268
- alignItems: "center",
269
- fontStyle: "normal",
270
- lineHeight: "150%",
271
- }, children: jsx("h3", { children: t("SignIn") }) }), jsx("div", { className: "", style: {
272
- color: "#949597",
273
- fontSize: "16px",
274
- fontWeight: "400",
275
- // fontFamily: "Poppins",
276
- alignItems: "center",
277
- fontStyle: "normal",
278
- width: "360px",
279
- }, children: t("SignInWithUserIDandPassword") }), jsxs("div", { className: classes.formWrap, children: [jsx(TextField
280
- // variant="filled"
281
- // color="secondary"
282
- , {
283
- // variant="filled"
284
- // color="secondary"
285
- autoFocus: true, label: t("UserID"),
286
- // placeholder="User ID"
287
- placeholder: String(t("UserID")), style: {
288
- marginTop: "10px",
289
- marginBottom: "17px",
290
- }, fullWidth: true, type: "text", name: "userName", value: input.userName.trimStart() || "", onChange: handleChange, error: loginState.isUsernameError, helperText: loginState.isUsernameError
291
- ? t(loginState.userMessageforusername)
292
- : "", InputLabelProps: { shrink: true }, disabled: loginState.loading, autoComplete: "off", ref: inputRef, onKeyDown: (e) => {
293
- if (e.key === "Enter") {
294
- inputButtonRef?.current?.click?.();
295
- }
296
- }, inputProps: {
297
- maxLength: "16",
298
- } }), jsx("div", { style: {
299
- display: "flex",
300
- flexDirection: "row-reverse",
301
- marginTop: "8px",
302
- }, children: jsx(TextField, { label: t("Password"),
303
- // variant="filled"
304
- // color="secondary"
305
- placeholder: String(t("EnterPassword")), InputLabelProps: {
306
- shrink: true,
307
- }, fullWidth: true, type: showPassword ? "text" : "password", name: "password", value: input.password, onChange: handleChange, error: loginState.isPasswordError, helperText: loginState.isPasswordError
308
- ? t(loginState.userMessageforpassword)
309
- : "", disabled: loginState.loading, ref: inputPassRef, onKeyDown: (e) => {
310
- if (e.key === "Enter") {
311
- inputButtonRef?.current?.click?.();
312
- }
313
- }, InputProps: {
314
- endAdornment: (jsx(InputAdornment, { position: "end", children: jsx(IconButton, { "aria-label": "toggle password visibility", onClick: () => {
315
- if (!showPassword) {
316
- setShowPasswordTime(Date.now() + 5000);
317
- timerRef.current = setTimeout(() => forceUpdate(Date.now()), 5000);
318
- }
319
- else if (showPassword)
320
- setShowPasswordTime(0);
321
- }, onMouseDown: (e) => e.preventDefault(), disabled: loginState.loading, children: showPassword ? jsx(Visibility, {}) : jsx(VisibilityOff, {}) }) })),
322
- }, inputProps: { maxLength: "16" } }, "employee") }), jsx("div", { style: { marginTop: "20px", display: "flex" }, children: jsx("div", { style: { flex: "auto", textAlign: "end" }, children: jsx("a", { href: forgotPasswordEndpoint ?? "", style: { color: "var(--theme-color3)" }, children: t("ForgotPassword") }) }) }), jsx("div", { style: { marginTop: "20px", display: "flex" }, children: jsx("div", { style: {
323
- flex: "auto",
324
- textAlign: "center",
325
- marginTop: "5px",
326
- marginBottom: "17px",
327
- }, children: jsx(GradientButton, { style: {
328
- borderRadius: loginState.loading ? "50%" : "10px",
329
- height: loginState.loading ? "40px" : "100%",
330
- width: loginState.loading ? "0px" : "100%",
331
- minWidth: loginState.loading ? "40px" : "80px",
332
- }, fullWidth: true, disabled: loginState.loading, onClick: () => verifyUsernamePassword((input.userName || "").toLowerCase(), input.password), ref: inputButtonRef, endicon: loginState.loading ? undefined : "East", rotateIcon: "scale(1.4) rotateX(360deg)", children: loginState.loading ? (jsx(CircularProgress, { size: 25, thickness: 4.6 })) : (t("Next")) }) }) })] })] }) }) }));
333
- };
334
-
335
- const OTPModel = ({ classes, OTPResendRequest, open, handleClose, loginState, VerifyOTP, OTPError, setOTPError, previousStep, setNewRequestID = (id) => { }, otpresendCount = 0, resendFlag, }) => {
336
- const [OTP, setOTP] = useState("");
337
- const [showPasswordTime, setShowPasswordTime] = useState(0);
338
- const showPassword = Date.now() < showPasswordTime;
339
- const [, forceUpdate] = useState();
340
- const timerRef = useRef(null);
341
- useEffect(() => {
342
- return () => clearTimeout(timerRef.current);
343
- }, []);
344
- const [btnshow, setbtnshow] = useState(false);
345
- const inputButtonRef = useRef(null);
346
- const [resendotpLoading, setResendotpLoading] = useState(false);
347
- const { enqueueSnackbar } = useSnackbar();
348
- const { t } = useTranslation();
349
- // const renderButton = (buttonProps) => {
350
- // let { remainingTime, ...other } = buttonProps;
351
- // return resendotpLoading ? (
352
- // <a
353
- // remainingtime={remainingTime}
354
- // {...other}
355
- // className={clsx(
356
- // classes.resendbtnLink,
357
- // !btnshow && classes.btnvisibleoff
358
- // )}
359
- // >
360
- // {t("otp.ResendOTP")}
361
- // </a>
362
- // ) : null;
363
- // };
364
- const renderButton = (buttonProps) => {
365
- let { remainingTime, ...other } = buttonProps;
366
- return resendotpLoading ? (jsxs("a", { className: clsx(classes.resendbtnLink, !btnshow && classes.btnvisibleoff), style: { cursor: "wait" }, children: [t("otp.GetNewOTP"), " ", jsx(CircularProgress, { size: 20, color: "secondary" })] })) : (jsx("a", { remainingtime: remainingTime, ...other, className: clsx(classes.resendbtnLink, !btnshow && classes.btnvisibleoff), children: t("otp.GetNewOTP") }));
367
- };
368
- const ClickEventHandler = () => {
369
- if (!Boolean(OTP) || OTP.length < 6) {
370
- setOTPError("otp.EnterOTPDigit");
371
- }
372
- else {
373
- setOTPError("");
374
- VerifyOTP(OTP);
375
- }
376
- };
377
- const handleResendClick = async () => {
378
- setResendotpLoading(true);
379
- const { status, data, message } = await OTPResendRequest(
380
- // resendFlag === "FORGET_PW" || resendFlag === "FORGT_TOTP"
381
- // ? loginState?.requestCd
382
- // : loginState?.transactionID,
383
- loginState?.comapanyCD, loginState?.branchCD, loginState?.contactUser, resendFlag, loginState?.otpValidFor, loginState?.username);
384
- setResendotpLoading(false);
385
- if (status === "0") {
386
- setNewRequestID(data?.TRAN_CD);
387
- setbtnshow(false);
388
- enqueueSnackbar(message, { variant: "success" });
389
- }
390
- else {
391
- enqueueSnackbar(message, { variant: "error" });
392
- }
393
- };
394
- const handleCloseEvent = () => {
395
- setOTPError("");
396
- setOTP("");
397
- handleClose("");
398
- };
399
- const renderTime = (remainingtime) => {
400
- if (parseInt(remainingtime) === 0) {
401
- setTimeout(() => {
402
- setbtnshow(true);
403
- }, 700);
404
- }
405
- return (jsxs("span", { className: clsx(btnshow && classes.btnvisibleoff), children: [t("otp.OtpExpired"), " ", remainingtime, " ", t("otp.second")] }));
406
- };
407
- useEffect(() => {
408
- if (loginState?.otpmodelClose ?? false) {
409
- handleCloseEvent();
410
- }
411
- else if (Boolean(OTPError)) {
412
- setOTP("");
413
- }
414
- }, [loginState.otpmodelClose, OTPError]);
415
- return (jsx(Fragment, { children: jsx(Container, { maxWidth: "sm", children: jsx(Grid, { alignItems: "center", marginTop: "4em", children: jsxs("div", {
416
- // className={classes.formWrap}
417
- style: {
418
- // marginRight: "25px",
419
- // width: "100%",
420
- // position: "relative",
421
- // right: "42px",
422
- // bottom: "13px",
423
- }, children: [jsx("div", { style: {
424
- color: "#000000",
425
- fontSize: "30px",
426
- fontWeight: "600",
427
- // fontFamily: "Poppins",
428
- alignItems: "center",
429
- fontStyle: "normal",
430
- lineHeight: "150%",
431
- marginBottom: "10px",
432
- }, children: loginState?.authType === "OTP"
433
- ? t("otp.OTPAuthentication")
434
- : loginState?.authType === "TOTP"
435
- ? t("otp.TOTPAuthentication")
436
- : null }), jsx("div", { style: {
437
- color: "#949597",
438
- fontSize: "16px",
439
- fontWeight: "400",
440
- alignItems: "center",
441
- fontStyle: "normal",
442
- lineHeight: "33px",
443
- }, children: loginState?.authType === "OTP"
444
- ? t("otp.EnterOTPsentToMobile")
445
- : loginState?.authType === "TOTP"
446
- ? t("otp.PleaseEnterOTP")
447
- : null }), jsxs("div", { className: classes.OTPalignName, children: [t("otp.Hello"), " ", loginState?.username
448
- ? loginState.username.charAt(0).toUpperCase() +
449
- loginState.username.slice(1)
450
- : null, loginState?.authType === "OTP" && (jsx(ResendOTP
451
- // onResendClick={() => setbtnshow(false)}
452
- , {
453
- // onResendClick={() => setbtnshow(false)}
454
- onResendClick: handleResendClick,
455
- // onTimerComplete={() => setbtnshow(true)}
456
- renderButton: renderButton, renderTime: renderTime, maxTime: loginState?.otpValidFor ?? 60, className: classes.resendOTPalign }))] }), jsxs("div", { className: classes.divflex, onKeyDown: (e) => {
457
- if (e.key === "Enter") {
458
- inputButtonRef?.current?.click?.();
459
- }
460
- }, children: [jsx(OTPInput, { value: OTP, onChange: setOTP, autoFocus: true, OTPLength: 6, otpType: "number", disabled: loginState.otploading || loginState.loading, secure: !showPassword, className: classes.otpinputpadding }), jsx(IconButton$1, { "aria-label": "toggle password visibility", onClick: () => {
461
- if (!showPassword) {
462
- setShowPasswordTime(Date.now() + 5000);
463
- timerRef.current = setTimeout(() => forceUpdate(Date.now()), 5000);
464
- }
465
- else if (showPassword)
466
- setShowPasswordTime(0);
467
- }, onMouseDown: (e) => e.preventDefault(), disabled: loginState.otploading, className: classes.ibtnvisible, children: showPassword ? jsx(Visibility, {}) : jsx(VisibilityOff, {}) })] }), Boolean(OTPError) ? (jsx(FormHelperText, { style: { color: "red" }, children: OTPError })) : null, loginState?.authType === "TOTP" ? (jsx("div", { style: { flex: "auto" }, children: jsx("a", { href: "forgot-totp", style: { color: "var(--theme-color3)" }, children: "Forgot TOTP" }) })) : (jsx(Fragment$1, {})), jsxs("div", { style: {
468
- display: "flex",
469
- gap: "10px",
470
- margin: "42px 0 0 42px",
471
- width: "60%",
472
- }, children: [jsx(GradientButton
473
- // fullWidth
474
- , {
475
- // fullWidth
476
- disabled: loginState.otploading || loginState.loading, onClick: () => {
477
- previousStep(false, "");
478
- }, className: classes.otpButtons, textColor: "var(--theme-color3)", sx: {
479
- border: "var(--theme-color3)1px solid",
480
- minWidth: "50%",
481
- background: "var(--white)",
482
- borderRadius: "10px",
483
- "&:hover": {
484
- background: "var(--white) !important",
485
- },
486
- },
487
- // customstyle = {{color : "var(--theme-color3) !important"}}
488
- starticon: "West", rotateIcon: "scale(1.4) rotateX(360deg)", children: t("otp.Back") }), jsx(GradientButton, { style: {
489
- borderRadius: loginState.loading ? "50%" : "10px",
490
- height: loginState.loading ? "40px" : "100%",
491
- width: loginState.loading ? "0px" : "100%",
492
- minWidth: loginState.loading ? "40px" : "80px",
493
- }, fullWidth: true, disabled: loginState.loading, onClick: ClickEventHandler, ref: inputButtonRef, className: classes.otpButtons, endicon: loginState.loading ? undefined : "TaskAlt", rotateIcon: "scale(1.4)", children: loginState.loading ? (jsx(CircularProgress, { size: 25, thickness: 4.6 })) : (t("otp.VerifyOTP")) })] })] }) }) }) }));
494
- };
495
- const OTPModelForm = ({ classes, OTPResendRequest, handleClose, loginState, VerifyOTP, OTPError, setOTPError, resendFlag, setNewRequestID = (id) => { }, otpresendCount = 0, }) => {
496
- const [OTP, setOTP] = useState("");
497
- const [showPasswordTime, setShowPasswordTime] = useState(0);
498
- const showPassword = Date.now() < showPasswordTime;
499
- const [, forceUpdate] = useState();
500
- const timerRef = useRef(null);
501
- useEffect(() => {
502
- return () => clearTimeout(timerRef.current);
503
- }, []);
504
- const [btnshow, setbtnshow] = useState(false);
505
- const [resendotpLoading, setResendotpLoading] = useState(false);
506
- const inputButtonRef = useRef(null);
507
- const { enqueueSnackbar } = useSnackbar();
508
- const { t } = useTranslation();
509
- const renderButton = (buttonProps) => {
510
- let { remainingTime, ...other } = buttonProps;
511
- return resendotpLoading ? (jsxs("a", { className: clsx(classes.resendbtnLink, !btnshow && classes.btnvisibleoff), style: { cursor: "wait" }, children: [t("otp.GetNewOTP"), " ", jsx(CircularProgress, { size: 20, color: "secondary" })] })) : (jsx("a", { remainingtime: remainingTime, ...other, className: clsx(classes.resendbtnLink, !btnshow && classes.btnvisibleoff), children: t("otp.GetNewOTP") }));
512
- };
513
- const ClickEventHandler = () => {
514
- if (!Boolean(OTP) || OTP.length < 6) {
515
- setOTPError("otp.EnterOTPDigit");
516
- }
517
- else {
518
- setOTPError("");
519
- VerifyOTP(OTP);
520
- }
521
- };
522
- const handleResendClick = async () => {
523
- setResendotpLoading(true);
524
- const { status, data, message } = await OTPResendRequest(
525
- // resendFlag === "FORGET_PW"
526
- // ? loginState?.requestCd
527
- // : loginState?.transactionID,
528
- // resendFlag,
529
- loginState?.company_ID, loginState?.branch_cd, loginState?.contactUser, resendFlag, loginState?.otpValidFor, loginState?.username);
530
- setResendotpLoading(false);
531
- if (status === "0") {
532
- setNewRequestID(data?.TRAN_CD);
533
- setbtnshow(false);
534
- enqueueSnackbar(message, { variant: "success" });
535
- }
536
- else {
537
- enqueueSnackbar(message, { variant: "error" });
538
- }
539
- };
540
- const handleCloseEvent = () => {
541
- setOTPError("");
542
- setOTP("");
543
- handleClose();
544
- };
545
- const renderTime = (remainingtime) => {
546
- if (parseInt(remainingtime) === 0) {
547
- setTimeout(() => {
548
- setbtnshow(true);
549
- }, 700);
550
- }
551
- return (jsxs("span", { className: clsx(btnshow && classes.btnvisibleoff), children: [t("otp.OtpExpired"), " ", remainingtime] }));
552
- };
553
- useEffect(() => {
554
- if (loginState?.otpmodelClose ?? false) {
555
- handleCloseEvent();
556
- }
557
- }, [loginState.otpmodelClose]);
558
- return (jsx(Fragment, { children: jsx(Grid, { alignItems: "center", children: jsxs("div", { children: [jsx("div", { style: {
559
- color: "#000000",
560
- fontSize: "30px",
561
- fontWeight: "600",
562
- // fontFamily: "Poppins",
563
- alignItems: "center",
564
- fontStyle: "normal",
565
- lineHeight: "150%",
566
- marginBottom: "10px",
567
- }, children: t("otp.OTPAuthentication") }), jsxs("div", { className: classes.OTPalignName, children: [t("otp.Hello"), " ", loginState?.username
568
- ? loginState.username.charAt(0).toUpperCase() +
569
- loginState.username.slice(1)
570
- : null, loginState.otploading ||
571
- otpresendCount >= 3 ||
572
- loginState?.auth_type === "TOTP" ? null : (jsx(ResendOTP, { onResendClick: handleResendClick,
573
- // onTimerComplete={() => setbtnshow(true)}
574
- renderButton: renderButton, renderTime: renderTime, maxTime: loginState?.otpValidFor ?? 60, className: classes.resendOTPalign }))] }), jsxs("div", { className: classes.divflex, onKeyDown: (e) => {
575
- if (e.key === "Enter") {
576
- inputButtonRef?.current?.click?.();
577
- }
578
- }, children: [jsx(OTPInput, { value: OTP, onChange: setOTP, autoFocus: true, OTPLength: 6, otpType: "number", disabled: loginState.otploading || loginState.loading, secure: !showPassword, className: classes.otpinputpadding }), jsx(IconButton$1, { "aria-label": "toggle password visibility", onClick: () => {
579
- if (!showPassword) {
580
- setShowPasswordTime(Date.now() + 5000);
581
- timerRef.current = setTimeout(() => forceUpdate(Date.now()), 5000);
582
- }
583
- else if (showPassword)
584
- setShowPasswordTime(0);
585
- }, onMouseDown: (e) => e.preventDefault(), disabled: loginState.otploading, className: classes.ibtnvisible, children: showPassword ? jsx(Visibility, {}) : jsx(VisibilityOff, {}) })] }), Boolean(OTPError) ? (jsx(FormHelperText, { style: { color: "red" }, children: OTPError })) : null, jsxs("div", { style: {
586
- display: "flex",
587
- gap: "10px",
588
- margin: "42px 0 0 42px",
589
- width: "60%",
590
- }, children: [jsx(GradientButton, { fullWidth: true, disabled: loginState.otploading || loginState.loading, onClick: handleCloseEvent, className: classes.otpButtons, starticon: "West", textColor: "var(--white) !important", sx: {
591
- "&:disabled": {
592
- color: "var(-theme-color3) !important",
593
- },
594
- }, rotateIcon: "scale(1.4) rotateX(360deg)", style: {
595
- // border: "var(--theme-color3) 1px solid",
596
- // color: "var(--white)",
597
- // background: "var(--white)",
598
- borderRadius: "10px",
599
- minWidth: "48%",
600
- }, children: t("otp.Back") }), jsx(GradientButton, { style: {
601
- borderRadius: loginState.otploading ? "50%" : "10px",
602
- height: loginState.otploading ? "40px" : "100%",
603
- width: loginState.otploading ? "0px" : "100%",
604
- minWidth: loginState.otploading ? "40px" : "80px",
605
- },
606
- // fullWidth
607
- disabled: loginState.loading, onClick: ClickEventHandler, ref: inputButtonRef, className: classes.otpButtons, children: loginState.otploading ? (jsx(CircularProgress, { size: 25, thickness: 4.6 })) : (t("otp.VerifyOTP")) })] })] }) }) }));
608
- };
609
-
610
- const VerifyFinger = ({ classes, loginState, verifyFinger, previousStep, }) => {
611
- const { t } = useTranslation();
612
- return (jsx(Fragment, { children: jsx(Container, { maxWidth: "xs", children: jsxs(Grid, { alignItems: "center", children: [jsxs("div", { style: {
613
- marginRight: "25px",
614
- width: "102%",
615
- // marginBottom: "55px",
616
- }, children: [jsx("br", {}), jsx("div", { style: {
617
- color: "#000000",
618
- fontSize: "34px",
619
- fontWeight: "600",
620
- // fontFamily: "Poppins",
621
- alignItems: "center",
622
- fontStyle: "normal",
623
- lineHeight: "150%",
624
- marginBottom: "10px",
625
- }, children: t("Biometric.BiometrixAuthentication") }), jsx("div", { style: {
626
- color: "#949597",
627
- fontSize: "18px",
628
- fontWeight: "400",
629
- // fontFamily: "Poppins",
630
- alignItems: "center",
631
- fontStyle: "normal",
632
- lineHeight: "33px",
633
- // marginBottom: "10px",
634
- }, children: t("Biometric.Kindlyplaceyoufinger") }), jsx("br", {}), jsxs(Typography, { variant: "h5", style: { color: "#000000" }, children: [t("otp.Hello"), " ", "", ` ${loginState?.username
635
- ? loginState.username.charAt(0).toUpperCase() +
636
- loginState.username.slice(1)
637
- : null}`] }), jsx("br", {}), jsx("div", { className: loginState?.isBiometricError
638
- ? classes.eFingerUi
639
- : classes.fingerUi, children: jsxs("div", { className: "spinner-wrap", children: [jsx(FingerprintSharpIcon, { sx: {
640
- fontSize: "80px",
641
- opacity: "0.4",
642
- borderRadius: "50%",
643
- display: "flex",
644
- margin: "0 auto",
645
- "&:after": {
646
- borderBottom: "2px solid #26A456",
647
- },
648
- }, className: loginState?.isBiometricError ? classes.FingerIcon : null, color: loginState?.isBiometricError ? "error" : "inherit" }), loginState?.isScanning ? (jsxs(Fragment$1, { children: [jsx("div", { className: "spinner-item", style: {
649
- border: loginState?.isScanning
650
- ? "1px solid #949597"
651
- : " 1px solid red",
652
- } }), jsx("div", { className: "spinner-item spinner-item--2", style: {
653
- border: loginState?.isScanning
654
- ? "1px solid #949597"
655
- : "1px solid red",
656
- } }), jsx("div", { className: "spinner-item spinner-item--3", style: {
657
- border: loginState?.isScanning
658
- ? "1px solid #949597"
659
- : "1px solid red",
660
- } })] })) : null] }) }), jsx("div", { className: classes.biometric, children: jsxs("div", { style: { marginTop: "50px" }, children: [jsx("div", { className: loginState.isScanning ? "progress" : "hide", children: jsx("div", { className: "bar", style: { width: loginState.isScanning ? "30%" : "0%" } }) }), jsx("h3", { style: {
661
- display: "flex",
662
- marginTop: "20px",
663
- justifyContent: "space-around",
664
- color: loginState?.isBiometricError
665
- ? "rgb(255 0 0 / 65%)"
666
- : "inherit",
667
- }, children: loginState?.isBiometricError
668
- ? loginState?.userMessage
669
- : loginState?.loading
670
- ? t("Biometric.Loading")
671
- : loginState?.isScanning
672
- ? t("Biometric.Scanning")
673
- : null })] }) })] }), jsxs("div", { style: {
674
- display: "flex",
675
- justifyContent: "center",
676
- margin: "42px 0 0 42px",
677
- // margin: "38px 0 0 0",
678
- gap: "10px",
679
- }, children: [jsx(GradientButton, { fullWidth: true, disabled: loginState.loading, onClick: () => {
680
- previousStep(false, "");
681
- }, className: classes.otpButtons, starticon: "West", rotateIcon: "scale(1.4) rotateX(360deg)", textColor: "var(--theme-color3) !important", style: {
682
- border: "var(--theme-color3)1px solid",
683
- color: "var(--theme-color3)",
684
- background: "var(--white)",
685
- borderRadius: "10px",
686
- minWidth: "48%",
687
- }, children: t("otp.Back") }), jsx(GradientButton, { style: {
688
- borderRadius: loginState.loading ? "50%" : "10px",
689
- height: loginState.loading ? "40px" : "100%",
690
- width: loginState.loading ? "0px" : "100%",
691
- minWidth: loginState.loading ? "40px" : "80px",
692
- // width: loginState.loading ? "0px" : "90%",
693
- // minWidth: loginState.loading ? "40px" : "80px",
694
- }, disabled: loginState.loading, onKeyDown: (e) => e.keyCode === 13 && verifyFinger, onClick: verifyFinger, className: classes.otpButtons, children: loginState.loading ? (jsx(CircularProgress, { size: 25, thickness: 4.6, style: { color: "#fff" } })) : (t("Biometric.Verify")) })] })] }) }) }));
695
- };
696
-
697
- const capture = async () => {
698
- var MFS100Request = {
699
- Quality: 60,
700
- TimeOut: 10,
701
- };
702
- var jsondata = JSON.stringify(MFS100Request);
703
- const rawResponse = await fetch("http://localhost:8004/mfs100/capture", {
704
- method: "POST",
705
- headers: {
706
- Accept: "application/json",
707
- "Content-Type": "application/json",
708
- },
709
- body: jsondata,
710
- });
711
- const content = await rawResponse.json();
712
- return content;
713
- };
714
-
715
- const decryptString = (encryptString) => {
716
- var secretKey = "SUPERACUTE@MKS";
717
- var keyBytes = CryptoJS.PBKDF2(secretKey, "Ivan Medvedev", {
718
- keySize: 48 / 4,
719
- iterations: 1000,
720
- });
721
- console.log(keyBytes.toString());
722
- // take first 32 bytes as key (like in C# code)
723
- var key = new CryptoJS.lib.WordArray.init(keyBytes.words, 32);
724
- // // skip first 32 bytes and take next 16 bytes as IV
725
- var iv = new CryptoJS.lib.WordArray.init(keyBytes.words.splice(32 / 4), 16);
726
- // console.log(key.toString());
727
- //console.log(encryptString, CryptoJS.enc.Base64.parse(encryptString));
728
- var dec = CryptoJS.AES.decrypt({
729
- ciphertext: CryptoJS.enc.Base64.parse(CryptoJS.enc.Base64.parse(encryptString).toString(CryptoJS.enc.Utf8)),
730
- }, key, {
731
- iv: iv,
732
- });
733
- console.log("CryptoJS.AES.decrypt", dec);
734
- return dec.toString(CryptoJS.enc.Utf8).split(String.fromCharCode(0)).join("");
735
- };
736
- const matchFinger = async (rows, captureFinger) => {
737
- var promise = new Promise((resolve, reject) => {
738
- //console.log("matchFinger", rows, typeof rows);
739
- if (typeof rows === "string") {
740
- rows = JSON.parse(rows);
741
- }
742
- rows.forEach(async (element, i) => {
743
- try {
744
- var galleryTemplate = decryptString(element.IMG_DATA);
745
- var MFS100Request = {
746
- GalleryTemplate: galleryTemplate,
747
- ProbTemplate: captureFinger,
748
- BioType: "Iso",
749
- };
750
- var jsondata = JSON.stringify(MFS100Request);
751
- await fetch("http://localhost:8004/mfs100/verify", {
752
- method: "POST",
753
- headers: {
754
- Accept: "application/json",
755
- "Content-Type": "application/json",
756
- },
757
- body: jsondata,
758
- })
759
- .then((response) => response.json())
760
- .then((response) => {
761
- if (response?.ErrorCode === "0" && response["Status"]) {
762
- resolve({
763
- status: true,
764
- errorCode: "0",
765
- errorMessage: "",
766
- isError: false,
767
- sr_cd: element.SR_CD,
768
- });
769
- return;
770
- }
771
- if (rows.length === i + 1) {
772
- resolve({
773
- status: false,
774
- errorCode: response.ErrorCode,
775
- errorMessage: response.ErrorMessage,
776
- isError: false,
777
- });
778
- return;
779
- }
780
- })
781
- .catch((reason) => {
782
- resolve({
783
- status: false,
784
- errorCode: "999",
785
- errorMessage: reason,
786
- isError: true,
787
- });
788
- });
789
- }
790
- catch (err) {
791
- console.log(err);
792
- resolve({
793
- status: false,
794
- errorCode: "999",
795
- errorMessage: "Something went wrong!",
796
- isError: true,
797
- });
798
- }
799
- });
800
- });
801
- return promise;
802
- };
803
-
804
- const isBase64 = (str = "") => {
805
- if (typeof str !== "string") {
806
- return false;
807
- }
808
- const base64Regex = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;
809
- return base64Regex.test(str);
810
- };
811
-
812
- const BankDetails = ({ bannerDetails }) => {
813
- const [loginImageURL, setLoginImageURL] = useState(null);
814
- const urlObj = useRef(null);
815
- const classes = useStyles$3();
816
- const banner = useMemo(() => bannerDetails, []);
817
- useEffect(() => {
818
- if (Boolean(banner?.bannerImg)) {
819
- if (isBase64(banner?.bannerImg)) {
820
- let blob = utilFunction.base64toBlob(banner?.bannerImg);
821
- urlObj.current =
822
- typeof blob === "object" && Boolean(blob)
823
- ? URL.createObjectURL(blob)
824
- : "";
825
- setLoginImageURL(urlObj.current);
826
- }
827
- else {
828
- setLoginImageURL(banner?.bannerImg);
829
- }
830
- }
831
- }, [banner]);
832
- return (jsx(Fragment$1, { children: jsxs(Grid, { item: true, xs: 6, md: 6, lg: 6, className: classes.loginLeft, children: [jsx(Grid, { item: true, xs: 12, md: 12, lg: 12, style: { height: "70vh" }, children: jsx("img", { alt: "", style: {
833
- width: "100%",
834
- height: "100%",
835
- objectFit: "cover",
836
- objectPosition: "center",
837
- }, src: Boolean(loginImageURL) ? loginImageURL : "" }) }), jsx(Grid, { item: true, xs: 12, md: 12, lg: 12, style: {
838
- height: "30vh",
839
- background: "var(--primary-bg)",
840
- }, children: jsxs(Container, { maxWidth: "sm", children: [jsxs("div", { className: "text", style: {
841
- color: "white",
842
- fontStyle: "normal",
843
- fontSize: "35px",
844
- paddingTop: "30px",
845
- }, children: [banner?.bannerTitle ?? "", jsx("span", { style: { marginLeft: "8px", fontWeight: "900" } })] }), jsx("div", { style: {
846
- lineHeight: "27px",
847
- fontSize: "15px",
848
- fontWeight: "500px",
849
- letterSpacing: "0.02em",
850
- color: "#ebedee",
851
- maxWidth: "464px",
852
- }, children: banner?.bannerNote ?? "" })] }) })] }) }));
853
- };
854
-
855
- const PasswordRotation = ({ classes, ResetPassword, open, username, accessToken, tokenType, handleClose, validatePasswordFn }) => {
856
- const inputButtonRef = useRef(null);
857
- const { enqueueSnackbar } = useSnackbar();
858
- const { t } = useTranslation();
859
- const [input, setInput] = useState({
860
- userName: username,
861
- oldpassword: "",
862
- password: "",
863
- confirmpassword: "",
864
- });
865
- const [pwdReset, setPasswordReset] = useState({
866
- isError: false,
867
- errorMessage: "",
868
- isLoading: false,
869
- isoldPwdError: false,
870
- oldpassworderror: "",
871
- isnewpwdError: false,
872
- newpassworderror: "",
873
- isconfirmnewpwdError: false,
874
- confirmnewpassworderror: "",
875
- });
876
- const handleCloseEvent = () => {
877
- handleClose("");
878
- };
879
- const ClickEventHandler = async () => {
880
- let isError = false;
881
- let setPwdData = {
882
- isError: false,
883
- errorMessage: "",
884
- isLoading: false,
885
- isoldPwdError: false,
886
- oldpassworderror: "",
887
- isnewpwdError: false,
888
- newpassworderror: "",
889
- isconfirmnewpwdError: false,
890
- confirmnewpassworderror: "",
891
- };
892
- // Local validation
893
- if (!Boolean(input.oldpassword)) {
894
- setPwdData.isoldPwdError = true;
895
- setPwdData.oldpassworderror = "Current Password is required.";
896
- isError = true;
897
- }
898
- let pwdData = utilFunction.ValidatePassword(input.password);
899
- if (Boolean(pwdData)) {
900
- setPwdData.isnewpwdError = true;
901
- setPwdData.newpassworderror = pwdData;
902
- isError = true;
903
- }
904
- if (Boolean(input.oldpassword) &&
905
- Boolean(input.password) &&
906
- input.oldpassword === input.password) {
907
- setPwdData.isnewpwdError = true;
908
- setPwdData.newpassworderror = "The new password cannot be the same as the old password";
909
- isError = true;
910
- }
911
- if (!Boolean(input.confirmpassword)) {
912
- setPwdData.isconfirmnewpwdError = true;
913
- setPwdData.confirmnewpassworderror = "Confirm new password is required.";
914
- isError = true;
915
- }
916
- else if (Boolean(input.password) &&
917
- input.password !== input.confirmpassword) {
918
- setPwdData.isconfirmnewpwdError = true;
919
- setPwdData.confirmnewpassworderror = "New Password and Confirm Password did not match";
920
- isError = true;
921
- }
922
- if (isError) {
923
- setPasswordReset(setPwdData);
924
- return;
925
- }
926
- // API validation
927
- setPasswordReset((values) => ({ ...values, isLoading: true }));
928
- const { validateStatus, validateData } = await validatePasswordFn({
929
- USER_ID: input.userName,
930
- PASSWORD: input.password,
931
- SCREEN_REF: "LOGIN"
932
- });
933
- setPasswordReset((values) => ({ ...values, isLoading: false }));
934
- if (validateStatus === "0") {
935
- switch (validateData?.O_STATUS) {
936
- case "999":
937
- setPwdData.isnewpwdError = true;
938
- setPwdData.newpassworderror = validateData?.O_MESSAGE;
939
- setPasswordReset(setPwdData);
940
- return;
941
- case "0":
942
- let response = await ResetPassword(input.userName, input.oldpassword, input.password, accessToken, tokenType);
943
- setPasswordReset((values) => ({ ...values, isLoading: true }));
944
- if (response.status === "0") {
945
- enqueueSnackbar("Password successfully changed.", {
946
- variant: "success",
947
- });
948
- handleClose("0");
949
- setPasswordReset((values) => ({ ...values, isLoading: false }));
950
- }
951
- else {
952
- setPasswordReset((values) => ({
953
- ...values,
954
- isError: true,
955
- errorMessage: response.message,
956
- }));
957
- }
958
- break;
959
- }
960
- }
961
- };
962
- const handleChange = (event) => {
963
- const name = event.target.name;
964
- let value = event.target.value;
965
- if (name === "oldpassword" && Boolean(value)) {
966
- setPasswordReset((values) => ({ ...values, isoldPwdError: false }));
967
- }
968
- else if (name === "password" && Boolean(value)) {
969
- setPasswordReset((values) => ({ ...values, isnewpwdError: false }));
970
- }
971
- else if (name === "confirmpassword" && Boolean(value)) {
972
- setPasswordReset((values) => ({
973
- ...values,
974
- isconfirmnewpwdError: false,
975
- }));
976
- }
977
- setInput((values) => ({ ...values, [name]: value }));
978
- };
979
- return (jsx(Fragment, { children: jsx(Container, { maxWidth: "xs", children: jsxs(Grid, { alignItems: "center", children: [jsx("div", { style: {
980
- color: "#000000 !important",
981
- fontSize: "30px",
982
- fontWeight: "600",
983
- alignItems: "center",
984
- fontStyle: "normal",
985
- }, children: jsx("h3", { children: "Password Rotation" }) }), jsx("div", { className: "", style: {
986
- color: "#949597",
987
- fontSize: "18px",
988
- fontWeight: "400",
989
- alignItems: "center",
990
- fontStyle: "normal",
991
- width: "360px",
992
- }, children: "Please Verify OTP" }), jsxs("div", { className: classes.formWrap, children: [jsx(TextField, { label: "User ID", placeholder: "Enter User ID", fullWidth: true, type: "text", name: "userName", value: input.userName || "", onChange: handleChange, InputLabelProps: { shrink: true }, disabled: true, autoComplete: "off", inputProps: { maxLength: 16 }, style: { paddingBottom: "8px" } }), jsx(TextField, { autoFocus: true, label: "Current Password", placeholder: "Enter Current Password", fullWidth: true, type: "password", name: "oldpassword", value: input.oldpassword || "", onChange: handleChange, error: pwdReset.isoldPwdError, helperText: pwdReset.isoldPwdError ? t(pwdReset.oldpassworderror) : "", InputLabelProps: { shrink: true }, disabled: pwdReset.isLoading, autoComplete: "off", onKeyDown: (e) => {
993
- if (e.key === "Enter") {
994
- inputButtonRef?.current?.click?.();
995
- }
996
- }, inputProps: { maxLength: 16 }, style: { paddingBottom: "8px" } }), jsx(TextField, { label: "New Password", placeholder: "Enter New Password", fullWidth: true, type: "password", name: "password", value: input.password || "", onChange: handleChange, error: pwdReset.isnewpwdError, helperText: pwdReset.isnewpwdError ? t(pwdReset.newpassworderror) : "", InputLabelProps: { shrink: true }, disabled: pwdReset.isLoading, autoComplete: "off", onKeyDown: (e) => {
997
- if (e.key === "Enter") {
998
- inputButtonRef?.current?.click?.();
999
- }
1000
- }, inputProps: { maxLength: 16 }, style: { paddingBottom: "8px" } }), jsx(TextField, { label: "Confirm New Password", placeholder: "Enter confirm new password", fullWidth: true, type: "password", name: "confirmpassword", value: input.confirmpassword || "", onChange: handleChange, error: pwdReset.isconfirmnewpwdError, helperText: pwdReset.isconfirmnewpwdError
1001
- ? t(pwdReset.confirmnewpassworderror)
1002
- : "", InputLabelProps: { shrink: true }, disabled: pwdReset.isLoading, autoComplete: "off", onKeyDown: (e) => {
1003
- if (e.key === "Enter") {
1004
- inputButtonRef?.current?.click?.();
1005
- }
1006
- }, inputProps: { maxLength: 16 }, style: { paddingBottom: "8px" } }), pwdReset.isError ? (jsx(FormHelperText, { style: { color: "red" }, children: pwdReset.errorMessage })) : null] }), jsxs("div", { style: {
1007
- display: "flex",
1008
- gap: "10px",
1009
- margin: "20px 0 0 10px",
1010
- width: "94%",
1011
- }, children: [jsx(GradientButton, { fullWidth: true, disabled: pwdReset.isLoading, onClick: handleCloseEvent, className: classes.otpButtons, style: {
1012
- border: "var(--theme-color3)1px solid",
1013
- color: "var(--theme-color3)",
1014
- // pebbackground: "var(--white)",
1015
- borderRadius: "10px",
1016
- }, children: "Back" }), jsx(GradientButton, { style: {
1017
- borderRadius: pwdReset.isLoading ? "50%" : "10px",
1018
- height: pwdReset.isLoading ? "40px" : "100%",
1019
- width: pwdReset.isLoading ? "0px" : "100%",
1020
- minWidth: pwdReset.isLoading ? "40px" : "80px",
1021
- }, fullWidth: true, disabled: pwdReset.isLoading, onClick: ClickEventHandler, ref: inputButtonRef, className: classes.otpButtons, children: pwdReset.isLoading ? (jsx(CircularProgress, { size: 25, thickness: 4.6 })) : ("Update") })] })] }) }) }));
1022
- };
1023
-
1024
- const inititalState$1 = {
1025
- username: "",
1026
- firstName: "",
1027
- lastName: "",
1028
- loading: false,
1029
- otploading: false,
1030
- isError: false,
1031
- isUsernameError: false,
1032
- isPasswordError: false,
1033
- userMessage: "",
1034
- OtpuserMessage: "",
1035
- userMessageforpassword: "",
1036
- userMessageforusername: "",
1037
- currentFlow: "username",
1038
- transactionID: "",
1039
- comapanyCD: "",
1040
- branchCD: "",
1041
- contactUser: "",
1042
- access_token: "",
1043
- token_type: "",
1044
- otpmodelClose: false,
1045
- authType: "",
1046
- isScanning: false,
1047
- auth_type: "O",
1048
- otpValidFor: 60,
1049
- };
1050
- const reducer$1 = (state, action) => {
1051
- switch (action.type) {
1052
- case "inititateUserFingerVerification":
1053
- case "inititateOTPVerification": {
1054
- return {
1055
- ...state,
1056
- loading: true,
1057
- isError: false,
1058
- isUsernameError: false,
1059
- isPasswordError: false,
1060
- isOTPError: false,
1061
- isBiometricError: false,
1062
- userMessage: "",
1063
- };
1064
- }
1065
- case "inititateUserFingerScanner": {
1066
- return { ...state, isScanning: true, isBiometricError: false };
1067
- }
1068
- case "usernameandpasswordrequired": {
1069
- return {
1070
- ...state,
1071
- loading: false,
1072
- isError: true,
1073
- isUsernameError: true,
1074
- isPasswordError: true,
1075
- otploading: false,
1076
- userMessage: action?.payload?.error,
1077
- userMessageforpassword: action?.payload?.errorPassword,
1078
- userMessageforusername: action?.payload?.errorUsername,
1079
- username: "",
1080
- transactionID: "",
1081
- comapanyCD: "",
1082
- branchCD: "",
1083
- contactUser: ""
1084
- };
1085
- }
1086
- case "passwordVerificationFailure":
1087
- return {
1088
- ...state,
1089
- loading: false,
1090
- isError: true,
1091
- isUsernameError: false,
1092
- isPasswordError: true,
1093
- otploading: false,
1094
- userMessage: action?.payload?.error,
1095
- userMessageforpassword: action?.payload?.errorPassword,
1096
- username: "",
1097
- transactionID: "",
1098
- comapanyCD: "",
1099
- branchCD: ""
1100
- };
1101
- case "usernameVerificationFailure": {
1102
- return {
1103
- ...state,
1104
- loading: false,
1105
- isError: true,
1106
- isUsernameError: true,
1107
- isPasswordError: false,
1108
- otploading: false,
1109
- userMessage: action?.payload?.error,
1110
- userMessageforusername: action?.payload?.errorUsername,
1111
- username: "",
1112
- transactionID: "",
1113
- comapanyCD: "",
1114
- branchCD: "",
1115
- contactUser: ""
1116
- };
1117
- }
1118
- case "inititatePasswordVerification": {
1119
- return {
1120
- ...state,
1121
- loading: true,
1122
- isError: false,
1123
- isUsernameError: false,
1124
- isPasswordError: false,
1125
- otploading: false,
1126
- userMessage: "",
1127
- userMessageforusername: "",
1128
- userMessageforpassword: "",
1129
- username: "",
1130
- transactionID: "",
1131
- access_token: "",
1132
- comapanyCD: "",
1133
- branchCD: "",
1134
- contactUser: ""
1135
- };
1136
- }
1137
- case "passwordRotation": {
1138
- return {
1139
- ...state,
1140
- loading: false,
1141
- username: action?.payload?.username,
1142
- access_token: action?.payload?.access_token,
1143
- token_type: action?.payload?.token_type,
1144
- };
1145
- }
1146
- case "passwordRotationsuccess": {
1147
- return {
1148
- ...state,
1149
- loading: false,
1150
- otpmodelClose: Boolean(action?.payload?.otpmodelclose),
1151
- };
1152
- }
1153
- case "passwordVerificationSuccessful": {
1154
- return {
1155
- ...state,
1156
- loading: false,
1157
- otploading: false,
1158
- transactionID: action?.payload?.transactionID,
1159
- comapanyCD: action?.payload?.comapanyCD,
1160
- branchCD: action?.payload?.branchCD,
1161
- contactUser: action?.payload?.contactUser,
1162
- username: action?.payload?.username,
1163
- auth_type: action?.payload?.auth_type,
1164
- OtpuserMessage: "",
1165
- access_token: action?.payload?.access_token,
1166
- token_type: action?.payload?.token_type,
1167
- otpmodelClose: false,
1168
- currentFlow: "OTP",
1169
- authType: action?.payload?.authType,
1170
- auth_data: action?.payload?.auth_data,
1171
- otpValidFor: action?.payload?.otpValidFor,
1172
- };
1173
- }
1174
- case "inititatebiometricVerification": {
1175
- return {
1176
- ...state,
1177
- loading: true,
1178
- otploading: true,
1179
- OtpuserMessage: "",
1180
- otpmodelClose: false,
1181
- };
1182
- }
1183
- case "biometricVerificationFailure":
1184
- return {
1185
- ...state,
1186
- loading: false,
1187
- isError: true,
1188
- isBiometricError: true,
1189
- userMessage: action?.payload?.error,
1190
- isScanning: false,
1191
- };
1192
- case "biometricVerificationSuccessful":
1193
- return {
1194
- ...state,
1195
- loading: false,
1196
- isError: false,
1197
- isBiometricError: false,
1198
- state: action.payload,
1199
- isScanning: false,
1200
- };
1201
- case "OTPVerificationComplate": {
1202
- return {
1203
- ...state,
1204
- loading: false,
1205
- otploading: false,
1206
- OtpuserMessage: "",
1207
- };
1208
- }
1209
- case "OTPVerificationFailed": {
1210
- return {
1211
- ...state,
1212
- loading: false,
1213
- otploading: false,
1214
- OtpuserMessage: action?.payload?.error,
1215
- otpmodelClose: Boolean(action?.payload?.otpmodelclose),
1216
- };
1217
- }
1218
- case "OTPResendSuccess": {
1219
- return {
1220
- ...state,
1221
- transactionID: action?.payload?.transactionID,
1222
- };
1223
- }
1224
- case "backToUsernameVerification": {
1225
- return {
1226
- ...inititalState$1,
1227
- isPasswordError: action?.payload?.isError,
1228
- userMessageforpassword: action?.payload?.errorMessage,
1229
- };
1230
- }
1231
- default: {
1232
- return state;
1233
- }
1234
- }
1235
- };
1236
- const AuthControllerWrapper = ({ bannerDetails, logoUrl, logoTitle, loginFn, veirfyUsernameandPassword, validatePasswordFn, verifyOTP, OTPResendRequest, ResetPassword, LanguageComponent, forgotPasswordEndpoint, }) => {
1237
- const classes = useStyles$3();
1238
- const [loginState, dispath] = useReducer(reducer$1, inititalState$1);
1239
- const [openpwdreset, setOpenPwdReset] = useState(false);
1240
- const failureCount = useRef(0);
1241
- const [dashboardLogoURL, setDashboardLogoURL] = useState(null);
1242
- const urlObj = useRef(null);
1243
- const { t } = useTranslation();
1244
- const otpResendRef = useRef(1);
1245
- const { MessageBox } = usePopupContext();
1246
- useEffect(() => {
1247
- if (Boolean(logoUrl)) {
1248
- if (isBase64(logoUrl)) {
1249
- let blob = utilFunction.base64toBlob(logoUrl);
1250
- urlObj.current =
1251
- typeof blob === "object" && Boolean(blob)
1252
- ? URL.createObjectURL(blob)
1253
- : "";
1254
- setDashboardLogoURL(urlObj.current);
1255
- }
1256
- else {
1257
- setDashboardLogoURL(logoUrl);
1258
- }
1259
- }
1260
- }, [logoUrl]);
1261
- const verifyUsernamePassword = async (username, password) => {
1262
- if (Boolean(username) && Boolean(password)) {
1263
- dispath({ type: "inititatePasswordVerification" });
1264
- try {
1265
- const { status = "", data = null, message = "", responseType = "", access_token = null, } = await veirfyUsernameandPassword(username, password);
1266
- if (status === "0" && responseType === "S") {
1267
- dispath({
1268
- type: "passwordRotation",
1269
- payload: {
1270
- username: username,
1271
- access_token: access_token?.access_token || "",
1272
- token_type: access_token?.token_type || "",
1273
- },
1274
- });
1275
- setOpenPwdReset(true);
1276
- }
1277
- else if (status === "0") {
1278
- dispath({
1279
- type: "passwordVerificationSuccessful",
1280
- payload: {
1281
- comapanyCD: data?.BASE_COMP_CD,
1282
- branchCD: data?.BASE_BRANCH_CD,
1283
- contactUser: data?.CONTACT2,
1284
- transactionID: data?.REQUEST_CD,
1285
- username: username,
1286
- access_token: access_token?.access_token,
1287
- token_type: access_token?.token_type,
1288
- authType: data?.AUTH_TYPE,
1289
- auth_data: data?.AUTH_DATA,
1290
- otpValidFor: data?.OTP_VALID,
1291
- },
1292
- });
1293
- if (data?.STATUS === "0") {
1294
- for (let i = 0; i < data?.ALERT_MSG_LIST.length; i++) {
1295
- await MessageBox({
1296
- messageTitle: "Password Alert",
1297
- message: data?.ALERT_MSG_LIST[i],
1298
- });
1299
- }
1300
- }
1301
- }
1302
- else {
1303
- dispath({
1304
- type: "passwordVerificationFailure",
1305
- payload: { error: message, errorPassword: message },
1306
- });
1307
- }
1308
- }
1309
- catch (err) {
1310
- throw new Error("Error occurred while verifying username and password: " + err);
1311
- }
1312
- }
1313
- else if (!Boolean(username) && !Boolean(password)) {
1314
- dispath({
1315
- type: "usernameandpasswordrequired",
1316
- payload: {
1317
- error: "UsernamenandPasswordisRequired",
1318
- errorUsername: "UsernameisRequired",
1319
- errorPassword: "PasswordisRequired",
1320
- },
1321
- });
1322
- }
1323
- else if (!Boolean(username)) {
1324
- dispath({
1325
- type: "usernameVerificationFailure",
1326
- payload: {
1327
- error: "UsernameisRequired",
1328
- errorUsername: "UsernameisRequired",
1329
- },
1330
- });
1331
- }
1332
- else {
1333
- dispath({
1334
- type: "passwordVerificationFailure",
1335
- payload: {
1336
- error: "PasswordisRequired",
1337
- errorPassword: "PasswordisRequired",
1338
- },
1339
- });
1340
- }
1341
- };
1342
- const VerifyOTP = async (OTPNumber) => {
1343
- if (Boolean(OTPNumber) && OTPNumber.toString().length === 6) {
1344
- dispath({ type: "inititateOTPVerification" });
1345
- const { status, data, message } = await verifyOTP(loginState.transactionID,
1346
- // loginState.app_transactionId,
1347
- loginState.username, OTPNumber, loginState.access_token, loginState.token_type, loginState.authType);
1348
- if (status === "0") {
1349
- // try {
1350
- // audio.play();
1351
- // } catch (error) {
1352
- // console.log(error);
1353
- // }
1354
- dispath({ type: "OTPVerificationComplate" });
1355
- loginFn(data);
1356
- }
1357
- else if (status === "999") {
1358
- dispath({
1359
- type: "OTPVerificationFailed",
1360
- payload: { error: message, otpmodelclose: true },
1361
- });
1362
- // enqueueSnackbar(message, { variant: "error" });
1363
- }
1364
- else {
1365
- dispath({
1366
- type: "OTPVerificationFailed",
1367
- payload: { error: message, otpmodelclose: false },
1368
- });
1369
- }
1370
- }
1371
- else {
1372
- dispath({
1373
- type: "OTPVerificationFailed",
1374
- payload: { error: "Please enter a 6 digit OTP number" },
1375
- });
1376
- }
1377
- };
1378
- const handlePasswordRotationClose = (flag) => {
1379
- if (flag === "0") {
1380
- dispath({
1381
- type: "passwordRotationsuccess",
1382
- payload: { otpmodelclose: true },
1383
- });
1384
- }
1385
- setOpenPwdReset(false);
1386
- };
1387
- const changeUserName = (isError = false, errorMessage = "") => {
1388
- dispath({
1389
- type: "backToUsernameVerification",
1390
- payload: {
1391
- isError: isError,
1392
- errorMessage: errorMessage,
1393
- },
1394
- });
1395
- };
1396
- const verifyFinger = async () => {
1397
- try {
1398
- dispath({ type: "inititateUserFingerScanner" });
1399
- const fingerResponse = await capture();
1400
- if (fingerResponse?.ErrorCode === "0") {
1401
- dispath({ type: "inititateUserFingerVerification" });
1402
- const promise = await matchFinger(loginState.auth_data, fingerResponse.IsoTemplate);
1403
- if (promise.isError) {
1404
- dispath({
1405
- type: "biometricVerificationFailure",
1406
- payload: {
1407
- error: promise?.errorMessage ?? "Something went wrong.",
1408
- },
1409
- });
1410
- }
1411
- else {
1412
- const { status, data, message } = await verifyOTP(loginState.transactionID, loginState.username, String(promise?.sr_cd ?? "0"), loginState.access_token, loginState.token_type, loginState.authType, promise.status ? "Y" : "N");
1413
- if (status === "0" && promise.status) {
1414
- dispath({ type: "biometricVerificationSuccessful" });
1415
- loginFn(data);
1416
- }
1417
- else if (status === "0" && !promise.status) {
1418
- failureCount.current = failureCount.current + 1;
1419
- dispath({
1420
- type: "biometricVerificationFailure",
1421
- payload: {
1422
- error: "Finger Not Match.Please Try Again",
1423
- },
1424
- });
1425
- if (failureCount.current >= 3)
1426
- changeUserName(true, "Finger Not Match.Please Try Again");
1427
- }
1428
- else if (status === "99") {
1429
- dispath({
1430
- type: "biometricVerificationFailure",
1431
- payload: {
1432
- error: message ?? "Finger Not Match.Please Try Again",
1433
- },
1434
- });
1435
- }
1436
- else if (status === "999") {
1437
- dispath({
1438
- type: "biometricVerificationFailure",
1439
- payload: {
1440
- error: message ?? "Finger Not Match.Please Try Again",
1441
- },
1442
- });
1443
- changeUserName(true, message ?? "Finger Not Match.Please Try Again");
1444
- }
1445
- else {
1446
- dispath({
1447
- type: "biometricVerificationFailure",
1448
- payload: {
1449
- error: message ?? "Finger Not Match.Please Try Again",
1450
- },
1451
- });
1452
- }
1453
- }
1454
- }
1455
- else {
1456
- dispath({
1457
- type: "biometricVerificationFailure",
1458
- payload: {
1459
- error: fingerResponse?.ErrorMessage ?? t("Biometric.MFS100NotFound"),
1460
- },
1461
- });
1462
- }
1463
- }
1464
- catch (e) {
1465
- dispath({
1466
- type: "biometricVerificationFailure",
1467
- payload: {
1468
- error: e?.message ?? t("Biometric.Unknownerroroccured"),
1469
- },
1470
- });
1471
- }
1472
- };
1473
- return (jsx(Fragment$1, { children: jsxs(Grid, { container: true, style: { height: "100vh", overflow: "hidden" }, children: [jsx(BankDetails, { bannerDetails: bannerDetails }), jsxs(Grid, { item: true, xs: 11, md: 6, lg: 6, sm: 6, children: [logoUrl ? (jsx(Grid, { container: true, direction: "row", justifyContent: "flex-end", alignItems: "center", padding: "25px", maxWidth: "210px", ml: "auto", children: jsx(Tooltip, { describeChild: true, title: logoTitle ?? "", children: jsx("img", { src: Boolean(dashboardLogoURL) ? dashboardLogoURL : "", alt: "Logo", width: "100%" }) }) })) : null, LanguageComponent ? (jsx(Grid, { container: true, direction: "row", justifyContent: "flex-end", alignItems: "center", padding: "0 35px 0 0", maxWidth: "180px", ml: "auto", children: jsx(LanguageComponent, {}) })) : null, openpwdreset ? (jsx(PasswordRotation, { classes: classes, ResetPassword: ResetPassword, open: openpwdreset, username: loginState.username, accessToken: loginState.access_token, tokenType: loginState.token_type, handleClose: handlePasswordRotationClose, validatePasswordFn: validatePasswordFn })) : (jsx(Fragment$1, { children: loginState.currentFlow === "username" ? (jsx(UsernamePasswordField, { classes: classes, loginState: loginState, verifyUsernamePassword: verifyUsernamePassword, forgotPasswordEndpoint: forgotPasswordEndpoint }, "username")) : (jsx(Fragment$1, { children: loginState.authType === "OTP" ? (jsx(OTPModel, { OTPResendRequest: OTPResendRequest, classes: classes, loginState: loginState, VerifyOTP: VerifyOTP, previousStep: changeUserName, OTPError: t(loginState?.OtpuserMessage ?? ""), setOTPError: (error) => {
1474
- dispath({
1475
- type: "OTPVerificationFailed",
1476
- payload: { error: error },
1477
- });
1478
- }, open: true, handleClose: changeUserName, resendFlag: "LOGIN", setNewRequestID: (newRequestID) => {
1479
- dispath({
1480
- type: "OTPResendSuccess",
1481
- payload: { transactionID: newRequestID },
1482
- });
1483
- otpResendRef.current = otpResendRef.current + 1;
1484
- }, otpresendCount: otpResendRef.current }, "otp")) : loginState.authType === "TOTP" ? (jsxs(Fragment$1, { children: [" ", jsx(OTPModelForm, { OTPResendRequest: OTPResendRequest, classes: classes,
1485
- // handleClose={() => {}}
1486
- handleClose: changeUserName, loginState: loginState, VerifyOTP: VerifyOTP, OTPError: loginState?.OtpuserMessage ?? "", setOTPError: (error) => {
1487
- dispath({
1488
- type: "OTPVerificationFailed",
1489
- payload: { error: error },
1490
- });
1491
- }, resendFlag: "LOGIN", setNewRequestID: (newRequestID) => {
1492
- dispath({
1493
- type: "OTPResendSuccess",
1494
- payload: { transactionID: newRequestID },
1495
- });
1496
- otpResendRef.current = otpResendRef.current + 1;
1497
- }, otpresendCount: otpResendRef.current }, "OTPForm")] })) : (jsx(VerifyFinger, { classes: classes, loginState: loginState, verifyFinger: verifyFinger, previousStep: changeUserName }, "biometric")) })) }))] })] }) }));
1498
- };
1499
-
1500
- const ForgotPasswordFields = ({ classes, loginState, onSubmit, navigate, loginPageEndpoint, }) => {
1501
- const [input, setInput] = useState({
1502
- userName: loginState.workingState === 1 ? loginState?.username : "",
1503
- mobileno: "",
1504
- password: "",
1505
- confirmpassword: "",
1506
- });
1507
- const inputRef = useRef(null);
1508
- const inputPassRef = useRef(null);
1509
- const inputButtonRef = useRef(null);
1510
- const [showPasswordTime, setShowPasswordTime] = useState(0);
1511
- const [showConfirmPasswordTime, setShowConfirmPasswordTime] = useState(0);
1512
- const showPassword = Date.now() < showPasswordTime;
1513
- const showConfirmPassword = Date.now() < showConfirmPasswordTime;
1514
- const [, forceUpdate] = useState();
1515
- const timerRef = useRef(null);
1516
- useEffect(() => {
1517
- return () => clearTimeout(timerRef.current);
1518
- }, []);
1519
- // const navigate = useNavigate();
1520
- const { t } = useTranslation();
1521
- const handleChange = (event) => {
1522
- const name = event.target.name;
1523
- let value = event.target.value;
1524
- if (name === "userName" && value) {
1525
- loginState.isUsernameError = false;
1526
- }
1527
- if (name === "mobileno" && value) {
1528
- value = value.replace(/\D/g, "");
1529
- if (Boolean(value)) {
1530
- loginState.isMobileError = false;
1531
- }
1532
- }
1533
- setInput((values) => ({ ...values, [name]: value }));
1534
- };
1535
- useEffect(() => {
1536
- if (loginState.workingState === 1) {
1537
- setTimeout(() => {
1538
- inputPassRef?.current?.focus?.();
1539
- }, 2000);
1540
- }
1541
- }, [loginState.workingState]);
1542
- return (jsx(Fragment, { children: jsxs("div", { className: classes.formWrap, children: [jsx(TextField, { autoFocus: true, label: t("UserID"), placeholder: String(t("UserID")), fullWidth: true, type: "text", name: "userName", value: input.userName || "", onChange: handleChange, error: loginState.isUsernameError, helperText: loginState.isUsernameError
1543
- ? t(loginState.userMessageforusername)
1544
- : "", InputLabelProps: { shrink: true }, disabled: loginState.loading
1545
- ? true
1546
- : loginState.workingState === 0
1547
- ? false
1548
- : true, autoComplete: "off", ref: inputRef, inputProps: { maxLength: 16 }, onKeyDown: (e) => {
1549
- if (e.key === "Enter") {
1550
- inputButtonRef?.current?.click?.();
1551
- }
1552
- }, style: { paddingBottom: "8px" } }), loginState.workingState === 0 ? (jsx(TextField, { label: t("MobileNo"), placeholder: "Enter Mobile No.",
1553
- // placeholder={String(t("EnterMobileNo"))}
1554
- fullWidth: true, type: "text", name: "mobileno", value: input.mobileno || "", onChange: handleChange, error: loginState.isMobileError, helperText: loginState.isMobileError
1555
- ? t(loginState.userMessageforMobileno)
1556
- : "", InputLabelProps: { shrink: true }, disabled: loginState.loading
1557
- ? true
1558
- : loginState.workingState === 0
1559
- ? false
1560
- : true, autoComplete: "off", onKeyDown: (e) => {
1561
- if (e.key === "Enter") {
1562
- inputButtonRef?.current?.click?.();
1563
- }
1564
- }, inputProps: { maxLength: 13 }, style: { paddingBottom: "8px" } })) : null, loginState.workingState === 1 ? (jsxs(Fragment$1, { children: [jsx(TextField, { autoFocus: true, label: t("Password"), placeholder: "Enter Password", fullWidth: true, type: showPassword ? "text" : "password", name: "password", value: input.password || "", onChange: handleChange, error: loginState.isPasswordError, helperText: loginState.isPasswordError
1565
- ? t(loginState.userMessageforPassword)
1566
- : "", InputLabelProps: { shrink: true }, disabled: loginState.loading, autoComplete: "off", ref: inputPassRef, onKeyDown: (e) => {
1567
- if (e.key === "Enter") {
1568
- inputButtonRef?.current?.click?.();
1569
- }
1570
- }, InputProps: {
1571
- endAdornment: (jsx(InputAdornment, { position: "end", children: jsx(IconButton, { "aria-label": "toggle password visibility", onClick: () => {
1572
- if (!showPassword) {
1573
- setShowPasswordTime(Date.now() + 5000);
1574
- timerRef.current = setTimeout(() => forceUpdate(Date.now()), 5000);
1575
- }
1576
- else if (showPassword)
1577
- setShowPasswordTime(0);
1578
- }, onMouseDown: (e) => e.preventDefault(), disabled: loginState.loading, children: showPassword ? jsx(Visibility, {}) : jsx(VisibilityOff, {}) }) })),
1579
- }, inputProps: { maxLength: 16 }, style: { paddingBottom: "8px" } }), jsx(TextField, { label: t("ConfirmPassword"), placeholder: String(t("EnterConfirmPassword")), fullWidth: true, type: showConfirmPassword ? "text" : "password", name: "confirmpassword", value: input.confirmpassword || "", onChange: handleChange, error: loginState.isConfirmPasswordError, helperText: loginState.isConfirmPasswordError
1580
- ? t(loginState.userMessageforconfirmPassword)
1581
- : "", InputLabelProps: { shrink: true }, disabled: loginState.loading, autoComplete: "off", onKeyDown: (e) => {
1582
- if (e.key === "Enter") {
1583
- inputButtonRef?.current?.click?.();
1584
- }
1585
- }, InputProps: {
1586
- endAdornment: (jsx(InputAdornment, { position: "end", children: jsx(IconButton, { "aria-label": "toggle password visibility", onClick: () => {
1587
- if (!showConfirmPassword) {
1588
- setShowConfirmPasswordTime(Date.now() + 5000);
1589
- timerRef.current = setTimeout(() => forceUpdate(Date.now()), 5000);
1590
- }
1591
- else if (showConfirmPassword)
1592
- setShowConfirmPasswordTime(0);
1593
- }, onMouseDown: (e) => e.preventDefault(), disabled: loginState.loading, children: showConfirmPassword ? jsx(Visibility, {}) : jsx(VisibilityOff, {}) }) })),
1594
- }, inputProps: { maxLength: 16 }, style: { paddingBottom: "8px" } })] })) : null, loginState.isApiError ? (jsx(FormHelperText, { style: { color: "red" }, children: loginState.apierrorMessage })) : null, jsx("div", { style: {
1595
- marginTop: "20px",
1596
- display: "flex",
1597
- flexDirection: "row-reverse",
1598
- }, children: jsx("div", { style: {
1599
- flex: "auto",
1600
- textAlign: "center",
1601
- marginTop: "5px",
1602
- marginBottom: "17px",
1603
- }, children: jsxs("div", { children: [jsx(GradientButton, { style: { borderRadius: "10px", marginRight: "5px" },
1604
- // fullWidth
1605
- disabled: loginState.loading, onClick: () => {
1606
- navigate(loginPageEndpoint);
1607
- }, starticon: "West", rotateIcon: "scale(1.4) rotateX(360deg)", children: t("backtologin") }), jsx(GradientButton, { style: { borderRadius: "10px" }, disabled: loginState.loading, onClick: () => {
1608
- onSubmit(input, loginState.workingState);
1609
- }, ref: inputButtonRef, endicon: loginState.loading ? undefined : "East", rotateIcon: "scale(1.4) rotateX(360deg)", children: loginState.loading ? (jsx(CircularProgress, { size: 25, thickness: 4.6 })) : (t("Next")) })] }) }) })] }) }));
1610
- };
1611
-
1612
- const inititalState = {
1613
- isUsernameError: false,
1614
- userMessageforusername: "",
1615
- loading: false,
1616
- isMobileError: false,
1617
- userMessageforMobileno: "",
1618
- isPasswordError: false,
1619
- userMessageforPassword: "",
1620
- isConfirmPasswordError: false,
1621
- userMessageforconfirmPassword: "",
1622
- workingState: 0,
1623
- isApiError: false,
1624
- apierrorMessage: "",
1625
- otploading: false,
1626
- OtpuserMessage: "",
1627
- otpmodelClose: false,
1628
- requestCd: "",
1629
- username: "",
1630
- auth_type: "O",
1631
- transactionID: "",
1632
- contactUser: "",
1633
- };
1634
- const reducer = (state, action) => {
1635
- switch (action.type) {
1636
- case "verifyUserNameandMobileNoFailed": {
1637
- return {
1638
- ...state,
1639
- loading: false,
1640
- isUsernameError: action?.payload?.isUsernameError ?? false,
1641
- isMobileError: action?.payload?.isMobileError ?? false,
1642
- userMessageforusername: action?.payload?.userMessageforusername ?? "",
1643
- userMessageforMobileno: action?.payload?.userMessageforMobileno ?? "",
1644
- isApiError: action?.payload?.isApiError ?? false,
1645
- apierrorMessage: action?.payload?.apierrorMessage ?? "",
1646
- requestCd: "",
1647
- username: "",
1648
- contactUser: "",
1649
- };
1650
- }
1651
- case "initverifyUserNameandMobileNo": {
1652
- return {
1653
- ...state,
1654
- loading: true,
1655
- isUsernameError: false,
1656
- isMobileError: false,
1657
- requestCd: "",
1658
- username: "",
1659
- };
1660
- }
1661
- case "verifyUserNameandMobileNoSuccess": {
1662
- return {
1663
- ...state,
1664
- loading: false,
1665
- isUsernameError: false,
1666
- isMobileError: false,
1667
- workingState: 0,
1668
- isApiError: false,
1669
- apierrorMessage: "",
1670
- requestCd: action?.payload?.requestCd ?? "",
1671
- username: action?.payload?.username ?? "",
1672
- auth_type: action?.payload?.auth_type,
1673
- company_ID: action?.payload?.company_ID,
1674
- branch_cd: action?.payload?.branch_cd,
1675
- otpValidFor: action?.payload?.otpValidFor,
1676
- contactUser: action?.payload?.contactUser,
1677
- };
1678
- }
1679
- case "inititateOTPVerification": {
1680
- return {
1681
- ...state,
1682
- loading: false,
1683
- otploading: true,
1684
- OtpuserMessage: "",
1685
- otpmodelClose: false,
1686
- };
1687
- }
1688
- case "OTPVerificationComplate": {
1689
- return {
1690
- ...state,
1691
- loading: false,
1692
- otploading: false,
1693
- OtpuserMessage: "",
1694
- workingState: 1,
1695
- otpmodelClose: Boolean(action?.payload?.otpmodelclose),
1696
- };
1697
- }
1698
- case "OTPVerificationFailed": {
1699
- return {
1700
- ...state,
1701
- otploading: false,
1702
- OtpuserMessage: action?.payload?.error,
1703
- otpmodelClose: Boolean(action?.payload?.otpmodelclose),
1704
- };
1705
- }
1706
- case "verifyPasswordFailed": {
1707
- return {
1708
- ...state,
1709
- loading: false,
1710
- isPasswordError: action?.payload?.isPasswordError ?? false,
1711
- isConfirmPasswordError: action?.payload?.isConfirmPasswordError ?? false,
1712
- userMessageforPassword: action?.payload?.userMessageforPassword ?? "",
1713
- userMessageforconfirmPassword: action?.payload?.userMessageforconfirmPassword ?? "",
1714
- isApiError: false,
1715
- apierrorMessage: "",
1716
- };
1717
- }
1718
- case "initverifyPasswordSetReq": {
1719
- return {
1720
- ...state,
1721
- loading: true,
1722
- isPasswordError: false,
1723
- isConfirmPasswordError: false,
1724
- };
1725
- }
1726
- case "passwordRegistaredSuccess": {
1727
- return {
1728
- ...state,
1729
- loading: false,
1730
- isPasswordError: false,
1731
- isConfirmPasswordError: false,
1732
- };
1733
- }
1734
- case "OTPResendSuccess": {
1735
- return {
1736
- ...state,
1737
- requestCd: action?.payload?.requestCd,
1738
- };
1739
- }
1740
- default: {
1741
- return state;
1742
- }
1743
- }
1744
- };
1745
- const ForgotPasswordControllerWrapper = ({ screenFlag, updatenewPassword, validatePasswordFn, veirfyUsernameandMobileNo, verifyOTPForPWDReset, logoUrl, logoTitle, LanguageComponent, bannerDetails, navigate, loginPageEndpoint, }) => {
1746
- const classes = useStyles$3();
1747
- const [loginState, dispath] = useReducer(reducer, inititalState);
1748
- const [open, setOpen] = useState(false);
1749
- const { enqueueSnackbar } = useSnackbar();
1750
- const otpResendRef = useRef(1);
1751
- const { t } = useTranslation();
1752
- const [dashboardLogoURL, setDashboardLogoURL] = useState(null);
1753
- const urlObj = useRef(null);
1754
- useEffect(() => {
1755
- if (Boolean(logoUrl)) {
1756
- if (isBase64(logoUrl)) {
1757
- let blob = utilFunction.base64toBlob(logoUrl);
1758
- urlObj.current =
1759
- typeof blob === "object" && Boolean(blob)
1760
- ? URL.createObjectURL(blob)
1761
- : "";
1762
- setDashboardLogoURL(urlObj.current);
1763
- }
1764
- else {
1765
- setDashboardLogoURL(logoUrl);
1766
- }
1767
- }
1768
- }, [logoUrl]);
1769
- const onSubmitHandel = async (data, flag) => {
1770
- if (verifyRequestData(data, flag)) {
1771
- if (flag === 0) {
1772
- dispath({ type: "initverifyUserNameandMobileNo" });
1773
- const { status, data: resdata, message, } = await veirfyUsernameandMobileNo(data?.userName.toLowerCase(), data?.mobileno, screenFlag);
1774
- if (status === "0") {
1775
- dispath({
1776
- type: "verifyUserNameandMobileNoSuccess",
1777
- payload: {
1778
- requestCd: String(resdata?.TRAN_CD ?? ""),
1779
- username: data?.userName,
1780
- auth_type: resdata?.AUTH_TYPE,
1781
- company_ID: resdata?.COMP_CD,
1782
- branch_cd: resdata?.BRANCH_CD,
1783
- otpValidFor: resdata?.OTP_VALID,
1784
- contactUser: resdata?.CONTACT2,
1785
- },
1786
- });
1787
- setOpen(true);
1788
- }
1789
- else {
1790
- dispath({
1791
- type: "verifyUserNameandMobileNoFailed",
1792
- payload: {
1793
- isApiError: true,
1794
- apierrorMessage: message,
1795
- },
1796
- });
1797
- }
1798
- }
1799
- else if (flag === 1) {
1800
- dispath({ type: "initverifyPasswordSetReq" });
1801
- const { validateStatus, validateData } = await validatePasswordFn({
1802
- USER_ID: data?.userName,
1803
- PASSWORD: data?.password,
1804
- SCREEN_REF: "FORGET_PW"
1805
- });
1806
- // console.log("validateData", validateData?.O_MESSAGE, validateStatus)
1807
- if (validateStatus === "0") {
1808
- switch (validateData?.O_STATUS) {
1809
- case "999":
1810
- dispath({
1811
- type: "verifyPasswordFailed",
1812
- payload: {
1813
- isPasswordError: true,
1814
- userMessageforPassword: validateData?.O_MESSAGE,
1815
- apierrorMessage: validateData?.O_MESSAGE,
1816
- },
1817
- });
1818
- break;
1819
- case "0":
1820
- const { status, data: resdata, message } = await updatenewPassword(loginState?.requestCd, loginState?.username, data?.password);
1821
- if (status === "0") {
1822
- dispath({ type: "passwordRegistaredSuccess" });
1823
- enqueueSnackbar("Password successfully reset", {
1824
- variant: "success",
1825
- });
1826
- navigate(loginPageEndpoint);
1827
- }
1828
- else if (status === "99") {
1829
- dispath({
1830
- type: "verifyPasswordFailed",
1831
- payload: {
1832
- isApiError: true,
1833
- apierrorMessage: message,
1834
- },
1835
- });
1836
- }
1837
- else {
1838
- enqueueSnackbar(message, {
1839
- variant: "error",
1840
- });
1841
- navigate(loginPageEndpoint);
1842
- }
1843
- }
1844
- }
1845
- else {
1846
- dispath({
1847
- type: "verifyPasswordFailed",
1848
- payload: {
1849
- isApiError: true,
1850
- apierrorMessage: validateData?.O_MESSAGE,
1851
- },
1852
- });
1853
- }
1854
- }
1855
- }
1856
- };
1857
- const verifyRequestData = (data, flag) => {
1858
- if (flag === 0) {
1859
- let validationData = {
1860
- isUsernameError: false,
1861
- isMobileError: false,
1862
- userMessageforusername: "",
1863
- userMessageforMobileno: "",
1864
- };
1865
- if (!Boolean(data.userName)) {
1866
- validationData.isUsernameError = true;
1867
- validationData.userMessageforusername = "UsernameisRequired";
1868
- }
1869
- if (!Boolean(data.mobileno)) {
1870
- validationData.isMobileError = true;
1871
- validationData.userMessageforMobileno = "MobileNoisRequired";
1872
- }
1873
- else if (isNaN(data.mobileno) ||
1874
- (data.mobileno.length !== 10 && data.mobileno.length !== 13)) {
1875
- validationData.isMobileError = true;
1876
- validationData.userMessageforMobileno = "Please enter valid Mobile No.";
1877
- }
1878
- dispath({
1879
- type: "verifyUserNameandMobileNoFailed",
1880
- payload: validationData,
1881
- });
1882
- return !(validationData.isMobileError || validationData.isUsernameError);
1883
- }
1884
- else if (flag === 1) {
1885
- let validationData = {
1886
- isPasswordError: false,
1887
- userMessageforPassword: "",
1888
- isConfirmPasswordError: false,
1889
- userMessageforconfirmPassword: "",
1890
- };
1891
- let pwdverify = utilFunction.ValidatePassword(data.password);
1892
- if (Boolean(pwdverify)) {
1893
- validationData.isPasswordError = true;
1894
- validationData.userMessageforPassword = pwdverify;
1895
- }
1896
- if (!Boolean(data.confirmpassword)) {
1897
- validationData.isConfirmPasswordError = true;
1898
- validationData.userMessageforconfirmPassword =
1899
- "Confirmpasswordisrequired";
1900
- }
1901
- else if (Boolean(data.password) &&
1902
- data.password !== data.confirmpassword) {
1903
- validationData.isConfirmPasswordError = true;
1904
- validationData.userMessageforconfirmPassword =
1905
- "New Password and Confirm Password did not matched";
1906
- }
1907
- dispath({
1908
- type: "verifyPasswordFailed",
1909
- payload: validationData,
1910
- });
1911
- return !(validationData.isConfirmPasswordError || validationData.isPasswordError);
1912
- }
1913
- return true;
1914
- };
1915
- const handleClose = () => {
1916
- setOpen(false);
1917
- };
1918
- const VerifyOTP = async (OTPNumber) => {
1919
- if (Boolean(OTPNumber) && OTPNumber.toString().length === 6) {
1920
- dispath({ type: "inititateOTPVerification" });
1921
- const { status, data: resdata, message, } = await verifyOTPForPWDReset(loginState?.requestCd, loginState?.username, OTPNumber, loginState?.auth_type, screenFlag);
1922
- if (status === "0") {
1923
- if (screenFlag === "totp") {
1924
- enqueueSnackbar(message, {
1925
- variant: "success",
1926
- });
1927
- navigate(loginPageEndpoint);
1928
- }
1929
- else {
1930
- dispath({
1931
- type: "OTPVerificationComplate",
1932
- payload: { otpmodelclose: true },
1933
- });
1934
- }
1935
- }
1936
- else if (status === "99") {
1937
- dispath({
1938
- type: "OTPVerificationFailed",
1939
- payload: { error: message },
1940
- });
1941
- }
1942
- else {
1943
- enqueueSnackbar(message, {
1944
- variant: "error",
1945
- });
1946
- navigate(loginPageEndpoint);
1947
- }
1948
- }
1949
- else {
1950
- dispath({
1951
- type: "OTPVerificationFailed",
1952
- payload: { error: "Please enter a 6 digit OTP number" },
1953
- });
1954
- }
1955
- };
1956
- return (jsx(Fragment$1, { children: jsxs(Grid, { container: true, style: { height: "100vh", overflow: "hidden" }, children: [jsx(BankDetails, { bannerDetails: bannerDetails }), jsxs(Grid, { item: true, xs: 6, md: 6, lg: 6, sm: 6, children: [logoUrl ? (jsx(Grid, { container: true, direction: "row", justifyContent: "flex-end", alignItems: "center", padding: "31px", maxWidth: "210px", ml: "auto", children: jsx(Tooltip, { describeChild: true, title: logoTitle ?? "", children: jsx("img", { src: Boolean(dashboardLogoURL) ? dashboardLogoURL : "", alt: "Logo", width: "100%" }) }) })) : null, LanguageComponent ? (jsx(Grid, { container: true, direction: "row", justifyContent: "flex-end", alignItems: "center", padding: "0 35px 0 0", maxWidth: "180px", ml: "auto", children: jsx(LanguageComponent, {}) })) : null, jsx(Container, { maxWidth: "xs", children: jsxs(Grid, { alignItems: "center", style: { paddingTop: "20px" }, children: [jsx("h2", { style: { margin: "10px 0" }, children: loginState.workingState === 1
1957
- ? t("Setnewpassword")
1958
- : screenFlag === "totp"
1959
- ? "Forgot TOTP"
1960
- : t("ForgotPassword") }), open ? (jsx(OTPModelForm, { classes: classes, handleClose: handleClose, loginState: loginState, VerifyOTP: VerifyOTP, OTPError: t(loginState?.OtpuserMessage ?? ""), setOTPError: (error) => {
1961
- dispath({
1962
- type: "OTPVerificationFailed",
1963
- payload: { error: error },
1964
- });
1965
- }, resendFlag: "FORGET_PW", setNewRequestID: (newRequestID) => {
1966
- dispath({
1967
- type: "OTPResendSuccess",
1968
- payload: { requestCd: newRequestID },
1969
- });
1970
- otpResendRef.current = otpResendRef.current + 1;
1971
- }, otpresendCount: otpResendRef.current, OTPResendRequest: undefined })) : (jsx(ForgotPasswordFields, { classes: classes, loginState: loginState, onSubmit: onSubmitHandel, navigate: navigate, loginPageEndpoint: loginPageEndpoint }))] }) })] })] }) }));
1972
- };
1973
-
1974
- const BranchSelectionGridMetaData = {
1975
- gridConfig: {
1976
- dense: true,
1977
- gridLabel: "Access Branch List",
1978
- rowIdColumn: "BRANCH_CD",
1979
- // searchPlaceholder: "Branches",
1980
- defaultColumnConfig: {
1981
- width: 400,
1982
- maxWidth: 450,
1983
- minWidth: 300,
1984
- },
1985
- allowColumnReordering: false,
1986
- disableSorting: false,
1987
- hideHeader: false,
1988
- disableGroupBy: true,
1989
- enablePagination: false,
1990
- containerHeight: {
1991
- min: "68vh",
1992
- max: "68vh ",
1993
- },
1994
- allowFilter: false,
1995
- allowColumnHiding: false,
1996
- allowRowSelection: false,
1997
- isCusrsorFocused: true,
1998
- hideFooter: true,
1999
- },
2000
- columns: [
2001
- {
2002
- accessor: "BRANCH_CD",
2003
- columnName: "Branch Code",
2004
- sequence: 1,
2005
- alignment: "left",
2006
- componentType: "default",
2007
- width: 200,
2008
- minWidth: 140,
2009
- maxWidth: 220,
2010
- },
2011
- {
2012
- accessor: "BRANCH_NM",
2013
- columnName: "Branch Name",
2014
- sequence: 2,
2015
- alignment: "left",
2016
- componentType: "default",
2017
- width: 280,
2018
- minWidth: 280,
2019
- maxWidth: 420,
2020
- },
2021
- {
2022
- accessor: "DISP_STATUS",
2023
- columnName: "Status",
2024
- sequence: 3,
2025
- alignment: "left",
2026
- componentType: "default",
2027
- width: 200,
2028
- minWidth: 140,
2029
- maxWidth: 220,
2030
- },
2031
- {
2032
- accessor: "BEGIN_DATETIME",
2033
- columnName: "Begin Time",
2034
- sequence: 4,
2035
- alignment: "left",
2036
- componentType: "dateTime",
2037
- width: 222,
2038
- minWidth: 140,
2039
- maxWidth: 240,
2040
- },
2041
- {
2042
- accessor: "END_DATETIME",
2043
- columnName: "End Time",
2044
- sequence: 5,
2045
- alignment: "left",
2046
- componentType: "dateTime",
2047
- width: 222,
2048
- minWidth: 140,
2049
- maxWidth: 240,
2050
- },
2051
- {
2052
- accessor: "DAYEND_STATUS",
2053
- columnName: "Dayend Status",
2054
- sequence: 6,
2055
- componentType: "default",
2056
- isVisible: false,
2057
- },
2058
- {
2059
- accessor: "EOD_RUNNING_STATUS",
2060
- columnName: "EOD Running Status",
2061
- sequence: 6,
2062
- componentType: "default",
2063
- isVisible: false,
2064
- },
2065
- {
2066
- accessor: "BASE_COMP_CD",
2067
- columnName: "Base Comp Cd",
2068
- sequence: 6,
2069
- componentType: "default",
2070
- isVisible: false,
2071
- },
2072
- {
2073
- accessor: "BASE_BRANCH_CD",
2074
- columnName: "Base Branch Cd",
2075
- sequence: 6,
2076
- componentType: "default",
2077
- isVisible: false,
2078
- },
2079
- {
2080
- accessor: "COMP_CD",
2081
- columnName: "Comp Cd",
2082
- sequence: 6,
2083
- componentType: "default",
2084
- isVisible: false,
2085
- },
2086
- {
2087
- accessor: "COMP_NM",
2088
- columnName: "Comp Name",
2089
- sequence: 6,
2090
- componentType: "default",
2091
- isVisible: false,
2092
- },
2093
- ],
2094
- };
2095
-
2096
- const useStyles$2 = makeStyles((theme) => ({
2097
- heading_user_img: {
2098
- width: "40px",
2099
- height: "40px",
2100
- // cursor: "pointer",
2101
- },
2102
- heading_user_img_border: {
2103
- border: "2px dashed var(--theme-color3)",
2104
- borderRadius: "50%",
2105
- padding: "4px",
2106
- },
2107
- logo: {
2108
- height: "38px",
2109
- },
2110
- }));
2111
-
2112
- const actions = [
2113
- {
2114
- actionName: "back",
2115
- actionLabel: "Back",
2116
- multiple: false,
2117
- rowDoubleClick: false,
2118
- actionTextColor: "var(--theme-color3)",
2119
- actionBackground: "var(--white)",
2120
- startsIcon: "West",
2121
- rotateIcon: "scale(1.4) rotateX(-360deg)",
2122
- },
2123
- {
2124
- actionName: "proceed",
2125
- actionLabel: "Proceed",
2126
- multiple: false,
2127
- rowDoubleClick: true,
2128
- actionTextColor: "var(--white)",
2129
- actionBackground: "var(--theme-color3)",
2130
- onEnterSubmit: true,
2131
- endsIcon: "East",
2132
- rotateIcon: "scale(1.4) rotateX(-360deg)",
2133
- },
2134
- ];
2135
- const BranchSelectionGrid = ({ selectionMode, authState, isBranchSelectedFn, isLoggedInFn, logoutFn, logos, logo, navigate, BranchSelectionGridDataApiFn, GetMenuDataApiFn, sideImage, branchSelectFn, dashboardUrl, loginUrl, appTranCd, }) => {
2136
- const classes = useStyles$2();
2137
- const { enqueueSnackbar } = useSnackbar();
2138
- const { data, isLoading, isFetching, error, isError } = useQuery(["BranchSelectionGridData"], () => BranchSelectionGridDataApiFn());
2139
- useEffect(() => {
2140
- return () => {
2141
- queryClient.removeQueries(["BranchSelectionGridData", {}]);
2142
- };
2143
- }, []);
2144
- useEffect(() => {
2145
- if (!isLoggedInFn()) {
2146
- navigate(loginUrl);
2147
- }
2148
- else if (isBranchSelectedFn() && selectionMode !== "C") {
2149
- navigate(dashboardUrl);
2150
- }
2151
- }, [isBranchSelectedFn, isLoggedInFn]);
2152
- const mutation = useMutation(GetMenuDataApiFn, {
2153
- onSuccess: (data, extreData) => {
2154
- branchSelectFn({
2155
- menulistdata: data,
2156
- branchCode: extreData?.BRANCH_CD,
2157
- branch: extreData?.BRANCH_NM,
2158
- baseBranchCode: extreData?.BASE_BRANCH_CD,
2159
- });
2160
- },
2161
- });
2162
- const getError = mutation.error;
2163
- const setCurrentAction = useCallback((data) => {
2164
- if (data.name === "proceed") {
2165
- if (data.rows?.length === 0) {
2166
- enqueueSnackbar("Please Select Branch", {
2167
- variant: "error",
2168
- });
2169
- }
2170
- else if (data.rows?.[0]?.data?.STATUS === "C") {
2171
- enqueueSnackbar("Branch is in Day End Status.~rPlease contact system Vendor.", {
2172
- variant: "error",
2173
- });
2174
- }
2175
- else {
2176
- mutation.mutate({
2177
- BASE_COMP_CD: data.rows?.[0]?.data?.BASE_COMP_CD ?? "",
2178
- BASE_BRANCH_CD: data.rows?.[0]?.data?.BASE_BRANCH_CD ?? "",
2179
- COMP_CD: data.rows?.[0]?.data?.COMP_CD ?? "",
2180
- BRANCH_CD: data.rows?.[0]?.data?.BRANCH_CD ?? "",
2181
- GROUP_NAME: authState?.groupName ?? "",
2182
- APP_TRAN_CD: appTranCd,
2183
- COMP_NM: data.rows?.[0]?.data?.COMP_NM ?? "",
2184
- BRANCH_NM: data.rows?.[0]?.data?.BRANCH_NM ?? "",
2185
- DAYEND_STATUS: data.rows?.[0]?.data?.DAYEND_STATUS ?? "",
2186
- EOD_RUNNING_STATUS: data.rows?.[0]?.data?.EOD_RUNNING_STATUS ?? "",
2187
- IS_UPD_DEF_BRANCH: authState?.user?.isUpdDefBranch ?? "",
2188
- COMP_BASE_BRANCH_CD: data.rows?.[0]?.data?.COMP_BASE_BRANCH_CD ?? "",
2189
- selectionMode: selectionMode,
2190
- });
2191
- }
2192
- }
2193
- else if (data.name === "back") {
2194
- if (selectionMode === "C") {
2195
- navigate(dashboardUrl, {
2196
- replace: true,
2197
- });
2198
- }
2199
- else {
2200
- logoutFn();
2201
- }
2202
- }
2203
- }, [navigate, data, mutation]);
2204
- useEffect(() => {
2205
- var oneBranchOpen = data?.some((branch) => branch.STATUS === "O");
2206
- if (oneBranchOpen === false) {
2207
- enqueueSnackbar("Branch is in Day End Status.~rPlease contact system Vendor.", {
2208
- variant: "error",
2209
- });
2210
- logoutFn();
2211
- }
2212
- if (data?.length === 1) {
2213
- if (data?.[0]?.STATUS === "O") {
2214
- setCurrentAction({ name: "proceed", rows: [{ data: { ...data[0] } }] });
2215
- }
2216
- }
2217
- }, [JSON.stringify(data)]);
2218
- const Greetings = () => {
2219
- let hours = new Date().getHours();
2220
- let greet;
2221
- if (hours < 12)
2222
- greet = "morning";
2223
- else if (hours >= 12 && hours <= 16)
2224
- greet = "afternoon";
2225
- else if (hours >= 16 && hours <= 24)
2226
- greet = "evening";
2227
- return jsxs("span", { children: ["Good ", greet, ","] });
2228
- };
2229
- const LightTooltip = styled(({ className, ...props }) => (jsx(Tooltip, { ...props, classes: { popper: className } })))(({ theme }) => ({
2230
- [`& .${tooltipClasses.tooltip}`]: {
2231
- backgroundColor: theme.palette.common.white,
2232
- color: "rgba(0, 0, 0, 0.87)",
2233
- boxShadow: theme.shadows[1],
2234
- fontSize: 13,
2235
- },
2236
- }));
2237
- // const greet = Greetings();
2238
- return (jsx(Fragment$1, { children: jsxs(Grid, { container: true, style: {
2239
- margin: "0",
2240
- padding: "0",
2241
- height: "100vh",
2242
- // overflowY: "hidden",
2243
- }, children: [sideImage ? (jsx(Grid, { item: true, lg: 1, md: 1, xl: 1, xs: 1, sm: 1, children: jsx("img", { className: "sideImage", src: sideImage, alt: "side-Image" }) })) : null, jsx(Grid, { item: true, lg: 11, md: 11, xl: 11, xs: 11, style: {
2244
- display: "flex",
2245
- justifyContent: "center",
2246
- }, children: jsxs(Grid, { container: true, style: {
2247
- minHeight: "100vh",
2248
- padding: "10px 0px 0px 0px",
2249
- }, lg: 11, md: 11, xl: 11, xs: 11, children: [jsxs(Grid, { container: true, style: {
2250
- margin: "0",
2251
- padding: "0",
2252
- // height: "12vh",
2253
- }, lg: 12, md: 12, xl: 12, xs: 12, children: [jsx(Grid, { xs: 12, sm: 1, md: 1, lg: 1, xl: 1, sx: {
2254
- display: "flex",
2255
- alignItems: "center",
2256
- // justifyContent: "center",
2257
- }, children: jsx(Stack, { direction: "row", spacing: 4, ml: 1, children: jsx(Box, { className: classes.heading_user_img_border, sx: { cursor: "pointer" }, children: jsx(LightTooltip, { title: jsxs(Fragment$1, { children: [jsxs("div", { children: ["User ID : ", authState?.user?.id ?? ""] }), jsxs("div", { children: ["Role : ", authState?.roleName ?? ""] }), jsx("div", { children: "Last Unsuccessful Login : \"\"" })] }), placement: "bottom-start", children: jsx(Avatar, { className: classes.heading_user_img,
2258
- // onClick={handleNavigate}
2259
- alt: "Remy Sharp", src: Boolean(logos?.profile)
2260
- ? logos?.profile
2261
- : USER_PROFILE_DEFAULT }) }) }) }) }), jsxs(Grid, { xs: 12, sm: 5, md: 5, lg: 5, xl: 5, sx: {
2262
- justifyContent: "center",
2263
- display: "flex",
2264
- flexDirection: "column",
2265
- }, children: [jsxs("h1", { className: "name-heading", style: { fontSize: "24px", margin: "4px 0px" }, children: ["Welcome ", jsx("span", { children: `${authState?.user?.name ?? ""},` })] }), jsxs("div", { style: { display: "flex", alignItems: "center", gap: 10 }, children: [jsx("h3", { style: { margin: "4px 0px" }, children: Greetings() }), jsx("img", { src: Waving_hand, alt: "", style: { height: "18px" } })] })] }), jsx(Grid, { xs: 12, sm: 1, md: 1, lg: 1, xl: 1, sx: {
2266
- display: "flex",
2267
- // flexDirection: "column",
2268
- justifyContent: "center",
2269
- alignItems: "center",
2270
- }, children: jsx(Stack, { direction: "row", justifyContent: "flex-start", spacing: 2, children: jsx(Box, { className: classes.heading_user_img_border, children: jsx(Avatar, { className: classes.heading_user_img, alt: "Remy Sharp", src: Boolean(logos?.bank) ? logos?.bank : bank_logo_default }) }) }) }), jsxs(Grid, { xs: 12, sm: 3, md: 3, lg: 3, xl: 3, sx: {
2271
- display: "flex",
2272
- flexDirection: "column",
2273
- justifyContent: "center",
2274
- }, children: [jsx("div", { className: "bank-name-container", style: { fontSize: "14px" }, children: jsx("p", { className: "bank-name", children: `Bank Name: ${authState?.companyName ?? ""}` }) }), jsx("p", { className: "emp-id", children: `Emp. Id: ${authState?.user?.employeeID ?? ""}` })] }), jsxs(Grid, { xs: 12, sm: 3, md: 3, lg: 2, xl: 2, sx: {
2275
- display: "flex",
2276
- alignItems: "center",
2277
- justifyContent: "right",
2278
- }, children: [" ", jsx("div", { children: jsx("img", { src: Boolean(logos?.logo) ? logos?.logo : logo, alt: "bank_logo", className: classes.logo }) })] })] }), isError ? (jsx(Fragment, { children: jsx("div", { style: { width: "100%", paddingTop: "10px" }, children: jsx(Alert, { severity: error?.severity ?? "error", errorMsg: error?.error_msg ?? "Error", errorDetail: error?.error_detail ?? "" }) }) })) : mutation.isError && mutation.error ? (jsx(Fragment, { children: jsx("div", { style: { width: "100%", paddingTop: "10px" }, children: jsx(Alert, { severity: getError.severity ?? "error", errorMsg: getError.error_msg ?? "Error", errorDetail: getError.error_detail ?? "" }) }) })) : null, jsx(GridWrapper, { finalMetaData: BranchSelectionGridMetaData, data: data ?? [], setData: () => null, actions: actions, setAction: setCurrentAction, controlsAtBottom: true, actionContextAtBottom: true, headerToolbarStyle: {
2279
- background: "#fff !important",
2280
- padding: "0",
2281
- "& .MuiTypography-root": {
2282
- color: "black",
2283
- },
2284
- }, disableMultipleRowSelect: true, variant: "outlined", loading: isLoading || isFetching || mutation.isLoading, defaultSelectedRowId: authState?.user?.branchCode ?? null }, `branchSelection`), isError || data?.length === 0 ? (jsx(Button, { sx: {
2285
- backgroundColor: "var(--theme-color3)",
2286
- position: "absolute",
2287
- right: "113px",
2288
- bottom: "20px",
2289
- width: "7rem",
2290
- "&:hover": {
2291
- backgroundColor: "var(--theme-color3)",
2292
- },
2293
- }, onClick: () => {
2294
- if (selectionMode === "C") {
2295
- navigate(dashboardUrl, {
2296
- replace: true,
2297
- });
2298
- }
2299
- else {
2300
- logoutFn();
2301
- }
2302
- }, children: "Back" })) : null] }) })] }) }));
2303
- };
2304
- const BranchSelectionGridWrapper = (props) => {
2305
- return (jsx(ClearCacheProvider, { children: jsx(BranchSelectionGrid, { ...props }) }));
2306
- };
2307
-
2308
- const useStyles$1 = makeStyles((theme) => ({
2309
- appBar: {
2310
- // zIndex: theme.zIndex.drawer + 1,
2311
- transition: theme.transitions.create(["width", "margin"], {
2312
- easing: theme.transitions.easing.sharp,
2313
- duration: theme.transitions.duration.leavingScreen,
2314
- }),
2315
- color: "#0063A3",
2316
- height: "80px",
2317
- background: "var(--white)",
2318
- boxShadow: "0px 1px 0px -0.5px #DEE0E2",
2319
- },
2320
- searchBar: {
2321
- width: 290,
2322
- border: "none",
2323
- color: "rgba(0, 0, 0, 0.87) !important",
2324
- backgroundColor: "rgb(235 237 238 / 26%)!important",
2325
- "& input": {
2326
- width: "100% !important",
2327
- },
2328
- },
2329
- searchList: {
2330
- position: "absolute",
2331
- background: "#fff",
2332
- width: "100%",
2333
- borderRadius: "6px",
2334
- boxShadow: "0 12px 25px rgba(0,0,0,.3)",
2335
- top: "120%",
2336
- height: "auto",
2337
- maxHeight: "325px",
2338
- overflowY: "auto",
2339
- "& .list-links": {
2340
- background: "none",
2341
- border: "none",
2342
- outline: "none",
2343
- cursor: "pointer",
2344
- textDecoration: "none",
2345
- padding: "0.7rem 1rem",
2346
- fontSize: "0.90rem",
2347
- textAlign: "left",
2348
- borderBottom: "1px solid #ddd",
2349
- color: "#222 !important",
2350
- fontWeight: 500,
2351
- "&:hover, &.active": {
2352
- backgroundColor: "#f4f4f4",
2353
- },
2354
- },
2355
- },
2356
- appBarShift: {
2357
- paddingLeft: "0px",
2358
- // width: `calc(100% - ${drawerWidth}px)`,
2359
- transition: theme.transitions.create(["width", "margin"], {
2360
- easing: theme.transitions.easing.sharp,
2361
- duration: theme.transitions.duration.enteringScreen,
2362
- background: "rgba(250, 251, 255, 0.9)",
2363
- }),
2364
- },
2365
- heading_user_dtl: {
2366
- width: "458px",
2367
- height: "73px",
2368
- left: "37px",
2369
- top: "calc(50% - 73px/2)",
2370
- },
2371
- heading_user_img: {
2372
- width: "40px",
2373
- height: "40px",
2374
- // cursor: "pointer",
2375
- },
2376
- heading_user_img_border: {
2377
- border: "2px dashed var(--theme-color3)",
2378
- borderRadius: "50%",
2379
- padding: "4px",
2380
- },
2381
- toolbar: {
2382
- minHeight: "80px",
2383
- paddingLeft: "0px",
2384
- height: "80px",
2385
- },
2386
- title: {
2387
- flexGrow: 1,
2388
- padding: theme.spacing(0.5, 0),
2389
- color: "var(--theme-color1)",
2390
- },
2391
- searchRoot: {
2392
- fontFamily: theme.typography.fontFamily,
2393
- position: "relative",
2394
- boxShadow: "0px 2px 4px -1px rgba(0,0,0,0.2), 0px 4px 5px 0px rgba(0,0,0,0.14), 0px 1px 10px 0px rgba(0,0,0,0.12)",
2395
- marginRight: theme.spacing(2),
2396
- marginLeft: theme.spacing(1),
2397
- marginBottom: theme.spacing(0.25),
2398
- marginTop: theme.spacing(0.25),
2399
- borderRadius: 40,
2400
- backgroundColor: alpha(theme.palette.common.white, 0.15),
2401
- "&:hover": {
2402
- backgroundColor: alpha(theme.palette.common.white, 0.25),
2403
- },
2404
- "& $inputInput": {
2405
- transition: theme.transitions.create("width"),
2406
- width: 120,
2407
- "&:focus": {
2408
- width: 170,
2409
- },
2410
- },
2411
- },
2412
- search: {
2413
- width: theme.spacing(6),
2414
- height: "100%",
2415
- position: "absolute",
2416
- pointerEvents: "none",
2417
- display: "flex",
2418
- alignItems: "center",
2419
- justifyContent: "center",
2420
- },
2421
- inputRoot: {
2422
- color: "inherit",
2423
- marginTop: 0,
2424
- borderRadius: "40px",
2425
- },
2426
- inputInput: {
2427
- padding: theme.spacing(1, 1, 1, 6),
2428
- },
2429
- loggedInUser: {
2430
- marginLeft: theme.spacing(2),
2431
- },
2432
- nameClass: {
2433
- color: "#0063A3",
2434
- fontWeight: 600,
2435
- textTransform: "capitalize",
2436
- lineHeight: "1.4",
2437
- textAlign: "left",
2438
- },
2439
- dropDown: {
2440
- fontSize: "2rem",
2441
- },
2442
- vTop: {
2443
- verticalAlign: "top",
2444
- paddingLeft: "4px",
2445
- color: "var(--theme-color1)",
2446
- },
2447
- userDesignation: {
2448
- margin: "0px",
2449
- fontWeight: 500,
2450
- fontSize: "0.875rem",
2451
- lineHeight: 1.57,
2452
- color: "var(--theme-color1)",
2453
- },
2454
- userName: {
2455
- margin: "0px",
2456
- fontWeight: 500,
2457
- fontSize: "0.875rem",
2458
- lineHeight: 1.57,
2459
- color: "var(--theme-color3)",
2460
- },
2461
- userprofilehover: {
2462
- "&:hover": {
2463
- backgroundColor: "var(--white)",
2464
- },
2465
- },
2466
- lang_svg: {
2467
- marginRight: "10px",
2468
- width: "22px",
2469
- height: "22px",
2470
- },
2471
- logo: {
2472
- height: "38px",
2473
- },
2474
- version01: {
2475
- margin: "0",
2476
- textAlign: "center",
2477
- color: "var(--theme-color3)",
2478
- fontSize: "9px",
2479
- },
2480
- DrawerClose_icon: {
2481
- color: "var(--theme-color3)",
2482
- position: "static",
2483
- background: "transperant",
2484
- "&:hover": {
2485
- background: "var(--theme-color4)",
2486
- },
2487
- width: "46px",
2488
- height: "46px",
2489
- },
2490
- marquee: {
2491
- animation: "$marquee 10s linear infinite",
2492
- animationDelay: "3s",
2493
- },
2494
- "@keyframes marquee": {
2495
- "0%": { transform: "translateX(100%)" },
2496
- "100%": { transform: "translateX(-100%)" },
2497
- },
2498
- popover: {
2499
- popover: {
2500
- maxWidth: "100%",
2501
- width: "fit-content",
2502
- "& .MuiPopover-paper": {
2503
- maxWidth: "100%",
2504
- },
2505
- },
2506
- },
2507
- }));
2508
-
2509
- const AppbarWrapper = ({ handleDrawerOpen, handleDrawerClose, open, authState, LanguageComponent, SearchComponent, dashboardUrl, logos, bankLogo, profilePic, handleLogout, handleProfile, navigate, hideGreetings, menuIconPosition = "left", }) => {
2510
- const classes = useStyles$1();
2511
- const { t } = useTranslation();
2512
- const LightTooltip = styled(({ className, ...props }) => (jsx(Tooltip, { ...props, classes: { popper: className } })))(({ theme }) => ({
2513
- [`& .${tooltipClasses.tooltip}`]: {
2514
- backgroundColor: theme.palette.common.white,
2515
- color: "rgba(0, 0, 0, 0.87)",
2516
- boxShadow: theme.shadows[1],
2517
- fontSize: 13,
2518
- },
2519
- }));
2520
- const Greetings = () => {
2521
- let hours = new Date().getHours();
2522
- let greet;
2523
- if (hours < 12)
2524
- greet = "morning";
2525
- else if (hours >= 12 && hours <= 16)
2526
- greet = "afternoon";
2527
- else if (hours >= 16 && hours <= 24)
2528
- greet = "evening";
2529
- return jsxs("span", { children: ["Good ", greet, ","] });
2530
- };
2531
- return (jsx(AppBar, { position: "fixed", elevation: 0, className: clsx(classes.appBar, open && classes.appBarShift), children: jsxs(Toolbar, { className: classes.toolbar, children: [jsxs(Box, { sx: {
2532
- display: "flex",
2533
- justifyContent: "space-evenly",
2534
- alignItems: "center",
2535
- height: "80px",
2536
- width: "227px",
2537
- flexDirection: menuIconPosition === "right" ? "row-reverse" : "row",
2538
- }, children: [open ? (jsx(IconButton$1, { disableRipple: true, onClick: () => handleDrawerClose(), className: classes.DrawerClose_icon, children: jsx(MenuOutlinedIcon, { fontSize: "large" }) })) : (jsx(IconButton$1, { disableRipple: true, "aria-label": "open drawer", onClick: () => handleDrawerOpen(), className: classes.DrawerClose_icon, children: jsx(MenuOutlinedIcon, { fontSize: "large" }) })), jsxs("div", { children: [jsx("img", { src: Boolean(logos?.logo) ? logos?.logo : bankLogo, alt: "bank_logo", className: classes.logo, onClick: (e) => {
2539
- e.preventDefault();
2540
- navigate(dashboardUrl ?? "./dashboard");
2541
- } }), jsx("p", { className: classes.version01, children: logos?.version })] })] }), jsx(Stack, { direction: "row", spacing: 4, mx: 2, children: jsx(Box, { className: classes.heading_user_img_border, children: jsx(Avatar, { className: classes.heading_user_img, alt: "Remy Sharp", src: Boolean(logos?.bank) ? logos?.bank : bank_logo_default }) }) }), jsxs(Typography, { component: "h1", variant: "h6", color: "inherit", noWrap: true, className: classes.title, children: [jsx(Box, { style: {
2542
- marginBottom: "8px",
2543
- fontSize: "17px",
2544
- color: "var(--theme-color1)",
2545
- width: "555px",
2546
- }, className: clsx({
2547
- [classes.marquee]: authState?.companyName.length > 55,
2548
- }), children: authState?.companyName || "" }), jsx("div", { style: { display: "flex", gap: "8px" }, children: jsxs("div", { style: { color: "var(--theme-color6)" }, children: [jsxs(Typography, { variant: "caption", display: "block", lineHeight: 0, fontSize: "11px", children: [t("appBar.Branch"), ":", authState?.user?.branchCode ?? "001 ", "-", authState?.user?.branch ?? ""] }), jsxs(Typography, { variant: "caption", display: "inline", fontSize: "11px", children: [t("appBar.WorkingDate"), ":", " ", Boolean(authState?.workingDate)
2549
- ? checkDateAndDisplay(format(new Date(authState?.workingDate), "dd/MM/yyyy"))
2550
- : "not found"] }), jsxs(Typography, { marginLeft: 1, variant: "caption", display: "inline", fontSize: "11px", children: [t("appBar.LastLoginDate"), " :", " ", checkDateAndDisplay(authState?.user?.lastLogin ?? "Vastrapur")] })] }) })] }), jsxs(Box, { children: [!hideGreetings ? (jsx(Box, { sx: { marginBottom: "3px", paddingRight: "15px" }, children: jsxs(Stack, { direction: "row", spacing: 2, justifyContent: "flex-end", alignItems: "center", children: [jsxs(Typography, { fontSize: "17px", color: "#1C1C1C", children: [Greetings(), " ", authState?.user?.id ?? ""] }), jsx("img", { src: Waving_hand, alt: "", style: { height: "18px" } })] }) })) : null, jsxs(Box, { display: "flex", justifyContent: "space-evenly", alignItems: "center", children: [SearchComponent ? jsx(SearchComponent, {}) : null, LanguageComponent ? jsx(LanguageComponent, {}) : null, jsx(Box, { maxWidth: 170, display: "flex", justifyContent: "end", children: jsx(Tooltip, { title: "Logout", placement: "bottom", arrow: true, children: jsx(IconButton$1, { onClick: () => typeof handleLogout === "function" ? handleLogout() : null, color: "error", sx: {
2551
- backgroundColor: "rgba(235, 237, 238, 0.45)",
2552
- borderRadius: "10px",
2553
- height: "30px",
2554
- width: "30px",
2555
- "&:hover": {
2556
- background: "var(--white)",
2557
- borderRadius: "10px",
2558
- transition: "all 0.2s ease 0s",
2559
- boxShadow: "rgba(0, 0, 0, 0.16) 0px 3px 6px, rgba(0, 0, 0, 0.23) 0px 3px 6px",
2560
- "& .MuiSvgIcon-root": {
2561
- height: "32px",
2562
- width: "32px",
2563
- transition: "all 0.2s ease 0s",
2564
- padding: "4px",
2565
- },
2566
- },
2567
- }, "aria-label": "show 4 new mails", children: jsx(LogoutIcon, {}) }) }) })] })] }), jsx(Stack, { direction: "row", spacing: 4, ml: 1, children: jsx(Box, { className: classes.heading_user_img_border, sx: { cursor: "pointer" }, children: jsx(LightTooltip, { title: jsxs(Fragment$1, { children: [jsxs("div", { children: [" ", t("appBar.UserID"), ": ", authState?.user?.id] }), jsxs("div", { children: [t("appBar.Role"), " : ", authState?.roleName] }), jsxs("div", { children: [t("appBar.LastUnsuccessfulLogin"), " : \"\""] })] }), placement: "bottom-start", children: jsx(Avatar, { className: classes.heading_user_img, onClick: () => typeof handleProfile === "function" ? handleProfile() : null, alt: "Remy Sharp", src: profilePic ?? "" }) }) }) })] }) }));
2568
- };
2569
- const checkDateAndDisplay = (dateStr) => {
2570
- // const dt = new Date(dateStr);
2571
- // //@ts-ignore
2572
- // if (dt instanceof Date && !isNaN(dt)) {
2573
- // return dt.toDateString();
2574
- // }
2575
- if (Boolean(dateStr)) {
2576
- return dateStr;
2577
- }
2578
- return "N/A";
2579
- };
2580
-
2581
- const drawerWidth = 227;
2582
- const useStyles = makeStyles((theme) => {
2583
- return {
2584
- drawerPaper: {
2585
- position: "relative",
2586
- whiteSpace: "nowrap",
2587
- width: drawerWidth,
2588
- transition: theme.transitions.create("width", {
2589
- easing: theme.transitions.easing.sharp,
2590
- duration: theme.transitions.duration.enteringScreen,
2591
- }),
2592
- border: "none",
2593
- overflow: "hidden",
2594
- zIndex: 120,
2595
- },
2596
- drawerPaperClose: {
2597
- overflowX: "hidden",
2598
- transition: theme.transitions.create("width", {
2599
- easing: theme.transitions.easing.sharp,
2600
- duration: theme.transitions.duration.leavingScreen,
2601
- }),
2602
- width: theme.spacing(8),
2603
- [theme.breakpoints.up("sm")]: {
2604
- width: theme.spacing(8),
2605
- },
2606
- },
2607
- toolbarIcon: {
2608
- display: "flex",
2609
- alignItems: "center",
2610
- zIndex: 9999,
2611
- ...theme.mixins.toolbar,
2612
- background: "var(--white)",
2613
- justifyContent: "center",
2614
- height: "80px",
2615
- // borderBottom: "1px dashed #949597",
2616
- },
2617
- hrCSS: {
2618
- zIndex: 9999,
2619
- },
2620
- buttonLink: {
2621
- backgroundColor: "transparent",
2622
- border: "none",
2623
- cursor: "pointer",
2624
- textDecoration: "underline",
2625
- display: "inline",
2626
- margin: 0,
2627
- padding: 0,
2628
- "&:focus": {
2629
- textDecoration: "none",
2630
- },
2631
- "$:hover": {
2632
- textDecoration: "none",
2633
- },
2634
- },
2635
- };
2636
- });
2637
- /*
2638
-
2639
- */
2640
-
2641
- const reportMetaData = [];
2642
-
2643
- // import { createTheme } from "@mui/material";
2644
- // const theme = createTheme();
2645
- makeStyles((theme) => ({
2646
- navBarCSS: {
2647
- padding: "4px 1rem ",
2648
- backgroundColor: "#fff !important",
2649
- minHeight: "64px",
2650
- boxShadow: "0 3px 6px rgba(0,0,0,0.03)",
2651
- margin: "10px",
2652
- },
2653
- headerDropdown: {
2654
- backgroundColor: "#fff",
2655
- minWidth: "205px",
2656
- boxShadow: "0 3px 6px rgba(0,0,0,0.16)",
2657
- textDecoration: "none",
2658
- borderBottom: "3px solid #26A456",
2659
- },
2660
- navLinkHeader: {
2661
- color: "#555",
2662
- fontSize: "14px",
2663
- lineHeight: "1.2",
2664
- paddingTop: "4px",
2665
- paddingBottom: "4px",
2666
- paddingRight: ".5rem",
2667
- paddingLeft: ".5rem",
2668
- fontWeight: 600,
2669
- textTransform: "capitalize",
2670
- display: "flex",
2671
- alignItems: "center",
2672
- cursor: "pointer",
2673
- "& hover": {
2674
- color: "#0b6fb8",
2675
- },
2676
- },
2677
- productLink: {
2678
- color: "#555",
2679
- padding: "0 1rem 8px 1rem",
2680
- display: "inline-block",
2681
- verticalAlign: "middle",
2682
- cursor: "pointer",
2683
- textTransform: "capitalize",
2684
- },
2685
- font13: {
2686
- fontSize: "13px",
2687
- },
2688
- loginDropdown: {
2689
- width: "160px",
2690
- },
2691
- }));
2692
- const useStylesSideBar = makeStyles((theme) => ({
2693
- root: {
2694
- justifyContent: "center",
2695
- },
2696
- drawer: {
2697
- margin: "5px",
2698
- },
2699
- item: {
2700
- display: "flex",
2701
- //borderBottom: "2px solid #93242433",
2702
- borderRadius: "8px",
2703
- marginLeft: "7px",
2704
- marginTop: "6.5px",
2705
- width: "90%",
2706
- height: "50px",
2707
- paddingLeft: theme.spacing(2),
2708
- paddingRight: theme.spacing(2),
2709
- background: "var(--white)",
2710
- boxShadow: "3px 6px 9px rgba(93, 95, 121, 0.26)",
2711
- "& svg": {
2712
- // color: theme.palette.primary.main,
2713
- color: "var(--theme-color1)",
2714
- },
2715
- "&:hover": {
2716
- boxShadow: "6px 6px 1px -1px rgba(0,0,0,0.2), 0px 1px 1px 0px rgba(0,0,0,0.14), 0px 1px 0px 0px rgba(0,0,5,0.12)",
2717
- background: "var(--theme-color4)",
2718
- transition: "0.6s ease",
2719
- },
2720
- },
2721
- drawerIconSize: {
2722
- width: "50px",
2723
- height: "50px",
2724
- padding: "18px",
2725
- justifyItems: "cenetr",
2726
- },
2727
- button: {
2728
- color: "#0063A3",
2729
- padding: "10px 8px",
2730
- //justifyContent: "flex-start",
2731
- textTransform: "none",
2732
- letterSpacing: 0,
2733
- width: "100%",
2734
- textAlign: "left",
2735
- "&:hover": {
2736
- backgroundColor: "var(--theme-color1)",
2737
- // boxShadow: "0px 15px 20px rgb(221 176 176 / 37%)",
2738
- },
2739
- },
2740
- btnRoot: {
2741
- paddingLeft: "24px",
2742
- justifyContent: "left ",
2743
- },
2744
- navLinks: {
2745
- // height: "calc(100vh - 78px)",
2746
- overflowY: "auto",
2747
- overflowX: "hidden",
2748
- // height:"100px",
2749
- backgroundColor: "rgba(250, 251, 255, 0.9);",
2750
- // height: "calc(100vh - 230px)",
2751
- //background: "var(--theme-color1)",
2752
- // marginTop: "25px",
2753
- // boxShadow: "0 3px 6px rgba(255, 99, 71, 0.3)",
2754
- borderRadius: "10px",
2755
- paddingTop: "5px",
2756
- //margin: "5px",
2757
- },
2758
- navLinksforseparateView: {
2759
- overflowY: "auto",
2760
- overflowX: "hidden",
2761
- height: "calc(100vh - 180px)",
2762
- // height:"auto",
2763
- paddingTop: "10px",
2764
- },
2765
- nestedMenuLevel1: {
2766
- paddingLeft: "20px",
2767
- marginTop: "11px",
2768
- paddingRight: theme.spacing(3),
2769
- height: "auto",
2770
- fontSize: "13px",
2771
- "& div > svg": {
2772
- fontSize: "14px",
2773
- },
2774
- },
2775
- nestedMenuLevel2: {
2776
- paddingLeft: "20px",
2777
- marginTop: "11px",
2778
- fontSize: "12px",
2779
- "& div > svg": {
2780
- fontSize: "9px",
2781
- },
2782
- },
2783
- listIcon: {
2784
- minWidth: "30px !important",
2785
- justifyItems: "center",
2786
- color: "var(--theme-color6)",
2787
- fontWeight: 700,
2788
- fontSize: "18px",
2789
- },
2790
- link: {
2791
- fontSize: "1rem ",
2792
- marginTop: "2px",
2793
- marginBottom: "2px",
2794
- textOverflow: "ellipsis",
2795
- color: "var(--theme-color1)",
2796
- marginLeft: "15px",
2797
- whiteSpace: "break-spaces",
2798
- "& span": {
2799
- fontWeight: 400,
2800
- whiteSpace: "break-spaces",
2801
- },
2802
- "& p": {
2803
- color: "var(--theme-color3)",
2804
- fontweight: 400,
2805
- },
2806
- },
2807
- linktext: {
2808
- backgroundColor: "var(--white)",
2809
- "&:hover": {
2810
- background: "var(--theme-color1)",
2811
- "& div": {
2812
- color: "var(--white) !important",
2813
- },
2814
- "& div > svg": {
2815
- color: "var(--white) !important",
2816
- },
2817
- },
2818
- },
2819
- faSmall: {
2820
- fontSize: "13px ",
2821
- },
2822
- openList: {
2823
- ":not(activeMenuItem)": {
2824
- "& > div": {
2825
- backgroundColor: "rgba(0, 0, 0, 0.04)",
2826
- },
2827
- "& *": {
2828
- color: "var(--white)",
2829
- },
2830
- },
2831
- },
2832
- openCurrent: {
2833
- backgroundColor: "var(--theme-color1)",
2834
- "& *": {
2835
- color: "var(--white)",
2836
- },
2837
- "&:hover": {
2838
- backgroundColor: "var(--theme-color1)",
2839
- },
2840
- },
2841
- slimList: {
2842
- paddingTop: "15px",
2843
- paddingBottom: "13px",
2844
- height: "auto",
2845
- paddingLeft: "15px",
2846
- justifyItems: "center",
2847
- },
2848
- activeMenuItem: {
2849
- backgroundColor: "var(--theme-color1)!important ",
2850
- "& > div": {
2851
- color: "var(--white)!important",
2852
- },
2853
- "& svg": {
2854
- color: "var(--theme-color4)",
2855
- },
2856
- "& hover": {
2857
- "& > div": {
2858
- color: "var(--theme-color3)",
2859
- },
2860
- },
2861
- "& p": {
2862
- color: "var(--theme-color6)",
2863
- },
2864
- },
2865
- }));
2866
-
2867
- let localdrawerOpen = true;
2868
- const SideBarNav = ({ metaData, handleDrawerOpen, drawerOpen, setView, slimSize, setNewFilterData, setNewFilterView, isFromSeparetView = false, rootUrl, dashboardUrl, navigate, }) => {
2869
- const classes = useStylesSideBar();
2870
- let result = null;
2871
- localdrawerOpen = drawerOpen;
2872
- if (Array.isArray(metaData.navItems)) {
2873
- result = metaData.navItems.map((one) => {
2874
- if (one?.seperateView === true) {
2875
- return (jsx(SeperateListView, { item: one, setView: setView, classes: classes, level: 0, slimSize: slimSize, setNewFilterData: setNewFilterData, setNewFilterView: setNewFilterView }, one.label));
2876
- }
2877
- else if (Array.isArray(one.children)) {
2878
- return (jsx(NestedListItem, { item: one, classes: classes, level: 0, handleDrawerOpen: handleDrawerOpen, drawerOpen: drawerOpen, slimSize: slimSize, rootUrl: rootUrl, dashboardUrl: dashboardUrl, navigate: navigate }, one.label));
2879
- }
2880
- else {
2881
- return (jsx(SingleListItem, { item: one, classes: classes, level: 0, slimSize: slimSize, drawerOpen: drawerOpen, rootUrl: rootUrl, dashboardUrl: dashboardUrl, navigate: navigate }, one.label));
2882
- }
2883
- });
2884
- }
2885
- return (jsx(List, { component: "nav", disablePadding: true, className: isFromSeparetView ? classes.navLinksforseparateView : classes.navLinks, children: jsx(ScrollBar, { children: result }) }));
2886
- };
2887
- const SeperateListView = ({ item, setView, level, classes, slimSize, setNewFilterData, setNewFilterView, }) => {
2888
- let labelStart = (item.label || "").toLowerCase().substring(0, 1) || "circle";
2889
- // const icon = item.icon ? (
2890
- // <ListItemIcon className={classes.listIcon}>
2891
- // <FontAwesomeIcon icon={["fas", labelStart]} />
2892
- // </ListItemIcon>
2893
- // ) : null;
2894
- const icon = item.icon?.toLowerCase() !== "process.gif" && item.icon ? (jsx(ListItemIcon, { className: classes.listIcon, children: jsx(FontAwesomeIcon, { icon: ["fas", item.icon] }) })) : (jsx(ListItemIcon, { className: classes.listIcon, children: jsx(FontAwesomeIcon, { icon: ["fas", labelStart] }) }));
2895
- const levelClassName = level === 1
2896
- ? classes.nestedMenuLevel1
2897
- : level === 2
2898
- ? classes.nestedMenuLevel2
2899
- : "";
2900
- return (jsxs(ListItem, { button: true, disableGutters: true, className: clsx({
2901
- [classes.item]: true,
2902
- [levelClassName]: Boolean(levelClassName),
2903
- [classes.slimList]: Boolean(slimSize),
2904
- [classes.drawerIconSize]: !localdrawerOpen,
2905
- }), onClick: () => {
2906
- if (item.viewName === "newfilterview" && Array.isArray(item.children)) {
2907
- setNewFilterView({
2908
- label: item.label,
2909
- placeholder: "Search " + item.label + " Screen...",
2910
- });
2911
- let newChield = item.children.map((item1) => {
2912
- return { ...item1, secondaryLabel: item1.user_code };
2913
- });
2914
- setNewFilterData(newChield);
2915
- }
2916
- setView(item.viewName);
2917
- }, children: [jsx(Tooltip, { title: item.label, arrow: true, placement: localdrawerOpen ? "bottom-start" : "right", children: jsx("span", { children: icon }) }), (localdrawerOpen && item.label.length > 27) || !Boolean(icon) ? (jsx(Tooltip, { title: item.label, arrow: true, placement: localdrawerOpen ? "bottom-start" : "right", children: jsx(ListItemText, { primary: item.label, className: classes.link, secondary: item.secondaryLabel ?? null }) })) : localdrawerOpen ? (jsx(ListItemText, { primary: item.label, className: classes.link, secondary: item.secondaryLabel ?? null })) : null] }));
2918
- };
2919
- const SingleListItem = ({ item, classes, level, slimSize, drawerOpen, rootUrl, dashboardUrl, navigate, }) => {
2920
- const isActiveMenu = isActiveMenuFromhref(window.location?.pathname ?? "", item?.href ?? "", item?.navigationProps, rootUrl, dashboardUrl);
2921
- if (isActiveMenu) {
2922
- // GeneralAPI.setDocumentName(item.label);
2923
- let titleText = document.title;
2924
- document.title = titleText.split(" - ")[0] + " - " + item.label;
2925
- }
2926
- let labelStart = (item.label || "").toLowerCase().substring(0, 1) || "circle";
2927
- const icon = item.icon.toLowerCase() === "process.gif" || !Boolean(item.icon) ? (jsx(ListItemIcon, { className: classes.listIcon, children: jsx(FontAwesomeIcon, { icon: ["fas", labelStart] }) })) : (jsx(ListItemIcon, { className: classes.listIcon, children: jsx(FontAwesomeIcon, { icon: ["fas", item.icon] }) }));
2928
- const levelClassName = level === 1
2929
- ? classes.nestedMenuLevel1
2930
- : level === 2
2931
- ? classes.nestedMenuLevel2
2932
- : "";
2933
- return (jsxs(ListItem, { button: true, disableGutters: true, className: clsx({
2934
- [classes.item]: true,
2935
- [levelClassName]: Boolean(levelClassName),
2936
- [classes.slimList]: Boolean(slimSize),
2937
- [classes.activeMenuItem]: isActiveMenu,
2938
- [classes.drawerIconSize]: !localdrawerOpen,
2939
- }), onClick: (e) => {
2940
- e.preventDefault();
2941
- if (item.isRouterLink) {
2942
- let path = item.href;
2943
- path =
2944
- item.href?.substring(0, 1) === "/"
2945
- ? item.href.substring(1)
2946
- : item.href;
2947
- if (item.passNavigationPropsAsURLParmas) {
2948
- let urlParms = new URLSearchParams(item?.navigationProps);
2949
- navigate(`${path}?${urlParms.toString()}`);
2950
- }
2951
- else {
2952
- navigate(`${path}`, {
2953
- state: { ...item?.navigationProps },
2954
- });
2955
- }
2956
- }
2957
- else if (Boolean(item.href)) {
2958
- window.open(item.href, item.rel ?? "_newtab");
2959
- }
2960
- }, children: [jsx(Tooltip, { title: item.label, arrow: true, placement: localdrawerOpen ? "bottom-start" : "right", children: jsx("span", { children: icon }) }), (localdrawerOpen && item.label.length > 27) || !Boolean(icon) ? (jsx(Tooltip, { title: item.label, arrow: true, placement: localdrawerOpen ? "bottom-start" : "right", children: jsx(ListItemText, { primary: item.label, className: classes.link, secondary: item.secondaryLabel ?? null }) })) : localdrawerOpen ? (jsx(ListItemText, { primary: item.label, className: classes.link, secondary: item.secondaryLabel ?? null })) : null] }));
2961
- };
2962
- const NestedListItem = ({ item, classes, level, handleDrawerOpen, drawerOpen, slimSize, rootUrl, navigate, }) => {
2963
- const [open, setOpen] = useState(false);
2964
- const handleClick = () => {
2965
- setOpen(!open);
2966
- };
2967
- const childrens = item.children?.map((one) => {
2968
- if (Array.isArray(one.children)) {
2969
- return (jsx(NestedListItem, { item: one, classes: classes, level: level + 1, handleDrawerOpen: handleDrawerOpen, drawerOpen: drawerOpen, slimSize: slimSize, rootUrl: rootUrl, navigate: navigate }, one.label));
2970
- }
2971
- else {
2972
- return (jsx(SingleListItem, { item: one, classes: classes, level: level + 1, slimSize: slimSize, rootUrl: rootUrl, navigate: navigate }, one.label));
2973
- }
2974
- });
2975
- let labelStart = (item.label || "").toLowerCase().substring(0, 1) || "circle";
2976
- const icon = item.icon?.toLowerCase() === "process.gif" || !Boolean(item.icon) ? (jsx(ListItemIcon, { className: classes.listIcon, children: jsx(FontAwesomeIcon, { icon: ["fas", labelStart] }) })) : (jsx(ListItemIcon, { className: classes.listIcon, children: jsx(FontAwesomeIcon, { icon: ["fas", item.icon] }) }));
2977
- const levelClassName = level === 1
2978
- ? classes.nestedMenuLevel1
2979
- : level === 2
2980
- ? classes.nestedMenuLevel2
2981
- : "";
2982
- return (jsxs(Fragment$1, { children: [jsxs(ListItem, { button: true, onClick: handleClick, disableGutters: true, className: open
2983
- ? clsx({
2984
- [classes.item]: true,
2985
- [levelClassName]: Boolean(levelClassName),
2986
- [classes.slimList]: Boolean(slimSize),
2987
- [classes.openCurrent]: true,
2988
- [classes.drawerIconSize]: !localdrawerOpen,
2989
- })
2990
- : clsx({
2991
- [classes.item]: true,
2992
- [levelClassName]: Boolean(levelClassName),
2993
- [classes.slimList]: Boolean(slimSize),
2994
- [classes.drawerIconSize]: !localdrawerOpen,
2995
- }), children: [jsx(Tooltip, { title: item.label, arrow: true, placement: localdrawerOpen ? "bottom-start" : "right", children: jsx("span", { children: icon }) }), drawerOpen || !Boolean(icon) ? (jsxs(Fragment$1, { children: [jsx(ListItemText, { primary: item.label, secondary: item.secondaryLabel ?? null, color: "primary", className: classes.link }), open ? jsx(ExpandLess, {}) : jsx(ExpandMore, {})] })) : null] }), jsx(Collapse, { in: open, timeout: "auto", unmountOnExit: true, children: jsx(List, { component: "div", disablePadding: true, className: open ? classes.openList : "", children: childrens }) })] }));
2996
- };
2997
- const isActiveMenuFromhref = (location, menuhref, navigationProps, rootUrl, dashboardUrl) => {
2998
- if ((location === `/${rootUrl}` || location === `/${rootUrl}/`) &&
2999
- menuhref === dashboardUrl) {
3000
- return true;
3001
- }
3002
- else if (menuhref === "report") {
3003
- try {
3004
- let urlParms = new URLSearchParams(navigationProps);
3005
- if ("?" + urlParms.toString() === window.location.search) {
3006
- return true;
3007
- }
3008
- }
3009
- catch (error) {
3010
- console.log(error);
3011
- }
3012
- return false;
3013
- }
3014
- else if (location !== `/${rootUrl}` &&
3015
- location !== "/" &&
3016
- Boolean(menuhref) &&
3017
- location.includes(menuhref)) {
3018
- return true;
3019
- }
3020
- return false;
3021
- };
3022
-
3023
- const matchByValue = (search, tags, navItem) => {
3024
- if (!Array.isArray(tags)) {
3025
- tags = [tags];
3026
- }
3027
- return tags.some((one) => navItem[one]
3028
- ?.toLocaleLowerCase?.()
3029
- ?.includes(search?.toLocaleLowerCase?.()));
3030
- };
3031
- const filterMetaDataByValue = (searchString, navItems, tagsToSearch) => {
3032
- let newNavItems = [];
3033
- for (let i = 0; i < navItems.length; i++) {
3034
- if (matchByValue(searchString, tagsToSearch, navItems[i])) {
3035
- let { children, ...newItem } = navItems[i];
3036
- if (Array.isArray(children) && children.length > 0) {
3037
- let newChildren = filterMetaDataByValue(searchString, children, tagsToSearch);
3038
- if (newChildren.length > 0) {
3039
- newNavItems.push({ ...newItem, children: newChildren });
3040
- }
3041
- }
3042
- else {
3043
- newNavItems.push({ ...newItem });
3044
- }
3045
- }
3046
- }
3047
- return newNavItems;
3048
- };
3049
-
3050
- const SearchViewNavigation = ({ metaData, handleDrawerOpen, drawerOpen, setView, label, icon, placeholder = "Search Reports...", rootUrl, dashboardUrl, navigate, }) => {
3051
- const [search, setSearch] = useState("");
3052
- const filteredMetaData = useMemo(() => {
3053
- return filterMetaDataByValue(search, metaData.navItems, [
3054
- "label",
3055
- "secondaryLabel",
3056
- ]);
3057
- }, [search, metaData.navItems]);
3058
- const classes = useStylesSideBar();
3059
- const myIcon = icon ? (jsx(ListItemIcon, { className: classes.listIcon, children: jsx(ArrowBackIosNewIcon, {}) })) : null;
3060
- const handleClick = () => {
3061
- if (!drawerOpen) {
3062
- handleDrawerOpen();
3063
- }
3064
- };
3065
- return (jsxs("div", { style: { display: "flex", flexDirection: "column" }, children: [jsxs(ListItem, { button: true, className: clsx({
3066
- [classes.item]: true,
3067
- [classes.nestedMenuLevel1]: true,
3068
- [classes.linktext]: true,
3069
- }), onClick: () => setView("/"), children: [myIcon, jsx(ListItemText, { primary: label, className: classes.link })] }), jsx(SearchBar, { sx: { overflow: "hidden" }, value: search, onChange: (e) => setSearch(e.target.value), onClick: handleClick, placeholder: Boolean(placeholder) ? placeholder : "Search Reports...", autoFocus: drawerOpen }), jsx(SideBarNav, { handleDrawerOpen: handleDrawerOpen, drawerOpen: drawerOpen, setView: setView, metaData: {
3070
- navItems: filteredMetaData,
3071
- config: { rel: "", target: "_blank" },
3072
- }, slimSize: true, isFromSeparetView: true, rootUrl: rootUrl, dashboardUrl: dashboardUrl, navigate: navigate })] }));
3073
- };
3074
-
3075
- library.add(faHandsHelping, faUsers, faBars, faBalanceScale, faHandHoldingHeart, faTasks, faCog, faHome, faTh, faUsersCog, faCircle, faUserCircle, faHashtag, faThumbtack, faSquare, faLink, faQuestion, faPlus, faTable, faLocationArrow, faHeadset, faGears, faArrowDown, faArrowUp, faSpinner, faCircleExclamation, faRotateRight, faUserLock, faUserClock, faGripHorizontal, faFileLines, faGear, faHeadphones, faUsersGear, faMessage, faUnlock, faUserPlus, faUserCheck, faKey, faIdCard, faIdBadge, faCheck, faCheckDouble, faCircleCheck, faCircleXmark, faUserTag, faAddressCard, faChartColumn, faUserPen, faHandHolding, faHandHoldingMedical, faObjectGroup, faTowerCell, faTowerObservation, faBuilding, faMailBulk, faLandmarkFlag, faCreditCard, faHospitalSymbol, faPlugCircleBolt, faCodeBranch, faPersonCircleCheck, faBank, faServer, faNotesMedical, faPenToSquare, faBarsProgress, faFileExport, faA, faB, faC, faD, faE, faF, faG, faH, faI, faJ, faK, faL, faM, faN, faO, faP, faQ, faR, faS, faT, faU, faV, faW, faX, faY, faZ);
3076
-
3077
- const transformMetaDataAsPerRole = (metaData, role, branches, company, access, products) => {
3078
- let navItems = filterMetaData(metaData.navItems, role, branches, company, access, products);
3079
- //console.log(navItems);
3080
- let newnavItem = navItems.map((item) => {
3081
- let { children, ...newItem } = item;
3082
- if (Array.isArray(children) && children.length > 5) {
3083
- if (!Boolean(newItem.seperateView)) {
3084
- newItem.seperateView = true;
3085
- newItem.viewName = "newfilterview";
3086
- //console.log(newItem);
3087
- }
3088
- }
3089
- return { ...newItem, children: children };
3090
- });
3091
- return {
3092
- config: metaData.config,
3093
- navItems: newnavItem,
3094
- };
3095
- };
3096
- const matchBranches = (userBranches, accessBranches) => {
3097
- if (!Array.isArray(accessBranches) || !Array.isArray(userBranches)) {
3098
- return true;
3099
- }
3100
- if (accessBranches.length <= 0 || userBranches.length <= 0) {
3101
- return true;
3102
- }
3103
- for (const one of accessBranches) {
3104
- if (userBranches.indexOf(one) >= 0) {
3105
- return true;
3106
- }
3107
- }
3108
- return false;
3109
- };
3110
- const matchComany = (userCompany, accessCompany) => {
3111
- if (!Array.isArray(accessCompany) || !Boolean(userCompany)) {
3112
- return true;
3113
- }
3114
- if (accessCompany.length <= 0) {
3115
- return true;
3116
- }
3117
- if (accessCompany.indexOf(userCompany) >= 0) {
3118
- return true;
3119
- }
3120
- return false;
3121
- };
3122
- const matchRoles = (userRole, accessRoles) => {
3123
- if (!Array.isArray(accessRoles) || typeof userRole !== "number") {
3124
- return true;
3125
- }
3126
- if (accessRoles.length <= 0) {
3127
- return true;
3128
- }
3129
- if (accessRoles.indexOf(userRole) >= 0) {
3130
- return true;
3131
- }
3132
- return false;
3133
- };
3134
- const matchInvisibleRoles = (userRole, accessRoles) => {
3135
- if (!Array.isArray(accessRoles) || typeof userRole !== "number") {
3136
- return true;
3137
- }
3138
- if (accessRoles.length <= 0) {
3139
- return true;
3140
- }
3141
- if (accessRoles.indexOf(userRole) >= 0) {
3142
- return false;
3143
- }
3144
- return true;
3145
- };
3146
- const matchProducts = (userProducts, accessProducts) => {
3147
- if (!Array.isArray(accessProducts) || !Array.isArray(userProducts)) {
3148
- return true;
3149
- }
3150
- if (accessProducts.length <= 0 || userProducts.length <= 0) {
3151
- return true;
3152
- }
3153
- for (const one of accessProducts) {
3154
- if (userProducts.indexOf(one) >= 0) {
3155
- return true;
3156
- }
3157
- }
3158
- return false;
3159
- };
3160
- const ishrefisNotNull = (item) => {
3161
- if (!(Array.isArray(item.children) && item.children.length > 0) &&
3162
- !Boolean(item.href)) {
3163
- //console.log(item);
3164
- return false;
3165
- }
3166
- return true;
3167
- };
3168
- const filterMetaData = (navItems, role, branches, company, access, products) => {
3169
- let newNavItems = [];
3170
- for (let i = 0; i < navItems.length; i++) {
3171
- if (matchRoles(Number(role), navItems[i].visibleToRoles) &&
3172
- matchComany(company, navItems[i].visibleToCompanies) &&
3173
- matchBranches(branches, navItems[i].visibleToBranches) &&
3174
- matchInvisibleRoles(Number(role), navItems[i].invisibleToRoles) &&
3175
- matchProducts(products, navItems[i].visibleToProducts) &&
3176
- ishrefisNotNull(navItems[i])) {
3177
- let { children, ...newItem } = navItems[i];
3178
- if (Array.isArray(children) && children.length > 0) {
3179
- let newChildren = filterMetaData(children, role, branches, company, access, products);
3180
- if (newChildren.length > 0) {
3181
- newNavItems.push({ ...newItem, children: newChildren });
3182
- }
3183
- }
3184
- else {
3185
- newNavItems.push({ ...newItem, secondaryLabel: newItem.system_code });
3186
- }
3187
- }
3188
- }
3189
- return newNavItems;
3190
- };
3191
-
3192
- /* eslint-disable react-hooks/exhaustive-deps */
3193
- const SideBar = ({ authState, handleDrawerOpen, open, rootUrl, dashboardUrl = "dashboard", navigate, }) => {
3194
- const [view, setView] = useState("/");
3195
- const [NewFilterView, setNewFilterView] = useState({});
3196
- const [NewFilterData, setNewFilterData] = useState([]);
3197
- const branches = useMemo(() => {
3198
- let myBranches = authState?.access?.entities?.Branch ?? [];
3199
- if (Array.isArray(myBranches) && myBranches.length >= 0) {
3200
- return myBranches.map((one) => one.branchCode);
3201
- }
3202
- else {
3203
- return [];
3204
- }
3205
- }, []);
3206
- const products = useMemo(() => {
3207
- let myProducts = authState?.access?.products ?? [];
3208
- if (Array.isArray(myProducts) && myProducts.length >= 0) {
3209
- return myProducts.map((one) => one.categoryCode);
3210
- }
3211
- else {
3212
- return [];
3213
- }
3214
- }, []);
3215
- let newMetaData = { navItems: authState.menulistdata };
3216
- let filteredMetaDataSideBar = transformMetaDataAsPerRole(newMetaData, Number(authState.role), branches, authState.companyID, authState.access, products);
3217
- let filteredReportsMetaData = transformMetaDataAsPerRole({
3218
- config: { rel: "", target: "_blank" },
3219
- navItems: reportMetaData,
3220
- }, Number(authState.role), branches, authState.companyID, authState.access, products);
3221
- return view === "report" ? (jsx(SearchViewNavigation, { metaData: filteredReportsMetaData, handleDrawerOpen: handleDrawerOpen, drawerOpen: open, setView: setView, label: "Reports", icon: "table", rootUrl: rootUrl, dashboardUrl: dashboardUrl, navigate: navigate })) : view === "newfilterview" ? (jsx(SearchViewNavigation, { metaData: {
3222
- config: { rel: "", target: "_blank" },
3223
- navItems: NewFilterData,
3224
- }, handleDrawerOpen: handleDrawerOpen, drawerOpen: open, setView: setView, label: NewFilterView?.label ?? "Reports", icon: "table", placeholder: NewFilterView?.placeholder, rootUrl: rootUrl, dashboardUrl: dashboardUrl, navigate: navigate })) : (jsx(Fragment$1, { children: jsx(SideBarNav, { metaData: filteredMetaDataSideBar, handleDrawerOpen: handleDrawerOpen, drawerOpen: open, setView: setView, slimSize: true, setNewFilterData: setNewFilterData, setNewFilterView: setNewFilterView, rootUrl: rootUrl, dashboardUrl: dashboardUrl, navigate: navigate }) }));
3225
- };
3226
-
3227
- const SidebarWrapper = (props) => {
3228
- const classes = useStyles();
3229
- return (jsxs(Drawer, { variant: "permanent", classes: {
3230
- paper: clsx(classes.drawerPaper, !props.open && classes.drawerPaperClose),
3231
- }, open: props.open, children: [jsx("div", { className: classes.toolbarIcon }), jsx(SideBar, { ...props })] }));
3232
- };
3233
-
3234
- export { AppbarWrapper, AuthControllerWrapper, BranchSelectionGridWrapper, ForgotPasswordControllerWrapper, SidebarWrapper };
1
+ import"regenerator-runtime/runtime";import"./assets/index~NFLKLAwc.css";import{jsx as e,jsxs as r,Fragment as o}from"react/jsx-runtime";import{TextField as a,GradientButton as t,utilFunction as n,usePopupContext as i,ClearCacheProvider as s,queryClient as l,Alert as d,GridWrapper as c,SearchBar as p}from"@acuteinfo/common-base";import{useState as m,useRef as g,useEffect as u,Fragment as h,useMemo as f,useReducer as w,useCallback as y}from"react";import{makeStyles as x}from"@mui/styles";import b from"@mui/icons-material/Visibility";import v from"@mui/icons-material/VisibilityOff";import{Container as C,Grid as S,InputAdornment as P,IconButton as T,CircularProgress as N,FormHelperText as E,Typography as k,Tooltip as D,tooltipClasses as B,Stack as M,Box as _,Avatar as O,Button as I,alpha as A,AppBar as R,Toolbar as L,List as U,ListItemIcon as F,ListItem as W,ListItemText as V,Collapse as z,Drawer as q}from"@mui/material";import{useTranslation as H}from"react-i18next";import j,{ResendOTP as G}from"otp-input-react";import K from"@mui/material/IconButton";import $ from"clsx";import{useSnackbar as X}from"notistack";import Y from"@mui/icons-material/FingerprintSharp";import"./assets/verify~MOgwPpDY.css";import J from"crypto-js";import"./assets/styles~ILuxAzHT.css";import{useQuery as Q,useMutation as Z}from"react-query";import ee from"./assets/BecomePartnerImg~cwVtJhaB.svg";import re from"./assets/waving-hand~JqQoivUD.png";import{styled as oe}from"@mui/material/styles";import ae from"./assets/profile-default~evuVPsgu.png";import te from"@mui/icons-material/Logout";import ne from"@mui/icons-material/MenuOutlined";import{format as ie}from"date-fns";import{FontAwesomeIcon as se}from"@fortawesome/react-fontawesome";import le from"react-perfect-scrollbar";import{ExpandLess as de,ExpandMore as ce}from"@mui/icons-material";import pe from"@mui/icons-material/ArrowBackIosNew";import{library as me}from"@fortawesome/fontawesome-svg-core";import{faHandsHelping as ge,faUsers as ue,faBars as he,faBalanceScale as fe,faHandHoldingHeart as we,faTasks as ye,faCog as xe,faHome as be,faTh as ve,faUsersCog as Ce,faCircle as Se,faUserCircle as Pe,faHashtag as Te,faThumbtack as Ne,faSquare as Ee,faLink as ke,faQuestion as De,faPlus as Be,faTable as Me,faLocationArrow as _e,faHeadset as Oe,faGears as Ie,faArrowDown as Ae,faArrowUp as Re,faSpinner as Le,faCircleExclamation as Ue,faRotateRight as Fe,faUserLock as We,faUserClock as Ve,faGripHorizontal as ze,faFileLines as qe,faGear as He,faHeadphones as je,faUsersGear as Ge,faMessage as Ke,faUnlock as $e,faUserPlus as Xe,faUserCheck as Ye,faKey as Je,faIdCard as Qe,faIdBadge as Ze,faCheck as er,faCheckDouble as rr,faCircleCheck as or,faCircleXmark as ar,faUserTag as tr,faAddressCard as nr,faChartColumn as ir,faUserPen as sr,faHandHolding as lr,faHandHoldingMedical as dr,faObjectGroup as cr,faTowerCell as pr,faTowerObservation as mr,faBuilding as gr,faMailBulk as ur,faLandmarkFlag as hr,faCreditCard as fr,faHospitalSymbol as wr,faPlugCircleBolt as yr,faCodeBranch as xr,faPersonCircleCheck as br,faBank as vr,faServer as Cr,faNotesMedical as Sr,faPenToSquare as Pr,faBarsProgress as Tr,faFileExport as Nr,faA as Er,faB as kr,faC as Dr,faD as Br,faE as Mr,faF as _r,faG as Or,faH as Ir,faI as Ar,faJ as Rr,faK as Lr,faL as Ur,faM as Fr,faN as Wr,faO as Vr,faP as zr,faQ as qr,faR as Hr,faS as jr,faT as Gr,faU as Kr,faV as $r,faW as Xr,faX as Yr,faY as Jr,faZ as Qr}from"@fortawesome/free-solid-svg-icons";import"lodash";const Zr=x((e=>({wrapper:{minHeight:"100vh",boxShadow:"0 3px 6px rgba(0,0,0,0.03)",background:"var(--white)"},loginEmp:{background:"#fff",padding:e.spacing(2,4),display:"flex",maxWidth:"400px",margin:"auto",boxShadow:"0 0 20px rgba(0,0,0,0.06)",borderRadius:"8px",[e.breakpoints.down("sm")]:{width:"100%"}},formWrap:{marginTop:e.spacing(2)},loginBtn:{minWidth:"100% !important",margin:e.spacing(2,0),fontSize:"1rem",padding:"10px .75rem",background:"rgb(128,0,0)",border:0,color:"#fff !important",fontWeight:600,letterSpacing:"0.02857em",boxShadow:"none",textTransform:"capitalize",alignSelf:"flex-end","&:hover":{background:"#fedad8",boxShadow:"none"}},OTPTimer:{marginTop:"10px",color:e.palette.primary.main,fontWeight:600},resendLink:{marginTop:"10px",cursor:"pointer",color:e.palette.secondary.main,fontWeight:600,fontSize:"0.875 rem"},logo:{marginBottom:e.spacing(1)},loginLeft:{[e.breakpoints.down("sm")]:{display:"none"}},loginRight:{background:"#fff",padding:e.spacing(2,4),display:"flex",maxWidth:"400px",margin:"auto",boxShadow:"0 0 20px rgba(0,0,0,0.06)",borderRadius:"8px",[e.breakpoints.down("sm")]:{width:"100%"},"& img":{alignSelf:"center"}},loginImg:{},verifybutton:{alignSelf:"center",padding:"5px"},otpButtons:{},divflex:{display:"flex"},otpinputpadding:{"& input":{marginRight:"25px !important",border:"1.42444px solid var(--theme-color3)",borderRadius:"10px",width:"45px !important",height:"45px !important",marginBottom:"15px",boxShadow:"0px 5.69775px 11.3955px rgba(66, 99, 199, 0.16)"}},ibtnvisible:{marginBottom:"15px"},btnvisibleoff:{display:"none"},OTPalignName:{display:"flex",alignItems:"center",marginBottom:"12px",color:"#1C1C1C",fonWeight:"400",fontSize:"17px",lineHeight:"33px"},resendOTPalign:{color:"var(--theme-color3)",fonWeight:"400",fontSize:"17px",lineHeight:"33px",margin:"0 auto"},resendbtnLink:{textDecoration:"underline",color:"var(--theme-color3)",cursor:"pointer","&:hover":{textDecoration:"underline",color:"var(--theme-color3)"}},dialogTitleClass:{background:"var(--primary-bg)",padding:"6px 15px !important",margin:"10px",color:"var(--white)",borderRadius:"4px","& h2":{fontWeight:"500 !important"}},lang_svg:{marginRight:"10px",width:"22px",height:"22px"},dialogContent:{padding:"0px 15px","& p":{whiteSpace:"pre-wrap",color:"black",marginTop:"8px",marginBottom:"6px"}},button:{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",margin:"6px",background:"var(--theme-color1)","&:hover":{background:"var(--theme-color1) !important"}}}))),eo=({classes:o,loginState:n,verifyUsernamePassword:i,forgotPasswordEndpoint:s})=>{const[l,d]=m({userName:"",password:""}),[c,p]=m(0),f=Date.now()<c,[,w]=m(),y=g(null),{t:x}=H();u((()=>()=>clearTimeout(y.current)),[]);const E=e=>{const r=e.target.name,o=e.target.value;"userName"===r&&o&&(n.isUsernameError=!1),"password"===r&&o&&(n.isPasswordError=!1),d((e=>({...e,[r]:o})))},k=g(null),D=g(null),B=g(null);return u((()=>{let e;return n.isUsernameError?e=setTimeout((()=>{k?.current?.focus?.()}),1e3):n.isPasswordError&&(e=setTimeout((()=>{D?.current?.focus?.()}),1e3)),()=>{e&&clearTimeout(e)}}),[n.isUsernameError,n.isPasswordError]),u((()=>{let e;return n?.otpmodelClose&&(d((e=>({...e,password:""}))),e=setTimeout((()=>{D?.current?.focus?.()}),1500)),()=>{e&&clearTimeout(e)}}),[n.otpmodelClose]),e(h,{children:e(C,{maxWidth:"xs",children:r(S,{alignItems:"center",style:{paddingTop:"20px"},children:[e("div",{style:{color:"#000000 !important",fontSize:"30px",fontWeight:"600",alignItems:"center",fontStyle:"normal",lineHeight:"150%"},children:e("h3",{children:x("SignIn")})}),e("div",{className:"",style:{color:"#949597",fontSize:"16px",fontWeight:"400",alignItems:"center",fontStyle:"normal",width:"360px"},children:x("SignInWithUserIDandPassword")}),r("div",{className:o.formWrap,children:[e(a,{autoFocus:!0,label:x("UserID"),placeholder:String(x("UserID")),style:{marginTop:"10px",marginBottom:"17px"},fullWidth:!0,type:"text",name:"userName",value:l.userName.trimStart()||"",onChange:E,error:n.isUsernameError,helperText:n.isUsernameError?x(n.userMessageforusername):"",InputLabelProps:{shrink:!0},disabled:n.loading,autoComplete:"off",ref:k,onKeyDown:e=>{"Enter"===e.key&&B?.current?.click?.()},inputProps:{maxLength:"16"}}),e("div",{style:{display:"flex",flexDirection:"row-reverse",marginTop:"8px"},children:e(a,{label:x("Password"),placeholder:String(x("EnterPassword")),InputLabelProps:{shrink:!0},fullWidth:!0,type:f?"text":"password",name:"password",value:l.password,onChange:E,error:n.isPasswordError,helperText:n.isPasswordError?x(n.userMessageforpassword):"",disabled:n.loading,ref:D,onKeyDown:e=>{"Enter"===e.key&&B?.current?.click?.()},InputProps:{endAdornment:e(P,{position:"end",children:e(T,{"aria-label":"toggle password visibility",onClick:()=>{f?f&&p(0):(p(Date.now()+5e3),y.current=setTimeout((()=>w(Date.now())),5e3))},onMouseDown:e=>e.preventDefault(),disabled:n.loading,children:e(f?b:v,{})})})},inputProps:{maxLength:"16"}},"employee")}),e("div",{style:{marginTop:"20px",display:"flex"},children:e("div",{style:{flex:"auto",textAlign:"end"},children:e("a",{href:s??"",style:{color:"var(--theme-color3)"},children:x("ForgotPassword")})})}),e("div",{style:{marginTop:"20px",display:"flex"},children:e("div",{style:{flex:"auto",textAlign:"center",marginTop:"5px",marginBottom:"17px"},children:e(t,{style:{borderRadius:n.loading?"50%":"10px",height:n.loading?"40px":"100%",width:n.loading?"0px":"100%",minWidth:n.loading?"40px":"80px"},fullWidth:!0,disabled:n.loading,onClick:()=>i((l.userName||"").toLowerCase(),l.password),ref:B,endicon:n.loading?void 0:"East",rotateIcon:"scale(1.4) rotateX(360deg)",children:n.loading?e(N,{size:25,thickness:4.6}):x("Next")})})})]})]})})})},ro=({classes:a,OTPResendRequest:n,open:i,handleClose:s,loginState:l,VerifyOTP:d,OTPError:c,setOTPError:p,previousStep:f,setNewRequestID:w=(e=>{}),otpresendCount:y=0,resendFlag:x})=>{const[P,T]=m(""),[k,D]=m(0),B=Date.now()<k,[,M]=m(),_=g(null);u((()=>()=>clearTimeout(_.current)),[]);const[O,I]=m(!1),A=g(null),[R,L]=m(!1),{enqueueSnackbar:U}=X(),{t:F}=H();return u((()=>{l?.otpmodelClose?(p(""),T(""),s("")):Boolean(c)&&T("")}),[l.otpmodelClose,c]),e(h,{children:e(C,{maxWidth:"sm",children:e(S,{alignItems:"center",marginTop:"4em",children:r("div",{style:{},children:[e("div",{style:{color:"#000000",fontSize:"30px",fontWeight:"600",alignItems:"center",fontStyle:"normal",lineHeight:"150%",marginBottom:"10px"},children:"OTP"===l?.authType?F("otp.OTPAuthentication"):"TOTP"===l?.authType?F("otp.TOTPAuthentication"):null}),e("div",{style:{color:"#949597",fontSize:"16px",fontWeight:"400",alignItems:"center",fontStyle:"normal",lineHeight:"33px"},children:"OTP"===l?.authType?F("otp.EnterOTPsentToMobile"):"TOTP"===l?.authType?F("otp.PleaseEnterOTP"):null}),r("div",{className:a.OTPalignName,children:[F("otp.Hello")," ",l?.username?l.username.charAt(0).toUpperCase()+l.username.slice(1):null,"OTP"===l?.authType&&e(G,{onResendClick:async()=>{L(!0);const{status:e,data:r,message:o}=await n(l?.comapanyCD,l?.branchCD,l?.contactUser,x,l?.otpValidFor,l?.username);L(!1),"0"===e?(w(r?.TRAN_CD),I(!1),U(o,{variant:"success"})):U(o,{variant:"error"})},renderButton:o=>{let{remainingTime:t,...n}=o;return R?r("a",{className:$(a.resendbtnLink,!O&&a.btnvisibleoff),style:{cursor:"wait"},children:[F("otp.GetNewOTP")," ",e(N,{size:20,color:"secondary"})]}):e("a",{remainingtime:t,...n,className:$(a.resendbtnLink,!O&&a.btnvisibleoff),children:F("otp.GetNewOTP")})},renderTime:e=>(0===parseInt(e)&&setTimeout((()=>{I(!0)}),700),r("span",{className:$(O&&a.btnvisibleoff),children:[F("otp.OtpExpired")," ",e," ",F("otp.second")]})),maxTime:l?.otpValidFor??60,className:a.resendOTPalign})]}),r("div",{className:a.divflex,onKeyDown:e=>{"Enter"===e.key&&A?.current?.click?.()},children:[e(j,{value:P,onChange:T,autoFocus:!0,OTPLength:6,otpType:"number",disabled:l.otploading||l.loading,secure:!B,className:a.otpinputpadding}),e(K,{"aria-label":"toggle password visibility",onClick:()=>{B?B&&D(0):(D(Date.now()+5e3),_.current=setTimeout((()=>M(Date.now())),5e3))},onMouseDown:e=>e.preventDefault(),disabled:l.otploading,className:a.ibtnvisible,children:e(B?b:v,{})})]}),Boolean(c)?e(E,{style:{color:"red"},children:c}):null,"TOTP"===l?.authType?e("div",{style:{flex:"auto"},children:e("a",{href:"forgot-totp",style:{color:"var(--theme-color3)"},children:"Forgot TOTP"})}):e(o,{}),r("div",{style:{display:"flex",gap:"10px",margin:"42px 0 0 42px",width:"60%"},children:[e(t,{disabled:l.otploading||l.loading,onClick:()=>{f(!1,"")},className:a.otpButtons,textColor:"var(--theme-color3)",sx:{border:"var(--theme-color3) 1px solid",minWidth:"50%",background:"var(--white)",borderRadius:"10px","&:disabled":{color:"var(--theme-color3) !important",opacity:.7},"&:hover":{background:"var(--white) !important","& .MuiSvgIcon-root":{transform:"scale(1.4) rotateX(360deg)",transition:"transform 2s ease-in-out"}}},starticon:"West",children:F("otp.Back")}),e(t,{style:{borderRadius:l.loading?"50%":"10px",height:l.loading?"40px":"100%",width:l.loading?"0px":"100%",minWidth:l.loading?"40px":"80px"},fullWidth:!0,disabled:l.loading,onClick:()=>{!Boolean(P)||P.length<6?p("otp.EnterOTPDigit"):(p(""),d(P))},ref:A,className:a.otpButtons,endicon:l.loading?void 0:"TaskAlt",rotateIcon:"scale(1.4)",children:l.loading?e(N,{size:25,thickness:4.6}):F("otp.VerifyOTP")})]})]})})})})},oo=({classes:o,OTPResendRequest:a,handleClose:n,loginState:i,VerifyOTP:s,OTPError:l,setOTPError:d,resendFlag:c,setNewRequestID:p=(e=>{}),otpresendCount:f=0})=>{const[w,y]=m(""),[x,C]=m(0),P=Date.now()<x,[,T]=m(),k=g(null);u((()=>()=>clearTimeout(k.current)),[]);const[D,B]=m(!1),[M,_]=m(!1),O=g(null),{enqueueSnackbar:I}=X(),{t:A}=H(),R=()=>{d(""),y(""),n()};return u((()=>{i?.otpmodelClose&&R()}),[i.otpmodelClose]),e(h,{children:e(S,{alignItems:"center",children:r("div",{children:[e("div",{style:{color:"#000000",fontSize:"30px",fontWeight:"600",alignItems:"center",fontStyle:"normal",lineHeight:"150%",marginBottom:"10px"},children:A("otp.OTPAuthentication")}),r("div",{className:o.OTPalignName,children:[A("otp.Hello")," ",i?.username?i.username.charAt(0).toUpperCase()+i.username.slice(1):null,i.otploading||f>=3||"TOTP"===i?.auth_type?null:e(G,{onResendClick:async()=>{_(!0);const{status:e,data:r,message:o}=await a(i?.company_ID,i?.branch_cd,i?.contactUser,c,i?.otpValidFor,i?.username);_(!1),"0"===e?(p(r?.TRAN_CD),B(!1),I(o,{variant:"success"})):I(o,{variant:"error"})},renderButton:a=>{let{remainingTime:t,...n}=a;return M?r("a",{className:$(o.resendbtnLink,!D&&o.btnvisibleoff),style:{cursor:"wait"},children:[A("otp.GetNewOTP")," ",e(N,{size:20,color:"secondary"})]}):e("a",{remainingtime:t,...n,className:$(o.resendbtnLink,!D&&o.btnvisibleoff),children:A("otp.GetNewOTP")})},renderTime:e=>(0===parseInt(e)&&setTimeout((()=>{B(!0)}),700),r("span",{className:$(D&&o.btnvisibleoff),children:[A("otp.OtpExpired")," ",e]})),maxTime:i?.otpValidFor??60,className:o.resendOTPalign})]}),r("div",{className:o.divflex,onKeyDown:e=>{"Enter"===e.key&&O?.current?.click?.()},children:[e(j,{value:w,onChange:y,autoFocus:!0,OTPLength:6,otpType:"number",disabled:i.otploading||i.loading,secure:!P,className:o.otpinputpadding}),e(K,{"aria-label":"toggle password visibility",onClick:()=>{P?P&&C(0):(C(Date.now()+5e3),k.current=setTimeout((()=>T(Date.now())),5e3))},onMouseDown:e=>e.preventDefault(),disabled:i.otploading,className:o.ibtnvisible,children:e(P?b:v,{})})]}),Boolean(l)?e(E,{style:{color:"red"},children:l}):null,r("div",{style:{display:"flex",gap:"10px",margin:"42px 0 0 42px",width:"60%"},children:[e(t,{fullWidth:!0,disabled:i.otploading||i.loading,onClick:R,className:o.otpButtons,starticon:"West",textColor:"var(--white) !important",sx:{"&:disabled":{color:"var(-theme-color3) !important"}},rotateIcon:"scale(1.4) rotateX(360deg)",style:{borderRadius:"10px",minWidth:"48%"},children:A("otp.Back")}),e(t,{style:{borderRadius:i.otploading?"50%":"10px",height:i.otploading?"40px":"100%",width:i.otploading?"0px":"100%",minWidth:i.otploading?"40px":"80px"},disabled:i.loading,onClick:()=>{!Boolean(w)||w.length<6?d("otp.EnterOTPDigit"):(d(""),s(w))},ref:O,className:o.otpButtons,children:i.otploading?e(N,{size:25,thickness:4.6}):A("otp.VerifyOTP")})]})]})})})},ao=({classes:a,loginState:n,verifyFinger:i,previousStep:s})=>{const{t:l}=H();return e(h,{children:e(C,{maxWidth:"xs",children:r(S,{alignItems:"center",children:[r("div",{style:{marginRight:"25px",width:"102%"},children:[e("br",{}),e("div",{style:{color:"#000000",fontSize:"34px",fontWeight:"600",alignItems:"center",fontStyle:"normal",lineHeight:"150%",marginBottom:"10px"},children:l("Biometric.BiometrixAuthentication")}),e("div",{style:{color:"#949597",fontSize:"18px",fontWeight:"400",alignItems:"center",fontStyle:"normal",lineHeight:"33px"},children:l("Biometric.Kindlyplaceyoufinger")}),e("br",{}),r(k,{variant:"h5",style:{color:"#000000"},children:[l("otp.Hello")," ","",` ${n?.username?n.username.charAt(0).toUpperCase()+n.username.slice(1):null}`]}),e("br",{}),e("div",{className:n?.isBiometricError?a.eFingerUi:a.fingerUi,children:r("div",{className:"spinner-wrap",children:[e(Y,{sx:{fontSize:"80px",opacity:"0.4",borderRadius:"50%",display:"flex",margin:"0 auto","&:after":{borderBottom:"2px solid #26A456"}},className:n?.isBiometricError?a.FingerIcon:null,color:n?.isBiometricError?"error":"inherit"}),n?.isScanning?r(o,{children:[e("div",{className:"spinner-item",style:{border:n?.isScanning?"1px solid #949597":" 1px solid red"}}),e("div",{className:"spinner-item spinner-item--2",style:{border:n?.isScanning?"1px solid #949597":"1px solid red"}}),e("div",{className:"spinner-item spinner-item--3",style:{border:n?.isScanning?"1px solid #949597":"1px solid red"}})]}):null]})}),e("div",{className:a.biometric,children:r("div",{style:{marginTop:"50px"},children:[e("div",{className:n.isScanning?"progress":"hide",children:e("div",{className:"bar",style:{width:n.isScanning?"30%":"0%"}})}),e("h3",{style:{display:"flex",marginTop:"20px",justifyContent:"space-around",color:n?.isBiometricError?"rgb(255 0 0 / 65%)":"inherit"},children:n?.isBiometricError?n?.userMessage:n?.loading?l("Biometric.Loading"):n?.isScanning?l("Biometric.Scanning"):null})]})})]}),r("div",{style:{display:"flex",justifyContent:"center",margin:"42px 0 0 42px",gap:"10px"},children:[e(t,{fullWidth:!0,disabled:n.loading,onClick:()=>{s(!1,"")},className:a.otpButtons,starticon:"West",rotateIcon:"scale(1.4) rotateX(360deg)",textColor:"var(--theme-color3) !important",style:{border:"var(--theme-color3)1px solid",color:"var(--theme-color3)",background:"var(--white)",borderRadius:"10px",minWidth:"48%"},children:l("otp.Back")}),e(t,{style:{borderRadius:n.loading?"50%":"10px",height:n.loading?"40px":"100%",width:n.loading?"0px":"100%",minWidth:n.loading?"40px":"80px"},disabled:n.loading,onKeyDown:e=>13===e.keyCode&&i,onClick:i,className:a.otpButtons,children:n.loading?e(N,{size:25,thickness:4.6,style:{color:"#fff"}}):l("Biometric.Verify")})]})]})})})},to=async(e,r)=>new Promise(((o,a)=>{"string"==typeof e&&(e=JSON.parse(e)),e.forEach((async(a,t)=>{try{var n={GalleryTemplate:(e=>{var r=J.PBKDF2("SUPERACUTE@MKS","Ivan Medvedev",{keySize:12,iterations:1e3});console.log(r.toString());var o=new J.lib.WordArray.init(r.words,32),a=new J.lib.WordArray.init(r.words.splice(8),16),t=J.AES.decrypt({ciphertext:J.enc.Base64.parse(J.enc.Base64.parse(e).toString(J.enc.Utf8))},o,{iv:a});return console.log("CryptoJS.AES.decrypt",t),t.toString(J.enc.Utf8).split(String.fromCharCode(0)).join("")})(a.IMG_DATA),ProbTemplate:r,BioType:"Iso"},i=JSON.stringify(n);await fetch("http://localhost:8004/mfs100/verify",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:i}).then((e=>e.json())).then((r=>{"0"===r?.ErrorCode&&r.Status?o({status:!0,errorCode:"0",errorMessage:"",isError:!1,sr_cd:a.SR_CD}):e.length!==t+1||o({status:!1,errorCode:r.ErrorCode,errorMessage:r.ErrorMessage,isError:!1})})).catch((e=>{o({status:!1,errorCode:"999",errorMessage:e,isError:!0})}))}catch(e){console.log(e),o({status:!1,errorCode:"999",errorMessage:"Something went wrong!",isError:!0})}}))})),no=(e="")=>{if("string"!=typeof e)return!1;return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)},io=({bannerDetails:a})=>{const[t,i]=m(null),s=g(null),l=Zr(),d=f((()=>a),[]);return u((()=>{if(Boolean(d?.bannerImg))if(no(d?.bannerImg)){let e=n.base64toBlob(d?.bannerImg);s.current="object"==typeof e&&Boolean(e)?URL.createObjectURL(e):"",i(s.current)}else i(d?.bannerImg)}),[d]),e(o,{children:r(S,{item:!0,xs:6,md:6,lg:6,className:l.loginLeft,children:[e(S,{item:!0,xs:12,md:12,lg:12,style:{height:"70vh"},children:e("img",{alt:"",style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"center"},src:Boolean(t)?t:""})}),e(S,{item:!0,xs:12,md:12,lg:12,style:{height:"30vh",background:"var(--primary-bg)"},children:r(C,{maxWidth:"sm",children:[r("div",{className:"text",style:{color:"white",fontStyle:"normal",fontSize:"31px",paddingTop:"30px"},children:[d?.bannerTitle??"",e("span",{style:{marginLeft:"8px",fontWeight:"900"}})]}),e("div",{style:{lineHeight:"27px",fontSize:"15px",fontWeight:"500px",letterSpacing:"0.02em",color:"#ebedee",maxWidth:"464px"},children:d?.bannerNote??""})]})})]})})},so=({classes:o,ResetPassword:i,open:s,username:l,accessToken:d,tokenType:c,handleClose:p,validatePasswordFn:u})=>{const f=g(null),{enqueueSnackbar:w}=X(),{t:y}=H(),[x,b]=m({userName:l,oldpassword:"",password:"",confirmpassword:""}),[v,P]=m({isError:!1,errorMessage:"",isLoading:!1,isoldPwdError:!1,oldpassworderror:"",isnewpwdError:!1,newpassworderror:"",isconfirmnewpwdError:!1,confirmnewpassworderror:""}),T=e=>{const r=e.target.name;let o=e.target.value;"oldpassword"===r&&Boolean(o)?P((e=>({...e,isoldPwdError:!1}))):"password"===r&&Boolean(o)?P((e=>({...e,isnewpwdError:!1}))):"confirmpassword"===r&&Boolean(o)&&P((e=>({...e,isconfirmnewpwdError:!1}))),b((e=>({...e,[r]:o})))};return e(h,{children:e(C,{maxWidth:"xs",children:r(S,{alignItems:"center",children:[e("div",{style:{color:"#000000 !important",fontSize:"30px",fontWeight:"600",alignItems:"center",fontStyle:"normal"},children:e("h3",{children:"Password Rotation"})}),e("div",{className:"",style:{color:"#949597",fontSize:"18px",fontWeight:"400",alignItems:"center",fontStyle:"normal",width:"360px"},children:"Please Verify OTP"}),r("div",{className:o.formWrap,children:[e(a,{label:"User ID",placeholder:"Enter User ID",fullWidth:!0,type:"text",name:"userName",value:x.userName||"",onChange:T,InputLabelProps:{shrink:!0},disabled:!0,autoComplete:"off",inputProps:{maxLength:16},style:{paddingBottom:"8px"}}),e(a,{autoFocus:!0,label:"Current Password",placeholder:"Enter Current Password",fullWidth:!0,type:"password",name:"oldpassword",value:x.oldpassword||"",onChange:T,error:v.isoldPwdError,helperText:v.isoldPwdError?y(v.oldpassworderror):"",InputLabelProps:{shrink:!0},disabled:v.isLoading,autoComplete:"off",onKeyDown:e=>{"Enter"===e.key&&f?.current?.click?.()},inputProps:{maxLength:16},style:{paddingBottom:"8px"}}),e(a,{label:"New Password",placeholder:"Enter New Password",fullWidth:!0,type:"password",name:"password",value:x.password||"",onChange:T,error:v.isnewpwdError,helperText:v.isnewpwdError?y(v.newpassworderror):"",InputLabelProps:{shrink:!0},disabled:v.isLoading,autoComplete:"off",onKeyDown:e=>{"Enter"===e.key&&f?.current?.click?.()},inputProps:{maxLength:16},style:{paddingBottom:"8px"}}),e(a,{label:"Confirm New Password",placeholder:"Enter confirm new password",fullWidth:!0,type:"password",name:"confirmpassword",value:x.confirmpassword||"",onChange:T,error:v.isconfirmnewpwdError,helperText:v.isconfirmnewpwdError?y(v.confirmnewpassworderror):"",InputLabelProps:{shrink:!0},disabled:v.isLoading,autoComplete:"off",onKeyDown:e=>{"Enter"===e.key&&f?.current?.click?.()},inputProps:{maxLength:16},style:{paddingBottom:"8px"}}),v.isError?e(E,{style:{color:"red"},children:v.errorMessage}):null]}),r("div",{style:{display:"flex",gap:"10px",margin:"20px 0 0 10px",width:"94%"},children:[e(t,{fullWidth:!0,disabled:v.isLoading,onClick:()=>{p("")},className:o.otpButtons,style:{border:"var(--theme-color3)1px solid",color:"var(--theme-color3)",borderRadius:"10px"},children:"Back"}),e(t,{style:{borderRadius:v.isLoading?"50%":"10px",height:v.isLoading?"40px":"100%",width:v.isLoading?"0px":"100%",minWidth:v.isLoading?"40px":"80px"},fullWidth:!0,disabled:v.isLoading,onClick:async()=>{let e=!1,r={isError:!1,errorMessage:"",isLoading:!1,isoldPwdError:!1,oldpassworderror:"",isnewpwdError:!1,newpassworderror:"",isconfirmnewpwdError:!1,confirmnewpassworderror:""};Boolean(x.oldpassword)||(r.isoldPwdError=!0,r.oldpassworderror="Current Password is required.",e=!0);let o=n.ValidatePassword(x.password);if(Boolean(o)&&(r.isnewpwdError=!0,r.newpassworderror=o,e=!0),Boolean(x.oldpassword)&&Boolean(x.password)&&x.oldpassword===x.password&&(r.isnewpwdError=!0,r.newpassworderror="The new password cannot be the same as the old password",e=!0),Boolean(x.confirmpassword)?Boolean(x.password)&&x.password!==x.confirmpassword&&(r.isconfirmnewpwdError=!0,r.confirmnewpassworderror="New Password and Confirm Password did not match",e=!0):(r.isconfirmnewpwdError=!0,r.confirmnewpassworderror="Confirm new password is required.",e=!0),e)return void P(r);P((e=>({...e,isLoading:!0})));const{validateStatus:a,validateData:t}=await u({USER_ID:x.userName,PASSWORD:x.password,SCREEN_REF:"LOGIN"});if(P((e=>({...e,isLoading:!1}))),"0"===a)switch(t?.O_STATUS){case"999":return r.isnewpwdError=!0,r.newpassworderror=t?.O_MESSAGE,void P(r);case"0":let e=await i(x.userName,x.oldpassword,x.password,d,c);P((e=>({...e,isLoading:!0}))),"0"===e.status?(w("Password successfully changed.",{variant:"success"}),p("0"),P((e=>({...e,isLoading:!1})))):P((r=>({...r,isError:!0,errorMessage:e.message})))}},ref:f,className:o.otpButtons,children:v.isLoading?e(N,{size:25,thickness:4.6}):"Update"})]})]})})})},lo={username:"",firstName:"",lastName:"",loading:!1,otploading:!1,isError:!1,isUsernameError:!1,isPasswordError:!1,userMessage:"",OtpuserMessage:"",userMessageforpassword:"",userMessageforusername:"",currentFlow:"username",transactionID:"",comapanyCD:"",branchCD:"",contactUser:"",access_token:"",token_type:"",otpmodelClose:!1,authType:"",isScanning:!1,auth_type:"O",otpValidFor:60},co=(e,r)=>{switch(r.type){case"inititateUserFingerVerification":case"inititateOTPVerification":return{...e,loading:!0,isError:!1,isUsernameError:!1,isPasswordError:!1,isOTPError:!1,isBiometricError:!1,userMessage:""};case"inititateUserFingerScanner":return{...e,isScanning:!0,isBiometricError:!1};case"usernameandpasswordrequired":return{...e,loading:!1,isError:!0,isUsernameError:!0,isPasswordError:!0,otploading:!1,userMessage:r?.payload?.error,userMessageforpassword:r?.payload?.errorPassword,userMessageforusername:r?.payload?.errorUsername,username:"",transactionID:"",comapanyCD:"",branchCD:"",contactUser:""};case"passwordVerificationFailure":return{...e,loading:!1,isError:!0,isUsernameError:!1,isPasswordError:!0,otploading:!1,userMessage:r?.payload?.error,userMessageforpassword:r?.payload?.errorPassword,username:"",transactionID:"",comapanyCD:"",branchCD:""};case"usernameVerificationFailure":return{...e,loading:!1,isError:!0,isUsernameError:!0,isPasswordError:!1,otploading:!1,userMessage:r?.payload?.error,userMessageforusername:r?.payload?.errorUsername,username:"",transactionID:"",comapanyCD:"",branchCD:"",contactUser:""};case"inititatePasswordVerification":return{...e,loading:!0,isError:!1,isUsernameError:!1,isPasswordError:!1,otploading:!1,userMessage:"",userMessageforusername:"",userMessageforpassword:"",username:"",transactionID:"",access_token:"",comapanyCD:"",branchCD:"",contactUser:""};case"passwordRotation":return{...e,loading:!1,username:r?.payload?.username,access_token:r?.payload?.access_token,token_type:r?.payload?.token_type};case"passwordRotationsuccess":return{...e,loading:!1,otpmodelClose:Boolean(r?.payload?.otpmodelclose)};case"passwordVerificationSuccessful":return{...e,loading:!1,otploading:!1,transactionID:r?.payload?.transactionID,comapanyCD:r?.payload?.comapanyCD,branchCD:r?.payload?.branchCD,contactUser:r?.payload?.contactUser,username:r?.payload?.username,auth_type:r?.payload?.auth_type,OtpuserMessage:"",access_token:r?.payload?.access_token,token_type:r?.payload?.token_type,otpmodelClose:!1,currentFlow:"OTP",authType:r?.payload?.authType,auth_data:r?.payload?.auth_data,otpValidFor:r?.payload?.otpValidFor};case"inititatebiometricVerification":return{...e,loading:!0,otploading:!0,OtpuserMessage:"",otpmodelClose:!1};case"biometricVerificationFailure":return{...e,loading:!1,isError:!0,isBiometricError:!0,userMessage:r?.payload?.error,isScanning:!1};case"biometricVerificationSuccessful":return{...e,loading:!1,isError:!1,isBiometricError:!1,state:r.payload,isScanning:!1};case"OTPVerificationComplate":return{...e,loading:!1,otploading:!1,OtpuserMessage:""};case"OTPVerificationFailed":return{...e,loading:!1,otploading:!1,OtpuserMessage:r?.payload?.error,otpmodelClose:Boolean(r?.payload?.otpmodelclose)};case"OTPResendSuccess":return{...e,transactionID:r?.payload?.transactionID};case"backToUsernameVerification":return{...lo,isPasswordError:r?.payload?.isError,userMessageforpassword:r?.payload?.errorMessage};default:return e}},po=({bannerDetails:a,logoUrl:t,logoTitle:s,loginFn:l,veirfyUsernameandPassword:d,validatePasswordFn:c,verifyOTP:p,OTPResendRequest:h,ResetPassword:f,LanguageComponent:y,forgotPasswordEndpoint:x})=>{const b=Zr(),[v,C]=w(co,lo),[P,T]=m(!1),N=g(0),[E,k]=m(null),B=g(null),{t:M}=H(),_=g(1),{MessageBox:O}=i();u((()=>{if(Boolean(t))if(no(t)){let e=n.base64toBlob(t);B.current="object"==typeof e&&Boolean(e)?URL.createObjectURL(e):"",k(B.current)}else k(t)}),[t]);const I=async e=>{if(Boolean(e)&&6===e.toString().length){C({type:"inititateOTPVerification"});const{status:r,data:o,message:a}=await p(v.transactionID,v.username,e,v.access_token,v.token_type,v.authType);"0"===r?(C({type:"OTPVerificationComplate"}),l(o)):C("999"===r?{type:"OTPVerificationFailed",payload:{error:a,otpmodelclose:!0}}:{type:"OTPVerificationFailed",payload:{error:a,otpmodelclose:!1}})}else C({type:"OTPVerificationFailed",payload:{error:"Please enter a 6 digit OTP number"}})},A=(e=!1,r="")=>{C({type:"backToUsernameVerification",payload:{isError:e,errorMessage:r}})};return e(o,{children:r(S,{container:!0,style:{height:"100vh",overflow:"hidden"},children:[e(io,{bannerDetails:a}),r(S,{item:!0,xs:11,md:6,lg:6,sm:6,children:[t?e(S,{container:!0,direction:"row",justifyContent:"flex-end",alignItems:"center",padding:"25px",maxWidth:"210px",ml:"auto",children:e(D,{describeChild:!0,title:s??"",children:e("img",{src:Boolean(E)?E:"",alt:"Logo",width:"100%"})})}):null,y?e(S,{container:!0,direction:"row",justifyContent:"flex-end",alignItems:"center",padding:"0 35px 0 0",maxWidth:"180px",ml:"auto",children:e(y,{})}):null,P?e(so,{classes:b,ResetPassword:f,open:P,username:v.username,accessToken:v.access_token,tokenType:v.token_type,handleClose:e=>{"0"===e&&C({type:"passwordRotationsuccess",payload:{otpmodelclose:!0}}),T(!1)},validatePasswordFn:c}):e(o,{children:"username"===v.currentFlow?e(eo,{classes:b,loginState:v,verifyUsernamePassword:async(e,r)=>{if(Boolean(e)&&Boolean(r)){C({type:"inititatePasswordVerification"});try{const{status:o="",data:a=null,message:t="",responseType:n="",access_token:i=null}=await d(e,r);if("0"===o&&"S"===n)C({type:"passwordRotation",payload:{username:e,access_token:i?.access_token||"",token_type:i?.token_type||""}}),T(!0);else if("0"===o){if(C({type:"passwordVerificationSuccessful",payload:{comapanyCD:a?.BASE_COMP_CD,branchCD:a?.BASE_BRANCH_CD,contactUser:a?.CONTACT2,transactionID:a?.REQUEST_CD,username:e,access_token:i?.access_token,token_type:i?.token_type,authType:a?.AUTH_TYPE,auth_data:a?.AUTH_DATA,otpValidFor:a?.OTP_VALID}}),"0"===a?.STATUS)for(let e=0;e<a?.ALERT_MSG_LIST.length;e++)await O({messageTitle:"Password Alert",message:a?.ALERT_MSG_LIST[e]})}else C({type:"passwordVerificationFailure",payload:{error:t,errorPassword:t}})}catch(e){throw new Error("Error occurred while verifying username and password: "+e)}}else Boolean(e)||Boolean(r)?Boolean(e)?C({type:"passwordVerificationFailure",payload:{error:"PasswordisRequired",errorPassword:"PasswordisRequired"}}):C({type:"usernameVerificationFailure",payload:{error:"UsernameisRequired",errorUsername:"UsernameisRequired"}}):C({type:"usernameandpasswordrequired",payload:{error:"UsernamenandPasswordisRequired",errorUsername:"UsernameisRequired",errorPassword:"PasswordisRequired"}})},forgotPasswordEndpoint:x},"username"):e(o,{children:"OTP"===v.authType?e(ro,{OTPResendRequest:h,classes:b,loginState:v,VerifyOTP:I,previousStep:A,OTPError:M(v?.OtpuserMessage??""),setOTPError:e=>{C({type:"OTPVerificationFailed",payload:{error:e}})},open:!0,handleClose:A,resendFlag:"LOGIN",setNewRequestID:e=>{C({type:"OTPResendSuccess",payload:{transactionID:e}}),_.current=_.current+1},otpresendCount:_.current},"otp"):"TOTP"===v.authType?r(o,{children:[" ",e(oo,{OTPResendRequest:h,classes:b,handleClose:A,loginState:v,VerifyOTP:I,OTPError:v?.OtpuserMessage??"",setOTPError:e=>{C({type:"OTPVerificationFailed",payload:{error:e}})},resendFlag:"LOGIN",setNewRequestID:e=>{C({type:"OTPResendSuccess",payload:{transactionID:e}}),_.current=_.current+1},otpresendCount:_.current},"OTPForm")]}):e(ao,{classes:b,loginState:v,verifyFinger:async()=>{try{C({type:"inititateUserFingerScanner"});const e=await(async()=>{var e=JSON.stringify({Quality:60,TimeOut:10});const r=await fetch("http://localhost:8004/mfs100/capture",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:e});return await r.json()})();if("0"===e?.ErrorCode){C({type:"inititateUserFingerVerification"});const r=await to(v.auth_data,e.IsoTemplate);if(r.isError)C({type:"biometricVerificationFailure",payload:{error:r?.errorMessage??"Something went wrong."}});else{const{status:e,data:o,message:a}=await p(v.transactionID,v.username,String(r?.sr_cd??"0"),v.access_token,v.token_type,v.authType,r.status?"Y":"N");"0"===e&&r.status?(C({type:"biometricVerificationSuccessful"}),l(o)):"0"!==e||r.status?"99"===e?C({type:"biometricVerificationFailure",payload:{error:a??"Finger Not Match.Please Try Again"}}):"999"===e?(C({type:"biometricVerificationFailure",payload:{error:a??"Finger Not Match.Please Try Again"}}),A(!0,a??"Finger Not Match.Please Try Again")):C({type:"biometricVerificationFailure",payload:{error:a??"Finger Not Match.Please Try Again"}}):(N.current=N.current+1,C({type:"biometricVerificationFailure",payload:{error:"Finger Not Match.Please Try Again"}}),N.current>=3&&A(!0,"Finger Not Match.Please Try Again"))}}else C({type:"biometricVerificationFailure",payload:{error:e?.ErrorMessage??M("Biometric.MFS100NotFound")}})}catch(e){C({type:"biometricVerificationFailure",payload:{error:e?.message??M("Biometric.Unknownerroroccured")}})}},previousStep:A},"biometric")})})]})]})})},mo=({classes:n,loginState:i,onSubmit:s,navigate:l,loginPageEndpoint:d})=>{const[c,p]=m({userName:1===i.workingState?i?.username:"",mobileno:"",password:"",confirmpassword:""}),f=g(null),w=g(null),y=g(null),[x,C]=m(0),[S,k]=m(0),D=Date.now()<x,B=Date.now()<S,[,M]=m(),_=g(null);u((()=>()=>clearTimeout(_.current)),[]);const{t:O}=H(),I=e=>{const r=e.target.name;let o=e.target.value;"userName"===r&&o&&(i.isUsernameError=!1),"mobileno"===r&&o&&(o=o.replace(/\D/g,""),Boolean(o)&&(i.isMobileError=!1)),p((e=>({...e,[r]:o})))};return u((()=>{1===i.workingState&&setTimeout((()=>{w?.current?.focus?.()}),2e3)}),[i.workingState]),e(h,{children:r("div",{className:n.formWrap,children:[e(a,{autoFocus:!0,label:O("UserID"),placeholder:String(O("UserID")),fullWidth:!0,type:"text",name:"userName",value:c.userName||"",onChange:I,error:i.isUsernameError,helperText:i.isUsernameError?O(i.userMessageforusername):"",InputLabelProps:{shrink:!0},disabled:!!i.loading||0!==i.workingState,autoComplete:"off",ref:f,inputProps:{maxLength:16},onKeyDown:e=>{"Enter"===e.key&&y?.current?.click?.()},style:{paddingBottom:"8px"}}),0===i.workingState?e(a,{label:O("MobileNo"),placeholder:"Enter Mobile No.",fullWidth:!0,type:"text",name:"mobileno",value:c.mobileno||"",onChange:I,error:i.isMobileError,helperText:i.isMobileError?O(i.userMessageforMobileno):"",InputLabelProps:{shrink:!0},disabled:!!i.loading||0!==i.workingState,autoComplete:"off",onKeyDown:e=>{"Enter"===e.key&&y?.current?.click?.()},inputProps:{maxLength:13},style:{paddingBottom:"8px"}}):null,1===i.workingState?r(o,{children:[e(a,{autoFocus:!0,label:O("Password"),placeholder:"Enter Password",fullWidth:!0,type:D?"text":"password",name:"password",value:c.password||"",onChange:I,error:i.isPasswordError,helperText:i.isPasswordError?O(i.userMessageforPassword):"",InputLabelProps:{shrink:!0},disabled:i.loading,autoComplete:"off",ref:w,onKeyDown:e=>{"Enter"===e.key&&y?.current?.click?.()},InputProps:{endAdornment:e(P,{position:"end",children:e(T,{"aria-label":"toggle password visibility",onClick:()=>{D?D&&C(0):(C(Date.now()+5e3),_.current=setTimeout((()=>M(Date.now())),5e3))},onMouseDown:e=>e.preventDefault(),disabled:i.loading,children:e(D?b:v,{})})})},inputProps:{maxLength:16},style:{paddingBottom:"8px"}}),e(a,{label:O("ConfirmPassword"),placeholder:String(O("EnterConfirmPassword")),fullWidth:!0,type:B?"text":"password",name:"confirmpassword",value:c.confirmpassword||"",onChange:I,error:i.isConfirmPasswordError,helperText:i.isConfirmPasswordError?O(i.userMessageforconfirmPassword):"",InputLabelProps:{shrink:!0},disabled:i.loading,autoComplete:"off",onKeyDown:e=>{"Enter"===e.key&&y?.current?.click?.()},InputProps:{endAdornment:e(P,{position:"end",children:e(T,{"aria-label":"toggle password visibility",onClick:()=>{B?B&&k(0):(k(Date.now()+5e3),_.current=setTimeout((()=>M(Date.now())),5e3))},onMouseDown:e=>e.preventDefault(),disabled:i.loading,children:e(B?b:v,{})})})},inputProps:{maxLength:16},style:{paddingBottom:"8px"}})]}):null,i.isApiError?e(E,{style:{color:"red"},children:i.apierrorMessage}):null,e("div",{style:{marginTop:"20px",display:"flex",flexDirection:"row-reverse"},children:e("div",{style:{flex:"auto",textAlign:"center",marginTop:"5px",marginBottom:"17px"},children:r("div",{children:[e(t,{style:{borderRadius:"10px",marginRight:"5px"},disabled:i.loading,onClick:()=>{l(d)},starticon:"West",rotateIcon:"scale(1.4) rotateX(360deg)",children:O("backtologin")}),e(t,{style:{borderRadius:"10px"},disabled:i.loading,onClick:()=>{s(c,i.workingState)},ref:y,endicon:i.loading?void 0:"East",rotateIcon:"scale(1.4) rotateX(360deg)",children:i.loading?e(N,{size:25,thickness:4.6}):O("Next")})]})})})]})})},go={isUsernameError:!1,userMessageforusername:"",loading:!1,isMobileError:!1,userMessageforMobileno:"",isPasswordError:!1,userMessageforPassword:"",isConfirmPasswordError:!1,userMessageforconfirmPassword:"",workingState:0,isApiError:!1,apierrorMessage:"",otploading:!1,OtpuserMessage:"",otpmodelClose:!1,requestCd:"",username:"",auth_type:"O",transactionID:"",contactUser:""},uo=(e,r)=>{switch(r.type){case"verifyUserNameandMobileNoFailed":return{...e,loading:!1,isUsernameError:r?.payload?.isUsernameError??!1,isMobileError:r?.payload?.isMobileError??!1,userMessageforusername:r?.payload?.userMessageforusername??"",userMessageforMobileno:r?.payload?.userMessageforMobileno??"",isApiError:r?.payload?.isApiError??!1,apierrorMessage:r?.payload?.apierrorMessage??"",requestCd:"",username:"",contactUser:""};case"initverifyUserNameandMobileNo":return{...e,loading:!0,isUsernameError:!1,isMobileError:!1,requestCd:"",username:""};case"verifyUserNameandMobileNoSuccess":return{...e,loading:!1,isUsernameError:!1,isMobileError:!1,workingState:0,isApiError:!1,apierrorMessage:"",requestCd:r?.payload?.requestCd??"",username:r?.payload?.username??"",auth_type:r?.payload?.auth_type,company_ID:r?.payload?.company_ID,branch_cd:r?.payload?.branch_cd,otpValidFor:r?.payload?.otpValidFor,contactUser:r?.payload?.contactUser};case"inititateOTPVerification":return{...e,loading:!1,otploading:!0,OtpuserMessage:"",otpmodelClose:!1};case"OTPVerificationComplate":return{...e,loading:!1,otploading:!1,OtpuserMessage:"",workingState:1,otpmodelClose:Boolean(r?.payload?.otpmodelclose)};case"OTPVerificationFailed":return{...e,otploading:!1,OtpuserMessage:r?.payload?.error,otpmodelClose:Boolean(r?.payload?.otpmodelclose)};case"verifyPasswordFailed":return{...e,loading:!1,isPasswordError:r?.payload?.isPasswordError??!1,isConfirmPasswordError:r?.payload?.isConfirmPasswordError??!1,userMessageforPassword:r?.payload?.userMessageforPassword??"",userMessageforconfirmPassword:r?.payload?.userMessageforconfirmPassword??"",isApiError:!1,apierrorMessage:""};case"initverifyPasswordSetReq":return{...e,loading:!0,isPasswordError:!1,isConfirmPasswordError:!1};case"passwordRegistaredSuccess":return{...e,loading:!1,isPasswordError:!1,isConfirmPasswordError:!1};case"OTPResendSuccess":return{...e,requestCd:r?.payload?.requestCd};default:return e}},ho=({screenFlag:a,updatenewPassword:t,validatePasswordFn:i,veirfyUsernameandMobileNo:s,verifyOTPForPWDReset:l,logoUrl:d,logoTitle:c,LanguageComponent:p,bannerDetails:h,navigate:f,loginPageEndpoint:y})=>{const x=Zr(),[b,v]=w(uo,go),[P,T]=m(!1),{enqueueSnackbar:N}=X(),E=g(1),{t:k}=H(),[B,M]=m(null),_=g(null);u((()=>{if(Boolean(d))if(no(d)){let e=n.base64toBlob(d);_.current="object"==typeof e&&Boolean(e)?URL.createObjectURL(e):"",M(_.current)}else M(d)}),[d]);const O=(e,r)=>{if(0===r){let r={isUsernameError:!1,isMobileError:!1,userMessageforusername:"",userMessageforMobileno:""};return Boolean(e.userName)||(r.isUsernameError=!0,r.userMessageforusername="UsernameisRequired"),Boolean(e.mobileno)?(isNaN(e.mobileno)||10!==e.mobileno.length&&13!==e.mobileno.length)&&(r.isMobileError=!0,r.userMessageforMobileno="Please enter valid Mobile No."):(r.isMobileError=!0,r.userMessageforMobileno="MobileNoisRequired"),v({type:"verifyUserNameandMobileNoFailed",payload:r}),!(r.isMobileError||r.isUsernameError)}if(1===r){let r={isPasswordError:!1,userMessageforPassword:"",isConfirmPasswordError:!1,userMessageforconfirmPassword:""},o=n.ValidatePassword(e.password);return Boolean(o)&&(r.isPasswordError=!0,r.userMessageforPassword=o),Boolean(e.confirmpassword)?Boolean(e.password)&&e.password!==e.confirmpassword&&(r.isConfirmPasswordError=!0,r.userMessageforconfirmPassword="New Password and Confirm Password did not matched"):(r.isConfirmPasswordError=!0,r.userMessageforconfirmPassword="Confirmpasswordisrequired"),v({type:"verifyPasswordFailed",payload:r}),!(r.isConfirmPasswordError||r.isPasswordError)}return!0};return e(o,{children:r(S,{container:!0,style:{height:"100vh",overflow:"hidden"},children:[e(io,{bannerDetails:h}),r(S,{item:!0,xs:6,md:6,lg:6,sm:6,children:[d?e(S,{container:!0,direction:"row",justifyContent:"flex-end",alignItems:"center",padding:"31px",maxWidth:"210px",ml:"auto",children:e(D,{describeChild:!0,title:c??"",children:e("img",{src:Boolean(B)?B:"",alt:"Logo",width:"100%"})})}):null,p?e(S,{container:!0,direction:"row",justifyContent:"flex-end",alignItems:"center",padding:"0 35px 0 0",maxWidth:"180px",ml:"auto",children:e(p,{})}):null,e(C,{maxWidth:"xs",children:r(S,{alignItems:"center",style:{paddingTop:"20px"},children:[e("h2",{style:{margin:"10px 0"},children:1===b.workingState?k("Setnewpassword"):"totp"===a?"Forgot TOTP":k("ForgotPassword")}),P?e(oo,{classes:x,handleClose:()=>{T(!1)},loginState:b,VerifyOTP:async e=>{if(Boolean(e)&&6===e.toString().length){v({type:"inititateOTPVerification"});const{status:r,data:o,message:t}=await l(b?.requestCd,b?.username,e,b?.auth_type,a);"0"===r?"totp"===a?(N(t,{variant:"success"}),f(y)):v({type:"OTPVerificationComplate",payload:{otpmodelclose:!0}}):"99"===r?v({type:"OTPVerificationFailed",payload:{error:t}}):(N(t,{variant:"error"}),f(y))}else v({type:"OTPVerificationFailed",payload:{error:"Please enter a 6 digit OTP number"}})},OTPError:k(b?.OtpuserMessage??""),setOTPError:e=>{v({type:"OTPVerificationFailed",payload:{error:e}})},resendFlag:"FORGET_PW",setNewRequestID:e=>{v({type:"OTPResendSuccess",payload:{requestCd:e}}),E.current=E.current+1},otpresendCount:E.current,OTPResendRequest:void 0}):e(mo,{classes:x,loginState:b,onSubmit:async(e,r)=>{if(O(e,r))if(0===r){v({type:"initverifyUserNameandMobileNo"});const{status:r,data:o,message:t}=await s(e?.userName.toLowerCase(),e?.mobileno,a);"0"===r?(v({type:"verifyUserNameandMobileNoSuccess",payload:{requestCd:String(o?.TRAN_CD??""),username:e?.userName,auth_type:o?.AUTH_TYPE,company_ID:o?.COMP_CD,branch_cd:o?.BRANCH_CD,otpValidFor:o?.OTP_VALID,contactUser:o?.CONTACT2}}),T(!0)):v({type:"verifyUserNameandMobileNoFailed",payload:{isApiError:!0,apierrorMessage:t}})}else if(1===r){v({type:"initverifyPasswordSetReq"});const{validateStatus:r,validateData:o}=await i({USER_ID:e?.userName,PASSWORD:e?.password,SCREEN_REF:"FORGET_PW"});if("0"===r)switch(o?.O_STATUS){case"999":v({type:"verifyPasswordFailed",payload:{isPasswordError:!0,userMessageforPassword:o?.O_MESSAGE,apierrorMessage:o?.O_MESSAGE}});break;case"0":const{status:r,data:a,message:n}=await t(b?.requestCd,b?.username,e?.password);"0"===r?(v({type:"passwordRegistaredSuccess"}),N("Password successfully reset",{variant:"success"}),f(y)):"99"===r?v({type:"verifyPasswordFailed",payload:{isApiError:!0,apierrorMessage:n}}):(N(n,{variant:"error"}),f(y))}else v({type:"verifyPasswordFailed",payload:{isApiError:!0,apierrorMessage:o?.O_MESSAGE}})}},navigate:f,loginPageEndpoint:y})]})})]})]})})},fo={gridConfig:{dense:!0,gridLabel:"Access Branch List",rowIdColumn:"BRANCH_CD",defaultColumnConfig:{width:400,maxWidth:450,minWidth:300},allowColumnReordering:!1,disableSorting:!1,hideHeader:!1,disableGroupBy:!0,enablePagination:!1,containerHeight:{min:"68vh",max:"68vh "},allowFilter:!1,allowColumnHiding:!1,allowRowSelection:!1,isCusrsorFocused:!0,hideFooter:!0},columns:[{accessor:"BRANCH_CD",columnName:"Branch Code",sequence:1,alignment:"left",componentType:"default",width:200,minWidth:140,maxWidth:220},{accessor:"BRANCH_NM",columnName:"Branch Name",sequence:2,alignment:"left",componentType:"default",width:280,minWidth:280,maxWidth:420},{accessor:"DISP_STATUS",columnName:"Status",sequence:3,alignment:"left",componentType:"default",width:200,minWidth:140,maxWidth:220},{accessor:"BEGIN_DATETIME",columnName:"Begin Time",sequence:4,alignment:"left",componentType:"dateTime",width:222,minWidth:140,maxWidth:240},{accessor:"END_DATETIME",columnName:"End Time",sequence:5,alignment:"left",componentType:"dateTime",width:222,minWidth:140,maxWidth:240},{accessor:"DAYEND_STATUS",columnName:"Dayend Status",sequence:6,componentType:"default",isVisible:!1},{accessor:"EOD_RUNNING_STATUS",columnName:"EOD Running Status",sequence:6,componentType:"default",isVisible:!1},{accessor:"BASE_COMP_CD",columnName:"Base Comp Cd",sequence:6,componentType:"default",isVisible:!1},{accessor:"BASE_BRANCH_CD",columnName:"Base Branch Cd",sequence:6,componentType:"default",isVisible:!1},{accessor:"COMP_CD",columnName:"Comp Cd",sequence:6,componentType:"default",isVisible:!1},{accessor:"COMP_NM",columnName:"Comp Name",sequence:6,componentType:"default",isVisible:!1}]},wo=x((e=>({heading_user_img:{width:"40px",height:"40px"},heading_user_img_border:{border:"2px dashed var(--theme-color3)",borderRadius:"50%",padding:"4px"},logo:{height:"38px"}}))),yo=[{actionName:"back",actionLabel:"Back",multiple:!1,rowDoubleClick:!1,actionTextColor:"var(--theme-color3)",actionBackground:"var(--white)",startsIcon:"West",rotateIcon:"scale(1.4) rotateX(-360deg)"},{actionName:"proceed",actionLabel:"Proceed",multiple:!1,rowDoubleClick:!0,actionTextColor:"var(--white)",actionBackground:"var(--theme-color3)",onEnterSubmit:!0,endsIcon:"East",rotateIcon:"scale(1.4) rotateX(-360deg)"}],xo=({selectionMode:a,authState:t,isBranchSelectedFn:n,isLoggedInFn:i,logoutFn:s,logos:p,logo:m,navigate:g,BranchSelectionGridDataApiFn:f,GetMenuDataApiFn:w,sideImage:x,branchSelectFn:b,dashboardUrl:v,loginUrl:C,appTranCd:P})=>{const T=wo(),{enqueueSnackbar:N}=X(),{data:E,isLoading:k,isFetching:A,error:R,isError:L}=Q(["BranchSelectionGridData"],(()=>f()));u((()=>()=>{l.removeQueries(["BranchSelectionGridData",{}])}),[]),u((()=>{i()?n()&&"C"!==a&&g(v):g(C)}),[n,i]);const U=Z(w,{onSuccess:(e,r)=>{b({menulistdata:e,branchCode:r?.BRANCH_CD,branch:r?.BRANCH_NM,baseBranchCode:r?.BASE_BRANCH_CD})}}),F=U.error,W=y((e=>{"proceed"===e.name?0===e.rows?.length?N("Please Select Branch",{variant:"error"}):"C"===e.rows?.[0]?.data?.STATUS?N("Branch is in Day End Status.~rPlease contact system Vendor.",{variant:"error"}):U.mutate({BASE_COMP_CD:e.rows?.[0]?.data?.BASE_COMP_CD??"",BASE_BRANCH_CD:e.rows?.[0]?.data?.BASE_BRANCH_CD??"",COMP_CD:e.rows?.[0]?.data?.COMP_CD??"",BRANCH_CD:e.rows?.[0]?.data?.BRANCH_CD??"",GROUP_NAME:t?.groupName??"",APP_TRAN_CD:P,COMP_NM:e.rows?.[0]?.data?.COMP_NM??"",BRANCH_NM:e.rows?.[0]?.data?.BRANCH_NM??"",DAYEND_STATUS:e.rows?.[0]?.data?.DAYEND_STATUS??"",EOD_RUNNING_STATUS:e.rows?.[0]?.data?.EOD_RUNNING_STATUS??"",IS_UPD_DEF_BRANCH:t?.user?.isUpdDefBranch??"",COMP_BASE_BRANCH_CD:e.rows?.[0]?.data?.COMP_BASE_BRANCH_CD??"",selectionMode:a}):"back"===e.name&&("C"===a?g(v,{replace:!0}):s())}),[g,E,U]);u((()=>{var e=E?.some((e=>"O"===e.STATUS));!1===e&&(N("Branch is in Day End Status.~rPlease contact system Vendor.",{variant:"error"}),s()),1===E?.length&&"O"===E?.[0]?.STATUS&&W({name:"proceed",rows:[{data:{...E[0]}}]})}),[JSON.stringify(E)]);const V=oe((({className:r,...o})=>e(D,{...o,classes:{popper:r}})))((({theme:e})=>({[`& .${B.tooltip}`]:{backgroundColor:e.palette.common.white,color:"rgba(0, 0, 0, 0.87)",boxShadow:e.shadows[1],fontSize:13}})));return e(o,{children:r(S,{container:!0,style:{margin:"0",padding:"0",height:"100vh"},children:[x?e(S,{item:!0,lg:1,md:1,xl:1,xs:1,sm:1,children:e("img",{className:"sideImage",src:x,alt:"side-Image"})}):null,e(S,{item:!0,lg:11,md:11,xl:11,xs:11,style:{display:"flex",justifyContent:"center"},children:r(S,{container:!0,style:{minHeight:"100vh",padding:"10px 0px 0px 0px"},lg:11,md:11,xl:11,xs:11,children:[r(S,{container:!0,style:{margin:"0",padding:"0"},lg:12,md:12,xl:12,xs:12,children:[e(S,{xs:12,sm:1,md:1,lg:1,xl:1,sx:{display:"flex",alignItems:"center"},children:e(M,{direction:"row",spacing:4,ml:1,children:e(_,{className:T.heading_user_img_border,sx:{cursor:"pointer"},children:e(V,{title:r(o,{children:[r("div",{children:["User ID : ",t?.user?.id??""]}),r("div",{children:["Role : ",t?.roleName??""]}),e("div",{children:'Last Unsuccessful Login : ""'})]}),placement:"bottom-start",children:e(O,{className:T.heading_user_img,alt:"Remy Sharp",src:Boolean(p?.profile)?p?.profile:ae})})})})}),r(S,{xs:12,sm:5,md:5,lg:5,xl:5,sx:{justifyContent:"center",display:"flex",flexDirection:"column"},children:[r("h1",{className:"name-heading",style:{fontSize:"24px",margin:"4px 0px"},children:["Welcome ",e("span",{children:`${t?.user?.name??""},`})]}),r("div",{style:{display:"flex",alignItems:"center",gap:10},children:[e("h3",{style:{margin:"4px 0px"},children:(()=>{let e,o=(new Date).getHours();return o<12?e="morning":o>=12&&o<=16?e="afternoon":o>=16&&o<=24&&(e="evening"),r("span",{children:["Good ",e,","]})})()}),e("img",{src:re,alt:"",style:{height:"18px"}})]})]}),e(S,{xs:12,sm:1,md:1,lg:1,xl:1,sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:e(M,{direction:"row",justifyContent:"flex-start",spacing:2,children:e(_,{className:T.heading_user_img_border,children:e(O,{className:T.heading_user_img,alt:"Remy Sharp",src:Boolean(p?.bank)?p?.bank:ee})})})}),r(S,{xs:12,sm:3,md:3,lg:3,xl:3,sx:{display:"flex",flexDirection:"column",justifyContent:"center"},children:[e("div",{className:"bank-name-container",style:{fontSize:"14px"},children:e("p",{className:"bank-name",children:`Bank Name: ${t?.companyName??""}`})}),e("p",{className:"emp-id",children:`Emp. Id: ${t?.user?.employeeID??""}`})]}),r(S,{xs:12,sm:3,md:3,lg:2,xl:2,sx:{display:"flex",alignItems:"center",justifyContent:"right"},children:[" ",e("div",{children:e("img",{src:Boolean(p?.logo)?p?.logo:m,alt:"bank_logo",className:T.logo})})]})]}),L?e(h,{children:e("div",{style:{width:"100%",paddingTop:"10px"},children:e(d,{severity:R?.severity??"error",errorMsg:R?.error_msg??"Error",errorDetail:R?.error_detail??""})})}):U.isError&&U.error?e(h,{children:e("div",{style:{width:"100%",paddingTop:"10px"},children:e(d,{severity:F.severity??"error",errorMsg:F.error_msg??"Error",errorDetail:F.error_detail??""})})}):null,e(c,{finalMetaData:fo,data:E??[],setData:()=>null,actions:yo,setAction:W,controlsAtBottom:!0,actionContextAtBottom:!0,headerToolbarStyle:{background:"#fff !important",padding:"0","& .MuiTypography-root":{color:"black"}},disableMultipleRowSelect:!0,variant:"outlined",loading:k||A||U.isLoading,defaultSelectedRowId:t?.user?.branchCode??null},"branchSelection"),L||0===E?.length?e(I,{sx:{backgroundColor:"var(--theme-color3)",position:"absolute",right:"113px",bottom:"20px",width:"7rem","&:hover":{backgroundColor:"var(--theme-color3)"}},onClick:()=>{"C"===a?g(v,{replace:!0}):s()},children:"Back"}):null]})})]})})},bo=r=>e(s,{children:e(xo,{...r})}),vo=x((e=>({appBar:{transition:e.transitions.create(["width","margin"],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),color:"#0063A3",height:"80px",background:"var(--white)",boxShadow:"0px 1px 0px -0.5px #DEE0E2"},searchBar:{width:290,border:"none",color:"rgba(0, 0, 0, 0.87) !important",backgroundColor:"rgb(235 237 238 / 26%)!important","& input":{width:"100% !important"}},searchList:{position:"absolute",background:"#fff",width:"100%",borderRadius:"6px",boxShadow:"0 12px 25px rgba(0,0,0,.3)",top:"120%",height:"auto",maxHeight:"325px",overflowY:"auto","& .list-links":{background:"none",border:"none",outline:"none",cursor:"pointer",textDecoration:"none",padding:"0.7rem 1rem",fontSize:"0.90rem",textAlign:"left",borderBottom:"1px solid #ddd",color:"#222 !important",fontWeight:500,"&:hover, &.active":{backgroundColor:"#f4f4f4"}}},appBarShift:{paddingLeft:"0px",transition:e.transitions.create(["width","margin"],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen,background:"rgba(250, 251, 255, 0.9)"})},heading_user_dtl:{width:"458px",height:"73px",left:"37px",top:"calc(50% - 73px/2)"},heading_user_img:{width:"40px",height:"40px"},heading_user_img_border:{border:"2px dashed var(--theme-color3)",borderRadius:"50%",padding:"4px"},toolbar:{minHeight:"80px",paddingLeft:"0px",height:"80px"},title:{flexGrow:1,padding:e.spacing(.5,0),color:"var(--theme-color1)"},searchRoot:{fontFamily:e.typography.fontFamily,position:"relative",boxShadow:"0px 2px 4px -1px rgba(0,0,0,0.2), 0px 4px 5px 0px rgba(0,0,0,0.14), 0px 1px 10px 0px rgba(0,0,0,0.12)",marginRight:e.spacing(2),marginLeft:e.spacing(1),marginBottom:e.spacing(.25),marginTop:e.spacing(.25),borderRadius:40,backgroundColor:A(e.palette.common.white,.15),"&:hover":{backgroundColor:A(e.palette.common.white,.25)},"& $inputInput":{transition:e.transitions.create("width"),width:120,"&:focus":{width:170}}},search:{width:e.spacing(6),height:"100%",position:"absolute",pointerEvents:"none",display:"flex",alignItems:"center",justifyContent:"center"},inputRoot:{color:"inherit",marginTop:0,borderRadius:"40px"},inputInput:{padding:e.spacing(1,1,1,6)},loggedInUser:{marginLeft:e.spacing(2)},nameClass:{color:"#0063A3",fontWeight:600,textTransform:"capitalize",lineHeight:"1.4",textAlign:"left"},dropDown:{fontSize:"2rem"},vTop:{verticalAlign:"top",paddingLeft:"4px",color:"var(--theme-color1)"},userDesignation:{margin:"0px",fontWeight:500,fontSize:"0.875rem",lineHeight:1.57,color:"var(--theme-color1)"},userName:{margin:"0px",fontWeight:500,fontSize:"0.875rem",lineHeight:1.57,color:"var(--theme-color3)"},userprofilehover:{"&:hover":{backgroundColor:"var(--white)"}},lang_svg:{marginRight:"10px",width:"22px",height:"22px"},logo:{height:"38px"},version01:{margin:"0",textAlign:"center",color:"var(--theme-color3)",fontSize:"9px"},DrawerClose_icon:{color:"var(--theme-color3)",position:"static",background:"transperant","&:hover":{background:"var(--theme-color4)"},width:"46px",height:"46px"},marquee:{animation:"$marquee 10s linear infinite",animationDelay:"3s"},"@keyframes marquee":{"0%":{transform:"translateX(100%)"},"100%":{transform:"translateX(-100%)"}},popover:{popover:{maxWidth:"100%",width:"fit-content","& .MuiPopover-paper":{maxWidth:"100%"}}}}))),Co=({handleDrawerOpen:a,handleDrawerClose:t,open:n,authState:i,LanguageComponent:s,SearchComponent:l,dashboardUrl:d,logos:c,bankLogo:p,profilePic:m,handleLogout:g,handleProfile:u,navigate:h,hideGreetings:f,menuIconPosition:w="left"})=>{const y=vo(),{t:x}=H(),b=oe((({className:r,...o})=>e(D,{...o,classes:{popper:r}})))((({theme:e})=>({[`& .${B.tooltip}`]:{backgroundColor:e.palette.common.white,color:"rgba(0, 0, 0, 0.87)",boxShadow:e.shadows[1],fontSize:13}})));return e(R,{position:"fixed",elevation:0,className:$(y.appBar,n&&y.appBarShift),children:r(L,{className:y.toolbar,children:[r(_,{sx:{display:"flex",justifyContent:"space-evenly",alignItems:"center",height:"80px",width:"227px",flexDirection:"right"===w?"row-reverse":"row"},children:[e(K,n?{disableRipple:!0,onClick:()=>t(),className:y.DrawerClose_icon,children:e(ne,{fontSize:"large"})}:{disableRipple:!0,"aria-label":"open drawer",onClick:()=>a(),className:y.DrawerClose_icon,children:e(ne,{fontSize:"large"})}),r("div",{children:[e("img",{src:Boolean(c?.logo)?c?.logo:p,alt:"bank_logo",className:y.logo,onClick:e=>{e.preventDefault(),h(d??"./dashboard")}}),e("p",{className:y.version01,children:c?.version})]})]}),e(M,{direction:"row",spacing:4,mx:2,children:e(_,{className:y.heading_user_img_border,children:e(O,{className:y.heading_user_img,alt:"Remy Sharp",src:Boolean(c?.bank)?c?.bank:ee})})}),r(k,{component:"h1",variant:"h6",color:"inherit",noWrap:!0,className:y.title,children:[e(_,{style:{marginBottom:"8px",fontSize:"17px",color:"var(--theme-color1)",width:"555px"},className:$({[y.marquee]:i?.companyName.length>55}),children:i?.companyName||""}),e("div",{style:{display:"flex",gap:"8px"},children:r("div",{style:{color:"var(--theme-color6)"},children:[r(k,{variant:"caption",display:"block",lineHeight:0,fontSize:"11px",children:[x("appBar.Branch"),":",i?.user?.branchCode??"001 ","-",i?.user?.branch??""]}),r(k,{variant:"caption",display:"inline",fontSize:"11px",children:[x("appBar.WorkingDate"),":"," ",Boolean(i?.workingDate)?So(ie(new Date(i?.workingDate),"dd/MM/yyyy")):"not found"]}),r(k,{marginLeft:1,variant:"caption",display:"inline",fontSize:"11px",children:[x("appBar.LastLoginDate")," :"," ",So(i?.user?.lastLogin??"Vastrapur")]})]})})]}),r(_,{children:[f?null:e(_,{sx:{marginBottom:"3px",paddingRight:"15px"},children:r(M,{direction:"row",spacing:2,justifyContent:"flex-end",alignItems:"center",children:[r(k,{fontSize:"17px",color:"#1C1C1C",children:[(()=>{let e,o=(new Date).getHours();return o<12?e="morning":o>=12&&o<=16?e="afternoon":o>=16&&o<=24&&(e="evening"),r("span",{children:["Good ",e,","]})})()," ",i?.user?.id??""]}),e("img",{src:re,alt:"",style:{height:"18px"}})]})}),r(_,{display:"flex",justifyContent:"space-evenly",alignItems:"center",children:[l?e(l,{}):null,s?e(s,{}):null,e(_,{maxWidth:170,display:"flex",justifyContent:"end",children:e(D,{title:"Logout",placement:"bottom",arrow:!0,children:e(K,{onClick:()=>"function"==typeof g?g():null,color:"error",sx:{backgroundColor:"rgba(235, 237, 238, 0.45)",borderRadius:"10px",height:"30px",width:"30px","&:hover":{background:"var(--white)",borderRadius:"10px",transition:"all 0.2s ease 0s",boxShadow:"rgba(0, 0, 0, 0.16) 0px 3px 6px, rgba(0, 0, 0, 0.23) 0px 3px 6px","& .MuiSvgIcon-root":{height:"32px",width:"32px",transition:"all 0.2s ease 0s",padding:"4px"}}},"aria-label":"show 4 new mails",children:e(te,{})})})})]})]}),e(M,{direction:"row",spacing:4,ml:1,children:e(_,{className:y.heading_user_img_border,sx:{cursor:"pointer"},children:e(b,{title:r(o,{children:[r("div",{children:[" ",x("appBar.UserID"),": ",i?.user?.id]}),r("div",{children:[x("appBar.Role")," : ",i?.roleName]}),r("div",{children:[x("appBar.LastUnsuccessfulLogin"),' : ""']})]}),placement:"bottom-start",children:e(O,{className:y.heading_user_img,onClick:()=>"function"==typeof u?u():null,alt:"Remy Sharp",src:m??""})})})})]})})},So=e=>Boolean(e)?e:"N/A",Po=x((e=>({drawerPaper:{position:"relative",whiteSpace:"nowrap",width:227,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),border:"none",overflow:"hidden",zIndex:120},drawerPaperClose:{overflowX:"hidden",transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),width:e.spacing(8),[e.breakpoints.up("sm")]:{width:e.spacing(8)}},toolbarIcon:{display:"flex",alignItems:"center",zIndex:9999,...e.mixins.toolbar,background:"var(--white)",justifyContent:"center",height:"80px"},hrCSS:{zIndex:9999},buttonLink:{backgroundColor:"transparent",border:"none",cursor:"pointer",textDecoration:"underline",display:"inline",margin:0,padding:0,"&:focus":{textDecoration:"none"},"$:hover":{textDecoration:"none"}}}))),To=[];x((e=>({navBarCSS:{padding:"4px 1rem ",backgroundColor:"#fff !important",minHeight:"64px",boxShadow:"0 3px 6px rgba(0,0,0,0.03)",margin:"10px"},headerDropdown:{backgroundColor:"#fff",minWidth:"205px",boxShadow:"0 3px 6px rgba(0,0,0,0.16)",textDecoration:"none",borderBottom:"3px solid #26A456"},navLinkHeader:{color:"#555",fontSize:"14px",lineHeight:"1.2",paddingTop:"4px",paddingBottom:"4px",paddingRight:".5rem",paddingLeft:".5rem",fontWeight:600,textTransform:"capitalize",display:"flex",alignItems:"center",cursor:"pointer","& hover":{color:"#0b6fb8"}},productLink:{color:"#555",padding:"0 1rem 8px 1rem",display:"inline-block",verticalAlign:"middle",cursor:"pointer",textTransform:"capitalize"},font13:{fontSize:"13px"},loginDropdown:{width:"160px"}})));const No=x((e=>({root:{justifyContent:"center"},drawer:{margin:"5px"},item:{display:"flex",borderRadius:"8px",marginLeft:"7px",marginTop:"6.5px",width:"90%",height:"50px",paddingLeft:e.spacing(2),paddingRight:e.spacing(2),background:"var(--white)",boxShadow:"3px 6px 9px rgba(93, 95, 121, 0.26)","& svg":{color:"var(--theme-color1)"},"&:hover":{boxShadow:"6px 6px 1px -1px rgba(0,0,0,0.2), 0px 1px 1px 0px rgba(0,0,0,0.14), 0px 1px 0px 0px rgba(0,0,5,0.12)",background:"var(--theme-color4)",transition:"0.6s ease"}},drawerIconSize:{width:"50px",height:"50px",padding:"18px",justifyItems:"cenetr"},button:{color:"#0063A3",padding:"10px 8px",textTransform:"none",letterSpacing:0,width:"100%",textAlign:"left","&:hover":{backgroundColor:"var(--theme-color1)"}},btnRoot:{paddingLeft:"24px",justifyContent:"left "},navLinks:{overflowY:"auto",overflowX:"hidden",backgroundColor:"rgba(250, 251, 255, 0.9);",borderRadius:"10px",paddingTop:"5px"},navLinksforseparateView:{overflowY:"auto",overflowX:"hidden",height:"calc(100vh - 180px)",paddingTop:"10px"},nestedMenuLevel1:{paddingLeft:"20px",marginTop:"11px",paddingRight:e.spacing(3),height:"auto",fontSize:"13px","& div > svg":{fontSize:"14px"}},nestedMenuLevel2:{paddingLeft:"20px",marginTop:"11px",fontSize:"12px","& div > svg":{fontSize:"9px"}},listIcon:{minWidth:"30px !important",justifyItems:"center",color:"var(--theme-color6)",fontWeight:700,fontSize:"18px"},link:{fontSize:"1rem ",marginTop:"2px",marginBottom:"2px",textOverflow:"ellipsis",color:"var(--theme-color1)",marginLeft:"15px",whiteSpace:"break-spaces","& span":{fontWeight:400,whiteSpace:"break-spaces"},"& p":{color:"var(--theme-color3)",fontweight:400}},linktext:{backgroundColor:"var(--white)","&:hover":{background:"var(--theme-color1)","& div":{color:"var(--white) !important"},"& div > svg":{color:"var(--white) !important"}}},faSmall:{fontSize:"13px "},openList:{":not(activeMenuItem)":{"& > div":{backgroundColor:"rgba(0, 0, 0, 0.04)"},"& *":{color:"var(--white)"}}},openCurrent:{backgroundColor:"var(--theme-color1)","& *":{color:"var(--white)"},"&:hover":{backgroundColor:"var(--theme-color1)"}},slimList:{paddingTop:"15px",paddingBottom:"13px",height:"auto",paddingLeft:"15px",justifyItems:"center"},activeMenuItem:{backgroundColor:"var(--theme-color1)!important ","& > div":{color:"var(--white)!important"},"& svg":{color:"var(--theme-color4)"},"& hover":{"& > div":{color:"var(--theme-color3)"}},"& p":{color:"var(--theme-color6)"}}})));let Eo=!0;const ko=({metaData:r,handleDrawerOpen:o,drawerOpen:a,setView:t,slimSize:n,setNewFilterData:i,setNewFilterView:s,isFromSeparetView:l=!1,rootUrl:d,dashboardUrl:c,navigate:p})=>{const m=No();let g=null;return Eo=a,Array.isArray(r.navItems)&&(g=r.navItems.map((r=>!0===r?.seperateView?e(Do,{item:r,setView:t,classes:m,level:0,slimSize:n,setNewFilterData:i,setNewFilterView:s},r.label):Array.isArray(r.children)?e(Mo,{item:r,classes:m,level:0,handleDrawerOpen:o,drawerOpen:a,slimSize:n,rootUrl:d,dashboardUrl:c,navigate:p},r.label):e(Bo,{item:r,classes:m,level:0,slimSize:n,drawerOpen:a,rootUrl:d,dashboardUrl:c,navigate:p},r.label)))),e(U,{component:"nav",disablePadding:!0,className:l?m.navLinksforseparateView:m.navLinks,children:e(le,{children:g})})},Do=({item:o,setView:a,level:t,classes:n,slimSize:i,setNewFilterData:s,setNewFilterView:l})=>{let d=(o.label||"").toLowerCase().substring(0,1)||"circle";const c="process.gif"!==o.icon?.toLowerCase()&&o.icon?e(F,{className:n.listIcon,children:e(se,{icon:["fas",o.icon]})}):e(F,{className:n.listIcon,children:e(se,{icon:["fas",d]})}),p=1===t?n.nestedMenuLevel1:2===t?n.nestedMenuLevel2:"";return r(W,{button:!0,disableGutters:!0,className:$({[n.item]:!0,[p]:Boolean(p),[n.slimList]:Boolean(i),[n.drawerIconSize]:!Eo}),onClick:()=>{if("newfilterview"===o.viewName&&Array.isArray(o.children)){l({label:o.label,placeholder:"Search "+o.label+" Screen..."});let e=o.children.map((e=>({...e,secondaryLabel:e.user_code})));s(e)}a(o.viewName)},children:[e(D,{title:o.label,arrow:!0,placement:Eo?"bottom-start":"right",children:e("span",{children:c})}),Eo&&o.label.length>27||!Boolean(c)?e(D,{title:o.label,arrow:!0,placement:Eo?"bottom-start":"right",children:e(V,{primary:o.label,className:n.link,secondary:o.secondaryLabel??null})}):Eo?e(V,{primary:o.label,className:n.link,secondary:o.secondaryLabel??null}):null]})},Bo=({item:o,classes:a,level:t,slimSize:n,drawerOpen:i,rootUrl:s,dashboardUrl:l,navigate:d})=>{const c=_o(window.location?.pathname??"",o?.href??"",o?.navigationProps,s,l);if(c){let e=document.title;document.title=e.split(" - ")[0]+" - "+o.label}let p=(o.label||"").toLowerCase().substring(0,1)||"circle";const m="process.gif"!==o.icon.toLowerCase()&&Boolean(o.icon)?e(F,{className:a.listIcon,children:e(se,{icon:["fas",o.icon]})}):e(F,{className:a.listIcon,children:e(se,{icon:["fas",p]})}),g=1===t?a.nestedMenuLevel1:2===t?a.nestedMenuLevel2:"";return r(W,{button:!0,disableGutters:!0,className:$({[a.item]:!0,[g]:Boolean(g),[a.slimList]:Boolean(n),[a.activeMenuItem]:c,[a.drawerIconSize]:!Eo}),onClick:e=>{if(e.preventDefault(),o.isRouterLink){let e=o.href;if(e="/"===o.href?.substring(0,1)?o.href.substring(1):o.href,o.passNavigationPropsAsURLParmas){let r=new URLSearchParams(o?.navigationProps);d(`${e}?${r.toString()}`)}else d(`${e}`,{state:{...o?.navigationProps}})}else Boolean(o.href)&&window.open(o.href,o.rel??"_newtab")},children:[e(D,{title:o.label,arrow:!0,placement:Eo?"bottom-start":"right",children:e("span",{children:m})}),Eo&&o.label.length>27||!Boolean(m)?e(D,{title:o.label,arrow:!0,placement:Eo?"bottom-start":"right",children:e(V,{primary:o.label,className:a.link,secondary:o.secondaryLabel??null})}):Eo?e(V,{primary:o.label,className:a.link,secondary:o.secondaryLabel??null}):null]})},Mo=({item:a,classes:t,level:n,handleDrawerOpen:i,drawerOpen:s,slimSize:l,rootUrl:d,navigate:c})=>{const[p,g]=m(!1),u=a.children?.map((r=>Array.isArray(r.children)?e(Mo,{item:r,classes:t,level:n+1,handleDrawerOpen:i,drawerOpen:s,slimSize:l,rootUrl:d,navigate:c},r.label):e(Bo,{item:r,classes:t,level:n+1,slimSize:l,rootUrl:d,navigate:c},r.label)));let h=(a.label||"").toLowerCase().substring(0,1)||"circle";const f="process.gif"!==a.icon?.toLowerCase()&&Boolean(a.icon)?e(F,{className:t.listIcon,children:e(se,{icon:["fas",a.icon]})}):e(F,{className:t.listIcon,children:e(se,{icon:["fas",h]})}),w=1===n?t.nestedMenuLevel1:2===n?t.nestedMenuLevel2:"";return r(o,{children:[r(W,{button:!0,onClick:()=>{g(!p)},disableGutters:!0,className:$(p?{[t.item]:!0,[w]:Boolean(w),[t.slimList]:Boolean(l),[t.openCurrent]:!0,[t.drawerIconSize]:!Eo}:{[t.item]:!0,[w]:Boolean(w),[t.slimList]:Boolean(l),[t.drawerIconSize]:!Eo}),children:[e(D,{title:a.label,arrow:!0,placement:Eo?"bottom-start":"right",children:e("span",{children:f})}),s||!Boolean(f)?r(o,{children:[e(V,{primary:a.label,secondary:a.secondaryLabel??null,color:"primary",className:t.link}),e(p?de:ce,{})]}):null]}),e(z,{in:p,timeout:"auto",unmountOnExit:!0,children:e(U,{component:"div",disablePadding:!0,className:p?t.openList:"",children:u})})]})},_o=(e,r,o,a,t)=>{if((e===`/${a}`||e===`/${a}/`)&&r===t)return!0;if("report"===r){try{if("?"+new URLSearchParams(o).toString()===window.location.search)return!0}catch(e){console.log(e)}return!1}return!(e===`/${a}`||"/"===e||!Boolean(r)||!e.includes(r))},Oo=(e,r,o)=>(Array.isArray(r)||(r=[r]),r.some((r=>o[r]?.toLocaleLowerCase?.()?.includes(e?.toLocaleLowerCase?.())))),Io=(e,r,o)=>{let a=[];for(let t=0;t<r.length;t++)if(Oo(e,o,r[t])){let{children:n,...i}=r[t];if(Array.isArray(n)&&n.length>0){let r=Io(e,n,o);r.length>0&&a.push({...i,children:r})}else a.push({...i})}return a},Ao=({metaData:o,handleDrawerOpen:a,drawerOpen:t,setView:n,label:i,icon:s,placeholder:l="Search Reports...",rootUrl:d,dashboardUrl:c,navigate:g})=>{const[u,h]=m(""),w=f((()=>Io(u,o.navItems,["label","secondaryLabel"])),[u,o.navItems]),y=No(),x=s?e(F,{className:y.listIcon,children:e(pe,{})}):null;return r("div",{style:{display:"flex",flexDirection:"column"},children:[r(W,{button:!0,className:$({[y.item]:!0,[y.nestedMenuLevel1]:!0,[y.linktext]:!0}),onClick:()=>n("/"),children:[x,e(V,{primary:i,className:y.link})]}),e(p,{sx:{overflow:"hidden"},value:u,onChange:e=>h(e.target.value),onClick:()=>{t||a()},placeholder:Boolean(l)?l:"Search Reports...",autoFocus:t}),e(ko,{handleDrawerOpen:a,drawerOpen:t,setView:n,metaData:{navItems:w,config:{rel:"",target:"_blank"}},slimSize:!0,isFromSeparetView:!0,rootUrl:d,dashboardUrl:c,navigate:g})]})};me.add(ge,ue,he,fe,we,ye,xe,be,ve,Ce,Se,Pe,Te,Ne,Ee,ke,De,Be,Me,_e,Oe,Ie,Ae,Re,Le,Ue,Fe,We,Ve,ze,qe,He,je,Ge,Ke,$e,Xe,Ye,Je,Qe,Ze,er,rr,or,ar,tr,nr,ir,sr,lr,dr,cr,pr,mr,gr,ur,hr,fr,wr,yr,xr,br,vr,Cr,Sr,Pr,Tr,Nr,Er,kr,Dr,Br,Mr,_r,Or,Ir,Ar,Rr,Lr,Ur,Fr,Wr,Vr,zr,qr,Hr,jr,Gr,Kr,$r,Xr,Yr,Jr,Qr);const Ro=(e,r,o,a,t,n)=>{let i=Wo(e.navItems,r,o,a,t,n).map((e=>{let{children:r,...o}=e;return Array.isArray(r)&&r.length>5&&(Boolean(o.seperateView)||(o.seperateView=!0,o.viewName="newfilterview")),{...o,children:r}}));return{config:e.config,navItems:i}},Lo=(e,r)=>{if(!Array.isArray(r)||!Array.isArray(e))return!0;if(r.length<=0||e.length<=0)return!0;for(const o of r)if(e.indexOf(o)>=0)return!0;return!1},Uo=(e,r)=>!Array.isArray(r)||"number"!=typeof e||(r.length<=0||!(r.indexOf(e)>=0)),Fo=(e,r)=>{if(!Array.isArray(r)||!Array.isArray(e))return!0;if(r.length<=0||e.length<=0)return!0;for(const o of r)if(e.indexOf(o)>=0)return!0;return!1},Wo=(e,r,o,a,t,n)=>{let i=[];for(let m=0;m<e.length;m++)if(c=Number(r),p=e[m].visibleToRoles,(!Array.isArray(p)||"number"!=typeof c||p.length<=0||p.indexOf(c)>=0)&&(l=a,d=e[m].visibleToCompanies,!Array.isArray(d)||!Boolean(l)||d.length<=0||d.indexOf(l)>=0)&&Lo(o,e[m].visibleToBranches)&&Uo(Number(r),e[m].invisibleToRoles)&&Fo(n,e[m].visibleToProducts)&&(s=e[m],Array.isArray(s.children)&&s.children.length>0||Boolean(s.href))){let{children:s,...l}=e[m];if(Array.isArray(s)&&s.length>0){let e=Wo(s,r,o,a,t,n);e.length>0&&i.push({...l,children:e})}else i.push({...l,secondaryLabel:l.system_code})}var s,l,d,c,p;return i},Vo=({authState:r,handleDrawerOpen:a,open:t,rootUrl:n,dashboardUrl:i="dashboard",navigate:s})=>{const[l,d]=m("/"),[c,p]=m({}),[g,u]=m([]),h=f((()=>{let e=r?.access?.entities?.Branch??[];return Array.isArray(e)&&e.length>=0?e.map((e=>e.branchCode)):[]}),[]),w=f((()=>{let e=r?.access?.products??[];return Array.isArray(e)&&e.length>=0?e.map((e=>e.categoryCode)):[]}),[]);let y={navItems:r.menulistdata},x=Ro(y,Number(r.role),h,r.companyID,r.access,w),b=Ro({config:{rel:"",target:"_blank"},navItems:To},Number(r.role),h,r.companyID,r.access,w);return"report"===l?e(Ao,{metaData:b,handleDrawerOpen:a,drawerOpen:t,setView:d,label:"Reports",icon:"table",rootUrl:n,dashboardUrl:i,navigate:s}):"newfilterview"===l?e(Ao,{metaData:{config:{rel:"",target:"_blank"},navItems:g},handleDrawerOpen:a,drawerOpen:t,setView:d,label:c?.label??"Reports",icon:"table",placeholder:c?.placeholder,rootUrl:n,dashboardUrl:i,navigate:s}):e(o,{children:e(ko,{metaData:x,handleDrawerOpen:a,drawerOpen:t,setView:d,slimSize:!0,setNewFilterData:u,setNewFilterView:p,rootUrl:n,dashboardUrl:i,navigate:s})})},zo=o=>{const a=Po();return r(q,{variant:"permanent",classes:{paper:$(a.drawerPaper,!o.open&&a.drawerPaperClose)},open:o.open,children:[e("div",{className:a.toolbarIcon}),e(Vo,{...o})]})};export{Co as AppbarWrapper,po as AuthControllerWrapper,bo as BranchSelectionGridWrapper,ho as ForgotPasswordControllerWrapper,zo as SidebarWrapper};
3235
2
  //# sourceMappingURL=index.js.map