@djb25/digit-ui-module-ekyc 1.0.9 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +298 -28
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
- package/src/Module.js +3 -8
- package/src/{pages/employee → components}/Dashboard.js +3 -3
- package/src/pages/citizen/Home.js +41 -0
- package/src/pages/citizen/Inbox.js +255 -0
- package/src/pages/citizen/index.js +44 -65
- package/src/pages/employee/index.js +1 -1
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),d=(null==n?void 0:n.total)||0,m=(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=d>0?Math.round(E/d*100):0,g=d>0?Math.round(p/d*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,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 b=[{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 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(d)),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=e=>{const l=Digit.ULBService.getCurrentTenantId(),{isLoading:n,data:o}=Digit.Hooks.ekyc.useEkycSurveyorDashboard({},{tenantId:l,offset:0,limit:10},{enabled:!!l}),i=t.useMemo(()=>{const e=(null==o?void 0:o.dashboardInfo)||{};return{total:e.total||0,completed:e.completed||0,pending:e.pending||0,rejected:e.rejected||0,active:e.active||0}},[o]);return n?a.createElement(r.Loader,null):a.createElement(r.Card,null,a.createElement(s,{countData:i}))},d=e=>{var n,o,i;let{onSearch:s,searchParams:c,children:d,...m}=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=m.countData)||void 0===n?void 0:n.todaysAudits)||24),a.createElement("div",{className:"audits-change"},a.createElement("span",null,"↗"),(null===(o=m.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=m.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")))))),d)))},m=e=>{let{searchParams:n,onFilterChange:o,defaultSearchParams:i,...s}=e;const{t:c}=l.useTranslation(),[d,m]=t.useState(()=>({...n}));return a.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},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={...d,status:e};m(t),o(t)},selected:(null==d?void 0:d.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)}function E(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 p=e=>null==e;const v=e=>"object"==typeof e;var g=e=>!p(e)&&!Array.isArray(e)&&v(e)&&!(e instanceof Date),C=e=>e.filter(Boolean),b=e=>void 0===e,S=function(e,t,a){void 0===e&&(e={});const l=C(t.split(/[,[\].]+?/)).reduce((e,t)=>p(e)?e:e[t],e);return b(l)||l===e?b(e[t])?a:e[t]:l},f=e=>"function"==typeof e;const N=t.createContext(null);N.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(N);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:E,reValidateMode:{isReValidateOnBlur:y,isReValidateOnChange:h},formState:_,formStateRef:{current:{isSubmitted:x,touched:T,errors:I}},updateFormState:R,readFormStateRef:k,fieldsRef:D,fieldArrayNamesRef:A,shallowFieldsStateRef:L}=r||i.control,w=!((e,t)=>[...e].some(e=>((e,t)=>RegExp(`^${t}([|.)\\d+`.replace(/\[/g,"\\[").replace(/\]/g,"\\]")).test(e))(t,e)))(A.current,a),O=()=>!b(S(L.current,a))&&w?S(L.current,a):b(n)?S(s.current,a):n,[F,K]=t.useState(O()),Y=t.useRef(F),M=t.useRef({focus:()=>null}),P=t.useRef(o||(()=>{f(M.current.focus)&&M.current.focus(),"production"!==process.env.NODE_ENV&&(f(M.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:y,isReValidateOnChange:h,isSubmitted:x,isTouched:!!S(T,a)},E)),[y,h,x,T,a,E]),z=t.useCallback(e=>{let[t]=e;const a=(e=>{return p(t=e)||!v(t)||!g(e.target)||g(e.target)&&!e.type?e:b(e.target.value)?e.target.checked:e.target.value;var t})(t);return K(a),Y.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):(d(Object.defineProperties({name:a,focus:P.current},{value:{set(e){K(e),Y.current=e},get:()=>Y.current}}),l),e=b(S(s.current,a))),e&&w&&K(O())},[l,a,d]);t.useEffect(()=>()=>m(a),[a]),t.useEffect(()=>{"production"!==process.env.NODE_ENV&&(b(F)&&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)`),!w&&b(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(()=>{k.current.touched&&!S(T,a)&&(function(e,t,a){let l=-1;const n=(e=>/^\w*$/.test(e))(t)?[t]:C(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=g(r)||Array.isArray(r)?r:isNaN(+n[l+1])?{}:[]}e[t]=a,e=e[t]}}(T,a),R({touched:T})),B(!0)&&u(a)},[a,R,B,u,k]);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:F,ref:M},meta:Object.defineProperties({invalid:!!S(I,a)},{isDirty:{get:()=>!!S(_.dirtyFields,a)},isTouched:{get:()=>!!S(_.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},h=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.Tooltip,{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)))},_=e=>{var o,i,s,c,d;let{parentRoute:m,businessService:E="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===(o=C.tableForm)||void 0===o?void 0:o.offset,null==C||null===(i=C.tableForm)||void 0===i?void 0:i.limit,null==C?void 0:C.searchForm]),{isLoading:f,data:N={}}=Digit.Hooks.ekyc.useEkycSurveyorDashboard({},S,{enabled:!!v,keepPreviousData:!0}),y=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===(s=C.searchForm)||void 0===s?void 0:s.kNumber,null==C||null===(c=C.searchForm)||void 0===c?void 0:c.kName]),_=!(!y.kno&&!y.name),{isLoading:x,data:T}=Digit.Hooks.ekyc.useSearchConnection({tenantId:v,details:y},{enabled:!!v&&!!y.kno,keepPreviousData:!0}),I=t.useMemo(()=>{var e;return _?T?[T]:[]:(null==N||null===(e=N.dashboardInfo)||void 0===e?void 0:e.consumerList)||[]},[_,T,N]),R=t.useMemo(()=>(I||[]).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}}),[I]),k=(null==N||null===(d=N.dashboardInfo)||void 0===d?void 0:d.totalRecords)||(null==N?void 0:N.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(h,{registerRef:t,searchFormState:l,controlSearchForm:n,className:"search"})},[]),w={sortBy:"createdTime",limit:window.Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"DESC"},O={mobileNumber:"",applicationNumber:"",consumerNo:""},F={SearchFormFields:L,onSearchFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),b({action:"mutateTableForm",data:{...w},checkPathName:D}),b({action:"mutateSearchForm",data:e,checkPathName:D})},searchFormDefaultValues:null==C?void 0:C.searchForm,resetSearchFormDefaultValues:O,onSearchFormReset:e=>{e("mobileNumber",null),e("applicationNumber",null),e("consumerNo",null),b({action:"mutateSearchForm",data:O})},className:"search-form-wns-inbox"},K={FilterFormFields:t.useCallback(e=>a.createElement(a.Fragment,null),[]),onFilterFormSubmit:()=>{},filterFormDefaultValues:"",resetFilterFormDefaultValues:"",onFilterFormReset:()=>{}},Y=(e=>{var r,o,i;let{onPageSizeChange:s,formState:c,totalCount:d,table:m,dispatch:u,checkPathName:E,onSortingByData:p,tenantId:v,inboxStyles:g={},tableStyle:C={}}=e;const{t:b}=l.useTranslation(),S=n.useHistory(),[f,N]=t.useState(""),{data:y,getReview:h}=Digit.Hooks.ekyc.useEkycAPI("review",v),_=e=>{N(e),h({kno:e})},x=(null==c||null===(r=c.tableForm)||void 0===r?void 0:r.limit)||10,T=(null==c||null===(o=c.tableForm)||void 0===o?void 0:o.offset)||0;a.useEffect(()=>{y&&S.push("/digit-ui/employee/ekyc/review",{kNumber:f,aadhaarData:null==y?void 0:y.aadhaarData,reviewData:y})},[y]);const I=[{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(T/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: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:E})},onFirstPage:()=>u({action:"mutateTableForm",data:{...c.tableForm,offset:0},checkPathName:E}),data:m,columns:I,inboxStyles:{...g},tableStyle:{...C}}})({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:k,table:R,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:f||x,PropsForInboxLinks:A},F,K,{propsForInboxTable:Y,formState:C})))},x=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"}))},k=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"}))},D=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"}))},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",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"}))},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.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"}],F=[{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"}],K=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,d]=t.useState([]),[m,u]=t.useState(null),[E,p]=t.useState(null),[v,g]=t.useState(null),[C,b]=t.useState(null),[S,f]=t.useState(null),N=()=>{u(null),p(null),g(null)},y=t.useMemo(()=>[{Header:e("EKYC_SURVEYOR_NAME")||"Surveyor",accessor:"surveyorName",Cell:t=>{let{row:l}=t;return m===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(x,{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 m===l.original.id?a.createElement("div",{style:{minWidth:"200px"}},a.createElement(r.Dropdown,{selected:v,select:g,option:F,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(k,{size:10})," ",l.original.zone)))}},{Header:e("ES_COMMON_ACTION")||"Actions",Cell:e=>{let{row:t}=e;return m===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)?f({type:"warning",message:"This mapping already exists"}):(d(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),f({type:"success",message:"Mapping updated successfully"})):f({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(L,{size:13})," Save"),a.createElement("button",{onClick:N,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(F.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"))}}],[m,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:()=>{f(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(A,{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(x,{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:F,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(k,{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(x,{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)?f({type:"warning",message:e("EKYC_MAPPING_EXISTS")||"This mapping already exists"}):(d(e=>[...e,{id:Date.now(),surveyorName:n.name,surveyorId:n.id,mrdName:i.name,mrdCode:i.code,zone:i.zone}]),s(null),f({type:"success",message:e("EKYC_MAPPING_ADDED")||"Mapping added successfully"})):f({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(D,{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(x,{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:y,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(K,{mapping:C,onConfirm:()=>{d(e=>e.filter(e=>e.id!==C.id)),b(null),f({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:()=>f(null)}))},M=e=>{let{kNumber:o,kName:i,connectionDetails:s,isLoading:c}=e;const{t:d}=l.useTranslation(),m=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"},d("EKYC_K_NUMBER_DETAILS")||"Consumer Identity Details")),a.createElement("span",{className:"status-badge "+(S?"active":"inactive")},S?d("EKYC_ACTIVE_CONNECTION")||"Active Connection":b||d("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"},d("EKYC_VERIFICATION_PARAMETERS")||"Verification Parameters"),a.createElement("div",{className:"data-grid"},a.createElement("div",{className:"data-item"},a.createElement("div",{className:"data-label"},d("EKYC_CONSUMER_NAME")||"Consumer Name"),a.createElement("div",{className:"data-value"},C.consumerName||i||d("CS_NA"))),a.createElement("div",{className:"data-item"},a.createElement("div",{className:"data-label"},d("EKYC_K_NUMBER")||"K Number"),a.createElement("div",{className:"data-value blue"},o||d("CS_NA"))),a.createElement("div",{className:"data-item"},a.createElement("div",{className:"data-label"},d("EKYC_METER_NO")||"Meter Serial No."),a.createElement("div",{className:"data-value"},C.meterNumber||d("CS_NA"))),a.createElement("div",{className:"data-item"},a.createElement("div",{className:"data-label"},d("EKYC_CONNECTION_TYPE")||"Connection Type"),a.createElement("div",{className:"data-value"},C.connectionType||d("CS_NA"))))),a.createElement("div",{className:"vertical-divider"}),a.createElement("div",{className:"detail-section"},a.createElement("div",{className:"section-title"},d("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"},d("EKYC_ADDRESS")||"Service Address"),a.createElement("div",{className:"address-text"},C.address||d("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"},d("EKYC_PHONE_NO")||"Contact"),a.createElement("div",{className:"address-text"},C.phoneNumber||d("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"},d("EKYC_EMAIL")||"Email Address"),a.createElement("div",{className:"address-text"},C.email||d("CS_NA")))))))),a.createElement("div",{className:"details-card-footer"},a.createElement("div",{className:"footer-meta-text"},null!=s&&s.lastVerified?`${d("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"}},d("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:d("EKYC_SELECT_VERIFICATION_TYPE"),headerBarEnd:a.createElement("span",{onClick:()=>p(!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}),p(!1)},actionCancelLabel:d("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:d}))))},P=()=>{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,m]=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;m({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(d,{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)):m({error:!0,label:e("EKYC_FILL_ALL_FIELDS")})},searchParams:n},i&&a.createElement(M,{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:()=>{m(null)},isDsc:!0}))},B=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})}})},z=e=>null!=e&&""!==e?e:"N/A",U=(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",H=()=>{var e,o,i,s,c,d,m;const{t:u}=l.useTranslation(),p=n.useHistory(),v=n.useLocation(),[g,C]=t.useState(!1),[b,S]=t.useState(!1),f=v.state||{},{kNumber:N,kno:y,edits:h={}}=f,_=N||y,{aadhaarData:x={},addressDetails:T={},propertyDetails:I={},meterDetails:R={}}=h,k=Digit.ULBService.getCurrentTenantId(),{data:D,isLoading:A}=Digit.Hooks.ekyc.useEkycSearchReview({kno:_,fetchType:"REVIEW"},k,{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,f),w=(null==L?void 0:L.connectionDetails)||L||{},O=(null==L?void 0:L.addressDetails)||L||{},F=(null==L?void 0:L.propertyInfo)||L||{},K=(null==L?void 0:L.meterDetails)||L||{},Y={consumerName:(null==x?void 0:x.name)||(null==w?void 0:w.consumerName),address:(null==w?void 0:w.address)||(null==w?void 0:w.addressRaw),connectionType:(null==w?void 0:w.connectionType)||(null==w?void 0:w.connectionCategory),meterNumber:(null==w?void 0:w.meterNumber)||(null==w?void 0:w.meterNo),phoneNumber:(null==x?void 0:x.mobileNumber)||(null==w?void 0:w.phoneNumber)||(null==w?void 0:w.mobileNo),email:null==w?void 0:w.email,statusflag:(null==w?void 0:w.statusflag)||(null==w?void 0:w.statusFlag),ekycStatus:null==w?void 0:w.ekycStatus,knumber:(null==w?void 0:w.knumber)||(null==w?void 0:w.kno)||_},M={fullAddress:(null==T?void 0:T.fullAddress)||(null==O?void 0:O.fullAddress)||(null==O?void 0:O.addressRaw),flatHouseNumber:(null==T?void 0:T.flatHouseNumber)||(null==T?void 0:T.flatNo)||(null==O?void 0:O.flatHouseNumber),buildingTower:(null==T?void 0:T.buildingTower)||(null==T?void 0:T.building)||(null==O?void 0:O.buildingTower),landmark:(null==T?void 0:T.landmark)||(null==O?void 0:O.landmark),pinCode:(null==T?void 0:T.pinCode)||(null==T?void 0:T.pincode)||(null==O?void 0:O.pinCode)||(null==O?void 0:O.pincode),ward:(null==T?void 0:T.ward)||(null==O?void 0:O.ward)||(null==O?void 0:O.locality),assembly:(null==T?void 0:T.assembly)||(null==O?void 0:O.assembly),gpsValid:void 0!==(null==T?void 0:T.gpsValid)?T.gpsValid:null==O?void 0:O.gpsValid,latitude:(null==T?void 0:T.latitude)||(null==O?void 0:O.latitude),longitude:(null==T?void 0:T.longitude)||(null==O?void 0:O.longitude),mobileNo:(null==T?void 0:T.mobileNo)||(null==x?void 0:x.mobileNumber)||(null==O?void 0:O.mobileNo),whatsappNo:(null==T?void 0:T.whatsappNo)||(null==x?void 0:x.whatsappNumber)||(null==O?void 0:O.whatsappNo),email:(null==T?void 0:T.email)||(null==O?void 0:O.email),noOfPerson:(null==T?void 0:T.noOfPerson)||(null==x?void 0:x.noOfPersons)||(null==O?void 0:O.noOfPerson),knumber:(null==T?void 0:T.knumber)||(null==O?void 0:O.knumber)||(null==O?void 0:O.kno)||_,doorPhotoFilestoreId:(null==T?void 0:T.doorPhotoFileStoreId)||(null==O?void 0:O.doorPhotoFilestoreId)},P={kno:(null==F?void 0:F.kno)||_,pidNumber:(null==I?void 0:I.pidNumber)||(null==F?void 0:F.pidNumber),typeOfConnection:(null==I||null===(e=I.connectionTypeData)||void 0===e?void 0:e.label)||(null==F?void 0:F.typeOfConnection),connectionCategory:(null==I||null===(o=I.connectionCategoryData)||void 0===o?void 0:o.label)||(null==F?void 0:F.connectionCategory),userType:(null==I||null===(i=I.userTypeData)||void 0===i?void 0:i.label)||(null==F?void 0:F.userType),numberOfFloors:(null==I||null===(s=I.noOfFloorsData)||void 0===s?void 0:s.label)||(null==F?void 0:F.numberOfFloors),tenantName:null==F?void 0:F.tenantName,tenantMobile:null==F?void 0:F.tenantMobile,ekycStatus:null==F?void 0:F.ekycStatus,propertyDocumentFileStoreId:(null==I?void 0:I.propertyDocumentFileStoreId)||(null==F?void 0:F.propertyDocumentFileStoreId),buildingImageFileStoreId:null==F?void 0:F.buildingImageFileStoreId},H={kno:(null==R?void 0:R.kno)||(null==K?void 0:K.kno)||_,metered:"Metered"===(null==R||null===(c=R.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==R?void 0:R.meterMake)||(null==K?void 0:K.meterMake),meterLocationAddress:(null==R?void 0:R.meterLocation)||(null==K?void 0:K.meterLocationAddress),meterLatitude:null==K?void 0:K.meterLatitude,meterLongitude:null==K?void 0:K.meterLongitude,workingStatus:"Working"===(null==R||null===(d=R.workingStatusData)||void 0===d?void 0:d.value)||(null==K?void 0:K.workingStatus),lastBillRaised:"Yes"===(null==R||null===(m=R.lastBillRaisedData)||void 0===m?void 0:m.value)||(null==K?void 0:K.lastBillRaised),systemMeterId:null==K?void 0:K.systemMeterId,meterPhotoFileStoreId:(null==R?void 0:R.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:z(Y.knumber)}),a.createElement(r.Row,{label:u("EKYC_CONSUMER_NAME"),text:z(Y.consumerName)}),a.createElement(r.Row,{label:u("EKYC_ADDRESS"),text:z(Y.address)}),a.createElement(r.Row,{label:u("EKYC_CONNECTION_TYPE"),text:z(Y.connectionType)}),a.createElement(r.Row,{label:u("EKYC_METER_NO"),text:z(Y.meterNumber)}),a.createElement(r.Row,{label:u("EKYC_MOBILE_NO"),text:z(Y.phoneNumber)}),a.createElement(r.Row,{label:u("EKYC_EMAIL"),text:z(Y.email)}),a.createElement(r.Row,{label:u("EKYC_STATUS_FLAG"),text:z(Y.statusflag)}),a.createElement(r.Row,{label:u("EKYC_STATUS"),text:z(Y.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:z(M.fullAddress),actionButton:a.createElement(B,{jumpTo:V+"/address-details",state:{...f,reviewData:D,edits:h}})}),a.createElement(r.Row,{label:u("EKYC_FLAT_HOUSE_NO"),text:z(M.flatHouseNumber)}),a.createElement(r.Row,{label:u("EKYC_BUILDING_TOWER"),text:z(M.buildingTower)}),a.createElement(r.Row,{label:u("EKYC_LANDMARK"),text:z(M.landmark)}),a.createElement(r.Row,{label:u("EKYC_PINCODE"),text:z(M.pinCode)}),a.createElement(r.Row,{label:u("EKYC_LOCALITY"),text:z(M.ward)}),a.createElement(r.Row,{label:u("EKYC_ASSEMBLY"),text:z(M.assembly)}),a.createElement(r.Row,{label:u("EKYC_GPS_VALID"),text:U(M.gpsValid,u)}),a.createElement(r.Row,{label:u("EKYC_LATITUDE"),text:z(M.latitude)}),a.createElement(r.Row,{label:u("EKYC_LONGITUDE"),text:z(M.longitude)}),a.createElement(r.Row,{label:u("EKYC_MOBILE_NO"),text:z(M.mobileNo)}),a.createElement(r.Row,{label:u("EKYC_WHATSAPP_NO"),text:z(M.whatsappNo)}),a.createElement(r.Row,{label:u("EKYC_EMAIL"),text:z(M.email)}),a.createElement(r.Row,{label:u("EKYC_NO_OF_PERSONS"),text:z(M.noOfPerson)}),a.createElement(r.Row,{label:u("EKYC_K_NUMBER"),text:z(M.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:z(P.connectionCategory),actionButton:a.createElement(B,{jumpTo:V+"/property-info",state:{...f,reviewData:D,edits:h}})}),a.createElement(r.Row,{label:u("EKYC_PID_NUMBER"),text:z(P.pidNumber)}),a.createElement(r.Row,{label:u("EKYC_TYPE_OF_CONNECTION"),text:z(P.typeOfConnection)}),a.createElement(r.Row,{label:u("EKYC_USER_TYPE"),text:z(P.userType)}),a.createElement(r.Row,{label:u("EKYC_FLOOR_COUNT"),text:z(P.numberOfFloors)}),a.createElement(r.Row,{label:u("EKYC_TENANT_NAME"),text:z(P.tenantName)}),a.createElement(r.Row,{label:u("EKYC_TENANT_MOBILE"),text:z(P.tenantMobile)}),a.createElement(r.Row,{label:u("EKYC_STATUS"),text:z(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:U(H.metered,u),actionButton:a.createElement(B,{jumpTo:V+"/meter-details",state:{...f,reviewData:D,edits:h}})}),a.createElement(r.Row,{label:u("EKYC_METER_NO"),text:z(H.meterNumber)}),a.createElement(r.Row,{label:u("EKYC_METER_MAKE"),text:z(H.meterMake)}),a.createElement(r.Row,{label:u("EKYC_METER_LOCATION_ADDRESS"),text:z(H.meterLocationAddress)}),a.createElement(r.Row,{label:u("EKYC_METER_LATITUDE"),text:z(H.meterLatitude)}),a.createElement(r.Row,{label:u("EKYC_METER_LONGITUDE"),text:z(H.meterLongitude)}),a.createElement(r.Row,{label:u("EKYC_WORKING_STATUS"),text:U(H.workingStatus,u)}),a.createElement(r.Row,{label:u("EKYC_LAST_BILL_RAISED"),text:U(H.lastBillRaised,u)}),a.createElement(r.Row,{label:u("EKYC_SYSTEM_METER_ID"),text:z(H.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(M.doorPhotoFilestoreId?"EKYC_PHOTO_AVAILABLE":"CS_NA"),actionButton:M.doorPhotoFilestoreId&&a.createElement(r.GenericFileIcon,{style:{cursor:"pointer"}})}),a.createElement(r.Row,{label:u("EKYC_METER_PHOTO"),text:u(H.meterPhotoFileStoreId?"EKYC_PHOTO_AVAILABLE":"CS_NA"),actionButton:H.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=E(function(){return Promise.resolve(Digit.EkycService.application_update({kno:_,tenantId:k,newData:{connectionDetails:Y,addressDetails:M,propertyInfo:P,meterDetails:H}},k)).then(function(e){e&&p.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 V,W=(V=a.createContext(void 0),"undefined"!=typeof window&&(window.ReactQueryClientContext=V),V);const j=e=>{let{config:l,onSelect:n}=e;const[o,i]=t.useState(""),[s,c]=t.useState(null),[d,m]=t.useState(null),[u,p]=t.useState(null),[v,g]=t.useState(""),[C,b]=t.useState(""),[S,f]=t.useState(""),[N,y]=t.useState(""),[h,_]=t.useState(null),[x,T]=t.useState(""),[I,R]=t.useState(""),[k,D]=t.useState(""),[A,L]=t.useState(""),[w,O]=t.useState(""),[F,K]=t.useState(null),[Y,M]=t.useState(null),[P,B]=t.useState(""),[z,U]=t.useState(""),[H,V]=t.useState(""),[W,j]=t.useState(""),[G,$]=t.useState(""),[q,X]=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,de]=t.useState(!1),[me,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&&d&&u&&C&&I&&w&&!(Number(w)<=0)&&("Tenanted"!==(null==d?void 0:d.name)||Y||P)&&ce?n(l.key,{kno:o,consumerType:null==s?void 0:s.name,occupantType:null==d?void 0:d.name,categoryType:null==u?void 0:u.name,consumerName:v,firstName:C,middleName:S,lastName:N,gender:null==h?void 0:h.name,relation:x,mobile:I,whatsapp:k,email:A,residents:w,documentId:Y,ownerMobile:P,tenantVerification:z,designation:H,department:W,employeeId:G,landline:q,entityRelation:Z,contactPerson:J,entityName:te,idProof:null==le?void 0:le.name,idNumber:re,consent:ce,informantIsConsumer:me,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:d,select:m})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Category Type *"),a.createElement(r.Dropdown,{option:[],selected:u,select:p})),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=>f(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Last Name"),a.createElement(r.TextInput,{value:N,onChange:e=>y(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:h,select:_})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Mobile *"),a.createElement(r.TextInput,{value:I,onChange:e=>R(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"WhatsApp"),a.createElement(r.TextInput,{value:k,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:w,onChange:e=>O(e.target.value)})),"Tenanted"===(null==d?void 0:d.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=E(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,M)})),!Y&&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=>$(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)})))))},G=[{body:[{route:"consumer-details",component:j,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:W))throw new Error("No QueryClient set, use QueryClientProvider to set one")}();const i=n.useRouteMatch(),{t:s}=l.useTranslation(),c=n.useLocation(),{pathname:d}=c,m=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=d.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=m.push;e&&(p=m.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]),G.forEach(e=>{u=u.concat(e.body)}),u.indexRoute="consumer-details";const C=u.map(e=>e.route),b=C.some(e=>d.includes(e)),S=t.useRef({});return t.useEffect(()=>{if(b){const e=d.split("/").pop();S.current[e]&&S.current[e].scrollIntoView({behavior:"smooth",block:"start"})}},[d,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(_,{parentRoute:t,businessService:"EKYC",moduleCode:"EKYC",isInbox:!0})}),a.createElement(r.PrivateRoute,{path:t+"/create-kyc",component:()=>a.createElement(P,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(H,null)}))))))},X=e=>{var n,o,i,s,c;let{config:d,onSelect:m}=e;const{t:u}=l.useTranslation(),p=Digit.ULBService.getCurrentTenantId(),[v,g]=t.useState(""),[C,b]=t.useState(""),[S,f]=t.useState(""),[N,y]=t.useState(""),[h,_]=t.useState(null),[x,T]=t.useState(""),[I,R]=t.useState(null),[k,D]=t.useState(null),[A,L]=t.useState(null),[w,O]=t.useState(""),[F,K]=t.useState(""),[Y,M]=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(p,"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&&(O(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&&I&&k&&A&&w&&F&&z?m(d.key,{houseNo:v,street:C,locality:S,landmark:N,subLocality:h,pinCode:x,assembly:null==I?void 0:I.name,ward:null==k?void 0:k.name,zone:null==A?void 0:A.name,latitude:w,longitude:F,addressType:null==Y?void 0:Y.name,doorPhotoFilestoreId:z}):V({type:"error",message:"Please fill all mandatory fields"})},config:d,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=>f(e.target.value)}),a.createElement(r.CardLabel,null,"Landmark"),a.createElement(r.TextInput,{value:N,onChange:e=>y(e.target.value)}),a.createElement(r.CardLabel,null,"Sub Locality"),a.createElement(r.Dropdown,{option:[],selected:h,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)&&(T(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:I,select:R}),a.createElement(r.CardLabel,null,"Ward *"),a.createElement(r.Dropdown,{option:(null==I?void 0:I.children)||[],selected:k,select:D}),a.createElement(r.CardLabel,null,"Zone *"),a.createElement(r.Dropdown,{option:(null==k?void 0:k.children)||[],selected:A,select:L}),a.createElement(r.CardLabel,null,"Latitude"),a.createElement(r.TextInput,{value:w,disabled:!0}),a.createElement(r.CardLabel,null,"Longitude"),a.createElement(r.TextInput,{value:F,disabled:!0}),a.createElement(r.CardLabel,null,"Address Type"),a.createElement(r.Dropdown,{option:[{name:"Permanent"},{name:"Correspondence"},{name:"Other"}],selected:Y,select:M}),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=E(function(){return Promise.resolve(Digit.UploadServices.Filestorage("EKYC",n,p)).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)})))},Z=e=>{let{config:n,onSelect:o}=e;const{t:i}=l.useTranslation(),s=Digit.ULBService.getCurrentTenantId(),[c,d]=t.useState(""),[m,u]=t.useState(null),[p,v]=t.useState(null),[g,C]=t.useState(""),[b,S]=t.useState(""),[f,N]=t.useState(""),[y,h]=t.useState(""),[_,x]=t.useState(""),[T,I]=t.useState(null),[R,k]=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||!R||"Hotel"===(null==m?void 0:m.name)&&!f||!("Hospital"!==(null==m?void 0:m.name)&&"Nursing Home"!==(null==m?void 0:m.name)||y)?A({type:"error",message:"Fill all required fields"}):o(n.key,{pidNumber:c,propertyType:null==m?void 0:m.name,subPropertyCategory:null==p?void 0:p.name,noOfFloors:g,floorNo:b,noOfRooms:f,noOfBeds:y,dwellingUnits:_,buildingImageId:R})},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=>d(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:m,select:u})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Sub Property Category"),a.createElement(r.Dropdown,{option:[],selected:p,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:y,onChange:e=>h(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"No. of Rooms"),a.createElement(r.TextInput,{type:"number",value:f,onChange:e=>N(e.target.value)})),"Hotel"===(null==m?void 0:m.name)&&a.createElement("div",null,a.createElement(r.CardLabel,null,"No. of Rooms *"),a.createElement(r.TextInput,{type:"number",value:f,onChange:e=>N(e.target.value)})),("Hospital"===(null==m?void 0:m.name)||"Nursing Home"===(null==m?void 0:m.name))&&a.createElement("div",null,a.createElement(r.CardLabel,null,"No. of Beds *"),a.createElement(r.TextInput,{type:"number",value:y,onChange:e=>h(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=E(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){k(r);const e=new FileReader;e.onloadend=()=>I(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:()=>{I(null),k(null)},message:R?"Uploaded":"No file selected"})),T&&a.createElement("div",{style:{gridColumn:"span 2"}},a.createElement("img",{src:T,alt:"preview",style:{width:"100%",marginTop:"10px"}})),D&&a.createElement(r.Toast,{label:D.message,error:"error"===D.type,onClose:()=>A(null)})))},Q=e=>{let{config:l,onSelect:n}=e;const o=Digit.ULBService.getCurrentTenantId(),[i,s]=t.useState(""),[c,d]=t.useState(""),[m,u]=t.useState(""),[p,v]=t.useState(""),[g,C]=t.useState(""),[b,S]=t.useState(""),[f,N]=t.useState(""),[y,h]=t.useState(""),[_,x]=t.useState(null),[T,I]=t.useState(null),[R,k]=t.useState(null),[D,A]=t.useState(null),[L,w]=t.useState(null),[O,F]=t.useState(""),[K,Y]=t.useState(null),[M,P]=t.useState(null),[B,z]=t.useState(null),[U,H]=t.useState(null),[V,W]=t.useState(null),[j,G]=t.useState(null),$=[{name:"Yes"},{name:"No"}],q=[];for(let e=1998;e<=2026;e++)for(let t=1;t<=12;t++)q.push({name:`${t}/${e}`});const X="Can not be identified"===(null==_?void 0:_.name);return a.createElement(t.Fragment,null,a.createElement(r.FormStep,{onSelect:()=>{i&&_&&R&&D&&M&&("Metered"!==(null==_?void 0:_.name)||V)&&("No"!==(null==D?void 0:D.name)||O)&&("No"!==(null==M?void 0:M.name)||B)?n(l.key,{connectionCategory:i,saType:c,status:m,mrCode:p,areaCode:g,mrKey:b,meterNumber:f,meterMaker:y,meterStatus:null==_?void 0:_.name,meterCondition:null==T?void 0:T.name,meterLocation:null==R?void 0:R.name,lastBillReceived:null==D?void 0:D.name,billMonthYear:null==L?void 0:L.name,reason:O,accessToMeter:null==K?void 0:K.name,sewerConnection:null==M?void 0:M.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=>d(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Status"),a.createElement(r.TextInput,{value:m,onChange:e=>u(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"MR Code"),a.createElement(r.TextInput,{value:p,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)})),!X&&a.createElement(t.Fragment,null,a.createElement("div",null,a.createElement(r.CardLabel,null,"Meter Number"),a.createElement(r.TextInput,{value:f,onChange:e=>N(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Meter Maker"),a.createElement(r.TextInput,{value:y,onChange:e=>h(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:T,select:I})),"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=E(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:R,select:k})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Last Bill Received *"),a.createElement(r.Dropdown,{option:$,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:q,selected:L,select:w})),"No"===(null==D?void 0:D.name)&&a.createElement("div",null,a.createElement(r.CardLabel,null,"Reason *"),a.createElement(r.TextInput,{value:O,onChange:e=>F(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Access to Meter"),a.createElement(r.Dropdown,{option:$,selected:K,select:Y})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Sewer Connection *"),a.createElement(r.Dropdown,{option:$,selected:M,select:P})),"No"===(null==M?void 0:M.name)&&a.createElement("div",null,a.createElement(r.CardLabel,null,"Septic Tank *"),a.createElement(r.Dropdown,{option:$,selected:B,select:z})),j&&a.createElement(r.Toast,{label:j.message,error:"error"===j.type,onClose:()=>G(null)})))},J=()=>{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,{path:o+"/create-kyc",component:()=>a.createElement(P,null)}),a.createElement(r.PrivateRoute,{path:o+"/aadhaar-verification",component:()=>a.createElement(j,null)}),a.createElement(r.PrivateRoute,{path:o+"/address-details",component:()=>a.createElement(X,null)}),a.createElement(r.PrivateRoute,{path:o+"/property-info",component:()=>a.createElement(Z,null)}),a.createElement(r.PrivateRoute,{path:o+"/meter-details",component:()=>a.createElement(Q,null)}),a.createElement(r.PrivateRoute,{path:o+"/review",component:()=>a.createElement(H,null)}),a.createElement(r.PrivateRoute,{path:o+"/",component:()=>a.createElement(P,null)}))))},ee=e=>{let{stateCode:t,userType:l,tenants:r}=e;const{path:o,url:i}=n.useRouteMatch(),s=Digit.StoreData.getCurrentLanguage(),{isLoading:c}=Digit.Services.useStore({stateCode:t,moduleCode:"EKYC",language:s});return Digit.SessionStorage.set("EKYC_TENANTS",r),c?null:"employee"===l?a.createElement(q,{path:o,url:i,userType:l,tenants:r}):a.createElement(J,null)},te=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"})})},ae={EKYCModule:ee,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:d,isLoading:m,onSort:u,onNextPage:E,onPrevPage:p,currentPage:v,pageSizeLimit:g,onPageSizeChange:C,parentRoute:b,searchParams:S,sortParams:f,totalRecords:N,countData:y}=c,{t:h}=l.useTranslation(),_=n.useHistory(),x=Digit.ULBService.getCurrentTenantId(),T=null===(o=Digit.ComponentRegistryService)||void 0===o?void 0:o.getComponent(i),[I,R]=t.useState(""),{data:k,getReview:D}=Digit.Hooks.ekyc.useEkycAPI("review",x),A=e=>{R(e),D({kno:e})};a.useEffect(()=>{k&&_.push("/digit-ui/employee/ekyc/review",{kNumber:I,aadhaarData:null==k?void 0:k.aadhaarData,reviewData:k})},[k]);const L=t.useMemo(()=>[{Header:h("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:h("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:h("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},h(""+n))}},{Header:h("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)},h("EKYC_REVIEW"))}}],[h,b]),w=t.useMemo(()=>(null==d?void 0:d.items)||[],[d]);return a.createElement("div",{className:"app-container"},a.createElement("div",{className:"inbox-container"},m&&a.createElement(r.Loader,null),a.createElement("div",{className:"side-panel-item"},a.createElement(r.InboxLinks,{headerText:c.moduleCode}),T&&a.createElement(T,{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:y})),a.createElement("div",{className:"result",style:{flex:1}},a.createElement(r.Card,{className:"ekyc-table-card",style:{padding:0}},a.createElement(r.Table,{t:h,data:w,columns:L,isLoading:m,onSort:u,sortParams:f,totalRecords:N,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:m,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(d,{onSearch:c,searchParams:m}),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(m,e),EkycLinks:te,AadhaarVerification:j,AddressDetails:X,PropertyInfo:Z,MeterDetails:Q};exports.EkycLinks=te,exports.EkycModule=ee,exports.default=ee,exports.initEkycComponents=()=>{Object.entries(ae).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"),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.Tooltip,{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)})};
|