@djb25/digit-ui-module-ekyc 1.0.12 → 1.0.14

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.
@@ -1,10 +1,11 @@
1
- import React, { useRef, useEffect, useMemo, useState, createContext, isValidElement, cloneElement, createElement, useContext, useCallback, useReducer, Fragment } from 'react';
1
+ import React, { useRef, useEffect, useMemo, useState, createContext, isValidElement, cloneElement, createElement, useContext, useCallback, useReducer, Fragment as Fragment$1 } from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
3
  import { useHistory, Link, useLocation, useRouteMatch, Switch, Route, Redirect } from 'react-router-dom';
4
4
  import { PersonIcon, EmployeeModuleCard, Loader, Card, InboxLinks, Table, HomeIcon, TextInput, Header, SubmitBar, DetailsCard, FilterForm, FilterFormField, Dropdown, Label, CustomTooltip, CardLabelError, InboxComposer, Toast, Modal, RadioButtons, CardHeader, CardSubHeader, StatusTable, Row, GenericFileIcon, CheckBox, ActionBar, LinkButton, EditIcon as EditIcon$1, FormStep, CardLabel, UploadFile, VerticalTimeline, AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, LayoutWrapper, ModuleLinksView, CitizenHomeCard, DocumentIcon } from '@djb25/digit-ui-react-components';
5
5
  import * as Chartjs from 'chart.js/auto';
6
6
  import Chartjs__default, { Chart } from 'chart.js/auto';
7
7
  import 'react-dom';
8
+ import { Chart as Chart$1, registerables } from 'chart.js';
8
9
 
9
10
  const EKYCCard = () => {
10
11
  const {
@@ -3748,7 +3749,7 @@ const AadhaarVerification = ({
3748
3749
  if (isLoading) {
3749
3750
  return /*#__PURE__*/React.createElement(Loader, null);
3750
3751
  }
3751
- return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(FormStep, {
3752
+ return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(FormStep, {
3752
3753
  onSelect: onStepSelect,
3753
3754
  config: config,
3754
3755
  isDisabled: !isValid()
@@ -3805,21 +3806,21 @@ const AadhaarVerification = ({
3805
3806
  label: "Yes, the informant is the consumer",
3806
3807
  checked: informantIsConsumer,
3807
3808
  onChange: e => setInformantIsConsumer(e.target.checked)
3808
- })), !informantIsConsumer && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Informant Name"), /*#__PURE__*/React.createElement(TextInput, {
3809
+ })), !informantIsConsumer && /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Informant Name"), /*#__PURE__*/React.createElement(TextInput, {
3809
3810
  value: informantName,
3810
3811
  onChange: e => setInformantName(e.target.value)
3811
3812
  })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Informant Relation"), /*#__PURE__*/React.createElement(TextInput, {
3812
3813
  value: informantRelation,
3813
3814
  onChange: e => setInformantRelation(e.target.value)
3814
- }))), (occupantType === null || occupantType === void 0 ? void 0 : occupantType.name) === "Tenanted" && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Document Proof"), /*#__PURE__*/React.createElement(UploadFile, {
3815
+ }))), (occupantType === null || occupantType === void 0 ? void 0 : occupantType.name) === "Tenanted" && /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Document Proof"), /*#__PURE__*/React.createElement(UploadFile, {
3815
3816
  onUpload: e => uploadFile(e, setDocumentProof, setDocumentId)
3816
- })), !documentId && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Owner Mobile *"), /*#__PURE__*/React.createElement(TextInput, {
3817
+ })), !documentId && /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Owner Mobile *"), /*#__PURE__*/React.createElement(TextInput, {
3817
3818
  value: ownerMobile,
3818
3819
  onChange: e => setOwnerMobile(e.target.value)
3819
3820
  })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Tenant Verification"), /*#__PURE__*/React.createElement(TextInput, {
3820
3821
  value: tenantVerification,
3821
3822
  onChange: e => setTenantVerification(e.target.value)
3822
- })))), (consumerType === null || consumerType === void 0 ? void 0 : consumerType.name) === "Govt" && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Designation"), /*#__PURE__*/React.createElement(TextInput, {
3823
+ })))), (consumerType === null || consumerType === void 0 ? void 0 : consumerType.name) === "Govt" && /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Designation"), /*#__PURE__*/React.createElement(TextInput, {
3823
3824
  value: designation,
3824
3825
  onChange: e => setDesignation(e.target.value)
3825
3826
  })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Department"), /*#__PURE__*/React.createElement(TextInput, {
@@ -3828,7 +3829,7 @@ const AadhaarVerification = ({
3828
3829
  })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Employee ID"), /*#__PURE__*/React.createElement(TextInput, {
3829
3830
  value: employeeId,
3830
3831
  onChange: e => setEmployeeId(e.target.value)
3831
- }))), (consumerType === null || consumerType === void 0 ? void 0 : consumerType.name) === "Company_Society_Org" && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Entity Name"), /*#__PURE__*/React.createElement(TextInput, {
3832
+ }))), (consumerType === null || consumerType === void 0 ? void 0 : consumerType.name) === "Company_Society_Org" && /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Entity Name"), /*#__PURE__*/React.createElement(TextInput, {
3832
3833
  value: entityName,
3833
3834
  onChange: e => setEntityName(e.target.value)
3834
3835
  })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Contact Person"), /*#__PURE__*/React.createElement(TextInput, {
@@ -4022,6 +4023,7 @@ const EmployeeApp = ({
4022
4023
  } = useTranslation();
4023
4024
  const location = useLocation();
4024
4025
  sessionStorage.removeItem("revalidateddone");
4026
+ const CeoDashboard = Digit.ComponentRegistryService.getComponent("CeoDashboard");
4025
4027
  const getBreadcrumbLabel = () => {
4026
4028
  const pathname = location.pathname;
4027
4029
  if (pathname.includes("/dashboard")) return "ES_COMMON_INBOX";
@@ -4095,6 +4097,11 @@ const EmployeeApp = ({
4095
4097
  component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
4096
4098
  layoutClass: "normal"
4097
4099
  }, /*#__PURE__*/React.createElement(Review, null))
4100
+ }), /*#__PURE__*/React.createElement(PrivateRoute, {
4101
+ path: `${path}/ceo-dashboard`,
4102
+ component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
4103
+ layoutClass: "normal"
4104
+ }, /*#__PURE__*/React.createElement(CeoDashboard, null))
4098
4105
  }))))));
4099
4106
  };
4100
4107
 
@@ -4254,7 +4261,7 @@ const PropertyInfo = ({
4254
4261
  if (isLoading) {
4255
4262
  return /*#__PURE__*/React.createElement(Loader, null);
4256
4263
  }
4257
- return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(FormStep, {
4264
+ return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(FormStep, {
4258
4265
  t: t,
4259
4266
  onSelect: onStepSelect,
4260
4267
  config: config,
@@ -4573,7 +4580,7 @@ const MeterDetails = ({
4573
4580
  if (isLoading) {
4574
4581
  return /*#__PURE__*/React.createElement(Loader, null);
4575
4582
  }
4576
- return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(FormStep, {
4583
+ return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(FormStep, {
4577
4584
  onSelect: onStepSelect,
4578
4585
  config: config,
4579
4586
  isDisabled: !isValid()
@@ -4595,7 +4602,7 @@ const MeterDetails = ({
4595
4602
  })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "MR Key"), /*#__PURE__*/React.createElement(TextInput, {
4596
4603
  value: mrKey,
4597
4604
  onChange: e => setMrKey(e.target.value)
4598
- })), !isFrozen && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Meter Number"), /*#__PURE__*/React.createElement(TextInput, {
4605
+ })), !isFrozen && /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Meter Number"), /*#__PURE__*/React.createElement(TextInput, {
4599
4606
  value: meterNumber,
4600
4607
  onChange: e => setMeterNumber(e.target.value)
4601
4608
  })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Meter Maker"), /*#__PURE__*/React.createElement(TextInput, {
@@ -4605,7 +4612,7 @@ const MeterDetails = ({
4605
4612
  option: meterConditionOptions,
4606
4613
  selected: meterCondition,
4607
4614
  select: setMeterCondition
4608
- })), (meterStatus === null || meterStatus === void 0 ? void 0 : meterStatus.name) === "Metered" && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Meter Photo *"), /*#__PURE__*/React.createElement(UploadFile, {
4615
+ })), (meterStatus === null || meterStatus === void 0 ? void 0 : meterStatus.name) === "Metered" && /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Meter Photo *"), /*#__PURE__*/React.createElement(UploadFile, {
4609
4616
  onUpload: uploadPhoto,
4610
4617
  message: meterPhotoId ? "Uploaded" : "No file"
4611
4618
  })), meterPhoto && /*#__PURE__*/React.createElement("div", {
@@ -5072,7 +5079,7 @@ const AddressDetails = ({
5072
5079
  onSelect(config.key, data);
5073
5080
  };
5074
5081
  if (isLoading) return /*#__PURE__*/React.createElement(Loader, null);
5075
- return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(FormStep, {
5082
+ return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(FormStep, {
5076
5083
  t: t,
5077
5084
  onSelect: onStepSelect,
5078
5085
  config: config,
@@ -5220,6 +5227,1453 @@ const CitizenApp = () => {
5220
5227
  }))));
5221
5228
  };
5222
5229
 
5230
+ const DashboardLayout = ({
5231
+ header,
5232
+ filters,
5233
+ children,
5234
+ onNotificationClick,
5235
+ activeRole,
5236
+ onRoleChange
5237
+ }) => {
5238
+ const {
5239
+ t
5240
+ } = useTranslation();
5241
+ const roles = ["CEO", "CLUSTER_MANAGER", "AGENCY_SUPERVISOR"];
5242
+ return /*#__PURE__*/React.createElement("div", {
5243
+ className: "enterprise-dashboard-layout",
5244
+ style: {
5245
+ background: "linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%)",
5246
+ minHeight: "100vh"
5247
+ }
5248
+ }, /*#__PURE__*/React.createElement("div", {
5249
+ className: "glass-card",
5250
+ style: {
5251
+ padding: "24px 32px",
5252
+ display: "flex",
5253
+ justifyContent: "space-between",
5254
+ alignItems: "center",
5255
+ borderRadius: "0",
5256
+ borderTop: "none",
5257
+ borderLeft: "none",
5258
+ borderRight: "none"
5259
+ }
5260
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h1", {
5261
+ style: {
5262
+ fontSize: "28px",
5263
+ fontWeight: "900",
5264
+ color: "#1E293B",
5265
+ letterSpacing: "-0.05em"
5266
+ }
5267
+ }, t(header)), /*#__PURE__*/React.createElement("p", {
5268
+ style: {
5269
+ fontSize: "14px",
5270
+ color: "#64748B",
5271
+ marginTop: "4px",
5272
+ fontWeight: "500"
5273
+ }
5274
+ }, t("EKYC_DASHBOARD_SUBTITLE_ALT") || "Operational analytics & performance monitoring.")), /*#__PURE__*/React.createElement("div", {
5275
+ style: {
5276
+ display: "flex",
5277
+ alignItems: "center",
5278
+ gap: "20px"
5279
+ }
5280
+ }, /*#__PURE__*/React.createElement("div", {
5281
+ style: {
5282
+ display: "flex",
5283
+ background: "#F3F4F6",
5284
+ padding: "4px",
5285
+ borderRadius: "8px",
5286
+ gap: "4px"
5287
+ }
5288
+ }, roles.map(role => /*#__PURE__*/React.createElement("button", {
5289
+ key: role,
5290
+ onClick: () => onRoleChange(role),
5291
+ style: {
5292
+ padding: "6px 12px",
5293
+ borderRadius: "6px",
5294
+ fontSize: "12px",
5295
+ fontWeight: "700",
5296
+ border: "none",
5297
+ cursor: "pointer",
5298
+ background: activeRole === role ? "var(--primary-gradient)" : "transparent",
5299
+ color: activeRole === role ? "#FFFFFF" : "#64748B",
5300
+ boxShadow: activeRole === role ? "0 4px 12px rgba(99, 102, 241, 0.3)" : "none",
5301
+ transition: "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"
5302
+ }
5303
+ }, t(role)))), /*#__PURE__*/React.createElement("button", {
5304
+ onClick: onNotificationClick,
5305
+ style: {
5306
+ position: "relative",
5307
+ background: "#F3F4F6",
5308
+ border: "none",
5309
+ padding: "10px",
5310
+ borderRadius: "50%",
5311
+ cursor: "pointer"
5312
+ }
5313
+ }, /*#__PURE__*/React.createElement("span", {
5314
+ style: {
5315
+ fontSize: "20px"
5316
+ }
5317
+ }, "\uD83D\uDD14"), /*#__PURE__*/React.createElement("span", {
5318
+ style: {
5319
+ position: "absolute",
5320
+ top: "0",
5321
+ right: "0",
5322
+ width: "10px",
5323
+ height: "10px",
5324
+ background: "#EF4444",
5325
+ borderRadius: "50%",
5326
+ border: "2px solid #FFF"
5327
+ }
5328
+ })))), filters, /*#__PURE__*/React.createElement("div", {
5329
+ style: {
5330
+ padding: "24px",
5331
+ maxWidth: "1600px",
5332
+ margin: "0 auto"
5333
+ }
5334
+ }, children), /*#__PURE__*/React.createElement("div", {
5335
+ style: {
5336
+ padding: "40px 24px",
5337
+ textAlign: "center",
5338
+ color: "#9CA3AF",
5339
+ fontSize: "12px"
5340
+ }
5341
+ }, t("EKYC_POWERED_BY_UPYOG"), " | ", new Date().getFullYear(), " \xA9 ", t("EKYC_GOVT_DJB")));
5342
+ };
5343
+
5344
+ const FilterBar = ({
5345
+ filters,
5346
+ config,
5347
+ onFilterChange,
5348
+ onReset
5349
+ }) => {
5350
+ const {
5351
+ t
5352
+ } = useTranslation();
5353
+ return /*#__PURE__*/React.createElement("div", {
5354
+ className: "dashboard-filter-bar glass-card",
5355
+ style: {
5356
+ position: "sticky",
5357
+ top: "0",
5358
+ zIndex: "100",
5359
+ padding: "20px 28px",
5360
+ display: "flex",
5361
+ alignItems: "center",
5362
+ gap: "24px",
5363
+ flexWrap: "wrap",
5364
+ borderRadius: "0 0 24px 24px",
5365
+ marginTop: "-1px"
5366
+ }
5367
+ }, /*#__PURE__*/React.createElement("div", {
5368
+ style: {
5369
+ display: "flex",
5370
+ alignItems: "center",
5371
+ gap: "8px",
5372
+ borderRight: "1px solid #E5E7EB",
5373
+ paddingRight: "16px"
5374
+ }
5375
+ }, /*#__PURE__*/React.createElement("span", {
5376
+ style: {
5377
+ fontSize: "14px",
5378
+ fontWeight: "700",
5379
+ color: "#374151"
5380
+ }
5381
+ }, t("EKYC_GLOBAL_FILTERS"))), /*#__PURE__*/React.createElement("div", {
5382
+ style: {
5383
+ display: "flex",
5384
+ gap: "12px",
5385
+ flex: 1,
5386
+ flexWrap: "wrap"
5387
+ }
5388
+ }, config.map(filter => /*#__PURE__*/React.createElement("div", {
5389
+ key: filter.id,
5390
+ style: {
5391
+ display: "flex",
5392
+ flexDirection: "column",
5393
+ gap: "4px"
5394
+ }
5395
+ }, /*#__PURE__*/React.createElement("label", {
5396
+ style: {
5397
+ fontSize: "11px",
5398
+ fontWeight: "600",
5399
+ color: "#6B7280",
5400
+ textTransform: "uppercase"
5401
+ }
5402
+ }, t(filter.label)), /*#__PURE__*/React.createElement("select", {
5403
+ value: filters[filter.id] || filter.default,
5404
+ onChange: e => onFilterChange(filter.id, e.target.value),
5405
+ style: {
5406
+ padding: "6px 12px",
5407
+ borderRadius: "6px",
5408
+ border: "1px solid #D1D5DB",
5409
+ background: "#F9FAFB",
5410
+ fontSize: "13px",
5411
+ outline: "none",
5412
+ minWidth: "140px"
5413
+ }
5414
+ }, filter.options.map(opt => /*#__PURE__*/React.createElement("option", {
5415
+ key: opt,
5416
+ value: opt
5417
+ }, opt)))))), /*#__PURE__*/React.createElement("div", {
5418
+ style: {
5419
+ display: "flex",
5420
+ gap: "12px"
5421
+ }
5422
+ }, /*#__PURE__*/React.createElement("button", {
5423
+ onClick: onReset,
5424
+ style: {
5425
+ padding: "8px 16px",
5426
+ borderRadius: "8px",
5427
+ background: "transparent",
5428
+ color: "#6B7280",
5429
+ border: "1px solid #D1D5DB",
5430
+ cursor: "pointer",
5431
+ fontSize: "14px",
5432
+ fontWeight: "600"
5433
+ }
5434
+ }, t("EKYC_RESET"))));
5435
+ };
5436
+
5437
+ const SummaryCard = ({
5438
+ label,
5439
+ value,
5440
+ color,
5441
+ icon,
5442
+ trend,
5443
+ isCurrency,
5444
+ suffix: _suffix = "",
5445
+ onClick
5446
+ }) => {
5447
+ const {
5448
+ t
5449
+ } = useTranslation();
5450
+ const formatValue = val => {
5451
+ if (isCurrency) {
5452
+ return `₹${new Intl.NumberFormat('en-IN').format(val)}`;
5453
+ }
5454
+ return new Intl.NumberFormat('en-IN').format(val);
5455
+ };
5456
+ return /*#__PURE__*/React.createElement("div", {
5457
+ className: "summary-card glass-card",
5458
+ onClick: onClick,
5459
+ style: {
5460
+ padding: "28px 24px",
5461
+ cursor: onClick ? "pointer" : "default",
5462
+ display: "flex",
5463
+ flexDirection: "column",
5464
+ justifyContent: "space-between",
5465
+ height: "100%",
5466
+ minHeight: "160px",
5467
+ position: "relative",
5468
+ overflow: "hidden"
5469
+ },
5470
+ onMouseOver: e => {
5471
+ if (onClick) {
5472
+ e.currentTarget.style.transform = "translateY(-8px) scale(1.02)";
5473
+ }
5474
+ },
5475
+ onMouseOut: e => {
5476
+ if (onClick) {
5477
+ e.currentTarget.style.transform = "translateY(0) scale(1)";
5478
+ }
5479
+ }
5480
+ }, /*#__PURE__*/React.createElement("div", {
5481
+ style: {
5482
+ display: "flex",
5483
+ justifyContent: "space-between",
5484
+ alignItems: "flex-start"
5485
+ }
5486
+ }, /*#__PURE__*/React.createElement("span", {
5487
+ style: {
5488
+ fontSize: "13px",
5489
+ fontWeight: "700",
5490
+ color: "#6B7280",
5491
+ letterSpacing: "0.05em",
5492
+ textTransform: "uppercase"
5493
+ }
5494
+ }, t(label)), /*#__PURE__*/React.createElement("div", {
5495
+ style: {
5496
+ padding: "10px",
5497
+ borderRadius: "12px",
5498
+ background: `linear-gradient(135deg, ${color}20 0%, ${color}40 100%)`,
5499
+ color: color,
5500
+ boxShadow: `0 4px 12px ${color}20`
5501
+ }
5502
+ }, /*#__PURE__*/React.createElement("span", {
5503
+ style: {
5504
+ fontSize: "20px"
5505
+ }
5506
+ }, icon === "document" ? "📄" : icon === "check" ? "✅" : icon === "clock" ? "⏳" : icon === "rupee" ? "₹" : "📊"))), /*#__PURE__*/React.createElement("div", {
5507
+ style: {
5508
+ marginTop: "12px"
5509
+ }
5510
+ }, /*#__PURE__*/React.createElement("div", {
5511
+ style: {
5512
+ fontSize: "28px",
5513
+ fontWeight: "800",
5514
+ color: "#111827"
5515
+ }
5516
+ }, formatValue(value), _suffix), trend && /*#__PURE__*/React.createElement("div", {
5517
+ style: {
5518
+ display: "flex",
5519
+ alignItems: "center",
5520
+ marginTop: "8px",
5521
+ fontSize: "12px",
5522
+ fontWeight: "600"
5523
+ }
5524
+ }, /*#__PURE__*/React.createElement("span", {
5525
+ style: {
5526
+ color: trend > 0 ? "#10B981" : "#EF4444"
5527
+ }
5528
+ }, trend > 0 ? "↗" : "↘", " ", Math.abs(trend), "%"), /*#__PURE__*/React.createElement("span", {
5529
+ style: {
5530
+ color: "#9CA3AF",
5531
+ marginLeft: "4px"
5532
+ }
5533
+ }, t("EKYC_FROM_PREV_MONTH")))));
5534
+ };
5535
+
5536
+ Chart$1.register(...registerables);
5537
+ const TaskStatusChart = ({
5538
+ data,
5539
+ title
5540
+ }) => {
5541
+ const {
5542
+ t
5543
+ } = useTranslation();
5544
+ const chartRef = useRef(null);
5545
+ const chartInstance = useRef(null);
5546
+ useEffect(() => {
5547
+ if (chartRef.current && data) {
5548
+ if (chartInstance.current) chartInstance.current.destroy();
5549
+ const ctx = chartRef.current.getContext("2d");
5550
+ const gradientBlue = ctx.createLinearGradient(0, 0, 0, 400);
5551
+ gradientBlue.addColorStop(0, '#3B82F6');
5552
+ gradientBlue.addColorStop(1, '#2563EB');
5553
+ const gradientAmber = ctx.createLinearGradient(0, 0, 0, 400);
5554
+ gradientAmber.addColorStop(0, '#F59E0B');
5555
+ gradientAmber.addColorStop(1, '#D97706');
5556
+ const gradientIndigo = ctx.createLinearGradient(0, 0, 0, 400);
5557
+ gradientIndigo.addColorStop(0, '#6366F1');
5558
+ gradientIndigo.addColorStop(1, '#4F46E5');
5559
+ const gradientEmerald = ctx.createLinearGradient(0, 0, 0, 400);
5560
+ gradientEmerald.addColorStop(0, '#10B981');
5561
+ gradientEmerald.addColorStop(1, '#059669');
5562
+ const colors = [gradientBlue, gradientAmber, gradientIndigo, gradientEmerald, '#EC4899', '#EF4444'];
5563
+ const labels = data.map(item => t(item.stageName));
5564
+ const values = data.map(item => item.count);
5565
+ const ChartConstructor = Chart$1.Chart || Chart$1;
5566
+ chartInstance.current = new ChartConstructor(ctx, {
5567
+ type: "doughnut",
5568
+ data: {
5569
+ labels,
5570
+ datasets: [{
5571
+ data: values,
5572
+ backgroundColor: colors.slice(0, labels.length),
5573
+ borderWidth: 2,
5574
+ borderColor: "#ffffff",
5575
+ hoverOffset: 10
5576
+ }]
5577
+ },
5578
+ options: {
5579
+ responsive: true,
5580
+ maintainAspectRatio: false,
5581
+ cutout: '70%',
5582
+ plugins: {
5583
+ legend: {
5584
+ position: 'right',
5585
+ labels: {
5586
+ usePointStyle: true,
5587
+ padding: 15,
5588
+ font: {
5589
+ size: 12
5590
+ }
5591
+ }
5592
+ },
5593
+ tooltip: {
5594
+ backgroundColor: '#1F2937',
5595
+ padding: 10,
5596
+ bodyFont: {
5597
+ size: 13
5598
+ }
5599
+ }
5600
+ }
5601
+ }
5602
+ });
5603
+ }
5604
+ return () => {
5605
+ if (chartInstance.current) chartInstance.current.destroy();
5606
+ };
5607
+ }, [data, t]);
5608
+ return /*#__PURE__*/React.createElement("div", {
5609
+ className: "task-status-chart-container glass-card",
5610
+ style: {
5611
+ height: "320px",
5612
+ width: "100%",
5613
+ padding: "24px"
5614
+ }
5615
+ }, title && /*#__PURE__*/React.createElement("h3", {
5616
+ className: "chart-title",
5617
+ style: {
5618
+ marginBottom: "24px",
5619
+ fontSize: "18px",
5620
+ fontWeight: "700",
5621
+ color: "#111827"
5622
+ }
5623
+ }, t(title)), /*#__PURE__*/React.createElement("div", {
5624
+ style: {
5625
+ height: "220px"
5626
+ }
5627
+ }, /*#__PURE__*/React.createElement("canvas", {
5628
+ ref: chartRef
5629
+ })));
5630
+ };
5631
+
5632
+ const ClusterHeatmap = ({
5633
+ data,
5634
+ title,
5635
+ onDrillDown
5636
+ }) => {
5637
+ const {
5638
+ t
5639
+ } = useTranslation();
5640
+ if (!data || data.length === 0) return null;
5641
+ const getIntensityColor = score => {
5642
+ if (score > 80) return "#EF4444";
5643
+ if (score > 50) return "#F59E0B";
5644
+ return "#10B981";
5645
+ };
5646
+ return /*#__PURE__*/React.createElement("div", {
5647
+ className: "cluster-heatmap-container glass-card",
5648
+ style: {
5649
+ padding: "28px"
5650
+ }
5651
+ }, title && /*#__PURE__*/React.createElement("h3", {
5652
+ className: "chart-title",
5653
+ style: {
5654
+ marginBottom: "28px",
5655
+ fontSize: "18px",
5656
+ fontWeight: "800",
5657
+ color: "#111827",
5658
+ letterSpacing: "-0.025em"
5659
+ }
5660
+ }, t(title)), /*#__PURE__*/React.createElement("div", {
5661
+ className: "heatmap-grid",
5662
+ style: {
5663
+ display: "grid",
5664
+ gridTemplateColumns: "repeat(auto-fill, minmax(240px, 1fr))",
5665
+ gap: "20px"
5666
+ }
5667
+ }, data.map(cluster => /*#__PURE__*/React.createElement("div", {
5668
+ key: cluster.clusterId,
5669
+ className: "heatmap-card glass-card",
5670
+ onClick: () => onDrillDown === null || onDrillDown === void 0 ? void 0 : onDrillDown(cluster),
5671
+ style: {
5672
+ padding: "20px",
5673
+ background: "#FFFFFF",
5674
+ border: `1px solid ${getIntensityColor(cluster.intensityScore)}40`,
5675
+ cursor: "pointer",
5676
+ position: "relative",
5677
+ overflow: "hidden"
5678
+ }
5679
+ }, /*#__PURE__*/React.createElement("div", {
5680
+ className: "intensity-bar",
5681
+ style: {
5682
+ position: "absolute",
5683
+ top: 0,
5684
+ left: 0,
5685
+ height: "4px",
5686
+ width: "100%",
5687
+ background: getIntensityColor(cluster.intensityScore)
5688
+ }
5689
+ }), /*#__PURE__*/React.createElement("div", {
5690
+ style: {
5691
+ display: "flex",
5692
+ justifyContent: "space-between",
5693
+ alignItems: "flex-start",
5694
+ marginBottom: "12px"
5695
+ }
5696
+ }, /*#__PURE__*/React.createElement("span", {
5697
+ style: {
5698
+ fontWeight: "600",
5699
+ fontSize: "14px",
5700
+ color: "#374151"
5701
+ }
5702
+ }, cluster.clusterName), /*#__PURE__*/React.createElement("span", {
5703
+ style: {
5704
+ fontSize: "12px",
5705
+ fontWeight: "700",
5706
+ padding: "2px 8px",
5707
+ borderRadius: "12px",
5708
+ background: `${getIntensityColor(cluster.intensityScore)}20`,
5709
+ color: getIntensityColor(cluster.intensityScore)
5710
+ }
5711
+ }, cluster.intensityScore, "%")), /*#__PURE__*/React.createElement("div", {
5712
+ className: "cluster-stats",
5713
+ style: {
5714
+ display: "flex",
5715
+ flexDirection: "column",
5716
+ gap: "8px"
5717
+ }
5718
+ }, /*#__PURE__*/React.createElement("div", {
5719
+ style: {
5720
+ display: "flex",
5721
+ justifyContent: "space-between",
5722
+ fontSize: "12px"
5723
+ }
5724
+ }, /*#__PURE__*/React.createElement("span", {
5725
+ style: {
5726
+ color: "#6B7280"
5727
+ }
5728
+ }, t("EKYC_PENDING_WORKLOAD")), /*#__PURE__*/React.createElement("span", {
5729
+ style: {
5730
+ fontWeight: "600",
5731
+ color: "#1F2937"
5732
+ }
5733
+ }, cluster.pendingWorkload)), /*#__PURE__*/React.createElement("div", {
5734
+ style: {
5735
+ display: "flex",
5736
+ justifyContent: "space-between",
5737
+ fontSize: "12px"
5738
+ }
5739
+ }, /*#__PURE__*/React.createElement("span", {
5740
+ style: {
5741
+ color: "#6B7280"
5742
+ }
5743
+ }, t("EKYC_ACTIVE_AGENCIES")), /*#__PURE__*/React.createElement("span", {
5744
+ style: {
5745
+ fontWeight: "600",
5746
+ color: "#1F2937"
5747
+ }
5748
+ }, cluster.activeAgencies))), /*#__PURE__*/React.createElement("div", {
5749
+ className: "mini-spark",
5750
+ style: {
5751
+ marginTop: "12px",
5752
+ display: "flex",
5753
+ gap: "2px",
5754
+ alignItems: "flex-end",
5755
+ height: "20px"
5756
+ }
5757
+ }, cluster.wards.map((ward, idx) => /*#__PURE__*/React.createElement("div", {
5758
+ key: idx,
5759
+ style: {
5760
+ flex: 1,
5761
+ height: `${Math.min(100, ward.pendingCount / cluster.pendingWorkload * 100)}%`,
5762
+ background: getIntensityColor(cluster.intensityScore),
5763
+ opacity: 0.6,
5764
+ borderRadius: "1px"
5765
+ }
5766
+ })))))));
5767
+ };
5768
+
5769
+ const ExportUtils = {
5770
+ exportToCsv: (data, filename = "dashboard_export.csv", columns = []) => {
5771
+ if (!data || !data.length) return;
5772
+ const keys = columns.length ? columns.map(c => c.id) : Object.keys(data[0]);
5773
+ const headers = columns.length ? columns.map(c => c.label) : keys;
5774
+ const csvRows = [];
5775
+ csvRows.push(headers.map(h => `"${String(h).replace(/"/g, '""')}"`).join(","));
5776
+ data.forEach(row => {
5777
+ const values = keys.map(k => {
5778
+ const val = row[k] !== undefined && row[k] !== null ? row[k] : "";
5779
+ return `"${String(val).replace(/"/g, '""')}"`;
5780
+ });
5781
+ csvRows.push(values.join(","));
5782
+ });
5783
+ const csvString = csvRows.join("\n");
5784
+ const blob = new Blob([csvString], {
5785
+ type: "text/csv;charset=utf-8;"
5786
+ });
5787
+ const link = document.createElement("a");
5788
+ if (link.download !== undefined) {
5789
+ const url = URL.createObjectURL(blob);
5790
+ link.setAttribute("href", url);
5791
+ link.setAttribute("download", filename);
5792
+ link.style.visibility = "hidden";
5793
+ document.body.appendChild(link);
5794
+ link.click();
5795
+ document.body.removeChild(link);
5796
+ }
5797
+ },
5798
+ exportToExcel: (data, filename = "dashboard_report.xlsx", columns = []) => {
5799
+ ExportUtils.exportToCsv(data, filename.replace(".xlsx", ".csv"), columns);
5800
+ },
5801
+ printDashboard: () => {
5802
+ if (typeof window !== "undefined") {
5803
+ window.print();
5804
+ }
5805
+ }
5806
+ };
5807
+
5808
+ const AnalyticsTable = ({
5809
+ data,
5810
+ columns,
5811
+ title,
5812
+ filename
5813
+ }) => {
5814
+ const {
5815
+ t
5816
+ } = useTranslation();
5817
+ const [searchTerm, setSearchTerm] = useState("");
5818
+ const [sortConfig, setSortConfig] = useState({
5819
+ key: null,
5820
+ direction: 'asc'
5821
+ });
5822
+ const sortedData = useMemo(() => {
5823
+ let items = [...(data || [])];
5824
+ if (searchTerm) {
5825
+ items = items.filter(item => Object.values(item).some(val => String(val).toLowerCase().includes(searchTerm.toLowerCase())));
5826
+ }
5827
+ if (sortConfig.key) {
5828
+ items.sort((a, b) => {
5829
+ if (a[sortConfig.key] < b[sortConfig.key]) {
5830
+ return sortConfig.direction === 'asc' ? -1 : 1;
5831
+ }
5832
+ if (a[sortConfig.key] > b[sortConfig.key]) {
5833
+ return sortConfig.direction === 'asc' ? 1 : -1;
5834
+ }
5835
+ return 0;
5836
+ });
5837
+ }
5838
+ return items;
5839
+ }, [data, searchTerm, sortConfig]);
5840
+ const requestSort = key => {
5841
+ let direction = 'asc';
5842
+ if (sortConfig.key === key && sortConfig.direction === 'asc') {
5843
+ direction = 'desc';
5844
+ }
5845
+ setSortConfig({
5846
+ key,
5847
+ direction
5848
+ });
5849
+ };
5850
+ return /*#__PURE__*/React.createElement("div", {
5851
+ className: "analytics-table-card glass-card",
5852
+ style: {
5853
+ padding: "0",
5854
+ overflow: "hidden"
5855
+ }
5856
+ }, /*#__PURE__*/React.createElement("div", {
5857
+ className: "table-header",
5858
+ style: {
5859
+ padding: "28px",
5860
+ borderBottom: "1px solid rgba(229, 231, 235, 0.5)",
5861
+ display: "flex",
5862
+ justifyContent: "space-between",
5863
+ alignItems: "center",
5864
+ flexWrap: "wrap",
5865
+ gap: "16px"
5866
+ }
5867
+ }, /*#__PURE__*/React.createElement("h3", {
5868
+ style: {
5869
+ fontSize: "18px",
5870
+ fontWeight: "800",
5871
+ color: "#111827",
5872
+ letterSpacing: "-0.025em"
5873
+ }
5874
+ }, t(title)), /*#__PURE__*/React.createElement("div", {
5875
+ style: {
5876
+ display: "flex",
5877
+ gap: "12px",
5878
+ alignItems: "center"
5879
+ }
5880
+ }, /*#__PURE__*/React.createElement("input", {
5881
+ type: "text",
5882
+ placeholder: t("EKYC_SEARCH_RECORDS"),
5883
+ value: searchTerm,
5884
+ onChange: e => setSearchTerm(e.target.value),
5885
+ style: {
5886
+ padding: "8px 16px",
5887
+ borderRadius: "8px",
5888
+ border: "1px solid #D1D5DB",
5889
+ outline: "none",
5890
+ fontSize: "14px"
5891
+ }
5892
+ }), /*#__PURE__*/React.createElement("button", {
5893
+ onClick: () => ExportUtils.exportToCsv(sortedData, filename, columns),
5894
+ style: {
5895
+ padding: "10px 20px",
5896
+ borderRadius: "12px",
5897
+ background: "var(--primary-gradient)",
5898
+ color: "#FFF",
5899
+ border: "none",
5900
+ cursor: "pointer",
5901
+ fontWeight: "700",
5902
+ fontSize: "14px",
5903
+ boxShadow: "0 4px 6px rgba(99, 102, 241, 0.2)"
5904
+ }
5905
+ }, t("EKYC_EXPORT_CSV")))), /*#__PURE__*/React.createElement("div", {
5906
+ className: "table-body",
5907
+ style: {
5908
+ overflowX: "auto"
5909
+ }
5910
+ }, /*#__PURE__*/React.createElement("table", {
5911
+ style: {
5912
+ width: "100%",
5913
+ borderCollapse: "collapse",
5914
+ textAlign: "left"
5915
+ }
5916
+ }, /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("tr", {
5917
+ style: {
5918
+ background: "#F9FAFB"
5919
+ }
5920
+ }, columns.map(col => /*#__PURE__*/React.createElement("th", {
5921
+ key: col.id,
5922
+ onClick: () => requestSort(col.id),
5923
+ style: {
5924
+ padding: "16px 28px",
5925
+ fontSize: "11px",
5926
+ fontWeight: "700",
5927
+ color: "#6B7280",
5928
+ textTransform: "uppercase",
5929
+ cursor: "pointer",
5930
+ borderBottom: "1px solid rgba(229, 231, 235, 0.5)",
5931
+ letterSpacing: "0.05em"
5932
+ }
5933
+ }, /*#__PURE__*/React.createElement("div", {
5934
+ style: {
5935
+ display: "flex",
5936
+ alignItems: "center",
5937
+ gap: "4px"
5938
+ }
5939
+ }, t(col.label), sortConfig.key === col.id && /*#__PURE__*/React.createElement("span", null, sortConfig.direction === 'asc' ? '↑' : '↓')))))), /*#__PURE__*/React.createElement("tbody", null, sortedData.map((row, idx) => /*#__PURE__*/React.createElement("tr", {
5940
+ key: idx,
5941
+ style: {
5942
+ borderBottom: "1px solid #F3F4F6",
5943
+ transition: "background 0.2s"
5944
+ },
5945
+ onMouseOver: e => e.currentTarget.style.background = "#F9FAFB",
5946
+ onMouseOut: e => e.currentTarget.style.background = "transparent"
5947
+ }, columns.map(col => /*#__PURE__*/React.createElement("td", {
5948
+ key: col.id,
5949
+ style: {
5950
+ padding: "16px 28px",
5951
+ fontSize: "14px",
5952
+ color: "#4B5563",
5953
+ fontWeight: col.id === "agencyName" ? "600" : "400"
5954
+ }
5955
+ }, col.isCurrency ? `₹${new Intl.NumberFormat('en-IN').format(row[col.id])}` : col.isPercentage ? `${row[col.id]}%` : row[col.id]))))))));
5956
+ };
5957
+
5958
+ const SLAWidget = ({
5959
+ slaPercentage,
5960
+ avgTime,
5961
+ breachedCount
5962
+ }) => {
5963
+ const {
5964
+ t
5965
+ } = useTranslation();
5966
+ const getStatusColor = pct => {
5967
+ if (pct > 90) return "#10B981";
5968
+ if (pct > 75) return "#F59E0B";
5969
+ return "#EF4444";
5970
+ };
5971
+ return /*#__PURE__*/React.createElement("div", {
5972
+ className: "sla-widget-card glass-card",
5973
+ style: {
5974
+ padding: "28px"
5975
+ }
5976
+ }, /*#__PURE__*/React.createElement("h3", {
5977
+ style: {
5978
+ fontSize: "18px",
5979
+ fontWeight: "800",
5980
+ color: "#111827",
5981
+ marginBottom: "28px",
5982
+ letterSpacing: "-0.025em"
5983
+ }
5984
+ }, t("EKYC_SLA_PERFORMANCE")), /*#__PURE__*/React.createElement("div", {
5985
+ style: {
5986
+ display: "flex",
5987
+ alignItems: "center",
5988
+ gap: "24px",
5989
+ marginBottom: "24px"
5990
+ }
5991
+ }, /*#__PURE__*/React.createElement("div", {
5992
+ style: {
5993
+ position: "relative",
5994
+ width: "100px",
5995
+ height: "100px",
5996
+ display: "flex",
5997
+ alignItems: "center",
5998
+ justifyContent: "center"
5999
+ }
6000
+ }, /*#__PURE__*/React.createElement("svg", {
6001
+ width: "100",
6002
+ height: "100",
6003
+ viewBox: "0 0 100 100"
6004
+ }, /*#__PURE__*/React.createElement("circle", {
6005
+ cx: "50",
6006
+ cy: "50",
6007
+ r: "40",
6008
+ stroke: "#F3F4F6",
6009
+ strokeWidth: "8",
6010
+ fill: "none"
6011
+ }), /*#__PURE__*/React.createElement("circle", {
6012
+ cx: "50",
6013
+ cy: "50",
6014
+ r: "40",
6015
+ stroke: getStatusColor(slaPercentage),
6016
+ strokeWidth: "8",
6017
+ fill: "none",
6018
+ strokeDasharray: `${slaPercentage * 2.51} 251`,
6019
+ transform: "rotate(-90 50 50)",
6020
+ strokeLinecap: "round"
6021
+ }), /*#__PURE__*/React.createElement("text", {
6022
+ x: "50",
6023
+ y: "55",
6024
+ textAnchor: "middle",
6025
+ fontSize: "18",
6026
+ fontWeight: "700",
6027
+ fill: "#111827"
6028
+ }, slaPercentage, "%"))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
6029
+ style: {
6030
+ fontSize: "14px",
6031
+ color: "#6B7280"
6032
+ }
6033
+ }, t("EKYC_SLA_COMPLIANCE")), /*#__PURE__*/React.createElement("div", {
6034
+ style: {
6035
+ fontSize: "20px",
6036
+ fontWeight: "700",
6037
+ color: "#111827"
6038
+ }
6039
+ }, t("EKYC_OPTIMAL_PERFORMANCE")))), /*#__PURE__*/React.createElement("div", {
6040
+ style: {
6041
+ display: "grid",
6042
+ gridTemplateColumns: "1fr 1fr",
6043
+ gap: "16px",
6044
+ borderTop: "1px solid #F3F4F6",
6045
+ paddingTop: "20px"
6046
+ }
6047
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
6048
+ style: {
6049
+ fontSize: "12px",
6050
+ color: "#6B7280",
6051
+ marginBottom: "4px"
6052
+ }
6053
+ }, t("EKYC_AVG_LATENCY")), /*#__PURE__*/React.createElement("div", {
6054
+ style: {
6055
+ fontSize: "18px",
6056
+ fontWeight: "700",
6057
+ color: "#111827"
6058
+ }
6059
+ }, avgTime, "h")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
6060
+ style: {
6061
+ fontSize: "12px",
6062
+ color: "#6B7280",
6063
+ marginBottom: "4px"
6064
+ }
6065
+ }, t("EKYC_BREACH_COUNT")), /*#__PURE__*/React.createElement("div", {
6066
+ style: {
6067
+ fontSize: "18px",
6068
+ fontWeight: "700",
6069
+ color: "#EF4444"
6070
+ }
6071
+ }, breachedCount))));
6072
+ };
6073
+
6074
+ const WorkflowTimeline = ({
6075
+ stages
6076
+ }) => {
6077
+ const {
6078
+ t
6079
+ } = useTranslation();
6080
+ if (!stages || stages.length === 0) return null;
6081
+ return /*#__PURE__*/React.createElement("div", {
6082
+ className: "workflow-timeline-card glass-card",
6083
+ style: {
6084
+ padding: "28px"
6085
+ }
6086
+ }, /*#__PURE__*/React.createElement("h3", {
6087
+ style: {
6088
+ fontSize: "18px",
6089
+ fontWeight: "800",
6090
+ color: "#111827",
6091
+ marginBottom: "28px",
6092
+ letterSpacing: "-0.025em"
6093
+ }
6094
+ }, t("EKYC_WORKFLOW_BOTTLENECK_ANALYSIS")), /*#__PURE__*/React.createElement("div", {
6095
+ className: "timeline-container",
6096
+ style: {
6097
+ display: "flex",
6098
+ flexDirection: "column",
6099
+ gap: "16px"
6100
+ }
6101
+ }, stages.map((stage, idx) => /*#__PURE__*/React.createElement("div", {
6102
+ key: idx,
6103
+ style: {
6104
+ display: "flex",
6105
+ gap: "16px",
6106
+ alignItems: "flex-start"
6107
+ }
6108
+ }, /*#__PURE__*/React.createElement("div", {
6109
+ style: {
6110
+ display: "flex",
6111
+ flexDirection: "column",
6112
+ alignItems: "center"
6113
+ }
6114
+ }, /*#__PURE__*/React.createElement("div", {
6115
+ style: {
6116
+ width: "12px",
6117
+ height: "12px",
6118
+ borderRadius: "50%",
6119
+ background: stage.avgDurationHours > 20 ? "#EF4444" : "#10B981",
6120
+ marginTop: "4px"
6121
+ }
6122
+ }), idx !== stages.length - 1 && /*#__PURE__*/React.createElement("div", {
6123
+ style: {
6124
+ width: "2px",
6125
+ height: "40px",
6126
+ background: "#E5E7EB"
6127
+ }
6128
+ })), /*#__PURE__*/React.createElement("div", {
6129
+ style: {
6130
+ flex: 1
6131
+ }
6132
+ }, /*#__PURE__*/React.createElement("div", {
6133
+ style: {
6134
+ display: "flex",
6135
+ justifyContent: "space-between",
6136
+ marginBottom: "4px"
6137
+ }
6138
+ }, /*#__PURE__*/React.createElement("span", {
6139
+ style: {
6140
+ fontSize: "14px",
6141
+ fontWeight: "600",
6142
+ color: "#374151"
6143
+ }
6144
+ }, t(stage.stageName)), /*#__PURE__*/React.createElement("span", {
6145
+ style: {
6146
+ fontSize: "12px",
6147
+ fontWeight: "700",
6148
+ color: stage.avgDurationHours > 20 ? "#EF4444" : "#10B981"
6149
+ }
6150
+ }, stage.avgDurationHours, "h ", t("EKYC_AVG"))), /*#__PURE__*/React.createElement("div", {
6151
+ style: {
6152
+ width: "100%",
6153
+ height: "6px",
6154
+ background: "#F3F4F6",
6155
+ borderRadius: "3px",
6156
+ overflow: "hidden"
6157
+ }
6158
+ }, /*#__PURE__*/React.createElement("div", {
6159
+ style: {
6160
+ width: `${Math.min(100, stage.count / 1000 * 100)}%`,
6161
+ height: "100%",
6162
+ background: stage.avgDurationHours > 20 ? "#EF444480" : "#10B98180"
6163
+ }
6164
+ })), /*#__PURE__*/React.createElement("div", {
6165
+ style: {
6166
+ fontSize: "12px",
6167
+ color: "#6B7280",
6168
+ marginTop: "4px"
6169
+ }
6170
+ }, stage.count, " ", t("EKYC_APPLICATIONS_IN_STAGE")))))));
6171
+ };
6172
+
6173
+ const NotificationPanel = ({
6174
+ notifications,
6175
+ isOpen,
6176
+ onClose
6177
+ }) => {
6178
+ const {
6179
+ t
6180
+ } = useTranslation();
6181
+ if (!isOpen) return null;
6182
+ return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
6183
+ onClick: onClose,
6184
+ style: {
6185
+ position: "fixed",
6186
+ top: 0,
6187
+ left: 0,
6188
+ width: "100%",
6189
+ height: "100%",
6190
+ background: "rgba(0,0,0,0.3)",
6191
+ zIndex: 999
6192
+ }
6193
+ }), /*#__PURE__*/React.createElement("div", {
6194
+ className: "notification-panel",
6195
+ style: {
6196
+ position: "fixed",
6197
+ top: 0,
6198
+ right: 0,
6199
+ width: "350px",
6200
+ height: "100%",
6201
+ background: "#FFFFFF",
6202
+ zIndex: 1000,
6203
+ boxShadow: "-4px 0 15px rgba(0,0,0,0.1)",
6204
+ display: "flex",
6205
+ flexDirection: "column"
6206
+ }
6207
+ }, /*#__PURE__*/React.createElement("div", {
6208
+ style: {
6209
+ padding: "20px",
6210
+ borderBottom: "1px solid #F3F4F6",
6211
+ display: "flex",
6212
+ justifyContent: "space-between",
6213
+ alignItems: "center"
6214
+ }
6215
+ }, /*#__PURE__*/React.createElement("h3", {
6216
+ style: {
6217
+ fontSize: "18px",
6218
+ fontWeight: "700",
6219
+ color: "#111827"
6220
+ }
6221
+ }, t("EKYC_ALERTS_CENTER")), /*#__PURE__*/React.createElement("button", {
6222
+ onClick: onClose,
6223
+ style: {
6224
+ background: "none",
6225
+ border: "none",
6226
+ fontSize: "24px",
6227
+ cursor: "pointer",
6228
+ color: "#9CA3AF"
6229
+ }
6230
+ }, "\xD7")), /*#__PURE__*/React.createElement("div", {
6231
+ style: {
6232
+ flex: 1,
6233
+ overflowY: "auto",
6234
+ padding: "16px"
6235
+ }
6236
+ }, notifications.length === 0 ? /*#__PURE__*/React.createElement("div", {
6237
+ style: {
6238
+ textAlign: "center",
6239
+ color: "#9CA3AF",
6240
+ marginTop: "40px"
6241
+ }
6242
+ }, t("EKYC_NO_NEW_ALERTS")) : notifications.map((alert, idx) => /*#__PURE__*/React.createElement("div", {
6243
+ key: idx,
6244
+ style: {
6245
+ padding: "16px",
6246
+ borderRadius: "12px",
6247
+ background: alert.priority === "HIGH" ? "#FEF2F2" : "#F9FAFB",
6248
+ border: `1px solid ${alert.priority === "HIGH" ? "#FECACA" : "#E5E7EB"}`,
6249
+ marginBottom: "12px"
6250
+ }
6251
+ }, /*#__PURE__*/React.createElement("div", {
6252
+ style: {
6253
+ display: "flex",
6254
+ justifyContent: "space-between",
6255
+ marginBottom: "4px"
6256
+ }
6257
+ }, /*#__PURE__*/React.createElement("span", {
6258
+ style: {
6259
+ fontSize: "10px",
6260
+ fontWeight: "800",
6261
+ padding: "2px 6px",
6262
+ borderRadius: "4px",
6263
+ background: alert.priority === "HIGH" ? "#EF4444" : "#3B82F6",
6264
+ color: "#FFFFFF"
6265
+ }
6266
+ }, alert.priority), /*#__PURE__*/React.createElement("span", {
6267
+ style: {
6268
+ fontSize: "11px",
6269
+ color: "#9CA3AF"
6270
+ }
6271
+ }, alert.time)), /*#__PURE__*/React.createElement("h4", {
6272
+ style: {
6273
+ fontSize: "14px",
6274
+ fontWeight: "600",
6275
+ color: "#374151",
6276
+ marginBottom: "4px"
6277
+ }
6278
+ }, t(alert.title)), /*#__PURE__*/React.createElement("p", {
6279
+ style: {
6280
+ fontSize: "13px",
6281
+ color: "#6B7280"
6282
+ }
6283
+ }, t(alert.message))))), /*#__PURE__*/React.createElement("div", {
6284
+ style: {
6285
+ padding: "16px",
6286
+ borderTop: "1px solid #F3F4F6"
6287
+ }
6288
+ }, /*#__PURE__*/React.createElement("button", {
6289
+ style: {
6290
+ width: "100%",
6291
+ padding: "12px",
6292
+ borderRadius: "8px",
6293
+ background: "#F3F4F6",
6294
+ color: "#374151",
6295
+ border: "none",
6296
+ fontWeight: "600",
6297
+ cursor: "pointer"
6298
+ }
6299
+ }, t("EKYC_MARK_ALL_READ")))));
6300
+ };
6301
+
6302
+ const SkeletonLoader = ({
6303
+ type: _type = "card",
6304
+ count: _count = 1
6305
+ }) => {
6306
+ const renderSkeleton = () => {
6307
+ switch (_type) {
6308
+ case "card":
6309
+ return /*#__PURE__*/React.createElement("div", {
6310
+ className: "skeleton-card",
6311
+ style: {
6312
+ padding: "24px",
6313
+ background: "#F3F4F6",
6314
+ borderRadius: "12px",
6315
+ height: "140px",
6316
+ animation: "pulse 1.5s infinite"
6317
+ }
6318
+ }, /*#__PURE__*/React.createElement("div", {
6319
+ style: {
6320
+ height: "16px",
6321
+ width: "40%",
6322
+ background: "#E5E7EB",
6323
+ marginBottom: "16px",
6324
+ borderRadius: "4px"
6325
+ }
6326
+ }), /*#__PURE__*/React.createElement("div", {
6327
+ style: {
6328
+ height: "32px",
6329
+ width: "70%",
6330
+ background: "#E5E7EB",
6331
+ marginBottom: "12px",
6332
+ borderRadius: "4px"
6333
+ }
6334
+ }), /*#__PURE__*/React.createElement("div", {
6335
+ style: {
6336
+ height: "12px",
6337
+ width: "30%",
6338
+ background: "#E5E7EB",
6339
+ borderRadius: "4px"
6340
+ }
6341
+ }));
6342
+ case "chart":
6343
+ return /*#__PURE__*/React.createElement("div", {
6344
+ className: "skeleton-chart",
6345
+ style: {
6346
+ padding: "24px",
6347
+ background: "#F3F4F6",
6348
+ borderRadius: "12px",
6349
+ height: "300px",
6350
+ animation: "pulse 1.5s infinite"
6351
+ }
6352
+ }, /*#__PURE__*/React.createElement("div", {
6353
+ style: {
6354
+ height: "20px",
6355
+ width: "30%",
6356
+ background: "#E5E7EB",
6357
+ marginBottom: "24px",
6358
+ borderRadius: "4px"
6359
+ }
6360
+ }), /*#__PURE__*/React.createElement("div", {
6361
+ style: {
6362
+ height: "200px",
6363
+ width: "100%",
6364
+ background: "#E5E7EB",
6365
+ borderRadius: "8px"
6366
+ }
6367
+ }));
6368
+ case "table":
6369
+ return /*#__PURE__*/React.createElement("div", {
6370
+ className: "skeleton-table",
6371
+ style: {
6372
+ padding: "16px",
6373
+ background: "#F3F4F6",
6374
+ borderRadius: "12px",
6375
+ animation: "pulse 1.5s infinite"
6376
+ }
6377
+ }, [1, 2, 3, 4, 5].map(i => /*#__PURE__*/React.createElement("div", {
6378
+ key: i,
6379
+ style: {
6380
+ height: "40px",
6381
+ width: "100%",
6382
+ background: "#E5E7EB",
6383
+ marginBottom: "8px",
6384
+ borderRadius: "4px"
6385
+ }
6386
+ })));
6387
+ default:
6388
+ return null;
6389
+ }
6390
+ };
6391
+ return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement("style", null, `
6392
+ @keyframes pulse {
6393
+ 0% { opacity: 1; }
6394
+ 50% { opacity: 0.5; }
6395
+ 100% { opacity: 1; }
6396
+ }
6397
+ `), /*#__PURE__*/React.createElement("div", {
6398
+ style: {
6399
+ display: "grid",
6400
+ gap: "16px",
6401
+ gridTemplateColumns: _type === "card" ? "repeat(auto-fill, minmax(240px, 1fr))" : "1fr"
6402
+ }
6403
+ }, Array(_count).fill(0).map((_, i) => /*#__PURE__*/React.createElement(React.Fragment, {
6404
+ key: i
6405
+ }, renderSkeleton()))));
6406
+ };
6407
+
6408
+ class ErrorBoundary extends React.Component {
6409
+ constructor(props) {
6410
+ super(props);
6411
+ this.state = {
6412
+ hasError: false
6413
+ };
6414
+ }
6415
+ static getDerivedStateFromError(error) {
6416
+ return {
6417
+ hasError: true
6418
+ };
6419
+ }
6420
+ render() {
6421
+ if (this.state.hasError) {
6422
+ return /*#__PURE__*/React.createElement("div", {
6423
+ style: {
6424
+ padding: "20px",
6425
+ background: "#FEF2F2",
6426
+ border: "1px solid #FECACA",
6427
+ borderRadius: "8px",
6428
+ textAlign: "center"
6429
+ }
6430
+ }, /*#__PURE__*/React.createElement("h4", {
6431
+ style: {
6432
+ color: "#991B1B",
6433
+ marginBottom: "8px"
6434
+ }
6435
+ }, "Widget Error"), /*#__PURE__*/React.createElement("p", {
6436
+ style: {
6437
+ color: "#B91C1C",
6438
+ fontSize: "12px"
6439
+ }
6440
+ }, "Failed to render this component."));
6441
+ }
6442
+ return this.props.children;
6443
+ }
6444
+ }
6445
+
6446
+ const EmptyState = ({
6447
+ message: _message = "EKYC_NO_DATA_FOUND"
6448
+ }) => {
6449
+ const {
6450
+ t
6451
+ } = useTranslation();
6452
+ return /*#__PURE__*/React.createElement("div", {
6453
+ className: "empty-state-container",
6454
+ style: {
6455
+ display: "flex",
6456
+ flexDirection: "column",
6457
+ alignItems: "center",
6458
+ justifyContent: "center",
6459
+ padding: "60px 20px",
6460
+ background: "#F9FAFB",
6461
+ borderRadius: "12px",
6462
+ border: "1px dashed #D1D5DB"
6463
+ }
6464
+ }, /*#__PURE__*/React.createElement("div", {
6465
+ style: {
6466
+ fontSize: "48px",
6467
+ marginBottom: "16px"
6468
+ }
6469
+ }, "\uD83D\uDD0D"), /*#__PURE__*/React.createElement("h3", {
6470
+ style: {
6471
+ fontSize: "18px",
6472
+ fontWeight: "600",
6473
+ color: "#374151",
6474
+ marginBottom: "8px"
6475
+ }
6476
+ }, t("EKYC_EMPTY_STATE_TITLE") || "No Results Found"), /*#__PURE__*/React.createElement("p", {
6477
+ style: {
6478
+ color: "#6B7280",
6479
+ textAlign: "center",
6480
+ maxWidth: "300px"
6481
+ }
6482
+ }, t(_message) || "Try adjusting your filters or check back later for updated metrics."));
6483
+ };
6484
+
6485
+ const CeoDashboard = () => {
6486
+ var _config$widgets, _config$widgets$summa;
6487
+ const {
6488
+ t
6489
+ } = useTranslation();
6490
+ const {
6491
+ routeToInbox
6492
+ } = Digit.Hooks.ekyc.useInboxRouting();
6493
+ const [activeRole, setActiveRole] = useState("CEO");
6494
+ const [isNotificationOpen, setIsNotificationOpen] = useState(false);
6495
+ const [filters, setFilters] = useState({
6496
+ financialYear: "2025-26",
6497
+ clusterId: "ALL",
6498
+ agencyId: "ALL"
6499
+ });
6500
+ const {
6501
+ config,
6502
+ tenantId
6503
+ } = Digit.Hooks.ekyc.useEkycDashboardConfigs(activeRole);
6504
+ const {
6505
+ summary: kpiData,
6506
+ agencies: agencyData,
6507
+ heatmap: clusterData,
6508
+ workflow: workflowData,
6509
+ isLoading,
6510
+ isError
6511
+ } = Digit.Hooks.ekyc.useEkycDashboardData(activeRole, filters);
6512
+ const handleFilterChange = (id, value) => {
6513
+ setFilters(prev => ({
6514
+ ...prev,
6515
+ [id]: value
6516
+ }));
6517
+ };
6518
+ const handleReset = () => {
6519
+ setFilters({
6520
+ financialYear: "2025-26",
6521
+ clusterId: "ALL",
6522
+ agencyId: "ALL"
6523
+ });
6524
+ };
6525
+ const handleKpiClick = kpi => {
6526
+ routeToInbox(kpi.targetRoute, {
6527
+ ...filters,
6528
+ status: kpi.status
6529
+ });
6530
+ };
6531
+ const notifications = [{
6532
+ title: "EKYC_SLA_BREACH_ALERT",
6533
+ message: "EKYC_ALERT_DESC_1",
6534
+ priority: "HIGH",
6535
+ time: "10m ago"
6536
+ }, {
6537
+ title: "EKYC_SYSTEM_UPDATE",
6538
+ message: "EKYC_ALERT_DESC_3",
6539
+ priority: "NORMAL",
6540
+ time: "5h ago"
6541
+ }];
6542
+ if (isError) return /*#__PURE__*/React.createElement(EmptyState, {
6543
+ message: "EKYC_ERROR_FETCHING_DATA"
6544
+ });
6545
+ return /*#__PURE__*/React.createElement(DashboardLayout, {
6546
+ header: config.title,
6547
+ activeRole: activeRole,
6548
+ onRoleChange: role => {
6549
+ setActiveRole(role);
6550
+ handleReset();
6551
+ },
6552
+ onNotificationClick: () => setIsNotificationOpen(true),
6553
+ filters: /*#__PURE__*/React.createElement(FilterBar, {
6554
+ filters: filters,
6555
+ config: config.globalFilters,
6556
+ onFilterChange: handleFilterChange,
6557
+ onReset: handleReset
6558
+ })
6559
+ }, /*#__PURE__*/React.createElement(NotificationPanel, {
6560
+ isOpen: isNotificationOpen,
6561
+ onClose: () => setIsNotificationOpen(false),
6562
+ notifications: notifications
6563
+ }), /*#__PURE__*/React.createElement("section", {
6564
+ style: {
6565
+ marginBottom: "32px"
6566
+ }
6567
+ }, isLoading ? /*#__PURE__*/React.createElement(SkeletonLoader, {
6568
+ type: "card",
6569
+ count: 4
6570
+ }) : /*#__PURE__*/React.createElement("div", {
6571
+ style: {
6572
+ display: "grid",
6573
+ gridTemplateColumns: "repeat(auto-fill, minmax(280px, 1fr))",
6574
+ gap: "24px"
6575
+ }
6576
+ }, config === null || config === void 0 ? void 0 : (_config$widgets = config.widgets) === null || _config$widgets === void 0 ? void 0 : (_config$widgets$summa = _config$widgets.summary) === null || _config$widgets$summa === void 0 ? void 0 : _config$widgets$summa.map((kpiKey, idx) => {
6577
+ var _config$kpis;
6578
+ const kpiMeta = config === null || config === void 0 ? void 0 : (_config$kpis = config.kpis) === null || _config$kpis === void 0 ? void 0 : _config$kpis[kpiKey];
6579
+ if (!kpiMeta) return null;
6580
+ const value = (kpiData === null || kpiData === void 0 ? void 0 : kpiData[kpiKey]) || 0;
6581
+ return /*#__PURE__*/React.createElement(ErrorBoundary, {
6582
+ key: kpiKey
6583
+ }, /*#__PURE__*/React.createElement("div", {
6584
+ className: "animate-fade-in",
6585
+ style: {
6586
+ animationDelay: `${idx * 0.1}s`
6587
+ }
6588
+ }, /*#__PURE__*/React.createElement(SummaryCard, {
6589
+ label: kpiMeta.label,
6590
+ value: value,
6591
+ color: kpiMeta.color,
6592
+ icon: kpiMeta.icon,
6593
+ trend: kpiData === null || kpiData === void 0 ? void 0 : kpiData[`${kpiKey}Trend`],
6594
+ onClick: () => handleKpiClick(kpiMeta)
6595
+ })));
6596
+ }))), /*#__PURE__*/React.createElement("div", {
6597
+ style: {
6598
+ display: "grid",
6599
+ gridTemplateColumns: "repeat(12, 1fr)",
6600
+ gap: "24px"
6601
+ }
6602
+ }, /*#__PURE__*/React.createElement("div", {
6603
+ style: {
6604
+ gridColumn: "span 12",
6605
+ background: "#FFF",
6606
+ padding: "24px",
6607
+ borderRadius: "16px",
6608
+ boxShadow: "0 1px 3px rgba(0,0,0,0.1)"
6609
+ }
6610
+ }, isLoading ? /*#__PURE__*/React.createElement(SkeletonLoader, {
6611
+ type: "chart"
6612
+ }) : /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement(TaskStatusChart, {
6613
+ title: "EKYC_APPLICATION_STATUS",
6614
+ data: (workflowData === null || workflowData === void 0 ? void 0 : workflowData.stageBreakdown) || []
6615
+ }))), /*#__PURE__*/React.createElement("div", {
6616
+ style: {
6617
+ gridColumn: "span 4"
6618
+ }
6619
+ }, isLoading ? /*#__PURE__*/React.createElement(SkeletonLoader, {
6620
+ type: "chart"
6621
+ }) : /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement(SLAWidget, {
6622
+ slaPercentage: (workflowData === null || workflowData === void 0 ? void 0 : workflowData.slaCompliance) || 0,
6623
+ avgTime: (workflowData === null || workflowData === void 0 ? void 0 : workflowData.avgProcessingTimeHours) || 0,
6624
+ breachedCount: (workflowData === null || workflowData === void 0 ? void 0 : workflowData.breachCount) || 0
6625
+ }))), /*#__PURE__*/React.createElement("div", {
6626
+ style: {
6627
+ gridColumn: "span 8"
6628
+ }
6629
+ }, isLoading ? /*#__PURE__*/React.createElement(SkeletonLoader, {
6630
+ type: "chart"
6631
+ }) : /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement(WorkflowTimeline, {
6632
+ stages: (workflowData === null || workflowData === void 0 ? void 0 : workflowData.stageBreakdown) || []
6633
+ }))), /*#__PURE__*/React.createElement("div", {
6634
+ style: {
6635
+ gridColumn: "span 12",
6636
+ background: "#FFF",
6637
+ padding: "24px",
6638
+ borderRadius: "16px",
6639
+ boxShadow: "0 1px 3px rgba(0,0,0,0.1)"
6640
+ }
6641
+ }, isLoading ? /*#__PURE__*/React.createElement(SkeletonLoader, {
6642
+ type: "chart"
6643
+ }) : /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement(ClusterHeatmap, {
6644
+ title: "EKYC_CLUSTER_WORKLOAD_HEATMAP",
6645
+ data: clusterData || [],
6646
+ onDrillDown: cluster => handleFilterChange("clusterId", cluster.clusterId)
6647
+ }))), /*#__PURE__*/React.createElement("div", {
6648
+ style: {
6649
+ gridColumn: "span 12"
6650
+ }
6651
+ }, isLoading ? /*#__PURE__*/React.createElement(SkeletonLoader, {
6652
+ type: "table"
6653
+ }) : /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement(AnalyticsTable, {
6654
+ title: "EKYC_AGENCY_PERFORMANCE_METRICS",
6655
+ filename: "agency_performance_report.csv",
6656
+ data: agencyData || [],
6657
+ columns: [{
6658
+ id: "agencyName",
6659
+ label: "EKYC_AGENCY_NAME"
6660
+ }, {
6661
+ id: "totalAssigned",
6662
+ label: "EKYC_TOTAL_ASSIGNED"
6663
+ }, {
6664
+ id: "totalCompleted",
6665
+ label: "EKYC_TOTAL_COMPLETED"
6666
+ }, {
6667
+ id: "pendingCount",
6668
+ label: "EKYC_PENDING"
6669
+ }, {
6670
+ id: "slaCompliance",
6671
+ label: "EKYC_SLA_COMPLIANCE",
6672
+ isPercentage: true
6673
+ }]
6674
+ })))));
6675
+ };
6676
+
5223
6677
  const EkycModule = ({
5224
6678
  stateCode,
5225
6679
  userType,
@@ -5292,7 +6746,8 @@ const componentsToRegister = {
5292
6746
  AadhaarVerification,
5293
6747
  AddressDetails,
5294
6748
  PropertyInfo,
5295
- MeterDetails
6749
+ MeterDetails,
6750
+ CeoDashboard
5296
6751
  };
5297
6752
  const initEkycComponents = () => {
5298
6753
  Object.entries(componentsToRegister).forEach(([key, value]) => {