@djb25/digit-ui-module-ekyc 1.0.11 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/index.css +1 -0
  2. package/dist/index.js +1 -1
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.modern.js +2884 -682
  5. package/dist/index.modern.js.map +1 -1
  6. package/package.json +1 -1
  7. package/src/Module.js +28 -7
  8. package/src/components/AadhaarVerification.js +415 -0
  9. package/src/components/AddressDetails.js +207 -0
  10. package/src/components/CeoDashboard.js +201 -0
  11. package/src/components/DesktopInbox.js +1 -1
  12. package/src/components/EKYCCard.js +4 -0
  13. package/src/components/MeterDetails.js +372 -0
  14. package/src/components/PropertyInfo.js +303 -0
  15. package/src/components/Review.js +572 -0
  16. package/src/components/analytics/charts/ClusterHeatmap.js +88 -0
  17. package/src/components/analytics/charts/TaskStatusChart.js +92 -0
  18. package/src/components/analytics/components/AnalyticsTable.js +106 -0
  19. package/src/components/analytics/components/DashboardLayout.js +72 -0
  20. package/src/components/analytics/components/EmptyState.js +27 -0
  21. package/src/components/analytics/components/ErrorBoundary.js +27 -0
  22. package/src/components/analytics/components/FilterBar.js +73 -0
  23. package/src/components/analytics/components/NotificationPanel.js +77 -0
  24. package/src/components/analytics/components/SLAWidget.js +56 -0
  25. package/src/components/analytics/components/SkeletonLoader.js +53 -0
  26. package/src/components/analytics/components/SummaryCard.js +74 -0
  27. package/src/components/analytics/components/WorkflowTimeline.js +55 -0
  28. package/src/components/analytics/styles/Dashboard.css +54 -0
  29. package/src/components/analytics/utils/exportUtils.js +64 -0
  30. package/src/components/analytics/utils/filterSerializer.js +50 -0
  31. package/src/config/config.js +1 -1
  32. package/src/pages/citizen/index.js +74 -18
  33. package/src/pages/employee/ConsumerDetails.js +10 -281
  34. package/src/pages/employee/Inbox.js +6 -4
  35. package/src/pages/employee/index.js +55 -8
  36. package/src/pages/employee/AadhaarVerification.js +0 -512
  37. package/src/pages/employee/AddressDetails.js +0 -548
  38. package/src/pages/employee/MeterDetails.js +0 -496
  39. package/src/pages/employee/PropertyInfo.js +0 -489
  40. package/src/pages/employee/Review.js +0 -314
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("react"),a=e(t),l=require("react-i18next"),n=require("react-router-dom"),r=require("@djb25/digit-ui-react-components"),o=require("chart.js/auto"),i=e(o);require("react-dom");const s=e=>{let{countData:n}=e;const{t:r}=l.useTranslation(),s=t.useRef(null),c=t.useRef(null),m=(null==n?void 0:n.total)||0,d=(null==n?void 0:n.pending)||0,u=(null==n?void 0:n.completed)||0,E=(null==n?void 0:n.completed)||0,p=E,v=m>0?Math.round(E/m*100):0,g=m>0?Math.round(p/m*100):0,C=e=>new Intl.NumberFormat("en-IN").format(e||0);t.useEffect(()=>{if(s.current){c.current&&c.current.destroy();const e=s.current.getContext("2d");c.current=new(o.Chart||i||o)(e,{type:"doughnut",data:{labels:[r("EKYC_ACTIVE"),r("EKYC_PENDING"),r("EKYC_COMPLETED")],datasets:[{data:[u,d,0],backgroundColor:["#0c2a52","#77B6EA","#c8ddf5"],borderColor:["#ffffff","#ffffff","#ffffff"],borderWidth:2,hoverOffset:4}]},options:{cutout:"75%",plugins:{legend:{display:!1}},maintainAspectRatio:!1,responsive:!0}})}return()=>{c.current&&c.current.destroy()}},[d,0,u,r]);const b=[{color:"#0c2a52",label:r("EKYC_ACTIVE"),value:u},{color:"#77B6EA",label:r("EKYC_PENDING"),value:d},{color:"#c8ddf5",label:r("EKYC_COMPLETED"),value:0}];return a.createElement("div",{className:"ekyc-employee-container"},a.createElement("div",{className:"status-cards-wrapper"},a.createElement("div",{className:"status-cards-header"},a.createElement("div",null,a.createElement("div",{className:"eyebrow"},a.createElement("span",{className:"eyebrow-dot"}),r("EKYC_INSTITUTIONAL_OVERVIEW")||"Institutional Performance Overview"),a.createElement("h1",{className:"status-cards-h1"},r("EKYC_DASHBOARD_TITLE")||"eKYC Verification Dashboard"),a.createElement("p",{className:"status-cards-subtitle"},r("EKYC_DASHBOARD_SUBTITLE")||"Real-time monitoring of consumer verification workflows across all administrative zones.")),a.createElement("div",{className:"total-applications-card"},a.createElement("div",{className:"total-label"},r("EKYC_TOTAL_APPLICATIONS")||"Total Applications Processed"),a.createElement("div",{className:"total-number"},C(m)),a.createElement("div",{className:"total-badge"},"↗ +12.4% ",r("EKYC_FROM_LAST_QUARTER")||"from last quarter"))),a.createElement("div",{className:"status-panels-grid"},a.createElement("div",{className:"status-panel"},a.createElement("div",{className:"panel-title"},r("EKYC_STATUS_BREAKDOWN")||"Status Breakdown"),a.createElement("div",{className:"panel-subtitle"},r("EKYC_VERIFICATION_LIFECYCLE")||"Verification lifecycle distribution"),a.createElement("div",{className:"breakdown-body"},a.createElement("div",{className:"status-legend"},b.map(e=>a.createElement("div",{key:e.label,className:"legend-row"},a.createElement("span",{className:"legend-label"},a.createElement("span",{className:"indicator-dot",style:{background:e.color}}),e.label),a.createElement("span",{className:"legend-value"},C(e.value))))),a.createElement("div",{className:"chart-wrapper"},a.createElement("canvas",{ref:s,style:{width:"100%",height:"100%"}}),a.createElement("div",{className:"chart-center"},a.createElement("div",{className:"chart-percentage"},v,"%"),a.createElement("div",{className:"chart-label"},r("EKYC_COMPLETE")||"Complete"))))),a.createElement("div",{className:"status-panel"},a.createElement("div",{className:"panel-title"},r("EKYC_SUBMISSION_HEALTH")||"Submission Health",a.createElement("span",{className:"optimal-badge"},r("EKYC_OPTIMAL")||"Optimal")),a.createElement("div",{className:"panel-subtitle"},r("EKYC_PLATFORM_EFFICIENCY")||"Platform operational efficiency"),a.createElement("div",{className:"health-metrics-row"},a.createElement("div",{className:"health-percentage"},g,"%"),a.createElement("div",{className:"health-trend"},"↗ +2.1%")),a.createElement("div",{className:"status-progress-bar"},a.createElement("div",{className:"progress-fill",style:{width:g+"%"}})),a.createElement("div",{className:"mini-metrics-grid"},a.createElement("div",{className:"metric-box"},a.createElement("div",{className:"metric-label"},r("EKYC_AVG_LATENCY")||"Avg Latency"),a.createElement("div",{className:"metric-value"},"1.2s")),a.createElement("div",{className:"metric-box"},a.createElement("div",{className:"metric-label"},r("EKYC_ERROR_RATE")||"Error Rate"),a.createElement("div",{className:"metric-value"},"0.04%")))))))},c=()=>{const e=Digit.ULBService.getCurrentTenantId(),{isLoading:l,data:n}=Digit.Hooks.ekyc.useEkycSurveyorDashboard({},{tenantId:e,offset:0,limit:10},{enabled:!!e}),o=t.useMemo(()=>{const e=(null==n?void 0:n.dashboardInfo)||{};return{total:e.total||0,completed:e.completed||0,pending:e.pending||0,rejected:e.rejected||0,active:e.active||0}},[n]);return l?a.createElement(r.Loader,null):a.createElement(r.Card,{className:"min-width-full"},a.createElement(s,{countData:o}))},m=e=>{var n,o,i;let{onSearch:s,searchParams:c,children:m,...d}=e;const{t:u}=l.useTranslation(),[E,p]=t.useState(()=>({...c})),v=(e,t)=>{p(a=>({...a,[e]:t}))};return a.createElement("div",{className:"ekyc-employee-container"},a.createElement("div",{className:"search-consumer-wrapper"},a.createElement("div",{className:"header-wrapper"},a.createElement(r.Card,{className:"sidebar-title-card"},a.createElement("div",{className:"icon-container"},a.createElement(r.HomeIcon,null)),a.createElement("div",{className:"title-text"},u("EKYC_SEARCH_CONSUMER_HEADER")))),a.createElement("div",{className:"main-content-wrapper"},a.createElement("div",{className:"search-stats-row"},a.createElement("div",{className:"identity-lookup-card"},a.createElement("div",{className:"lookup-card-title"},a.createElement("div",{className:"lookup-icon-bg"},a.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"#3A7BD5",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("circle",{cx:"11",cy:"11",r:"8"}),a.createElement("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}))),a.createElement("span",{className:"lookup-title-text"},u("EKYC_IDENTITY_LOOKUP")||"Identity Lookup")),a.createElement("form",{onSubmit:e=>{e&&e.preventDefault&&e.preventDefault(),s(E)}},a.createElement("div",{className:"inputs-row"},a.createElement("div",{className:"input-group"},a.createElement("label",null,u("EKYC_K_NUMBER")||"K Number",a.createElement("span",{className:"info-badge"},"i")),a.createElement(r.TextInput,{value:null==E?void 0:E.kNumber,onChange:e=>v("kNumber",e.target.value),placeholder:u("EKYC_K_NUMBER_PLACEHOLDER")||"e.g. 8234910234"})),a.createElement("div",{className:"input-group"},a.createElement("label",null,u("EKYC_K_NAME")||"K Name",a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#3A7BD5",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),a.createElement("circle",{cx:"12",cy:"7",r:"4"}))),a.createElement(r.TextInput,{value:null==E?void 0:E.kName,onChange:e=>v("kName",e.target.value),placeholder:u("EKYC_K_NAME_PLACEHOLDER")||"Consumer name search"}))),a.createElement("div",{className:"actions-row"},a.createElement("button",{type:"button",onClick:()=>{const e={kNumber:"",kName:""};p(e),s(e)},className:"clear-btn"},u("ES_COMMON_CLEAR")||"Clear"),a.createElement("button",{type:"submit",className:"search-btn"},u("ES_COMMON_SEARCH")||"Execute Search")))),a.createElement("div",{className:"stats-column"},a.createElement("div",{className:"audits-card"},a.createElement("div",{className:"audits-label"},u("EKYC_TODAYS_AUDITS")||"Today's Audits"),a.createElement("div",{className:"audits-count"},(null===(n=d.countData)||void 0===n?void 0:n.todaysAudits)||24),a.createElement("div",{className:"audits-change"},a.createElement("span",null,"↗"),(null===(o=d.countData)||void 0===o?void 0:o.auditChange)||"12% increase from yesterday"),a.createElement("div",{className:"audits-watermark"},"M")),a.createElement("div",{className:"queue-card"},a.createElement("div",{className:"queue-label"},u("EKYC_QUEUE_STATUS")||"Queue Status"),a.createElement("div",{className:"queue-content"},a.createElement("div",{className:"queue-status-text"},(null===(i=d.countData)||void 0===i?void 0:i.pendingCount)||3," Pending"),a.createElement("div",{className:"avatar-group"},[0,1].map(e=>a.createElement("div",{key:e,className:"avatar-item"},String.fromCharCode(65+e))),a.createElement("div",{className:"avatar-more"},"+1")))))),m)))},d=e=>{let{searchParams:n,onFilterChange:o,defaultSearchParams:i,...s}=e;const{t:c}=l.useTranslation(),[m,d]=t.useState(()=>({...n}));return a.createElement(r.FilterForm,{onSubmit:()=>{o(m)},handleSubmit:e=>t=>{t&&t.preventDefault(),e()},onResetFilterForm:()=>{d({...i}),o({...i})},id:"ekyc-filter-form",onMobileExclusiveFilterPopupFormClose:s.onClose},a.createElement(r.FilterFormField,null,a.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},c("EKYC_STATUS"),":"),a.createElement(r.Dropdown,{option:[{label:c("EKYC_STATUS_ALL"),value:""},{label:c("EKYC_STATUS_ACTIVE"),value:"ACTIVE"},{label:c("EKYC_STATUS_PENDING"),value:"PENDING START"}],optionKey:"label",select:e=>{const t={...m,status:e};d(t),o(t)},selected:(null==m?void 0:m.status)||{label:c("EKYC_STATUS_ALL"),value:""}})))};function u(){return(u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var l in a)({}).hasOwnProperty.call(a,l)&&(e[l]=a[l])}return e}).apply(null,arguments)}const E=e=>{var r,o,i;let{onPageSizeChange:s,formState:c,totalCount:m,table:d,dispatch:u,checkPathName:E,onSortingByData:p,tenantId:v,inboxStyles:g={},tableStyle:C={}}=e;const{t:b}=l.useTranslation(),S=n.useHistory(),[N,f]=t.useState(""),{data:h,getReview:y}=Digit.Hooks.ekyc.useEkycAPI("review",v),_=e=>{f(e),y({kno:e})},x=(null==c||null===(r=c.tableForm)||void 0===r?void 0:r.limit)||10,k=(null==c||null===(o=c.tableForm)||void 0===o?void 0:o.offset)||0;a.useEffect(()=>{h&&S.push("/digit-ui/employee/ekyc/review",{kNumber:N,aadhaarData:null==h?void 0:h.aadhaarData,reviewData:h})},[h]);const T=[{Header:b("EKYC_APPLICATION_NO"),accessor:"applicationNumber",disableSortBy:!0,Cell:e=>{var t,l;let{row:n}=e;const r=(null===(t=n.original)||void 0===t?void 0:t.kno)||(null===(l=n.original)||void 0===l?void 0:l.applicationNumber)||"NA";return a.createElement("span",{className:"ekyc-application-link",style:{color:"#add8f7",cursor:"pointer",fontWeight:"bold"},onClick:()=>_(r)},r)}},{Header:b("EKYC_CITIZEN_NAME"),accessor:"citizenName",Cell:e=>{var t;let{row:l}=e;return a.createElement("span",null,(null===(t=l.original)||void 0===t?void 0:t.citizenName)||"NA")}},{Header:b("EKYC_STATUS"),accessor:"actionStatus",Cell:e=>{var t;let{row:l}=e;const n=(null===(t=l.original)||void 0===t?void 0:t.status)||"DEFAULT";return a.createElement("span",{className:"ekyc-status-tag "+n},b(""+n))}},{Header:b("EKYC_ACTION"),accessor:"status",Cell:e=>{var t,l;let{row:n}=e;const r=(null===(t=n.original)||void 0===t?void 0:t.kno)||(null===(l=n.original)||void 0===l?void 0:l.applicationNumber)||"NA";return a.createElement("span",{className:"ekyc-application-link",style:{color:"#add8f7",cursor:"pointer",fontWeight:"bold"},onClick:()=>_(r)},b("EKYC_REVIEW"))}}];return{getCellProps:e=>({style:{padding:"8px",fontSize:"12px"}}),disableSort:!1,autoSort:!1,manualPagination:!0,initSortId:"applicationDate",onPageSizeChange:s,currentPage:Math.floor(k/x),onNextPage:()=>{var e,t;return u({action:"mutateTableForm",data:{...c.tableForm,offset:parseInt(null===(e=c.tableForm)||void 0===e?void 0:e.offset)+parseInt(null===(t=c.tableForm)||void 0===t?void 0:t.limit)},checkPathName:E})},onPrevPage:()=>{var e,t;return u({action:"mutateTableForm",data:{...c.tableForm,offset:parseInt(null===(e=c.tableForm)||void 0===e?void 0:e.offset)-parseInt(null===(t=c.tableForm)||void 0===t?void 0:t.limit)},checkPathName:E})},pageSizeLimit:x,onSort:p,totalRecords:m,onSearch:null==c||null===(i=c.searchForm)||void 0===i?void 0:i.message,onLastPage:()=>{var e;return u({action:"mutateTableForm",data:{...c.tableForm,offset:10*Math.ceil(m/10)-parseInt(null===(e=c.tableForm)||void 0===e?void 0:e.limit)},checkPathName:E})},onFirstPage:()=>u({action:"mutateTableForm",data:{...c.tableForm,offset:0},checkPathName:E}),data:d,columns:T,inboxStyles:{...g},tableStyle:{...C}}};function p(e,t){try{var a=e()}catch(e){return t(e)}return a&&a.then?a.then(void 0,t):a}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));var v=e=>null==e;const g=e=>"object"==typeof e;var C=e=>!v(e)&&!Array.isArray(e)&&g(e)&&!(e instanceof Date),b=e=>e.filter(Boolean),S=e=>void 0===e,N=function(e,t,a){void 0===e&&(e={});const l=b(t.split(/[,[\].]+?/)).reduce((e,t)=>v(e)?e:e[t],e);return S(l)||l===e?S(e[t])?a:e[t]:l},f=e=>"function"==typeof e;const h=t.createContext(null);h.displayName="RHFContext";const y=e=>{const{as:a,render:l}=e,n=function(e,t){var a={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&t.indexOf(l)<0&&(a[l]=e[l]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(l=Object.getOwnPropertySymbols(e);n<l.length;n++)t.indexOf(l[n])<0&&Object.prototype.propertyIsEnumerable.call(e,l[n])&&(a[l[n]]=e[l[n]])}return a}(e,["rules","as","render","defaultValue","control","onFocus"]),{field:r,meta:o}=function(e){let{name:a,rules:l,defaultValue:n,control:r,onFocus:o}=e;const i=t.useContext(h);if("production"!==process.env.NODE_ENV&&!r&&!i)throw new Error("📋 Controller is missing `control` prop. https://react-hook-form.com/api#Controller");const{defaultValuesRef:s,setValue:c,register:m,unregister:d,trigger:u,mode:E,reValidateMode:{isReValidateOnBlur:p,isReValidateOnChange:y},formState:_,formStateRef:{current:{isSubmitted:x,touched:k,errors:T}},updateFormState:I,readFormStateRef:R,fieldsRef:D,fieldArrayNamesRef:A,shallowFieldsStateRef:L}=r||i.control,F=!((e,t)=>[...e].some(e=>((e,t)=>RegExp(`^${t}([|.)\\d+`.replace(/\[/g,"\\[").replace(/\]/g,"\\]")).test(e))(t,e)))(A.current,a),w=()=>!S(N(L.current,a))&&F?N(L.current,a):S(n)?N(s.current,a):n,[O,K]=t.useState(w()),M=t.useRef(O),Y=t.useRef({focus:()=>null}),P=t.useRef(o||(()=>{f(Y.current.focus)&&Y.current.focus(),"production"!==process.env.NODE_ENV&&(f(Y.current.focus)||console.warn("📋 'ref' from Controller render prop must be attached to a React component or a DOM Element whose ref provides a 'focus()' method"))})),B=t.useCallback(e=>!(e=>{let{isOnBlur:t,isOnChange:a,isOnTouch:l,isTouched:n,isReValidateOnBlur:r,isReValidateOnChange:o,isBlurEvent:i,isSubmitted:s,isOnAll:c}=e;return!c&&(!s&&l?!(n||i):(s?r:t)?!i:!(s?o:a)||i)})(Object.assign({isBlurEvent:e,isReValidateOnBlur:p,isReValidateOnChange:y,isSubmitted:x,isTouched:!!N(k,a)},E)),[p,y,x,k,a,E]),z=t.useCallback(e=>{let[t]=e;const a=(e=>{return v(t=e)||!g(t)||!C(e.target)||C(e.target)&&!e.type?e:S(e.target.value)?e.target.checked:e.target.value;var t})(t);return K(a),M.current=a,a},[]),U=t.useCallback(e=>{if("production"!==process.env.NODE_ENV&&!a)return console.warn("📋 Field is missing `name` prop. https://react-hook-form.com/api#Controller");D.current[a]?D.current[a]=Object.assign({ref:D.current[a].ref},l):(m(Object.defineProperties({name:a,focus:P.current},{value:{set(e){K(e),M.current=e},get:()=>M.current}}),l),e=S(N(s.current,a))),e&&F&&K(w())},[l,a,m]);t.useEffect(()=>()=>d(a),[a]),t.useEffect(()=>{"production"!==process.env.NODE_ENV&&(S(O)&&console.warn(`📋 ${a} is missing in the 'defaultValue' prop of either its Controller (https://react-hook-form.com/api#Controller) or useForm (https://react-hook-form.com/api#useForm)`),!F&&S(n)&&console.warn("📋 Controller is missing `defaultValue` prop when using `useFieldArray`. https://react-hook-form.com/api#Controller")),U()},[U]),t.useEffect(()=>{!D.current[a]&&U(!0)});const H=t.useCallback(()=>{R.current.touched&&!N(k,a)&&(function(e,t,a){let l=-1;const n=(e=>/^\w*$/.test(e))(t)?[t]:b(t.replace(/["|']/g,"").replace(/\[/g,".").replace(/\]/g,"").split(".")),r=n.length,o=r-1;for(;++l<r;){const t=n[l];let a=!0;if(l!==o){const r=e[t];a=C(r)||Array.isArray(r)?r:isNaN(+n[l+1])?{}:[]}e[t]=a,e=e[t]}}(k,a),I({touched:k})),B(!0)&&u(a)},[a,I,B,u,R]);return{field:{onChange:t.useCallback(function(){for(var e=arguments.length,t=new Array(e),l=0;l<e;l++)t[l]=arguments[l];return c(a,z(t),{shouldValidate:B(),shouldDirty:!0})},[c,a,B]),onBlur:H,name:a,value:O,ref:Y},meta:Object.defineProperties({invalid:!!N(T,a)},{isDirty:{get:()=>!!N(_.dirtyFields,a)},isTouched:{get:()=>!!N(_.touched,a)}})}}(e),i=Object.assign(Object.assign({},n),r);return a?t.isValidElement(a)?t.cloneElement(a,i):t.createElement(a,i):l?l(r,o):null},_=e=>{let{searchFormState:t,controlSearchForm:n}=e;const{t:o}=l.useTranslation(),{errors:i}=t;return a.createElement(a.Fragment,null,a.createElement("span",{className:"mobile-input"},a.createElement(r.Label,{className:"flex-roww flex-gap-2"},o("EKYC_K_NUMBER")||"K Number",a.createElement(r.CustomTooltip,{message:o("EKYC_K_NUMBER_MESSAGE")})),a.createElement(y,{name:"kNumber",control:n,defaultValue:"",rules:{pattern:{value:/^[a-zA-Z0-9-_/]*$/,message:o("ERR_INVALID_APPLICATION_NO")}},render:e=>{let{onChange:t,value:l}=e;return a.createElement(r.TextInput,{value:l||"",onChange:e=>t(e.target.value)})}}),(null==i?void 0:i.kNumber)&&a.createElement(r.CardLabelError,null,i.kNumber.message)))},x=e=>{var l,o,i,s,c;let{parentRoute:m,businessService:d="EKYC",initialStates:p={}}=e;const v=Digit.ULBService.getCurrentTenantId(),g=n.useLocation(),[C,b]=t.useReducer(function(e,t){const a=t.checkPathName?"EKYC.INBOX":"EKYC.SW.INBOX";switch(t.action){case"mutateSearchForm":return Digit.SessionStorage.set(a,{...e,searchForm:t.data}),{...e,searchForm:t.data};case"mutateFilterForm":return Digit.SessionStorage.set(a,{...e,filterForm:t.data}),{...e,filterForm:t.data};case"mutateTableForm":return Digit.SessionStorage.set(a,{...e,tableForm:t.data}),{...e,tableForm:t.data};default:return e}},{filterForm:{},searchForm:{},tableForm:{limit:10,offset:0,sortBy:"createdTime",sortOrder:"DESC"}}),S=t.useMemo(()=>{var e,t;return{tenantId:v,offset:(null==C||null===(e=C.tableForm)||void 0===e?void 0:e.offset)||0,limit:(null==C||null===(t=C.tableForm)||void 0===t?void 0:t.limit)||10,search:(null==C?void 0:C.searchForm)||{}}},[v,null==C||null===(l=C.tableForm)||void 0===l?void 0:l.offset,null==C||null===(o=C.tableForm)||void 0===o?void 0:o.limit,null==C?void 0:C.searchForm]),{isLoading:N,data:f={}}=Digit.Hooks.ekyc.useEkycSurveyorDashboard({},S,{enabled:!!v,keepPreviousData:!0}),h=t.useMemo(()=>{var e,t;return{kno:(null==C||null===(e=C.searchForm)||void 0===e?void 0:e.kNumber)||"",name:(null==C||null===(t=C.searchForm)||void 0===t?void 0:t.kName)||""}},[null==C||null===(i=C.searchForm)||void 0===i?void 0:i.kNumber,null==C||null===(s=C.searchForm)||void 0===s?void 0:s.kName]),y=!(!h.kno&&!h.name),{isLoading:x,data:k}=Digit.Hooks.ekyc.useSearchConnection({tenantId:v,details:h},{enabled:!!v&&!!h.kno,keepPreviousData:!0}),T=t.useMemo(()=>{var e;return y?k?[k]:[]:(null==f||null===(e=f.dashboardInfo)||void 0===e?void 0:e.consumerList)||[]},[y,k,f]),I=t.useMemo(()=>(T||[]).map(e=>{var t,a,l,n,r,o;return e.connectionDetails?{applicationNo:(null===(t=e.propertyInfo)||void 0===t?void 0:t.kno)||"",connectionNo:(null===(a=e.propertyInfo)||void 0===a?void 0:a.kno)||"",owner:(null===(l=e.connectionDetails)||void 0===l?void 0:l.consumerName)||"",applicationNumber:(null===(n=e.propertyInfo)||void 0===n?void 0:n.kno)||"",citizenName:(null===(r=e.connectionDetails)||void 0===r?void 0:r.consumerName)||"",status:(null===(o=e.connectionDetails)||void 0===o?void 0:o.statusflag)||"",sla:0}:{...e,applicationNo:e.kno||e.applicationNumber||"",connectionNo:e.connectionNo||"",owner:e.consumerName||e.citizenName||"",applicationNumber:e.kno||e.applicationNumber||"",citizenName:e.consumerName||e.citizenName||"",status:e.status||"",sla:e.sla??0}}),[T]),R=(null==f||null===(c=f.dashboardInfo)||void 0===c?void 0:c.totalRecords)||(null==f?void 0:f.totalCount)||0,D=g.pathname.includes("ekyc/inbox"),A={headerText:D?"MODULE_WATER":"MODULE_SW"},L=t.useCallback(e=>{let{registerRef:t,searchFormState:l,controlSearchForm:n}=e;return a.createElement(_,{registerRef:t,searchFormState:l,controlSearchForm:n,className:"search"})},[]),F={sortBy:"createdTime",limit:window.Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"DESC"},w={mobileNumber:"",applicationNumber:"",consumerNo:""},O={SearchFormFields:L,onSearchFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),b({action:"mutateTableForm",data:{...F},checkPathName:D}),b({action:"mutateSearchForm",data:e,checkPathName:D})},searchFormDefaultValues:null==C?void 0:C.searchForm,resetSearchFormDefaultValues:w,onSearchFormReset:e=>{e("mobileNumber",null),e("applicationNumber",null),e("consumerNo",null),b({action:"mutateSearchForm",data:w})},className:"search-form-wns-inbox"},K={FilterFormFields:t.useCallback(e=>a.createElement(a.Fragment,null),[]),onFilterFormSubmit:()=>{},filterFormDefaultValues:"",resetFilterFormDefaultValues:"",onFilterFormReset:()=>{}},M=E({parentRoute:m,onPageSizeChange:e=>{const t=Number(e.target.value);b({action:"mutateTableForm",data:{...C.tableForm,limit:t,offset:0},checkPathName:D})},formState:C,totalCount:R,table:I,dispatch:b,onSortingByData:e=>{if(e.length>0){const[{id:t,desc:a}]=e,l=a?"DESC":"ASC";C.tableForm.sortBy===t&&C.tableForm.sortOrder===l||b({action:"mutateTableForm",data:{...C.tableForm,sortBy:t,sortOrder:a?"DESC":"ASC"},checkPathName:D})}},tenantId:v,checkPathName:D,inboxStyles:{overflowX:"scroll",overflowY:"hidden"},tableStyle:{width:"70%"}});return a.createElement("div",{className:"app-container"},a.createElement(r.InboxComposer,u({isInboxLoading:N||x,PropsForInboxLinks:A},O,K,{propsForInboxTable:M,formState:C})))},k=e=>{let{size:t=18,color:l="currentColor"}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:l,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),a.createElement("circle",{cx:"12",cy:"7",r:"4"}))},T=e=>{let{size:t=18,color:l="currentColor"}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:l,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M4 19.5A2.5 2.5 0 0 1 6.5 17H20"}),a.createElement("path",{d:"M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"}))},I=e=>{let{size:t=14}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("polyline",{points:"3 6 5 6 21 6"}),a.createElement("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}))},R=e=>{let{size:t=14}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),a.createElement("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"}))},D=e=>{let{size:t=12}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"}),a.createElement("circle",{cx:"12",cy:"10",r:"3"}))},A=e=>{let{size:t=16}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),a.createElement("line",{x1:"5",y1:"12",x2:"19",y2:"12"}))},L=e=>{let{size:t=16}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"}),a.createElement("polyline",{points:"17 21 17 13 7 13 7 21"}),a.createElement("polyline",{points:"7 3 7 8 15 8"}))},F=e=>{let{size:t=16}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("polyline",{points:"20 6 9 17 4 12"}))},w=e=>{let{size:t=16}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))},O=[{name:"Amit Kumar",id:"SVR001",role:"Surveyor"},{name:"Sanjay Singh",id:"SVR002",role:"Surveyor"},{name:"Rahul Sharma",id:"SVR003",role:"Surveyor"},{name:"Priya Verma",id:"SVR004",role:"Surveyor"}],K=[{name:"MRD - 01 (Central Zone)",code:"MRD01",zone:"Central"},{name:"MRD - 02 (North Zone)",code:"MRD02",zone:"North"},{name:"MRD - 03 (South Zone)",code:"MRD03",zone:"South"},{name:"MRD - 04 (West Zone)",code:"MRD04",zone:"West"},{name:"MRD - 05 (East Zone)",code:"MRD05",zone:"East"},{name:"MRD - 06 (Rohini)",code:"MRD06",zone:"Rohini"},{name:"MRD - 07 (Dwarka)",code:"MRD07",zone:"Dwarka"}],M=e=>{let{mapping:t,onConfirm:l,onCancel:n}=e;return a.createElement("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.35)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3}},a.createElement("div",{style:{background:"#fff",borderRadius:"12px",padding:"28px 28px 24px",width:"400px",boxShadow:"0 20px 60px rgba(0,0,0,0.15)"}},a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"16px"}},a.createElement("div",{style:{width:"40px",height:"40px",borderRadius:"50%",background:"#FEF3F2",display:"flex",alignItems:"center",justifyContent:"center"}},a.createElement(I,{size:18})),a.createElement("div",null,a.createElement("div",{style:{fontWeight:"700",fontSize:"16px",color:"#0D1B2A"}},"Remove Mapping"),a.createElement("div",{style:{fontSize:"12px",color:"#6B7B8E"}},"This action cannot be undone"))),a.createElement("p",{style:{fontSize:"13px",color:"#344054",marginBottom:"24px",lineHeight:"1.6"}},"Are you sure you want to remove the mapping between"," ",a.createElement("strong",null,null==t?void 0:t.surveyorName)," and ",a.createElement("strong",null,null==t?void 0:t.mrdName),"?"),a.createElement("div",{style:{display:"flex",gap:"10px",justifyContent:"flex-end"}},a.createElement("button",{onClick:n,style:{background:"none",border:"1px solid #D0D5DD",borderRadius:"8px",padding:"8px 20px",fontWeight:"600",fontSize:"13px",color:"#344054",cursor:"pointer"}},"Cancel"),a.createElement("button",{onClick:l,style:{background:"#B42318",border:"none",borderRadius:"8px",padding:"8px 20px",fontWeight:"600",fontSize:"13px",color:"#fff",cursor:"pointer",display:"flex",alignItems:"center",gap:"6px"}},a.createElement(I,{size:13})," Remove"))))},Y=()=>{const{t:e}=l.useTranslation(),[n,o]=t.useState(null),[i,s]=t.useState(null),[c,m]=t.useState([]),[d,u]=t.useState(null),[E,p]=t.useState(null),[v,g]=t.useState(null),[C,b]=t.useState(null),[S,N]=t.useState(null),f=()=>{u(null),p(null),g(null)},h=t.useMemo(()=>[{Header:e("EKYC_SURVEYOR_NAME")||"Surveyor",accessor:"surveyorName",Cell:t=>{let{row:l}=t;return d===l.original.id?a.createElement("div",{style:{minWidth:"180px"}},a.createElement(r.Dropdown,{selected:E,select:p,option:O,optionKey:"name",t:e,placeholder:"Choose surveyor..."})):a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px"}},a.createElement("div",{style:{width:"32px",height:"32px",borderRadius:"50%",background:"#EEF4FB",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},a.createElement(k,{size:15,color:"#3A7BD5"})),a.createElement("div",null,a.createElement("div",{style:{fontWeight:"600",fontSize:"13px",color:"#0D1B2A"}},l.original.surveyorName),a.createElement("div",{style:{fontSize:"11px",color:"#6B7B8E"}},"ID: ",l.original.surveyorId)))}},{Header:e("EKYC_MRD_ASSIGNED")||"MRD Assigned",accessor:"mrdName",Cell:t=>{let{row:l}=t;return d===l.original.id?a.createElement("div",{style:{minWidth:"200px"}},a.createElement(r.Dropdown,{selected:v,select:g,option:K,optionKey:"name",t:e,placeholder:"Choose MRD..."})):a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px"}},a.createElement("div",{style:{width:"32px",height:"32px",borderRadius:"50%",background:"#EEF4FB",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},a.createElement(T,{size:15,color:"#3A7BD5"})),a.createElement("div",null,a.createElement("div",{style:{fontWeight:"600",fontSize:"13px",color:"#0D1B2A"}},l.original.mrdName),a.createElement("div",{style:{fontSize:"11px",color:"#3A7BD5",display:"flex",alignItems:"center",gap:"3px"}},a.createElement(D,{size:10})," ",l.original.zone)))}},{Header:e("ES_COMMON_ACTION")||"Actions",Cell:e=>{let{row:t}=e;return d===t.original.id?a.createElement("div",{style:{display:"flex",gap:"8px"}},a.createElement("button",{onClick:()=>{return e=t.original.id,void(E&&v?c.some(t=>t.id!==e&&t.surveyorId===E.id&&t.mrdCode===v.code)?N({type:"warning",message:"This mapping already exists"}):(m(t=>t.map(t=>t.id!==e?t:{...t,surveyorName:E.name,surveyorId:E.id,mrdName:v.name,mrdCode:v.code,zone:v.zone})),u(null),N({type:"success",message:"Mapping updated successfully"})):N({type:"error",message:"Please select both Surveyor and MRD to save"}));var e},style:{display:"flex",alignItems:"center",gap:"5px",background:"#3A7BD5",color:"#fff",border:"none",borderRadius:"6px",padding:"6px 12px",fontWeight:"600",fontSize:"12px",cursor:"pointer"}},a.createElement(F,{size:13})," Save"),a.createElement("button",{onClick:f,style:{display:"flex",alignItems:"center",gap:"5px",background:"none",border:"1px solid #D0D5DD",borderRadius:"6px",padding:"6px 12px",fontWeight:"600",fontSize:"12px",color:"#344054",cursor:"pointer"}},a.createElement(w,{size:13})," Cancel")):a.createElement("div",{style:{display:"flex",gap:"8px"}},a.createElement("button",{onClick:()=>(e=>{u(e.id),p(O.find(t=>t.id===e.surveyorId)||null),g(K.find(t=>t.code===e.mrdCode)||null)})(t.original),style:{display:"flex",alignItems:"center",gap:"5px",background:"none",border:"1px solid #D0D5DD",borderRadius:"6px",padding:"6px 12px",color:"#344054",fontSize:"12px",fontWeight:"600",cursor:"pointer"}},a.createElement(R,{size:13})," Edit"),a.createElement("button",{onClick:()=>b(t.original),style:{display:"flex",alignItems:"center",gap:"5px",background:"none",border:"1px solid #FECDCA",borderRadius:"6px",padding:"6px 12px",color:"#B42318",fontSize:"12px",fontWeight:"600",cursor:"pointer"}},a.createElement(I,{size:13})," Remove"))}}],[d,E,v,c,e]);return a.createElement("div",{style:{background:"#F5F7FA",minHeight:"100vh",padding:"0"}},a.createElement(r.Card,{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 24px",marginBottom:"0",borderRadius:"4px"}},a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"12px"}},a.createElement("div",{style:{color:"#3A8DCC"}},a.createElement(T,{size:24})),a.createElement("div",{style:{fontWeight:"700",fontSize:"18px",color:"#0B0C0C"}},e("EKYC_SURVEYOR_MAPPING")||"Surveyor Mapping")),a.createElement("button",{onClick:()=>{N(0!==c.length?{type:"success",message:e("EKYC_MAPPINGS_SAVED_SUCCESS")||"Surveyor mappings saved successfully!"}:{type:"error",message:e("EKYC_NO_MAPPINGS_TO_SAVE")||"No mappings to save"})},disabled:0===c.length,style:{display:"flex",alignItems:"center",gap:"8px",background:0===c.length?"#D0D5DD":"#0F3460",color:"#fff",border:"none",borderRadius:"8px",padding:"10px 20px",fontWeight:"600",fontSize:"14px",cursor:0===c.length?"not-allowed":"pointer",transition:"background 0.2s"}},a.createElement(L,{size:15}),e("EKYC_SAVE_MAPPINGS")||"Save Mappings")),a.createElement("div",{style:{padding:"24px 32px"}},a.createElement("p",{style:{fontSize:"13px",color:"#6B7B8E",marginBottom:"24px",marginTop:"0"}},e("EKYC_MAPPING_SUBHEADER")||"Assign Meter Reading Dairies to surveyors to manage their data access."),a.createElement("div",{style:{display:"grid",gridTemplateColumns:"360px 1fr",gap:"20px",alignItems:"start"}},a.createElement("div",{style:{background:"#fff",borderRadius:"12px",border:"1px solid #E5E9EF",overflow:"hidden"}},a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px",padding:"16px 20px",borderBottom:"1px solid #F0F2F5",background:"#FAFBFC"}},a.createElement("div",{style:{width:"32px",height:"32px",borderRadius:"8px",background:"#EEF4FB",display:"flex",alignItems:"center",justifyContent:"center"}},a.createElement(T,{size:16,color:"#3A7BD5"})),a.createElement("span",{style:{fontWeight:"700",fontSize:"15px",color:"#0D1B2A"}},e("EKYC_NEW_MAPPING")||"New Mapping")),a.createElement("div",{style:{padding:"20px"}},a.createElement("div",{style:{marginBottom:"16px"}},a.createElement("label",{style:{display:"flex",alignItems:"center",gap:"6px",fontSize:"11px",fontWeight:"700",letterSpacing:"0.06em",color:"#3A7BD5",textTransform:"uppercase",marginBottom:"8px"}},a.createElement(k,{size:12,color:"#3A7BD5"}),e("EKYC_SELECT_SURVEYOR")||"Select Surveyor"),a.createElement(r.Dropdown,{selected:n,select:o,option:O,optionKey:"name",t:e,placeholder:e("EKYC_SELECT_SURVEYOR_PLACEHOLDER")||"Choose a surveyor..."})),a.createElement("div",{style:{marginBottom:"16px"}},a.createElement("label",{style:{display:"flex",alignItems:"center",gap:"6px",fontSize:"11px",fontWeight:"700",letterSpacing:"0.06em",color:"#3A7BD5",textTransform:"uppercase",marginBottom:"8px"}},a.createElement(T,{size:12,color:"#3A7BD5"}),e("EKYC_SELECT_MRD")||"Select MRD"),a.createElement(r.Dropdown,{selected:i,select:s,option:K,optionKey:"name",t:e,placeholder:e("EKYC_SELECT_MRD_PLACEHOLDER")||"Choose an MRD..."})),i&&a.createElement("div",{style:{background:"#EEF4FB",borderLeft:"3px solid #3A7BD5",borderRadius:"6px",padding:"10px 14px",fontSize:"12px",color:"#0D1B2A",marginBottom:"16px",display:"flex",alignItems:"center",gap:"8px"}},a.createElement(D,{size:13}),a.createElement("span",null,a.createElement("strong",null,i.name)," — ",i.zone," Zone")),n&&a.createElement("div",{style:{background:"#F5F7FA",borderLeft:"3px solid #6B7B8E",borderRadius:"6px",padding:"10px 14px",fontSize:"12px",color:"#0D1B2A",marginBottom:"16px",display:"flex",alignItems:"center",gap:"8px"}},a.createElement(k,{size:13,color:"#6B7B8E"}),a.createElement("span",null,a.createElement("strong",null,n.name)," — ",n.id)),a.createElement("button",{onClick:()=>{n&&i?c.some(e=>e.surveyorId===n.id&&e.mrdCode===i.code)?N({type:"warning",message:e("EKYC_MAPPING_EXISTS")||"This mapping already exists"}):(m(e=>[...e,{id:Date.now(),surveyorName:n.name,surveyorId:n.id,mrdName:i.name,mrdCode:i.code,zone:i.zone}]),s(null),N({type:"success",message:e("EKYC_MAPPING_ADDED")||"Mapping added successfully"})):N({type:"error",message:e("EKYC_SELECT_BOTH_ERROR")||"Please select both Surveyor and MRD"})},disabled:!n||!i,style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",background:n&&i?"#3A7BD5":"#D0D5DD",color:"#fff",border:"none",borderRadius:"8px",padding:"12px",fontWeight:"600",fontSize:"14px",cursor:n&&i?"pointer":"not-allowed",marginTop:"4px",transition:"background 0.2s"}},a.createElement(A,{size:16}),e("EKYC_ADD_TO_LIST")||"Add to Mapping List")),c.length>0&&a.createElement("div",{style:{padding:"12px 20px",borderTop:"1px solid #F0F2F5",background:"#FAFBFC",display:"flex",gap:"16px"}},a.createElement("div",{style:{textAlign:"center",flex:1}},a.createElement("div",{style:{fontSize:"20px",fontWeight:"700",color:"#0F3460"}},c.length),a.createElement("div",{style:{fontSize:"11px",color:"#6B7B8E"}},"Total Mappings")),a.createElement("div",{style:{width:"1px",background:"#E5E9EF"}}),a.createElement("div",{style:{textAlign:"center",flex:1}},a.createElement("div",{style:{fontSize:"20px",fontWeight:"700",color:"#0F3460"}},[...new Set(c.map(e=>e.surveyorId))].length),a.createElement("div",{style:{fontSize:"11px",color:"#6B7B8E"}},"Surveyors")),a.createElement("div",{style:{width:"1px",background:"#E5E9EF"}}),a.createElement("div",{style:{textAlign:"center",flex:1}},a.createElement("div",{style:{fontSize:"20px",fontWeight:"700",color:"#0F3460"}},[...new Set(c.map(e=>e.mrdCode))].length),a.createElement("div",{style:{fontSize:"11px",color:"#6B7B8E"}},"MRDs")))),a.createElement("div",{style:{background:"#fff",borderRadius:"12px",border:"1px solid #E5E9EF",overflow:"hidden",minHeight:"420px"}},a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid #F0F2F5",background:"#FAFBFC"}},a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px"}},a.createElement("div",{style:{width:"32px",height:"32px",borderRadius:"8px",background:"#EEF4FB",display:"flex",alignItems:"center",justifyContent:"center"}},a.createElement(k,{size:16,color:"#3A7BD5"})),a.createElement("span",{style:{fontWeight:"700",fontSize:"15px",color:"#0D1B2A"}},e("EKYC_MAPPING_SUMMARY")||"Mapping Summary")),a.createElement("span",{style:{background:c.length>0?"#0F3460":"#E5E9EF",color:c.length>0?"#fff":"#6B7B8E",fontSize:"12px",fontWeight:"700",padding:"3px 10px",borderRadius:"20px"}},c.length," ",e("EKYC_ITEMS")||"items")),a.createElement("div",{style:{padding:"20px"}},c.length>0?a.createElement("div",{style:{border:"1px solid #E5E9EF",borderRadius:"8px",overflow:"hidden"}},a.createElement(r.Table,{t:e,data:c,columns:h,getCellProps:()=>({}),tableClassName:"digit-table"})):a.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"320px",textAlign:"center"}},a.createElement("div",{style:{marginBottom:"16px",opacity:.2}},a.createElement(T,{size:56,color:"#0F3460"})),a.createElement("div",{style:{fontSize:"15px",fontWeight:"700",color:"#0D1B2A",marginBottom:"6px"}},e("EKYC_NO_MAPPINGS")||"No Mappings Created Yet"),a.createElement("div",{style:{fontSize:"13px",color:"#6B7B8E"}},e("EKYC_NO_MAPPINGS_HINT")||"Select a surveyor and MRD on the left to get started.")))))),C&&a.createElement(M,{mapping:C,onConfirm:()=>{m(e=>e.filter(e=>e.id!==C.id)),b(null),N({type:"info",message:e("EKYC_MAPPING_REMOVED")||"Mapping removed"})},onCancel:()=>b(null)}),S&&a.createElement(r.Toast,{label:S.message,error:"error"===S.type,warning:"warning"===S.type,isDsc:!0,onClose:()=>N(null)}))},P=e=>{let{kNumber:o,kName:i,connectionDetails:s,isLoading:c}=e;const{t:m}=l.useTranslation(),d=n.useHistory(),{path:u}=n.useRouteMatch(),[E,p]=t.useState(!1),[v,g]=t.useState({code:"SELF",name:"EKYC_SELF"});if(c)return a.createElement(r.Loader,null);if(!s)return null;const C=(null==s?void 0:s.connectionDetails)||{},b=C.statusflag||"",S="active"===(null==b?void 0:b.toLowerCase())||"A"===b;return a.createElement(a.Fragment,null,a.createElement("div",{className:"ekyc-employee-container"},a.createElement("div",{className:"connection-details-card"},a.createElement("div",{className:"details-card-header"},a.createElement("div",{className:"header-title-wrapper"},a.createElement("div",{className:"header-icon-bg"},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#3A7BD5",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),a.createElement("circle",{cx:"12",cy:"7",r:"4"}))),a.createElement("span",{className:"header-title-text"},m("EKYC_K_NUMBER_DETAILS")||"Consumer Identity Details")),a.createElement("span",{className:"status-badge "+(S?"active":"inactive")},S?m("EKYC_ACTIVE_CONNECTION")||"Active Connection":b||m("CS_NA"))),a.createElement("div",{className:"details-card-body"},a.createElement("div",{className:"body-content-row"},a.createElement("div",{className:"detail-section"},a.createElement("div",{className:"section-title"},m("EKYC_VERIFICATION_PARAMETERS")||"Verification Parameters"),a.createElement("div",{className:"data-grid"},a.createElement("div",{className:"data-item"},a.createElement("div",{className:"data-label"},m("EKYC_CONSUMER_NAME")||"Consumer Name"),a.createElement("div",{className:"data-value"},C.consumerName||i||m("CS_NA"))),a.createElement("div",{className:"data-item"},a.createElement("div",{className:"data-label"},m("EKYC_K_NUMBER")||"K Number"),a.createElement("div",{className:"data-value blue"},o||m("CS_NA"))),a.createElement("div",{className:"data-item"},a.createElement("div",{className:"data-label"},m("EKYC_METER_NO")||"Meter Serial No."),a.createElement("div",{className:"data-value"},C.meterNumber||m("CS_NA"))),a.createElement("div",{className:"data-item"},a.createElement("div",{className:"data-label"},m("EKYC_CONNECTION_TYPE")||"Connection Type"),a.createElement("div",{className:"data-value"},C.connectionType||m("CS_NA"))))),a.createElement("div",{className:"vertical-divider"}),a.createElement("div",{className:"detail-section"},a.createElement("div",{className:"section-title"},m("EKYC_ADDRESS_AND_CONTACT")||"Address & Contact"),a.createElement("div",{className:"address-block"},a.createElement("div",{className:"icon-wrapper-small"},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#6B7B8E",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M21 10c0 7-9 13-9 13S3 17 3 10a9 9 0 0 1 18 0z"}),a.createElement("circle",{cx:"12",cy:"10",r:"3"}))),a.createElement("div",null,a.createElement("div",{className:"data-label"},m("EKYC_ADDRESS")||"Service Address"),a.createElement("div",{className:"address-text"},C.address||m("CS_NA")))),a.createElement("div",{className:"contact-row"},a.createElement("div",{className:"contact-item"},a.createElement("div",{className:"icon-wrapper-small"},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#6B7B8E",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("rect",{x:"5",y:"2",width:"14",height:"20",rx:"2",ry:"2"}),a.createElement("line",{x1:"12",y1:"18",x2:"12.01",y2:"18"}))),a.createElement("div",null,a.createElement("div",{className:"data-label"},m("EKYC_PHONE_NO")||"Contact"),a.createElement("div",{className:"address-text"},C.phoneNumber||m("CS_NA")))),a.createElement("div",{className:"contact-item"},a.createElement("div",{className:"icon-wrapper-small"},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#6B7B8E",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("circle",{cx:"12",cy:"12",r:"4"}),a.createElement("path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-3.92 7.94"}))),a.createElement("div",null,a.createElement("div",{className:"data-label"},m("EKYC_EMAIL")||"Email Address"),a.createElement("div",{className:"address-text"},C.email||m("CS_NA")))))))),a.createElement("div",{className:"details-card-footer"},a.createElement("div",{className:"footer-meta-text"},null!=s&&s.lastVerified?`${m("EKYC_LAST_VERIFIED")||"Last verified:"} ${s.lastVerified}`:""),a.createElement("div",{className:"action-btns-container",style:{fontSize:"12px"}},a.createElement("button",{onClick:()=>p(!0),className:"primary-action-btn",style:{fontSize:"12px"}},m("EKYC_START_REVIEW")||"Start Review",a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),a.createElement("polyline",{points:"12 5 19 12 12 19"}))))))),E&&a.createElement(r.Modal,{headerBarMain:m("EKYC_SELECT_VERIFICATION_TYPE"),headerBarEnd:a.createElement("span",{onClick:()=>p(!1),style:{cursor:"pointer",padding:"8px"}},"X"),actionSaveLabel:m("ES_COMMON_CONFIRM"),actionSaveOnSubmit:()=>{const e=u.includes("/create-kyc")?u.replace("/create-kyc",""):u.replace("/k-details","");d.push(e+"/consumer-details",{kNumber:o,selectedOption:v,connectionDetails:s}),p(!1)},actionCancelLabel:m("ES_COMMON_CANCEL"),actionCancelOnSubmit:()=>p(!1),style:{borderRadius:"12px"}},a.createElement("div",{style:{padding:"24px"}},a.createElement(r.RadioButtons,{name:"verificationType",options:[{code:"SELF",name:"EKYC_SELF"},{code:"OTHER",name:"EKYC_OTHER"}],optionsKey:"name",selectedOption:v,onSelect:g,style:{display:"flex",flexDirection:"column",gap:"12px",buttonStyle:{borderRadius:"5px"}},t:m}))))},B=()=>{const{t:e}=l.useTranslation(),[n,o]=t.useState(()=>{const e=sessionStorage.getItem("EKYC_CREATE_SEARCH_PARAMS");return e?JSON.parse(e):{kNumber:"",kName:""}}),[i,s]=t.useState(()=>"true"===sessionStorage.getItem("EKYC_CREATE_SEARCH_PERFORMED")),[c,d]=t.useState(null),[u,E,p]=Digit.Hooks.useSessionStorage("EKYC_CREATE",{}),v=Digit.ULBService.getCurrentTenantId(),{isLoading:g,data:C}=Digit.Hooks.ekyc.useSearchConnection({tenantId:v,details:{kno:n.kNumber,name:n.kName}},{enabled:i&&!!n.kNumber&&!!n.kName,onError:t=>{var a,l,n,r;d({error:!0,label:(null==t||null===(a=t.response)||void 0===a||null===(l=a.data)||void 0===l||null===(n=l.Errors)||void 0===n||null===(r=n[0])||void 0===r?void 0:r.message)||e("EKYC_SEARCH_ERROR_PLEASE_ENTER_THE_CORRECT_CREDENTIALS")}),s(!1),sessionStorage.removeItem("EKYC_CREATE_SEARCH_PERFORMED")}});return a.createElement(m,{onSearch:t=>{if(!t.kNumber&&!t.kName)return o({kNumber:"",kName:""}),s(!1),sessionStorage.removeItem("EKYC_CREATE_SEARCH_PARAMS"),sessionStorage.removeItem("EKYC_CREATE_SEARCH_PERFORMED"),void p();t.kNumber&&t.kName?(o(t),s(!0),sessionStorage.getItem("EKYC_K_NUMBER")!==t.kNumber&&(p(),Object.keys(sessionStorage).forEach(e=>{e.startsWith("EKYC_")&&"EKYC_CREATE"!==e&&sessionStorage.removeItem(e)})),sessionStorage.setItem("EKYC_CREATE_SEARCH_PARAMS",JSON.stringify(t)),sessionStorage.setItem("EKYC_CREATE_SEARCH_PERFORMED","true"),sessionStorage.setItem("EKYC_K_NUMBER",t.kNumber)):d({error:!0,label:e("EKYC_FILL_ALL_FIELDS")})},searchParams:n},i&&a.createElement(P,{kNumber:n.kNumber,kName:n.kName,connectionDetails:C,isLoading:g}),!i&&!g&&a.createElement(r.Card,{style:{textAlign:"center",padding:"40px"}},a.createElement("div",{style:{color:"#667085"}},e("EKYC_SEARCH_TO_VIEW_DETAILS"))),c&&a.createElement(r.Toast,{error:c.error,label:c.label,onClose:()=>{d(null)},isDsc:!0}))},z=e=>{let{jumpTo:t,state:o}=e;l.useTranslation();const i=n.useHistory();return a.createElement(r.LinkButton,{label:a.createElement(r.EditIcon,{style:{marginTop:"-30px",float:"right",position:"relative",bottom:"32px"}}),className:"check-page-link-button",onClick:function(){i.push(t,{...o,isEditing:!0})}})},U=e=>null!=e&&""!==e?e:"N/A",H=(e,t)=>!0===e||"true"===e||"yes"===String(e).toLowerCase()?t("CORE_COMMON_YES"):!1===e||"false"===e||"no"===String(e).toLowerCase()?t("CORE_COMMON_NO"):"N/A",V=()=>{var e,o,i,s,c,m,d;const{t:u}=l.useTranslation(),E=n.useHistory(),v=n.useLocation(),[g,C]=t.useState(!1),[b,S]=t.useState(!1),N=v.state||{},{kNumber:f,kno:h,edits:y={}}=N,_=f||h,{aadhaarData:x={},addressDetails:k={},propertyDetails:T={},meterDetails:I={}}=y,R=Digit.ULBService.getCurrentTenantId(),{data:D,isLoading:A}=Digit.Hooks.ekyc.useEkycSearchReview({kno:_,fetchType:"REVIEW"},R,{enabled:!!_}),L=((e,t)=>{const a=e&&Object.keys(e).length>0?e:(null==t?void 0:t.reviewData)||{},l=(null==a?void 0:a.applicationReview)||a,n=(Array.isArray(l)?l[0]:l)||{};return(null==n?void 0:n.newData)||n})(D,N),F=(null==L?void 0:L.connectionDetails)||L||{},w=(null==L?void 0:L.addressDetails)||L||{},O=(null==L?void 0:L.propertyInfo)||L||{},K=(null==L?void 0:L.meterDetails)||L||{},M={consumerName:(null==x?void 0:x.name)||(null==F?void 0:F.consumerName),address:(null==F?void 0:F.address)||(null==F?void 0:F.addressRaw),connectionType:(null==F?void 0:F.connectionType)||(null==F?void 0:F.connectionCategory),meterNumber:(null==F?void 0:F.meterNumber)||(null==F?void 0:F.meterNo),phoneNumber:(null==x?void 0:x.mobileNumber)||(null==F?void 0:F.phoneNumber)||(null==F?void 0:F.mobileNo),email:null==F?void 0:F.email,statusflag:(null==F?void 0:F.statusflag)||(null==F?void 0:F.statusFlag),ekycStatus:null==F?void 0:F.ekycStatus,knumber:(null==F?void 0:F.knumber)||(null==F?void 0:F.kno)||_},Y={fullAddress:(null==k?void 0:k.fullAddress)||(null==w?void 0:w.fullAddress)||(null==w?void 0:w.addressRaw),flatHouseNumber:(null==k?void 0:k.flatHouseNumber)||(null==k?void 0:k.flatNo)||(null==w?void 0:w.flatHouseNumber),buildingTower:(null==k?void 0:k.buildingTower)||(null==k?void 0:k.building)||(null==w?void 0:w.buildingTower),landmark:(null==k?void 0:k.landmark)||(null==w?void 0:w.landmark),pinCode:(null==k?void 0:k.pinCode)||(null==k?void 0:k.pincode)||(null==w?void 0:w.pinCode)||(null==w?void 0:w.pincode),ward:(null==k?void 0:k.ward)||(null==w?void 0:w.ward)||(null==w?void 0:w.locality),assembly:(null==k?void 0:k.assembly)||(null==w?void 0:w.assembly),gpsValid:void 0!==(null==k?void 0:k.gpsValid)?k.gpsValid:null==w?void 0:w.gpsValid,latitude:(null==k?void 0:k.latitude)||(null==w?void 0:w.latitude),longitude:(null==k?void 0:k.longitude)||(null==w?void 0:w.longitude),mobileNo:(null==k?void 0:k.mobileNo)||(null==x?void 0:x.mobileNumber)||(null==w?void 0:w.mobileNo),whatsappNo:(null==k?void 0:k.whatsappNo)||(null==x?void 0:x.whatsappNumber)||(null==w?void 0:w.whatsappNo),email:(null==k?void 0:k.email)||(null==w?void 0:w.email),noOfPerson:(null==k?void 0:k.noOfPerson)||(null==x?void 0:x.noOfPersons)||(null==w?void 0:w.noOfPerson),knumber:(null==k?void 0:k.knumber)||(null==w?void 0:w.knumber)||(null==w?void 0:w.kno)||_,doorPhotoFilestoreId:(null==k?void 0:k.doorPhotoFileStoreId)||(null==w?void 0:w.doorPhotoFilestoreId)},P={kno:(null==O?void 0:O.kno)||_,pidNumber:(null==T?void 0:T.pidNumber)||(null==O?void 0:O.pidNumber),typeOfConnection:(null==T||null===(e=T.connectionTypeData)||void 0===e?void 0:e.label)||(null==O?void 0:O.typeOfConnection),connectionCategory:(null==T||null===(o=T.connectionCategoryData)||void 0===o?void 0:o.label)||(null==O?void 0:O.connectionCategory),userType:(null==T||null===(i=T.userTypeData)||void 0===i?void 0:i.label)||(null==O?void 0:O.userType),numberOfFloors:(null==T||null===(s=T.noOfFloorsData)||void 0===s?void 0:s.label)||(null==O?void 0:O.numberOfFloors),tenantName:null==O?void 0:O.tenantName,tenantMobile:null==O?void 0:O.tenantMobile,ekycStatus:null==O?void 0:O.ekycStatus,propertyDocumentFileStoreId:(null==T?void 0:T.propertyDocumentFileStoreId)||(null==O?void 0:O.propertyDocumentFileStoreId),buildingImageFileStoreId:null==O?void 0:O.buildingImageFileStoreId},B={kno:(null==I?void 0:I.kno)||(null==K?void 0:K.kno)||_,metered:"Metered"===(null==I||null===(c=I.meterStatusData)||void 0===c?void 0:c.value)||(null==K?void 0:K.metered),meterNumber:(null==K?void 0:K.meterNumber)||(null==K?void 0:K.meterNo),meterMake:(null==I?void 0:I.meterMake)||(null==K?void 0:K.meterMake),meterLocationAddress:(null==I?void 0:I.meterLocation)||(null==K?void 0:K.meterLocationAddress),meterLatitude:null==K?void 0:K.meterLatitude,meterLongitude:null==K?void 0:K.meterLongitude,workingStatus:"Working"===(null==I||null===(m=I.workingStatusData)||void 0===m?void 0:m.value)||(null==K?void 0:K.workingStatus),lastBillRaised:"Yes"===(null==I||null===(d=I.lastBillRaisedData)||void 0===d?void 0:d.value)||(null==K?void 0:K.lastBillRaised),systemMeterId:null==K?void 0:K.systemMeterId,meterPhotoFileStoreId:(null==I?void 0:I.meterPhotoFileStoreId)||(null==K?void 0:K.meterPhotoFileStoreId)};if(A||b)return a.createElement(r.Loader,null);const V="/digit-ui/employee/ekyc";return a.createElement("div",{className:"review-container"},a.createElement(r.Card,null,a.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"20px"}},a.createElement(r.CardHeader,{style:{margin:0}},u("EKYC_REVIEW_APPLICATION")),a.createElement("div",{style:{background:"#F9FAFB",border:"0.5px solid #EAECF0",borderRadius:"20px",padding:"4px 14px",fontSize:"12px",color:"#667085"}},u("EKYC_K_NUMBER"),": ",a.createElement("span",{style:{color:"#0B0C0C",fontWeight:"600"}},_))),a.createElement(r.CardSubHeader,null,u("EKYC_CONNECTION_DETAILS")),a.createElement(r.StatusTable,{style:{marginTop:"20px",marginBottom:"30px"}},a.createElement(r.Row,{label:u("EKYC_K_NUMBER"),text:U(M.knumber)}),a.createElement(r.Row,{label:u("EKYC_CONSUMER_NAME"),text:U(M.consumerName)}),a.createElement(r.Row,{label:u("EKYC_ADDRESS"),text:U(M.address)}),a.createElement(r.Row,{label:u("EKYC_CONNECTION_TYPE"),text:U(M.connectionType)}),a.createElement(r.Row,{label:u("EKYC_METER_NO"),text:U(M.meterNumber)}),a.createElement(r.Row,{label:u("EKYC_MOBILE_NO"),text:U(M.phoneNumber)}),a.createElement(r.Row,{label:u("EKYC_EMAIL"),text:U(M.email)}),a.createElement(r.Row,{label:u("EKYC_STATUS_FLAG"),text:U(M.statusflag)}),a.createElement(r.Row,{label:u("EKYC_STATUS"),text:U(M.ekycStatus)})),a.createElement(r.CardSubHeader,null,u("EKYC_ADDRESS_DETAILS")),a.createElement(r.StatusTable,{style:{marginTop:"20px",marginBottom:"30px"}},a.createElement(r.Row,{label:u("EKYC_FULL_ADDRESS"),text:U(Y.fullAddress),actionButton:a.createElement(z,{jumpTo:V+"/address-details",state:{...N,reviewData:D,edits:y}})}),a.createElement(r.Row,{label:u("EKYC_FLAT_HOUSE_NO"),text:U(Y.flatHouseNumber)}),a.createElement(r.Row,{label:u("EKYC_BUILDING_TOWER"),text:U(Y.buildingTower)}),a.createElement(r.Row,{label:u("EKYC_LANDMARK"),text:U(Y.landmark)}),a.createElement(r.Row,{label:u("EKYC_PINCODE"),text:U(Y.pinCode)}),a.createElement(r.Row,{label:u("EKYC_LOCALITY"),text:U(Y.ward)}),a.createElement(r.Row,{label:u("EKYC_ASSEMBLY"),text:U(Y.assembly)}),a.createElement(r.Row,{label:u("EKYC_GPS_VALID"),text:H(Y.gpsValid,u)}),a.createElement(r.Row,{label:u("EKYC_LATITUDE"),text:U(Y.latitude)}),a.createElement(r.Row,{label:u("EKYC_LONGITUDE"),text:U(Y.longitude)}),a.createElement(r.Row,{label:u("EKYC_MOBILE_NO"),text:U(Y.mobileNo)}),a.createElement(r.Row,{label:u("EKYC_WHATSAPP_NO"),text:U(Y.whatsappNo)}),a.createElement(r.Row,{label:u("EKYC_EMAIL"),text:U(Y.email)}),a.createElement(r.Row,{label:u("EKYC_NO_OF_PERSONS"),text:U(Y.noOfPerson)}),a.createElement(r.Row,{label:u("EKYC_K_NUMBER"),text:U(Y.knumber)})),a.createElement(r.CardSubHeader,null,u("EKYC_PROPERTY_INFO")),a.createElement(r.StatusTable,{style:{marginTop:"20px",marginBottom:"30px"}},a.createElement(r.Row,{label:u("EKYC_CONNECTION_CATEGORY"),text:U(P.connectionCategory),actionButton:a.createElement(z,{jumpTo:V+"/property-info",state:{...N,reviewData:D,edits:y}})}),a.createElement(r.Row,{label:u("EKYC_PID_NUMBER"),text:U(P.pidNumber)}),a.createElement(r.Row,{label:u("EKYC_TYPE_OF_CONNECTION"),text:U(P.typeOfConnection)}),a.createElement(r.Row,{label:u("EKYC_USER_TYPE"),text:U(P.userType)}),a.createElement(r.Row,{label:u("EKYC_FLOOR_COUNT"),text:U(P.numberOfFloors)}),a.createElement(r.Row,{label:u("EKYC_TENANT_NAME"),text:U(P.tenantName)}),a.createElement(r.Row,{label:u("EKYC_TENANT_MOBILE"),text:U(P.tenantMobile)}),a.createElement(r.Row,{label:u("EKYC_STATUS"),text:U(P.ekycStatus)})),a.createElement(r.CardSubHeader,null,u("EKYC_METER_DETAILS")),a.createElement(r.StatusTable,{style:{marginTop:"20px",marginBottom:"30px"}},a.createElement(r.Row,{label:u("EKYC_METERED"),text:H(B.metered,u),actionButton:a.createElement(z,{jumpTo:V+"/meter-details",state:{...N,reviewData:D,edits:y}})}),a.createElement(r.Row,{label:u("EKYC_METER_NO"),text:U(B.meterNumber)}),a.createElement(r.Row,{label:u("EKYC_METER_MAKE"),text:U(B.meterMake)}),a.createElement(r.Row,{label:u("EKYC_METER_LOCATION_ADDRESS"),text:U(B.meterLocationAddress)}),a.createElement(r.Row,{label:u("EKYC_METER_LATITUDE"),text:U(B.meterLatitude)}),a.createElement(r.Row,{label:u("EKYC_METER_LONGITUDE"),text:U(B.meterLongitude)}),a.createElement(r.Row,{label:u("EKYC_WORKING_STATUS"),text:H(B.workingStatus,u)}),a.createElement(r.Row,{label:u("EKYC_LAST_BILL_RAISED"),text:H(B.lastBillRaised,u)}),a.createElement(r.Row,{label:u("EKYC_SYSTEM_METER_ID"),text:U(B.systemMeterId)})),a.createElement(r.CardSubHeader,null,u("EKYC_DOCUMENTS")),a.createElement(r.StatusTable,{style:{marginTop:"20px",marginBottom:"30px"}},a.createElement(r.Row,{label:u("EKYC_DOOR_PHOTO"),text:u(Y.doorPhotoFilestoreId?"EKYC_PHOTO_AVAILABLE":"CS_NA"),actionButton:Y.doorPhotoFilestoreId&&a.createElement(r.GenericFileIcon,{style:{cursor:"pointer"}})}),a.createElement(r.Row,{label:u("EKYC_METER_PHOTO"),text:u(B.meterPhotoFileStoreId?"EKYC_PHOTO_AVAILABLE":"CS_NA"),actionButton:B.meterPhotoFileStoreId&&a.createElement(r.GenericFileIcon,{style:{cursor:"pointer"}})}),a.createElement(r.Row,{label:u("EKYC_BUILDING_IMAGE"),text:u(P.buildingImageFileStoreId?"EKYC_PHOTO_AVAILABLE":"CS_NA"),actionButton:P.buildingImageFileStoreId&&a.createElement(r.GenericFileIcon,{style:{cursor:"pointer"}})}),a.createElement(r.Row,{label:u("EKYC_PROPERTY_DOCUMENTS"),text:u(P.propertyDocumentFileStoreId?"EKYC_DOCS_AVAILABLE":"CS_NA"),actionButton:P.propertyDocumentFileStoreId&&a.createElement(r.GenericFileIcon,{style:{cursor:"pointer"}})})),a.createElement(r.CheckBox,{id:"agreeDeclaration",name:"agreeDeclaration",label:u("EKYC_FINAL_DECLARATION"),onChange:()=>C(!g),checked:g,style:{marginTop:"20px"}})),a.createElement(r.ActionBar,{style:{position:"static",marginTop:"24px"}},a.createElement(r.SubmitBar,{label:u("EKYC_SUBMIT_APPLICATION"),onSubmit:function(){try{S(!0);const e=function(e,t){try{var a=p(function(){return Promise.resolve(Digit.EkycService.application_update({kno:_,tenantId:R,newData:{connectionDetails:M,addressDetails:Y,propertyInfo:P,meterDetails:B}},R)).then(function(e){e&&E.push("/digit-ui/employee/ekyc/response",{success:!0,result:e})})},function(e){console.error("Submit Error:",e)})}catch(e){return t(!0,e)}return a&&a.then?a.then(t.bind(null,!1),t.bind(null,!0)):t(!1,a)}(0,function(e,t){if(S(!1),e)throw t;return t});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},disabled:!g})))};var W,j=(W=a.createContext(void 0),"undefined"!=typeof window&&(window.ReactQueryClientContext=W),W);const G=e=>{let{config:l,onSelect:n}=e;const[o,i]=t.useState(""),[s,c]=t.useState(null),[m,d]=t.useState(null),[u,E]=t.useState(null),[v,g]=t.useState(""),[C,b]=t.useState(""),[S,N]=t.useState(""),[f,h]=t.useState(""),[y,_]=t.useState(null),[x,k]=t.useState(""),[T,I]=t.useState(""),[R,D]=t.useState(""),[A,L]=t.useState(""),[F,w]=t.useState(""),[O,K]=t.useState(null),[M,Y]=t.useState(null),[P,B]=t.useState(""),[z,U]=t.useState(""),[H,V]=t.useState(""),[W,j]=t.useState(""),[G,X]=t.useState(""),[$,q]=t.useState(""),[Z,Q]=t.useState(""),[J,ee]=t.useState(""),[te,ae]=t.useState(""),[le,ne]=t.useState(null),[re,oe]=t.useState(""),[ie,se]=t.useState(null),[ce,me]=t.useState(!1),[de,ue]=t.useState(!0),[Ee,pe]=t.useState(""),[ve,ge]=t.useState(""),[Ce,be]=t.useState(null);return a.createElement(t.Fragment,null,a.createElement(r.FormStep,{onSelect:()=>{o&&s&&m&&u&&C&&T&&F&&!(Number(F)<=0)&&("Tenanted"!==(null==m?void 0:m.name)||M||P)&&ce?n(l.key,{kno:o,consumerType:null==s?void 0:s.name,occupantType:null==m?void 0:m.name,categoryType:null==u?void 0:u.name,consumerName:v,firstName:C,middleName:S,lastName:f,gender:null==y?void 0:y.name,relation:x,mobile:T,whatsapp:R,email:A,residents:F,documentId:M,ownerMobile:P,tenantVerification:z,designation:H,department:W,employeeId:G,landline:$,entityRelation:Z,contactPerson:J,entityName:te,idProof:null==le?void 0:le.name,idNumber:re,consent:ce,informantIsConsumer:de,informantName:Ee,informantRelation:ve}):be({type:"error",message:"Fill required fields"})},config:l},a.createElement("div",null,a.createElement(r.CardLabel,null,"K Number *"),a.createElement(r.TextInput,{value:o,onChange:e=>i(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Consumer Type *"),a.createElement(r.Dropdown,{option:[{name:"Individual"},{name:"Govt"},{name:"Company_Society_Org"}],selected:s,select:c})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Occupant Type *"),a.createElement(r.Dropdown,{option:[{name:"Self"},{name:"Tenanted"}],selected:m,select:d})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Category Type *"),a.createElement(r.Dropdown,{option:[],selected:u,select:E})),a.createElement("div",null,a.createElement(r.CardLabel,null,"First Name *"),a.createElement(r.TextInput,{value:C,onChange:e=>b(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Middle Name"),a.createElement(r.TextInput,{value:S,onChange:e=>N(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Last Name"),a.createElement(r.TextInput,{value:f,onChange:e=>h(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Gender"),a.createElement(r.Dropdown,{option:[{name:"Male"},{name:"Female"},{name:"Others"},{name:"Not prefer to say"}],selected:y,select:_})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Mobile *"),a.createElement(r.TextInput,{value:T,onChange:e=>I(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"WhatsApp"),a.createElement(r.TextInput,{value:R,onChange:e=>D(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Email"),a.createElement(r.TextInput,{value:A,onChange:e=>L(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"No. of Residents *"),a.createElement(r.TextInput,{value:F,onChange:e=>w(e.target.value)})),"Tenanted"===(null==m?void 0:m.name)&&a.createElement(t.Fragment,null,a.createElement("div",null,a.createElement(r.CardLabel,null,"Document Proof"),a.createElement(r.UploadFile,{onUpload:e=>function(e,t,a){try{const l=e.target.files[0];if(!l)return Promise.resolve();const n=p(function(){return Promise.resolve(Digit.UploadServices.Filestorage("EKYC",l)).then(function(e){var n,r,o;const i=null==e||null===(n=e.data)||void 0===n||null===(r=n.files)||void 0===r||null===(o=r[0])||void 0===o?void 0:o.fileStoreId;i&&(t(l.name),a(i))})},function(){be({type:"error",message:"Upload failed"})});return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(e,K,Y)})),!M&&a.createElement(t.Fragment,null,a.createElement("div",null,a.createElement(r.CardLabel,null,"Owner Mobile *"),a.createElement(r.TextInput,{value:P,onChange:e=>B(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Tenant Verification"),a.createElement(r.TextInput,{value:z,onChange:e=>U(e.target.value)})))),"Govt"===(null==s?void 0:s.name)&&a.createElement(t.Fragment,null,a.createElement("div",null,a.createElement(r.CardLabel,null,"Designation"),a.createElement(r.TextInput,{value:H,onChange:e=>V(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Department"),a.createElement(r.TextInput,{value:W,onChange:e=>j(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Employee ID"),a.createElement(r.TextInput,{value:G,onChange:e=>X(e.target.value)}))),"Company_Society_Org"===(null==s?void 0:s.name)&&a.createElement(t.Fragment,null,a.createElement("div",null,a.createElement(r.CardLabel,null,"Entity Name"),a.createElement(r.TextInput,{value:te,onChange:e=>ae(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Contact Person"),a.createElement(r.TextInput,{value:J,onChange:e=>ee(e.target.value)})))))},X=[{body:[{route:"consumer-details",component:G,key:"aadhaarVerification",texts:{header:"EKYC_CONSUMER_CONNECTION",submitBarLabel:"COMMON_SAVE_NEXT"},timeLine:[{currentStep:1,actions:"EKYC_CONSUMER_CONNECTION"}]},{route:"address-details",component:"AddressDetails",key:"addressDetails",doorImage:!0,texts:{header:"EKYC_ADDRESS_DETAILS",submitBarLabel:"COMMON_SAVE_NEXT"},timeLine:[{currentStep:2,actions:"EKYC_ADDRESS_DETAILS"}]},{route:"property-info",component:"PropertyInfo",key:"propertyDetails",texts:{header:"EKYC_PROPERTY_INFO",submitBarLabel:"COMMON_SAVE_NEXT"},timeLine:[{currentStep:3,actions:"EKYC_PROPERTY_INFO"}]},{route:"meter-details",component:"MeterDetails",key:"meterDetails",texts:{header:"EKYC_METER_DETAILS",submitBarLabel:"COMMON_SAVE_NEXT"},timeLine:[{currentStep:4,actions:"EKYC_METER_DETAILS"}]}]}],$=e=>{let{path:o}=e;!function(){var e;if(!a.useContext("undefined"!=typeof window&&null!=(e=window.ReactQueryClientContext)?e:j))throw new Error("No QueryClient set, use QueryClientProvider to set one")}();const i=n.useRouteMatch(),{t:s}=l.useTranslation(),c=n.useLocation(),{pathname:m}=c,d=n.useHistory();let u=[];const[E,p,v]=Digit.Hooks.useSessionStorage("EKYC_CREATE",{});function g(e,t,a,l,n){void 0===n&&(n=!1),p({...E,[e]:{...E[e],...t}}),((e,t,a,l)=>{let n=m.split("/").pop(),r=u.find(e=>l?e.key===l:e.route===n);r||(r=u.find(e=>e.route===n));let s=null;const c=u.findIndex(e=>e.route===r.route);c>-1&&c<u.length-1&&(s=u[c+1].route);let p=d.push;e&&(p=d.replace);const v=o||i.path.split("/").slice(0,-1).join("/");if(null===s)return p(v+"/review",{...E,edits:E});p(`${v}/${s}`,{...E})})(a,0,0,e)}Digit.UserService.getUser(),Digit.ULBService.getCurrentTenantId(),t.useEffect(()=>{if(c.state&&Object.keys(c.state).length>0){const{edits:e,...t}=c.state;p({...E,...t,...e})}},[c.state]),X.forEach(e=>{u=u.concat(e.body)}),u.indexRoute="consumer-details";const C=u.map(e=>e.route),b=C.some(e=>m.includes(e)),S=t.useRef({});return t.useEffect(()=>{if(b){const e=m.split("/").pop();S.current[e]&&S.current[e].scrollIntoView({behavior:"smooth",block:"start"})}},[m,b]),a.createElement(a.Fragment,null,a.createElement("div",{className:"employee-form-section-wrapper"},a.createElement(r.VerticalTimeline,{config:u,showFinalStep:!0}),a.createElement("div",{className:"employee-form-section"},a.createElement(n.Switch,null,a.createElement(n.Route,{path:C.map(e=>`${o||i.path.split("/").slice(0,-1).join("/")}/${e}`)},a.createElement("div",{className:"single-page-form-container"},u.map((e,t)=>{const{component:l}=e,n="string"==typeof l?Digit.ComponentRegistryService.getComponent(l):l;return a.createElement("div",{key:t,ref:t=>S.current[e.route]=t,className:"form-section-unit"},a.createElement(n,{config:{...e,isCollapsible:!0,defaultOpen:!0},onSelect:g,t:s,formData:E}))}))),a.createElement(n.Route,null,a.createElement(n.Redirect,{to:`${o||i.path.split("/").slice(0,-1).join("/")}/${u.indexRoute}`}))))))},q=e=>{let{path:t}=e;const{t:o}=l.useTranslation(),i=n.useLocation();sessionStorage.removeItem("revalidateddone");const s=[{icon:r.HomeIcon,path:"/digit-ui/employee"},{label:o((()=>{const e=i.pathname;return e.includes("/dashboard")?"ES_COMMON_INBOX":e.includes("/create-kyc")?"EKYC_CREATE_KYC":e.includes("/k-details")?"EKYC_K_DETAILS":e.includes("/consumer-details")?"EKYC_CONSUMER_DETAILS":e.includes("/address-details")?"EKYC_ADDRESS_DETAILS":e.includes("/property-info")?"EKYC_PROPERTY_INFO":e.includes("/meter-details")?"EKYC_METER_DETAILS":e.includes("/review")?"EKYC_REVIEW":"ES_COMMON_INBOX"})())}];return a.createElement(r.AppContainer,null,a.createElement("div",{className:"ground-container employee-app-container form-container"},a.createElement(r.ModuleHeader,{leftContent:a.createElement(a.Fragment,null,a.createElement(r.ArrowLeft,{className:"icon"}),"Back"),onLeftClick:()=>window.history.back(),breadcrumbs:s}),a.createElement("div",{className:"employee-form"},a.createElement("div",{className:"employee-form-content"},a.createElement(n.Switch,null,a.createElement(r.PrivateRoute,{path:t+"/dashboard",component:()=>a.createElement(c,{parentRoute:t,businessService:"EKYC",moduleCode:"EKYC",isInbox:!0})}),a.createElement(r.PrivateRoute,{path:t+"/inbox",component:()=>a.createElement(x,{parentRoute:t,businessService:"EKYC",moduleCode:"EKYC",isInbox:!0})}),a.createElement(r.PrivateRoute,{path:t+"/create-kyc",component:()=>a.createElement(B,null)}),a.createElement(r.PrivateRoute,{path:t+"/mapping",component:()=>a.createElement(Y,null)}),a.createElement(r.PrivateRoute,{path:["consumer-details","address-details","property-info","meter-details"].map(e=>`${t}/${e}`),component:e=>a.createElement($,u({},e,{path:t}))}),a.createElement(r.PrivateRoute,{path:t+"/review",component:()=>a.createElement(V,null)}))))))},Z=e=>{var n,o,i,s,c;let{config:m,onSelect:d}=e;const{t:u}=l.useTranslation(),E=Digit.ULBService.getCurrentTenantId(),[v,g]=t.useState(""),[C,b]=t.useState(""),[S,N]=t.useState(""),[f,h]=t.useState(""),[y,_]=t.useState(null),[x,k]=t.useState(""),[T,I]=t.useState(null),[R,D]=t.useState(null),[A,L]=t.useState(null),[F,w]=t.useState(""),[O,K]=t.useState(""),[M,Y]=t.useState(null),[P,B]=t.useState(null),[z,U]=t.useState(null),[H,V]=t.useState(null),{data:W,isLoading:j}=Digit.Hooks.useCommonMDMS(E,"egov-location",["TenantBoundary"]),G=(null==W||null===(n=W.MdmsRes)||void 0===n||null===(o=n["egov-location"])||void 0===o||null===(i=o.TenantBoundary)||void 0===i||null===(s=i[0])||void 0===s||null===(c=s.boundary)||void 0===c?void 0:c.children)||[];return t.useEffect(()=>{let e=!0;return navigator.geolocation&&navigator.geolocation.getCurrentPosition(t=>{e&&(w(t.coords.latitude),K(t.coords.longitude))},()=>{e&&V({type:"error",message:"GPS access denied"})}),()=>{e=!1}},[]),j?a.createElement(r.Loader,null):a.createElement(t.Fragment,null,a.createElement(r.FormStep,{t:u,onSelect:()=>{v&&C&&6===x.length&&T&&R&&A&&F&&O&&z?d(m.key,{houseNo:v,street:C,locality:S,landmark:f,subLocality:y,pinCode:x,assembly:null==T?void 0:T.name,ward:null==R?void 0:R.name,zone:null==A?void 0:A.name,latitude:F,longitude:O,addressType:null==M?void 0:M.name,doorPhotoFilestoreId:z}):V({type:"error",message:"Please fill all mandatory fields"})},config:m,label:u("ES_COMMON_CONTINUE")},a.createElement(r.CardLabel,null,"House No / Flat No *"),a.createElement(r.TextInput,{value:v,onChange:e=>g(e.target.value)}),a.createElement(r.CardLabel,null,"Street / Address Line *"),a.createElement(r.TextInput,{value:C,onChange:e=>b(e.target.value)}),a.createElement(r.CardLabel,null,"Locality"),a.createElement(r.TextInput,{value:S,onChange:e=>N(e.target.value)}),a.createElement(r.CardLabel,null,"Landmark"),a.createElement(r.TextInput,{value:f,onChange:e=>h(e.target.value)}),a.createElement(r.CardLabel,null,"Sub Locality"),a.createElement(r.Dropdown,{option:[],selected:y,select:_}),a.createElement(r.CardLabel,null,"PIN Code *"),a.createElement(r.TextInput,{value:x,onChange:e=>{const t=e.target.value;/^\d{0,6}$/.test(t)&&(k(t),6===t.length&&console.log("Fetching location for PIN:",t))},maxLength:6}),a.createElement(r.CardLabel,null,"Assembly *"),a.createElement(r.Dropdown,{option:G,selected:T,select:I}),a.createElement(r.CardLabel,null,"Ward *"),a.createElement(r.Dropdown,{option:(null==T?void 0:T.children)||[],selected:R,select:D}),a.createElement(r.CardLabel,null,"Zone *"),a.createElement(r.Dropdown,{option:(null==R?void 0:R.children)||[],selected:A,select:L}),a.createElement(r.CardLabel,null,"Latitude"),a.createElement(r.TextInput,{value:F,disabled:!0}),a.createElement(r.CardLabel,null,"Longitude"),a.createElement(r.TextInput,{value:O,disabled:!0}),a.createElement(r.CardLabel,null,"Address Type"),a.createElement(r.Dropdown,{option:[{name:"Permanent"},{name:"Correspondence"},{name:"Other"}],selected:M,select:Y}),a.createElement(r.CardLabel,null,"Door Image *"),a.createElement(r.UploadFile,{onUpload:function(e){try{let a=!1;function t(e){return a?e:()=>{l=!1}}let l=!0;const n=e.target.files[0];if(!n)return Promise.resolve();if(n.size>=2e6)return V({type:"error",message:"Max size 2MB exceeded"}),Promise.resolve();const r=p(function(){return Promise.resolve(Digit.UploadServices.Filestorage("EKYC",n,E)).then(function(e){var t,r,o;if(!l)return void(a=!0);const i=null==e||null===(t=e.data)||void 0===t||null===(r=t.files)||void 0===r||null===(o=r[0])||void 0===o?void 0:o.fileStoreId;if(i){U(i);const e=new FileReader;e.onloadend=()=>{l&&B(e.result)},e.readAsDataURL(n),V({type:"success",message:"Upload successful"})}})},function(){l?V({type:"error",message:"Upload failed"}):a=!0});return Promise.resolve(r&&r.then?r.then(t):t(r))}catch(e){return Promise.reject(e)}},onDelete:()=>{B(null),U(null)},message:z?"Uploaded":"No file selected"}),P&&a.createElement("img",{src:P,alt:"preview",style:{width:"100%",marginTop:"10px"}}),H&&a.createElement(r.Toast,{label:H.message,error:"error"===H.type,onClose:()=>V(null)})))},Q=e=>{let{config:n,onSelect:o}=e;const{t:i}=l.useTranslation(),s=Digit.ULBService.getCurrentTenantId(),[c,m]=t.useState(""),[d,u]=t.useState(null),[E,v]=t.useState(null),[g,C]=t.useState(""),[b,S]=t.useState(""),[N,f]=t.useState(""),[h,y]=t.useState(""),[_,x]=t.useState(""),[k,T]=t.useState(null),[I,R]=t.useState(null),[D,A]=t.useState(null);return a.createElement(t.Fragment,null,a.createElement(r.FormStep,{t:i,onSelect:()=>{!g||Number(g)<1||!I||"Hotel"===(null==d?void 0:d.name)&&!N||!("Hospital"!==(null==d?void 0:d.name)&&"Nursing Home"!==(null==d?void 0:d.name)||h)?A({type:"error",message:"Fill all required fields"}):o(n.key,{pidNumber:c,propertyType:null==d?void 0:d.name,subPropertyCategory:null==E?void 0:E.name,noOfFloors:g,floorNo:b,noOfRooms:N,noOfBeds:h,dwellingUnits:_,buildingImageId:I})},config:n,label:i("ES_COMMON_CONTINUE")},a.createElement("div",null,a.createElement(r.CardLabel,null,"PID Number"),a.createElement(r.TextInput,{value:c,onChange:e=>m(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Property Type"),a.createElement(r.Dropdown,{option:[{name:"Residential"},{name:"Commercial"},{name:"Hotel"},{name:"Hospital"},{name:"Nursing Home"}],selected:d,select:u})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Sub Property Category"),a.createElement(r.Dropdown,{option:[],selected:E,select:v})),a.createElement("div",null,a.createElement(r.CardLabel,null,"No. of Floors *"),a.createElement(r.TextInput,{type:"number",value:g,onChange:e=>C(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Floor No. of this KNO"),a.createElement(r.TextInput,{value:b,onChange:e=>S(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"No of Beds"),a.createElement(r.TextInput,{type:"number",value:h,onChange:e=>y(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"No. of Rooms"),a.createElement(r.TextInput,{type:"number",value:N,onChange:e=>f(e.target.value)})),"Hotel"===(null==d?void 0:d.name)&&a.createElement("div",null,a.createElement(r.CardLabel,null,"No. of Rooms *"),a.createElement(r.TextInput,{type:"number",value:N,onChange:e=>f(e.target.value)})),("Hospital"===(null==d?void 0:d.name)||"Nursing Home"===(null==d?void 0:d.name))&&a.createElement("div",null,a.createElement(r.CardLabel,null,"No. of Beds *"),a.createElement(r.TextInput,{type:"number",value:h,onChange:e=>y(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Number of Dwelling Units"),a.createElement(r.TextInput,{type:"number",value:_,onChange:e=>x(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Building Image *"),a.createElement(r.UploadFile,{onUpload:function(e){try{const t=e.target.files[0];if(!t)return Promise.resolve();if(t.size>2e6)return A({type:"error",message:"Max size 2MB exceeded"}),Promise.resolve();const a=p(function(){return Promise.resolve(Digit.UploadServices.Filestorage("EKYC",t,s)).then(function(e){var a,l,n;const r=null==e||null===(a=e.data)||void 0===a||null===(l=a.files)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.fileStoreId;if(r){R(r);const e=new FileReader;e.onloadend=()=>T(e.result),e.readAsDataURL(t),A({type:"success",message:"Upload successful"})}})},function(){A({type:"error",message:"Upload failed"})});return Promise.resolve(a&&a.then?a.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},onDelete:()=>{T(null),R(null)},message:I?"Uploaded":"No file selected"})),k&&a.createElement("div",{style:{gridColumn:"span 2"}},a.createElement("img",{src:k,alt:"preview",style:{width:"100%",marginTop:"10px"}})),D&&a.createElement(r.Toast,{label:D.message,error:"error"===D.type,onClose:()=>A(null)})))},J=e=>{let{config:l,onSelect:n}=e;const o=Digit.ULBService.getCurrentTenantId(),[i,s]=t.useState(""),[c,m]=t.useState(""),[d,u]=t.useState(""),[E,v]=t.useState(""),[g,C]=t.useState(""),[b,S]=t.useState(""),[N,f]=t.useState(""),[h,y]=t.useState(""),[_,x]=t.useState(null),[k,T]=t.useState(null),[I,R]=t.useState(null),[D,A]=t.useState(null),[L,F]=t.useState(null),[w,O]=t.useState(""),[K,M]=t.useState(null),[Y,P]=t.useState(null),[B,z]=t.useState(null),[U,H]=t.useState(null),[V,W]=t.useState(null),[j,G]=t.useState(null),X=[{name:"Yes"},{name:"No"}],$=[];for(let e=1998;e<=2026;e++)for(let t=1;t<=12;t++)$.push({name:`${t}/${e}`});const q="Can not be identified"===(null==_?void 0:_.name);return a.createElement(t.Fragment,null,a.createElement(r.FormStep,{onSelect:()=>{i&&_&&I&&D&&Y&&("Metered"!==(null==_?void 0:_.name)||V)&&("No"!==(null==D?void 0:D.name)||w)&&("No"!==(null==Y?void 0:Y.name)||B)?n(l.key,{connectionCategory:i,saType:c,status:d,mrCode:E,areaCode:g,mrKey:b,meterNumber:N,meterMaker:h,meterStatus:null==_?void 0:_.name,meterCondition:null==k?void 0:k.name,meterLocation:null==I?void 0:I.name,lastBillReceived:null==D?void 0:D.name,billMonthYear:null==L?void 0:L.name,reason:w,accessToMeter:null==K?void 0:K.name,sewerConnection:null==Y?void 0:Y.name,septicTank:null==B?void 0:B.name,meterPhotoId:V}):G({type:"error",message:"Fill all mandatory fields"})},config:l},a.createElement("div",null,a.createElement(r.CardLabel,null,"Connection Category *"),a.createElement(r.TextInput,{value:i,onChange:e=>s(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"SA Type"),a.createElement(r.TextInput,{value:c,onChange:e=>m(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Status"),a.createElement(r.TextInput,{value:d,onChange:e=>u(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"MR Code"),a.createElement(r.TextInput,{value:E,onChange:e=>v(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Area Code"),a.createElement(r.TextInput,{value:g,onChange:e=>C(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"MR Key"),a.createElement(r.TextInput,{value:b,onChange:e=>S(e.target.value)})),!q&&a.createElement(t.Fragment,null,a.createElement("div",null,a.createElement(r.CardLabel,null,"Meter Number"),a.createElement(r.TextInput,{value:N,onChange:e=>f(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Meter Maker"),a.createElement(r.TextInput,{value:h,onChange:e=>y(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Meter Condition"),a.createElement(r.Dropdown,{option:[{name:"Damaged"},{name:"Not-Damaged"}],selected:k,select:T})),"Metered"===(null==_?void 0:_.name)&&a.createElement(t.Fragment,null,a.createElement("div",null,a.createElement(r.CardLabel,null,"Meter Photo *"),a.createElement(r.UploadFile,{onUpload:function(e){try{const t=e.target.files[0];if(!t)return Promise.resolve();const a=p(function(){return Promise.resolve(Digit.UploadServices.Filestorage("EKYC",t,o)).then(function(e){var a,l,n;const r=null==e||null===(a=e.data)||void 0===a||null===(l=a.files)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.fileStoreId;if(r){W(r);const e=new FileReader;e.onloadend=()=>H(e.result),e.readAsDataURL(t)}})},function(){G({type:"error",message:"Upload failed"})});return Promise.resolve(a&&a.then?a.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},message:V?"Uploaded":"No file"})),U&&a.createElement("div",{style:{gridColumn:"span 2"}},a.createElement("img",{src:U,style:{width:"100%"}})))),a.createElement("div",null,a.createElement(r.CardLabel,null,"Meter Status *"),a.createElement(r.Dropdown,{option:[{name:"Metered"},{name:"Unmetered"},{name:"Can not be identified"}],selected:_,select:x})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Meter Location *"),a.createElement(r.Dropdown,{option:[{name:"Inside"},{name:"Outside"}],selected:I,select:R})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Last Bill Received *"),a.createElement(r.Dropdown,{option:X,selected:D,select:A})),"Yes"===(null==D?void 0:D.name)&&a.createElement("div",null,a.createElement(r.CardLabel,null,"When was the last bill received *"),a.createElement(r.Dropdown,{option:$,selected:L,select:F})),"No"===(null==D?void 0:D.name)&&a.createElement("div",null,a.createElement(r.CardLabel,null,"Reason *"),a.createElement(r.TextInput,{value:w,onChange:e=>O(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Access to Meter"),a.createElement(r.Dropdown,{option:X,selected:K,select:M})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Sewer Connection *"),a.createElement(r.Dropdown,{option:X,selected:Y,select:P})),"No"===(null==Y?void 0:Y.name)&&a.createElement("div",null,a.createElement(r.CardLabel,null,"Septic Tank *"),a.createElement(r.Dropdown,{option:X,selected:B,select:z})),j&&a.createElement(r.Toast,{label:j.message,error:"error"===j.type,onClose:()=>G(null)})))},ee=()=>{const{t:e}=l.useTranslation(),t={moduleName:e("ACTION_TEST_EKYC"),kpis:[{count:"-",label:e("TOTAL_EKYC"),link:"/digit-ui/citizen/ekyc/dashboard"}],links:[{label:e("EKYC_DASHBOARD"),link:"/digit-ui/citizen/ekyc/dashboard"},{label:e("EKYC_INBOX"),link:"/digit-ui/citizen/ekyc/inbox"},{label:e("EKYC_MAPPING"),link:"/digit-ui/citizen/ekyc/mapping"}]};return a.createElement(r.ModuleLinksView,{links:t.links})},te=e=>{var l,o,i,s,c;let{parentRoute:m}=e;const d=Digit.ULBService.getCurrentTenantId(),p=n.useLocation(),[v,g]=t.useReducer(function(e,t){const a=t.checkPathName?"EKYC.INBOX":"EKYC.SW.INBOX";switch(t.action){case"mutateSearchForm":return Digit.SessionStorage.set(a,{...e,searchForm:t.data}),{...e,searchForm:t.data};case"mutateFilterForm":return Digit.SessionStorage.set(a,{...e,filterForm:t.data}),{...e,filterForm:t.data};case"mutateTableForm":return Digit.SessionStorage.set(a,{...e,tableForm:t.data}),{...e,tableForm:t.data};default:return e}},{filterForm:{},searchForm:{},tableForm:{limit:10,offset:0,sortBy:"createdTime",sortOrder:"DESC"}}),C=t.useMemo(()=>{var e,t;return{tenantId:d,offset:(null==v||null===(e=v.tableForm)||void 0===e?void 0:e.offset)||0,limit:(null==v||null===(t=v.tableForm)||void 0===t?void 0:t.limit)||10,search:(null==v?void 0:v.searchForm)||{}}},[d,null==v||null===(l=v.tableForm)||void 0===l?void 0:l.offset,null==v||null===(o=v.tableForm)||void 0===o?void 0:o.limit,null==v?void 0:v.searchForm]),{isLoading:b,data:S={}}=Digit.Hooks.ekyc.useEkycSurveyorDashboard({},C,{enabled:!!d,keepPreviousData:!0}),N=t.useMemo(()=>{var e,t;return{kno:(null==v||null===(e=v.searchForm)||void 0===e?void 0:e.kNumber)||"",name:(null==v||null===(t=v.searchForm)||void 0===t?void 0:t.kName)||""}},[null==v||null===(i=v.searchForm)||void 0===i?void 0:i.kNumber,null==v||null===(s=v.searchForm)||void 0===s?void 0:s.kName]),f=!(!N.kno&&!N.name),{isLoading:h,data:y}=Digit.Hooks.ekyc.useSearchConnection({tenantId:d,details:N},{enabled:!!d&&!!N.kno,keepPreviousData:!0}),x=t.useMemo(()=>{var e;return f?y?[y]:[]:(null==S||null===(e=S.dashboardInfo)||void 0===e?void 0:e.consumerList)||[]},[f,y,S]),k=t.useMemo(()=>(x||[]).map(e=>{var t,a,l,n,r,o;return e.connectionDetails?{applicationNo:(null===(t=e.propertyInfo)||void 0===t?void 0:t.kno)||"",connectionNo:(null===(a=e.propertyInfo)||void 0===a?void 0:a.kno)||"",owner:(null===(l=e.connectionDetails)||void 0===l?void 0:l.consumerName)||"",applicationNumber:(null===(n=e.propertyInfo)||void 0===n?void 0:n.kno)||"",citizenName:(null===(r=e.connectionDetails)||void 0===r?void 0:r.consumerName)||"",status:(null===(o=e.connectionDetails)||void 0===o?void 0:o.statusflag)||"",sla:0}:{...e,applicationNo:e.kno||e.applicationNumber||"",connectionNo:e.connectionNo||"",owner:e.consumerName||e.citizenName||"",applicationNumber:e.kno||e.applicationNumber||"",citizenName:e.consumerName||e.citizenName||"",status:e.status||"",sla:e.sla??0}}),[x]),T=(null==S||null===(c=S.dashboardInfo)||void 0===c?void 0:c.totalRecords)||(null==S?void 0:S.totalCount)||0,I=p.pathname.includes("ekyc/inbox"),R={headerText:I?"MODULE_WATER":"MODULE_SW"},D=t.useCallback(e=>{let{registerRef:t,searchFormState:l,controlSearchForm:n}=e;return a.createElement(_,{registerRef:t,searchFormState:l,controlSearchForm:n,className:"search"})},[]),A={sortBy:"createdTime",limit:window.Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"DESC"},L={mobileNumber:"",applicationNumber:"",consumerNo:""},F={SearchFormFields:D,onSearchFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),g({action:"mutateTableForm",data:{...A},checkPathName:I}),g({action:"mutateSearchForm",data:e,checkPathName:I})},searchFormDefaultValues:null==v?void 0:v.searchForm,resetSearchFormDefaultValues:L,onSearchFormReset:e=>{e("mobileNumber",null),e("applicationNumber",null),e("consumerNo",null),g({action:"mutateSearchForm",data:L})},className:"search-form-wns-inbox"},w={FilterFormFields:t.useCallback(e=>a.createElement(a.Fragment,null),[]),onFilterFormSubmit:()=>{},filterFormDefaultValues:"",resetFilterFormDefaultValues:"",onFilterFormReset:()=>{}},O=E({parentRoute:m,onPageSizeChange:e=>{const t=Number(e.target.value);g({action:"mutateTableForm",data:{...v.tableForm,limit:t,offset:0},checkPathName:I})},formState:v,totalCount:T,table:k,dispatch:g,onSortingByData:e=>{if(e.length>0){const[{id:t,desc:a}]=e,l=a?"DESC":"ASC";v.tableForm.sortBy===t&&v.tableForm.sortOrder===l||g({action:"mutateTableForm",data:{...v.tableForm,sortBy:t,sortOrder:a?"DESC":"ASC"},checkPathName:I})}},tenantId:d,checkPathName:I,inboxStyles:{overflowX:"scroll",overflowY:"hidden"},tableStyle:{width:"70%"}});return a.createElement("div",{className:"app-container"},a.createElement(r.InboxComposer,u({isInboxLoading:b||h,PropsForInboxLinks:R},F,w,{propsForInboxTable:O,formState:v})))},ae=()=>{const{t:e}=l.useTranslation(),t=n.useLocation(),{path:o}=n.useRouteMatch();sessionStorage.removeItem("revalidateddone");const i=[{icon:r.HomeIcon,path:"/digit-ui/citizen"},{label:e((()=>{const e=t.pathname;return e.includes("/create-kyc")?"EKYC_CREATE_KYC":e.includes("/aadhaar-verification")?"EKYC_AADHAAR_VERIFICATION":e.includes("/address-details")?"EKYC_ADDRESS_DETAILS":e.includes("/property-info")?"EKYC_PROPERTY_INFO":e.includes("/meter-details")?"EKYC_METER_DETAILS":e.includes("/review")?"EKYC_REVIEW":"EKYC_HOME"})())}];return a.createElement(r.AppContainer,null,a.createElement("div",{className:"ground-container employee-app-container form-container"},a.createElement(r.ModuleHeader,{leftContent:a.createElement(a.Fragment,null,a.createElement(r.ArrowLeft,{className:"icon"}),e("CS_COMMON_BACK")),onLeftClick:()=>window.history.back(),breadcrumbs:i}),a.createElement(n.Switch,null,a.createElement(r.PrivateRoute,{exact:!0,path:""+o,component:()=>a.createElement(ee,null)}),a.createElement(r.PrivateRoute,{path:o+"/dashboard",component:()=>a.createElement(c,null)}),a.createElement(r.PrivateRoute,{path:o+"/inbox",component:()=>a.createElement(te,null)}),a.createElement(r.PrivateRoute,{path:o+"/aadhaar-verification",component:()=>a.createElement(G,null)}),a.createElement(r.PrivateRoute,{path:o+"/address-details",component:()=>a.createElement(Z,null)}),a.createElement(r.PrivateRoute,{path:o+"/property-info",component:()=>a.createElement(Q,null)}),a.createElement(r.PrivateRoute,{path:o+"/meter-details",component:()=>a.createElement(J,null)}),a.createElement(r.PrivateRoute,{path:o+"/review",component:()=>a.createElement(V,null)}))))},le=e=>{let{userType:t,tenants:l}=e;const{path:r,url:o}=n.useRouteMatch();return Digit.SessionStorage.set("EKYC_TENANTS",l),"employee"===t?a.createElement(q,{path:r,url:o,userType:t,tenants:l}):a.createElement(ae,null)},ne=e=>{let{matchPath:t}=e;const{t:n}=l.useTranslation(),o=[{link:t+"/create-kyc",i18nKey:n("EKYC_CREATE_KYC")},{link:t+"/update-kyc",i18nKey:n("EKYC_UPDATE_KYC")}];return a.createElement(r.CitizenHomeCard,{header:n("EKYC_MODULE_NAME"),links:o,Icon:()=>a.createElement(r.DocumentIcon,{className:"fill-path-primary-main"})})},re={EKYCModule:le,EKYCCard:()=>{const{t:e}=l.useTranslation(),t={Icon:a.createElement(r.PersonIcon,null),moduleName:e("ACTION_TEST_EKYC"),kpis:[{count:"-",label:e("TOTAL_EKYC"),link:"/digit-ui/employee/ekyc/dashboard"}],links:[{label:e("EKYC_DASHBOARD"),link:"/digit-ui/employee/ekyc/dashboard"},{label:e("EKYC_INBOX"),link:"/digit-ui/employee/ekyc/inbox"},{label:e("EKYC_MAPPING"),link:"/digit-ui/employee/ekyc/mapping"}]};return a.createElement(r.EmployeeModuleCard,t)},EKYCInbox:c,EKYCDesktopInbox:e=>{var o;let{filterComponent:i,...c}=e;const{data:m,isLoading:d,onSort:u,onNextPage:E,onPrevPage:p,currentPage:v,pageSizeLimit:g,onPageSizeChange:C,parentRoute:b,searchParams:S,sortParams:N,totalRecords:f,countData:h}=c,{t:y}=l.useTranslation(),_=n.useHistory(),x=Digit.ULBService.getCurrentTenantId(),k=null===(o=Digit.ComponentRegistryService)||void 0===o?void 0:o.getComponent(i),[T,I]=t.useState(""),{data:R,getReview:D}=Digit.Hooks.ekyc.useEkycAPI("review",x),A=e=>{I(e),D({kno:e})};a.useEffect(()=>{R&&_.push("/digit-ui/employee/ekyc/review",{kNumber:T,aadhaarData:null==R?void 0:R.aadhaarData,reviewData:R})},[R]);const L=t.useMemo(()=>[{Header:y("EKYC_APPLICATION_NO"),accessor:"applicationNumber",Cell:e=>{var t,l;let{row:n}=e;const r=(null===(t=n.original)||void 0===t?void 0:t.kno)||(null===(l=n.original)||void 0===l?void 0:l.applicationNumber)||"NA";return a.createElement("span",{className:"ekyc-application-link",style:{color:"#add8f7",cursor:"pointer",fontWeight:"bold"},onClick:()=>A(r)},r)}},{Header:y("EKYC_CITIZEN_NAME"),accessor:"citizenName",Cell:e=>{var t;let{row:l}=e;return a.createElement("span",null,(null===(t=l.original)||void 0===t?void 0:t.citizenName)||"NA")}},{Header:y("EKYC_STATUS"),accessor:"actionStatus",Cell:e=>{var t;let{row:l}=e;const n=(null===(t=l.original)||void 0===t?void 0:t.status)||"DEFAULT";return a.createElement("span",{className:"ekyc-status-tag "+n},y(""+n))}},{Header:y("EKYC_ACTION"),accessor:"status",Cell:e=>{var t,l;let{row:n}=e;const r=(null===(t=n.original)||void 0===t?void 0:t.kno)||(null===(l=n.original)||void 0===l?void 0:l.applicationNumber)||"NA";return a.createElement("span",{className:"ekyc-application-link",style:{color:"#add8f7",cursor:"pointer",fontWeight:"bold"},onClick:()=>A(r)},y("EKYC_REVIEW"))}}],[y,b]),F=t.useMemo(()=>(null==m?void 0:m.items)||[],[m]);return a.createElement("div",{className:"app-container"},a.createElement("div",{className:"inbox-container"},d&&a.createElement(r.Loader,null),a.createElement("div",{className:"side-panel-item"},a.createElement(r.InboxLinks,{headerText:c.moduleCode}),k&&a.createElement(k,{defaultSearchParams:c.defaultSearchParams,onFilterChange:c.onSearch,searchParams:S,type:"desktop",moduleCode:"EKYC"})),a.createElement("div",{className:"employee-form-content",style:{flex:1}},a.createElement(r.Card,{className:"ekyc-metrics-card"},a.createElement(s,{countData:h})),a.createElement("div",{className:"result",style:{flex:1}},a.createElement(r.Card,{className:"ekyc-table-card",style:{padding:0}},a.createElement(r.Table,{t:y,data:F,columns:L,isLoading:d,onSort:u,sortParams:N,totalRecords:f,onNextPage:E,onPrevPage:p,currentPage:v,pageSizeLimit:g,onPageSizeChange:C,getCellProps:e=>({className:"ekyc-table-cell"})}))))))},EKYCMobileInbox:e=>{var t;let{data:o,isLoading:i,onSearch:c,searchParams:d,parentRoute:u,countData:E}=e;const{t:p}=l.useTranslation(),v=(null==o||null===(t=o.items)||void 0===t?void 0:t.map(e=>({[p("EKYC_APPLICATION_NO")]:e.applicationNumber,[p("EKYC_CITIZEN_NAME")]:e.citizenName,[p("EKYC_MOBILE_NO")]:e.mobileNumber,[p("EKYC_STATUS")]:a.createElement("span",{className:"ekyc-status-tag "+e.status},p("EKYC_STATUS_"+e.status))})))||[];return a.createElement("div",{className:"inbox-wrapper"},a.createElement("div",{className:"ekyc-header-container module-header"},a.createElement(r.Header,{className:"title"},p("EKYC_INBOX_HEADER")),a.createElement(n.Link,{to:u+"/create-kyc"},a.createElement(r.SubmitBar,{label:p("EKYC_CREATE_KYC")}))),a.createElement("div",{className:"ekyc-metrics-section"},a.createElement(s,{countData:E})),a.createElement(m,{onSearch:c,searchParams:d}),a.createElement("div",{className:"mobile-data-container"},i?a.createElement(r.Loader,null):(null==v?void 0:v.length)>0?a.createElement(r.DetailsCard,{data:v,t:p,serviceRequestIdKey:p("EKYC_APPLICATION_NO"),linkPrefix:u+"/application-details/"}):a.createElement(r.Card,null,p("ES_COMMON_NO_DATA").split("\\n").map((e,t)=>a.createElement("p",{key:t,style:{textAlign:"center"}},e)))))},EKYC_INBOX_FILTER:e=>a.createElement(d,e),EkycLinks:ne,AadhaarVerification:G,AddressDetails:Z,PropertyInfo:Q,MeterDetails:J};exports.EkycLinks=ne,exports.EkycModule=le,exports.default=le,exports.initEkycComponents=()=>{Object.entries(re).forEach(e=>{let[t,a]=e;Digit.ComponentRegistryService.setComponent(t,a)})};
1
+ function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("react"),n=e(t),a=require("react-i18next"),l=require("react-router-dom"),r=require("@djb25/digit-ui-react-components"),o=require("chart.js/auto"),i=e(o);require("react-dom");var s=require("chart.js");const c=e=>{let{countData:l}=e;const{t:r}=a.useTranslation(),s=t.useRef(null),c=t.useRef(null),d=(null==l?void 0:l.total)||0,m=(null==l?void 0:l.pending)||0,u=(null==l?void 0:l.completed)||0,p=(null==l?void 0:l.completed)||0,E=p,v=d>0?Math.round(p/d*100):0,g=d>0?Math.round(E/d*100):0,y=e=>new Intl.NumberFormat("en-IN").format(e||0);t.useEffect(()=>{if(s.current){c.current&&c.current.destroy();const e=s.current.getContext("2d");c.current=new(o.Chart||i||o)(e,{type:"doughnut",data:{labels:[r("EKYC_ACTIVE"),r("EKYC_PENDING"),r("EKYC_COMPLETED")],datasets:[{data:[u,m,0],backgroundColor:["#0c2a52","#77B6EA","#c8ddf5"],borderColor:["#ffffff","#ffffff","#ffffff"],borderWidth:2,hoverOffset:4}]},options:{cutout:"75%",plugins:{legend:{display:!1}},maintainAspectRatio:!1,responsive:!0}})}return()=>{c.current&&c.current.destroy()}},[m,0,u,r]);const f=[{color:"#0c2a52",label:r("EKYC_ACTIVE"),value:u},{color:"#77B6EA",label:r("EKYC_PENDING"),value:m},{color:"#c8ddf5",label:r("EKYC_COMPLETED"),value:0}];return n.createElement("div",{className:"ekyc-employee-container"},n.createElement("div",{className:"status-cards-wrapper"},n.createElement("div",{className:"status-cards-header"},n.createElement("div",null,n.createElement("div",{className:"eyebrow"},n.createElement("span",{className:"eyebrow-dot"}),r("EKYC_INSTITUTIONAL_OVERVIEW")||"Institutional Performance Overview"),n.createElement("h1",{className:"status-cards-h1"},r("EKYC_DASHBOARD_TITLE")||"eKYC Verification Dashboard"),n.createElement("p",{className:"status-cards-subtitle"},r("EKYC_DASHBOARD_SUBTITLE")||"Real-time monitoring of consumer verification workflows across all administrative zones.")),n.createElement("div",{className:"total-applications-card"},n.createElement("div",{className:"total-label"},r("EKYC_TOTAL_APPLICATIONS")||"Total Applications Processed"),n.createElement("div",{className:"total-number"},y(d)),n.createElement("div",{className:"total-badge"},"↗ +12.4% ",r("EKYC_FROM_LAST_QUARTER")||"from last quarter"))),n.createElement("div",{className:"status-panels-grid"},n.createElement("div",{className:"status-panel"},n.createElement("div",{className:"panel-title"},r("EKYC_STATUS_BREAKDOWN")||"Status Breakdown"),n.createElement("div",{className:"panel-subtitle"},r("EKYC_VERIFICATION_LIFECYCLE")||"Verification lifecycle distribution"),n.createElement("div",{className:"breakdown-body"},n.createElement("div",{className:"status-legend"},f.map(e=>n.createElement("div",{key:e.label,className:"legend-row"},n.createElement("span",{className:"legend-label"},n.createElement("span",{className:"indicator-dot",style:{background:e.color}}),e.label),n.createElement("span",{className:"legend-value"},y(e.value))))),n.createElement("div",{className:"chart-wrapper"},n.createElement("canvas",{ref:s,style:{width:"100%",height:"100%"}}),n.createElement("div",{className:"chart-center"},n.createElement("div",{className:"chart-percentage"},v,"%"),n.createElement("div",{className:"chart-label"},r("EKYC_COMPLETE")||"Complete"))))),n.createElement("div",{className:"status-panel"},n.createElement("div",{className:"panel-title"},r("EKYC_SUBMISSION_HEALTH")||"Submission Health",n.createElement("span",{className:"optimal-badge"},r("EKYC_OPTIMAL")||"Optimal")),n.createElement("div",{className:"panel-subtitle"},r("EKYC_PLATFORM_EFFICIENCY")||"Platform operational efficiency"),n.createElement("div",{className:"health-metrics-row"},n.createElement("div",{className:"health-percentage"},g,"%"),n.createElement("div",{className:"health-trend"},"↗ +2.1%")),n.createElement("div",{className:"status-progress-bar"},n.createElement("div",{className:"progress-fill",style:{width:g+"%"}})),n.createElement("div",{className:"mini-metrics-grid"},n.createElement("div",{className:"metric-box"},n.createElement("div",{className:"metric-label"},r("EKYC_AVG_LATENCY")||"Avg Latency"),n.createElement("div",{className:"metric-value"},"1.2s")),n.createElement("div",{className:"metric-box"},n.createElement("div",{className:"metric-label"},r("EKYC_ERROR_RATE")||"Error Rate"),n.createElement("div",{className:"metric-value"},"0.04%")))))))},d=()=>{const e=Digit.ULBService.getCurrentTenantId(),{isLoading:a,data:l}=Digit.Hooks.ekyc.useEkycSurveyorDashboard({},{tenantId:e,offset:0,limit:10},{enabled:!!e}),o=t.useMemo(()=>{const e=(null==l?void 0:l.dashboardInfo)||{};return{total:e.total||0,completed:e.completed||0,pending:e.pending||0,rejected:e.rejected||0,active:e.active||0}},[l]);return a?n.createElement(r.Loader,null):n.createElement(r.Card,{className:"min-width-full"},n.createElement(c,{countData:o}))},m=e=>{var l,o,i;let{onSearch:s,searchParams:c,children:d,...m}=e;const{t:u}=a.useTranslation(),[p,E]=t.useState(()=>({...c})),v=(e,t)=>{E(n=>({...n,[e]:t}))};return n.createElement("div",{className:"ekyc-employee-container"},n.createElement("div",{className:"search-consumer-wrapper"},n.createElement("div",{className:"header-wrapper"},n.createElement(r.Card,{className:"sidebar-title-card"},n.createElement("div",{className:"icon-container"},n.createElement(r.HomeIcon,null)),n.createElement("div",{className:"title-text"},u("EKYC_SEARCH_CONSUMER_HEADER")))),n.createElement("div",{className:"main-content-wrapper"},n.createElement("div",{className:"search-stats-row"},n.createElement("div",{className:"identity-lookup-card"},n.createElement("div",{className:"lookup-card-title"},n.createElement("div",{className:"lookup-icon-bg"},n.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"#3A7BD5",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("circle",{cx:"11",cy:"11",r:"8"}),n.createElement("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}))),n.createElement("span",{className:"lookup-title-text"},u("EKYC_IDENTITY_LOOKUP")||"Identity Lookup")),n.createElement("form",{onSubmit:e=>{e&&e.preventDefault&&e.preventDefault(),s(p)}},n.createElement("div",{className:"inputs-row"},n.createElement("div",{className:"input-group"},n.createElement("label",null,u("EKYC_K_NUMBER")||"K Number",n.createElement("span",{className:"info-badge"},"i")),n.createElement(r.TextInput,{value:null==p?void 0:p.kNumber,onChange:e=>v("kNumber",e.target.value),placeholder:u("EKYC_K_NUMBER_PLACEHOLDER")||"e.g. 8234910234"})),n.createElement("div",{className:"input-group"},n.createElement("label",null,u("EKYC_K_NAME")||"K Name",n.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#3A7BD5",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),n.createElement("circle",{cx:"12",cy:"7",r:"4"}))),n.createElement(r.TextInput,{value:null==p?void 0:p.kName,onChange:e=>v("kName",e.target.value),placeholder:u("EKYC_K_NAME_PLACEHOLDER")||"Consumer name search"}))),n.createElement("div",{className:"actions-row"},n.createElement("button",{type:"button",onClick:()=>{const e={kNumber:"",kName:""};E(e),s(e)},className:"clear-btn"},u("ES_COMMON_CLEAR")||"Clear"),n.createElement("button",{type:"submit",className:"search-btn"},u("ES_COMMON_SEARCH")||"Execute Search")))),n.createElement("div",{className:"stats-column"},n.createElement("div",{className:"audits-card"},n.createElement("div",{className:"audits-label"},u("EKYC_TODAYS_AUDITS")||"Today's Audits"),n.createElement("div",{className:"audits-count"},(null===(l=m.countData)||void 0===l?void 0:l.todaysAudits)||24),n.createElement("div",{className:"audits-change"},n.createElement("span",null,"↗"),(null===(o=m.countData)||void 0===o?void 0:o.auditChange)||"12% increase from yesterday"),n.createElement("div",{className:"audits-watermark"},"M")),n.createElement("div",{className:"queue-card"},n.createElement("div",{className:"queue-label"},u("EKYC_QUEUE_STATUS")||"Queue Status"),n.createElement("div",{className:"queue-content"},n.createElement("div",{className:"queue-status-text"},(null===(i=m.countData)||void 0===i?void 0:i.pendingCount)||3," Pending"),n.createElement("div",{className:"avatar-group"},[0,1].map(e=>n.createElement("div",{key:e,className:"avatar-item"},String.fromCharCode(65+e))),n.createElement("div",{className:"avatar-more"},"+1")))))),d)))},u=e=>{let{searchParams:l,onFilterChange:o,defaultSearchParams:i,...s}=e;const{t:c}=a.useTranslation(),[d,m]=t.useState(()=>({...l}));return n.createElement(r.FilterForm,{onSubmit:()=>{o(d)},handleSubmit:e=>t=>{t&&t.preventDefault(),e()},onResetFilterForm:()=>{m({...i}),o({...i})},id:"ekyc-filter-form",onMobileExclusiveFilterPopupFormClose:s.onClose},n.createElement(r.FilterFormField,null,n.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},c("EKYC_STATUS"),":"),n.createElement(r.Dropdown,{option:[{label:c("EKYC_STATUS_ALL"),value:""},{label:c("EKYC_STATUS_ACTIVE"),value:"ACTIVE"},{label:c("EKYC_STATUS_PENDING"),value:"PENDING START"}],optionKey:"label",select:e=>{const t={...d,status:e};m(t),o(t)},selected:(null==d?void 0:d.status)||{label:c("EKYC_STATUS_ALL"),value:""}})))};function p(){return(p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(null,arguments)}const E=e=>{var r,o,i;let{onPageSizeChange:s,formState:c,totalCount:d,table:m,dispatch:u,checkPathName:p,onSortingByData:E,tenantId:v,inboxStyles:g={},tableStyle:y={}}=e;const{t:f}=a.useTranslation(),C=l.useHistory(),[b,h]=t.useState(""),{data:S,getReview:x}=Digit.Hooks.ekyc.useEkycAPI("review",v),N=e=>{h(e),x({kno:e})},k=(null==c||null===(r=c.tableForm)||void 0===r?void 0:r.limit)||10,_=(null==c||null===(o=c.tableForm)||void 0===o?void 0:o.offset)||0;n.useEffect(()=>{S&&C.push("/digit-ui/employee/ekyc/review",{kNumber:b,aadhaarData:null==S?void 0:S.aadhaarData,reviewData:S})},[S]);const T=[{Header:f("EKYC_APPLICATION_NO"),accessor:"applicationNumber",disableSortBy:!0,Cell:e=>{var t,a;let{row:l}=e;const r=(null===(t=l.original)||void 0===t?void 0:t.kno)||(null===(a=l.original)||void 0===a?void 0:a.applicationNumber)||"NA";return n.createElement("span",{className:"ekyc-application-link",style:{color:"#add8f7",cursor:"pointer",fontWeight:"bold"},onClick:()=>N(r)},r)}},{Header:f("EKYC_CITIZEN_NAME"),accessor:"citizenName",Cell:e=>{var t;let{row:a}=e;return n.createElement("span",null,(null===(t=a.original)||void 0===t?void 0:t.citizenName)||"NA")}},{Header:f("EKYC_STATUS"),accessor:"actionStatus",Cell:e=>{var t;let{row:a}=e;const l=(null===(t=a.original)||void 0===t?void 0:t.status)||"DEFAULT";return n.createElement("span",{className:"ekyc-status-tag "+l},f(""+l))}},{Header:f("EKYC_ACTION"),accessor:"status",Cell:e=>{var t,a;let{row:l}=e;const r=(null===(t=l.original)||void 0===t?void 0:t.kno)||(null===(a=l.original)||void 0===a?void 0:a.applicationNumber)||"NA";return n.createElement("span",{className:"ekyc-application-link",style:{color:"#add8f7",cursor:"pointer",fontWeight:"bold"},onClick:()=>N(r)},f("EKYC_REVIEW"))}}];return{getCellProps:e=>({style:{padding:"8px",fontSize:"12px"}}),disableSort:!1,autoSort:!1,manualPagination:!0,initSortId:"applicationDate",onPageSizeChange:s,currentPage:Math.floor(_/k),onNextPage:()=>{var e,t;return u({action:"mutateTableForm",data:{...c.tableForm,offset:parseInt(null===(e=c.tableForm)||void 0===e?void 0:e.offset)+parseInt(null===(t=c.tableForm)||void 0===t?void 0:t.limit)},checkPathName:p})},onPrevPage:()=>{var e,t;return u({action:"mutateTableForm",data:{...c.tableForm,offset:parseInt(null===(e=c.tableForm)||void 0===e?void 0:e.offset)-parseInt(null===(t=c.tableForm)||void 0===t?void 0:t.limit)},checkPathName:p})},pageSizeLimit:k,onSort:E,totalRecords:d,onSearch:null==c||null===(i=c.searchForm)||void 0===i?void 0:i.message,onLastPage:()=>{var e;return u({action:"mutateTableForm",data:{...c.tableForm,offset:10*Math.ceil(d/10)-parseInt(null===(e=c.tableForm)||void 0===e?void 0:e.limit)},checkPathName:p})},onFirstPage:()=>u({action:"mutateTableForm",data:{...c.tableForm,offset:0},checkPathName:p}),data:m,columns:T,inboxStyles:{...g},tableStyle:{...y}}};function v(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));var g=e=>null==e;const y=e=>"object"==typeof e;var f=e=>!g(e)&&!Array.isArray(e)&&y(e)&&!(e instanceof Date),C=e=>e.filter(Boolean),b=e=>void 0===e,h=function(e,t,n){void 0===e&&(e={});const a=C(t.split(/[,[\].]+?/)).reduce((e,t)=>g(e)?e:e[t],e);return b(a)||a===e?b(e[t])?n:e[t]:a},S=e=>"function"==typeof e;const x=t.createContext(null);x.displayName="RHFContext";const N=e=>{const{as:n,render:a}=e,l=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(a=Object.getOwnPropertySymbols(e);l<a.length;l++)t.indexOf(a[l])<0&&Object.prototype.propertyIsEnumerable.call(e,a[l])&&(n[a[l]]=e[a[l]])}return n}(e,["rules","as","render","defaultValue","control","onFocus"]),{field:r,meta:o}=function(e){let{name:n,rules:a,defaultValue:l,control:r,onFocus:o}=e;const i=t.useContext(x);if("production"!==process.env.NODE_ENV&&!r&&!i)throw new Error("📋 Controller is missing `control` prop. https://react-hook-form.com/api#Controller");const{defaultValuesRef:s,setValue:c,register:d,unregister:m,trigger:u,mode:p,reValidateMode:{isReValidateOnBlur:E,isReValidateOnChange:v},formState:N,formStateRef:{current:{isSubmitted:k,touched:_,errors:T}},updateFormState:I,readFormStateRef:F,fieldsRef:D,fieldArrayNamesRef:R,shallowFieldsStateRef:A}=r||i.control,L=!((e,t)=>[...e].some(e=>((e,t)=>RegExp(`^${t}([|.)\\d+`.replace(/\[/g,"\\[").replace(/\]/g,"\\]")).test(e))(t,e)))(R.current,n),w=()=>!b(h(A.current,n))&&L?h(A.current,n):b(l)?h(s.current,n):l,[O,Y]=t.useState(w()),P=t.useRef(O),B=t.useRef({focus:()=>null}),K=t.useRef(o||(()=>{S(B.current.focus)&&B.current.focus(),"production"!==process.env.NODE_ENV&&(S(B.current.focus)||console.warn("📋 'ref' from Controller render prop must be attached to a React component or a DOM Element whose ref provides a 'focus()' method"))})),M=t.useCallback(e=>!(e=>{let{isOnBlur:t,isOnChange:n,isOnTouch:a,isTouched:l,isReValidateOnBlur:r,isReValidateOnChange:o,isBlurEvent:i,isSubmitted:s,isOnAll:c}=e;return!c&&(!s&&a?!(l||i):(s?r:t)?!i:!(s?o:n)||i)})(Object.assign({isBlurEvent:e,isReValidateOnBlur:E,isReValidateOnChange:v,isSubmitted:k,isTouched:!!h(_,n)},p)),[E,v,k,_,n,p]),z=t.useCallback(e=>{let[t]=e;const n=(e=>{return g(t=e)||!y(t)||!f(e.target)||f(e.target)&&!e.type?e:b(e.target.value)?e.target.checked:e.target.value;var t})(t);return Y(n),P.current=n,n},[]),W=t.useCallback(e=>{if("production"!==process.env.NODE_ENV&&!n)return console.warn("📋 Field is missing `name` prop. https://react-hook-form.com/api#Controller");D.current[n]?D.current[n]=Object.assign({ref:D.current[n].ref},a):(d(Object.defineProperties({name:n,focus:K.current},{value:{set(e){Y(e),P.current=e},get:()=>P.current}}),a),e=b(h(s.current,n))),e&&L&&Y(w())},[a,n,d]);t.useEffect(()=>()=>m(n),[n]),t.useEffect(()=>{"production"!==process.env.NODE_ENV&&(b(O)&&console.warn(`📋 ${n} is missing in the 'defaultValue' prop of either its Controller (https://react-hook-form.com/api#Controller) or useForm (https://react-hook-form.com/api#useForm)`),!L&&b(l)&&console.warn("📋 Controller is missing `defaultValue` prop when using `useFieldArray`. https://react-hook-form.com/api#Controller")),W()},[W]),t.useEffect(()=>{!D.current[n]&&W(!0)});const U=t.useCallback(()=>{F.current.touched&&!h(_,n)&&(function(e,t,n){let a=-1;const l=(e=>/^\w*$/.test(e))(t)?[t]:C(t.replace(/["|']/g,"").replace(/\[/g,".").replace(/\]/g,"").split(".")),r=l.length,o=r-1;for(;++a<r;){const t=l[a];let n=!0;if(a!==o){const r=e[t];n=f(r)||Array.isArray(r)?r:isNaN(+l[a+1])?{}:[]}e[t]=n,e=e[t]}}(_,n),I({touched:_})),M(!0)&&u(n)},[n,I,M,u,F]);return{field:{onChange:t.useCallback(function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return c(n,z(t),{shouldValidate:M(),shouldDirty:!0})},[c,n,M]),onBlur:U,name:n,value:O,ref:B},meta:Object.defineProperties({invalid:!!h(T,n)},{isDirty:{get:()=>!!h(N.dirtyFields,n)},isTouched:{get:()=>!!h(N.touched,n)}})}}(e),i=Object.assign(Object.assign({},l),r);return n?t.isValidElement(n)?t.cloneElement(n,i):t.createElement(n,i):a?a(r,o):null},k=e=>{let{searchFormState:t,controlSearchForm:l}=e;const{t:o}=a.useTranslation(),{errors:i}=t;return n.createElement(n.Fragment,null,n.createElement("span",{className:"mobile-input"},n.createElement(r.Label,{className:"flex-roww flex-gap-2"},o("EKYC_K_NUMBER")||"K Number",n.createElement(r.CustomTooltip,{message:o("EKYC_K_NUMBER_MESSAGE")})),n.createElement(N,{name:"kNumber",control:l,defaultValue:"",rules:{pattern:{value:/^[a-zA-Z0-9-_/]*$/,message:o("ERR_INVALID_APPLICATION_NO")}},render:e=>{let{onChange:t,value:a}=e;return n.createElement(r.TextInput,{value:a||"",onChange:e=>t(e.target.value)})}}),(null==i?void 0:i.kNumber)&&n.createElement(r.CardLabelError,null,i.kNumber.message)))},_=e=>{var a,o,i,s,c;let{parentRoute:d,businessService:m="EKYC",initialStates:u={}}=e;const v=Digit.ULBService.getCurrentTenantId(),g=l.useLocation(),[y,f]=t.useReducer(function(e,t){const n=t.checkPathName?"EKYC.INBOX":"EKYC.SW.INBOX";switch(t.action){case"mutateSearchForm":return Digit.SessionStorage.set(n,{...e,searchForm:t.data}),{...e,searchForm:t.data};case"mutateFilterForm":return Digit.SessionStorage.set(n,{...e,filterForm:t.data}),{...e,filterForm:t.data};case"mutateTableForm":return Digit.SessionStorage.set(n,{...e,tableForm:t.data}),{...e,tableForm:t.data};default:return e}},{filterForm:{},searchForm:{},tableForm:{limit:10,offset:0,sortBy:"createdTime",sortOrder:"DESC"}}),C=t.useMemo(()=>{var e,t;return{tenantId:v,offset:(null==y||null===(e=y.tableForm)||void 0===e?void 0:e.offset)||0,limit:(null==y||null===(t=y.tableForm)||void 0===t?void 0:t.limit)||10,search:(null==y?void 0:y.searchForm)||{}}},[v,null==y||null===(a=y.tableForm)||void 0===a?void 0:a.offset,null==y||null===(o=y.tableForm)||void 0===o?void 0:o.limit,null==y?void 0:y.searchForm]),{isLoading:b,data:h={}}=Digit.Hooks.ekyc.useEkycSurveyorDashboard({},C,{enabled:!!v,keepPreviousData:!0}),S=t.useMemo(()=>{var e,t;return{kno:(null==y||null===(e=y.searchForm)||void 0===e?void 0:e.kNumber)||"",name:(null==y||null===(t=y.searchForm)||void 0===t?void 0:t.kName)||""}},[null==y||null===(i=y.searchForm)||void 0===i?void 0:i.kNumber,null==y||null===(s=y.searchForm)||void 0===s?void 0:s.kName]),x=!(!S.kno&&!S.name),{isLoading:N,data:_}=Digit.Hooks.ekyc.useSearchConnection({tenantId:v,details:S},{enabled:!!v&&!!S.kno,keepPreviousData:!0}),T=t.useMemo(()=>{var e;return x?_?[_]:[]:(null==h||null===(e=h.dashboardInfo)||void 0===e?void 0:e.consumerList)||[]},[x,_,h]),I=t.useMemo(()=>(T||[]).map(e=>{var t,n,a,l,r,o;if(e.connectionDetails)return{applicationNo:(null===(t=e.propertyInfo)||void 0===t?void 0:t.kno)||"",connectionNo:(null===(n=e.propertyInfo)||void 0===n?void 0:n.kno)||"",owner:(null===(a=e.connectionDetails)||void 0===a?void 0:a.consumerName)||"",applicationNumber:(null===(l=e.propertyInfo)||void 0===l?void 0:l.kno)||"",citizenName:(null===(r=e.connectionDetails)||void 0===r?void 0:r.consumerName)||"",status:(null===(o=e.connectionDetails)||void 0===o?void 0:o.statusflag)||"",sla:0};const i=[e.firstName,e.middleName,e.lastName].filter(Boolean).join(" ");return{...e,applicationNo:e.kno||e.applicationNumber||"",connectionNo:e.kno||"",owner:i||e.consumerName||e.citizenName||"",applicationNumber:e.kno||e.applicationNumber||"",citizenName:i||e.consumerName||e.citizenName||"",status:e.status||"",sla:e.sla??0}}),[T]),F=(null==h||null===(c=h.dashboardInfo)||void 0===c?void 0:c.totalRecords)||(null==h?void 0:h.totalCount)||0,D=g.pathname.includes("ekyc/inbox"),R={headerText:D?"EKYC_MODULE":"MODULE_SW"},A=t.useCallback(e=>{let{registerRef:t,searchFormState:a,controlSearchForm:l}=e;return n.createElement(k,{registerRef:t,searchFormState:a,controlSearchForm:l,className:"search"})},[]),L={sortBy:"createdTime",limit:window.Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"DESC"},w={mobileNumber:"",applicationNumber:"",consumerNo:""},O={SearchFormFields:A,onSearchFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),f({action:"mutateTableForm",data:{...L},checkPathName:D}),f({action:"mutateSearchForm",data:e,checkPathName:D})},searchFormDefaultValues:null==y?void 0:y.searchForm,resetSearchFormDefaultValues:w,onSearchFormReset:e=>{e("mobileNumber",null),e("applicationNumber",null),e("consumerNo",null),f({action:"mutateSearchForm",data:w})},className:"search-form-wns-inbox"},Y={FilterFormFields:t.useCallback(e=>n.createElement(n.Fragment,null),[]),onFilterFormSubmit:()=>{},filterFormDefaultValues:"",resetFilterFormDefaultValues:"",onFilterFormReset:()=>{}},P=E({parentRoute:d,onPageSizeChange:e=>{const t=Number(e.target.value);f({action:"mutateTableForm",data:{...y.tableForm,limit:t,offset:0},checkPathName:D})},formState:y,totalCount:F,table:I,dispatch:f,onSortingByData:e=>{if(e.length>0){const[{id:t,desc:n}]=e,a=n?"DESC":"ASC";y.tableForm.sortBy===t&&y.tableForm.sortOrder===a||f({action:"mutateTableForm",data:{...y.tableForm,sortBy:t,sortOrder:n?"DESC":"ASC"},checkPathName:D})}},tenantId:v,checkPathName:D,inboxStyles:{overflowX:"scroll",overflowY:"hidden"},tableStyle:{width:"70%"}});return n.createElement("div",{className:"app-container"},n.createElement(r.InboxComposer,p({isInboxLoading:b||N,PropsForInboxLinks:R},O,Y,{propsForInboxTable:P,formState:y,countData:null==h?void 0:h.dashboardInfo})))},T=e=>{let{size:t=18,color:a="currentColor"}=e;return n.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:a,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),n.createElement("circle",{cx:"12",cy:"7",r:"4"}))},I=e=>{let{size:t=18,color:a="currentColor"}=e;return n.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:a,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("path",{d:"M4 19.5A2.5 2.5 0 0 1 6.5 17H20"}),n.createElement("path",{d:"M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"}))},F=e=>{let{size:t=14}=e;return n.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("polyline",{points:"3 6 5 6 21 6"}),n.createElement("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}))},D=e=>{let{size:t=14}=e;return n.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),n.createElement("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"}))},R=e=>{let{size:t=12}=e;return n.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("path",{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"}),n.createElement("circle",{cx:"12",cy:"10",r:"3"}))},A=e=>{let{size:t=16}=e;return n.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),n.createElement("line",{x1:"5",y1:"12",x2:"19",y2:"12"}))},L=e=>{let{size:t=16}=e;return n.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"}),n.createElement("polyline",{points:"17 21 17 13 7 13 7 21"}),n.createElement("polyline",{points:"7 3 7 8 15 8"}))},w=e=>{let{size:t=16}=e;return n.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("polyline",{points:"20 6 9 17 4 12"}))},O=e=>{let{size:t=16}=e;return n.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))},Y=[{name:"Amit Kumar",id:"SVR001",role:"Surveyor"},{name:"Sanjay Singh",id:"SVR002",role:"Surveyor"},{name:"Rahul Sharma",id:"SVR003",role:"Surveyor"},{name:"Priya Verma",id:"SVR004",role:"Surveyor"}],P=[{name:"MRD - 01 (Central Zone)",code:"MRD01",zone:"Central"},{name:"MRD - 02 (North Zone)",code:"MRD02",zone:"North"},{name:"MRD - 03 (South Zone)",code:"MRD03",zone:"South"},{name:"MRD - 04 (West Zone)",code:"MRD04",zone:"West"},{name:"MRD - 05 (East Zone)",code:"MRD05",zone:"East"},{name:"MRD - 06 (Rohini)",code:"MRD06",zone:"Rohini"},{name:"MRD - 07 (Dwarka)",code:"MRD07",zone:"Dwarka"}],B=e=>{let{mapping:t,onConfirm:a,onCancel:l}=e;return n.createElement("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.35)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3}},n.createElement("div",{style:{background:"#fff",borderRadius:"12px",padding:"28px 28px 24px",width:"400px",boxShadow:"0 20px 60px rgba(0,0,0,0.15)"}},n.createElement("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"16px"}},n.createElement("div",{style:{width:"40px",height:"40px",borderRadius:"50%",background:"#FEF3F2",display:"flex",alignItems:"center",justifyContent:"center"}},n.createElement(F,{size:18})),n.createElement("div",null,n.createElement("div",{style:{fontWeight:"700",fontSize:"16px",color:"#0D1B2A"}},"Remove Mapping"),n.createElement("div",{style:{fontSize:"12px",color:"#6B7B8E"}},"This action cannot be undone"))),n.createElement("p",{style:{fontSize:"13px",color:"#344054",marginBottom:"24px",lineHeight:"1.6"}},"Are you sure you want to remove the mapping between"," ",n.createElement("strong",null,null==t?void 0:t.surveyorName)," and ",n.createElement("strong",null,null==t?void 0:t.mrdName),"?"),n.createElement("div",{style:{display:"flex",gap:"10px",justifyContent:"flex-end"}},n.createElement("button",{onClick:l,style:{background:"none",border:"1px solid #D0D5DD",borderRadius:"8px",padding:"8px 20px",fontWeight:"600",fontSize:"13px",color:"#344054",cursor:"pointer"}},"Cancel"),n.createElement("button",{onClick:a,style:{background:"#B42318",border:"none",borderRadius:"8px",padding:"8px 20px",fontWeight:"600",fontSize:"13px",color:"#fff",cursor:"pointer",display:"flex",alignItems:"center",gap:"6px"}},n.createElement(F,{size:13})," Remove"))))},K=()=>{const{t:e}=a.useTranslation(),[l,o]=t.useState(null),[i,s]=t.useState(null),[c,d]=t.useState([]),[m,u]=t.useState(null),[p,E]=t.useState(null),[v,g]=t.useState(null),[y,f]=t.useState(null),[C,b]=t.useState(null),h=()=>{u(null),E(null),g(null)},S=t.useMemo(()=>[{Header:e("EKYC_SURVEYOR_NAME")||"Surveyor",accessor:"surveyorName",Cell:t=>{let{row:a}=t;return m===a.original.id?n.createElement("div",{style:{minWidth:"180px"}},n.createElement(r.Dropdown,{selected:p,select:E,option:Y,optionKey:"name",t:e,placeholder:"Choose surveyor..."})):n.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px"}},n.createElement("div",{style:{width:"32px",height:"32px",borderRadius:"50%",background:"#EEF4FB",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},n.createElement(T,{size:15,color:"#3A7BD5"})),n.createElement("div",null,n.createElement("div",{style:{fontWeight:"600",fontSize:"13px",color:"#0D1B2A"}},a.original.surveyorName),n.createElement("div",{style:{fontSize:"11px",color:"#6B7B8E"}},"ID: ",a.original.surveyorId)))}},{Header:e("EKYC_MRD_ASSIGNED")||"MRD Assigned",accessor:"mrdName",Cell:t=>{let{row:a}=t;return m===a.original.id?n.createElement("div",{style:{minWidth:"200px"}},n.createElement(r.Dropdown,{selected:v,select:g,option:P,optionKey:"name",t:e,placeholder:"Choose MRD..."})):n.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px"}},n.createElement("div",{style:{width:"32px",height:"32px",borderRadius:"50%",background:"#EEF4FB",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},n.createElement(I,{size:15,color:"#3A7BD5"})),n.createElement("div",null,n.createElement("div",{style:{fontWeight:"600",fontSize:"13px",color:"#0D1B2A"}},a.original.mrdName),n.createElement("div",{style:{fontSize:"11px",color:"#3A7BD5",display:"flex",alignItems:"center",gap:"3px"}},n.createElement(R,{size:10})," ",a.original.zone)))}},{Header:e("ES_COMMON_ACTION")||"Actions",Cell:e=>{let{row:t}=e;return m===t.original.id?n.createElement("div",{style:{display:"flex",gap:"8px"}},n.createElement("button",{onClick:()=>{return e=t.original.id,void(p&&v?c.some(t=>t.id!==e&&t.surveyorId===p.id&&t.mrdCode===v.code)?b({type:"warning",message:"This mapping already exists"}):(d(t=>t.map(t=>t.id!==e?t:{...t,surveyorName:p.name,surveyorId:p.id,mrdName:v.name,mrdCode:v.code,zone:v.zone})),u(null),b({type:"success",message:"Mapping updated successfully"})):b({type:"error",message:"Please select both Surveyor and MRD to save"}));var e},style:{display:"flex",alignItems:"center",gap:"5px",background:"#3A7BD5",color:"#fff",border:"none",borderRadius:"6px",padding:"6px 12px",fontWeight:"600",fontSize:"12px",cursor:"pointer"}},n.createElement(w,{size:13})," Save"),n.createElement("button",{onClick:h,style:{display:"flex",alignItems:"center",gap:"5px",background:"none",border:"1px solid #D0D5DD",borderRadius:"6px",padding:"6px 12px",fontWeight:"600",fontSize:"12px",color:"#344054",cursor:"pointer"}},n.createElement(O,{size:13})," Cancel")):n.createElement("div",{style:{display:"flex",gap:"8px"}},n.createElement("button",{onClick:()=>(e=>{u(e.id),E(Y.find(t=>t.id===e.surveyorId)||null),g(P.find(t=>t.code===e.mrdCode)||null)})(t.original),style:{display:"flex",alignItems:"center",gap:"5px",background:"none",border:"1px solid #D0D5DD",borderRadius:"6px",padding:"6px 12px",color:"#344054",fontSize:"12px",fontWeight:"600",cursor:"pointer"}},n.createElement(D,{size:13})," Edit"),n.createElement("button",{onClick:()=>f(t.original),style:{display:"flex",alignItems:"center",gap:"5px",background:"none",border:"1px solid #FECDCA",borderRadius:"6px",padding:"6px 12px",color:"#B42318",fontSize:"12px",fontWeight:"600",cursor:"pointer"}},n.createElement(F,{size:13})," Remove"))}}],[m,p,v,c,e]);return n.createElement("div",{style:{background:"#F5F7FA",minHeight:"100vh",padding:"0"}},n.createElement(r.Card,{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 24px",marginBottom:"0",borderRadius:"4px"}},n.createElement("div",{style:{display:"flex",alignItems:"center",gap:"12px"}},n.createElement("div",{style:{color:"#3A8DCC"}},n.createElement(I,{size:24})),n.createElement("div",{style:{fontWeight:"700",fontSize:"18px",color:"#0B0C0C"}},e("EKYC_SURVEYOR_MAPPING")||"Surveyor Mapping")),n.createElement("button",{onClick:()=>{b(0!==c.length?{type:"success",message:e("EKYC_MAPPINGS_SAVED_SUCCESS")||"Surveyor mappings saved successfully!"}:{type:"error",message:e("EKYC_NO_MAPPINGS_TO_SAVE")||"No mappings to save"})},disabled:0===c.length,style:{display:"flex",alignItems:"center",gap:"8px",background:0===c.length?"#D0D5DD":"#0F3460",color:"#fff",border:"none",borderRadius:"8px",padding:"10px 20px",fontWeight:"600",fontSize:"14px",cursor:0===c.length?"not-allowed":"pointer",transition:"background 0.2s"}},n.createElement(L,{size:15}),e("EKYC_SAVE_MAPPINGS")||"Save Mappings")),n.createElement("div",{style:{padding:"24px 32px"}},n.createElement("p",{style:{fontSize:"13px",color:"#6B7B8E",marginBottom:"24px",marginTop:"0"}},e("EKYC_MAPPING_SUBHEADER")||"Assign Meter Reading Dairies to surveyors to manage their data access."),n.createElement("div",{style:{display:"grid",gridTemplateColumns:"360px 1fr",gap:"20px",alignItems:"start"}},n.createElement("div",{style:{background:"#fff",borderRadius:"12px",border:"1px solid #E5E9EF",overflow:"hidden"}},n.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px",padding:"16px 20px",borderBottom:"1px solid #F0F2F5",background:"#FAFBFC"}},n.createElement("div",{style:{width:"32px",height:"32px",borderRadius:"8px",background:"#EEF4FB",display:"flex",alignItems:"center",justifyContent:"center"}},n.createElement(I,{size:16,color:"#3A7BD5"})),n.createElement("span",{style:{fontWeight:"700",fontSize:"15px",color:"#0D1B2A"}},e("EKYC_NEW_MAPPING")||"New Mapping")),n.createElement("div",{style:{padding:"20px"}},n.createElement("div",{style:{marginBottom:"16px"}},n.createElement("label",{style:{display:"flex",alignItems:"center",gap:"6px",fontSize:"11px",fontWeight:"700",letterSpacing:"0.06em",color:"#3A7BD5",textTransform:"uppercase",marginBottom:"8px"}},n.createElement(T,{size:12,color:"#3A7BD5"}),e("EKYC_SELECT_SURVEYOR")||"Select Surveyor"),n.createElement(r.Dropdown,{selected:l,select:o,option:Y,optionKey:"name",t:e,placeholder:e("EKYC_SELECT_SURVEYOR_PLACEHOLDER")||"Choose a surveyor..."})),n.createElement("div",{style:{marginBottom:"16px"}},n.createElement("label",{style:{display:"flex",alignItems:"center",gap:"6px",fontSize:"11px",fontWeight:"700",letterSpacing:"0.06em",color:"#3A7BD5",textTransform:"uppercase",marginBottom:"8px"}},n.createElement(I,{size:12,color:"#3A7BD5"}),e("EKYC_SELECT_MRD")||"Select MRD"),n.createElement(r.Dropdown,{selected:i,select:s,option:P,optionKey:"name",t:e,placeholder:e("EKYC_SELECT_MRD_PLACEHOLDER")||"Choose an MRD..."})),i&&n.createElement("div",{style:{background:"#EEF4FB",borderLeft:"3px solid #3A7BD5",borderRadius:"6px",padding:"10px 14px",fontSize:"12px",color:"#0D1B2A",marginBottom:"16px",display:"flex",alignItems:"center",gap:"8px"}},n.createElement(R,{size:13}),n.createElement("span",null,n.createElement("strong",null,i.name)," — ",i.zone," Zone")),l&&n.createElement("div",{style:{background:"#F5F7FA",borderLeft:"3px solid #6B7B8E",borderRadius:"6px",padding:"10px 14px",fontSize:"12px",color:"#0D1B2A",marginBottom:"16px",display:"flex",alignItems:"center",gap:"8px"}},n.createElement(T,{size:13,color:"#6B7B8E"}),n.createElement("span",null,n.createElement("strong",null,l.name)," — ",l.id)),n.createElement("button",{onClick:()=>{l&&i?c.some(e=>e.surveyorId===l.id&&e.mrdCode===i.code)?b({type:"warning",message:e("EKYC_MAPPING_EXISTS")||"This mapping already exists"}):(d(e=>[...e,{id:Date.now(),surveyorName:l.name,surveyorId:l.id,mrdName:i.name,mrdCode:i.code,zone:i.zone}]),s(null),b({type:"success",message:e("EKYC_MAPPING_ADDED")||"Mapping added successfully"})):b({type:"error",message:e("EKYC_SELECT_BOTH_ERROR")||"Please select both Surveyor and MRD"})},disabled:!l||!i,style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",background:l&&i?"#3A7BD5":"#D0D5DD",color:"#fff",border:"none",borderRadius:"8px",padding:"12px",fontWeight:"600",fontSize:"14px",cursor:l&&i?"pointer":"not-allowed",marginTop:"4px",transition:"background 0.2s"}},n.createElement(A,{size:16}),e("EKYC_ADD_TO_LIST")||"Add to Mapping List")),c.length>0&&n.createElement("div",{style:{padding:"12px 20px",borderTop:"1px solid #F0F2F5",background:"#FAFBFC",display:"flex",gap:"16px"}},n.createElement("div",{style:{textAlign:"center",flex:1}},n.createElement("div",{style:{fontSize:"20px",fontWeight:"700",color:"#0F3460"}},c.length),n.createElement("div",{style:{fontSize:"11px",color:"#6B7B8E"}},"Total Mappings")),n.createElement("div",{style:{width:"1px",background:"#E5E9EF"}}),n.createElement("div",{style:{textAlign:"center",flex:1}},n.createElement("div",{style:{fontSize:"20px",fontWeight:"700",color:"#0F3460"}},[...new Set(c.map(e=>e.surveyorId))].length),n.createElement("div",{style:{fontSize:"11px",color:"#6B7B8E"}},"Surveyors")),n.createElement("div",{style:{width:"1px",background:"#E5E9EF"}}),n.createElement("div",{style:{textAlign:"center",flex:1}},n.createElement("div",{style:{fontSize:"20px",fontWeight:"700",color:"#0F3460"}},[...new Set(c.map(e=>e.mrdCode))].length),n.createElement("div",{style:{fontSize:"11px",color:"#6B7B8E"}},"MRDs")))),n.createElement("div",{style:{background:"#fff",borderRadius:"12px",border:"1px solid #E5E9EF",overflow:"hidden",minHeight:"420px"}},n.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid #F0F2F5",background:"#FAFBFC"}},n.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px"}},n.createElement("div",{style:{width:"32px",height:"32px",borderRadius:"8px",background:"#EEF4FB",display:"flex",alignItems:"center",justifyContent:"center"}},n.createElement(T,{size:16,color:"#3A7BD5"})),n.createElement("span",{style:{fontWeight:"700",fontSize:"15px",color:"#0D1B2A"}},e("EKYC_MAPPING_SUMMARY")||"Mapping Summary")),n.createElement("span",{style:{background:c.length>0?"#0F3460":"#E5E9EF",color:c.length>0?"#fff":"#6B7B8E",fontSize:"12px",fontWeight:"700",padding:"3px 10px",borderRadius:"20px"}},c.length," ",e("EKYC_ITEMS")||"items")),n.createElement("div",{style:{padding:"20px"}},c.length>0?n.createElement("div",{style:{border:"1px solid #E5E9EF",borderRadius:"8px",overflow:"hidden"}},n.createElement(r.Table,{t:e,data:c,columns:S,getCellProps:()=>({}),tableClassName:"digit-table"})):n.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"320px",textAlign:"center"}},n.createElement("div",{style:{marginBottom:"16px",opacity:.2}},n.createElement(I,{size:56,color:"#0F3460"})),n.createElement("div",{style:{fontSize:"15px",fontWeight:"700",color:"#0D1B2A",marginBottom:"6px"}},e("EKYC_NO_MAPPINGS")||"No Mappings Created Yet"),n.createElement("div",{style:{fontSize:"13px",color:"#6B7B8E"}},e("EKYC_NO_MAPPINGS_HINT")||"Select a surveyor and MRD on the left to get started.")))))),y&&n.createElement(B,{mapping:y,onConfirm:()=>{d(e=>e.filter(e=>e.id!==y.id)),f(null),b({type:"info",message:e("EKYC_MAPPING_REMOVED")||"Mapping removed"})},onCancel:()=>f(null)}),C&&n.createElement(r.Toast,{label:C.message,error:"error"===C.type,warning:"warning"===C.type,isDsc:!0,onClose:()=>b(null)}))},M=e=>{let{kNumber:o,kName:i,connectionDetails:s,isLoading:c}=e;const{t:d}=a.useTranslation(),m=l.useHistory(),{path:u}=l.useRouteMatch(),[p,E]=t.useState(!1),[v,g]=t.useState({code:"SELF",name:"EKYC_SELF"});if(c)return n.createElement(r.Loader,null);if(!s)return null;const y=(null==s?void 0:s.connectionDetails)||{},f=y.statusflag||"",C="active"===(null==f?void 0:f.toLowerCase())||"A"===f;return n.createElement(n.Fragment,null,n.createElement("div",{className:"ekyc-employee-container"},n.createElement("div",{className:"connection-details-card"},n.createElement("div",{className:"details-card-header"},n.createElement("div",{className:"header-title-wrapper"},n.createElement("div",{className:"header-icon-bg"},n.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#3A7BD5",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),n.createElement("circle",{cx:"12",cy:"7",r:"4"}))),n.createElement("span",{className:"header-title-text"},d("EKYC_K_NUMBER_DETAILS")||"Consumer Identity Details")),n.createElement("span",{className:"status-badge "+(C?"active":"inactive")},C?d("EKYC_ACTIVE_CONNECTION")||"Active Connection":f||d("CS_NA"))),n.createElement("div",{className:"details-card-body"},n.createElement("div",{className:"body-content-row"},n.createElement("div",{className:"detail-section"},n.createElement("div",{className:"section-title"},d("EKYC_VERIFICATION_PARAMETERS")||"Verification Parameters"),n.createElement("div",{className:"data-grid"},n.createElement("div",{className:"data-item"},n.createElement("div",{className:"data-label"},d("EKYC_CONSUMER_NAME")||"Consumer Name"),n.createElement("div",{className:"data-value"},y.consumerName||i||d("CS_NA"))),n.createElement("div",{className:"data-item"},n.createElement("div",{className:"data-label"},d("EKYC_K_NUMBER")||"K Number"),n.createElement("div",{className:"data-value blue"},o||d("CS_NA"))),n.createElement("div",{className:"data-item"},n.createElement("div",{className:"data-label"},d("EKYC_METER_NO")||"Meter Serial No."),n.createElement("div",{className:"data-value"},y.meterNumber||d("CS_NA"))),n.createElement("div",{className:"data-item"},n.createElement("div",{className:"data-label"},d("EKYC_CONNECTION_TYPE")||"Connection Type"),n.createElement("div",{className:"data-value"},y.connectionType||d("CS_NA"))))),n.createElement("div",{className:"vertical-divider"}),n.createElement("div",{className:"detail-section"},n.createElement("div",{className:"section-title"},d("EKYC_ADDRESS_AND_CONTACT")||"Address & Contact"),n.createElement("div",{className:"address-block"},n.createElement("div",{className:"icon-wrapper-small"},n.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#6B7B8E",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("path",{d:"M21 10c0 7-9 13-9 13S3 17 3 10a9 9 0 0 1 18 0z"}),n.createElement("circle",{cx:"12",cy:"10",r:"3"}))),n.createElement("div",null,n.createElement("div",{className:"data-label"},d("EKYC_ADDRESS")||"Service Address"),n.createElement("div",{className:"address-text"},y.address||d("CS_NA")))),n.createElement("div",{className:"contact-row"},n.createElement("div",{className:"contact-item"},n.createElement("div",{className:"icon-wrapper-small"},n.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#6B7B8E",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("rect",{x:"5",y:"2",width:"14",height:"20",rx:"2",ry:"2"}),n.createElement("line",{x1:"12",y1:"18",x2:"12.01",y2:"18"}))),n.createElement("div",null,n.createElement("div",{className:"data-label"},d("EKYC_PHONE_NO")||"Contact"),n.createElement("div",{className:"address-text"},y.phoneNumber||d("CS_NA")))),n.createElement("div",{className:"contact-item"},n.createElement("div",{className:"icon-wrapper-small"},n.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#6B7B8E",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("circle",{cx:"12",cy:"12",r:"4"}),n.createElement("path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-3.92 7.94"}))),n.createElement("div",null,n.createElement("div",{className:"data-label"},d("EKYC_EMAIL")||"Email Address"),n.createElement("div",{className:"address-text"},y.email||d("CS_NA")))))))),n.createElement("div",{className:"details-card-footer"},n.createElement("div",{className:"footer-meta-text"},null!=s&&s.lastVerified?`${d("EKYC_LAST_VERIFIED")||"Last verified:"} ${s.lastVerified}`:""),n.createElement("div",{className:"action-btns-container",style:{fontSize:"12px"}},n.createElement("button",{onClick:()=>E(!0),className:"primary-action-btn",style:{fontSize:"12px"}},d("EKYC_START_REVIEW")||"Start Review",n.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),n.createElement("polyline",{points:"12 5 19 12 12 19"}))))))),p&&n.createElement(r.Modal,{headerBarMain:d("EKYC_SELECT_VERIFICATION_TYPE"),headerBarEnd:n.createElement("span",{onClick:()=>E(!1),style:{cursor:"pointer",padding:"8px"}},"X"),actionSaveLabel:d("ES_COMMON_CONFIRM"),actionSaveOnSubmit:()=>{const e=u.includes("/create-kyc")?u.replace("/create-kyc",""):u.replace("/k-details","");m.push(e+"/consumer-details",{kNumber:o,selectedOption:v,connectionDetails:s}),E(!1)},actionCancelLabel:d("ES_COMMON_CANCEL"),actionCancelOnSubmit:()=>E(!1),style:{borderRadius:"12px"}},n.createElement("div",{style:{padding:"24px"}},n.createElement(r.RadioButtons,{name:"verificationType",options:[{code:"SELF",name:"EKYC_SELF"},{code:"OTHER",name:"EKYC_OTHER"}],optionsKey:"name",selectedOption:v,onSelect:g,style:{display:"flex",flexDirection:"column",gap:"12px",buttonStyle:{borderRadius:"5px"}},t:d}))))},z=()=>{const{t:e}=a.useTranslation(),[l,o]=t.useState(()=>{const e=sessionStorage.getItem("EKYC_CREATE_SEARCH_PARAMS");return e?JSON.parse(e):{kNumber:"",kName:""}}),[i,s]=t.useState(()=>"true"===sessionStorage.getItem("EKYC_CREATE_SEARCH_PERFORMED")),[c,d]=t.useState(null),[u,p,E]=Digit.Hooks.useSessionStorage("EKYC_CREATE",{}),v=Digit.ULBService.getCurrentTenantId(),{isLoading:g,data:y}=Digit.Hooks.ekyc.useSearchConnection({tenantId:v,details:{kno:l.kNumber,name:l.kName}},{enabled:i&&!!l.kNumber&&!!l.kName,onError:t=>{var n,a,l,r;d({error:!0,label:(null==t||null===(n=t.response)||void 0===n||null===(a=n.data)||void 0===a||null===(l=a.Errors)||void 0===l||null===(r=l[0])||void 0===r?void 0:r.message)||e("EKYC_SEARCH_ERROR_PLEASE_ENTER_THE_CORRECT_CREDENTIALS")}),s(!1),sessionStorage.removeItem("EKYC_CREATE_SEARCH_PERFORMED")}});return n.createElement(m,{onSearch:t=>{if(!t.kNumber&&!t.kName)return o({kNumber:"",kName:""}),s(!1),sessionStorage.removeItem("EKYC_CREATE_SEARCH_PARAMS"),sessionStorage.removeItem("EKYC_CREATE_SEARCH_PERFORMED"),void E();t.kNumber&&t.kName?(o(t),s(!0),sessionStorage.getItem("EKYC_K_NUMBER")!==t.kNumber&&(E(),Object.keys(sessionStorage).forEach(e=>{e.startsWith("EKYC_")&&"EKYC_CREATE"!==e&&sessionStorage.removeItem(e)})),sessionStorage.setItem("EKYC_CREATE_SEARCH_PARAMS",JSON.stringify(t)),sessionStorage.setItem("EKYC_CREATE_SEARCH_PERFORMED","true"),sessionStorage.setItem("EKYC_K_NUMBER",t.kNumber)):d({error:!0,label:e("EKYC_FILL_ALL_FIELDS")})},searchParams:l},i&&n.createElement(M,{kNumber:l.kNumber,kName:l.kName,connectionDetails:y,isLoading:g}),!i&&!g&&n.createElement(r.Card,{style:{textAlign:"center",padding:"40px"}},n.createElement("div",{style:{color:"#667085"}},e("EKYC_SEARCH_TO_VIEW_DETAILS"))),c&&n.createElement(r.Toast,{error:c.error,label:c.label,onClose:()=>{d(null)},isDsc:!0}))},W=e=>{let{jumpTo:t,state:a}=e;const o=l.useHistory();return n.createElement(r.LinkButton,{label:n.createElement(r.EditIcon,{style:{width:"20px",height:"20px",fill:"#F47738"}}),style:{margin:0,padding:0},onClick:function(){o.push(t,{...a,isEditing:!0})}})},U=e=>null!=e&&""!==e?e:"N/A",H=(e,t)=>!0===e||"true"===e||"yes"===String(e).toLowerCase()?t("CORE_COMMON_YES"):!1===e||"false"===e||"no"===String(e).toLowerCase()?t("CORE_COMMON_NO"):"true"===e?t("CORE_COMMON_YES"):"false"===e?t("CORE_COMMON_NO"):"N/A",V=e=>{let{title:t,fields:a,newData:l,oldData:o,t:i,jumpTo:s,state:c}=e;return n.createElement("div",{className:"review-section-wrapper",style:{marginBottom:"48px",background:"#fff",borderRadius:"12px",border:"1px solid #EAECF0",overflow:"hidden"}},n.createElement("div",{style:{padding:"20px 24px",background:"#F9FAFB",borderBottom:"1px solid #EAECF0",display:"flex",justifyContent:"space-between",alignItems:"center"}},n.createElement(r.CardSubHeader,{style:{margin:0,fontSize:"18px",color:"#101828",fontWeight:"700"}},t),s&&n.createElement(W,{jumpTo:s,state:c})),n.createElement("div",{style:{padding:"0 24px"}},n.createElement("table",{style:{width:"100%",borderCollapse:"collapse",tableLayout:"fixed"}},n.createElement("thead",null,n.createElement("tr",null,n.createElement("th",{style:{padding:"16px 0",textAlign:"left",color:"#667085",fontSize:"12px",fontWeight:"600",textTransform:"uppercase",width:"30%"}},i("EKYC_FIELD_NAME")),n.createElement("th",{style:{padding:"16px 0",textAlign:"left",color:"#667085",fontSize:"12px",fontWeight:"600",textTransform:"uppercase",width:"35%"}},i("EKYC_EXISTING_INFORMATION")),n.createElement("th",{style:{padding:"16px 0",textAlign:"left",color:"#667085",fontSize:"12px",fontWeight:"600",textTransform:"uppercase",width:"35%"}},i("EKYC_PROPOSED_UPDATES")))),n.createElement("tbody",null,a.map((e,t)=>{const a=null==l?void 0:l[e.key],r=null==o?void 0:o[e.key],s=o&&String(a)!==String(r)&&null!=r;return n.createElement("tr",{key:t,style:{borderTop:"1px solid #F2F4F7"}},n.createElement("td",{style:{padding:"16px 0",fontSize:"14px",color:"#344054",fontWeight:"500"}},i(e.label)),n.createElement("td",{style:{padding:"16px 0",fontSize:"14px",color:"#667085"}},e.isBool?H(r,i):U(r)),n.createElement("td",{style:{padding:"16px 0",fontSize:"14px",color:s?"#1B8B32":"#101828",fontWeight:s?"700":"400"}},n.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},e.isBool?H(a,i):U(a),s&&n.createElement("span",{style:{background:"#ECFDF3",color:"#067647",padding:"2px 8px",borderRadius:"12px",fontSize:"10px",fontWeight:"600"}},i("EKYC_CHANGED")))))})))))},j=()=>{var e,o,i,s,c,d,m,u,p,E,g,y,f,C,b,h,S,x,N,k,_,T,I,F,D,R,A,L,w,O,Y,P,B,K,M,z,W,U,H,j,G;const{t:$}=a.useTranslation(),X=l.useHistory(),q=l.useLocation(),[Z,Q]=t.useState(!1),[J,ee]=t.useState(!1),[te,ne]=t.useState(!1),[ae,le]=t.useState(""),re=q.state||{},{kNumber:oe,kno:ie,edits:se={}}=re,ce=oe||ie,{aadhaarData:de={},addressDetails:me={},propertyDetails:ue={},meterDetails:pe={}}=se,Ee=Digit.ULBService.getCurrentTenantId(),ve=Digit.Hooks.ekyc.useEkycWorkflow(Ee),ge=Digit.Hooks.ekyc.useEkycUpdate(Ee),{data:ye,isLoading:fe}=Digit.Hooks.ekyc.useEkycSearchReview({kno:ce,fetchType:"REVIEW"},Ee,{enabled:!!ce}),{newData:Ce,oldData:be}=((e,t)=>{const n=e&&Object.keys(e).length>0?e:(null==t?void 0:t.reviewData)||{},a=(null==n?void 0:n.applicationReviewInfo)||(null==n?void 0:n.applicationReview)||n,l=(Array.isArray(a)?a[0]:a)||{};return{newData:(null==l?void 0:l.newData)||l,oldData:(null==l?void 0:l.oldData)||null}})(ye,re),he=e=>{if(!e)return null;const t=(null==e?void 0:e.connectionDetails)||e||{},n=(null==e?void 0:e.addressDetails)||e||{},a=(null==e?void 0:e.propertyInfo)||e||{},l=(null==e?void 0:e.meterDetails)||e||{};return{connection:{consumerName:(null==t?void 0:t.consumerName)||(null!=t&&t.firstName?[t.firstName,t.middleName,t.lastName].filter(Boolean).join(" "):null),address:(null==t?void 0:t.address)||(null==t?void 0:t.addressRaw),connectionType:(null==t?void 0:t.connectionType)||(null==t?void 0:t.connectionCategory),meterNumber:(null==t?void 0:t.meterNumber)||(null==t?void 0:t.meterNo),phoneNumber:(null==t?void 0:t.phoneNumber)||(null==t?void 0:t.mobileNo)||(null==t?void 0:t.mobileNumber),email:null==t?void 0:t.email,statusflag:(null==t?void 0:t.statusflag)||(null==t?void 0:t.statusFlag),ekycStatus:null==t?void 0:t.ekycStatus,knumber:(null==t?void 0:t.knumber)||(null==t?void 0:t.kno)},address:{fullAddress:(null==n?void 0:n.fullAddress)||(null==n?void 0:n.addressRaw),flatHouseNumber:(null==n?void 0:n.flatHouseNumber)||(null==n?void 0:n.flatNo),buildingTower:(null==n?void 0:n.buildingTower)||(null==n?void 0:n.building),landmark:null==n?void 0:n.landmark,pinCode:(null==n?void 0:n.pinCode)||(null==n?void 0:n.pincode),ward:(null==n?void 0:n.ward)||(null==n?void 0:n.locality),assembly:null==n?void 0:n.assembly,gpsValid:null==n?void 0:n.gpsValid,latitude:null==n?void 0:n.latitude,longitude:null==n?void 0:n.longitude,mobileNo:(null==n?void 0:n.mobileNo)||(null==n?void 0:n.mobileNumber),whatsappNo:null==n?void 0:n.whatsappNo,email:null==n?void 0:n.email,noOfPerson:(null==n?void 0:n.noOfPerson)||(null==n?void 0:n.noOfPersons),knumber:(null==n?void 0:n.knumber)||(null==n?void 0:n.kno),doorPhotoFilestoreId:null==n?void 0:n.doorPhotoFilestoreId},property:{kno:null==a?void 0:a.kno,pidNumber:null==a?void 0:a.pidNumber,typeOfConnection:null==a?void 0:a.typeOfConnection,connectionCategory:null==a?void 0:a.connectionCategory,userType:null==a?void 0:a.userType,numberOfFloors:(null==a?void 0:a.numberOfFloors)||(null==a?void 0:a.noOfFloor),tenantName:null==a?void 0:a.tenantName,tenantMobile:null==a?void 0:a.tenantMobile,ekycStatus:null==a?void 0:a.ekycStatus,propertyDocumentFileStoreId:null==a?void 0:a.propertyDocumentFileStoreId,buildingImageFileStoreId:null==a?void 0:a.buildingImageFileStoreId},meter:{kno:null==l?void 0:l.kno,metered:"METERED"===(null==l?void 0:l.meterStatus)||(null==l?void 0:l.metered),meterNumber:(null==l?void 0:l.meterNumber)||(null==l?void 0:l.meterNo),meterMake:null==l?void 0:l.meterMake,meterLocationAddress:null==l?void 0:l.meterLocationAddress,meterLatitude:null==l?void 0:l.meterLatitude,meterLongitude:null==l?void 0:l.meterLongitude,workingStatus:null==l?void 0:l.workingStatus,lastBillRaised:null==l?void 0:l.lastBillRaised,systemMeterId:null==l?void 0:l.systemMeterId,meterPhotoFileStoreId:null==l?void 0:l.meterPhotoFileStoreId}}},Se=he(Ce),xe=he(be),Ne={...null==Se?void 0:Se.connection,consumerName:(null==de?void 0:de.name)||(null==Se||null===(e=Se.connection)||void 0===e?void 0:e.consumerName),phoneNumber:(null==de?void 0:de.mobileNumber)||(null==Se||null===(o=Se.connection)||void 0===o?void 0:o.phoneNumber),knumber:(null==Se||null===(i=Se.connection)||void 0===i?void 0:i.knumber)||ce},ke={...null==Se?void 0:Se.address,fullAddress:(null==me?void 0:me.fullAddress)||(null==Se||null===(s=Se.address)||void 0===s?void 0:s.fullAddress),flatHouseNumber:(null==me?void 0:me.flatHouseNumber)||(null==me?void 0:me.flatNo)||(null==Se||null===(c=Se.address)||void 0===c?void 0:c.flatHouseNumber),buildingTower:(null==me?void 0:me.buildingTower)||(null==me?void 0:me.building)||(null==Se||null===(d=Se.address)||void 0===d?void 0:d.buildingTower),landmark:(null==me?void 0:me.landmark)||(null==Se||null===(m=Se.address)||void 0===m?void 0:m.landmark),pinCode:(null==me?void 0:me.pinCode)||(null==me?void 0:me.pincode)||(null==Se||null===(u=Se.address)||void 0===u?void 0:u.pinCode),ward:(null==me?void 0:me.ward)||(null==Se||null===(p=Se.address)||void 0===p?void 0:p.ward),assembly:(null==me?void 0:me.assembly)||(null==Se||null===(E=Se.address)||void 0===E?void 0:E.assembly),gpsValid:void 0!==(null==me?void 0:me.gpsValid)?me.gpsValid:null==Se||null===(g=Se.address)||void 0===g?void 0:g.gpsValid,latitude:(null==me?void 0:me.latitude)||(null==Se||null===(y=Se.address)||void 0===y?void 0:y.latitude),longitude:(null==me?void 0:me.longitude)||(null==Se||null===(f=Se.address)||void 0===f?void 0:f.longitude),mobileNo:(null==me?void 0:me.mobileNo)||(null==de?void 0:de.mobileNumber)||(null==Se||null===(C=Se.address)||void 0===C?void 0:C.mobileNo),whatsappNo:(null==me?void 0:me.whatsappNo)||(null==de?void 0:de.whatsappNumber)||(null==Se||null===(b=Se.address)||void 0===b?void 0:b.whatsappNo),email:(null==me?void 0:me.email)||(null==Se||null===(h=Se.address)||void 0===h?void 0:h.email),noOfPerson:(null==me?void 0:me.noOfPerson)||(null==de?void 0:de.noOfPersons)||(null==Se||null===(S=Se.address)||void 0===S?void 0:S.noOfPerson),knumber:(null==me?void 0:me.knumber)||(null==Se||null===(x=Se.address)||void 0===x?void 0:x.knumber)||ce,doorPhotoFilestoreId:(null==me?void 0:me.doorPhotoFileStoreId)||(null==Se||null===(N=Se.address)||void 0===N?void 0:N.doorPhotoFilestoreId)},_e={...null==Se?void 0:Se.property,kno:(null==Se||null===(k=Se.property)||void 0===k?void 0:k.kno)||ce,pidNumber:(null==ue?void 0:ue.pidNumber)||(null==Se||null===(_=Se.property)||void 0===_?void 0:_.pidNumber),typeOfConnection:(null==ue||null===(T=ue.connectionTypeData)||void 0===T?void 0:T.label)||(null==Se||null===(I=Se.property)||void 0===I?void 0:I.typeOfConnection),connectionCategory:(null==ue||null===(F=ue.connectionCategoryData)||void 0===F?void 0:F.label)||(null==Se||null===(D=Se.property)||void 0===D?void 0:D.connectionCategory),userType:(null==ue||null===(R=ue.userTypeData)||void 0===R?void 0:R.label)||(null==Se||null===(A=Se.property)||void 0===A?void 0:A.userType),numberOfFloors:(null==ue||null===(L=ue.noOfFloorsData)||void 0===L?void 0:L.label)||(null==Se||null===(w=Se.property)||void 0===w?void 0:w.numberOfFloors),propertyDocumentFileStoreId:(null==ue?void 0:ue.propertyDocumentFileStoreId)||(null==Se||null===(O=Se.property)||void 0===O?void 0:O.propertyDocumentFileStoreId)},Te={...null==Se?void 0:Se.meter,kno:(null==pe?void 0:pe.kno)||(null==Se||null===(Y=Se.meter)||void 0===Y?void 0:Y.kno)||ce,metered:"Metered"===(null==pe||null===(P=pe.meterStatusData)||void 0===P?void 0:P.value)||(null==Se||null===(B=Se.meter)||void 0===B?void 0:B.metered),meterNumber:null==Se||null===(K=Se.meter)||void 0===K?void 0:K.meterNumber,meterMake:(null==pe?void 0:pe.meterMake)||(null==Se||null===(M=Se.meter)||void 0===M?void 0:M.meterMake),meterLocationAddress:(null==pe?void 0:pe.meterLocation)||(null==Se||null===(z=Se.meter)||void 0===z?void 0:z.meterLocationAddress),workingStatus:"Working"===(null==pe||null===(W=pe.workingStatusData)||void 0===W?void 0:W.value)||(null==Se||null===(U=Se.meter)||void 0===U?void 0:U.workingStatus),lastBillRaised:"Yes"===(null==pe||null===(H=pe.lastBillRaisedData)||void 0===H?void 0:H.value)||(null==Se||null===(j=Se.meter)||void 0===j?void 0:j.lastBillRaised),meterPhotoFileStoreId:(null==pe?void 0:pe.meterPhotoFileStoreId)||(null==Se||null===(G=Se.meter)||void 0===G?void 0:G.meterPhotoFileStoreId)},Ie=e=>{e&&(le("https://dev-djb.nitcon.in/filestore/v1/files/id?tenantId=dl.djb&fileStoreId="+e),ne(!0))};if(fe||J)return n.createElement(r.Loader,null);const Fe="/digit-ui/employee/ekyc";return n.createElement("div",{className:"employeeCard overflow-y-scroll"},n.createElement(r.Card,{style:{padding:"32px"}},n.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"40px",borderBottom:"1px solid #EAECF0",paddingBottom:"20px"}},n.createElement(r.CardHeader,{style:{margin:0,fontSize:"28px"}},$("EKYC_REVIEW_APPLICATION")),n.createElement("div",{style:{background:"#F9FAFB",border:"1px solid #EAECF0",borderRadius:"24px",padding:"8px 20px",fontSize:"14px",color:"#475467",fontWeight:"500"}},$("EKYC_K_NUMBER"),": ",n.createElement("span",{style:{color:"#101828",fontWeight:"700"}},ce))),n.createElement(V,{title:$("EKYC_CONNECTION_DETAILS"),fields:[{label:"EKYC_K_NUMBER",key:"knumber"},{label:"EKYC_CONSUMER_NAME",key:"consumerName"},{label:"EKYC_ADDRESS",key:"address"},{label:"EKYC_CONNECTION_TYPE",key:"connectionType"},{label:"EKYC_METER_NO",key:"meterNumber"},{label:"EKYC_MOBILE_NO",key:"phoneNumber"},{label:"EKYC_EMAIL",key:"email"},{label:"EKYC_STATUS_FLAG",key:"statusflag"},{label:"EKYC_STATUS",key:"ekycStatus"}],newData:Ne,oldData:null==xe?void 0:xe.connection,t:$,jumpTo:Fe+"/consumer-details",state:{...re,reviewData:ye,edits:se}}),n.createElement(V,{title:$("EKYC_ADDRESS_DETAILS"),fields:[{label:"EKYC_FULL_ADDRESS",key:"fullAddress"},{label:"EKYC_FLAT_HOUSE_NO",key:"flatHouseNumber"},{label:"EKYC_BUILDING_TOWER",key:"buildingTower"},{label:"EKYC_LANDMARK",key:"landmark"},{label:"EKYC_PINCODE",key:"pinCode"},{label:"EKYC_LOCALITY",key:"ward"},{label:"EKYC_ASSEMBLY",key:"assembly"},{label:"EKYC_GPS_VALID",key:"gpsValid",isBool:!0},{label:"EKYC_LATITUDE",key:"latitude"},{label:"EKYC_LONGITUDE",key:"longitude"},{label:"EKYC_MOBILE_NO",key:"mobileNo"},{label:"EKYC_WHATSAPP_NO",key:"whatsappNo"},{label:"EKYC_EMAIL",key:"email"},{label:"EKYC_NO_OF_PERSONS",key:"noOfPerson"},{label:"EKYC_K_NUMBER",key:"knumber"}],newData:ke,oldData:null==xe?void 0:xe.address,t:$,jumpTo:Fe+"/address-details",state:{...re,reviewData:ye,edits:se}}),n.createElement(V,{title:$("EKYC_PROPERTY_INFO"),fields:[{label:"EKYC_CONNECTION_CATEGORY",key:"connectionCategory"},{label:"EKYC_PID_NUMBER",key:"pidNumber"},{label:"EKYC_TYPE_OF_CONNECTION",key:"typeOfConnection"},{label:"EKYC_USER_TYPE",key:"userType"},{label:"EKYC_FLOOR_COUNT",key:"numberOfFloors"},{label:"EKYC_TENANT_NAME",key:"tenantName"},{label:"EKYC_TENANT_MOBILE",key:"tenantMobile"},{label:"EKYC_STATUS",key:"ekycStatus"}],newData:_e,oldData:null==xe?void 0:xe.property,t:$,jumpTo:Fe+"/property-info",state:{...re,reviewData:ye,edits:se}}),n.createElement(V,{title:$("EKYC_METER_DETAILS"),fields:[{label:"EKYC_METERED",key:"metered",isBool:!0},{label:"EKYC_METER_NO",key:"meterNumber"},{label:"EKYC_METER_MAKE",key:"meterMake"},{label:"EKYC_METER_LOCATION_ADDRESS",key:"meterLocationAddress"},{label:"EKYC_METER_LATITUDE",key:"meterLatitude"},{label:"EKYC_METER_LONGITUDE",key:"meterLongitude"},{label:"EKYC_WORKING_STATUS",key:"workingStatus",isBool:!0},{label:"EKYC_LAST_BILL_RAISED",key:"lastBillRaised",isBool:!0},{label:"EKYC_SYSTEM_METER_ID",key:"systemMeterId"}],newData:Te,oldData:null==xe?void 0:xe.meter,t:$,jumpTo:Fe+"/meter-details",state:{...re,reviewData:ye,edits:se}}),n.createElement("div",{style:{marginTop:"40px"}},n.createElement(r.CardSubHeader,{style:{marginBottom:"20px"}},$("EKYC_DOCUMENTS")),n.createElement(r.StatusTable,{style:{maxWidth:"600px"}},n.createElement(r.Row,{label:$("EKYC_DOOR_PHOTO"),text:$(ke.doorPhotoFilestoreId?"EKYC_PHOTO_AVAILABLE":"CS_NA"),actionButton:ke.doorPhotoFilestoreId&&n.createElement("div",{onClick:()=>Ie(ke.doorPhotoFilestoreId)},n.createElement(r.GenericFileIcon,{style:{cursor:"pointer",fill:"#F47738"}}))}),n.createElement(r.Row,{label:$("EKYC_METER_PHOTO"),text:$(Te.meterPhotoFileStoreId?"EKYC_PHOTO_AVAILABLE":"CS_NA"),actionButton:Te.meterPhotoFileStoreId&&n.createElement("div",{onClick:()=>Ie(Te.meterPhotoFileStoreId)},n.createElement(r.GenericFileIcon,{style:{cursor:"pointer",fill:"#F47738"}}))}),n.createElement(r.Row,{label:$("EKYC_BUILDING_IMAGE"),text:$(_e.buildingImageFileStoreId?"EKYC_PHOTO_AVAILABLE":"CS_NA"),actionButton:_e.buildingImageFileStoreId&&n.createElement("div",{onClick:()=>Ie(_e.buildingImageFileStoreId)},n.createElement(r.GenericFileIcon,{style:{cursor:"pointer",fill:"#F47738"}}))}),n.createElement(r.Row,{label:$("EKYC_PROPERTY_DOCUMENTS"),text:$(_e.propertyDocumentFileStoreId?"EKYC_DOCS_AVAILABLE":"CS_NA"),actionButton:_e.propertyDocumentFileStoreId&&n.createElement("div",{onClick:()=>Ie(_e.propertyDocumentFileStoreId)},n.createElement(r.GenericFileIcon,{style:{cursor:"pointer",fill:"#F47738"}}))}))),n.createElement("div",{style:{marginTop:"40px",paddingTop:"30px",borderTop:"1px solid #EAECF0"}},n.createElement(r.CheckBox,{id:"agreeDeclaration",name:"agreeDeclaration",label:n.createElement("span",{style:{fontSize:"16px",color:"#344054"}},$("EKYC_FINAL_DECLARATION")),onChange:()=>Q(!Z),checked:Z}))),n.createElement(r.ActionBar,{style:{position:"static",marginTop:"32px",display:"flex",justifyContent:"flex-end"}},n.createElement(r.SubmitBar,{label:$("EKYC_REJECT"),onSubmit:function(){try{var e,t,n;const a={RequestInfo:{apiId:"Rainmaker",ver:"1.0",msgId:"message-id",authToken:null===(e=Digit.UserService.getUser())||void 0===e?void 0:e.access_token},kno:ce,action:"REJECTED",remarks:"Application rejected by reviewer",reviewedBy:null===(t=Digit.UserService.getUser())||void 0===t||null===(n=t.info)||void 0===n?void 0:n.userName,role:"ZRO"},l=v(function(){return Promise.resolve(ve.mutateAsync(a)).then(function(e){e&&X.push("/digit-ui/employee/ekyc/response",{success:!0,result:e})})},function(e){console.error("Reject Error:",e)});return Promise.resolve(l&&l.then?l.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},disabled:!Z}),n.createElement(r.SubmitBar,{label:$("EKYC_APPROVE"),onSubmit:function(){try{var e,t,n;const a={RequestInfo:{apiId:"Rainmaker",ver:"1.0",msgId:"message-id",authToken:null===(e=Digit.UserService.getUser())||void 0===e?void 0:e.access_token},kno:ce,action:"APPROVED",remarks:"All documents verified",reviewedBy:null===(t=Digit.UserService.getUser())||void 0===t||null===(n=t.info)||void 0===n?void 0:n.userName,role:"ZRO"},l=v(function(){return Promise.resolve(ve.mutateAsync(a)).then(function(e){e&&X.push("/digit-ui/employee/ekyc/response",{success:!0,result:e})})},function(e){console.error("Approve Error:",e)});return Promise.resolve(l&&l.then?l.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},disabled:!Z}),n.createElement(r.SubmitBar,{label:$("EKYC_SUBMIT_APPLICATION"),onSubmit:function(){try{ee(!0);const e=function(e,t){try{var n=v(function(){return Promise.resolve(ge.mutateAsync({kno:ce,tenantId:Ee,newData:{connectionDetails:Ne,addressDetails:ke,propertyInfo:_e,meterDetails:Te}})).then(function(e){e&&X.push("/digit-ui/employee/ekyc/response",{success:!0,result:e})})},function(e){console.error("Submit Error:",e)})}catch(e){return t(!0,e)}return n&&n.then?n.then(t.bind(null,!1),t.bind(null,!0)):t(!1,n)}(0,function(e,t){if(ee(!1),e)throw t;return t});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},disabled:!Z})),te&&n.createElement("div",{style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(0,0,0,0.7)",display:"flex",justifyContent:"center",alignItems:"center",zIndex:1e4}},n.createElement("div",{style:{position:"relative",backgroundColor:"#fff",padding:"30px",borderRadius:"12px",maxWidth:"600px",width:"100%",maxHeight:"70vh",overflow:"auto",boxShadow:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)"}},n.createElement("div",{onClick:()=>ne(!1),style:{position:"absolute",top:"10px",right:"10px",cursor:"pointer",fontWeight:"bold",fontSize:"20px",color:"#333",background:"#eee",width:"30px",height:"30px",display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"50%"}},"×"),n.createElement("img",{src:ae,alt:"Document Preview",style:{maxWidth:"100%",height:"auto",display:"block"},onError:e=>{e.target.style.display="none",e.target.nextSibling.style.display="block"}}),n.createElement("div",{style:{display:"none",padding:"40px",textAlign:"center"}},n.createElement("p",null,$("EKYC_DOCUMENT_PREVIEW_NOT_AVAILABLE")),n.createElement(r.LinkButton,{label:$("EKYC_OPEN_IN_NEW_TAB"),onClick:()=>window.open(ae,"_blank")})))))};var G,$=(G=n.createContext(void 0),"undefined"!=typeof window&&(window.ReactQueryClientContext=G),G);const X=e=>{let{config:a,onSelect:o,formData:i}=e;const s=l.useLocation().state||{},c=Digit.ULBService.getCurrentTenantId(),d=(null==s?void 0:s.kNumber)||(null==s?void 0:s.kno)||(null==i?void 0:i.kNumber)||(null==i?void 0:i.kno)||sessionStorage.getItem("EKYC_K_NUMBER"),{isLoading:m,data:u}=Digit.Hooks.ekyc.useSearchConnection({tenantId:c,details:{kno:d}},{enabled:!!d,cacheTime:0}),p=Digit.Hooks.ekyc.useEkycUpdate(c),E=(null==i?void 0:i.aadhaarVerification)||{},[g,y]=t.useState(E.kno||d||""),[f,C]=t.useState(E.consumerType?{name:E.consumerType}:null),[b,h]=t.useState(E.occupantType?{name:E.occupantType}:null),[S,x]=t.useState(E.categoryType?{name:E.categoryType}:null),[N,k]=t.useState(E.consumerName||""),[_,T]=t.useState(E.firstName||""),[I,F]=t.useState(E.middleName||""),[D,R]=t.useState(E.lastName||""),[A,L]=t.useState(E.gender?{name:E.gender}:null),[w,O]=t.useState(E.parentSpouseName||""),[Y,P]=t.useState(E.relation||""),[B,K]=t.useState(E.mobile||""),[M,z]=t.useState(E.whatsapp||""),[W,U]=t.useState(E.email||""),[H,V]=t.useState(E.residents||""),[j,G]=t.useState(E.documentProof||null),[$,X]=t.useState(E.documentId||null),[q,Z]=t.useState(E.ownerMobile||""),[Q,J]=t.useState(E.tenantVerification||""),[ee,te]=t.useState(E.designation||""),[ne,ae]=t.useState(E.department||""),[le,re]=t.useState(E.employeeId||""),[oe,ie]=t.useState(E.landline||""),[se,ce]=t.useState(E.entityRelation||""),[de,me]=t.useState(E.contactPerson||""),[ue,pe]=t.useState(E.entityName||""),[Ee,ve]=t.useState(E.idProof?{name:E.idProof}:null),[ge,ye]=t.useState(E.idNumber||""),[fe,Ce]=t.useState(E.documentNumber||""),[be,he]=t.useState(E.identityType?{name:E.identityType}:null),[Se,xe]=t.useState(E.idFile||null),[Ne,ke]=t.useState(E.consent||!1),[_e,Te]=t.useState(E.informantIsConsumer??!0),[Ie,Fe]=t.useState(E.informantName||""),[De,Re]=t.useState(E.informantRelation||""),[Ae,Le]=t.useState(null);t.useEffect(()=>{const e=u||(null==i?void 0:i.connectionDetails),t=(null==e?void 0:e.connectionDetails)||e||{},n=(null==e?void 0:e.addressDetails)||{};if(t&&Object.keys(t).length>0&&!E.firstName){if(!g&&d&&y(d),t.firstName)T(t.firstName),t.middleName&&F(t.middleName),t.lastName&&R(t.lastName);else if(t.consumerName){k(t.consumerName);const e=t.consumerName.trim().split(/\s+/);T(e[0]||""),2===e.length&&R(e[1]),e.length>2&&(F(e.slice(1,-1).join(" ")),R(e[e.length-1]))}(t.phoneNumber||n.mobileNo)&&K(t.phoneNumber||n.mobileNo),(t.email||n.email)&&U(t.email||n.email),n.whatsappNo&&z(n.whatsappNo),n.noOfPerson&&V(String(n.noOfPerson)),t.consumerType&&C({name:t.consumerType}),t.occupantType&&h({name:t.occupantType}),t.gender&&L({name:t.gender}),t.parentSpouse&&O(t.parentSpouse),t.documentNumber&&(X(t.documentNumber),ye(t.documentNumber)),t.informantName&&Fe(t.informantName),t.informantRelation&&Re(t.informantRelation)}},[u,null==i?void 0:i.connectionDetails,d]);const we=function(e,t,n){try{const a=e.target.files[0];if(!a)return Promise.resolve();const l=v(function(){return Promise.resolve(Digit.UploadServices.Filestorage("EKYC",a)).then(function(e){var l,r,o;const i=null==e||null===(l=e.data)||void 0===l||null===(r=l.files)||void 0===r||null===(o=r[0])||void 0===o?void 0:o.fileStoreId;i&&(t(a.name),n(i))})},function(){Le({type:"error",message:"Upload failed"})});return Promise.resolve(l&&l.then?l.then(function(){}):void 0)}catch(e){return Promise.reject(e)}};return m?n.createElement(r.Loader,null):n.createElement(t.Fragment,null,n.createElement(r.FormStep,{onSelect:function(){try{const e={kno:g,consumerType:null==f?void 0:f.name,occupantType:null==b?void 0:b.name,categoryType:null==S?void 0:S.name,consumerName:N,firstName:_,middleName:I,lastName:D,gender:null==A?void 0:A.name,parentSpouseName:w,relation:Y,mobile:B,whatsapp:M,email:W,residents:H,documentId:$,ownerMobile:q,tenantVerification:Q,designation:ee,department:ne,employeeId:le,landline:oe,entityRelation:se,contactPerson:de,entityName:ue,idProof:null==Ee?void 0:Ee.name,idNumber:ge,consent:Ne,informantIsConsumer:_e,informantName:Ie,informantRelation:De},t=v(function(){return Promise.resolve(p.mutateAsync({RequestInfo:{},updateType:"CONSUMER",...e})).then(function(){Le({type:"success",message:"Data updated successfully!"}),o(a.key,e)})},function(){Le({type:"error",message:"Failed to update consumer details"})});return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},config:a,isDisabled:!(g&&f&&b&&S&&_&&B&&H&&!(Number(H)<=0)&&("Tenanted"!==(null==b?void 0:b.name)||$||q)&&Ne)},n.createElement("div",null,n.createElement(r.CardLabel,null,"Consumer Type *"),n.createElement(r.Dropdown,{option:[{name:"Individual"},{name:"Govt"},{name:"Company_Society_Org"}],selected:f,select:C})),n.createElement("div",null,n.createElement(r.CardLabel,null,"Occupant Type *"),n.createElement(r.Dropdown,{option:[{name:"Self"},{name:"Tenanted"}],selected:b,select:h})),n.createElement("div",null,n.createElement(r.CardLabel,null,"Category Type *"),n.createElement(r.Dropdown,{option:[],selected:S,select:x})),n.createElement("div",null,n.createElement(r.CardLabel,null,"First Name *"),n.createElement(r.TextInput,{value:_,onChange:e=>T(e.target.value)})),n.createElement("div",null,n.createElement(r.CardLabel,null,"Middle Name"),n.createElement(r.TextInput,{value:I,onChange:e=>F(e.target.value)})),n.createElement("div",null,n.createElement(r.CardLabel,null,"Last Name"),n.createElement(r.TextInput,{value:D,onChange:e=>R(e.target.value)})),n.createElement("div",null,n.createElement(r.CardLabel,null,"Gender"),n.createElement(r.Dropdown,{option:[{name:"Male"},{name:"Female"},{name:"Others"},{name:"Not prefer to say"}],selected:A,select:L})),n.createElement("div",null,n.createElement(r.CardLabel,null,"Parent/Spouse Name "),n.createElement(r.TextInput,{value:w,onChange:e=>O(e.target.value)})),n.createElement("div",null,n.createElement(r.CardLabel,null,"Mobile *"),n.createElement(r.TextInput,{value:B,onChange:e=>K(e.target.value)})),n.createElement("div",null,n.createElement(r.CardLabel,null,"WhatsApp"),n.createElement(r.TextInput,{value:M,onChange:e=>z(e.target.value)})),n.createElement("div",null,n.createElement(r.CardLabel,null,"Email"),n.createElement(r.TextInput,{value:W,onChange:e=>U(e.target.value)})),n.createElement("div",null,n.createElement(r.CardLabel,null,"No. of Residents *"),n.createElement(r.TextInput,{value:H,onChange:e=>V(e.target.value)})),n.createElement("div",null,console.log("identityType",be),n.createElement(r.CardLabel,null,"Type of Identity *"),n.createElement(r.Dropdown,{option:[{name:"Aadhaar Card"},{name:"Driving License"},{name:"Passport"},{name:"Voter ID"}],selected:be,select:he})),n.createElement("div",null,n.createElement(r.CardLabel,null,"Proof of Identity"),n.createElement(r.UploadFile,{onUpload:e=>we(e,G,X)})),n.createElement("div",null,n.createElement(r.CardLabel,null,"Document Number"),n.createElement(r.TextInput,{value:fe,onChange:e=>Ce(e.target.value)})),n.createElement("div",null,n.createElement(r.CardLabel,null,"Informant Is Consumer"),n.createElement(r.CheckBox,{label:"Yes, the informant is the consumer",checked:_e,onChange:e=>Te(e.target.checked)})),!_e&&n.createElement(t.Fragment,null,n.createElement("div",null,n.createElement(r.CardLabel,null,"Informant Name"),n.createElement(r.TextInput,{value:Ie,onChange:e=>Fe(e.target.value)})),n.createElement("div",null,n.createElement(r.CardLabel,null,"Informant Relation"),n.createElement(r.TextInput,{value:De,onChange:e=>Re(e.target.value)}))),"Tenanted"===(null==b?void 0:b.name)&&n.createElement(t.Fragment,null,n.createElement("div",null,n.createElement(r.CardLabel,null,"Document Proof"),n.createElement(r.UploadFile,{onUpload:e=>we(e,G,X)})),!$&&n.createElement(t.Fragment,null,n.createElement("div",null,n.createElement(r.CardLabel,null,"Owner Mobile *"),n.createElement(r.TextInput,{value:q,onChange:e=>Z(e.target.value)})),n.createElement("div",null,n.createElement(r.CardLabel,null,"Tenant Verification"),n.createElement(r.TextInput,{value:Q,onChange:e=>J(e.target.value)})))),"Govt"===(null==f?void 0:f.name)&&n.createElement(t.Fragment,null,n.createElement("div",null,n.createElement(r.CardLabel,null,"Designation"),n.createElement(r.TextInput,{value:ee,onChange:e=>te(e.target.value)})),n.createElement("div",null,n.createElement(r.CardLabel,null,"Department"),n.createElement(r.TextInput,{value:ne,onChange:e=>ae(e.target.value)})),n.createElement("div",null,n.createElement(r.CardLabel,null,"Employee ID"),n.createElement(r.TextInput,{value:le,onChange:e=>re(e.target.value)}))),"Company_Society_Org"===(null==f?void 0:f.name)&&n.createElement(t.Fragment,null,n.createElement("div",null,n.createElement(r.CardLabel,null,"Entity Name"),n.createElement(r.TextInput,{value:ue,onChange:e=>pe(e.target.value)})),n.createElement("div",null,n.createElement(r.CardLabel,null,"Contact Person"),n.createElement(r.TextInput,{value:de,onChange:e=>me(e.target.value)})))),Ae&&n.createElement(r.Toast,{error:"error"===Ae.type,label:Ae.message,onClose:()=>Le(null)}))},q=[{body:[{route:"consumer-details",component:X,key:"aadhaarVerification",texts:{header:"EKYC_CONSUMER_CONNECTION",submitBarLabel:"COMMON_SAVE_NEXT"},timeLine:[{currentStep:1,actions:"EKYC_CONSUMER_CONNECTION"}]},{route:"address-details",component:"AddressDetails",key:"addressDetails",doorImage:!0,texts:{header:"EKYC_ADDRESS_DETAILS",submitBarLabel:"COMMON_SAVE_NEXT"},timeLine:[{currentStep:2,actions:"EKYC_ADDRESS_DETAILS"}]},{route:"property-info",component:"PropertyInfo",key:"propertyDetails",texts:{header:"EKYC_PROPERTY_INFO",submitBarLabel:"COMMON_SAVE_NEXT"},timeLine:[{currentStep:3,actions:"EKYC_PROPERTY_INFO"}]},{route:"meter-details",component:"MeterDetails",key:"meterDetails",texts:{header:"EKYC_METER_DETAILS",submitBarLabel:"COMMON_SAVE_NEXT"},timeLine:[{currentStep:4,actions:"EKYC_METER_DETAILS"}]}]}],Z=e=>{let{path:o}=e;!function(){var e;if(!n.useContext("undefined"!=typeof window&&null!=(e=window.ReactQueryClientContext)?e:$))throw new Error("No QueryClient set, use QueryClientProvider to set one")}();const i=l.useRouteMatch(),{t:s}=a.useTranslation(),c=l.useLocation(),{pathname:d}=c,m=l.useHistory();let u=[];const[p,E,v]=Digit.Hooks.useSessionStorage("EKYC_CREATE",{});function g(e,t,n,a,l){void 0===l&&(l=!1),E({...p,[e]:{...p[e],...t}}),((e,t,n,a)=>{let l=d.split("/").pop(),r=u.find(e=>a?e.key===a:e.route===l);r||(r=u.find(e=>e.route===l));let s=null;const c=u.findIndex(e=>e.route===r.route);c>-1&&c<u.length-1&&(s=u[c+1].route);let E=m.push;e&&(E=m.replace);const v=o||i.path.split("/").slice(0,-1).join("/");if(null===s)return E(v+"/review",{...p,edits:p});E(`${v}/${s}`,{...p})})(n,0,0,e)}Digit.UserService.getUser(),Digit.ULBService.getCurrentTenantId(),t.useEffect(()=>{if(c.state&&Object.keys(c.state).length>0){const{edits:e,...t}=c.state;E({...p,...t,...e})}},[c.state]),q.forEach(e=>{u=u.concat(e.body)}),u.indexRoute="consumer-details";const y=u.map(e=>e.route),f=y.some(e=>d.includes(e)),C=t.useRef({});return t.useEffect(()=>{if(f){const e=d.split("/").pop();C.current[e]&&C.current[e].scrollIntoView({behavior:"smooth",block:"start"})}},[d,f]),n.createElement(n.Fragment,null,n.createElement("div",{className:"employee-form-section-wrapper"},n.createElement(r.VerticalTimeline,{config:u,showFinalStep:!0}),n.createElement("div",{className:"employee-form-section"},n.createElement(l.Switch,null,n.createElement(l.Route,{path:y.map(e=>`${o||i.path.split("/").slice(0,-1).join("/")}/${e}`)},n.createElement("div",{className:"single-page-form-container"},u.map((e,t)=>{const{component:a}=e,l="string"==typeof a?Digit.ComponentRegistryService.getComponent(a):a;return n.createElement("div",{key:t,ref:t=>C.current[e.route]=t,className:"form-section-unit"},n.createElement(l,{config:{...e,isCollapsible:!0,defaultOpen:!0},onSelect:g,t:s,formData:p}))}))),n.createElement(l.Route,null,n.createElement(l.Redirect,{to:`${o||i.path.split("/").slice(0,-1).join("/")}/${u.indexRoute}`}))))))},Q=e=>{let{path:t}=e;const{t:o}=a.useTranslation(),i=l.useLocation();sessionStorage.removeItem("revalidateddone");const s=Digit.ComponentRegistryService.getComponent("CeoDashboard"),c=[{icon:r.HomeIcon,path:"/digit-ui/employee"},{label:o((()=>{const e=i.pathname;return e.includes("/dashboard")?"ES_COMMON_INBOX":e.includes("/create-kyc")?"EKYC_CREATE_KYC":e.includes("/k-details")?"EKYC_K_DETAILS":e.includes("/consumer-details")?"EKYC_CONSUMER_DETAILS":e.includes("/address-details")?"EKYC_ADDRESS_DETAILS":e.includes("/property-info")?"EKYC_PROPERTY_INFO":e.includes("/meter-details")?"EKYC_METER_DETAILS":e.includes("/review")?"EKYC_REVIEW":"ES_COMMON_INBOX"})())}];return n.createElement(r.AppContainer,null,n.createElement("div",{className:"ground-container employee-app-container form-container"},n.createElement(r.ModuleHeader,{leftContent:n.createElement(n.Fragment,null,n.createElement(r.ArrowLeft,{className:"icon"}),"Back"),onLeftClick:()=>window.history.back(),breadcrumbs:c}),n.createElement("div",{className:"employee-form"},n.createElement("div",{className:"employee-form-content"},n.createElement(l.Switch,null,n.createElement(r.PrivateRoute,{path:t+"/dashboard",component:()=>n.createElement(r.LayoutWrapper,{layoutClass:"normal"},n.createElement(d,{parentRoute:t,businessService:"EKYC",moduleCode:"EKYC",isInbox:!0}))}),n.createElement(r.PrivateRoute,{path:t+"/inbox",component:()=>n.createElement(r.LayoutWrapper,{layoutClass:"normal"},n.createElement(_,{parentRoute:t,businessService:"EKYC",moduleCode:"EKYC",isInbox:!0}))}),n.createElement(r.PrivateRoute,{path:t+"/create-kyc",component:()=>n.createElement(r.LayoutWrapper,{layoutClass:"normal"},n.createElement(z,null))}),n.createElement(r.PrivateRoute,{path:t+"/mapping",component:()=>n.createElement(r.LayoutWrapper,{layoutClass:"normal"},n.createElement(K,null))}),n.createElement(r.PrivateRoute,{path:["consumer-details","address-details","property-info","meter-details"].map(e=>`${t}/${e}`),component:e=>n.createElement(r.LayoutWrapper,{layoutClass:"normal"},n.createElement(Z,p({},e,{path:t})))}),n.createElement(r.PrivateRoute,{path:t+"/review",component:()=>n.createElement(r.LayoutWrapper,{layoutClass:"normal"},n.createElement(j,null))}),n.createElement(r.PrivateRoute,{path:t+"/ceo-dashboard",component:()=>n.createElement(r.LayoutWrapper,{layoutClass:"normal"},n.createElement(s,null))}))))))},J=e=>{let{config:o,onSelect:i,formData:s}=e;const{t:c}=a.useTranslation(),d=l.useLocation().state||{},m=Digit.ULBService.getCurrentTenantId(),u=(null==d?void 0:d.kNumber)||(null==d?void 0:d.kno)||(null==s?void 0:s.kNumber)||(null==s?void 0:s.kno)||sessionStorage.getItem("EKYC_K_NUMBER"),{isLoading:p,data:E}=Digit.Hooks.ekyc.useSearchConnection({tenantId:m,details:{kno:u}},{enabled:!!u,cacheTime:0}),g=Digit.Hooks.ekyc.useEkycUpdate(m),y=(null==s?void 0:s.propertyDetails)||{},[f,C]=t.useState(y.pidNumber||""),[b,h]=t.useState(y.propertyType?{name:y.propertyType}:null),[S,x]=t.useState(y.subPropertyCategory?{name:y.subPropertyCategory}:null),[N,k]=t.useState(y.noOfFloors||""),[_,T]=t.useState(y.floorNo||""),[I,F]=t.useState(y.noOfRooms||""),[D,R]=t.useState(y.noOfBeds||""),[A,L]=t.useState(y.dwellingUnits||""),[w,O]=t.useState(null),[Y,P]=t.useState(y.buildingImageId||null),[B,K]=t.useState(null),M=[{name:"Residential"},{name:"Commercial"},{name:"Hotel"},{name:"Hospital"},{name:"Nursing Home"}];return t.useEffect(()=>{const e=E||(null==s?void 0:s.connectionDetails),t=(null==e?void 0:e.propertyInfo)||(null==e?void 0:e.propertyDetails)||{};if(t&&Object.keys(t).length>0&&!y.pidNumber){if(t.pidNumber&&C(t.pidNumber),(t.numberOfFloors||t.noOfFloor)&&k(String(t.numberOfFloors||t.noOfFloor)),t.buildingImageFileStoreId&&P(t.buildingImageFileStoreId),t.subPropertyCategory){const e=M.find(e=>e.name.toLowerCase()===t.subPropertyCategory.toLowerCase());h(e||{name:t.subPropertyCategory}),x({name:t.subPropertyCategory})}t.propertyType&&(x({name:t.propertyType}),t.subPropertyCategory||h({name:t.propertyType})),t.floorNo&&T(t.floorNo),null!=t.numberOfRooms&&F(String(t.numberOfRooms)),null!=t.numberOfBeds&&R(String(t.numberOfBeds)),null!=t.numberOfDwellingUnits&&L(String(t.numberOfDwellingUnits))}},[E,null==s?void 0:s.connectionDetails]),p?n.createElement(r.Loader,null):n.createElement(t.Fragment,null,n.createElement(r.FormStep,{t:c,onSelect:function(){try{const e={pidNumber:f,propertyType:null==b?void 0:b.name,subPropertyCategory:null==S?void 0:S.name,noOfFloors:N,floorNo:_,noOfRooms:I,noOfBeds:D,dwellingUnits:A,buildingImageId:Y},t=v(function(){return Promise.resolve(g.mutateAsync({RequestInfo:{},updateType:"PROPERTY",kno:u,...e})).then(function(){K({type:"success",message:"Property details updated successfully!"}),i(o.key,e)})},function(){K({type:"error",message:"Failed to update property details"})});return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},config:o,label:c("ES_COMMON_CONTINUE"),isDisabled:!(b&&S&&N&&!(Number(N)<1)&&Y&&("Hotel"!==(null==b?void 0:b.name)||I)&&("Hospital"!==(null==b?void 0:b.name)&&"Nursing Home"!==(null==b?void 0:b.name)||D))},n.createElement("div",null,n.createElement(r.CardLabel,null,"PID Number"),n.createElement(r.TextInput,{value:f,onChange:e=>C(e.target.value)})),n.createElement("div",null,n.createElement(r.CardLabel,null,"Property Type"),n.createElement(r.Dropdown,{option:M,selected:b,select:h})),n.createElement("div",null,n.createElement(r.CardLabel,null,"Sub Property Category"),n.createElement(r.Dropdown,{option:[],selected:S,select:x})),n.createElement("div",null,n.createElement(r.CardLabel,null,"No. of Floors *"),n.createElement(r.TextInput,{type:"number",value:N,onChange:e=>k(e.target.value)})),n.createElement("div",null,n.createElement(r.CardLabel,null,"Floor No. of this KNO"),n.createElement(r.TextInput,{value:_,onChange:e=>T(e.target.value)})),n.createElement("div",null,n.createElement(r.CardLabel,null,"No of Beds"),n.createElement(r.TextInput,{type:"number",value:D,onChange:e=>R(e.target.value)})),n.createElement("div",null,n.createElement(r.CardLabel,null,"No. of Rooms"),n.createElement(r.TextInput,{type:"number",value:I,onChange:e=>F(e.target.value)})),"Hotel"===(null==b?void 0:b.name)&&n.createElement("div",null,n.createElement(r.CardLabel,null,"No. of Rooms *"),n.createElement(r.TextInput,{type:"number",value:I,onChange:e=>F(e.target.value)})),("Hospital"===(null==b?void 0:b.name)||"Nursing Home"===(null==b?void 0:b.name))&&n.createElement("div",null,n.createElement(r.CardLabel,null,"No. of Beds *"),n.createElement(r.TextInput,{type:"number",value:D,onChange:e=>R(e.target.value)})),n.createElement("div",null,n.createElement(r.CardLabel,null,"Number of Dwelling Units"),n.createElement(r.TextInput,{type:"number",value:A,onChange:e=>L(e.target.value)})),n.createElement("div",null,n.createElement(r.CardLabel,null,"Building Image *"),n.createElement(r.UploadFile,{onUpload:function(e){try{const t=e.target.files[0];if(!t)return Promise.resolve();if(t.size>2e6)return K({type:"error",message:"Max size 2MB exceeded"}),Promise.resolve();const n=v(function(){return Promise.resolve(Digit.UploadServices.Filestorage("EKYC",t,m)).then(function(e){var n,a,l;const r=null==e||null===(n=e.data)||void 0===n||null===(a=n.files)||void 0===a||null===(l=a[0])||void 0===l?void 0:l.fileStoreId;if(r){P(r);const e=new FileReader;e.onloadend=()=>O(e.result),e.readAsDataURL(t),K({type:"success",message:"Upload successful"})}})},function(){K({type:"error",message:"Upload failed"})});return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},onDelete:()=>{O(null),P(null)},message:Y?"Uploaded":"No file selected"})),w&&n.createElement("div",{style:{gridColumn:"span 2"}},n.createElement("img",{src:w,alt:"preview",style:{width:"100%",marginTop:"10px"}})),B&&n.createElement(r.Toast,{label:B.message,error:"error"===B.type,onClose:()=>K(null)})))},ee=e=>{let{config:a,onSelect:o,formData:i}=e;const s=l.useLocation().state||{},c=Digit.ULBService.getCurrentTenantId(),d=(null==s?void 0:s.kNumber)||(null==s?void 0:s.kno)||(null==i?void 0:i.kNumber)||(null==i?void 0:i.kno)||sessionStorage.getItem("EKYC_K_NUMBER"),{isLoading:m,data:u}=Digit.Hooks.ekyc.useSearchConnection({tenantId:c,details:{kno:d}},{enabled:!!d,cacheTime:0}),p=Digit.Hooks.ekyc.useEkycUpdate(c),E=(null==i?void 0:i.meterDetails)||{},[g,y]=t.useState(E.connectionCategory||""),[f,C]=t.useState(E.saType||""),[b,h]=t.useState(E.status||""),[S,x]=t.useState(E.mrCode||""),[N,k]=t.useState(E.areaCode||""),[_,T]=t.useState(E.mrKey||""),[I,F]=t.useState(E.meterNumber||""),[D,R]=t.useState(E.meterMaker||""),[A,L]=t.useState(E.meterStatus?{name:E.meterStatus}:null),[w,O]=t.useState(E.meterCondition?{name:E.meterCondition}:null),[Y,P]=t.useState(E.meterLocation?{name:E.meterLocation}:null),[B,K]=t.useState(E.lastBillReceived?{name:E.lastBillReceived}:null),[M,z]=t.useState(E.billMonthYear?{name:E.billMonthYear}:null),[W,U]=t.useState(E.reason||""),[H,V]=t.useState(E.accessToMeter?{name:E.accessToMeter}:null),[j,G]=t.useState(E.sewerConnection?{name:E.sewerConnection}:null),[$,X]=t.useState(E.septicTank?{name:E.septicTank}:null),[q,Z]=t.useState(null),[Q,J]=t.useState(E.meterPhotoId||null),[ee,te]=t.useState(null),ne=[{name:"Yes"},{name:"No"}],ae=[{name:"Metered"},{name:"Unmetered"},{name:"Can not be identified"}],le=[{name:"Damaged"},{name:"Not-Damaged"}],re=[{name:"Inside"},{name:"Outside"}],oe=[];for(let e=1998;e<=2026;e++)for(let t=1;t<=12;t++)oe.push({name:`${t}/${e}`});t.useEffect(()=>{const e=u||(null==i?void 0:i.connectionDetails),t=(null==e?void 0:e.meterDetails)||e||{};if(t&&Object.keys(t).length>0&&!E.connectionCategory){if(t.connectionCategory&&y(t.connectionCategory),t.saType&&C(t.saType),t.statusFlag&&h(t.statusFlag),t.mrcode&&x(String(t.mrcode)),t.areacode&&k(String(t.areacode)),t.mrkey&&T(String(t.mrkey)),t.meterNumber&&F(t.meterNumber),t.meterMake&&R(t.meterMake),t.meterStatus){const e=ae.find(e=>e.name.toLowerCase()===t.meterStatus.toLowerCase());L(e||{name:t.meterStatus})}else void 0!==t.metered&&L({name:t.metered?"Metered":"Unmetered"});if(t.meterCondition){const e=le.find(e=>e.name.toLowerCase()===t.meterCondition.toLowerCase());O(e||{name:t.meterCondition})}if(t.meterLocation){const e=re.find(e=>e.name.toLowerCase()===t.meterLocation.toLowerCase()||t.meterLocation.toLowerCase().includes(e.name.toLowerCase()));P(e||{name:t.meterLocation})}if(null!=t.lastBillRaised){const e=String(t.lastBillRaised).toLowerCase();K("true"===e||"yes"===e?{name:"Yes"}:{name:"No"})}if(t.lastBillReceivedDate){const e=t.lastBillReceivedDate.replace("-","/").split("/");if(2===e.length){const t=parseInt(e[0],10),n=parseInt(e[1],10);z({name:`${t}/${n}`})}else z({name:t.lastBillReceivedDate})}if(t.lastBillNotRaisedReason&&U(t.lastBillNotRaisedReason),null!=t.accessToMeter){const e=String(t.accessToMeter).toLowerCase();V("true"===e||"yes"===e?{name:"Yes"}:{name:"No"})}if(null!=t.sewerConnection){const e=String(t.sewerConnection).toLowerCase();G("true"===e||"yes"===e?{name:"Yes"}:{name:"No"})}if(null!=t.septicTank){const e=String(t.septicTank).toLowerCase();X("true"===e||"yes"===e?{name:"Yes"}:{name:"No"})}t.meterPhotoFileStoreId&&J(t.meterPhotoFileStoreId)}},[u,null==i?void 0:i.connectionDetails]);const ie="Can not be identified"===(null==A?void 0:A.name);return m?n.createElement(r.Loader,null):n.createElement(t.Fragment,null,n.createElement(r.FormStep,{onSelect:function(){try{const e={connectionCategory:g,saType:f,status:b,mrCode:S,areaCode:N,mrKey:_,meterNumber:I,meterMaker:D,meterStatus:null==A?void 0:A.name,meterCondition:null==w?void 0:w.name,meterLocation:null==Y?void 0:Y.name,lastBillReceived:null==B?void 0:B.name,billMonthYear:null==M?void 0:M.name,reason:W,accessToMeter:null==H?void 0:H.name,sewerConnection:null==j?void 0:j.name,septicTank:null==$?void 0:$.name,meterPhotoId:Q},t=v(function(){return Promise.resolve(p.mutateAsync({RequestInfo:{},updateType:"METER",kno:d,...e})).then(function(){te({type:"success",message:"Meter details updated successfully!"}),o(a.key,e)})},function(){te({type:"error",message:"Failed to update meter details"})});return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},config:a,isDisabled:!(g&&A&&Y&&B&&j&&("Metered"!==(null==A?void 0:A.name)||Q)&&("No"!==(null==B?void 0:B.name)||W)&&("Yes"!==(null==B?void 0:B.name)||M)&&("No"!==(null==j?void 0:j.name)||$))},n.createElement("div",null,n.createElement(r.CardLabel,null,"Connection Category *"),n.createElement(r.TextInput,{value:g,onChange:e=>y(e.target.value)})),n.createElement("div",null,n.createElement(r.CardLabel,null,"SA Type"),n.createElement(r.TextInput,{value:f,onChange:e=>C(e.target.value)})),n.createElement("div",null,n.createElement(r.CardLabel,null,"Status"),n.createElement(r.TextInput,{value:b,onChange:e=>h(e.target.value)})),n.createElement("div",null,n.createElement(r.CardLabel,null,"MR Code"),n.createElement(r.TextInput,{value:S,onChange:e=>x(e.target.value)})),n.createElement("div",null,n.createElement(r.CardLabel,null,"Area Code"),n.createElement(r.TextInput,{value:N,onChange:e=>k(e.target.value)})),n.createElement("div",null,n.createElement(r.CardLabel,null,"MR Key"),n.createElement(r.TextInput,{value:_,onChange:e=>T(e.target.value)})),!ie&&n.createElement(t.Fragment,null,n.createElement("div",null,n.createElement(r.CardLabel,null,"Meter Number"),n.createElement(r.TextInput,{value:I,onChange:e=>F(e.target.value)})),n.createElement("div",null,n.createElement(r.CardLabel,null,"Meter Maker"),n.createElement(r.TextInput,{value:D,onChange:e=>R(e.target.value)})),n.createElement("div",null,n.createElement(r.CardLabel,null,"Meter Condition"),n.createElement(r.Dropdown,{option:le,selected:w,select:O})),"Metered"===(null==A?void 0:A.name)&&n.createElement(t.Fragment,null,n.createElement("div",null,n.createElement(r.CardLabel,null,"Meter Photo *"),n.createElement(r.UploadFile,{onUpload:function(e){try{const t=e.target.files[0];if(!t)return Promise.resolve();const n=v(function(){return Promise.resolve(Digit.UploadServices.Filestorage("EKYC",t,c)).then(function(e){var n,a,l;const r=null==e||null===(n=e.data)||void 0===n||null===(a=n.files)||void 0===a||null===(l=a[0])||void 0===l?void 0:l.fileStoreId;if(r){J(r);const e=new FileReader;e.onloadend=()=>Z(e.result),e.readAsDataURL(t)}})},function(){te({type:"error",message:"Upload failed"})});return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},message:Q?"Uploaded":"No file"})),q&&n.createElement("div",{style:{gridColumn:"span 2"}},n.createElement("img",{src:q,style:{width:"100%"}})))),n.createElement("div",null,n.createElement(r.CardLabel,null,"Meter Status *"),n.createElement(r.Dropdown,{option:ae,selected:A,select:L})),n.createElement("div",null,n.createElement(r.CardLabel,null,"Meter Location *"),n.createElement(r.Dropdown,{option:re,selected:Y,select:P})),n.createElement("div",null,n.createElement(r.CardLabel,null,"Last Bill Received *"),n.createElement(r.Dropdown,{option:ne,selected:B,select:K})),"Yes"===(null==B?void 0:B.name)&&n.createElement("div",null,n.createElement(r.CardLabel,null,"When was the last bill received *"),n.createElement(r.Dropdown,{option:oe,selected:M,select:z})),"No"===(null==B?void 0:B.name)&&n.createElement("div",null,n.createElement(r.CardLabel,null,"Reason *"),n.createElement(r.TextInput,{value:W,onChange:e=>U(e.target.value)})),n.createElement("div",null,n.createElement(r.CardLabel,null,"Access to Meter"),n.createElement(r.Dropdown,{option:ne,selected:H,select:V})),n.createElement("div",null,n.createElement(r.CardLabel,null,"Sewer Connection *"),n.createElement(r.Dropdown,{option:ne,selected:j,select:G})),"No"===(null==j?void 0:j.name)&&n.createElement("div",null,n.createElement(r.CardLabel,null,"Septic Tank *"),n.createElement(r.Dropdown,{option:ne,selected:$,select:X})),ee&&n.createElement(r.Toast,{label:ee.message,error:"error"===ee.type,onClose:()=>te(null)})))},te=()=>{const{t:e}=a.useTranslation(),t={moduleName:e("ACTION_TEST_EKYC"),kpis:[{count:"-",label:e("TOTAL_EKYC"),link:"/digit-ui/citizen/ekyc/dashboard"}],links:[{label:e("EKYC_DASHBOARD"),link:"/digit-ui/citizen/ekyc/dashboard"},{label:e("EKYC_INBOX"),link:"/digit-ui/citizen/ekyc/inbox"},{label:e("EKYC_MAPPING"),link:"/digit-ui/citizen/ekyc/mapping"}]};return n.createElement(r.ModuleLinksView,{links:t.links})},ne=e=>{var a,o,i,s,c;let{parentRoute:d}=e;const m=Digit.ULBService.getCurrentTenantId(),u=l.useLocation(),[v,g]=t.useReducer(function(e,t){const n=t.checkPathName?"EKYC.INBOX":"EKYC.SW.INBOX";switch(t.action){case"mutateSearchForm":return Digit.SessionStorage.set(n,{...e,searchForm:t.data}),{...e,searchForm:t.data};case"mutateFilterForm":return Digit.SessionStorage.set(n,{...e,filterForm:t.data}),{...e,filterForm:t.data};case"mutateTableForm":return Digit.SessionStorage.set(n,{...e,tableForm:t.data}),{...e,tableForm:t.data};default:return e}},{filterForm:{},searchForm:{},tableForm:{limit:10,offset:0,sortBy:"createdTime",sortOrder:"DESC"}}),y=t.useMemo(()=>{var e,t;return{tenantId:m,offset:(null==v||null===(e=v.tableForm)||void 0===e?void 0:e.offset)||0,limit:(null==v||null===(t=v.tableForm)||void 0===t?void 0:t.limit)||10,search:(null==v?void 0:v.searchForm)||{}}},[m,null==v||null===(a=v.tableForm)||void 0===a?void 0:a.offset,null==v||null===(o=v.tableForm)||void 0===o?void 0:o.limit,null==v?void 0:v.searchForm]),{isLoading:f,data:C={}}=Digit.Hooks.ekyc.useEkycSurveyorDashboard({},y,{enabled:!!m,keepPreviousData:!0}),b=t.useMemo(()=>{var e,t;return{kno:(null==v||null===(e=v.searchForm)||void 0===e?void 0:e.kNumber)||"",name:(null==v||null===(t=v.searchForm)||void 0===t?void 0:t.kName)||""}},[null==v||null===(i=v.searchForm)||void 0===i?void 0:i.kNumber,null==v||null===(s=v.searchForm)||void 0===s?void 0:s.kName]),h=!(!b.kno&&!b.name),{isLoading:S,data:x}=Digit.Hooks.ekyc.useSearchConnection({tenantId:m,details:b},{enabled:!!m&&!!b.kno,keepPreviousData:!0}),N=t.useMemo(()=>{var e;return h?x?[x]:[]:(null==C||null===(e=C.dashboardInfo)||void 0===e?void 0:e.consumerList)||[]},[h,x,C]),_=t.useMemo(()=>(N||[]).map(e=>{var t,n,a,l,r,o;return e.connectionDetails?{applicationNo:(null===(t=e.propertyInfo)||void 0===t?void 0:t.kno)||"",connectionNo:(null===(n=e.propertyInfo)||void 0===n?void 0:n.kno)||"",owner:(null===(a=e.connectionDetails)||void 0===a?void 0:a.consumerName)||"",applicationNumber:(null===(l=e.propertyInfo)||void 0===l?void 0:l.kno)||"",citizenName:(null===(r=e.connectionDetails)||void 0===r?void 0:r.consumerName)||"",status:(null===(o=e.connectionDetails)||void 0===o?void 0:o.statusflag)||"",sla:0}:{...e,applicationNo:e.kno||e.applicationNumber||"",connectionNo:e.connectionNo||"",owner:e.consumerName||e.citizenName||"",applicationNumber:e.kno||e.applicationNumber||"",citizenName:e.consumerName||e.citizenName||"",status:e.status||"",sla:e.sla??0}}),[N]),T=(null==C||null===(c=C.dashboardInfo)||void 0===c?void 0:c.totalRecords)||(null==C?void 0:C.totalCount)||0,I=u.pathname.includes("ekyc/inbox"),F={headerText:I?"MODULE_WATER":"MODULE_SW"},D=t.useCallback(e=>{let{registerRef:t,searchFormState:a,controlSearchForm:l}=e;return n.createElement(k,{registerRef:t,searchFormState:a,controlSearchForm:l,className:"search"})},[]),R={sortBy:"createdTime",limit:window.Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"DESC"},A={mobileNumber:"",applicationNumber:"",consumerNo:""},L={SearchFormFields:D,onSearchFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),g({action:"mutateTableForm",data:{...R},checkPathName:I}),g({action:"mutateSearchForm",data:e,checkPathName:I})},searchFormDefaultValues:null==v?void 0:v.searchForm,resetSearchFormDefaultValues:A,onSearchFormReset:e=>{e("mobileNumber",null),e("applicationNumber",null),e("consumerNo",null),g({action:"mutateSearchForm",data:A})},className:"search-form-wns-inbox"},w={FilterFormFields:t.useCallback(e=>n.createElement(n.Fragment,null),[]),onFilterFormSubmit:()=>{},filterFormDefaultValues:"",resetFilterFormDefaultValues:"",onFilterFormReset:()=>{}},O=E({parentRoute:d,onPageSizeChange:e=>{const t=Number(e.target.value);g({action:"mutateTableForm",data:{...v.tableForm,limit:t,offset:0},checkPathName:I})},formState:v,totalCount:T,table:_,dispatch:g,onSortingByData:e=>{if(e.length>0){const[{id:t,desc:n}]=e,a=n?"DESC":"ASC";v.tableForm.sortBy===t&&v.tableForm.sortOrder===a||g({action:"mutateTableForm",data:{...v.tableForm,sortBy:t,sortOrder:n?"DESC":"ASC"},checkPathName:I})}},tenantId:m,checkPathName:I,inboxStyles:{overflowX:"scroll",overflowY:"hidden"},tableStyle:{width:"70%"}});return n.createElement("div",{className:"app-container"},n.createElement(r.InboxComposer,p({isInboxLoading:f||S,PropsForInboxLinks:F},L,w,{propsForInboxTable:O,formState:v})))},ae=e=>{var l,o,i,s,c;let{config:d,onSelect:m}=e;const{t:u}=a.useTranslation(),p=Digit.ULBService.getCurrentTenantId(),[E,g]=t.useState(""),[y,f]=t.useState(""),[C,b]=t.useState(""),[h,S]=t.useState(""),[x,N]=t.useState(null),[k,_]=t.useState(""),[T,I]=t.useState(null),[F,D]=t.useState(null),[R,A]=t.useState(null),[L,w]=t.useState(""),[O,Y]=t.useState(""),[P,B]=t.useState(null),[K,M]=t.useState(null),[z,W]=t.useState(null),[U,H]=t.useState(null),{data:V,isLoading:j}=Digit.Hooks.useCommonMDMS(p,"egov-location",["TenantBoundary"]),G=(null==V||null===(l=V.MdmsRes)||void 0===l||null===(o=l["egov-location"])||void 0===o||null===(i=o.TenantBoundary)||void 0===i||null===(s=i[0])||void 0===s||null===(c=s.boundary)||void 0===c?void 0:c.children)||[];return t.useEffect(()=>{let e=!0;return navigator.geolocation&&navigator.geolocation.getCurrentPosition(t=>{e&&(w(t.coords.latitude),Y(t.coords.longitude))},()=>{e&&H({type:"error",message:"GPS access denied"})}),()=>{e=!1}},[]),j?n.createElement(r.Loader,null):n.createElement(t.Fragment,null,n.createElement(r.FormStep,{t:u,onSelect:()=>{E&&y&&6===k.length&&T&&F&&R&&L&&O&&z?m(d.key,{houseNo:E,street:y,locality:C,landmark:h,subLocality:x,pinCode:k,assembly:null==T?void 0:T.name,ward:null==F?void 0:F.name,zone:null==R?void 0:R.name,latitude:L,longitude:O,addressType:null==P?void 0:P.name,doorPhotoFilestoreId:z}):H({type:"error",message:"Please fill all mandatory fields"})},config:d,label:u("ES_COMMON_CONTINUE")},n.createElement(r.CardLabel,null,"House No / Flat No *"),n.createElement(r.TextInput,{value:E,onChange:e=>g(e.target.value)}),n.createElement(r.CardLabel,null,"Street / Address Line *"),n.createElement(r.TextInput,{value:y,onChange:e=>f(e.target.value)}),n.createElement(r.CardLabel,null,"Locality"),n.createElement(r.TextInput,{value:C,onChange:e=>b(e.target.value)}),n.createElement(r.CardLabel,null,"Landmark"),n.createElement(r.TextInput,{value:h,onChange:e=>S(e.target.value)}),n.createElement(r.CardLabel,null,"Sub Locality"),n.createElement(r.Dropdown,{option:[],selected:x,select:N}),n.createElement(r.CardLabel,null,"PIN Code *"),n.createElement(r.TextInput,{value:k,onChange:e=>{const t=e.target.value;/^\d{0,6}$/.test(t)&&(_(t),6===t.length&&console.log("Fetching location for PIN:",t))},maxLength:6}),n.createElement(r.CardLabel,null,"Assembly *"),n.createElement(r.Dropdown,{option:G,selected:T,select:I}),n.createElement(r.CardLabel,null,"Ward *"),n.createElement(r.Dropdown,{option:(null==T?void 0:T.children)||[],selected:F,select:D}),n.createElement(r.CardLabel,null,"Zone *"),n.createElement(r.Dropdown,{option:(null==F?void 0:F.children)||[],selected:R,select:A}),n.createElement(r.CardLabel,null,"Latitude"),n.createElement(r.TextInput,{value:L,disabled:!0}),n.createElement(r.CardLabel,null,"Longitude"),n.createElement(r.TextInput,{value:O,disabled:!0}),n.createElement(r.CardLabel,null,"Address Type"),n.createElement(r.Dropdown,{option:[{name:"Permanent"},{name:"Correspondence"},{name:"Other"}],selected:P,select:B}),n.createElement(r.CardLabel,null,"Door Image *"),n.createElement(r.UploadFile,{onUpload:function(e){try{let n=!1;function t(e){return n?e:()=>{a=!1}}let a=!0;const l=e.target.files[0];if(!l)return Promise.resolve();if(l.size>=2e6)return H({type:"error",message:"Max size 2MB exceeded"}),Promise.resolve();const r=v(function(){return Promise.resolve(Digit.UploadServices.Filestorage("EKYC",l,p)).then(function(e){var t,r,o;if(!a)return void(n=!0);const i=null==e||null===(t=e.data)||void 0===t||null===(r=t.files)||void 0===r||null===(o=r[0])||void 0===o?void 0:o.fileStoreId;if(i){W(i);const e=new FileReader;e.onloadend=()=>{a&&M(e.result)},e.readAsDataURL(l),H({type:"success",message:"Upload successful"})}})},function(){a?H({type:"error",message:"Upload failed"}):n=!0});return Promise.resolve(r&&r.then?r.then(t):t(r))}catch(e){return Promise.reject(e)}},onDelete:()=>{M(null),W(null)},message:z?"Uploaded":"No file selected"}),K&&n.createElement("img",{src:K,alt:"preview",style:{width:"100%",marginTop:"10px"}}),U&&n.createElement(r.Toast,{label:U.message,error:"error"===U.type,onClose:()=>H(null)})))},le=()=>{const{t:e}=a.useTranslation(),t=l.useLocation(),{path:o}=l.useRouteMatch();sessionStorage.removeItem("revalidateddone");const i=[{icon:r.HomeIcon,path:"/digit-ui/citizen"},{label:e((()=>{const e=t.pathname;return e.includes("/create-kyc")?"EKYC_CREATE_KYC":e.includes("/aadhaar-verification")?"EKYC_AADHAAR_VERIFICATION":e.includes("/address-details")?"EKYC_ADDRESS_DETAILS":e.includes("/property-info")?"EKYC_PROPERTY_INFO":e.includes("/meter-details")?"EKYC_METER_DETAILS":e.includes("/review")?"EKYC_REVIEW":"EKYC_HOME"})())}];return n.createElement(n.Fragment,null,n.createElement("div",{className:"ground-container form-container"},n.createElement(r.ModuleHeader,{leftContent:n.createElement(n.Fragment,null,n.createElement(r.ArrowLeft,{className:"icon"}),e("CS_COMMON_BACK")),onLeftClick:()=>window.history.back(),breadcrumbs:i}),n.createElement(l.Switch,null,n.createElement(r.PrivateRoute,{exact:!0,path:""+o,component:()=>n.createElement(r.LayoutWrapper,{layoutClass:"normal"},n.createElement(te,null))}),n.createElement(r.PrivateRoute,{path:o+"/dashboard",component:()=>n.createElement(r.LayoutWrapper,{layoutClass:"normal"},n.createElement(d,null))}),n.createElement(r.PrivateRoute,{path:o+"/inbox",component:()=>n.createElement(r.LayoutWrapper,{layoutClass:"normal"},n.createElement(ne,null))}),n.createElement(r.PrivateRoute,{path:o+"/aadhaar-verification",component:()=>n.createElement(r.LayoutWrapper,{layoutClass:"normal"},n.createElement(X,null))}),n.createElement(r.PrivateRoute,{path:o+"/address-details",component:()=>n.createElement(r.LayoutWrapper,{layoutClass:"normal"},n.createElement(ae,null))}),n.createElement(r.PrivateRoute,{path:o+"/property-info",component:()=>n.createElement(r.LayoutWrapper,{layoutClass:"normal"},n.createElement(J,null))}),n.createElement(r.PrivateRoute,{path:o+"/meter-details",component:()=>n.createElement(r.LayoutWrapper,{layoutClass:"normal"},n.createElement(ee,null))}),n.createElement(r.PrivateRoute,{path:o+"/review",component:()=>n.createElement(r.LayoutWrapper,{layoutClass:"normal"},n.createElement(j,null))}))))},re=e=>{let{header:t,filters:l,children:r,onNotificationClick:o,activeRole:i,onRoleChange:s}=e;const{t:c}=a.useTranslation();return n.createElement("div",{className:"enterprise-dashboard-layout",style:{background:"linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%)",minHeight:"100vh"}},n.createElement("div",{className:"glass-card",style:{padding:"24px 32px",display:"flex",justifyContent:"space-between",alignItems:"center",borderRadius:"0",borderTop:"none",borderLeft:"none",borderRight:"none"}},n.createElement("div",null,n.createElement("h1",{style:{fontSize:"28px",fontWeight:"900",color:"#1E293B",letterSpacing:"-0.05em"}},c(t)),n.createElement("p",{style:{fontSize:"14px",color:"#64748B",marginTop:"4px",fontWeight:"500"}},c("EKYC_DASHBOARD_SUBTITLE_ALT")||"Operational analytics & performance monitoring.")),n.createElement("div",{style:{display:"flex",alignItems:"center",gap:"20px"}},n.createElement("div",{style:{display:"flex",background:"#F3F4F6",padding:"4px",borderRadius:"8px",gap:"4px"}},["CEO","CLUSTER_MANAGER","AGENCY_SUPERVISOR"].map(e=>n.createElement("button",{key:e,onClick:()=>s(e),style:{padding:"6px 12px",borderRadius:"6px",fontSize:"12px",fontWeight:"700",border:"none",cursor:"pointer",background:i===e?"var(--primary-gradient)":"transparent",color:i===e?"#FFFFFF":"#64748B",boxShadow:i===e?"0 4px 12px rgba(99, 102, 241, 0.3)":"none",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"}},c(e)))),n.createElement("button",{onClick:o,style:{position:"relative",background:"#F3F4F6",border:"none",padding:"10px",borderRadius:"50%",cursor:"pointer"}},n.createElement("span",{style:{fontSize:"20px"}},"🔔"),n.createElement("span",{style:{position:"absolute",top:"0",right:"0",width:"10px",height:"10px",background:"#EF4444",borderRadius:"50%",border:"2px solid #FFF"}})))),l,n.createElement("div",{style:{padding:"24px",maxWidth:"1600px",margin:"0 auto"}},r),n.createElement("div",{style:{padding:"40px 24px",textAlign:"center",color:"#9CA3AF",fontSize:"12px"}},c("EKYC_POWERED_BY_UPYOG")," | ",(new Date).getFullYear()," © ",c("EKYC_GOVT_DJB")))},oe=e=>{let{filters:t,config:l,onFilterChange:r,onReset:o}=e;const{t:i}=a.useTranslation();return n.createElement("div",{className:"dashboard-filter-bar glass-card",style:{position:"sticky",top:"0",zIndex:"100",padding:"20px 28px",display:"flex",alignItems:"center",gap:"24px",flexWrap:"wrap",borderRadius:"0 0 24px 24px",marginTop:"-1px"}},n.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",borderRight:"1px solid #E5E7EB",paddingRight:"16px"}},n.createElement("span",{style:{fontSize:"14px",fontWeight:"700",color:"#374151"}},i("EKYC_GLOBAL_FILTERS"))),n.createElement("div",{style:{display:"flex",gap:"12px",flex:1,flexWrap:"wrap"}},l.map(e=>n.createElement("div",{key:e.id,style:{display:"flex",flexDirection:"column",gap:"4px"}},n.createElement("label",{style:{fontSize:"11px",fontWeight:"600",color:"#6B7280",textTransform:"uppercase"}},i(e.label)),n.createElement("select",{value:t[e.id]||e.default,onChange:t=>r(e.id,t.target.value),style:{padding:"6px 12px",borderRadius:"6px",border:"1px solid #D1D5DB",background:"#F9FAFB",fontSize:"13px",outline:"none",minWidth:"140px"}},e.options.map(e=>n.createElement("option",{key:e,value:e},e)))))),n.createElement("div",{style:{display:"flex",gap:"12px"}},n.createElement("button",{onClick:o,style:{padding:"8px 16px",borderRadius:"8px",background:"transparent",color:"#6B7280",border:"1px solid #D1D5DB",cursor:"pointer",fontSize:"14px",fontWeight:"600"}},i("EKYC_RESET"))))},ie=e=>{let{label:t,value:l,color:r,icon:o,trend:i,isCurrency:s,suffix:c="",onClick:d}=e;const{t:m}=a.useTranslation();return n.createElement("div",{className:"summary-card glass-card",onClick:d,style:{padding:"28px 24px",cursor:d?"pointer":"default",display:"flex",flexDirection:"column",justifyContent:"space-between",height:"100%",minHeight:"160px",position:"relative",overflow:"hidden"},onMouseOver:e=>{d&&(e.currentTarget.style.transform="translateY(-8px) scale(1.02)")},onMouseOut:e=>{d&&(e.currentTarget.style.transform="translateY(0) scale(1)")}},n.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"}},n.createElement("span",{style:{fontSize:"13px",fontWeight:"700",color:"#6B7280",letterSpacing:"0.05em",textTransform:"uppercase"}},m(t)),n.createElement("div",{style:{padding:"10px",borderRadius:"12px",background:`linear-gradient(135deg, ${r}20 0%, ${r}40 100%)`,color:r,boxShadow:`0 4px 12px ${r}20`}},n.createElement("span",{style:{fontSize:"20px"}},"document"===o?"📄":"check"===o?"✅":"clock"===o?"⏳":"rupee"===o?"₹":"📊"))),n.createElement("div",{style:{marginTop:"12px"}},n.createElement("div",{style:{fontSize:"28px",fontWeight:"800",color:"#111827"}},(u=l,s?"₹"+new Intl.NumberFormat("en-IN").format(u):new Intl.NumberFormat("en-IN").format(u)),c),i&&n.createElement("div",{style:{display:"flex",alignItems:"center",marginTop:"8px",fontSize:"12px",fontWeight:"600"}},n.createElement("span",{style:{color:i>0?"#10B981":"#EF4444"}},i>0?"↗":"↘"," ",Math.abs(i),"%"),n.createElement("span",{style:{color:"#9CA3AF",marginLeft:"4px"}},m("EKYC_FROM_PREV_MONTH")))));var u};s.Chart.register(...s.registerables);const se=e=>{let{data:l,title:r}=e;const{t:o}=a.useTranslation(),i=t.useRef(null),c=t.useRef(null);return t.useEffect(()=>{if(i.current&&l){c.current&&c.current.destroy();const e=i.current.getContext("2d"),t=e.createLinearGradient(0,0,0,400);t.addColorStop(0,"#3B82F6"),t.addColorStop(1,"#2563EB");const n=e.createLinearGradient(0,0,0,400);n.addColorStop(0,"#F59E0B"),n.addColorStop(1,"#D97706");const a=e.createLinearGradient(0,0,0,400);a.addColorStop(0,"#6366F1"),a.addColorStop(1,"#4F46E5");const r=e.createLinearGradient(0,0,0,400);r.addColorStop(0,"#10B981"),r.addColorStop(1,"#059669");const d=[t,n,a,r,"#EC4899","#EF4444"],m=l.map(e=>o(e.stageName)),u=l.map(e=>e.count);c.current=new(s.Chart.Chart||s.Chart)(e,{type:"doughnut",data:{labels:m,datasets:[{data:u,backgroundColor:d.slice(0,m.length),borderWidth:2,borderColor:"#ffffff",hoverOffset:10}]},options:{responsive:!0,maintainAspectRatio:!1,cutout:"70%",plugins:{legend:{position:"right",labels:{usePointStyle:!0,padding:15,font:{size:12}}},tooltip:{backgroundColor:"#1F2937",padding:10,bodyFont:{size:13}}}}})}return()=>{c.current&&c.current.destroy()}},[l,o]),n.createElement("div",{className:"task-status-chart-container glass-card",style:{height:"320px",width:"100%",padding:"24px"}},r&&n.createElement("h3",{className:"chart-title",style:{marginBottom:"24px",fontSize:"18px",fontWeight:"700",color:"#111827"}},o(r)),n.createElement("div",{style:{height:"220px"}},n.createElement("canvas",{ref:i})))},ce=e=>{let{data:t,title:l,onDrillDown:r}=e;const{t:o}=a.useTranslation();if(!t||0===t.length)return null;const i=e=>e>80?"#EF4444":e>50?"#F59E0B":"#10B981";return n.createElement("div",{className:"cluster-heatmap-container glass-card",style:{padding:"28px"}},l&&n.createElement("h3",{className:"chart-title",style:{marginBottom:"28px",fontSize:"18px",fontWeight:"800",color:"#111827",letterSpacing:"-0.025em"}},o(l)),n.createElement("div",{className:"heatmap-grid",style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(240px, 1fr))",gap:"20px"}},t.map(e=>n.createElement("div",{key:e.clusterId,className:"heatmap-card glass-card",onClick:()=>null==r?void 0:r(e),style:{padding:"20px",background:"#FFFFFF",border:`1px solid ${i(e.intensityScore)}40`,cursor:"pointer",position:"relative",overflow:"hidden"}},n.createElement("div",{className:"intensity-bar",style:{position:"absolute",top:0,left:0,height:"4px",width:"100%",background:i(e.intensityScore)}}),n.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"12px"}},n.createElement("span",{style:{fontWeight:"600",fontSize:"14px",color:"#374151"}},e.clusterName),n.createElement("span",{style:{fontSize:"12px",fontWeight:"700",padding:"2px 8px",borderRadius:"12px",background:i(e.intensityScore)+"20",color:i(e.intensityScore)}},e.intensityScore,"%")),n.createElement("div",{className:"cluster-stats",style:{display:"flex",flexDirection:"column",gap:"8px"}},n.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},n.createElement("span",{style:{color:"#6B7280"}},o("EKYC_PENDING_WORKLOAD")),n.createElement("span",{style:{fontWeight:"600",color:"#1F2937"}},e.pendingWorkload)),n.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},n.createElement("span",{style:{color:"#6B7280"}},o("EKYC_ACTIVE_AGENCIES")),n.createElement("span",{style:{fontWeight:"600",color:"#1F2937"}},e.activeAgencies))),n.createElement("div",{className:"mini-spark",style:{marginTop:"12px",display:"flex",gap:"2px",alignItems:"flex-end",height:"20px"}},e.wards.map((t,a)=>n.createElement("div",{key:a,style:{flex:1,height:Math.min(100,t.pendingCount/e.pendingWorkload*100)+"%",background:i(e.intensityScore),opacity:.6,borderRadius:"1px"}})))))))},de={exportToCsv:function(e,t,n){if(void 0===t&&(t="dashboard_export.csv"),void 0===n&&(n=[]),!e||!e.length)return;const a=n.length?n.map(e=>e.id):Object.keys(e[0]),l=n.length?n.map(e=>e.label):a,r=[];r.push(l.map(e=>`"${String(e).replace(/"/g,'""')}"`).join(",")),e.forEach(e=>{const t=a.map(t=>`"${String(null!=e[t]?e[t]:"").replace(/"/g,'""')}"`);r.push(t.join(","))});const o=r.join("\n"),i=new Blob([o],{type:"text/csv;charset=utf-8;"}),s=document.createElement("a");if(void 0!==s.download){const e=URL.createObjectURL(i);s.setAttribute("href",e),s.setAttribute("download",t),s.style.visibility="hidden",document.body.appendChild(s),s.click(),document.body.removeChild(s)}},exportToExcel:function(e,t,n){void 0===t&&(t="dashboard_report.xlsx"),void 0===n&&(n=[]),de.exportToCsv(e,t.replace(".xlsx",".csv"),n)},printDashboard:()=>{"undefined"!=typeof window&&window.print()}},me=e=>{let{data:l,columns:r,title:o,filename:i}=e;const{t:s}=a.useTranslation(),[c,d]=t.useState(""),[m,u]=t.useState({key:null,direction:"asc"}),p=t.useMemo(()=>{let e=[...l||[]];return c&&(e=e.filter(e=>Object.values(e).some(e=>String(e).toLowerCase().includes(c.toLowerCase())))),m.key&&e.sort((e,t)=>e[m.key]<t[m.key]?"asc"===m.direction?-1:1:e[m.key]>t[m.key]?"asc"===m.direction?1:-1:0),e},[l,c,m]);return n.createElement("div",{className:"analytics-table-card glass-card",style:{padding:"0",overflow:"hidden"}},n.createElement("div",{className:"table-header",style:{padding:"28px",borderBottom:"1px solid rgba(229, 231, 235, 0.5)",display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:"16px"}},n.createElement("h3",{style:{fontSize:"18px",fontWeight:"800",color:"#111827",letterSpacing:"-0.025em"}},s(o)),n.createElement("div",{style:{display:"flex",gap:"12px",alignItems:"center"}},n.createElement("input",{type:"text",placeholder:s("EKYC_SEARCH_RECORDS"),value:c,onChange:e=>d(e.target.value),style:{padding:"8px 16px",borderRadius:"8px",border:"1px solid #D1D5DB",outline:"none",fontSize:"14px"}}),n.createElement("button",{onClick:()=>de.exportToCsv(p,i,r),style:{padding:"10px 20px",borderRadius:"12px",background:"var(--primary-gradient)",color:"#FFF",border:"none",cursor:"pointer",fontWeight:"700",fontSize:"14px",boxShadow:"0 4px 6px rgba(99, 102, 241, 0.2)"}},s("EKYC_EXPORT_CSV")))),n.createElement("div",{className:"table-body",style:{overflowX:"auto"}},n.createElement("table",{style:{width:"100%",borderCollapse:"collapse",textAlign:"left"}},n.createElement("thead",null,n.createElement("tr",{style:{background:"#F9FAFB"}},r.map(e=>n.createElement("th",{key:e.id,onClick:()=>(e=>{let t="asc";m.key===e&&"asc"===m.direction&&(t="desc"),u({key:e,direction:t})})(e.id),style:{padding:"16px 28px",fontSize:"11px",fontWeight:"700",color:"#6B7280",textTransform:"uppercase",cursor:"pointer",borderBottom:"1px solid rgba(229, 231, 235, 0.5)",letterSpacing:"0.05em"}},n.createElement("div",{style:{display:"flex",alignItems:"center",gap:"4px"}},s(e.label),m.key===e.id&&n.createElement("span",null,"asc"===m.direction?"↑":"↓")))))),n.createElement("tbody",null,p.map((e,t)=>n.createElement("tr",{key:t,style:{borderBottom:"1px solid #F3F4F6",transition:"background 0.2s"},onMouseOver:e=>e.currentTarget.style.background="#F9FAFB",onMouseOut:e=>e.currentTarget.style.background="transparent"},r.map(t=>n.createElement("td",{key:t.id,style:{padding:"16px 28px",fontSize:"14px",color:"#4B5563",fontWeight:"agencyName"===t.id?"600":"400"}},t.isCurrency?"₹"+new Intl.NumberFormat("en-IN").format(e[t.id]):t.isPercentage?e[t.id]+"%":e[t.id]))))))))},ue=e=>{let{slaPercentage:t,avgTime:l,breachedCount:r}=e;const{t:o}=a.useTranslation();return n.createElement("div",{className:"sla-widget-card glass-card",style:{padding:"28px"}},n.createElement("h3",{style:{fontSize:"18px",fontWeight:"800",color:"#111827",marginBottom:"28px",letterSpacing:"-0.025em"}},o("EKYC_SLA_PERFORMANCE")),n.createElement("div",{style:{display:"flex",alignItems:"center",gap:"24px",marginBottom:"24px"}},n.createElement("div",{style:{position:"relative",width:"100px",height:"100px",display:"flex",alignItems:"center",justifyContent:"center"}},n.createElement("svg",{width:"100",height:"100",viewBox:"0 0 100 100"},n.createElement("circle",{cx:"50",cy:"50",r:"40",stroke:"#F3F4F6",strokeWidth:"8",fill:"none"}),n.createElement("circle",{cx:"50",cy:"50",r:"40",stroke:(i=t,i>90?"#10B981":i>75?"#F59E0B":"#EF4444"),strokeWidth:"8",fill:"none",strokeDasharray:2.51*t+" 251",transform:"rotate(-90 50 50)",strokeLinecap:"round"}),n.createElement("text",{x:"50",y:"55",textAnchor:"middle",fontSize:"18",fontWeight:"700",fill:"#111827"},t,"%"))),n.createElement("div",null,n.createElement("div",{style:{fontSize:"14px",color:"#6B7280"}},o("EKYC_SLA_COMPLIANCE")),n.createElement("div",{style:{fontSize:"20px",fontWeight:"700",color:"#111827"}},o("EKYC_OPTIMAL_PERFORMANCE")))),n.createElement("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"16px",borderTop:"1px solid #F3F4F6",paddingTop:"20px"}},n.createElement("div",null,n.createElement("div",{style:{fontSize:"12px",color:"#6B7280",marginBottom:"4px"}},o("EKYC_AVG_LATENCY")),n.createElement("div",{style:{fontSize:"18px",fontWeight:"700",color:"#111827"}},l,"h")),n.createElement("div",null,n.createElement("div",{style:{fontSize:"12px",color:"#6B7280",marginBottom:"4px"}},o("EKYC_BREACH_COUNT")),n.createElement("div",{style:{fontSize:"18px",fontWeight:"700",color:"#EF4444"}},r))));var i},pe=e=>{let{stages:t}=e;const{t:l}=a.useTranslation();return t&&0!==t.length?n.createElement("div",{className:"workflow-timeline-card glass-card",style:{padding:"28px"}},n.createElement("h3",{style:{fontSize:"18px",fontWeight:"800",color:"#111827",marginBottom:"28px",letterSpacing:"-0.025em"}},l("EKYC_WORKFLOW_BOTTLENECK_ANALYSIS")),n.createElement("div",{className:"timeline-container",style:{display:"flex",flexDirection:"column",gap:"16px"}},t.map((e,a)=>n.createElement("div",{key:a,style:{display:"flex",gap:"16px",alignItems:"flex-start"}},n.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"}},n.createElement("div",{style:{width:"12px",height:"12px",borderRadius:"50%",background:e.avgDurationHours>20?"#EF4444":"#10B981",marginTop:"4px"}}),a!==t.length-1&&n.createElement("div",{style:{width:"2px",height:"40px",background:"#E5E7EB"}})),n.createElement("div",{style:{flex:1}},n.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"4px"}},n.createElement("span",{style:{fontSize:"14px",fontWeight:"600",color:"#374151"}},l(e.stageName)),n.createElement("span",{style:{fontSize:"12px",fontWeight:"700",color:e.avgDurationHours>20?"#EF4444":"#10B981"}},e.avgDurationHours,"h ",l("EKYC_AVG"))),n.createElement("div",{style:{width:"100%",height:"6px",background:"#F3F4F6",borderRadius:"3px",overflow:"hidden"}},n.createElement("div",{style:{width:Math.min(100,e.count/1e3*100)+"%",height:"100%",background:e.avgDurationHours>20?"#EF444480":"#10B98180"}})),n.createElement("div",{style:{fontSize:"12px",color:"#6B7280",marginTop:"4px"}},e.count," ",l("EKYC_APPLICATIONS_IN_STAGE"))))))):null},Ee=e=>{let{notifications:t,isOpen:l,onClose:r}=e;const{t:o}=a.useTranslation();return l?n.createElement(Fragment,null,n.createElement("div",{onClick:r,style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",background:"rgba(0,0,0,0.3)",zIndex:999}}),n.createElement("div",{className:"notification-panel",style:{position:"fixed",top:0,right:0,width:"350px",height:"100%",background:"#FFFFFF",zIndex:1e3,boxShadow:"-4px 0 15px rgba(0,0,0,0.1)",display:"flex",flexDirection:"column"}},n.createElement("div",{style:{padding:"20px",borderBottom:"1px solid #F3F4F6",display:"flex",justifyContent:"space-between",alignItems:"center"}},n.createElement("h3",{style:{fontSize:"18px",fontWeight:"700",color:"#111827"}},o("EKYC_ALERTS_CENTER")),n.createElement("button",{onClick:r,style:{background:"none",border:"none",fontSize:"24px",cursor:"pointer",color:"#9CA3AF"}},"×")),n.createElement("div",{style:{flex:1,overflowY:"auto",padding:"16px"}},0===t.length?n.createElement("div",{style:{textAlign:"center",color:"#9CA3AF",marginTop:"40px"}},o("EKYC_NO_NEW_ALERTS")):t.map((e,t)=>n.createElement("div",{key:t,style:{padding:"16px",borderRadius:"12px",background:"HIGH"===e.priority?"#FEF2F2":"#F9FAFB",border:"1px solid "+("HIGH"===e.priority?"#FECACA":"#E5E7EB"),marginBottom:"12px"}},n.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"4px"}},n.createElement("span",{style:{fontSize:"10px",fontWeight:"800",padding:"2px 6px",borderRadius:"4px",background:"HIGH"===e.priority?"#EF4444":"#3B82F6",color:"#FFFFFF"}},e.priority),n.createElement("span",{style:{fontSize:"11px",color:"#9CA3AF"}},e.time)),n.createElement("h4",{style:{fontSize:"14px",fontWeight:"600",color:"#374151",marginBottom:"4px"}},o(e.title)),n.createElement("p",{style:{fontSize:"13px",color:"#6B7280"}},o(e.message))))),n.createElement("div",{style:{padding:"16px",borderTop:"1px solid #F3F4F6"}},n.createElement("button",{style:{width:"100%",padding:"12px",borderRadius:"8px",background:"#F3F4F6",color:"#374151",border:"none",fontWeight:"600",cursor:"pointer"}},o("EKYC_MARK_ALL_READ"))))):null},ve=e=>{let{type:a="card",count:l=1}=e;return n.createElement(t.Fragment,null,n.createElement("style",null,"\n @keyframes pulse {\n 0% { opacity: 1; }\n 50% { opacity: 0.5; }\n 100% { opacity: 1; }\n }\n "),n.createElement("div",{style:{display:"grid",gap:"16px",gridTemplateColumns:"card"===a?"repeat(auto-fill, minmax(240px, 1fr))":"1fr"}},Array(l).fill(0).map((e,t)=>n.createElement(n.Fragment,{key:t},(()=>{switch(a){case"card":return n.createElement("div",{className:"skeleton-card",style:{padding:"24px",background:"#F3F4F6",borderRadius:"12px",height:"140px",animation:"pulse 1.5s infinite"}},n.createElement("div",{style:{height:"16px",width:"40%",background:"#E5E7EB",marginBottom:"16px",borderRadius:"4px"}}),n.createElement("div",{style:{height:"32px",width:"70%",background:"#E5E7EB",marginBottom:"12px",borderRadius:"4px"}}),n.createElement("div",{style:{height:"12px",width:"30%",background:"#E5E7EB",borderRadius:"4px"}}));case"chart":return n.createElement("div",{className:"skeleton-chart",style:{padding:"24px",background:"#F3F4F6",borderRadius:"12px",height:"300px",animation:"pulse 1.5s infinite"}},n.createElement("div",{style:{height:"20px",width:"30%",background:"#E5E7EB",marginBottom:"24px",borderRadius:"4px"}}),n.createElement("div",{style:{height:"200px",width:"100%",background:"#E5E7EB",borderRadius:"8px"}}));case"table":return n.createElement("div",{className:"skeleton-table",style:{padding:"16px",background:"#F3F4F6",borderRadius:"12px",animation:"pulse 1.5s infinite"}},[1,2,3,4,5].map(e=>n.createElement("div",{key:e,style:{height:"40px",width:"100%",background:"#E5E7EB",marginBottom:"8px",borderRadius:"4px"}})));default:return null}})()))))};class ge extends n.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0}}render(){return this.state.hasError?n.createElement("div",{style:{padding:"20px",background:"#FEF2F2",border:"1px solid #FECACA",borderRadius:"8px",textAlign:"center"}},n.createElement("h4",{style:{color:"#991B1B",marginBottom:"8px"}},"Widget Error"),n.createElement("p",{style:{color:"#B91C1C",fontSize:"12px"}},"Failed to render this component.")):this.props.children}}const ye=e=>{let{message:t="EKYC_NO_DATA_FOUND"}=e;const{t:l}=a.useTranslation();return n.createElement("div",{className:"empty-state-container",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"60px 20px",background:"#F9FAFB",borderRadius:"12px",border:"1px dashed #D1D5DB"}},n.createElement("div",{style:{fontSize:"48px",marginBottom:"16px"}},"🔍"),n.createElement("h3",{style:{fontSize:"18px",fontWeight:"600",color:"#374151",marginBottom:"8px"}},l("EKYC_EMPTY_STATE_TITLE")||"No Results Found"),n.createElement("p",{style:{color:"#6B7280",textAlign:"center",maxWidth:"300px"}},l(t)||"Try adjusting your filters or check back later for updated metrics."))},fe=e=>{let{stateCode:a,userType:o,tenants:i}=e;const{path:s,url:c}=l.useRouteMatch(),d=Digit.StoreData.getCurrentLanguage(),{isLoading:m}=Digit.Services.useStore({stateCode:a,moduleCode:"EKYC",language:d});return Digit.SessionStorage.set("EKYC_TENANTS",i),t.useEffect(()=>Digit.LocalizationService.getLocale({modules:["rainmaker-ekyc","rainmaker-"+Digit.ULBService.getCurrentTenantId()],locale:Digit.StoreData.getCurrentLanguage(),tenantId:Digit.ULBService.getCurrentTenantId()}),[]),m?n.createElement(r.Loader,{page:!0}):"employee"===o?n.createElement(Q,{path:s,url:c,userType:o,tenants:i}):n.createElement(le,null)},Ce=e=>{let{matchPath:t}=e;const{t:l}=a.useTranslation(),o=[{link:t+"/create-kyc",i18nKey:l("EKYC_CREATE_KYC")},{link:t+"/update-kyc",i18nKey:l("EKYC_UPDATE_KYC")}];return n.createElement(r.CitizenHomeCard,{header:l("EKYC_MODULE_NAME"),links:o,Icon:()=>n.createElement(r.DocumentIcon,{className:"fill-path-primary-main"})})},be={EKYCModule:fe,EKYCCard:()=>{const{t:e}=a.useTranslation(),t={Icon:n.createElement(r.PersonIcon,null),moduleName:e("ACTION_TEST_EKYC"),kpis:[{count:"-",label:e("TOTAL_EKYC"),link:"/digit-ui/employee/ekyc/dashboard"}],links:[{label:e("EKYC_DASHBOARD"),link:"/digit-ui/employee/ekyc/dashboard"},{label:e("EKYC_INBOX"),link:"/digit-ui/employee/ekyc/inbox"},{label:e("CEO_M.F_DOR_FINANCE_VIEW"),link:"/digit-ui/employee/ekyc/ceo-dashboard"},{label:e("EKYC_MAPPING"),link:"/digit-ui/employee/ekyc/mapping"}]};return n.createElement(r.EmployeeModuleCard,t)},EKYCInbox:d,EKYCDesktopInbox:e=>{var o;let{filterComponent:i,...s}=e;const{data:d,isLoading:m,onSort:u,onNextPage:p,onPrevPage:E,currentPage:v,pageSizeLimit:g,onPageSizeChange:y,parentRoute:f,searchParams:C,sortParams:b,totalRecords:h,countData:S}=s,{t:x}=a.useTranslation(),N=l.useHistory(),k=Digit.ULBService.getCurrentTenantId(),_=null===(o=Digit.ComponentRegistryService)||void 0===o?void 0:o.getComponent(i),[T,I]=t.useState(""),{data:F,getReview:D}=Digit.Hooks.ekyc.useEkycAPI("review",k),R=e=>{I(e),D({kno:e})};n.useEffect(()=>{F&&N.push("/digit-ui/employee/ekyc/review",{kNumber:T,aadhaarData:null==F?void 0:F.aadhaarData,reviewData:F})},[F]);const A=t.useMemo(()=>[{Header:x("EKYC_APPLICATION_NO"),accessor:"applicationNumber",Cell:e=>{var t,a;let{row:l}=e;const r=(null===(t=l.original)||void 0===t?void 0:t.kno)||(null===(a=l.original)||void 0===a?void 0:a.applicationNumber)||"NA";return n.createElement("span",{className:"ekyc-application-link",style:{color:"#add8f7",cursor:"pointer",fontWeight:"bold"},onClick:()=>R(r)},r)}},{Header:x("EKYC_CITIZEN_NAME"),accessor:"citizenName",Cell:e=>{var t;let{row:a}=e;return n.createElement("span",null,(null===(t=a.original)||void 0===t?void 0:t.citizenName)||"NA")}},{Header:x("EKYC_STATUS"),accessor:"actionStatus",Cell:e=>{var t;let{row:a}=e;const l=(null===(t=a.original)||void 0===t?void 0:t.status)||"DEFAULT";return n.createElement("span",{className:"ekyc-status-tag "+l},x(""+l))}},{Header:x("EKYC_ACTION"),accessor:"status",Cell:e=>{var t,a;let{row:l}=e;const r=(null===(t=l.original)||void 0===t?void 0:t.kno)||(null===(a=l.original)||void 0===a?void 0:a.applicationNumber)||"NA";return n.createElement("span",{className:"ekyc-application-link",style:{color:"#add8f7",cursor:"pointer",fontWeight:"bold"},onClick:()=>R(r)},x("EKYC_REVIEW"))}}],[x,f]),L=t.useMemo(()=>(null==d?void 0:d.items)||(Array.isArray(d)?d:[]),[d]);return n.createElement("div",{className:"app-container"},n.createElement("div",{className:"inbox-container"},m&&n.createElement(r.Loader,null),n.createElement("div",{className:"side-panel-item"},n.createElement(r.InboxLinks,{headerText:s.moduleCode}),_&&n.createElement(_,{defaultSearchParams:s.defaultSearchParams,onFilterChange:s.onSearch,searchParams:C,type:"desktop",moduleCode:"EKYC"})),n.createElement("div",{className:"employee-form-content",style:{flex:1}},n.createElement(r.Card,{className:"ekyc-metrics-card"},n.createElement(c,{countData:S})),n.createElement("div",{className:"result",style:{flex:1}},n.createElement(r.Card,{className:"ekyc-table-card",style:{padding:0}},n.createElement(r.Table,{t:x,data:L,columns:A,isLoading:m,onSort:u,sortParams:b,totalRecords:h,onNextPage:p,onPrevPage:E,currentPage:v,pageSizeLimit:g,onPageSizeChange:y,getCellProps:e=>({className:"ekyc-table-cell"})}))))))},EKYCMobileInbox:e=>{var t;let{data:o,isLoading:i,onSearch:s,searchParams:d,parentRoute:u,countData:p}=e;const{t:E}=a.useTranslation(),v=(null==o||null===(t=o.items)||void 0===t?void 0:t.map(e=>({[E("EKYC_APPLICATION_NO")]:e.applicationNumber,[E("EKYC_CITIZEN_NAME")]:e.citizenName,[E("EKYC_MOBILE_NO")]:e.mobileNumber,[E("EKYC_STATUS")]:n.createElement("span",{className:"ekyc-status-tag "+e.status},E("EKYC_STATUS_"+e.status))})))||[];return n.createElement("div",{className:"inbox-wrapper"},n.createElement("div",{className:"ekyc-header-container module-header"},n.createElement(r.Header,{className:"title"},E("EKYC_INBOX_HEADER")),n.createElement(l.Link,{to:u+"/create-kyc"},n.createElement(r.SubmitBar,{label:E("EKYC_CREATE_KYC")}))),n.createElement("div",{className:"ekyc-metrics-section"},n.createElement(c,{countData:p})),n.createElement(m,{onSearch:s,searchParams:d}),n.createElement("div",{className:"mobile-data-container"},i?n.createElement(r.Loader,null):(null==v?void 0:v.length)>0?n.createElement(r.DetailsCard,{data:v,t:E,serviceRequestIdKey:E("EKYC_APPLICATION_NO"),linkPrefix:u+"/application-details/"}):n.createElement(r.Card,null,E("ES_COMMON_NO_DATA").split("\\n").map((e,t)=>n.createElement("p",{key:t,style:{textAlign:"center"}},e)))))},EKYC_INBOX_FILTER:e=>n.createElement(u,e),EkycLinks:Ce,AadhaarVerification:X,AddressDetails:ae,PropertyInfo:J,MeterDetails:ee,CeoDashboard:()=>{var e,l;a.useTranslation();const{routeToInbox:r}=Digit.Hooks.ekyc.useInboxRouting(),[o,i]=t.useState("CEO"),[s,c]=t.useState(!1),[d,m]=t.useState({financialYear:"2025-26",clusterId:"ALL",agencyId:"ALL"}),{config:u}=Digit.Hooks.ekyc.useEkycDashboardConfigs(o),{summary:p,agencies:E,heatmap:v,workflow:g,isLoading:y,isError:f}=Digit.Hooks.ekyc.useEkycDashboardData(o,d),C=(e,t)=>{m(n=>({...n,[e]:t}))},b=()=>{m({financialYear:"2025-26",clusterId:"ALL",agencyId:"ALL"})};return f?n.createElement(ye,{message:"EKYC_ERROR_FETCHING_DATA"}):n.createElement(re,{header:u.title,activeRole:o,onRoleChange:e=>{i(e),b()},onNotificationClick:()=>c(!0),filters:n.createElement(oe,{filters:d,config:u.globalFilters,onFilterChange:C,onReset:b})},n.createElement(Ee,{isOpen:s,onClose:()=>c(!1),notifications:[{title:"EKYC_SLA_BREACH_ALERT",message:"EKYC_ALERT_DESC_1",priority:"HIGH",time:"10m ago"},{title:"EKYC_SYSTEM_UPDATE",message:"EKYC_ALERT_DESC_3",priority:"NORMAL",time:"5h ago"}]}),n.createElement("section",{style:{marginBottom:"32px"}},y?n.createElement(ve,{type:"card",count:4}):n.createElement("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))",gap:"24px"}},null==u||null===(e=u.widgets)||void 0===e||null===(l=e.summary)||void 0===l?void 0:l.map((e,t)=>{var a;const l=null==u||null===(a=u.kpis)||void 0===a?void 0:a[e];return l?n.createElement(ge,{key:e},n.createElement("div",{className:"animate-fade-in",style:{animationDelay:.1*t+"s"}},n.createElement(ie,{label:l.label,value:(null==p?void 0:p[e])||0,color:l.color,icon:l.icon,trend:null==p?void 0:p[e+"Trend"],onClick:()=>{var e;r((e=l).targetRoute,{...d,status:e.status})}}))):null}))),n.createElement("div",{style:{display:"grid",gridTemplateColumns:"repeat(12, 1fr)",gap:"24px"}},n.createElement("div",{style:{gridColumn:"span 12",background:"#FFF",padding:"24px",borderRadius:"16px",boxShadow:"0 1px 3px rgba(0,0,0,0.1)"}},y?n.createElement(ve,{type:"chart"}):n.createElement(ge,null,n.createElement(se,{title:"EKYC_APPLICATION_STATUS",data:(null==g?void 0:g.stageBreakdown)||[]}))),n.createElement("div",{style:{gridColumn:"span 4"}},y?n.createElement(ve,{type:"chart"}):n.createElement(ge,null,n.createElement(ue,{slaPercentage:(null==g?void 0:g.slaCompliance)||0,avgTime:(null==g?void 0:g.avgProcessingTimeHours)||0,breachedCount:(null==g?void 0:g.breachCount)||0}))),n.createElement("div",{style:{gridColumn:"span 8"}},y?n.createElement(ve,{type:"chart"}):n.createElement(ge,null,n.createElement(pe,{stages:(null==g?void 0:g.stageBreakdown)||[]}))),n.createElement("div",{style:{gridColumn:"span 12",background:"#FFF",padding:"24px",borderRadius:"16px",boxShadow:"0 1px 3px rgba(0,0,0,0.1)"}},y?n.createElement(ve,{type:"chart"}):n.createElement(ge,null,n.createElement(ce,{title:"EKYC_CLUSTER_WORKLOAD_HEATMAP",data:v||[],onDrillDown:e=>C("clusterId",e.clusterId)}))),n.createElement("div",{style:{gridColumn:"span 12"}},y?n.createElement(ve,{type:"table"}):n.createElement(ge,null,n.createElement(me,{title:"EKYC_AGENCY_PERFORMANCE_METRICS",filename:"agency_performance_report.csv",data:E||[],columns:[{id:"agencyName",label:"EKYC_AGENCY_NAME"},{id:"totalAssigned",label:"EKYC_TOTAL_ASSIGNED"},{id:"totalCompleted",label:"EKYC_TOTAL_COMPLETED"},{id:"pendingCount",label:"EKYC_PENDING"},{id:"slaCompliance",label:"EKYC_SLA_COMPLIANCE",isPercentage:!0}]})))))}};exports.EkycLinks=Ce,exports.EkycModule=fe,exports.default=fe,exports.initEkycComponents=()=>{Object.entries(be).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)})};