@djb25/digit-ui-module-ws 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/index.modern.js +43413 -0
- package/dist/index.modern.js.map +1 -0
- package/package.json +33 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var e,t=require("react"),l=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,o=require("react-i18next"),i=require("react-router-dom"),a=require("@upyog/digit-ui-react-components"),r=require("react-hook-form"),u=require("xlsx"),d=require("react-query"),s=require("@nudmcdgnpm/digit-ui-react-components");const c=()=>{const{t:e}=o.useTranslation();return l.createElement("div",null,"Test Acknowlwdgment",l.createElement("br",null),l.createElement("button",{onClick:()=>{const n=((e,n)=>{var t;const l={i18nKey:"TENANT_TENANTS_PB_AMRITSAR",code:"pb.amritsar",name:"Amritsar",description:"Amritsar",pincode:[143001,143002,143003,143004,143005],logoId:"https://s3.ap-south-1.amazonaws.com/pb-egov-assets/pb.amritsar/logo.png",imageId:"/pb-egov-assets/pb.amritsar/logo.png",domainUrl:"www.amritsarcorp.com",type:"CITY",twitterUrl:null,facebookUrl:null,emailId:"support.amritsar@gmail.com",OfficeTimings:{"Mon - Fri":"9.00 AM - 6.00 PM"},city:{name:"Amritsar",localName:"Amritsar",districtCode:"1",districtName:"Amritsar",districtTenantCode:"pb.amritsar",regionName:"Amritsar Region",ulbGrade:"MC 1",longitude:74.8723,latitude:31.634,shapeFileLocation:null,captcha:null,code:"107",regionCode:"1",municipalityName:"Amritsar",ddrName:"Amritsar District"},address:"Municipal Corporation Amritsar, C Block, Ranjit Avenue, Amritsar, Punjab",contactNumber:"0181-2227014"};return{name:n(null==l?void 0:l.i18nKey)+" "+n("ULBGRADE_"+(null==l||null===(t=l.city)||void 0===t?void 0:t.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),email:null==l?void 0:l.emailId,phoneNumber:null==l?void 0:l.contactNumber,heading:n("WS_NEW_WATER_CONNECTION"),breakPageLimit:4,details:[{title:n("CS_TITLE_APPLICATION_DETAILS"),values:[{title:n("WS_COMMON_APPLICATION_NO_LABEL"),value:"WS_AP/107/2021-22/250238"}]},{title:n("WS_COMMON_PROPERTY_DETAILS"),values:[{title:n("WS_PROPERTY_ID_LABEL"),value:"PB-PT-2022-02-24-026486"},{title:n("WS_PROPERTY_TYPE_LABEL"),value:"Flat/Part of the building"},{title:n("WS_PROPERTY_USAGE_TYPE_LABEL"),value:"Residential"},{title:n("WS_PROPERTY_SUB_USAGE_TYPE_LABEL"),value:"N/A"},{title:n("WS_PROP_DETAIL_PLOT_SIZE_LABEL"),value:"2112"},{title:n("WS_PROPERTY_NO_OF_FLOOR_LABEL"),value:"1"},{title:n("WS_SERV_DETAIL_CONN_RAIN_WATER_HARVESTING_FAC"),value:"N/A"}]},{title:n("WS_COMMON_PROP_LOC_DETAIL_HEADER"),values:[{title:n("WS_PROP_DETAIL_CITY"),value:"Amritsar"},{title:n("WS_PROP_DETAIL_DHNO"),value:"N/A"},{title:n("WS_PROP_DETAIL_BUILD_NAME_LABEL"),value:"N/A"},{title:n("WS_PROP_DETAIL_STREET_NAME"),value:"N/A"},{title:n("WS_PROP_DETAIL_LOCALITY_MOHALLA_LABEL"),value:"Ajit Nagar - Area1"},{title:n("WS_PROP_DETAIL_DHNO"),value:"143001"}]},{title:n("WS_TASK_PROP_OWN_HEADER"),values:[{title:n("Owner - 1"),value:""},{title:n("WS_CONN_HOLDER_OWN_DETAIL_MOBILE_NO_LABEL"),value:"7878787878"},{title:n("WS_MYCONNECTIONS_OWNER_NAME"),value:"OWNER NAME"},{title:n("WS_OWNER_DETAILS_EMAIL_LABEL"),value:"N/A"},{title:n("WS_OWN_DETAIL_GENDER_LABEL"),value:"Male"},{title:n("WS_OWN_DETAIL_DOB_LABEL"),value:"N/A"},{title:n("WS_OWN_DETAIL_FATHER_OR_HUSBAND_NAME"),value:"N/A"},{title:n("WS_OWN_DETAIL_RELATION_LABEL"),value:"Husband"},{title:n("WS_CONN_HOLDER_OWN_DETAIL_CROSADD"),value:"Ajit Nagar - Area1, Amritsar, 143001"},{title:n("WS_CONN_HOLDER_OWN_DETAIL_SPECIAL_APPLICANT_LABEL"),value:"None"}]},{title:n("WS_COMMON_CONNECTION_DETAILS"),values:[{title:n("WS_APPLY_FOR"),value:"Water"},{title:n("WS_CONN_DETAIL_NO_OF_TAPS"),value:"12"},{title:n("WS_CONN_DETAIL_PIPE_SIZE"),value:"0.25"}]},{title:n("WS_COMMON_CONNECTION_HOLDER_DETAILS_HEADER"),values:[{title:n("WS_CONN_HOLDER_SAME_AS_OWNER_DETAILS"),value:"Yes"}]},{title:n("WS_COMMON_DOCS"),values:[{title:n("WS_OWNER.IDENTITYPROOF"),value:"ANXgJeMOAJ.pdf"},{title:n("WS_OWNER.ADDRESSPROOF"),value:"ANXgJeMOAJ.pdf"},{title:n("OWNER.ADDRESSPROOF.ELECTRICITYBILL"),value:"ANXgJeMOAJ.pdf"},{title:n("PLUMBER_REPORT_DRAWING"),value:"ANXgJeMOAJ.pdf"}]},{title:n("WS_COMMON_ADDN_DETAILS"),values:[{title:n("WS_COMMON_TABLE_COL_CONNECTIONTYPE_LABEL"),value:"NA"},{title:n("WS_SERV_DETAIL_NO_OF_TAPS"),value:"NA"},{title:n("WS_SERV_DETAIL_WATER_SOURCE"),value:"NA"},{title:n("WS_SERV_DETAIL_WATER_SUB_SOURCE"),value:"NA"},{title:n("WS_SERV_DETAIL_PIPE_SIZE"),value:"NA"}]},{title:n("WS_COMMON_PLUMBER_DETAILS"),values:[{title:n("WS_ADDN_DETAILS_PLUMBER_PROVIDED_BY"),value:"NA"},{title:n("WS_ADDN_DETAILS_PLUMBER_LICENCE_NO_LABEL"),value:"NA"},{title:n("WS_ADDN_DETAILS_PLUMBER_NAME_LABEL"),value:"NA"},{title:n("WS_ADDN_DETAILS_PLUMBER_MOB_NO_LABEL"),value:"NA"}]},{title:n("WS_ROAD_CUTTING_CHARGE"),values:[{title:n("WS_ADDN_DETAIL_ROAD_TYPE"),value:"NA"},{title:n("WS_ADDN_DETAILS_AREA_LABEL"),value:"NA"}]},{title:n("WS_ACTIVATION_DETAILS"),values:[{title:n("WS_SERV_DETAIL_CONN_EXECUTION_DATE"),value:"NA"},{title:n("WS_SERV_DETAIL_METER_ID"),value:"NA"},{title:n("WS_ADDN_DETAIL_METER_INSTALL_DATE"),value:"NA"},{title:n("WS_ADDN_DETAILS_INITIAL_METER_READING"),value:"NA"}]}]}})(0,e);Digit.Utils.pdf.generate(n)}},"Print"))};function v(){return(v=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var l in t)({}).hasOwnProperty.call(t,l)&&(e[l]=t[l])}return e}).apply(null,arguments)}function p(e,n){if(null==e)return{};var t={};for(var l in e)if({}.hasOwnProperty.call(e,l)){if(-1!==n.indexOf(l))continue;t[l]=e[l]}return t}const m=function(e,n,t){if(void 0===e&&(e=""),void 0===n&&(n=""),void 0===t&&(t=""),""==n)return e;for(;e&&e.includes(n);)e=e.replace(n,t);return e},E=function(e,n){try{return Promise.resolve(Digit.MDMSService.getMultipleTypes(e,"tenant",["tenants","citymodule"])).then(function(t){var l,o,i,a,r;const u=t&&t.tenant.tenants.filter(n=>n.code===e),d=Digit.Utils.locale.getTransformedLocale(e),s=null==u||null===(l=u[0])||void 0===l||null===(o=l.city)||void 0===o?void 0:o.ulbGrade.replaceAll(" ","_");return{header:n("TENANT_TENANTS_"+d)+" "+n("ULBGRADE_"+s),subHeader:null==u?void 0:u[0].address,description:(null==u||null===(i=u[0])||void 0===i?void 0:i.contactNumber)+" | "+(null==u||null===(a=u[0])||void 0===a?void 0:a.domainUrl)+" | "+(null==u||null===(r=u[0])||void 0===r?void 0:r.emailId)}})}catch(e){return Promise.reject(e)}},S=function(e,n){if(void 0===n&&(n=!1),null==e||null==e||""==e)return"NA";const t=new Date(e);let l=t.getMonth()+1,o=t.getDate(),i=t.getFullYear();return l=(l>9?"":"0")+l,o=(o>9?"":"0")+o,n?i+"-"+l+"-"+o:o+"-"+l+"-"+i},f=e=>{if(null==e||null==e||""==e)return"NA";const n=new Date(e);let t=n.getMonth()+1,l=n.getDate();return t=(t>9?"":"0")+t,l=(l>9?"":"0")+l,l+"/"+t+"/"+n.getFullYear()},g=e=>e?(/^[?#]/.test(e)?e.slice(1):e).split("&").reduce((e,n)=>{let[t,l]=n.split("=");return e[t]=l?decodeURIComponent(l.replace(/\+/g," ")):"",e},{}):{},C=(e,n)=>{var t,l,o;return(null!=e&&e.doorNo?(null==e?void 0:e.doorNo)+", ":"")+(null!=e&&e.street?(null==e?void 0:e.street)+", ":"")+(null!=e&&e.landmark?(null==e?void 0:e.landmark)+", ":"")+(null!=e&&null!==(t=e.locality)&&void 0!==t&&t.code?n("TENANTS_MOHALLA_"+(null==e||null===(l=e.locality)||void 0===l?void 0:l.code)):"")+(null!=e&&null!==(o=e.city)&&void 0!==o&&o.code||null!=e&&e.city?", "+n((null==e?void 0:e.city.code)||(null==e?void 0:e.city)):"")+(null!=e&&e.pincode?", "+e.pincode:" ")},N=function(e,n){void 0===n&&(n="dayend");try{const t=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),l=new Date(Date.UTC(t[1],t[2]-1,t[3]));return l.setMinutes(l.getMinutes()+l.getTimezoneOffset()),"dayend"===n&&(l.setHours(l.getHours()+24),l.setSeconds(l.getSeconds()-1)),l.getTime()}catch(n){return e}},y=e=>{if(e){const n=new Date(e);let t=n.getMonth()+1,l=n.getDate(),o=n.getFullYear();return t=(t>9?"":"0")+t,l=(l>9?"":"0")+l,t+"/"+l+"/"+o}return null},D=e=>{switch(e){case"WSOnlyNumbers":return/^[0-9]*$/i;case"Name":return/^[^{0-9}^\$\"<>?\\\\~!@#$%^()+={}\[\]*,/_:;“”‘’]{1,50}$/i;case"MobileNo":return/^[6789][0-9]{9}$/i;case"MobileNoWithPrivacy":return/^[6789][*]{7}[0-9]{2}|[6789][0-9]{9}$/i;case"Amount":return/^[0-9]{0,8}$/i;case"NonZeroAmount":return/^[1-9][0-9]{0,7}$/i;case"DecimalNumber":return/^\d{0,8}(\.\d{1,2})?$/i;case"Email":return/[A-Za-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$/i;case"Address":return/^[^\$\"<>?\\\\~`!@$%^()+={}\[\]*:;“”‘’]{1,500}$/i;case"PAN":return/^[A-Za-z]{5}\d{4}[A-Za-z]{1}$/i;case"TradeName":return/^[-@.\/#&+\w\s]*$/;case"Date":return/^[12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/i;case"UOMValue":return/^(0)*[1-9][0-9]{0,5}$/i;case"OperationalArea":case"NoOfEmp":return/^(0)*[1-9][0-9]{0,6}$/i;case"GSTNo":return/^\d{2}[A-Z]{5}\d{4}[A-Z]{1}\d[Z]{1}[A-Z\d]{1}$/i;case"DoorHouseNo":return/^[^\$\"'<>?\\\\~`!@$%^()+={}\[\]*:;“”‘’]{1,50}$/i;case"BuildingStreet":return/^[^\$\"'<>?\\\\~`!@$%^()+={}\[\]*.:;“”‘’]{1,64}$/i;case"Pincode":return/^[1-9][0-9]{5}$/i;case"Landline":return/^[0-9]{11}$/i;case"PropertyID":return/^[a-zA-z0-9\s\\/\-]$/i;case"ElectricityConnNo":return/^.{1,15}$/i;case"DocumentNo":return/^[0-9]{1,15}$/i;case"eventName":return/^[^\$\"<>?\\\\~`!@#$%^()+={}\[\]*,.:;“”]{1,65}$/i;case"eventDescription":return/^[^\$\"'<>?\\\\~`!@$%^()+={}\[\]*.:;“”‘’]{1,500}$/i;case"cancelChallan":return/^[^\$\"'<>?\\\\~`!@$%^()+={}\[\]*.:;“”‘’]{1,100}$/i;case"FireNOCNo":return/^[a-zA-Z0-9-]*$/i;case"consumerNo":return/^[a-zA-Z0-9/-]*$/i;case"AadharNo":return/^([0-9]){12}$/;case"ChequeNo":return/^(?!0{6})[0-9]{6}$/;case"Comments":return/^[^\$\"'<>?\\\\~`!@$%^()+={}\[\]*.:;“”‘’]{1,50}$/i;case"OldLicenceNo":return/^[a-zA-Z0-9-/]{0,64}$/}},T=function(e,n){try{return Promise.resolve(Digit.UploadServices.Filefetch(e,n)).then(function(e){var n,t,l,o,i,a;null!=e&&null!==(n=e.data)&&void 0!==n&&null!==(t=n.fileStoreIds)&&void 0!==t&&null!==(l=t[0])&&void 0!==l&&l.url&&window.open(null==e||null===(o=e.data)||void 0===o||null===(i=o.fileStoreIds)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.url)})}catch(e){return Promise.reject(e)}},h=function(e,n){try{var t,l,o,i,a,r;let u=v({},e,{processInstance:v({},null==e?void 0:e.processInstance,{action:"SUBMIT_APPLICATION"}),documents:JSON.parse(sessionStorage.getItem("WS_DOCUMENTS_INOF")),property:JSON.parse(sessionStorage.getItem("WS_PROPERTY_INOF")),connectionType:"WATER"===n?null==e?void 0:e.connectionType:"Non Metered"});return u=null!==(t=Digit)&&void 0!==t&&null!==(l=t.Customizations)&&void 0!==l&&null!==(o=l.WS)&&void 0!==o&&o.customiseUpdatePayloadOfWS?null===(i=Digit)||void 0===i||null===(a=i.Customizations)||void 0===a||null===(r=a.WS)||void 0===r?void 0:r.customiseUpdatePayloadOfWS(e,u,n):u,Promise.resolve(u)}catch(e){return Promise.reject(e)}},A=function(e,n,t){try{var l,o,i,a,r,u,d,s,c,p,m,E,S,_,f,g,C,y,D,T,h,A,I,O,b,L,R,w,W,P,M,x,B,F,U,k,H,j,V,z,Y,G,q,K,X,Z,$,J,Q,ee,ne,te,le,oe,ie,ae,re;const we=Digit.UserService.getType();let We=[];if((null==n||null===(l=n.applicationData)||void 0===l||null===(o=l.plumberInfo)||void 0===o?void 0:o.length)>0){var ue,de,se,ce,ve,pe,me,Ee,Se,_e,fe,ge,Ce,Ne,ye,De,Te,he,Ae,Ie,Oe,be,Le,Re;let e={};null!=n&&null!==(ue=n.applicationData)&&void 0!==ue&&null!==(de=ue.plumberInfo)&&void 0!==de&&null!==(se=de[0])&&void 0!==se&&se.licenseNo&&(e.licenseNo=null==n||null===(ce=n.applicationData)||void 0===ce||null===(ve=ce.plumberInfo)||void 0===ve||null===(pe=ve[0])||void 0===pe?void 0:pe.licenseNo),null!=n&&null!==(me=n.applicationData)&&void 0!==me&&null!==(Ee=me.plumberInfo)&&void 0!==Ee&&null!==(Se=Ee[0])&&void 0!==Se&&Se.mobileNumber&&(e.mobileNumber=null==n||null===(_e=n.applicationData)||void 0===_e||null===(fe=_e.plumberInfo)||void 0===fe||null===(ge=fe[0])||void 0===ge?void 0:ge.mobileNumber),null!=n&&null!==(Ce=n.applicationData)&&void 0!==Ce&&null!==(Ne=Ce.plumberInfo)&&void 0!==Ne&&null!==(ye=Ne[0])&&void 0!==ye&&ye.id&&(e.id=null==n||null===(De=n.applicationData)||void 0===De||null===(Te=De.plumberInfo)||void 0===Te||null===(he=Te[0])||void 0===he?void 0:he.id),null!=n&&null!==(Ae=n.applicationData)&&void 0!==Ae&&null!==(Ie=Ae.plumberInfo)&&void 0!==Ie&&null!==(Oe=Ie[0])&&void 0!==Oe&&Oe.name&&(e.name=null==n||null===(be=n.applicationData)||void 0===be||null===(Le=be.plumberInfo)||void 0===Le||null===(Re=Le[0])||void 0===Re?void 0:Re.name),We=[e]}let Pe={WaterConnection:{id:null==n||null===(i=n.applicationData)||void 0===i?void 0:i.id,applicationNo:null==n||null===(a=n.applicationData)||void 0===a?void 0:a.applicationNo,applicationStatus:null==n||null===(r=n.applicationData)||void 0===r?void 0:r.applicationStatus,status:null==n||null===(u=n.applicationData)||void 0===u?void 0:u.status,connectionNo:null==n||null===(d=n.applicationData)||void 0===d?void 0:d.connectionNo,connectionHolders:null==n||null===(s=n.applicationData)||void 0===s?void 0:s.connectionHolders,applicationType:"NEW_WATER_CONNECTION",dateEffectiveFrom:N(null==e?void 0:e.date),isdisconnection:!0,isDisconnectionTemporary:"Temporary"===(null==e||null===(c=e.type)||void 0===c||null===(p=c.value)||void 0===p?void 0:p.code)||"TEMPORARY"===(null==e||null===(m=e.type)||void 0===m||null===(E=m.value)||void 0===E?void 0:E.code),disconnectionReason:null==e||null===(S=e.reason.value)||void 0===S?void 0:S.code,documents:null==e?void 0:e.documents,water:!0,sewerage:!1,proposedTaps:(null==n||null===(_=n.applicationData)||void 0===_?void 0:_.proposedTaps)&&Number(null==n||null===(f=n.applicationData)||void 0===f?void 0:f.proposedTaps),proposedPipeSize:(null==n||null===(g=n.applicationData)||void 0===g||null===(C=g.proposedPipeSize)||void 0===C?void 0:C.size)&&Number(null==n||null===(y=n.applicationData)||void 0===y||null===(D=y.proposedPipeSize)||void 0===D?void 0:D.size),service:"Water",property:null==n||null===(T=n.applicationData)||void 0===T?void 0:T.property,propertyId:null==n||null===(h=n.applicationData)||void 0===h?void 0:h.propertyId,oldConnectionNo:null,plumberInfo:(null===(A=We)||void 0===A?void 0:A.length)>0?We:null,roadCuttingInfo:null==n||null===(I=n.applicationData)||void 0===I?void 0:I.roadCuttingInfo,roadCuttingArea:null,roadType:null,connectionExecutionDate:null==n||null===(O=n.applicationData)||void 0===O?void 0:O.connectionExecutionDate,noOfTaps:null==n||null===(b=n.applicationData)||void 0===b?void 0:b.noOfTaps,additionalDetails:null==n||null===(L=n.applicationData)||void 0===L?void 0:L.additionalDetails,tenantId:null==n||null===(R=n.applicationData)||void 0===R?void 0:R.tenantId,connectionType:n.applicationData.connectionType||null,waterSource:n.applicationData.waterSource||null,processInstance:v({},null==n||null===(w=n.applicationData)||void 0===w?void 0:w.processInstance,{action:"INITIATE"}),channel:"citizen"===we?"CITIZEN":"CFC_COUNTER"},disconnectRequest:!0};n.applicationData.connectionType&&(n.applicationData.meterInstallationDate&&(Pe.WaterConnection.meterInstallationDate=n.applicationData.meterInstallationDate),n.applicationData.meterId&&(Pe.WaterConnection.meterId=n.applicationData.meterId));let Me={SewerageConnection:{id:null==n||null===(W=n.applicationData)||void 0===W?void 0:W.id,applicationNo:null==n||null===(P=n.applicationData)||void 0===P?void 0:P.applicationNo,applicationStatus:null==n||null===(M=n.applicationData)||void 0===M?void 0:M.applicationStatus,status:null==n||null===(x=n.applicationData)||void 0===x?void 0:x.status,connectionNo:null==n||null===(B=n.applicationData)||void 0===B?void 0:B.connectionNo,connectionHolders:null==n||null===(F=n.applicationData)||void 0===F?void 0:F.connectionHolders,applicationType:"NEW_WATER_CONNECTION",dateEffectiveFrom:N(null==e?void 0:e.date),isdisconnection:!0,isDisconnectionTemporary:"Temporary"===(null==e||null===(U=e.type)||void 0===U||null===(k=U.value)||void 0===k?void 0:k.code),disconnectionReason:null==e||null===(H=e.reason.value)||void 0===H?void 0:H.code,documents:null==e?void 0:e.documents,water:!1,sewerage:!0,proposedWaterClosets:(null==n||null===(j=n.applicationData)||void 0===j?void 0:j.proposedWaterClosets)&&Number(null==n||null===(V=n.applicationData)||void 0===V?void 0:V.proposedWaterClosets),proposedToilets:(null==n||null===(z=n.applicationData)||void 0===z?void 0:z.proposedToilets)&&Number(null==n||null===(Y=n.applicationData)||void 0===Y?void 0:Y.proposedToilets),service:"Sewerage",property:null==n||null===(G=n.applicationData)||void 0===G?void 0:G.property,propertyId:null==n||null===(q=n.applicationData)||void 0===q?void 0:q.propertyId,oldConnectionNo:null,plumberInfo:(null===(K=We)||void 0===K?void 0:K.length)>0?We:null,roadCuttingInfo:null==n||null===(X=n.applicationData)||void 0===X?void 0:X.roadCuttingInfo,roadCuttingArea:null,roadType:null,connectionExecutionDate:null==n||null===(Z=n.applicationData)||void 0===Z?void 0:Z.connectionExecutionDate,noOfWaterClosets:null==n||null===($=n.applicationData)||void 0===$?void 0:$.noOfWaterClosets,noOfToilets:null==n||null===(J=n.applicationData)||void 0===J?void 0:J.noOfToilets,additionalDetails:null==n||null===(Q=n.applicationData)||void 0===Q?void 0:Q.additionalDetails,tenantId:null==n||null===(ee=n.applicationData)||void 0===ee?void 0:ee.tenantId,connectionType:"Non Metered",waterSource:n.applicationData.waterSource||null,processInstance:v({},null==n||null===(ne=n.applicationData)||void 0===ne?void 0:ne.processInstance,{action:"INITIATE"}),channel:"citizen"===we?"CITIZEN":"CFC_COUNTER"},disconnectRequest:!0},xe="WATER"===t?Pe:Me;return xe=null!==(te=Digit)&&void 0!==te&&null!==(le=te.Customizations)&&void 0!==le&&null!==(oe=le.WS)&&void 0!==oe&&oe.customiseCreatePayloadOfWSDisconnection?null===(ie=Digit)||void 0===ie||null===(ae=ie.Customizations)||void 0===ae||null===(re=ae.WS)||void 0===re?void 0:re.customiseCreatePayloadOfWSDisconnection(e,xe,t):xe,Promise.resolve(xe)}catch(e){return Promise.reject(e)}},I=function(e,n){try{var t,l,o,i,a,r,u,d;let s=v({},e,{plumberInfo:null!=e&&null!==(t=e.plumberInfo)&&void 0!==t&&t[0]?[v({},null==e||null===(l=e.plumberInfo)||void 0===l?void 0:l[0],{id:null})]:null==e?void 0:e.plumberInfo,applicationType:"WATER"===n?"DISCONNECT_WATER_CONNECTION":"DISCONNECT_SEWERAGE_CONNECTION",processInstance:v({},null==e?void 0:e.processInstance,{businessService:"WATER"===n?"DisconnectWSConnection":"DisconnectSWConnection",action:"SUBMIT_APPLICATION"})});return s=null!==(o=Digit)&&void 0!==o&&null!==(i=o.Customizations)&&void 0!==i&&null!==(a=i.WS)&&void 0!==a&&a.customiseUpdatePayloadOfWSDisconnection?null===(r=Digit)||void 0===r||null===(u=r.Customizations)||void 0===u||null===(d=u.WS)||void 0===d?void 0:d.customiseUpdatePayloadOfWSDisconnection(e,s,n):s,Promise.resolve(s)}catch(e){return Promise.reject(e)}},O=function(e,n){try{var t,l;let o=v({},e,{plumberInfo:null!=e&&null!==(t=e.plumberInfo)&&void 0!==t&&t[0]?[v({},null==e||null===(l=e.plumberInfo)||void 0===l?void 0:l[0],{id:null})]:null==e?void 0:e.plumberInfo,applicationType:"WATER"===n?"WATER_RECONNECTION":"SEWERAGE_RECONNECTION",processInstance:v({},null==e?void 0:e.processInstance,{businessService:"WATER"===n?"WSReconnection":"SWReconnection",action:"SUBMIT_APPLICATION"})});return Promise.resolve(o)}catch(e){return Promise.reject(e)}},b=e=>{var n;const t=Digit.ULBService.getCurrentTenantId(),l=Digit.UserService.getUser();let o=[];return null==l||null===(n=l.info)||void 0===n||n.roles.filter(n=>{for(let l=0;l<e.length;l++)n.code==e[l]&&n.tenantId===t&&o.push(!0)}),null==o?void 0:o.length},L=e=>"WATER"==(null==e?void 0:e.service)?"WS.ONE_TIME_FEE":"SW.ONE_TIME_FEE",R=function(e,n,t,l,o){var i,a,r,u,d,s,c,v,p,E,_,f,g,C,N,y,D,T,h,A,I,O,b,L,R,w,W,P,M,x,B,F,U,k,H,j,V,z,Y,G,q,K,X,Z,$,J,Q,ee,ne,te,le,oe,ie,ae,re,ue,de,se,ce,ve,pe,me,Ee,Se,_e,fe,ge,Ce,Ne,ye,De,Te,he,Ae,Ie,Oe,be,Le,Re;void 0===t&&(t=!1),void 0===l&&(l=!1),null==e||null===(i=e.propertyDetails)||void 0===i||null===(a=i.owners)||void 0===a||a.forEach(e=>{null!=e&&e.permanentAddress&&(e.correspondenceAddress=null==e?void 0:e.permanentAddress)});let we=[{water:"WATER"===n,sewerage:"WATER"!==n,applicationNo:null==e||null===(r=e.applicationData)||void 0===r?void 0:r.applicationNo,serviceName:n,proposedTaps:Number(null==e||null===(u=e.applicationData)||void 0===u?void 0:u.proposedTaps)||"",proposedPipeSize:null!=e&&null!==(d=e.applicationData)&&void 0!==d&&d.proposedPipeSize?{i18nKey:null==e||null===(s=e.applicationData)||void 0===s?void 0:s.proposedPipeSize,code:null==e||null===(c=e.applicationData)||void 0===c?void 0:c.proposedPipeSize,size:null==e||null===(v=e.applicationData)||void 0===v?void 0:v.proposedPipeSize}:"",proposedToilets:(null==e||null===(p=e.applicationData)||void 0===p?void 0:p.proposedToilets)||"",proposedWaterClosets:(null==e||null===(E=e.applicationData)||void 0===E?void 0:E.proposedWaterClosets)||""}];const We=(null==e||null===(_=e.applicationData)||void 0===_||null===(f=_.connectionHolders)||void 0===f?void 0:f.length)>0?[{sameAsOwnerDetails:!1,uuid:null==e||null===(g=e.applicationData)||void 0===g||null===(C=g.connectionHolders)||void 0===C||null===(N=C[0])||void 0===N?void 0:N.uuid,name:(null==e||null===(y=e.applicationData)||void 0===y||null===(D=y.connectionHolders)||void 0===D||null===(T=D[0])||void 0===T?void 0:T.name)||"",mobileNumber:(null==e||null===(h=e.applicationData)||void 0===h||null===(A=h.connectionHolders)||void 0===A||null===(I=A[0])||void 0===I?void 0:I.mobileNumber)||"",emailId:(null==e||null===(O=e.applicationData)||void 0===O||null===(b=O.connectionHolders)||void 0===b||null===(L=b[0])||void 0===L?void 0:L.emailId)||"",guardian:(null==e||null===(R=e.applicationData)||void 0===R||null===(w=R.connectionHolders)||void 0===w||null===(W=w[0])||void 0===W?void 0:W.fatherOrHusbandName)||"",address:(null==e||null===(P=e.applicationData)||void 0===P||null===(M=P.connectionHolders)||void 0===M||null===(x=M[0])||void 0===x?void 0:x.correspondenceAddress)||"",gender:null!=e&&null!==(B=e.applicationData)&&void 0!==B&&null!==(F=B.connectionHolders)&&void 0!==F&&null!==(U=F[0])&&void 0!==U&&U.gender?{code:null==e||null===(k=e.applicationData)||void 0===k||null===(H=k.connectionHolders)||void 0===H||null===(j=H[0])||void 0===j?void 0:j.gender,i18nKey:null==e||null===(V=e.applicationData)||void 0===V||null===(z=V.connectionHolders)||void 0===z||null===(Y=z[0])||void 0===Y?void 0:Y.gender}:"",relationship:null!=e&&null!==(G=e.applicationData)&&void 0!==G&&null!==(q=G.connectionHolders)&&void 0!==q&&null!==(K=q[0])&&void 0!==K&&K.relationship?{code:null==e||null===(X=e.applicationData)||void 0===X||null===(Z=X.connectionHolders)||void 0===Z||null===($=Z[0])||void 0===$?void 0:$.relationship,i18nKey:null==e||null===(J=e.applicationData)||void 0===J||null===(Q=J.connectionHolders)||void 0===Q||null===(ee=Q[0])||void 0===ee?void 0:ee.relationship}:"",ownerType:null!=e&&null!==(ne=e.applicationData)&&void 0!==ne&&null!==(te=ne.connectionHolders)&&void 0!==te&&null!==(le=te[0])&&void 0!==le&&le.ownerType?{code:null==e||null===(oe=e.applicationData)||void 0===oe||null===(ie=oe.connectionHolders)||void 0===ie||null===(ae=ie[0])||void 0===ae?void 0:ae.ownerType,i18nKey:null==e||null===(re=e.applicationData)||void 0===re||null===(ue=re.connectionHolders)||void 0===ue||null===(de=ue[0])||void 0===de?void 0:de.ownerType}:"",documentId:"",documentType:"",file:""}]:[{sameAsOwnerDetails:!0,name:"",gender:"",mobileNumber:"",guardian:"",relationship:"",address:"",ownerType:"",documentId:"",documentType:"",file:""}];let Pe=[];null!=e&&null!==(se=e.applicationData)&&void 0!==se&&se.documents&&e.applicationData.documents.forEach(e=>{var n;Pe.push({active:!0,code:null==e?void 0:e.documentType,i18nKey:null==e||null===(n=e.documentType)||void 0===n?void 0:n.replaceAll(".","_"),documentType:null==e?void 0:e.documentType,id:e.id,documentUid:null==e?void 0:e.documentUid,fileStoreId:null==e?void 0:e.fileStoreId})});let Me={documents:Pe}||[],xe={};xe.details=(null==e?void 0:e.propertyDetails)||{};let Be={};const Fe=null!=e&&null!==(ce=e.applicationData)&&void 0!==ce&&ce.waterSource?m(null==e||null===(ve=e.applicationData)||void 0===ve||null===(pe=ve.waterSource)||void 0===pe?void 0:pe.toUpperCase()," ","_"):"",Ue=Fe?m(null==Fe?void 0:Fe.toUpperCase(),".","_"):"",ke="WATER"===n?{connectionType:null!=e&&null!==(me=e.applicationData)&&void 0!==me&&me.connectionType?{code:null==e||null===(Ee=e.applicationData)||void 0===Ee?void 0:Ee.connectionType,i18nKey:o("WS_CONNECTIONTYPE_"+m(null==e||null===(Se=e.applicationData)||void 0===Se||null===(_e=Se.connectionType)||void 0===_e?void 0:_e.toUpperCase()," ","_"))}:"",waterSource:null!=e&&null!==(fe=e.applicationData)&&void 0!==fe&&fe.waterSource?{code:null==e||null===(ge=e.applicationData)||void 0===ge?void 0:ge.waterSource,i18nKey:o("WS_SERVICES_MASTERS_WATERSOURCE_"+m(null==e||null===(Ce=e.applicationData)||void 0===Ce||null===(Ne=Ce.waterSource)||void 0===Ne||null===(ye=Ne.split(".")[0])||void 0===ye?void 0:ye.toUpperCase()," ","_"))}:"",sourceSubData:null!=e&&null!==(De=e.applicationData)&&void 0!==De&&De.waterSource?{code:null==e||null===(Te=e.applicationData)||void 0===Te?void 0:Te.waterSource,i18nKey:o("WS_SERVICES_MASTERS_WATERSOURCE_"+Ue)}:"",pipeSize:null!=e&&null!==(he=e.applicationData)&&void 0!==he&&he.pipeSize?{code:null==e||null===(Ae=e.applicationData)||void 0===Ae?void 0:Ae.pipeSize,i18nKey:null==e||null===(Ie=e.applicationData)||void 0===Ie?void 0:Ie.pipeSize,size:null==e||null===(Oe=e.applicationData)||void 0===Oe?void 0:Oe.pipeSize}:"",noOfTaps:(null==e||null===(be=e.applicationData)||void 0===be?void 0:be.noOfTaps)||""}:{noOfWaterClosets:(null==e||null===(Le=e.applicationData)||void 0===Le?void 0:Le.noOfWaterClosets)||"",noOfToilets:(null==e||null===(Re=e.applicationData)||void 0===Re?void 0:Re.noOfToilets)||""};if(t){var He,je,Ve,ze,Ye,Ge,qe,Ke,Xe,Ze,$e,Je,Qe,en,nn,tn,ln,on,an,rn,un,dn,sn,cn,vn,pn,mn,En,Sn,_n,fn,gn;const t=[{meterId:null!=e&&null!==(He=e.applicationData)&&void 0!==He&&He.meterId?Number(null==e||null===(je=e.applicationData)||void 0===je?void 0:je.meterId):"",meterInstallationDate:null!=e&&null!==(Ve=e.applicationData)&&void 0!==Ve&&Ve.meterInstallationDate?S(null==e||null===(ze=e.applicationData)||void 0===ze?void 0:ze.meterInstallationDate,!0):null,meterInitialReading:null!=e&&null!==(Ye=e.applicationData)&&void 0!==Ye&&null!==(Ge=Ye.additionalDetails)&&void 0!==Ge&&Ge.initialMeterReading?Number(null==e||null===(qe=e.applicationData)||void 0===qe||null===(Ke=qe.additionalDetails)||void 0===Ke?void 0:Ke.initialMeterReading):"",connectionExecutionDate:null!=e&&null!==(Xe=e.applicationData)&&void 0!==Xe&&Xe.connectionExecutionDate?S(null==e||null===(Ze=e.applicationData)||void 0===Ze?void 0:Ze.connectionExecutionDate,!0):null}];window.location.href.includes("modify-application-edit")&&(t[0].dateEffectiveFrom=null!=e&&null!==($e=e.applicationData)&&void 0!==$e&&$e.dateEffectiveFrom?S(null==e||null===(Je=e.applicationData)||void 0===Je?void 0:Je.dateEffectiveFrom,!0):null);const l=null!=e&&null!==(Qe=e.applicationData)&&void 0!==Qe&&Qe.waterSource?m(null==e||null===(en=e.applicationData)||void 0===en||null===(nn=en.waterSource)||void 0===nn?void 0:nn.toUpperCase()," ","_"):"",i=l?m(null==l?void 0:l.toUpperCase(),".","_"):"",a="WATER"===n?{connectionType:null!=e&&null!==(tn=e.applicationData)&&void 0!==tn&&tn.connectionType?{code:null==e||null===(ln=e.applicationData)||void 0===ln?void 0:ln.connectionType,i18nKey:o("WS_CONNECTIONTYPE_"+m(null==e||null===(on=e.applicationData)||void 0===on||null===(an=on.connectionType)||void 0===an?void 0:an.toUpperCase()," ","_"))}:"",waterSource:null!=e&&null!==(rn=e.applicationData)&&void 0!==rn&&rn.waterSource?{code:null==e||null===(un=e.applicationData)||void 0===un?void 0:un.waterSource,i18nKey:o("WS_SERVICES_MASTERS_WATERSOURCE_"+m(null==e||null===(dn=e.applicationData)||void 0===dn||null===(sn=dn.waterSource)||void 0===sn||null===(cn=sn.split(".")[0])||void 0===cn?void 0:cn.toUpperCase()," ","_"))}:"",sourceSubData:null!=e&&null!==(vn=e.applicationData)&&void 0!==vn&&vn.waterSource?{code:null==e||null===(pn=e.applicationData)||void 0===pn?void 0:pn.waterSource,i18nKey:o("WS_SERVICES_MASTERS_WATERSOURCE_"+i)}:"",pipeSize:null!=e&&null!==(mn=e.applicationData)&&void 0!==mn&&mn.pipeSize?{code:null==e||null===(En=e.applicationData)||void 0===En?void 0:En.pipeSize,i18nKey:null==e||null===(Sn=e.applicationData)||void 0===Sn?void 0:Sn.pipeSize}:"",noOfTaps:(null==e||null===(_n=e.applicationData)||void 0===_n?void 0:_n.noOfTaps)||""}:{noOfWaterClosets:(null==e||null===(fn=e.applicationData)||void 0===fn?void 0:fn.noOfWaterClosets)||"",noOfToilets:(null==e||null===(gn=e.applicationData)||void 0===gn?void 0:gn.noOfToilets)||""};Me=window.location.href.includes("modify-application-edit")?{documents:Pe}:{documents:[]},Be={ConnectionDetails:we,connectionDetails:[a],ConnectionHolderDetails:We,activationDetails:t,DocumentsRequired:Me,cpt:xe,InfoLabel:"InfoLabel"}}else{var Cn,Nn,yn,Dn,Tn,hn,An,In,On,bn,Ln,Rn,wn,Wn,Pn,Mn,xn;Be={ConnectionDetails:we,ConnectionHolderDetails:We,DocumentsRequired:Me,cpt:xe,InfoLabel:"InfoLabel"};let n=[{detailsProvidedBy:null!=e&&null!==(Cn=e.applicationData)&&void 0!==Cn&&null!==(Nn=Cn.additionalDetails)&&void 0!==Nn&&Nn.detailsProvidedBy?{i18nKey:null==e||null===(yn=e.applicationData)||void 0===yn||null===(Dn=yn.additionalDetails)||void 0===Dn?void 0:Dn.detailsProvidedBy,code:null==e||null===(Tn=e.applicationData)||void 0===Tn||null===(hn=Tn.additionalDetails)||void 0===hn?void 0:hn.detailsProvidedBy,size:null==e||null===(An=e.applicationData)||void 0===An||null===(In=An.additionalDetails)||void 0===In?void 0:In.detailsProvidedBy}:"",plumberName:null==e||null===(On=e.applicationData)||void 0===On||null===(bn=On.plumberInfo)||void 0===bn?void 0:bn[0].name,plumberMobileNo:null==e||null===(Ln=e.applicationData)||void 0===Ln||null===(Rn=Ln.plumberInfo)||void 0===Rn?void 0:Rn[0].mobileNumber,plumberLicenseNo:null==e||null===(wn=e.applicationData)||void 0===wn||null===(Wn=wn.plumberInfo)||void 0===Wn?void 0:Wn[0].licenseNo}],t=null!=e&&null!==(Pn=e.applicationData)&&void 0!==Pn&&Pn.roadCuttingInfo?null==e||null===(Mn=e.applicationData)||void 0===Mn||null===(xn=Mn.roadCuttingInfo)||void 0===xn?void 0:xn.map((e,n)=>e.id?{key:n+"_"+Date.now(),id:null==e?void 0:e.id,roadType:{i18nKey:"WS_ROADTYPE_"+(null==e?void 0:e.roadType),code:null==e?void 0:e.roadType},area:null==e?void 0:e.roadCuttingArea,status:null==e?void 0:e.status}:{key:n+"_"+Date.now(),roadType:{i18nKey:"WS_ROADTYPE_"+(null==e?void 0:e.roadType),code:null==e?void 0:e.roadType},area:null==e?void 0:e.roadCuttingArea,status:null==e?void 0:e.status}):[{key:"99999_"+Date.now(),id:null,roadType:{i18nKey:"",code:""},area:"",status:""}];l&&(Be.connectionDetails=[ke],Be.plumberDetails=n,Be.roadCuttingDetails=t)}return sessionStorage.setItem("Digit.PT_CREATE_EMP_WS_NEW_FORM",JSON.stringify(Be)),sessionStorage.setItem("WS_EDIT_APPLICATION_DETAILS",JSON.stringify(e)),Be},w=function(e,n,t,l){var o,i,a,r,u,d;void 0===t&&(t=!1);let s=[{consumerNumber:null==e||null===(o=e.applicationData)||void 0===o?void 0:o.applicationNo,disConnectionType:null!=e&&null!==(i=e.applicationData)&&void 0!==i&&i.isDisconnectionTemporary?"TEMPORARY":"PERMANENT",disConnectionReason:(null==e||null===(a=e.applicationData)||void 0===a?void 0:a.disconnectionReason)||"",disConnectionProposeDate:null!=e&&null!==(r=e.applicationData)&&void 0!==r&&r.dateEffectiveFrom?S(null==e||null===(u=e.applicationData)||void 0===u?void 0:u.dateEffectiveFrom,!0):null}],c=[];null!=e&&null!==(d=e.applicationData)&&void 0!==d&&d.documents&&e.applicationData.documents.forEach(e=>{var n;c.push({active:!0,code:null==e?void 0:e.documentType,i18nKey:null==e||null===(n=e.documentType)||void 0===n?void 0:n.replaceAll(".","_"),documentType:null==e?void 0:e.documentType,id:e.id,documentUid:null==e?void 0:e.documentUid,fileStoreId:null==e?void 0:e.fileStoreId})});let v={documents:c},p={};if(p.disConnectionDetails=s,p.DocumentsRequired=v,t){var m,E,_,f,g,C,N,y,D,T,h,A,I,O,b;let n=[{detailsProvidedBy:null!=e&&null!==(m=e.applicationData)&&void 0!==m&&null!==(E=m.additionalDetails)&&void 0!==E&&E.detailsProvidedBy?{i18nKey:null==e||null===(_=e.applicationData)||void 0===_||null===(f=_.additionalDetails)||void 0===f?void 0:f.detailsProvidedBy,code:null==e||null===(g=e.applicationData)||void 0===g||null===(C=g.additionalDetails)||void 0===C?void 0:C.detailsProvidedBy,size:null==e||null===(N=e.applicationData)||void 0===N||null===(y=N.additionalDetails)||void 0===y?void 0:y.detailsProvidedBy}:"",plumberName:null==e||null===(D=e.applicationData)||void 0===D||null===(T=D.plumberInfo)||void 0===T?void 0:T[0].name,plumberMobileNo:null==e||null===(h=e.applicationData)||void 0===h||null===(A=h.plumberInfo)||void 0===A?void 0:A[0].mobileNumber,plumberLicenseNo:null==e||null===(I=e.applicationData)||void 0===I||null===(O=I.plumberInfo)||void 0===O?void 0:O[0].licenseNo,applicationNo:null==e||null===(b=e.applicationData)||void 0===b?void 0:b.applicationNo}];p.plumberDetails=n}return sessionStorage.setItem("Digit.PT_CREATE_EMP_WS_NEW_FORM",JSON.stringify(p)),sessionStorage.setItem("WS_EDIT_APPLICATION_DETAILS",JSON.stringify(e)),p},W=function(e,n,t){try{var l,o,i,a,r,u,d,s,c,p,m,E,S,_,f,g;const C=sessionStorage.getItem("DISCONNECTION_EDIT_DOCS"),N=C?JSON.parse(C):"",y=[];null==N||N.map(e=>{var t,l,o,i;const a=null==n||null===(t=n.applicationData)||void 0===t||null===(l=t.documents)||void 0===l?void 0:l.filter(n=>{var t,l,o,i,a,r,u,d;return(null==n||null===(t=n.documentType)||void 0===t||null===(l=t.split("."))||void 0===l?void 0:l[0])+"."+(null==n||null===(o=n.documentType)||void 0===o||null===(i=o.split("."))||void 0===i?void 0:i[1])==(null==e||null===(a=e.documentType)||void 0===a||null===(r=a.split("."))||void 0===r?void 0:r[0])+"."+(null==e||null===(u=e.documentType)||void 0===u||null===(d=u.split("."))||void 0===d?void 0:d[1])});let r=(null==a?void 0:a.length)>0?{auditDetails:null,documentType:null==e?void 0:e.documentType,documentUid:null==a||null===(o=a[0])||void 0===o?void 0:o.documentUid,fileStoreId:null==e?void 0:e.fileStoreId,id:null==a||null===(i=a[0])||void 0===i?void 0:i.id,status:"ACTIVE"}:e;y.push(r)});const D=[{licenseNo:null==e||null===(l=e.plumberDetails)||void 0===l||null===(o=l[0])||void 0===o?void 0:o.plumberLicenseNo,mobileNumber:null==e||null===(i=e.plumberDetails)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.plumberMobileNo,name:null==e||null===(r=e.plumberDetails)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.plumberName,id:null==n||null===(d=n.applicationData)||void 0===d||null===(s=d.plumberInfo)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.id}],T=(null==e||null===(p=e.disConnectionDetails)||void 0===p||null===(m=p[0])||void 0===m?void 0:m.disConnectionReason)||"",h="TEMPORARY"==(null==e||null===(E=e.disConnectionDetails)||void 0===E||null===(S=E[0])||void 0===S?void 0:S.disConnectionType),A=(null==y?void 0:y.length)>0?y:null==e||null===(_=e.DocumentsRequired)||void 0===_?void 0:_.documents;return Promise.resolve(P(null==e||null===(f=e.disConnectionDetails)||void 0===f||null===(g=f[0])||void 0===g?void 0:g.disConnectionProposeDate)).then(function(l){var o,i,a;let r=v({},n.applicationData,{documents:A,isDisconnectionTemporary:h,disconnectionReason:T,dateEffectiveFrom:l,processInstance:{action:t||"RESUBMIT_APPLICATION"},action:t||"RESUBMIT_APPLICATION"});var u,d,s,c,p,m;return null!=e&&null!==(o=e.plumberDetails)&&void 0!==o&&null!==(i=o[0])&&void 0!==i&&null!==(a=i.detailsProvidedBy)&&void 0!==a&&a.code&&(r.additionalDetails.detailsProvidedBy=null==e||null===(u=e.plumberDetails)||void 0===u||null===(d=u[0])||void 0===d||null===(s=d.detailsProvidedBy)||void 0===s?void 0:s.code,"ULB"==(null==e||null===(c=e.plumberDetails)||void 0===c||null===(p=c[0])||void 0===p||null===(m=p.detailsProvidedBy)||void 0===m?void 0:m.code)&&(r.plumberInfo=D)),r})}catch(e){return Promise.reject(e)}},P=function(e){try{const n=null==e?void 0:e.split("-"),t=null==n?void 0:n.reverse(),l=null==t?void 0:t.join("-");let o=m(l,"/","-"),i="";return i=o.split("-")[2]>1900?o.split("-")[2]+"-"+o.split("-")[1]+"-"+o.split("-")[0]:o.split("-")[0]+"-"+o.split("-")[2]+"-"+o.split("-")[1],Promise.resolve(N(i))}catch(e){return Promise.reject(e)}},M=function(e,n,t){void 0===t&&(t="INITIATE");try{var l,o,i,a,r,u,d,s,c,p,m,E,S,_,f,g,C,N,y,D,T,h,A,I,O,b,L,R,w,W,M,x,B,F,U,k,H,j,V,z,Y;function G(){var l,o,i,a;function r(){function l(){var l,o,i,a,r,u,d,s,c,p,m,E,S,_,f,g,C,N,y,D,T,h,A,I,O,b,L,R,w,W;return q.documents=null!=e&&null!==(l=e.DocumentsRequired)&&void 0!==l&&null!==(o=l.documents)&&void 0!==o&&o.length?null==e||null===(i=e.DocumentsRequired)||void 0===i?void 0:i.documents:null,null!=e&&null!==(a=e.ConnectionHolderDetails)&&void 0!==a&&null!==(r=a[0])&&void 0!==r&&r.sameAsOwnerDetails||(q.connectionHolders=[v({},null==n||null===(s=n.applicationData)||void 0===s||null===(c=s.connectionHolders)||void 0===c?void 0:c[0],{correspondenceAddress:(null==e||null===(p=e.ConnectionHolderDetails)||void 0===p||null===(m=p[0])||void 0===m?void 0:m.address)||"",fatherOrHusbandName:(null==e||null===(E=e.ConnectionHolderDetails)||void 0===E||null===(S=E[0])||void 0===S?void 0:S.guardian)||"",gender:(null==e||null===(_=e.ConnectionHolderDetails)||void 0===_||null===(f=_[0])||void 0===f||null===(g=f.gender)||void 0===g?void 0:g.code)||"",mobileNumber:(null==e||null===(C=e.ConnectionHolderDetails)||void 0===C||null===(N=C[0])||void 0===N?void 0:N.mobileNumber)||"",name:(null==e||null===(y=e.ConnectionHolderDetails)||void 0===y||null===(D=y[0])||void 0===D?void 0:D.name)||"",emailId:(null==e||null===(T=e.ConnectionHolderDetails)||void 0===T||null===(h=T[0])||void 0===h?void 0:h.emailId)||"",ownerType:(null==e||null===(A=e.ConnectionHolderDetails)||void 0===A||null===(I=A[0])||void 0===I||null===(O=I.ownerType)||void 0===O?void 0:O.code)||"",relationship:(null==e||null===(b=e.ConnectionHolderDetails)||void 0===b||null===(L=b[0])||void 0===L||null===(R=L.relationship)||void 0===R?void 0:R.code)||"",sameAsPropertyAddress:null==e||null===(w=e.ConnectionHolderDetails)||void 0===w||null===(W=w[0])||void 0===W?void 0:W.sameAsOwnerDetails})]),q.processInstance={action:t},q.action=t,q.channel="CFC_COUNTER",sessionStorage.setItem("WS_DOCUMENTS_INOF",JSON.stringify((null==e||null===(u=e.DocumentsRequired)||void 0===u?void 0:u.documents)||[])),sessionStorage.setItem("WS_PROPERTY_INOF",JSON.stringify(null==e||null===(d=e.cpt)||void 0===d?void 0:d.details)),q}const o=function(n,t,l,o){if(null!=e&&null!==(n=e.activationDetails)&&void 0!==n&&null!==(t=n[0])&&void 0!==t&&t.dateEffectiveFrom)return Promise.resolve(P(null==e||null===(l=e.activationDetails)||void 0===l||null===(o=l[0])||void 0===o?void 0:o.dateEffectiveFrom)).then(function(e){q.dateEffectiveFrom=e})}();return o&&o.then?o.then(l):l()}null!=e&&null!==(l=e.activationDetails)&&void 0!==l&&null!==(o=l[0])&&void 0!==o&&o.meterInitialReading&&(q.additionalDetails.initialMeterReading=null==e||null===(i=e.activationDetails)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.meterInitialReading);const u=function(n,t,l,o){if(null!=e&&null!==(n=e.activationDetails)&&void 0!==n&&null!==(t=n[0])&&void 0!==t&&t.connectionExecutionDate)return Promise.resolve(P(null==e||null===(l=e.activationDetails)||void 0===l||null===(o=l[0])||void 0===o?void 0:o.connectionExecutionDate)).then(function(e){q.connectionExecutionDate=e})}();return u&&u.then?u.then(r):r()}null==e||null===(l=e.cpt)||void 0===l||null===(o=l.details)||void 0===o||null===(i=o.owners)||void 0===i||i.forEach(e=>{null!=e&&e.permanentAddress&&(e.correspondenceAddress=null==e?void 0:e.permanentAddress)});let q=v({},n.applicationData);null!=e&&null!==(a=e.cpt)&&void 0!==a&&null!==(r=a.details)&&void 0!==r&&r.propertyId&&(q.propertyId=null==e||null===(u=e.cpt)||void 0===u||null===(d=u.details)||void 0===d?void 0:d.propertyId),null!=e&&null!==(s=e.connectionDetails)&&void 0!==s&&null!==(c=s[0])&&void 0!==c&&null!==(p=c.connectionType)&&void 0!==p&&p.code&&(q.connectionType=null==e||null===(m=e.connectionDetails)||void 0===m||null===(E=m[0])||void 0===E||null===(S=E.connectionType)||void 0===S?void 0:S.code),null!=e&&null!==(_=e.connectionDetails)&&void 0!==_&&null!==(f=_[0])&&void 0!==f&&null!==(g=f.waterSource)&&void 0!==g&&g.code&&(q.waterSource=null==e||null===(C=e.connectionDetails)||void 0===C||null===(N=C[0])||void 0===N||null===(y=N.waterSource)||void 0===y?void 0:y.code),null!=e&&null!==(D=e.connectionDetails)&&void 0!==D&&null!==(T=D[0])&&void 0!==T&&null!==(h=T.pipeSize)&&void 0!==h&&h.size&&(q.pipeSize=null==e||null===(A=e.connectionDetails)||void 0===A||null===(I=A[0])||void 0===I||null===(O=I.pipeSize)||void 0===O?void 0:O.size),null!=e&&null!==(b=e.connectionDetails)&&void 0!==b&&null!==(L=b[0])&&void 0!==L&&L.noOfTaps&&(q.noOfTaps=null==e||null===(R=e.connectionDetails)||void 0===R||null===(w=R[0])||void 0===w?void 0:w.noOfTaps),null!=e&&null!==(W=e.connectionDetails)&&void 0!==W&&null!==(M=W[0])&&void 0!==M&&M.noOfWaterClosets&&(q.noOfWaterClosets=null==e||null===(x=e.connectionDetails)||void 0===x||null===(B=x[0])||void 0===B?void 0:B.noOfWaterClosets),null!=e&&null!==(F=e.connectionDetails)&&void 0!==F&&null!==(U=F[0])&&void 0!==U&&U.noOfToilets&&(q.noOfToilets=null==e||null===(k=e.connectionDetails)||void 0===k||null===(H=k[0])||void 0===H?void 0:H.noOfToilets),null!=e&&null!==(j=e.activationDetails)&&void 0!==j&&null!==(V=j[0])&&void 0!==V&&V.meterId&&(q.meterId=null==e||null===(z=e.activationDetails)||void 0===z||null===(Y=z[0])||void 0===Y?void 0:Y.meterId);const K=function(n,t,l,o){if(null!=e&&null!==(n=e.activationDetails)&&void 0!==n&&null!==(t=n[0])&&void 0!==t&&t.meterInstallationDate)return Promise.resolve(P(null==e||null===(l=e.activationDetails)||void 0===l||null===(o=l[0])||void 0===o?void 0:o.meterInstallationDate)).then(function(e){q.meterInstallationDate=e})}();return Promise.resolve(K&&K.then?K.then(G):G())}catch(e){return Promise.reject(e)}},x=e=>{var n,t;const l=Digit.UserService.getUser();return(null!=l&&null!==(n=l.info)&&void 0!==n&&n.roles?null==l||null===(t=l.info)||void 0===t?void 0:t.roles.map(e=>e.code):[]).indexOf(e)>-1};var B="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function F(e,n){return e(n={exports:{}},n.exports),n.exports}var U=F(function(e,n){(function(){var t="Expected a function",l="__lodash_placeholder__",o=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],i="[object Arguments]",a="[object Array]",r="[object Boolean]",u="[object Date]",d="[object Error]",s="[object Function]",c="[object GeneratorFunction]",v="[object Map]",p="[object Number]",m="[object Object]",E="[object RegExp]",S="[object Set]",_="[object String]",f="[object Symbol]",g="[object WeakMap]",C="[object ArrayBuffer]",N="[object DataView]",y="[object Float32Array]",D="[object Float64Array]",T="[object Int8Array]",h="[object Int16Array]",A="[object Int32Array]",I="[object Uint8Array]",O="[object Uint16Array]",b="[object Uint32Array]",L=/\b__p \+= '';/g,R=/\b(__p \+=) '' \+/g,w=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,P=/[&<>"']/g,M=RegExp(W.source),x=RegExp(P.source),F=/<%-([\s\S]+?)%>/g,U=/<%([\s\S]+?)%>/g,k=/<%=([\s\S]+?)%>/g,H=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,j=/^\w*$/,V=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,z=/[\\^$.*+?()[\]{}|]/g,Y=RegExp(z.source),G=/^\s+/,q=/\s/,K=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,X=/\{\n\/\* \[wrapped with (.+)\] \*/,Z=/,? & /,$=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,J=/[()=,{}\[\]\/\s]/,Q=/\\(\\)?/g,ee=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ne=/\w*$/,te=/^[-+]0x[0-9a-f]+$/i,le=/^0b[01]+$/i,oe=/^\[object .+?Constructor\]$/,ie=/^0o[0-7]+$/i,ae=/^(?:0|[1-9]\d*)$/,re=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ue=/($^)/,de=/['\n\r\u2028\u2029\\]/g,se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ce="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ve="["+ce+"]",pe="["+se+"]",me="\\d+",Ee="[a-z\\xdf-\\xf6\\xf8-\\xff]",Se="[^\\ud800-\\udfff"+ce+me+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",_e="\\ud83c[\\udffb-\\udfff]",fe="[^\\ud800-\\udfff]",ge="(?:\\ud83c[\\udde6-\\uddff]){2}",Ce="[\\ud800-\\udbff][\\udc00-\\udfff]",Ne="[A-Z\\xc0-\\xd6\\xd8-\\xde]",ye="(?:"+Ee+"|"+Se+")",De="(?:"+Ne+"|"+Se+")",Te="(?:"+pe+"|"+_e+")?",he="[\\ufe0e\\ufe0f]?"+Te+"(?:\\u200d(?:"+[fe,ge,Ce].join("|")+")[\\ufe0e\\ufe0f]?"+Te+")*",Ae="(?:"+["[\\u2700-\\u27bf]",ge,Ce].join("|")+")"+he,Ie="(?:"+[fe+pe+"?",pe,ge,Ce,"[\\ud800-\\udfff]"].join("|")+")",Oe=RegExp("['’]","g"),be=RegExp(pe,"g"),Le=RegExp(_e+"(?="+_e+")|"+Ie+he,"g"),Re=RegExp([Ne+"?"+Ee+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ve,Ne,"$"].join("|")+")",De+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ve,Ne+ye,"$"].join("|")+")",Ne+"?"+ye+"+(?:['’](?:d|ll|m|re|s|t|ve))?",Ne+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",me,Ae].join("|"),"g"),we=RegExp("[\\u200d\\ud800-\\udfff"+se+"\\ufe0e\\ufe0f]"),We=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Pe=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Me=-1,xe={};xe[y]=xe[D]=xe[T]=xe[h]=xe[A]=xe[I]=xe["[object Uint8ClampedArray]"]=xe[O]=xe[b]=!0,xe[i]=xe[a]=xe[C]=xe[r]=xe[N]=xe[u]=xe[d]=xe[s]=xe[v]=xe[p]=xe[m]=xe[E]=xe[S]=xe[_]=xe[g]=!1;var Be={};Be[i]=Be[a]=Be[C]=Be[N]=Be[r]=Be[u]=Be[y]=Be[D]=Be[T]=Be[h]=Be[A]=Be[v]=Be[p]=Be[m]=Be[E]=Be[S]=Be[_]=Be[f]=Be[I]=Be["[object Uint8ClampedArray]"]=Be[O]=Be[b]=!0,Be[d]=Be[s]=Be[g]=!1;var Fe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,ke=parseInt,He="object"==typeof B&&B&&B.Object===Object&&B,je="object"==typeof self&&self&&self.Object===Object&&self,Ve=He||je||Function("return this")(),ze=n&&!n.nodeType&&n,Ye=ze&&e&&!e.nodeType&&e,Ge=Ye&&Ye.exports===ze,qe=Ge&&He.process,Ke=function(){try{return Ye&&Ye.require&&Ye.require("util").types||qe&&qe.binding&&qe.binding("util")}catch(e){}}(),Xe=Ke&&Ke.isArrayBuffer,Ze=Ke&&Ke.isDate,$e=Ke&&Ke.isMap,Je=Ke&&Ke.isRegExp,Qe=Ke&&Ke.isSet,en=Ke&&Ke.isTypedArray;function nn(e,n,t){switch(t.length){case 0:return e.call(n);case 1:return e.call(n,t[0]);case 2:return e.call(n,t[0],t[1]);case 3:return e.call(n,t[0],t[1],t[2])}return e.apply(n,t)}function tn(e,n,t,l){for(var o=-1,i=null==e?0:e.length;++o<i;){var a=e[o];n(l,a,t(a),e)}return l}function ln(e,n){for(var t=-1,l=null==e?0:e.length;++t<l&&!1!==n(e[t],t,e););return e}function on(e,n){for(var t=null==e?0:e.length;t--&&!1!==n(e[t],t,e););return e}function an(e,n){for(var t=-1,l=null==e?0:e.length;++t<l;)if(!n(e[t],t,e))return!1;return!0}function rn(e,n){for(var t=-1,l=null==e?0:e.length,o=0,i=[];++t<l;){var a=e[t];n(a,t,e)&&(i[o++]=a)}return i}function un(e,n){return!(null==e||!e.length)&&fn(e,n,0)>-1}function dn(e,n,t){for(var l=-1,o=null==e?0:e.length;++l<o;)if(t(n,e[l]))return!0;return!1}function sn(e,n){for(var t=-1,l=null==e?0:e.length,o=Array(l);++t<l;)o[t]=n(e[t],t,e);return o}function cn(e,n){for(var t=-1,l=n.length,o=e.length;++t<l;)e[o+t]=n[t];return e}function vn(e,n,t,l){var o=-1,i=null==e?0:e.length;for(l&&i&&(t=e[++o]);++o<i;)t=n(t,e[o],o,e);return t}function pn(e,n,t,l){var o=null==e?0:e.length;for(l&&o&&(t=e[--o]);o--;)t=n(t,e[o],o,e);return t}function mn(e,n){for(var t=-1,l=null==e?0:e.length;++t<l;)if(n(e[t],t,e))return!0;return!1}var En=yn("length");function Sn(e,n,t){var l;return t(e,function(e,t,o){if(n(e,t,o))return l=t,!1}),l}function _n(e,n,t,l){for(var o=e.length,i=t+(l?1:-1);l?i--:++i<o;)if(n(e[i],i,e))return i;return-1}function fn(e,n,t){return n==n?function(e,n,t){for(var l=t-1,o=e.length;++l<o;)if(e[l]===n)return l;return-1}(e,n,t):_n(e,Cn,t)}function gn(e,n,t,l){for(var o=t-1,i=e.length;++o<i;)if(l(e[o],n))return o;return-1}function Cn(e){return e!=e}function Nn(e,n){var t=null==e?0:e.length;return t?hn(e,n)/t:NaN}function yn(e){return function(n){return null==n?void 0:n[e]}}function Dn(e){return function(n){return null==e?void 0:e[n]}}function Tn(e,n,t,l,o){return o(e,function(e,o,i){t=l?(l=!1,e):n(t,e,o,i)}),t}function hn(e,n){for(var t,l=-1,o=e.length;++l<o;){var i=n(e[l]);void 0!==i&&(t=void 0===t?i:t+i)}return t}function An(e,n){for(var t=-1,l=Array(e);++t<e;)l[t]=n(t);return l}function In(e){return e?e.slice(0,Yn(e)+1).replace(G,""):e}function On(e){return function(n){return e(n)}}function bn(e,n){return sn(n,function(n){return e[n]})}function Ln(e,n){return e.has(n)}function Rn(e,n){for(var t=-1,l=e.length;++t<l&&fn(n,e[t],0)>-1;);return t}function wn(e,n){for(var t=e.length;t--&&fn(n,e[t],0)>-1;);return t}function Wn(e,n){for(var t=e.length,l=0;t--;)e[t]===n&&++l;return l}var Pn=Dn({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Mn=Dn({"&":"&","<":"<",">":">",'"':""","'":"'"});function xn(e){return"\\"+Fe[e]}function Bn(e){return we.test(e)}function Fn(e){var n=-1,t=Array(e.size);return e.forEach(function(e,l){t[++n]=[l,e]}),t}function Un(e,n){return function(t){return e(n(t))}}function kn(e,n){for(var t=-1,o=e.length,i=0,a=[];++t<o;){var r=e[t];r!==n&&r!==l||(e[t]=l,a[i++]=t)}return a}function Hn(e){var n=-1,t=Array(e.size);return e.forEach(function(e){t[++n]=e}),t}function jn(e){var n=-1,t=Array(e.size);return e.forEach(function(e){t[++n]=[e,e]}),t}function Vn(e){return Bn(e)?function(e){for(var n=Le.lastIndex=0;Le.test(e);)++n;return n}(e):En(e)}function zn(e){return Bn(e)?function(e){return e.match(Le)||[]}(e):function(e){return e.split("")}(e)}function Yn(e){for(var n=e.length;n--&&q.test(e.charAt(n)););return n}var Gn=Dn({"&":"&","<":"<",">":">",""":'"',"'":"'"}),qn=function e(n){var B,q=(n=null==n?Ve:qn.defaults(Ve.Object(),n,qn.pick(Ve,Pe))).Array,se=n.Date,ce=n.Error,ve=n.Function,pe=n.Math,me=n.Object,Ee=n.RegExp,Se=n.String,_e=n.TypeError,fe=q.prototype,ge=me.prototype,Ce=n["__core-js_shared__"],Ne=ve.prototype.toString,ye=ge.hasOwnProperty,De=0,Te=(B=/[^.]+$/.exec(Ce&&Ce.keys&&Ce.keys.IE_PROTO||""))?"Symbol(src)_1."+B:"",he=ge.toString,Ae=Ne.call(me),Ie=Ve._,Le=Ee("^"+Ne.call(ye).replace(z,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),we=Ge?n.Buffer:void 0,Fe=n.Symbol,He=n.Uint8Array,je=we?we.allocUnsafe:void 0,ze=Un(me.getPrototypeOf,me),Ye=me.create,qe=ge.propertyIsEnumerable,Ke=fe.splice,En=Fe?Fe.isConcatSpreadable:void 0,Dn=Fe?Fe.iterator:void 0,Kn=Fe?Fe.toStringTag:void 0,Xn=function(){try{var e=Qo(me,"defineProperty");return e({},"",{}),e}catch(e){}}(),Zn=n.clearTimeout!==Ve.clearTimeout&&n.clearTimeout,$n=se&&se.now!==Ve.Date.now&&se.now,Jn=n.setTimeout!==Ve.setTimeout&&n.setTimeout,Qn=pe.ceil,et=pe.floor,nt=me.getOwnPropertySymbols,tt=we?we.isBuffer:void 0,lt=n.isFinite,ot=fe.join,it=Un(me.keys,me),at=pe.max,rt=pe.min,ut=se.now,dt=n.parseInt,st=pe.random,ct=fe.reverse,vt=Qo(n,"DataView"),pt=Qo(n,"Map"),mt=Qo(n,"Promise"),Et=Qo(n,"Set"),St=Qo(n,"WeakMap"),_t=Qo(me,"create"),ft=St&&new St,gt={},Ct=Oi(vt),Nt=Oi(pt),yt=Oi(mt),Dt=Oi(Et),Tt=Oi(St),ht=Fe?Fe.prototype:void 0,At=ht?ht.valueOf:void 0,It=ht?ht.toString:void 0;function Ot(e){if(Ya(e)&&!Pa(e)&&!(e instanceof wt)){if(e instanceof Rt)return e;if(ye.call(e,"__wrapped__"))return bi(e)}return new Rt(e)}var bt=function(){function e(){}return function(n){if(!za(n))return{};if(Ye)return Ye(n);e.prototype=n;var t=new e;return e.prototype=void 0,t}}();function Lt(){}function Rt(e,n){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=void 0}function wt(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Wt(e){var n=-1,t=null==e?0:e.length;for(this.clear();++n<t;){var l=e[n];this.set(l[0],l[1])}}function Pt(e){var n=-1,t=null==e?0:e.length;for(this.clear();++n<t;){var l=e[n];this.set(l[0],l[1])}}function Mt(e){var n=-1,t=null==e?0:e.length;for(this.clear();++n<t;){var l=e[n];this.set(l[0],l[1])}}function xt(e){var n=-1,t=null==e?0:e.length;for(this.__data__=new Mt;++n<t;)this.add(e[n])}function Bt(e){var n=this.__data__=new Pt(e);this.size=n.size}function Ft(e,n){var t=Pa(e),l=!t&&Wa(e),o=!t&&!l&&Fa(e),i=!t&&!l&&!o&&Qa(e),a=t||l||o||i,r=a?An(e.length,Se):[],u=r.length;for(var d in e)!n&&!ye.call(e,d)||a&&("length"==d||o&&("offset"==d||"parent"==d)||i&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||ai(d,u))||r.push(d);return r}function Ut(e){var n=e.length;return n?e[Ml(0,n-1)]:void 0}function kt(e,n){return Di(_o(e),Xt(n,0,e.length))}function Ht(e){return Di(_o(e))}function jt(e,n,t){(void 0!==t&&!La(e[n],t)||void 0===t&&!(n in e))&&qt(e,n,t)}function Vt(e,n,t){var l=e[n];ye.call(e,n)&&La(l,t)&&(void 0!==t||n in e)||qt(e,n,t)}function zt(e,n){for(var t=e.length;t--;)if(La(e[t][0],n))return t;return-1}function Yt(e,n,t,l){return el(e,function(e,o,i){n(l,e,t(e),i)}),l}function Gt(e,n){return e&&fo(n,Nr(n),e)}function qt(e,n,t){"__proto__"==n&&Xn?Xn(e,n,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[n]=t}function Kt(e,n){for(var t=-1,l=n.length,o=q(l),i=null==e;++t<l;)o[t]=i?void 0:Sr(e,n[t]);return o}function Xt(e,n,t){return e==e&&(void 0!==t&&(e=e<=t?e:t),void 0!==n&&(e=e>=n?e:n)),e}function Zt(e,n,t,l,o,a){var d,g=1&n,L=2&n,R=4&n;if(t&&(d=o?t(e,l,o,a):t(e)),void 0!==d)return d;if(!za(e))return e;var w=Pa(e);if(w){if(d=function(e){var n=e.length,t=new e.constructor(n);return n&&"string"==typeof e[0]&&ye.call(e,"index")&&(t.index=e.index,t.input=e.input),t}(e),!g)return _o(e,d)}else{var W=ti(e),P=W==s||W==c;if(Fa(e))return co(e,g);if(W==m||W==i||P&&!o){if(d=L||P?{}:oi(e),!g)return L?function(e,n){return fo(e,ni(e),n)}(e,function(e,n){return e&&fo(n,yr(n),e)}(d,e)):function(e,n){return fo(e,ei(e),n)}(e,Gt(d,e))}else{if(!Be[W])return o?e:{};d=function(e,n,t){var l=e.constructor;switch(n){case C:return vo(e);case r:case u:return new l(+e);case N:return function(e,n){var t=n?vo(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.byteLength)}(e,t);case y:case D:case T:case h:case A:case I:case"[object Uint8ClampedArray]":case O:case b:return po(e,t);case v:return new l;case p:case _:return new l(e);case E:return function(e){var n=new e.constructor(e.source,ne.exec(e));return n.lastIndex=e.lastIndex,n}(e);case S:return new l;case f:return At?me(At.call(e)):{}}}(e,W,g)}}a||(a=new Bt);var M=a.get(e);if(M)return M;a.set(e,d),Za(e)?e.forEach(function(l){d.add(Zt(l,n,t,l,e,a))}):Ga(e)&&e.forEach(function(l,o){d.set(o,Zt(l,n,t,o,e,a))});var x=w?void 0:(R?L?Go:Yo:L?yr:Nr)(e);return ln(x||e,function(l,o){x&&(l=e[o=l]),Vt(d,o,Zt(l,n,t,o,e,a))}),d}function $t(e,n,t){var l=t.length;if(null==e)return!l;for(e=me(e);l--;){var o=t[l],i=e[o];if(void 0===i&&!(o in e)||!(0,n[o])(i))return!1}return!0}function Jt(e,n,l){if("function"!=typeof e)throw new _e(t);return gi(function(){e.apply(void 0,l)},n)}function Qt(e,n,t,l){var o=-1,i=un,a=!0,r=e.length,u=[],d=n.length;if(!r)return u;t&&(n=sn(n,On(t))),l?(i=dn,a=!1):n.length>=200&&(i=Ln,a=!1,n=new xt(n));e:for(;++o<r;){var s=e[o],c=null==t?s:t(s);if(s=l||0!==s?s:0,a&&c==c){for(var v=d;v--;)if(n[v]===c)continue e;u.push(s)}else i(n,c,l)||u.push(s)}return u}Ot.templateSettings={escape:F,evaluate:U,interpolate:k,variable:"",imports:{_:Ot}},(Ot.prototype=Lt.prototype).constructor=Ot,(Rt.prototype=bt(Lt.prototype)).constructor=Rt,(wt.prototype=bt(Lt.prototype)).constructor=wt,Wt.prototype.clear=function(){this.__data__=_t?_t(null):{},this.size=0},Wt.prototype.delete=function(e){var n=this.has(e)&&delete this.__data__[e];return this.size-=n?1:0,n},Wt.prototype.get=function(e){var n=this.__data__;if(_t){var t=n[e];return"__lodash_hash_undefined__"===t?void 0:t}return ye.call(n,e)?n[e]:void 0},Wt.prototype.has=function(e){var n=this.__data__;return _t?void 0!==n[e]:ye.call(n,e)},Wt.prototype.set=function(e,n){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=_t&&void 0===n?"__lodash_hash_undefined__":n,this},Pt.prototype.clear=function(){this.__data__=[],this.size=0},Pt.prototype.delete=function(e){var n=this.__data__,t=zt(n,e);return!(t<0||(t==n.length-1?n.pop():Ke.call(n,t,1),--this.size,0))},Pt.prototype.get=function(e){var n=this.__data__,t=zt(n,e);return t<0?void 0:n[t][1]},Pt.prototype.has=function(e){return zt(this.__data__,e)>-1},Pt.prototype.set=function(e,n){var t=this.__data__,l=zt(t,e);return l<0?(++this.size,t.push([e,n])):t[l][1]=n,this},Mt.prototype.clear=function(){this.size=0,this.__data__={hash:new Wt,map:new(pt||Pt),string:new Wt}},Mt.prototype.delete=function(e){var n=$o(this,e).delete(e);return this.size-=n?1:0,n},Mt.prototype.get=function(e){return $o(this,e).get(e)},Mt.prototype.has=function(e){return $o(this,e).has(e)},Mt.prototype.set=function(e,n){var t=$o(this,e),l=t.size;return t.set(e,n),this.size+=t.size==l?0:1,this},xt.prototype.add=xt.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},xt.prototype.has=function(e){return this.__data__.has(e)},Bt.prototype.clear=function(){this.__data__=new Pt,this.size=0},Bt.prototype.delete=function(e){var n=this.__data__,t=n.delete(e);return this.size=n.size,t},Bt.prototype.get=function(e){return this.__data__.get(e)},Bt.prototype.has=function(e){return this.__data__.has(e)},Bt.prototype.set=function(e,n){var t=this.__data__;if(t instanceof Pt){var l=t.__data__;if(!pt||l.length<199)return l.push([e,n]),this.size=++t.size,this;t=this.__data__=new Mt(l)}return t.set(e,n),this.size=t.size,this};var el=No(ul),nl=No(dl,!0);function tl(e,n){var t=!0;return el(e,function(e,l,o){return t=!!n(e,l,o)}),t}function ll(e,n,t){for(var l=-1,o=e.length;++l<o;){var i=e[l],a=n(i);if(null!=a&&(void 0===r?a==a&&!Ja(a):t(a,r)))var r=a,u=i}return u}function ol(e,n){var t=[];return el(e,function(e,l,o){n(e,l,o)&&t.push(e)}),t}function il(e,n,t,l,o){var i=-1,a=e.length;for(t||(t=ii),o||(o=[]);++i<a;){var r=e[i];n>0&&t(r)?n>1?il(r,n-1,t,l,o):cn(o,r):l||(o[o.length]=r)}return o}var al=yo(),rl=yo(!0);function ul(e,n){return e&&al(e,n,Nr)}function dl(e,n){return e&&rl(e,n,Nr)}function sl(e,n){return rn(n,function(n){return Ha(e[n])})}function cl(e,n){for(var t=0,l=(n=ao(n,e)).length;null!=e&&t<l;)e=e[Ii(n[t++])];return t&&t==l?e:void 0}function vl(e,n,t){var l=n(e);return Pa(e)?l:cn(l,t(e))}function pl(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Kn&&Kn in me(e)?function(e){var n=ye.call(e,Kn),t=e[Kn];try{e[Kn]=void 0;var l=!0}catch(e){}var o=he.call(e);return l&&(n?e[Kn]=t:delete e[Kn]),o}(e):function(e){return he.call(e)}(e)}function ml(e,n){return e>n}function El(e,n){return null!=e&&ye.call(e,n)}function Sl(e,n){return null!=e&&n in me(e)}function _l(e,n,t){for(var l=t?dn:un,o=e[0].length,i=e.length,a=i,r=q(i),u=Infinity,d=[];a--;){var s=e[a];a&&n&&(s=sn(s,On(n))),u=rt(s.length,u),r[a]=!t&&(n||o>=120&&s.length>=120)?new xt(a&&s):void 0}s=e[0];var c=-1,v=r[0];e:for(;++c<o&&d.length<u;){var p=s[c],m=n?n(p):p;if(p=t||0!==p?p:0,!(v?Ln(v,m):l(d,m,t))){for(a=i;--a;){var E=r[a];if(!(E?Ln(E,m):l(e[a],m,t)))continue e}v&&v.push(m),d.push(p)}}return d}function fl(e,n,t){var l=null==(e=Ei(e,n=ao(n,e)))?e:e[Ii(ki(n))];return null==l?void 0:nn(l,e,t)}function gl(e){return Ya(e)&&pl(e)==i}function Cl(e,n,t,l,o){return e===n||(null==e||null==n||!Ya(e)&&!Ya(n)?e!=e&&n!=n:function(e,n,t,l,o,s){var c=Pa(e),g=Pa(n),y=c?a:ti(e),D=g?a:ti(n),T=(y=y==i?m:y)==m,h=(D=D==i?m:D)==m,A=y==D;if(A&&Fa(e)){if(!Fa(n))return!1;c=!0,T=!1}if(A&&!T)return s||(s=new Bt),c||Qa(e)?Vo(e,n,t,l,o,s):function(e,n,t,l,o,i,a){switch(t){case N:if(e.byteLength!=n.byteLength||e.byteOffset!=n.byteOffset)return!1;e=e.buffer,n=n.buffer;case C:return!(e.byteLength!=n.byteLength||!i(new He(e),new He(n)));case r:case u:case p:return La(+e,+n);case d:return e.name==n.name&&e.message==n.message;case E:case _:return e==n+"";case v:var s=Fn;case S:if(s||(s=Hn),e.size!=n.size&&!(1&l))return!1;var c=a.get(e);if(c)return c==n;l|=2,a.set(e,n);var m=Vo(s(e),s(n),l,o,i,a);return a.delete(e),m;case f:if(At)return At.call(e)==At.call(n)}return!1}(e,n,y,t,l,o,s);if(!(1&t)){var I=T&&ye.call(e,"__wrapped__"),O=h&&ye.call(n,"__wrapped__");if(I||O){var b=I?e.value():e,L=O?n.value():n;return s||(s=new Bt),o(b,L,t,l,s)}}return!!A&&(s||(s=new Bt),function(e,n,t,l,o,i){var a=1&t,r=Yo(e),u=r.length;if(u!=Yo(n).length&&!a)return!1;for(var d=u;d--;){var s=r[d];if(!(a?s in n:ye.call(n,s)))return!1}var c=i.get(e),v=i.get(n);if(c&&v)return c==n&&v==e;var p=!0;i.set(e,n),i.set(n,e);for(var m=a;++d<u;){var E=e[s=r[d]],S=n[s];if(l)var _=a?l(S,E,s,n,e,i):l(E,S,s,e,n,i);if(!(void 0===_?E===S||o(E,S,t,l,i):_)){p=!1;break}m||(m="constructor"==s)}if(p&&!m){var f=e.constructor,g=n.constructor;f==g||!("constructor"in e)||!("constructor"in n)||"function"==typeof f&&f instanceof f&&"function"==typeof g&&g instanceof g||(p=!1)}return i.delete(e),i.delete(n),p}(e,n,t,l,o,s))}(e,n,t,l,Cl,o))}function Nl(e,n,t,l){var o=t.length,i=o,a=!l;if(null==e)return!i;for(e=me(e);o--;){var r=t[o];if(a&&r[2]?r[1]!==e[r[0]]:!(r[0]in e))return!1}for(;++o<i;){var u=(r=t[o])[0],d=e[u],s=r[1];if(a&&r[2]){if(void 0===d&&!(u in e))return!1}else{var c=new Bt;if(l)var v=l(d,s,u,e,n,c);if(!(void 0===v?Cl(s,d,3,l,c):v))return!1}}return!0}function yl(e){return!(!za(e)||(n=e,Te&&Te in n))&&(Ha(e)?Le:oe).test(Oi(e));var n}function Dl(e){return"function"==typeof e?e:null==e?qr:"object"==typeof e?Pa(e)?Ol(e[0],e[1]):Il(e):tu(e)}function Tl(e){if(!ci(e))return it(e);var n=[];for(var t in me(e))ye.call(e,t)&&"constructor"!=t&&n.push(t);return n}function hl(e,n){return e<n}function Al(e,n){var t=-1,l=xa(e)?q(e.length):[];return el(e,function(e,o,i){l[++t]=n(e,o,i)}),l}function Il(e){var n=Jo(e);return 1==n.length&&n[0][2]?pi(n[0][0],n[0][1]):function(t){return t===e||Nl(t,e,n)}}function Ol(e,n){return ui(e)&&vi(n)?pi(Ii(e),n):function(t){var l=Sr(t,e);return void 0===l&&l===n?_r(t,e):Cl(n,l,3)}}function bl(e,n,t,l,o){e!==n&&al(n,function(i,a){if(o||(o=new Bt),za(i))!function(e,n,t,l,o,i,a){var r=_i(e,t),u=_i(n,t),d=a.get(u);if(d)jt(e,t,d);else{var s=i?i(r,u,t+"",e,n,a):void 0,c=void 0===s;if(c){var v=Pa(u),p=!v&&Fa(u),m=!v&&!p&&Qa(u);s=u,v||p||m?Pa(r)?s=r:Ba(r)?s=_o(r):p?(c=!1,s=co(u,!0)):m?(c=!1,s=po(u,!0)):s=[]:Ka(u)||Wa(u)?(s=r,Wa(r)?s=rr(r):za(r)&&!Ha(r)||(s=oi(u))):c=!1}c&&(a.set(u,s),o(s,u,l,i,a),a.delete(u)),jt(e,t,s)}}(e,n,a,t,bl,l,o);else{var r=l?l(_i(e,a),i,a+"",e,n,o):void 0;void 0===r&&(r=i),jt(e,a,r)}},yr)}function Ll(e,n){var t=e.length;if(t)return ai(n+=n<0?t:0,t)?e[n]:void 0}function Rl(e,n,t){n=n.length?sn(n,function(e){return Pa(e)?function(n){return cl(n,1===e.length?e[0]:e)}:e}):[qr];var l=-1;return n=sn(n,On(Zo())),function(e,n){var l=e.length;for(e.sort(function(e,n){return function(e,n,t){for(var l=-1,o=e.criteria,i=n.criteria,a=o.length,r=t.length;++l<a;){var u=mo(o[l],i[l]);if(u)return l>=r?u:u*("desc"==t[l]?-1:1)}return e.index-n.index}(e,n,t)});l--;)e[l]=e[l].value;return e}(Al(e,function(e,t,o){return{criteria:sn(n,function(n){return n(e)}),index:++l,value:e}}))}function wl(e,n,t){for(var l=-1,o=n.length,i={};++l<o;){var a=n[l],r=cl(e,a);t(r,a)&&kl(i,ao(a,e),r)}return i}function Wl(e,n,t,l){var o=l?gn:fn,i=-1,a=n.length,r=e;for(e===n&&(n=_o(n)),t&&(r=sn(e,On(t)));++i<a;)for(var u=0,d=n[i],s=t?t(d):d;(u=o(r,s,u,l))>-1;)r!==e&&Ke.call(r,u,1),Ke.call(e,u,1);return e}function Pl(e,n){for(var t=e?n.length:0,l=t-1;t--;){var o=n[t];if(t==l||o!==i){var i=o;ai(o)?Ke.call(e,o,1):Jl(e,o)}}return e}function Ml(e,n){return e+et(st()*(n-e+1))}function xl(e,n){var t="";if(!e||n<1||n>9007199254740991)return t;do{n%2&&(t+=e),(n=et(n/2))&&(e+=e)}while(n);return t}function Bl(e,n){return Ci(mi(e,n,qr),e+"")}function Fl(e){return Ut(Lr(e))}function Ul(e,n){var t=Lr(e);return Di(t,Xt(n,0,t.length))}function kl(e,n,t,l){if(!za(e))return e;for(var o=-1,i=(n=ao(n,e)).length,a=i-1,r=e;null!=r&&++o<i;){var u=Ii(n[o]),d=t;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(o!=a){var s=r[u];void 0===(d=l?l(s,u,r):void 0)&&(d=za(s)?s:ai(n[o+1])?[]:{})}Vt(r,u,d),r=r[u]}return e}var Hl=ft?function(e,n){return ft.set(e,n),e}:qr,jl=Xn?function(e,n){return Xn(e,"toString",{configurable:!0,enumerable:!1,value:zr(n),writable:!0})}:qr;function Vl(e){return Di(Lr(e))}function zl(e,n,t){var l=-1,o=e.length;n<0&&(n=-n>o?0:o+n),(t=t>o?o:t)<0&&(t+=o),o=n>t?0:t-n>>>0,n>>>=0;for(var i=q(o);++l<o;)i[l]=e[l+n];return i}function Yl(e,n){var t;return el(e,function(e,l,o){return!(t=n(e,l,o))}),!!t}function Gl(e,n,t){var l=0,o=null==e?l:e.length;if("number"==typeof n&&n==n&&o<=2147483647){for(;l<o;){var i=l+o>>>1,a=e[i];null!==a&&!Ja(a)&&(t?a<=n:a<n)?l=i+1:o=i}return o}return ql(e,n,qr,t)}function ql(e,n,t,l){var o=0,i=null==e?0:e.length;if(0===i)return 0;for(var a=(n=t(n))!=n,r=null===n,u=Ja(n),d=void 0===n;o<i;){var s=et((o+i)/2),c=t(e[s]),v=void 0!==c,p=null===c,m=c==c,E=Ja(c);if(a)var S=l||m;else S=d?m&&(l||v):r?m&&v&&(l||!p):u?m&&v&&!p&&(l||!E):!p&&!E&&(l?c<=n:c<n);S?o=s+1:i=s}return rt(i,4294967294)}function Kl(e,n){for(var t=-1,l=e.length,o=0,i=[];++t<l;){var a=e[t],r=n?n(a):a;if(!t||!La(r,u)){var u=r;i[o++]=0===a?0:a}}return i}function Xl(e){return"number"==typeof e?e:Ja(e)?NaN:+e}function Zl(e){if("string"==typeof e)return e;if(Pa(e))return sn(e,Zl)+"";if(Ja(e))return It?It.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n}function $l(e,n,t){var l=-1,o=un,i=e.length,a=!0,r=[],u=r;if(t)a=!1,o=dn;else if(i>=200){var d=n?null:Bo(e);if(d)return Hn(d);a=!1,o=Ln,u=new xt}else u=n?[]:r;e:for(;++l<i;){var s=e[l],c=n?n(s):s;if(s=t||0!==s?s:0,a&&c==c){for(var v=u.length;v--;)if(u[v]===c)continue e;n&&u.push(c),r.push(s)}else o(u,c,t)||(u!==r&&u.push(c),r.push(s))}return r}function Jl(e,n){return null==(e=Ei(e,n=ao(n,e)))||delete e[Ii(ki(n))]}function Ql(e,n,t,l){return kl(e,n,t(cl(e,n)),l)}function eo(e,n,t,l){for(var o=e.length,i=l?o:-1;(l?i--:++i<o)&&n(e[i],i,e););return t?zl(e,l?0:i,l?i+1:o):zl(e,l?i+1:0,l?o:i)}function no(e,n){var t=e;return t instanceof wt&&(t=t.value()),vn(n,function(e,n){return n.func.apply(n.thisArg,cn([e],n.args))},t)}function to(e,n,t){var l=e.length;if(l<2)return l?$l(e[0]):[];for(var o=-1,i=q(l);++o<l;)for(var a=e[o],r=-1;++r<l;)r!=o&&(i[o]=Qt(i[o]||a,e[r],n,t));return $l(il(i,1),n,t)}function lo(e,n,t){for(var l=-1,o=e.length,i=n.length,a={};++l<o;)t(a,e[l],l<i?n[l]:void 0);return a}function oo(e){return Ba(e)?e:[]}function io(e){return"function"==typeof e?e:qr}function ao(e,n){return Pa(e)?e:ui(e,n)?[e]:Ai(ur(e))}var ro=Bl;function uo(e,n,t){var l=e.length;return t=void 0===t?l:t,!n&&t>=l?e:zl(e,n,t)}var so=Zn||function(e){return Ve.clearTimeout(e)};function co(e,n){if(n)return e.slice();var t=e.length,l=je?je(t):new e.constructor(t);return e.copy(l),l}function vo(e){var n=new e.constructor(e.byteLength);return new He(n).set(new He(e)),n}function po(e,n){var t=n?vo(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}function mo(e,n){if(e!==n){var t=void 0!==e,l=null===e,o=e==e,i=Ja(e),a=void 0!==n,r=null===n,u=n==n,d=Ja(n);if(!r&&!d&&!i&&e>n||i&&a&&u&&!r&&!d||l&&a&&u||!t&&u||!o)return 1;if(!l&&!i&&!d&&e<n||d&&t&&o&&!l&&!i||r&&t&&o||!a&&o||!u)return-1}return 0}function Eo(e,n,t,l){for(var o=-1,i=e.length,a=t.length,r=-1,u=n.length,d=at(i-a,0),s=q(u+d),c=!l;++r<u;)s[r]=n[r];for(;++o<a;)(c||o<i)&&(s[t[o]]=e[o]);for(;d--;)s[r++]=e[o++];return s}function So(e,n,t,l){for(var o=-1,i=e.length,a=-1,r=t.length,u=-1,d=n.length,s=at(i-r,0),c=q(s+d),v=!l;++o<s;)c[o]=e[o];for(var p=o;++u<d;)c[p+u]=n[u];for(;++a<r;)(v||o<i)&&(c[p+t[a]]=e[o++]);return c}function _o(e,n){var t=-1,l=e.length;for(n||(n=q(l));++t<l;)n[t]=e[t];return n}function fo(e,n,t,l){var o=!t;t||(t={});for(var i=-1,a=n.length;++i<a;){var r=n[i],u=l?l(t[r],e[r],r,t,e):void 0;void 0===u&&(u=e[r]),o?qt(t,r,u):Vt(t,r,u)}return t}function go(e,n){return function(t,l){var o=Pa(t)?tn:Yt,i=n?n():{};return o(t,e,Zo(l,2),i)}}function Co(e){return Bl(function(n,t){var l=-1,o=t.length,i=o>1?t[o-1]:void 0,a=o>2?t[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,a&&ri(t[0],t[1],a)&&(i=o<3?void 0:i,o=1),n=me(n);++l<o;){var r=t[l];r&&e(n,r,l,i)}return n})}function No(e,n){return function(t,l){if(null==t)return t;if(!xa(t))return e(t,l);for(var o=t.length,i=n?o:-1,a=me(t);(n?i--:++i<o)&&!1!==l(a[i],i,a););return t}}function yo(e){return function(n,t,l){for(var o=-1,i=me(n),a=l(n),r=a.length;r--;){var u=a[e?r:++o];if(!1===t(i[u],u,i))break}return n}}function Do(e){return function(n){var t=Bn(n=ur(n))?zn(n):void 0,l=t?t[0]:n.charAt(0),o=t?uo(t,1).join(""):n.slice(1);return l[e]()+o}}function To(e){return function(n){return vn(Hr(Wr(n).replace(Oe,"")),e,"")}}function ho(e){return function(){var n=arguments;switch(n.length){case 0:return new e;case 1:return new e(n[0]);case 2:return new e(n[0],n[1]);case 3:return new e(n[0],n[1],n[2]);case 4:return new e(n[0],n[1],n[2],n[3]);case 5:return new e(n[0],n[1],n[2],n[3],n[4]);case 6:return new e(n[0],n[1],n[2],n[3],n[4],n[5]);case 7:return new e(n[0],n[1],n[2],n[3],n[4],n[5],n[6])}var t=bt(e.prototype),l=e.apply(t,n);return za(l)?l:t}}function Ao(e){return function(n,t,l){var o=me(n);if(!xa(n)){var i=Zo(t,3);n=Nr(n),t=function(e){return i(o[e],e,o)}}var a=e(n,t,l);return a>-1?o[i?n[a]:a]:void 0}}function Io(e){return zo(function(n){var l=n.length,o=l,i=Rt.prototype.thru;for(e&&n.reverse();o--;){var a=n[o];if("function"!=typeof a)throw new _e(t);if(i&&!r&&"wrapper"==Ko(a))var r=new Rt([],!0)}for(o=r?o:l;++o<l;){var u=Ko(a=n[o]),d="wrapper"==u?qo(a):void 0;r=d&&di(d[0])&&424==d[1]&&!d[4].length&&1==d[9]?r[Ko(d[0])].apply(r,d[3]):1==a.length&&di(a)?r[u]():r.thru(a)}return function(){var e=arguments,t=e[0];if(r&&1==e.length&&Pa(t))return r.plant(t).value();for(var o=0,i=l?n[o].apply(this,e):t;++o<l;)i=n[o].call(this,i);return i}})}function Oo(e,n,t,l,o,i,a,r,u,d){var s=128&n,c=1&n,v=2&n,p=24&n,m=512&n,E=v?void 0:ho(e);return function S(){for(var _=arguments.length,f=q(_),g=_;g--;)f[g]=arguments[g];if(p)var C=Xo(S),N=Wn(f,C);if(l&&(f=Eo(f,l,o,p)),i&&(f=So(f,i,a,p)),_-=N,p&&_<d){var y=kn(f,C);return Mo(e,n,Oo,S.placeholder,t,f,y,r,u,d-_)}var D=c?t:this,T=v?D[e]:e;return _=f.length,r?f=Si(f,r):m&&_>1&&f.reverse(),s&&u<_&&(f.length=u),this&&this!==Ve&&this instanceof S&&(T=E||ho(T)),T.apply(D,f)}}function bo(e,n){return function(t,l){return function(e,n,t,l){return ul(e,function(e,o,i){n(l,t(e),o,i)}),l}(t,e,n(l),{})}}function Lo(e,n){return function(t,l){var o;if(void 0===t&&void 0===l)return n;if(void 0!==t&&(o=t),void 0!==l){if(void 0===o)return l;"string"==typeof t||"string"==typeof l?(t=Zl(t),l=Zl(l)):(t=Xl(t),l=Xl(l)),o=e(t,l)}return o}}function Ro(e){return zo(function(n){return n=sn(n,On(Zo())),Bl(function(t){var l=this;return e(n,function(e){return nn(e,l,t)})})})}function wo(e,n){var t=(n=void 0===n?" ":Zl(n)).length;if(t<2)return t?xl(n,e):n;var l=xl(n,Qn(e/Vn(n)));return Bn(n)?uo(zn(l),0,e).join(""):l.slice(0,e)}function Wo(e){return function(n,t,l){return l&&"number"!=typeof l&&ri(n,t,l)&&(t=l=void 0),n=lr(n),void 0===t?(t=n,n=0):t=lr(t),function(e,n,t,l){for(var o=-1,i=at(Qn((n-e)/(t||1)),0),a=q(i);i--;)a[l?i:++o]=e,e+=t;return a}(n,t,l=void 0===l?n<t?1:-1:lr(l),e)}}function Po(e){return function(n,t){return"string"==typeof n&&"string"==typeof t||(n=ar(n),t=ar(t)),e(n,t)}}function Mo(e,n,t,l,o,i,a,r,u,d){var s=8&n;n|=s?32:64,4&(n&=~(s?64:32))||(n&=-4);var c=[e,n,o,s?i:void 0,s?a:void 0,s?void 0:i,s?void 0:a,r,u,d],v=t.apply(void 0,c);return di(e)&&fi(v,c),v.placeholder=l,Ni(v,e,n)}function xo(e){var n=pe[e];return function(e,t){if(e=ar(e),(t=null==t?0:rt(or(t),292))&<(e)){var l=(ur(e)+"e").split("e");return+((l=(ur(n(l[0]+"e"+(+l[1]+t)))+"e").split("e"))[0]+"e"+(+l[1]-t))}return n(e)}}var Bo=Et&&1/Hn(new Et([,-0]))[1]==1/0?function(e){return new Et(e)}:Jr;function Fo(e){return function(n){var t=ti(n);return t==v?Fn(n):t==S?jn(n):function(e,n){return sn(n,function(n){return[n,e[n]]})}(n,e(n))}}function Uo(e,n,o,i,a,r,u,d){var s=2&n;if(!s&&"function"!=typeof e)throw new _e(t);var c=i?i.length:0;if(c||(n&=-97,i=a=void 0),u=void 0===u?u:at(or(u),0),d=void 0===d?d:or(d),c-=a?a.length:0,64&n){var v=i,p=a;i=a=void 0}var m=s?void 0:qo(e),E=[e,n,o,i,a,v,p,r,u,d];if(m&&function(e,n){var t=e[1],o=n[1],i=t|o;if(!(i<131||128==o&&8==t||128==o&&256==t&&e[7].length<=n[8]||384==o&&n[7].length<=n[8]&&8==t))return e;1&o&&(e[2]=n[2],i|=1&t?0:4);var a=n[3];if(a){var r=e[3];e[3]=r?Eo(r,a,n[4]):a,e[4]=r?kn(e[3],l):n[4]}(a=n[5])&&(e[5]=(r=e[5])?So(r,a,n[6]):a,e[6]=r?kn(e[5],l):n[6]),(a=n[7])&&(e[7]=a),128&o&&(e[8]=null==e[8]?n[8]:rt(e[8],n[8])),null==e[9]&&(e[9]=n[9]),e[0]=n[0],e[1]=i}(E,m),e=E[0],n=E[1],o=E[2],i=E[3],a=E[4],!(d=E[9]=void 0===E[9]?s?0:e.length:at(E[9]-c,0))&&24&n&&(n&=-25),n&&1!=n)S=8==n||16==n?function(e,n,t){var l=ho(e);return function o(){for(var i=arguments.length,a=q(i),r=i,u=Xo(o);r--;)a[r]=arguments[r];var d=i<3&&a[0]!==u&&a[i-1]!==u?[]:kn(a,u);if((i-=d.length)<t)return Mo(e,n,Oo,o.placeholder,void 0,a,d,void 0,void 0,t-i);var s=this&&this!==Ve&&this instanceof o?l:e;return nn(s,this,a)}}(e,n,d):32!=n&&33!=n||a.length?Oo.apply(void 0,E):function(e,n,t,l){var o=1&n,i=ho(e);return function n(){for(var a=-1,r=arguments.length,u=-1,d=l.length,s=q(d+r),c=this&&this!==Ve&&this instanceof n?i:e;++u<d;)s[u]=l[u];for(;r--;)s[u++]=arguments[++a];return nn(c,o?t:this,s)}}(e,n,o,i);else var S=function(e,n,t){var l=1&n,o=ho(e);return function n(){var i=this&&this!==Ve&&this instanceof n?o:e;return i.apply(l?t:this,arguments)}}(e,n,o);return Ni((m?Hl:fi)(S,E),e,n)}function ko(e,n,t,l){return void 0===e||La(e,ge[t])&&!ye.call(l,t)?n:e}function Ho(e,n,t,l,o,i){return za(e)&&za(n)&&(i.set(n,e),bl(e,n,void 0,Ho,i),i.delete(n)),e}function jo(e){return Ka(e)?void 0:e}function Vo(e,n,t,l,o,i){var a=1&t,r=e.length,u=n.length;if(r!=u&&!(a&&u>r))return!1;var d=i.get(e),s=i.get(n);if(d&&s)return d==n&&s==e;var c=-1,v=!0,p=2&t?new xt:void 0;for(i.set(e,n),i.set(n,e);++c<r;){var m=e[c],E=n[c];if(l)var S=a?l(E,m,c,n,e,i):l(m,E,c,e,n,i);if(void 0!==S){if(S)continue;v=!1;break}if(p){if(!mn(n,function(e,n){if(!Ln(p,n)&&(m===e||o(m,e,t,l,i)))return p.push(n)})){v=!1;break}}else if(m!==E&&!o(m,E,t,l,i)){v=!1;break}}return i.delete(e),i.delete(n),v}function zo(e){return Ci(mi(e,void 0,Mi),e+"")}function Yo(e){return vl(e,Nr,ei)}function Go(e){return vl(e,yr,ni)}var qo=ft?function(e){return ft.get(e)}:Jr;function Ko(e){for(var n=e.name+"",t=gt[n],l=ye.call(gt,n)?t.length:0;l--;){var o=t[l],i=o.func;if(null==i||i==e)return o.name}return n}function Xo(e){return(ye.call(Ot,"placeholder")?Ot:e).placeholder}function Zo(){var e=Ot.iteratee||Kr;return e=e===Kr?Dl:e,arguments.length?e(arguments[0],arguments[1]):e}function $o(e,n){var t,l,o=e.__data__;return("string"==(l=typeof(t=n))||"number"==l||"symbol"==l||"boolean"==l?"__proto__"!==t:null===t)?o["string"==typeof n?"string":"hash"]:o.map}function Jo(e){for(var n=Nr(e),t=n.length;t--;){var l=n[t],o=e[l];n[t]=[l,o,vi(o)]}return n}function Qo(e,n){var t=function(e,n){return null==e?void 0:e[n]}(e,n);return yl(t)?t:void 0}var ei=nt?function(e){return null==e?[]:(e=me(e),rn(nt(e),function(n){return qe.call(e,n)}))}:iu,ni=nt?function(e){for(var n=[];e;)cn(n,ei(e)),e=ze(e);return n}:iu,ti=pl;function li(e,n,t){for(var l=-1,o=(n=ao(n,e)).length,i=!1;++l<o;){var a=Ii(n[l]);if(!(i=null!=e&&t(e,a)))break;e=e[a]}return i||++l!=o?i:!!(o=null==e?0:e.length)&&Va(o)&&ai(a,o)&&(Pa(e)||Wa(e))}function oi(e){return"function"!=typeof e.constructor||ci(e)?{}:bt(ze(e))}function ii(e){return Pa(e)||Wa(e)||!!(En&&e&&e[En])}function ai(e,n){var t=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==t||"symbol"!=t&&ae.test(e))&&e>-1&&e%1==0&&e<n}function ri(e,n,t){if(!za(t))return!1;var l=typeof n;return!!("number"==l?xa(t)&&ai(n,t.length):"string"==l&&n in t)&&La(t[n],e)}function ui(e,n){if(Pa(e))return!1;var t=typeof e;return!("number"!=t&&"symbol"!=t&&"boolean"!=t&&null!=e&&!Ja(e))||j.test(e)||!H.test(e)||null!=n&&e in me(n)}function di(e){var n=Ko(e),t=Ot[n];if("function"!=typeof t||!(n in wt.prototype))return!1;if(e===t)return!0;var l=qo(t);return!!l&&e===l[0]}(vt&&ti(new vt(new ArrayBuffer(1)))!=N||pt&&ti(new pt)!=v||mt&&"[object Promise]"!=ti(mt.resolve())||Et&&ti(new Et)!=S||St&&ti(new St)!=g)&&(ti=function(e){var n=pl(e),t=n==m?e.constructor:void 0,l=t?Oi(t):"";if(l)switch(l){case Ct:return N;case Nt:return v;case yt:return"[object Promise]";case Dt:return S;case Tt:return g}return n});var si=Ce?Ha:au;function ci(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||ge)}function vi(e){return e==e&&!za(e)}function pi(e,n){return function(t){return null!=t&&t[e]===n&&(void 0!==n||e in me(t))}}function mi(e,n,t){return n=at(void 0===n?e.length-1:n,0),function(){for(var l=arguments,o=-1,i=at(l.length-n,0),a=q(i);++o<i;)a[o]=l[n+o];o=-1;for(var r=q(n+1);++o<n;)r[o]=l[o];return r[n]=t(a),nn(e,this,r)}}function Ei(e,n){return n.length<2?e:cl(e,zl(n,0,-1))}function Si(e,n){for(var t=e.length,l=rt(n.length,t),o=_o(e);l--;){var i=n[l];e[l]=ai(i,t)?o[i]:void 0}return e}function _i(e,n){if(("constructor"!==n||"function"!=typeof e[n])&&"__proto__"!=n)return e[n]}var fi=yi(Hl),gi=Jn||function(e,n){return Ve.setTimeout(e,n)},Ci=yi(jl);function Ni(e,n,t){var l=n+"";return Ci(e,function(e,n){var t=n.length;if(!t)return e;var l=t-1;return n[l]=(t>1?"& ":"")+n[l],n=n.join(t>2?", ":" "),e.replace(K,"{\n/* [wrapped with "+n+"] */\n")}(l,function(e,n){return ln(o,function(t){var l="_."+t[0];n&t[1]&&!un(e,l)&&e.push(l)}),e.sort()}(function(e){var n=e.match(X);return n?n[1].split(Z):[]}(l),t)))}function yi(e){var n=0,t=0;return function(){var l=ut(),o=16-(l-t);if(t=l,o>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}function Di(e,n){var t=-1,l=e.length,o=l-1;for(n=void 0===n?l:n;++t<n;){var i=Ml(t,o),a=e[i];e[i]=e[t],e[t]=a}return e.length=n,e}var Ti,hi,Ai=(Ti=Ta(function(e){var n=[];return 46===e.charCodeAt(0)&&n.push(""),e.replace(V,function(e,t,l,o){n.push(l?o.replace(Q,"$1"):t||e)}),n},function(e){return 500===hi.size&&hi.clear(),e}),hi=Ti.cache,Ti);function Ii(e){if("string"==typeof e||Ja(e))return e;var n=e+"";return"0"==n&&1/e==-1/0?"-0":n}function Oi(e){if(null!=e){try{return Ne.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function bi(e){if(e instanceof wt)return e.clone();var n=new Rt(e.__wrapped__,e.__chain__);return n.__actions__=_o(e.__actions__),n.__index__=e.__index__,n.__values__=e.__values__,n}var Li=Bl(function(e,n){return Ba(e)?Qt(e,il(n,1,Ba,!0)):[]}),Ri=Bl(function(e,n){var t=ki(n);return Ba(t)&&(t=void 0),Ba(e)?Qt(e,il(n,1,Ba,!0),Zo(t,2)):[]}),wi=Bl(function(e,n){var t=ki(n);return Ba(t)&&(t=void 0),Ba(e)?Qt(e,il(n,1,Ba,!0),void 0,t):[]});function Wi(e,n,t){var l=null==e?0:e.length;if(!l)return-1;var o=null==t?0:or(t);return o<0&&(o=at(l+o,0)),_n(e,Zo(n,3),o)}function Pi(e,n,t){var l=null==e?0:e.length;if(!l)return-1;var o=l-1;return void 0!==t&&(o=or(t),o=t<0?at(l+o,0):rt(o,l-1)),_n(e,Zo(n,3),o,!0)}function Mi(e){return null!=e&&e.length?il(e,1):[]}function xi(e){return e&&e.length?e[0]:void 0}var Bi=Bl(function(e){var n=sn(e,oo);return n.length&&n[0]===e[0]?_l(n):[]}),Fi=Bl(function(e){var n=ki(e),t=sn(e,oo);return n===ki(t)?n=void 0:t.pop(),t.length&&t[0]===e[0]?_l(t,Zo(n,2)):[]}),Ui=Bl(function(e){var n=ki(e),t=sn(e,oo);return(n="function"==typeof n?n:void 0)&&t.pop(),t.length&&t[0]===e[0]?_l(t,void 0,n):[]});function ki(e){var n=null==e?0:e.length;return n?e[n-1]:void 0}var Hi=Bl(ji);function ji(e,n){return e&&e.length&&n&&n.length?Wl(e,n):e}var Vi=zo(function(e,n){var t=null==e?0:e.length,l=Kt(e,n);return Pl(e,sn(n,function(e){return ai(e,t)?+e:e}).sort(mo)),l});function zi(e){return null==e?e:ct.call(e)}var Yi=Bl(function(e){return $l(il(e,1,Ba,!0))}),Gi=Bl(function(e){var n=ki(e);return Ba(n)&&(n=void 0),$l(il(e,1,Ba,!0),Zo(n,2))}),qi=Bl(function(e){var n=ki(e);return n="function"==typeof n?n:void 0,$l(il(e,1,Ba,!0),void 0,n)});function Ki(e){if(!e||!e.length)return[];var n=0;return e=rn(e,function(e){if(Ba(e))return n=at(e.length,n),!0}),An(n,function(n){return sn(e,yn(n))})}function Xi(e,n){if(!e||!e.length)return[];var t=Ki(e);return null==n?t:sn(t,function(e){return nn(n,void 0,e)})}var Zi=Bl(function(e,n){return Ba(e)?Qt(e,n):[]}),$i=Bl(function(e){return to(rn(e,Ba))}),Ji=Bl(function(e){var n=ki(e);return Ba(n)&&(n=void 0),to(rn(e,Ba),Zo(n,2))}),Qi=Bl(function(e){var n=ki(e);return n="function"==typeof n?n:void 0,to(rn(e,Ba),void 0,n)}),ea=Bl(Ki),na=Bl(function(e){var n=e.length,t=n>1?e[n-1]:void 0;return t="function"==typeof t?(e.pop(),t):void 0,Xi(e,t)});function ta(e){var n=Ot(e);return n.__chain__=!0,n}function la(e,n){return n(e)}var oa=zo(function(e){var n=e.length,t=n?e[0]:0,l=this.__wrapped__,o=function(n){return Kt(n,e)};return!(n>1||this.__actions__.length)&&l instanceof wt&&ai(t)?((l=l.slice(t,+t+(n?1:0))).__actions__.push({func:la,args:[o],thisArg:void 0}),new Rt(l,this.__chain__).thru(function(e){return n&&!e.length&&e.push(void 0),e})):this.thru(o)}),ia=go(function(e,n,t){ye.call(e,t)?++e[t]:qt(e,t,1)}),aa=Ao(Wi),ra=Ao(Pi);function ua(e,n){return(Pa(e)?ln:el)(e,Zo(n,3))}function da(e,n){return(Pa(e)?on:nl)(e,Zo(n,3))}var sa=go(function(e,n,t){ye.call(e,t)?e[t].push(n):qt(e,t,[n])}),ca=Bl(function(e,n,t){var l=-1,o="function"==typeof n,i=xa(e)?q(e.length):[];return el(e,function(e){i[++l]=o?nn(n,e,t):fl(e,n,t)}),i}),va=go(function(e,n,t){qt(e,t,n)});function pa(e,n){return(Pa(e)?sn:Al)(e,Zo(n,3))}var ma=go(function(e,n,t){e[t?0:1].push(n)},function(){return[[],[]]}),Ea=Bl(function(e,n){if(null==e)return[];var t=n.length;return t>1&&ri(e,n[0],n[1])?n=[]:t>2&&ri(n[0],n[1],n[2])&&(n=[n[0]]),Rl(e,il(n,1),[])}),Sa=$n||function(){return Ve.Date.now()};function _a(e,n,t){return n=t?void 0:n,Uo(e,128,void 0,void 0,void 0,void 0,n=e&&null==n?e.length:n)}function fa(e,n){var l;if("function"!=typeof n)throw new _e(t);return e=or(e),function(){return--e>0&&(l=n.apply(this,arguments)),e<=1&&(n=void 0),l}}var ga=Bl(function(e,n,t){var l=1;if(t.length){var o=kn(t,Xo(ga));l|=32}return Uo(e,l,n,t,o)}),Ca=Bl(function(e,n,t){var l=3;if(t.length){var o=kn(t,Xo(Ca));l|=32}return Uo(n,l,e,t,o)});function Na(e,n,l){var o,i,a,r,u,d,s=0,c=!1,v=!1,p=!0;if("function"!=typeof e)throw new _e(t);function m(n){var t=o,l=i;return o=i=void 0,s=n,r=e.apply(l,t)}function E(e){return s=e,u=gi(_,n),c?m(e):r}function S(e){var t=e-d;return void 0===d||t>=n||t<0||v&&e-s>=a}function _(){var e=Sa();if(S(e))return f(e);u=gi(_,function(e){var t=n-(e-d);return v?rt(t,a-(e-s)):t}(e))}function f(e){return u=void 0,p&&o?m(e):(o=i=void 0,r)}function g(){var e=Sa(),t=S(e);if(o=arguments,i=this,d=e,t){if(void 0===u)return E(d);if(v)return so(u),u=gi(_,n),m(d)}return void 0===u&&(u=gi(_,n)),r}return n=ar(n)||0,za(l)&&(c=!!l.leading,a=(v="maxWait"in l)?at(ar(l.maxWait)||0,n):a,p="trailing"in l?!!l.trailing:p),g.cancel=function(){void 0!==u&&so(u),s=0,o=d=i=u=void 0},g.flush=function(){return void 0===u?r:f(Sa())},g}var ya=Bl(function(e,n){return Jt(e,1,n)}),Da=Bl(function(e,n,t){return Jt(e,ar(n)||0,t)});function Ta(e,n){if("function"!=typeof e||null!=n&&"function"!=typeof n)throw new _e(t);var l=function(){var t=arguments,o=n?n.apply(this,t):t[0],i=l.cache;if(i.has(o))return i.get(o);var a=e.apply(this,t);return l.cache=i.set(o,a)||i,a};return l.cache=new(Ta.Cache||Mt),l}function ha(e){if("function"!=typeof e)throw new _e(t);return function(){var n=arguments;switch(n.length){case 0:return!e.call(this);case 1:return!e.call(this,n[0]);case 2:return!e.call(this,n[0],n[1]);case 3:return!e.call(this,n[0],n[1],n[2])}return!e.apply(this,n)}}Ta.Cache=Mt;var Aa=ro(function(e,n){var t=(n=1==n.length&&Pa(n[0])?sn(n[0],On(Zo())):sn(il(n,1),On(Zo()))).length;return Bl(function(l){for(var o=-1,i=rt(l.length,t);++o<i;)l[o]=n[o].call(this,l[o]);return nn(e,this,l)})}),Ia=Bl(function(e,n){return Uo(e,32,void 0,n,kn(n,Xo(Ia)))}),Oa=Bl(function(e,n){return Uo(e,64,void 0,n,kn(n,Xo(Oa)))}),ba=zo(function(e,n){return Uo(e,256,void 0,void 0,void 0,n)});function La(e,n){return e===n||e!=e&&n!=n}var Ra=Po(ml),wa=Po(function(e,n){return e>=n}),Wa=gl(function(){return arguments}())?gl:function(e){return Ya(e)&&ye.call(e,"callee")&&!qe.call(e,"callee")},Pa=q.isArray,Ma=Xe?On(Xe):function(e){return Ya(e)&&pl(e)==C};function xa(e){return null!=e&&Va(e.length)&&!Ha(e)}function Ba(e){return Ya(e)&&xa(e)}var Fa=tt||au,Ua=Ze?On(Ze):function(e){return Ya(e)&&pl(e)==u};function ka(e){if(!Ya(e))return!1;var n=pl(e);return n==d||"[object DOMException]"==n||"string"==typeof e.message&&"string"==typeof e.name&&!Ka(e)}function Ha(e){if(!za(e))return!1;var n=pl(e);return n==s||n==c||"[object AsyncFunction]"==n||"[object Proxy]"==n}function ja(e){return"number"==typeof e&&e==or(e)}function Va(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function za(e){var n=typeof e;return null!=e&&("object"==n||"function"==n)}function Ya(e){return null!=e&&"object"==typeof e}var Ga=$e?On($e):function(e){return Ya(e)&&ti(e)==v};function qa(e){return"number"==typeof e||Ya(e)&&pl(e)==p}function Ka(e){if(!Ya(e)||pl(e)!=m)return!1;var n=ze(e);if(null===n)return!0;var t=ye.call(n,"constructor")&&n.constructor;return"function"==typeof t&&t instanceof t&&Ne.call(t)==Ae}var Xa=Je?On(Je):function(e){return Ya(e)&&pl(e)==E},Za=Qe?On(Qe):function(e){return Ya(e)&&ti(e)==S};function $a(e){return"string"==typeof e||!Pa(e)&&Ya(e)&&pl(e)==_}function Ja(e){return"symbol"==typeof e||Ya(e)&&pl(e)==f}var Qa=en?On(en):function(e){return Ya(e)&&Va(e.length)&&!!xe[pl(e)]},er=Po(hl),nr=Po(function(e,n){return e<=n});function tr(e){if(!e)return[];if(xa(e))return $a(e)?zn(e):_o(e);if(Dn&&e[Dn])return function(e){for(var n,t=[];!(n=e.next()).done;)t.push(n.value);return t}(e[Dn]());var n=ti(e);return(n==v?Fn:n==S?Hn:Lr)(e)}function lr(e){return e?(e=ar(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function or(e){var n=lr(e),t=n%1;return n==n?t?n-t:n:0}function ir(e){return e?Xt(or(e),0,4294967295):0}function ar(e){if("number"==typeof e)return e;if(Ja(e))return NaN;if(za(e)){var n="function"==typeof e.valueOf?e.valueOf():e;e=za(n)?n+"":n}if("string"!=typeof e)return 0===e?e:+e;e=In(e);var t=le.test(e);return t||ie.test(e)?ke(e.slice(2),t?2:8):te.test(e)?NaN:+e}function rr(e){return fo(e,yr(e))}function ur(e){return null==e?"":Zl(e)}var dr=Co(function(e,n){if(ci(n)||xa(n))fo(n,Nr(n),e);else for(var t in n)ye.call(n,t)&&Vt(e,t,n[t])}),sr=Co(function(e,n){fo(n,yr(n),e)}),cr=Co(function(e,n,t,l){fo(n,yr(n),e,l)}),vr=Co(function(e,n,t,l){fo(n,Nr(n),e,l)}),pr=zo(Kt),mr=Bl(function(e,n){e=me(e);var t=-1,l=n.length,o=l>2?n[2]:void 0;for(o&&ri(n[0],n[1],o)&&(l=1);++t<l;)for(var i=n[t],a=yr(i),r=-1,u=a.length;++r<u;){var d=a[r],s=e[d];(void 0===s||La(s,ge[d])&&!ye.call(e,d))&&(e[d]=i[d])}return e}),Er=Bl(function(e){return e.push(void 0,Ho),nn(Tr,void 0,e)});function Sr(e,n,t){var l=null==e?void 0:cl(e,n);return void 0===l?t:l}function _r(e,n){return null!=e&&li(e,n,Sl)}var fr=bo(function(e,n,t){null!=n&&"function"!=typeof n.toString&&(n=he.call(n)),e[n]=t},zr(qr)),gr=bo(function(e,n,t){null!=n&&"function"!=typeof n.toString&&(n=he.call(n)),ye.call(e,n)?e[n].push(t):e[n]=[t]},Zo),Cr=Bl(fl);function Nr(e){return xa(e)?Ft(e):Tl(e)}function yr(e){return xa(e)?Ft(e,!0):function(e){if(!za(e))return function(e){var n=[];if(null!=e)for(var t in me(e))n.push(t);return n}(e);var n=ci(e),t=[];for(var l in e)("constructor"!=l||!n&&ye.call(e,l))&&t.push(l);return t}(e)}var Dr=Co(function(e,n,t){bl(e,n,t)}),Tr=Co(function(e,n,t,l){bl(e,n,t,l)}),hr=zo(function(e,n){var t={};if(null==e)return t;var l=!1;n=sn(n,function(n){return n=ao(n,e),l||(l=n.length>1),n}),fo(e,Go(e),t),l&&(t=Zt(t,7,jo));for(var o=n.length;o--;)Jl(t,n[o]);return t}),Ar=zo(function(e,n){return null==e?{}:function(e,n){return wl(e,n,function(n,t){return _r(e,t)})}(e,n)});function Ir(e,n){if(null==e)return{};var t=sn(Go(e),function(e){return[e]});return n=Zo(n),wl(e,t,function(e,t){return n(e,t[0])})}var Or=Fo(Nr),br=Fo(yr);function Lr(e){return null==e?[]:bn(e,Nr(e))}var Rr=To(function(e,n,t){return n=n.toLowerCase(),e+(t?wr(n):n)});function wr(e){return kr(ur(e).toLowerCase())}function Wr(e){return(e=ur(e))&&e.replace(re,Pn).replace(be,"")}var Pr=To(function(e,n,t){return e+(t?"-":"")+n.toLowerCase()}),Mr=To(function(e,n,t){return e+(t?" ":"")+n.toLowerCase()}),xr=Do("toLowerCase"),Br=To(function(e,n,t){return e+(t?"_":"")+n.toLowerCase()}),Fr=To(function(e,n,t){return e+(t?" ":"")+kr(n)}),Ur=To(function(e,n,t){return e+(t?" ":"")+n.toUpperCase()}),kr=Do("toUpperCase");function Hr(e,n,t){return e=ur(e),void 0===(n=t?void 0:n)?function(e){return We.test(e)}(e)?function(e){return e.match(Re)||[]}(e):function(e){return e.match($)||[]}(e):e.match(n)||[]}var jr=Bl(function(e,n){try{return nn(e,void 0,n)}catch(e){return ka(e)?e:new ce(e)}}),Vr=zo(function(e,n){return ln(n,function(n){n=Ii(n),qt(e,n,ga(e[n],e))}),e});function zr(e){return function(){return e}}var Yr=Io(),Gr=Io(!0);function qr(e){return e}function Kr(e){return Dl("function"==typeof e?e:Zt(e,1))}var Xr=Bl(function(e,n){return function(t){return fl(t,e,n)}}),Zr=Bl(function(e,n){return function(t){return fl(e,t,n)}});function $r(e,n,t){var l=Nr(n),o=sl(n,l);null!=t||za(n)&&(o.length||!l.length)||(t=n,n=e,e=this,o=sl(n,Nr(n)));var i=!(za(t)&&"chain"in t&&!t.chain),a=Ha(e);return ln(o,function(t){var l=n[t];e[t]=l,a&&(e.prototype[t]=function(){var n=this.__chain__;if(i||n){var t=e(this.__wrapped__),o=t.__actions__=_o(this.__actions__);return o.push({func:l,args:arguments,thisArg:e}),t.__chain__=n,t}return l.apply(e,cn([this.value()],arguments))})}),e}function Jr(){}var Qr=Ro(sn),eu=Ro(an),nu=Ro(mn);function tu(e){return ui(e)?yn(Ii(e)):function(e){return function(n){return cl(n,e)}}(e)}var lu=Wo(),ou=Wo(!0);function iu(){return[]}function au(){return!1}var ru,uu=Lo(function(e,n){return e+n},0),du=xo("ceil"),su=Lo(function(e,n){return e/n},1),cu=xo("floor"),vu=Lo(function(e,n){return e*n},1),pu=xo("round"),mu=Lo(function(e,n){return e-n},0);return Ot.after=function(e,n){if("function"!=typeof n)throw new _e(t);return e=or(e),function(){if(--e<1)return n.apply(this,arguments)}},Ot.ary=_a,Ot.assign=dr,Ot.assignIn=sr,Ot.assignInWith=cr,Ot.assignWith=vr,Ot.at=pr,Ot.before=fa,Ot.bind=ga,Ot.bindAll=Vr,Ot.bindKey=Ca,Ot.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Pa(e)?e:[e]},Ot.chain=ta,Ot.chunk=function(e,n,t){n=(t?ri(e,n,t):void 0===n)?1:at(or(n),0);var l=null==e?0:e.length;if(!l||n<1)return[];for(var o=0,i=0,a=q(Qn(l/n));o<l;)a[i++]=zl(e,o,o+=n);return a},Ot.compact=function(e){for(var n=-1,t=null==e?0:e.length,l=0,o=[];++n<t;){var i=e[n];i&&(o[l++]=i)}return o},Ot.concat=function(){var e=arguments.length;if(!e)return[];for(var n=q(e-1),t=arguments[0],l=e;l--;)n[l-1]=arguments[l];return cn(Pa(t)?_o(t):[t],il(n,1))},Ot.cond=function(e){var n=null==e?0:e.length,l=Zo();return e=n?sn(e,function(e){if("function"!=typeof e[1])throw new _e(t);return[l(e[0]),e[1]]}):[],Bl(function(t){for(var l=-1;++l<n;){var o=e[l];if(nn(o[0],this,t))return nn(o[1],this,t)}})},Ot.conforms=function(e){return function(e){var n=Nr(e);return function(t){return $t(t,e,n)}}(Zt(e,1))},Ot.constant=zr,Ot.countBy=ia,Ot.create=function(e,n){var t=bt(e);return null==n?t:Gt(t,n)},Ot.curry=function e(n,t,l){var o=Uo(n,8,void 0,void 0,void 0,void 0,void 0,t=l?void 0:t);return o.placeholder=e.placeholder,o},Ot.curryRight=function e(n,t,l){var o=Uo(n,16,void 0,void 0,void 0,void 0,void 0,t=l?void 0:t);return o.placeholder=e.placeholder,o},Ot.debounce=Na,Ot.defaults=mr,Ot.defaultsDeep=Er,Ot.defer=ya,Ot.delay=Da,Ot.difference=Li,Ot.differenceBy=Ri,Ot.differenceWith=wi,Ot.drop=function(e,n,t){var l=null==e?0:e.length;return l?zl(e,(n=t||void 0===n?1:or(n))<0?0:n,l):[]},Ot.dropRight=function(e,n,t){var l=null==e?0:e.length;return l?zl(e,0,(n=l-(n=t||void 0===n?1:or(n)))<0?0:n):[]},Ot.dropRightWhile=function(e,n){return e&&e.length?eo(e,Zo(n,3),!0,!0):[]},Ot.dropWhile=function(e,n){return e&&e.length?eo(e,Zo(n,3),!0):[]},Ot.fill=function(e,n,t,l){var o=null==e?0:e.length;return o?(t&&"number"!=typeof t&&ri(e,n,t)&&(t=0,l=o),function(e,n,t,l){var o=e.length;for((t=or(t))<0&&(t=-t>o?0:o+t),(l=void 0===l||l>o?o:or(l))<0&&(l+=o),l=t>l?0:ir(l);t<l;)e[t++]=n;return e}(e,n,t,l)):[]},Ot.filter=function(e,n){return(Pa(e)?rn:ol)(e,Zo(n,3))},Ot.flatMap=function(e,n){return il(pa(e,n),1)},Ot.flatMapDeep=function(e,n){return il(pa(e,n),1/0)},Ot.flatMapDepth=function(e,n,t){return t=void 0===t?1:or(t),il(pa(e,n),t)},Ot.flatten=Mi,Ot.flattenDeep=function(e){return null!=e&&e.length?il(e,1/0):[]},Ot.flattenDepth=function(e,n){return null!=e&&e.length?il(e,n=void 0===n?1:or(n)):[]},Ot.flip=function(e){return Uo(e,512)},Ot.flow=Yr,Ot.flowRight=Gr,Ot.fromPairs=function(e){for(var n=-1,t=null==e?0:e.length,l={};++n<t;){var o=e[n];l[o[0]]=o[1]}return l},Ot.functions=function(e){return null==e?[]:sl(e,Nr(e))},Ot.functionsIn=function(e){return null==e?[]:sl(e,yr(e))},Ot.groupBy=sa,Ot.initial=function(e){return null!=e&&e.length?zl(e,0,-1):[]},Ot.intersection=Bi,Ot.intersectionBy=Fi,Ot.intersectionWith=Ui,Ot.invert=fr,Ot.invertBy=gr,Ot.invokeMap=ca,Ot.iteratee=Kr,Ot.keyBy=va,Ot.keys=Nr,Ot.keysIn=yr,Ot.map=pa,Ot.mapKeys=function(e,n){var t={};return n=Zo(n,3),ul(e,function(e,l,o){qt(t,n(e,l,o),e)}),t},Ot.mapValues=function(e,n){var t={};return n=Zo(n,3),ul(e,function(e,l,o){qt(t,l,n(e,l,o))}),t},Ot.matches=function(e){return Il(Zt(e,1))},Ot.matchesProperty=function(e,n){return Ol(e,Zt(n,1))},Ot.memoize=Ta,Ot.merge=Dr,Ot.mergeWith=Tr,Ot.method=Xr,Ot.methodOf=Zr,Ot.mixin=$r,Ot.negate=ha,Ot.nthArg=function(e){return e=or(e),Bl(function(n){return Ll(n,e)})},Ot.omit=hr,Ot.omitBy=function(e,n){return Ir(e,ha(Zo(n)))},Ot.once=function(e){return fa(2,e)},Ot.orderBy=function(e,n,t,l){return null==e?[]:(Pa(n)||(n=null==n?[]:[n]),Pa(t=l?void 0:t)||(t=null==t?[]:[t]),Rl(e,n,t))},Ot.over=Qr,Ot.overArgs=Aa,Ot.overEvery=eu,Ot.overSome=nu,Ot.partial=Ia,Ot.partialRight=Oa,Ot.partition=ma,Ot.pick=Ar,Ot.pickBy=Ir,Ot.property=tu,Ot.propertyOf=function(e){return function(n){return null==e?void 0:cl(e,n)}},Ot.pull=Hi,Ot.pullAll=ji,Ot.pullAllBy=function(e,n,t){return e&&e.length&&n&&n.length?Wl(e,n,Zo(t,2)):e},Ot.pullAllWith=function(e,n,t){return e&&e.length&&n&&n.length?Wl(e,n,void 0,t):e},Ot.pullAt=Vi,Ot.range=lu,Ot.rangeRight=ou,Ot.rearg=ba,Ot.reject=function(e,n){return(Pa(e)?rn:ol)(e,ha(Zo(n,3)))},Ot.remove=function(e,n){var t=[];if(!e||!e.length)return t;var l=-1,o=[],i=e.length;for(n=Zo(n,3);++l<i;){var a=e[l];n(a,l,e)&&(t.push(a),o.push(l))}return Pl(e,o),t},Ot.rest=function(e,n){if("function"!=typeof e)throw new _e(t);return Bl(e,n=void 0===n?n:or(n))},Ot.reverse=zi,Ot.sampleSize=function(e,n,t){return n=(t?ri(e,n,t):void 0===n)?1:or(n),(Pa(e)?kt:Ul)(e,n)},Ot.set=function(e,n,t){return null==e?e:kl(e,n,t)},Ot.setWith=function(e,n,t,l){return l="function"==typeof l?l:void 0,null==e?e:kl(e,n,t,l)},Ot.shuffle=function(e){return(Pa(e)?Ht:Vl)(e)},Ot.slice=function(e,n,t){var l=null==e?0:e.length;return l?(t&&"number"!=typeof t&&ri(e,n,t)?(n=0,t=l):(n=null==n?0:or(n),t=void 0===t?l:or(t)),zl(e,n,t)):[]},Ot.sortBy=Ea,Ot.sortedUniq=function(e){return e&&e.length?Kl(e):[]},Ot.sortedUniqBy=function(e,n){return e&&e.length?Kl(e,Zo(n,2)):[]},Ot.split=function(e,n,t){return t&&"number"!=typeof t&&ri(e,n,t)&&(n=t=void 0),(t=void 0===t?4294967295:t>>>0)?(e=ur(e))&&("string"==typeof n||null!=n&&!Xa(n))&&!(n=Zl(n))&&Bn(e)?uo(zn(e),0,t):e.split(n,t):[]},Ot.spread=function(e,n){if("function"!=typeof e)throw new _e(t);return n=null==n?0:at(or(n),0),Bl(function(t){var l=t[n],o=uo(t,0,n);return l&&cn(o,l),nn(e,this,o)})},Ot.tail=function(e){var n=null==e?0:e.length;return n?zl(e,1,n):[]},Ot.take=function(e,n,t){return e&&e.length?zl(e,0,(n=t||void 0===n?1:or(n))<0?0:n):[]},Ot.takeRight=function(e,n,t){var l=null==e?0:e.length;return l?zl(e,(n=l-(n=t||void 0===n?1:or(n)))<0?0:n,l):[]},Ot.takeRightWhile=function(e,n){return e&&e.length?eo(e,Zo(n,3),!1,!0):[]},Ot.takeWhile=function(e,n){return e&&e.length?eo(e,Zo(n,3)):[]},Ot.tap=function(e,n){return n(e),e},Ot.throttle=function(e,n,l){var o=!0,i=!0;if("function"!=typeof e)throw new _e(t);return za(l)&&(o="leading"in l?!!l.leading:o,i="trailing"in l?!!l.trailing:i),Na(e,n,{leading:o,maxWait:n,trailing:i})},Ot.thru=la,Ot.toArray=tr,Ot.toPairs=Or,Ot.toPairsIn=br,Ot.toPath=function(e){return Pa(e)?sn(e,Ii):Ja(e)?[e]:_o(Ai(ur(e)))},Ot.toPlainObject=rr,Ot.transform=function(e,n,t){var l=Pa(e),o=l||Fa(e)||Qa(e);if(n=Zo(n,4),null==t){var i=e&&e.constructor;t=o?l?new i:[]:za(e)&&Ha(i)?bt(ze(e)):{}}return(o?ln:ul)(e,function(e,l,o){return n(t,e,l,o)}),t},Ot.unary=function(e){return _a(e,1)},Ot.union=Yi,Ot.unionBy=Gi,Ot.unionWith=qi,Ot.uniq=function(e){return e&&e.length?$l(e):[]},Ot.uniqBy=function(e,n){return e&&e.length?$l(e,Zo(n,2)):[]},Ot.uniqWith=function(e,n){return n="function"==typeof n?n:void 0,e&&e.length?$l(e,void 0,n):[]},Ot.unset=function(e,n){return null==e||Jl(e,n)},Ot.unzip=Ki,Ot.unzipWith=Xi,Ot.update=function(e,n,t){return null==e?e:Ql(e,n,io(t))},Ot.updateWith=function(e,n,t,l){return l="function"==typeof l?l:void 0,null==e?e:Ql(e,n,io(t),l)},Ot.values=Lr,Ot.valuesIn=function(e){return null==e?[]:bn(e,yr(e))},Ot.without=Zi,Ot.words=Hr,Ot.wrap=function(e,n){return Ia(io(n),e)},Ot.xor=$i,Ot.xorBy=Ji,Ot.xorWith=Qi,Ot.zip=ea,Ot.zipObject=function(e,n){return lo(e||[],n||[],Vt)},Ot.zipObjectDeep=function(e,n){return lo(e||[],n||[],kl)},Ot.zipWith=na,Ot.entries=Or,Ot.entriesIn=br,Ot.extend=sr,Ot.extendWith=cr,$r(Ot,Ot),Ot.add=uu,Ot.attempt=jr,Ot.camelCase=Rr,Ot.capitalize=wr,Ot.ceil=du,Ot.clamp=function(e,n,t){return void 0===t&&(t=n,n=void 0),void 0!==t&&(t=(t=ar(t))==t?t:0),void 0!==n&&(n=(n=ar(n))==n?n:0),Xt(ar(e),n,t)},Ot.clone=function(e){return Zt(e,4)},Ot.cloneDeep=function(e){return Zt(e,5)},Ot.cloneDeepWith=function(e,n){return Zt(e,5,n="function"==typeof n?n:void 0)},Ot.cloneWith=function(e,n){return Zt(e,4,n="function"==typeof n?n:void 0)},Ot.conformsTo=function(e,n){return null==n||$t(e,n,Nr(n))},Ot.deburr=Wr,Ot.defaultTo=function(e,n){return null==e||e!=e?n:e},Ot.divide=su,Ot.endsWith=function(e,n,t){e=ur(e),n=Zl(n);var l=e.length,o=t=void 0===t?l:Xt(or(t),0,l);return(t-=n.length)>=0&&e.slice(t,o)==n},Ot.eq=La,Ot.escape=function(e){return(e=ur(e))&&x.test(e)?e.replace(P,Mn):e},Ot.escapeRegExp=function(e){return(e=ur(e))&&Y.test(e)?e.replace(z,"\\$&"):e},Ot.every=function(e,n,t){var l=Pa(e)?an:tl;return t&&ri(e,n,t)&&(n=void 0),l(e,Zo(n,3))},Ot.find=aa,Ot.findIndex=Wi,Ot.findKey=function(e,n){return Sn(e,Zo(n,3),ul)},Ot.findLast=ra,Ot.findLastIndex=Pi,Ot.findLastKey=function(e,n){return Sn(e,Zo(n,3),dl)},Ot.floor=cu,Ot.forEach=ua,Ot.forEachRight=da,Ot.forIn=function(e,n){return null==e?e:al(e,Zo(n,3),yr)},Ot.forInRight=function(e,n){return null==e?e:rl(e,Zo(n,3),yr)},Ot.forOwn=function(e,n){return e&&ul(e,Zo(n,3))},Ot.forOwnRight=function(e,n){return e&&dl(e,Zo(n,3))},Ot.get=Sr,Ot.gt=Ra,Ot.gte=wa,Ot.has=function(e,n){return null!=e&&li(e,n,El)},Ot.hasIn=_r,Ot.head=xi,Ot.identity=qr,Ot.includes=function(e,n,t,l){e=xa(e)?e:Lr(e),t=t&&!l?or(t):0;var o=e.length;return t<0&&(t=at(o+t,0)),$a(e)?t<=o&&e.indexOf(n,t)>-1:!!o&&fn(e,n,t)>-1},Ot.indexOf=function(e,n,t){var l=null==e?0:e.length;if(!l)return-1;var o=null==t?0:or(t);return o<0&&(o=at(l+o,0)),fn(e,n,o)},Ot.inRange=function(e,n,t){return n=lr(n),void 0===t?(t=n,n=0):t=lr(t),function(e,n,t){return e>=rt(n,t)&&e<at(n,t)}(e=ar(e),n,t)},Ot.invoke=Cr,Ot.isArguments=Wa,Ot.isArray=Pa,Ot.isArrayBuffer=Ma,Ot.isArrayLike=xa,Ot.isArrayLikeObject=Ba,Ot.isBoolean=function(e){return!0===e||!1===e||Ya(e)&&pl(e)==r},Ot.isBuffer=Fa,Ot.isDate=Ua,Ot.isElement=function(e){return Ya(e)&&1===e.nodeType&&!Ka(e)},Ot.isEmpty=function(e){if(null==e)return!0;if(xa(e)&&(Pa(e)||"string"==typeof e||"function"==typeof e.splice||Fa(e)||Qa(e)||Wa(e)))return!e.length;var n=ti(e);if(n==v||n==S)return!e.size;if(ci(e))return!Tl(e).length;for(var t in e)if(ye.call(e,t))return!1;return!0},Ot.isEqual=function(e,n){return Cl(e,n)},Ot.isEqualWith=function(e,n,t){var l=(t="function"==typeof t?t:void 0)?t(e,n):void 0;return void 0===l?Cl(e,n,void 0,t):!!l},Ot.isError=ka,Ot.isFinite=function(e){return"number"==typeof e&<(e)},Ot.isFunction=Ha,Ot.isInteger=ja,Ot.isLength=Va,Ot.isMap=Ga,Ot.isMatch=function(e,n){return e===n||Nl(e,n,Jo(n))},Ot.isMatchWith=function(e,n,t){return t="function"==typeof t?t:void 0,Nl(e,n,Jo(n),t)},Ot.isNaN=function(e){return qa(e)&&e!=+e},Ot.isNative=function(e){if(si(e))throw new ce("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return yl(e)},Ot.isNil=function(e){return null==e},Ot.isNull=function(e){return null===e},Ot.isNumber=qa,Ot.isObject=za,Ot.isObjectLike=Ya,Ot.isPlainObject=Ka,Ot.isRegExp=Xa,Ot.isSafeInteger=function(e){return ja(e)&&e>=-9007199254740991&&e<=9007199254740991},Ot.isSet=Za,Ot.isString=$a,Ot.isSymbol=Ja,Ot.isTypedArray=Qa,Ot.isUndefined=function(e){return void 0===e},Ot.isWeakMap=function(e){return Ya(e)&&ti(e)==g},Ot.isWeakSet=function(e){return Ya(e)&&"[object WeakSet]"==pl(e)},Ot.join=function(e,n){return null==e?"":ot.call(e,n)},Ot.kebabCase=Pr,Ot.last=ki,Ot.lastIndexOf=function(e,n,t){var l=null==e?0:e.length;if(!l)return-1;var o=l;return void 0!==t&&(o=(o=or(t))<0?at(l+o,0):rt(o,l-1)),n==n?function(e,n,t){for(var l=t+1;l--;)if(e[l]===n)return l;return l}(e,n,o):_n(e,Cn,o,!0)},Ot.lowerCase=Mr,Ot.lowerFirst=xr,Ot.lt=er,Ot.lte=nr,Ot.max=function(e){return e&&e.length?ll(e,qr,ml):void 0},Ot.maxBy=function(e,n){return e&&e.length?ll(e,Zo(n,2),ml):void 0},Ot.mean=function(e){return Nn(e,qr)},Ot.meanBy=function(e,n){return Nn(e,Zo(n,2))},Ot.min=function(e){return e&&e.length?ll(e,qr,hl):void 0},Ot.minBy=function(e,n){return e&&e.length?ll(e,Zo(n,2),hl):void 0},Ot.stubArray=iu,Ot.stubFalse=au,Ot.stubObject=function(){return{}},Ot.stubString=function(){return""},Ot.stubTrue=function(){return!0},Ot.multiply=vu,Ot.nth=function(e,n){return e&&e.length?Ll(e,or(n)):void 0},Ot.noConflict=function(){return Ve._===this&&(Ve._=Ie),this},Ot.noop=Jr,Ot.now=Sa,Ot.pad=function(e,n,t){e=ur(e);var l=(n=or(n))?Vn(e):0;if(!n||l>=n)return e;var o=(n-l)/2;return wo(et(o),t)+e+wo(Qn(o),t)},Ot.padEnd=function(e,n,t){e=ur(e);var l=(n=or(n))?Vn(e):0;return n&&l<n?e+wo(n-l,t):e},Ot.padStart=function(e,n,t){e=ur(e);var l=(n=or(n))?Vn(e):0;return n&&l<n?wo(n-l,t)+e:e},Ot.parseInt=function(e,n,t){return t||null==n?n=0:n&&(n=+n),dt(ur(e).replace(G,""),n||0)},Ot.random=function(e,n,t){if(t&&"boolean"!=typeof t&&ri(e,n,t)&&(n=t=void 0),void 0===t&&("boolean"==typeof n?(t=n,n=void 0):"boolean"==typeof e&&(t=e,e=void 0)),void 0===e&&void 0===n?(e=0,n=1):(e=lr(e),void 0===n?(n=e,e=0):n=lr(n)),e>n){var l=e;e=n,n=l}if(t||e%1||n%1){var o=st();return rt(e+o*(n-e+Ue("1e-"+((o+"").length-1))),n)}return Ml(e,n)},Ot.reduce=function(e,n,t){var l=Pa(e)?vn:Tn,o=arguments.length<3;return l(e,Zo(n,4),t,o,el)},Ot.reduceRight=function(e,n,t){var l=Pa(e)?pn:Tn,o=arguments.length<3;return l(e,Zo(n,4),t,o,nl)},Ot.repeat=function(e,n,t){return n=(t?ri(e,n,t):void 0===n)?1:or(n),xl(ur(e),n)},Ot.replace=function(){var e=arguments,n=ur(e[0]);return e.length<3?n:n.replace(e[1],e[2])},Ot.result=function(e,n,t){var l=-1,o=(n=ao(n,e)).length;for(o||(o=1,e=void 0);++l<o;){var i=null==e?void 0:e[Ii(n[l])];void 0===i&&(l=o,i=t),e=Ha(i)?i.call(e):i}return e},Ot.round=pu,Ot.runInContext=e,Ot.sample=function(e){return(Pa(e)?Ut:Fl)(e)},Ot.size=function(e){if(null==e)return 0;if(xa(e))return $a(e)?Vn(e):e.length;var n=ti(e);return n==v||n==S?e.size:Tl(e).length},Ot.snakeCase=Br,Ot.some=function(e,n,t){var l=Pa(e)?mn:Yl;return t&&ri(e,n,t)&&(n=void 0),l(e,Zo(n,3))},Ot.sortedIndex=function(e,n){return Gl(e,n)},Ot.sortedIndexBy=function(e,n,t){return ql(e,n,Zo(t,2))},Ot.sortedIndexOf=function(e,n){var t=null==e?0:e.length;if(t){var l=Gl(e,n);if(l<t&&La(e[l],n))return l}return-1},Ot.sortedLastIndex=function(e,n){return Gl(e,n,!0)},Ot.sortedLastIndexBy=function(e,n,t){return ql(e,n,Zo(t,2),!0)},Ot.sortedLastIndexOf=function(e,n){if(null!=e&&e.length){var t=Gl(e,n,!0)-1;if(La(e[t],n))return t}return-1},Ot.startCase=Fr,Ot.startsWith=function(e,n,t){return e=ur(e),t=null==t?0:Xt(or(t),0,e.length),n=Zl(n),e.slice(t,t+n.length)==n},Ot.subtract=mu,Ot.sum=function(e){return e&&e.length?hn(e,qr):0},Ot.sumBy=function(e,n){return e&&e.length?hn(e,Zo(n,2)):0},Ot.template=function(e,n,t){var l=Ot.templateSettings;t&&ri(e,n,t)&&(n=void 0),e=ur(e),n=cr({},n,l,ko);var o,i,a=cr({},n.imports,l.imports,ko),r=Nr(a),u=bn(a,r),d=0,s=n.interpolate||ue,c="__p += '",v=Ee((n.escape||ue).source+"|"+s.source+"|"+(s===k?ee:ue).source+"|"+(n.evaluate||ue).source+"|$","g"),p="//# sourceURL="+(ye.call(n,"sourceURL")?(n.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Me+"]")+"\n";e.replace(v,function(n,t,l,a,r,u){return l||(l=a),c+=e.slice(d,u).replace(de,xn),t&&(o=!0,c+="' +\n__e("+t+") +\n'"),r&&(i=!0,c+="';\n"+r+";\n__p += '"),l&&(c+="' +\n((__t = ("+l+")) == null ? '' : __t) +\n'"),d=u+n.length,n}),c+="';\n";var m=ye.call(n,"variable")&&n.variable;if(m){if(J.test(m))throw new ce("Invalid `variable` option passed into `_.template`")}else c="with (obj) {\n"+c+"\n}\n";c=(i?c.replace(L,""):c).replace(R,"$1").replace(w,"$1;"),c="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+c+"return __p\n}";var E=jr(function(){return ve(r,p+"return "+c).apply(void 0,u)});if(E.source=c,ka(E))throw E;return E},Ot.times=function(e,n){if((e=or(e))<1||e>9007199254740991)return[];var t=4294967295,l=rt(e,4294967295);e-=4294967295;for(var o=An(l,n=Zo(n));++t<e;)n(t);return o},Ot.toFinite=lr,Ot.toInteger=or,Ot.toLength=ir,Ot.toLower=function(e){return ur(e).toLowerCase()},Ot.toNumber=ar,Ot.toSafeInteger=function(e){return e?Xt(or(e),-9007199254740991,9007199254740991):0===e?e:0},Ot.toString=ur,Ot.toUpper=function(e){return ur(e).toUpperCase()},Ot.trim=function(e,n,t){if((e=ur(e))&&(t||void 0===n))return In(e);if(!e||!(n=Zl(n)))return e;var l=zn(e),o=zn(n);return uo(l,Rn(l,o),wn(l,o)+1).join("")},Ot.trimEnd=function(e,n,t){if((e=ur(e))&&(t||void 0===n))return e.slice(0,Yn(e)+1);if(!e||!(n=Zl(n)))return e;var l=zn(e);return uo(l,0,wn(l,zn(n))+1).join("")},Ot.trimStart=function(e,n,t){if((e=ur(e))&&(t||void 0===n))return e.replace(G,"");if(!e||!(n=Zl(n)))return e;var l=zn(e);return uo(l,Rn(l,zn(n))).join("")},Ot.truncate=function(e,n){var t=30,l="...";if(za(n)){var o="separator"in n?n.separator:o;t="length"in n?or(n.length):t,l="omission"in n?Zl(n.omission):l}var i=(e=ur(e)).length;if(Bn(e)){var a=zn(e);i=a.length}if(t>=i)return e;var r=t-Vn(l);if(r<1)return l;var u=a?uo(a,0,r).join(""):e.slice(0,r);if(void 0===o)return u+l;if(a&&(r+=u.length-r),Xa(o)){if(e.slice(r).search(o)){var d,s=u;for(o.global||(o=Ee(o.source,ur(ne.exec(o))+"g")),o.lastIndex=0;d=o.exec(s);)var c=d.index;u=u.slice(0,void 0===c?r:c)}}else if(e.indexOf(Zl(o),r)!=r){var v=u.lastIndexOf(o);v>-1&&(u=u.slice(0,v))}return u+l},Ot.unescape=function(e){return(e=ur(e))&&M.test(e)?e.replace(W,Gn):e},Ot.uniqueId=function(e){var n=++De;return ur(e)+n},Ot.upperCase=Ur,Ot.upperFirst=kr,Ot.each=ua,Ot.eachRight=da,Ot.first=xi,$r(Ot,(ru={},ul(Ot,function(e,n){ye.call(Ot.prototype,n)||(ru[n]=e)}),ru),{chain:!1}),Ot.VERSION="4.17.21",ln(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Ot[e].placeholder=Ot}),ln(["drop","take"],function(e,n){wt.prototype[e]=function(t){t=void 0===t?1:at(or(t),0);var l=this.__filtered__&&!n?new wt(this):this.clone();return l.__filtered__?l.__takeCount__=rt(t,l.__takeCount__):l.__views__.push({size:rt(t,4294967295),type:e+(l.__dir__<0?"Right":"")}),l},wt.prototype[e+"Right"]=function(n){return this.reverse()[e](n).reverse()}}),ln(["filter","map","takeWhile"],function(e,n){var t=n+1,l=1==t||3==t;wt.prototype[e]=function(e){var n=this.clone();return n.__iteratees__.push({iteratee:Zo(e,3),type:t}),n.__filtered__=n.__filtered__||l,n}}),ln(["head","last"],function(e,n){var t="take"+(n?"Right":"");wt.prototype[e]=function(){return this[t](1).value()[0]}}),ln(["initial","tail"],function(e,n){var t="drop"+(n?"":"Right");wt.prototype[e]=function(){return this.__filtered__?new wt(this):this[t](1)}}),wt.prototype.compact=function(){return this.filter(qr)},wt.prototype.find=function(e){return this.filter(e).head()},wt.prototype.findLast=function(e){return this.reverse().find(e)},wt.prototype.invokeMap=Bl(function(e,n){return"function"==typeof e?new wt(this):this.map(function(t){return fl(t,e,n)})}),wt.prototype.reject=function(e){return this.filter(ha(Zo(e)))},wt.prototype.slice=function(e,n){e=or(e);var t=this;return t.__filtered__&&(e>0||n<0)?new wt(t):(e<0?t=t.takeRight(-e):e&&(t=t.drop(e)),void 0!==n&&(t=(n=or(n))<0?t.dropRight(-n):t.take(n-e)),t)},wt.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},wt.prototype.toArray=function(){return this.take(4294967295)},ul(wt.prototype,function(e,n){var t=/^(?:filter|find|map|reject)|While$/.test(n),l=/^(?:head|last)$/.test(n),o=Ot[l?"take"+("last"==n?"Right":""):n],i=l||/^find/.test(n);o&&(Ot.prototype[n]=function(){var n=this.__wrapped__,a=l?[1]:arguments,r=n instanceof wt,u=a[0],d=r||Pa(n),s=function(e){var n=o.apply(Ot,cn([e],a));return l&&c?n[0]:n};d&&t&&"function"==typeof u&&1!=u.length&&(r=d=!1);var c=this.__chain__,v=!!this.__actions__.length,p=i&&!c,m=r&&!v;if(!i&&d){n=m?n:new wt(this);var E=e.apply(n,a);return E.__actions__.push({func:la,args:[s],thisArg:void 0}),new Rt(E,c)}return p&&m?e.apply(this,a):(E=this.thru(s),p?l?E.value()[0]:E.value():E)})}),ln(["pop","push","shift","sort","splice","unshift"],function(e){var n=fe[e],t=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",l=/^(?:pop|shift)$/.test(e);Ot.prototype[e]=function(){var e=arguments;if(l&&!this.__chain__){var o=this.value();return n.apply(Pa(o)?o:[],e)}return this[t](function(t){return n.apply(Pa(t)?t:[],e)})}}),ul(wt.prototype,function(e,n){var t=Ot[n];if(t){var l=t.name+"";ye.call(gt,l)||(gt[l]=[]),gt[l].push({name:n,func:t})}}),gt[Oo(void 0,2).name]=[{name:"wrapper",func:void 0}],wt.prototype.clone=function(){var e=new wt(this.__wrapped__);return e.__actions__=_o(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=_o(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=_o(this.__views__),e},wt.prototype.reverse=function(){if(this.__filtered__){var e=new wt(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},wt.prototype.value=function(){var e=this.__wrapped__.value(),n=this.__dir__,t=Pa(e),l=n<0,o=t?e.length:0,i=function(e,n,t){for(var l=-1,o=t.length;++l<o;){var i=t[l],a=i.size;switch(i.type){case"drop":e+=a;break;case"dropRight":n-=a;break;case"take":n=rt(n,e+a);break;case"takeRight":e=at(e,n-a)}}return{start:e,end:n}}(0,o,this.__views__),a=i.start,r=i.end,u=r-a,d=l?r:a-1,s=this.__iteratees__,c=s.length,v=0,p=rt(u,this.__takeCount__);if(!t||!l&&o==u&&p==u)return no(e,this.__actions__);var m=[];e:for(;u--&&v<p;){for(var E=-1,S=e[d+=n];++E<c;){var _=s[E],f=_.type,g=(0,_.iteratee)(S);if(2==f)S=g;else if(!g){if(1==f)continue e;break e}}m[v++]=S}return m},Ot.prototype.at=oa,Ot.prototype.chain=function(){return ta(this)},Ot.prototype.commit=function(){return new Rt(this.value(),this.__chain__)},Ot.prototype.next=function(){void 0===this.__values__&&(this.__values__=tr(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},Ot.prototype.plant=function(e){for(var n,t=this;t instanceof Lt;){var l=bi(t);l.__index__=0,l.__values__=void 0,n?o.__wrapped__=l:n=l;var o=l;t=t.__wrapped__}return o.__wrapped__=e,n},Ot.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof wt){var n=e;return this.__actions__.length&&(n=new wt(this)),(n=n.reverse()).__actions__.push({func:la,args:[zi],thisArg:void 0}),new Rt(n,this.__chain__)}return this.thru(zi)},Ot.prototype.toJSON=Ot.prototype.valueOf=Ot.prototype.value=function(){return no(this.__wrapped__,this.__actions__)},Ot.prototype.first=Ot.prototype.head,Dn&&(Ot.prototype[Dn]=function(){return this}),Ot}();Ye?((Ye.exports=qn)._=qn,ze._=qn):Ve._=qn}).call(B)});const k=e=>{var n,t,r,u,d,s,c,v,p,E,S,_,f,g,N,y,D,T,h;let{application:A}=e;const{t:I}=o.useTranslation();let O=encodeURI(A.applicationNo),b={tenantId:A.tenantId,applicationNumber:A.applicationNo};const{isLoading:L}=Digit.Hooks.ws.useMyApplicationSearch({filters:b,BusinessService:null!==(n=A.applicationNo)&&void 0!==n&&n.includes("SW")?"SW":"WS"},{filters:b,privacy:Digit.Utils.getPrivacyObject()}),{data:R}=Digit.Hooks.pt.usePropertySearch({filters:{propertyIds:null==A?void 0:A.propertyId}},{filters:{propertyIds:null==A?void 0:A.propertyId},privacy:Digit.Utils.getPrivacyObject()}),w=null!=A&&null!==(t=A.applicationNo)&&void 0!==t&&t.includes("SW")?null!=A&&null!==(r=A.applicationNo)&&void 0!==r&&r.includes("DC")?"SW":"SW.ONE_TIME_FEE":null!=A&&null!==(u=A.applicationNo)&&void 0!==u&&u.includes("DC")?"WS":"WS.ONE_TIME_FEE";return null!=A&&null!==(d=A.applicationNo)&&void 0!==d&&d.includes("DC"),L?l.createElement(a.Loader,null):l.createElement(a.Card,null,l.createElement(a.KeyNote,{keyValue:I("WS_MYCONNECTIONS_APPLICATION_NO"),note:null==A?void 0:A.applicationNo}),l.createElement(a.KeyNote,{keyValue:I("WS_SERVICE_NAME"),note:I("WS_APPLICATION_TYPE_"+(null==A?void 0:A.applicationType))}),l.createElement(a.KeyNote,{keyValue:I("WS_CONSUMER_NAME"),note:(null==A||null===(s=A.connectionHolders)||void 0===s?void 0:s.map(e=>e.name).join(","))||(null==A||null===(c=A.property)||void 0===c||null===(v=c.owners)||void 0===v?void 0:v.sort((e,n)=>{var t,l;return(null==e||null===(t=e.additionalDetails)||void 0===t?void 0:t.ownerSequence)-(null==n||null===(l=n.additionalDetails)||void 0===l?void 0:l.ownerSequence)}).map(e=>e.name).join(","))||I("CS_NA")}),l.createElement(a.KeyNote,{keyValue:I("WS_PROPERTY_ID"),note:(null==A?void 0:A.propertyId)||I("CS_NA")}),l.createElement(a.KeyNote,{keyValue:I("WS_STATUS"),note:I("CS_"+(null==A?void 0:A.applicationStatus))||I("CS_NA")}),l.createElement(a.KeyNote,{keyValue:I("WS_SLA"),note:Math.round((null==A?void 0:A.sla)/864e5)?Math.round((null==A?void 0:A.sla)/864e5)+" Days":I("CS_NA")}),l.createElement(a.KeyNote,{keyValue:I("WS_PROPERTY_ADDRESS"),note:C(null==A||null===(p=A.property)||void 0===p?void 0:p.address,I),privacy:{uuid:null==A||null===(E=A.property)||void 0===E||null===(S=E.owners)||void 0===S||null===(_=S[0])||void 0===_?void 0:_.uuid,fieldName:["doorNo","street","landmark"],model:"Property",showValue:!0,loadData:{serviceName:"/property-services/property/_search",requestBody:{},requestParam:{tenantId:null==A?void 0:A.tenantId,propertyIds:null==A?void 0:A.propertyId},jsonPath:"Properties[0].address.street",isArray:!1,d:e=>(U.get(e,"Properties[0].address.doorNo")?U.get(e,"Properties[0].address.doorNo")+", ":"")+(U.get(e,"Properties[0].address.street")?U.get(e,"Properties[0].address.street")+", ":"")+(U.get(e,"Properties[0].address.landmark")?""+U.get(e,"Properties[0].address.landmark"):"")}}}),l.createElement(i.Link,{to:"/digit-ui/citizen/ws/connection/application/"+O},l.createElement(a.SubmitBar,{label:I("WS_VIEW_DETAILS_LABEL")})),"PENDING_FOR_PAYMENT"===(null==A?void 0:A.applicationStatus)?l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen/payment/my-bills/"+w+"/"+(null!=A&&null!==(f=A.applicationNo)&&void 0!==f&&f.includes("DC")?m(null==A?void 0:A.connectionNo,"/","+")||m(null==A?void 0:A.connectionNo,"/","+"):m(null==A?void 0:A.applicationNo,"/","+")||m(null==A?void 0:A.applicationNo,"/","+"))+"?workflow=WNS&tenantId="+(null==A?void 0:A.tenantId)+"&ConsumerName="+((null==A||null===(g=A.connectionHolders)||void 0===g?void 0:g.map(e=>e.name).join(","))||(null==A||null===(N=A.connectionHolders)||void 0===N?void 0:N.map(e=>e.name).join(","))||(null==R||null===(y=R.Properties)||void 0===y||null===(D=y[0])||void 0===D||null===(T=D.owners)||void 0===T?void 0:T.map(e=>e.name).join(",")))+"&isDisoconnectFlow="+!(null==A||null===(h=A.applicationNo)||void 0===h||!h.includes("DC")),state:{}}},l.createElement("div",{style:{marginTop:"10px"}},l.createElement(a.SubmitBar,{label:I("MAKE_PAYMENT")}))):null)},H=e=>{let{style:n}=e;return l.createElement("span",null,l.createElement("svg",{style:v({},n),display:"inline",width:"22",height:"16",viewBox:"0 0 22 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M11 0.5C6 0.5 1.73 3.61 0 8C1.73 12.39 6 15.5 11 15.5C16 15.5 20.27 12.39 22 8C20.27 3.61 16 0.5 11 0.5ZM11 13C8.24 13 6 10.76 6 8C6 5.24 8.24 3 11 3C13.76 3 16 5.24 16 8C16 10.76 13.76 13 11 13ZM11 5C9.34 5 8 6.34 8 8C8 9.66 9.34 11 11 11C12.66 11 14 9.66 14 8C14 6.34 12.66 5 11 5Z",fill:"#a82227"})))},j=e=>{let{t:n,userType:t}=e;t=t||Digit.SessionStorage.get("userType");const o=window.Digit.Utils.browser.isMobile();let i=sessionStorage.getItem("isPrivacyEnabled");return l.createElement(l.Fragment,null,"true"===i&&l.createElement("div",{style:"citizen"===t?{maxWidth:"970px"}:o?{}:{width:"80%"}},l.createElement("div",{className:"info-banner-wrap",style:window.location.href.includes("/connection-details")?{color:"#3498DB",margin:"0px"}:{color:"#3498DB"}},l.createElement("div",null,l.createElement(a.InfoBannerIcon,null),l.createElement("h2",{style:{color:"#3498DB"}},n("CS_FILE_APPLICATION_INFO_LABEL"))),n("WS_CLICK_ON_LABEL")+" ",l.createElement(H,{style:{display:"inline",marginBottom:"5px"}})," "+n("WS_CLICK_ON_INFO_LABEL"))))},V=()=>{var e,n,t,i,r,u,d,s,c,p,m,E,S,_;const{t:f}=o.useTranslation(),g=Digit.UserService.getUser(),C=(null===(e=Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY"))||void 0===e?void 0:e.code)||(null==g||null===(n=g.info)||void 0===n?void 0:n.permanentCity)||Digit.ULBService.getCurrentTenantId();let N=window.location.href.split("/").pop(),y=isNaN(parseInt(N))?{tenantId:C,mobileNumber:null==g||null===(i=g.info)||void 0===i?void 0:i.mobileNumber}:{tenantId:C,mobileNumber:null==g||null===(t=g.info)||void 0===t?void 0:t.mobileNumber};const{isLoading:D,data:T}=Digit.Hooks.ws.useMyApplicationSearch({filters:y},{filters:y}),{isLoading:h,data:A}=Digit.Hooks.ws.useMyApplicationSearch({filters:y,BusinessService:"SW"},{filters:y});let I=T&&(null==T||null===(r=T.WaterConnection)||void 0===r?void 0:r.map(e=>e.applicationNo).join(","))||"",O=A&&(null==A||null===(u=A.SewerageConnections)||void 0===u?void 0:u.map(e=>e.applicationNo).join(","))||"",b=I.concat(O),L=Digit.Hooks.useWorkflowDetails({tenantId:C,id:b,moduleCode:"WS,SW",config:{enabled:!!b}}),R=T&&(null==T||null===(d=T.WaterConnection)||void 0===d?void 0:d.map(e=>null==e?void 0:e.propertyId).join(","))||"",w=A&&(null==A||null===(s=A.SewerageConnections)||void 0===s?void 0:s.map(e=>null==e?void 0:e.propertyId).join(","))||"",W=R.concat(w);const{isLoading:P,data:M}=Digit.Hooks.pt.usePropertySearch({filters:{propertyIds:W}},{filters:{propertyIds:W},enabled:!!W});if(D||h||P)return l.createElement(a.Loader,null);let{WaterConnection:x}=T||{},{SewerageConnections:B}=A||{};x=null===(c=x)||void 0===c?void 0:c.map(e=>{var n,t,l;return v({},e,{sla:null==L||null===(n=L.data)||void 0===n||null===(t=n.processInstances)||void 0===t||null===(l=t.filter(n=>n.businessId==e.applicationNo)[0])||void 0===l?void 0:l.businesssServiceSla})}),B=null===(p=B)||void 0===p?void 0:p.map(e=>{var n,t,l;return v({},e,{sla:null==L||null===(n=L.data)||void 0===n||null===(t=n.processInstances)||void 0===t||null===(l=t.filter(n=>n.businessId==e.applicationNo)[0])||void 0===l?void 0:l.businesssServiceSla})}),x=null===(m=x)||void 0===m?void 0:m.filter(e=>"MODIFY_WATER_CONNECTION"!==(null==e?void 0:e.applicationType)),B=null===(E=B)||void 0===E?void 0:E.filter(e=>"MODIFY_SEWERAGE_CONNECTION"!==(null==e?void 0:e.applicationType));let F=x.concat(B);return F=F&&F.map(e=>{var n;return v({},e,{property:null==M||null===(n=M.Properties)||void 0===n?void 0:n.filter(n=>(null==n?void 0:n.propertyId)===(null==e?void 0:e.propertyId))[0]})}),l.createElement(l.Fragment,null,l.createElement(a.Header,null,f("CS_HOME_MY_APPLICATIONS")+" "+(F?"("+F.length+")":"")),l.createElement(j,{t:f}),l.createElement("div",null,(null===(S=F)||void 0===S?void 0:S.length)>0&&F.sort((e,n)=>{var t,l;return(null===(t=n.auditDetails)||void 0===t?void 0:t.lastModifiedTime)-(null===(l=e.auditDetails)||void 0===l?void 0:l.lastModifiedTime)}).map((e,n)=>l.createElement("div",{key:n},l.createElement(k,{application:e}))),!(null!==(_=F)&&void 0!==_&&_.length)>0&&l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},f("WS_NO_APPLICATION_FOUND_MSG"))))},z=e=>{var n,t,r,u,d,s,v,p,m,E,S,_,f,g,C,N,y,D,T,h,A,I,O,b,L,R,w,W,P,M,x,B;let{path:F}=e;i.useLocation();const{t:U}=o.useTranslation();let k=window.location.href.includes("/ws/create-application/property-details"),H=window.location.href.includes("/acknowledgement")||window.location.href.includes("/disconnect-acknowledge");const j=null===(n=Digit)||void 0===n||null===(t=n.ComponentRegistryService)||void 0===t?void 0:t.getComponent("WSDisconnectAcknowledgement"),z=null===(r=Digit)||void 0===r||null===(u=r.ComponentRegistryService)||void 0===u?void 0:u.getComponent("WSRestorationAcknowledgement"),Y=null===(d=Digit)||void 0===d||null===(s=d.ComponentRegistryService)||void 0===s?void 0:s.getComponent("WSCreate"),G=null===(v=Digit)||void 0===v||null===(p=v.ComponentRegistryService)||void 0===p?void 0:p.getComponent("WSDisconnection"),q=null===(m=Digit)||void 0===m||null===(E=m.ComponentRegistryService)||void 0===E?void 0:E.getComponent("WSRestoration"),K=null===(S=Digit)||void 0===S||null===(_=S.ComponentRegistryService)||void 0===_?void 0:_.getComponent("WSSearchConnectionComponent"),X=null===(f=Digit)||void 0===f||null===(g=f.ComponentRegistryService)||void 0===g?void 0:g.getComponent("WSSearchResultsComponent"),Z=null===(C=Digit)||void 0===C||null===(N=C.ComponentRegistryService)||void 0===N?void 0:N.getComponent("WSCitizenApplicationDetails"),$=null===(y=Digit)||void 0===y||null===(D=y.ComponentRegistryService)||void 0===D?void 0:D.getComponent("WSAdditionalDetails"),J=null===(T=Digit)||void 0===T||null===(h=T.ComponentRegistryService)||void 0===h?void 0:h.getComponent("WSCitizenConnectionDetails"),Q=null===(A=Digit)||void 0===A||null===(I=A.ComponentRegistryService)||void 0===I?void 0:I.getComponent("WSCitizenConsumptionDetails"),ee=null===(O=Digit)||void 0===O||null===(b=O.ComponentRegistryService)||void 0===b?void 0:b.getComponent("WSMyPayments"),ne=null===(L=Digit)||void 0===L||null===(R=L.ComponentRegistryService)||void 0===R?void 0:R.getComponent("WSCitizenEditApplication"),te=null===(w=Digit)||void 0===w||null===(W=w.ComponentRegistryService)||void 0===W?void 0:W.getComponent("WSReSubmitDisconnectionApplication"),le=null===(P=Digit)||void 0===P||null===(M=P.ComponentRegistryService)||void 0===M?void 0:M.getComponent("WSMyConnections"),oe=null===(x=Digit)||void 0===x||null===(B=x.ComponentRegistryService)||void 0===B?void 0:B.getComponent("WNSMyBillsComponent");return l.createElement(l.Fragment,null,l.createElement("div",{className:"ws-citizen-wrapper"},!H&&l.createElement(a.BackButton,{style:{border:"none"},getBackPageNumber:()=>{let e=-1;return"true"===sessionStorage.getItem("VisitedCommonPTSearch")&&k?(e=-4,e):e}},U("CS_COMMON_BACK")),l.createElement(i.Switch,null,l.createElement(a.PrivateRoute,{path:F+"/create-application",component:Y}),l.createElement(a.PrivateRoute,{path:F+"/disconnect-application",component:G}),l.createElement(a.PrivateRoute,{path:F+"/restore-application",component:q}),l.createElement(a.PrivateRoute,{path:F+"/disconnect-acknowledge",component:j}),l.createElement(a.PrivateRoute,{path:F+"/restoration-acknowledge",component:z}),l.createElement(a.PrivateRoute,{path:F+"/resubmit-disconnect-application",component:te}),l.createElement(i.Route,{path:F+"/search",component:K}),l.createElement(a.PrivateRoute,{path:F+"/my-bills",component:oe}),l.createElement(i.Route,{path:F+"/search-results",component:X}),l.createElement(i.Route,{path:F+"/test-acknowledgment",component:c}),l.createElement(a.PrivateRoute,{path:F+"/my-payments",component:ee}),l.createElement(a.PrivateRoute,{path:F+"/my-applications",component:V}),l.createElement(a.PrivateRoute,{path:F+"/my-connections",component:le}),l.createElement(a.PrivateRoute,{path:F+"/connection/application/:acknowledgementIds",component:Z}),l.createElement(a.PrivateRoute,{path:F+"/connection/additional/:acknowledgementIds",component:$}),l.createElement(a.PrivateRoute,{path:F+"/connection/details/:acknowledgementIds",component:J}),l.createElement(a.PrivateRoute,{path:F+"/consumption/details",component:Q}),l.createElement(a.PrivateRoute,{path:F+"/edit-application/:tenantId",component:ne}),l.createElement(a.PrivateRoute,{path:F+"/modify-connection/:tenantId",component:ne}))))},Y=e=>{var n;const t=null==e?void 0:e.doorNo,l=null==e?void 0:e.street,o=null==e?void 0:e.landmark,i=null==e||null===(n=e.locality)||void 0===n?void 0:n.name,a=null==e?void 0:e.pincode;return(t?t+", ":"")+(l?l+", ":"")+(o?o+", ":"")+(i?i+", ":"")+((null==e?void 0:e.city)||"")+(a?", "+a:"")},G=(e,n)=>{var t,l,o;const i=null===(l=((null==e||null===(t=e.owners)||void 0===t?void 0:t.filter(e=>1==e.active))||[]).sort((e,n)=>{var t,l;return(null==e||null===(t=e.additionalDetails)||void 0===t?void 0:t.ownerSequence)-(null==n||null===(l=n.additionalDetails)||void 0===l?void 0:l.ownerSequence)}))||void 0===l||null===(o=l.map(e=>e.name))||void 0===o?void 0:o.join(",");return{title:n("WS_COMMON_PROPERTY_DETAILS"),values:[{title:n("WS_PROPERTY_ID_LABEL"),value:n(""+(null==e?void 0:e.propertyId))||n("CS_NA")},{title:n("WS_OWN_DETAIL_NAME"),value:i||n("CS_NA")},{title:n("WS_PROPERTY_ADDRESS_LABEL"),value:Y(null==e?void 0:e.address)||n("CS_NA")}]}},q=(e,n)=>({title:n("WS_COMMON_CONNECTION_DETAILS"),values:"NEW_WATER_CONNECTION"==(null==e?void 0:e.applicationType)?[{title:n("WS_APPLY_FOR"),value:n(null==e?void 0:e.applicationType)||n("CS_NA")},{title:n("WS_TASK_DETAILS_CONN_DETAIL_NO_OF_TAPS_PROPOSED"),value:(null==e?void 0:e.proposedTaps)||n("CS_NA")},{title:n("WS_TASK_DETAILS_CONN_DETAIL_PIPE_SIZE_PROPOSED"),value:(null==e?void 0:e.proposedPipeSize)||n("CS_NA")}]:[{title:n("WS_APPLY_FOR"),value:n(null==e?void 0:e.applicationType)||n("CS_NA")},{title:n("WS_NO_WATER_CLOSETS_LABEL"),value:(null==e?void 0:e.proposedWaterClosets)||n("CS_NA")},{title:n("WS_SERV_DETAIL_NO_OF_TOILETS"),value:(null==e?void 0:e.proposedToilets)||n("CS_NA")}]}),K=(e,n)=>{var t,l,o,i,a,r,u,d,s,c,v;return{title:n("WS_COMMON_CONNECTION_HOLDER_DETAILS_HEADER"),values:(null==e||null===(t=e.connectionHolders)||void 0===t?void 0:t.length)>0?[{title:n("WS_OWN_DETAIL_NAME"),value:(null==e||null===(l=e.connectionHolders)||void 0===l||null===(o=l[0])||void 0===o?void 0:o.name)||n("CS_NA")},{title:n("CORE_COMMON_MOBILE_NUMBER"),value:(null==e||null===(i=e.connectionHolders)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.mobileNumber)||n("CS_NA")},{title:n("WS_CONN_HOLDER_COMMON_FATHER_OR_HUSBAND_NAME"),value:(null==e||null===(r=e.connectionHolders)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.fatherOrHusbandName)||n("CS_NA")},{title:n("WS_CORRESPONDANCE_ADDRESS_LABEL"),value:(null==e||null===(d=e.connectionHolders)||void 0===d||null===(s=d[0])||void 0===s?void 0:s.correspondenceAddress)||n("CS_NA")},{title:n("WS_EMAIL_ID"),value:(null==e||null===(c=e.connectionHolders)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.emailId)||n("CS_NA")}]:[{title:n("WS_CONN_HOLDER_SAME_AS_OWNER_DETAILS"),value:n("SCORE_YES")||n("CS_NA")}]}},X=(e,n)=>{const t=null==e?void 0:e.documents;return{title:n("WS_COMMON_DOCUMENTS_DETAILS"),isAttachments:!0,values:null==t?void 0:t.map(e=>n(null==e?void 0:e.documentType))}},Z=function(e,n,t,l){try{var o,i;function a(){return Promise.resolve(function(e,n,t){try{return Promise.resolve(E(t,n)).then(function(t){var l,o,i,a;let r=[];return null!=e&&e.applicationNo&&r.push({title:n("PDF_STATIC_LABEL_APPLICATION_NUMBER_LABEL")+":",value:null==e?void 0:e.applicationNo}),null!=e&&e.connectionNo&&r.push({title:n("PDF_STATIC_LABEL_CONSUMER_NUMBER_LABEL")+":",value:null==e?void 0:e.connectionNo}),v({title:"",email:"",phoneNumber:"",isHeader:!0,typeOfApplication:null!=e&&null!==(l=e.applicationNo)&&void 0!==l&&l.includes("SW")?n("WS_NEW_SEWERAGE_CONNECTION"):n("WS_COMMON_INBOX_NEWWS1"),date:(null!=e&&null!==(o=e.auditDetails)&&void 0!==o&&o.createdTime?Digit.DateUtils.ConvertEpochToDate(null==e||null===(i=e.auditDetails)||void 0===i?void 0:i.createdTime):Digit.DateUtils.ConvertEpochToDate(null==e||null===(a=e.additionalDetails)||void 0===a?void 0:a.appCreatedDate))||"NA",values:r},t)})}catch(e){return Promise.reject(e)}}(e,l,t)).then(function(o){return{t:l,tenantId:t,title:"PDF_STATIC_LABEL_WS_CONSOLIDATED_ACKNOWELDGMENT_LOGO_SUB_HEADER",name:""+l("PDF_STATIC_LABEL_WS_CONSOLIDATED_ACKNOWELDGMENT_LOGO_SUB_HEADER"),email:"",phoneNumber:"",headerDetails:[o],details:[G(n,l),K(e,l),q(e,l),X(e,l)]}})}const r=null==e||null===(o=e.tradeLicenseDetail)||void 0===o||null===(i=o.applicationDocuments)||void 0===i?void 0:i.map(e=>null==e?void 0:e.fileStoreId);let u;const d=function(){if(r)return Promise.resolve(Digit.UploadServices.Filefetch(r,Digit.ULBService.getStateId())).then(function(e){u=e})}();return Promise.resolve(d&&d.then?d.then(a):a())}catch(e){return Promise.reject(e)}},$=(e,n,t)=>n===e?t("WS_NO_CHANGE"):n,J=e=>{var n;const t=null==e?void 0:e.doorNo,l=null==e?void 0:e.street,o=null==e?void 0:e.landmark,i=null==e||null===(n=e.locality)||void 0===n?void 0:n.name,a=null==e?void 0:e.pincode;return(t?t+", ":"")+(l?l+", ":"")+(o?o+", ":"")+(i?i+", ":"")+((null==e?void 0:e.city)||"")+(a?", "+a:"")},Q=(e,n,t)=>{var l,o,i,a;const r=(null==e||null===(l=e.owners)||void 0===l?void 0:l.filter(e=>1==e.active))||[],u=null==r||null===(o=r.map(e=>e.name))||void 0===o?void 0:o.join(","),d=(null==n||null===(i=n.owners)||void 0===i?void 0:i.filter(e=>1==e.active))||[],s=null==d||null===(a=d.map(e=>e.name))||void 0===a?void 0:a.join(","),c=!(s===u);return{title:[t("WS_COMMON_PROPERTY_DETAILS"),t("WS_CURRENT_VALUE"),t("WS_OLD_VALUE")],values:[{val1:t("WS_PROPERTY_ID_LABEL"),val2:t(""+(null==e?void 0:e.propertyId))||t("CS_NA"),val3:$(null==e?void 0:e.propertyId,null==n?void 0:n.propertyId,t)},{val1:t("WS_OWN_DETAIL_NAME"),val2:u||t("CS_NA"),val3:c?s:t("WS_NO_CHANGE")},{val1:t("WS_PROPERTY_ADDRESS_LABEL"),val2:J(null==e?void 0:e.address)||t("CS_NA"),val3:c?J(null==n?void 0:n.address):t("WS_NO_CHANGE")}]}},ee=(e,n,t)=>{var l,o,i;return{title:[t("WS_COMMON_CONNECTION_DETAILS"),t(""),t("")],values:"MODIFY_WATER_CONNECTION"==(null==e?void 0:e.applicationType)?[{val1:t("WS_SERV_DETAIL_CONN_TYPE"),val2:null==e?void 0:e.connectionType,val3:$(null==e?void 0:e.connectionType,null==n?void 0:n.connectionType,t)},{val1:t("WS_TASK_DETAILS_CONN_DETAIL_NO_OF_TAPS_PROPOSED"),val2:(null==e?void 0:e.noOfTaps)||t("CS_NA"),val3:$(null==e?void 0:e.noOfTaps,null==n?void 0:n.noOfTaps,t)},{val1:t("WS_TASK_DETAILS_CONN_DETAIL_PIPE_SIZE_PROPOSED"),val2:(null==e?void 0:e.pipeSize)||t("CS_NA"),val3:$(null==e?void 0:e.pipeSize,null==n?void 0:n.pipeSize,t)},{val1:t("WS_SERV_DETAIL_WATER_SOURCE"),val2:t("WS_SERVICES_MASTERS_WATERSOURCE_"+(null==e?void 0:e.waterSource.split(".")[0])),val3:$(t("WS_SERVICES_MASTERS_WATERSOURCE_"+(null==e?void 0:e.waterSource.split(".")[0])),t("WS_SERVICES_MASTERS_WATERSOURCE_"+(null==n?void 0:n.waterSource.split(".")[0])),t)},{val1:t("WS_SERV_DETAIL_WATER_SUB_SOURCE"),val2:t("WS_SERVICES_MASTERS_WATERSOURCE_"+m(null==e?void 0:e.waterSource,".","_")),val3:$(t("WS_SERVICES_MASTERS_WATERSOURCE_"+m(null==e?void 0:e.waterSource,".","_")),t("WS_SERVICES_MASTERS_WATERSOURCE_"+m(null==n?void 0:n.waterSource,".","_")),t)},{val1:t("WS_SERV_DETAIL_CONN_EXECUTION_DATE"),val2:S(null==e?void 0:e.connectionExecutionDate),val3:$(null==e?void 0:e.connectionExecutionDate,null==n?void 0:n.connectionExecutionDate,t)!==t("WS_NO_CHANGE")?S($(null==e?void 0:e.connectionExecutionDate,null==n?void 0:n.connectionExecutionDate,t)):t("WS_NO_CHANGE")},{val1:t("WS_SERV_DETAIL_METER_ID"),val2:null==e?void 0:e.meterId,val3:$(null==e?void 0:e.meterId,null==n?void 0:n.meterId,t)},{val1:t("WS_ADDN_DETAIL_METER_INSTALL_DATE"),val2:S(null==e?void 0:e.meterInstallationDate),val3:$(S(null==e?void 0:e.meterInstallationDate),S(null==n?void 0:n.meterInstallationDate),t)},{val1:t("WS_INITIAL_METER_READING_LABEL"),val2:(null==e||null===(l=e.additionalDetails)||void 0===l?void 0:l.initialMeterReading)||t("CS_NA"),val3:$(null==e||null===(o=e.additionalDetails)||void 0===o?void 0:o.initialMeterReading,null==n||null===(i=n.additionalDetails)||void 0===i?void 0:i.initialMeterReading,t)},{val1:t("WS_MODIFICATIONS_EFFECTIVE_DATE"),val2:S(null==e?void 0:e.dateEffectiveFrom),val3:$(S(null==e?void 0:e.dateEffectiveFrom),S(null==n?void 0:n.dateEffectiveFrom),t)}]:[{val1:t("WS_SERV_DETAIL_CONN_TYPE"),val2:null==e?void 0:e.connectionType,val3:$(null==e?void 0:e.connectionType,null==n?void 0:n.connectionType,t)},{val1:t("WS_NO_WATER_CLOSETS_LABEL"),val2:(null==e?void 0:e.noOfWaterClosets)||t("CS_NA"),val3:$(null==e?void 0:e.noOfWaterClosets,null==n?void 0:n.noOfWaterClosets,t)},{val1:t("WS_SERV_DETAIL_NO_OF_TOILETS"),val2:(null==e?void 0:e.noOfToilets)||t("CS_NA"),val3:$(null==e?void 0:e.noOfToilets,null==n?void 0:n.noOfToilets,t)},{val1:t("WS_SERV_DETAIL_CONN_EXECUTION_DATE"),val2:S(null==e?void 0:e.connectionExecutionDate),val3:$(null==e?void 0:e.connectionExecutionDate,null==n?void 0:n.connectionExecutionDate,t)},{val1:t("WS_MODIFICATIONS_EFFECTIVE_DATE"),val2:S(null==e?void 0:e.dateEffectiveFrom),val3:$(S(null==e?void 0:e.dateEffectiveFrom),S(null==n?void 0:n.dateEffectiveFrom),t)}]}},ne=(e,n,t)=>{var l,o;const i=(null==n||null===(l=n.connectionHolders)||void 0===l?void 0:l.length)>0,a=(null==e||null===(o=e.connectionHolders)||void 0===o?void 0:o.length)>0;var r,u,d,s,c,v,p,m,E,S,_,f,g,C,N,y,D,T,h,A,I,O,b,L,R,w,W,P,M,x,B,F,U,k,H,j,V,z,Y,G,q,K,X,Z,J,Q,ee,ne,te,le;return i&&a?{title:[t("WS_COMMON_CONNECTION_HOLDER_DETAILS_HEADER"),t(""),t("")],values:[{val1:t("WS_OWN_DETAIL_NAME"),val2:(null==e||null===(r=e.connectionHolders)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.name)||t("CS_NA"),val3:$(null==e||null===(d=e.connectionHolders)||void 0===d||null===(s=d[0])||void 0===s?void 0:s.name,null==n||null===(c=n.connectionHolders)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.name,t)},{val1:t("CORE_COMMON_MOBILE_NUMBER"),val2:(null==e||null===(p=e.connectionHolders)||void 0===p||null===(m=p[0])||void 0===m?void 0:m.mobileNumber)||t("CS_NA"),val3:$(null==e||null===(E=e.connectionHolders)||void 0===E||null===(S=E[0])||void 0===S?void 0:S.mobileNumber,null==n||null===(_=n.connectionHolders)||void 0===_||null===(f=_[0])||void 0===f?void 0:f.mobileNumber,t)},{val1:t("CORE_COMMON_EMAIL_ID"),val2:(null==e||null===(g=e.connectionHolders)||void 0===g||null===(C=g[0])||void 0===C?void 0:C.emailId)||t("CS_NA"),val3:$(null==e||null===(N=e.connectionHolders)||void 0===N||null===(y=N[0])||void 0===y?void 0:y.emailId,null==n||null===(D=n.connectionHolders)||void 0===D||null===(T=D[0])||void 0===T?void 0:T.emailId,t)},{val1:t("WS_CONN_HOLDER_COMMON_FATHER_OR_HUSBAND_NAME"),val2:(null==e||null===(h=e.connectionHolders)||void 0===h||null===(A=h[0])||void 0===A?void 0:A.fatherOrHusbandName)||t("CS_NA"),val3:$(null==e||null===(I=e.connectionHolders)||void 0===I||null===(O=I[0])||void 0===O?void 0:O.fatherOrHusbandName,null==n||null===(b=n.connectionHolders)||void 0===b||null===(L=b[0])||void 0===L?void 0:L.fatherOrHusbandName,t)},{val1:t("WS_CORRESPONDANCE_ADDRESS_LABEL"),val2:(null==e||null===(R=e.connectionHolders)||void 0===R||null===(w=R[0])||void 0===w?void 0:w.correspondenceAddress)||t("CS_NA"),val3:$(null==e||null===(W=e.connectionHolders)||void 0===W||null===(P=W[0])||void 0===P?void 0:P.correspondenceAddress,null==n||null===(M=n.connectionHolders)||void 0===M||null===(x=M[0])||void 0===x?void 0:x.correspondenceAddress,t)}]}:a&&!i?{title:[t("WS_COMMON_CONNECTION_HOLDER_DETAILS_HEADER"),t(""),t("")],values:[{val1:t("WS_OWN_DETAIL_NAME"),val2:(null==e||null===(B=e.connectionHolders)||void 0===B||null===(F=B[0])||void 0===F?void 0:F.name)||t("CS_NA"),val3:t("WS_SAME_AS_PROPERTY_OWNERS")},{val1:t("CORE_COMMON_MOBILE_NUMBER"),val2:(null==e||null===(U=e.connectionHolders)||void 0===U||null===(k=U[0])||void 0===k?void 0:k.mobileNumber)||t("CS_NA"),val3:t("WS_SAME_AS_PROPERTY_OWNERS")},{val1:t("CORE_COMMON_EMAIL_ID"),val2:(null==e||null===(H=e.connectionHolders)||void 0===H||null===(j=H[0])||void 0===j?void 0:j.emailId)||t("CS_NA"),val3:t("WS_SAME_AS_PROPERTY_OWNERS")},{val1:t("WS_CONN_HOLDER_COMMON_FATHER_OR_HUSBAND_NAME"),val2:(null==e||null===(V=e.connectionHolders)||void 0===V||null===(z=V[0])||void 0===z?void 0:z.fatherOrHusbandName)||t("CS_NA"),val3:t("WS_SAME_AS_PROPERTY_OWNERS")},{val1:t("WS_CORRESPONDANCE_ADDRESS_LABEL"),val2:(null==e||null===(Y=e.connectionHolders)||void 0===Y||null===(G=Y[0])||void 0===G?void 0:G.correspondenceAddress)||t("CS_NA"),val3:t("WS_SAME_AS_PROPERTY_OWNERS")}]}:!a&&i?{title:[t("WS_COMMON_CONNECTION_HOLDER_DETAILS_HEADER"),t(""),t("")],values:[{val1:t("WS_OWN_DETAIL_NAME"),val3:(null==n||null===(q=n.connectionHolders)||void 0===q||null===(K=q[0])||void 0===K?void 0:K.name)||t("CS_NA"),val2:t("WS_SAME_AS_PROPERTY_OWNERS")},{val1:t("CORE_COMMON_MOBILE_NUMBER"),val3:(null==n||null===(X=n.connectionHolders)||void 0===X||null===(Z=X[0])||void 0===Z?void 0:Z.mobileNumber)||t("CS_NA"),val2:t("WS_SAME_AS_PROPERTY_OWNERS")},{val1:t("CORE_COMMON_EMAIL_ID"),val3:(null==n||null===(J=n.connectionHolders)||void 0===J||null===(Q=J[0])||void 0===Q?void 0:Q.emailId)||t("CS_NA"),val2:t("WS_SAME_AS_PROPERTY_OWNERS")},{val1:t("WS_CONN_HOLDER_COMMON_FATHER_OR_HUSBAND_NAME"),val3:(null==n||null===(ee=n.connectionHolders)||void 0===ee||null===(ne=ee[0])||void 0===ne?void 0:ne.fatherOrHusbandName)||t("CS_NA"),val2:t("WS_SAME_AS_PROPERTY_OWNERS")},{val1:t("WS_CORRESPONDANCE_ADDRESS_LABEL"),val3:(null==n||null===(te=n.connectionHolders)||void 0===te||null===(le=te[0])||void 0===le?void 0:le.correspondenceAddress)||t("CS_NA"),val2:t("WS_SAME_AS_PROPERTY_OWNERS")}]}:{title:[t("WS_COMMON_CONNECTION_HOLDER_DETAILS_HEADER"),t(""),t("")],values:[{val1:t("WS_SAME_AS_PROPERTY_OWNERS"),val2:t("SCORE_YES")||t("CS_NA"),val3:t("SCORE_YES")}]}},te=(e,n)=>{const t=null==e?void 0:e.documents;return{title:n("WS_COMMON_DOCUMENTS_DETAILS"),isAttachments:!0,values:(null==t?void 0:t.length)>0?null==t?void 0:t.map(e=>n(null==e?void 0:e.documentType)):[n("BPA_NO_DOCUMENTS_UPLOADED_LABEL")]}},le=function(e,n,t,l,o){return Promise.resolve(function(e,n,t){try{return Promise.resolve(E(t,n)).then(function(t){var l,o,i,a,r,u,d,s;let c=[];return null!=e&&e.applicationNo&&c.push({title:n("PDF_STATIC_LABEL_APPLICATION_NUMBER_LABEL")+":",value:null==e?void 0:e.applicationNo}),null!=e&&e.connectionNo&&c.push({title:n("PDF_STATIC_LABEL_CONSUMER_NUMBER_LABEL")+":",value:null==e?void 0:e.connectionNo}),v({title:"",isHeader:!0,header:n((null==e||null===(l=e.tenantId)||void 0===l||null===(o=l.replace(".","_"))||void 0===o?void 0:o.toUpperCase())+"_HEADER_LABEL"),subHeader:n((null==e||null===(i=e.tenantId)||void 0===i||null===(a=i.replace(".","_"))||void 0===a?void 0:a.toUpperCase())+"_SUB_HEADER_LABEL"),description:n((null==e||null===(r=e.tenantId)||void 0===r||null===(u=r.replace(".","_"))||void 0===u?void 0:u.toUpperCase())+"_DES_HEADER_LABEL"),typeOfApplication:null!=e&&null!==(d=e.applicationNo)&&void 0!==d&&d.includes("SW")?n("CS_COMMON_INBOX_MODIFYSWCONNECTION"):n("WS_COMMON_INBOX_MODIFYWSCONNECTION"),date:Digit.DateUtils.ConvertEpochToDate(null==e||null===(s=e.auditDetails)||void 0===s?void 0:s.createdTime)||"NA",values:c},t)})}catch(e){return Promise.reject(e)}}(e,l,t)).then(function(i){return Promise.resolve(Digit.PTService.search({tenantId:t,filters:{propertyIds:null==o?void 0:o.propertyId}})).then(function(a){var r;const u=null==a||null===(r=a.Properties)||void 0===r?void 0:r[0];return{tenantId:t,headerDetails:[i],bodyDetails:[Q(n,u,l),ne(e,o,l),ee(e,o,l),te(e,l)]}})})},oe=e=>{var n,r,u,d,s,c,p,m,E,S;const{t:_}=o.useTranslation(),f=Digit.ULBService.getCurrentTenantId(),C=i.useHistory();let N=g(location.search);const[y,D]=t.useState({}),[T,h]=t.useState({}),{data:A}=Digit.Hooks.ws.useWSDetailsPage(_,f,null==N?void 0:N.applicationNumber,"WATER",{enabled:!(null==N||!N.applicationNumber)}),{data:I}=Digit.Hooks.ws.useWSDetailsPage(_,f,null==N?void 0:N.applicationNumber1,"SEWERAGE",{enabled:!(null==N||!N.applicationNumber1)});t.useEffect(function(){try{return D(A),h(I),Promise.resolve()}catch(e){return Promise.reject(e)}},[A,I]);const{data:O}=Digit.Hooks.ws.useOldValue({tenantId:f,filters:{connectionNumber:null==y||null===(n=y.applicationData)||void 0===n?void 0:n.connectionNo,isConnectionSearch:!0},businessService:"WATER"},{enabled:!(null==y||null===(r=y.applicationData)||void 0===r||null===(u=r.applicationType)||void 0===u||!u.includes("MODIFY_"))}),{data:b}=Digit.Hooks.ws.useOldValue({tenantId:f,filters:{connectionNumber:null==T||null===(d=T.applicationData)||void 0===d?void 0:d.connectionNo,isConnectionSearch:!0},businessService:"SEWERAGE"},{enabled:!(null==T||null===(s=T.applicationData)||void 0===s||null===(c=s.applicationType)||void 0===c||!c.includes("MODIFY_"))}),L=null==O||null===(p=O.WaterConnection)||void 0===p?void 0:p[(null==O||null===(m=O.WaterConnection)||void 0===m?void 0:m.length)-1],R=null==b||null===(E=b.SewerageConnections)||void 0===E?void 0:E[(null==b||null===(S=b.SewerageConnections)||void 0===S?void 0:S.length)-1];return l.createElement("div",null,l.createElement(a.Card,null,l.createElement(a.Banner,{message:_("WS_APPLICATION_SUBMITTED_SUCCESSFULLY_LABEL"),applicationNumber:null==N?void 0:N.applicationNumber,applicationNumberOne:null==N?void 0:N.applicationNumber1,info:null!=N&&N.applicationNumber?_("WS_WATER_APPLICATION_NUMBER_LABEL"):"",infoOne:null!=N&&N.applicationNumber1?_("WS_SEWERAGE_APPLICATION_NUMBER_LABEL"):"",successful:!0,style:{padding:"10px"},headerStyles:{fontSize:"32px"},infoOneStyles:{paddingTop:"20px"}}),l.createElement(a.CardText,{style:{paddingBottom:"10px",marginBottom:"10px"}},_("WS_MESSAGE_SUB_DESCRIPTION_LABEL")),l.createElement("div",{style:{display:"flex"}},(null==N?void 0:N.applicationNumber)&&l.createElement("div",{className:"primary-label-btn d-grid",style:{marginLeft:"unset",marginBottom:"10px",padding:"0px 8px"},onClick:function(){try{var e,n,t;const o=null==y||null===(e=y.applicationData)||void 0===e?void 0:e.tenantId;let i=null==y?void 0:y.applicationData;var l;return null!=y&&null!==(n=y.applicationData)&&void 0!==n&&null!==(t=n.applicationType)&&void 0!==t&&t.includes("MODIFY_")?(le(v({},null==O||null===(l=O.WaterConnection)||void 0===l?void 0:l[0]),v({},null==y?void 0:y.propertyDetails),o,_,L).then(e=>Digit.Utils.pdf.generateModifyPdf(e)),Promise.resolve()):(Z(v({},i),v({},null==y?void 0:y.propertyDetails),o,_).then(e=>Digit.Utils.pdf.generatev1(e)),Promise.resolve())}catch(e){return Promise.reject(e)}}},l.createElement("svg",{width:"20",height:"23",viewBox:"0 0 20 23",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M19.3334 8H14V0H6.00002V8H0.666687L10 17.3333L19.3334 8ZM0.666687 20V22.6667H19.3334V20H0.666687Z",fill:"#a82227"})),_("WS_PRINT_WATER_APPLICATION_LABEL")),(null==N?void 0:N.applicationNumber1)&&l.createElement("div",{className:"primary-label-btn d-grid",style:{marginLeft:"unset",marginBottom:"10px",padding:"0px 8px"},onClick:function(){try{var e,n,t;const o=null==T||null===(e=T.applicationData)||void 0===e?void 0:e.tenantId;let i=null==T?void 0:T.applicationData;var l;return null!=T&&null!==(n=T.applicationData)&&void 0!==n&&null!==(t=n.applicationType)&&void 0!==t&&t.includes("MODIFY_")?(le(v({},null==b||null===(l=b.SewerageConnections)||void 0===l?void 0:l[0]),v({},null==T?void 0:T.propertyDetails),o,_,R).then(e=>Digit.Utils.pdf.generateModifyPdf(e)),Promise.resolve()):(Z(v({},i),v({},null==T?void 0:T.propertyDetails),o,_).then(e=>Digit.Utils.pdf.generatev1(e)),Promise.resolve())}catch(e){return Promise.reject(e)}}},l.createElement("svg",{width:"20",height:"23",viewBox:"0 0 20 23",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M19.3334 8H14V0H6.00002V8H0.666687L10 17.3333L19.3334 8ZM0.666687 20V22.6667H19.3334V20H0.666687Z",fill:"#a82227"})),_("WS_PRINT_SEWERAGE_APPLICATION_LABEL"))),l.createElement(a.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},l.createElement(a.SubmitBar,{label:_("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{C.push("/digit-ui/employee")},style:{margin:"10px 10px 0px 0px"}}))))},ie=function(e,n,t,l,o){return Promise.resolve(function(e,n,t){try{return Promise.resolve(E(t,n)).then(function(t){var l,o,i,a,r,u,d;let s=[];null!=e&&e.amendmentId&&s.push({title:n("PDF_STATIC_LABEL_APPLICATION_NUMBER_LABEL")+":",value:null==e?void 0:e.amendmentId}),null!=e&&e.consumerCode&&s.push({title:n("PDF_STATIC_LABEL_CONSUMER_NUMBER_LABEL")+":",value:null==e?void 0:e.consumerCode});const c={title:n("WS_DEMAND_REVISION_BASIS_DETAILS"),values:[{title:n("WS_DEMAND_REVISION_BASIS"),value:n(null==e?void 0:e.amendmentReason)||n("CS_NA")},{title:n((p=null==e?void 0:e.amendmentReason,"COURT_CASE_SETTLEMENT"===p?"WS_COURT_ORDER_NO":"ARREAR_WRITE_OFF"===p||"ONE_TIME_SETTLEMENT"===p?"WS_GOVERNMENT_NOTIFICATION_NUMBER":"WS_DOCUMENT_NO")),value:(null==e?void 0:e.reasonDocumentNumber)||n("CS_NA")},{title:n("WS_COMMON_FROM_DATE_LABEL"),value:S(null==e?void 0:e.effectiveFrom)},v({},"COURT_CASE_SETTLEMENT"!==(null==e?void 0:e.amendmentReason)&&{title:n("WS_COMMON_TO_DATE_LABEL"),value:S(null==e?void 0:e.effectiveTill)})]};var p;const m=null==e?void 0:e.documents,E={title:n("WS_COMMON_DOCUMENTS_DETAILS"),isAttachments:!0,values:null==m?void 0:m.map(e=>n(null==e?void 0:e.documentType))};return v({title:"",isHeader:!0,header:n((null==e||null===(l=e.tenantId)||void 0===l||null===(o=l.replace(".","_"))||void 0===o?void 0:o.toUpperCase())+"_HEADER_LABEL"),subHeader:n((null==e||null===(i=e.tenantId)||void 0===i||null===(a=i.replace(".","_"))||void 0===a?void 0:a.toUpperCase())+"_SUB_HEADER_LABEL"),description:n((null==e||null===(r=e.tenantId)||void 0===r||null===(u=r.replace(".","_"))||void 0===u?void 0:u.toUpperCase())+"_DES_HEADER_LABEL"),typeOfApplication:n("WS_BILL_AMEND_APP"),date:Digit.DateUtils.ConvertEpochToDate(null==e||null===(d=e.auditDetails)||void 0===d?void 0:d.createdTime)||"NA",values:s,DemandRevision:c,Attachments:E},t)})}catch(e){return Promise.reject(e)}}(e,t,n)).then(function(e){return{tenantId:n,headerDetails:e,bodyDetails:l[1],t:t}})},ae=()=>{var e,n,r,u,d,s,c;const v=Digit.ULBService.getCurrentTenantId(),{state:p}=i.useLocation(),{t:m}=o.useTranslation();let E="WATER";(null==p||null===(e=p.Amendment)||void 0===e?void 0:e.consumerCode).includes("SW")&&(E="SEWERAGE");const{mutate:S,isSuccess:_,isError:f,isLoading:g,data:C}=Digit.Hooks.ws.useCreateBillAmendment(),{isLoading:N,data:y}=Digit.Hooks.ws.useWSApplicationDetailsBillAmendment(m,v,null==C||null===(n=C.Amendments)||void 0===n||null===(r=n[0])||void 0===r?void 0:r.amendmentId,E,{enabled:_});return t.useEffect(()=>{null!=p&&p.Amendment&&S(p)},[]),l.createElement("div",null,g||N?l.createElement(a.Loader,null):l.createElement(a.Card,null,l.createElement(a.Banner,{message:m(_?"WS_APPLICATION_SUBMITTED_SUCCESSFULLY_LABEL":"CS_WATER_UPDATE_APPLICATION_FAILED"),applicationNumber:null==C||null===(u=C.Amendments)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.amendmentId,info:_?m("WS_MYCONNECTIONS_APPLICATION_NO"):"",successful:!!_}),f?null:l.createElement(a.CardText,null,m("WS_MESSAGE_SUB_DESCRIPTION_LABEL")),(_||!(null==C||null===(s=C.Amendments)||void 0===s||null===(c=s[0])||void 0===c||!c.amendmentId))&&!f&&l.createElement("div",{className:"primary-label-btn d-grid",style:{marginLeft:"unset",marginBottom:"10px",padding:"0px 8px"},onClick:()=>{!function(e,n,t,l,o){try{ie(e,n,t,l).then(e=>Digit.Utils.pdf.generateBillAmendPDF(e)),Promise.resolve()}catch(e){return Promise.reject(e)}}(null==y?void 0:y.amendment,v,m,null==y?void 0:y.applicationDetails)}},l.createElement("svg",{width:"20",height:"18",viewBox:"0 0 20 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{marginTop:"3px"}},l.createElement("path",{d:"M17 5H3C1.34 5 0 6.34 0 8V14H4V18H16V14H20V8C20 6.34 18.66 5 17 5ZM14 16H6V11H14V16ZM17 9C16.45 9 16 8.55 16 8C16 7.45 16.45 7 17 7C17.55 7 18 7.45 18 8C18 8.55 17.55 9 17 9ZM16 0H4V4H16V0Z",fill:"#a82227"})),m("WS_PRINT_APPLICATION_LABEL")),l.createElement(a.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},l.createElement(i.Link,{to:"/digit-ui/employee",style:{marginRight:"1rem"}},l.createElement(a.SubmitBar,{label:m("CORE_COMMON_GO_TO_HOME")})))))},re=()=>{var e,n,t;const{state:r}=i.useLocation(),{t:u}=o.useTranslation();return l.createElement("div",null,l.createElement(a.Card,null,l.createElement(a.Banner,{message:u(r?"WS_BILL_AMENDMENT_BANNER":"WS_BILL_AMENDMENT_FAILURE"),applicationNumber:null==r||null===(e=r.state)||void 0===e||null===(n=e.Amendments)||void 0===n||null===(t=n[0])||void 0===t?void 0:t.amendmentId,info:"",successful:!(null==r||!r.status)}),r.status?l.createElement(a.CardText,null,u("WS_BILL_AMENDMENT_MESSAGE")):null,l.createElement(a.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},l.createElement(i.Link,{to:"/digit-ui/employee",style:{marginRight:"1rem"}},l.createElement(a.SubmitBar,{label:u("CORE_COMMON_GO_TO_HOME")})))))},ue=e=>{var n;const t=null==e?void 0:e.doorNo,l=null==e?void 0:e.street,o=null==e?void 0:e.landmark,i=null==e||null===(n=e.locality)||void 0===n?void 0:n.name,a=null==e?void 0:e.pincode;return(t?t+", ":"")+(l?l+", ":"")+(o?o+", ":"")+(i?i+", ":"")+((null==e?void 0:e.city)||"")+(a?", "+a:"")},de=(e,n)=>{var t,l,o;const i=null===(l=((null==e||null===(t=e.owners)||void 0===t?void 0:t.filter(e=>1==e.active))||[]).sort((e,n)=>{var t,l;return(null==e||null===(t=e.additionalDetails)||void 0===t?void 0:t.ownerSequence)-(null==n||null===(l=n.additionalDetails)||void 0===l?void 0:l.ownerSequence)}))||void 0===l||null===(o=l.map(e=>e.name))||void 0===o?void 0:o.join(",");return{title:n("WS_COMMON_PROPERTY_DETAILS"),values:[{title:n("WS_PROPERTY_ID_LABEL"),value:n(""+(null==e?void 0:e.propertyId))||n("CS_NA")},{title:n("WS_OWN_DETAIL_NAME"),value:i||n("CS_NA")},{title:n("WS_PROPERTY_ADDRESS_LABEL"),value:ue(null==e?void 0:e.address)||n("CS_NA")}]}},se=(e,n)=>{var t,l,o,i,a,r,u,d,s,c;return{title:n("WS_COMMON_CONNECTION_HOLDER_DETAILS_HEADER"),values:null!==(null==e?void 0:e.connectionHolders)?[{title:n("WS_OWN_DETAIL_NAME"),value:(null==e||null===(t=e.connectionHolders)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.name)||n("CS_NA")},{title:n("CORE_COMMON_MOBILE_NUMBER"),value:(null==e||null===(o=e.connectionHolders)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.mobileNumber)||n("CS_NA")},{title:n("WS_CONN_HOLDER_COMMON_FATHER_OR_HUSBAND_NAME"),value:(null==e||null===(a=e.connectionHolders)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.fatherOrHusbandName)||n("CS_NA")},{title:n("WS_CORRESPONDANCE_ADDRESS_LABEL"),value:(null==e||null===(u=e.connectionHolders)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.correspondenceAddress)||n("CS_NA")},{title:n("CORE_COMMON_EMAIL_ID"),value:(null==e||null===(s=e.connectionHolders)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.emailId)||n("CS_NA")}]:[{title:n("WS_CONN_HOLDER_SAME_AS_OWNER_DETAILS"),value:n("SCORE_YES")||n("CS_NA")}]}},ce=(e,n)=>({title:n("WS_DISCONNECTION_DETAILS"),values:[{title:n("WS_DISCONNECTION_TYPE"),value:!0===(null==e?void 0:e.isDisconnectionTemporary)?n("WS_DISCONNECTIONTYPE_TEMPORARY"):n("WS_DISCONNECTIONTYPE_PERMANENT")||n("CS_NA")},{title:n("WS_DISCONNECTION_PROPOSED_DATE"),value:Digit.DateUtils.ConvertEpochToDate(null==e?void 0:e.dateEffectiveFrom)||n("CS_NA")},{title:n("WS_DISCONNECTION_REASON"),value:(null==e?void 0:e.disconnectionReason)||n("CS_NA")}]}),ve=(e,n)=>{const t=null==e?void 0:e.documents;return{title:n("WS_COMMON_DOCUMENTS_DETAILS"),isAttachments:!0,values:null==t?void 0:t.map(e=>n(null==e?void 0:e.documentType))}},pe=function(e,n,t,l){try{var o,i;function a(){return Promise.resolve(function(e,n,t){try{return Promise.resolve(E(t,n)).then(function(t){var l,o,i,a,r,u,d,s;let c=[];return null!=e&&e.applicationNo&&c.push({title:n("PDF_STATIC_LABEL_APPLICATION_NUMBER_LABEL")+":",value:null==e?void 0:e.applicationNo}),null!=e&&e.applicationType&&c.push({title:n("WS_SERVICE_NAME")+":",value:n("WS_APPLICATION_TYPE_"+(null==e?void 0:e.applicationType))}),v({title:"",email:"",phoneNumber:"",isHeader:!0,header:n((null==e||null===(l=e.tenantId)||void 0===l||null===(o=l.replace(".","_"))||void 0===o?void 0:o.toUpperCase())+"_HEADER_LABEL"),subHeader:n((null==e||null===(i=e.tenantId)||void 0===i||null===(a=i.replace(".","_"))||void 0===a?void 0:a.toUpperCase())+"_SUB_HEADER_LABEL"),description:n((null==e||null===(r=e.tenantId)||void 0===r||null===(u=r.replace(".","_"))||void 0===u?void 0:u.toUpperCase())+"_DES_HEADER_LABEL"),typeOfApplication:null!=e&&null!==(d=e.applicationNo)&&void 0!==d&&d.includes("SW")?n("WS_SEWERAGE_DISCONNECTION"):n("WS_WATER_DISCONNECTION"),date:Digit.DateUtils.ConvertEpochToDate(null==e||null===(s=e.additionalDetails)||void 0===s?void 0:s.appCreatedDate)||"NA",values:c},t)})}catch(e){return Promise.reject(e)}}(e,l,t)).then(function(o){return{t:l,tenantId:t,email:"",phoneNumber:"",headerDetails:[o],details:[de(n,l),se(e,l),ce(e,l),ve(e,l)]}})}const r=null==e||null===(o=e.DisconnectionResponse)||void 0===o||null===(i=o.documents)||void 0===i?void 0:i.map(e=>null==e?void 0:e.fileStoreId);let u;const d=function(){if(r)return Promise.resolve(Digit.UploadServices.Filefetch(r,Digit.ULBService.getStateId())).then(function(e){u=e})}();return Promise.resolve(d&&d.then?d.then(a):a())}catch(e){return Promise.reject(e)}},me=e=>{var n;const{t:t}=o.useTranslation(),r=(Digit.ULBService.getCurrentTenantId(),i.useHistory());let u=g(location.search);const d=Digit.SessionStorage.get("WS_DISCONNECTION");return l.createElement("div",null,l.createElement(a.Card,null,l.createElement(a.Banner,{message:t("WS_APPLICATION_SUBMITTED_SUCCESSFULLY_LABEL"),applicationNumber:null==u?void 0:u.applicationNumber,info:null!=u&&null!==(n=u.applicationNumber)&&void 0!==n&&n.includes("WS")?t("WS_WATER_APPLICATION_NUMBER_LABEL"):t("WS_SEWERAGE_APPLICATION_NUMBER_LABEL"),successful:!0,style:{padding:"10px"},headerStyles:{fontSize:"32px"},infoOneStyles:{paddingTop:"20px"}}),l.createElement(a.CardText,{style:{paddingBottom:"10px",marginBottom:"10px"}},t("WS_MESSAGE_SUB_DESCRIPTION_LABEL")),l.createElement("div",{style:{display:"flex"}},l.createElement("div",{className:"primary-label-btn d-grid",style:{marginLeft:"unset",marginBottom:"10px",padding:"0px 8px"},onClick:()=>{const e=null==d?void 0:d.DisconnectionResponse;pe(e,null==d?void 0:d.propertyDetails,null==e?void 0:e.tenantId,t).then(e=>Digit.Utils.pdf.generatev1(e))}},l.createElement("svg",{width:"20",height:"23",viewBox:"0 0 20 23",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M19.3334 8H14V0H6.00002V8H0.666687L10 17.3333L19.3334 8ZM0.666687 20V22.6667H19.3334V20H0.666687Z",fill:"#a82227"})),t("WS_PRINT_APPLICATION_LABEL"))),l.createElement(a.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},l.createElement(a.SubmitBar,{label:t("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{r.push("/digit-ui/employee")},style:{margin:"10px 10px 0px 0px"}}))))},Ee=e=>{var n;const t=null==e?void 0:e.doorNo,l=null==e?void 0:e.street,o=null==e?void 0:e.landmark,i=null==e||null===(n=e.locality)||void 0===n?void 0:n.name,a=null==e?void 0:e.pincode;return(t?t+", ":"")+(l?l+", ":"")+(o?o+", ":"")+(i?i+", ":"")+((null==e?void 0:e.city)||"")+(a?", "+a:"")},Se=(e,n)=>{var t,l,o;const i=null===(l=((null==e||null===(t=e.owners)||void 0===t?void 0:t.filter(e=>1==e.active))||[]).sort((e,n)=>{var t,l;return(null==e||null===(t=e.additionalDetails)||void 0===t?void 0:t.ownerSequence)-(null==n||null===(l=n.additionalDetails)||void 0===l?void 0:l.ownerSequence)}))||void 0===l||null===(o=l.map(e=>e.name))||void 0===o?void 0:o.join(",");return{title:n("WS_COMMON_PROPERTY_DETAILS"),values:[{title:n("WS_PROPERTY_ID_LABEL"),value:n(""+(null==e?void 0:e.propertyId))||n("CS_NA")},{title:n("WS_OWN_DETAIL_NAME"),value:i||n("CS_NA")},{title:n("WS_PROPERTY_ADDRESS_LABEL"),value:Ee(null==e?void 0:e.address)||n("CS_NA")}]}},_e=(e,n)=>{var t,l,o,i,a,r,u,d,s,c;return{title:n("WS_COMMON_CONNECTION_HOLDER_DETAILS_HEADER"),values:null!==(null==e?void 0:e.connectionHolders)?[{title:n("WS_OWN_DETAIL_NAME"),value:(null==e||null===(t=e.connectionHolders)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.name)||n("CS_NA")},{title:n("CORE_COMMON_MOBILE_NUMBER"),value:(null==e||null===(o=e.connectionHolders)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.mobileNumber)||n("CS_NA")},{title:n("WS_CONN_HOLDER_COMMON_FATHER_OR_HUSBAND_NAME"),value:(null==e||null===(a=e.connectionHolders)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.fatherOrHusbandName)||n("CS_NA")},{title:n("WS_CORRESPONDANCE_ADDRESS_LABEL"),value:(null==e||null===(u=e.connectionHolders)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.correspondenceAddress)||n("CS_NA")},{title:n("CORE_COMMON_EMAIL_ID"),value:(null==e||null===(s=e.connectionHolders)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.emailId)||n("CS_NA")}]:[{title:n("WS_CONN_HOLDER_SAME_AS_OWNER_DETAILS"),value:n("SCORE_YES")||n("CS_NA")}]}},fe=(e,n)=>({title:n("WS_RESTORATION_DETAILS"),values:[{title:n("WS_RESTORATION_PROPOSED_DATE"),value:Digit.DateUtils.ConvertEpochToDate(null==e?void 0:e.dateEffectiveFrom)||n("CS_NA")},{title:n("WS_RESTORATION_REASON"),value:(null==e?void 0:e.reconnectionReason)||n("CS_NA")}]}),ge=function(e,n,t,l){try{var o,i;function a(){return Promise.resolve(function(e,n,t){try{return Promise.resolve(E(t,n)).then(function(t){var l,o,i,a,r,u,d,s;let c=[];return null!=e&&e.applicationNo&&c.push({title:n("PDF_STATIC_LABEL_APPLICATION_NUMBER_LABEL")+":",value:null==e?void 0:e.applicationNo}),null!=e&&e.applicationType&&c.push({title:n("WS_SERVICE_NAME")+":",value:n("WS_APPLICATION_TYPE_"+(null==e?void 0:e.applicationType))}),v({title:"",email:"",phoneNumber:"",isHeader:!0,header:n((null==e||null===(l=e.tenantId)||void 0===l||null===(o=l.replace(".","_"))||void 0===o?void 0:o.toUpperCase())+"_HEADER_LABEL"),subHeader:n((null==e||null===(i=e.tenantId)||void 0===i||null===(a=i.replace(".","_"))||void 0===a?void 0:a.toUpperCase())+"_SUB_HEADER_LABEL"),description:n((null==e||null===(r=e.tenantId)||void 0===r||null===(u=r.replace(".","_"))||void 0===u?void 0:u.toUpperCase())+"_DES_HEADER_LABEL"),typeOfApplication:null!=e&&null!==(d=e.applicationNo)&&void 0!==d&&d.includes("SW")?n("WS_SEWERAGE_RESTORATION"):n("WS_WATER_RESORATION"),date:Digit.DateUtils.ConvertEpochToDate(null==e||null===(s=e.additionalDetails)||void 0===s?void 0:s.appCreatedDate)||"NA",values:c},t)})}catch(e){return Promise.reject(e)}}(e,l,t)).then(function(o){return{t:l,tenantId:t,email:"",phoneNumber:"",headerDetails:[o],details:[Se(n,l),_e(e,l),fe(e,l)]}})}const r=null==e||null===(o=e.DisconnectionResponse)||void 0===o||null===(i=o.documents)||void 0===i?void 0:i.map(e=>null==e?void 0:e.fileStoreId);let u;const d=function(){if(r)return Promise.resolve(Digit.UploadServices.Filefetch(r,Digit.ULBService.getStateId())).then(function(e){u=e})}();return Promise.resolve(d&&d.then?d.then(a):a())}catch(e){return Promise.reject(e)}},Ce=e=>{var n;const{t:t}=o.useTranslation(),r=(Digit.ULBService.getCurrentTenantId(),i.useHistory());let u=g(location.search);const d=Digit.SessionStorage.get("WS_DISCONNECTION");return l.createElement("div",null,l.createElement(a.Card,null,l.createElement(a.Banner,{message:t("WS_APPLICATION_SUBMITTED_SUCCESSFULLY_LABEL"),applicationNumber:null==u?void 0:u.applicationNumber,info:null!=u&&null!==(n=u.applicationNumber)&&void 0!==n&&n.includes("WS")?t("WS_WATER_APPLICATION_NUMBER_LABEL"):t("WS_SEWERAGE_APPLICATION_NUMBER_LABEL"),successful:!0,style:{padding:"10px"},headerStyles:{fontSize:"32px"},infoOneStyles:{paddingTop:"20px"}}),l.createElement(a.CardText,{style:{paddingBottom:"10px",marginBottom:"10px"}},t("WS_MESSAGE_SUB_DESCRIPTION_LABEL")),l.createElement("div",{style:{display:"flex"}},l.createElement("div",{className:"primary-label-btn d-grid",style:{marginLeft:"unset",marginBottom:"10px",padding:"0px 8px"},onClick:()=>{const e=null==d?void 0:d.DisconnectionResponse;ge(e,null==d?void 0:d.propertyDetails,null==e?void 0:e.tenantId,t).then(e=>Digit.Utils.pdf.generatev1(e))}},l.createElement("svg",{width:"20",height:"23",viewBox:"0 0 20 23",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M19.3334 8H14V0H6.00002V8H0.666687L10 17.3333L19.3334 8ZM0.666687 20V22.6667H19.3334V20H0.666687Z",fill:"#a82227"})),t("WS_PRINT_APPLICATION_LABEL"))),l.createElement(a.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},l.createElement(a.SubmitBar,{label:t("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{r.push("/digit-ui/employee")},style:{margin:"10px 10px 0px 0px"}}))))},Ne=e=>{var n,t;let{location:r}=e;const{t:u}=o.useTranslation(),d=i.useLocation().search,s=new URLSearchParams(d).get("from")||null,c=new URLSearchParams(d).get("isEdit")||null,p=new URLSearchParams(d).get("applicationNumber")||null;let m=window.Digit.Utils.browser.isMobile(),E=window.location.href.split("?")[1],S=[{path:"/digit-ui/employee",content:u("ES_COMMON_HOME"),show:!0,style:m?{width:"20%"}:{}},{path:"/digit-ui/employee/ws/create-application",content:u("ES_COMMON_WS_DOCUMENTS_REQUIRED"),show:!!r.pathname.includes("/create-application")},{path:"/digit-ui/employee/water/inbox",content:u("ES_COMMON_BILLS_WATER_INBOX_LABEL"),show:!!r.pathname.includes("/water/inbox")},{path:"/digit-ui/employee/ws/water/bill-amendment/inbox",content:u("ES_COMMON_BILL_AMEND_WATER_INBOX_LABEL"),show:!!r.pathname.includes("/water/bill-amendment/inbox")},{path:"/digit-ui/employee/ws/sewerage/bill-amendment/inbox",content:u("ES_COMMON_BILL_AMEND_SEWERAGE_INBOX_LABEL"),show:!!r.pathname.includes("/sewerage/bill-amendment/inbox")},{path:"/digit-ui/employee/ws/water/search-application",content:s?u(s)+" / "+u("WS_SEARCH_APPLICATIONS"):u("WS_SEARCH_APPLICATIONS"),show:!!r.pathname.includes("/water/search-application"),isBack:s&&!0},{path:"/digit-ui/employee/ws/water/search-connection",content:s?u(s)+" / "+u("WS_SEARCH_CONNECTION"):u("WS_SEARCH_CONNECTION"),show:!!r.pathname.includes("/water/search-connection"),isBack:s&&!0},{path:"/digit-ui/employee/ws/water/wns-search",content:s?u(s)+" / "+u("WS_SEARCH_INTEGRATED_BILL"):u("WS_SEARCH_INTEGRATED_BILL"),show:!!r.pathname.includes("/water/wns-search"),isBack:s&&!0},{path:"/digit-ui/employee/ws/sewerage/search-application",content:s?u(s)+" / "+u("WS_SEARCH_APPLICATIONS"):u("WS_SEARCH_APPLICATIONS"),show:!!r.pathname.includes("/sewerage/search-application"),isBack:s&&!0},{path:"/digit-ui/employee/ws/sewerage/search-connection",content:s?u(s)+" / "+u("WS_SEARCH_CONNECTION"):u("WS_SEARCH_CONNECTION"),show:!!r.pathname.includes("/sewerage/search-connection"),isBack:s&&!0},{path:"/digit-ui/employee/sewerage/inbox",content:u("ES_COMMON_BILLS_SEWERAGE_INBOX_LABEL"),show:!!r.pathname.includes("/sewerage/inbox")},{path:"/digit-ui/employee/ws/new-application",content:u("ES_COMMON_WS_NEW_CONNECTION"),show:!!r.pathname.includes("/new-application")},{path:""+(null==r?void 0:r.pathname)+r.search,content:u("ACTION_TEST_RESPONSE"),show:!!r.pathname.includes("/ws-response")},{path:"/digit-ui/employee/ws/consumption-details",content:s?u(s)+" / "+u("WS_VIEW_CONSUMPTION_DETAIL"):u("WS_VIEW_CONSUMPTION_DETAIL"),show:!!r.pathname.includes("/consumption-details"),isBack:s&&!0},{path:"true"===sessionStorage.getItem("redirectedfromEDIT")?null!=p&&p.includes("SW_AP")?"/digit-ui/employee/ws/sewerage/search-application":"/digit-ui/employee/ws/water/search-application":"/digit-ui/employee/ws/application-details",content:s?u(s)+" / "+u("WS_APPLICATION_DETAILS_HEADER"):u("WS_APPLICATION_DETAILS_HEADER"),show:!!r.pathname.includes("/application-details"),isBack:"true"!==sessionStorage.getItem("redirectedfromEDIT")&&s&&!0},{path:"true"===sessionStorage.getItem("redirectedfromEDIT")?null!=p&&p.includes("SW_AP")?"/digit-ui/employee/ws/sewerage/search-application":"/digit-ui/employee/ws/water/search-application":"/digit-ui/employee/ws/modify-details",content:s?u(s)+" / "+u("WS_APPLICATION_DETAILS_HEADER"):u("WS_APPLICATION_DETAILS_HEADER"),show:!!r.pathname.includes("/modify-details"),isBack:"true"!==sessionStorage.getItem("redirectedfromEDIT")&&s&&!0},{path:"/digit-ui/employee/ws/disconnection-details",content:s?u(s)+" / "+u("WS_APPLICATION_DETAILS_HEADER"):u("WS_APPLICATION_DETAILS_HEADER"),show:!!r.pathname.includes("/disconnection-details"),isBack:s&&!0},{path:"/digit-ui/employee/ws/connection-details",content:s?u(s)+" / "+u("WS_COMMON_CONNECTION_DETAIL"):u("WS_COMMON_CONNECTION_DETAIL"),show:!!r.pathname.includes("/connection-details"),isBack:s&&!0},{path:"/digit-ui/employee/ws/edit-application",content:u("WS_APPLICATION_DETAILS_HEADER")+" / "+u("WS_APP_FOR_WATER_AND_SEWERAGE_EDIT_LABEL"),show:!!r.pathname.includes("/edit-application"),isBack:!0},{path:""+(null==r?void 0:r.pathname)+r.search,content:u("WS_APPLICATION_DETAILS_HEADER")+" / "+u("WF_EMPLOYEE_NEWSW1_ACTIVATE_CONNECTION"),show:!!r.pathname.includes("/activate-connection"),isBack:!0},{path:""+(null==r?void 0:r.pathname)+r.search,content:u("WS_APPLICATION_DETAILS_HEADER")+" / "+u("WS_WATER_SEWERAGE_DISCONNECTION_EDIT_LABEL"),show:!!r.pathname.includes("edit-disconnection-application"),isBack:!0},{path:""+(null==r?void 0:r.pathname)+r.search,content:u("WS_APPLICATION_DETAILS_HEADER")+" / "+u("WS_WATER_SEWERAGE_DISCONNECTION_EDIT_LABEL"),show:!!r.pathname.includes("config-by-disconnection-application"),isBack:!0},{path:""+(null==r?void 0:r.pathname)+r.search,content:u("WS_APPLICATION_DETAILS_HEADER")+" / "+u("WS_WATER_SEWERAGE_DISCONNECTION_EDIT_LABEL"),show:!!r.pathname.includes("resubmit-disconnection-application"),isBack:!0},{path:"/digit-ui/employee/ws/new-disconnection/docsrequired",content:u("WS_NEW_DISCONNECTION_DOCS_REQUIRED"),show:!!r.pathname.includes("/new-disconnection/docsrequired")},{path:"/digit-ui/employee/ws/new-disconnection/application-form",content:u("WS_NEW_DISCONNECTION_DOCS_REQUIRED")+" / "+u("WS_NEW_DISCONNECTION_APPLICATION"),show:!!r.pathname.includes("/new-disconnection/application-form"),isBack:!0},{path:""+(null==r?void 0:r.pathname)+r.search,content:""+u("WS_NEW_DISCONNECTION_RESPONSE"),show:!!r.pathname.includes("/ws-disconnection-response"),isBack:!0},{path:""+(null==r?void 0:r.pathname)+r.search,content:s?u(s)+" / "+u("WS_MODIFY_CONNECTION_BUTTON"):u("WS_MODIFY_CONNECTION_BUTTON"),show:!!r.pathname.includes("ws/modify-application"),isBack:!0},{path:"/digit-ui/employee/ws/required-documents",content:u("ES_COMMON_WS_DOCUMENTS_REQUIRED"),show:!!r.pathname.includes("/required-documents")},{path:E?"/digit-ui/employee/ws/bill-amendment?"+E:"/digit-ui/employee/ws/bill-amendment",content:u("WS_BILL_AMEND_APP"),show:!(!r.pathname.includes("ws/bill-amendment")||c)},{path:"/digit-ui/employee/ws/bill-amendment",content:u("WS_BILL_AMEND_EDIT_APP"),show:!(!r.pathname.includes("ws/bill-amendment")||!c)},{path:"/digit-ui/employee/ws/response",content:u("WS_ACK_SCREEN"),show:!!r.pathname.includes("/employee/ws/response"),isclickable:!1},{path:"/digit-ui/employee/ws/generate-note-bill-amendment",content:u("CS_TITLE_GENERATE_NOTE"),show:!!r.pathname.includes("/generate-note-bill-amendment")},{path:"/digit-ui/employee/ws/water/bulk-bil",content:u("CS_TITLE_BULK_BILL"),show:!!r.pathname.includes("/ws/water/bulk-bill")}],_=(g=(f=S).slice().reverse().findIndex(e=>!0===e.show))>=0?f.length-1-g:g;var f,g;return S[_]=v({},S[_],{isclickable:!1}),l.createElement("div",{style:null!==(n=window)&&void 0!==n&&n.location.href.includes("/employee/ws/bill-amendment")||null!==(t=window)&&void 0!==t&&t.location.href.includes("/employee/ws/response")?{marginLeft:"20px"}:{}},l.createElement(a.BreadCrumb,{crumbs:S,spanStyle:{maxWidth:"min-content"}}))},ye=e=>{var n,t,o,r,u,d,s,c,p,m,E,S,_,f,g,C,N,y,D,T,h,A,I,O,b,L,R,w,W,P,M,x,B,F,U,k,H,j,V,z,Y,G,q,K,X,Z,$,J,Q,ee,ne,te,le,ie;let{path:ue}=e;const de=i.useLocation(),se=null===(n=Digit)||void 0===n||null===(t=n.ComponentRegistryService)||void 0===t?void 0:t.getComponent("WSDocsRequired"),ce=null===(o=Digit)||void 0===o||null===(r=o.ComponentRegistryService)||void 0===r?void 0:r.getComponent("WSInbox"),ve=null===(u=Digit)||void 0===u||null===(d=u.ComponentRegistryService)||void 0===d?void 0:d.getComponent("WSDisconnectionDocsRequired"),pe=null===(s=Digit)||void 0===s||null===(c=s.ComponentRegistryService)||void 0===c?void 0:c.getComponent("WSApplicationBillAmendment"),Ee=null===(p=Digit)||void 0===p||null===(m=p.ComponentRegistryService)||void 0===m?void 0:m.getComponent("WSRequiredDocuments"),Se=null===(E=Digit)||void 0===E||null===(S=E.ComponentRegistryService)||void 0===S?void 0:S.getComponent("WSNewApplication"),_e=null===(_=Digit)||void 0===_||null===(f=_.ComponentRegistryService)||void 0===f?void 0:f.getComponent("WSApplicationDetails"),fe=null===(g=Digit)||void 0===g||null===(C=g.ComponentRegistryService)||void 0===C?void 0:C.getComponent("WSGetConnectionDetails"),ge=null===(N=Digit)||void 0===N||null===(y=N.ComponentRegistryService)||void 0===y?void 0:y.getComponent("WSActivateConnection"),ye=null===(D=Digit)||void 0===D||null===(T=D.ComponentRegistryService)||void 0===T?void 0:T.getComponent("WSApplicationDetailsBillAmendment"),De=null===(h=Digit)||void 0===h||null===(A=h.ComponentRegistryService)||void 0===A?void 0:A.getComponent("WSSearch"),Te=null===(I=Digit)||void 0===I||null===(O=I.ComponentRegistryService)||void 0===O?void 0:O.getComponent("WSSearchWater"),he=null===(b=Digit)||void 0===b||null===(L=b.ComponentRegistryService)||void 0===L?void 0:L.getComponent("WSEditApplication"),Ae=null===(R=Digit)||void 0===R||null===(w=R.ComponentRegistryService)||void 0===w?void 0:w.getComponent("WSConsumptionDetails"),Ie=null===(W=Digit)||void 0===W||null===(P=W.ComponentRegistryService)||void 0===P?void 0:P.getComponent("WSModifyApplication"),Oe=null===(M=Digit)||void 0===M||null===(x=M.ComponentRegistryService)||void 0===x?void 0:x.getComponent("WSEditModifyApplication"),be=null===(B=Digit)||void 0===B||null===(F=B.ComponentRegistryService)||void 0===F?void 0:F.getComponent("WSDisconnectionApplication"),Le=null===(U=Digit)||void 0===U||null===(k=U.ComponentRegistryService)||void 0===k?void 0:k.getComponent("WSRestorationApplication"),Re=null===(H=Digit)||void 0===H||null===(j=H.ComponentRegistryService)||void 0===j?void 0:j.getComponent("WSEditApplicationByConfig"),we=null===(V=Digit)||void 0===V||null===(z=V.ComponentRegistryService)||void 0===z?void 0:z.getComponent("WSBillIAmendMentInbox"),We=null===(Y=Digit)||void 0===Y||null===(G=Y.ComponentRegistryService)||void 0===G?void 0:G.getComponent("WSGetDisconnectionDetails"),Pe=null===(q=Digit)||void 0===q||null===(K=q.ComponentRegistryService)||void 0===K?void 0:K.getComponent("WSModifyApplicationDetails"),Me=null===(X=Digit)||void 0===X||null===(Z=X.ComponentRegistryService)||void 0===Z?void 0:Z.getComponent("WSEditDisconnectionApplication"),xe=null===($=Digit)||void 0===$||null===(J=$.ComponentRegistryService)||void 0===J?void 0:J.getComponent("WSEditDisconnectionByConfig"),Be=null===(Q=Digit)||void 0===Q||null===(ee=Q.ComponentRegistryService)||void 0===ee?void 0:ee.getComponent("WSResubmitDisconnection"),Fe=null===(ne=Digit)||void 0===ne||null===(te=ne.ComponentRegistryService)||void 0===te?void 0:te.getComponent("WSSearchIntegrated"),Ue=null===(le=Digit)||void 0===le||null===(ie=le.ComponentRegistryService)||void 0===ie?void 0:ie.getComponent("WSBulkBillGeneration"),ke=window.location.href.includes("/employee/ws/new-application")||window.location.href.includes("/employee/ws/modify-application")||window.location.href.includes("/employee/ws/edit-application")||window.location.href.includes("/employee/ws/activate-connection")||window.location.href.includes("/employee/ws/application-details")||window.location.href.includes("/employee/ws/modify-details")||window.location.href.includes("/employee/ws/ws-response")||window.location.href.includes("/employee/ws/new-disconnection/application-form")||window.location.href.includes("/employee/ws/ws-disconnection-response")||window.location.href.includes("/employee/ws/consumption-details")||window.location.href.includes("/employee/ws/edit-disconnection-application")||window.location.href.includes("/employee/ws/config-by-disconnection-application")||window.location.href.includes("/employee/ws/resubmit-disconnection-application")||window.location.href.includes("/employee/ws/water/bulk-bill"),He=window.location.href.includes("/employee/ws/create-application")||window.location.href.includes("/employee/ws/new-disconnection/docsrequired");return l.createElement(i.Switch,null,l.createElement(l.Fragment,null,l.createElement("div",{className:"ground-container"},l.createElement("div",{style:ke?{marginLeft:"12px"}:He?{marginLeft:"25px"}:{marginLeft:"-4px"}},l.createElement(Ne,{location:de})),l.createElement(a.PrivateRoute,{path:ue+"/create-application",component:se}),l.createElement(a.PrivateRoute,{path:ue+"/new-application",component:Se}),l.createElement(a.PrivateRoute,{path:ue+"/edit-application",component:he}),l.createElement(a.PrivateRoute,{path:ue+"/edit-disconnection-application",component:Me}),l.createElement(a.PrivateRoute,{path:ue+"/resubmit-disconnection-application",component:Be}),l.createElement(a.PrivateRoute,{path:ue+"/config-by-disconnection-application",component:xe}),l.createElement(a.PrivateRoute,{path:ue+"/application-details",component:_e}),l.createElement(a.PrivateRoute,{path:ue+"/modify-details",component:Pe}),l.createElement(a.PrivateRoute,{path:ue+"/connection-details",component:fe}),l.createElement(a.PrivateRoute,{path:ue+"/bill-amendment",component:()=>l.createElement(pe,{path:ue})}),l.createElement(a.PrivateRoute,{path:ue+"/generate-note-bill-amendment",component:()=>l.createElement(ye,{path:ue})}),l.createElement(a.PrivateRoute,{path:ue+"/response",component:()=>l.createElement(ae,{path:ue})}),l.createElement(a.PrivateRoute,{path:ue+"/response-bill-amend",component:()=>l.createElement(re,{path:ue})}),l.createElement(a.PrivateRoute,{path:ue+"/required-documents",component:()=>l.createElement(Ee,{path:ue})}),l.createElement(a.PrivateRoute,{path:ue+"/activate-connection",component:ge}),l.createElement(a.PrivateRoute,{path:ue+"/water/search-application",component:e=>l.createElement(De,v({},e,{parentRoute:ue}))}),l.createElement(a.PrivateRoute,{path:ue+"/sewerage/search-application",component:e=>l.createElement(De,v({},e,{parentRoute:ue}))}),l.createElement(a.PrivateRoute,{path:ue+"/ws-response",component:oe}),l.createElement(a.PrivateRoute,{path:ue+"/ws-disconnection-response",component:me}),l.createElement(a.PrivateRoute,{path:ue+"/ws-restoration-response",component:Ce}),l.createElement(a.PrivateRoute,{path:ue+"/water/search-connection",component:e=>l.createElement(Te,v({},e,{parentRoute:ue}))}),l.createElement(a.PrivateRoute,{path:ue+"/sewerage/search-connection",component:e=>l.createElement(Te,v({},e,{parentRoute:ue}))}),l.createElement(a.PrivateRoute,{path:ue+"/water/search-demand",component:e=>l.createElement(Te,v({},e,{parentRoute:ue}))}),l.createElement(a.PrivateRoute,{path:ue+"/sewerage/search-demand",component:e=>l.createElement(Te,v({},e,{parentRoute:ue}))}),l.createElement(a.PrivateRoute,{path:ue+"/consumption-details",component:Ae}),l.createElement(a.PrivateRoute,{path:ue+"/modify-application",component:Ie}),l.createElement(a.PrivateRoute,{path:ue+"/modify-application-edit",component:Oe}),l.createElement(a.PrivateRoute,{path:ue+"/disconnection-application",component:ve}),l.createElement(a.PrivateRoute,{path:ue+"/new-disconnection",component:be}),l.createElement(a.PrivateRoute,{path:ue+"/new-restoration",component:Le}),l.createElement(a.PrivateRoute,{path:ue+"/bill-amend/inbox",component:e=>l.createElement(we,v({},e,{parentRoute:ue}))}),l.createElement(a.PrivateRoute,{path:ue+"/water/inbox",component:e=>l.createElement(ce,v({},e,{parentRoute:ue}))}),l.createElement(a.PrivateRoute,{path:ue+"/sewerage/inbox",component:e=>l.createElement(ce,v({},e,{parentRoute:ue}))}),l.createElement(a.PrivateRoute,{path:ue+"/edit-application-by-config",component:Re}),l.createElement(a.PrivateRoute,{path:ue+"/disconnection-details",component:We}),l.createElement(a.PrivateRoute,{path:ue+"/water/bill-amendment/inbox",component:e=>l.createElement(we,v({},e,{parentRoute:ue}))}),l.createElement(a.PrivateRoute,{path:ue+"/sewerage/bill-amendment/inbox",component:e=>l.createElement(we,v({},e,{parentRoute:ue}))}),l.createElement(a.PrivateRoute,{path:ue+"/water/wns-search",component:e=>l.createElement(Fe,v({},e,{parentRoute:ue}))}),l.createElement(a.PrivateRoute,{path:ue+"/water/bulk-bill",component:e=>l.createElement(Ue,v({},e,{parentRoute:ue}))}))))};let De=[];const Te=e=>{let{currentStep:n=1,flow:t=""}=e;const{t:i}=o.useTranslation(),r=window.Digit.Utils.browser.isMobile();return De=["WS_COMMON_PROPERTY_DETAILS","WS_COMMON_CONNECTION_DETAIL","WS_COMMON_DOCUMENT_DETAILS","WS_COMMON_SUMMARY"],l.createElement("div",{className:"timeline-container",style:r?{}:{maxWidth:"960px",minWidth:"640px",marginRight:"auto"}},De.map((e,t,o)=>l.createElement("div",{className:"timeline-checkpoint",key:t},l.createElement("div",{className:"timeline-content"},l.createElement("span",{className:"circle "+(t<=n-1&&"active")},t<n-1?l.createElement(a.TickMark,null):t+1),l.createElement("span",{className:"secondary-color"},i(e))),t<o.length-1&&l.createElement("span",{className:"line "+(t<n-1&&"active")}))))};function he(e,n){try{var t=e()}catch(e){return n(e)}return t&&t.then?t.then(void 0,n):t}function Ae(e){var n;let{t:o,key:i,document:r,setDocuments:u,error:d,setError:s,documents:c,setCheckRequiredFields:p}=e;const m=null==c?void 0:c.filter(e=>{var n;return null==e||null===(n=e.documentType)||void 0===n?void 0:n.includes(null==r?void 0:r.code)})[0],E=Digit.ULBService.getCurrentTenantId(),[S,_]=t.useState(m?v({},m,{active:!0,code:null==m?void 0:m.documentType,i18nKey:null==m?void 0:m.documentType}):1===(null==r||null===(n=r.dropdownData)||void 0===n?void 0:n.length)?null==r?void 0:r.dropdownData[0]:{}),[f,g]=t.useState(null),[C,N]=t.useState(()=>(null==m?void 0:m.fileStoreId)||null);return t.useEffect(()=>{null!=S&&S.code&&u(e=>{const n=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==S?void 0:S.code));return 0===(null==C?void 0:C.length)||null===C?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==C),{documentType:null==S?void 0:S.code,fileStoreId:C,documentUid:(null==S?void 0:S.documentUid)||null,id:(null==S?void 0:S.id)||null,fileName:(null==f?void 0:f.name)||"",status:"ACTIVE"}]})},[C,S]),t.useEffect(()=>{!function(){try{s(null);const e=function(){if(f){const e=function(){if(f.size>=5242880)s(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=he(function(){return N(null),Promise.resolve(Digit.UploadServices.Filestorage("WS",f,null==E?void 0:E.split(".")[0])).then(function(e){var n,t,l,i;(null==e||null===(n=e.data)||void 0===n||null===(t=n.files)||void 0===t?void 0:t.length)>0?N(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):s(o("CS_FILE_UPLOAD_ERROR"))})},function(){s(o("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[f]),l.createElement("div",{style:{marginBottom:"24px"}},l.createElement(a.CardLabel,{style:{fontWeight:"700"}},null!=r&&r.required?l.createElement(l.Fragment,null,o(null==r?void 0:r.i18nKey)," ",l.createElement("span",{style:{color:"red"}},"*")):o(null==r?void 0:r.i18nKey)),l.createElement(a.Dropdown,{t:o,isMandatory:!1,option:null==r?void 0:r.dropdownData,selected:S,optionKey:"i18nKey",select:e=>_(e)}),l.createElement(a.UploadFile,{id:"noc-doc-"+i,extraStyleName:"propertyCreate",accept:"image/*, .pdf, .png, .jpeg, .jpg",onUpload:function(e){g(e.target.files[0])},onDelete:()=>{N(null),p(!0)},message:C?"1 "+o("CS_ACTION_FILEUPLOADED"):o("ES_NO_FILE_SELECTED_LABEL"),error:d}))}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const Ie=e=>{var n,o,i,u,d;const{connectionDetail:s,focusIndex:c,setFocusIndex:p,t:m,config:E,setError:S,clearErrors:_,formState:f,setIsErrors:g,isErrors:C,setConnectionDetails:N,pipeSizeList:y,connectionDetails:T,waterSewarageSelection:h,formData:A}=e,{control:I,formState:O,watch:b,trigger:L,getValues:R}=r.useForm(),w=b(),{errors:W}=O;t.useEffect(()=>{L()},[]),t.useEffect(()=>{if(Object.entries(w).length>0){const e=Object.keys(w),n={};if(e.forEach(e=>n[e]=s[e]),!U.isEqual(w,n)){let e=!0;Object.keys(w).map(n=>{!w[n]&&e&&(e=!1,g(!1))}),e&&g(!0);let n=[v({},w)];N(n),L()}}},[w,T]),t.useEffect(()=>{var e,n,t,l;let o=!0;null===(e=Object.keys(null==T?void 0:T[0]))||void 0===e||e.map(e=>{!T[0][e]&&0!=T[0][e]&&o&&(o=!1)}),o&&(null===(n=Object.keys(null==T?void 0:T[0]))||void 0===n?void 0:n.length)>1&&_("ConnectionDetails"),null!=T&&null!==(t=T[0])&&void 0!==t&&t.sewerage||(_(E.key,{type:"proposedToilets"}),_(E.key,{type:"proposedWaterClosets"})),null!=T&&null!==(l=T[0])&&void 0!==l&&l.water||(_(E.key,{type:"proposedPipeSize"}),_(E.key,{type:"proposedTaps"})),L()},[T,h,null==A||null===(n=A.DocumentsRequired)||void 0===n?void 0:n.documents]),t.useEffect(()=>{var e;Object.keys(W).length&&!U.isEqual((null===(e=f.errors[E.key])||void 0===e?void 0:e.type)||{},W)?S(E.key,{type:W}):!Object.keys(W).length&&f.errors[E.key]&&C&&_(E.key)},[W]);const P={width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"},M=window.Digit.Utils.browser.isMobile(),x=window.location.href.includes("/employee");return l.createElement("div",null,l.createElement("div",{style:{marginBottom:"16px"}},l.createElement(a.CardLabel,{style:{fontWeight:"700"}},m("WS_APPLY_FOR")+"*"),l.createElement("div",{style:{display:"flex",gap:"0 3rem"}},l.createElement(r.Controller,{control:I,name:"water",defaultValue:null==s?void 0:s.water,isMandatory:!0,render:e=>{var n;return l.createElement(a.CheckBox,{label:m("WATER_CONNECTION"),name:"water",autoFocus:c.index===(null==s?void 0:s.key)&&"water"===c.type,errorStyle:!(!O.touched.water||null==W||null===(n=W.water)||void 0===n||!n.message),onChange:n=>{(n.target.checked||null!=s&&s.sewerage)&&(e.onChange(n.target.checked),p({index:null==s?void 0:s.key,type:"water"}))},checked:null==s?void 0:s.water,style:{paddingBottom:"10px",paddingTop:"3px"},onBlur:e.onBlur})}}),l.createElement(r.Controller,{control:I,name:"sewerage",defaultValue:null==s?void 0:s.sewerage,type:"number",isMandatory:!0,render:e=>{var n;return l.createElement(a.CheckBox,{label:m("SEWERAGE_CONNECTION"),name:"sewerage",autoFocus:c.index===(null==s?void 0:s.key)&&"sewerage"===c.type,errorStyle:!(!O.touched.sewerage||null==W||null===(n=W.sewerage)||void 0===n||!n.message),onChange:n=>{(n.target.checked||null!=s&&s.water)&&(e.onChange(n.target.checked),p({index:null==s?void 0:s.key,type:"sewerage"}))},checked:null==s?void 0:s.sewerage,style:{paddingBottom:"10px",paddingTop:"3px"},onBlur:e.onBlur})}})),(null==s?void 0:s.water)&&l.createElement("div",null,l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:M&&x?{fontWeight:"700",width:"100%"}:{marginTop:"-5px",fontWeight:"700"},className:"card-label-smaller"},m("WS_NO_OF_PROPOSED_TAPS_LABEL")+"*"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:I,name:"proposedTaps",defaultValue:null==s?void 0:s.proposedTaps,rules:{validate:e=>!(!(parseInt(e)>0&&e&&D("WSOnlyNumbers").test(e))&&e)||m("ERR_DEFAULT_INPUT_FIELD_MSG"),required:m("REQUIRED_FIELD")},type:"number",isMandatory:!0,render:e=>{var n;return l.createElement(a.TextInput,{type:"number",value:e.value,autoFocus:c.index===(null==s?void 0:s.key)&&"proposedTaps"===c.type,errorStyle:!(!O.touched.proposedTaps||null==W||null===(n=W.proposedTaps)||void 0===n||!n.message),onChange:n=>{e.onChange(n.target.value),p({index:null==s?void 0:s.key,type:"proposedTaps"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur})}}))),l.createElement(a.CardLabelError,{style:P},O.touched.proposedTaps?null==W||null===(o=W.proposedTaps)||void 0===o?void 0:o.message:""),l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:M&&x?{fontWeight:"700",width:"100%",paddingTop:"10px"}:{marginTop:"-5px",fontWeight:"700"},className:"card-label-smaller"},m("WS_PROPOSED_PIPE_SIZE_IN_INCHES_LABEL")+"*"),l.createElement(r.Controller,{control:I,name:"proposedPipeSize",defaultValue:null==s?void 0:s.proposedPipeSize,rules:{required:m("REQUIRED_FIELD")},isMandatory:!0,render:e=>{var n;return l.createElement(a.Dropdown,{className:"form-field",selected:R("proposedPipeSize"),disable:!1,option:y,errorStyle:!(!O.touched.proposedPipeSize||null==W||null===(n=W.proposedPipeSize)||void 0===n||!n.message),select:n=>{e.onChange(n)},optionKey:"i18nKey",onBlur:e.onBlur,t:m})}})),l.createElement(a.CardLabelError,{style:P},O.touched.proposedPipeSize?null==W||null===(i=W.proposedPipeSize)||void 0===i?void 0:i.message:"")),(null==s?void 0:s.sewerage)&&l.createElement("div",null,l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:M&&x?{fontWeight:"700",width:"100%"}:{marginTop:"-5px",fontWeight:"700"},className:"card-label-smaller"},m("WS_PROPOSED_WATER_CLOSETS_LABEL")+"*"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:I,name:"proposedWaterClosets",defaultValue:null==s?void 0:s.proposedWaterClosets,rules:{validate:e=>!(!(parseInt(e)>0&&e&&D("WSOnlyNumbers").test(e))&&e)||m("ERR_DEFAULT_INPUT_FIELD_MSG"),required:m("REQUIRED_FIELD")},type:"number",isMandatory:!0,render:e=>{var n;return l.createElement(a.TextInput,{type:"number",value:e.value,autoFocus:c.index===(null==s?void 0:s.key)&&"proposedWaterClosets"===c.type,errorStyle:!(!O.touched.proposedWaterClosets||null==W||null===(n=W.proposedWaterClosets)||void 0===n||!n.message),onChange:n=>{e.onChange(n.target.value),p({index:null==s?void 0:s.key,type:"proposedWaterClosets"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur})}}))),l.createElement(a.CardLabelError,{style:P},O.touched.proposedWaterClosets?null==W||null===(u=W.proposedWaterClosets)||void 0===u?void 0:u.message:""),l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:M&&x?{fontWeight:"700",width:"100%"}:{marginTop:"-5px",fontWeight:"700"},className:"card-label-smaller"},m("WS_PROPOSED_WATER_TOILETS_LABEL")+"*"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:I,name:"proposedToilets",defaultValue:null==s?void 0:s.proposedToilets,rules:{validate:e=>!(!(parseInt(e)>0&&e&&D("WSOnlyNumbers").test(e))&&e)||m("ERR_DEFAULT_INPUT_FIELD_MSG"),required:m("REQUIRED_FIELD")},type:"number",isMandatory:!0,render:e=>{var n;return l.createElement(a.TextInput,{type:"number",value:e.value,autoFocus:c.index===(null==s?void 0:s.key)&&"proposedToilets"===c.type,errorStyle:!(!O.touched.proposedToilets||null==W||null===(n=W.proposedToilets)||void 0===n||!n.message),onChange:n=>{e.onChange(n.target.value),p({index:null==s?void 0:s.key,type:"proposedToilets"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur})}}))),l.createElement(a.CardLabelError,{style:P},O.touched.proposedToilets?null==W||null===(d=W.proposedToilets)||void 0===d?void 0:d.message:""))))},Oe=()=>({roadType:{code:"",value:"",i18nKey:""},area:"",status:"",id:null,key:Date.now()}),be=e=>{var n,o,i,u;const{roadCutt:d,index:s,focusIndex:c,allRoadCuttingDetails:p,setFocusIndex:E,removeroadCutt:S,formData:_,formState:f,setRoadCuttingDetails:g,mdmsData:C,t:N,setError:y,clearErrors:D,config:T,isEditScreen:h}=e,{control:A,formState:I,watch:O,trigger:b,getValues:L}=r.useForm(),R=O(),{errors:w}=I,W=t.useMemo(()=>{var e,n;const t=(window.location.href.includes("sewerage")?null==C||null===(e=C["sw-services-calculation"])||void 0===e?void 0:e.RoadType:(null==C||null===(n=C["ws-services-calculation"])||void 0===n?void 0:n.RoadType)||[]).filter(e=>!0===(null==e?void 0:e.isActive));return t.forEach(e=>{var n;return e.i18nKey="WS_ROADTYPE_"+m(null==e||null===(n=e.code)||void 0===n?void 0:n.toUpperCase()," ","_")}),t},[C]);t.useEffect(()=>{b()},[]),t.useEffect(()=>{b()},[p,null==_?void 0:_.connectionDetails,null==_?void 0:_.plumberDetails]);const[P,M]=l.useState({});t.useEffect(()=>{U.isEqual(P,R)||(M(v({},R)),g(e=>e.map(e=>e.key&&e.key===d.key?v({},e,R):v({},e))),b())},[R]),t.useEffect(()=>{var e;Object.keys(w).length&&!U.isEqual((null===(e=f.errors[T.key])||void 0===e?void 0:e.type)||{},w)?y(T.key,{type:w}):!Object.keys(w).length&&f.errors[T.key]&&D(T.key)},[w]);const x={width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"};return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginBottom:"16px"}},l.createElement("div",{className:"label-field-pair"},l.createElement("h2",{className:"card-label card-label-smaller",style:{color:"#505A5F"}},N("WS_COMMON_ROAD_CUTTING_DETAILS")," ",(null==p?void 0:p.filter(e=>"INACTIVE"!==e.status).length)>1?s+1:null)),l.createElement("div",{style:{border:"1px solid #E3E3E3",padding:"16px",marginTop:"8px"}},(null==p?void 0:p.filter(e=>"INACTIVE"!==e.status).length)>1?l.createElement(a.LinkButton,{label:l.createElement(a.DeleteIcon,{style:{float:"right",position:"relative",bottom:"-6px"},fill:1!=(null==p?void 0:p.length)?"#494848":"#FAFAFA"}),style:{width:"100px",display:"inline",background:"black"},onClick:e=>S(d)}):null,l.createElement("div",{style:1==(null==p?void 0:p.filter(e=>"INACTIVE"!==e.status).length)?{}:{marginTop:"40px"}},l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{className:"card-label-smaller"},N("WS_ROAD_TYPE")+" *"),l.createElement(r.Controller,{control:A,name:"roadType",defaultValue:null==d?void 0:d.roadType,rules:{required:N("REQUIRED_FIELD")},isMandatory:!0,render:e=>{var n;return l.createElement(a.Dropdown,{className:"form-field",selected:L("roadType"),errorStyle:!(!I.touched.roadType||null==w||null===(n=w.roadType)||void 0===n||!n.message),select:n=>{e.onChange(n)},option:W,onBlur:e.onBlur,optionKey:"i18nKey",disable:!1,t:N})}})),l.createElement(a.CardLabelError,{style:x},null!==(n=I.touched)&&void 0!==n&&n.roadType?null==w||null===(o=w.roadType)||void 0===o?void 0:o.message:""),l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{className:"card-label-smaller"},N("WS_AREA_SQ_FT")+" *"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:A,name:"area",defaultValue:null==d?void 0:d.area,rules:{required:N("CORE_COMMON_REQUIRED_ERRMSG"),validate:{pattern:e=>!!/^[0-9]{1,10}$/i.test(e)||N("ERR_DEFAULT_INPUT_FIELD_MSG")}},render:e=>l.createElement(a.TextInput,{value:e.value,disable:h,autoFocus:c.index===d.key&&"area"===c.type,onChange:n=>{e.onChange(n.target.value),E({index:d.key,type:"area"})},onBlur:n=>{E({index:-1}),e.onBlur(n)}})}))),l.createElement(a.CardLabelError,{style:x},null!==(i=I.touched)&&void 0!==i&&i.area?null==w||null===(u=w.area)||void 0===u?void 0:u.message:"")))))},Le=e=>{var n,o,i,u,d,s,c,p,m;const{connectionHolderDetail:E,focusIndex:S,setFocusIndex:_,t:f,formData:g,config:C,setError:N,clearErrors:y,formState:T,connectionHolderDetails:h,setIsErrors:A,isErrors:I,setConnectionHolderDetails:O,menu:b,GuardianOptions:L,Menu:R}=e,{control:w,formState:W,trigger:P,getValues:M}=r.useForm(),[x,B]=t.useState(null==E?void 0:E.name),[F,k]=t.useState(null==E?void 0:E.gender),[H,j]=t.useState(null==E?void 0:E.mobileNumber),[V,z]=t.useState(null==E?void 0:E.guardian),[Y,G]=t.useState(null==E?void 0:E.relationship),[q,K]=t.useState(null==E?void 0:E.address),[X,Z]=t.useState(null==E?void 0:E.ownerType),[$,J]=t.useState(null==E?void 0:E.sameAsOwnerDetails),[Q,ee]=t.useState(null==E?void 0:E.uuid),[ne,te]=t.useState(null==E?void 0:E.emailId),le={name:x,gender:F,mobileNumber:H,guardian:V,relationship:Y,ownerType:X,sameAsOwnerDetails:$,address:q,uuid:Q,emailId:ne},{errors:oe}=W,ie=window.Digit.Utils.browser.isMobile(),ae=window.location.href.includes("/employee"),{data:re}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"DataSecurity",[{name:"SecurityPolicy"}],{select:e=>{var n,t;return(null==e||null===(n=e.DataSecurity)||void 0===n||null===(t=n.SecurityPolicy)||void 0===t?void 0:t.find(e=>"User"==(null==e?void 0:e.model)))||{}}});t.useEffect(()=>{P()},[]),t.useEffect(()=>{if(Object.entries(le).length>0&&null!=le&&le.name||null!=le&&le.uuid){const e=Object.keys(le),n={};if(e.forEach(e=>n[e]=E[e]),!U.isEqual(le,n)){let e=!0;Object.keys(le).map(n=>{!le[n]&&e&&(e=!1,A(!1))}),e&&A(!0);let n=[v({},le)];O(n),P()}}},[le]),t.useEffect(()=>{var e,n,t;let l=!0;null===(e=Object.keys(null==h?void 0:h[0]))||void 0===e||e.map(e=>{!h[0][e]&&0!=h[0][e]&&l&&(l=!1)}),null!=h&&null!==(n=h[0])&&void 0!==n&&n.sameAsOwnerDetails||l&&(null===(t=Object.keys(null==h?void 0:h[0]))||void 0===t?void 0:t.length)>1?y("ConnectionHolderDetails"):P()},[h]),t.useEffect(()=>{$?y("ConnectionHolderDetails"):P()},[$]),t.useEffect(()=>{var e;Object.keys(oe).length&&!U.isEqual((null===(e=T.errors[C.key])||void 0===e?void 0:e.type)||{},oe)?N(C.key,{type:oe}):!Object.keys(oe).length&&T.errors[C.key]&&I&&y(C.key)},[oe]);const ue=()=>!(!window.location.href.includes("edit")&&!window.location.href.includes("modify")),de={width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"};return l.createElement("div",null,l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:w,name:"sameAsOwnerDetails",defaultValue:$,isMandatory:!0,render:e=>{var n;return l.createElement(a.CheckBox,{label:f("WS_SAME_AS_PROPERTY_OWNERS"),name:"sameAsOwnerDetails",autoFocus:S.index===(null==E?void 0:E.key)&&"sameAsOwnerDetails"===S.type,errorStyle:!(!W.touched.sameAsOwnerDetails||null==oe||null===(n=oe.sameAsOwnerDetails)||void 0===n||!n.message),onChange:n=>{J(n.target.checked),e.onChange(n.target.checked),_({index:null==E?void 0:E.key,type:"sameAsOwnerDetails"})},checked:$,style:{paddingBottom:"10px",paddingTop:"3px"},onBlur:e.onBlur})}})),$?null:l.createElement("div",null,l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:ie&&ae?{fontWeight:"700",width:"100%"}:{marginTop:"-5px",fontWeight:"700"},className:"card-label-smaller"},f("WS_OWN_DETAIL_NAME")+"*"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:w,name:"name",defaultValue:null==E?void 0:E.name,rules:{validate:e=>!!(e&&D("Name").test(e)||!e)||f("ERR_DEFAULT_INPUT_FIELD_MSG"),required:f("REQUIRED_FIELD")},isMandatory:!0,render:e=>{var n,t,o,i,r,u,d,s,c,v,p;return l.createElement("div",{style:{display:"flex",alignItems:"baseline",marginRight:ie&&ae?"":(ue(),"-4%")}},l.createElement(a.TextInput,{value:M("name"),autoFocus:S.index===(null==E?void 0:E.key)&&"name"===S.type,errorStyle:!(!W.touched.name||null==oe||null===(n=oe.name)||void 0===n||!n.message),onChange:n=>{B(n.target.value),e.onChange(n.target.value),_({index:null==E?void 0:E.key,type:"name"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur,style:!ue()||null!==(t=M("name"))&&void 0!==t&&t.includes("*")?{}:(Digit.Utils.checkPrivacy(re,{uuid:null==E?void 0:E.uuid,fieldName:"name",model:"User"})||Digit.Utils.checkPrivacy(re,{uuid:null==E?void 0:E.uuid,fieldName:"mobileNumber",model:"User"}),ie&&ae?{}:{width:"96%"})}),ue()&&l.createElement("div",{style:ie&&ae?{}:{marginRight:"-10px",marginLeft:"10px"}},l.createElement(a.WrapUnMaskComponent,{unmaskField:n=>{B(n),e.onChange(n)},iseyevisible:!(null===(o=M("name"))||void 0===o||!o.includes("*")),privacy:{uuid:null==E?void 0:E.uuid,fieldName:"name",model:"WnSConnectionOwner",loadData:{serviceName:null!=g&&null!==(i=g.ConnectionDetails)&&void 0!==i&&null!==(r=i[0])&&void 0!==r&&r.water?"/ws-services/wc/_search":"/sw-services/swc/_search",requestBody:{},requestParam:{tenantId:null==g||null===(u=g.cpt)||void 0===u||null===(d=u.details)||void 0===d?void 0:d.tenantId,applicationNumber:null==g||null===(s=g.ConnectionDetails)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.applicationNo},jsonPath:null!=g&&null!==(v=g.ConnectionDetails)&&void 0!==v&&null!==(p=v[0])&&void 0!==p&&p.water?"WaterConnection[0].connectionHolders[0].name":"SewerageConnections[0].connectionHolders[0].name",isArray:!1}}})))}}))),l.createElement(a.CardLabelError,{style:de},W.touched.name?null==oe||null===(n=oe.name)||void 0===n?void 0:n.message:""),l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:ie&&ae?{fontWeight:"700",width:"100%"}:{marginTop:"-5px",fontWeight:"700"},className:"card-label-smaller"},f("WS_CONN_HOLDER_OWN_DETAIL_GENDER_LABEL")+"*"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:w,name:"gender",defaultValue:null==E?void 0:E.gender,rules:{required:f("REQUIRED_FIELD")},isMandatory:!0,render:e=>{var n,t,o,i,r,u,d,s,c,v;return l.createElement("div",{style:{display:"flex",marginRight:!ue()||ie&&ae?"unset":"-20px",width:ie&&ae?"":ue()?"197%":"208%"}},l.createElement(a.Dropdown,{className:"form-field",selected:M("gender"),disable:!1,option:b,errorStyle:!(!W.touched.gender||null==oe||null===(n=oe.gender)||void 0===n||!n.message),select:n=>{k(n),e.onChange(n)},optionKey:"i18nKey",onBlur:e.onBlur,t:f}),ue()&&l.createElement("div",{style:{marginRight:"-10px",marginLeft:ie&&ae?"":"8px",marginTop:"15px"}},l.createElement(a.WrapUnMaskComponent,{unmaskField:n=>{const t={code:n,i18nKey:"COMMON_GENDER_"+n,name:n};k(t),e.onChange(t)},iseyevisible:!(null===(t=F.i18nKey)||void 0===t||!t.includes("*")),privacy:{uuid:null==E?void 0:E.uuid,fieldName:"gender",model:"WnSConnectionOwner",loadData:{serviceName:null!=g&&null!==(o=g.ConnectionDetails)&&void 0!==o&&null!==(i=o[0])&&void 0!==i&&i.water?"/ws-services/wc/_search":"/sw-services/swc/_search",requestBody:{},requestParam:{tenantId:null==g||null===(r=g.cpt)||void 0===r||null===(u=r.details)||void 0===u?void 0:u.tenantId,applicationNumber:null==g||null===(d=g.ConnectionDetails)||void 0===d||null===(s=d[0])||void 0===s?void 0:s.applicationNo},jsonPath:null!=g&&null!==(c=g.ConnectionDetails)&&void 0!==c&&null!==(v=c[0])&&void 0!==v&&v.water?"WaterConnection[0].connectionHolders[0].gender":"SewerageConnections[0].connectionHolders[0].gender",isArray:!1}}})))}}))),l.createElement(a.CardLabelError,{style:de},W.touched.gender?null==oe||null===(o=oe.gender)||void 0===o?void 0:o.message:""),l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:ie&&ae?{fontWeight:"700",width:"100%"}:{marginTop:"-5px",fontWeight:"700"},className:"card-label-smaller"},f("CORE_COMMON_MOBILE_NUMBER")+"*"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:w,name:"mobileNumber",defaultValue:null==E?void 0:E.mobileNumber,rules:{validate:e=>!!(e&&D("MobileNoWithPrivacy").test(e)||!e||e.includes("*"))||f("ERR_DEFAULT_INPUT_FIELD_MSG"),required:f("REQUIRED_FIELD")},isMandatory:!0,render:e=>{var n,t,o,i,r,u,d,s,c,v,p,m;return l.createElement("div",{style:{display:"flex",alignItems:"baseline",marginRight:ae&&ie?"":null===(n=M("mobileNumber"))||void 0===n||!n.includes("*")||ie&&ae?"-4%":"-20px"}},l.createElement("div",{className:"employee-card-input employee-card-input--front",style:{position:"relative",marginTop:"4px"}},"+91"),l.createElement(a.TextInput,{value:M("mobileNumber"),autoFocus:S.index===(null==E?void 0:E.key)&&"mobileNumber"===S.type,errorStyle:!(!W.touched.mobileNumber||null==oe||null===(t=oe.mobileNumber)||void 0===t||!t.message),onChange:n=>{j(n.target.value),e.onChange(n.target.value),_({index:null==E?void 0:E.key,type:"mobileNumber"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur,style:!ue()||null!==(o=M("mobileNumber"))&&void 0!==o&&o.includes("*")?{background:"#FAFAFA"}:Digit.Utils.checkPrivacy(re,{uuid:null==E?void 0:E.uuid,fieldName:"connectionHoldersMobileNumber",model:"WnSConnectionOwner"})||Digit.Utils.checkPrivacy(re,{uuid:null==E?void 0:E.uuid,fieldName:"mobileNumber",model:"User"})?ie&&ae?{}:{width:"96%",background:"#FAFAFA"}:ie&&ae?{}:{width:"96%"}}),ue()&&l.createElement("div",{style:ie&&ae?{}:{marginRight:"-10px",marginLeft:"10px"}},l.createElement(a.WrapUnMaskComponent,{unmaskField:n=>{j(n),e.onChange(n)},iseyevisible:!(null===(i=M("mobileNumber"))||void 0===i||!i.includes("*")),privacy:{uuid:null==E?void 0:E.uuid,fieldName:"connectionHoldersMobileNumber",model:"WnSConnectionOwner",loadData:{serviceName:null!=g&&null!==(r=g.ConnectionDetails)&&void 0!==r&&null!==(u=r[0])&&void 0!==u&&u.water?"/ws-services/wc/_search":"/sw-services/swc/_search",requestBody:{},requestParam:{tenantId:null==g||null===(d=g.cpt)||void 0===d||null===(s=d.details)||void 0===s?void 0:s.tenantId,applicationNumber:null==g||null===(c=g.ConnectionDetails)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.applicationNo},jsonPath:null!=g&&null!==(p=g.ConnectionDetails)&&void 0!==p&&null!==(m=p[0])&&void 0!==m&&m.water?"WaterConnection[0].connectionHolders[0].mobileNumber":"SewerageConnections[0].connectionHolders[0].mobileNumber",isArray:!1}}})))}}))),l.createElement(a.CardLabelError,{style:de},W.touched.mobileNumber?null==oe||null===(i=oe.mobileNumber)||void 0===i?void 0:i.message:""),l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:ie&&ae?{fontWeight:"700",width:"100%"}:{marginTop:"-5px",fontWeight:"700"},className:"card-label-smaller"},f("WS_OWN_DETAIL_GUARDIAN_LABEL")+"*"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:w,name:"guardian",defaultValue:null==E?void 0:E.guardian,rules:{validate:e=>!!(e&&D("Name").test(e)||!e||e.includes("*"))||f("ERR_DEFAULT_INPUT_FIELD_MSG"),required:f("REQUIRED_FIELD")},isMandatory:!0,render:e=>{var n,t,o,i,r,u,d,s,c,v,p,m;return l.createElement("div",{style:{display:"flex",alignItems:"baseline",marginRight:ae&&ie?"":null===(n=M("guardian"))||void 0===n||!n.includes("*")||ie&&ae?"-4%":"-20px"}},l.createElement(a.TextInput,{value:M("guardian"),autoFocus:S.index===(null==E?void 0:E.key)&&"guardian"===S.type,errorStyle:!(!W.touched.guardian||null==oe||null===(t=oe.guardian)||void 0===t||!t.message),onChange:n=>{z(n.target.value),e.onChange(n.target.value),_({index:null==E?void 0:E.key,type:"guardian"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur,style:!ue()||null!==(o=M("guardian"))&&void 0!==o&&o.includes("*")?{}:Digit.Utils.checkPrivacy(re,{uuid:null==E?void 0:E.uuid,fieldName:"fatherOrHusbandName",model:"WnSConnectionOwner"})||Digit.Utils.checkPrivacy(re,{uuid:null==E?void 0:E.uuid,fieldName:"mobileNumber",model:"User"})?ie&&ae?{}:{width:"96.2%"}:ie&&ae?{}:{width:"96%"}}),ue()&&l.createElement("div",{style:ie&&ae?{}:{marginRight:"-10px",marginLeft:"10px"}},l.createElement(a.WrapUnMaskComponent,{unmaskField:n=>{z(n),e.onChange(n)},iseyevisible:!(null===(i=M("guardian"))||void 0===i||!i.includes("*")),privacy:{uuid:null==E?void 0:E.uuid,fieldName:"fatherOrHusbandName",model:"WnSConnectionOwner",loadData:{serviceName:null!=g&&null!==(r=g.ConnectionDetails)&&void 0!==r&&null!==(u=r[0])&&void 0!==u&&u.water?"/ws-services/wc/_search":"/sw-services/swc/_search",requestBody:{},requestParam:{tenantId:null==g||null===(d=g.cpt)||void 0===d||null===(s=d.details)||void 0===s?void 0:s.tenantId,applicationNumber:null==g||null===(c=g.ConnectionDetails)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.applicationNo},jsonPath:null!=g&&null!==(p=g.ConnectionDetails)&&void 0!==p&&null!==(m=p[0])&&void 0!==m&&m.water?"WaterConnection[0].connectionHolders[0].fatherOrHusbandName":"SewerageConnections[0].connectionHolders[0].fatherOrHusbandName",isArray:!1}}})))}}))),l.createElement(a.CardLabelError,{style:de},W.touched.guardian?null==oe||null===(u=oe.guardian)||void 0===u?void 0:u.message:""),l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:ie&&ae?{fontWeight:"700",width:"100%"}:{marginTop:"-5px",fontWeight:"700"},className:"card-label-smaller"},f("WS_CONN_HOLDER_OWN_DETAIL_RELATION_LABEL")+"*"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:w,name:"relationship",defaultValue:null==E?void 0:E.relationship,rules:{required:f("REQUIRED_FIELD")},isMandatory:!0,render:e=>{var n,t,o,i,r,u,d,s,c,v;return l.createElement("div",{style:{display:"flex",marginRight:!ue()||ie&&ae?"unset":"-20px",width:ie&&ae?"":ue()?"197%":"208%"}},l.createElement(a.Dropdown,{className:"form-field",selected:M("relationship"),disable:!1,option:L,errorStyle:!(!W.touched.relationship||null==oe||null===(n=oe.relationship)||void 0===n||!n.message),select:n=>{G(n),e.onChange(n)},optionKey:"i18nKey",onBlur:e.onBlur,t:f}),ue()&&l.createElement("div",{style:{marginRight:"-10px",marginLeft:ie&&ae?"":"8px",marginTop:"15px"}},l.createElement(a.WrapUnMaskComponent,{unmaskField:n=>{const t={code:n,i18nKey:"COMMON_MASTERS_OWNERTYPE_"+n,name:n};G(t),e.onChange(t)},iseyevisible:!(null==Y||null===(t=Y.i18nKey)||void 0===t||!t.includes("*")),privacy:{uuid:null==E?void 0:E.uuid,fieldName:"relationship",model:"WnSConnection",loadData:{serviceName:null!=g&&null!==(o=g.ConnectionDetails)&&void 0!==o&&null!==(i=o[0])&&void 0!==i&&i.water?"/ws-services/wc/_search":"/sw-services/swc/_search",requestBody:{},requestParam:{tenantId:null==g||null===(r=g.cpt)||void 0===r||null===(u=r.details)||void 0===u?void 0:u.tenantId,applicationNumber:null==g||null===(d=g.ConnectionDetails)||void 0===d||null===(s=d[0])||void 0===s?void 0:s.applicationNo},jsonPath:null!=g&&null!==(c=g.ConnectionDetails)&&void 0!==c&&null!==(v=c[0])&&void 0!==v&&v.water?"WaterConnection[0].connectionHolders[0].relationship":"SewerageConnections[0].connectionHolders[0].relationship",isArray:!1}}})))}}))),l.createElement(a.CardLabelError,{style:de},W.touched.relationship?null==oe||null===(d=oe.relationship)||void 0===d?void 0:d.message:""),l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:ie&&ae?{fontWeight:"700",width:"100%"}:{marginTop:"-5px",fontWeight:"700"},className:"card-label-smaller"},f("WS_CORRESPONDANCE_ADDRESS_LABEL")+"*"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:w,name:"address",defaultValue:null==E?void 0:E.address,rules:{validate:e=>!!(e&&D("Address").test(e)||!e||e.includes("*"))||f("ERR_DEFAULT_INPUT_FIELD_MSG"),required:f("REQUIRED_FIELD")},isMandatory:!0,render:e=>{var n,t,o,i,r,u,d,s,c,v,p,m;return l.createElement("div",{style:{display:"flex",alignItems:"baseline",marginRight:ae&&ie?"":null===(n=M("address"))||void 0===n||!n.includes("*")||ie&&ae?"-4%":"-20px"}},l.createElement(a.TextInput,{value:M("address"),autoFocus:S.index===(null==E?void 0:E.key)&&"address"===S.type,errorStyle:!(!W.touched.address||null==oe||null===(t=oe.address)||void 0===t||!t.message),onChange:n=>{K(n.target.value),e.onChange(n.target.value),_({index:null==E?void 0:E.key,type:"address"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur,style:!ue()||null!==(o=M("address"))&&void 0!==o&&o.includes("*")?{}:Digit.Utils.checkPrivacy(re,{uuid:null==E?void 0:E.uuid,fieldName:"correspondenceAddress",model:"WnSConnectionOwner"})||Digit.Utils.checkPrivacy(re,{uuid:null==E?void 0:E.uuid,fieldName:"mobileNumber",model:"User"})?ie&&ae?{}:{width:"96.2%"}:ie&&ae?{}:{width:"96%"}}),ue()&&l.createElement("div",{style:ie&&ae?{}:{marginRight:"-10px",marginLeft:"10px"}},l.createElement(a.WrapUnMaskComponent,{unmaskField:n=>{K(n),e.onChange(n)},iseyevisible:!(null===(i=M("address"))||void 0===i||!i.includes("*")),privacy:{uuid:null==E?void 0:E.uuid,fieldName:"correspondenceAddress",model:"WnSConnectionOwner",loadData:{serviceName:null!=g&&null!==(r=g.ConnectionDetails)&&void 0!==r&&null!==(u=r[0])&&void 0!==u&&u.water?"/ws-services/wc/_search":"/sw-services/swc/_search",requestBody:{},requestParam:{tenantId:null==g||null===(d=g.cpt)||void 0===d||null===(s=d.details)||void 0===s?void 0:s.tenantId,applicationNumber:null==g||null===(c=g.ConnectionDetails)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.applicationNo},jsonPath:null!=g&&null!==(p=g.ConnectionDetails)&&void 0!==p&&null!==(m=p[0])&&void 0!==m&&m.water?"WaterConnection[0].connectionHolders[0].correspondenceAddress":"SewerageConnections[0].connectionHolders[0].correspondenceAddress",isArray:!1}}})))}}))),l.createElement(a.CardLabelError,{style:de},W.touched.address?null==oe||null===(s=oe.address)||void 0===s?void 0:s.message:""),l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:ie&&ae?{fontWeight:"700",width:"100%"}:{marginTop:"-5px",fontWeight:"700"},className:"card-label-smaller"},f("WS_OWNER_SPECIAL_CATEGORY")+"*"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:w,name:"ownerType",defaultValue:null==E?void 0:E.ownerType,rules:{required:f("REQUIRED_FIELD")},render:e=>{var n,t,o,i,r,u,d,s,c,v;return l.createElement("div",{style:{display:"flex",marginRight:!ue()||ie&&ae?"unset":"-20px",width:ie&&ae?"":ue()?"197%":"208%"}},l.createElement(a.Dropdown,{className:"form-field",selected:M("ownerType"),disable:!1,option:R,errorStyle:!(!W.touched.ownerType||null==oe||null===(n=oe.ownerType)||void 0===n||!n.message),select:n=>{Z(n),e.onChange(n)},optionKey:"i18nKey",onBlur:e.onBlur,t:f}),ue()&&l.createElement("div",{style:{marginRight:"-10px",marginLeft:ie&&ae?"":"8px",marginTop:"10px"}},l.createElement(a.WrapUnMaskComponent,{unmaskField:n=>{const t={code:n,i18nKey:"COMMON_MASTERS_OWNERTYPE_"+n,name:n};Z(t),e.onChange(t)},iseyevisible:!(null==X||null===(t=X.i18nKey)||void 0===t||!t.includes("*")),privacy:{uuid:null==E?void 0:E.uuid,fieldName:"ownerType",model:"WnSConnection",loadData:{serviceName:null!=g&&null!==(o=g.ConnectionDetails)&&void 0!==o&&null!==(i=o[0])&&void 0!==i&&i.water?"/ws-services/wc/_search":"/sw-services/swc/_search",requestBody:{},requestParam:{tenantId:null==g||null===(r=g.cpt)||void 0===r||null===(u=r.details)||void 0===u?void 0:u.tenantId,applicationNumber:null==g||null===(d=g.ConnectionDetails)||void 0===d||null===(s=d[0])||void 0===s?void 0:s.applicationNo},jsonPath:null!=g&&null!==(c=g.ConnectionDetails)&&void 0!==c&&null!==(v=c[0])&&void 0!==v&&v.water?"WaterConnection[0].connectionHolders[0].ownerType":"SewerageConnections[0].connectionHolders[0].ownerType",isArray:!1}}})))}}))),l.createElement(a.CardLabelError,{style:de},W.touched.ownerType?null==oe||null===(c=oe.ownerType)||void 0===c?void 0:c.message:""),l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:ie&&ae?{fontWeight:"700",width:"100%"}:{marginTop:"-5px",fontWeight:"700"},className:"card-label-smaller"},""+f("WS_EMAIL_ID")),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:w,name:"emailId",defaultValue:null==E?void 0:E.emailId,rules:{validate:e=>!!(e&&D("Email").test(e)||!e)||f("ERR_DEFAULT_INPUT_FIELD_MSG")},isMandatory:!1,render:e=>{var n,t,o,i,r,u,d,s,c,v,p;return l.createElement("div",{style:{display:"flex",alignItems:"baseline",marginRight:ie&&ae?"":(ue(),"-4%")}},l.createElement(a.TextInput,{value:M("emailId"),autoFocus:S.index===(null==E?void 0:E.key)&&"emailId"===S.type,errorStyle:!(!W.touched.emailId||null==oe||null===(n=oe.emailId)||void 0===n||!n.message),onChange:n=>{te(n.target.value),e.onChange(n.target.value),(e=>{const n=sessionStorage.getItem("FORMSTATE_ERRORS");let t="string"==typeof n?JSON.parse(n):{};var l,o,i;/^[a-zA-Z0-9._%+-]+@[a-z.-]+\.(com|org|in)$/.test(e)?(y("emailId"),t.ConnectionHolderDetails&&null!==(l=t.ConnectionHolderDetails)&&void 0!==l&&l.type&&null!==(o=t.ConnectionHolderDetails)&&void 0!==o&&null!==(i=o.type)&&void 0!==i&&i.emailId&&delete t.ConnectionHolderDetails.type.emailId,0===Object.keys(t.ConnectionHolderDetails.type).length&&delete t.ConnectionHolderDetails.type,0===Object.keys(t.ConnectionHolderDetails).length&&delete t.ConnectionHolderDetails,sessionStorage.setItem("FORMSTATE_ERRORS",JSON.stringify(t))):(N("emailId",{type:"manual",message:"email id error"}),t.ConnectionHolderDetails||(t.ConnectionHolderDetails={type:{}}),t.ConnectionHolderDetails.type||(t.ConnectionHolderDetails.type={}),t.ConnectionHolderDetails.type.emailId={message:"please enter a valid emailId"},sessionStorage.setItem("FORMSTATE_ERRORS",JSON.stringify(t)))})(n.target.value),_({index:null==E?void 0:E.key,type:"emailId"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur,style:!ue()||null!==(t=M("emailId"))&&void 0!==t&&t.includes("*")?{}:(Digit.Utils.checkPrivacy(re,{uuid:null==E?void 0:E.uuid,fieldName:"name",model:"User"})||Digit.Utils.checkPrivacy(re,{uuid:null==E?void 0:E.uuid,fieldName:"mobileNumber",model:"User"}),ie&&ae?{}:{width:"96%"})}),ue()&&l.createElement("div",{style:ie&&ae?{}:{marginRight:"-10px",marginLeft:"10px"}},l.createElement(a.WrapUnMaskComponent,{unmaskField:n=>{te(n),e.onChange(n)},iseyevisible:!(null===(o=M("emailId"))||void 0===o||!o.includes("*")),privacy:{uuid:null==E?void 0:E.uuid,fieldName:"emailId",model:"WnSConnectionOwner",loadData:{serviceName:null!=g&&null!==(i=g.ConnectionDetails)&&void 0!==i&&null!==(r=i[0])&&void 0!==r&&r.water?"/ws-services/wc/_search":"/sw-services/swc/_search",requestBody:{},requestParam:{tenantId:null==g||null===(u=g.cpt)||void 0===u||null===(d=u.details)||void 0===d?void 0:d.tenantId,applicationNumber:null==g||null===(s=g.ConnectionDetails)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.applicationNo},jsonPath:null!=g&&null!==(v=g.ConnectionDetails)&&void 0!==v&&null!==(p=v[0])&&void 0!==p&&p.water?"WaterConnection[0].connectionHolders[0].emailId":"SewerageConnections[0].connectionHolders[0].emailId",isArray:!1}}})))}}))),l.createElement(a.CardLabelError,{style:de},W.touched.emailId&&null!=oe&&null!==(p=oe.emailId)&&void 0!==p&&p.message?null==oe||null===(m=oe.emailId)||void 0===m?void 0:m.message:"")))};var Re=function(e,n){return e===n||e!=e&&n!=n},we=function(e,n){for(var t=e.length;t--;)if(Re(e[t][0],n))return t;return-1},We=Array.prototype.splice;function Pe(e){var n=-1,t=null==e?0:e.length;for(this.clear();++n<t;){var l=e[n];this.set(l[0],l[1])}}Pe.prototype.clear=function(){this.__data__=[],this.size=0},Pe.prototype.delete=function(e){var n=this.__data__,t=we(n,e);return!(t<0||(t==n.length-1?n.pop():We.call(n,t,1),--this.size,0))},Pe.prototype.get=function(e){var n=this.__data__,t=we(n,e);return t<0?void 0:n[t][1]},Pe.prototype.has=function(e){return we(this.__data__,e)>-1},Pe.prototype.set=function(e,n){var t=this.__data__,l=we(t,e);return l<0?(++this.size,t.push([e,n])):t[l][1]=n,this};var Me,xe=Pe,Be="object"==typeof B&&B&&B.Object===Object&&B,Fe="object"==typeof self&&self&&self.Object===Object&&self,Ue=Be||Fe||Function("return this")(),ke=Ue.Symbol,He=Object.prototype,je=He.hasOwnProperty,Ve=He.toString,ze=ke?ke.toStringTag:void 0,Ye=Object.prototype.toString,Ge=ke?ke.toStringTag:void 0,qe=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Ge&&Ge in Object(e)?function(e){var n=je.call(e,ze),t=e[ze];try{e[ze]=void 0;var l=!0}catch(e){}var o=Ve.call(e);return l&&(n?e[ze]=t:delete e[ze]),o}(e):function(e){return Ye.call(e)}(e)},Ke=function(e){var n=typeof e;return null!=e&&("object"==n||"function"==n)},Xe=function(e){if(!Ke(e))return!1;var n=qe(e);return"[object Function]"==n||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n},Ze=Ue["__core-js_shared__"],$e=(Me=/[^.]+$/.exec(Ze&&Ze.keys&&Ze.keys.IE_PROTO||""))?"Symbol(src)_1."+Me:"",Je=Function.prototype.toString,Qe=function(e){if(null!=e){try{return Je.call(e)}catch(e){}try{return e+""}catch(e){}}return""},en=/^\[object .+?Constructor\]$/,nn=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),tn=function(e,n){var t=function(e,n){return null==e?void 0:e[n]}(e,n);return function(e){return!(!Ke(e)||(n=e,$e&&$e in n))&&(Xe(e)?nn:en).test(Qe(e));var n}(t)?t:void 0},ln=tn(Ue,"Map"),on=tn(Object,"create"),an=Object.prototype.hasOwnProperty,rn=Object.prototype.hasOwnProperty;function un(e){var n=-1,t=null==e?0:e.length;for(this.clear();++n<t;){var l=e[n];this.set(l[0],l[1])}}un.prototype.clear=function(){this.__data__=on?on(null):{},this.size=0},un.prototype.delete=function(e){var n=this.has(e)&&delete this.__data__[e];return this.size-=n?1:0,n},un.prototype.get=function(e){var n=this.__data__;if(on){var t=n[e];return"__lodash_hash_undefined__"===t?void 0:t}return an.call(n,e)?n[e]:void 0},un.prototype.has=function(e){var n=this.__data__;return on?void 0!==n[e]:rn.call(n,e)},un.prototype.set=function(e,n){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=on&&void 0===n?"__lodash_hash_undefined__":n,this};var dn=un,sn=function(e,n){var t,l,o=e.__data__;return("string"==(l=typeof(t=n))||"number"==l||"symbol"==l||"boolean"==l?"__proto__"!==t:null===t)?o["string"==typeof n?"string":"hash"]:o.map};function cn(e){var n=-1,t=null==e?0:e.length;for(this.clear();++n<t;){var l=e[n];this.set(l[0],l[1])}}cn.prototype.clear=function(){this.size=0,this.__data__={hash:new dn,map:new(ln||xe),string:new dn}},cn.prototype.delete=function(e){var n=sn(this,e).delete(e);return this.size-=n?1:0,n},cn.prototype.get=function(e){return sn(this,e).get(e)},cn.prototype.has=function(e){return sn(this,e).has(e)},cn.prototype.set=function(e,n){var t=sn(this,e),l=t.size;return t.set(e,n),this.size+=t.size==l?0:1,this};var vn=cn;function pn(e){var n=this.__data__=new xe(e);this.size=n.size}pn.prototype.clear=function(){this.__data__=new xe,this.size=0},pn.prototype.delete=function(e){var n=this.__data__,t=n.delete(e);return this.size=n.size,t},pn.prototype.get=function(e){return this.__data__.get(e)},pn.prototype.has=function(e){return this.__data__.has(e)},pn.prototype.set=function(e,n){var t=this.__data__;if(t instanceof xe){var l=t.__data__;if(!ln||l.length<199)return l.push([e,n]),this.size=++t.size,this;t=this.__data__=new vn(l)}return t.set(e,n),this.size=t.size,this};var mn=pn,En=function(){try{var e=tn(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),Sn=function(e,n,t){"__proto__"==n&&En?En(e,n,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[n]=t},_n=Object.prototype.hasOwnProperty,fn=function(e,n,t){var l=e[n];_n.call(e,n)&&Re(l,t)&&(void 0!==t||n in e)||Sn(e,n,t)},gn=function(e,n,t,l){var o=!t;t||(t={});for(var i=-1,a=n.length;++i<a;){var r=n[i],u=l?l(t[r],e[r],r,t,e):void 0;void 0===u&&(u=e[r]),o?Sn(t,r,u):fn(t,r,u)}return t},Cn=function(e){return null!=e&&"object"==typeof e},Nn=function(e){return Cn(e)&&"[object Arguments]"==qe(e)},yn=Object.prototype,Dn=yn.hasOwnProperty,Tn=yn.propertyIsEnumerable,hn=Nn(function(){return arguments}())?Nn:function(e){return Cn(e)&&Dn.call(e,"callee")&&!Tn.call(e,"callee")},An=Array.isArray,In=function(){return!1},On=F(function(e,n){var t=n&&!n.nodeType&&n,l=t&&e&&!e.nodeType&&e,o=l&&l.exports===t?Ue.Buffer:void 0;e.exports=(o?o.isBuffer:void 0)||In}),bn=/^(?:0|[1-9]\d*)$/,Ln=function(e,n){var t=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==t||"symbol"!=t&&bn.test(e))&&e>-1&&e%1==0&&e<n},Rn=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},wn={};wn["[object Float32Array]"]=wn["[object Float64Array]"]=wn["[object Int8Array]"]=wn["[object Int16Array]"]=wn["[object Int32Array]"]=wn["[object Uint8Array]"]=wn["[object Uint8ClampedArray]"]=wn["[object Uint16Array]"]=wn["[object Uint32Array]"]=!0,wn["[object Arguments]"]=wn["[object Array]"]=wn["[object ArrayBuffer]"]=wn["[object Boolean]"]=wn["[object DataView]"]=wn["[object Date]"]=wn["[object Error]"]=wn["[object Function]"]=wn["[object Map]"]=wn["[object Number]"]=wn["[object Object]"]=wn["[object RegExp]"]=wn["[object Set]"]=wn["[object String]"]=wn["[object WeakMap]"]=!1;var Wn=function(e){return function(n){return e(n)}},Pn=F(function(e,n){var t=n&&!n.nodeType&&n,l=t&&e&&!e.nodeType&&e,o=l&&l.exports===t&&Be.process,i=function(){try{return l&&l.require&&l.require("util").types||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=i}),Mn=Pn&&Pn.isTypedArray,xn=Mn?Wn(Mn):function(e){return Cn(e)&&Rn(e.length)&&!!wn[qe(e)]},Bn=Object.prototype.hasOwnProperty,Fn=function(e,n){var t=An(e),l=!t&&hn(e),o=!t&&!l&&On(e),i=!t&&!l&&!o&&xn(e),a=t||l||o||i,r=a?function(e,n){for(var t=-1,l=Array(e);++t<e;)l[t]=n(t);return l}(e.length,String):[],u=r.length;for(var d in e)!n&&!Bn.call(e,d)||a&&("length"==d||o&&("offset"==d||"parent"==d)||i&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||Ln(d,u))||r.push(d);return r},Un=Object.prototype,kn=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||Un)},Hn=function(e,n){return function(t){return e(n(t))}},jn=Hn(Object.keys,Object),Vn=Object.prototype.hasOwnProperty,zn=function(e){return null!=e&&Rn(e.length)&&!Xe(e)},Yn=function(e){return zn(e)?Fn(e):function(e){if(!kn(e))return jn(e);var n=[];for(var t in Object(e))Vn.call(e,t)&&"constructor"!=t&&n.push(t);return n}(e)},Gn=Object.prototype.hasOwnProperty,qn=function(e){return zn(e)?Fn(e,!0):function(e){if(!Ke(e))return function(e){var n=[];if(null!=e)for(var t in Object(e))n.push(t);return n}(e);var n=kn(e),t=[];for(var l in e)("constructor"!=l||!n&&Gn.call(e,l))&&t.push(l);return t}(e)},Kn=F(function(e,n){var t=n&&!n.nodeType&&n,l=t&&e&&!e.nodeType&&e,o=l&&l.exports===t?Ue.Buffer:void 0,i=o?o.allocUnsafe:void 0;e.exports=function(e,n){if(n)return e.slice();var t=e.length,l=i?i(t):new e.constructor(t);return e.copy(l),l}}),Xn=function(){return[]},Zn=Object.prototype.propertyIsEnumerable,$n=Object.getOwnPropertySymbols,Jn=$n?function(e){return null==e?[]:(e=Object(e),function(n,t){for(var l=-1,o=null==n?0:n.length,i=0,a=[];++l<o;){var r=n[l];Zn.call(e,r)&&(a[i++]=r)}return a}($n(e)))}:Xn,Qn=function(e,n){for(var t=-1,l=n.length,o=e.length;++t<l;)e[o+t]=n[t];return e},et=Hn(Object.getPrototypeOf,Object),nt=Object.getOwnPropertySymbols?function(e){for(var n=[];e;)Qn(n,Jn(e)),e=et(e);return n}:Xn,tt=function(e,n,t){var l=n(e);return An(e)?l:Qn(l,t(e))},lt=function(e){return tt(e,Yn,Jn)},ot=function(e){return tt(e,qn,nt)},it=tn(Ue,"DataView"),at=tn(Ue,"Promise"),rt=tn(Ue,"Set"),ut=tn(Ue,"WeakMap"),dt=Qe(it),st=Qe(ln),ct=Qe(at),vt=Qe(rt),pt=Qe(ut),mt=qe;(it&&"[object DataView]"!=mt(new it(new ArrayBuffer(1)))||ln&&"[object Map]"!=mt(new ln)||at&&"[object Promise]"!=mt(at.resolve())||rt&&"[object Set]"!=mt(new rt)||ut&&"[object WeakMap]"!=mt(new ut))&&(mt=function(e){var n=qe(e),t="[object Object]"==n?e.constructor:void 0,l=t?Qe(t):"";if(l)switch(l){case dt:return"[object DataView]";case st:return"[object Map]";case ct:return"[object Promise]";case vt:return"[object Set]";case pt:return"[object WeakMap]"}return n});var Et=mt,St=Object.prototype.hasOwnProperty,_t=Ue.Uint8Array,ft=function(e){var n=new e.constructor(e.byteLength);return new _t(n).set(new _t(e)),n},gt=/\w*$/,Ct=ke?ke.prototype:void 0,Nt=Ct?Ct.valueOf:void 0,yt=Object.create,Dt=function(){function e(){}return function(n){if(!Ke(n))return{};if(yt)return yt(n);e.prototype=n;var t=new e;return e.prototype=void 0,t}}(),Tt=Pn&&Pn.isMap,ht=Tt?Wn(Tt):function(e){return Cn(e)&&"[object Map]"==Et(e)},At=Pn&&Pn.isSet,It=At?Wn(At):function(e){return Cn(e)&&"[object Set]"==Et(e)},Ot={};Ot["[object Arguments]"]=Ot["[object Array]"]=Ot["[object ArrayBuffer]"]=Ot["[object DataView]"]=Ot["[object Boolean]"]=Ot["[object Date]"]=Ot["[object Float32Array]"]=Ot["[object Float64Array]"]=Ot["[object Int8Array]"]=Ot["[object Int16Array]"]=Ot["[object Int32Array]"]=Ot["[object Map]"]=Ot["[object Number]"]=Ot["[object Object]"]=Ot["[object RegExp]"]=Ot["[object Set]"]=Ot["[object String]"]=Ot["[object Symbol]"]=Ot["[object Uint8Array]"]=Ot["[object Uint8ClampedArray]"]=Ot["[object Uint16Array]"]=Ot["[object Uint32Array]"]=!0,Ot["[object Error]"]=Ot["[object Function]"]=Ot["[object WeakMap]"]=!1;var bt=function e(n,t,l,o,i,a){var r,u=1&t,d=2&t,s=4&t;if(l&&(r=i?l(n,o,i,a):l(n)),void 0!==r)return r;if(!Ke(n))return n;var c=An(n);if(c){if(r=function(e){var n=e.length,t=new e.constructor(n);return n&&"string"==typeof e[0]&&St.call(e,"index")&&(t.index=e.index,t.input=e.input),t}(n),!u)return function(e,n){var t=-1,l=e.length;for(n||(n=Array(l));++t<l;)n[t]=e[t];return n}(n,r)}else{var v=Et(n),p="[object Function]"==v||"[object GeneratorFunction]"==v;if(On(n))return Kn(n,u);if("[object Object]"==v||"[object Arguments]"==v||p&&!i){if(r=d||p?{}:function(e){return"function"!=typeof e.constructor||kn(e)?{}:Dt(et(e))}(n),!u)return d?function(e,n){return gn(e,nt(e),n)}(n,function(e,n){return e&&gn(n,qn(n),e)}(r,n)):function(e,n){return gn(e,Jn(e),n)}(n,function(e,n){return e&&gn(n,Yn(n),e)}(r,n))}else{if(!Ot[v])return i?n:{};r=function(e,n,t){var l,o,i=e.constructor;switch(n){case"[object ArrayBuffer]":return ft(e);case"[object Boolean]":case"[object Date]":return new i(+e);case"[object DataView]":return function(e,n){var t=n?ft(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.byteLength)}(e,t);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e,n){var t=n?ft(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}(e,t);case"[object Map]":return new i;case"[object Number]":case"[object String]":return new i(e);case"[object RegExp]":return(o=new(l=e).constructor(l.source,gt.exec(l))).lastIndex=l.lastIndex,o;case"[object Set]":return new i;case"[object Symbol]":return Nt?Object(Nt.call(e)):{}}}(n,v,u)}}a||(a=new mn);var m=a.get(n);if(m)return m;a.set(n,r),It(n)?n.forEach(function(o){r.add(e(o,t,l,o,n,a))}):ht(n)&&n.forEach(function(o,i){r.set(i,e(o,t,l,i,n,a))});var E=c?void 0:(s?d?ot:lt:d?qn:Yn)(n);return function(e,n){for(var t=-1,l=null==e?0:e.length;++t<l&&!1!==n(e[t],t););}(E||n,function(o,i){E&&(o=n[i=o]),fn(r,i,e(o,t,l,i,n,a))}),r},Lt=function(e){return bt(e,5)};const Rt=e=>"WATER"==e?{connectionType:"",noOfTaps:"",waterSource:"",pipeSize:"",waterSubSource:"",sourceSubData:""}:{noOfWaterClosets:"",noOfToilets:""},wt=e=>{var n,o,i,u,d,s,c;const{connectionDetail:p,focusIndex:E,setFocusIndex:S,t:_,config:f,setError:g,clearErrors:C,formState:N,connectionDetails:y,setIsErrors:T,isErrors:h,connectionTypeList:A,waterSourceList:I,waterSubSourceList:O,pipeSizeList:b,setConnectionDetails:L,filters:R,setWaterSubSourceList:w,mdmsData:W}=e,{control:P,formState:M,watch:x,trigger:B,getValues:F}=r.useForm(),k=x(),{errors:H}=M,j=window.Digit.Utils.browser.isMobile();let V=window.location.href.includes("/employee");t.useEffect(()=>{B()},[]),t.useEffect(()=>{window.location.href.includes("modify")&&B()},[y]),t.useEffect(()=>{if(Object.entries(k).length>0){const e=Object.keys(k),n={};if(e.forEach(e=>n[e]=p[e]),!U.isEqual(k,n)){let e=!0;Object.keys(k).map(n=>{!k[n]&&e&&(e=!1,T(!1))}),e&&T(!0);let n=[v({},k)];L(n),B()}}},[k]),t.useEffect(()=>{var e;Object.keys(H).length&&!U.isEqual((null===(e=N.errors[f.key])||void 0===e?void 0:e.type)||{},H)?g(f.key,{type:H}):!Object.keys(H).length&&N.errors[f.key]&&h&&C(f.key)},[H]);const z={width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"};return l.createElement("div",null,l.createElement("div",{style:{marginBottom:"16px"}},l.createElement("div",null,window.location.href.includes("by-config")||window.location.href.includes("ws/modify-application")?null:l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:j&&V?{fontWeight:"700",width:"100%"}:{marginTop:"-5px",fontWeight:"700"},className:"card-label-smaller"},_("WS_ACK_COMMON_APP_NO_LABEL")+"*"),l.createElement("div",{className:"field"},l.createElement(a.TextInput,{disabled:!0,value:null==R?void 0:R.applicationNumber}))),"WATER"===(null==R?void 0:R.service)?l.createElement("div",null,l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:j&&V?{fontWeight:"700",width:"100%"}:{marginTop:"-5px",fontWeight:"700"},className:"card-label-smaller"},_("WS_SERV_DETAIL_CONN_TYPE")+"*"),l.createElement(r.Controller,{control:P,name:"connectionType",defaultValue:null==p?void 0:p.connectionType,rules:{required:_("REQUIRED_FIELD")},isMandatory:!0,render:e=>{var n;return l.createElement(a.Dropdown,{className:"form-field",selected:F("connectionType"),disable:!1,option:A,errorStyle:!(!M.touched.connectionType||null==H||null===(n=H.connectionType)||void 0===n||!n.message),select:n=>{e.onChange(n)},optionKey:"i18nKey",onBlur:e.onBlur,t:_})}})),l.createElement(a.CardLabelError,{style:z},M.touched.connectionType?null==H||null===(n=H.connectionType)||void 0===n?void 0:n.message:""),l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:j&&V?{fontWeight:"700",width:"100%"}:{marginTop:"-5px",fontWeight:"700"},className:"card-label-smaller"},_("WS_SERV_DETAIL_WATER_SOURCE")+"*"),l.createElement(r.Controller,{control:P,name:"waterSource",defaultValue:null==p?void 0:p.waterSource,rules:{required:_("REQUIRED_FIELD")},isMandatory:!0,render:e=>{var n;return l.createElement(a.Dropdown,{className:"form-field",selected:F("waterSource"),disable:!1,option:I,errorStyle:!(!M.touched.waterSource||null==H||null===(n=H.waterSource)||void 0===n||!n.message),select:n=>{var t,l;let o=v({},null==y?void 0:y[0],{waterSource:null==n?void 0:n.code,waterSubSource:""});L([o]);const i=(null==W||null===(t=W["ws-services-masters"])||void 0===t?void 0:t.waterSource)&&Lt(null==W||null===(l=W["ws-services-masters"])||void 0===l?void 0:l.waterSource)||[];null==i||i.forEach(e=>{var n;return e.i18nKey="WS_SERVICES_MASTERS_WATERSOURCE_"+m(null==e||null===(n=e.code)||void 0===n?void 0:n.toUpperCase(),".","_")});const a=null==i?void 0:i.filter(e=>{var t,l;return(null==n||null===(t=n.code)||void 0===t?void 0:t.split(".")[0])==(null==e||null===(l=e.code)||void 0===l?void 0:l.split(".")[0])});w(a),e.onChange(n)},optionKey:"i18nKey",onBlur:e.onBlur,t:_})}})),l.createElement(a.CardLabelError,{style:z},M.touched.waterSource?null==H||null===(o=H.waterSource)||void 0===o?void 0:o.message:""),l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:j&&V?{fontWeight:"700",width:"100%"}:{marginTop:"-5px",fontWeight:"700"},className:"card-label-smaller"},_("WS_SERV_DETAIL_WATER_SUB_SOURCE")+"*"),l.createElement(r.Controller,{control:P,name:"sourceSubData",defaultValue:null==p?void 0:p.sourceSubData,rules:{required:_("REQUIRED_FIELD")},isMandatory:!0,render:e=>{var n;return l.createElement(a.Dropdown,{className:"form-field",selected:F("sourceSubData"),disable:!1,option:O,errorStyle:!(!M.touched.sourceSubData||null==H||null===(n=H.sourceSubData)||void 0===n||!n.message),select:n=>{e.onChange(n)},optionKey:"i18nKey",onBlur:e.onBlur,t:_})}})),l.createElement(a.CardLabelError,{style:z},M.touched.sourceSubData?null==H||null===(i=H.sourceSubData)||void 0===i?void 0:i.message:""),l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:j&&V?{fontWeight:"700",width:"100%"}:{marginTop:"-5px",fontWeight:"700"},className:"card-label-smaller"},_("WS_PIPE_SIZE_IN_INCHES_LABEL")+"*"),l.createElement(r.Controller,{control:P,name:"pipeSize",defaultValue:null==p?void 0:p.pipeSize,rules:{required:_("REQUIRED_FIELD")},isMandatory:!0,render:e=>{var n;return l.createElement(a.Dropdown,{className:"form-field",selected:F("pipeSize"),disable:!1,option:b,errorStyle:!(!M.touched.pipeSize||null==H||null===(n=H.pipeSize)||void 0===n||!n.message),select:n=>{e.onChange(n)},optionKey:"i18nKey",onBlur:e.onBlur,t:_})}})),l.createElement(a.CardLabelError,{style:z},M.touched.pipeSize?null==H||null===(u=H.pipeSize)||void 0===u?void 0:u.message:""),l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:j&&V?{fontWeight:"700",width:"100%"}:{marginTop:"-5px",fontWeight:"700"},className:"card-label-smaller"},_("WS_SERV_DETAIL_NO_OF_TAPS")+"*"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:P,name:"noOfTaps",defaultValue:null==p?void 0:p.noOfTaps,rules:{validate:e=>!!(e&&D("WSOnlyNumbers").test(e)||!e)||_("ERR_DEFAULT_INPUT_FIELD_MSG"),required:_("REQUIRED_FIELD")},type:"number",isMandatory:!0,render:e=>{var n;return l.createElement(a.TextInput,{type:"number",value:e.value,autoFocus:E.index===(null==p?void 0:p.key)&&"noOfTaps"===E.type,errorStyle:!(!M.touched.noOfTaps||null==H||null===(n=H.noOfTaps)||void 0===n||!n.message),onChange:n=>{e.onChange(n.target.value),S({index:null==p?void 0:p.key,type:"noOfTaps"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur})}}))),l.createElement(a.CardLabelError,{style:z},M.touched.noOfTaps?null==H||null===(d=H.noOfTaps)||void 0===d?void 0:d.message:"")):l.createElement("div",null,l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:j&&V?{fontWeight:"700",width:"100%"}:{marginTop:"-5px",fontWeight:"700"},className:"card-label-smaller"},_("WS_NUMBER_WATER_CLOSETS_LABEL")+"*"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:P,name:"noOfWaterClosets",defaultValue:null==p?void 0:p.noOfWaterClosets,rules:{validate:e=>!!(e&&D("WSOnlyNumbers").test(e)||!e)||_("ERR_DEFAULT_INPUT_FIELD_MSG"),required:_("REQUIRED_FIELD")},type:"number",isMandatory:!0,render:e=>{var n;return l.createElement(a.TextInput,{value:e.value,type:"number",autoFocus:E.index===(null==p?void 0:p.key)&&"noOfWaterClosets"===E.type,errorStyle:!(!M.touched.noOfWaterClosets||null==H||null===(n=H.noOfWaterClosets)||void 0===n||!n.message),onChange:n=>{e.onChange(n.target.value),S({index:null==p?void 0:p.key,type:"noOfWaterClosets"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur})}}))),l.createElement(a.CardLabelError,{style:z},M.touched.noOfWaterClosets?null==H||null===(s=H.noOfWaterClosets)||void 0===s?void 0:s.message:""),l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:j&&V?{fontWeight:"700",width:"100%"}:{marginTop:"-5px",fontWeight:"700"},className:"card-label-smaller"},_("WS_SERV_DETAIL_NO_OF_TOILETS")+"*"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:P,name:"noOfToilets",defaultValue:null==p?void 0:p.noOfToilets,rules:{validate:e=>!!(e&&D("WSOnlyNumbers").test(e)||!e)||_("ERR_DEFAULT_INPUT_FIELD_MSG"),required:_("REQUIRED_FIELD")},type:"number",isMandatory:!0,render:e=>{var n;return l.createElement(a.TextInput,{value:e.value,type:"number",autoFocus:E.index===(null==p?void 0:p.key)&&"noOfToilets"===E.type,errorStyle:!(!M.touched.noOfToilets||null==H||null===(n=H.noOfToilets)||void 0===n||!n.message),onChange:n=>{e.onChange(n.target.value),S({index:null==p?void 0:p.key,type:"noOfToilets"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur})}}))),l.createElement(a.CardLabelError,{style:z},M.touched.noOfToilets?null==H||null===(c=H.noOfToilets)||void 0===c?void 0:c.message:"")))))},Wt=e=>{var n,o,i,u,d,s,c,p;const{plumberDetail:m,focusIndex:E,setFocusIndex:S,t:_,formData:f,config:g,setError:C,clearErrors:N,formState:y,plumberDetails:T,setIsErrors:h,options:A,setPlumberDetails:I}=e,{control:O,formState:b,watch:L,trigger:R,getValues:w}=r.useForm(),W=L(),{errors:P}=b,M=window.Digit.Utils.browser.isMobile();let x=window.location.href.includes("/employee");t.useEffect(()=>{R()},[]),t.useEffect(()=>{R()},[null==T||null===(n=T[0])||void 0===n?void 0:n.detailsProvidedBy,null==f||null===(o=f.disConnectionDetails)||void 0===o?void 0:o[0]]),t.useEffect(()=>{if(Object.entries(W).length>0){const e=Object.keys(W),n={};e.forEach(e=>n[e]=m[e]);let t=!window.location.href.includes("ws/config-by-disconnection-application")||void 0!==(null==W?void 0:W.plumberMobileNo)&&(null==n?void 0:n.plumberMobileNo);if(!U.isEqual(W,n)&&t){let e=!0;Object.keys(W).map(n=>{!W[n]&&e&&(e=!1,h(!1))}),e&&h(!0);let n=[v({},W)];I(n),R()}}},[W,T]),t.useEffect(()=>{var e;Object.keys(P).length&&!U.isEqual((null===(e=y.errors[g.key])||void 0===e?void 0:e.type)||{},P)?C(g.key,{type:P}):!Object.keys(P).length&&y.errors[g.key]&&N(g.key)},[P]);const B={width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"};return l.createElement("div",null,l.createElement("div",{style:{marginBottom:"16px"}},l.createElement("div",null,l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:M&&x?{fontWeight:"700",width:"100%"}:{marginTop:"-5px",fontWeight:"700"},className:"card-label-smaller"},_("WS_ADDN_DETAILS_PLUMBER_PROVIDED_BY")+"*"),l.createElement(r.Controller,{control:O,name:"detailsProvidedBy",defaultValue:null==m?void 0:m.detailsProvidedBy,rules:{required:_("REQUIRED_FIELD")},isMandatory:!0,render:e=>{var n;return l.createElement(a.Dropdown,{className:"form-field",selected:w("detailsProvidedBy"),disable:!1,option:A,errorStyle:!(!b.touched.detailsProvidedBy||null==P||null===(n=P.detailsProvidedBy)||void 0===n||!n.message),select:n=>{if("ULB"==n.code){let e=v({},null==T?void 0:T[0],{detailsProvidedBy:n,plumberName:"",plumberMobileNo:"",plumberLicenseNo:""});I([e])}else I([{detailsProvidedBy:n}]);e.onChange(n)},optionKey:"i18nKey",onBlur:e.onBlur,t:_})}})),l.createElement(a.CardLabelError,{style:B},b.touched.detailsProvidedBy?null==P||null===(i=P.detailsProvidedBy)||void 0===i?void 0:i.message:""),null!=m&&null!==(u=m.detailsProvidedBy)&&void 0!==u&&u.code&&"ULB"!=(null==m||null===(d=m.detailsProvidedBy)||void 0===d?void 0:d.code)?null:l.createElement("div",null,l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:M&&x?{fontWeight:"700",width:"100%"}:{marginTop:"-5px",fontWeight:"700"},className:"card-label-smaller"},_("WS_PLIMBER_LICENSE_NO_LABEL")+"*"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:O,name:"plumberLicenseNo",defaultValue:null==m?void 0:m.plumberLicenseNo,rules:{validate:e=>!!(e&&D("WSOnlyNumbers").test(e)||!e)||_("ERR_DEFAULT_INPUT_FIELD_MSG"),required:_("REQUIRED_FIELD")},isMandatory:!0,render:e=>{var n;return l.createElement(a.TextInput,{value:e.value,autoFocus:E.index===(null==m?void 0:m.key)&&"plumberLicenseNo"===E.type,errorStyle:!(!b.touched.plumberLicenseNo||null==P||null===(n=P.plumberLicenseNo)||void 0===n||!n.message),onChange:n=>{e.onChange(n.target.value),S({index:null==m?void 0:m.key,type:"plumberLicenseNo"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur})}}))),l.createElement(a.CardLabelError,{style:B},b.touched.plumberLicenseNo?null==P||null===(s=P.plumberLicenseNo)||void 0===s?void 0:s.message:""),l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:M&&x?{fontWeight:"700",width:"100%"}:{marginTop:"-5px",fontWeight:"700"},className:"card-label-smaller"},_("WS_ADDN_DETAILS_PLUMBER_NAME_LABEL")+"*"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:O,name:"plumberName",defaultValue:null==m?void 0:m.plumberName,rules:{validate:e=>!!(e&&D("Name").test(e)||!e)||_("ERR_DEFAULT_INPUT_FIELD_MSG"),required:_("REQUIRED_FIELD")},isMandatory:!0,render:e=>{var n;return l.createElement(a.TextInput,{value:e.value,autoFocus:E.index===(null==m?void 0:m.key)&&"plumberName"===E.type,errorStyle:!(!b.touched.plumberName||null==P||null===(n=P.plumberName)||void 0===n||!n.message),onChange:n=>{e.onChange(n.target.value),S({index:null==m?void 0:m.key,type:"plumberName"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur})}}))),l.createElement(a.CardLabelError,{style:B},b.touched.plumberName?null==P||null===(c=P.plumberName)||void 0===c?void 0:c.message:""),l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:M&&x?{fontWeight:"700",width:"100%"}:{marginTop:"-5px",fontWeight:"700"},className:"card-label-smaller"},_("WS_PLUMBER_MOBILE_NO_LABEL")+"*"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:O,name:"plumberMobileNo",defaultValue:null==m?void 0:m.plumberMobileNo,rules:{validate:e=>!!(e&&D("MobileNoWithPrivacy").test(e)||!e||e.includes("*"))||_("ERR_DEFAULT_INPUT_FIELD_MSG"),required:_("REQUIRED_FIELD")},type:"mobileNumber",isMandatory:!0,render:e=>{var n,t,o,i,r,u,d,s,c,v,p,_,g,C,N,y,D,T,h;return l.createElement("div",{style:{display:"flex",alignItems:"baseline",marginRight:"unset"}},l.createElement("div",{style:{position:"relative",zIndex:"1",left:"35px",marginTop:"-24.5px",marginLeft:"-26px"}},"+91"),l.createElement(a.TextInput,{style:{background:"#FAFAFA",padding:"0px 35px"},type:"mobileNumber",value:e.value,autoFocus:E.index===(null==m?void 0:m.key)&&"plumberMobileNo"===E.type,errorStyle:!(!b.touched.plumberMobileNo||null==P||null===(n=P.plumberMobileNo)||void 0===n||!n.message),onChange:n=>{e.onChange(n.target.value),S({index:null==m?void 0:m.key,type:"plumberMobileNo"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur}),l.createElement("div",{style:M&&x?{}:{marginRight:"-50px",marginLeft:"10px"}},l.createElement(a.WrapUnMaskComponent,{unmaskField:n=>{e.onChange(n)},iseyevisible:!(null===(t=e.value)||void 0===t||!t.includes("*")),privacy:{uuid:null==m?void 0:m.applicationNo,fieldName:"plumberInfoMobileNumber",model:"WnSConnectionPlumber",loadData:{serviceName:"WATER"===(null==f||null===(o=f.connectionDetails)||void 0===o||null===(i=o[0])||void 0===i||null===(r=i.formDetails)||void 0===r||null===(u=r.applicationData)||void 0===u?void 0:u.serviceType)||null!=f&&null!==(d=f.disConnectionDetails)&&void 0!==d&&null!==(s=d[0])&&void 0!==s&&null!==(c=s.consumerNumber)&&void 0!==c&&c.includes("WS")?"/ws-services/wc/_search":"/sw-services/swc/_search",requestBody:{},requestParam:{tenantId:null==f||null===(v=f.connectionDetails)||void 0===v||null===(p=v[0])||void 0===p||null===(_=p.formDetails)||void 0===_?void 0:_.tenantId,applicationNumber:null==m?void 0:m.applicationNo},jsonPath:"WATER"===(null==f||null===(g=f.connectionDetails)||void 0===g||null===(C=g[0])||void 0===C||null===(N=C.formDetails)||void 0===N||null===(y=N.applicationData)||void 0===y?void 0:y.serviceType)||null!=f&&null!==(D=f.disConnectionDetails)&&void 0!==D&&null!==(T=D[0])&&void 0!==T&&null!==(h=T.consumerNumber)&&void 0!==h&&h.includes("WS")?"WaterConnection[0].plumberInfo[0].mobileNumber":"SewerageConnections[0].plumberInfo[0].mobileNumber",isArray:!1}}})))}}))),l.createElement(a.CardLabelError,{style:B},b.touched.plumberMobileNo?null==P||null===(p=P.plumberMobileNo)||void 0===p?void 0:p.message:"")))))},Pt=e=>{var n,o,i,u,d,s,c,p,m,E,S,_,f,g,C;const{activationDetail:N,focusIndex:y,setFocusIndex:T,t:h,formData:A,formData2:I,config:O,setError:b,clearErrors:L,formState:R,activationDetails:w,setIsErrors:W,isErrors:P,filters:M,setActivationDetails:x}=e,{control:B,formState:F,watch:k,trigger:H}=r.useForm(),j=k(),{errors:V}=F,z=window.Digit.Utils.browser.isMobile();let Y=window.location.href.includes("/employee");t.useEffect(()=>{H()},[]),t.useEffect(()=>{if(Object.entries(j).length>0){const e=Object.keys(j),n={};if(e.forEach(e=>n[e]=N[e]),!U.isEqual(j,n)){let e=!0;Object.keys(j).map(n=>{!j[n]&&e&&(e=!1,W(!1))}),e&&W(!0);let n=[v({},j)];x(n),H()}}},[j]),t.useEffect(()=>{H()},[null==A||null===(n=A.connectionDetails)||void 0===n||null===(o=n[0])||void 0===o?void 0:o.connectionType]),t.useEffect(()=>{window.location.href.includes("modify")&&H()},[w,null==A?void 0:A.ConnectionDetails,null==A?void 0:A.ConnectionHolderDetails,null==A?void 0:A.DocumentsRequired,null==A?void 0:A.connectionDetails,null==A?void 0:A.cpt]),t.useEffect(()=>{var e;Object.keys(V).length&&!U.isEqual((null===(e=R.errors[O.key])||void 0===e?void 0:e.type)||{},V)?b(O.key,{type:V}):!Object.keys(V).length&&R.errors[O.key]&&P&&L(O.key)},[V]);const G={width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"};return l.createElement("div",null,l.createElement("div",{style:{marginBottom:"16px"}},"WATER"===(null==M?void 0:M.service)&&"METERED"===(null==A||null===(i=A.connectionDetails)||void 0===i||null===(u=i[0])||void 0===u||null===(d=u.connectionType)||void 0===d||null===(s=d.code)||void 0===s?void 0:s.toUpperCase())&&"WATER_RECONNECTION"!==(null==I||null===(c=I.connectionDetails)||void 0===c||null===(p=c[0])||void 0===p||null===(m=p.formDetails)||void 0===m||null===(E=m.applicationData)||void 0===E?void 0:E.applicationType)?l.createElement("div",null,l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:z&&Y?{fontWeight:"700",width:"100%"}:{marginTop:"-5px",fontWeight:"700"},className:"card-label-smaller"},h("WS_SERV_DETAIL_METER_ID")+"*"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:B,name:"meterId",defaultValue:null==N?void 0:N.meterId,type:"number",rules:{validate:e=>!!(e&&D("WSOnlyNumbers").test(e)||!e)||h("ERR_DEFAULT_INPUT_FIELD_MSG"),required:h("REQUIRED_FIELD")},isMandatory:!0,render:e=>{var n;return l.createElement(a.TextInput,{type:"number",value:e.value,autoFocus:y.index===(null==N?void 0:N.key)&&"meterId"===y.type,errorStyle:!(!F.touched.meterId||null==V||null===(n=V.meterId)||void 0===n||!n.message),onChange:n=>{e.onChange(n.target.value),T({index:null==N?void 0:N.key,type:"meterId"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur})}}))),l.createElement(a.CardLabelError,{style:G},F.touched.meterId?null==V||null===(S=V.meterId)||void 0===S?void 0:S.message:""),l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:z&&Y?{fontWeight:"700",width:"100%"}:{marginTop:"-5px",fontWeight:"700"},className:"card-label-smaller"},h("WS_ADDN_DETAIL_METER_INSTALL_DATE")+"*"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{name:"meterInstallationDate",rules:{required:h("REQUIRED_FIELD")},defaultValue:null==N?void 0:N.meterInstallationDate,control:B,render:e=>l.createElement(a.DatePicker,{date:e.value,name:"meterInstallationDate",onChange:e.onChange})}))),l.createElement(a.CardLabelError,{style:G},F.touched.meterInstallationDate?null==V||null===(_=V.meterInstallationDate)||void 0===_?void 0:_.message:""),l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:z&&Y?{fontWeight:"700",width:"100%"}:{marginTop:"-5px",fontWeight:"700"},className:"card-label-smaller"},h("WS_INITIAL_METER_READING_LABEL")+"*"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{type:"number",control:B,name:"meterInitialReading",rules:{validate:e=>!!(e&&D("WSOnlyNumbers").test(e)||!e)||h("ERR_DEFAULT_INPUT_FIELD_MSG"),required:h("REQUIRED_FIELD")},defaultValue:null==N?void 0:N.meterInitialReading,isMandatory:!0,render:e=>{var n;return l.createElement(a.TextInput,{type:"number",value:e.value,autoFocus:y.index===(null==N?void 0:N.key)&&"meterInitialReading"===y.type,errorStyle:!(!F.touched.meterInitialReading||null==V||null===(n=V.meterInitialReading)||void 0===n||!n.message),onChange:n=>{e.onChange(n.target.value),T({index:null==N?void 0:N.key,type:"meterInitialReading"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur})}}))),l.createElement(a.CardLabelError,{style:G},F.touched.meterInitialReading?null==V||null===(f=V.meterInitialReading)||void 0===f?void 0:f.message:"")):null,l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:z&&Y?{fontWeight:"700",width:"100%"}:{marginTop:"-5px",fontWeight:"700"},className:"card-label-smaller"},h("WS_SERV_DETAIL_CONN_EXECUTION_DATE")+"*"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{name:"connectionExecutionDate",rules:{required:h("REQUIRED_FIELD")},defaultValue:null==N?void 0:N.connectionExecutionDate,control:B,render:e=>{var n;return l.createElement(a.DatePicker,{date:e.value,name:"connectionExecutionDate",onChange:e.onChange,autoFocus:y.index===(null==N?void 0:N.key)&&"connectionExecutionDate"===y.type,errorStyle:!(!F.touched.connectionExecutionDate||null==V||null===(n=V.connectionExecutionDate)||void 0===n||!n.message)})}}))),l.createElement(a.CardLabelError,{style:G},F.touched.connectionExecutionDate?null==V||null===(g=V.connectionExecutionDate)||void 0===g?void 0:g.message:""),window.location.href.includes("modify")?l.createElement("div",null,l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:z&&Y?{fontWeight:"700",width:"100%"}:{marginTop:"-5px",fontWeight:"700"},className:"card-label-smaller"},h("WS_MODIFICATIONS_EFFECTIVE_FROM")+"*"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{name:"dateEffectiveFrom",rules:{required:h("REQUIRED_FIELD")},isMandatory:!0,defaultValue:null==N?void 0:N.dateEffectiveFrom,control:B,render:e=>{var n;return l.createElement(a.DatePicker,{date:e.value,name:"dateEffectiveFrom",onChange:e.onChange,autoFocus:y.index===(null==N?void 0:N.key)&&"dateEffectiveFrom"===y.type,errorStyle:!(!F.touched.dateEffectiveFrom||null==V||null===(n=V.dateEffectiveFrom)||void 0===n||!n.message)})}}))),l.createElement(a.CardLabelError,{style:G},F.touched.dateEffectiveFrom?null==V||null===(C=V.dateEffectiveFrom)||void 0===C?void 0:C.message:"")):null))};function Mt(e){var n,o;let{t:i,document:r,setDocuments:u,setError:d,documents:s,formData:c,setFormError:p,clearFormErrors:m,config:E,formState:S,id:_}=e;const f=null==s?void 0:s.filter(e=>{var n;return null==e||null===(n=e.documentType)||void 0===n?void 0:n.includes(null==r?void 0:r.code)})[0],[g,C]=(Digit.ULBService.getCurrentTenantId(),t.useState(f?v({},f,{code:null==f?void 0:f.documentType}):1===(null==r||null===(n=r.dropdownData)||void 0===n?void 0:n.length)?null==r?void 0:r.dropdownData[0]:{})),[N,y]=t.useState(null),[D,T]=t.useState(()=>(null==f?void 0:f.fileStoreId)||null);t.useEffect(()=>{var e;f&&C(f?v({},f,{code:null==f?void 0:f.documentType}):1===(null==r||null===(e=r.dropdownData)||void 0===e?void 0:e.length)?null==r?void 0:r.dropdownData[0]:{})},[]);const{dropdownData:h}=r;var A=h;const[I,O]=t.useState(!1),b=()=>{var e,n;let t=null===(e=S.errors)||void 0===e||null===(n=e[E.key])||void 0===n?void 0:n.type;Array.isArray(t)||(t=[]),t.includes(null==r?void 0:r.code)&&(t=t.filter(e=>e!=(null==r?void 0:r.code)),t.length?p(E.key,{type:t}):m(E.key))};return t.useEffect(()=>{null!=g&&g.code&&u(e=>{const n=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==g?void 0:g.code));if(0===(null==D?void 0:D.length)||null===D)return n;const t=[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==D),{documentType:null==g?void 0:g.code,fileStoreId:D,i18nKey:null==g?void 0:g.code,id:null==g?void 0:g.id,status:"ACTIVE"}];return sessionStorage.setItem("DISCONNECTION_EDIT_DOCS",JSON.stringify(t)),t}),I?I&&b():D&&null!=g&&g.code||null==r||!r.required?D&&null!=g&&g.code&&b():(()=>{var e,n;let t=null===(e=S.errors)||void 0===e||null===(n=e[E.key])||void 0===n?void 0:n.type;Array.isArray(t)||(t=[]),t.includes(r.code)||(t.push(r.code),p(E.key,{type:t}))})()},[D,g,I,null==c||null===(o=c.ConnectionDetails)||void 0===o?void 0:o[0]]),t.useEffect(()=>{!function(){try{d(null);const e=function(){if(N){const e=function(){if(N.size>=5242880)d(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=he(function(){return T(null),Promise.resolve(Digit.UploadServices.Filestorage("WS",N,Digit.ULBService.getStateId())).then(function(e){var n,t,l,o;(null==e||null===(n=e.data)||void 0===n||null===(t=n.files)||void 0===t?void 0:t.length)>0?T(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):d(i("CS_FILE_UPLOAD_ERROR"))})},function(){d(i("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[N]),t.useEffect(()=>{I&&T(null)},[I]),l.createElement("div",{style:{marginBottom:"24px"}},null!=r&&r.hasDropdown?l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:{fontWeight:"700"}},null!=r&&r.required?l.createElement(l.Fragment,null,i(null==r?void 0:r.i18nKey)," ",l.createElement("span",{style:{color:"red"}},"*")):i(null==r?void 0:r.i18nKey)),l.createElement(a.Dropdown,{id:"doc-"+(null==r?void 0:r.code),key:"doc-"+(null==r?void 0:r.code),className:"form-field",selected:g||f||g,option:A.map(e=>{var n;return v({},e,{i18nKey:null===(n=e.code)||void 0===n?void 0:n.replaceAll(".","_")})}),select:e=>C(e),optionKey:"i18nKey",t:i})):null,l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{className:"card-label-smaller"}),l.createElement("div",{className:"field"},l.createElement(a.UploadFile,{onUpload:function(e){y(e.target.files[0])},onDelete:()=>{T(null)},id:_,message:D?"1 "+i("CS_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},inputStyles:{width:"280px"},buttonType:"button",error:!D,accept:"image/*, .pdf, .png, .jpeg, .jpg"}),l.createElement("div",{style:{marginTop:"10px",fontSize:"12px"}},i("CS_FILE_SIZE_RESTRICTIONS_WS")))))}const xt=e=>{var n,o,i,u;const{connectionDetail:d,focusIndex:s,setFocusIndex:c,t:p,config:m,setError:E,clearErrors:S,formState:_,setIsErrors:f,isErrors:g,setConnectionDetails:C,pipeSizeList:N,connectionDetails:y,waterSewarageSelection:T,applicationNumber:h}=e,{control:A,formState:I,watch:O,trigger:b,getValues:L}=r.useForm(),R=O(),{errors:w}=I;t.useEffect(()=>{b()},[]),t.useEffect(()=>{if(Object.entries(R).length>0){const e=Object.keys(R),n={};if(e.forEach(e=>n[e]=d[e]),!U.isEqual(R,n)){let e=!0;Object.keys(R).map(n=>{!R[n]&&e&&(e=!1,f(!1))}),e&&f(!0);let n=[v({},R)];C(n),b()}}},[R,y]),t.useEffect(()=>{var e,n,t,l;let o=!0;null===(e=Object.keys(null==y?void 0:y[0]))||void 0===e||e.map(e=>{!y[0][e]&&0!=y[0][e]&&o&&(o=!1)}),o&&(null===(n=Object.keys(null==y?void 0:y[0]))||void 0===n?void 0:n.length)>1&&S("ConnectionDetails"),null!=y&&null!==(t=y[0])&&void 0!==t&&t.sewerage||(S(m.key,{type:"proposedToilets"}),S(m.key,{type:"proposedWaterClosets"})),null!=y&&null!==(l=y[0])&&void 0!==l&&l.water||(S(m.key,{type:"proposedPipeSize"}),S(m.key,{type:"proposedTaps"})),b()},[y,T]),t.useEffect(()=>{var e;Object.keys(w).length&&!U.isEqual((null===(e=_.errors[m.key])||void 0===e?void 0:e.type)||{},w)?E(m.key,{type:w}):!Object.keys(w).length&&_.errors[m.key]&&g&&S(m.key)},[w]);const W={width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"},P=window.Digit.Utils.browser.isMobile(),M=window.location.href.includes("/employee");return l.createElement("div",null,window.location.href.includes("modify-application")?l.createElement("div",null,l.createElement(a.CardSubHeader,null,p("WS_COMMON_SERV_DETAIL")),l.createElement(a.StatusTable,null,l.createElement(a.Row,{className:"border-none",key:"WS_MYCONNECTIONS_CONSUMER_NO",label:""+p("WS_MYCONNECTIONS_CONSUMER_NO"),text:h}),l.createElement(a.Row,{className:"border-none",key:"WS_SERVICE_NAME_LABEL",label:""+p("WS_SERVICE_NAME_LABEL"),text:null==d?void 0:d.serviceName}))):l.createElement("div",{style:{marginBottom:"16px"}},l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:P&&M?{fontWeight:"700",width:"100%"}:{marginTop:"-5px",fontWeight:"700"},className:"card-label-smaller"},""+p("PDF_STATIC_LABEL_APPLICATION_NUMBER_LABEL")),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:A,name:"applicationNo",defaultValue:null==d?void 0:d.applicationNo,isMandatory:!0,render:e=>{var n;return l.createElement(a.TextInput,{value:e.value,autoFocus:s.index===(null==d?void 0:d.key)&&"applicationNo"===s.type,errorStyle:!(!I.touched.applicationNo||null==w||null===(n=w.applicationNo)||void 0===n||!n.message),onChange:n=>{e.onChange(n.target.value),c({index:null==d?void 0:d.key,type:"applicationNo"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur,disabled:!0,disable:!0})}}))),l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:P&&M?{fontWeight:"700",width:"100%"}:{marginTop:"-5px",fontWeight:"700"},className:"card-label-smaller"},""+p("WS_SERVICE_NAME_LABEL")),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:A,name:"serviceName",defaultValue:null==d?void 0:d.serviceName,isMandatory:!0,render:e=>{var n;return l.createElement(a.TextInput,{value:e.value,autoFocus:s.index===(null==d?void 0:d.key)&&"serviceName"===s.type,errorStyle:!(!I.touched.serviceName||null==w||null===(n=w.serviceName)||void 0===n||!n.message),onChange:n=>{e.onChange(n.target.value),c({index:null==d?void 0:d.key,type:"serviceName"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur,disabled:!0,disable:!0})}}))),"WATER"==(null==d?void 0:d.serviceName)&&l.createElement("div",null,l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:P&&M?{fontWeight:"700",width:"100%"}:{marginTop:"-5px",fontWeight:"700"},className:"card-label-smaller"},p("WS_NO_OF_PROPOSED_TAPS_LABEL")+"*"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:A,name:"proposedTaps",defaultValue:null==d?void 0:d.proposedTaps,rules:{validate:e=>!!(e&&D("WSOnlyNumbers").test(e)||!e)||p("ERR_DEFAULT_INPUT_FIELD_MSG"),required:p("REQUIRED_FIELD")},type:"number",isMandatory:!0,render:e=>{var n;return l.createElement(a.TextInput,{type:"number",value:e.value,autoFocus:s.index===(null==d?void 0:d.key)&&"proposedTaps"===s.type,errorStyle:!(!I.touched.proposedTaps||null==w||null===(n=w.proposedTaps)||void 0===n||!n.message),onChange:n=>{e.onChange(n.target.value),c({index:null==d?void 0:d.key,type:"proposedTaps"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur})}}))),l.createElement(a.CardLabelError,{style:W},I.touched.proposedTaps?null==w||null===(n=w.proposedTaps)||void 0===n?void 0:n.message:""),l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:P&&M?{fontWeight:"700",width:"100%"}:{marginTop:"-5px",fontWeight:"700"},className:"card-label-smaller"},p("WS_PROPOSED_PIPE_SIZE_IN_INCHES_LABEL")+"*"),l.createElement(r.Controller,{control:A,name:"proposedPipeSize",defaultValue:null==d?void 0:d.proposedPipeSize,rules:{required:p("REQUIRED_FIELD")},isMandatory:!0,render:e=>{var n;return l.createElement(a.Dropdown,{className:"form-field",selected:L("proposedPipeSize"),disable:!1,option:N,errorStyle:!(!I.touched.proposedPipeSize||null==w||null===(n=w.proposedPipeSize)||void 0===n||!n.message),select:n=>{e.onChange(n)},optionKey:"i18nKey",onBlur:e.onBlur,t:p})}})),l.createElement(a.CardLabelError,{style:W},I.touched.proposedPipeSize?null==w||null===(o=w.proposedPipeSize)||void 0===o?void 0:o.message:"")),"WATER"!==(null==d?void 0:d.serviceName)&&l.createElement("div",null,l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:P&&M?{fontWeight:"700",width:"100%"}:{marginTop:"-5px",fontWeight:"700"},className:"card-label-smaller"},p("WS_PROPOSED_WATER_CLOSETS_LABEL")+"*"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:A,name:"proposedWaterClosets",defaultValue:null==d?void 0:d.proposedWaterClosets,rules:{validate:e=>!!(e&&D("WSOnlyNumbers").test(e)||!e)||p("ERR_DEFAULT_INPUT_FIELD_MSG"),required:p("REQUIRED_FIELD")},type:"number",isMandatory:!0,render:e=>{var n;return l.createElement(a.TextInput,{type:"number",value:e.value,autoFocus:s.index===(null==d?void 0:d.key)&&"proposedWaterClosets"===s.type,errorStyle:!(!I.touched.proposedWaterClosets||null==w||null===(n=w.proposedWaterClosets)||void 0===n||!n.message),onChange:n=>{e.onChange(n.target.value),c({index:null==d?void 0:d.key,type:"proposedWaterClosets"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur})}}))),l.createElement(a.CardLabelError,{style:W},I.touched.proposedWaterClosets?null==w||null===(i=w.proposedWaterClosets)||void 0===i?void 0:i.message:""),l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:P&&M?{fontWeight:"700",width:"100%"}:{marginTop:"-5px",fontWeight:"700"},className:"card-label-smaller"},p("WS_PROPOSED_WATER_TOILETS_LABEL")+"*"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:A,name:"proposedToilets",defaultValue:null==d?void 0:d.proposedToilets,rules:{validate:e=>!!(e&&D("WSOnlyNumbers").test(e)||!e)||p("ERR_DEFAULT_INPUT_FIELD_MSG"),required:p("REQUIRED_FIELD")},type:"number",isMandatory:!0,render:e=>{var n;return l.createElement(a.TextInput,{type:"number",value:e.value,autoFocus:s.index===(null==d?void 0:d.key)&&"proposedToilets"===s.type,errorStyle:!(!I.touched.proposedToilets||null==w||null===(n=w.proposedToilets)||void 0===n||!n.message),onChange:n=>{e.onChange(n.target.value),c({index:null==d?void 0:d.key,type:"proposedToilets"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur})}}))),l.createElement(a.CardLabelError,{style:W},I.touched.proposedToilets?null==w||null===(u=w.proposedToilets)||void 0===u?void 0:u.message:""))))};let Bt=[];const Ft=e=>{let{currentStep:n=1,flow:t=""}=e;const{t:i}=o.useTranslation(),r=window.Digit.Utils.browser.isMobile();return Bt=["WS_COMMON_DISCONNECTION_DETAIL","WS_COMMON_DOCUMENT_DETAILS","WS_COMMON_SUMMARY"],l.createElement("div",{className:"timeline-container",style:r?{}:{maxWidth:"960px",minWidth:"640px",marginRight:"auto"}},Bt.map((e,t,o)=>l.createElement("div",{className:"timeline-checkpoint",key:t},l.createElement("div",{className:"timeline-content"},l.createElement("span",{className:"circle "+(t<=n-1&&"active")},t<n-1?l.createElement(a.TickMark,null):t+1),l.createElement("span",{className:"secondary-color"},i(e))),t<o.length-1&&l.createElement("span",{className:"line "+(t<n-1&&"active")}))))};function Ut(e){if(null===e||!0===e||!1===e)return NaN;var n=Number(e);return isNaN(n)?n:n<0?Math.ceil(n):Math.floor(n)}function kt(e,n){if(n.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+n.length+" present")}function Ht(e){kt(1,arguments);var n=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===n?new Date(e.getTime()):"number"==typeof e||"[object Number]"===n?new Date(e):("string"!=typeof e&&"[object String]"!==n||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn((new Error).stack)),new Date(NaN))}function jt(e,n){kt(2,arguments);var t=Ht(e),l=Ut(n);return isNaN(l)?new Date(NaN):l?(t.setDate(t.getDate()+l),t):t}function Vt(e,n){kt(2,arguments);var t=Ht(e).getTime(),l=Ut(n);return new Date(t+l)}function zt(e){var n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),e.getTime()-n.getTime()}function Yt(e){return kt(1,arguments),e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function Gt(e){if(kt(1,arguments),!Yt(e)&&"number"!=typeof e)return!1;var n=Ht(e);return!isNaN(Number(n))}var qt={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function Kt(e){return function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=n.width?String(n.width):e.defaultWidth,l=e.formats[t]||e.formats[e.defaultWidth];return l}}var Xt={date:Kt({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:Kt({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:Kt({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},Zt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function $t(e){return function(n,t){var l,o=t||{};if("formatting"===(o.context?String(o.context):"standalone")&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,a=o.width?String(o.width):i;l=e.formattingValues[a]||e.formattingValues[i]}else{var r=e.defaultWidth,u=o.width?String(o.width):e.defaultWidth;l=e.values[u]||e.values[r]}return l[e.argumentCallback?e.argumentCallback(n):n]}}function Jt(e){return function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=t.width,o=l&&e.matchPatterns[l]||e.matchPatterns[e.defaultMatchWidth],i=n.match(o);if(!i)return null;var a,r=i[0],u=l&&e.parsePatterns[l]||e.parsePatterns[e.defaultParseWidth],d=Array.isArray(u)?el(u,function(e){return e.test(r)}):Qt(u,function(e){return e.test(r)});a=e.valueCallback?e.valueCallback(d):d,a=t.valueCallback?t.valueCallback(a):a;var s=n.slice(r.length);return{value:a,rest:s}}}function Qt(e,n){for(var t in e)if(e.hasOwnProperty(t)&&n(e[t]))return t}function el(e,n){for(var t=0;t<e.length;t++)if(n(e[t]))return t}var nl,tl={code:"en-US",formatDistance:function(e,n,t){var l,o=qt[e];return l="string"==typeof o?o:1===n?o.one:o.other.replace("{{count}}",n.toString()),null!=t&&t.addSuffix?t.comparison&&t.comparison>0?"in "+l:l+" ago":l},formatLong:Xt,formatRelative:function(e,n,t,l){return Zt[e]},localize:{ordinalNumber:function(e,n){var t=Number(e),l=t%100;if(l>20||l<10)switch(l%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},era:$t({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:$t({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:$t({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:$t({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:$t({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(nl={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=e.match(nl.matchPattern);if(!t)return null;var l=t[0],o=e.match(nl.parsePattern);if(!o)return null;var i=nl.valueCallback?nl.valueCallback(o[0]):o[0];i=n.valueCallback?n.valueCallback(i):i;var a=e.slice(l.length);return{value:i,rest:a}}),era:Jt({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:Jt({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:Jt({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:Jt({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:Jt({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function ll(e,n){kt(2,arguments);var t=Ut(n);return Vt(e,-t)}function ol(e){kt(1,arguments);var n=1,t=Ht(e),l=t.getUTCDay(),o=(l<n?7:0)+l-n;return t.setUTCDate(t.getUTCDate()-o),t.setUTCHours(0,0,0,0),t}function il(e){kt(1,arguments);var n=Ht(e),t=n.getUTCFullYear(),l=new Date(0);l.setUTCFullYear(t+1,0,4),l.setUTCHours(0,0,0,0);var o=ol(l),i=new Date(0);i.setUTCFullYear(t,0,4),i.setUTCHours(0,0,0,0);var a=ol(i);return n.getTime()>=o.getTime()?t+1:n.getTime()>=a.getTime()?t:t-1}function al(e){kt(1,arguments);var n=il(e),t=new Date(0);t.setUTCFullYear(n,0,4),t.setUTCHours(0,0,0,0);var l=ol(t);return l}function rl(e,n){kt(1,arguments);var t=n||{},l=t.locale,o=l&&l.options&&l.options.weekStartsOn,i=null==o?0:Ut(o),a=null==t.weekStartsOn?i:Ut(t.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var r=Ht(e),u=r.getUTCDay(),d=(u<a?7:0)+u-a;return r.setUTCDate(r.getUTCDate()-d),r.setUTCHours(0,0,0,0),r}function ul(e,n){kt(1,arguments);var t=Ht(e),l=t.getUTCFullYear(),o=n||{},i=o.locale,a=i&&i.options&&i.options.firstWeekContainsDate,r=null==a?1:Ut(a),u=null==o.firstWeekContainsDate?r:Ut(o.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var d=new Date(0);d.setUTCFullYear(l+1,0,u),d.setUTCHours(0,0,0,0);var s=rl(d,n),c=new Date(0);c.setUTCFullYear(l,0,u),c.setUTCHours(0,0,0,0);var v=rl(c,n);return t.getTime()>=s.getTime()?l+1:t.getTime()>=v.getTime()?l:l-1}function dl(e,n){kt(1,arguments);var t=n||{},l=t.locale,o=l&&l.options&&l.options.firstWeekContainsDate,i=null==o?1:Ut(o),a=null==t.firstWeekContainsDate?i:Ut(t.firstWeekContainsDate),r=ul(e,n),u=new Date(0);u.setUTCFullYear(r,0,a),u.setUTCHours(0,0,0,0);var d=rl(u,n);return d}function sl(e,n){for(var t=e<0?"-":"",l=Math.abs(e).toString();l.length<n;)l="0"+l;return t+l}var cl={G:function(e,n,t){var l=e.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return t.era(l,{width:"abbreviated"});case"GGGGG":return t.era(l,{width:"narrow"});case"GGGG":default:return t.era(l,{width:"wide"})}},y:function(e,n,t){if("yo"===n){var l=e.getUTCFullYear();return t.ordinalNumber(l>0?l:1-l,{unit:"year"})}return function(e,n){var t=e.getUTCFullYear(),l=t>0?t:1-t;return sl("yy"===n?l%100:l,n.length)}(e,n)},Y:function(e,n,t,l){var o=ul(e,l),i=o>0?o:1-o;return"YY"===n?sl(i%100,2):"Yo"===n?t.ordinalNumber(i,{unit:"year"}):sl(i,n.length)},R:function(e,n){return sl(il(e),n.length)},u:function(e,n){return sl(e.getUTCFullYear(),n.length)},Q:function(e,n,t){var l=Math.ceil((e.getUTCMonth()+1)/3);switch(n){case"Q":return String(l);case"QQ":return sl(l,2);case"Qo":return t.ordinalNumber(l,{unit:"quarter"});case"QQQ":return t.quarter(l,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(l,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(l,{width:"wide",context:"formatting"})}},q:function(e,n,t){var l=Math.ceil((e.getUTCMonth()+1)/3);switch(n){case"q":return String(l);case"qq":return sl(l,2);case"qo":return t.ordinalNumber(l,{unit:"quarter"});case"qqq":return t.quarter(l,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(l,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(l,{width:"wide",context:"standalone"})}},M:function(e,n,t){var l=e.getUTCMonth();switch(n){case"M":case"MM":return function(e,n){var t=e.getUTCMonth();return"M"===n?String(t+1):sl(t+1,2)}(e,n);case"Mo":return t.ordinalNumber(l+1,{unit:"month"});case"MMM":return t.month(l,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(l,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(l,{width:"wide",context:"formatting"})}},L:function(e,n,t){var l=e.getUTCMonth();switch(n){case"L":return String(l+1);case"LL":return sl(l+1,2);case"Lo":return t.ordinalNumber(l+1,{unit:"month"});case"LLL":return t.month(l,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(l,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(l,{width:"wide",context:"standalone"})}},w:function(e,n,t,l){var o=function(e,n){kt(1,arguments);var t=Ht(e),l=rl(t,n).getTime()-dl(t,n).getTime();return Math.round(l/6048e5)+1}(e,l);return"wo"===n?t.ordinalNumber(o,{unit:"week"}):sl(o,n.length)},I:function(e,n,t){var l=function(e){kt(1,arguments);var n=Ht(e),t=ol(n).getTime()-al(n).getTime();return Math.round(t/6048e5)+1}(e);return"Io"===n?t.ordinalNumber(l,{unit:"week"}):sl(l,n.length)},d:function(e,n,t){return"do"===n?t.ordinalNumber(e.getUTCDate(),{unit:"date"}):function(e,n){return sl(e.getUTCDate(),n.length)}(e,n)},D:function(e,n,t){var l=function(e){kt(1,arguments);var n=Ht(e),t=n.getTime();n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0);var l=n.getTime(),o=t-l;return Math.floor(o/864e5)+1}(e);return"Do"===n?t.ordinalNumber(l,{unit:"dayOfYear"}):sl(l,n.length)},E:function(e,n,t){var l=e.getUTCDay();switch(n){case"E":case"EE":case"EEE":return t.day(l,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(l,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(l,{width:"short",context:"formatting"});case"EEEE":default:return t.day(l,{width:"wide",context:"formatting"})}},e:function(e,n,t,l){var o=e.getUTCDay(),i=(o-l.weekStartsOn+8)%7||7;switch(n){case"e":return String(i);case"ee":return sl(i,2);case"eo":return t.ordinalNumber(i,{unit:"day"});case"eee":return t.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(o,{width:"short",context:"formatting"});case"eeee":default:return t.day(o,{width:"wide",context:"formatting"})}},c:function(e,n,t,l){var o=e.getUTCDay(),i=(o-l.weekStartsOn+8)%7||7;switch(n){case"c":return String(i);case"cc":return sl(i,n.length);case"co":return t.ordinalNumber(i,{unit:"day"});case"ccc":return t.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(o,{width:"narrow",context:"standalone"});case"cccccc":return t.day(o,{width:"short",context:"standalone"});case"cccc":default:return t.day(o,{width:"wide",context:"standalone"})}},i:function(e,n,t){var l=e.getUTCDay(),o=0===l?7:l;switch(n){case"i":return String(o);case"ii":return sl(o,n.length);case"io":return t.ordinalNumber(o,{unit:"day"});case"iii":return t.day(l,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(l,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(l,{width:"short",context:"formatting"});case"iiii":default:return t.day(l,{width:"wide",context:"formatting"})}},a:function(e,n,t){var l=e.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return t.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(l,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(l,{width:"wide",context:"formatting"})}},b:function(e,n,t){var l,o=e.getUTCHours();switch(l=12===o?"noon":0===o?"midnight":o/12>=1?"pm":"am",n){case"b":case"bb":return t.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(l,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(l,{width:"wide",context:"formatting"})}},B:function(e,n,t){var l,o=e.getUTCHours();switch(l=o>=17?"evening":o>=12?"afternoon":o>=4?"morning":"night",n){case"B":case"BB":case"BBB":return t.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(l,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(l,{width:"wide",context:"formatting"})}},h:function(e,n,t){if("ho"===n){var l=e.getUTCHours()%12;return 0===l&&(l=12),t.ordinalNumber(l,{unit:"hour"})}return function(e,n){return sl(e.getUTCHours()%12||12,n.length)}(e,n)},H:function(e,n,t){return"Ho"===n?t.ordinalNumber(e.getUTCHours(),{unit:"hour"}):function(e,n){return sl(e.getUTCHours(),n.length)}(e,n)},K:function(e,n,t){var l=e.getUTCHours()%12;return"Ko"===n?t.ordinalNumber(l,{unit:"hour"}):sl(l,n.length)},k:function(e,n,t){var l=e.getUTCHours();return 0===l&&(l=24),"ko"===n?t.ordinalNumber(l,{unit:"hour"}):sl(l,n.length)},m:function(e,n,t){return"mo"===n?t.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):function(e,n){return sl(e.getUTCMinutes(),n.length)}(e,n)},s:function(e,n,t){return"so"===n?t.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):function(e,n){return sl(e.getUTCSeconds(),n.length)}(e,n)},S:function(e,n){return function(e,n){var t=n.length,l=e.getUTCMilliseconds();return sl(Math.floor(l*Math.pow(10,t-3)),n.length)}(e,n)},X:function(e,n,t,l){var o=(l._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(n){case"X":return pl(o);case"XXXX":case"XX":return ml(o);case"XXXXX":case"XXX":default:return ml(o,":")}},x:function(e,n,t,l){var o=(l._originalDate||e).getTimezoneOffset();switch(n){case"x":return pl(o);case"xxxx":case"xx":return ml(o);case"xxxxx":case"xxx":default:return ml(o,":")}},O:function(e,n,t,l){var o=(l._originalDate||e).getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+vl(o,":");case"OOOO":default:return"GMT"+ml(o,":")}},z:function(e,n,t,l){var o=(l._originalDate||e).getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+vl(o,":");case"zzzz":default:return"GMT"+ml(o,":")}},t:function(e,n,t,l){return sl(Math.floor((l._originalDate||e).getTime()/1e3),n.length)},T:function(e,n,t,l){return sl((l._originalDate||e).getTime(),n.length)}};function vl(e,n){var t=e>0?"-":"+",l=Math.abs(e),o=Math.floor(l/60),i=l%60;if(0===i)return t+String(o);var a=n||"";return t+String(o)+a+sl(i,2)}function pl(e,n){return e%60==0?(e>0?"-":"+")+sl(Math.abs(e)/60,2):ml(e,n)}function ml(e,n){var t=n||"",l=e>0?"-":"+",o=Math.abs(e);return l+sl(Math.floor(o/60),2)+t+sl(o%60,2)}function El(e,n){switch(e){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}}function Sl(e,n){switch(e){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}}var _l={p:Sl,P:function(e,n){var t,l=e.match(/(P+)(p+)?/)||[],o=l[1],i=l[2];if(!i)return El(e,n);switch(o){case"P":t=n.dateTime({width:"short"});break;case"PP":t=n.dateTime({width:"medium"});break;case"PPP":t=n.dateTime({width:"long"});break;case"PPPP":default:t=n.dateTime({width:"full"})}return t.replace("{{date}}",El(o,n)).replace("{{time}}",Sl(i,n))}},fl=["D","DD"],gl=["YY","YYYY"];function Cl(e){return-1!==fl.indexOf(e)}function Nl(e){return-1!==gl.indexOf(e)}function yl(e,n,t){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(n,"`) for formatting years to the input `").concat(t,"`; see: https://git.io/fxCyr"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(n,"`) for formatting years to the input `").concat(t,"`; see: https://git.io/fxCyr"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(n,"`) for formatting days of the month to the input `").concat(t,"`; see: https://git.io/fxCyr"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(n,"`) for formatting days of the month to the input `").concat(t,"`; see: https://git.io/fxCyr"))}var Dl=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Tl=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,hl=/^'([^]*?)'?$/,Al=/''/g,Il=/[a-zA-Z]/;function Ol(e,n,t){kt(2,arguments);var l=String(n),o=t||{},i=o.locale||tl,a=i.options&&i.options.firstWeekContainsDate,r=null==a?1:Ut(a),u=null==o.firstWeekContainsDate?r:Ut(o.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var d=i.options&&i.options.weekStartsOn,s=null==d?0:Ut(d),c=null==o.weekStartsOn?s:Ut(o.weekStartsOn);if(!(c>=0&&c<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!i.localize)throw new RangeError("locale must contain localize property");if(!i.formatLong)throw new RangeError("locale must contain formatLong property");var v=Ht(e);if(!Gt(v))throw new RangeError("Invalid time value");var p=zt(v),m=ll(v,p),E={firstWeekContainsDate:u,weekStartsOn:c,locale:i,_originalDate:v},S=l.match(Tl).map(function(e){var n=e[0];return"p"===n||"P"===n?(0,_l[n])(e,i.formatLong,E):e}).join("").match(Dl).map(function(t){if("''"===t)return"'";var l=t[0];if("'"===l)return bl(t);var a=cl[l];if(a)return!o.useAdditionalWeekYearTokens&&Nl(t)&&yl(t,n,e),!o.useAdditionalDayOfYearTokens&&Cl(t)&&yl(t,n,e),a(m,t,i.localize,E);if(l.match(Il))throw new RangeError("Format string contains an unescaped latin alphabet character `"+l+"`");return t}).join("");return S}function bl(e){return e.match(hl)[1].replace(Al,"'")}function Ll(e){var n;let{t:o,key:i,document:r,setDocuments:u,error:d,setError:s,documents:c,setCheckRequiredFields:p}=e;const m=null==c?void 0:c.filter(e=>{var n;return null==e||null===(n=e.documentType)||void 0===n?void 0:n.includes(null==r?void 0:r.code)})[0],E=Digit.ULBService.getCurrentTenantId(),[S,_]=t.useState(m?v({},m,{active:!0,code:null==m?void 0:m.documentType,i18nKey:null==m?void 0:m.documentType}):1===(null==r||null===(n=r.dropdownData)||void 0===n?void 0:n.length)?null==r?void 0:r.dropdownData[0]:{}),[f,g]=t.useState(null),[C,N]=t.useState(()=>(null==m?void 0:m.fileStoreId)||null);return t.useEffect(()=>{null!=S&&S.code&&u(e=>{const n=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==S?void 0:S.code));return 0===(null==C?void 0:C.length)||null===C?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==C),{documentType:null==S?void 0:S.code,fileStoreId:C,documentUid:C,fileName:(null==f?void 0:f.name)||""}]})},[C,S]),t.useEffect(()=>{!function(){try{s(null);const e=function(){if(f){const e=function(){if(f.size>=5242880)s({key:"error",message:"CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"});else{const e=he(function(){return N(null),Promise.resolve(Digit.UploadServices.Filestorage("WS",f,null==E?void 0:E.split(".")[0])).then(function(e){var n,t,l,o;(null==e||null===(n=e.data)||void 0===n||null===(t=n.files)||void 0===t?void 0:t.length)>0?N(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):s({key:"error",message:"CS_FILE_UPLOAD_ERROR"})})},function(){s({key:"error",message:"CS_FILE_UPLOAD_ERROR"})});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[f]),l.createElement("div",{style:{marginBottom:"24px"}},l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:{marginTop:"-5px",fontWeight:"700",display:"inline"},className:"card-label-smaller"},o(null==r?void 0:r.i18nKey)+"*"),l.createElement("div",{className:"field"},l.createElement(a.Dropdown,{t:o,isMandatory:!1,option:null==r?void 0:r.dropdownData,selected:S,optionKey:"i18nKey",select:e=>_(e)}),l.createElement(a.UploadFile,{id:"noc-doc-1-"+i,extraStyleName:"propertyCreate",accept:"image/*, .pdf, .png, .jpeg, .jpg",onUpload:function(e){g(e.target.files[0])},onDelete:()=>{N(null),p(!0)},message:C?"1 "+o("CS_ACTION_FILEUPLOADED"):o("ES_NO_FILE_SELECTED_LABEL"),error:d}))))}function Rl(e){var n;let{t:o,key:i,document:r,setDocuments:u,error:d,setError:s,documents:c,setCheckRequiredFields:p}=e;const m=null==c?void 0:c.filter(e=>{var n;return null==e||null===(n=e.documentType)||void 0===n?void 0:n.includes(null==r?void 0:r.code)})[0],E=Digit.ULBService.getCurrentTenantId(),[S,_]=t.useState(m?v({},m,{active:!0,code:null==m?void 0:m.documentType,i18nKey:null==m?void 0:m.documentType}):1===(null==r||null===(n=r.dropdownData)||void 0===n?void 0:n.length)?null==r?void 0:r.dropdownData[0]:{}),[f,g]=t.useState(null),[C,N]=t.useState(()=>(null==m?void 0:m.fileStoreId)||null);return t.useEffect(()=>{null!=S&&S.code&&u(e=>{const n=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==S?void 0:S.code));return 0===(null==C?void 0:C.length)||null===C?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==C),{documentType:null==S?void 0:S.code,fileStoreId:C,id:null==S?void 0:S.id,i18nKey:null==S?void 0:S.code,documentUid:null!=S&&S.documentUid?null==S?void 0:S.documentUid:C,fileName:(null==f?void 0:f.name)||"",status:"ACTIVE"}]})},[C,S]),t.useEffect(()=>{!function(){try{s(null);const e=function(){if(f){const e=function(){if(f.size>=5242880)s({key:"error",message:"CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"});else{const e=he(function(){return N(null),Promise.resolve(Digit.UploadServices.Filestorage("WS",f,null==E?void 0:E.split(".")[0])).then(function(e){var n,t,l,o;(null==e||null===(n=e.data)||void 0===n||null===(t=n.files)||void 0===t?void 0:t.length)>0?N(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):s({key:"error",message:"CS_FILE_UPLOAD_ERROR"})})},function(){s({key:"error",message:"CS_FILE_UPLOAD_ERROR"})});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[f]),l.createElement("div",{style:{marginBottom:"24px"}},l.createElement(a.CardLabel,null,o(null==r?void 0:r.i18nKey)+"*"),l.createElement(a.Dropdown,{t:o,isMandatory:!1,option:null==r?void 0:r.dropdownData,selected:S,optionKey:"i18nKey",select:e=>_(e)}),l.createElement(a.UploadFile,{id:"noc-doc-"+i,extraStyleName:"propertyCreate",accept:"image/*, .pdf, .png, .jpeg, .jpg",onUpload:function(e){g(e.target.files[0])},onDelete:()=>{N(null),p(!0)},message:C?"1 "+o("CS_ACTION_FILEUPLOADED"):o("ES_NO_FILE_SELECTED_LABEL"),error:d}))}const wl=e=>l.createElement(a.Banner,{message:e.message,applicationNumber:null==e?void 0:e.applicationNumber,successful:e.isSuccess,style:{padding:"10px"},headerStyles:{fontSize:"32px"},infoOneStyles:{paddingTop:"20px"}}),Wl=e=>l.createElement(a.Banner,{message:e.message,applicationNumber:null==e?void 0:e.applicationNumber,successful:e.isSuccess,style:{padding:"10px"},headerStyles:{fontSize:"32px"},infoOneStyles:{paddingTop:"20px"}}),Pl=e=>{var n,o;const{disConnectionDetail:i,focusIndex:u,setFocusIndex:d,t:s,config:c,setError:p,clearErrors:E,formState:S,disConnectionDetails:f,setIsErrors:g,setDisConnectionDetails:C,disconnectionTypeList:N}=e,{control:y,formState:D,watch:T,trigger:h}=r.useForm(),A=T(),{errors:I}=D,O=window.Digit.Utils.browser.isMobile(),b=window.location.href.includes("/employee");t.useEffect(()=>{h()},[]),t.useEffect(()=>{if(Object.entries(A).length>0){const e=Object.keys(A),n={};if(e.forEach(e=>n[e]=i[e]),!_.isEqual(A,n)){let e=!0;Object.keys(A).map(n=>{!A[n]&&e&&(e=!1,g(!1))}),e&&g(!0);let n=[v({},A)];C(n),h()}}},[A,f]),t.useEffect(()=>{var e;Object.keys(I).length&&!_.isEqual((null===(e=S.errors[c.key])||void 0===e?void 0:e.type)||{},I)?p(c.key,{type:I}):!Object.keys(I).length&&S.errors[c.key]&&E(c.key)},[I]);const L={width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"};return l.createElement("div",null,l.createElement("div",{style:{marginBottom:"16px"}},l.createElement(a.CardSubHeader,{style:{marginBottom:"40px",fontSize:"24px",lineHeight:"32px"}},s("WS_APPLICATION_DETAILS")),l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:O&&b?{fontWeight:"700",width:"100%"}:{marginTop:"-5px",fontWeight:"700"},className:"card-label-smaller"},s("WS_ACK_COMMON_APP_NO_LABEL")+"*"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:y,name:"consumerNumber",defaultValue:null==i?void 0:i.consumerNumber,rules:{required:s("REQUIRED_FIELD")},isMandatory:!0,render:e=>{var n;return l.createElement(a.TextInput,{value:e.value,autoFocus:u.index===(null==i?void 0:i.key)&&"consumerNumber"===u.type,errorStyle:!(!D.touched.consumerNumber||null==I||null===(n=I.consumerNumber)||void 0===n||!n.message),onChange:n=>{e.onChange(n.target.value),d({index:null==i?void 0:i.key,type:"consumerNumber"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur,style:{border:"none",color:"#0b0c0c !important",pointerEvents:"none"}})}}))),l.createElement(a.CardLabel,{style:O&&b?{fontWeight:"700",width:"100%"}:{marginTop:"-5px",fontWeight:"700"},className:"card-label-smaller"},""+s("WS_DISCONNECTION_TYPE")),l.createElement(r.Controller,{control:y,name:"disConnectionType",defaultValue:null==i?void 0:i.disConnectionType,rules:{required:s("REQUIRED_FIELD")},isMandatory:!0,render:e=>{var n;return l.createElement(a.RadioButtons,{t:s,options:N,optionsKey:"i18nKey",value:{name:null==i?void 0:i.disConnectionType,value:null==i?void 0:i.disConnectionType,code:null==i?void 0:i.disConnectionType,i18nKey:"WS_DISCONNECTIONTYPE_"+m(null==i?void 0:i.disConnectionType," ","_")},selectedOption:{name:null==i?void 0:i.disConnectionType,value:null==i?void 0:i.disConnectionType,code:null==i?void 0:i.disConnectionType,i18nKey:"WS_DISCONNECTIONTYPE_"+m(null==i?void 0:i.disConnectionType," ","_")},onSelect:n=>{e.onChange(n.code)},labelKey:"WS_DISCONNECTIONTYPE",errorStyle:!(!D.touched.disConnectionType||null==I||null===(n=I.disConnectionType)||void 0===n||!n.message),autoFocus:u.index===(null==i?void 0:i.key)&&"disConnectionType"===u.type,style:{display:"flex",gap:"0px 3rem"},isDependent:!0})}}),l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:O&&b?{fontWeight:"700",width:"100%"}:{marginTop:"-5px",fontWeight:"700"},className:"card-label-smaller"},s("WS_DISCONNECTION_PROPOSED_DATE")+"*"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{name:"disConnectionProposeDate",rules:{required:s("REQUIRED_FIELD")},defaultValue:null==i?void 0:i.disConnectionProposeDate,control:y,render:e=>l.createElement(a.DatePicker,{date:e.value,name:"disConnectionProposeDate",onChange:e.onChange})}))),l.createElement(a.CardLabelError,{style:L},D.touched.disConnectionProposeDate?null==I||null===(n=I.disConnectionProposeDate)||void 0===n?void 0:n.message:""),l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:O&&b?{fontWeight:"700",width:"100%"}:{marginTop:"-5px",fontWeight:"700"},className:"card-label-smaller"},s("WS_DISCONNECTION_REASON")+"*"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:y,defaultValue:null==i?void 0:i.disConnectionReason,name:"disConnectionReason",rules:{required:s("REQUIRED_FIELD")},render:e=>{var n;return l.createElement(a.TextArea,{t:s,type:"text",isMandatory:!1,name:"disConnectionReason",value:e.value,errorStyle:!(!D.touched.disConnectionReason||null==I||null===(n=I.disConnectionReason)||void 0===n||!n.message),autoFocus:u.index===(null==i?void 0:i.key)&&"disConnectionReason"===u.type,onChange:n=>{e.onChange(n),d({index:i.key,type:"disConnectionReason"})},onBlur:e.onBlur})}}))),l.createElement(a.CardLabelError,{style:L},D.touched.disConnectionReason?null==I||null===(o=I.disConnectionReason)||void 0===o?void 0:o.message:"")))},Ml=e=>{var n,i,r,u;let{registerRef:d,searchFormState:s}=e;const{t:c}=o.useTranslation(),p={maxlength:10,pattern:"[6-9][0-9]{9}",title:c("ES_SEARCH_APPLICATION_MOBILE_INVALID"),componentInFront:"+91"};let m={};return l.createElement(t.Fragment,null,l.createElement(a.SearchField,{className:"wns-search-field"},l.createElement("label",null,c("WS_ACK_COMMON_APP_NO_LABEL")),l.createElement(a.TextInput,v({name:"applicationNumber",inputRef:d({})},m={isRequired:!1,pattern:"^[a-zA-Z0-9-_/]*$",type:"text",title:c("ERR_INVALID_APPLICATION_NO")}))),l.createElement(a.SearchField,{className:"wns-search-field"},l.createElement("label",null,c("WS_MYCONNECTIONS_CONSUMER_NO")),l.createElement(a.TextInput,v({name:"consumerNo",inputRef:d({})},m={isRequired:!1,pattern:"^[a-zA-Z0-9/-]*$",type:"text",title:c("ERR_INVALID_CONSUMER_NO")}))),l.createElement(a.SearchField,{className:"wns-search-field"},l.createElement("label",null,c("CORE_COMMON_MOBILE_NUMBER")),l.createElement(a.MobileNumber,v({name:"mobileNumber",type:"number",inputRef:d({})},p)),null!=s&&null!==(n=s.errors)&&void 0!==n&&null!==(i=n.mobileNumber)&&void 0!==i&&i.message?l.createElement(a.CardLabelError,null,null==s||null===(r=s.errors)||void 0===r||null===(u=r.mobileNumber)||void 0===u?void 0:u.message):null))},xl=e=>{var n,i,u,d,s,c;let{statuses:v,isInboxLoading:p,controlFilterForm:m,filterFormState:E,localitiesForEmployeesCurrentTenant:S,loadingLocalitiesForEmployeesCurrentTenant:_,checkPathName:f}=e;const{t:g}=o.useTranslation(),C=[{code:"ASSIGNED_TO_ME",name:""+g("ES_INBOX_ASSIGNED_TO_ME")},{code:"ASSIGNED_TO_ALL",name:""+g("ES_INBOX_ASSIGNED_TO_ALL")}],N=r.useWatch({control:m,name:"applicationType",defaultValue:(null==E?void 0:E.applicationType)||null});let y=0,D=0,T=0,h=0,A=0,I=0;null==v||null===(n=v.filter(e=>"NewWS1"===e.businessservice))||void 0===n||n.forEach(e=>y+=null==e?void 0:e.count),null==v||null===(i=v.filter(e=>"ModifyWSConnection"===e.businessservice))||void 0===i||i.forEach(e=>D+=null==e?void 0:e.count),null==v||null===(u=v.filter(e=>"DisconnectWSConnection"===e.businessservice))||void 0===u||u.forEach(e=>T+=null==e?void 0:e.count),null==v||null===(d=v.filter(e=>"NewSW1"===e.businessservice))||void 0===d||d.forEach(e=>h+=null==e?void 0:e.count),null==v||null===(s=v.filter(e=>"ModifySWConnection"===e.businessservice))||void 0===s||s.forEach(e=>A+=null==e?void 0:e.count),null==v||null===(c=v.filter(e=>"DisconnectSWConnection"===e.businessservice))||void 0===c||c.forEach(e=>I+=null==e?void 0:e.count);const O=f?[{code:"NewWS1",name:g("CS_COMMON_INBOX_NEWWS1")+" ("+y+")"},{code:"ModifyWSConnection",name:g("CS_COMMON_INBOX_MODIFYWSCONNECTION")+" ("+D+")"},{code:"DisconnectWSConnection",name:g("CS_COMMON_INBOX_DISCONNECTIONWS")+" ("+T+")"}]:[{code:"NewSW1",name:g("CS_COMMON_INBOX_NEWSW1")+" ("+h+")"},{code:"ModifySWConnection",name:g("CS_COMMON_INBOX_MODIFYSWCONNECTION")+" ("+A+")"},{code:"DisconnectSWConnection",name:g("CS_COMMON_INBOX_DISCONNECTIONSW")+" ("+I+")"}],b=(e,n)=>{const t=e.map(e=>e[1]);return n.onChange(t)};return l.createElement(t.Fragment,null,l.createElement(a.FilterFormField,null,l.createElement(r.Controller,{name:"assignee",control:m,render:e=>l.createElement(a.RadioButtons,{onSelect:n=>{e.onChange(n.code)},selectedOption:C.filter(n=>n.code===e.value)[0],optionsKey:"name",name:"assignee",options:C})})),l.createElement(a.FilterFormField,null,l.createElement(r.Controller,{name:"locality",control:m,render:e=>{const n=t.useMemo(()=>{var n;return null==e||null===(n=e.value)||void 0===n?void 0:n.map((n,t)=>l.createElement(a.RemoveableTag,{key:t,text:n.i18nkey,onClick:()=>{var t;e.onChange(null==e||null===(t=e.value)||void 0===t?void 0:t.filter(e=>e.code!==n.code))}}))},[null==e?void 0:e.value]);return _?l.createElement(a.Loader,null):l.createElement(t.Fragment,null,l.createElement("div",{className:"filter-label sub-filter-label"},g("ES_INBOX_LOCALITY")),l.createElement(a.MultiSelectDropdown,{options:S||[],optionsKey:"i18nkey",props:e,isPropsNeeded:!0,onSelect:b,selected:null==e?void 0:e.value,defaultLabel:g("ES_WS_ALL_SELECTED"),defaultUnit:g("WS_SELECTED_TEXT")}),l.createElement("div",{className:"tag-container"},n))}})),l.createElement(a.FilterFormField,null,l.createElement(r.Controller,{name:"applicationType",control:m,render:e=>{const n=t.useMemo(()=>null==O?void 0:O.map((n,t)=>{var o;return l.createElement(a.CheckBox,{onChange:t=>{var l,o;return o=t.target.checked?[...e.value,null==n?void 0:n.code]:null===(l=e.value)||void 0===l?void 0:l.filter(e=>e!==(null==n?void 0:n.code)),void e.onChange(o)},checked:null===(o=e.value)||void 0===o?void 0:o.includes(null==n?void 0:n.code),label:null==n?void 0:n.name,value:n.name,key:t+1})}),[e.value,v]);return l.createElement(t.Fragment,null,l.createElement("div",{className:"filter-label sub-filter-label"},g("WS_COMMON_TABLE_COL_APP_TYPE_LABEL")),p?l.createElement(a.Loader,null):l.createElement(t.Fragment,null," ",n))}})),(null==N?void 0:N.length)>0?l.createElement(a.FilterFormField,null,l.createElement(r.Controller,{name:"applicationStatus",control:m,render:e=>{const n=t.useMemo(()=>{var n;return null==v||null===(n=v.filter(e=>N.includes(e.businessservice)))||void 0===n?void 0:n.map((n,t)=>{var o;return l.createElement(a.CheckBox,{key:t+1,onChange:t=>{var l,o;return o=t.target.checked?[...e.value,null==n?void 0:n.statusid]:null===(l=e.value)||void 0===l?void 0:l.filter(e=>e!==(null==n?void 0:n.statusid)),void e.onChange(o)},checked:null===(o=e.value)||void 0===o?void 0:o.includes(null==n?void 0:n.statusid),label:g("WF_"+n.businessservice.toUpperCase()+"_"+n.applicationstatus.split("_").pop())+" ("+n.count+")"})})},[e.value,v,N]);return l.createElement(t.Fragment,null,l.createElement("div",{className:"filter-label sub-filter-label"},g("WS_MYCONNECTIONS_STATUS")),p?l.createElement(a.Loader,null):l.createElement(t.Fragment,null,n))}})):null)},Bl=e=>{var n,o;let{register:i,control:u,reset:d,tenantId:s,t:c,businessService:p}=e;const{isLoading:m,data:E}=Digit.Hooks.ws.useWSMDMSWS.applicationTypes(Digit.ULBService.getStateId()),S="WS"===p?"WATER":"SEWERAGE",_=null==E?void 0:E.filter(e=>{var n;return null==e||null===(n=e.code)||void 0===n?void 0:n.includes(S)}),f=r.useWatch({control:u,name:"applicationType"});let g=[],C="";g=["NewWS1","NewSW1","ModifyWSConnection","ModifySWConnection","DisconnectWSConnection","DisconnectSWConnection"],f&&"NEW_WATER_CONNECTION"===(null==f?void 0:f.code)?C="NewWS1":f&&"NEW_SEWERAGE_CONNECTION"===(null==f?void 0:f.code)?C="NewSW1":f&&"MODIFY_WATER_CONNECTION"===(null==f?void 0:f.code)?C="ModifyWSConnection":f&&"MODIFY_SEWERAGE_CONNECTION"===(null==f?void 0:f.code)?C="ModifySWConnection":f&&"DISCONNECT_WATER_CONNECTION"===(null==f?void 0:f.code)?C="DisconnectWSConnection":f&&"DISCONNECT_SEWERAGE_CONNECTION"===(null==f?void 0:f.code)&&(C="DisconnectSWConnection");const{data:N,isLoading:y}=Digit.Hooks.useApplicationStatusGeneral({businessServices:g,tenantId:s},{});let D=[];N&&(null==N||null===(n=N.otherRoleStates)||void 0===n||n.map(e=>{""===C?D.length>0&&(null==D?void 0:D.some(n=>(null==n?void 0:n.code)===e.applicationStatus))||D.push({code:null==e?void 0:e.applicationStatus,i18nKey:"WF_NEWWS1_"+(null==e?void 0:e.applicationStatus)}):(null==e?void 0:e.stateBusinessService)===C&&D.push({code:null==e?void 0:e.applicationStatus,i18nKey:"WF_NEWWS1_"+(null==e?void 0:e.applicationStatus)})})),N&&(null==N||null===(o=N.userRoleStates)||void 0===o||o.map(e=>{""===C?D.length>0&&(null==D?void 0:D.some(n=>(null==n?void 0:n.code)===e.applicationStatus))||D.push({code:null==e?void 0:e.applicationStatus,i18nKey:"WF_NEWWS1_"+(null==e?void 0:e.applicationStatus)}):(null==e?void 0:e.stateBusinessService)===C&&D.push({code:null==e?void 0:e.applicationStatus,i18nKey:"WF_NEWWS1_"+(null==e?void 0:e.applicationStatus)})})),null==D||D.sort((e,n)=>c(e.i18nKey)>c(n.i18nKey)?1:c(n.i18nKey)>c(e.i18nKey)?-1:0);const T={maxlength:10,pattern:"[6-9][0-9]{9}",title:c("ES_SEARCH_APPLICATION_MOBILE_INVALID"),componentInFront:"+91"};let h={};return l.createElement(t.Fragment,null,l.createElement(a.SearchField,null,l.createElement("label",null,c("WS_ACK_COMMON_APP_NO_LABEL")),l.createElement(a.TextInput,v({name:"applicationNumber",inputRef:i()},h={isRequired:!1,pattern:"^[a-zA-Z0-9-_/]*$",type:"text",title:c("ERR_INVALID_APPLICATION_NO")}))),l.createElement(a.SearchField,null,l.createElement("label",null,c("WS_MYCONNECTIONS_CONSUMER_NO")),l.createElement(a.TextInput,v({name:"connectionNumber",inputRef:i()},h={isRequired:!1,pattern:"^[a-zA-Z0-9/-]*$",type:"text",title:c("ERR_INVALID_CONSUMER_NO")}))),l.createElement(a.SearchField,null,l.createElement("label",null,c("CONSUMER_MOBILE_NUMBER")),l.createElement(a.MobileNumber,v({name:"mobileNumber",type:"number",inputRef:i({})},T))),m?l.createElement(a.Loader,null):l.createElement(a.SearchField,null,l.createElement("label",null,c("WS_APPLICATION_TYPE_LABEL")),l.createElement(r.Controller,{control:u,name:"applicationType",render:e=>l.createElement(a.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:_,optionKey:"i18nKey",t:c})})),y?l.createElement(a.Loader,null):l.createElement(a.SearchField,null,l.createElement("label",null,c("WS_COMMON_TABLE_COL_APPLICATION_STATUS_LABEL")),l.createElement(r.Controller,{control:u,name:"applicationStatus",render:e=>l.createElement(a.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:D,optionKey:"i18nKey",t:c})})),l.createElement(a.SearchField,null,l.createElement("label",null,c("WS_COMMON_FROM_DATE_LABEL")),l.createElement(r.Controller,{render:e=>l.createElement(a.DatePicker,{date:e.value,onChange:e.onChange}),name:"fromDate",control:u})),l.createElement(a.SearchField,null,l.createElement("label",null,c("WS_COMMON_TO_DATE_LABEL")),l.createElement(r.Controller,{render:e=>l.createElement(a.DatePicker,{date:e.value,onChange:e.onChange}),name:"toDate",control:u})),l.createElement(a.SearchField,{className:"submit"},l.createElement(a.SubmitBar,{label:c("ES_COMMON_SEARCH"),submit:!0}),l.createElement("p",{onClick:()=>{d({applicationType:"",fromDate:"",toDate:"",connectionNumber:"",applicationStatus:"",applicationNumber:"",tradeName:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC"})}},c("CS_COMMON_CLEAR_SEARCH"))))},Fl=["currentlyActiveMobileModal","searchFormFieldsComponentProps","tenantId"],Ul=["currentlyActiveMobileModal","searchFormFieldsComponentProps","tenantId"],kl=e=>{let{Controller:n,register:o,control:r,t:u,reset:d,previousPage:s,handleSubmit:c,tenantId:m,data:E,onSubmit:S,businessService:_}=e;const[f,g]=t.useReducer(function(e,n){switch(n.type){case"set":return n.payload;case"remove":return!1}},!1),C=()=>{g({type:"remove"})},N=()=>l.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:C},l.createElement(a.CloseSvg,null)),y={Controller:n,register:o,control:r,t:u,reset:d,previousPage:s,businessService:_},D=t.useCallback(e=>{let{currentlyActiveMobileModal:n,searchFormFieldsComponentProps:t,tenantId:o}=e;return(e=>{let{currentlyActiveMobileModal:n,searchFormFieldsComponentProps:t,tenantId:o}=e,i=p(e,Fl);const{closeMobilePopupModal:r}=i;switch(n){case"SearchFormComponent":return l.createElement(a.SearchForm,i,l.createElement(N,null),l.createElement("div",{className:"MobilePopupHeadingWrapper"},l.createElement("h2",null,u("ES_COMMON_SEARCH"),":")),l.createElement(Bl,v({},t,{closeMobilePopupModal:r,tenantId:o,t:u})));default:return l.createElement("span",null)}})(v({currentlyActiveMobileModal:n,searchFormFieldsComponentProps:t,tenantId:o},p(e,Ul)))},[f]),T=t.useMemo(()=>{if(null!=E&&E.display)return[];const e=e=>"NEW_WATER_CONNECTION"==(null==e?void 0:e.applicationType)||"MODIFY_WATER_CONNECTION"==(null==e?void 0:e.applicationType)||"DISCONNECT_WATER_CONNECTION"==(null==e?void 0:e.applicationType)?"WATER":"NEW_SEWERAGE_CONNECTION"==(null==e?void 0:e.applicationType)||"MODIFY_SEWERAGE_CONNECTION"==(null==e?void 0:e.applicationType)||"DISCONNECT_SEWERAGE_CONNECTION"==(null==e?void 0:e.applicationType)?"SEWERAGE":void 0,n=e=>{var n,t;let l="application";return null!=e&&null!==(n=e.toUpperCase())&&void 0!==n&&n.includes("DISCONNECT")?l="disconnection":null!=e&&null!==(t=e.toUpperCase())&&void 0!==t&&t.includes("MODIFY")&&(l="modify"),l};return null==E?void 0:E.map(t=>{return{[u("WS_MYCONNECTIONS_CONSUMER_NO")]:null!=t&&t.connectionNo?l.createElement("div",null,l.createElement("span",{className:"link"},l.createElement(i.Link,{to:"/digit-ui/employee/ws/connection-details?applicationNumber="+(null==t?void 0:t.connectionNo)+"&tenantId="+m+"&service="+e(t)},null==t?void 0:t.connectionNo))):u("CS_NA"),[u("WS_ACK_COMMON_APP_NO_LABEL")]:l.createElement("div",null,l.createElement("span",{className:"link"},l.createElement(i.Link,{to:"/digit-ui/employee/ws/"+n(null==t?void 0:t.applicationType)+"-details?applicationNumber="+(null==t?void 0:t.applicationNo)+"&tenantId="+m+"&service="+e(t)},null==t?void 0:t.applicationNo))),[u("WS_APPLICATION_TYPE_LABEL")]:null!=t&&t.applicationType?(o=t.applicationType,o=o.replace(/_/g," ")):"-",[u("WS_COMMON_TABLE_COL_OWN_NAME_LABEL")]:(null==t?void 0:t.ownerNames)||"-",[u("WS_COMMON_TABLE_COL_APPLICATION_STATUS_LABEL")]:u((null==t?void 0:t.applicationStatus)||"NA"),[u("WS_COMMON_TABLE_COL_ADDRESS")]:(null==t?void 0:t.address)||"-"};var o})},[E]);return l.createElement(l.Fragment,null,l.createElement("div",{className:"searchBox"},l.createElement(a.SearchAction,{text:u("ES_COMMON_SEARCH"),handleActionClick:()=>g({type:"set",payload:"SearchFormComponent"}),tenantId:m,t:u})),f?l.createElement(a.PopUp,null,l.createElement(D,{onSubmit:e=>{g({type:"remove"}),S(e)},handleSubmit:c,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",searchFormFieldsComponentProps:y,currentlyActiveMobileModal:f,closeMobilePopupModal:C,tenantId:m})):null,null!=E&&E.display?l.createElement(a.Card,{style:{marginTop:20}},u(null==E?void 0:E.display).split("\\n").map((e,n)=>l.createElement("p",{key:n,style:{textAlign:"center"}},e))):l.createElement(a.DetailsCard,{data:T,serviceRequestIdKey:u("WS_COMMON_TABLE_COL_APP_NO")}))},Hl=e=>{let{register:n,reset:o,t:i}=e;const r={maxlength:10,pattern:"[6-9][0-9]{9}",title:i("ES_SEARCH_APPLICATION_MOBILE_INVALID"),componentInFront:"+91"},u={pattern:"[A-Za-z]{2}-[A-Za-z]{2}-[0-9]{4}-[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{6}|[A-Za-z]{2}-[A-Za-z]{2}-[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{6}",title:i("ERR_DEFAULT_INPUT_FIELD_MSG")};let d={};return l.createElement(t.Fragment,null,l.createElement(a.SearchField,null,l.createElement("label",null,i("WS_MYCONNECTIONS_CONSUMER_NO")),l.createElement(a.TextInput,v({name:"connectionNumber",inputRef:n({})},d={isRequired:!1,pattern:"^[a-zA-Z0-9/-]*$",type:"text",title:i("ERR_INVALID_CONSUMER_NO")}))),l.createElement(a.SearchField,null,l.createElement("label",null,i("WS_SEARCH_CONNNECTION_OLD_CONSUMER_LABEL")),l.createElement(a.TextInput,v({name:"oldConnectionNumber",inputRef:n({})},u))),l.createElement(a.SearchField,null,l.createElement("label",null,i("WS_PROPERTY_ID_LABEL")),l.createElement(a.TextInput,v({name:"propertyId",inputRef:n({})},u))),l.createElement(a.SearchField,null,l.createElement("label",null,i("WS_HOME_SEARCH_RESULTS_OWN_MOB_LABEL")),l.createElement(a.MobileNumber,v({name:"mobileNumber",inputRef:n({})},r))),l.createElement(a.SearchField,{className:"submit"},l.createElement(a.SubmitBar,{label:i("WS_SEARCH_CONNECTION_SEARCH_BUTTON"),submit:!0}),l.createElement("p",{onClick:()=>{o({searchType:"CONNECTION",mobileNumber:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC",propertyId:"",connectionNumber:"",oldConnectionNumber:""})}},i("WS_SEARCH_CONNECTION_RESET_BUTTON"))))},jl=["currentlyActiveMobileModal","searchFormFieldsComponentProps","tenantId"],Vl=["currentlyActiveMobileModal","searchFormFieldsComponentProps","tenantId"],zl=e=>{let{Controller:n,register:o,control:r,t:u,reset:d,previousPage:s,handleSubmit:c,tenantId:m,data:E,onSubmit:S}=e;const[_,f]=t.useReducer(function(e,n){switch(n.type){case"set":return n.payload;case"remove":return!1}},!1),g=()=>{f({type:"remove"})},C=()=>l.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:g},l.createElement(a.CloseSvg,null)),N={Controller:n,register:o,control:r,t:u,reset:d,previousPage:s},y=e=>{if(null==e||null==e||""==e)return"NA";const n=new Date(e);let t=n.getMonth()+1,l=n.getDate();return t=(t>9?"":"0")+t,l=(l>9?"":"0")+l,l+"/"+t+"/"+n.getFullYear()},D=t.useCallback(e=>{let{currentlyActiveMobileModal:n,searchFormFieldsComponentProps:t,tenantId:o}=e;return(e=>{let{currentlyActiveMobileModal:n,searchFormFieldsComponentProps:t,tenantId:o}=e,i=p(e,jl);const{closeMobilePopupModal:r}=i;switch(n){case"SearchFormComponent":return l.createElement(a.SearchForm,i,l.createElement(C,null),l.createElement("div",{className:"MobilePopupHeadingWrapper"},l.createElement("h2",null,u("ES_COMMON_SEARCH"),":")),l.createElement(Hl,v({},t,{closeMobilePopupModal:r,tenantId:o,t:u})));default:return l.createElement("span",null)}})(v({currentlyActiveMobileModal:n,searchFormFieldsComponentProps:t,tenantId:o},p(e,Vl)))},[_]),T=(e,n)=>{switch(e){case"Active":return l.createElement("div",null,l.createElement("span",{className:"link"},l.createElement(i.Link,{to:{pathname:"/digit-ui/employee/payment/collect/"+("WATER"==(null==n?void 0:n.service)?"WS":"SW")+"/"+encodeURIComponent(null==n?void 0:n.connectionNo)+"/"+(null==n?void 0:n.tenantId)+"?tenantId="+(null==n?void 0:n.tenantId)+"&ISWSCON"}},u("WS_COMMON_COLLECT_LABEL")," ")))}},h=t.useMemo(()=>null!=E&&E.display?[]:null==E?void 0:E.map(e=>{var n,t,o;return{[u("WS_MYCONNECTIONS_CONSUMER_NO")]:(o=e,l.createElement("div",null,l.createElement("span",{className:"link"},l.createElement(i.Link,{to:"/digit-ui/employee/ws/connection-details?applicationNumber="+(null==o?void 0:o.connectionNo)+"&tenantId="+(null==o?void 0:o.tenantId)+"&service="+(null==o?void 0:o.service)+"&connectionType="+(null==o?void 0:o.connectionType)+"&due="+((null==o?void 0:o.due)||0)},(null==o?void 0:o.connectionNo)||"NA")))||u("WS_NA")),[u("WS_COMMON_TABLE_COL_SERVICE_LABEL")]:u("WS_"+(null==e?void 0:e.service)),[u("WS_COMMON_TABLE_COL_OWN_NAME_LABEL")]:(null==e?void 0:e.owner)||u("WS_NA"),[u("WS_COMMON_TABLE_COL_STATUS_LABEL")]:u("WS_"+(null==e||null===(n=e.status)||void 0===n?void 0:n.toUpperCase())),[u("WS_COMMON_TABLE_COL_AMT_DUE_LABEL")]:(null==e?void 0:e.due)||u("WS_NA"),[u("WS_COMMON_TABLE_COL_ADDRESS")]:(null==e?void 0:e.address)||u("WS_NA"),[u("WS_COMMON_TABLE_COL_DUE_DATE_LABEL")]:"INACTIVE"===(null==e||null===(t=e.status)||void 0===t?void 0:t.toUpperCase())?u("WS_NA"):null!=e&&e.dueDate?y(null==e?void 0:e.dueDate):u("WS_NA"),[u("WS_COMMON_TABLE_COL_ACTION_LABEL")]:null!=e&&e.due?T(null==e?void 0:e.status,e):u("WS_NA")}}),[E]);return l.createElement(l.Fragment,null,l.createElement("div",{className:"searchBox"},l.createElement(a.SearchAction,{text:u("ES_COMMON_SEARCH"),handleActionClick:()=>f({type:"set",payload:"SearchFormComponent"}),tenantId:m,t:u})),_?l.createElement(a.PopUp,null,l.createElement(D,{onSubmit:e=>{f({type:"remove"}),S(e)},handleSubmit:c,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",searchFormFieldsComponentProps:N,currentlyActiveMobileModal:_,closeMobilePopupModal:g,tenantId:m})):null,null!=E&&E.display?l.createElement(a.Card,{style:{marginTop:20}},u(null==E?void 0:E.display).split("\\n").map((e,n)=>l.createElement("p",{key:n,style:{textAlign:"center"}},e))):l.createElement(a.DetailsCard,{data:h,serviceRequestIdKey:u("WS_COMMON_TABLE_COL_APP_NO")}))},Yl=e=>{let{register:n,control:o,t:i,setValue:u}=e;const[d,s]=t.useState(""),c=Digit.ULBService.getCurrentTenantId();function v(e){console.log("register, control",n,c),u("locality",e),u("tenantId",c),s(e)}return l.createElement(t.Fragment,null,l.createElement(a.SearchField,null,l.createElement("label",null,i("WS_SEARCH_CONNNECTION_CITY")),l.createElement(a.TextInput,{name:"city",disable:!0,value:i(c),inputRef:n({})})),l.createElement(a.SearchField,null,l.createElement("label",null,i("WS_SEARCH_LOCALITY_LABEL")),l.createElement(r.Controller,{name:"locality",defaultValue:null,control:o,inputRef:n({}),render:e=>l.createElement(a.Localities,{selectLocality:v,tenantId:c,boundaryType:"revenue",keepNull:!1,optionCardStyles:{height:"600px",overflow:"auto",zIndex:"10"},selected:d,disableLoader:!1})})),l.createElement(a.SearchField,{style:{marginTop:"16px !important"}},l.createElement(a.SubmitBar,{label:i("WS_SEARCH_CONNECTION_SEARCH_BUTTON"),submit:!0})))},Gl=e=>{var n,i,r,u;let{registerRef:d,searchFormState:s}=e;const{t:c}=o.useTranslation(),p={maxlength:10,pattern:"[6-9][0-9]{9}",title:c("ES_SEARCH_APPLICATION_MOBILE_INVALID"),componentInFront:"+91"};let m={};return l.createElement(t.Fragment,null,l.createElement(a.SearchField,{className:"wns-search-field"},l.createElement("label",null,c("BILLAMEND_APPLICATIONNO")),l.createElement(a.TextInput,v({name:"applicationNumber",inputRef:d({})},m={isRequired:!1,pattern:"^[a-zA-Z0-9-_/]*$",type:"text",title:c("ERR_INVALID_APPLICATION_NO")}))),l.createElement(a.SearchField,{className:"wns-search-field"},l.createElement("label",null,c("BILLAMEND_CONSUMER_NO")),l.createElement(a.TextInput,v({name:"consumerCode",inputRef:d({})},m={isRequired:!1,pattern:"^[a-zA-Z0-9/-]*$",type:"text",title:c("ERR_INVALID_CONSUMER_NO")}))),l.createElement(a.SearchField,{className:"wns-search-field"},l.createElement("label",null,c("CORE_COMMON_MOBILE_NUMBER")),l.createElement(a.MobileNumber,v({name:"mobileNumber",type:"number",inputRef:d({})},p)),null!=s&&null!==(n=s.errors)&&void 0!==n&&null!==(i=n.mobileNumber)&&void 0!==i&&i.message?l.createElement(a.CardLabelError,null,null==s||null===(r=s.errors)||void 0===r||null===(u=r.mobileNumber)||void 0===u?void 0:u.message):null))},ql=e=>{let{controlFilterForm:n,localitiesForEmployeesCurrentTenant:i,loadingLocalitiesForEmployeesCurrentTenant:u,isInboxLoading:d,filterFormState:s,statuses:c}=e;const{t:v}=o.useTranslation(),p=[{code:"ASSIGNED_TO_ME",name:""+v("ES_INBOX_ASSIGNED_TO_ME")},{code:"ASSIGNED_TO_ALL",name:""+v("ES_INBOX_ASSIGNED_TO_ALL")}],m=(r.useWatch({control:n,name:"status",defaultValue:(null==s?void 0:s.applicationStatus)||null}),null==c||c.filter(e=>"BS.AMENDMENT"===e.businessservice),v("INWORKFLOW"),v("CONSUMED"),(e,n)=>{const t=e.map(e=>e[1]);return n.onChange(t)});return l.createElement(t.Fragment,null,l.createElement(a.FilterFormField,null,l.createElement(r.Controller,{name:"assignee",control:n,render:e=>l.createElement(a.RadioButtons,{onSelect:n=>{e.onChange(n.code)},selectedOption:p.filter(n=>n.code===e.value)[0],optionsKey:"name",name:"assignee",options:p})})),l.createElement(a.FilterFormField,null,l.createElement(r.Controller,{name:"locality",control:n,render:e=>{const n=t.useMemo(()=>{var n;return null==e||null===(n=e.value)||void 0===n?void 0:n.map((n,t)=>l.createElement(a.RemoveableTag,{key:t,text:n.i18nkey,onClick:()=>{var t;e.onChange(null==e||null===(t=e.value)||void 0===t?void 0:t.filter(e=>e.code!==n.code))}}))},[null==e?void 0:e.value]);return u?l.createElement(a.Loader,null):l.createElement(t.Fragment,null,l.createElement("div",{className:"filter-label sub-filter-label"},v("ES_INBOX_LOCALITY")),l.createElement(a.MultiSelectDropdown,{options:i||[],optionsKey:"i18nkey",props:e,isPropsNeeded:!0,onSelect:m,selected:null==e?void 0:e.value,defaultLabel:v("ES_BPA_ALL_SELECTED"),defaultUnit:v("BPA_SELECTED_TEXT"),ServerStyle:{overflowX:"hidden",width:"100%"}}),l.createElement("div",{className:"tag-container"},n))}})),l.createElement(a.FilterFormField,null,l.createElement(r.Controller,{name:"applicationStatus",control:n,render:e=>{const n=t.useMemo(()=>null==c?void 0:c.map((n,t)=>{var o;return l.createElement(a.CheckBox,{onChange:t=>{var l,o;return o=t.target.checked?[...e.value,null==n?void 0:n.statusid]:null===(l=e.value)||void 0===l?void 0:l.filter(e=>e!==(null==n?void 0:n.statusid)),void e.onChange(o)},checked:null===(o=e.value)||void 0===o?void 0:o.includes(null==n?void 0:n.statusid),label:""+v(n.applicationstatus+" ("+n.count+")"),value:n.applicationStatus,key:t+1})}),[e.value,c]);return l.createElement(t.Fragment,null,l.createElement("div",{className:"filter-label sub-filter-label"},v("CS_INBOX_STATUS_FILTER")),d?l.createElement(a.Loader,null):l.createElement(t.Fragment,null," ",n))}})))},Kl=[{head:"",body:[{type:"component",route:"know-your-property",isMandatory:!0,component:"CPTKnowYourProperty",texts:{header:"PT_DO_YOU_KNOW_YOUR_PROPERTY",submitBarLabel:"CS_COMMON_NEXT"},key:"knowyourproperty",withoutLabel:!0,nextStep:{TL_COMMON_YES:"search-property",TL_COMMON_NO:"create-property"},hideInEmployee:!0},{type:"component",route:"search-property",isMandatory:!0,component:"CPTSearchProperty",key:"cptsearchproperty",withoutLabel:!0,nextStep:"search-results",hideInEmployee:!0},{type:"component",route:"search-results",isMandatory:!0,component:"CPTSearchResults",key:"cptsearchresults",withoutLabel:!0,nextStep:"docsrequired",hideInEmployee:!0},{type:"component",route:"create-property",isMandatory:!0,component:"CPTCreateProperty",key:"cptcreateproperty",withoutLabel:!0,nextStep:"acknowledge-create-property",hideInEmployee:!0},{type:"component",route:"acknowledge-create-property",isMandatory:!0,component:"CPTAcknowledgement",key:"cptacknowledgement",withoutLabel:!0,nextStep:"docsrequired",hideInEmployee:!0},{type:"component",route:"property-details",isMandatory:!0,component:"CPTPropertyDetails",key:"propertydetails",withoutLabel:!0,nextStep:"connection-holder",hideInEmployee:!0}]},{head:"ES_NEW_APPLICATION_PROPERTY_ASSESSMENT",body:[{route:"docsrequired",component:"WSDocsRequired",key:"data",nextStep:"property-details"},{route:"connection-holder",component:"WSConnectionHolder",key:"ConnectionHolderDetails",nextStep:"service-name",texts:{headerCaption:"WS_COMMON_CONNECTION_DETAIL",header:"WS_COMMON_CONNECTION_HOLDER_DETAILS_HEADER",cardText:"WS_CONNECTION_HOLDER_TEXT",submitBarLabel:"CS_COMMON_NEXT"}},{route:"service-name",component:"WSServiceName",key:"serviceName",nextStep:"water-connection-details",WATER:"water-connection-details",SEWERAGE:"sewerage-connection-details",texts:{headerCaption:"WS_COMMON_CONNECTION_DETAIL",header:"WS_SERVICE_NAME",cardText:"",submitBarLabel:"CS_COMMON_NEXT"}},{route:"water-connection-details",component:"WSWaterConnectionDetails",key:"waterConectionDetails",nextStep:"sewerage-connection-details",WATER:"document-details",texts:{headerCaption:"WS_COMMON_CONNECTION_DETAIL",header:"WS_WATER_CONNECTION_DETAILS",cardText:"WS_PROVIDE_PROPOSED_NO_OF_TAPS_SELECT_PIPE_SIZE",submitBarLabel:"CS_COMMON_NEXT"}},{route:"sewerage-connection-details",component:"WSSewerageConnectionDetails",key:"sewerageConnectionDetails",nextStep:"document-details",SEWERAGE:"document-details",texts:{headerCaption:"WS_COMMON_CONNECTION_DETAIL",header:"PDF_STATIC_LABEL_SW_CONSOLIDATED_ACKNOWELDGMENT_LOGO_SUB_HEADER",cardText:"WS_PROVIDE_NO_WATER_CLOSETS_TOILETS",submitBarLabel:"CS_COMMON_NEXT"}},{route:"document-details",component:"WSDocumentDetails",key:"documents",nextStep:null,texts:{headerCaption:"CE_DOCUMENT_DETAILS",header:"WS_DOCUMENT_DETAILS_HEADER",submitBarLabel:"CS_COMMON_NEXT"}}]},{head:"WS_APP_FOR_WATER_AND_SEWERAGE_LABEL",isCreate:!0,hideInCitizen:!0,body:[{head:"",isEditConnection:!0,isCreateConnection:!0,isModifyConnection:!0,isEditByConfigConnection:!0,body:[{type:"component",key:"InfoLabel",component:"WSInfoLabel",withoutLabel:!0}]},{head:"",isEditConnection:!0,isCreateConnection:!1,isModifyConnection:!0,isEditByConfigConnection:!0,body:[{component:"WSEditConnectionDetails",withoutLabel:!0,key:"ConnectionDetails",type:"component",hideInCitizen:!0}]},{head:"WS_COMMON_PROPERTY_DETAILS",isEditConnection:!0,isCreateConnection:!0,isModifyConnection:!0,isEditByConfigConnection:!0,body:[{component:"CPTPropertySearchNSummary",withoutLabel:!0,key:"cpt",type:"component",hideInCitizen:!0}]},{head:"WS_COMMON_CONNECTION_HOLDER_DETAILS_HEADER",isEditConnection:!0,isCreateConnection:!0,isModifyConnection:!0,isEditByConfigConnection:!0,body:[{type:"component",key:"ConnectionHolderDetails",component:"WSConnectionHolderDetails",withoutLabel:!0}]},{head:"WS_COMMON_CONNECTION_DETAIL",isEditConnection:!1,isCreateConnection:!1,isModifyConnection:!0,body:[{type:"component",key:"connectionDetails",component:"WSActivationConnectionDetails",withoutLabel:!0}]},{head:"WS_ACTIVATION_DETAILS",isEditConnection:!1,isCreateConnection:!1,isModifyConnection:!0,body:[{type:"component",key:"activationDetails",component:"WSActivationPageDetails",withoutLabel:!0}]},{head:"WS_COMMON_CONNECTION_DETAIL",subHead:"WS_CONNECTION_DETAILS_HEADER_SUB_TEXT_LABEL",isEditConnection:!1,isCreateConnection:!0,body:[{type:"component",key:"ConnectionDetails",component:"WSConnectionDetails",withoutLabel:!0}]},{head:"WS_COMMON_CONNECTION_DETAIL",isEditByConfigConnection:!0,body:[{type:"component",key:"connectionDetails",component:"WSActivationConnectionDetails",withoutLabel:!0}]},{head:"WS_COMMON_PLUMBER_DETAILS",isEditByConfigConnection:!0,body:[{type:"component",key:"plumberDetails",component:"WSActivationPlumberDetails",withoutLabel:!0}]},{head:"WS_COMMON_ROAD_CUTTING_DETAILS",isEditByConfigConnection:!0,body:[{type:"component",key:"roadCuttingDetails",component:"WSRoadCuttingDetails",withoutLabel:!0}]},{head:"WS_COMMON_DOCS",isEditConnection:!0,isCreateConnection:!0,isModifyConnection:!0,isEditByConfigConnection:!0,body:[{type:"component",key:"DocumentsRequired",component:"WSDocumentsEmployee",withoutLabel:!0}]}]},{head:"WS_APP_FOR_WATER_AND_SEWERAGE_LABEL",isModify:!0,hideInCitizen:!0,body:[{head:"",isEditConnection:!0,isCreateConnection:!0,isModifyConnection:!0,isEditByConfigConnection:!0,body:[{type:"component",key:"InfoLabel",component:"WSInfoLabel",withoutLabel:!0}]},{head:"",isEditConnection:!0,isCreateConnection:!1,isModifyConnection:!0,isEditByConfigConnection:!0,body:[{component:"WSEditConnectionDetails",withoutLabel:!0,key:"ConnectionDetails",type:"component",hideInCitizen:!0}]},{head:"WS_COMMON_PROPERTY_DETAILS",isEditConnection:!0,isCreateConnection:!0,isModifyConnection:!0,isEditByConfigConnection:!0,body:[{component:"CPTPropertySearchNSummary",withoutLabel:!0,key:"cpt",type:"component",hideInCitizen:!0}]},{head:"WS_COMMON_CONNECTION_HOLDER_DETAILS_HEADER",isEditConnection:!0,isCreateConnection:!0,isModifyConnection:!0,isEditByConfigConnection:!0,body:[{type:"component",key:"ConnectionHolderDetails",component:"WSConnectionHolderDetails",withoutLabel:!0}]},{head:"WS_COMMON_CONNECTION_DETAIL",isEditConnection:!1,isCreateConnection:!1,isModifyConnection:!0,body:[{type:"component",key:"connectionDetails",component:"WSActivationConnectionDetails",withoutLabel:!0}]},{head:"WS_ACTIVATION_DETAILS",isEditConnection:!1,isCreateConnection:!1,isModifyConnection:!0,body:[{type:"component",key:"activationDetails",component:"WSActivationPageDetails",withoutLabel:!0}]},{head:"WS_COMMON_CONNECTION_DETAIL",isEditConnection:!1,isCreateConnection:!0,body:[{type:"component",key:"ConnectionDetails",component:"WSConnectionDetails",withoutLabel:!0}]},{head:"WS_COMMON_CONNECTION_DETAIL",isEditByConfigConnection:!0,body:[{type:"component",key:"connectionDetails",component:"WSActivationConnectionDetails",withoutLabel:!0}]},{head:"WS_COMMON_PLUMBER_DETAILS",isEditByConfigConnection:!0,body:[{type:"component",key:"plumberDetails",component:"WSActivationPlumberDetails",withoutLabel:!0}]},{head:"WS_COMMON_ROAD_CUTTING_DETAILS",isEditByConfigConnection:!0,body:[{type:"component",key:"roadCuttingDetails",component:"WSRoadCuttingDetails",withoutLabel:!0}]},{head:"WS_COMMON_DOCS",isEditConnection:!0,isCreateConnection:!0,isModifyConnection:!0,isEditByConfigConnection:!0,body:[{type:"component",key:"DocumentsRequired",component:"WSDocumentsEmployee",withoutLabel:!0}]}]},{head:"WS_APP_FOR_WATER_AND_SEWERAGE_LABEL",isEdit:!0,hideInCitizen:!0,body:[{head:"",isEditConnection:!0,isCreateConnection:!0,isModifyConnection:!0,isEditByConfigConnection:!0,body:[{type:"component",key:"InfoLabel",component:"WSInfoLabel",withoutLabel:!0}]},{head:"",isEditConnection:!0,isCreateConnection:!1,isModifyConnection:!0,isEditByConfigConnection:!0,body:[{component:"WSEditConnectionDetails",withoutLabel:!0,key:"ConnectionDetails",type:"component",hideInCitizen:!0}]},{head:"WS_COMMON_PROPERTY_DETAILS",isEditConnection:!0,isCreateConnection:!0,isModifyConnection:!0,isEditByConfigConnection:!0,body:[{component:"CPTPropertySearchNSummary",withoutLabel:!0,key:"cpt",type:"component",hideInCitizen:!0}]},{head:"WS_COMMON_CONNECTION_HOLDER_DETAILS_HEADER",isEditConnection:!0,isCreateConnection:!0,isModifyConnection:!0,isEditByConfigConnection:!0,body:[{type:"component",key:"ConnectionHolderDetails",component:"WSConnectionHolderDetails",withoutLabel:!0}]},{head:"WS_COMMON_CONNECTION_DETAIL",isEditConnection:!1,isCreateConnection:!1,isModifyConnection:!0,body:[{type:"component",key:"connectionDetails",component:"WSActivationConnectionDetails",withoutLabel:!0}]},{head:"WS_ACTIVATION_DETAILS",isEditConnection:!1,isCreateConnection:!1,isModifyConnection:!0,body:[{type:"component",key:"activationDetails",component:"WSActivationPageDetails",withoutLabel:!0}]},{head:"WS_COMMON_CONNECTION_DETAIL",isEditConnection:!1,isCreateConnection:!0,body:[{type:"component",key:"ConnectionDetails",component:"WSConnectionDetails",withoutLabel:!0}]},{head:"WS_COMMON_CONNECTION_DETAIL",isEditByConfigConnection:!0,body:[{type:"component",key:"connectionDetails",component:"WSActivationConnectionDetails",withoutLabel:!0}]},{head:"WS_COMMON_PLUMBER_DETAILS",isEditByConfigConnection:!0,body:[{type:"component",key:"plumberDetails",component:"WSActivationPlumberDetails",withoutLabel:!0}]},{head:"WS_COMMON_ROAD_CUTTING_DETAILS",isEditByConfigConnection:!0,body:[{type:"component",key:"roadCuttingDetails",component:"WSRoadCuttingDetails",withoutLabel:!0}]},{head:"WS_COMMON_DOCS",isEditConnection:!0,isCreateConnection:!0,isModifyConnection:!0,isEditByConfigConnection:!0,body:[{type:"component",key:"DocumentsRequired",component:"WSDocumentsEmployee",withoutLabel:!0}]}]},{head:"WS_APP_FOR_WATER_AND_SEWERAGE_LABEL",isEditByConfig:!0,hideInCitizen:!0,body:[{head:"",isEditConnection:!0,isCreateConnection:!0,isModifyConnection:!0,isEditByConfigConnection:!0,body:[{type:"component",key:"InfoLabel",component:"WSInfoLabel",withoutLabel:!0}]},{head:"",isEditConnection:!0,isCreateConnection:!1,isModifyConnection:!0,isEditByConfigConnection:!0,body:[{component:"WSEditConnectionDetails",withoutLabel:!0,key:"ConnectionDetails",type:"component",hideInCitizen:!0}]},{head:"WS_COMMON_PROPERTY_DETAILS",isEditConnection:!0,isCreateConnection:!0,isModifyConnection:!0,isEditByConfigConnection:!0,body:[{component:"CPTPropertySearchNSummary",withoutLabel:!0,key:"cpt",type:"component",hideInCitizen:!0}]},{head:"WS_COMMON_CONNECTION_HOLDER_DETAILS_HEADER",isEditConnection:!0,isCreateConnection:!0,isModifyConnection:!0,isEditByConfigConnection:!0,body:[{type:"component",key:"ConnectionHolderDetails",component:"WSConnectionHolderDetails",withoutLabel:!0}]},{head:"WS_COMMON_CONNECTION_DETAIL",isEditConnection:!1,isCreateConnection:!1,isModifyConnection:!0,body:[{type:"component",key:"connectionDetails",component:"WSActivationConnectionDetails",withoutLabel:!0}]},{head:"WS_ACTIVATION_DETAILS",isEditConnection:!1,isCreateConnection:!1,isModifyConnection:!0,body:[{type:"component",key:"activationDetails",component:"WSActivationPageDetails",withoutLabel:!0}]},{head:"WS_COMMON_CONNECTION_DETAIL",isEditConnection:!1,isCreateConnection:!0,body:[{type:"component",key:"ConnectionDetails",component:"WSConnectionDetails",withoutLabel:!0}]},{head:"WS_COMMON_CONNECTION_DETAIL",isEditByConfigConnection:!0,body:[{type:"component",key:"connectionDetails",component:"WSActivationConnectionDetails",withoutLabel:!0}]},{head:"WS_COMMON_PLUMBER_DETAILS",isEditByConfigConnection:!0,body:[{type:"component",key:"plumberDetails",component:"WSActivationPlumberDetails",withoutLabel:!0}]},{head:"WS_COMMON_ROAD_CUTTING_DETAILS",isEditByConfigConnection:!0,body:[{type:"component",key:"roadCuttingDetails",component:"WSRoadCuttingDetails",withoutLabel:!0}]},{head:"WS_COMMON_DOCS",isEditConnection:!0,isCreateConnection:!0,isModifyConnection:!0,isEditByConfigConnection:!0,body:[{type:"component",key:"DocumentsRequired",component:"WSDocumentsEmployee",withoutLabel:!0}]}]}],Xl=(e,n)=>(n&&Object.keys(n).map(t=>{e=e.replace(":"+t,n[t])}),e),Zl=[{head:"NEW_DISCONNECTION",body:[{route:"docsrequired",component:"WSDisconnectionDocsRequired",key:"data",type:"component",withoutLabel:!0,nextStep:"application-form"},{route:"application-form",component:"WSDisconnectionForm",key:"WSDisconnectionForm",type:"component",withoutLabel:!0,nextStep:"documents-upload"},{route:"documents-upload",component:"WSDisconnectionDocumentsForm",key:"WSDisconnectionDocumentsForm",type:"component",isMandatory:!0,withoutLabel:!0,nextStep:"check",hideInEmployee:!0},{route:"check",component:"WSDisconnectionCheckPage",key:"WSDisconnectionCheckPage",type:"component",isMandatory:!0,withoutLabel:!0,nextStep:"disconnect-acknowledge",hideInEmployee:!0},{route:"disconnect-acknowledge",component:"WSDisconnectAcknowledgement",key:"WSDisconnectAcknowledgement",type:"component",isMandatory:!0,withoutLabel:!0,hideInEmployee:!0}]},{head:"WS_APP_FOR_WATER_AND_SEWERAGE_LABEL",isEditByConfig:!0,hideInCitizen:!0,isDisonnectionEdit:!0,isDisonnectionEditByConfig:!0,body:[{head:"",isDisonnectionEdit:!0,isDisonnectionEditByConfig:!0,body:[{type:"component",key:"disConnectionDetails",component:"WSDisconnectionAppDetails",isDisonnectionEdit:!0,withoutLabel:!0}]},{head:"WS_COMMON_PLUMBER_DETAILS",isDisonnectionEditByConfig:!0,body:[{type:"component",key:"plumberDetails",component:"WSActivationPlumberDetails",withoutLabel:!0}]},{head:"WS_COMMON_DOCS",isDisonnectionEdit:!0,isDisonnectionEditByConfig:!0,body:[{type:"component",key:"DocumentsRequired",component:"WSDocumentsEmployee",withoutLabel:!0}]}]},{head:"RE_SUBMIT_DISCONNECTION_APPLICATION",body:[{route:"application-form",component:"WSDisconnectionForm",key:"WSDisconnectionForm",type:"component",withoutLabel:!0,nextStep:"documents-upload"},{route:"documents-upload",component:"WSDisconnectionDocumentsForm",key:"WSDisconnectionDocumentsForm",type:"component",isMandatory:!0,withoutLabel:!0,nextStep:"resubmit-check",hideInEmployee:!0},{route:"check",component:"WSReSubmitDisconnectionCheckPage",key:"WSReSubmitDisconnectionCheckPage",type:"component",isMandatory:!0,withoutLabel:!0,nextStep:"disconnect-acknowledge",hideInEmployee:!0},{route:"disconnect-acknowledge",component:"WSDisconnectAcknowledgement",key:"WSDisconnectAcknowledgement",type:"component",isMandatory:!0,withoutLabel:!0,hideInEmployee:!0}]}],$l=(e,n)=>(n&&Object.keys(n).map(t=>{e=e.replace(":"+t,n[t])}),e),Jl=(e,n)=>(n&&Object.keys(n).map(t=>{e=e.replace(":"+t,n[t])}),e),Ql=[{texts:{header:"WS_SEARCH_CONNECTION",submitBarLabel:"WS_SEARCH_LABEL",cardText:""},inputs:[{label:"CORE_COMMON_MOBILE_NUMBER",type:"mobileNumber",name:"mobileNumber",error:"CORE_COMMON_PHONENO_INVALIDMSG"},{label:"WS_PROP_DETAIL_CITY",name:"city",error:"WS_WRONG_CITY"},{label:"WS_PROP_DETAIL_LOCALITY_LABEL",type:"any",name:"locality",error:"UC_INVALID_LOCALITY"}]}];
|
|
2
|
+
/** @license React v16.13.1
|
|
3
|
+
* react-is.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/
|
|
10
|
+
var eo="function"==typeof Symbol&&Symbol.for,no=eo?Symbol.for("react.element"):60103,to=eo?Symbol.for("react.portal"):60106,lo=eo?Symbol.for("react.fragment"):60107,oo=eo?Symbol.for("react.strict_mode"):60108,io=eo?Symbol.for("react.profiler"):60114,ao=eo?Symbol.for("react.provider"):60109,ro=eo?Symbol.for("react.context"):60110,uo=eo?Symbol.for("react.async_mode"):60111,so=eo?Symbol.for("react.concurrent_mode"):60111,co=eo?Symbol.for("react.forward_ref"):60112,vo=eo?Symbol.for("react.suspense"):60113,po=eo?Symbol.for("react.suspense_list"):60120,mo=eo?Symbol.for("react.memo"):60115,Eo=eo?Symbol.for("react.lazy"):60116,So=eo?Symbol.for("react.block"):60121,_o=eo?Symbol.for("react.fundamental"):60117,fo=eo?Symbol.for("react.responder"):60118,go=eo?Symbol.for("react.scope"):60119;function Co(e){if("object"==typeof e&&null!==e){var n=e.$$typeof;switch(n){case no:switch(e=e.type){case uo:case so:case lo:case io:case oo:case vo:return e;default:switch(e=e&&e.$$typeof){case ro:case co:case Eo:case mo:case ao:return e;default:return n}}case to:return n}}}function No(e){return Co(e)===so}var yo={AsyncMode:uo,ConcurrentMode:so,ContextConsumer:ro,ContextProvider:ao,Element:no,ForwardRef:co,Fragment:lo,Lazy:Eo,Memo:mo,Portal:to,Profiler:io,StrictMode:oo,Suspense:vo,isAsyncMode:function(e){return No(e)||Co(e)===uo},isConcurrentMode:No,isContextConsumer:function(e){return Co(e)===ro},isContextProvider:function(e){return Co(e)===ao},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===no},isForwardRef:function(e){return Co(e)===co},isFragment:function(e){return Co(e)===lo},isLazy:function(e){return Co(e)===Eo},isMemo:function(e){return Co(e)===mo},isPortal:function(e){return Co(e)===to},isProfiler:function(e){return Co(e)===io},isStrictMode:function(e){return Co(e)===oo},isSuspense:function(e){return Co(e)===vo},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===lo||e===so||e===io||e===oo||e===vo||e===po||"object"==typeof e&&null!==e&&(e.$$typeof===Eo||e.$$typeof===mo||e.$$typeof===ao||e.$$typeof===ro||e.$$typeof===co||e.$$typeof===_o||e.$$typeof===fo||e.$$typeof===go||e.$$typeof===So)},typeOf:Co},Do=F(function(e,n){"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,l=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,r=e?Symbol.for("react.provider"):60109,u=e?Symbol.for("react.context"):60110,d=e?Symbol.for("react.async_mode"):60111,s=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,v=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,E=e?Symbol.for("react.lazy"):60116,S=e?Symbol.for("react.block"):60121,_=e?Symbol.for("react.fundamental"):60117,f=e?Symbol.for("react.responder"):60118,g=e?Symbol.for("react.scope"):60119;function C(e){if("object"==typeof e&&null!==e){var n=e.$$typeof;switch(n){case t:var p=e.type;switch(p){case d:case s:case o:case a:case i:case v:return p;default:var S=p&&p.$$typeof;switch(S){case u:case c:case E:case m:case r:return S;default:return n}}case l:return n}}}var N=s,y=u,D=r,T=t,h=c,A=o,I=E,O=m,b=l,L=a,R=i,w=v,W=!1;function P(e){return C(e)===s}n.AsyncMode=d,n.ConcurrentMode=N,n.ContextConsumer=y,n.ContextProvider=D,n.Element=T,n.ForwardRef=h,n.Fragment=A,n.Lazy=I,n.Memo=O,n.Portal=b,n.Profiler=L,n.StrictMode=R,n.Suspense=w,n.isAsyncMode=function(e){return W||(W=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),P(e)||C(e)===d},n.isConcurrentMode=P,n.isContextConsumer=function(e){return C(e)===u},n.isContextProvider=function(e){return C(e)===r},n.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},n.isForwardRef=function(e){return C(e)===c},n.isFragment=function(e){return C(e)===o},n.isLazy=function(e){return C(e)===E},n.isMemo=function(e){return C(e)===m},n.isPortal=function(e){return C(e)===l},n.isProfiler=function(e){return C(e)===a},n.isStrictMode=function(e){return C(e)===i},n.isSuspense=function(e){return C(e)===v},n.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===s||e===a||e===i||e===v||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===E||e.$$typeof===m||e.$$typeof===r||e.$$typeof===u||e.$$typeof===c||e.$$typeof===_||e.$$typeof===f||e.$$typeof===g||e.$$typeof===S)},n.typeOf=C}()}),To=F(function(e){e.exports="production"===process.env.NODE_ENV?yo:Do}),ho=Object.getOwnPropertySymbols,Ao=Object.prototype.hasOwnProperty,Io=Object.prototype.propertyIsEnumerable;function Oo(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var bo=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var n={},t=0;t<10;t++)n["_"+String.fromCharCode(t)]=t;if("0123456789"!==Object.getOwnPropertyNames(n).map(function(e){return n[e]}).join(""))return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(e){l[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},l)).join("")}catch(e){return!1}}()?Object.assign:function(e,n){for(var t,l,o=Oo(e),i=1;i<arguments.length;i++){for(var a in t=Object(arguments[i]))Ao.call(t,a)&&(o[a]=t[a]);if(ho){l=ho(t);for(var r=0;r<l.length;r++)Io.call(t,l[r])&&(o[l[r]]=t[l[r]])}}return o},Lo="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Ro=Function.call.bind(Object.prototype.hasOwnProperty),wo=function(){};if("production"!==process.env.NODE_ENV){var Wo=Lo,Po={},Mo=Ro;wo=function(e){var n="Warning: "+e;"undefined"!=typeof console&&console.error(n);try{throw new Error(n)}catch(e){}}}function xo(e,n,t,l,o){if("production"!==process.env.NODE_ENV)for(var i in e)if(Mo(e,i)){var a;try{if("function"!=typeof e[i]){var r=Error((l||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw r.name="Invariant Violation",r}a=e[i](n,i,l,t,null,Wo)}catch(e){a=e}if(!a||a instanceof Error||wo((l||"React class")+": type specification of "+t+" `"+i+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof a+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),a instanceof Error&&!(a.message in Po)){Po[a.message]=!0;var u=o?o():"";wo("Failed "+t+" type: "+a.message+(null!=u?u:""))}}}xo.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(Po={})};var Bo=xo,Fo=function(){};function Uo(){return null}function ko(){}function Ho(){}"production"!==process.env.NODE_ENV&&(Fo=function(e){var n="Warning: "+e;"undefined"!=typeof console&&console.error(n);try{throw new Error(n)}catch(e){}}),Ho.resetWarningCache=ko;var jo=F(function(e){e.exports="production"!==process.env.NODE_ENV?function(e,n){var t="function"==typeof Symbol&&Symbol.iterator,l={array:r("array"),bigint:r("bigint"),bool:r("boolean"),func:r("function"),number:r("number"),object:r("object"),string:r("string"),symbol:r("symbol"),any:a(Uo),arrayOf:function(e){return a(function(n,t,l,o,a){if("function"!=typeof e)return new i("Property `"+a+"` of component `"+l+"` has invalid PropType notation inside arrayOf.");var r=n[t];if(!Array.isArray(r))return new i("Invalid "+o+" `"+a+"` of type `"+s(r)+"` supplied to `"+l+"`, expected an array.");for(var u=0;u<r.length;u++){var d=e(r,u,l,o,a+"["+u+"]",Lo);if(d instanceof Error)return d}return null})},element:a(function(n,t,l,o,a){var r=n[t];return e(r)?null:new i("Invalid "+o+" `"+a+"` of type `"+s(r)+"` supplied to `"+l+"`, expected a single ReactElement.")}),elementType:a(function(e,n,t,l,o){var a=e[n];return To.isValidElementType(a)?null:new i("Invalid "+l+" `"+o+"` of type `"+s(a)+"` supplied to `"+t+"`, expected a single ReactElement type.")}),instanceOf:function(e){return a(function(n,t,l,o,a){var r;return n[t]instanceof e?null:new i("Invalid "+o+" `"+a+"` of type `"+((r=n[t]).constructor&&r.constructor.name?r.constructor.name:"<<anonymous>>")+"` supplied to `"+l+"`, expected instance of `"+(e.name||"<<anonymous>>")+"`.")})},node:a(function(e,n,t,l,o){return d(e[n])?null:new i("Invalid "+l+" `"+o+"` supplied to `"+t+"`, expected a ReactNode.")}),objectOf:function(e){return a(function(n,t,l,o,a){if("function"!=typeof e)return new i("Property `"+a+"` of component `"+l+"` has invalid PropType notation inside objectOf.");var r=n[t],u=s(r);if("object"!==u)return new i("Invalid "+o+" `"+a+"` of type `"+u+"` supplied to `"+l+"`, expected an object.");for(var d in r)if(Ro(r,d)){var c=e(r,d,l,o,a+"."+d,Lo);if(c instanceof Error)return c}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&Fo(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),Uo;function n(n,t,l,a,r){for(var u=n[t],d=0;d<e.length;d++)if(o(u,e[d]))return null;var s=JSON.stringify(e,function(e,n){return"symbol"===c(n)?String(n):n});return new i("Invalid "+a+" `"+r+"` of value `"+String(u)+"` supplied to `"+l+"`, expected one of "+s+".")}return a(n)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&Fo("Invalid argument supplied to oneOfType, expected an instance of array."),Uo;for(var n=0;n<e.length;n++){var t=e[n];if("function"!=typeof t)return Fo("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+v(t)+" at index "+n+"."),Uo}return a(function(n,t,l,o,a){for(var r=[],u=0;u<e.length;u++){var d=(0,e[u])(n,t,l,o,a,Lo);if(null==d)return null;d.data&&Ro(d.data,"expectedType")&&r.push(d.data.expectedType)}return new i("Invalid "+o+" `"+a+"` supplied to `"+l+"`"+(r.length>0?", expected one of type ["+r.join(", ")+"]":"")+".")})},shape:function(e){return a(function(n,t,l,o,a){var r=n[t],d=s(r);if("object"!==d)return new i("Invalid "+o+" `"+a+"` of type `"+d+"` supplied to `"+l+"`, expected `object`.");for(var v in e){var p=e[v];if("function"!=typeof p)return u(l,o,a,v,c(p));var m=p(r,v,l,o,a+"."+v,Lo);if(m)return m}return null})},exact:function(e){return a(function(n,t,l,o,a){var r=n[t],d=s(r);if("object"!==d)return new i("Invalid "+o+" `"+a+"` of type `"+d+"` supplied to `"+l+"`, expected `object`.");var v=bo({},n[t],e);for(var p in v){var m=e[p];if(Ro(e,p)&&"function"!=typeof m)return u(l,o,a,p,c(m));if(!m)return new i("Invalid "+o+" `"+a+"` key `"+p+"` supplied to `"+l+"`.\nBad object: "+JSON.stringify(n[t],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var E=m(r,p,l,o,a+"."+p,Lo);if(E)return E}return null})}};function o(e,n){return e===n?0!==e||1/e==1/n:e!=e&&n!=n}function i(e,n){this.message=e,this.data=n&&"object"==typeof n?n:{},this.stack=""}function a(e){function n(n,t,l,o,a,r,u){if(o=o||"<<anonymous>>",r=r||l,u!==Lo){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}return null==t[l]?n?new i(null===t[l]?"The "+a+" `"+r+"` is marked as required in `"+o+"`, but its value is `null`.":"The "+a+" `"+r+"` is marked as required in `"+o+"`, but its value is `undefined`."):null:e(t,l,o,a,r)}process;var t=n.bind(null,!1);return t.isRequired=n.bind(null,!0),t}function r(e){return a(function(n,t,l,o,a,r){var u=n[t];return s(u)!==e?new i("Invalid "+o+" `"+a+"` of type `"+c(u)+"` supplied to `"+l+"`, expected `"+e+"`.",{expectedType:e}):null})}function u(e,n,t,l,o){return new i((e||"React class")+": "+n+" type `"+t+"."+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function d(n){switch(typeof n){case"number":case"string":case"undefined":return!0;case"boolean":return!n;case"object":if(Array.isArray(n))return n.every(d);if(null===n||e(n))return!0;var l=function(e){var n=e&&(t&&e[t]||e["@@iterator"]);if("function"==typeof n)return n}(n);if(!l)return!1;var o,i=l.call(n);if(l!==n.entries){for(;!(o=i.next()).done;)if(!d(o.value))return!1}else for(;!(o=i.next()).done;){var a=o.value;if(a&&!d(a[1]))return!1}return!0;default:return!1}}function s(e){var n=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,n){return"symbol"===e||!!n&&("Symbol"===n["@@toStringTag"]||"function"==typeof Symbol&&n instanceof Symbol)}(n,e)?"symbol":n}function c(e){if(null==e)return""+e;var n=s(e);if("object"===n){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return n}function v(e){var n=c(e);switch(n){case"array":case"object":return"an "+n;case"boolean":case"date":case"regexp":return"a "+n;default:return n}}return i.prototype=Error.prototype,l.checkPropTypes=Bo,l.resetWarningCache=Bo.resetWarningCache,l.PropTypes=l,l}(To.isElement):function(){function e(e,n,t,l,o,i){if(i!==Lo){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function n(){return e}e.isRequired=e;var t={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:n,element:e,elementType:e,instanceOf:n,node:e,objectOf:n,oneOf:n,oneOfType:n,shape:n,exact:n,checkPropTypes:Ho,resetWarningCache:ko};return t.PropTypes=t,t}()});const Vo=e=>{var n;let{config:r,formData:u}=e;const{t:d}=o.useTranslation();let s={};const c=i.useHistory(),p=Digit.ULBService.getCurrentTenantId(),m=Digit.UserService.getUser(),[E,S]=t.useState((null==u?void 0:u.mobileNumber)||""),[_,f]=t.useState((null==u?void 0:u.consumerNumber)||""),[g,C]=t.useState((null==u?void 0:u.oldconsumerNumber)||""),[N,y]=t.useState((null==u?void 0:u.doorNumber)||""),[D,T]=t.useState((null==u?void 0:u.propertyId)||""),[h,A]=t.useState((null==u?void 0:u.consumerName)||""),[I,O]=t.useState((null==u?void 0:u.Servicecateogry)||""),[b,L]=t.useState((null==u?void 0:u.city)||""),[R,w]=t.useState(null),[W,P]=t.useState((null==u?void 0:u.locality)||""),[M,x]=t.useState((null==u?void 0:u.searchType)||{code:"CONSUMER_NUMBER",i18nKey:"WS_CONSUMER_NUMBER_SEARCH"}),B=null===(n=Digit.Hooks.ws.usewsTenants())||void 0===n?void 0:n.sort((e,n)=>{var t,l;return null==e||null===(t=e.i18nKey)||void 0===t||null===(l=t.localeCompare)||void 0===l?void 0:l.call(t,null==n?void 0:n.i18nKey)}),[F,U]=t.useState(null);let k={};const{isLoading:H}=Digit.Hooks.mcollect.useMCollectMDMS(p,"BillingService","BusinessService"),{data:j}=Digit.Hooks.pt.useMDMS(Digit.ULBService.getStateId(),"DIGIT-UI","HelpText",{select:e=>{var n,t,l;return null==e||null===(n=e["DIGIT-UI"])||void 0===n||null===(t=n.HelpText)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.PT}});return H?l.createElement(a.Loader,null):l.createElement("div",{style:{marginTop:"16px"}},l.createElement(a.FormStep,{config:r,label:r.texts.submitButtonLabel,heading:r.texts.header,text:r.texts.text,cardStyle:{margin:"auto",maxWidth:"960px"},headingStyle:{fontSize:"32px",marginBottom:"16px"},onSelect:function(e){try{const e=function(){if("CONSUMER_NUMBER"===M.code)b.code?E||_||g||D?c.push("/digit-ui/citizen/ws/search-results?mobileNumber="+E+"&consumerNumber="+_+"&oldconsumerNumber="+g+"&propertyId="+D+"&tenantId="+b.code+"&locality="+void 0):w({key:!0,label:"WS_HOME_SEARCH_CONN_RESULTS_DESC"}):w({key:!0,label:"WS_PLEASE_PROVIDE_CITY"});else{const e=function(){if(b.code){const e=function(){if(null!=m||W){const e=function(){if(N||h)return"undefined"!==W&&(k.locality=null==W?void 0:W.code),N&&(k.doorNo=N),h&&(k.ownerName=h),k=v({},k,{searchType:"CONNECTION"}),Promise.resolve(Digit.WSService.search({tenantId:null==b?void 0:b.code,filters:v({},k),businessService:"WS"})).then(function(e){return Promise.resolve(Digit.WSService.search({tenantId:null==b?void 0:b.code,filters:v({},k),businessService:"SW"})).then(function(n){null!=j&&j.maxResultValidation&&(null==e?void 0:e.TotalCount)+(null==n?void 0:n.TotalCount)>(null==j?void 0:j.maxPropertyResult)?w({key:!0,label:"Refine your search"}):c.push("/digit-ui/citizen/ws/search-results?doorNumber="+N+"&consumerName="+h+"&tenantId="+b.code+"&locality="+W.code)})});w({key:!0,label:"WS_HOME_SEARCH_CONN_RESULTS_DESC"})}();if(e&&e.then)return e.then(function(){})}else w({key:!0,label:"WS_PLEASE_PROVIDE_LOCALITY"})}();if(e&&e.then)return e.then(function(){})}else w({key:!0,label:"WS_PLEASE_PROVIDE_CITY"})}();if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},componentInFront:l.createElement("div",{className:"employee-card-input employee-card-input--front"},"+91"),isDisabled:!1,forcedError:d(F),t:d},l.createElement(a.RadioOrSelect,v({className:"form-field",isMandatory:!0,t:d,optionKey:"code",name:"SearchType",options:[{code:"CONSUMER_NUMBER",i18nKey:"WS_CONSUMER_NUMBER_SEARCH"},{code:"CONNECTION_DETAILS",i18nKey:"WS_CONNECTION_DETAILS_SEARCH"}],value:M,selectedOption:M,onSelect:function(e){x(e)}},s={isRequired:!0,title:d("WS_SEARCH_TYPE_MANDATORY")})),l.createElement(a.CardLabel,null,d("WS_PROP_DETAIL_CITY")+"*"),l.createElement(a.RadioOrSelect,v({className:"form-field",isMandatory:!0,t:d,optionKey:"code",name:"City",options:B,value:b,selectedOption:b,onSelect:function(e){L(e),P("")}},s={isRequired:!0,title:d("UC_CITY_MANDATORY")})),b&&M&&"CONNECTION_DETAILS"==(null==M?void 0:M.code)&&l.createElement(a.CardLabel,null,d("WS_PROP_DETAIL_LOCALITY_LABEL")+"*"),b&&M&&"CONNECTION_DETAILS"==(null==M?void 0:M.code)&&l.createElement(a.Localities,{selectLocality:function(e){P(e)},tenantId:null==b?void 0:b.code,boundaryType:"revenue",keepNull:!1,optionCardStyles:{height:"600px",overflow:"auto",zIndex:"10"},selected:W,disableLoader:!1}),M&&"CONSUMER_NUMBER"==(null==M?void 0:M.code)&&l.createElement("div",{style:{border:"solid",borderRadius:"5px",padding:"10px",paddingTop:"20px",marginTop:"10px",borderColor:"#f3f3f3",background:"#FAFAFA",marginBottom:"20px"}},l.createElement(a.CardText,null,d("WS_SEARCH_TEXT")),l.createElement(a.CardLabel,null,""+d("WS_CONSUMER_NUMBER_LABEL")),l.createElement("div",{className:"field-container"},l.createElement("span",{className:"employee-card-input employee-card-input--front",style:{marginTop:"-1px"}},"+91"),l.createElement(a.TextInput,v({type:"mobileNumber",style:{background:"#FAFAFA",maxWidth:"500px"},t:d,isMandatory:!1,optionKey:"i18nKey",name:"mobileNumber",value:E,onChange:function(e){U(null),e.target.value.match("^\\d{10}$")||U("CORE_COMMON_PHONENO_INVALIDMSG"),S(e.target.value)}},s={isRequired:!1,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:d("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}))),l.createElement(a.CardLabel,{style:{textAlign:"center",color:"#505A5F"}},""+d("(or)")),l.createElement("div",{className:"tooltip"},l.createElement("div",{style:{display:"flex",gap:"0 4px"}},l.createElement(a.CardLabel,null,""+d("WS_MYCONNECTIONS_CONSUMER_NO")),l.createElement(a.InfoBannerIcon,{fill:"#0b0c0c"}),l.createElement("span",{className:"tooltiptext",style:{position:"absolute",width:"70%",marginLeft:"50%",fontSize:"medium"}},d("WS_CONSUMER_NO_DESCRIPTION")+" "+d("WS_CONSUMER_NO_FORMAT")))),l.createElement(a.TextInput,v({t:d,type:"any",isMandatory:!1,style:{background:"#FAFAFA"},name:"consumerNumber",value:_,onChange:function(e){f(e.target.value)}},s={isRequired:!1,pattern:"[A-Za-z]{2}/[0-9]{3,4}/[0-9]{4}-[0-9]{2}/[0-9]{6}",type:"text",title:d("ERR_INVALID_CONSUMER_NO")})),l.createElement(a.CardLabel,{style:{textAlign:"center",color:"#505A5F"}},""+d("(or)")),l.createElement("div",{className:"tooltip"},l.createElement("div",{style:{display:"flex",gap:"0 4px"}},l.createElement(a.CardLabel,null,""+d("WS_SEARCH_CONNNECTION_OLD_CONSUMER_LABEL")),l.createElement(a.InfoBannerIcon,{fill:"#0b0c0c"}),l.createElement("span",{className:"tooltiptext",style:{position:"absolute",width:"55%",marginLeft:"50%",fontSize:"medium"}},d("WS_CONSUMER_NO_DESCRIPTION")+" "+d("WS_CONSUMER_NO_FORMAT")))),l.createElement(a.TextInput,v({t:d,type:"any",isMandatory:!1,style:{background:"#FAFAFA"},name:"oldconsumerNumber",value:g,onChange:function(e){C(e.target.value)}},s={isRequired:!1,pattern:"[A-Za-z]{2}/[0-9]{3}/[0-9]{4}-[0-9]{2}/[0-9]{6}",type:"text",title:d("ERR_INVALID_CONSUMER_NO")})),l.createElement(a.CardLabel,{style:{textAlign:"center",color:"#505A5F"}},""+d("(or)")),l.createElement(a.CardLabel,null,""+d("WS_PROPERTY_ID_LABEL")),l.createElement(a.TextInput,v({t:d,type:"any",isMandatory:!1,style:{background:"#FAFAFA"},name:"propertyId",value:D,onChange:function(e){T(e.target.value)}},s={isRequired:!1,pattern:"[A-Za-z]{2}-[A-Za-z]{2}-[0-9]{4}-[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{6}|[A-Za-z]{2}-[A-Za-z]{2}-[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{6}",type:"text",title:d("ERR_INVALID_PROPERTY_ID")}))),M&&"CONNECTION_DETAILS"==(null==M?void 0:M.code)&&l.createElement("div",{style:{border:"solid",borderRadius:"5px",padding:"10px",paddingTop:"20px",marginTop:"10px",borderColor:"#f3f3f3",background:"#FAFAFA",marginBottom:"20px"}},l.createElement(a.CardText,null,d("WS_SEARCH_TEXT")),l.createElement(a.CardLabel,null,""+d("WS_DOOR_NO_LABEL")),l.createElement(a.TextInput,v({t:d,type:"any",isMandatory:!1,style:{background:"#FAFAFA"},name:"doorNumber",value:N,onChange:function(e){y(e.target.value)}},s={isRequired:!1,pattern:"^([1-9][0-9]*)$",type:"text",title:d("ERR_INVALID_DOOR_NO")})),l.createElement(a.CardLabel,null,""+d("WS_CONSUMER_NAME_LABEL")),l.createElement(a.TextInput,{t:d,type:"any",isMandatory:!1,style:{background:"#FAFAFA"},name:"consumerName",value:h,onChange:function(e){A(e.target.value)}}))),R&&l.createElement(a.Toast,{isDleteBtn:!0,error:R.key,label:d(R.label),onClose:()=>{w(null)}}))};Vo.propTypes={loginParams:jo.any},Vo.defaultProps={loginParams:null};const zo=[{texts:{header:"CS_SEARCH_RESULTS",actionButtonLabel:"WS_VIEW_DETAILS_AND_PAY"},labels:[{label:"WS_COMMON_TABLE_COL_AMT_DUE_LABEL",key:"AmountDue",noteStyle:{fontSize:"24px",fontWeight:"bold"},notePrefix:"₹ "},{label:"WS_MYCONNECTIONS_CONSUMER_NO",key:"ConsumerNumber"},{label:"WS_CONSUMER_NAME_LABEL",key:"ConsumerName"},{label:"WS_MYCONNECTION_ADDRESS",key:"Address"},{label:"WS_VIEW_BILL_DUE_DATE_LABEL",key:"DueDate"}]}];var Yo=function(e,n){return function(){for(var t=new Array(arguments.length),l=0;l<t.length;l++)t[l]=arguments[l];return e.apply(n,t)}},Go=Object.prototype.toString;function qo(e){return"[object Array]"===Go.call(e)}function Ko(e){return void 0===e}function Xo(e){return null!==e&&"object"==typeof e}function Zo(e){if("[object Object]"!==Go.call(e))return!1;var n=Object.getPrototypeOf(e);return null===n||n===Object.prototype}function $o(e){return"[object Function]"===Go.call(e)}function Jo(e,n){if(null!=e)if("object"!=typeof e&&(e=[e]),qo(e))for(var t=0,l=e.length;t<l;t++)n.call(null,e[t],t,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.call(null,e[o],o,e)}var Qo={isArray:qo,isArrayBuffer:function(e){return"[object ArrayBuffer]"===Go.call(e)},isBuffer:function(e){return null!==e&&!Ko(e)&&null!==e.constructor&&!Ko(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:Xo,isPlainObject:Zo,isUndefined:Ko,isDate:function(e){return"[object Date]"===Go.call(e)},isFile:function(e){return"[object File]"===Go.call(e)},isBlob:function(e){return"[object Blob]"===Go.call(e)},isFunction:$o,isStream:function(e){return Xo(e)&&$o(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:Jo,merge:function e(){var n={};function t(t,l){n[l]=Zo(n[l])&&Zo(t)?e(n[l],t):Zo(t)?e({},t):qo(t)?t.slice():t}for(var l=0,o=arguments.length;l<o;l++)Jo(arguments[l],t);return n},extend:function(e,n,t){return Jo(n,function(n,l){e[l]=t&&"function"==typeof n?Yo(n,t):n}),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}};function ei(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var ni=function(e,n,t){if(!n)return e;var l;if(t)l=t(n);else if(Qo.isURLSearchParams(n))l=n.toString();else{var o=[];Qo.forEach(n,function(e,n){null!=e&&(Qo.isArray(e)?n+="[]":e=[e],Qo.forEach(e,function(e){Qo.isDate(e)?e=e.toISOString():Qo.isObject(e)&&(e=JSON.stringify(e)),o.push(ei(n)+"="+ei(e))}))}),l=o.join("&")}if(l){var i=e.indexOf("#");-1!==i&&(e=e.slice(0,i)),e+=(-1===e.indexOf("?")?"?":"&")+l}return e};function ti(){this.handlers=[]}ti.prototype.use=function(e,n){return this.handlers.push({fulfilled:e,rejected:n}),this.handlers.length-1},ti.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},ti.prototype.forEach=function(e){Qo.forEach(this.handlers,function(n){null!==n&&e(n)})};var li=ti,oi=function(e,n,t){return Qo.forEach(t,function(t){e=t(e,n)}),e},ii=function(e){return!(!e||!e.__CANCEL__)},ai=function(e,n){Qo.forEach(e,function(t,l){l!==n&&l.toUpperCase()===n.toUpperCase()&&(e[n]=t,delete e[l])})},ri=function(e,n,t,l,o){return function(e,n,t,l,o){return e.config=n,t&&(e.code=t),e.request=l,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}(new Error(e),n,t,l,o)},ui=Qo.isStandardBrowserEnv()?{write:function(e,n,t,l,o,i){var a=[];a.push(e+"="+encodeURIComponent(n)),Qo.isNumber(t)&&a.push("expires="+new Date(t).toGMTString()),Qo.isString(l)&&a.push("path="+l),Qo.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var n=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},di=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],si=Qo.isStandardBrowserEnv()?function(){var e,n=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");function l(e){var l=e;return n&&(t.setAttribute("href",l),l=t.href),t.setAttribute("href",l),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return e=l(window.location.href),function(n){var t=Qo.isString(n)?l(n):n;return t.protocol===e.protocol&&t.host===e.host}}():function(){return!0},ci={"Content-Type":"application/x-www-form-urlencoded"};function vi(e,n){!Qo.isUndefined(e)&&Qo.isUndefined(e["Content-Type"])&&(e["Content-Type"]=n)}var pi,mi={adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(pi=function(e){return new Promise(function(n,t){var l=e.data,o=e.headers;Qo.isFormData(l)&&delete o["Content-Type"];var i=new XMLHttpRequest;if(e.auth){var a=e.auth.username||"",r=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.Authorization="Basic "+btoa(a+":"+r)}var u,d,s=(d=e.url,(u=e.baseURL)&&!function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}(d)?function(e,n){return n?e.replace(/\/+$/,"")+"/"+n.replace(/^\/+/,""):e}(u,d):d);if(i.open(e.method.toUpperCase(),ni(s,e.params,e.paramsSerializer),!0),i.timeout=e.timeout,i.onreadystatechange=function(){if(i&&4===i.readyState&&(0!==i.status||i.responseURL&&0===i.responseURL.indexOf("file:"))){var l,o,a,r,u,d="getAllResponseHeaders"in i?(l=i.getAllResponseHeaders(),u={},l?(Qo.forEach(l.split("\n"),function(e){if(r=e.indexOf(":"),o=Qo.trim(e.substr(0,r)).toLowerCase(),a=Qo.trim(e.substr(r+1)),o){if(u[o]&&di.indexOf(o)>=0)return;u[o]="set-cookie"===o?(u[o]?u[o]:[]).concat([a]):u[o]?u[o]+", "+a:a}}),u):u):null;!function(e,n,t){var l=t.config.validateStatus;t.status&&l&&!l(t.status)?n(ri("Request failed with status code "+t.status,t.config,null,t.request,t)):e(t)}(n,t,{data:e.responseType&&"text"!==e.responseType?i.response:i.responseText,status:i.status,statusText:i.statusText,headers:d,config:e,request:i}),i=null}},i.onabort=function(){i&&(t(ri("Request aborted",e,"ECONNABORTED",i)),i=null)},i.onerror=function(){t(ri("Network Error",e,null,i)),i=null},i.ontimeout=function(){var n="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(n=e.timeoutErrorMessage),t(ri(n,e,"ECONNABORTED",i)),i=null},Qo.isStandardBrowserEnv()){var c=(e.withCredentials||si(s))&&e.xsrfCookieName?ui.read(e.xsrfCookieName):void 0;c&&(o[e.xsrfHeaderName]=c)}if("setRequestHeader"in i&&Qo.forEach(o,function(e,n){void 0===l&&"content-type"===n.toLowerCase()?delete o[n]:i.setRequestHeader(n,e)}),Qo.isUndefined(e.withCredentials)||(i.withCredentials=!!e.withCredentials),e.responseType)try{i.responseType=e.responseType}catch(n){if("json"!==e.responseType)throw n}"function"==typeof e.onDownloadProgress&&i.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&i.upload&&i.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(e){i&&(i.abort(),t(e),i=null)}),l||(l=null),i.send(l)})}),pi),transformRequest:[function(e,n){return ai(n,"Accept"),ai(n,"Content-Type"),Qo.isFormData(e)||Qo.isArrayBuffer(e)||Qo.isBuffer(e)||Qo.isStream(e)||Qo.isFile(e)||Qo.isBlob(e)?e:Qo.isArrayBufferView(e)?e.buffer:Qo.isURLSearchParams(e)?(vi(n,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):Qo.isObject(e)?(vi(n,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};Qo.forEach(["delete","get","head"],function(e){mi.headers[e]={}}),Qo.forEach(["post","put","patch"],function(e){mi.headers[e]=Qo.merge(ci)});var Ei=mi;function Si(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var _i=function(e){return Si(e),e.headers=e.headers||{},e.data=oi(e.data,e.headers,e.transformRequest),e.headers=Qo.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),Qo.forEach(["delete","get","head","post","put","patch","common"],function(n){delete e.headers[n]}),(e.adapter||Ei.adapter)(e).then(function(n){return Si(e),n.data=oi(n.data,n.headers,e.transformResponse),n},function(n){return ii(n)||(Si(e),n&&n.response&&(n.response.data=oi(n.response.data,n.response.headers,e.transformResponse))),Promise.reject(n)})},fi=function(e,n){n=n||{};var t={},l=["url","method","data"],o=["headers","auth","proxy","params"],i=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function r(e,n){return Qo.isPlainObject(e)&&Qo.isPlainObject(n)?Qo.merge(e,n):Qo.isPlainObject(n)?Qo.merge({},n):Qo.isArray(n)?n.slice():n}function u(l){Qo.isUndefined(n[l])?Qo.isUndefined(e[l])||(t[l]=r(void 0,e[l])):t[l]=r(e[l],n[l])}Qo.forEach(l,function(e){Qo.isUndefined(n[e])||(t[e]=r(void 0,n[e]))}),Qo.forEach(o,u),Qo.forEach(i,function(l){Qo.isUndefined(n[l])?Qo.isUndefined(e[l])||(t[l]=r(void 0,e[l])):t[l]=r(void 0,n[l])}),Qo.forEach(a,function(l){l in n?t[l]=r(e[l],n[l]):l in e&&(t[l]=r(void 0,e[l]))});var d=l.concat(o).concat(i).concat(a),s=Object.keys(e).concat(Object.keys(n)).filter(function(e){return-1===d.indexOf(e)});return Qo.forEach(s,u),t};function gi(e){this.defaults=e,this.interceptors={request:new li,response:new li}}gi.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=fi(this.defaults,e)).method=e.method?e.method.toLowerCase():this.defaults.method?this.defaults.method.toLowerCase():"get";var n=[_i,void 0],t=Promise.resolve(e);for(this.interceptors.request.forEach(function(e){n.unshift(e.fulfilled,e.rejected)}),this.interceptors.response.forEach(function(e){n.push(e.fulfilled,e.rejected)});n.length;)t=t.then(n.shift(),n.shift());return t},gi.prototype.getUri=function(e){return e=fi(this.defaults,e),ni(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},Qo.forEach(["delete","get","head","options"],function(e){gi.prototype[e]=function(n,t){return this.request(fi(t||{},{method:e,url:n,data:(t||{}).data}))}}),Qo.forEach(["post","put","patch"],function(e){gi.prototype[e]=function(n,t,l){return this.request(fi(l||{},{method:e,url:n,data:t}))}});var Ci=gi;function Ni(e){this.message=e}Ni.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},Ni.prototype.__CANCEL__=!0;var yi=Ni;function Di(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var n;this.promise=new Promise(function(e){n=e});var t=this;e(function(e){t.reason||(t.reason=new yi(e),n(t.reason))})}Di.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},Di.source=function(){var e;return{token:new Di(function(n){e=n}),cancel:e}};var Ti=Di;function hi(e){var n=new Ci(e),t=Yo(Ci.prototype.request,n);return Qo.extend(t,Ci.prototype,n),Qo.extend(t,n),t}var Ai=hi(Ei);Ai.Axios=Ci,Ai.create=function(e){return hi(fi(Ai.defaults,e))},Ai.Cancel=yi,Ai.CancelToken=Ti,Ai.isCancel=ii,Ai.all=function(e){return Promise.all(e)},Ai.spread=function(e){return function(n){return e.apply(null,n)}},Ai.isAxiosError=function(e){return"object"==typeof e&&!0===e.isAxiosError},Ai.default=Ai;const Ii=e=>{let{template:n,header:t,actionButtonLabel:r}=e;const{t:u}=o.useTranslation(),d=i.useHistory(),{mobileNumber:s,consumerNumber:c,oldconsumerNumber:p,tenantId:E,propertyId:S,locality:_,doorNumber:f,consumerName:g,PToffset:C}=Digit.Hooks.useQueryParams();let N,y,D={},T=C;isNaN(parseInt(T))?N=5:(y=T,N=parseInt(T)+5);let h=isNaN(parseInt(T))?{limit:"5",sortOrder:"ASC",sortBy:"createdTime",offset:"0"}:{limit:"5",sortOrder:"ASC",sortBy:"createdTime",offset:y};s&&(D.mobileNumber=s),c&&(D.connectionNumber=c),p&&(D.oldConnectionNumber=p),S&&(D.propertyId=S),"undefined"!==_&&(D.locality=_),f&&(D.doorNo=f),g&&(D.ownerName=g),(_||searchQuery&&searchQuery.locality)&&(D.limit=h.limit,D.sortOrder=h.sortOrder,D.sortBy=h.sortBy,D.offset=h.offset),D=v({},D,{searchType:"CONNECTION"});const{isLoading:A,data:I}=Digit.Hooks.ws.useWaterSearch({tenantId:E,filters:v({},D),BusinessService:"WS",t:u},{privacy:Digit.Utils.getPrivacyObject()}),{isLoading:O,data:b}=Digit.Hooks.ws.useSewarageSearch({tenantId:E,filters:v({},D),BusinessService:"SW",t:u},{privacy:Digit.Utils.getPrivacyObject()});if(A||O)return l.createElement(a.Loader,null);const L=I&&b?I.concat(b):I||b||[];return l.createElement("div",{style:{marginTop:"16px"}},l.createElement("div",null,t&&l.createElement(a.Header,{style:{marginLeft:"8px"}},u(t)," (",null==L?void 0:L.length,")"),l.createElement(a.ResponseComposer,{data:L,template:n,actionButtonLabel:r,onSubmit:e=>{d.push("/digit-ui/citizen/payment/my-bills/"+(null==e?void 0:e.ConsumerNumber.split("/")[0])+"/"+m(null==e?void 0:e.ConsumerNumber,"/","+")+"?workflow=WNS&tenantId="+E+"&ConsumerName="+(null==e?void 0:e.ConsumerName))}}),!(null!=L&&L.length)>0&&l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},u("WS_NO_APP_FOUND_MSG")),0!==(null==L?void 0:L.length)&&(5==(null==L?void 0:L.length)||50==(null==L?void 0:L.length))&&(_||searchQuery&&searchQuery.locality)&&l.createElement("div",null,l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},u("WS_LOAD_MORE_MSG")," ",l.createElement("span",{className:"link"},l.createElement(i.Link,{to:"/digit-ui/citizen/ws/search-results?doorNumber="+f+"&consumerName="+g+"&tenantId="+(null==E?void 0:E.split(".")[0])+"&locality="+_.code+"&PToffset="+N},u("PT_COMMON_CLICK_HERE"))))),l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},u("WS_WANT_TO_ADD_NEW_CONNECTION")," ",l.createElement("span",{className:"link",style:{display:"block"}},l.createElement(i.Link,{to:"/digit-ui/citizen/ws/create-application/search-property"},u("WS_CLICK_HERE_TO_APPLY"))))))};Ii.propTypes={template:jo.any,header:jo.string,actionButtonLabel:jo.string},Ii.defaultProps={template:[],header:null,actionButtonLabel:null};const Oi=e=>{var n,t,i;let{data:r,OpenImage:u}=e;const{t:d}=o.useTranslation();return l.createElement("div",null,r.date&&l.createElement("p",null,r.date),l.createElement("p",null,r.name),r.mobileNumber&&l.createElement(a.TelePhone,{mobile:r.mobileNumber}),r.source&&l.createElement("p",null,d("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+r.source.toUpperCase())),r.comment&&l.createElement(Reason,{otherComment:null==r?void 0:r.otherComment,headComment:null==r?void 0:r.comment}),null!=r&&r.wfComment?l.createElement("div",null,null==r||null===(n=r.wfComment)||void 0===n?void 0:n.map(e=>l.createElement("div",{className:"TLComments"},l.createElement("h3",null,d("WF_COMMON_COMMENTS")),l.createElement("p",{style:{overflowX:"scroll"}},e)))):null,(null==r||null===(t=r.thumbnailsToShow)||void 0===t||null===(i=t.thumbs)||void 0===i?void 0:i.length)>0?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,d("CS_COMMON_ATTACHMENTS")),l.createElement(a.DisplayPhotos,{srcs:null==r?void 0:r.thumbnailsToShow.thumbs,onClick:(e,n)=>{u(e,n,null==r?void 0:r.thumbnailsToShow)}})):null)},bi=e=>{var n,r,u,d,s,c;const{t:v}=o.useTranslation(),p=null===(n=e.application)||void 0===n?void 0:n.applicationNo.split("_")[0],{isLoading:m,data:E}=Digit.Hooks.useWorkflowDetails({tenantId:null===(r=e.application)||void 0===r?void 0:r.tenantId,id:e.id,moduleCode:p}),[S,_]=t.useState(!1);function f(e,n,t){var l;window.open(null==t||null===(l=t.fullImage)||void 0===l?void 0:l[0],"_blank")}const g=n=>{if("OPEN"===n.state){var t,o,r;const n={date:Digit.DateUtils.ConvertTimestampToDate(null===(t=e.application)||void 0===t||null===(o=t.auditDetails)||void 0===o?void 0:o.createdTime),source:(null===(r=e.application)||void 0===r?void 0:r.channel)||""};return l.createElement(Oi,{data:n})}var u,d;if("ACTIVE"===n.status)return l.createElement("div",null,l.createElement(i.Link,{to:"/digit-ui/citizen/commonpt/view-property?propertyId="+(null==e||null===(u=e.application)||void 0===u?void 0:u.propertyId)+"&tenantId="+(null==e||null===(d=e.application)||void 0===d?void 0:d.tenantId)},l.createElement(a.ActionLinks,null,v("PT_VIEW_PROPERTY_DETAILS"))));{var s,c,p,m,E,S;const t={source:(null===(s=e.application)||void 0===s?void 0:s.channel)||"",date:null==n||null===(c=n.auditDetails)||void 0===c?void 0:c.lastModified,name:null==n||null===(p=n.assignes)||void 0===p||null===(m=p[0])||void 0===m?void 0:m.name,mobileNumber:null==n||null===(E=n.assignes)||void 0===E||null===(S=E[0])||void 0===S?void 0:S.mobileNumber,comment:v(null==n?void 0:n.comment),wfComment:n.wfComment,thumbnailsToShow:null==n?void 0:n.thumbnailsToShow};return l.createElement(Oi,{data:t,OpenImage:f})}};return m?l.createElement(a.Loader,null):l.createElement(l.Fragment,null,!m&&l.createElement(t.Fragment,null,(null==E||null===(u=E.timeline)||void 0===u?void 0:u.length)>0&&l.createElement(a.CardSectionHeader,{style:{marginBottom:"16px"}},v("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=E&&E.timeline&&1===(null==E||null===(d=E.timeline)||void 0===d?void 0:d.length)?l.createElement(a.CheckPoint,{isCompleted:!0,label:v((null==E||null===(s=E.timeline[0])||void 0===s?void 0:s.state)&&"CS_"+E.timeline[0].state||"NA"),customChild:g(null==E?void 0:E.timeline[0])}):l.createElement(a.ConnectingCheckPoints,null,(null==E?void 0:E.timeline)&&(null==E?void 0:E.timeline.slice(0,S?E.timeline.length:2).map((e,n,t)=>l.createElement(l.Fragment,{key:n},l.createElement(a.CheckPoint,{keyValue:n,isCompleted:0===n,label:e.state?v("CS_"+e.state):"NA",customChild:g(e)}))))),(null==E||null===(c=E.timeline)||void 0===c?void 0:c.length)>2&&l.createElement(a.LinkButton,{label:v(S?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{_(e=>!e)}})),E&&(n=>{var t;let o=n[0];const r=n.map(e=>e.action);if(r.includes("PAY")||r.includes("EDIT")){let e=r.indexOf("EDIT")||r.indexOf("PAY");e=-1!=e?e:r.indexOf("PAY"),o=n[e]}switch(null===(t=o)||void 0===t?void 0:t.action){case"PAY":if(!1!==(null==e?void 0:e.paymentbuttonenabled))return l.createElement("div",{style:{marginTop:"1em",bottom:"0px",width:"100%",marginBottom:"1.2em"}},l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen/payment/collect/"+p+"/"+e.id+"?consumerCode="+e.id+"&&workflow=WNS",state:{tenantId:e.application.tenantId}}},l.createElement(a.SubmitBar,{label:v("CS_APPLICATION_DETAILS_MAKE_PAYMENT")})));break;case"EDIT":return l.createElement("div",{style:{marginTop:"1em",bottom:"0px",width:"100%",marginBottom:"1.2em"}},"PT.MUTATION"!=p&&l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen/pt/property/edit-application/action=edit-"+p+"/"+e.id,state:{tenantId:e.application.tenantId}}},l.createElement(a.SubmitBar,{label:v("CS_APPLICATION_DETAILS_EDIT")})));case"SUBMIT_FEEDBACK":return l.createElement("div",{style:{marginTop:"24px"}},l.createElement(i.Link,{to:"/digit-ui/citizen/fsm/rate/"+e.id},l.createElement(a.SubmitBar,{label:v("CS_APPLICATION_DETAILS_RATE")})))}})(null==E?void 0:E.nextActions))};function Li(e){var n;let{value:t={},Code:i,index:r,showFileName:u=!1}=e;const{t:d}=o.useTranslation(),{isLoading:s,data:c}=Digit.Hooks.ws.useWSDocumentSearch({value:t},{value:t},i,r),v=[];return null!=t&&t.documents?null==t||null===(n=t.documents)||void 0===n||n.documents.filter(e=>(null==e?void 0:e.documentType)===i).map(e=>{v.push(e)}):t.filter(e=>(null==e?void 0:e.documentType)===i).map(e=>{v.push(e)}),s?l.createElement(a.Loader,null):l.createElement("div",{style:{marginTop:"19px"}},l.createElement(l.Fragment,null,l.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},null==v?void 0:v.map((e,n)=>{let t=function(e,n,t){void 0===e&&(e={}),void 0===n&&(n="");let l=e[n]||"",o=(null==l?void 0:l.split(","))||[],i="";return o.length>0&&o.map(e=>{e.includes("large")||e.includes("medium")||e.includes("small")||(i=e)}),i}(c.pdfFiles,null==e?void 0:e.fileStoreId);return l.createElement("a",{target:"_",href:t,style:{minWidth:"160px"},key:n},l.createElement(a.PDFSvg,null),u?l.createElement("p",{style:{marginTop:"8px"}},d(null==i?void 0:i.split(".").slice(0,3).join("_"))):null)}))))}const Ri=e=>{var n;const t=null==e?void 0:e.doorNo,l=null==e?void 0:e.street,o=null==e?void 0:e.landmark,i=null==e||null===(n=e.locality)||void 0===n?void 0:n.name,a=null==e?void 0:e.pincode;return(t?t+", ":"")+(l?l+", ":"")+(o?o+", ":"")+(i?i+", ":"")+((null==e?void 0:e.city)||"")+(a?", "+a:"")},wi=(e,n)=>{var t,l,o;const i=null===(l=((null==e||null===(t=e.owners)||void 0===t?void 0:t.filter(e=>1==e.active))||[]).sort((e,n)=>{var t,l;return(null==e||null===(t=e.additionalDetails)||void 0===t?void 0:t.ownerSequence)-(null==n||null===(l=n.additionalDetails)||void 0===l?void 0:l.ownerSequence)}))||void 0===l||null===(o=l.map(e=>e.name))||void 0===o?void 0:o.join(",");return{title:n("WS_COMMON_PROPERTY_DETAILS"),values:[{title:n("WS_PROPERTY_ID_LABEL"),value:n(""+(null==e?void 0:e.propertyId))||n("CS_NA")},{title:n("WS_OWN_DETAIL_NAME"),value:i||n("CS_NA")},{title:n("WS_PROPERTY_ADDRESS_LABEL"),value:Ri(null==e?void 0:e.address)||n("CS_NA")}]}},Wi=(e,n)=>({title:n("WS_COMMON_CONNECTION_DETAILS"),values:[{title:n("WS_DISCONNECTION_TYPE"),value:!0===(null==e?void 0:e.isDisconnectionTemporary)?n("WS_DISCONNECTIONTYPE_TEMPORARY"):n("WS_DISCONNECTIONTYPE_PERMANENT")||n("CS_NA")},{title:n("WS_DISCONNECTION_PROPOSED_DATE"),value:null!=e&&e.dateEffectiveFrom?Digit.DateUtils.ConvertEpochToDate(null==e?void 0:e.dateEffectiveFrom):n("CS_NA")},{title:n("WS_DISCONNECTION_REASON"),value:(null==e?void 0:e.disconnectionReason)||n("CS_NA")}]}),Pi=(e,n)=>{var t,l,o,i,a,r,u,d,s,c,v;return{title:n("WS_COMMON_CONNECTION_HOLDER_DETAILS_HEADER"),values:(null==e||null===(t=e.connectionHolders)||void 0===t?void 0:t.length)>0?[{title:n("WS_OWN_DETAIL_NAME"),value:(null==e||null===(l=e.connectionHolders)||void 0===l||null===(o=l[0])||void 0===o?void 0:o.name)||n("CS_NA")},{title:n("CORE_COMMON_MOBILE_NUMBER"),value:(null==e||null===(i=e.connectionHolders)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.mobileNumber)||n("CS_NA")},{title:n("WS_CONN_HOLDER_COMMON_FATHER_OR_HUSBAND_NAME"),value:(null==e||null===(r=e.connectionHolders)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.fatherOrHusbandName)||n("CS_NA")},{title:n("WS_CORRESPONDANCE_ADDRESS_LABEL"),value:(null==e||null===(d=e.connectionHolders)||void 0===d||null===(s=d[0])||void 0===s?void 0:s.correspondenceAddress)||n("CS_NA")},{title:n("CORE_COMMON_EMAIL_ID"),value:(null==e||null===(c=e.connectionHolders)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.emailId)||n("CS_NA")}]:[{title:n("WS_CONN_HOLDER_SAME_AS_OWNER_DETAILS"),value:n("SCORE_YES")||n("CS_NA")}]}},Mi=(e,n)=>{const t=null==e?void 0:e.documents;return{title:n("WS_COMMON_DOCUMENTS_DETAILS"),isAttachments:!0,values:null==t?void 0:t.map(e=>n(null==e?void 0:e.documentType))}},xi=function(e,n,t,l){try{var o,i;function a(){return Promise.resolve(function(e,n,t){try{return Promise.resolve(E(t,n)).then(function(t){var l,o;let i=[];return null!=e&&e.applicationNo&&i.push({title:n("PDF_STATIC_LABEL_APPLICATION_NUMBER_LABEL")+":",value:null==e?void 0:e.applicationNo}),null!=e&&e.applicationType&&i.push({title:n("WS_SERVICE_NAME")+":",value:n("WS_APPLICATION_TYPE_"+(null==e?void 0:e.applicationType))}),v({title:"",isHeader:!0,typeOfApplication:null!=e&&null!==(l=e.applicationNo)&&void 0!==l&&l.includes("SW")?n("WS_NEW_SEWERAGE_DISCONNECTION"):n("WS_NEW_WATER_DISCONNECTION"),date:Digit.DateUtils.ConvertEpochToDate(null==e||null===(o=e.auditDetails)||void 0===o?void 0:o.createdTime)||"NA",values:i},t)})}catch(e){return Promise.reject(e)}}(e,l,t)).then(function(o){return{t:l,tenantId:t,title:"PDF_STATIC_LABEL_WS_CONSOLIDATED_ACKNOWELDGMENT_LOGO_SUB_HEADER",name:""+l("PDF_STATIC_LABEL_WS_CONSOLIDATED_ACKNOWELDGMENT_LOGO_SUB_HEADER"),email:"",phoneNumber:"",headerDetails:[o],details:[wi(n,l),Pi(e,l),Wi(e,l),Mi(e,l)]}})}const r=null==e||null===(o=e.tradeLicenseDetail)||void 0===o||null===(i=o.applicationDocuments)||void 0===i?void 0:i.map(e=>null==e?void 0:e.fileStoreId);let u;const d=function(){if(r)return Promise.resolve(Digit.UploadServices.Filefetch(r,Digit.ULBService.getStateId())).then(function(e){u=e})}();return Promise.resolve(d&&d.then?d.then(a):a())}catch(e){return Promise.reject(e)}},Bi=e=>{var n;const t=null==e?void 0:e.doorNo,l=null==e?void 0:e.street,o=null==e?void 0:e.landmark,i=null==e||null===(n=e.locality)||void 0===n?void 0:n.name,a=null==e?void 0:e.pincode;return(t?t+", ":"")+(l?l+", ":"")+(o?o+", ":"")+(i?i+", ":"")+((null==e?void 0:e.city)||"")+(a?", "+a:"")},Fi=(e,n)=>{var t,l,o;const i=null===(l=((null==e||null===(t=e.owners)||void 0===t?void 0:t.filter(e=>1==e.active))||[]).sort((e,n)=>{var t,l;return(null==e||null===(t=e.additionalDetails)||void 0===t?void 0:t.ownerSequence)-(null==n||null===(l=n.additionalDetails)||void 0===l?void 0:l.ownerSequence)}))||void 0===l||null===(o=l.map(e=>e.name))||void 0===o?void 0:o.join(",");return{title:n("WS_COMMON_PROPERTY_DETAILS"),values:[{title:n("WS_PROPERTY_ID_LABEL"),value:n(""+(null==e?void 0:e.propertyId))||n("CS_NA")},{title:n("WS_OWN_DETAIL_NAME"),value:i||n("CS_NA")},{title:n("WS_PROPERTY_ADDRESS_LABEL"),value:Bi(null==e?void 0:e.address)||n("CS_NA")}]}},Ui=(e,n)=>{var t,l,o,i,a,r,u,d,s,c,v,p,E,_;return{title:n("WS_COMMON_CONNECTION_DETAILS"),values:null!=e&&null!==(t=e.applicationNo)&&void 0!==t&&t.includes("WS")&&"Metered"==(null==e?void 0:e.connectionType)?[{title:n("WS_SERV_DETAIL_CONN_TYPE"),value:n(null!=e&&e.connectionType?"WS_SERVICES_MASTERS_WATERSOURCE_"+m(null==e||null===(l=e.connectionType)||void 0===l?void 0:l.toUpperCase()," ","_"):"CS_NA")},{title:n("WS_SERV_DETAIL_NO_OF_TAPS"),value:(null==e?void 0:e.noOfTaps)||n("CS_NA")},{title:n("WS_PIPE_SIZE_IN_INCHES_LABEL"),value:(null==e?void 0:e.pipeSize)||n("CS_NA")},{title:n("WS_SERV_DETAIL_WATER_SOURCE"),value:n(null!=e&&e.waterSource?"WS_SERVICES_MASTERS_WATERSOURCE_"+(null==e||null===(o=e.waterSource)||void 0===o||null===(i=o.toUpperCase())||void 0===i?void 0:i.split(".")[0]):"CS_NA")},{title:n("WS_SERV_DETAIL_WATER_SUB_SOURCE"),value:n(null!=e&&e.waterSource?""+(null==e||null===(a=e.waterSource)||void 0===a||null===(r=a.toUpperCase())||void 0===r?void 0:r.split(".")[1]):"CS_NA")},{title:n("WS_SERV_DETAIL_CONN_EXECUTION_DATE"),value:null!=e&&e.connectionExecutionDate?S(null==e?void 0:e.connectionExecutionDate):n("CS_NA")},{title:n("WS_SERV_DETAIL_METER_ID"),value:(null==e?void 0:e.meterId)||n("CS_NA")},{title:n("WS_INITIAL_METER_READING_LABEL"),value:(null==e||null===(u=e.additionalDetails)||void 0===u?void 0:u.initialMeterReading)||n("CS_NA")},{title:n("WS_INSTALLATION_DATE_LABEL"),value:null!=e&&e.meterInstallationDate?S(null==e?void 0:e.meterInstallationDate):n("CS_NA")}]:null!=e&&null!==(d=e.applicationNo)&&void 0!==d&&d.includes("WS")&&"Metered"!==(null==e?void 0:e.connectionType)?[{title:n("WS_SERV_DETAIL_CONN_TYPE"),value:n(null!=e&&e.connectionType?"WS_SERVICES_MASTERS_WATERSOURCE_"+m(null==e||null===(s=e.connectionType)||void 0===s?void 0:s.toUpperCase()," ","_"):"CS_NA")},{title:n("WS_SERV_DETAIL_NO_OF_TAPS"),value:(null==e?void 0:e.noOfTaps)||n("CS_NA")},{title:n("WS_PIPE_SIZE_IN_INCHES_LABEL"),value:(null==e?void 0:e.pipeSize)||n("CS_NA")},{title:n("WS_SERV_DETAIL_WATER_SOURCE"),value:n(null!=e&&e.waterSource?"WS_SERVICES_MASTERS_WATERSOURCE_"+(null==e||null===(c=e.waterSource)||void 0===c||null===(v=c.toUpperCase())||void 0===v?void 0:v.split(".")[0]):"CS_NA")},{title:n("WS_SERV_DETAIL_WATER_SUB_SOURCE"),value:n(null!=e&&e.waterSource?""+(null==e||null===(p=e.waterSource)||void 0===p||null===(E=p.toUpperCase())||void 0===E?void 0:E.split(".")[1]):"CS_NA")},{title:n("WS_SERV_DETAIL_CONN_EXECUTION_DATE"),value:null!=e&&e.connectionExecutionDate?S(null==e?void 0:e.connectionExecutionDate):n("CS_NA")}]:[{title:n("WS_SERV_DETAIL_CONN_TYPE"),value:n(null!=e&&e.connectionType?"WS_SERVICES_MASTERS_WATERSOURCE_"+m(null==e||null===(_=e.connectionType)||void 0===_?void 0:_.toUpperCase()," ","_"):"CS_NA")},{title:n("WS_NUMBER_WATER_CLOSETS_LABEL"),value:(null==e?void 0:e.noOfWaterClosets)||n("CS_NA")},{title:n("WS_SERV_DETAIL_NO_OF_TOILETS"),value:(null==e?void 0:e.noOfToilets)||n("CS_NA")},{title:n("WS_SERV_DETAIL_CONN_EXECUTION_DATE"),value:null!=e&&e.connectionExecutionDate?S(null==e?void 0:e.connectionExecutionDate):n("CS_NA")}]}},ki=(e,n)=>{var t,l,o,i,a,r,u,d,s,c,v;return{title:n("WS_COMMON_CONNECTION_HOLDER_DETAILS_HEADER"),values:(null==e||null===(t=e.connectionHolders)||void 0===t?void 0:t.length)>0?[{title:n("WS_OWN_DETAIL_NAME"),value:(null==e||null===(l=e.connectionHolders)||void 0===l||null===(o=l[0])||void 0===o?void 0:o.name)||n("CS_NA")},{title:n("CORE_COMMON_MOBILE_NUMBER"),value:(null==e||null===(i=e.connectionHolders)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.mobileNumber)||n("CS_NA")},{title:n("WS_CONN_HOLDER_COMMON_FATHER_OR_HUSBAND_NAME"),value:(null==e||null===(r=e.connectionHolders)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.fatherOrHusbandName)||n("CS_NA")},{title:n("WS_CORRESPONDANCE_ADDRESS_LABEL"),value:(null==e||null===(d=e.connectionHolders)||void 0===d||null===(s=d[0])||void 0===s?void 0:s.correspondenceAddress)||n("CS_NA")},{title:n("CORE_COMMON_EMAIL_ID"),value:(null==e||null===(c=e.connectionHolders)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.emailId)||n("CS_NA")}]:[{title:n("WS_CONN_HOLDER_SAME_AS_OWNER_DETAILS"),value:n("SCORE_YES")||n("CS_NA")}]}},Hi=function(e,n,t,l){try{var o,i;function a(){return Promise.resolve(function(e,n,t){try{return Promise.resolve(E(t,n)).then(function(t){var l,o,i,a;let r=[];return null!=e&&e.connectionNo&&r.push({title:n("PDF_STATIC_LABEL_CONSUMER_NUMBER_LABEL")+":",value:null==e?void 0:e.connectionNo}),v({title:"",isHeader:!0,typeOfApplication:null!=e&&null!==(l=e.connectionNo)&&void 0!==l&&l.includes("SW")?n("PDF_STATIC_LABEL_SW_CONSOLIDATED_ACKNOWELDGMENT_LOGO_SUB_HEADER"):n("PDF_STATIC_LABEL_WS_CONSOLIDATED_ACKNOWELDGMENT_WATER_CONNECTIONDETAIL"),date:(null!=e&&null!==(o=e.auditDetails)&&void 0!==o&&o.createdTime?Digit.DateUtils.ConvertEpochToDate(null==e||null===(i=e.auditDetails)||void 0===i?void 0:i.createdTime):Digit.DateUtils.ConvertEpochToDate(null==e||null===(a=e.additionalDetails)||void 0===a?void 0:a.appCreatedDate))||"NA",values:r},t)})}catch(e){return Promise.reject(e)}}(e,l,t)).then(function(o){return{t:l,tenantId:t,title:"PDF_STATIC_LABEL_WS_CONSOLIDATED_ACKNOWELDGMENT_LOGO_SUB_HEADER",name:""+l("PDF_STATIC_LABEL_WS_CONSOLIDATED_ACKNOWELDGMENT_LOGO_SUB_HEADER"),email:"",phoneNumber:"",headerDetails:[o],details:[Ui(e,l),Fi(n,l),ki(e,l)]}})}const r=null==e||null===(o=e.tradeLicenseDetail)||void 0===o||null===(i=o.applicationDocuments)||void 0===i?void 0:i.map(e=>null==e?void 0:e.fileStoreId);let u;const d=function(){if(r)return Promise.resolve(Digit.UploadServices.Filefetch(r,Digit.ULBService.getStateId())).then(function(e){u=e})}();return Promise.resolve(d&&d.then?d.then(a):a())}catch(e){return Promise.reject(e)}},ji=e=>{var n,t,i,r,u,d,s,c,p,m,E,S,_,g,C;let{application:N}=e;const{t:y}=o.useTranslation();return l.createElement(a.Card,null,l.createElement(a.KeyNote,{noteStyle:{fontSize:"24px",fontWeight:"700"},keyValue:y("CS_PAYMENT_AMOUNT_DUE_WITHOUT_SYMBOL"),note:"₹ "+(null==N||null===(n=N.paymentDetails)||void 0===n||null===(t=n[0])||void 0===t?void 0:t.totalAmountPaid)}),l.createElement(a.KeyNote,{keyValue:y("WS_SERVICE_NAME_LABEL"),note:y("WS_SERVICE_TYPE_"+(null==N||null===(i=N.paymentDetails)||void 0===i||null===(r=i[0])||void 0===r?void 0:r.businessService))}),l.createElement(a.KeyNote,{keyValue:y("WS_CONSUMER_CODE"),note:y(null==N||null===(u=N.paymentDetails)||void 0===u||null===(d=u[0])||void 0===d||null===(s=d.bill)||void 0===s?void 0:s.consumerCode)}),l.createElement(a.KeyNote,{keyValue:y("WS_CONSUMER_NAME"),note:(null==N||null===(c=N.property)||void 0===c||null===(p=c.connectionHolders)||void 0===p?void 0:p.map(e=>null==e?void 0:e.name).join(","))||(null==N||null===(m=N.property)||void 0===m||null===(E=m.owners)||void 0===E?void 0:E.map(e=>null==e?void 0:e.name).join(","))||(null==N?void 0:N.payerName)}),l.createElement(a.KeyNote,{keyValue:y("WS_RECEIPT_NO_LABEL"),note:y(null==N||null===(S=N.paymentDetails)||void 0===S||null===(_=S[0])||void 0===_?void 0:_.receiptNumber)}),l.createElement(a.KeyNote,{keyValue:y("WS_RECEIPT_DATE_LABEL"),note:f(null==N||null===(g=N.paymentDetails)||void 0===g||null===(C=g[0])||void 0===C?void 0:C.receiptDate)||y("CS_NA")}),l.createElement(a.KeyNote,{keyValue:y("WS_PAYMENT_STATUS"),note:y(null==N?void 0:N.paymentStatus)}),l.createElement(a.SubmitBar,{label:y("WS_DOWNLOAD_RECEIPT"),onSubmit:e=>{var n,t,l,o;return function(e,n,t,l){try{function o(){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:n.filestoreIds[0]})).then(function(e){var t;window.open(e[null===(t=n)||void 0===t?void 0:t.filestoreIds[0]],"_blank")})}let n=null;const l=function(){if(null==e||!e.fileStoreId)return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[v({},e)]},"ws-onetime-receipt")).then(function(e){n=e});n={filestoreIds:[null==e?void 0:e.fileStoreId]}}();return Promise.resolve(l&&l.then?l.then(o):o())}catch(e){return Promise.reject(e)}}(N,0,null==N?void 0:N.tenantId,null!=N&&null!==(n=N.paymentDetails)&&void 0!==n&&null!==(t=n[0])&&void 0!==t&&null!==(l=t.bill)&&void 0!==l&&null!==(o=l.consumerCode)&&void 0!==o&&o.includes("SW"))}}))},Vi=(e,n)=>(n&&Object.keys(n).map(t=>{e=e.replace(":"+t,n[t])}),e),zi=(e,n)=>(n&&Object.keys(n).map(t=>{e=e.replace(":"+t,n[t])}),e),Yi=e=>{var n,t,r,u,d,s,c,p;let{application:m}=e;const{t:E}=o.useTranslation();let S=encodeURI(m.applicationNo);return l.createElement(a.Card,null,l.createElement(a.KeyNote,{keyValue:E("WS_MYCONNECTIONS_CONSUMER_NO"),note:null==m?void 0:m.connectionNo}),l.createElement(a.KeyNote,{keyValue:E("WS_SERVICE_NAME_LABEL"),note:E("WS_APPLICATION_TYPE_"+(null==m?void 0:m.applicationType))}),l.createElement(a.KeyNote,{keyValue:E("WS_CONSUMER_NAME"),note:(null==m||null===(n=m.connectionHolders)||void 0===n?void 0:n.map(e=>e.name).join(","))||(null==m||null===(t=m.property)||void 0===t||null===(r=t.owners.sort((e,n)=>{var t,l;return(null==e||null===(t=e.additionalDetails)||void 0===t?void 0:t.ownerSequence)-(null==n||null===(l=n.additionalDetails)||void 0===l?void 0:l.ownerSequence)}))||void 0===r?void 0:r.map(e=>e.name).join(","))}),l.createElement(a.KeyNote,{keyValue:E("WS_MYCONNECTION_ADDRESS"),note:C(null==m||null===(u=m.property)||void 0===u?void 0:u.address,E),privacy:{uuid:null==m||null===(d=m.property)||void 0===d||null===(s=d.owners)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.uuid,fieldName:["doorNo","street","landmark"],model:"Property",showValue:!0,loadData:{serviceName:"/property-services/property/_search",requestBody:{},requestParam:{tenantId:null==m?void 0:m.tenantId,propertyIds:null==m||null===(p=m.property)||void 0===p?void 0:p.propertyId},jsonPath:"Properties[0].address.street",isArray:!1,d:e=>(U.get(e,"Properties[0].address.doorNo")?U.get(e,"Properties[0].address.doorNo")+", ":"")+(U.get(e,"Properties[0].address.street")?U.get(e,"Properties[0].address.street")+", ":"")+(U.get(e,"Properties[0].address.landmark")?""+U.get(e,"Properties[0].address.landmark"):"")}}}),l.createElement(a.KeyNote,{keyValue:E("WS_MYCONNECTIONS_STATUS"),note:E(null==m?void 0:m.status)}),l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen/ws/connection/details/"+S,state:v({},m)}},l.createElement(a.SubmitBar,{label:E("WS_VIEW_DETAILS_LABEL")})))},Gi=e=>{const{t:n}=o.useTranslation();return e.isSuccess?n("CS_WATER_UPDATE_APPLICATION_SUCCESS"):e.isLoading?n("CS_WATER_UPDATE_APPLICATION_PENDING"):e.isSuccess?void 0:n("CS_WATER_UPDATE_APPLICATION_FAILED")},qi=e=>{var n,t,o,i,r,u;return l.createElement(a.Banner,{message:Gi(e),info:e.isSuccess&&null!=e&&e.Waterdata?e.t("WS_ACKNO_APP_NO_LABEL"):"",applicationNumber:null!=e&&e.Waterdata?null==e||null===(n=e.Waterdata)||void 0===n||null===(t=n.WaterConnection)||void 0===t||null===(o=t[0])||void 0===o?void 0:o.applicationNo:"",infoOne:e.isSuccess&&null!=e&&e.Seweragedata?e.t("WS_ACKNO_SEW_APP_NO_LABEL"):"",applicationNumberOne:null!=e&&e.Seweragedata?null==e||null===(i=e.Seweragedata)||void 0===i||null===(r=i.SewerageConnections)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.applicationNo:"",successful:e.isSuccess})},Ki=[{texts:{header:"CS_TITLE_MY_BILLS",actionButtonLabel:"WS_VIEW_DETAILS_AND_PAY"},labels:[{label:"WNS_COMMON_TABLE_COL_AMT_DUE_LABEL",key:"AmountDue",noteStyle:{fontSize:"24px",fontWeight:"bold"},notePrefix:"₹ "},{label:"WNS_MYCONNECTIONS_SERVICE",key:"ServiceName"},{label:"WNS_MYCONNECTIONS_CONSUMER_NO",key:"ConsumerNumber"},{label:"WNS_BILLING_PERIOD",key:"BillingPeriod"},{label:"WNS_CONSUMER_NAME_LABEL",key:"ConsumerName"},{label:"WNS_MYCONNECTION_ADDRESS",key:"Address"},{label:"WNS_VIEW_BILL_DUE_DATE_LABEL",key:"DueDate"}]}],Xi=e=>{var n,t,r,u,d,s,c,p,E;let{template:S,header:_,actionButtonLabel:f}=e;const{t:g}=o.useTranslation(),C=i.useHistory(),N=i.useLocation(),{tenantId:y}=Digit.Hooks.useQueryParams();let{tenantId:D}=(null===(n=Digit.UserService.getUser())||void 0===n?void 0:n.info)||(null==N?void 0:N.state)||{tenantId:y}||{};D=(null===(t=Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY"))||void 0===t?void 0:t.code)||(null===(r=Digit.UserService.getUser())||void 0===r||null===(u=r.info)||void 0===u?void 0:u.permanentCity)||D,D||null!=N&&null!==(d=N.state)&&void 0!==d&&d.fromSearchResults||C.replace("/digit-ui/citizen/login",{from:url});let T={};const{mobileNumber:h}=(null===(s=Digit.UserService.getUser())||void 0===s?void 0:s.info)||{};T=v({},T,{searchType:"CONNECTION"});const A=v({mobileNumber:h},T),I=Digit.Hooks.ws.useMyBillsWaterSearch({tenantId:D,filters:v({},A),BusinessService:"WS",t:g},{privacy:Digit.Utils.getPrivacyObject()}),O=Digit.Hooks.ws.useMyBillsSewarageSearch({tenantId:D,filters:v({},A),BusinessService:"SW",t:g},{privacy:Digit.Utils.getPrivacyObject()});if(null!=I&&I.isLoading||null!=O&&O.isLoading||null==I||null==O)return l.createElement(a.Loader,null);let b=I&&O?I.concat(O):[];return b=null===(c=b)||void 0===c?void 0:c.filter(e=>(null==e?void 0:e.AmountDue)&&"0"!==(null==e?void 0:e.AmountDue)),l.createElement("div",{style:{marginTop:"16px"}},l.createElement("div",null,_&&l.createElement(a.Header,{style:{marginLeft:10,marginTop:10}},g(_)," (",null===(p=b)||void 0===p?void 0:p.length,")"),l.createElement(j,{t:g}),l.createElement(a.ResponseComposer,{data:b,template:S,actionButtonLabel:f,onSubmit:e=>{C.push("/digit-ui/citizen/payment/my-bills/"+(null==e?void 0:e.ConsumerNumber.split("/")[0])+"/"+m(null==e?void 0:e.ConsumerNumber,"/","+")+"?workflow=WNS&tenantId="+D+"&ConsumerName="+(null==e?void 0:e.ConsumerName))}})),!(null!==(E=b)&&void 0!==E&&E.length)>0&&l.createElement("p",{style:{paddingLeft:"16px"}},g("CS_BILLS_TEXT_NO_BILLS_FOUND")))};Xi.propTypes={template:jo.any,header:jo.string,actionButtonLabel:jo.string},Xi.defaultProps={template:[],header:null,actionButtonLabel:null};const Zi=["register","control","watch","setValue","unregister","handleSubmit","formState","getValues","reset"],$i=["errors"];function Ji(e,n){try{var t=e()}catch(e){return n(e)}return t&&t.then?t.then(void 0,n):t}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const Qi=e=>l.createElement("h1",{className:"heading-m"},e.label),ea=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),na=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ea,null)),ta=e=>{var n,o;let{t:i,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:p,moduleCode:m}=e;const{data:E,isLoading:S}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(n=r.assigneeRoles)||void 0===n||null===(o=n.map)||void 0===o?void 0:o.call(n,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:_,data:f}=Digit.Hooks.pt.useMDMS(u,p,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[g,C]=t.useState({}),[N,y]=t.useState({}),[D,T]=t.useState([]),[h,A]=t.useState(null),[I,O]=t.useState(null),[b,L]=t.useState(null),[R,w]=t.useState(null),[W,P]=t.useState([]),[M,x]=t.useState(null),[B,F]=t.useState(!1);function U(e){O(e.target.files[0])}return t.useEffect(()=>{var e;f&&f["egf-master"]&&P(null===(e=f["egf-master"])||void 0===e?void 0:e.FinancialYear)},[f]),t.useEffect(()=>{var e;T(null==E||null===(e=E.Employees)||void 0===e?void 0:e.map(e=>{var n;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(n=e.user)||void 0===n?void 0:n.name}}))},[E]),t.useEffect(()=>{!function(){try{w(null);const e=function(){if(I){const e=function(){if(I.size>=5242880)w(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Ji(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",I,Digit.ULBService.getStateId())).then(function(e){var n,t,l,o;(null==e||null===(n=e.data)||void 0===n||null===(t=n.files)||void 0===t?void 0:t.length)>0?L(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):w(i("CS_FILE_UPLOAD_ERROR"))})},function(){w(i("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[I]),t.useEffect(()=>{r&&C(null!=r&&r.showFinancialYearsModal?(e=>{let{t:n,action:t,financialYears:o,selectedFinancialYear:i,setSelectedFinancialYear:r}=e;return{label:{heading:"WF_"+t.action+"_APPLICATION",submit:"WF_PT.CREATE_"+t.action,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:n("ES_PT_FINANCIAL_YEARS"),isMandatory:!0,type:"radio",populators:l.createElement(a.RadioButtons,{options:o,optionsKey:"name",onSelect:r,selectedOption:i})}]}]}})({t:i,action:r,financialYears:W,selectedFinancialYear:M,setSelectedFinancialYear:x}):(e=>{var n;let{t:t,action:o,approvers:i,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:v,businessService:p}=e;return{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+p+"_"+(null==o?void 0:o.action),cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:t(v||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:l.createElement(a.Dropdown,{option:i,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:t("ES_PT_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:t("ES_PT_ATTACH_FILE")+(o.docUploadRequired?" *":""),populators:l.createElement(a.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},showHint:!0,hintText:t("PT_ATTACH_RESTRICTIONS_SIZE"),message:s?"1 "+t("ES_PT_ACTION_FILEUPLOADED"):t("ES_PT_ACTION_NO_FILEUPLOADED")})}]}]}})({t:i,action:r,approvers:D,selectedApprover:h,setSelectedApprover:A,selectFile:U,uploadedFile:b,setUploadedFile:L,businessService:p}))},[r,D,W,M,b]),r&&g.form?l.createElement(a.Modal,{headerBarMain:l.createElement(Qi,{label:i(g.label.heading)}),headerBarEnd:l.createElement(na,{onClick:d}),actionCancelLabel:i(g.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:i(g.label.submit),actionSaveOnSubmit:()=>{},isDisabled:r.showFinancialYearsModal?!M:S||(null==r?void 0:r.docUploadRequired)&&!b,formId:"modal-action"},_?l.createElement(a.Loader,null):l.createElement(a.FormComposer,{config:g.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("INACTIVE_PROPERTY"==(null==r?void 0:r.action)){let n={action:"OPEN",comment:null==e?void 0:e.comments,businessService:"PT.CREATE",moduleName:"PT"};c.creationReason="STATUS",s({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Property:v({},c,{workflow:n})})}else if(null!=r&&r.showFinancialYearsModal)s({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Assessment:{financialYear:null==M?void 0:M.name,propertyId:null==c?void 0:c.propertyId,tenantId:u,source:null==c?void 0:c.source,channel:null==c?void 0:c.channel,assessmentDate:Date.now()}});else{let n={action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,businessService:p,moduleName:m};n.assignes=null!=r&&r.isTerminateState||!h?[]:[h],b&&(n.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==I?void 0:I.name,fileStoreId:b}]),s({Property:v({},c,{workflow:n})})}},defaultValues:N,formId:"modal-action"})):l.createElement(a.Loader,null)},la=e=>l.createElement("h1",{className:"heading-m"},e.label),oa=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),ia=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(oa,null)),aa=e=>{var n,o;let{t:i,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:p}=e;const{data:m}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(n=r.assigneeRoles)||void 0===n||null===(o=n.map)||void 0===o?void 0:o.call(n,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:E,data:S}=Digit.Hooks.pt.useMDMS(u,p,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[_,f]=t.useState({}),[g,C]=t.useState({}),[N,y]=t.useState([]),[D,T]=t.useState({}),[h,A]=t.useState(null),[I,O]=t.useState(null),[b,L]=t.useState(null),[R,w]=t.useState([]),[W,P]=t.useState(null);function M(e){A(e.target.files[0])}return t.useEffect(()=>{var e;S&&S["egf-master"]&&w(null===(e=S["egf-master"])||void 0===e?void 0:e.FinancialYear)},[S]),t.useEffect(()=>{var e;y(null==m||null===(e=m.Employees)||void 0===e?void 0:e.map(e=>{var n;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(n=e.user)||void 0===n?void 0:n.name}}))},[m]),t.useEffect(()=>{!function(){try{L(null);const e=function(){if(h){const e=function(){if(h.size>=5242880)L(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Ji(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",h,Digit.ULBService.getStateId())).then(function(e){var n,t,l,o;(null==e||null===(n=e.data)||void 0===n||null===(t=n.files)||void 0===t?void 0:t.length)>0?O(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):L(i("CS_FILE_UPLOAD_ERROR"))})},function(){L(i("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[h]),t.useEffect(()=>{r&&f((e=>{let{t:n,action:t,approvers:o,selectedApprover:i,setSelectedApprover:r,selectFile:u,uploadedFile:d,setUploadedFile:s,businessService:c}=e,v=!0;return"SENDBACKTOCITIZEN"!=(null==t?void 0:t.action)&&"APPROVE"!=(null==t?void 0:t.action)||(v=!1),t.isTerminateState&&(v=!1),{label:{heading:"WF_"+(null==t?void 0:t.action)+"_APPLICATION",submit:"WF_"+(null==c?void 0:c.toUpperCase())+"_"+(null==t?void 0:t.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:v?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:v?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:v?l.createElement(a.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:i}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(a.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{s(null)},message:d?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:i,action:r,approvers:N,selectedApprover:D,setSelectedApprover:T,selectFile:M,uploadedFile:I,setUploadedFile:O,businessService:p}))},[r,N,R,W,I]),r&&_.form?l.createElement(a.Modal,{headerBarMain:l.createElement(la,{label:i(_.label.heading)}),headerBarEnd:l.createElement(ia,{onClick:d}),actionCancelLabel:i(_.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:i(_.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},E?l.createElement(a.Loader,null):l.createElement(a.FormComposer,{config:_.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){c=v({},c,{action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=D&&D.uuid?[null==D?void 0:D.uuid]:null,wfDocuments:I?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==h?void 0:h.name,fileStoreId:I}]:null}),s({Licenses:[c]})},defaultValues:g,formId:"modal-action"})):l.createElement(a.Loader,null)},ra=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),ua=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),da=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ua,null)),sa=e=>{var n,o;let{t:i,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:p}=e;const{data:m,isLoading:E}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(n=r.assigneeRoles)||void 0===n||null===(o=n.map)||void 0===o?void 0:o.call(n,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[S,_]=t.useState({}),[f,g]=t.useState({}),[C,N]=t.useState([]),[y,D]=t.useState({}),[T,h]=t.useState(null),[A,I]=t.useState(null),[O,b]=t.useState(null),L=!!Digit.Utils.browser.isMobile();function R(e){h(e.target.files[0])}return t.useEffect(()=>{var e;N(null==m||null===(e=m.Employees)||void 0===e?void 0:e.map(e=>{var n;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(n=e.user)||void 0===n?void 0:n.name}}))},[m]),t.useEffect(()=>{!function(){try{b(null);const e=function(){if(T){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,n=function(){if(T.size>=5242880)b(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const n=function(){if(null!=T&&T.type&&!e.test(null==T?void 0:T.type))b(i("NOT_SUPPORTED_FILE_TYPE"));else{const e=Ji(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",T,Digit.ULBService.getStateId()||(null==u?void 0:u.split(".")[0]))).then(function(e){var n,t,l,o;(null==e||null===(n=e.data)||void 0===n||null===(t=n.files)||void 0===t?void 0:t.length)>0?I(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):b(i("CS_FILE_UPLOAD_ERROR"))})},function(){b(i("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(n&&n.then)return n.then(function(){})}}();if(n&&n.then)return n.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[T]),t.useEffect(()=>{r&&_((e=>{let{t:n,action:t,approvers:o,selectedApprover:i,setSelectedApprover:r,selectFile:u,uploadedFile:d,setUploadedFile:s,businessService:c,error:v}=e,p=!0;return"SENDBACKTOCITIZEN"==(null==t?void 0:t.action)&&(p=!1),t.isTerminateState&&(p=!1),{label:{heading:"WF_"+(null==t?void 0:t.action)+"_APPLICATION",submit:"WF_"+(null==c?void 0:c.toUpperCase())+"_"+(null==t?void 0:t.action),cancel:"WF_EMPLOYEE_BPAREG_CANCEL"},form:[{body:[{label:p?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:p?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:p?l.createElement(a.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:i}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("BPA_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(a.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{s(null)},message:d?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:v})}]}]}})({t:i,action:r,approvers:C,selectedApprover:y,setSelectedApprover:D,selectFile:R,uploadedFile:A,setUploadedFile:I,businessService:p,error:O}))},[r,C,A,O]),r&&S.form?l.createElement(a.Modal,{headerBarMain:l.createElement(ra,{label:i(S.label.heading)}),headerBarEnd:l.createElement(da,{onClick:d}),actionCancelLabel:i(S.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:i(S.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:L?{width:"720px"}:{},style:L?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:L?{paddingLeft:"5px"}:{}},E?l.createElement(a.Loader,null):l.createElement(a.FormComposer,{config:S.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){c=v({},c,{action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=y&&y.uuid?[null==y?void 0:y.uuid]:null,wfDocuments:A?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:A}]:null}),s({Licenses:[c]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:f,formId:"modal-action"})):l.createElement(a.Loader,null)},ca=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),va=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),pa=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(va,null)),ma=e=>{var n,o,i,r,u,s,c,p,m,E,S,_;let{t:f,action:g,tenantId:C,closeModal:N,submitAction:y,applicationDetails:D,applicationData:T,businessService:h,workflowDetails:A}=e;Digit.Hooks.obps.useObpsAPI(null!==(n=T)&&void 0!==n&&null!==(o=n.landInfo)&&void 0!==o&&null!==(i=o.address)&&void 0!==i&&i.city?null===(r=T)||void 0===r||null===(u=r.landInfo)||void 0===u||null===(s=u.address)||void 0===s?void 0:s.city:C,!1);const{data:I,isLoading:O}=Digit.Hooks.useEmployeeSearch(C,{roles:null==A||null===(c=A.data)||void 0===c||null===(p=c.initialActionState)||void 0===p||null===(m=p.nextActions)||void 0===m||null===(E=m.filter(e=>(null==e?void 0:e.action)==(null==g?void 0:g.action)))||void 0===E||null===(S=E[0])||void 0===S||null===(_=S.assigneeRoles)||void 0===_?void 0:_.map(e=>({code:e})),isActive:!0},{enabled:!(null!=g&&g.isTerminateState)}),[b,L]=(d.useQueryClient(),t.useState({})),[R,w]=t.useState({}),[W,P]=t.useState([]),[M,x]=t.useState({}),[B,F]=t.useState(null),[U,k]=t.useState(null),[H,j]=t.useState(null),[V,z]=t.useState(null),Y=!!Digit.Utils.browser.isMobile();function G(e){F(e.target.files[0])}t.useEffect(()=>{var e;P(null==I||null===(e=I.Employees)||void 0===e?void 0:e.map(e=>{var n;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(n=e.user)||void 0===n?void 0:n.name}}))},[I]),t.useEffect(()=>{!function(){try{j(null);const e=function(){if(B){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,n=function(){if(B.size>=5242880)j(f("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const n=function(){if(null!=B&&B.type&&!e.test(null==B?void 0:B.type))j(f("NOT_SUPPORTED_FILE_TYPE"));else{const e=Ji(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",B,Digit.ULBService.getStateId()||(null==C?void 0:C.split(".")[0]))).then(function(e){var n,t,l,o;(null==e||null===(n=e.data)||void 0===n||null===(t=n.files)||void 0===t?void 0:t.length)>0?k(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):j(f("CS_FILE_UPLOAD_ERROR"))})},function(){j(f("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(n&&n.then)return n.then(function(){})}}();if(n&&n.then)return n.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[B]);const q=e=>{let n=[];return e&&e.map((e,t)=>{n.push({documentType:(e.documentType+"_"+e.documentType.split("_")[1]).replaceAll("_","."),fileStoreId:e.fileStoreId,fileStore:e.fileStoreId,fileName:"",dropDownValues:{value:(e.documentType+"_"+e.documentType.split("_")[1]).replaceAll("_",".")}})}),n},K=e=>{let n=[];var t;for(t=0;t<(null==e?void 0:e.questionLength);t++){var l;n.push({remarks:e["Remarks_"+t],question:null==e?void 0:e.questionList[t].question,value:null==e||null===(l=e["question_"+t])||void 0===l?void 0:l.code})}return n},X=e=>{var n,t;let l=[],o=[];var i,a;return(null==e||null===(n=e.additionalDetails)||void 0===n||null===(t=n.fieldinspection_pending)||void 0===t?void 0:t.length)>0&&(o=null==e||null===(i=e.additionalDetails)||void 0===i?void 0:i.fieldinspection_pending),"FIELDINSPECTION_INPROGRESS"==e.status?(l=JSON.parse(sessionStorage.getItem("INSPECTION_DATA")),(null===(a=l)||void 0===a?void 0:a.length)>0&&l.map((e,n)=>{o.push({docs:q(e.Documents),date:e.InspectionDate,questions:K(e),time:null==e?void 0:e.InspectionTime})}),o=o.filter(e=>e.docs&&e.docs.length>0)):sessionStorage.removeItem("INSPECTION_DATA"),[...o]},Z=e=>{let n=JSON.parse(sessionStorage.getItem("BPA_DOCUMENTS")),t=[];return n.map(e=>{var n,l,o,i,a,r;(null==e||null===(n=e.uploadedDocuments)||void 0===n||null===(l=n[0])||void 0===l||null===(o=l.values)||void 0===o?void 0:o.length)>0&&(t=[...t,...null==e||null===(i=e.uploadedDocuments)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.values]),(null==e||null===(r=e.newUploadedDocs)||void 0===r?void 0:r.length)>0&&(t=[...t,...null==e?void 0:e.newUploadedDocs])}),t},$=()=>{var e;const n=Digit.SessionStorage.get("OBPS_APPROVAL_CHECKS"),t=Digit.SessionStorage.get("OBPS_NEW_APPROVALS");let l=null==n?void 0:n.reduce((e,n)=>null!=n&&n.checked?e.push(null==n?void 0:n.label)&&e:e,[]);return l=null===(e=l)||void 0===e?void 0:e.concat(null!==t?t.filter(e=>""!==e.label).map(e=>null==e?void 0:e.label):[]),l};return t.useEffect(()=>{g&&L((e=>{var n;let{t:t,action:o,approvers:i,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:v,businessService:p,error:m}=e,E=!1;return"REVOCATE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"SKIP_PAYMENT"!=o.action&&"SEND_BACK_TO_CITIZEN"!=(null==o?void 0:o.action)&&"APPROVE"!=(null==o?void 0:o.action)||(E=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+p+"_"+(null==o?void 0:o.action),cancel:"BPA_CITIZEN_CANCEL_BUTTON"},form:[{body:[{label:o.isTerminateState||E?null:t(v||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||E?null:l.createElement(a.Dropdown,{option:i,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:t("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:!0,populators:{name:"comments"}},{label:""+t("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(a.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},message:s?"1 "+t("ES_PT_ACTION_FILEUPLOADED"):t("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:m})}]}]}})({t:f,action:g,approvers:W,selectedApprover:M,setSelectedApprover:x,selectFile:G,uploadedFile:U,setUploadedFile:k,businessService:h,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:H}))},[g,W,V,U,H]),g&&b.form?l.createElement(a.Modal,{headerBarMain:l.createElement(ca,{label:f(b.label.heading)}),headerBarEnd:l.createElement(pa,{onClick:N}),actionCancelLabel:f(b.label.cancel),actionCancelOnSubmit:N,actionSaveLabel:f(b.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:Y?{width:"720px"}:{},style:Y?{minHeight:"45px",height:"auto",width:"44%"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:Y?{paddingLeft:"5px"}:{}},O?l.createElement(a.Loader,null):l.createElement(a.FormComposer,{config:b.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){try{var n,t,l,o,i,a;T=v({},T,{documents:Z(),additionalDetails:v({},null===(n=T)||void 0===n?void 0:n.additionalDetails,{fieldinspection_pending:X(T),pendingapproval:$()}),workflow:{action:null==g?void 0:g.action,comment:(null==e||null===(t=e.comments)||void 0===t?void 0:t.length)>0?null==e?void 0:e.comments:null,comments:(null==e||null===(l=e.comments)||void 0===l?void 0:l.length)>0?null==e?void 0:e.comments:null,assignee:null!=M&&M.uuid?[null==M?void 0:M.uuid]:null,assignes:null!=M&&M.uuid?[null==M?void 0:M.uuid]:null,varificationDocuments:U?[{documentType:(null==g?void 0:g.action)+" DOC",fileName:null==B?void 0:B.name,fileStoreId:U}]:null},action:null==g?void 0:g.action,comment:null==e?void 0:e.comments,assignee:null!=M&&M.uuid?[null==M?void 0:M.uuid]:null,wfDocuments:U?[{documentType:(null==g?void 0:g.action)+" DOC",fileName:null==B?void 0:B.name,fileStoreId:U}]:null});const r=null==D||null===(o=D.nocData)||void 0===o?void 0:o.map(e=>{const n=Digit.SessionStorage.get(null==e?void 0:e.nocType)||[];return{Noc:v({},e,{documents:[...null!=e&&e.documents?null==e?void 0:e.documents:[],...n||[]]})}});let u={sourceRefId:null==r||null===(i=r[0])||void 0===i||null===(a=i.Noc)||void 0===a?void 0:a.sourceRefId};return Promise.resolve(Digit.NOCSearch.all(C,u)).then(function(e){var n;let t=!0,l=!0;null==e||null===(n=e.Noc)||void 0===n||n.map(e=>{var n,o,i,a,r;"APPROVED"!==(null==e||null===(n=e.applicationStatus)||void 0===n?void 0:n.toUpperCase())&&"AUTO_APPROVED"!==(null==e||null===(o=e.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"REJECTED"!==(null==e||null===(i=e.applicationStatus)||void 0===i?void 0:i.toUpperCase())&&"AUTO_REJECTED"!==(null==e||null===(a=e.applicationStatus)||void 0===a?void 0:a.toUpperCase())&&"VOIDED"!==(null==e||null===(r=e.applicationStatus)||void 0===r?void 0:r.toUpperCase())||1!=t&&1!=l||("AIRPORT_AUTHORITY"===(null==e?void 0:e.nocType)?t=!1:"FIRE_NOC"===(null==e?void 0:e.nocType)&&(l=!1))});let o=[];r&&r.map(e=>{var n,i,a,r,u,d,s,c,v,p,m,E;("APPROVED"!=(null==e||null===(n=e.Noc)||void 0===n||null===(i=n.applicationStatus)||void 0===i?void 0:i.toUpperCase())&&"AUTO_APPROVED"!=(null==e||null===(a=e.Noc)||void 0===a||null===(r=a.applicationStatus)||void 0===r?void 0:r.toUpperCase())&&"REJECTED"!=(null==e||null===(u=e.Noc)||void 0===u||null===(d=u.applicationStatus)||void 0===d?void 0:d.toUpperCase())&&"AUTO_REJECTED"!=(null==e||null===(s=e.Noc)||void 0===s||null===(c=s.applicationStatus)||void 0===c?void 0:c.toUpperCase())&&"VOIDED"!=(null==e||null===(v=e.Noc)||void 0===v||null===(p=v.applicationStatus)||void 0===p?void 0:p.toUpperCase())&&"AIRPORT_AUTHORITY"===(null==e||null===(m=e.Noc)||void 0===m?void 0:m.nocType)&&t||"FIRE_NOC"===(null==e||null===(E=e.Noc)||void 0===E?void 0:E.nocType)&&l)&&o.push(e)}),y({BPA:T},(null==o?void 0:o.length)>0&&o,{isStakeholder:!1,bpa:!0})})}catch(e){return Promise.reject(e)}},defaultValues:R,formId:"modal-action"})):l.createElement(a.Loader,null)},Ea=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Sa=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),_a=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Sa,null)),fa=e=>{var n,o;let{t:r,action:u,tenantId:s,closeModal:c,submitAction:p,applicationData:m,businessService:E}=e;const{data:S,isLoading:_}=Digit.Hooks.useEmployeeSearch(s,{roles:null==u||null===(n=u.assigneeRoles)||void 0===n||null===(o=n.map)||void 0===o?void 0:o.call(n,e=>({code:e})),isActive:!0},{enabled:!(null!=u&&u.isTerminateState)}),[f,g]=(d.useQueryClient(),t.useState({})),[C,N]=t.useState({}),[y,D]=t.useState([]),[T,h]=t.useState({}),[A,I]=t.useState(null),[O,b]=t.useState(null),[L,R]=t.useState(null),w=!!Digit.Utils.browser.isMobile();function W(e){I(e.target.files[0])}return i.useHistory(),t.useEffect(()=>{var e;D(null==S||null===(e=S.Employees)||void 0===e?void 0:e.map(e=>{var n;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(n=e.user)||void 0===n?void 0:n.name}}))},[S]),t.useEffect(()=>{!function(){try{R(null);const e=function(){if(A){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,n=function(){if(A.size>=5242880)R(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const n=function(){if(null!=A&&A.type&&!e.test(null==A?void 0:A.type))R(r("NOT_SUPPORTED_FILE_TYPE"));else{const e=Ji(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",A,Digit.ULBService.getStateId()||(null==s?void 0:s.split(".")[0]))).then(function(e){var n,t,l,o;(null==e||null===(n=e.data)||void 0===n||null===(t=n.files)||void 0===t?void 0:t.length)>0?b(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):R(r("CS_FILE_UPLOAD_ERROR"))})},function(){R(r("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(n&&n.then)return n.then(function(){})}}();if(n&&n.then)return n.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[A]),t.useEffect(()=>{u&&g((e=>{var n;let{t:t,action:o,approvers:i,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:v,businessService:p,error:m}=e,E=!1;"REVOCATE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)||(E=!0);let S=!1;return"APPROVE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"AUTO_APPROVE"!=o.action&&"AUTO_REJECT"!=o.action||(S=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+p+"_"+(null==o?void 0:o.action),cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:o.isTerminateState||S?null:t(v||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||S?null:l.createElement(a.Dropdown,{option:i,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:t("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:E,populators:{name:"comments"}},{label:""+t("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(a.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},showHint:!0,message:s?"1 "+t("ES_PT_ACTION_FILEUPLOADED"):t("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:m})}]}]}})({t:r,action:u,approvers:y,selectedApprover:T,setSelectedApprover:h,selectFile:W,uploadedFile:O,setUploadedFile:b,businessService:E,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:L}))},[u,y,O,L]),u&&f.form?l.createElement(a.Modal,{headerBarMain:l.createElement(Ea,{label:r(f.label.heading)}),headerBarEnd:l.createElement(_a,{onClick:c}),actionCancelLabel:r(f.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:r(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:w?{width:"720px"}:{},style:w?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:w?{paddingLeft:"5px"}:{}},_?l.createElement(a.Loader,null):l.createElement(a.FormComposer,{config:f.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var n,t,l;let o=JSON.parse(sessionStorage.getItem("NewNOCDocs")),i=(null===(n=m)||void 0===n||null===(t=n.documents)||void 0===t?void 0:t.length)>0?[...null===(l=m)||void 0===l?void 0:l.documents]:[];o.map((e,n)=>{i.push(e)}),m=v({},m,{workflow:{action:null==u?void 0:u.action,comment:null!=e&&e.comments?null==e?void 0:e.comments:null,assignee:null!=T&&T.uuid?[null==T?void 0:T.uuid]:null,documents:O?[{documentType:(null==u?void 0:u.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:O}]:null},documents:i}),p({Noc:m},!1,{isNoc:!0})},defaultValues:C,formId:"modal-action"})):l.createElement(a.Loader,null)},ga=e=>l.createElement("h1",{className:"heading-m"},e.label),Ca=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Na=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Ca,null)),ya=function(e,n){void 0===n&&(n="dayend");try{const t=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),l=new Date(Date.UTC(t[1],t[2]-1,t[3]));return l.setMinutes(l.getMinutes()+l.getTimezoneOffset()),"dayend"===n&&(l.setHours(l.getHours()+24),l.setSeconds(l.getSeconds()-1)),l.getTime()}catch(n){return e}},Da=e=>{var n,o;let{t:i,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:p}=e;const{data:m,isLoading:E}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(n=r.assigneeRoles)||void 0===n||null===(o=n.map)||void 0===o?void 0:o.call(n,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[S,_]=t.useState({}),[f,g]=t.useState({}),[C,N]=t.useState([]),[y,D]=t.useState({}),[T,h]=t.useState(null),[A,I]=t.useState(null),[O,b]=t.useState(null),L=window.Digit.Utils.browser.isMobile(),R=window.location.href.includes("/employee");function w(e){h(e.target.files[0])}return t.useEffect(()=>{var e;N(null==m||null===(e=m.Employees)||void 0===e?void 0:e.map(e=>{var n;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(n=e.user)||void 0===n?void 0:n.name}}))},[m]),t.useEffect(()=>{!function(){try{b(null);const e=function(){if(T){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,n=function(){if(T.size>=5242880)b(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const n=function(){if(null!=T&&T.type&&!e.test(null==T?void 0:T.type))b(i("NOT_SUPPORTED_FILE_TYPE"));else{const e=Ji(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",T,Digit.ULBService.getCurrentTenantId())).then(function(e){var n,t,l,o;(null==e||null===(n=e.data)||void 0===n||null===(t=n.files)||void 0===t?void 0:t.length)>0?I(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):b(i("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),b(i("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(n&&n.then)return n.then(function(){})}}();if(n&&n.then)return n.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[T]),t.useEffect(()=>{var e,n,t,o;"DisconnectWSConnection"==(null===(e=c)||void 0===e||null===(n=e.processInstance)||void 0===n?void 0:n.businessService)||"DisconnectSWConnection"==(null===(t=c)||void 0===t||null===(o=t.processInstance)||void 0===o?void 0:o.businessService)?r&&_((e=>{var n;let{t:t,action:o,approvers:i,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,businessService:p,error:m}=e,E=!0,S=!1;return(null!=o&&null!==(n=o.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_DISCONNECTION"==(null==o?void 0:o.action)||"RESUBMIT_APPLICATION"==(null==o?void 0:o.action))&&(E=!1),o.isTerminateState&&(E=!1),"EXECUTE_DISCONNECTION"!=(null==o?void 0:o.action)&&"DISCONNECTION_EXECUTED"!=(null==o?void 0:o.action)||(S=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==p?void 0:p.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:E?t("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:E?t("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:E?l.createElement(a.Dropdown,{option:i,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r}):null},S&&{label:t("ES_FSM_ACTION_SERVICE_DATE"),isMandatory:!!S,type:"custom",populators:S?{name:"date",validation:{required:!0},defaultValue:Digit.Utils.date.getDate(),component:(e,n)=>l.createElement(a.DatePicker,v({onChange:e.onChange,date:e.value},n))}:null},{label:t("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:t("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(a.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:d,onDelete:()=>{c(null)},message:s?"1 "+t("ES_PT_ACTION_FILEUPLOADED"):t("CS_ACTION_NO_FILEUPLOADED"),error:m,iserror:m,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:i,action:r,approvers:C,selectedApprover:y,setSelectedApprover:D,selectFile:w,uploadedFile:A,setUploadedFile:I,businessService:p,error:O})):r&&_((e=>{var n;let{t:t,action:o,approvers:i,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,businessService:v,error:p}=e,m=!0;return(null!=o&&null!==(n=o.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_CONNECTION"==(null==o?void 0:o.action))&&(m=!1),o.isTerminateState&&(m=!1),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==v?void 0:v.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:m?t("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:m?t("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:m?l.createElement(a.Dropdown,{option:i,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r}):null},{label:t("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:t("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(a.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:d,onDelete:()=>{c(null)},message:s?"1 "+t("ES_PT_ACTION_FILEUPLOADED"):t("CS_ACTION_NO_FILEUPLOADED"),error:p,iserror:p,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:i,action:r,approvers:C,selectedApprover:y,setSelectedApprover:D,selectFile:w,uploadedFile:A,setUploadedFile:I,businessService:p,error:O}))},[r,C,A,O]),r&&S.form?l.createElement(a.Modal,{headerBarMain:l.createElement(ga,{label:i(S.label.heading)}),headerBarEnd:l.createElement(Na,{onClick:d}),actionCancelLabel:i(S.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:i(S.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:L&&R?{width:"100%",height:"auto"}:{}},E?l.createElement(a.Loader,null):l.createElement(a.FormComposer,{config:S.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var n,t,l,o,i,a,d,p,m,E;if(null!==(n=c)&&void 0!==n&&n.isBillAmend){var S,_,f,g,C,N,D,h,I;const n=v({},null===(S=c)||void 0===S||null===(_=S.billAmendmentDetails)||void 0===_?void 0:_.additionalDetails,{comments:null!=e&&e.comments?e.comments:null}),t=v({},null===(f=c)||void 0===f?void 0:f.billAmendmentDetails,{workflow:{businessId:null===(g=c)||void 0===g||null===(C=g.billAmendmentDetails)||void 0===C?void 0:C.amendmentId,action:null==r?void 0:r.action,tenantId:u,businessService:null!==(N=c)&&void 0!==N&&null!==(D=N.applicationType)&&void 0!==D&&D.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(h=c)&&void 0!==h&&null!==(I=h.applicationType)&&void 0!==I&&I.includes("WATER")?"WS":"SW",assignes:null!=y&&y.uuid?[{uuid:null==y?void 0:y.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:A?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:A}]:[]},additionalDetails:n,comment:(null==e?void 0:e.comments)||"",wfDocuments:A?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:A}]:null,processInstance:{action:null==r?void 0:r.action,assignes:null!=y&&y.uuid?[{uuid:null==y?void 0:y.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:A?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:A}]:[]}});s({AmendmentUpdate:t})}else{if(c=v({},c,{action:null==r?void 0:r.action,comment:(null==e?void 0:e.comments)||"",assignee:null!=y&&y.uuid?[null==y?void 0:y.uuid]:[],assignes:null!=y&&y.uuid?[{uuid:null==y?void 0:y.uuid}]:[],wfDocuments:A?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:A}]:null,processInstance:v({},null===(t=c)||void 0===t?void 0:t.processInstance,{action:null==r?void 0:r.action,assignes:null!=y&&y.uuid?[{uuid:null==y?void 0:y.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:A?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:A}]:[]})}),null!=e&&e.date&&null!==(l=c)&&void 0!==l&&null!==(o=l.applicationType)&&void 0!==o&&o.includes("DISCONNECT")){const n=Lt(null==e?void 0:e.date);c.disconnectionExecutionDate=ya(n)}else if(null!=e&&e.date){const n=Lt(null==e?void 0:e.date);c.connectionExecutionDate=ya(n)}var O;if("DisconnectWSConnection"==(null===(i=c)||void 0===i||null===(a=i.processInstance)||void 0===a?void 0:a.businessService)||"DisconnectSWConnection"==(null===(d=c)||void 0===d||null===(p=d.processInstance)||void 0===p?void 0:p.businessService)||window.location.href.includes("disconnection"))"WATER"==(null===(O=c)||void 0===O?void 0:O.serviceType)?s({WaterConnection:c,disconnectRequest:!0}):s({SewerageConnection:c,disconnectRequest:!0});else if("SEWERAGE_RECONNECTION"==(null===(m=c)||void 0===m?void 0:m.applicationType))s({SewerageConnection:c,disconnectRequest:!1,reconnectRequest:!0});else if("WATER_RECONNECTION"==(null===(E=c)||void 0===E?void 0:E.applicationType))s({WaterConnection:c,disconnectRequest:!1,reconnectRequest:!0});else{var b,L,R,w,W,P,M,x,B,F,U,k,H;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),n=e?JSON.parse(e):"";null!=n&&null!==(b=n.value)&&void 0!==b&&b.adhocPenalty&&(c.additionalDetails.adhocPenalty=parseInt(null==n||null===(L=n.value)||void 0===L?void 0:L.adhocPenalty)||""),null!=n&&null!==(R=n.value)&&void 0!==R&&R.adhocPenaltyComment&&(c.additionalDetails.adhocPenaltyComment=(null==n||null===(w=n.value)||void 0===w?void 0:w.adhocPenaltyComment)||""),null!=n&&null!==(W=n.value)&&void 0!==W&&W.adhocPenaltyReason&&(c.additionalDetails.adhocPenaltyReason=(null==n||null===(P=n.value)||void 0===P?void 0:P.adhocPenaltyReason)||""),null!=n&&null!==(M=n.value)&&void 0!==M&&M.adhocRebate&&(c.additionalDetails.adhocRebate=parseInt(null==n||null===(x=n.value)||void 0===x?void 0:x.adhocRebate)||""),null!=n&&null!==(B=n.value)&&void 0!==B&&B.adhocRebateComment&&(c.additionalDetails.adhocRebateComment=(null==n||null===(F=n.value)||void 0===F?void 0:F.adhocRebateComment)||""),null!=n&&null!==(U=n.value)&&void 0!==U&&U.adhocRebateReason&&(c.additionalDetails.adhocRebateReason=(null==n||null===(k=n.value)||void 0===k?void 0:k.adhocRebateReason)||""),"WATER"==(null===(H=c)||void 0===H?void 0:H.serviceType)?s({WaterConnection:c,disconnectRequest:!1,reconnectRequest:!1}):s({SewerageConnection:c,disconnectRequest:!1,reconnectRequest:!1})}}},defaultValues:f,formId:"modal-action"})):l.createElement(a.Loader,null)},Ta=e=>l.createElement("h1",{className:"heading-m"},e.label),ha=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Aa=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ha,null)),Ia=e=>{var n,o;let{t:i,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:p,moduleCode:m}=e;console.log("applicationData",c);const{data:E}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(n=r.assigneeRoles)||void 0===n||null===(o=n.map)||void 0===o?void 0:o.call(n,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[S,_]=t.useState({}),[f,g]=t.useState({}),[C,N]=t.useState([]),[y,D]=t.useState(null),[T,h]=t.useState(null),[A,I]=t.useState(null),[O,b]=t.useState(null),[L,R]=t.useState(!1);function w(e){h(e.target.files[0])}return t.useEffect(()=>{var e;N(null==E||null===(e=E.Employees)||void 0===e?void 0:e.map(e=>{var n;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(n=e.user)||void 0===n?void 0:n.name}}))},[E]),t.useEffect(()=>{!function(){try{b(null);const e=function(){if(T){const e=function(){if(T.size>=5242880)b(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Ji(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",T,Digit.ULBService.getStateId())).then(function(e){var n,t,l,o;(null==e||null===(n=e.data)||void 0===n||null===(t=n.files)||void 0===t?void 0:t.length)>0?I(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):b(i("CS_FILE_UPLOAD_ERROR"))})},function(){b(i("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[T]),t.useEffect(()=>{r&&_((e=>{let{t:n,action:t,selectFile:o,uploadedFile:i,setUploadedFile:r,businessService:u}=e;return{label:{heading:"WF_"+(null==t?void 0:t.action)+"_APPLICATION",submit:"WF_"+u+"_"+(null==t?void 0:t.action),cancel:"ES_PTR_COMMON_CANCEL"},form:[{body:[{label:n("ES_PTR_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("ES_PTR_ATTACH_FILE")+(t.docUploadRequired?" *":""),populators:l.createElement(a.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},showHint:!0,hintText:n("PTR_ATTACH_RESTRICTIONS_SIZE"),message:i?"1 "+n("ES_PTR_ACTION_FILEUPLOADED"):n("ES_PTR_ACTION_NO_FILEUPLOADED")})}]}]}})({t:i,action:r,approvers:C,selectedApprover:y,setSelectedApprover:D,selectFile:w,uploadedFile:A,setUploadedFile:I,businessService:p}))},[r,C,A]),r&&S.form?l.createElement(a.Modal,{headerBarMain:l.createElement(Ta,{label:i(S.label.heading)}),headerBarEnd:l.createElement(Aa,{onClick:d}),actionCancelLabel:i(S.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:i(S.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(a.FormComposer,{config:S.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let n={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:p,moduleName:m};A&&(n.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,filestoreId:A}]),s({PetRegistrationApplications:[v({},c,{workflow:n})]})},defaultValues:f,formId:"modal-action"})):l.createElement(a.Loader,null)},Oa=e=>l.createElement("h1",{className:"heading-m"},e.label),ba=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),La=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ba,null)),Ra=e=>{var n,o,r;let{t:u,action:d,tenantId:s,closeModal:c,submitAction:p,applicationData:m,businessService:E,moduleCode:S}=e;const{data:_}=Digit.Hooks.useEmployeeSearch(s,{roles:null==d||null===(n=d.roles)||void 0===n||null===(o=n[0])||void 0===o||null===(r=o.map)||void 0===r?void 0:r.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=d&&d.isTerminateState)}),f=i.useHistory(),[g,C]=t.useState({}),[N,y]=t.useState({}),[D,T]=t.useState([]),[h,A]=t.useState(null),[I,O]=t.useState(null);return t.useEffect(()=>{var e;T(null==_||null===(e=_.Employees)||void 0===e?void 0:e.map(e=>{var n;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(n=e.user)||void 0===n?void 0:n.name}}))},[_]),t.useEffect(()=>{"INITIATED"===(null==d?void 0:d.state)?f.push("/digit-ui/employee/asset/assetservice/edit/"+(null==m?void 0:m.applicationNo)):C((e=>{let{t:n,action:t,businessService:l}=e;return{label:{heading:"WF_"+(null==t?void 0:t.action)+"_APPLICATION",submit:"WF_"+l+"_"+(null==t?void 0:t.action),cancel:"ES_AST_COMMON_CANCEL"},form:[{body:[{label:n("AST_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:u,action:d,approvers:D,selectedApprover:h,setSelectedApprover:A,uploadedFile:I,setUploadedFile:O,businessService:E}))},[d,D,I]),d&&g.form?l.createElement(a.Modal,{headerBarMain:l.createElement(Oa,{label:u(g.label.heading)}),headerBarEnd:l.createElement(La,{onClick:c}),actionCancelLabel:u(g.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:u(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(a.FormComposer,{config:g.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let n={action:null==d?void 0:d.action,comment:null==e?void 0:e.comments,businessService:E,moduleName:S};I&&(n.documents=[]),p({Asset:v({},m,{workflow:n})})},defaultValues:N,formId:"modal-action"})):l.createElement(a.Loader,null)},wa=e=>l.createElement("h1",{className:"heading-m"},e.label),Wa=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Pa=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Wa,null)),Ma=e=>{var n,o;let{t:i,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:p,moduleCode:m}=e;const{data:E}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(n=r.assigneeRoles)||void 0===n||null===(o=n.map)||void 0===o?void 0:o.call(n,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[S,_]=t.useState({}),[f,g]=t.useState({}),[C,N]=t.useState([]),[y,D]=t.useState(null),[T,h]=t.useState(null),[A,I]=t.useState(null),[O,b]=t.useState(null),[L,R]=t.useState(!1);function w(e){h(e.target.files[0])}return t.useEffect(()=>{var e;N(null==E||null===(e=E.Employees)||void 0===e?void 0:e.map(e=>{var n;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(n=e.user)||void 0===n?void 0:n.name}}))},[E]),t.useEffect(()=>{!function(){try{b(null);const e=function(){if(T){const e=function(){if(T.size>=5242880)b(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Ji(function(){return Promise.resolve(Digit.UploadServices.Filestorage("CHB",T,u)).then(function(e){var n,t,l,o;(null==e||null===(n=e.data)||void 0===n||null===(t=n.files)||void 0===t?void 0:t.length)>0?I(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):b(i("CS_FILE_UPLOAD_ERROR"))})},function(){b(i("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[T]),t.useEffect(()=>{r&&_((e=>{let{t:n,action:t,selectFile:o,uploadedFile:i,setUploadedFile:r}=e;return{label:{heading:"CHB_"+(null==t?void 0:t.action),submit:"CHB_"+(null==t?void 0:t.action),cancel:"CS_COMMON_BACK"},form:[{body:[{label:n("ES_CHB_ACTION_COMMENTS")+" *",type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:n("ES_CHB_ATTACH_FILE")+(t.docUploadRequired?" *":""),populators:l.createElement(a.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},message:i?"1 "+n("CS_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:i,action:r,approvers:C,selectedApprover:y,setSelectedApprover:D,selectFile:w,uploadedFile:A,setUploadedFile:I,businessService:p}))},[r,C,A]),r&&S.form?l.createElement(a.Modal,{headerBarMain:l.createElement(wa,{label:i(S.label.heading)}),headerBarEnd:l.createElement(Pa,{onClick:d}),actionCancelLabel:i(S.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:i(S.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(a.FormComposer,{config:S.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let n={action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,businessService:p,moduleName:m};A&&(n.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:A}]),s({hallsBookingApplication:v({},c,{workflow:n})})},defaultValues:f,formId:"modal-action"})):l.createElement(a.Loader,null)},xa=e=>l.createElement("h1",{className:"heading-m"},e.label),Ba=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Fa=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Ba,null)),Ua=e=>{var n,o;let{t:i,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:p,moduleCode:m}=e;console.log("snjdskbjdfbjskfjkbs",r);const{data:E}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(n=r.assigneeRoles)||void 0===n||null===(o=n.map)||void 0===o?void 0:o.call(n,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[S,_]=t.useState({}),[f,g]=t.useState({}),[C,N]=t.useState([]),[y,D]=t.useState(null),[T,h]=t.useState(null),[A,I]=t.useState(null),[O,b]=t.useState(null),[L,R]=t.useState(null),[w,W]=t.useState(!1);function P(e){I(e.target.files[0])}return t.useEffect(()=>{var e;N(null==E||null===(e=E.Employees)||void 0===e?void 0:e.map(e=>{var n;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(n=e.user)||void 0===n?void 0:n.name}}))},[E]),t.useEffect(()=>{!function(){try{R(null);const e=function(){if(A){const e=function(){if(A.size>=5242880)R(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Ji(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",A,Digit.ULBService.getStateId())).then(function(e){var n,t,l,o;(null==e||null===(n=e.data)||void 0===n||null===(t=n.files)||void 0===t?void 0:t.length)>0?b(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):R(i("CS_FILE_UPLOAD_ERROR"))})},function(){R(i("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[A]),t.useEffect(()=>{r&&_((e=>{let{t:n,action:t,selectFile:o,uploadedFile:i,setUploadedFile:r,businessService:u}=e;console.log("action",t);const d=(new Date).toISOString().split("T")[0];return console.log("todayedsta ::",d),{label:{heading:"WF_"+(null==t?void 0:t.action)+"_APPLICATION",submit:"WF_"+u+"_"+(null==t?void 0:t.action),cancel:"ES_PTR_COMMON_CANCEL"},form:[{body:["COMPLETIONPENDING"===(null==t?void 0:t.state)?{label:n("EW_PICKUP_DATE"),type:"date",isMandatory:!0,populators:{name:"date",min:(new Date).toISOString().split("T")[0],max:new Date(Date.now()+6048e5).toISOString().split("T")[0]}}:"null","REQUESTCOMPLETED"===(null==t?void 0:t.state)?{label:n("ES_EW_ACTION_TRANSACTION_ID"),type:"text",isMandatory:!0,populators:{name:"transactionId"}}:"null","REQUESTCOMPLETED"===(null==t?void 0:t.state)?{label:n("ES_EW_ACTION_FINALAMOUNT"),type:"text",isMandatory:!0,populators:{name:"finalAmount"}}:"null",{label:n("ES_EW_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("ES_EW_PHOTO")+(t.docUploadRequired?" *":""),populators:l.createElement(a.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},showHint:!0,hintText:n("EW_ATTACH_RESTRICTIONS_SIZE"),message:i?"1 "+n("ES_EW_ACTION_FILEUPLOADED"):n("ES_EW_ACTION_NO_FILEUPLOADED")})}]}]}})({t:i,action:r,approvers:C,selectedApprover:y,setSelectedApprover:D,selectFile:P,uploadedFile:O,setUploadedFile:b,businessService:p}))},[r,C,O]),console.log("conggg",S),r&&S.form?l.createElement(a.Modal,{headerBarMain:l.createElement(xa,{label:i(S.label.heading)}),headerBarEnd:l.createElement(Fa,{onClick:d}),actionCancelLabel:i(S.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:i(S.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(a.FormComposer,{config:S.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let n={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:p,moduleName:m};console.log("applicationData",e),O&&(n.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==A?void 0:A.name,filestoreId:O},{}]),c.pickUpDate=null==e?void 0:e.date,c.transactionId=null==e?void 0:e.transactionId,c.finalAmount=null==e?void 0:e.finalAmount,s({EwasteApplication:[v({},c,{workflow:n})]})},defaultValues:f,formId:"modal-action"})):l.createElement(a.Loader,null)};var ka=F(function(e,t){(function(){var l=function(e){return e instanceof l?e:this instanceof l?void(this.EXIFwrapped=e):new l(e)};e.exports&&(t=e.exports=l),t.EXIF=l;var o=l.Tags={36864:"ExifVersion",40960:"FlashpixVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",37121:"ComponentsConfiguration",37122:"CompressedBitsPerPixel",37500:"MakerNote",37510:"UserComment",40964:"RelatedSoundFile",36867:"DateTimeOriginal",36868:"DateTimeDigitized",37520:"SubsecTime",37521:"SubsecTimeOriginal",37522:"SubsecTimeDigitized",33434:"ExposureTime",33437:"FNumber",34850:"ExposureProgram",34852:"SpectralSensitivity",34855:"ISOSpeedRatings",34856:"OECF",37377:"ShutterSpeedValue",37378:"ApertureValue",37379:"BrightnessValue",37380:"ExposureBias",37381:"MaxApertureValue",37382:"SubjectDistance",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37396:"SubjectArea",37386:"FocalLength",41483:"FlashEnergy",41484:"SpatialFrequencyResponse",41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:"FocalPlaneResolutionUnit",41492:"SubjectLocation",41493:"ExposureIndex",41495:"SensingMethod",41728:"FileSource",41729:"SceneType",41730:"CFAPattern",41985:"CustomRendered",41986:"ExposureMode",41987:"WhiteBalance",41988:"DigitalZoomRation",41989:"FocalLengthIn35mmFilm",41990:"SceneCaptureType",41991:"GainControl",41992:"Contrast",41993:"Saturation",41994:"Sharpness",41995:"DeviceSettingDescription",41996:"SubjectDistanceRange",40965:"InteroperabilityIFDPointer",42016:"ImageUniqueID"},i=l.TiffTags={256:"ImageWidth",257:"ImageHeight",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer",40965:"InteroperabilityIFDPointer",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",274:"Orientation",277:"SamplesPerPixel",284:"PlanarConfiguration",530:"YCbCrSubSampling",531:"YCbCrPositioning",282:"XResolution",283:"YResolution",296:"ResolutionUnit",273:"StripOffsets",278:"RowsPerStrip",279:"StripByteCounts",513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",301:"TransferFunction",318:"WhitePoint",319:"PrimaryChromaticities",529:"YCbCrCoefficients",532:"ReferenceBlackWhite",306:"DateTime",270:"ImageDescription",271:"Make",272:"Model",305:"Software",315:"Artist",33432:"Copyright"},a=l.GPSTags={0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude",5:"GPSAltitudeRef",6:"GPSAltitude",7:"GPSTimeStamp",8:"GPSSatellites",9:"GPSStatus",10:"GPSMeasureMode",11:"GPSDOP",12:"GPSSpeedRef",13:"GPSSpeed",14:"GPSTrackRef",15:"GPSTrack",16:"GPSImgDirectionRef",17:"GPSImgDirection",18:"GPSMapDatum",19:"GPSDestLatitudeRef",20:"GPSDestLatitude",21:"GPSDestLongitudeRef",22:"GPSDestLongitude",23:"GPSDestBearingRef",24:"GPSDestBearing",25:"GPSDestDistanceRef",26:"GPSDestDistance",27:"GPSProcessingMethod",28:"GPSAreaInformation",29:"GPSDateStamp",30:"GPSDifferential"},r=l.IFD1Tags={256:"ImageWidth",257:"ImageHeight",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",273:"StripOffsets",274:"Orientation",277:"SamplesPerPixel",278:"RowsPerStrip",279:"StripByteCounts",282:"XResolution",283:"YResolution",284:"PlanarConfiguration",296:"ResolutionUnit",513:"JpegIFOffset",514:"JpegIFByteCount",529:"YCbCrCoefficients",530:"YCbCrSubSampling",531:"YCbCrPositioning",532:"ReferenceBlackWhite"},u=l.StringValues={ExposureProgram:{0:"Not defined",1:"Manual",2:"Normal program",3:"Aperture priority",4:"Shutter priority",5:"Creative program",6:"Action program",7:"Portrait mode",8:"Landscape mode"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{0:"Unknown",1:"Daylight",2:"Fluorescent",3:"Tungsten (incandescent light)",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 - 5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},SensingMethod:{1:"Not defined",2:"One-chip color area sensor",3:"Two-chip color area sensor",4:"Three-chip color area sensor",5:"Color sequential area sensor",7:"Trilinear sensor",8:"Color sequential linear sensor"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},SceneType:{1:"Directly photographed"},CustomRendered:{0:"Normal process",1:"Custom process"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},GainControl:{0:"None",1:"Low gain up",2:"High gain up",3:"Low gain down",4:"High gain down"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},SubjectDistanceRange:{0:"Unknown",1:"Macro",2:"Close view",3:"Distant view"},FileSource:{3:"DSC"},Components:{0:"",1:"Y",2:"Cb",3:"Cr",4:"R",5:"G",6:"B"}};function d(e){return!!e.exifdata}function s(e){var n=new DataView(e);if(255!=n.getUint8(0)||216!=n.getUint8(1))return!1;for(var t=2,l=e.byteLength;t<l;){if(255!=n.getUint8(t))return!1;if(225==n.getUint8(t+1))return S(n,t+4,n.getUint16(t+2));t+=2+n.getUint16(t+2)}}var c={120:"caption",110:"credit",25:"keywords",55:"dateCreated",80:"byline",85:"bylineTitle",122:"captionWriter",105:"headline",116:"copyright",15:"category"};function v(e,n,t){for(var l,o,i,a,r=new DataView(e),u={},d=n;d<n+t;)28===r.getUint8(d)&&2===r.getUint8(d+1)&&(a=r.getUint8(d+2))in c&&(i=r.getInt16(d+3),o=c[a],l=E(r,d+5,i),u.hasOwnProperty(o)?u[o]instanceof Array?u[o].push(l):u[o]=[u[o],l]:u[o]=l),d++;return u}function p(e,n,t,l,o){var i,a,r=e.getUint16(t,!o),u={};for(a=0;a<r;a++)u[l[e.getUint16(i=t+12*a+2,!o)]]=m(e,i,n,0,o);return u}function m(e,n,t,l,o){var i,a,r,u,d,s,c=e.getUint16(n+2,!o),v=e.getUint32(n+4,!o),p=e.getUint32(n+8,!o)+t;switch(c){case 1:case 7:if(1==v)return e.getUint8(n+8,!o);for(i=v>4?p:n+8,a=[],u=0;u<v;u++)a[u]=e.getUint8(i+u);return a;case 2:return E(e,i=v>4?p:n+8,v-1);case 3:if(1==v)return e.getUint16(n+8,!o);for(i=v>2?p:n+8,a=[],u=0;u<v;u++)a[u]=e.getUint16(i+2*u,!o);return a;case 4:if(1==v)return e.getUint32(n+8,!o);for(a=[],u=0;u<v;u++)a[u]=e.getUint32(p+4*u,!o);return a;case 5:if(1==v)return d=e.getUint32(p,!o),s=e.getUint32(p+4,!o),(r=new Number(d/s)).numerator=d,r.denominator=s,r;for(a=[],u=0;u<v;u++)d=e.getUint32(p+8*u,!o),s=e.getUint32(p+4+8*u,!o),a[u]=new Number(d/s),a[u].numerator=d,a[u].denominator=s;return a;case 9:if(1==v)return e.getInt32(n+8,!o);for(a=[],u=0;u<v;u++)a[u]=e.getInt32(p+4*u,!o);return a;case 10:if(1==v)return e.getInt32(p,!o)/e.getInt32(p+4,!o);for(a=[],u=0;u<v;u++)a[u]=e.getInt32(p+8*u,!o)/e.getInt32(p+4+8*u,!o);return a}}function E(e,t,l){var o="";for(n=t;n<t+l;n++)o+=String.fromCharCode(e.getUint8(n));return o}function S(e,n){if("Exif"!=E(e,n,4))return!1;var t,l,d,s,c,v=n+6;if(18761==e.getUint16(v))t=!1;else{if(19789!=e.getUint16(v))return!1;t=!0}if(42!=e.getUint16(v+2,!t))return!1;var m=e.getUint32(v+4,!t);if(m<8)return!1;if((l=p(e,v,v+m,i,t)).ExifIFDPointer)for(d in s=p(e,v,v+l.ExifIFDPointer,o,t)){switch(d){case"LightSource":case"Flash":case"MeteringMode":case"ExposureProgram":case"SensingMethod":case"SceneCaptureType":case"SceneType":case"CustomRendered":case"WhiteBalance":case"GainControl":case"Contrast":case"Saturation":case"Sharpness":case"SubjectDistanceRange":case"FileSource":s[d]=u[d][s[d]];break;case"ExifVersion":case"FlashpixVersion":s[d]=String.fromCharCode(s[d][0],s[d][1],s[d][2],s[d][3]);break;case"ComponentsConfiguration":s[d]=u.Components[s[d][0]]+u.Components[s[d][1]]+u.Components[s[d][2]]+u.Components[s[d][3]]}l[d]=s[d]}if(l.GPSInfoIFDPointer)for(d in c=p(e,v,v+l.GPSInfoIFDPointer,a,t)){switch(d){case"GPSVersionID":c[d]=c[d][0]+"."+c[d][1]+"."+c[d][2]+"."+c[d][3]}l[d]=c[d]}return l.thumbnail=function(e,n,t,l){var o=function(e,n,t){var l=e.getUint16(n,!t);return e.getUint32(n+2+12*l,!t)}(e,n+t,l);if(!o)return{};if(o>e.byteLength)return{};var i=p(e,n,n+o,r,l);if(i.Compression)switch(i.Compression){case 6:i.JpegIFOffset&&i.JpegIFByteCount&&(i.blob=new Blob([new Uint8Array(e.buffer,n+i.JpegIFOffset,i.JpegIFByteCount)],{type:"image/jpeg"}));break;case 1:console.log("Thumbnail image format is TIFF, which is not implemented.");break;default:console.log("Unknown thumbnail image format '%s'",i.Compression)}else 2==i.PhotometricInterpretation&&console.log("Thumbnail image format is RGB, which is not implemented.");return i}(e,v,m,t),l}function _(e){var n={};if(1==e.nodeType){if(e.attributes.length>0){n["@attributes"]={};for(var t=0;t<e.attributes.length;t++){var l=e.attributes.item(t);n["@attributes"][l.nodeName]=l.nodeValue}}}else if(3==e.nodeType)return e.nodeValue;if(e.hasChildNodes())for(var o=0;o<e.childNodes.length;o++){var i=e.childNodes.item(o),a=i.nodeName;if(null==n[a])n[a]=_(i);else{if(null==n[a].push){var r=n[a];n[a]=[],n[a].push(r)}n[a].push(_(i))}}return n}function f(e){try{var n={};if(e.children.length>0)for(var t=0;t<e.children.length;t++){var l=e.children.item(t),o=l.attributes;for(var i in o){var a=o[i],r=a.nodeName;void 0!==r&&(n[r]=a.nodeValue)}var u=l.nodeName;if(void 0===n[u])n[u]=_(l);else{if(void 0===n[u].push){var d=n[u];n[u]=[],n[u].push(d)}n[u].push(_(l))}}else n=e.textContent;return n}catch(e){console.log(e.message)}}l.enableXmp=function(){l.isXmpEnabled=!0},l.disableXmp=function(){l.isXmpEnabled=!1},l.getData=function(e,n){return!((self.Image&&e instanceof self.Image||self.HTMLImageElement&&e instanceof self.HTMLImageElement)&&!e.complete||(d(e)?n&&n.call(e):function(e,n){function t(t){var o=s(t);e.exifdata=o||{};var i=function(e){var n=new DataView(e);if(255!=n.getUint8(0)||216!=n.getUint8(1))return!1;for(var t=2,l=e.byteLength,o=function(e,n){return 56===e.getUint8(n)&&66===e.getUint8(n+1)&&73===e.getUint8(n+2)&&77===e.getUint8(n+3)&&4===e.getUint8(n+4)&&4===e.getUint8(n+5)};t<l;){if(o(n,t)){var i=n.getUint8(t+7);return i%2!=0&&(i+=1),0===i&&(i=4),v(e,t+8+i,n.getUint16(t+6+i))}t++}}(t);if(e.iptcdata=i||{},l.isXmpEnabled){var a=function(e){if("DOMParser"in self){var n=new DataView(e);if(255!=n.getUint8(0)||216!=n.getUint8(1))return!1;for(var t=2,l=e.byteLength,o=new DOMParser;t<l-4;){if("http"==E(n,t,4)){var i=t-1,a=n.getUint16(t-2)-1,r=E(n,i,a),u=r.indexOf("xmpmeta>")+8,d=(r=r.substring(r.indexOf("<x:xmpmeta"),u)).indexOf("x:xmpmeta")+10;return r=r.slice(0,d)+'xmlns:Iptc4xmpCore="http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tiff="http://ns.adobe.com/tiff/1.0/" xmlns:plus="http://schemas.android.com/apk/lib/com.google.android.gms.plus" xmlns:ext="http://www.gettyimages.com/xsltExtension/1.0" xmlns:exif="http://ns.adobe.com/exif/1.0/" xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#" xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#" xmlns:crs="http://ns.adobe.com/camera-raw-settings/1.0/" xmlns:xapGImg="http://ns.adobe.com/xap/1.0/g/img/" xmlns:Iptc4xmpExt="http://iptc.org/std/Iptc4xmpExt/2008-02-29/" '+r.slice(d),f(o.parseFromString(r,"text/xml"))}t++}}}(t);e.xmpdata=a||{}}n&&n.call(e)}if(e.src)if(/^data\:/i.test(e.src))t(function(e,n){n=n||e.match(/^data\:([^\;]+)\;base64,/im)[1]||"",e=e.replace(/^data\:([^\;]+)\;base64,/gim,"");for(var t=atob(e),l=t.length,o=new ArrayBuffer(l),i=new Uint8Array(o),a=0;a<l;a++)i[a]=t.charCodeAt(a);return o}(e.src));else if(/^blob\:/i.test(e.src))(i=new FileReader).onload=function(e){t(e.target.result)},function(e,n){var t=new XMLHttpRequest;t.open("GET",e,!0),t.responseType="blob",t.onload=function(e){200!=this.status&&0!==this.status||i.readAsArrayBuffer(this.response)},t.send()}(e.src);else{var o=new XMLHttpRequest;o.onload=function(){if(200!=this.status&&0!==this.status)throw"Could not load image";t(o.response),o=null},o.open("GET",e.src,!0),o.responseType="arraybuffer",o.send(null)}else if(self.FileReader&&(e instanceof self.Blob||e instanceof self.File)){var i;(i=new FileReader).onload=function(e){t(e.target.result)},i.readAsArrayBuffer(e)}}(e,n),0))},l.getTag=function(e,n){if(d(e))return e.exifdata[n]},l.getIptcTag=function(e,n){if(d(e))return e.iptcdata[n]},l.getAllTags=function(e){if(!d(e))return{};var n,t=e.exifdata,l={};for(n in t)t.hasOwnProperty(n)&&(l[n]=t[n]);return l},l.getAllIptcTags=function(e){if(!d(e))return{};var n,t=e.iptcdata,l={};for(n in t)t.hasOwnProperty(n)&&(l[n]=t[n]);return l},l.pretty=function(e){if(!d(e))return"";var n,t=e.exifdata,l="";for(n in t)t.hasOwnProperty(n)&&(l+="object"==typeof t[n]?t[n]instanceof Number?n+" : "+t[n]+" ["+t[n].numerator+"/"+t[n].denominator+"]\r\n":n+" : ["+t[n].length+" values]\r\n":n+" : "+t[n]+"\r\n");return l},l.readFromBinaryFile=function(e){return s(e)}}).call(B)});const Ha=e=>l.createElement("h1",{className:"heading-m"},e.label),ja=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Va=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ja,null)),za=e=>{var n,o;let{t:r,action:u,tenantId:d,closeModal:s,submitAction:c,applicationData:p,businessService:m,moduleCode:E,vending_Zone:S,UserVendingZone:_,UserVendingZoneCode:f}=e;i.useHistory();const g=Digit.UserService.getUser().info,C=null==g?void 0:g.roles,{data:N}=Digit.Hooks.useEmployeeSearch(d,{roles:null==u||null===(n=u.assigneeRoles)||void 0===n||null===(o=n.map)||void 0===o?void 0:o.call(n,e=>({code:e})),isActive:!0},{enabled:null==u?void 0:u.isTerminateState}),[y,D]=t.useState({}),[T,h]=t.useState({}),[A,I]=t.useState([]),[O,b]=t.useState(null),[L,R]=t.useState(null),[w,W]=t.useState(null),[P,M]=t.useState(null),[x,B]=t.useState(!1),[F,U]=t.useState(),[k,H]=t.useState(),[j,V]=t.useState("");function z(e){B(!0),R(e.target.files[0])}function Y(e){return e[0]+e[1]/60+e[2]/3600}return t.useEffect(()=>{var e;I(null==N||null===(e=N.Employees)||void 0===e?void 0:e.map(e=>{var n;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(n=e.user)||void 0===n?void 0:n.name}}))},[N]),t.useEffect(()=>{!function(){try{M(null);const e=function(){if(L){(function(e){return new Promise(n=>{ka.getData(e,function(){const e=ka.getTag(this,"GPSLatitude"),t=ka.getTag(this,"GPSLongitude");if(e&&t){const l=Y(e),o=Y(t);n({latitude:l,longitude:o})}else n({latitude:null,longitude:null})})})})(L).then(e=>{let{latitude:n,longitude:t}=e;n&&t?function(e,n){try{Promise.resolve(Ji(function(){return Promise.resolve(fetch(((e,n)=>"https://nominatim.openstreetmap.org/reverse?format=json&lat="+e+"&lon="+n+"&zoom=18&addressdetails=1")(e,n))).then(function(e){if(!e.ok)throw new Error("Failed to fetch address");return Promise.resolve(e.json()).then(function(e){if(e&&e.address){var n,t,l,o,i,a,r,u;const d=[null===(n=e.address)||void 0===n?void 0:n.amenity,null===(t=e.address)||void 0===t?void 0:t.road,null===(l=e.address)||void 0===l?void 0:l.neighbourhood,null===(o=e.address)||void 0===o?void 0:o.suburb,null===(i=e.address)||void 0===i?void 0:i.city,null===(a=e.address)||void 0===a?void 0:a.state,null===(r=e.address)||void 0===r?void 0:r.postcode,null===(u=e.address)||void 0===u?void 0:u.country].filter(Boolean).join(", ");U(d)}})})},function(e){console.error("Error fetching address:",e)}))}catch(e){return Promise.reject(e)}}(n,t):console.log("No geolocation data found in the image.")});const e=function(){if(L.size>=5242880)M(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=function(e,n){try{var t=Ji(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",L,d)).then(function(e){var n,t,l,o;(null==e||null===(n=e.data)||void 0===n||null===(t=n.files)||void 0===t?void 0:t.length)>0?W(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):M(r("CS_FILE_UPLOAD_ERROR"))})},function(){M(r("CS_FILE_UPLOAD_ERROR"))})}catch(e){return n(!0,e)}return t&&t.then?t.then(n.bind(null,!1),n.bind(null,!0)):n(!1,t)}(0,function(e,n){if(B(!1),e)throw n;return n});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[L]),t.useEffect(()=>{D((e=>{let{t:n,action:o,selectFile:i,uploadedFile:r,setUploadedFile:u,approvers:d,selectedApprover:s,setSelectedApprover:c,isUploading:v,geoLocationData:p,vending_Zone:m,vendingZones:E,setvendingZones:S,UserVendingZone:_,selectApprover:f}=e;const g=()=>l.createElement("div",{className:"loading-spinner"});return{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"SV_"+(null==o?void 0:o.action),cancel:"SV_COMMON_CANCEL"},form:[{body:["APPROVE"===(null==o?void 0:o.action)||"REJECT"===(null==o?void 0:o.action)||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?"":{label:n("SV_ASSIGNEE"),type:"dropdown",populators:l.createElement(a.Dropdown,{option:d,t:n,optionKey:"name",select:c,selected:s})},(f||[]).some(e=>"TVCEMPLOYEE"===e.code||"SVCEMP"===e.code)&&{label:n("SV_CONFIRM_VENDING_ZONE"),type:"dropdown",populators:l.createElement(a.Dropdown,{option:m,t:n,optionKey:"i18nKey",select:S,selected:(e=>e?{i18nKey:e,code:e,value:e}:null)(_)||E})},{label:n("SV_ACTION_COMMENTS"),isMandatory:!0,type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:n("SV_ATTATCH_FILE")+(o.docUploadRequired?" *":""),populators:l.createElement(t.Fragment,null,l.createElement(a.UploadFile,{id:"workflow-doc-sv",onUpload:i,onDelete:()=>{u(null)},message:v?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(g,null),l.createElement("span",null,"Uploading...")):r?"1 "+n("SV_FILE_UPLOADED"):n("SV_NO_FILE")}),(f||[]).some(e=>"INSPECTIONOFFICER"===e.code)&&p&&l.createElement("div",null,l.createElement("strong",null," Location: ",p," ")))}]}]}})({t:r,action:u,approvers:A,selectedApprover:O,setSelectedApprover:b,selectFile:z,uploadedFile:w,setUploadedFile:W,businessService:m,isUploading:x,geoLocationData:F,vending_Zone:S,vendingZones:k,setvendingZones:H,UserVendingZone:_,selectApprover:C}))},[u,A,w]),u&&y.form?l.createElement(a.Modal,{headerBarMain:l.createElement(Ha,{label:r(y.label.heading)}),headerBarEnd:l.createElement(Va,{onClick:s}),actionCancelLabel:r(y.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(y.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isDisabled:(null==u?void 0:u.docUploadRequired)&&!w&&!j||!j},l.createElement(a.FormComposer,{config:y.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var n;let t={action:null==u?void 0:u.action,comments:null==e?void 0:e.comments,businessService:m,moduleName:E,assignes:"SENDBACKTOCITIZEN"===(null==u?void 0:u.action)?[null==p||null===(n=p.auditDetails)||void 0===n?void 0:n.createdBy]:null!=O&&O.uuid?[null==O?void 0:O.uuid]:null};w&&(t.documents=[{documentType:(null==u?void 0:u.action)+" DOC",fileName:null==L?void 0:L.name,fileStoreId:w}]),c({streetVendingDetail:v({},p,{vendingZone:(null==k?void 0:k.code)||f,workflow:t})})},defaultValues:T,formId:"modal-action",onFormValueChange:(e,n)=>{V(null==n?void 0:n.comments)}})):l.createElement(a.Loader,null)},Ya=e=>l.createElement("h1",{className:"heading-m"},e.label),Ga=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),qa=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Ga,null)),Ka=e=>{var n,o,a,r;let{t:u,action:d,tenantId:c,closeModal:p,submitAction:m,applicationData:E,businessService:S,moduleCode:_}=e;const{data:f}=Digit.Hooks.useEmployeeSearch(c,{roles:null==d||null===(n=d.assigneeRoles)||void 0===n||null===(o=n.map)||void 0===o?void 0:o.call(n,e=>({code:e})),isActive:!0},{enabled:!(null!=d&&d.isTerminateState)}),{data:g}=Digit.Hooks.fsm.useVendorSearch({tenantId:c,config:{enabled:"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==d?void 0:d.state)}});let C=[];null==g||null===(a=g.vendor)||void 0===a||a.map(e=>{var n,t;(null==e||null===(n=e.additionalDetails)||void 0===n?void 0:n.serviceType)===(null==E?void 0:E.bookingNo.split("-")[0])&&C.push({code:null==e?void 0:e.name,name:null==e?void 0:e.name,i18nKey:null==e?void 0:e.name,vendorId:null==e?void 0:e.id,uuid:null==e||null===(t=e.owner)||void 0===t?void 0:t.uuid})});const{data:N}=Digit.Hooks.fsm.useVehiclesSearch({tenantId:c,config:{enabled:"DELIVERY_PENDING"===(null==d?void 0:d.state)}});let y=[];null==N||null===(r=N.vehicle)||void 0===r||r.map(e=>{var n;y.push({code:null==e?void 0:e.registrationNumber,name:null==e?void 0:e.registrationNumber,i18nKey:null==e?void 0:e.registrationNumber,tankerCapacity:null==e?void 0:e.tankCapacity,vehicleId:null==e?void 0:e.id,uuid:null==e||null===(n=e.owner)||void 0===n?void 0:n.uuid})});const[D,T]=t.useState({}),[h,A]=t.useState({}),[I,O]=t.useState([]),[b,L]=t.useState(null),[R,w]=t.useState(null),[W,P]=t.useState(null),[M,x]=t.useState(null),[B,F]=t.useState(null),[U,k]=t.useState(""),H=i.useHistory();function j(e){L(e.target.files[0])}return t.useEffect(()=>{var e;O(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var n;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(n=e.user)||void 0===n?void 0:n.name}}))},[f]),t.useEffect(()=>{!function(){try{P(null);const e=function(){if(b){const e=function(){if(b.size>=5242880)P(u("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Ji(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WT",b,c)).then(function(e){var n,t,l,o;(null==e||null===(n=e.data)||void 0===n||null===(t=n.files)||void 0===t?void 0:t.length)>0?w(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):P(u("CS_FILE_UPLOAD_ERROR"))})},function(){P(u("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[b]),t.useEffect(()=>{if(d){if("PAY"===d.action){var e;const n=null===(e=E.bookingNo)||void 0===e?void 0:e.split("-")[0];let t="";switch(n){case"WT":t="request-service.water_tanker";break;case"MT":t="request-service.mobile_toilet";break;case"TP":t="request-service.tree_pruning";break;default:return void console.error("Unknown booking prefix:",n)}return H.push("/digit-ui/employee/payment/collect/"+t+"/"+E.bookingNo)}T((e=>{let{t:n,action:t,selectFile:o,uploadedFile:i,setUploadedFile:a,selectedVendor:r,setSelectedVendor:u,vendorDescription:d,vehicleDescription:c,selectVehicle:v,setSelectVehicle:p}=e;return{label:{heading:"RS_"+(null==t?void 0:t.action),submit:"RS_"+(null==t?void 0:t.action),cancel:"CS_COMMON_BACK"},form:[{body:["PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==t?void 0:t.state)?{label:n("RS_ASSIGN"),type:"dropdown",isMandatory:!0,populators:l.createElement(s.Dropdown,{option:d,t:n,optionKey:"i18nKey",select:u,selected:r})}:"null","DELIVERY_PENDING"===(null==t?void 0:t.state)?{label:n("RS_REGISTRATION_NUMBER"),isMandatory:!0,type:"dropdown",populators:l.createElement(s.Dropdown,{option:c,t:n,optionKey:"i18nKey",select:p,selected:v})}:"null",{label:n("ES_RS_ACTION_COMMENTS")+" *",type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:n("ES_RS_ATTACH_FILE")+(t.docUploadRequired?" *":""),populators:l.createElement(s.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{a(null)},message:i?"1 "+n("CS_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:u,action:d,selectFile:j,uploadedFile:R,setUploadedFile:w,selectedVendor:M,setSelectedVendor:x,vendorDescription:g?C:void 0,vehicleDescription:N?y:void 0,selectVehicle:B,setSelectVehicle:F}))}},[d,I,R,g,B,N]),d&&D.form?l.createElement(s.Modal,{headerBarMain:l.createElement(Ya,{label:u(D.label.heading)}),headerBarEnd:l.createElement(qa,{onClick:p}),actionCancelLabel:u(D.label.cancel),actionCancelOnSubmit:p,actionSaveLabel:u(D.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isDisabled:(null==d?void 0:d.docUploadRequired)&&!R&&!U||"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==d?void 0:d.state)&&!M&&!U||"DELIVERY_PENDING"===(null==d?void 0:d.state)&&!B&&!U||!U},l.createElement(s.FormComposer,{config:D.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let n,t={action:null==d?void 0:d.action,comments:null==e?void 0:e.comments,businessService:S,moduleName:_};R&&(t.documents=[{documentType:(null==d?void 0:d.action)+" DOC",fileName:null==b?void 0:b.name,fileStoreId:R}]),"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==d?void 0:d.state)&&(t.assignes=[null==M?void 0:M.uuid],E.vendorId=null==M?void 0:M.vendorId),"DELIVERY_PENDING"===(null==d?void 0:d.state)&&(E.vehicleId=null==B?void 0:B.vehicleId),n="watertanker"===S?{waterTankerBookingDetail:v({},E,{workflow:t})}:"treePruning"===S?{treePruningBookingDetail:v({},E,{workflow:t})}:{mobileToiletBookingDetail:v({},E,{workflow:t})},m(n)},defaultValues:h,formId:"modal-action",onFormValueChange:(e,n)=>{k(null==n?void 0:n.comments)}})):l.createElement(s.Loader,null)},Xa=e=>null!=e&&e.businessService.includes("PT")?l.createElement(ta,e):null!=e&&e.businessService.includes("ptr")?l.createElement(Ia,e):null!=e&&e.businessService.includes("NewTL")||null!=e&&e.businessService.includes("TL")||null!=e&&e.businessService.includes("EDITRENEWAL")||null!=e&&e.businessService.includes("DIRECTRENEWAL")?l.createElement(aa,e):null!=e&&e.moduleCode.includes("BPAREG")?l.createElement(sa,e):null!=e&&e.moduleCode.includes("BPA")?l.createElement(ma,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement(fa,e):null!=e&&e.moduleCode.includes("WS")?l.createElement(Da,e):null!=e&&e.businessService.includes("asset-create")?l.createElement(Ra,e):null!=e&&e.businessService.includes("ewst")?l.createElement(Ua,e):null!=e&&e.businessService.includes("booking-refund")?l.createElement(Ma,e):null!=e&&e.businessService.includes("street-vending")?l.createElement(za,e):null!=e&&e.businessService.includes("watertanker")||null!=e&&e.businessService.includes("mobileToilet")||null!=e&&e.businessService.includes("treePruning")?l.createElement(Ka,e):void 0;function Za(e){let{documents:n,svgStyles:t={},isSendBackFlow:i=!1,isHrLine:r=!1,titleStyles:u}=e;const{t:d}=o.useTranslation(),s=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px"}},!s&&(null==n?void 0:n.map((e,t)=>{var o;return l.createElement(l.Fragment,{key:t},null!=e&&e.title?l.createElement(a.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},d(null==e?void 0:e.title)):null,l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,n)=>{var t;return l.createElement("a",{target:"_",href:null==e?void 0:e.url,style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:n},l.createElement("div",{style:{display:"flex",justifyContent:"center"}},l.createElement(a.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"center",color:"#505A5F"}},d(null==e?void 0:e.title)),i?null!=e&&null!==(t=e.documentType)&&void 0!==t&&t.includes("NOC")?l.createElement("p",{style:{textAlign:"center"}},d(null==e?void 0:e.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},d(null==e?void 0:e.documentType)):"")}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,d("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))),r&&(null==n?void 0:n.length)!=t+1?l.createElement("hr",{style:{color:"#D6D5D4",backgroundColor:"#D6D5D4",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null)})),s&&(null==n?void 0:n.map((e,n)=>{var o;return l.createElement(l.Fragment,{key:n},null!=e&&e.title?l.createElement(a.CardSubHeader,{style:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},d(null==e?void 0:e.title)):null,l.createElement("div",null,null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,n)=>l.createElement("a",{target:"_",href:null==e?void 0:e.url,style:{minWidth:null!=t&&t.minWidth?null==t?void 0:t.minWidth:"160px",marginRight:"20px"},key:n},l.createElement("div",{style:{maxWidth:"940px",padding:"8px",borderRadius:"4px",border:"1px solid #D6D5D4",background:"#FAFAFA"}},l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",marginBottom:"10px"}},d(null==e?void 0:e.title)),null!=e&&e.docInfo?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+d(null==e?void 0:e.docInfo)):null,l.createElement(a.PDFSvg,null),l.createElement("p",{style:{marginTop:"8px",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400",textAlign:"center",color:"#505A5F"}},""+d(null==e?void 0:e.title))))):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,d("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}const $a=e=>{var n,o;let{t:i,formData:a,applicationData:r,docs:u,bpaActionsDetails:d}=e;const s=(null==r?void 0:r.status)||"",c=(null==d||null===(n=d.data)||void 0===n?void 0:n.nextActions)||[],v=Digit.ULBService.getStateId(),[p,m]=t.useState((null==a||null===(o=a.documents)||void 0===o?void 0:o.documents)||[]),[E,S]=t.useState(null),[_,f]=t.useState([]),[g,C]=t.useState(!0),[N,y]=t.useState(!1),[D,T]=t.useState(!1),{isLoading:h,data:A}=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"]),{isLoading:I,data:O}=Digit.Hooks.obps.useMDMS(v,"common-masters",["DocumentType"]);return t.useEffect(()=>{var e,n,t,l;let o=[];var i,a;null!=A&&null!==(e=A.BPA)&&void 0!==e&&e.DocTypeMapping&&(o=null==A||null===(i=A.BPA)||void 0===i||null===(a=i.DocTypeMapping)||void 0===a?void 0:a.filter(e=>{var n,t;return e.WFState==(null==r?void 0:r.status)?null==r?void 0:r.status:e.RiskType==(null==r?void 0:r.riskType)&&e.ServiceType==(null==r||null===(n=r.additionalDetails)||void 0===n?void 0:n.serviceType)&&e.applicationType==(null==r||null===(t=r.additionalDetails)||void 0===t?void 0:t.applicationType)}));let d=[];null===(n=o)||void 0===n||null===(t=n[0])||void 0===t||null===(l=t.docTypes)||void 0===l||l.forEach(e=>{var n,t,l,o;let i=e.code;e.dropdownData=[],e.uploadedDocuments=[],null==O||null===(n=O["common-masters"])||void 0===n||null===(t=n.DocumentType)||void 0===t||t.forEach(n=>{let t=n.code.slice(0,i.length);i===t&&(e.hasDropdown=!0,n.i18nKey=n.code,e.dropdownData.push(n))}),e.uploadedDocuments[0]={},e.uploadedDocuments[0].values=[],null==u||null===(l=u[0])||void 0===l||null===(o=l.values)||void 0===o||o.map(n=>{var t,l;i===(null==n||null===(t=n.documentType)||void 0===t?void 0:t.split(".")[0])+"."+(null==n||null===(l=n.documentType)||void 0===l?void 0:l.split(".")[1])&&e.uploadedDocuments[0].values.push(n)}),d.push(e)}),sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(d)),f(d)},[!h,!I]),t.useEffect(()=>{let e=0;_.map(n=>{let t=!1;p.map(e=>{n.required&&n.code==e.documentType.split(".")[0]+"."+e.documentType.split(".")[1]&&(t=!0)}),!t&&n.required&&(e+=1)}),C("0"!=e&&0!=e||!(p.length>0))},[p,N]),t.useEffect(()=>{T("DOC_VERIFICATION_INPROGRESS"===s&&(null==c?void 0:c.length)>0)},[r,d]),l.createElement("div",null,null==_?void 0:_.map((e,n)=>l.createElement("div",null,l.createElement(Ja,{key:n,index:n,document:e,t:i,error:E,setError:S,setDocuments:m,documents:p,setCheckRequiredFields:y,applicationStatus:s,actions:c,bpaTaxDocuments:_,checkEnablingDocs:D}))))};function Ja(e){var n,o;let{t:i,document:r,setDocuments:u,documents:d,index:s,bpaTaxDocuments:c,checkEnablingDocs:p}=e;const m=null==d?void 0:d.filter(e=>{var n;return null==e||null===(n=e.documentType)||void 0===n?void 0:n.includes(null==r?void 0:r.code)})[0],E=Digit.ULBService.getStateId(),[S,_]=t.useState(m?v({},m,{active:!0,code:null==m?void 0:m.documentType,i18nKey:null==m?void 0:m.documentType}):1===(null==r||null===(n=r.dropdownData)||void 0===n?void 0:n.length)?null==r?void 0:r.dropdownData[0]:{}),[f,g]=t.useState(null),[C,N]=t.useState(()=>(null==m?void 0:m.fileStoreId)||null),[y,D]=t.useState([]);return t.useEffect(()=>{null!=S&&S.code&&u(e=>{var n;const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==S?void 0:S.code));return 0===(null==C?void 0:C.length)||null===C?t:[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==C),{documentType:null==S?void 0:S.code,fileStoreId:C,documentUid:C,fileName:(null==f?void 0:f.name)||"",id:d?null===(n=d.find(e=>e.documentType===(null==S?void 0:S.code)))||void 0===n?void 0:n.id:void 0}]})},[C,S]),t.useEffect(()=>{try{y.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),r.newUploadedDocs=[],y.map(e=>{var n,t,l;null!=S&&S.code&&r.newUploadedDocs.push({documentType:null==S?void 0:S.code,fileStoreId:null==e||null===(n=e.fileStoreId)||void 0===n?void 0:n.fileStoreId,documentUid:null==e||null===(t=e.fileStoreId)||void 0===t?void 0:t.fileStoreId,tenantId:null==e||null===(l=e.fileStoreId)||void 0===l?void 0:l.tenantId})}),c[s]=r,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(c)))}catch(e){Promise.reject(e)}},[y,S]),t.useEffect(()=>{},[f]),l.createElement("div",{style:{marginBottom:"24px",maxWidth:"950px",minWidth:"280px",background:"#FAFAFA",borderRadius:"4px",border:"1px solid #D6D5D4",padding:"8px"}},l.createElement(a.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},""+i(null==r?void 0:r.code)),(null==r||null===(o=r.uploadedDocuments)||void 0===o?void 0:o.length)&&l.createElement(Za,{documents:null==r?void 0:r.uploadedDocuments,svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}}),p?l.createElement("div",{style:{marginTop:"20px"}},l.createElement(a.LabelFieldPair,{style:{width:"100%"}},l.createElement(a.CardLabel,{style:{marginTop:"-10px",width:"100%"}},null!=r&&r.required?i(null==r?void 0:r.code)+"* ":""+i(null==r?void 0:r.code)),l.createElement(a.Dropdown,{className:"form-field",t:i,isMandatory:!1,option:null==r?void 0:r.dropdownData,selected:S,optionKey:"i18nKey",select:e=>_(e),style:{width:"100%"}})),l.createElement(a.LabelFieldPair,{style:{width:"100%"}},l.createElement(a.CardLabel,{className:"card-label-smaller",style:{width:"100%"}}),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(a.MultiUploadWrapper,{module:"BPA",tenantId:E,getFormState:e=>((e,n)=>{let t=Object.fromEntries(n),l=Object.values(t);0!==Object.keys(t).length&&D(l),function(e){e&&g(e.file)}(l[l.length-1])})(0,e),t:i,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"})))):null)}function Qa(e){let{fiReport:n,isCitizen:t=!1}=e;const{t:i}=o.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginTop:"10px"}},l.createElement(t?a.CardHeader:a.CardSectionHeader,{style:{fontSize:"24px"}},""+i("BPA_FI_REPORT")),n.map((e,t)=>{var o,r,u,d,s,c;return l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px",marginBottom:"24px"}},l.createElement(a.StatusTable,null,l.createElement(a.CardSectionHeader,{style:{fontSize:"20px"}},1==(null==n?void 0:n.length)?""+i("BPA_FI_REPORT"):i("BPA_FI_REPORT")+" - "+(t+1)),l.createElement(a.Row,{className:"border-none",label:""+i("BPA_FI_DATE_LABEL"),text:null!=e&&e.date?e.date.includes("-")?(null===(o=e.date)||void 0===o?void 0:o.split("-")[2])+"/"+(null===(r=e.date)||void 0===r?void 0:r.split("-")[1])+"/"+(null===(u=e.date)||void 0===u?void 0:u.split("-")[0]):null==e?void 0:e.date:"NA"}),l.createElement(a.Row,{className:"border-none",label:""+i("BPA_FI_TIME_LABEL"),text:null!=e&&e.time?null==e?void 0:e.time:"NA"}),(null==e||null===(d=e.questions)||void 0===d?void 0:d.length)&&(null==e||null===(s=e.questions)||void 0===s?void 0:s.map(e=>l.createElement("div",{style:{background:"white",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",marginTop:"10px"}},l.createElement(a.Row,{className:"border-none",label:""+i(""+e.question),text:null!=e&&e.value?null==e?void 0:e.value:"NA"}),l.createElement(a.Row,{className:"border-none",label:""+i("BPA_ENTER_REMARKS"),text:e.remarks?e.remarks:"NA"})))),l.createElement(Za,{documents:(c=null==e?void 0:e.docs,[{title:"BPA_DOCUMENT_DETAILS_LABEL",values:null==c?void 0:c.map(e=>{var n;return{title:null==e||null===(n=e.documentType)||void 0===n?void 0:n.replaceAll(".","_"),documentType:null==e?void 0:e.documentType,documentUid:null==e?void 0:e.documentUid,fileStoreId:null==e?void 0:e.fileStoreId,id:null==e?void 0:e.id,url:null==e?void 0:e.url}})}]),svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}})))})))}function er(e){let{t:n,document:o,setNocDocuments:i,setError:r,nocDocuments:u}=e;const d=null==u?void 0:u.filter(e=>{var n;return null==e||null===(n=e.documentType)||void 0===n?void 0:n.includes(null==o?void 0:o.code)})[0],s=Digit.ULBService.getStateId(),[c,v]=t.useState(),[p,m]=t.useState(null),[E,S]=t.useState(()=>(null==d?void 0:d.fileStoreId)||null);return t.useEffect(()=>{var e,n;null!=o&&null!==(e=o.dropdownData)&&void 0!==e&&null!==(n=e[0])&&void 0!==n&&n.code&&i(e=>{var n;const t=null==e?void 0:e.filter(e=>{var n,t;return(null==e?void 0:e.documentType)!==(null==o||null===(n=o.dropdownData)||void 0===n||null===(t=n[0])||void 0===t?void 0:t.code)});return 0===(null==E?void 0:E.length)||null===E?t:[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==E),{documentType:null==o||null===(n=o.dropdownData)||void 0===n?void 0:n[0].code,fileStoreId:E,documentUid:E,fileName:(null==p?void 0:p.name)||""}]})},[E]),t.useEffect(()=>{!function(){try{r(null);const e=function(){if(p){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(p.size>=5242880)r(n("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=p&&p.type&&!e.test(null==p?void 0:p.type))r(n("NOT_SUPPORTED_FILE_TYPE"));else{const e=Ji(function(){return S(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",p,Digit.ULBService.getStateId())).then(function(e){var t,l,o,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?S(null==e||null===(o=e.data)||void 0===o||null===(i=o.files[0])||void 0===i?void 0:i.fileStoreId):r(n("CS_FILE_UPLOAD_ERROR"))})},function(){r(n("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[p]),l.createElement("div",{style:{}},l.createElement(a.LabelFieldPair,{style:{width:"98%",marginRight:"10px"}},l.createElement(a.CardLabel,{style:{width:"100%"}},null!=o&&o.required?n("TL_BUTTON_UPLOAD FILE")+"*":""+n("TL_BUTTON_UPLOAD FILE")),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(a.MultiUploadWrapper,{module:"NOC",tenantId:s,getFormState:e=>(e=>{let n=Object.fromEntries(e),t=Object.values(n);!function(e){e&&m(e.file)}(t[t.length-1])})(e),t:n,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const nr=e=>{var n;let{t:o,noc:i,docs:r,isNoc:u,applicationData:d,NOCdata:s,bpaActionsDetails:c}=e;Digit.ULBService.getStateId();const v=Digit.ULBService.getStateId(),p=(null==d?void 0:d.status)||"",m=(null==c||null===(n=c.data)||void 0===n?void 0:n.nextActions)||[],{data:E}=Digit.Hooks.obps.useMDMS(v,"NOC",["DocumentTypeMapping"],{enabled:u}),{data:S}=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"],{enabled:!u}),{data:_}=Digit.Hooks.obps.useMDMS(v,"common-masters",["DocumentType"]),[f,g]=t.useState([]),[C,N]=t.useState([]),[y,D]=t.useState(!1),[T,h]=Digit.Hooks.useSessionStorage(null==i?void 0:i.nocType,[]),[A,I]=t.useState(null),O=window.location.href.includes("/employee/");return t.useEffect(()=>{var e;g(null==_||null===(e=_["common-masters"])||void 0===e?void 0:e.DocumentType)},[_]),t.useEffect(()=>{var e,n,t;let l,o=[];var a,r,s,c;l=u?null==E||null===(a=E.NOC)||void 0===a||null===(r=a.DocumentTypeMapping)||void 0===r?void 0:r.filter(e=>(null==e?void 0:e.applicationType)===(null==i?void 0:i.applicationType)&&(null==e?void 0:e.nocType)===(null==i?void 0:i.nocType)):null==S||null===(s=S.BPA)||void 0===s||null===(c=s.DocTypeMapping)||void 0===c?void 0:c.filter(e=>{var n,t;return e.WFState==(null==d?void 0:d.status)&&e.RiskType==(null==d?void 0:d.riskType)&&e.ServiceType==(null==d||null===(n=d.additionalDetails)||void 0===n?void 0:n.serviceType)&&e.applicationType==(null==d||null===(t=d.additionalDetails)||void 0===t?void 0:t.applicationType)}),null!==(e=l)&&void 0!==e&&null!==(n=e[0])&&void 0!==n&&null!==(t=n.docTypes)&&void 0!==t&&t[0]&&(l[0].docTypes[0].nocType=l[0].nocType,l[0].docTypes[0].additionalDetails={submissionDetails:null==i?void 0:i.additionalDetails,applicationStatus:null==i?void 0:i.applicationStatus,appNumberLink:null==i?void 0:i.applicationNo,nocNo:null==i?void 0:i.nocNo},o.push(l[0].docTypes[0]));let v=[];o&&o.length>0&&(o.map(e=>{let n=e.documentType;e.dropdownData=[],null==f||f.forEach(t=>{let l=t.code.slice(0,null==n?void 0:n.length);n===l&&(e.hasDropdown=!0,e.dropdownData.push(t))}),v.push(e)}),N(v))},[E,f]),t.useEffect(()=>{D("NOC_VERIFICATION_INPROGRESS"===p&&(null==m?void 0:m.length)>0)},[d,c]),l.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px 0px 16px 8px",background:"#FAFAFA",borderRadius:"5px",marginBottom:"24px",maxWidth:"950px"}},l.createElement(a.StatusTable,null,l.createElement(a.Row,{label:O?""+o("BPA_"+(null==i?void 0:i.nocType)+"_HEADER"):o("BPA_"+(null==i?void 0:i.nocType)+"_HEADER"),labelStyle:{fontSize:"20px",width:"150%"}}),s&&s.map((e,n)=>{if(null!=e&&e.value)return l.createElement(a.Row,"STATUS"==(null==e?void 0:e.field)?{className:"border-none",label:O?""+o(null==e?void 0:e.title):o(null==e?void 0:e.title),text:o(null!=e&&e.value?null==e?void 0:e.value:"CS_NA"),textStyle:"APPROVED"==(null==e?void 0:e.value)||"AUTO_APPROVED"==(null==e?void 0:e.value)?{color:"#00703C"}:{color:"#D4351C"}}:{className:"border-none",label:O?""+o(null==e?void 0:e.title):o(null==e?void 0:e.title),text:o(null!=e&&e.value?null==e?void 0:e.value:"CS_NA")})})),l.createElement(Za,{documents:r,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),y&&(null==C?void 0:C.map((e,n)=>l.createElement(er,{key:n,document:e,t:o,error:A,setError:I,setNocDocuments:h,nocDocuments:T,checkEnablingDocs:y}))))},tr=e=>{let{permissions:n,t:o}=e;const[i,r,u]=Digit.Hooks.useSessionStorage("OBPS_APPROVAL_CHECKS",null==n?void 0:n.map(e=>({label:e,checked:!1}))),[d,s,c]=Digit.Hooks.useSessionStorage("OBPS_NEW_APPROVALS",[]);t.useEffect(()=>()=>{Digit.SessionStorage.del("OBPS_NEW_APPROVALS"),Digit.SessionStorage.del("OBPS_APPROVAL_CHECKS")},[]);const p=window.Digit.Utils.browser.isMobile();return l.createElement("div",null,l.createElement(a.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},o("BPA_PERMIT_CONDITIONS")),null==i?void 0:i.map((e,n)=>l.createElement(a.CheckBox,{key:n,styles:{margin:"20px 0 40px",maxWidth:p?"100%":"70%"},label:null==e?void 0:e.label,checked:null==e?void 0:e.checked,onChange:e=>((e,n,t)=>{const l=e.target.checked;r(()=>null==i?void 0:i.map((e,n)=>t===n?v({},e,{checked:l}):e))})(e,0,n),isLabelFirst:!0,index:n})),null==d?void 0:d.map((e,n)=>l.createElement("div",null,l.createElement(a.TextInput,{key:n,value:null==e?void 0:e.label,onChange:e=>((e,n)=>{s(()=>null==d?void 0:d.map((t,l)=>{var o;return n===l?{label:null==e||null===(o=e.target)||void 0===o?void 0:o.value}:t}))})(e,n),textInputStyle:{maxWidth:p?"96%":"830px",width:p?"96%":"830px"},style:p?{paddingRight:"10%"}:{},placeholder:o("BPA_ENTER_PERMIT_CONDITIONS_LABEL")}),l.createElement(a.LinkButton,{label:l.createElement("div",null,l.createElement("span",null,l.createElement(a.Close,{style:{float:"right",position:"relative",bottom:"32px",marginTop:"-22px",marginRight:p?"5%":"35%"}}))),style:{},onClick:e=>(e=>{const n=[...d];n.splice(e,1),s([...n])})(n)}))),l.createElement(a.LinkButton,{style:{color:"#a82227",maxWidth:p?"fit-content":"10%",marginRight:"3%"},label:o("BPA_ADD_MORE"),onClick:()=>{s([...d,{label:""}])}}))};function lr(e){let{documents:n,svgStyles:i={},isSendBackFlow:r=!1}=e;const{t:u}=o.useTranslation(),[d,s]=t.useState(()=>[]),[c,v]=(Digit.ULBService.getCurrentTenantId(),t.useState({}));t.useEffect(()=>{var e;let t=[];null==n||n.forEach((e,n,l)=>{t=[...t,...e.values?e.values:[]]}),s(null===(e=t)||void 0===e?void 0:e.map(e=>null==e?void 0:e.fileStoreId))},[n]),t.useEffect(()=>{var e;null!=d&&d.length&&"BillAmend"===(null==n||null===(e=n[0])||void 0===e?void 0:e.BS)?Digit.UploadServices.Filefetch(d,Digit.ULBService.getCurrentTenantId()).then(e=>{v(null==e?void 0:e.data)}):null!=d&&d.length&&Digit.UploadServices.Filefetch(d,Digit.ULBService.getStateId()).then(e=>{v(null==e?void 0:e.data)})},[d]);const p=window.location.href.includes("employee/tl")||window.location.href.includes("/obps")||window.location.href.includes("employee/ws"),m=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px"}},!m&&(null==n?void 0:n.map((e,n)=>{var t;return l.createElement(l.Fragment,{key:n},null!=e&&e.title?l.createElement(a.CardSubHeader,{style:p?{marginTop:"32px",marginBottom:"18px",color:"#0B0C0C, 100%",fontSize:"24px",lineHeight:"30px"}:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},u(null==e?void 0:e.title)):null,l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(t=e.values)||void 0===t?void 0:t.map((e,n)=>{var t,o;return l.createElement("a",{target:"_",href:null===(t=c[e.fileStoreId])||void 0===t?void 0:t.split(",")[0],style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto"},key:n},l.createElement("div",{style:{display:"flex",justifyContent:"center"}},l.createElement(a.PDFSvg,null)),l.createElement("p",{style:p?{marginTop:"8px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F",textAlign:"center"}:{marginTop:"8px",fontWeight:"bold"}},u(null==e?void 0:e.title)),r?null!=e&&null!==(o=e.documentType)&&void 0!==o&&o.includes("NOC")?l.createElement("p",{style:{textAlign:"center"}},u(null==e?void 0:e.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},u(null==e?void 0:e.documentType)):"")}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,u("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})),m&&(null==n?void 0:n.map((e,n)=>{var t;return l.createElement(l.Fragment,{key:n},null!=e&&e.title?l.createElement(a.CardSubHeader,{style:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},u(null==e?void 0:e.title)):null,l.createElement("div",null,null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(t=e.values)||void 0===t?void 0:t.map((e,n)=>{var t;return l.createElement("a",{target:"_",href:null===(t=c[e.fileStoreId])||void 0===t?void 0:t.split(",")[0],style:{minWidth:null!=i&&i.minWidth?null==i?void 0:i.minWidth:"160px",marginRight:"20px"},key:n},l.createElement("div",{style:{maxWidth:"940px",padding:"8px",borderRadius:"4px",border:"1px solid #D6D5D4",background:"#FAFAFA"}},l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",marginBottom:"10px"}},u(null==e?void 0:e.title)),null!=e&&e.docInfo?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+u(null==e?void 0:e.docInfo)):null,l.createElement(a.PDFSvg,null),l.createElement("p",{style:{marginTop:"8px",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},""+u(null==e?void 0:e.title))))}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,u("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}function or(e){let{taxHeadEstimatesCalculation:n}=e;const{taxHeadEstimates:t}=n,{t:i}=o.useTranslation();return l.createElement("div",{style:{marginTop:"40px"}},l.createElement(a.StatusTable,null,l.createElement(a.Row,{label:i("ES_PT_TITLE_TAX_HEADS"),text:i("ES_PT_TITLE_AMOUNT"),className:"border-none",textStyle:{fontWeight:"bold"}}),l.createElement(a.BreakLine,{style:{margin:"16px 0",width:"40%"}}),null==t?void 0:t.map((e,n)=>l.createElement(a.Row,{key:i(e.taxHeadCode),label:i(e.taxHeadCode),text:"₹ "+e.estimateAmount||"N/A",last:n===(null==t?void 0:t.length)-1,className:"border-none",textStyle:{color:"#505A5F"},labelStyle:{color:"#505A5F"}})),l.createElement(a.BreakLine,{style:{margin:"16px 0",width:"40%"}}),l.createElement(a.Row,{label:i("ES_PT_TITLE_TOTAL_DUE_AMOUNT"),text:"₹ "+(null==n?void 0:n.totalAmount)||"N/A",className:"border-none",textStyle:{fontSize:"24px",fontWeight:"bold"}})))}function ir(e){let{floors:n}=e;const{t:t}=o.useTranslation();return l.createElement(l.Fragment,null,n.map(e=>{var n;return l.createElement("div",{key:t(null==e?void 0:e.title),style:{marginTop:"19px"}},l.createElement(a.CardSubHeader,{style:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},t(null==e?void 0:e.title)),null==e||null===(n=e.values)||void 0===n?void 0:n.map((e,n)=>{var o;return l.createElement(l.Fragment,{key:n},l.createElement(a.CardSectionHeader,{style:{marginBottom:"16px",color:"#505A5F",fontSize:"16px",marginTop:0!==n?"16px":"revert"}},t(e.title)),l.createElement(a.StatusTable,{style:{position:"relative",padding:"8px"}},l.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px",marginTop:"8px",borderRadius:"4px",background:"#FAFAFA",maxWidth:"100%"}},null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,n)=>{var o;return l.createElement(a.Row,!0===e.map&&"N/A"!==e.value?{key:t(e.title),label:t(e.title),text:l.createElement("img",{src:t(e.value),alt:""})}:{key:t(e.title),label:t(e.title),text:t(e.value)||"N/A",last:n===(null==e||null===(o=e.values)||void 0===o?void 0:o.length)-1,caption:e.caption,className:"border-none"})}))))}))}))}function ar(e){let{owners:n}=e,t={};t=window.location.href.includes("/employee/pt/")?n.slice().reverse():n;const{t:i}=o.useTranslation(),r=(null==n?void 0:n.length)||1;let u={marginTop:"19px"},d={position:"relative",padding:"8px"},s={justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"};return Number(r)>1?u={marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:Number(r)>1||(u={marginTop:"19px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"},d={position:"relative",marginTop:"19px"}),window.location.href.includes("obps")&&(u=v({},u,{maxWidth:"950px"}),u=v({},u,{maxWidth:"950px"}),s={}),n.sort((e,n)=>{var t,l;return(null==e||null===(t=e.additionalDetails)||void 0===t?void 0:t.ownerSequence)-(null==n||null===(l=n.additionalDetails)||void 0===l?void 0:l.ownerSequence)}),l.createElement(l.Fragment,null,l.createElement("div",{className:"owner-details"},t.map((e,n)=>{var t;return l.createElement("div",{key:i(null==e?void 0:e.title),style:u,className:"owner-details-child"},l.createElement(a.CardSubHeader,{style:Number(r)>1?{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},Number(r)>1?i(null==e?void 0:e.title)+" "+(n+1):i(null==e?void 0:e.title)),l.createElement(l.Fragment,{key:n},l.createElement(a.StatusTable,{style:d},l.createElement("div",{style:{maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(t=e.values)||void 0===t?void 0:t.map((e,n)=>{var t;return!0===e.map&&"N/A"!==e.value?l.createElement(a.Row,{key:i(e.title),label:i(e.title),text:l.createElement("img",{src:i(e.value),alt:"",privacy:null==e?void 0:e.privacy})}):l.createElement("span",null,l.createElement(a.Row,{key:i(e.title),label:""+i(e.title),text:i(e.value)||"N/A",last:n===(null==e||null===(t=e.values)||void 0===t?void 0:t.length)-1,caption:e.caption,className:"border-none",textStyle:e.textStyle,privacy:null==e?void 0:e.privacy,rowContainerStyle:s}))}))))})))}const rr=e=>{var n,i,r;let{scrutinyDetails:u,paymentsList:d=[]}=e;const{t:s}=o.useTranslation(),c=e=>null!=e&&e.value&&null!=e&&e.isTransLate?l.createElement("span",{style:{color:"#00703C"}},s(null==e?void 0:e.value)):null!=e&&e.value&&null!=e&&e.isTransLate?s(null==e?void 0:e.value):null!=e&&e.value?null==e?void 0:e.value:void s("NA");return l.createElement(t.Fragment,null,!(null!=u&&u.isChecklist)&&l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px"}},l.createElement(a.StatusTable,null,l.createElement("div",null,null==u||null===(n=u.values)||void 0===n?void 0:n.map((e,n)=>null!=e&&e.isUnit?l.createElement(a.Row,{className:"border-none",textStyle:"Paid"===(null==e?void 0:e.value)?{color:"darkgreen"}:"Unpaid"===(null==e?void 0:e.value)?{color:"red"}:{},key:""+e.title,label:""+s(""+e.title),text:null!=e&&e.value?c(e)+" "+s(null==e?void 0:e.isUnit):s("NA"),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):null==e||!e.isHeader||null!=e&&e.isUnit?null==e||!e.isSubTitle||null!=e&&e.isUnit?l.createElement(a.Row,{className:"border-none",textStyle:"Paid"===(null==e?void 0:e.value)?{color:"darkgreen",wordBreak:"break-all"}:"Unpaid"===(null==e?void 0:e.value)?{color:"red",wordBreak:"break-all"}:{wordBreak:"break-all"},key:""+e.title,label:""+s(""+e.title),text:c(e),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):l.createElement(a.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px",margin:"0px"}},s(null==e?void 0:e.title)):l.createElement(a.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},s(null==e?void 0:e.title))),null==u||null===(i=u.permit)||void 0===i?void 0:i.map((e,n)=>l.createElement(a.CardLabel,{style:{fontWeight:"400"}},null==e?void 0:e.title))),l.createElement("div",null,null==u||null===(r=u.scruntinyDetails)||void 0===r?void 0:r.map((e,n)=>l.createElement(t.Fragment,null,l.createElement(a.Row,{className:"border-none",label:""+s(null==e?void 0:e.title),labelStyle:{width:"150%"}}),l.createElement("a",{href:null==e?void 0:e.value}," ",l.createElement(a.PDFSvg,null)," "),l.createElement("p",{style:{margin:"8px 0px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F"}},s(null==e?void 0:e.text))))))))},ur=e=>{var n,i,r,u,d,s,c,v,p;let{edcrDetails:m,applicationData:E}=e;const{t:S}=o.useTranslation(),_=window.Digit.Utils.browser.isMobile(),f=[{name:"BPA_TABLE_COL_FLOOR",id:"Floor"},{name:"BPA_TABLE_COL_LEVEL",id:"Level"},{name:"BPA_TABLE_COL_OCCUPANCY",id:"Occupancy"},{name:"BPA_TABLE_COL_BUILDUPAREA",id:"BuildupArea"},{name:"BPA_TABLE_COL_FLOORAREA",id:"FloorArea"},{name:"BPA_TABLE_COL_CARPETAREA",id:"CarpetArea"}],g=e=>{const n=e;return(e,t,l)=>e[n]},C=t.useMemo(()=>f.map(e=>({Header:S(""+e.name),accessor:g(e.id),id:e.id})));function N(e){var n;let t=[];return null==e||null===(n=e.building)||void 0===n||n.floors.map(e=>{var n,l,o,i,a,r,u,d;t.push({Floor:(null==e?void 0:e.floorName)||S("BPA_FLOOR_NAME_"+e.number),Level:(null==e?void 0:e.number)||(null==e?void 0:e.floorNo),Occupancy:S(""+("BPA-PAP"===(null==E?void 0:E.businessService)?"Residential":null===(n=e.occupancies)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.type))||"NA",BuildupArea:(null==e||null===(o=e.occupancies)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.builtUpArea)||(null==e?void 0:e.builtUpArea),FloorArea:(null==e||null===(a=e.occupancies)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.floorArea)||(null==e?void 0:e.builtUpArea),CarpetArea:(null==e||null===(u=e.occupancies)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.carpetArea)||0,key:(null==e?void 0:e.floorName)||S("BPA_FLOOR_NAME_"+e.number)})}),t}function y(e){var n;let t=null==E||null===(n=E.landInfo)||void 0===n?void 0:n.unit,l="";if((null==t?void 0:t.length)>0){var o,i;let n=null===(o=t[e])||void 0===o||null===(i=o.usageCategory)||void 0===i?void 0:i.split(",");null!=n&&n.length&&(l=n.map(e=>e?""+S("BPA_SUBOCCUPANCYTYPE_"+function(e,n,t){if(void 0===e&&(e=""),void 0===n&&(n=""),void 0===t&&(t=""),""==n)return e;for(;e.includes(n);)e=e.replace(n,t);return e}(null==e?void 0:e.toUpperCase(),"-","_")):"NA").join(", "))}return l||"NA"}return l.createElement(t.Fragment,null,l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}},l.createElement(a.StatusTable,null,null==m||null===(n=m.values)||void 0===n?void 0:n.map((e,n)=>null!=e&&e.isHeader?l.createElement(a.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},S(null==e?void 0:e.title)):l.createElement(a.Row,{className:"border-none",labelStyle:{width:"100%",fontSize:"20px"},key:""+e.title,label:""+S(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),null==m||null===(i=m.subOccupancyTableDetails)||void 0===i||null===(r=i[0])||void 0===r||null===(u=r.value)||void 0===u||null===(d=u.planDetail)||void 0===d?void 0:d.blocks.map((e,n)=>{var t,o,i,r,u;return l.createElement("div",{key:n,style:(null==m||null===(t=m.subOccupancyTableDetails)||void 0===t||null===(o=t[0])||void 0===o||null===(i=o.value)||void 0===i||null===(r=i.planDetail)||void 0===r||null===(u=r.blocks)||void 0===u?void 0:u.length)>0?{marginBottom:"30px",background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}:{marginBottom:"30px"}},l.createElement(a.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"18px",lineHeight:"19px"}},S("BPA_BLOCK_SUBHEADER")," ",n+1),l.createElement(a.StatusTable,null,l.createElement(a.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+S("BPA_SUB_OCCUPANCY_LABEL"),text:y(n)})),l.createElement("div",{style:window.location.href.includes("citizen")||_?{overflow:"scroll"}:{maxWidth:"950px",maxHeight:"280px"}},l.createElement(a.Table,{className:"customTable table-fixed-first-column table-border-style",t:S,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:N(e),columns:C,getCellProps:e=>({style:{}})})))}),null==m||null===(s=m.subOccupancyTableDetails)||void 0===s||null===(c=s[0])||void 0===c||null===(v=c.value)||void 0===v||null===(p=v.drawingDetail)||void 0===p?void 0:p.blocks.map((e,n)=>{var t,o,i,r,u;return l.createElement("div",{key:n,style:(null==m||null===(t=m.subOccupancyTableDetails)||void 0===t||null===(o=t[0])||void 0===o||null===(i=o.value)||void 0===i||null===(r=i.drawingDetail)||void 0===r||null===(u=r.blocks)||void 0===u?void 0:u.length)>0?{marginBottom:"30px",background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}:{marginBottom:"30px"}},l.createElement(a.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"18px",lineHeight:"19px"}},S("BPA_BLOCK_SUBHEADER")," ",n+1),l.createElement(a.StatusTable,null,l.createElement(a.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+S("BPA_SUB_OCCUPANCY_LABEL"),text:y(n)})),l.createElement("div",{style:window.location.href.includes("citizen")||_?{overflow:"scroll"}:{maxWidth:"950px",maxHeight:"280px"}},l.createElement(a.Table,{className:"customTable table-fixed-first-column table-border-style",t:S,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:N(e),columns:C,getCellProps:e=>({style:{}})})))})))},dr=e=>{let{headComment:n,otherComment:t}=e;return l.createElement("div",{className:"checkpoint-comments-wrap"},l.createElement("h4",null,n),l.createElement("p",null,t))},sr=e=>{var n,t,i;let{data:r,OpenImage:u,privacy:d={}}=e;const{t:s}=o.useTranslation();return l.createElement("div",null,r.date&&l.createElement("p",null,r.date),l.createElement("p",null,r.name),r.mobileNumber&&l.createElement("span",{style:{display:"inline-flex",width:"fit-content",marginLeft:"10px"}},l.createElement(a.TelePhone,{mobile:r.mobileNumber,privacy:d}),l.createElement("p",null," ")),r.source&&l.createElement("p",null,s("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+r.source.toUpperCase())),r.comment&&l.createElement(dr,{otherComment:null==r?void 0:r.otherComment,headComment:null==r?void 0:r.comment}),null!=r&&r.wfComment?l.createElement("div",null,null==r||null===(n=r.wfComment)||void 0===n?void 0:n.map(e=>l.createElement("div",{className:"TLComments"},l.createElement("h3",null,s("WF_COMMON_COMMENTS")),l.createElement("p",{style:{overflowX:"scroll"}},e)))):null,(null==r||null===(t=r.thumbnailsToShow)||void 0===t||null===(i=t.thumbs)||void 0===i?void 0:i.length)>0?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,s("CS_COMMON_ATTACHMENTS")),l.createElement(a.DisplayPhotos,{srcs:null==r?void 0:r.thumbnailsToShow.thumbs,onClick:(e,n)=>{u(e,n,null==r?void 0:r.thumbnailsToShow)}})):null)};function cr(e){let{units:n}=e;const{t:t}=o.useTranslation();return l.createElement(l.Fragment,null,n.map((e,n)=>{var o;return l.createElement("div",{key:t(null==e?void 0:e.title),style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}},l.createElement(a.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},t(null==e?void 0:e.title)+" "+(n+1)),l.createElement(l.Fragment,{key:n},l.createElement(a.StatusTable,{style:{position:"relative",marginTop:"19px"}},l.createElement("div",{style:{position:"absolute",maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,n)=>{var o;return l.createElement(a.Row,!0===e.map&&"N/A"!==e.value?{key:t(e.title),label:t(e.title),text:l.createElement("img",{src:t(e.value),alt:""})}:{key:t(e.title),label:t(e.title)+":",text:t(e.value)||"N/A",last:n===(null==e||null===(o=e.values)||void 0===o?void 0:o.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}function vr(e){let{units:n}=e;const{t:t}=o.useTranslation();return l.createElement(l.Fragment,null,n.map((e,n)=>{var o;return l.createElement("div",{key:t(null==e?void 0:e.title),style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}},l.createElement(a.CardSubHeader,{style:{marginBottom:"9px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},t(null==e?void 0:e.title)+" "+(n+1)),l.createElement(l.Fragment,{key:n},l.createElement(a.StatusTable,{style:{position:"relative",marginTop:"19px"}},l.createElement("div",{style:{position:"absolute",maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,n)=>{var o;return l.createElement(a.Row,!0===e.map&&"N/A"!==e.value?{key:t(e.title),label:t(e.title),text:l.createElement("img",{src:t(e.value),alt:""})}:{key:t(e.title),label:t(e.title)+":",text:t(e.value)||"NA",last:n===(null==e||null===(o=e.values)||void 0===o?void 0:o.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}const pr=e=>{var n,i,r,u;let{wsAdditionalDetails:d}=e;const{t:s}=o.useTranslation();let c=g(location.search);const v=null==c?void 0:c.mode;var{connectionDetails:p,plumberDetails:m,roadCuttingDetails:E,activationDetails:S}=(null==d?void 0:d.additionalDetails)||{connectionDetails:[],plumberDetails:[]};return l.createElement(t.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},(null==d||null===(n=d.additionalDetails)||void 0===n?void 0:n.connectionDetails)&&l.createElement(a.StatusTable,null,l.createElement(a.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},s("WS_COMMON_CONNECTION_DETAIL")),l.createElement("div",null,l.createElement("div",{className:"connection-details-new-value-wrapper"},null==p?void 0:p.map((e,n)=>l.createElement("div",null,l.createElement(a.Row,{className:"border-none",key:""+e.title,label:""+s(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))),(null==d||null===(i=d.additionalDetails)||void 0===i?void 0:i.plumberDetails)&&"MODIFY"!=v&&l.createElement(a.StatusTable,null,l.createElement(a.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},s("WS_COMMON_PLUMBER_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==m?void 0:m.map((e,n)=>l.createElement(a.Row,{className:"border-none",key:""+e.title,label:""+s(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:"",privacy:e.privacy}))))),(null==d||null===(r=d.additionalDetails)||void 0===r?void 0:r.roadCuttingDetails)&&"MODIFY"!=v&&l.createElement(a.StatusTable,null,l.createElement(a.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},s("WS_ROAD_CUTTING_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==E?void 0:E.map(e=>{var n;return l.createElement("div",{style:(null==E?void 0:E.length)>1?{border:"1px solid #D6D5D4",background:"#FAFAFA",borderRadius:"4px",padding:"10px 10px 0px 10px",margin:"5px 0px"}:{}},null==e||null===(n=e.values)||void 0===n?void 0:n.map(e=>l.createElement(a.Row,{className:"border-none",key:""+e.title,label:""+s(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))})))),(null==d||null===(u=d.additionalDetails)||void 0===u?void 0:u.activationDetails)&&l.createElement(a.StatusTable,null,l.createElement(a.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},s("WS_ACTIVATION_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==S?void 0:S.map((e,n)=>l.createElement(a.Row,{className:"border-none",key:""+e.title,label:""+s(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))))},mr=[{title:"PT_PENDING_DUES_FROM_EARLIER",value:"Pending dues from earlier"},{title:"PT_MISCALCULATION_OF_EARLIER_ASSESSMENT",value:"Miscalculation of earlier Assessment"},{title:"PT_ONE_TIME_PENALITY",value:"One time penality"},{title:"PT_OTHERS",value:"Others"}],Er=[{title:"PT_ADVANCED_PAID_BY_CITIZEN_EARLIER",value:"Advanced Paid By Citizen Earlier"},{title:"PT_REBATE_PROVIDED_BY_COMMISSIONER_EO",value:"Rebate provided by commissioner/EO"},{title:"PT_ADDITIONAL_AMOUNT_CHARGED_FROM_THE_CITIZEN",value:"Additional amount charged from the citizen"},{title:"PT_OTHERS",value:"Others"}],Sr=e=>{var n,i,r,u;let{wsAdditionalDetails:d}=e;const{t:s}=o.useTranslation(),[c,p,m]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[E,S,f]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),g=!(null==d||null===(n=d.additionalDetails)||void 0===n||!n.isPaid),[C,N]=t.useState(!1),[y,D]=t.useState(c||{}),[T,h]=t.useState(null),[A,I]=t.useState(d.additionalDetails.data?d.additionalDetails.data:{}),[O,b]=t.useState(d.additionalDetails.values?d.additionalDetails.values:[]),L=Digit.ULBService.getStateId();Digit.Hooks.ws.useMDMS(L,"BillingService",["TaxHeadMaster"]),t.useEffect(()=>{var e,n,t;const o=v({},null==d||null===(e=d.additionalDetails)||void 0===e||null===(n=e.appDetails)||void 0===n?void 0:n.additionalDetails);if((null==c||null===(t=c.billDetails)||void 0===t?void 0:t.length)>0){var i,a,r,u,s,m,E;const e=[{title:"WS_APPLICATION_FEE_HEADER",value:l.createElement("span",null,"₹",null==c||null===(i=c.billDetails)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.fee)},{title:"WS_SERVICE_FEE_HEADER",value:l.createElement("span",null,"₹",null==c||null===(r=c.billDetails)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.charge)},{title:"WS_TAX_HEADER",value:l.createElement("span",null,"₹",null==c||null===(s=c.billDetails)||void 0===s||null===(m=s[0])||void 0===m?void 0:m.taxAmount)}];b(e),I(null==c||null===(E=c.billDetails)||void 0===E?void 0:E[0])}else p(o),D(o)},[]);let R={};const w=e=>l.createElement("h1",{className:"heading-m"},e.label),W=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),P=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(W,null)),M=function(e,n,t){void 0===n&&(n=!1);let l=v({},y);if("adhocPenalty"!=e&&"adhocRebate"!=e||!t.target.value)n?(l[e+"_data"]=t,l[e]=t.title,"PT_OTHERS"==t.title&&"adhocPenaltyReason"==e&&(l.adhocPenaltyComment=""),"PT_OTHERS"==t.title&&"adhocRebateReason"==e&&(l.adhocRebateComment="")):l[e]=t.target.value;else{var o,i;const n=0==(null==t||null===(o=t.target)||void 0===o?void 0:o.value)?1:Math.sign(null==t||null===(i=t.target)||void 0===i?void 0:i.value)||-1;l[e]=1==n?t.target.value:""}D(l)};return l.createElement(t.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},O&&l.createElement(a.StatusTable,null,l.createElement("div",null,null==O?void 0:O.map((e,n)=>l.createElement(a.Row,{className:"border-none",key:""+e.title,label:""+s(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),l.createElement("hr",{style:{border:"1px solid #D6D5D4",color:"#D6D5D4",margin:"16px 0px"}}),l.createElement("div",null,l.createElement(a.Row,{className:"border-none",key:"WS_COMMON_TOTAL_AMT",label:""+s("WS_COMMON_TOTAL_AMT"),text:l.createElement("span",null,"₹",(null==A?void 0:A.totalAmount)||0),textStyle:{fontSize:"24px",fontWeight:"700"}}),l.createElement(a.Row,{className:"border-none",key:"CS_INBOX_STATUS_FILTER",label:""+s("CS_INBOX_STATUS_FILTER"),text:s(g?"WS_COMMON_PAID_LABEL":"WS_COMMON_NOT_PAID"),textStyle:g?{color:"#00703C"}:{color:"#D4351C"}}))),null!=d&&null!==(i=d.additionalDetails)&&void 0!==i&&i.isAdhocRebate?l.createElement("div",{onClick:e=>{N(!0)}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},s("WS_PAYMENT_ADD_REBATE_PENALTY"))):null,C&&l.createElement(a.Modal,{headerBarMain:l.createElement(w,{label:s("PT_ADD_REBATE_PENALITY")}),headerBarEnd:l.createElement(P,{onClick:()=>{D(c),N(!1)}}),actionCancelLabel:s("PT_CANCEL"),actionCancelOnSubmit:()=>{D(c),N(!1)},actionSaveLabel:s("PT_ADD"),actionSaveOnSubmit:e=>(e=>{const n=null!=y&&y.adhocPenalty?Number(null==y?void 0:y.adhocPenalty):0,t=null!=y&&y.adhocRebate?Number(null==y?void 0:y.adhocRebate):0;var l,o;if(n||t)if(t>(null==d||null===(l=d.additionalDetails)||void 0===l||null===(o=l.data)||void 0===o?void 0:o.totalAmount))h({isError:!1,isWarning:!0,key:"error",message:s("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var i,a,r,u,c,m,E,f,g,C;const e=null==d||null===(i=d.additionalDetails)||void 0===i||null===(a=i.appDetails)||void 0===a?void 0:a.applicationNo,n=null==d||null===(r=d.additionalDetails)||void 0===r||null===(u=r.appDetails)||void 0===u?void 0:u.tenantId,t=v({},null==d||null===(c=d.additionalDetails)||void 0===c||null===(m=c.appDetails)||void 0===m?void 0:m.additionalDetails,y);d.additionalDetails.appDetails.additionalDetails=t;const l={CalculationCriteria:"WATER"==(null==d||null===(E=d.additionalDetails)||void 0===E||null===(f=E.appDetails)||void 0===f?void 0:f.service)?[{applicationNo:e,tenantId:n,waterConnection:d.additionalDetails.appDetails}]:[{applicationNo:e,tenantId:n,sewerageConnection:d.additionalDetails.appDetails}],isconnectionCalculation:!1};let o="WATER"==(null==d||null===(g=d.additionalDetails)||void 0===g||null===(C=g.appDetails)||void 0===C?void 0:C.service)?"WS":"SW";Digit.WSService.wsCalculationEstimate(l,o).then((e,n)=>{var t,l,o,i,a,r,u,d,s,c,v,m,E,f,g;(null==e||null===(t=e.Calculation)||void 0===t||null===(l=t[0])||void 0===l||null===(o=l.taxHeadEstimates)||void 0===o?void 0:o.length)>0&&(null==e||null===(E=e.Calculation)||void 0===E||null===(f=E[0])||void 0===f||null===(g=f.taxHeadEstimates)||void 0===g||g.forEach(e=>e.amount=e.estimateAmount)),e.Calculation[0].billSlabData=_.groupBy(null==e||null===(i=e.Calculation)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.taxHeadEstimates,"category");const C=[{title:"WS_APPLICATION_FEE_HEADER",value:null===(r=e.Calculation)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.fee},{title:"WS_SERVICE_FEE_HEADER",value:null===(d=e.Calculation)||void 0===d||null===(s=d[0])||void 0===s?void 0:s.charge},{title:"WS_TAX_HEADER",value:null===(c=e.Calculation)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.taxAmount}];S(Lt(e.Calculation[0])),I(null==e||null===(m=e.Calculation)||void 0===m?void 0:m[0]),b(C),y.billDetails=null==e?void 0:e.Calculation,p(y),N(!1)}).catch(e=>{var n,t,l,o,i,a;h({isError:!0,isWarning:!1,key:"error",message:null!=e&&null!==(n=e.response)&&void 0!==n&&null!==(t=n.data)&&void 0!==t&&null!==(l=t.Errors[0])&&void 0!==l&&l.message?s(""+(null==e||null===(o=e.response)||void 0===o||null===(i=o.data)||void 0===i||null===(a=i.Errors[0])||void 0===a?void 0:a.code)):s("PT_COMMON_ADD_REBATE_PENALITY")})})}else h({isError:!1,isWarning:!0,key:"warning",message:s("ERR_WS_ENTER_ATLEAST_ONE_FIELD")})})(),hideSubmit:!1,popupStyles:{overflowY:"auto"}},l.createElement("div",null,l.createElement(a.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},l.createElement(a.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},s("PT_AD_PENALTY")),l.createElement(a.CardLabel,null,s("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(a.Dropdown,{isMandatory:!0,option:mr,optionKey:"title",select:e=>M("adhocPenaltyReason",!0,e),selected:(null==y?void 0:y.adhocPenaltyReason_data)||"",isPropertyAssess:!0,name:"adhocPenaltyReason_data",t:s})),"PT_OTHERS"===(null==y||null===(r=y.adhocPenaltyReason_data)||void 0===r?void 0:r.title)&&l.createElement("div",{className:"field"},l.createElement(a.CardLabel,null,s("PT_REASON")),l.createElement("div",{className:"field"},l.createElement(a.TextInput,v({style:{background:"#FAFAFA"},t:s,type:"text",isMandatory:!1,name:"adhocPenaltyComment",value:(null==y?void 0:y.adhocPenaltyComment)||"",onChange:e=>M("adhocPenaltyComment",!1,e)},R={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:s("TL_NAME_ERROR_MESSAGE")})))),l.createElement(a.CardLabel,null,s("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(a.TextInput,v({style:{background:"#FAFAFA"},t:s,type:"number",isMandatory:!1,name:"adhocPenalty",value:(null==y?void 0:y.adhocPenalty)||"",onChange:e=>M("adhocPenalty",!1,e)},R={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:s("ERR_DEFAULT_INPUT_FIELD_MSG")})))),l.createElement(a.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},l.createElement(a.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},s("PT_AD_REBATE")),l.createElement(a.CardLabel,null,s("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(a.Dropdown,{isMandatory:!0,option:Er,optionKey:"title",select:e=>M("adhocRebateReason",!0,e),selected:(null==y?void 0:y.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:s})),"PT_OTHERS"===(null==y||null===(u=y.adhocRebateReason_data)||void 0===u?void 0:u.title)&&l.createElement("div",{className:"field"},l.createElement(a.CardLabel,null,s("PT_REASON")),l.createElement(a.TextInput,v({style:{background:"#FAFAFA"},t:s,type:"text",isMandatory:!1,name:"adhocRebateComment",value:(null==y?void 0:y.adhocRebateComment)||"",onChange:e=>M("adhocRebateComment",!1,e)},R={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:s("TL_NAME_ERROR_MESSAGE")}))),l.createElement(a.CardLabel,null,s("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(a.TextInput,v({style:{background:"#FAFAFA"},t:s,type:"number",isMandatory:!1,name:"adhocRebate",value:(null==y?void 0:y.adhocRebate)||"",onChange:e=>M("adhocRebate",!1,e)},R={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:s("ERR_DEFAULT_INPUT_FIELD_MSG")})))))," "),T&&l.createElement(a.Toast,{style:{zIndex:"10000"},warning:null==T?void 0:T.isWarning,error:null==T||!T.isWarning,label:s(null==T?void 0:T.message),onClose:()=>{h(!1)},isDleteBtn:!0})))},_r=e=>{let{style:n}=e;return l.createElement("span",null,l.createElement("svg",{style:v({},n),display:"inline",width:"22",height:"16",viewBox:"0 0 22 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M11 0.5C6 0.5 1.73 3.61 0 8C1.73 12.39 6 15.5 11 15.5C16 15.5 20.27 12.39 22 8C20.27 3.61 16 0.5 11 0.5ZM11 13C8.24 13 6 10.76 6 8C6 5.24 8.24 3 11 3C13.76 3 16 5.24 16 8C16 10.76 13.76 13 11 13ZM11 5C9.34 5 8 6.34 8 8C8 9.66 9.34 11 11 11C12.66 11 14 9.66 14 8C14 6.34 12.66 5 11 5Z",fill:"#a82227"})))},fr=e=>{let{t:n,userType:t=!1,infoBannerLabel:o="",infoClickLable:i="",infoClickInfoLabel:r="",infoClickInfoLabel1:u=""}=e;t=t||Digit.SessionStorage.get("userType");const d=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement("div",{style:d?{}:{width:"80%"}},l.createElement("div",{className:"info-banner-wrap",style:{color:"#3498DB",margin:"0px"}},l.createElement("div",null,l.createElement(a.InfoBannerIcon,null),l.createElement("h2",{style:{color:"#3498DB"}},n(o))),n(i)+" ",l.createElement(_r,{style:{display:"inline",marginBottom:"5px"}})," "+n(r),l.createElement("div",null," "+n(u)))))},gr=e=>{var n,i,r,u,d,s,c;let{wsAdditionalDetails:v}=e;const{t:p}=o.useTranslation(),[m,E]=t.useState(!1),[S,_]=t.useState({}),f=e=>l.createElement("h1",{className:"heading-m"},e.label),g=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),C=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(g,null));return l.createElement(t.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},null!=v&&null!==(n=v.additionalDetails)&&void 0!==n&&n.isViewBreakup?l.createElement("div",{onClick:e=>(()=>{var e;let n=v.additionalDetails.data||{};const t=sessionStorage.getItem("Digit.ADHOC_BILL_ADD_REBATE_DATA"),l=t?JSON.parse(t):{};null!=l&&null!==(e=l.value)&&void 0!==e&&e.totalAmount&&(n=null==l?void 0:l.value),_(n),E(!0)})(),style:{marginTop:"12px"}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},p("WS_PAYMENT_VIEW_BREAKUP"))):null,m&&l.createElement(a.Modal,{headerBarMain:l.createElement(f,{label:p("WS_CALCULATION_BREAKUP")}),headerBarEnd:l.createElement(C,{onClick:()=>{E(!1)}}),hideSubmit:!0,popupStyles:{overflowY:"auto"},headerBarMainStyle:{marginBottom:"0px"},popupModuleMianStyles:{paddingTop:"0px"}},l.createElement(a.StatusTable,{style:{padding:"10px",paddingTop:"0px"}},l.createElement(a.CardSectionHeader,{style:{margin:"10px 0px"}},p("WS_APPLICATION_FEE_HEADER")),null==S||null===(i=S.billSlabData)||void 0===i||null===(r=i.FEE)||void 0===r?void 0:r.map(e=>l.createElement(a.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+p(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(a.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT1",label:""+p("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==S?void 0:S.fee)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),l.createElement(a.CardSectionHeader,{style:{margin:"10px 0px"}},p("WS_SERVICE_FEE_HEADER")),null==S||null===(u=S.billSlabData)||void 0===u||null===(d=u.CHARGES)||void 0===d?void 0:d.map(e=>l.createElement(a.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+p(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(a.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT2",label:""+p("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==S?void 0:S.charge)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),null==S||null===(s=S.billSlabData)||void 0===s||null===(c=s.TAX)||void 0===c?void 0:c.map(e=>l.createElement(a.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+p(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(a.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT3",label:""+p("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==S?void 0:S.totalAmount)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}})))))},Cr={root:{width:"100%",marginTop:"2px",overflowX:"auto",boxShadow:"none"},table:{minWidth:700,backgroundColor:"rgba(250, 250, 250, var(--bg-opacity))"},cell:{maxWidth:"7em",minWidth:"1em",border:"1px solid #e8e7e6",padding:"4px 5px",fontSize:"0.8em",textAlign:"left",lineHeight:"1.5em"},cellHeader:{overflow:"hidden",textOverflow:"ellipsis"},cellLeft:{},cellRight:{}},Nr=e=>{let{className:n="table",headers:t=[],values:i=[],arrears:a=0}=e;const{t:r}=o.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:Cr.root},l.createElement("table",{className:"table-fixed-column-common-pay",style:Cr.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:v({},Cr.cell,Cr.cellLeft,Cr.cellHeader)},r("CS_BILL_PERIOD")),t.map((e,n)=>l.createElement("th",{style:v({},Cr.cell,t.length==n+1?Cr.cellRight:{},Cr.cellHeader),key:n},r(e))))),l.createElement("tbody",null,Object.values(i).map((e,n)=>l.createElement("tr",{key:n},l.createElement("td",{style:v({},Cr.cell,Cr.cellLeft),component:"th",scope:"row"},Object.keys(i)[n]),t.map((n,o)=>l.createElement("td",{style:v({},Cr.cell,{textAlign:"left"},t.length==o+1?Cr.cellRight:{},{whiteSpace:"pre"}),key:o,numeric:!0},o>1&&"₹",e[n]&&e[n].value||"0")))),l.createElement("tr",null,l.createElement("td",{style:v({},Cr.cell,Cr.cellLeft)}),t.map((e,n)=>n==t.length-1?l.createElement("td",{style:v({},Cr.cell,Cr.cellRight,{textAlign:"left",fontWeight:"700",whiteSpace:"pre"}),key:n,numeric:!0},a):n==t.length-2?l.createElement("td",{style:v({},Cr.cell,{textAlign:"left"}),key:n,numeric:!0},r("COMMON_ARREARS_TOTAL")):l.createElement("td",{style:Cr.cell,key:n,numeric:!0})))))))},yr={buttonStyle:{display:"flex",justifyContent:"flex-end",color:"#a82227"},headerStyle:{marginTop:"10px",fontSize:"16px",fontWeight:"700",lineHeight:"24px",color:" rgba(11, 12, 12, var(--text-opacity))"}},Dr=e=>{var n,i,a;let{bill:r={}}=e;const{t:u}=o.useTranslation();let d={},s=(null==r||null===(n=r.billDetails)||void 0===n?void 0:n.sort((e,n)=>n.fromPeriod-e.fromPeriod))||[];s=[...s];const c=(null===(i=s)||void 0===i?void 0:i.reduce((e,n,t)=>0===t?e:e+n.amount,0))||0;let v="₹ "+((null==c||null===(a=c.toFixed)||void 0===a?void 0:a.call(c,0))||Number(0).toFixed(0));s.shift(),s.map(e=>{let n=function(e){var n,t,l;void 0===e&&(e={});let o={};const{billAccountDetails:i=[]}=e;return i.map(e=>{o[e.taxHeadCode]={value:e.amount,order:e.order}}),o.CS_BILL_NO={value:(null===(n=e)||void 0===n?void 0:n.billNumber)||"NA",order:-2},o.CS_BILL_DUEDATE={value:(null===(t=e)||void 0===t?void 0:t.expiryDate)&&new Date(null===(l=e)||void 0===l?void 0:l.expiryDate).toLocaleDateString()||"NA",order:-1},o.TL_COMMON_TOTAL_AMT={value:e.amount,order:10},o}(e);d[((e,n)=>{const t=new Date(e),l=new Date(n);return l.getYear()-t.getYear()!=0?"FY"+(t.getYear()+1900)+"-"+(l.getYear()-100):t.toLocaleDateString()+"-"+l.toLocaleDateString()})(e.fromPeriod,e.toPeriod)]=n});let p={};!d||Object.keys(d).map((e,n)=>{Object.keys(d[e]).map(n=>{p[n]=d[e]&&d[e][n]&&d[e][n].order||0})});let m=[];m=Object.keys(p),m.sort((e,n)=>p[e]-p[n]);const[E,S]=t.useState(!1);return 0==c||c<0?l.createElement("span",null):l.createElement(l.Fragment,null,l.createElement("div",{style:yr.headerStyle},u("CS_ARREARS_DETAILS")),E&&l.createElement(Nr,{headers:[...m],values:d,arrears:v}),!E&&l.createElement("div",{style:yr.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{S(!0)}},u("CS_SHOW_CARD"))),E&&l.createElement("div",{style:yr.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{S(!1)}},u("CS_HIDE_CARD"))))},Tr=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),hr=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Tr,null)),Ar=e=>{let{t:n,closeModal:t}=e;console.log(" ----- Renew POP coming "),Digit.Hooks.sv.useCreateDemand();const o=i.useHistory();return l.createElement(l.Fragment,null,l.createElement(s.Modal,{headerBarMain:l.createElement(e=>l.createElement("h1",{className:"heading-m"},e.label),{label:"SV_WANT_TO_EDIT"}),headerBarEnd:l.createElement(hr,{onClick:t}),actionCancelLabel:n("CS_COMMON_BACK"),actionCancelOnSubmit:t,hideSubmit:!0,formId:"modal-action"},l.createElement(s.Card,{style:{boxShadow:"none"}},l.createElement("div",{style:{display:"flex",justifyContent:"center",gap:"20px",flexDirection:"column",alignItems:"center"}},l.createElement(s.SubmitBar,{label:n("SV_YES_PROCEED_WITH_APPLICATION"),onSubmit:()=>{o.push("renew-application/info")}}),l.createElement(s.SubmitBar,{label:n("SV_NO_PROCEED_PAYEMNT"),onSubmit:()=>{console.log(" testing coming compilter"),o.push("renew-application/check/makePayment")}})))))};function Ir(e){var n,r,u,d,s,c,v,p,m,E,S,f,g,C,N;let{applicationDetails:y,workflowDetails:D,isDataLoading:T,applicationData:h,timelineStatusPrefix:A,showTimeLine:I=!0,statusAttribute:O="status",paymentsList:b,oldValue:L,isInfoLabel:R=!1}=e;const{t:w}=o.useTranslation(),W=(i.useHistory(),i.useLocation()),[P,M]=t.useState(!1),[x,B]=t.useState(null);new URLSearchParams(W.search);let{id:F}=i.useParams();const U=null==y||null===(n=y.applicationData)||void 0===n?void 0:n.owners;function k(e,n,t){var l;window.open(null==t||null===(l=t.fullImage)||void 0===l?void 0:l[0],"_blank")}console.log("ownersSequences:- ",U);const[H,j]=t.useState({}),[V,z]=t.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==h?void 0:h.status)||V.loading||V.loaded||V.canLoad||z({loading:!1,loaded:!1,canLoad:!0}),null==V||!V.canLoad||V.loading||V.loaded||(z({loading:!0,loaded:!1,canLoad:!0}),function(e,n,t,l){try{Promise.resolve(Digit.PTService.assessmentSearch({tenantId:e,filters:{propertyIds:n}})).then(function(o){function i(){t(a),l({loading:!1,loaded:!0,canLoad:!0})}let a={};const r=function(t){if((null==o||null===(t=o.Assessments)||void 0===t?void 0:t.length)>0)return Promise.resolve(Digit.PaymentService.fetchBill(e,{businessService:"PT",consumerCode:n})).then(function(e){a=e})}();return r&&r.then?r.then(i):i()})}catch(e){return Promise.reject(e)}}((null==h?void 0:h.tenantId)||tenantId,null==h?void 0:h.propertyId,j,z));const Y=e=>{if(null==e||null==e||""==e)return"NA";const n=new Date(e);let t=n.getMonth()+1,l=n.getDate();return t=(t>9?"":"0")+t,l=(l>9?"":"0")+l,l+"/"+t+"/"+n.getFullYear()},G=function(e,n,t){if(void 0===n&&(n=0),"OPEN"===e.state||"INITIATED"===e.status&&!window.location.href.includes("/obps/")){var o;const e={date:Y(null==h||null===(o=h.auditDetails)||void 0===o?void 0:o.createdTime),source:(null==h?void 0:h.channel)||""};return l.createElement(sr,{data:e})}if(window.location.href.includes("/obps/")||window.location.href.includes("/noc/")||window.location.href.includes("/ws/")){var i,a,r,u,d,s,c,v,p,m,E,S,f,g,C,N,D,T;const o={uuid:null==e||null===(i=e.assignes)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.uuid,fieldName:"mobileNumber",model:"User",showValue:!1,loadData:{serviceName:"/egov-workflow-v2/egov-wf/process/_search",requestBody:{},requestParam:{tenantId:null==y?void 0:y.tenantId,businessIds:null==y?void 0:y.applicationNo,history:!0},jsonPath:"ProcessInstances[0].assignes[0].mobileNumber",isArray:!1,d:e=>{let t="";return t="+91 "+_.get(e,"ProcessInstances["+n+"].assignes[0].mobileNumber"),t}}},A=t&&t[n-1]&&(null==t?void 0:t[n-1]),I={date:null==e||null===(r=e.auditDetails)||void 0===r?void 0:r.lastModified,name:null==e||null===(u=e.assignes)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.name,mobileNumber:(null==h||null===(s=h.processInstance)||void 0===s||null===(c=s.assignes)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.uuid)===(null==e||null===(p=e.assignes)||void 0===p||null===(m=p[0])||void 0===m?void 0:m.uuid)&&null!=h&&null!==(E=h.processInstance)&&void 0!==E&&null!==(S=E.assignes)&&void 0!==S&&null!==(f=S[0])&&void 0!==f&&f.mobileNumber?null==h||null===(g=h.processInstance)||void 0===g||null===(C=g.assignes)||void 0===C||null===(N=C[0])||void 0===N?void 0:N.mobileNumber:null==e||null===(D=e.assignes)||void 0===D||null===(T=D[0])||void 0===T?void 0:T.mobileNumber,comment:w(e&&(null==e?void 0:e.comment)),wfComment:A?A&&A.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(sr,{data:I,OpenImage:k,privacy:o})}{var A,I,O,b,L;const n={date:Y(null==h||null===(A=h.auditDetails)||void 0===A?void 0:A.lastModifiedTime),name:null==e||null===(I=e.assignes)||void 0===I||null===(O=I[0])||void 0===O?void 0:O.name,wfComment:null==e?void 0:e.wfComment,mobileNumber:null==e||null===(b=e.assignes)||void 0===b||null===(L=b[0])||void 0===L?void 0:L.mobileNumber,thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(sr,{data:n,OpenImage:k})}},q=(e,n)=>e?n?e:w(e):w("NA"),K=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),X=window.location.href.includes("employee/noc"),Z=window.location.href.includes("employee/obps"),$=(window.location.href.includes("employee/ws"),()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||K?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{}),J=e=>{if(null!=e&&e.isTimeValue&&null!=e&&e.value){const n=e.value,[t,l]=n.split(":").map(e=>parseInt(e,10));if(!isNaN(t)&&!isNaN(l)){const e=t>=12?"PM":"AM";return(t%12||12)+":"+String(l).padStart(2,"0")+" "+e}return e.value}return null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?q(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)+" "+w(null==e?void 0:e.isUnit):w("N/A"):null!=e&&e.value?q(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):w("N/A")},[Q,ee]=t.useState(!1);return l.createElement(a.Card,{style:{position:"relative"},className:"employeeCard-override"},R?l.createElement(fr,{t:w,userType:!1,infoBannerLabel:"CS_FILE_APPLICATION_INFO_LABEL",infoClickLable:"WS_CLICK_ON_LABEL",infoClickInfoLabel:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO_LABEL":"WS_CLICK_ON_INFO_LABEL",infoClickInfoLabel1:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO1_LABEL":""}):null,null==y||null===(r=y.applicationDetails)||void 0===r?void 0:r.map((e,n)=>{var t,o,r,u,d,s,c,v,p,m,E,S,_,f,g,C,N,T,h,A,I,O,R,W,P,x,U,k,j,V,z,Y,G,q,Q,ee,ne,te,le;return l.createElement(l.Fragment,{key:n},l.createElement("div",{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||window.location.href.includes("employee/ws")?{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}:K?{lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:{}},0!==n||e.asSectionHeader?l.createElement(l.Fragment,null,l.createElement(a.CardSectionHeader,{style:0==n&&K?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},X?""+w(e.title):w(e.title),null!=e&&e.Component?l.createElement(e.Component,null):null)):l.createElement(a.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},w(e.title)),(null==e?void 0:e.isTable)&&l.createElement("table",{style:{tableLayout:"fixed",width:"100%",borderCollapse:"collapse",borderCollapse:"collapse",border:"1px solid black"}},l.createElement("tr",{style:{textAlign:"left"}},null==e?void 0:e.headers.map(e=>l.createElement("th",{style:{padding:"10px",paddingLeft:"5px",border:"1px solid black"}},w(e)))),null==e?void 0:e.tableRows.map((n,t)=>l.createElement("tr",null,n.map((n,o)=>Array.isArray(n)&&n.length>1&&!0===e.isMaintenance?l.createElement("td",{style:{paddingTop:"20px",textAlign:"left",border:"1px solid black",verticalAlign:"middle"},key:o},l.createElement("div",{style:{display:"flex",flexWrap:"nowrap",gap:"5px"}},n.map((e,n)=>l.createElement("a",{key:n,onClick:()=>{Digit.UploadServices.Filefetch([e.fileStoreId],Digit.ULBService.getStateId()).then(e=>{var n,t,l;console.log("Response of file:",e);const o=null==e||null===(n=e.data)||void 0===n||null===(t=n.fileStoreIds)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.url;if(o){const e=o.split(",")[0];e?window.open(e,"_blank"):console.error("No valid URL found to open!")}else console.error("URL is missing in the response!")}).catch(e=>{console.error("Error fetching file:",e)})},rel:"noopener noreferrer",style:{marginRight:"5px",display:"inline-block",cursor:"pointer"}},l.createElement(a.PDFSvg,{style:{width:"25px",height:"25px"}}))))):l.createElement("td",{key:o,style:{paddingTop:"20px",textAlign:"left",border:"1px solid black",verticalAlign:"middle"}},console.log("Comming Maintainaince data row:- ",n.data),n&&!0===n.editButton?l.createElement("span",{style:{display:"inline-flex",gap:"10px",alignItems:"center"}},l.createElement(i.Link,{to:{pathname:"/digit-ui/employee/asset/assetservice/maintenance-edit/"+F,state:{data:n.data}}},l.createElement("button",null," ",l.createElement(a.EditIcon,null)," ")),l.createElement("div",{key:t,onClick:()=>(B(n.data),void M(!0)),style:{cursor:"pointer"}},l.createElement(a.ViewsIcon,null))):w(n)))))),l.createElement(a.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||K?{position:"relative",marginTop:"19px"}:{}},(null==e?void 0:e.title)&&!(null!=e&&e.title.includes("NOC"))&&(null==e||null===(t=e.values)||void 0===t?void 0:t.map((n,t)=>{var o,r,u;return!0===n.map&&"N/A"!==n.value?l.createElement(a.Row,{labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"},key:w(n.title),label:w(n.title),text:l.createElement("img",{src:w(n.value),alt:"",privacy:null==n?void 0:n.privacy})}):1==(null==n?void 0:n.isLink)?l.createElement(a.Row,{key:w(n.title),label:window.location.href.includes("tl")||window.location.href.includes("ws")?l.createElement("div",{style:{width:"200%"}},l.createElement(i.Link,{to:null==n?void 0:n.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},w(null==n?void 0:n.title)))):X||Z?""+w(n.title):w(n.title),text:l.createElement("div",null,l.createElement(i.Link,{to:null==n?void 0:n.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==n?void 0:n.value))),last:t===(null==e||null===(u=e.values)||void 0===u?void 0:u.length)-1,caption:n.caption,className:"border-none",rowContainerStyle:$(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):l.createElement("div",null,window.location.href.includes("modify")?l.createElement(a.Row,{className:"border-none",key:""+n.title,label:""+w(""+n.title),privacy:null==n?void 0:n.privacy,text:null!=n&&n.oldValue?null==n?void 0:n.oldValue:null!=n&&n.value?null==n?void 0:n.value:"",labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):l.createElement(a.Row,{key:w(n.title),label:w(n.title),text:J(n),last:t===(null==e||null===(o=e.values)||void 0===o?void 0:o.length)-1,caption:n.caption,className:"border-none",privacy:null==n?void 0:n.privacy,rowContainerStyle:$(),labelStyle:{wordBreak:"break-all",fontWeight:n.isBold?"bold":"normal",fontStyle:n.isBold?"italic":"normal"},textStyle:{wordBreak:"break-all",fontWeight:n.isBold?"bold":"normal",fontStyle:n.isBold?"italic":"normal"}}),"PT_TOTAL_DUES"===n.title?l.createElement(Dr,{bill:null===(r=H.Bill)||void 0===r?void 0:r[0]}):"")})))),(null==e?void 0:e.belowComponent)&&l.createElement(e.belowComponent,null),(null==e||null===(o=e.additionalDetails)||void 0===o?void 0:o.inspectionReport)&&l.createElement(rr,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:b}),(null==y||null===(r=y.applicationData)||void 0===r||null===(u=r.additionalDetails)||void 0===u||null===(d=u.fieldinspection_pending)||void 0===d?void 0:d.length)>0&&(null==e||null===(s=e.additionalDetails)||void 0===s?void 0:s.fiReport)&&l.createElement(Qa,{fiReport:null==y||null===(c=y.applicationData)||void 0===c||null===(v=c.additionalDetails)||void 0===v?void 0:v.fieldinspection_pending}),(null==e||null===(p=e.additionalDetails)||void 0===p?void 0:p.floors)&&l.createElement(ir,{floors:null==e||null===(m=e.additionalDetails)||void 0===m?void 0:m.floors}),(null==e||null===(E=e.additionalDetails)||void 0===E?void 0:E.owners)&&l.createElement(ar,{owners:null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.owners}),(null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.units)&&l.createElement(vr,{units:null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.units}),(null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.accessories)&&l.createElement(cr,{units:null==e||null===(C=e.additionalDetails)||void 0===C?void 0:C.accessories}),(null==e||null===(N=e.additionalDetails)||void 0===N?void 0:N.permissions)&&(null==D||null===(T=D.data)||void 0===T||null===(h=T.nextActions)||void 0===h?void 0:h.length)>0&&l.createElement(tr,{applicationData:null==y?void 0:y.applicationData,t:w,permissions:null==e||null===(A=e.additionalDetails)||void 0===A?void 0:A.permissions}),(null==e||null===(I=e.additionalDetails)||void 0===I?void 0:I.obpsDocuments)&&l.createElement($a,{t:w,applicationData:null==y?void 0:y.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:D}),(null==e||null===(O=e.additionalDetails)||void 0===O?void 0:O.noc)&&l.createElement(nr,{t:w,isNoc:!0,NOCdata:e.values,applicationData:null==y?void 0:y.applicationData,docs:e.additionalDetails.noc,noc:null===(R=e.additionalDetails)||void 0===R?void 0:R.data,bpaActionsDetails:D}),(null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.scruntinyDetails)&&l.createElement(rr,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(P=e.additionalDetails)||void 0===P?void 0:P.buildingExtractionDetails)&&l.createElement(rr,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(x=e.additionalDetails)||void 0===x?void 0:x.subOccupancyTableDetails)&&l.createElement(ur,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==y?void 0:y.applicationData}),(null==e||null===(U=e.additionalDetails)||void 0===U?void 0:U.documentsWithUrl)&&l.createElement(Za,{documents:null==e||null===(k=e.additionalDetails)||void 0===k?void 0:k.documentsWithUrl}),(null==e||null===(j=e.additionalDetails)||void 0===j?void 0:j.documents)&&l.createElement(lr,{documents:null==e||null===(V=e.additionalDetails)||void 0===V?void 0:V.documents}),(null==e||null===(z=e.additionalDetails)||void 0===z?void 0:z.taxHeadEstimatesCalculation)&&l.createElement(or,{taxHeadEstimatesCalculation:null==e||null===(Y=e.additionalDetails)||void 0===Y?void 0:Y.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&l.createElement(pr,{wsAdditionalDetails:e,oldValue:L}),(null==e||null===(G=e.additionalDetails)||void 0===G?void 0:G.redirectUrl)&&l.createElement("div",{style:{fontSize:"16px",lineHeight:"24px",fontWeight:"400",padding:"10px 0px"}},l.createElement(i.Link,{to:null==e||null===(q=e.additionalDetails)||void 0===q||null===(Q=q.redirectUrl)||void 0===Q?void 0:Q.url},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==e||null===(ee=e.additionalDetails)||void 0===ee||null===(ne=ee.redirectUrl)||void 0===ne?void 0:ne.title))),(null==e||null===(te=e.additionalDetails)||void 0===te?void 0:te.estimationDetails)&&l.createElement(Sr,{wsAdditionalDetails:e,workflowDetails:D}),(null==e||null===(le=e.additionalDetails)||void 0===le?void 0:le.estimationDetails)&&l.createElement(gr,{wsAdditionalDetails:e,workflowDetails:D}))}),I&&(null==D||null===(u=D.data)||void 0===u||null===(d=u.timeline)||void 0===d?void 0:d.length)>0&&l.createElement(l.Fragment,null,l.createElement(a.BreakLine,null),((null==D?void 0:D.isLoading)||T)&&l.createElement(a.Loader,null),!(null!=D&&D.isLoading)&&!T&&l.createElement(t.Fragment,null,l.createElement("div",{id:"timeline"},l.createElement(a.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},w("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=D&&null!==(s=D.data)&&void 0!==s&&s.timeline&&1===(null==D||null===(c=D.data)||void 0===c||null===(v=c.timeline)||void 0===v?void 0:v.length)?l.createElement(a.CheckPoint,{isCompleted:!0,label:w(""+A+(null==D||null===(p=D.data)||void 0===p||null===(m=p.timeline[0])||void 0===m?void 0:m.state)),customChild:G(null==D||null===(E=D.data)||void 0===E?void 0:E.timeline[0],null==D||null===(S=D.data)||void 0===S?void 0:S.timeline)}):l.createElement(a.ConnectingCheckPoints,null,(null==D||null===(f=D.data)||void 0===f?void 0:f.timeline)&&(null==D||null===(g=D.data)||void 0===g?void 0:g.timeline.slice(0,Q?null==D?void 0:D.data.timeline.length:2).map((e,n,t)=>{var o;let i="";var r,u,d,s,c,v;return window.location.href.includes("/obps/")&&(i=null!=D&&null!==(r=D.data)&&void 0!==r&&null!==(u=r.timeline[n-1])&&void 0!==u&&null!==(d=u.state)&&void 0!==d&&d.includes("BACK_FROM")||null!=D&&null!==(s=D.data)&&void 0!==s&&null!==(c=s.timeline[n-1])&&void 0!==c&&null!==(v=c.state)&&void 0!==v&&v.includes("SEND_TO_CITIZEN")?"_NOT_DONE":"SEND_TO_ARCHITECT"===(null==e?void 0:e.performedAction)?"_BY_ARCHITECT_DONE":0==n?"":"_DONE"),l.createElement(l.Fragment,{key:n},l.createElement(a.CheckPoint,{keyValue:n,isCompleted:0===n,info:e.comment,label:w(""+A+("REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[O])+i),customChild:G(e,n,null==D||null===(o=D.data)||void 0===o?void 0:o.timeline)}))}))),(null==D||null===(C=D.data)||void 0===C||null===(N=C.timeline)||void 0===N?void 0:N.length)>2&&l.createElement(a.LinkButton,{label:w(Q?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{ee(e=>!e)}})))),l.createElement("div",null,P&&l.createElement(Ar,{t:w,closeModal:()=>setRnewButton(!1),actionCancelOnSubmit:()=>setRnewButton(!1),application:application})))}function Or(e){var n,t,o,i,r,u,d,s,c,v,p,m,E,S,_,f,g,C;let{t:N,showToast:y,closeToast:D,businessService:T}=e;if(null!=T&&T.includes("NewTL")||null!=T&&T.includes("TL")||null!=T&&T.includes("EDITRENEWAL")){var h;let e="";switch(null==y||null===(h=y.action)||void 0===h?void 0:h.action){case"SENDBACK":e="error"===(null==y?void 0:y.key)?null==y||null===(n=y.error)||void 0===n?void 0:n.message:N("TL_SENDBACK_CHECKLIST_MESSAGE_HEAD");break;case"FORWARD":e="error"===(null==y?void 0:y.key)?null==y||null===(t=y.error)||void 0===t?void 0:t.message:N("TL_FORWARD_SUCCESS_MESSAGE_MAIN");break;case"APPROVE":e="error"===(null==y?void 0:y.key)?null==y||null===(o=y.error)||void 0===o?void 0:o.message:N("TL_APPROVAL_CHECKLIST_MESSAGE_HEAD");break;case"SENDBACKTOCITIZEN":e="error"===(null==y?void 0:y.key)?null==y||null===(i=y.error)||void 0===i?void 0:i.message:N("TL_SENDBACK_TOCITIZEN_CHECKLIST_MESSAGE_HEAD");break;case"REJECT":e="error"===(null==y?void 0:y.key)?null==y||null===(r=y.error)||void 0===r?void 0:r.message:N("TL_APPROVAL_REJ_MESSAGE_HEAD");break;case"RESUBMIT":e="error"===(null==y?void 0:y.key)?null==y||null===(u=y.error)||void 0===u?void 0:u.message:N("TL_APPLICATION_RESUBMIT_SUCCESS_MESSAGE_MAIN");break;case"CANCEL":e="error"===(null==y?void 0:y.key)?null==y||null===(d=y.error)||void 0===d?void 0:d.message:N("TL_TL_CANCELLED_MESSAGE_HEAD");break;default:e="error"===(null==y?void 0:y.key)?null==y||null===(s=y.error)||void 0===s?void 0:s.message:N("ES_"+T+"_"+(null==y||null===(c=y.action)||void 0===c?void 0:c.action)+"_UPDATE_SUCCESS")}return l.createElement(l.Fragment,null,y&&l.createElement(a.Toast,{error:"error"===y.key,label:e,onClose:D}))}if(null!=T&&T.includes("BPA")||null!=T&&T.includes("BPA_LOW")||null!=T&&T.includes("BPA_OC")){var A;const e=function(e){var n;void 0===e&&(e=[]);let t=e[0];return t=2==(null===(n=e)||void 0===n?void 0:n.length)&&null!=T&&T.includes("BPA_OC")?N(e[1]):N(e[0]),t};let n="";switch(null==y||null===(A=y.action)||void 0===A?void 0:A.action){case"REVOCATE":n="error"===(null==y?void 0:y.key)?null==y||null===(v=y.error)||void 0===v?void 0:v.message:e(["BPA_APPROVAL_REVOCATED_MESSAGE_HEAD","BPA_APPROVAL_OC_REVOCATED_MESSAGE_HEAD"]);break;case"VERIFY_AND_FORWARD":n="error"===(null==y?void 0:y.key)?null==y||null===(p=y.error)||void 0===p?void 0:p.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_TO_CITIZEN":n="error"===(null==y?void 0:y.key)?null==y||null===(m=y.error)||void 0===m?void 0:m.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;case"APPROVE":n="error"===(null==y?void 0:y.key)?null==y||null===(E=y.error)||void 0===E?void 0:E.message:e(["BPA_APPROVAL_CHECKLIST_MESSAGE_HEAD"]);break;case"REJECT":n="error"===(null==y?void 0:y.key)?null==y||null===(S=y.error)||void 0===S?void 0:S.message:e(["BPA_APPROVAL_REJECTED_MESSAGE_HEAD","BPA_OC_APPROVAL_REJECTED_MESSAGE_HEAD"]);break;case"FORWARD":n="error"===(null==y?void 0:y.key)?null==y||null===(_=y.error)||void 0===_?void 0:_.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_FOR_DOCUMENT_VERIFICATION":case"SEND_BACK_FOR_FIELD_INSPECTION":n="error"===(null==y?void 0:y.key)?null==y||null===(f=y.error)||void 0===f?void 0:f.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;default:n="error"===(null==y?void 0:y.key)?null==y||null===(g=y.error)||void 0===g?void 0:g.message:N("ES_"+T+"_"+(null==y||null===(C=y.action)||void 0===C?void 0:C.action)+"_UPDATE_SUCCESS")}return l.createElement(l.Fragment,null,y&&l.createElement(a.Toast,{error:"error"===y.key,label:n,onClose:D}))}{var I,O;const e="error"===(null==y?void 0:y.key)?null==y||null===(I=y.error)||void 0===I?void 0:I.message:"ES_"+T+"_"+(null==y||null===(O=y.action)||void 0===O?void 0:O.action)+"_UPDATE_SUCCESS";return l.createElement(l.Fragment,null,y&&l.createElement(a.Toast,{error:"error"===y.key,label:N(e),onClose:D}))}}function br(e){var n,i,r,u,d,s,c,p,m,E,S,_,f,g,C,N,y,D,T;let{workflowDetails:h,displayMenu:A,onActionSelect:I,setDisplayMenu:O,businessService:b,forcedActionPrefix:L,ActionBarStyle:R={},MenuStyle:w={},isAction:W,applicationDetails:P}=e;const{t:M}=o.useTranslation();let x=Digit.UserService.getUser();const B=t.useRef();if(window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),n=e?JSON.parse(e):{};x=null==n?void 0:n.value}const F=null===(n=x)||void 0===n||null===(i=n.info)||void 0===i||null===(r=i.roles)||void 0===r?void 0:r.map(e=>e.code);let U=!1,k=!1,H=(null==h||null===(u=h.data)||void 0===u||null===(d=u.actionState)||void 0===d||null===(s=d.nextActions)||void 0===s?void 0:s.filter(e=>(null==F?void 0:F.some(n=>{var t;return null===(t=e.roles)||void 0===t?void 0:t.includes(n)}))||!e.roles))||(null==h||null===(c=h.data)||void 0===c||null===(p=c.nextActions)||void 0===p?void 0:p.filter(e=>(null==F?void 0:F.some(n=>{var t;return null===(t=e.roles)||void 0===t?void 0:t.includes(n)}))||!e.roles));Digit.Hooks.useClickOutside(B,()=>{O(!1)},A),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==H?void 0:H.length)||null!=H&&null!==(m=H[0])&&void 0!==m&&null!==(E=m.redirectionUrl)&&void 0!==E&&E.pathname.includes("/pt/property-details/")&&1==(null==H?void 0:H.length)?(k=!1,U=!0):(null==H?void 0:H.length)>0&&(k=!0,U=!1);const j=Digit.SessionStorage.get("User"),V=null==j||null===(S=j.info)||void 0===S?void 0:S.uuid,z=null==P||null===(_=P.applicationData)||void 0===_||null===(f=_.auditDetails)||void 0===f?void 0:f.lastModifiedBy;return l.createElement(l.Fragment,null,!(null!=h&&h.isLoading)&&k&&!U&&!W&&l.createElement(a.ActionBar,{style:v({},R)},A&&(null!=h&&null!==(g=h.data)&&void 0!==g&&null!==(C=g.actionState)&&void 0!==C&&C.nextActions||null!=h&&null!==(N=h.data)&&void 0!==N&&N.nextActions)?l.createElement(a.Menu,{localeKeyPrefix:L||"WF_EMPLOYEE_"+(null==b?void 0:b.toUpperCase()),options:H,optionKey:"action",t:M,onSelect:I,style:w}):null,"ewst"===b?z===V||null==z?l.createElement(a.SubmitBar,{ref:B,label:M("WF_TAKE_ACTION"),onSubmit:()=>O(!A)}):l.createElement(a.CardLabel,{style:{color:"red",font:"30px",fontWeight:"bold"}},""+M("EW_ALERT_ANOTHER_VENDOR")):l.createElement(a.SubmitBar,{ref:B,label:M("WF_TAKE_ACTION"),onSubmit:()=>O(!A)})),!(null!=h&&h.isLoading)&&!k&&U&&!W&&l.createElement(a.ActionBar,{style:v({},R)},l.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==H||null===(y=H[0])||void 0===y?void 0:y.action,value:null==H||null===(D=H[0])||void 0===D?void 0:D.action,onClick:e=>{I((null==H?void 0:H[0])||{})}},M((L||"WF_EMPLOYEE_"+(null==b?void 0:b.toUpperCase()))+"_"+(null==H||null===(T=H[0])||void 0===T?void 0:T.action)))))}const Lr=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Rr=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Lr,null));function wr(e){let{action:n,closeWarningPopup:t}=e;const{t:i}=o.useTranslation(),r=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement(a.Modal,{headerBarMain:l.createElement("h1",{className:"heading-m"},i("PT_DUES_ARE_PENDING")),headerBarEnd:l.createElement(Rr,{onClick:()=>{t()}}),hideSubmit:!0,isDisabled:!1,popupStyles:r?{}:{width:"29%",marginTop:"auto"}},l.createElement(a.Card,null,l.createElement("div",{style:{marginBottom:"30px"}},l.createElement("h1",null,i("PT_YOU_HAVE")," ₹",null==n?void 0:n.AmountDueForPay," ",i("PT_DUE_WARNING_MSG2"))),l.createElement(a.Row,{rowContainerStyle:{display:"flex"},labelStyle:{fontSize:"24px",fontWeight:"700",marginRight:"10%"},textStyle:{fontSize:"24px",fontWeight:"700",marginBottom:"20px"},label:""+i("PT_AMOUNT_DUE"),text:"₹"+i(null==n?void 0:n.AmountDueForPay)}),l.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end"}},l.createElement(a.ButtonSelector,{theme:"border",label:i("ES_PT_COMMON_CANCEL"),onSubmit:t,style:{marginLeft:"10px"}}),l.createElement(a.ButtonSelector,{label:i("PT_COLLECT"),onSubmit:()=>{var e;return window.location.assign(""+window.location.origin+(null==n||null===(e=n.redirectionUrl)||void 0===e?void 0:e.pathname))},style:{marginLeft:"10px"}})))),")")}const Wr=e=>{var n;const r=Digit.ULBService.getCurrentTenantId(),u=Digit.ULBService.getStateId(),{t:s}=o.useTranslation(),c=i.useHistory();let{id:p}=i.useParams();const[m,E]=t.useState(!1),[S,_]=t.useState(null),[f,g]=t.useState(!1),[C,N]=t.useState(!1),[y,D]=t.useState(!1),{applicationDetails:T,showToast:h,setShowToast:A,isLoading:I,isDataLoading:O,applicationData:b,mutate:L,nocMutation:R,workflowDetails:w,id:W,businessService:P,closeToast:M,moduleCode:x,timelineStatusPrefix:B,forcedActionPrefix:F,statusAttribute:U,ActionBarStyle:k,MenuStyle:H,paymentsList:j,showTimeLine:V=!0,oldValue:z,isInfoLabel:Y=!1,clearDataDetails:G,isAction:q=!1}=e;t.useEffect(()=>{h&&w.revalidate()},[h]);const K=d.useQueryClient(),X=()=>{_(null),g(!1)};return I||C?l.createElement(a.Loader,null):l.createElement(l.Fragment,null,I?l.createElement(a.Loader,null):l.createElement(l.Fragment,null,l.createElement(Ir,{applicationDetails:T,id:W,workflowDetails:w,isDataLoading:O,applicationData:b,businessService:P,timelineStatusPrefix:B,statusAttribute:U,paymentsList:j,showTimeLine:V,oldValue:z,isInfoLabel:Y}),f?l.createElement(Xa,{t:s,vending_Zone:(null==e?void 0:e.vending_Zone)||[],UserVendingZone:(null==e?void 0:e.UserVendingZone)||"",UserVendingZoneCode:(null==e?void 0:e.UserVendingZoneCode)||"",action:S,tenantId:r,state:u,id:p,applicationDetails:T,applicationData:null==T?void 0:T.applicationData,closeModal:X,submitAction:function(e,n,t){void 0===n&&(n=!1),void 0===t&&(t={});try{let l=!1;const o=function(o,i,a,r,u,d,p,m,E,S,_,f){if(0!=(null==e||null===(o=e.Property)||void 0===o||null===(i=o.workflow)||void 0===i||null===(a=i.comment)||void 0===a?void 0:a.length)&&0!=(null==e||null===(r=e.Licenses)||void 0===r||null===(u=r[0])||void 0===u||null===(d=u.comment)||void 0===d?void 0:d.length)&&0!=(null==e||null===(p=e.WaterConnection)||void 0===p||null===(m=p.comment)||void 0===m?void 0:m.length)&&0!=(null==e||null===(E=e.SewerageConnection)||void 0===E||null===(S=E.comment)||void 0===S?void 0:S.length)&&0!=(null==e||null===(_=e.BPA)||void 0===_||null===(f=_.comment)||void 0===f?void 0:f.length)){function g(n){if(l)return n;sessionStorage.setItem("updateData",JSON.stringify(e)),L&&(N(!0),L(e,{onError:(e,n)=>{N(!1),A({key:"error",error:e}),setTimeout(M,5e3)},onSuccess:(e,n)=>{var l,o,i,a,r,u,d,v,p,m,E,S;sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),N(!1),null!==(l=t)&&void 0!==l&&l.bpa&&c.replace("/digit-ui/employee/obps/response",{data:e}),null!==(o=t)&&void 0!==o&&o.isStakeholder&&c.push("/digit-ui/employee/obps/stakeholder-response",{data:e}),null!==(i=t)&&void 0!==i&&i.isNoc&&c.push("/digit-ui/employee/noc/response",{data:e}),(null==e||null===(a=e.Amendments)||void 0===a?void 0:a.length)>0?null!=n&&null!==(r=n.AmendmentUpdate)&&void 0!==r&&null!==(u=r.workflow)&&void 0!==u&&u.action.includes("SEND_BACK")?A({key:"success",label:s("ES_MODIFYSWCONNECTION_SEND_BACK_UPDATE_SUCCESS")}):null!=n&&null!==(d=n.AmendmentUpdate)&&void 0!==d&&null!==(v=d.workflow)&&void 0!==v&&v.action.includes("RE-SUBMIT")?A({key:"success",label:s("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=n&&null!==(p=n.AmendmentUpdate)&&void 0!==p&&null!==(m=p.workflow)&&void 0!==m&&m.action.includes("APPROVE")?A({key:"success",label:s("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=n&&null!==(E=n.AmendmentUpdate)&&void 0!==E&&null!==(S=E.workflow)&&void 0!==S&&S.action.includes("REJECT")&&A({key:"success",label:s("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")}):(G&&setTimeout(G,3e3),setTimeout(M,5e3),K.clear(),K.refetchQueries("APPLICATION_SEARCH"))}})),X()}N(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute(v({},e)));const o=function(){if(!1!==n&&R){var e;const t=null===(e=n)||void 0===e?void 0:e.map(e=>null==R?void 0:R.mutateAsync(e)),o=Ji(function(){return N(!0),Promise.resolve(Promise.all(t)).then(function(e){e&&e.map(e=>{var n,t;Digit.SessionStorage.del(null==e||null===(n=e.Noc)||void 0===n||null===(t=n[0])||void 0===t?void 0:t.nocType)})})},function(e){var n,t,o,i,a,r,u,d,c,v,p,m;N(!1);let E=null!=e&&null!==(n=e.response)&&void 0!==n&&null!==(t=n.data)&&void 0!==t&&null!==(o=t.Errors)&&void 0!==o&&null!==(i=o[0])&&void 0!==i&&i.code?s(null==e||null===(a=e.response)||void 0===a||null===(r=a.data)||void 0===r||null===(u=r.Errors)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.code):(null==e||null===(c=e.response)||void 0===c||null===(v=c.data)||void 0===v||null===(p=v.Errors)||void 0===p||null===(m=p[0])||void 0===m?void 0:m.message)||e;X(),A({key:"error",error:{message:E}}),setTimeout(M,5e3),l=!0});if(o&&o.then)return o.then(function(){})}}();return o&&o.then?o.then(g):g(o)}alert("Please fill in the comments before submitting")}();return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},actionData:null==w||null===(n=w.data)||void 0===n?void 0:n.timeline,businessService:P,workflowDetails:w,moduleCode:x}):null,y?l.createElement(wr,{action:S,workflowDetails:w,businessService:P,isWarningPop:y,closeWarningPopup:()=>{D(!1)}}):null,l.createElement(Or,{t:s,showToast:h,closeToast:M,businessService:P}),l.createElement(br,{isAction:q,workflowDetails:w,displayMenu:m,onActionSelect:function(e){if(sessionStorage.setItem("SELECTED_ACTION",null==e?void 0:e.action),e)if(null!=e&&e.isToast)A({key:"error",error:{message:null==e?void 0:e.toastMessage}}),setTimeout(M,5e3);else if(null!=e&&e.isWarningPopUp)D(!0);else if(null!=e&&e.redirectionUrll){var n,t,l,o,i;if("ACTIVATE_CONNECTION"===(null==e||null===(n=e.redirectionUrll)||void 0===n?void 0:n.action))c.push(""+(null==e||null===(l=e.redirectionUrll)||void 0===l?void 0:l.pathname),JSON.stringify({data:null==e||null===(o=e.redirectionUrll)||void 0===o?void 0:o.state,url:""+(null===(i=location)||void 0===i?void 0:i.pathname)+location.search}));else if("RE-SUBMIT-APPLICATION"===(null==e||null===(t=e.redirectionUrll)||void 0===t?void 0:t.action)){var a,r;c.push(""+(null==e||null===(a=e.redirectionUrll)||void 0===a?void 0:a.pathname),{data:null==e||null===(r=e.redirectionUrll)||void 0===r?void 0:r.state})}else{var u;window.location.assign(window.location.origin+"/digit-ui/employee/payment/collect/"+(null==e||null===(u=e.redirectionUrll)||void 0===u?void 0:u.pathname))}}else if(null!=e&&e.redirectionUrl){var d,s;c.push({pathname:null===(d=e.redirectionUrl)||void 0===d?void 0:d.pathname,state:v({},null===(s=e.redirectionUrl)||void 0===s?void 0:s.state)})}else g(!0);_(e),E(!1)},setDisplayMenu:E,businessService:P,forcedActionPrefix:F,ActionBarStyle:k,MenuStyle:H,applicationDetails:T})))};function Pr(e,n){if("function"!=typeof e||null!=n&&"function"!=typeof n)throw new TypeError("Expected a function");var t=function(){var l=arguments,o=n?n.apply(this,l):l[0],i=t.cache;if(i.has(o))return i.get(o);var a=e.apply(this,l);return t.cache=i.set(o,a)||i,a};return t.cache=new(Pr.Cache||vn),t}Pr.Cache=vn;var Mr,xr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Br=/\\(\\)?/g;Mr=Pr(function(e){var n=[];return 46===e.charCodeAt(0)&&n.push(""),e.replace(xr,function(e,t,l,o){n.push(l?o.replace(Br,"$1"):t||e)}),n},function(e){return 500===Mr.size&&Mr.clear(),e}).cache;const Fr=(e,n)=>(n&&Object.keys(n).map(t=>{e=e.replace(":"+t,n[t])}),e),Ur=(e,n)=>(n&&Object.keys(n).map(t=>{e=e.replace(":"+t,n[t])}),e),kr=e=>{let{register:n,reset:o,t:i}=e;return i("ES_SEARCH_APPLICATION_MOBILE_INVALID"),i("ERR_DEFAULT_INPUT_FIELD_MSG"),l.createElement(t.Fragment,null,l.createElement(a.SearchField,{style:{width:"100%"}},l.createElement("label",null,i("WS_PROPERTY_ID_LABEL")),l.createElement(a.TextInput,{name:"propertyId",inputRef:n({})})),l.createElement(a.SearchField,{className:"submit"},l.createElement(a.SubmitBar,{label:i("WS_SEARCH_CONNECTION_SEARCH_INTEGRATED_BUTTON"),submit:!0}),l.createElement("p",{onClick:()=>{o({searchType:"CONNECTION",mobileNumber:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC",propertyId:"",connectionNumber:"",oldConnectionNumber:""})}},i("WS_SEARCH_CONNECTION_RESET_BUTTON"))))},Hr=e=>{let{tenantId:n,onSubmit:u,data:d,count:s,resultOk:c,isLoading:v}=e;console.log("dafff",d);const{t:p}=o.useTranslation(),{register:m,control:E,handleSubmit:S,setValue:_,getValues:f,reset:g}=r.useForm({defaultValues:{offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC",searchType:"CONNECTION"}});t.useEffect(()=>{m("offset",0),m("limit",10),m("sortBy","commencementDate"),m("searchType","CONNECTION"),m("sortOrder","DESC"),m("propertyId","")},[m]);const C=t.useCallback(e=>{0!==e.length&&(_("sortBy",e.id),_("sortOrder",e.desc?"DESC":"ASC"))},[]),N=e=>l.createElement("span",{className:"cell-text"},e),y=t.useMemo(()=>[{Header:p("WS_COMMON_TABLE_COL_CONSUMER_NO_LABEL"),disableSortBy:!0,accessor:"connectionNo",Cell:e=>{var t,o,a;let{row:r}=e;return l.createElement("div",null,r.original.connectionNo?l.createElement("span",{className:"link"},l.createElement(i.Link,{to:"/digit-ui/employee/ws/connection-details?applicationNumber="+r.original.connectionNo+"&tenantId="+n+"&service="+(null===(t=r.original)||void 0===t?void 0:t.service)+"&connectionType="+(null===(o=r.original)||void 0===o?void 0:o.connectionType)+"&due="+((null===(a=r.original)||void 0===a?void 0:a.due)||0)+"&from=WS_SEWERAGE_CONNECTION_SEARCH_LABEL"},r.original.connectionNo||"NA")):l.createElement("span",null,p("NA")))}},{Header:p("WS_COMMON_TABLE_COL_SERVICE_LABEL"),disableSortBy:!0,Cell:e=>{var n;let{row:t}=e;return N(null!=t&&null!==(n=t.original)&&void 0!==n&&n.applicationNo.includes("WS")?"Water Service":"Sewerage Service")}},{Header:p("WS_COMMON_TABLE_COL_OWN_NAME_LABEL"),disableSortBy:!0,Cell:e=>{var n,t,l,o,i;let{row:a}=e;return N(null!=a&&null!==(n=a.original)&&void 0!==n&&null!==(t=n.connectionHolders)&&void 0!==t&&t.map(e=>null==e?void 0:e.name).join(",")?null==a||null===(l=a.original)||void 0===l||null===(o=l.connectionHolders)||void 0===o?void 0:o.map(e=>null==e?void 0:e.name).join(","):""+((null===(i=a.original)||void 0===i?void 0:i.owner)||"NA"))}},{Header:p("WS_COMMON_TABLE_COL_STATUS_LABEL"),disableSortBy:!0,Cell:e=>{var n,t;let{row:l}=e;return N(p("WS_"+(null===(n=l.original)||void 0===n||null===(t=n.status)||void 0===t?void 0:t.toUpperCase())))}},{Header:p("WS_COMMON_TABLE_COL_AMT_DUE_LABEL"),disableSortBy:!0,Cell:e=>{var n;let{row:t}=e;return N(""+((null===(n=t.original)||void 0===n?void 0:n.due)||"NA"))}},{Header:p("WS_COMMON_TABLE_COL_ADDRESS"),disableSortBy:!0,Cell:e=>{var n;let{row:t}=e;return N(""+((null===(n=t.original)||void 0===n?void 0:n.address)||"NA"))}},{Header:p("WS_COMMON_TABLE_COL_DUE_DATE_LABEL"),disableSortBy:!0,Cell:e=>{var n,t,l,o;let{row:i}=e;const a=(null===(n=i.original)||void 0===n||null===(t=n.status)||void 0===t?void 0:t.toUpperCase())||"",r="NA"===(null===(l=i.original)||void 0===l?void 0:l.dueDate)?p("WS_NA"):(e=>{if(null==e||null==e||""==e)return"NA";const n=new Date(e);let t=n.getMonth()+1,l=n.getDate();return t=(t>9?"":"0")+t,l=(l>9?"":"0")+l,l+"/"+t+"/"+n.getFullYear()})(null===(o=i.original)||void 0===o?void 0:o.dueDate);return N(p("INACTIVE"===a?"WS_NA":""+r))}}],[]);return l.createElement(t.Fragment,null,l.createElement(a.Header,{styles:{fontSize:"32px"}},p("WS_WATER_SEWERAGE_INTEGRATED_BILL_SUB_HEADER")),l.createElement(a.SearchForm,{className:"ws-custom-wrapper",onSubmit:u,handleSubmit:S},l.createElement(kr,{register:m,control:E,reset:g,tenantId:n,t:p})),v?l.createElement(a.Loader,null):null,null!=d&&d.display&&!c?l.createElement(a.Card,{style:{marginTop:20}},p(null==d?void 0:d.display).split("\\n").map((e,n)=>l.createElement("p",{key:n,style:{textAlign:"center"}},e))):c?l.createElement("div",null,l.createElement(a.Table,{t:p,data:d,totalRecords:s,columns:y,getCellProps:e=>({style:{minWidth:e.column.Header===p("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:function(e){_("limit",Number(e.target.value)),S(u)()},currentPage:f("offset")/f("limit"),onNextPage:function(){_("offset",f("offset")+f("limit")),S(u)()},onPrevPage:function(){_("offset",f("offset")-f("limit")),S(u)()},pageSizeLimit:f("limit"),onSort:C,disableSort:!1,sortParams:[{id:f("sortBy"),desc:"DESC"===f("sortOrder")}]}),l.createElement("button",{className:"submit-bar",type:"button",onClick:function(){try{console.log("integrated",d);const e=function(){if((null==d?void 0:d.length)>0){const e=he(function(){return Promise.resolve(Digit.WSService.wnsGroupBill({propertyId:d[0].propertyId,tenantId:n})).then(function(e){((e,n)=>{if(window.mSewaApp&&window.mSewaApp.isMsewaApp()&&window.mSewaApp.downloadBase64File){var t=new FileReader;t.readAsDataURL(e),t.onloadend=function(){window.mSewaApp.downloadBase64File(t.result,"IntegratedBill.pdf")}}else{const n=document.createElement("a");n.href=URL.createObjectURL(e),n.download="IntegratedBill.pdf",document.body.append(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(n.href),7e3)}})(new Blob([e.data],{type:"application/pdf"}))})},function(e){console.log("errorrrrrr",e)});if(e&&e.then)return e.then(function(){})}else alert("NO Pdf")}();return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},style:{fontFamily:"sans-serif",color:"white",fontSize:"19px",marginTop:"10px",float:"right"}},p("WS_DOWNLOAD_BILL"))):null)},jr={WSModule:e=>{var n;let{stateCode:t,userType:o,tenants:r}=e;const u=["ws","pt","common",(null===(n=Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY"))||void 0===n?void 0:n.code)||Digit.ULBService.getCurrentTenantId(),"bill-amend","abg"],{path:d}=i.useRouteMatch(),s=Digit.StoreData.getCurrentLanguage(),{isLoading:c}=Digit.Services.useStore({stateCode:t,moduleCode:u,language:s});return Digit.SessionStorage.set("WS_TENANTS",r),Digit.SessionStorage.set("PT_TENANTS",r),c?l.createElement(a.Loader,null):l.createElement("citizen"===o?z:ye,{path:d,stateCode:t})},WSLinks:e=>{let{matchPath:n}=e;const{t:t}=o.useTranslation(),i=[{link:n+"/my-bills",i18nKey:t("ACTION_TEST_WNS_MY_BILLS")},{link:n+"/my-payments",i18nKey:t("ACTION_TEST_MY_PAYMENTS")},{link:n+"/create-application",i18nKey:t("ACTION_TEST_APPLY_NEW_CONNECTION")},{link:n+"/search",i18nKey:t("ACTION_TEXT_WS_SEARCH_AND_PAY")},{link:n+"/my-applications",i18nKey:t("ACTION_TEXT_WS_MY_APPLICATION")},{link:n+"/my-connections",i18nKey:t("ACTION_TEXT_WS_MY_CONNECTION")}];return l.createElement(a.CitizenHomeCard,{header:t("ACTION_TEST_WATER_AND_SEWERAGE"),links:i,Icon:()=>l.createElement(a.WSICon,null)})},WSServiceName:e=>{let{t:n,config:o,onSelect:i,userType:r,formData:u}=e;const[d,s]=t.useState((null==u?void 0:u.serviceName)||""),[c,v]=t.useState(u||{}),p=window.location.href.includes("/ws/edit-application/");return l.createElement("div",null,"citizen"===r&&l.createElement(Te,{currentStep:2}),l.createElement(a.FormStep,{t:n,config:o,onSelect:()=>{var e;if("WATER"==(null==d?void 0:d.code)?sessionStorage.setItem("serviceName","WATER"):"SEWERAGE"==(null==d?void 0:d.code)?sessionStorage.setItem("serviceName","SEWERAGE"):sessionStorage.setItem("serviceName",""),"BOTH"!=(null==d?void 0:d.code)&&(null==c||null===(e=c.serviceName)||void 0===e?void 0:e.code)!=(null==d?void 0:d.code)){let e=c;e.waterConectionDetails={},e.sewerageConnectionDetails={},e.serviceName=d,i("",e)}else i(o.key,d)},onSkip:()=>i(),isDisabled:!d,onAdd:function(){}},l.createElement(a.CardLabel,null,n("WS_SELECT_SERVICE_TYPE_WANT_TO_APPLY")),l.createElement(a.RadioOrSelect,{name:"gender",options:[{i18nKey:"WS_WATER_CONNECTION_ONLY",code:"WATER"},{i18nKey:"WS_SEWERAGE_CONNECTION_ONLY",code:"SEWERAGE"},{i18nKey:"WS_BOTH_WATER_AND_SEWERAGE",code:"BOTH"}],selectedOption:d,optionKey:"i18nKey",onSelect:function(e){s(e)},t:n,disabled:p})))},WSWaterConnectionDetails:e=>{var n,o;let{t:i,config:r,userType:u,onSelect:d,formData:s}=e;const c=Digit.ULBService.getStateId(),[p,m]=t.useState((null==s||null===(n=s.waterConectionDetails)||void 0===n?void 0:n.proposedTaps)||""),[E,S]=t.useState((null==s||null===(o=s.waterConectionDetails)||void 0===o?void 0:o.proposedPipeSize)||""),[_,f]=t.useState(!1),[g,C]=t.useState(null),[N,y]=t.useState(null),[D,T]=t.useState([]),{isLoading:h,data:A}=Digit.Hooks.ws.WSSearchMdmsTypes.useWSServicesCalculation(c);return t.useEffect(()=>{var e;if((null==A||null===(e=A.PipeSize)||void 0===e?void 0:e.length)>0){var n;let e=[];null==A||null===(n=A.PipeSize)||void 0===n||n.forEach(n=>{e.push({i18nKey:n.size+" "+i("WS_INCHES_LABEL"),code:n.size,id:n.id,size:n.size})}),T(e)}},[A]),l.createElement("div",null,"citizen"===u&&l.createElement(Te,{currentStep:2}),h?l.createElement(a.Loader,null):l.createElement(a.FormStep,{t:i,config:r,onSelect:()=>{var e,n,t,l;if((null==s||!s.WaterConnectionResult||null==s||null===(e=s.WaterConnectionResult)||void 0===e||null===(n=e.WaterConnection)||void 0===n||null===(t=n[0])||void 0===t||!t.id)&&"WATER"===(null==s||null===(l=s.serviceName)||void 0===l?void 0:l.code)||null!=s&&s.isModifyConnection){f(!0);let e={};var o,i,a,u,c,m,S,_,g,N,D,T,h,A,I,O,b,L,R,w,W,P,M,x;e=null!=s&&s.isModifyConnection?{WaterConnection:v({},null==s||null===(o=s.WaterConnectionResult)||void 0===o||null===(i=o.WaterConnection)||void 0===i?void 0:i[0],{processInstance:{action:"INITIATE"},channel:"CITIZEN"}),reconnectRequest:!1,disconnectRequest:!1}:{WaterConnection:{water:!0,sewerage:!1,property:v({},null==s||null===(a=s.cpt)||void 0===a?void 0:a.details),proposedTaps:p,proposedPipeSize:null==E?void 0:E.code,proposedWaterClosets:null,proposedToilets:null,connectionHolders:null!=s&&null!==(u=s.ConnectionHolderDetails)&&void 0!==u&&u.isOwnerSame?null:[{correspondenceAddress:null==s||null===(c=s.ConnectionHolderDetails)||void 0===c?void 0:c.address,fatherOrHusbandName:null==s||null===(m=s.ConnectionHolderDetails)||void 0===m?void 0:m.guardian,gender:null==s||null===(S=s.ConnectionHolderDetails)||void 0===S||null===(_=S.gender)||void 0===_?void 0:_.code,mobileNumber:null==s||null===(g=s.ConnectionHolderDetails)||void 0===g?void 0:g.mobileNumber,name:null==s||null===(N=s.ConnectionHolderDetails)||void 0===N?void 0:N.name,emailId:null==s||null===(D=s.ConnectionHolderDetails)||void 0===D?void 0:D.emailId,ownerType:(null==s||null===(T=s.ConnectionHolderDetails)||void 0===T||null===(h=T.specialCategoryType)||void 0===h?void 0:h.code)||"NONE",relationship:null==s||null===(A=s.ConnectionHolderDetails)||void 0===A||null===(I=A.relationship)||void 0===I?void 0:I.code,sameAsPropertyAddress:!1}],service:"Water",roadCuttingArea:null,noOfTaps:null,noOfWaterClosets:null,noOfToilets:null,propertyId:(null==s||null===(O=s.cptId)||void 0===O?void 0:O.id)||(null==s||null===(b=s.cpt)||void 0===b||null===(L=b.details)||void 0===L?void 0:L.propertyId),additionalDetails:{initialMeterReading:null,detailsProvidedBy:"",locality:null==s||null===(R=s.cpt)||void 0===R||null===(w=R.details)||void 0===w||null===(W=w.address)||void 0===W||null===(P=W.locality)||void 0===P?void 0:P.code},tenantId:null==s||null===(M=s.cpt)||void 0===M||null===(x=M.details)||void 0===x?void 0:x.tenantId,processInstance:{action:"INITIATE"},channel:"CITIZEN"},reconnectRequest:!1,disconnectRequest:!1},Digit.WSService.create(e,"WATER").then((e,n)=>{f(!1);let t=v({},s,{WaterConnectionResult:e,waterConectionDetails:{proposedTaps:p,proposedPipeSize:E}});d("",t,"",!0)}).catch(e=>{var n,t,l;f(!1),C({key:"error"}),y((null==e||null===(n=e.response)||void 0===n||null===(t=n.data)||void 0===t||null===(l=t.Errors[0])||void 0===l?void 0:l.message)||null)})}else{let e={};e.proposedTaps=p,e.proposedPipeSize=E,d(r.key,e)}},onSkip:()=>d(),isDisabled:!p||!E||_,onAdd:function(){}},l.createElement(a.CardLabel,null,i("WS_NO_OF_TAPS_PROPOSED"),"*"),l.createElement(a.TextInput,v({isMandatory:!1,optionKey:"i18nKey",t:i,name:"proposedTaps",onChange:function(e){m(e.target.value)},value:p},{isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:i("ERR_DEFAULT_INPUT_FIELD_MSG"),type:"text"})),l.createElement(a.CardLabel,null,i("WS_PROPOSED_PIPE_SIZE"),"*"),l.createElement(a.RadioOrSelect,{name:"proposedPipeSize",options:D,selectedOption:E,optionKey:"i18nKey",onSelect:function(e){S(e)},t:i})),g&&l.createElement(a.Toast,{error:"error"===(null==g?void 0:g.key),label:N,isDleteBtn:!0,onClose:()=>{C(null),y(null)}}))},WSDocsRequired:e=>{var n;let{onSelect:r,userType:u}=e;const{t:d}=o.useTranslation(),s=i.useHistory(),c=i.useRouteMatch(),v=Digit.ULBService.getStateId();sessionStorage.removeItem("Digit.PT_CREATE_EMP_WS_NEW_FORM"),sessionStorage.removeItem("IsDetailsExists"),sessionStorage.removeItem("FORMSTATE_ERRORS");const{isLoading:p,data:m}=Digit.Hooks.ws.WSSearchMdmsTypes.useWSServicesMasters(v);var E;return"citizen"===u?l.createElement(t.Fragment,null,l.createElement(a.Card,null,l.createElement(a.CardHeader,null,d("WS_COMMON_APPL_NEW_CONNECTION")),l.createElement(a.CitizenInfoLabel,{style:{margin:"0px",textAlign:"center"},textStyle:{color:"#0B0C0C"},text:d("WS_DOCS_REQUIRED_TIME"),showInfo:!1}),l.createElement(a.CardText,{style:{color:"#0B0C0C",marginTop:"12px"}},d("WS_NEW_CONNECTION_TEST_1")),l.createElement(a.CardText,{style:{color:"#0B0C0C",marginTop:"12px"}},d("WS_NEW_CONNECTION_TEST_2")),l.createElement(a.CardSubHeader,null,d("WS_DOC_REQ_SCREEN_LABEL")),l.createElement(a.CardText,{style:{color:"#0B0C0C",marginTop:"12px"}},d("WS_NEW_CONNECTION_TEST_3")),p?l.createElement(a.Loader,null):l.createElement(t.Fragment,null,null==m||null===(E=m.Documents)||void 0===E?void 0:E.map((e,n)=>{var t;return l.createElement("div",null,l.createElement("div",{style:{fontWeight:700,marginBottom:"8px"},key:n},l.createElement("div",{style:{display:"flex"}},l.createElement("div",null,n+1+"."," "),l.createElement("div",null," "+d(null==e?void 0:e.code.replace(".","_"))))),l.createElement("div",{style:{marginBottom:"16px",marginLeft:"18px"}},null==e||null===(t=e.dropdownData)||void 0===t?void 0:t.map((n,t)=>{var o;return(null==e||null===(o=e.dropdownData)||void 0===o?void 0:o.length)!==t+1?l.createElement("span",null,d(null==n?void 0:n.i18nKey)+", "):l.createElement("span",null,""+d(null==n?void 0:n.i18nKey))})))})),l.createElement(a.SubmitBar,{label:d("CS_COMMON_NEXT"),onSubmit:()=>{r("DocsReq","")}}))):l.createElement("div",{style:{margin:"16px"}},l.createElement("div",null,l.createElement(a.Header,{styles:{fontSize:"32px",marginLeft:"18px",display:"flex",justifyContent:"space-between",marginRight:"12px"}},l.createElement("div",null,d("WS_WATER_AND_SEWERAGE_NEW_CONNECTION_LABEL")),l.createElement("div",{onClick:()=>{let e=document.getElementById("documents-div").innerHTML;if(window.mSewaApp&&window.mSewaApp.isMsewaApp())window.mSewaApp.downloadBase64File(window.btoa(e),d("WS_REQ_DOCS"));else{let n=window.open("","");n.document.write("<html><body>"+e+"</body></html>"),n.document.close(),n.focus(),n.print()}},style:{cursor:"pointer",display:"flex"}},l.createElement(a.PrintBtnCommon,null),l.createElement("div",{style:{fontSize:"24px",fontWeight:"400",color:"#0B0C0C"}},"Print")))),l.createElement(a.Card,null,p?l.createElement(a.Loader,null):l.createElement("div",{id:"documents-div"},null==m||null===(n=m.Documents)||void 0===n?void 0:n.map((e,n)=>{var t;return l.createElement("div",{key:n,style:{marginTop:"16px"}},l.createElement(a.CardSectionHeader,{style:{marginBottom:"16px",lineHeight:"28px",fontSize:"24px"}},d(null==e?void 0:e.code.replace(".","_"))),e.dropdownData&&e.dropdownData.length>1&&l.createElement("p",{style:{lineHeight:"24px",fontSize:"16px"}},d((null==e?void 0:e.code.replace(".","_"))+"_DESCRIPTION")),l.createElement("div",{style:{margin:"16px 0",lineHeight:"18px",fontSize:"16px"}},null==e||null===(t=e.dropdownData)||void 0===t?void 0:t.map((e,n)=>l.createElement("p",{style:{fontWeight:"bold",lineHeight:"32px"}},n+1+". "+d(null==e?void 0:e.i18nKey)))),l.createElement("p",{style:{fontSize:"16px"}},d((null==e?void 0:e.code.replace(".","_"))+"_BELOW_DESCRIPTION")))})),l.createElement(a.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},l.createElement(a.SubmitBar,{label:d("ACTION_TEST_APPLY"),onSubmit:()=>{s.push(c.path.replace("create-application","new-application"))},style:{margin:"10px 10px 0px 0px"},disabled:!!p}))))},WSDocumentDetails:e=>{var n,o;let{t:i,config:r,onSelect:u,userType:d,formData:s}=e;const c=Digit.ULBService.getStateId(),[p,m]=t.useState((null==s||null===(n=s.documents)||void 0===n?void 0:n.documents)||[]),[E,S]=t.useState(null),[_,f]=t.useState(!0),[g,C]=t.useState(!1),{isLoading:N,data:y}=Digit.Hooks.ws.WSSearchMdmsTypes.useWSServicesMasters(c);return t.useEffect(()=>{let e=0;null==y||y.Documents.map(n=>{let t=!1;p.map(e=>{n.required&&null!=e&&e.documentType.includes(n.code)&&(t=!0)}),!t&&n.required&&(e+=1)}),f("0"!=e&&0!=e||!(p.length>0))},[p,g]),l.createElement("div",null,"citizen"===d&&l.createElement(Te,{currentStep:3}),N?l.createElement(a.Loader,null):l.createElement(a.FormStep,{t:i,config:r,onSelect:()=>{let e;e=v({},s.documents,{documents:p}),u(r.key,e)},onSkip:()=>u(),isDisabled:_,onAdd:function(){}},null==y||null===(o=y.Documents)||void 0===o?void 0:o.map((e,n)=>l.createElement(Ae,{key:n,document:e,t:i,error:E,setError:S,setDocuments:m,documents:p,setCheckRequiredFields:C})),E&&l.createElement(a.Toast,{label:E,onClose:()=>S(null),error:!0})))},WSSewerageConnectionDetails:e=>{var n,o;let{t:i,config:r,userType:u,onSelect:d,formData:s}=e;const[c,p]=t.useState((null==s||null===(n=s.sewerageConnectionDetails)||void 0===n?void 0:n.proposedWaterClosets)||""),[m,E]=t.useState((null==s||null===(o=s.sewerageConnectionDetails)||void 0===o?void 0:o.proposedToilets)||""),[S,_]=t.useState(!1),[f,g]=t.useState(null),[C,N]=t.useState(null);let y={};return l.createElement("div",null,"citizen"===u&&l.createElement(Te,{currentStep:2}),l.createElement(a.FormStep,{t:i,config:r,onSelect:()=>{var e,n,t,l,o,i,a,u,p;if(null!=s&&s.SewerageConnectionResult&&null!=s&&null!==(e=s.SewerageConnectionResult)&&void 0!==e&&null!==(n=e.SewerageConnections)&&void 0!==n&&null!==(t=n[0])&&void 0!==t&&t.id&&(null==s||!s.isModifyConnection)||"SEWERAGE"!==(null==s||null===(l=s.serviceName)||void 0===l?void 0:l.code))if((null!=s&&s.SewerageConnectionResult&&null!=s&&null!==(o=s.SewerageConnectionResult)&&void 0!==o&&null!==(i=o.SewerageConnection)&&void 0!==i&&i.id||null!=s&&s.WaterConnectionResult&&null!=s&&null!==(a=s.WaterConnectionResult)&&void 0!==a&&null!==(u=a.WaterConnection)&&void 0!==u&&u.id)&&(null==s||!s.isModifyConnection)||"BOTH"!==(null==s||null===(p=s.serviceName)||void 0===p?void 0:p.code)){let e={};e.proposedWaterClosets=c,e.proposedToilets=m,d(r.key,e)}else{_(!0);let e={};var E,S,f,C,y,D,T,h,A,I,O,b,L,R,w,W,P,M,x,B,F,U,k,H,j,V,z;null!=s&&s.isModifyConnection?payload={WaterConnection:v({},null==s||null===(E=s.WaterConnectionResult)||void 0===E||null===(S=E.WaterConnection)||void 0===S?void 0:S[0],{processInstance:{action:"INITIATE"},channel:"CITIZEN"}),reconnectRequest:!1,disconnectRequest:!1}:e={WaterConnection:{water:!0,sewerage:!0,property:v({},null==s||null===(f=s.cpt)||void 0===f?void 0:f.details),proposedTaps:null==s||null===(C=s.waterConectionDetails)||void 0===C?void 0:C.proposedTaps,proposedPipeSize:null==s||null===(y=s.waterConectionDetails)||void 0===y||null===(D=y.proposedPipeSize)||void 0===D?void 0:D.code,proposedWaterClosets:parseInt(c),proposedToilets:parseInt(m),connectionHolders:null!=s&&null!==(T=s.ConnectionHolderDetails)&&void 0!==T&&T.isOwnerSame?null:[{correspondenceAddress:null==s||null===(h=s.ConnectionHolderDetails)||void 0===h?void 0:h.address,fatherOrHusbandName:null==s||null===(A=s.ConnectionHolderDetails)||void 0===A?void 0:A.guardian,gender:null==s||null===(I=s.ConnectionHolderDetails)||void 0===I||null===(O=I.gender)||void 0===O?void 0:O.code,mobileNumber:null==s||null===(b=s.ConnectionHolderDetails)||void 0===b?void 0:b.mobileNumber,name:null==s||null===(L=s.ConnectionHolderDetails)||void 0===L?void 0:L.name,emailId:null==s||null===(R=s.ConnectionHolderDetails)||void 0===R?void 0:R.emailId,ownerType:(null==s||null===(w=s.ConnectionHolderDetails)||void 0===w||null===(W=w.specialCategoryType)||void 0===W?void 0:W.code)||"NONE",relationship:null==s||null===(P=s.ConnectionHolderDetails)||void 0===P||null===(M=P.relationship)||void 0===M?void 0:M.code,sameAsPropertyAddress:!1}],service:"Water and Sewerage",roadCuttingArea:null,noOfTaps:null,noOfWaterClosets:null,noOfToilets:null,propertyId:(null==s||null===(x=s.cptId)||void 0===x?void 0:x.id)||(null==s||null===(B=s.cpt)||void 0===B||null===(F=B.details)||void 0===F?void 0:F.propertyId),additionalDetails:{initialMeterReading:null,detailsProvidedBy:"",locality:null==s||null===(U=s.cpt)||void 0===U||null===(k=U.details)||void 0===k||null===(H=k.address)||void 0===H||null===(j=H.locality)||void 0===j?void 0:j.code},tenantId:null==s||null===(V=s.cpt)||void 0===V||null===(z=V.details)||void 0===z?void 0:z.tenantId,processInstance:{action:"INITIATE"},channel:"CITIZEN"},reconnectRequest:!1,disconnectRequest:!1};let n={};var Y,G,q,K,X,Z,$,J,Q,ee,ne,te,le,oe,ie,ae,re,ue,de,se,ce,ve,pe,me,Ee,Se,_e;n=null!=s&&s.isModifyConnection?{SewerageConnection:v({},null==s||null===(Y=s.SewerageConnectionResult)||void 0===Y||null===(G=Y.SewerageConnections)||void 0===G?void 0:G[0],{processInstance:{action:"INITIATE"},channel:"CITIZEN"}),reconnectRequest:!1,disconnectRequest:!1}:{SewerageConnection:{water:!0,sewerage:!0,property:v({},null==s||null===(q=s.cpt)||void 0===q?void 0:q.details),proposedTaps:null==s||null===(K=s.waterConectionDetails)||void 0===K?void 0:K.proposedTaps,proposedPipeSize:null==s||null===(X=s.waterConectionDetails)||void 0===X||null===(Z=X.proposedPipeSize)||void 0===Z?void 0:Z.code,proposedWaterClosets:parseInt(c),proposedToilets:parseInt(m),connectionHolders:null!=s&&null!==($=s.ConnectionHolderDetails)&&void 0!==$&&$.isOwnerSame?null:[{correspondenceAddress:null==s||null===(J=s.ConnectionHolderDetails)||void 0===J?void 0:J.address,fatherOrHusbandName:null==s||null===(Q=s.ConnectionHolderDetails)||void 0===Q?void 0:Q.guardian,gender:null==s||null===(ee=s.ConnectionHolderDetails)||void 0===ee||null===(ne=ee.gender)||void 0===ne?void 0:ne.code,mobileNumber:null==s||null===(te=s.ConnectionHolderDetails)||void 0===te?void 0:te.mobileNumber,name:null==s||null===(le=s.ConnectionHolderDetails)||void 0===le?void 0:le.name,emailId:null==s||null===(oe=s.ConnectionHolderDetails)||void 0===oe?void 0:oe.emailId,ownerType:(null==s||null===(ie=s.ConnectionHolderDetails)||void 0===ie||null===(ae=ie.specialCategoryType)||void 0===ae?void 0:ae.code)||"NONE",relationship:null==s||null===(re=s.ConnectionHolderDetails)||void 0===re||null===(ue=re.relationship)||void 0===ue?void 0:ue.code,sameAsPropertyAddress:!1}],service:"Water and Sewerage",roadCuttingArea:null,noOfTaps:null,noOfWaterClosets:null,noOfToilets:null,propertyId:(null==s||null===(de=s.cptId)||void 0===de?void 0:de.id)||(null==s||null===(se=s.cpt)||void 0===se||null===(ce=se.details)||void 0===ce?void 0:ce.propertyId),additionalDetails:{initialMeterReading:null,detailsProvidedBy:"",locality:null==s||null===(ve=s.cpt)||void 0===ve||null===(pe=ve.details)||void 0===pe||null===(me=pe.address)||void 0===me||null===(Ee=me.locality)||void 0===Ee?void 0:Ee.code},tenantId:null==s||null===(Se=s.cpt)||void 0===Se||null===(_e=Se.details)||void 0===_e?void 0:_e.tenantId,processInstance:{action:"INITIATE"},channel:"CITIZEN"},reconnectRequest:!1,disconnectRequest:!1},Digit.WSService.create(e,"WATER").then((e,t)=>{Digit.WSService.create(n,"SEWERAGE").then((n,t)=>{_(!1);let l=v({},s,{WaterConnectionResult:e,SewerageConnectionResult:n,sewerageConnectionDetails:{proposedWaterClosets:c,proposedToilets:m}});d("",l,"",!0)}).catch(e=>{var n,t,l;_(!1),g({key:"error"}),N((null==e||null===(n=e.response)||void 0===n||null===(t=n.data)||void 0===t||null===(l=t.Errors[0])||void 0===l?void 0:l.message)||null)})}).catch(e=>{var n,t,l;_(!1),g({key:"error"}),N((null==e||null===(n=e.response)||void 0===n||null===(t=n.data)||void 0===t||null===(l=t.Errors[0])||void 0===l?void 0:l.message)||null)})}else{_(!0);let e={};var fe,ge,Ce,Ne,ye,De,Te,he,Ae,Ie,Oe,be,Le,Re,we,We,Pe,Me,xe,Be,Fe,Ue,ke,He;e=null!=s&&s.isModifyConnection?{SewerageConnection:v({},null==s||null===(fe=s.SewerageConnectionResult)||void 0===fe||null===(ge=fe.SewerageConnections)||void 0===ge?void 0:ge[0],{processInstance:{action:"INITIATE"},channel:"CITIZEN"}),reconnectRequest:!1,disconnectRequest:!1}:{SewerageConnection:{water:!1,sewerage:!0,property:v({},null==s||null===(Ce=s.cpt)||void 0===Ce?void 0:Ce.details),proposedTaps:null,proposedPipeSize:null,proposedWaterClosets:parseInt(c),proposedToilets:parseInt(m),connectionHolders:null!=s&&null!==(Ne=s.ConnectionHolderDetails)&&void 0!==Ne&&Ne.isOwnerSame?null:[{correspondenceAddress:null==s||null===(ye=s.ConnectionHolderDetails)||void 0===ye?void 0:ye.address,fatherOrHusbandName:null==s||null===(De=s.ConnectionHolderDetails)||void 0===De?void 0:De.guardian,gender:null==s||null===(Te=s.ConnectionHolderDetails)||void 0===Te||null===(he=Te.gender)||void 0===he?void 0:he.code,mobileNumber:null==s||null===(Ae=s.ConnectionHolderDetails)||void 0===Ae?void 0:Ae.mobileNumber,name:null==s||null===(Ie=s.ConnectionHolderDetails)||void 0===Ie?void 0:Ie.name,emailId:null==s||null===(Oe=s.ConnectionHolderDetails)||void 0===Oe?void 0:Oe.emailId,ownerType:(null==s||null===(be=s.ConnectionHolderDetails)||void 0===be||null===(Le=be.specialCategoryType)||void 0===Le?void 0:Le.code)||"NONE",relationship:null==s||null===(Re=s.ConnectionHolderDetails)||void 0===Re||null===(we=Re.relationship)||void 0===we?void 0:we.code,sameAsPropertyAddress:!1}],service:"Sewerage",roadCuttingArea:null,noOfTaps:null,noOfWaterClosets:null,noOfToilets:null,propertyId:(null==s||null===(We=s.cptId)||void 0===We?void 0:We.id)||(null==s||null===(Pe=s.cpt)||void 0===Pe||null===(Me=Pe.details)||void 0===Me?void 0:Me.propertyId),additionalDetails:{initialMeterReading:null,detailsProvidedBy:"",locality:null==s||null===(xe=s.cpt)||void 0===xe||null===(Be=xe.details)||void 0===Be||null===(Fe=Be.address)||void 0===Fe||null===(Ue=Fe.locality)||void 0===Ue?void 0:Ue.code},tenantId:null==s||null===(ke=s.cpt)||void 0===ke||null===(He=ke.details)||void 0===He?void 0:He.tenantId,processInstance:{action:"INITIATE"},channel:"CITIZEN"},reconnectRequest:!1,disconnectRequest:!1},Digit.WSService.create(e,"SEWERAGE").then((e,n)=>{_(!1);let t=v({},s,{SewerageConnectionResult:e,sewerageConnectionDetails:{proposedWaterClosets:c,proposedToilets:m}});d("",t,"",!0)}).catch(e=>{var n,t,l;_(!1),g({key:"error"}),N((null==e||null===(n=e.response)||void 0===n||null===(t=n.data)||void 0===t||null===(l=t.Errors[0])||void 0===l?void 0:l.message)||null)})}},onSkip:()=>d(),isDisabled:!c||!m||S,onAdd:function(){}},l.createElement(a.CardLabel,null,i("WS_NO_OF_WATER_CLOSETS"),"*"),l.createElement(a.TextInput,v({type:"number",isMandatory:!1,optionKey:"i18nKey",t:i,name:"proposedWaterClosets",onChange:function(e){p(e.target.value)},value:c},y={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:i("ERR_DEFAULT_INPUT_FIELD_MSG")})),l.createElement(a.CardLabel,null,i("WS_SERV_DETAIL_NO_OF_TOILETS"),"*"),l.createElement(a.TextInput,v({type:"number",isMandatory:!1,optionKey:"i18nKey",t:i,name:"proposedToilets",onChange:function(e){E(e.target.value)},value:m},y={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:i("ERR_DEFAULT_INPUT_FIELD_MSG")}))),f&&l.createElement(a.Toast,{error:"error"===(null==f?void 0:f.key),label:C,isDleteBtn:!0,onClose:()=>{g(null),N(null)}}))},WSPlumberPreference:e=>{var n;let{t:o,config:i,onSelect:r,userType:u,formData:d}=e;const[s,c]=t.useState((null==d||null===(n=d.plumberPreference)||void 0===n?void 0:n.plumberPreference)||{i18nKey:"WS_I_WOULD_PREFER_FROM_MUNICIPAL_OFFICE",code:"ULB"});return l.createElement("div",null,"citizen"===u&&l.createElement(Te,{currentStep:2}),l.createElement(a.FormStep,{t:o,config:i,onSelect:()=>{r(i.key,{plumberPreference:s})},onSkip:()=>r(),isDisabled:!s,onAdd:function(){}},l.createElement(a.RadioOrSelect,{name:"plumberPreference",options:[{i18nKey:"WS_I_WOULD_PREFER_FROM_MUNICIPAL_OFFICE",code:"ULB"},{i18nKey:"WS_I_WILL_ARRAGE_THE_PLUMBER_MYSELF",code:"Self"}],selectedOption:s,optionKey:"i18nKey",onSelect:function(e){c(e)},t:o,innerStyles:{display:"flex"},inputStyle:{marginTop:"10px"}})))},WSConnectionHolder:e=>{var n,o,i,r,u,d,s,c,p,E,S,_,f,g,C,N,y,D,T,h,A,I,O,b,L,R,w,W,P,M,x,B,F,U,k;let{t:H,config:j,onSelect:V,userType:z,formData:Y}=e,G={};const[q,K]=t.useState((null==Y||null===(n=Y.ConnectionHolderDetails)||void 0===n?void 0:n.name)||(null==Y||null===(o=Y.formData)||void 0===o||null===(i=o.ConnectionHolderDetails)||void 0===i?void 0:i.name)||""),[X,Z]=t.useState((null==Y||null===(r=Y.ConnectionHolderDetails)||void 0===r?void 0:r.guardian)||(null==Y||null===(u=Y.formData)||void 0===u||null===(d=u.ConnectionHolderDetails)||void 0===d?void 0:d.guardian)||""),[$,J]=t.useState((null==Y||null===(s=Y.ConnectionHolderDetails)||void 0===s?void 0:s.gender)||(null==Y||null===(c=Y.formData)||void 0===c||null===(p=c.ConnectionHolderDetails)||void 0===p?void 0:p.gender)),[Q,ee]=t.useState((null==Y||null===(E=Y.ConnectionHolderDetails)||void 0===E?void 0:E.relationship)||(null==Y||null===(S=Y.formData)||void 0===S||null===(_=S.ConnectionHolderDetails)||void 0===_?void 0:_.relationship)),[ne,te]=t.useState((null==Y||null===(f=Y.ConnectionHolderDetails)||void 0===f?void 0:f.mobileNumber)||(null==Y||null===(g=Y.formData)||void 0===g||null===(C=g.ConnectionHolderDetails)||void 0===C?void 0:C.mobileNumber)||""),[le,oe]=t.useState((null==Y||null===(N=Y.ConnectionHolderDetails)||void 0===N?void 0:N.address)||(null==Y||null===(y=Y.formData)||void 0===y||null===(D=y.ConnectionHolderDetails)||void 0===D?void 0:D.address)||""),[ie,ae]=t.useState((null==Y||null===(T=Y.ConnectionHolderDetails)||void 0===T?void 0:T.documentId)||(null==Y||null===(h=Y.formData)||void 0===h||null===(A=h.ConnectionHolderDetails)||void 0===A?void 0:A.documentId)||""),[re,ue]=t.useState(0!=(null==Y||null===(I=Y.ConnectionHolderDetails)||void 0===I?void 0:I.isOwnerSame)&&0!=(null==Y||null===(O=Y.formData)||void 0===O||null===(b=O.ConnectionHolderDetails)||void 0===b?void 0:b.isOwnerSame)),[de,se]=t.useState((null==Y||null===(L=Y[j.key])||void 0===L?void 0:L.fileStoreId)||null),[ce,ve]=t.useState(null),[pe,me]=t.useState(null),[Ee,Se]=t.useState((null==Y||null===(R=Y.ConnectionHolderDetails)||void 0===R?void 0:R.documentType)||""),[_e,fe]=t.useState((null==Y||null===(w=Y.ConnectionHolderDetails)||void 0===w?void 0:w.specialCategoryType)||{});let ge=window.Digit.Utils.browser.isMobile();const[Ce,Ne]=t.useState((null==Y||null===(W=Y.ConnectionHolderDetails)||void 0===W?void 0:W.emailId)||(null==Y||null===(P=Y.formData)||void 0===P||null===(M=P.ConnectionHolderDetails)||void 0===M?void 0:M.emailId)||""),ye=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId());let De=[];const{data:Ae={}}=Digit.Hooks.pt.usePropertyMDMS(ye,"PropertyTax","Documents"),Ie=null==Ae||null===(x=Ae.PropertyTax)||void 0===x?void 0:x.Documents,Oe=Array.isArray(Ie)&&Ie.filter(e=>e.code.includes("SPECIALCATEGORYPROOF"));var be,Le;Oe.length>0&&(De=null===(be=Oe[0])||void 0===be?void 0:be.dropdownData,De.forEach(e=>{e.i18nKey=m(e.code,".","_")}),De=null===(Le=De)||void 0===Le?void 0:Le.filter(e=>e.parentValue.includes(null==_e?void 0:_e.code)),1==De.length&&Ee!=De[0]&&function(e){Se(e)}(De[0]));const{isLoading:Re,data:we}=Digit.Hooks.obps.useMDMS(ye,"common-masters",["GenderType"]),{data:We}=Digit.Hooks.pt.usePropertyMDMS(ye,"PropertyTax","OwnerType");We&&We.sort((e,n)=>e.name.localeCompare(n.name));let Pe=[];we&&we["common-masters"].GenderType.filter(e=>e.active).map(e=>{Pe.push({i18nKey:"COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})});const Me=e=>{""===e||/^[a-zA-Z0-9._%+-]+@[a-z.-]+\.(com|org|in)$/.test(e)?me(""):me(H("CORE_INVALID_EMAIL_ID_PATTERN"))};t.useEffect(()=>{!function(){try{me(null);const e=function(){if(ce){const e=function(){if(ce.size>=2e6)me(H("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=he(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",ce,Digit.ULBService.getStateId())).then(function(e){var n,t,l,o;(null==e||null===(n=e.data)||void 0===n||null===(t=n.files)||void 0===t?void 0:t.length)>0?se(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):me(H("PT_FILE_UPLOAD_ERROR"))})},function(){me(H("PT_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[ce]),t.useEffect(()=>{Ce&&Me(Ce)},[Ce]);const xe=Array.isArray(null==Y||null===(B=Y.cpt)||void 0===B||null===(F=B.details)||void 0===F?void 0:F.owners)?null==Y||null===(U=Y.cpt)||void 0===U||null===(k=U.details)||void 0===k?void 0:k.owners.slice().reverse():[];return l.createElement("div",null,"citizen"===z&&l.createElement(Te,{currentStep:2}),Re?l.createElement(a.Loader,null):l.createElement(a.FormStep,{config:j,onSelect:()=>{if(!pe)if(1==re){var e,n,t,l,o,i,a,r,u,d,s;let c={isOwnerSame:re,name:null==xe||null===(e=xe[0])||void 0===e?void 0:e.name,mobileNumber:null==xe||null===(n=xe[0])||void 0===n?void 0:n.mobileNumber,gender:null!=xe&&null!==(t=xe[0])&&void 0!==t&&t.gender?{code:null==xe||null===(l=xe[0])||void 0===l?void 0:l.gender,i18nKey:"COMMON_GENDER_"+(null==xe||null===(o=xe[0])||void 0===o?void 0:o.gender)}:null,guardian:null==xe||null===(i=xe[0])||void 0===i?void 0:i.fatherOrHusbandName,address:null==xe||null===(a=xe[0])||void 0===a?void 0:a.permanentAddress,emailId:null==xe||null===(r=xe[0])||void 0===r?void 0:r.emailId,relationship:null!=xe&&null!==(u=xe[0])&&void 0!==u&&u.relationship?{code:null==xe||null===(d=xe[0])||void 0===d?void 0:d.relationship,i18nKey:"COMMON_MASTERS_OWNERTYPE_"+(null==xe||null===(s=xe[0])||void 0===s?void 0:s.relationship)}:null,specialCategoryType:_e,documentId:ie,fileStoreId:de,documentType:Ee};V(j.key,c)}else V(j.key,{isOwnerSame:re,name:q,mobileNumber:ne,gender:$,guardian:X,address:le,relationship:Q,specialCategoryType:_e,emailId:Ce,documentId:ie,fileStoreId:de,documentType:Ee})},onSkip:()=>V(),t:H,isDisabled:!(re||q&&ne&&$&&X&&Q&&null!=_e&&_e.code&&le)},l.createElement("div",null,l.createElement(a.CheckBox,{label:H("WS_CONN_HOLDER_SAME_AS_OWNER_DETAILS"),onChange:e=>{ue(!re)},checked:re,style:{paddingBottom:"10px",paddingTop:"3px"}})),!re&&l.createElement("div",{style:{border:"solid",borderRadius:"5px",padding:"10px",paddingTop:"20px",marginTop:"10px",borderColor:"#f3f3f3",background:"#FAFAFA"}},l.createElement(a.CardLabel,null,H("WS_OWN_DETAIL_NAME")+"*"),l.createElement(a.TextInput,v({t:H,type:"text",style:{background:"#FAFAFA"},isMandatory:!1,optionKey:"i18nKey",name:"name",value:q,onChange:function(e){K(e.target.value)}},G={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:H("WS_NAME_ERROR_MESSAGE")})),l.createElement(a.CardLabel,null,H("WS_OWN_DETAIL_GENDER_LABEL")+"*"),l.createElement(a.RadioButtons,{t:H,options:Pe,optionsKey:"code",name:"gender",value:$,selectedOption:$,onSelect:function(e){J(e)},isDependent:!0,labelKey:"COMMON_GENDER"}),l.createElement(a.CardLabel,null,H("WS_OWN_MOBILE_NO")+"*"),l.createElement(a.MobileNumber,{value:ne,name:"mobileNumber",onChange:e=>function(e){te(e.target.value)}({target:{value:e}}),style:{background:"#FAFAFA"},required:!0,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:H("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}),l.createElement(a.CardLabel,null,H("WS_OWN_DETAIL_GUARDIAN_LABEL")+"*"),l.createElement(a.TextInput,v({t:H,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"guardian",value:X,style:{background:"#FAFAFA"},onChange:function(e){Z(e.target.value)}},G={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:H("WS_NAME_ERROR_MESSAGE")})),l.createElement(a.CardLabel,null,H("WS_OWN_DETAIL_RELATIONSHIP_LABEL")+"*"),l.createElement(a.RadioButtons,{t:H,optionsKey:"i18nKey",name:"relationship",options:[{name:"Father",code:"FATHER",i18nKey:"COMMON_MASTERS_OWNERTYPE_FATHER"},{name:"HUSBAND",code:"HUSBAND",i18nKey:"COMMON_MASTERS_OWNERTYPE_HUSBAND"}],value:Q,selectedOption:Q,onSelect:function(e){ee(e)},isDependent:!0,labelKey:"COMMON_MASTERS_OWNERTYPE"}),l.createElement(a.CardLabel,null,H("WS_COMMON_TABLE_COL_ADDRESS")+"*"),l.createElement(a.TextInput,v({t:H,type:"text",style:{background:"#FAFAFA"},isMandatory:!1,optionKey:"i18nKey",name:"address",value:le,onChange:function(e){oe(e.target.value)}},G={isRequired:!0,title:H("WS_ADDR_ERROR_MESSAGE")})),l.createElement(a.CardLabel,null,H("WS_OWN_SPECIAL_CAT_LABEL")+"*"),l.createElement(a.Dropdown,{className:"form-field",selected:_e,style:ge?{}:{width:"540px"},isMandatory:!0,option:We,select:function(e){fe(e)},optionKey:"i18nKey",t:H}),l.createElement("div",null,l.createElement(a.CardLabel,null,""+H("WS_EMAIL_ID")),l.createElement(a.TextInput,v({t:H,isMandatory:!1,name:"emailId",value:Ce,onChange:e=>{const n=e.target.value;Ne(n),Me(n)}},G={pattern:"[A-Za-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,4}$",type:"Email",title:H("CORE_COMMON_APPLICANT_EMAILI_ID_INVALID")})),pe&&l.createElement("span",{style:{color:"red"}},pe)))))},WSInfoLabel:j,WSActivationDetails:e=>{let{t:n}=e;const[t,o]=l.useState({meterId:"",meterInstallationDate:"",meterInitialReading:"",connectionExecutionDate:""});return l.useEffect(()=>{}),l.createElement(l.Fragment,null,l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{className:"card-label-smaller",style:{fontWeight:"700"}},""+n("WS_METER_ID")),l.createElement("div",{className:"field"},l.createElement(a.TextInput,{t:n,type:"text",optionKey:"i18nKey",name:"meterId",value:t.meterId,onChange:e=>{o(v({},t,{meterId:e.target.value}))}}))),l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{className:"card-label-smaller",style:{fontWeight:"700"}},""+n("WS_METER_INSTALLATION_DATE")),l.createElement("div",{className:"field"},l.createElement(a.DatePicker,{date:t.meterInstallationDate,onChange:e=>{o(v({},t,{meterInstallationDate:e}))}}))),l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{className:"card-label-smaller",style:{fontWeight:"700"}},""+n("WS_INIT_METER_READING")),l.createElement("div",{className:"field"},l.createElement(a.TextInput,{value:t.meterInitialReading,onChange:e=>{o(v({},t,{meterInitialReading:e.target.value}))}}))),l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{className:"card-label-smaller",style:{fontWeight:"700"}},""+n("WS_CONN_EXEC_DATE")),l.createElement("div",{className:"field"},l.createElement(a.DatePicker,{date:t.connectionExecutionDate,onChange:e=>{o(v({},t,{connectionExecutionDate:e}))}}))))},WSConnectionDetails:e=>{var n;let{config:r,onSelect:u,userType:d,formData:s,setError:c,formState:p,clearErrors:m}=e;const{t:E}=o.useTranslation(),[S,_]=(i.useLocation(),t.useState(null!=s&&s.ConnectionDetails?[null==s||null===(n=s.ConnectionDetails)||void 0===n?void 0:n[0]]:[{water:!0,sewerage:!1,proposedPipeSize:"",proposedTaps:"",proposedToilets:"",proposedWaterClosets:""}])),[f,g]=t.useState({index:-1,type:""}),C=Digit.ULBService.getStateId(),[N,y]=t.useState(!1),[D,T]=t.useState({water:!0,sewerage:!1}),[h,A]=t.useState([]),{isWSServicesCalculationLoading:I,data:O}=Digit.Hooks.ws.useMDMS(C,"ws-services-calculation",["PipeSize"]);if(t.useEffect(()=>{const e=S.map(e=>e);u(null==r?void 0:r.key,e)},[S]),t.useEffect(()=>{var e;const n=(null==O||null===(e=O["ws-services-calculation"])||void 0===e?void 0:e.PipeSize)||[];null==n||n.forEach(e=>e.i18nKey=e.size),A(n)},[O]),t.useEffect(()=>{var e,n;"employee"===d&&u(r.key,v({},s[r.key],S)),null!=S&&null!==(e=S[0])&&void 0!==e&&e.water&&T({water:!0,sewerage:!1}),null!=S&&null!==(n=S[0])&&void 0!==n&&n.sewerage&&T({water:!1,sewerage:!0})},[S]),t.useEffect(()=>{null!=s&&s.ConnectionDetails||_([{water:!0,sewerage:!1,proposedPipeSize:"",proposedTaps:"",proposedToilets:"",proposedWaterClosets:""}])},[null==s?void 0:s.ConnectionDetails]),I)return l.createElement(a.Loader,null);const b={focusIndex:f,connectionDetails:S,setFocusIndex:g,formData:s,formState:p,t:E,setError:c,clearErrors:m,config:r,setConnectionDetails:_,setIsErrors:y,isErrors:N,pipeSizeList:h,wsServicesCalculationData:O,waterSewarageSelection:D,formData:s};return l.createElement(l.Fragment,null,S.map((e,n)=>l.createElement(Ie,v({key:e.key,index:n,connectionDetail:e},b))))},WSDocumentsRequired:()=>l.createElement("div",null,"WSDocumentsRequired"),WSPlumberDetails:e=>{let{t:n,config:t}=e;const[o,i]=l.useState({plumberName:"",plumberMobileNo:"",plumberLicenseNo:"",plumberProvideBy:{code:"",value:"",i18nKey:""}});return l.useEffect(()=>{}),l.createElement(l.Fragment,null,l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{className:"card-label-smaller"},n("WS_PLUMBER_PROVIDED_BY")),l.createElement("div",{className:"field"},l.createElement(a.Dropdown,{t:n,key:null==t?void 0:t.key,selected:o.plumberProvideBy,select:e=>{i(v({},o,{plumberProvideBy:e}))}}))),l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{className:"card-label-smaller"},n("WS_PLUMBER_LICENSE_NUMBER")),l.createElement("div",{className:"field"},l.createElement(a.TextInput,{key:t.key,value:o.plumberLicenseNo,onChange:e=>{i(v({},o,{plumberLicenseNo:e.target.value}))}}))),l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{className:"card-label-smaller"},n("WS_PLUMBER_NAME")),l.createElement("div",{className:"field"},l.createElement(a.TextInput,{key:t.key,value:o.plumberName,onChange:e=>{i(v({},o,{plumberName:e.target.value}))}}))),l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{className:"card-label-smaller"},n("WS_PLUMBER_MOB_NUMBER")),l.createElement("div",{className:"field"},l.createElement(a.TextInput,{key:t.key,value:o.plumberMobileNo,onChange:e=>{i(v({},o,{plumberMobileNo:e.target.value}))}}))))},WSRoadCuttingDetails:e=>{let{config:n,onSelect:r,formData:u,setError:d,formState:s,clearErrors:c}=e;const{t:p}=o.useTranslation(),{pathname:m}=i.useLocation(),E=m.includes("/modify-application/"),S=Digit.ULBService.getStateId(),{isMdmsLoading:_,data:f}=Digit.Hooks.ws.useMDMS(S,window.location.href.includes("sewerage")?"sw-services-calculation":"ws-services-calculation",["RoadType"]),[g,C]=t.useState((null==u?void 0:u.roadCuttingDetails)||[Oe()]),[N,y]=t.useState({index:-1,type:""});t.useEffect(()=>{r(null==n?void 0:n.key,g)},[g]);const D={focusIndex:N,allRoadCuttingDetails:g,setFocusIndex:y,removeroadCutt:e=>{C(null!==(null==e?void 0:e.id)?n=>n.map(n=>n.key==e.key&&null!==n.id?v({},e,{id:n.id,status:"INACTIVE"}):v({},n)):n=>n.filter(n=>n.key!=e.key))},formData:u,formState:s,setRoadCuttingDetails:C,mdmsData:f,t:p,setError:d,clearErrors:c,config:n,isEditScreen:E};return _?l.createElement(Loader,null):l.createElement(l.Fragment,null,g.filter(e=>"INACTIVE"!==e.status).map((e,n)=>l.createElement(be,v({key:e.key,index:n,roadCutt:e},D))),l.createElement(a.LinkButton,{label:p("WS_ADD_ROAD_TYPE"),onClick:()=>{const e=Oe();C(n=>[...n,e])},style:{color:"orange",display:"inline-block"}}))},WSPropertyDetails:e=>{var n,t,o,r,u,d;let{t:s,config:c,onSelect:v,formData:p}=e;const[m,E]=l.useState(""),S=null===(n=Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY"))||void 0===n?void 0:n.code,{isLoading:_,data:f}=Digit.Hooks.pt.usePropertySearch({filters:{propertyIds:null==p||null===(t=p.cptId)||void 0===t?void 0:t.id},tenantId:S},{filters:{propertyIds:null==p||null===(o=p.cptId)||void 0===o?void 0:o.id},tenantId:S});return _?l.createElement(a.Loader,null):l.createElement(l.Fragment,null,l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{className:"card-label-smaller"},""+s("PROPERTY_ID")),l.createElement("div",{className:"field",style:{marginTop:"20px"}},l.createElement(a.TextInput,{key:c.key,value:m,onChange:e=>{E(e.target.value),v(c.key,{id:e.target.value})},style:{width:"65%",float:"left",marginRight:"20px"}}),l.createElement("button",{className:"submit-bar",type:"button",onClick:()=>E(m)},""+s("PT_SEARCH")))),l.createElement(i.Link,{to:"/digit-ui/employee/pt/search"},l.createElement(a.LinkButton,{label:s("CPT_SEARCH_PROPERTY"),style:{color:"#a82227",display:"inline-block"}}))," | ",l.createElement(i.Link,{to:"/digit-ui/employee/pt/new-application"},l.createElement(a.LinkButton,{label:s("CPT_CREATE_PROPERTY"),style:{color:"#a82227",display:"inline-block"}})),f&&(null==f?void 0:f.Properties.length)&&l.createElement(l.Fragment,null,l.createElement("header",{className:"card-section-header",style:{marginBottom:0,marginTop:"20px"}},s("PT_DETAILS")),l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{className:"card-label-smaller"},""+s("PROPERTY_ID")),l.createElement("div",{className:"field"},l.createElement("p",null,null==f||null===(r=f.Properties[0])||void 0===r?void 0:r.propertyId))),l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{className:"card-label-smaller"},""+s("OWNER_NAME")),l.createElement("div",{className:"field"},l.createElement("p",null,null==f||null===(u=f.Properties[0])||void 0===u||null===(d=u.owners[0])||void 0===d?void 0:d.name))),l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{className:"card-label-smaller"},""+s("PROPERTY_ADDRESS")),l.createElement("div",{className:"field"},l.createElement("p",null,(()=>{var e,n,t,l,o,i,a;const r=null==f||null===(e=f.Properties)||void 0===e?void 0:e.at(0),u=null==r?void 0:r.doorNo,d=null==r||null===(n=r.address)||void 0===n?void 0:n.street,s=null==r||null===(t=r.address)||void 0===t?void 0:t.landmark,c=null==r||null===(l=r.address)||void 0===l||null===(o=l.locality)||void 0===o?void 0:o.name,v=null==r||null===(i=r.address)||void 0===i?void 0:i.city,p=null==r||null===(a=r.address)||void 0===a?void 0:a.pincode;return(u?u+", ":"")+"\n "+(d?d+", ":"")+"\n "+(s?s+", ":"")+"\n "+(c?c+", ":"")+"\n "+(v||"")+"\n "+(p?", "+p:"")})()))),l.createElement(i.Link,{to:"/digit-ui/employee/commonpt/view-property?propertyId="+m+"&tenantId="+S},l.createElement(a.LinkButton,{label:s("CPT_COMPLETE_PROPERTY_DETAILS"),style:{color:"#a82227"}}))))},WSConnectionHolderDetails:e=>{var n,a,r,u;let{config:d,onSelect:s,userType:c,formData:p,setError:E,formState:S,clearErrors:_}=e;const{t:f}=o.useTranslation(),C=(i.useLocation(),g(location.search)),[N,y]=t.useState(null!=p&&p.ConnectionHolderDetails?[v({},null==p||null===(n=p.ConnectionHolderDetails)||void 0===n?void 0:n[0])]:[{sameAsOwnerDetails:!0,name:"",gender:"",mobileNumber:"",guardian:"",relationship:"",address:"",ownerType:"",documentId:"",documentType:"",file:"",emailId:""}]),[D,T]=t.useState({index:-1,type:""}),h=Digit.ULBService.getStateId(),[A,I]=t.useState(!1),[O,b]=t.useState((null==p||null===(a=p[d.key])||void 0===a?void 0:a.fileStoreId)||null),[L,R]=t.useState(null),{data:w}=Digit.Hooks.obps.useMDMS(h,"common-masters",["GenderType"]);let W=[];w&&w["common-masters"].GenderType.filter(e=>e.active).map(e=>{W.push({i18nKey:"COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})});let P=[];const{data:M={}}=Digit.Hooks.pt.usePropertyMDMS(h,"PropertyTax","Documents"),x=null==M||null===(r=M.PropertyTax)||void 0===r?void 0:r.Documents,B=Array.isArray(x)&&x.filter(e=>e.code.includes("SPECIALCATEGORYPROOF"));var F,U;B.length>0&&(P=null===(F=B[0])||void 0===F?void 0:F.dropdownData,P.forEach(e=>{e.i18nKey=m(e.code,".","_")}),P=null===(U=P)||void 0===U?void 0:U.filter(e=>{var n;return e.parentValue.includes(null==N||null===(n=N[0])||void 0===n?void 0:n.ownerType)}),1==P.length&&dropdownValue!=P[0]&&setTypeOfDropdownValue(P[0]));const{data:k}=Digit.Hooks.pt.usePropertyMDMS(h,"PropertyTax","OwnerType");k&&k.sort((e,n)=>e.name.localeCompare(n.name)),t.useEffect(()=>{const e=N.map(e=>e);s(null==d?void 0:d.key,e)},[N]),t.useEffect(()=>{var e;"employee"===c&&s(d.key,[v({},null===(e=p[d.key])||void 0===e?void 0:e[0],null==N?void 0:N[0])])},[N]),t.useEffect(()=>{var e,n,t,l,o,i,a,r,u,d,s,c,v,m,E,S,_,f,g,C,y,D,T,h,A,I,O,b,L,R,w,W,P,M,x,B;e=sessionStorage.getItem("eyeIconClicked"),(window.location.href.includes("edit")||window.location.href.includes("modify"))&&null!=p&&p.ConnectionHolderDetails&&(null===(n=Object.values(null==p||null===(t=p.ConnectionHolderDetails)||void 0===t?void 0:t[0]))||void 0===n?void 0:n.length)>1&&("gender"===e&&null!=N&&null!==(l=N[0])&&void 0!==l&&null!==(o=l.gender)&&void 0!==o&&o.code&&(null==p||null===(i=p.ConnectionHolderDetails)||void 0===i||null===(a=i[0])||void 0===a||null===(r=a.gender)||void 0===r?void 0:r.code)!==(null==N||null===(u=N[0])||void 0===u||null===(d=u.gender)||void 0===d?void 0:d.code)||"connectionHoldersMobileNumber"===e&&null!=N&&null!==(s=N[0])&&void 0!==s&&s.mobileNumber&&(null==p||null===(c=p.ConnectionHolderDetails)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.mobileNumber)!==(null==N||null===(m=N[0])||void 0===m?void 0:m.mobileNumber)||"fatherOrHusbandName"===e&&null!=N&&null!==(E=N[0])&&void 0!==E&&E.guardian&&(null==p||null===(S=p.ConnectionHolderDetails)||void 0===S||null===(_=S[0])||void 0===_?void 0:_.guardian)!==(null==N||null===(f=N[0])||void 0===f?void 0:f.guardian)||"relationship"===e&&null!=N&&null!==(g=N[0])&&void 0!==g&&null!==(C=g.relationship)&&void 0!==C&&C.code&&(null==p||null===(y=p.ConnectionHolderDetails)||void 0===y||null===(D=y[0])||void 0===D||null===(T=D.relationship)||void 0===T?void 0:T.code)!==(null==N||null===(h=N[0])||void 0===h||null===(A=h.relationship)||void 0===A?void 0:A.code)||"correspondenceAddress"===e&&null!=N&&null!==(I=N[0])&&void 0!==I&&I.address&&(null==p||null===(O=p.ConnectionHolderDetails)||void 0===O||null===(b=O[0])||void 0===b?void 0:b.address)!==(null==N||null===(L=N[0])||void 0===L?void 0:L.address)||"ownerType"===e&&null!=N&&null!==(R=N[0])&&void 0!==R&&null!==(w=R.ownerType)&&void 0!==w&&w.code&&(null==p||null===(W=p.ConnectionHolderDetails)||void 0===W||null===(P=W[0])||void 0===P||null===(M=P.ownerType)||void 0===M?void 0:M.code)!==(null==N||null===(x=N[0])||void 0===x||null===(B=x.ownerType)||void 0===B?void 0:B.code))&&(sessionStorage.removeItem("eyeIconClicked"),window.location.reload())},[null==p||null===(u=p.ConnectionHolderDetails)||void 0===u?void 0:u[0],N,p]),t.useEffect(()=>{null!=p&&p.ConnectionHolderDetails||y([{sameAsOwnerDetails:!0,name:"",gender:"",mobileNumber:"",guardian:"",relationship:"",address:"",ownerType:"",documentId:"",documentType:"",file:"",emailId:""}])},[null==p?void 0:p.ConnectionHolderDetails]);const H={focusIndex:D,connectionHolderDetails:N,setFocusIndex:T,formData:p,formState:S,t:f,setError:E,clearErrors:_,config:d,setConnectionHolderDetails:y,setIsErrors:I,isErrors:A,connectionHolderDetails:N,filters:C,menu:W,uploadedFile:O,setUploadedFile:b,file:L,setFile:R,dropdownData:P,GuardianOptions:[{name:"HUSBAND",code:"HUSBAND",i18nKey:"COMMON_MASTERS_OWNERTYPE_HUSBAND"},{name:"Father",code:"FATHER",i18nKey:"COMMON_MASTERS_OWNERTYPE_FATHER"}],Menu:k};return l.createElement(l.Fragment,null,N.map((e,n)=>l.createElement(Le,v({key:e.key,index:n,connectionHolderDetail:e},H))))},WSActivationConnectionDetails:e=>{var n,r,u;let{config:d,onSelect:s,userType:c,formData:p,setError:E,formState:S,clearErrors:_}=e;const{t:f}=o.useTranslation(),C=(i.useLocation(),g(location.search)),[N,y]=window.location.href.includes("modify")?t.useState(null!=p&&p.connectionDetails?[null==p||null===(n=p.connectionDetails)||void 0===n?void 0:n[0]]:[Rt(null==C||null===(r=C.service)||void 0===r?void 0:r.toUpperCase())]):t.useState((null==p?void 0:p.connectionDetails)||[Rt(null==C||null===(u=C.service)||void 0===u?void 0:u.toUpperCase())]),[D,T]=t.useState({index:-1,type:""}),h=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),[A,I]=t.useState(!1),[O,b]=t.useState([]),[L,R]=t.useState([]),[w,W]=t.useState([]),[P,M]=t.useState([]),{isMdmsLoading:x,data:B}=Digit.Hooks.ws.useMDMS(h,"ws-services-masters",["connectionType","waterSource"]),{isWSServicesCalculationLoading:F,data:U}=Digit.Hooks.ws.useMDMS(h,"ws-services-calculation",["PipeSize"]);if(t.useEffect(()=>{const e=N.map(e=>e);s(null==d?void 0:d.key,e)},[N]),t.useEffect(()=>{var e,n,t,l,o,i;const a=(null==U||null===(e=U["ws-services-calculation"])||void 0===e?void 0:e.PipeSize)||[];null==a||a.forEach(e=>e.i18nKey=e.size);const r=(null==B||null===(n=B["ws-services-masters"])||void 0===n?void 0:n.connectionType)||[];null==r||r.forEach(e=>{var n;return e.i18nKey="WS_CONNECTIONTYPE_"+m(null==e||null===(n=e.code)||void 0===n?void 0:n.toUpperCase()," ","_")});const u=(null==B||null===(t=B["ws-services-masters"])||void 0===t?void 0:t.waterSource)&&Lt(null==B||null===(l=B["ws-services-masters"])||void 0===l?void 0:l.waterSource)||[];null==u||u.forEach(e=>{var n,t;return e.i18nKey="WS_SERVICES_MASTERS_WATERSOURCE_"+m(null==e||null===(n=e.code)||void 0===n||null===(t=n.split(".")[0])||void 0===t?void 0:t.toUpperCase()," ","_")});var d,s=[],c=[],v=u.length;for(d=0;d<v;d++){var p,E;s[u[d].i18nKey]||(s[u[d].i18nKey]=!0,c.push({i18nKey:null==u||null===(p=u[d])||void 0===p?void 0:p.i18nKey,code:null==u||null===(E=u[d])||void 0===E?void 0:E.code}))}if(b(a),R(r),W(c),null!=N&&null!==(o=N[0])&&void 0!==o&&null!==(i=o.waterSource)&&void 0!==i&&i.code){var S,_;const e=(null==B||null===(S=B["ws-services-masters"])||void 0===S?void 0:S.waterSource)&&Lt(null==B||null===(_=B["ws-services-masters"])||void 0===_?void 0:_.waterSource)||[];null==e||e.forEach(e=>{var n;return e.i18nKey="WS_SERVICES_MASTERS_WATERSOURCE_"+m(null==e||null===(n=e.code)||void 0===n?void 0:n.toUpperCase(),".","_")});const n=null==e?void 0:e.filter(e=>{var n,t,l,o;return(null==N||null===(n=N[0])||void 0===n||null===(t=n.waterSource)||void 0===t||null===(l=t.code)||void 0===l?void 0:l.split(".")[0])==(null==e||null===(o=e.code)||void 0===o?void 0:o.split(".")[0])});M(n)}},[B,U]),t.useEffect(()=>{"employee"===c&&s(d.key,v({},p[d.key],N))},[N]),x||F)return l.createElement(a.Loader,null);const k={focusIndex:D,allOwners:N,setFocusIndex:T,formData:p,formState:S,t:f,setError:E,clearErrors:_,config:d,setConnectionDetails:y,setIsErrors:I,isErrors:A,connectionDetails:N,connectionTypeList:L,waterSourceList:w,waterSubSourceList:P,pipeSizeList:O,filters:C,setWaterSubSourceList:M,mdmsData:B};return l.createElement(l.Fragment,null,N.map((e,n)=>l.createElement(wt,v({key:e.key,index:n,connectionDetail:e},k))))},WSActivationPlumberDetails:e=>{var n,i;let{config:a,onSelect:r,formData:u,setError:d,formState:s,clearErrors:c}=e;const{t:p}=o.useTranslation(),m=g(location.search),[E,S]=t.useState((null==u?void 0:u.plumberDetails)||[[{plumberName:"",plumberMobileNo:"",plumberLicenseNo:"",detailsProvidedBy:""}]]),[_,f]=t.useState({index:-1,type:""}),[C,N]=t.useState(!1);t.useEffect(()=>{const e=E.map(e=>e);r(null==a?void 0:a.key,e)},[E,null==u||null===(n=u.connectionDetails)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.connectionType]);const y={focusIndex:_,allOwners:E,setFocusIndex:f,formData:u,formState:s,t:p,setError:d,clearErrors:c,config:a,setPlumberDetails:S,setIsErrors:N,isErrors:C,plumberDetails:E,filters:m,options:[{i18nKey:"WS_PLUMBER_ULB",code:"ULB"},{i18nKey:"WS_PLUMBER_SELF",code:"Self"}],setPlumberDetails:S};return l.createElement(l.Fragment,null,E.map((e,n)=>l.createElement(Wt,v({key:e.key,index:n,plumberDetail:e},y))))},WSActivationPageDetails:e=>{var n;let{config:i,onSelect:a,userType:r,formData:u,setError:d,formState:s,clearErrors:c}=e;const{t:p}=o.useTranslation(),m=g(location.search),[E,S]=window.location.href.includes("modify")?t.useState(null!=u&&u.activationDetails?[null==u||null===(n=u.activationDetails)||void 0===n?void 0:n[0]]:[{meterId:"",meterInstallationDate:null,meterInitialReading:"",connectionExecutionDate:null}]):t.useState((null==u?void 0:u.activationDetails)||[{meterId:"",meterInstallationDate:null,meterInitialReading:"",connectionExecutionDate:null}]),[_,f]=t.useState({index:-1,type:""}),[C,N]=t.useState(!1);t.useEffect(()=>{const e=E.map(e=>e);a(null==i?void 0:i.key,e)},[E]),t.useEffect(()=>{"employee"===r&&a(i.key,v({},u[i.key],E))},[E]);const y={focusIndex:_,allOwners:E,setFocusIndex:f,formData:u,formData2:u,formState:s,t:p,setError:d,clearErrors:c,config:i,setActivationDetails:S,setIsErrors:N,isErrors:C,activationDetails:E,filters:m};return l.createElement(l.Fragment,null,E.map((e,n)=>l.createElement(Pt,v({key:e.key,index:n,activationDetail:e},y))))},WSActivationCommentsDetails:e=>{var n;let{t:o,config:i,userType:r,formData:u,onSelect:d}=e;const[s,c]=t.useState({comments:(null==u||null===(n=u.comments)||void 0===n?void 0:n.comments)||""});return t.useEffect(()=>{}),t.useEffect(()=>{"employee"===r&&d(i.key,v({},u[i.key],s))},[s]),l.createElement(l.Fragment,null,l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:{fontWeight:"700"},className:"card-label-smaller"},o("WF_COMMON_COMMENTS"),":"),l.createElement("div",{className:"field"},l.createElement(a.TextInput,{key:i.key,value:s.comments,onChange:e=>{c(v({},s,{comments:e.target.value}))}}))))},WSActivationSupportingDocuments:e=>{var n,o;let{t:i,config:r,userType:u,formData:d,onSelect:s}=e;Digit.ULBService.getStateId();const c=Digit.ULBService.getCurrentTenantId(),[p,m]=t.useState(null!=d&&null!==(n=d.supportingDocuments)&&void 0!==n&&n[0]?[null==d||null===(o=d.supportingDocuments)||void 0===o?void 0:o[0]]:[]),[E,S]=t.useState(null),[_,f]=t.useState(null),[g,C]=t.useState(null);return t.useEffect(()=>{s(r.key,{documents:p})},[p]),t.useEffect(()=>{"employee"===u&&s(r.key,v({},d[r.key],p))},[p]),t.useEffect(()=>{!function(){try{S(null);const e=function(){if(g){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,n=function(){if(g.size>=5242880)S(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const n=function(){if(null!=g&&g.type&&!e.test(null==g?void 0:g.type))S(i("NOT_SUPPORTED_FILE_TYPE"));else{const e=he(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",g,c)).then(function(e){var n,t,l,o;(null==e||null===(n=e.data)||void 0===n||null===(t=n.files)||void 0===t?void 0:t.length)>0?f(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):S(i("CS_FILE_UPLOAD_ERROR"))})},function(){S(i("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(n&&n.then)return n.then(function(){})}}();if(n&&n.then)return n.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[g]),t.useEffect(()=>{_&&m(e=>[{fileStoreId:_,documentUid:_}])},[_]),l.createElement("div",null,l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{className:"card-label-smaller",style:{fontWeight:"700"}},i("WF_APPROVAL_UPLOAD_HEAD"),":"),l.createElement("div",{className:"field"},l.createElement(a.UploadFile,{onUpload:e=>{!function(e){C(e.target.files[0])}(e)},onDelete:()=>{f(null)},message:_?"1 "+i("CS_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},inputStyles:{width:"280px"},buttonType:"button",accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:E}))))},WSDocumentsEmployee:e=>{var n,o,r,u;let{t:d,config:s,onSelect:c,formData:v,setError:p,clearErrors:m,formState:E}=e;Digit.ULBService.getCurrentTenantId();const S=Digit.ULBService.getStateId(),[_,f]=t.useState((null==v||null===(n=v.DocumentsRequired)||void 0===n?void 0:n.documents)||[]),[g,C]=t.useState(null),N=window.location.href.includes("modify")?"ModifyConnectionDocuments":window.location.href.includes("disconnection")?"DisconnectionDocuments":"Documents";let y="create";const{pathname:D}=i.useLocation(),T=D.includes("/modify-application/");D.includes("/property-mutate/"),T&&(y="update");const{isLoading:h,data:A}=Digit.Hooks.ws.WSSearchMdmsTypes.useWSServicesMasters(S,N);if(t.useEffect(()=>{c(s.key,{documents:_})},[_]),h)return l.createElement(a.Loader,null);const I=JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS"));if(window.location.href.includes("edit")&&(null==I||null===(o=I.applicationData)||void 0===o||null===(r=o.documents)||void 0===r?void 0:r.length)>0){var O;const e=(null==I||null===(O=I.applicationData)||void 0===O?void 0:O.documents)||[];null==e||e.map(e=>{var n;null==A||null===(n=A[N])||void 0===n||n.forEach(n=>{var t,l,o,i,a,r,u,d;(null!=n&&null!==(t=n.code)&&void 0!==t&&t.split(".")[1]?(null==n||null===(l=n.code)||void 0===l?void 0:l.split(".")[0])+"."+(null==n||null===(o=n.code)||void 0===o?void 0:o.split(".")[1]):null==n||null===(i=n.code)||void 0===i?void 0:i.split(".")[0])==(null!=e&&null!==(a=e.documentType)&&void 0!==a&&a.split(".")[1]?(null==e||null===(r=e.documentType)||void 0===r?void 0:r.split(".")[0])+"."+(null==e||null===(u=e.documentType)||void 0===u?void 0:u.split(".")[1]):null==e||null===(d=e.documentType)||void 0===d?void 0:d.split(".")[0])&&(n.auditDetails=e.auditDetails,n.documentType=n.documentType,n.documentUid=e.documentUid,n.fileStoreId=e.fileStoreId,n.id=e.id,n.status="ACTIVE")})})}return l.createElement("div",null,null==A||null===(u=A[N])||void 0===u?void 0:u.map((e,n)=>l.createElement(Mt,{key:n,document:e,action:y,t:d,id:"pt-document-"+n,error:g,setError:C,setDocuments:f,documents:_,formData:v,setFormError:p,clearFormErrors:m,config:s,formState:E})),g&&l.createElement(a.Toast,{label:g,onClose:()=>C(null),error:!0}))},WSEditConnectionDetails:e=>{var n;let{config:r,onSelect:u,userType:d,formData:s,setError:c,formState:p,clearErrors:m}=e,E=g(location.search);const S=null==E?void 0:E.applicationNumber,{t:_}=o.useTranslation(),[f,C]=(i.useLocation(),t.useState(null!=s&&s.ConnectionDetails?[null==s||null===(n=s.ConnectionDetails)||void 0===n?void 0:n[0]]:[{water:!0,sewerage:!1,applicationNo:"",serviceName:"",proposedPipeSize:"",proposedTaps:"",proposedToilets:"",proposedWaterClosets:""}])),[N,y]=t.useState({index:-1,type:""}),D=Digit.ULBService.getStateId(),[T,h]=t.useState(!1),[A,I]=t.useState({water:!0,sewerage:!1}),[O,b]=t.useState([]),{isWSServicesCalculationLoading:L,data:R}=Digit.Hooks.ws.useMDMS(D,"ws-services-calculation",["PipeSize"]);if(t.useEffect(()=>{const e=f.map(e=>e);u(null==r?void 0:r.key,e)},[f]),t.useEffect(()=>{var e;const n=(null==R||null===(e=R["ws-services-calculation"])||void 0===e?void 0:e.PipeSize)||[];null==n||n.forEach(e=>e.i18nKey=e.size),b(n)},[R]),t.useEffect(()=>{var e,n;"employee"===d&&u(r.key,v({},s[r.key],f)),null!=f&&null!==(e=f[0])&&void 0!==e&&e.water&&I({water:!0,sewerage:!1}),null!=f&&null!==(n=f[0])&&void 0!==n&&n.sewerage&&I({water:!1,sewerage:!0})},[f]),t.useEffect(()=>{null!=s&&s.ConnectionDetails||C([{water:!0,sewerage:!1,applicationNo:"",serviceName:"",proposedPipeSize:"",proposedTaps:"",proposedToilets:"",proposedWaterClosets:""}])},[null==s?void 0:s.ConnectionDetails]),L)return l.createElement(a.Loader,null);const w={focusIndex:N,connectionDetails:f,setFocusIndex:y,formData:s,formState:p,t:_,setError:c,clearErrors:m,config:r,setConnectionDetails:C,setIsErrors:h,isErrors:T,pipeSizeList:O,wsServicesCalculationData:R,waterSewarageSelection:A,applicationNumber:S};return l.createElement(l.Fragment,null,f.map((e,n)=>l.createElement(xt,v({key:e.key,index:n,connectionDetail:e},w))))},WSDisconnectionDocsRequired:e=>{var n;let{userType:r}=e;const{t:u}=o.useTranslation(),d=i.useHistory(),s=i.useRouteMatch(),c=Digit.ULBService.getStateId(),{isLoading:v,data:p}=Digit.Hooks.ws.WSSearchMdmsTypes.useWSServicesMasters(c,"DisconnectionDocuments");var m;return"citizen"===r?l.createElement(t.Fragment,null,l.createElement(a.Card,null,l.createElement(a.CardHeader,null,u("WS_COMMON_APPLICATION_DISCONNECTION")),l.createElement(a.CitizenInfoLabel,{style:{margin:"0px"},textStyle:{color:"#0B0C0C",paddingLeft:"40px",paddingRight:"40px"},text:u("WS_DOCS_REQUIRED_TIME"),showInfo:!1}),l.createElement(a.CardText,{style:{color:"#0B0C0C",marginTop:"12px"}},u("WS_NEW_CONNECTION_TEST_1")),l.createElement(a.CardText,{style:{color:"#0B0C0C",marginTop:"12px"}},u("WS_NEW_CONNECTION_TEST_2")),l.createElement(a.CardSubHeader,null,u("WS_DOC_REQ_SCREEN_LABEL")),l.createElement(a.CardText,{style:{color:"#0B0C0C",marginTop:"12px"}},u("WS_NEW_CONNECTION_TEST_3")),v?l.createElement(a.Loader,null):l.createElement(t.Fragment,null,null==p||null===(m=p.DisconnectionDocuments)||void 0===m?void 0:m.map((e,n)=>{var t;return l.createElement("div",null,l.createElement("div",{style:{fontWeight:700,marginBottom:"8px"},key:n},l.createElement("div",{style:{display:"flex"}},l.createElement("div",null,n+1+"."," "),l.createElement("div",null," "+u(null==e?void 0:e.code.replace(".","_"))))),l.createElement("div",{style:{marginBottom:"16px",marginLeft:"18px",color:"gray"}},null==e||null===(t=e.dropdownData)||void 0===t?void 0:t.map((n,t)=>{var o;return(null==e||null===(o=e.dropdownData)||void 0===o?void 0:o.length)!==t+1?l.createElement("span",{style:{color:"gray"}},u(null==n?void 0:n.i18nKey)+", "):l.createElement("span",{style:{color:"gray"}},""+u(null==n?void 0:n.i18nKey))})))})),l.createElement(a.SubmitBar,{label:u("CS_COMMON_NEXT"),onSubmit:()=>{d.push(s.path.replace("docsrequired","application-form"))}}))):l.createElement("div",{style:{margin:"16px"}},l.createElement(a.Header,{styles:{fontSize:"32px",marginLeft:"18px"}},u("WS_WATER_AND_SEWERAGE_DISCONNECTION")),l.createElement(a.Card,null,v?l.createElement(a.Loader,null):l.createElement("div",{id:"documents-div"},null==p||null===(n=p.DisconnectionDocuments)||void 0===n?void 0:n.map((e,n)=>{var t;return l.createElement("div",{key:n,style:{marginTop:"16px"}},l.createElement(a.CardSectionHeader,{style:{marginBottom:"16px",lineHeight:"28px",fontSize:"24px"}},u(null==e?void 0:e.code.replace(".","_"))),e.dropdownData&&e.dropdownData.length>1&&l.createElement("p",{style:{lineHeight:"24px",fontSize:"16px"}},u((null==e?void 0:e.code.replace(".","_"))+"_DESCRIPTION")),l.createElement("div",{style:{margin:"16px 0",lineHeight:"18px",fontSize:"16px"}},null==e||null===(t=e.dropdownData)||void 0===t?void 0:t.map((e,n)=>l.createElement("p",{style:{fontWeight:"bold",lineHeight:"32px"}},n+1+". "+u(null==e?void 0:e.i18nKey)))),l.createElement("p",{style:{fontSize:"16px"}},u((null==e?void 0:e.code.replace(".","_"))+"_BELOW_DESCRIPTION")))})),l.createElement(a.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},l.createElement(a.SubmitBar,{label:u("ACTION_TEST_APPLY"),onSubmit:()=>{d.push(s.path.replace("docsrequired","application-form"))},style:{margin:"10px 10px 0px 0px"},disabled:!!v}))))},WSDisconnectionForm:e=>{var n,o,r,u,d,s,c,p,E,S,_;let{t:f,config:g,onSelect:C,userType:y}=e;const D=Digit.ULBService.getStateId(),T=Digit.ULBService.getCurrentTenantId(),h=window.Digit.Utils.browser.isMobile(),O=Digit.SessionStorage.get("WS_DISCONNECTION"),b=i.useHistory(),L=i.useRouteMatch(),[R,w]=t.useState({type:O.WSDisconnectionForm?O.WSDisconnectionForm.type:"",date:O.WSDisconnectionForm?O.WSDisconnectionForm.date:"",endDate:O.WSDisconnectionForm&&(null==O||null===(n=O.WSDisconnectionForm)||void 0===n?void 0:n.endDate)||"",reason:O.WSDisconnectionForm?O.WSDisconnectionForm.reason:"",documents:O.WSDisconnectionForm?O.WSDisconnectionForm.documents:[]}),[W,P]=t.useState(O.WSDisconnectionForm?O.WSDisconnectionForm.documents:[]),[M,x]=t.useState(null),[B,F]=t.useState([]),[U,k]=t.useState([]),[H,j]=t.useState(!1),[V,z]=t.useState(!1),{isMdmsLoading:Y,data:G}=Digit.Hooks.ws.useMDMS(D,"ws-services-masters",["disconnectionType"]),{data:q}=Digit.Hooks.ws.useMDMS(D,"ws-services-masters",["DisconnectionReason"]),{isLoading:K,data:X}=Digit.Hooks.ws.WSSearchMdmsTypes.useWSServicesMasters(D,"DisconnectionDocuments"),{isLoading:Z,data:$}=Digit.Hooks.ws.useDisconnectionWorkflow({tenantId:T}),J=window.location.href.includes("resubmit"),{mutate:Q}=Digit.Hooks.ws.useWaterCreateAPI("WATER"),{mutate:ee}=Digit.Hooks.ws.useWSApplicationActions("WATER"),{mutate:ne}=Digit.Hooks.ws.useWaterCreateAPI("SEWERAGE"),{mutate:te}=Digit.Hooks.ws.useWSApplicationActions("SEWERAGE"),le=()=>{x(null)};t.useEffect(()=>{const e=v({},R);e.documents=W,w(e)},[W]),t.useEffect(()=>{var e;const n=(null==G||null===(e=G["ws-services-masters"])||void 0===e?void 0:e.disconnectionType)||[];null==n||n.forEach(e=>{var n;return e.i18nKey="WS_DISCONNECTIONTYPE_"+m(null==e||null===(n=e.code)||void 0===n?void 0:n.toUpperCase()," ","_")}),F(n)},[G]),t.useEffect(()=>{var e;const n=(null==q||null===(e=q["ws-services-masters"])||void 0===e?void 0:e.DisconnectionReason)||[];null==n||n.forEach(e=>{var n;return e.i18nKey="WS_DISCONNECTIONTYPE_"+m(null==e||null===(n=e.code)||void 0===n?void 0:n.toUpperCase()," ","_")}),k(n)},[q]),t.useEffect(()=>{Digit.SessionStorage.set("WS_DISCONNECTION",v({},O,{WSDisconnectionForm:R}))},[R]);const oe=()=>C(),ie=e=>{const n=v({},R);n[e.code]=e,w(n)};return Y||K||V||Z?l.createElement(a.Loader,null):"citizen"===y?l.createElement("div",null,"citizen"===y&&l.createElement(Ft,{currentStep:1}),l.createElement(a.FormStep,{config:g,onSelect:()=>C(g.key,{WSDisConnectionForm:R}),onSkip:oe,t:f},l.createElement("div",{style:{padding:"0px 10px 10px 10px"}},l.createElement(a.CardHeader,null,f(J?"RESUBMIT_DISCONNECTION_FORM":"WS_APPLICATION_FORM")),l.createElement(a.StatusTable,null,l.createElement(a.Row,{key:f("PDF_STATIC_LABEL_CONSUMER_NUMBER_LABEL"),label:""+f("PDF_STATIC_LABEL_CONSUMER_NUMBER_LABEL"),text:null==O?void 0:O.connectionNo,className:"border-none"})),l.createElement(a.CardLabel,{className:"card-label-smaller",style:{display:"inline"}},f("WS_DISCONNECTION_TYPE")+"*"),l.createElement(a.RadioButtons,{t:f,options:B,optionsKey:"i18nKey",value:null===(ae=R.type)||void 0===ae||null===(re=ae.value)||void 0===re?void 0:re.code,selectedOption:null===(ue=R.type)||void 0===ue?void 0:ue.value,isMandatory:!1,onSelect:e=>ie({code:"type",value:e}),labelKey:"WS_DISCONNECTION_TYPE",inputStyle:h?{marginLeft:"unset"}:{}}),l.createElement(a.CardLabel,{className:"card-label-smaller",style:{display:"inline"}},f("WS_DISCONNECTION_PROPOSED_DATE")+"*",l.createElement("div",{className:"tooltip",style:{position:"absolute"}},l.createElement(a.InfoIcon,null),l.createElement("span",{className:"tooltiptext",style:{whiteSpace:Digit.Utils.browser.isMobile()?"unset":"nowrap",fontSize:"medium",width:Digit.Utils.browser.isMobile()?"150px":"unset"}},f("SHOULD_BE_DATE")+" "+(null==$?void 0:$.slaDays)+" "+f("DAYS_OF_APPLICATION_DATE")))),l.createElement("div",{className:"field"},l.createElement(a.DatePicker,{date:null==R?void 0:R.date,onChange:e=>{w(v({},R,{date:e}))}})),"Temporary"===(null===(de=R.type)||void 0===de||null===(se=de.value)||void 0===se?void 0:se.code)?l.createElement("div",null,l.createElement(a.CardLabel,{className:"card-label-smaller",style:{display:"inline"}},f("WS_DISCONNECTION_PROPOSED_END_DATE")+"*",l.createElement("div",{className:"tooltip",style:{position:"absolute"}},l.createElement(a.InfoIcon,null),l.createElement("span",{className:"tooltiptext",style:{whiteSpace:Digit.Utils.browser.isMobile()?"unset":"nowrap",fontSize:"medium",width:Digit.Utils.browser.isMobile()?"150px":"unset"}},f("SHOULD_BE_DATE")+" "+f("DAYS_OF_PROPOSED_DATE")))),l.createElement("div",{className:"field"},l.createElement(a.DatePicker,{date:null==R?void 0:R.endDate,onChange:e=>{w(v({},R,{endDate:e}))}}))):"",l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{className:"card-label-smaller",style:{display:"inline"}},f("WS_DISCONNECTION_REASON")+"*"),l.createElement(a.Dropdown,{option:U,isMandatory:!1,optionKey:"i18nKey",t:f,name:"reason",value:null===(ce=R.reason)||void 0===ce||null===(ve=ce.value)||void 0===ve?void 0:ve.code,selectedOption:null===(pe=R.reason)||void 0===pe?void 0:pe.value,labelKey:"WS_DISCONNECTION_REASON",select:e=>ie({code:"reason",value:e})})),l.createElement(a.SubmitBar,{label:f("CS_COMMON_NEXT"),onSubmit:()=>{var e,n;const t=Ol(jt(new Date,null==$?void 0:$.slaDays),"yyyy-MM-dd").toString();N(null==R?void 0:R.date)<=N(t)?(x({key:"error",message:"PROPOSED_DISCONNECTION_INVALID_DATE"}),setTimeout(()=>{x(!1)},3e3)):"Temporary"==(null==R||null===(e=R.type)||void 0===e||null===(n=e.value)||void 0===n?void 0:n.code)&&parseInt(N(R.endDate))<=parseInt(N(null==R?void 0:R.date))?(console.log("Temporary connection"),x({key:"error",message:"PROPOSED_DISCONNECTION_INVALID_END_DATE"}),setTimeout(()=>{x(!1)},3e3)):b.push(L.path.replace("application-form","documents-upload"))},disabled:""===(null==R||null===(me=R.reason)||void 0===me?void 0:me.value)||""===(null==R?void 0:R.reason)||""===(null==R?void 0:R.date)||""===(null==R?void 0:R.type)}),M&&l.createElement(a.Toast,{error:"error"===(null==M?void 0:M.key),label:f(null==M?void 0:M.message),onClose:()=>x(null)}))),l.createElement(a.CitizenInfoLabel,{style:{margin:"0px"},textStyle:{color:"#0B0C0C"},text:f("WS_DISONNECT_APPL_INFO"),info:f("CS_COMMON_INFO")})):l.createElement("div",{style:{margin:"16px"}},l.createElement(a.Header,{styles:{fontSize:"32px",marginLeft:"18px"}},f("WS_WATER_AND_SEWERAGE_DISCONNECTION")),l.createElement(a.FormStep,{config:g,onSelect:()=>{C(g.key,{WSDisConnectionForm:v({},R,{documents:W})})},onSkip:oe,t:f},l.createElement("div",{style:{padding:"10px",paddingTop:"20px",marginTop:"10px"}},l.createElement(a.CardSectionHeader,null,f("CS_TITLE_APPLICATION_DETAILS")),l.createElement(a.StatusTable,null,l.createElement(a.Row,{key:f("PDF_STATIC_LABEL_CONSUMER_NUMBER_LABEL"),label:""+f("PDF_STATIC_LABEL_CONSUMER_NUMBER_LABEL"),text:null==O||null===(o=O.applicationData)||void 0===o?void 0:o.connectionNo,className:"border-none"})),l.createElement(a.CardSectionHeader,null,f("WS_DISCONNECTION_TYPE")+"*",l.createElement("div",{className:"tooltip",style:{marginLeft:"8px"}},l.createElement(a.InfoIcon,null),l.createElement("span",{className:"tooltiptext",style:{whiteSpace:Digit.Utils.browser.isMobile()?"unset":"nowrap",fontSize:"medium",width:Digit.Utils.browser.isMobile()&&window.location.href.includes("/employee")?"200px":""}},""+f("WS_DISCONNECTION_PERMANENT_TOOLTIP"),l.createElement("br",null),l.createElement("br",null),""+f("WS_DISCONNECTION_TEMPORARY_TOOLTIP")))),l.createElement(a.RadioButtons,{t:f,options:B,optionsKey:"i18nKey",value:null===(r=R.type)||void 0===r||null===(u=r.value)||void 0===u?void 0:u.code,selectedOption:null===(d=R.type)||void 0===d?void 0:d.value,isMandatory:!1,onSelect:e=>ie({code:"type",value:e}),labelKey:"WS_DISCONNECTION_TYPE",style:{display:"flex",gap:"0px 3rem"},inputStyle:h?{marginLeft:"unset"}:{}}),l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:{marginTop:"-5px",fontWeight:"700",display:"inline"},className:"card-label-smaller"},f("WS_DISCONNECTION_PROPOSED_DATE")+"*",l.createElement("div",{className:"tooltip",style:{position:"absolute",marginLeft:"4px"}},l.createElement(a.InfoIcon,null),l.createElement("span",{className:"tooltiptext",style:{whiteSpace:Digit.Utils.browser.isMobile()?"unset":"nowrap",fontSize:"medium"}},f("SHOULD_BE_DATE")+" "+(null==$?void 0:$.slaDays)+" "+f("DAYS_OF_APPLICATION_DATE")))),l.createElement("div",{className:"field"},l.createElement(a.DatePicker,{date:null==R?void 0:R.date,onChange:e=>{w(v({},R,{date:e}))}}))),"Temporary"===(null===(s=R.type)||void 0===s||null===(c=s.value)||void 0===c?void 0:c.code)?l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:{marginTop:"-5px",fontWeight:"700",display:"inline"},className:"card-label-smaller"},f("WS_DISCONNECTION_PROPOSED_END_DATE")+"*",l.createElement("div",{className:"tooltip",style:{position:"absolute",marginLeft:"4px"}},l.createElement(a.InfoIcon,null),l.createElement("span",{className:"tooltiptext",style:{whiteSpace:Digit.Utils.browser.isMobile()?"unset":"nowrap",fontSize:"medium"}},f("SHOULD_BE_DATE")+" "+f("DAYS_OF_APPLICATION_END_DATE")))),l.createElement("div",{className:"field"},l.createElement(a.DatePicker,{date:null==R?void 0:R.endDate,onChange:e=>{w(v({},R,{endDate:e}))}}))):"",l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:{marginTop:"-5px",fontWeight:"700",display:"inline"},className:"card-label-smaller"},f("WS_DISCONNECTION_REASON")+"*"),l.createElement("div",{className:"field"},l.createElement(a.Dropdown,{option:U,isMandatory:!1,optionKey:"i18nKey",t:f,name:"reason",value:null===(p=R.reason)||void 0===p||null===(E=p.value)||void 0===E?void 0:E.code,selectedOption:null===(S=R.reason)||void 0===S?void 0:S.value,select:e=>ie({code:"reason",value:e}),labelKey:"WS_DISCONNECTION_REASON"}))),l.createElement(a.CardSectionHeader,{style:{marginBottom:"8px"}},f("WS_DISCONNECTION_DOCUMENTS")+"*"),null==X||null===(_=X.DisconnectionDocuments)||void 0===_?void 0:_.map((e,n)=>l.createElement(Ll,{key:n,document:e,t:f,error:M,setError:x,setDocuments:P,documents:W,setCheckRequiredFields:j})),M&&l.createElement(a.Toast,{error:"error"===(null==M?void 0:M.key),label:f(null==M?void 0:M.message),warning:null==M?void 0:M.warning,onClose:()=>x(null)}))),l.createElement(a.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},l.createElement(a.SubmitBar,{label:f("ACTION_TEST_SUBMIT"),onSubmit:()=>function(e){try{const n=Ol(jt(new Date,null==$?void 0:$.slaDays),"yyyy-MM-dd").toString(),t=function(){if(N(null==e?void 0:e.date)<=N(n))x({key:"error",message:"PROPOSED_DISCONNECTION_INVALID_DATE"}),setTimeout(()=>{x(!1)},3e3);else{const n=function(n,t){if("Temporary"==(null==e||null===(n=e.type)||void 0===n||null===(t=n.value)||void 0===t?void 0:t.name)&&N(null==e?void 0:e.endDate)<=N(null==e?void 0:e.date))x({key:"error",message:"PROPOSED_DISCONNECTION_INVALID_END_DATE"}),setTimeout(()=>{x(!1)},3e3);else{const n=function(n){var t;if(!(K||W.length<2||""===(null==R||null===(n=R.reason)||void 0===n?void 0:n.value)||""===(null==R?void 0:R.reason)||""===(null==R?void 0:R.date)||""===(null==R?void 0:R.type)))return Promise.resolve(A(e,O,null==O||null===(t=O.applicationData)||void 0===t?void 0:t.serviceType)).then(function(e){const n=function(n){if(null!=e&&null!==(n=e.WaterConnection)&&void 0!==n&&n.water){const n=function(){if(Q)return z(!0),Promise.resolve(Q(e,{onError:(e,n)=>{var t,l,o,i,a,r;z(!1),x({key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&o[0].message?null==e||null===(i=e.response)||void 0===i||null===(a=i.data)||void 0===a||null===(r=a.Errors)||void 0===r?void 0:r[0].message:e}),setTimeout(le,5e3)},onSuccess:function(e,n){try{var t;return Promise.resolve(I(null==e||null===(t=e.WaterConnection)||void 0===t?void 0:t[0],"WATER")).then(function(e){let n={WaterConnection:e};return n=v({},n,{disconnectRequest:!0}),Promise.resolve(ee(n,{onError:(e,n)=>{var t,l,o,i,a,r;z(!1),x({key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&o[0].message?null==e||null===(i=e.response)||void 0===i||null===(a=i.data)||void 0===a||null===(r=a.Errors)||void 0===r?void 0:r[0].message:e}),setTimeout(le,5e3)},onSuccess:(e,n)=>{var t,l,o;Digit.SessionStorage.set("WS_DISCONNECTION",v({},O,{DisconnectionResponse:null==e||null===(t=e.WaterConnection)||void 0===t?void 0:t[0]})),b.push("/digit-ui/employee/ws/ws-disconnection-response?applicationNumber="+(null==e||null===(l=e.WaterConnection)||void 0===l||null===(o=l[0])||void 0===o?void 0:o.applicationNo))}})).then(function(){})})}catch(e){return Promise.reject(e)}}})).then(function(){})}();if(n&&n.then)return n.then(function(){})}else{const n=function(n){if(null!=e&&null!==(n=e.SewerageConnection)&&void 0!==n&&n.sewerage){const n=function(){if(ne)return z(!0),Promise.resolve(ne(e,{onError:(e,n)=>{var t,l,o,i,a,r;z(!1),x({key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&o[0].message?null==e||null===(i=e.response)||void 0===i||null===(a=i.data)||void 0===a||null===(r=a.Errors)||void 0===r?void 0:r[0].message:e}),setTimeout(le,5e3)},onSuccess:function(e,n){try{var t;return Promise.resolve(I(null==e||null===(t=e.SewerageConnections)||void 0===t?void 0:t[0],"SEWERAGE")).then(function(e){let n={SewerageConnection:e};return n=v({},n,{disconnectRequest:!0}),Promise.resolve(te(n,{onError:(e,n)=>{var t,l,o,i,a,r;z(!1),x({key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&o[0].message?null==e||null===(i=e.response)||void 0===i||null===(a=i.data)||void 0===a||null===(r=a.Errors)||void 0===r?void 0:r[0].message:e}),setTimeout(le,5e3)},onSuccess:(e,n)=>{var t,l,o;Digit.SessionStorage.set("WS_DISCONNECTION",v({},O,{DisconnectionResponse:null==e||null===(t=e.SewerageConnections)||void 0===t?void 0:t[0]})),b.push("/digit-ui/employee/ws/ws-disconnection-response?applicationNumber="+(null==e||null===(l=e.SewerageConnections)||void 0===l||null===(o=l[0])||void 0===o?void 0:o.applicationNo))}})).then(function(){})})}catch(e){return Promise.reject(e)}}})).then(function(){})}();if(n&&n.then)return n.then(function(){})}}();if(n&&n.then)return n.then(function(){})}}();if(n&&n.then)return n.then(function(){})});x({warning:!0,message:"PLEASE_FILL_MANDATORY_DETAILS"}),setTimeout(()=>{x(!1)},3e3)}();if(n&&n.then)return n.then(function(){})}}();if(n&&n.then)return n.then(function(){})}}();return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(R),style:{margin:"10px 10px 0px 0px"}})));var ae,re,ue,de,se,ce,ve,pe,me},WSRestorationForm:e=>{var n,o,r,u;let{t:d,config:s,onSelect:c,userType:p}=e;const E=Digit.ULBService.getStateId(),S=Digit.ULBService.getCurrentTenantId(),_=(window.Digit.Utils.browser.isMobile(),Digit.SessionStorage.get("WS_DISCONNECTION")),f=i.useHistory(),g=i.useRouteMatch(),[C,y]=t.useState({type:_.WSDisconnectionForm?_.WSDisconnectionForm.type:"",date:_.WSDisconnectionForm?_.WSDisconnectionForm.date:"",reason:_.WSDisconnectionForm?_.WSDisconnectionForm.reason:"",documents:_.WSDisconnectionForm?_.WSDisconnectionForm.documents:[]}),[D,T]=t.useState(_.WSDisconnectionForm?_.WSDisconnectionForm.documents:[]),[h,A]=t.useState(null),[I,b]=t.useState([]),[L,R]=t.useState(!1),[w,W]=t.useState(!1),{isMdmsLoading:P,data:M}=Digit.Hooks.ws.useMDMS(E,"ws-services-masters",["disconnectionType"]),{isLoading:x}=Digit.Hooks.ws.WSSearchMdmsTypes.useWSServicesMasters(E,"DisconnectionDocuments"),{isLoading:B,data:F}=Digit.Hooks.ws.useDisconnectionWorkflow({tenantId:S}),U=window.location.href.includes("resubmit"),{mutate:k}=Digit.Hooks.ws.useWaterCreateAPI("WATER"),{mutate:H}=Digit.Hooks.ws.useWSApplicationActions("WATER"),{mutate:j}=Digit.Hooks.ws.useWaterCreateAPI("SEWERAGE"),{mutate:V}=Digit.Hooks.ws.useWSApplicationActions("SEWERAGE"),z=()=>{A(null)};t.useEffect(()=>{const e=v({},C);e.documents=D,y(e)},[D]),t.useEffect(()=>{var e;const n=(null==M||null===(e=M["ws-services-masters"])||void 0===e?void 0:e.disconnectionType)||[];null==n||n.forEach(e=>{var n;return e.i18nKey="WS_DISCONNECTIONTYPE_"+m(null==e||null===(n=e.code)||void 0===n?void 0:n.toUpperCase()," ","_")}),console.log("disconnectionTypes",n),b(n)},[M]),t.useEffect(()=>{Digit.SessionStorage.set("WS_DISCONNECTION",v({},_,{WSDisconnectionForm:C}))},[C]);const Y=()=>c(),G=e=>{const n=v({},C);n[e.code]=e,y(n)};return P||x||w||B?l.createElement(a.Loader,null):"citizen"===p?l.createElement("div",null,"citizen"===p&&l.createElement(Ft,{currentStep:1}),l.createElement(a.FormStep,{config:s,onSelect:()=>c(s.key,{WSDisConnectionForm:C}),onSkip:Y,t:d},l.createElement("div",{style:{padding:"0px 10px 10px 10px"}},l.createElement(a.CardHeader,null,d(U?"RESUBMIT_RESTORATION_FORM":"WS_APPLICATION_FORM")),l.createElement(a.StatusTable,null,l.createElement(a.Row,{key:d("PDF_STATIC_LABEL_CONSUMER_NUMBER_LABEL"),label:""+d("PDF_STATIC_LABEL_CONSUMER_NUMBER_LABEL"),text:null==_?void 0:_.connectionNo,className:"border-none"})),l.createElement(a.CardLabel,{className:"card-label-smaller",style:{display:"inline"}},d("WS_RESTORATION_PROPOSED_DATE")+"*"),l.createElement("div",{className:"field"},l.createElement(a.DatePicker,{date:null==C?void 0:C.date,onChange:e=>{y(v({},C,{date:e}))}})),l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{className:"card-label-smaller",style:{display:"inline"}},d("WS_DISCONNECTION_REASON")+"*"),l.createElement(a.TextArea,{isMandatory:!1,optionKey:"i18nKey",t:d,name:"reason",value:null===(q=C.reason)||void 0===q?void 0:q.value,onChange:e=>G({code:"reason",value:e.target.value})})),l.createElement(a.SubmitBar,{label:d("CS_COMMON_NEXT"),onSubmit:()=>{Ol(jt(new Date,null==F?void 0:F.slaDays),"yyyy-MM-dd").toString(),f.push(g.path.replace("restoration-application","check"))},disabled:""===(null==C||null===(K=C.reason)||void 0===K?void 0:K.value)||""===(null==C?void 0:C.reason)||""===(null==C?void 0:C.date)}),h&&l.createElement(a.Toast,{error:"error"===(null==h?void 0:h.key),label:d(null==h?void 0:h.message),onClose:()=>A(null)}))),l.createElement(a.CitizenInfoLabel,{style:{margin:"0px"},textStyle:{color:"#0B0C0C"},text:d("WS_DISONNECT_APPL_INFO"),info:d("CS_COMMON_INFO")})):(console.log("applicationData",_),l.createElement("div",{style:{margin:"16px"}},l.createElement(a.Header,{styles:{fontSize:"32px",marginLeft:"18px"}},d("WS_WATER_AND_SEWERAGE_RESTORATION")),l.createElement(a.FormStep,{config:s,onSelect:()=>{c(s.key,{WSDisConnectionForm:v({},C,{documents:D})})},onSkip:Y,t:d},l.createElement("div",{style:{padding:"10px",paddingTop:"20px",marginTop:"10px"}},l.createElement(a.CardSectionHeader,null,d("CS_TITLE_APPLICATION_DETAILS")),l.createElement(a.StatusTable,null,l.createElement(a.Row,{key:d("PDF_STATIC_LABEL_CONSUMER_NUMBER_LABEL"),label:""+d("PDF_STATIC_LABEL_CONSUMER_NUMBER_LABEL"),text:null==_||null===(n=_.applicationData)||void 0===n?void 0:n.connectionNo,className:"border-none"}),l.createElement(a.Row,{key:d("PDF_STATIC_LABEL_TYPE_OF_SERVICE_LABEL"),label:""+d("PDF_STATIC_LABEL_TYPE_OF_SERVICE_LABEL"),text:null==_||null===(o=_.applicationData)||void 0===o?void 0:o.serviceType,className:"border-none"}),l.createElement(a.Row,{key:d("PDF_STATIC_LABEL_PROPERTY_ID_LABEL"),label:""+d("PDF_STATIC_LABEL_PROPERTY_ID_LABEL"),text:null==_||null===(r=_.applicationData)||void 0===r?void 0:r.propertyId,className:"border-none"})),l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:{marginTop:"-5px",fontWeight:"700",display:"inline"},className:"card-label-smaller"},d("WS_RESTORATION_PROPOSED_DATE")+"*",l.createElement("div",{className:"tooltip",style:{position:"absolute",marginLeft:"4px"}},l.createElement(a.InfoIcon,null),l.createElement("span",{className:"tooltiptext",style:{whiteSpace:Digit.Utils.browser.isMobile()?"unset":"nowrap",fontSize:"medium"}},d("SHOULD_BE_DATE")+" "+(null==F?void 0:F.slaDays)+" "+d("DAYS_OF_APPLICATION_DATE")))),l.createElement("div",{className:"field"},l.createElement(a.DatePicker,{date:null==C?void 0:C.date,onChange:e=>{y(v({},C,{date:e}))}}))),l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:{marginTop:"-5px",fontWeight:"700",display:"inline"},className:"card-label-smaller"},d("WS_RESTORATION_REASON")+"*"),l.createElement("div",{className:"field"},l.createElement(a.TextArea,{isMandatory:!1,optionKey:"i18nKey",t:d,name:"reason",value:null===(u=C.reason)||void 0===u?void 0:u.value,onChange:e=>G({code:"reason",value:e.target.value})}))),h&&l.createElement(a.Toast,{error:"error"===(null==h?void 0:h.key),label:d(null==h?void 0:h.message),warning:null==h?void 0:h.warning,onClose:()=>A(null)}))),l.createElement(a.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},l.createElement(a.SubmitBar,{label:d("ACTION_TEST_SUBMIT"),onSubmit:()=>function(e){try{const n=Ol(jt(new Date,null==F?void 0:F.slaDays),"yyyy-MM-dd").toString(),t=function(){if(N(null==e?void 0:e.date)<=N(n))A({key:"error",message:"PROPOSED_DISCONNECTION_INVALID_DATE"}),setTimeout(()=>{A(!1)},3e3);else{const n=function(n){var t;if(""!==(null==C||null===(n=C.reason)||void 0===n?void 0:n.value)&&""!==(null==C?void 0:C.reason)&&""!==(null==C?void 0:C.date))return Promise.resolve(function(e,n,t){try{var l,o,i,a,r,u,d,s,c,p,m,E,S,_,f,g,C,y,D,T,h,A,I,O,b,L,R,w,W,P,M,x,B,F,U,k,H,j,V,z,Y,G,q,K,X,Z,$,J,Q,ee,ne;const Ae=Digit.UserService.getType();let Ie=[];if((null==n||null===(l=n.applicationData)||void 0===l||null===(o=l.plumberInfo)||void 0===o?void 0:o.length)>0){var te,le,oe,ie,ae,re,ue,de,se,ce,ve,pe,me,Ee,Se,_e,fe,ge,Ce,Ne,ye,De,Te,he;let e={};null!=n&&null!==(te=n.applicationData)&&void 0!==te&&null!==(le=te.plumberInfo)&&void 0!==le&&null!==(oe=le[0])&&void 0!==oe&&oe.licenseNo&&(e.licenseNo=null==n||null===(ie=n.applicationData)||void 0===ie||null===(ae=ie.plumberInfo)||void 0===ae||null===(re=ae[0])||void 0===re?void 0:re.licenseNo),null!=n&&null!==(ue=n.applicationData)&&void 0!==ue&&null!==(de=ue.plumberInfo)&&void 0!==de&&null!==(se=de[0])&&void 0!==se&&se.mobileNumber&&(e.mobileNumber=null==n||null===(ce=n.applicationData)||void 0===ce||null===(ve=ce.plumberInfo)||void 0===ve||null===(pe=ve[0])||void 0===pe?void 0:pe.mobileNumber),null!=n&&null!==(me=n.applicationData)&&void 0!==me&&null!==(Ee=me.plumberInfo)&&void 0!==Ee&&null!==(Se=Ee[0])&&void 0!==Se&&Se.id&&(e.id=null==n||null===(_e=n.applicationData)||void 0===_e||null===(fe=_e.plumberInfo)||void 0===fe||null===(ge=fe[0])||void 0===ge?void 0:ge.id),null!=n&&null!==(Ce=n.applicationData)&&void 0!==Ce&&null!==(Ne=Ce.plumberInfo)&&void 0!==Ne&&null!==(ye=Ne[0])&&void 0!==ye&&ye.name&&(e.name=null==n||null===(De=n.applicationData)||void 0===De||null===(Te=De.plumberInfo)||void 0===Te||null===(he=Te[0])||void 0===he?void 0:he.name),Ie=[e]}let Oe={WaterConnection:{id:null==n||null===(i=n.applicationData)||void 0===i?void 0:i.id,applicationNo:null==n||null===(a=n.applicationData)||void 0===a?void 0:a.applicationNo,applicationStatus:null==n||null===(r=n.applicationData)||void 0===r?void 0:r.applicationStatus,status:null==n||null===(u=n.applicationData)||void 0===u?void 0:u.status,connectionNo:null==n||null===(d=n.applicationData)||void 0===d?void 0:d.connectionNo,connectionHolders:null==n||null===(s=n.applicationData)||void 0===s?void 0:s.connectionHolders,applicationType:"WATER_RECONNECTION",dateEffectiveFrom:N(null==e?void 0:e.date),isdisconnection:!0,isDisconnectionTemporary:"Temporary"===(null==e||null===(c=e.type)||void 0===c||null===(p=c.value)||void 0===p?void 0:p.code)||"TEMPORARY"===(null==e||null===(m=e.type)||void 0===m||null===(E=m.value)||void 0===E?void 0:E.code),disconnectionReason:null==e||null===(S=e.reason.value)||void 0===S?void 0:S.code,documents:null==e?void 0:e.documents,water:!0,sewerage:!1,proposedTaps:(null==n||null===(_=n.applicationData)||void 0===_?void 0:_.proposedTaps)&&Number(null==n||null===(f=n.applicationData)||void 0===f?void 0:f.proposedTaps),proposedPipeSize:(null==n||null===(g=n.applicationData)||void 0===g||null===(C=g.proposedPipeSize)||void 0===C?void 0:C.size)&&Number(null==n||null===(y=n.applicationData)||void 0===y||null===(D=y.proposedPipeSize)||void 0===D?void 0:D.size),service:"Water",property:null==n||null===(T=n.applicationData)||void 0===T?void 0:T.property,propertyId:null==n||null===(h=n.applicationData)||void 0===h?void 0:h.propertyId,oldConnectionNo:null,plumberInfo:(null===(A=Ie)||void 0===A?void 0:A.length)>0?Ie:null,roadCuttingInfo:null==n||null===(I=n.applicationData)||void 0===I?void 0:I.roadCuttingInfo,roadCuttingArea:null,roadType:null,connectionExecutionDate:null==n||null===(O=n.applicationData)||void 0===O?void 0:O.connectionExecutionDate,noOfTaps:null==n||null===(b=n.applicationData)||void 0===b?void 0:b.noOfTaps,additionalDetails:null==n||null===(L=n.applicationData)||void 0===L?void 0:L.additionalDetails,tenantId:null==n||null===(R=n.applicationData)||void 0===R?void 0:R.tenantId,connectionType:n.applicationData.connectionType||null,waterSource:n.applicationData.waterSource||null,processInstance:v({},null==n||null===(w=n.applicationData)||void 0===w?void 0:w.processInstance,{action:"INITIATE",businessService:"WSReconnection"}),channel:"citizen"===Ae?"CITIZEN":"CFC_COUNTER"},disconnectRequest:!1};n.applicationData.connectionType&&(n.applicationData.meterInstallationDate&&(Oe.WaterConnection.meterInstallationDate=n.applicationData.meterInstallationDate),n.applicationData.meterId&&(Oe.WaterConnection.meterId=n.applicationData.meterId));let be={SewerageConnection:{id:null==n||null===(W=n.applicationData)||void 0===W?void 0:W.id,applicationNo:null==n||null===(P=n.applicationData)||void 0===P?void 0:P.applicationNo,applicationStatus:null==n||null===(M=n.applicationData)||void 0===M?void 0:M.applicationStatus,status:null==n||null===(x=n.applicationData)||void 0===x?void 0:x.status,connectionNo:null==n||null===(B=n.applicationData)||void 0===B?void 0:B.connectionNo,connectionHolders:null==n||null===(F=n.applicationData)||void 0===F?void 0:F.connectionHolders,applicationType:"WATER_RECONNECTION",dateEffectiveFrom:N(null==e?void 0:e.date),isdisconnection:!0,isDisconnectionTemporary:"Temporary"===(null==e||null===(U=e.type)||void 0===U||null===(k=U.value)||void 0===k?void 0:k.code),disconnectionReason:null==e||null===(H=e.reason.value)||void 0===H?void 0:H.code,documents:null==e?void 0:e.documents,water:!1,sewerage:!0,proposedWaterClosets:(null==n||null===(j=n.applicationData)||void 0===j?void 0:j.proposedWaterClosets)&&Number(null==n||null===(V=n.applicationData)||void 0===V?void 0:V.proposedWaterClosets),proposedToilets:(null==n||null===(z=n.applicationData)||void 0===z?void 0:z.proposedToilets)&&Number(null==n||null===(Y=n.applicationData)||void 0===Y?void 0:Y.proposedToilets),service:"Sewerage",property:null==n||null===(G=n.applicationData)||void 0===G?void 0:G.property,propertyId:null==n||null===(q=n.applicationData)||void 0===q?void 0:q.propertyId,oldConnectionNo:null,plumberInfo:(null===(K=Ie)||void 0===K?void 0:K.length)>0?Ie:null,roadCuttingInfo:null==n||null===(X=n.applicationData)||void 0===X?void 0:X.roadCuttingInfo,roadCuttingArea:null,roadType:null,connectionExecutionDate:null==n||null===(Z=n.applicationData)||void 0===Z?void 0:Z.connectionExecutionDate,noOfWaterClosets:null==n||null===($=n.applicationData)||void 0===$?void 0:$.noOfWaterClosets,noOfToilets:null==n||null===(J=n.applicationData)||void 0===J?void 0:J.noOfToilets,additionalDetails:null==n||null===(Q=n.applicationData)||void 0===Q?void 0:Q.additionalDetails,tenantId:null==n||null===(ee=n.applicationData)||void 0===ee?void 0:ee.tenantId,connectionType:"Non Metered",waterSource:n.applicationData.waterSource||null,processInstance:v({},null==n||null===(ne=n.applicationData)||void 0===ne?void 0:ne.processInstance,{action:"INITIATE",businessService:"SWReconnection"}),channel:"citizen"===Ae?"CITIZEN":"CFC_COUNTER"},disconnectRequest:!1};return Promise.resolve("WATER"===t?Oe:be)}catch(e){return Promise.reject(e)}}(e,_,null==_||null===(t=_.applicationData)||void 0===t?void 0:t.serviceType)).then(function(e){const n=function(n){if(null!=e&&null!==(n=e.WaterConnection)&&void 0!==n&&n.water){e.WaterConnection.isdisconnection=!1,e.WaterConnection.isDisconnectionTemporary=!0,e.WaterConnection.reconnectionReason=e.WaterConnection.disconnectionReason,e.WaterConnection.disconnectionReason="",e.reconnectRequest=!0,e.disconnectRequest=!1;const n=function(){if(k)return W(!0),Promise.resolve(k(e,{onError:(e,n)=>{var t,l,o,i,a,r;W(!1),A({key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&o[0].message?null==e||null===(i=e.response)||void 0===i||null===(a=i.data)||void 0===a||null===(r=a.Errors)||void 0===r?void 0:r[0].message:e}),setTimeout(z,5e3)},onSuccess:function(e,n){try{var t;return Promise.resolve(O(null==e||null===(t=e.WaterConnection)||void 0===t?void 0:t[0],"WATER")).then(function(e){let n={WaterConnection:e};return n=v({},n,{disconnectRequest:!1,reconnectRequest:!0}),console.log("response"),Promise.resolve(H(n,{onError:(e,n)=>{var t,l,o,i,a,r;W(!1),A({key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&o[0].message?null==e||null===(i=e.response)||void 0===i||null===(a=i.data)||void 0===a||null===(r=a.Errors)||void 0===r?void 0:r[0].message:e}),setTimeout(z,5e3)},onSuccess:(e,n)=>{var t,l,o;Digit.SessionStorage.set("WS_DISCONNECTION",v({},_,{DisconnectionResponse:null==e||null===(t=e.WaterConnection)||void 0===t?void 0:t[0]})),f.push("/digit-ui/employee/ws/ws-restoration-response?applicationNumber="+(null==e||null===(l=e.WaterConnection)||void 0===l||null===(o=l[0])||void 0===o?void 0:o.applicationNo))}})).then(function(){})})}catch(e){return Promise.reject(e)}}})).then(function(){})}();if(n&&n.then)return n.then(function(){})}else{const n=function(n){if(null!=e&&null!==(n=e.SewerageConnection)&&void 0!==n&&n.sewerage){e.SewerageConnection.isdisconnection=!1,e.SewerageConnection.reconnectionReason=e.SewerageConnection.disconnectionReason,e.SewerageConnection.disconnectionReason="",e.SewerageConnection.isDisconnectionTemporary=!0,e.reconnectRequest=!0,e.disconnectRequest=!1;const n=function(){if(j)return W(!0),Promise.resolve(j(e,{onError:(e,n)=>{var t,l,o,i,a,r;W(!1),A({key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&o[0].message?null==e||null===(i=e.response)||void 0===i||null===(a=i.data)||void 0===a||null===(r=a.Errors)||void 0===r?void 0:r[0].message:e}),setTimeout(z,5e3)},onSuccess:function(e,n){try{var t;return Promise.resolve(O(null==e||null===(t=e.SewerageConnections)||void 0===t?void 0:t[0],"SEWERAGE")).then(function(e){let n={SewerageConnection:e};return n=v({},n,{disconnectRequest:!1,reconnectRequest:!0}),Promise.resolve(V(n,{onError:(e,n)=>{var t,l,o,i,a,r;W(!1),A({key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&o[0].message?null==e||null===(i=e.response)||void 0===i||null===(a=i.data)||void 0===a||null===(r=a.Errors)||void 0===r?void 0:r[0].message:e}),setTimeout(z,5e3)},onSuccess:(e,n)=>{var t,l,o;Digit.SessionStorage.set("WS_DISCONNECTION",v({},_,{DisconnectionResponse:null==e||null===(t=e.SewerageConnections)||void 0===t?void 0:t[0]})),f.push("/digit-ui/employee/ws/ws-restoration-response?applicationNumber="+(null==e||null===(l=e.SewerageConnections)||void 0===l||null===(o=l[0])||void 0===o?void 0:o.applicationNo))}})).then(function(){})})}catch(e){return Promise.reject(e)}}})).then(function(){})}();if(n&&n.then)return n.then(function(){})}}();if(n&&n.then)return n.then(function(){})}}();if(n&&n.then)return n.then(function(){})});A({warning:!0,message:"PLEASE_FILL_MANDATORY_DETAILS"}),setTimeout(()=>{A(!1)},3e3)}();if(n&&n.then)return n.then(function(){})}}();return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(C),style:{margin:"10px 10px 0px 0px"}}))));var q,K},WSDisconnectionDocumentsForm:function(e){var n;let{t:o,config:r,onSelect:u,userType:d}=e;const s=Digit.ULBService.getStateId(),c=Digit.SessionStorage.get("WS_DISCONNECTION"),[p,m]=t.useState(c.WSDisconnectionForm.documents?c.WSDisconnectionForm.documents:[]),[E,S]=t.useState(null),[_,f]=t.useState(!1),g=i.useHistory(),C=i.useRouteMatch();t.useEffect(()=>{Digit.SessionStorage.set("WS_DISCONNECTION",v({},c,{WSDisconnectionForm:v({},c.WSDisconnectionForm,{documents:p})}))},[p]);const{isLoading:N,data:y}=Digit.Hooks.ws.WSSearchMdmsTypes.useWSServicesMasters(s,"DisconnectionDocuments");return N?l.createElement(a.Loader,null):l.createElement("div",{style:{marginTop:"19px"}},"citizen"===d&&l.createElement(Ft,{currentStep:2}),l.createElement(a.FormStep,{t:o,config:r,onSelect:()=>{u(r.key,{WSDisconnectionDocumentsForm:p})}},l.createElement(a.CardHeader,null,o("WS_DISCONNECTION_UPLOAD_DOCUMENTS")),null==y||null===(n=y.DisconnectionDocuments)||void 0===n?void 0:n.map((e,n)=>l.createElement(Rl,{key:n,document:e,t:o,error:E,setError:S,setDocuments:m,documents:p,setCheckRequiredFields:f})),l.createElement(a.SubmitBar,{label:o("CS_COMMON_NEXT"),onSubmit:()=>{g.push(C.path.replace("documents-upload","check"))},disabled:p.length<2}),E&&l.createElement(a.Toast,{error:"error"===(null==E?void 0:E.key),label:o(null==E?void 0:E.message),onClose:()=>S(null)})))},WSDisconnectAcknowledgement:()=>{var e;const{t:n}=o.useTranslation(),t=Digit.SessionStorage.get("WS_DISCONNECTION");return l.createElement(a.Card,{style:{padding:"10px"}},l.createElement(a.CardSectionHeader,null,l.createElement(wl,{isSuccess:!0,message:n("WS_APPLICATION_COMPLETED_SUCCESSFULLY_LABEL"),applicationNumber:null==t||null===(e=t.DisconnectionResponse)||void 0===e?void 0:e.applicationNo})," ",l.createElement("successSvg",null)),l.createElement(a.CardText,null,n("WS_DISCONNECTION_APPLICATION_SUCC_MSG")),l.createElement(a.SubmitBar,{label:n("WS_DOWNLOAD_ACK_FORM"),onSubmit:()=>{const e=null==t?void 0:t.DisconnectionResponse;pe(e,null==t?void 0:t.property,null==e?void 0:e.tenantId,n).then(e=>Digit.Utils.pdf.generatev1(e))}}),l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(a.LinkButton,{label:n("CORE_COMMON_GO_TO_HOME"),onClick:()=>Digit.SessionStorage.del("WS_DISCONNECTION")})))},WSRestorationAcknowledgement:()=>{var e;const{t:n}=o.useTranslation(),t=Digit.SessionStorage.get("WS_DISCONNECTION");return l.createElement(a.Card,{style:{padding:"10px"}},l.createElement(a.CardSectionHeader,null,l.createElement(Wl,{isSuccess:!0,message:n("WS_APPLICATION_COMPLETED_SUCCESSFULLY_LABEL"),applicationNumber:null==t||null===(e=t.DisconnectionResponse)||void 0===e?void 0:e.applicationNo})," ",l.createElement("successSvg",null)),l.createElement(a.CardText,null,n("WS_RESTORATION_APPLICATION_SUCC_MSG")),l.createElement(a.SubmitBar,{label:n("WS_DOWNLOAD_ACK_FORM"),onSubmit:()=>{const e=null==t?void 0:t.DisconnectionResponse;ge(e,null==t?void 0:t.property,null==e?void 0:e.tenantId,n).then(e=>Digit.Utils.pdf.generatev1(e))}}),l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(a.LinkButton,{label:n("CORE_COMMON_GO_TO_HOME"),onClick:()=>Digit.SessionStorage.del("WS_DISCONNECTION")})))},WSDisconnectionAppDetails:e=>{let{config:n,onSelect:i,formData:a,setError:r,formState:u,clearErrors:d}=e;const{t:s}=o.useTranslation(),[c,p]=t.useState((null==a?void 0:a.disConnectionDetails)||[[{consumerNumber:"",disConnectionType:"",disConnectionProposeDate:"",disConnectionReason:""}]]),[m,E]=t.useState({index:-1,type:""}),[S,_]=t.useState(!1),[f,g]=t.useState([]),C=Digit.ULBService.getStateId(),N=Digit.ULBService.getCurrentTenantId(),{data:y}=Digit.Hooks.ws.useMDMS(C,"ws-services-masters",["disconnectionType"]);Digit.Hooks.ws.useDisconnectionWorkflow({tenantId:N}),t.useEffect(()=>{var e;const n=(null==y||null===(e=y["ws-services-masters"])||void 0===e?void 0:e.disconnectionType)||[];null==n||n.forEach(e=>{var n,t,l,o;e.code=null==e||null===(n=e.code)||void 0===n?void 0:n.toUpperCase(),e.i18nKey="WS_DISCONNECTIONTYPE_"+(null==e||null===(t=e.code)||void 0===t?void 0:t.toUpperCase()),e.value=null==e||null===(l=e.code)||void 0===l?void 0:l.toUpperCase(),e.name=null==e||null===(o=e.code)||void 0===o?void 0:o.toUpperCase()}),g(n)},[y]),t.useEffect(()=>{const e=c.map(e=>e);i(null==n?void 0:n.key,e)},[c]);const D={focusIndex:m,setFocusIndex:E,t:s,config:n,setError:r,clearErrors:d,formState:u,disConnectionDetails:c,setIsErrors:_,setDisConnectionDetails:p,disconnectionTypeList:f};return l.createElement(l.Fragment,null,c.map((e,n)=>l.createElement(Pl,v({key:e.key,index:n,disConnectionDetail:e},D))))},WSInbox:e=>{let{parentRoute:n}=e;const{t:u}=o.useTranslation(),d=Digit.ULBService.getCurrentTenantId(),s=window.location.pathname.includes("water/inbox"),c={mobileNumber:"",applicationNumber:"",consumerNo:""},p={businessService:s?["NewWS1","ModifyWSConnection","DisconnectWSConnection"]:["NewSW1","ModifySWConnection","DisconnectSWConnection"],moduleName:s?"ws-services":"sw-services",locality:[],assignee:"ASSIGNED_TO_ALL",applicationStatus:[],applicationType:[]},m={sortBy:"createdTime",limit:window.Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"DESC"};sessionStorage.removeItem("Digit.BILL.INBOX"),sessionStorage.removeItem("Digit.SW.INBOX");const E=Digit.SessionStorage.get("BILL.INBOX"),S=t.useMemo(()=>E||{filterForm:p,searchForm:c,tableForm:m},[Object.values((null==E?void 0:E.filterForm)||{}),Object.values((null==E?void 0:E.searchForm)||{}),Object.values((null==E?void 0:E.tableForm)||{})]),[_,f]=t.useReducer(function(e,n){if(s)switch(n.action){case"mutateSearchForm":return Digit.SessionStorage.set("BILL.INBOX",v({},e,{searchForm:n.data})),v({},e,{searchForm:n.data});case"mutateFilterForm":return Digit.SessionStorage.set("BILL.INBOX",v({},e,{filterForm:n.data})),v({},e,{filterForm:n.data});case"mutateTableForm":return Digit.SessionStorage.set("BILL.INBOX",v({},e,{tableForm:n.data})),v({},e,{tableForm:n.data})}else switch(n.action){case"mutateSearchForm":return Digit.SessionStorage.set("BILL.SW.INBOX",v({},e,{searchForm:n.data})),v({},e,{searchForm:n.data});case"mutateFilterForm":return Digit.SessionStorage.set("BILL.SW.INBOX",v({},e,{filterForm:n.data})),v({},e,{filterForm:n.data});case"mutateTableForm":return Digit.SessionStorage.set("BILL.SW.INBOX",v({},e,{tableForm:n.data})),v({},e,{tableForm:n.data})}},S),{data:g,isLoading:C}=Digit.Hooks.useBoundaryLocalities(d,"revenue",{},u),{isLoading:N,data:{table:y,statuses:D,totalCount:T}={}}=Digit.Hooks.ws.useInbox({tenantId:d,filters:v({},_)});let h=[{text:u("WS_APPLY_NEW_CONNECTION_HOME_CARD_LABEL"),link:"/digit-ui/employee/ws/create-application",roles:["WS_CEMP","SW_CEMP"]}];h=h.filter(e=>!e.roles||b(e.roles));const A={logoIcon:l.createElement(a.DropIcon,null),headerText:s?"MODULE_WATER":"MODULE_SW",links:[...h,{text:u("WS_SEWERAGE_CONNECTION_SEARCH_LABEL"),link:s?"/digit-ui/employee/ws/water/search-connection?from=WS_SEWERAGE_INBOX":"/digit-ui/employee/ws/sewerage/search-connection?from=WS_SEWERAGE_INBOX",roles:s?["WS_CEMP","WS_APPROVER","WS_FIELD_INSPECTOR","WS_DOC_VERIFIER","WS_CLERK"]:["SW_CEMP","SW_APPROVER","SW_FIELD_INSPECTOR","SW_DOC_VERIFIER","SW_CLERK"]},{text:u("WS_SEWERAGE_APPLICATION_SEARCH"),link:s?"/digit-ui/employee/ws/water/search-application?from=WS_SEWERAGE_INBOX":"/digit-ui/employee/ws/sewerage/search-application?from=WS_SEWERAGE_INBOX",roles:s?["WS_CEMP","WS_APPROVER","WS_FIELD_INSPECTOR","WS_DOC_VERIFIER","WS_CLERK"]:["SW_CEMP","SW_APPROVER","SW_FIELD_INSPECTOR","SW_DOC_VERIFIER","SW_CLERK"]}]},I=t.useCallback(e=>{let{registerRef:n,searchFormState:t}=e;return l.createElement(Ml,{registerRef:n,searchFormState:t,className:"search"})},[]),O=t.useCallback(e=>{let{registerRef:n,controlFilterForm:t,setFilterFormValue:o,getFilterFormValue:i}=e;return l.createElement(xl,{statuses:D,isInboxLoading:N,registerRef:n,controlFilterForm:t,setFilterFormValue:o,filterFormState:null==_?void 0:_.filterForm,getFilterFormValue:i,localitiesForEmployeesCurrentTenant:g,loadingLocalitiesForEmployeesCurrentTenant:C,checkPathName:s})},[D,N,g,C]),L={SearchFormFields:I,onSearchFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),f({action:"mutateTableForm",data:v({},m)}),f({action:"mutateSearchForm",data:e})},searchFormDefaultValues:null==_?void 0:_.searchForm,resetSearchFormDefaultValues:c,onSearchFormReset:e=>{e("mobileNumber",null),e("applicationNumber",null),e("consumerNo",null),f({action:"mutateSearchForm",data:c})},className:"search-form-wns-inbox"},R={FilterFormFields:O,onFilterFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),f({action:"mutateTableForm",data:v({},m)}),f({action:"mutateFilterForm",data:e})},filterFormDefaultValues:null==_?void 0:_.filterForm,resetFilterFormDefaultValues:p,onFilterFormReset:e=>{e("moduleName",s?"ws-services":"sw-services"),e("applicationStatus",[]),e("applicationType",[]),e("locality",[]),e("assignee","ASSIGNED_TO_ALL"),f({action:"mutateFilterForm",data:p})}},w=(e=>{var n,a,r,u;let{onPageSizeChange:d,formState:s,totalCount:c,table:p,dispatch:m,onSortingByData:E,tenantId:S,inboxStyles:_={},tableStyle:f={}}=e;const{t:g}=o.useTranslation(),C=e=>l.createElement("span",{className:"cell-text styled-cell"},e),N=t.useMemo(()=>[{Header:g("WS_ACK_COMMON_APP_NO_LABEL"),accessor:"applicationNo",disableSortBy:!0,Cell:e=>{var n,t,o,a,r,u;let{row:d}=e,s="WATER";d.original.applicationNo.includes("SW")&&(s="SEWERAGE");let c="application";return null!=d&&null!==(n=d.original)&&void 0!==n&&null!==(t=n.applicationType)&&void 0!==t&&null!==(o=t.toUpperCase())&&void 0!==o&&o.includes("DISCONNECT")?c="disconnection":null!=d&&null!==(a=d.original)&&void 0!==a&&null!==(r=a.applicationType)&&void 0!==r&&null!==(u=r.toUpperCase())&&void 0!==u&&u.includes("MODIFY")&&(c="modify"),l.createElement("div",null,l.createElement(i.Link,{to:"/digit-ui/employee/ws/"+c+"-details?applicationNumber="+d.original.applicationNo+"&tenantId="+S+"&service="+s+"&from=WS_SEWERAGE_INBOX"}," ",l.createElement("span",{className:"link"},d.original.applicationNo)))}},{Header:g("WS_COMMON_TABLE_COL_CONSUMER_NO_LABEL"),accessor:"connectionNo",disableSortBy:!0},{Header:g("WS_COMMON_TABLE_COL_OWN_NAME_LABEL"),accessor:"owner",disableSortBy:!0},{Header:g("WS_COMMON_TABLE_COL_APP_TYPE_LABEL"),accessor:e=>{var n;return C(g("CS_COMMON_INBOX_"+(null==e||null===(n=e.applicationType)||void 0===n?void 0:n.toUpperCase())))},disableSortBy:!0},{Header:g("WS_COMMON_TABLE_COL_APPLICATION_STATUS"),accessor:e=>C(g("CS_"+(null==e?void 0:e.status))),disableSortBy:!0},{Header:g("ES_INBOX_SLA_DAYS_REMAINING"),accessor:e=>{return l.createElement("span","Active"===(n=null==e?void 0:e.sla)||n>0?{className:"sla-cell-success"}:{className:"sla-cell-error"},n);var n}}]);return{getCellProps:e=>({style:{padding:"20px 18px",fontSize:"16px"}}),disableSort:!1,autoSort:!1,manualPagination:!0,initSortId:"applicationDate",onPageSizeChange:d,currentPage:(null===(n=s.tableForm)||void 0===n?void 0:n.offset)/(null===(a=s.tableForm)||void 0===a?void 0:a.limit),onNextPage:()=>{var e,n;return m({action:"mutateTableForm",data:v({},s.tableForm,{offset:parseInt(null===(e=s.tableForm)||void 0===e?void 0:e.offset)+parseInt(null===(n=s.tableForm)||void 0===n?void 0:n.limit)})})},onPrevPage:()=>{var e,n;return m({action:"mutateTableForm",data:v({},s.tableForm,{offset:parseInt(null===(e=s.tableForm)||void 0===e?void 0:e.offset)-parseInt(null===(n=s.tableForm)||void 0===n?void 0:n.limit)})})},pageSizeLimit:null===(r=s.tableForm)||void 0===r?void 0:r.limit,onSort:E,totalRecords:c,onSearch:null==s||null===(u=s.searchForm)||void 0===u?void 0:u.message,onLastPage:()=>{var e;return m({action:"mutateTableForm",data:v({},s.tableForm,{offset:10*Math.ceil(c/10)-parseInt(null===(e=s.tableForm)||void 0===e?void 0:e.limit)})})},onFirstPage:()=>m({action:"mutateTableForm",data:v({},s.tableForm,{offset:0})}),data:p,columns:N,inboxStyles:v({},_),tableStyle:v({},f)}})(v({},{parentRoute:n,onPageSizeChange:e=>{f({action:"mutateTableForm",data:v({},_.tableForm,{limit:e.target.value})})},formState:_,totalCount:T,table:y,dispatch:f,onSortingByData:e=>{if(e.length>0){const[{id:n,desc:t}]=e,l=t?"DESC":"ASC";_.tableForm.sortBy===n&&_.tableForm.sortOrder===l||f({action:"mutateTableForm",data:v({},_.tableForm,{sortBy:n,sortOrder:t?"DESC":"ASC"})})}},tenantId:d,inboxStyles:{overflowX:"scroll",overflowY:"hidden"},tableStyle:{width:"70%"}})),W=(e=>{let{table:n}=e;const{t:t}=o.useTranslation(),u=(e,n,t)=>{var o,a;let r=null!=e&&e.includes("WS")?"WATER":"SEWERAGE",u="application";return null!=t&&null!==(o=t.toUpperCase())&&void 0!==o&&o.includes("DISCONNECT")?u="disconnection":null!=t&&null!==(a=t.toUpperCase())&&void 0!==a&&a.includes("MODIFY")&&(u="modify"),l.createElement("div",null,l.createElement(i.Link,{to:"/digit-ui/employee/ws/"+u+"-details?applicationNumber="+e+"&tenantId="+n+"&service="+r}," ",l.createElement("span",{className:"link"},e)))};return{data:null==n?void 0:n.map(e=>{let{applicationNo:n,status:o,owner:i,sla:a,businessService:r,connectionNo:d,applicationType:s,tenantId:c}=e;return{[t("WS_ACK_COMMON_APP_NO_LABEL")]:u(n,c,s),[t("WS_COMMON_TABLE_COL_CONSUMER_NO_LABEL")]:d,[t("WS_COMMON_TABLE_COL_OWN_NAME_LABEL")]:i,[t("WS_COMMON_TABLE_COL_APP_TYPE_LABEL")]:t("WS_"+(null==s?void 0:s.toUpperCase())),[t("WS_COMMON_TABLE_COL_SERVICE_LABEL")]:r?t("WS_COMMON_INBOX_"+(null==r?void 0:r.toUpperCase())):"NA",[t("WS_COMMON_TABLE_COL_APPLICATION_STATUS")]:t("CS_"+o),[t("ES_INBOX_SLA_DAYS_REMAINING")]:(v=a,l.createElement("span","Active"===v||v>0?{className:"sla-cell-success"}:{className:"sla-cell-error"},v))};var v}),serviceRequestIdKey:t("NOC_APP_NO_LABEL"),MobileSortFormValues:()=>{const e=[{code:"DESC",i18nKey:"ES_COMMON_SORT_BY_DESC"},{code:"ASC",i18nKey:"ES_COMMON_SORT_BY_ASC"}],{control:n}=r.useFormContext();return l.createElement(a.SearchField,null,l.createElement(r.Controller,{name:"sortOrder",control:n,render:n=>{let{onChange:t,value:o}=n;return l.createElement(a.RadioButtons,{onSelect:e=>{t(e.code)},selectedOption:e.filter(e=>e.code===o)[0],optionsKey:"i18nKey",name:"sortOrder",options:e})}}))}}})({parentRoute:n,table:y}),P={onMobileSortOrderData:e=>{const{sortOrder:n}=e;f({action:"mutateTableForm",data:v({},_.tableForm,{sortOrder:n})})},sortFormDefaultValues:null==_?void 0:_.tableForm,onSortFormReset:e=>{e("sortOrder","DESC"),f({action:"mutateTableForm",data:m})}};return l.createElement(t.Fragment,null,l.createElement(a.Header,null,u("ES_COMMON_INBOX"),T?l.createElement("p",{className:"inbox-count"},T):null),l.createElement(a.InboxComposer,v({isInboxLoading:N,PropsForInboxLinks:A},L,R,P,{propsForInboxTable:w,propsForInboxMobileCards:W,formState:_})))},BillAmendmentCard:()=>{if(!Digit.Utils.wsAccess())return null;const{t:e}=o.useTranslation(),n=Digit.ULBService.getCurrentTenantId(),[i,r]=t.useState(0);sessionStorage.removeItem("Digit.PT_CREATE_EMP_WS_NEW_FORM"),sessionStorage.removeItem("IsDetailsExists");const u={sortBy:"",limit:10,offset:0,sortOrder:"DESC"},d={},s={applicationStatus:[],businessService:["WS.AMENDMENT"],moduleName:"bsWs-service",locality:[],assignee:"ASSIGNED_TO_ALL"},c={filterForm:s,searchForm:d,tableForm:u},p={filterForm:v({},s,{businessService:["SW.AMENDMENT"],moduleName:"bsSw-service"}),searchForm:d,tableForm:u},{isLoading:m,data:E}=Digit.Hooks.useBillAmendmentInbox({tenantId:n,filters:v({},c)}),{isLoading:S,data:_}=Digit.Hooks.useBillAmendmentInbox({tenantId:n,filters:v({},p)});t.useEffect(()=>{m&&S||r(null!=E&&E.totalCount&&null!=_&&_.totalCount?(null==E?void 0:E.totalCount)+(null==_?void 0:_.totalCount):null!=E&&E.totalCount?null==E?void 0:E.totalCount:null!=_&&_.totalCount?null==_?void 0:_.totalCount:0)},[E,_]);const f=t.useMemo(()=>({Icon:l.createElement(a.WSICon,null),moduleName:e("WS_BILL_AMENDMENT_BUTTON"),kpis:[{count:m?"-":i,label:e("TOTAL_WS"),link:"/digit-ui/employee/ws/water/bill-amendment/inbox"},{count:m?"-":null==E?void 0:E.slaCount,label:e("TOTAL_NEARING_SLA"),link:"/digit-ui/employee/ws/water/bill-amendment/inbox"}],links:[{count:m?"-":null==E?void 0:E.totalCount,label:e("WS_WATER_INBOX"),link:"/digit-ui/employee/ws/water/bill-amendment/inbox",roles:["WS_CEMP","WS_APPROVER","WS_FIELD_INSPECTOR","WS_DOC_VERIFIER","WS_CLERK"]},{count:m?"-":null==_?void 0:_.totalCount,label:e("SW_WATER_INBOX"),link:"/digit-ui/employee/ws/sewerage/bill-amendment/inbox",roles:["WS_CEMP","WS_APPROVER","WS_FIELD_INSPECTOR","WS_DOC_VERIFIER","WS_CLERK"]}]}),[m,E,i]);return l.createElement(a.EmployeeModuleCard,f)},WSSearchApplication:e=>{let{tenantId:n,onSubmit:u,data:d,count:s,resultOk:c,businessService:v,isLoading:p}=e;const[m,E,S]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[_,f,g]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),{t:C}=o.useTranslation(),{register:N,control:y,handleSubmit:D,setValue:T,getValues:h,reset:A}=r.useForm({defaultValues:{offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC",isConnectionSearch:!0}});t.useEffect(()=>{N("offset",0),N("limit",10),N("sortBy","commencementDate"),N("sortOrder","DESC"),N("sortOrder","DESC"),N("isConnectionSearch",!0)},[N]),t.useEffect(()=>{S(),E({}),f({}),g()},[]);const I=t.useCallback(e=>{0!==e.length&&(T("sortBy",e.id),T("sortOrder",e.desc?"DESC":"ASC"))},[]);function O(){T("offset",h("offset")-h("limit")),D(u)()}if(window.Digit.Utils.browser.isMobile())return l.createElement(kl,{Controller:r.Controller,register:N,control:y,t:C,reset:A,previousPage:O,handleSubmit:D,tenantId:n,data:d,onSubmit:u,businessService:v});const b=e=>l.createElement("span",{className:"cell-text"},e),L=t.useMemo(()=>[{Header:C("WS_MYCONNECTIONS_CONSUMER_NO"),disableSortBy:!0,accessor:"connectionNo",Cell:e=>{var t,o,a,r,u,d,s,c,v;let{row:p}=e,m="WATER";return"NEW_WATER_CONNECTION"==(null==p||null===(t=p.original)||void 0===t?void 0:t.applicationType)||"MODIFY_WATER_CONNECTION"==(null==p||null===(o=p.original)||void 0===o?void 0:o.applicationType)||"DISCONNECT_WATER_CONNECTION"==(null==p||null===(a=p.original)||void 0===a?void 0:a.applicationType)||"WATER_RECONNECTION"==(null==p||null===(r=p.original)||void 0===r?void 0:r.applicationType)?m="WATER":"NEW_SEWERAGE_CONNECTION"!=(null==p||null===(u=p.original)||void 0===u?void 0:u.applicationType)&&"MODIFY_SEWERAGE_CONNECTION"!=(null==p||null===(d=p.original)||void 0===d?void 0:d.applicationType)&&"DISCONNECT_SEWERAGE_CONNECTION"!=(null==p||null===(s=p.original)||void 0===s?void 0:s.applicationType)&&"SEWERAGE_RECONNECTION"!=(null==p||null===(c=p.original)||void 0===c?void 0:c.applicationType)||(m="SEWERAGE"),l.createElement("div",null,p.original.connectionNo?l.createElement("span",{className:"link"},l.createElement(i.Link,{to:"/digit-ui/employee/ws/connection-details?applicationNumber="+p.original.connectionNo+"&tenantId="+n+"&service="+m+"&due="+((null===(v=p.original)||void 0===v?void 0:v.due)||0)+"&from=WS_SEWERAGE_APPLICATION_SEARCH"},p.original.connectionNo||"NA")):l.createElement("span",null,C("NA")))}},{Header:C("WS_ACK_COMMON_APP_NO_LABEL"),accessor:"applicationNo",disableSortBy:!0,Cell:e=>{var t,o,a,r,u,d,s,c;let{row:v}=e,p="WATER";if("NEW_WATER_CONNECTION"==(null==v||null===(t=v.original)||void 0===t?void 0:t.applicationType)||"MODIFY_WATER_CONNECTION"==(null==v||null===(o=v.original)||void 0===o?void 0:o.applicationType)||"DISCONNECT_WATER_CONNECTION"==(null==v||null===(a=v.original)||void 0===a?void 0:a.applicationType)||"WATER_RECONNECTION"==(null==v||null===(r=v.original)||void 0===r?void 0:r.applicationType)?p="WATER":"NEW_SEWERAGE_CONNECTION"!=(null==v||null===(u=v.original)||void 0===u?void 0:u.applicationType)&&"MODIFY_SEWERAGE_CONNECTION"!=(null==v||null===(d=v.original)||void 0===d?void 0:d.applicationType)&&"DISCONNECT_SEWERAGE_CONNECTION"!=(null==v||null===(s=v.original)||void 0===s?void 0:s.applicationType)&&"SEWERAGE_RECONNECTION"!=(null==v||null===(c=v.original)||void 0===c?void 0:c.applicationType)||(p="SEWERAGE"),"MODIFY_SEWERAGE_CONNECTION"===v.original.applicationType||"MODIFY_WATER_CONNECTION"===v.original.applicationType){var m,E,S,_,f,g;let e="application";return null!=v&&null!==(m=v.original)&&void 0!==m&&null!==(E=m.applicationType)&&void 0!==E&&null!==(S=E.toUpperCase())&&void 0!==S&&S.includes("DISCONNECT")?e="disconnection":null!=v&&null!==(_=v.original)&&void 0!==_&&null!==(f=_.applicationType)&&void 0!==f&&null!==(g=f.toUpperCase())&&void 0!==g&&g.includes("MODIFY")&&(e="modify"),l.createElement("div",null,l.createElement("span",{className:"link"},l.createElement(i.Link,{to:"/digit-ui/employee/ws/"+e+"-details?applicationNumber="+v.original.applicationNo+"&tenantId="+n+"&service="+p+"&mode=MODIFY&from=WS_SEWERAGE_APPLICATION_SEARCH"},v.original.applicationNo)))}{var C,N,y,D;let e="application";return null!=v&&null!==(C=v.original)&&void 0!==C&&null!==(N=C.applicationType)&&void 0!==N&&N.includes("DISCONNECT")?e="disconnection":null!=v&&null!==(y=v.original)&&void 0!==y&&null!==(D=y.applicationType)&&void 0!==D&&D.includes("MODIFY")&&(e="modify"),l.createElement("div",null,l.createElement("span",{className:"link"},l.createElement(i.Link,{to:"/digit-ui/employee/ws/"+e+"-details?applicationNumber="+v.original.applicationNo+"&tenantId="+n+"&service="+p+"&from=WS_SEWERAGE_APPLICATION_SEARCH"},v.original.applicationNo)))}}},{Header:C("WS_APPLICATION_TYPE_LABEL"),disableSortBy:!0,accessor:e=>b(C("WS_"+e.applicationType))},{Header:C("WS_COMMON_TABLE_COL_OWN_NAME_LABEL"),disableSortBy:!0,accessor:e=>{var n,t,l,o;return b(null!=e&&null!==(n=e.connectionHolders)&&void 0!==n&&null!==(t=n[0])&&void 0!==t&&t.name?null==e||null===(l=e.connectionHolders)||void 0===l||null===(o=l[0])||void 0===o?void 0:o.name:(null==e?void 0:e.ownerNames)||"-")}},{Header:C("WS_COMMON_TABLE_COL_APPLICATION_STATUS_LABEL"),accessor:e=>b(C((null==e?void 0:e.applicationStatus)||"NA")),disableSortBy:!0},{Header:C("WS_COMMON_TABLE_COL_ADDRESS"),disableSortBy:!0,accessor:e=>b((null==e?void 0:e.address)||"-")}],[]);return l.createElement(t.Fragment,null,l.createElement(a.Header,{styles:{fontSize:"32px"}},C("WS"===v?"WS_WATER_SEARCH_APPLICATION_SUB_HEADER":"WS_SEWERAGE_SEARCH_APPLICATION_SUB_HEADER")),l.createElement(a.Card,{className:"card-search-heading"},l.createElement("span",{style:{color:"#505A5F"}},C("WS_INFO_VALIDATION"))),l.createElement(a.SearchForm,{onSubmit:u,handleSubmit:D},l.createElement(Bl,{register:N,control:y,reset:A,tenantId:n,t:C,businessService:v})),p?l.createElement(a.Loader,null):null,null!=d&&d.display&&!c?l.createElement(a.Card,{style:{marginTop:20}},C(null==d?void 0:d.display).split("\\n").map((e,n)=>l.createElement("p",{key:n,style:{textAlign:"center"}},e))):c?l.createElement(a.Table,{t:C,data:d,totalRecords:s,columns:L,getCellProps:e=>({style:{minWidth:e.column.Header===C("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:function(e){T("limit",Number(e.target.value)),D(u)()},currentPage:h("offset")/h("limit"),onNextPage:function(){T("offset",h("offset")+h("limit")),D(u)()},onPrevPage:O,pageSizeLimit:h("limit"),onSort:I,disableSort:!1,sortParams:[{id:h("sortBy"),desc:"DESC"===h("sortOrder")}]}):null)},WSSearchWaterConnection:e=>{let{tenantId:n,onSubmit:u,data:d,count:s,resultOk:c,isLoading:v}=e;const p=i.useHistory(),[m,E]=t.useState([]),[S,_]=t.useState(null);t.useEffect(function(){try{return Promise.resolve(Digit.WSService.WSSewsearchDemand({BulkBillCriteria:{tenantId:"pg.citya"}},window.location.href.includes("ws/sewerage/search-demand")?"sw":"ws")).then(function(e){E(e.connection)})}catch(e){return Promise.reject(e)}},[]);const{t:f}=o.useTranslation(),{register:g,control:C,handleSubmit:N,setValue:y,getValues:D,reset:T}=r.useForm({defaultValues:{offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC",searchType:"CONNECTION"}});t.useEffect(()=>{g("offset",0),g("limit",10),g("sortBy","commencementDate"),g("searchType","CONNECTION"),g("sortOrder","DESC"),g("propertyId","")},[g]);const h=t.useCallback(e=>{0!==e.length&&(y("sortBy",e.id),y("sortOrder",e.desc?"DESC":"ASC"))},[]);function A(e){y("limit",Number(e.target.value)),N(u)()}function I(){y("offset",D("offset")+D("limit")),N(u)()}function O(){y("offset",D("offset")-D("limit")),N(u)()}if(window.Digit.Utils.browser.isMobile())return l.createElement(zl,{Controller:r.Controller,register:g,control:C,t:f,reset:T,previousPage:O,handleSubmit:N,tenantId:n,data:d,onSubmit:u});const b=e=>l.createElement("span",{className:"cell-text"},e),L=t.useMemo(()=>[{Header:f("WS_COMMON_TABLE_COL_CONSUMER_NO_LABEL"),disableSortBy:!0,accessor:"connectionNo",Cell:e=>{var t,o,a;let{row:r}=e;return l.createElement("div",null,r.original.connectionNo?l.createElement("span",{className:"link"},l.createElement(i.Link,{to:"/digit-ui/employee/ws/connection-details?applicationNumber="+r.original.connectionNo+"&tenantId="+n+"&service="+(null===(t=r.original)||void 0===t?void 0:t.service)+"&connectionType="+(null===(o=r.original)||void 0===o?void 0:o.connectionType)+"&due="+((null===(a=r.original)||void 0===a?void 0:a.due)||0)+"&from=WS_SEWERAGE_CONNECTION_SEARCH_LABEL"},r.original.connectionNo||"NA")):l.createElement("span",null,f("NA")))}},{Header:f("WS_COMMON_TABLE_COL_SERVICE_LABEL"),disableSortBy:!0,Cell:e=>{var n;let{row:t}=e;return b(f("WS_"+(null===(n=t.original)||void 0===n?void 0:n.service)))}},{Header:f("WS_COMMON_TABLE_COL_OWN_NAME_LABEL"),disableSortBy:!0,Cell:e=>{var n,t,l,o,i;let{row:a}=e;return b(null!=a&&null!==(n=a.original)&&void 0!==n&&null!==(t=n.connectionHolders)&&void 0!==t&&t.map(e=>null==e?void 0:e.name).join(",")?null==a||null===(l=a.original)||void 0===l||null===(o=l.connectionHolders)||void 0===o?void 0:o.map(e=>null==e?void 0:e.name).join(","):""+((null===(i=a.original)||void 0===i?void 0:i.ownerNames)||"NA"))}},{Header:f("WS_COMMON_TABLE_COL_STATUS_LABEL"),disableSortBy:!0,Cell:e=>{var n,t;let{row:l}=e;return b(f("WS_"+(null===(n=l.original)||void 0===n||null===(t=n.status)||void 0===t?void 0:t.toUpperCase())))}},{Header:f("WS_COMMON_TABLE_COL_AMT_DUE_LABEL"),disableSortBy:!0,Cell:e=>{var n;let{row:t}=e;var l,o;return(null==t||null===(n=t.original)||void 0===n?void 0:n.due)<=0?b(""+(null===(l=t.original)||void 0===l?void 0:l.due)):b(""+((null===(o=t.original)||void 0===o?void 0:o.due)||"NA"))}},{Header:f("WS_COMMON_TABLE_COL_ADDRESS"),disableSortBy:!0,Cell:e=>{var n;let{row:t}=e;return b(""+((null===(n=t.original)||void 0===n?void 0:n.address)||"NA"))}},{Header:f("WS_COMMON_TABLE_COL_DUE_DATE_LABEL"),disableSortBy:!0,Cell:e=>{var n,t,l,o;let{row:i}=e;const a=(null===(n=i.original)||void 0===n||null===(t=n.status)||void 0===t?void 0:t.toUpperCase())||"",r="NA"===(null===(l=i.original)||void 0===l?void 0:l.dueDate)?f("WS_NA"):(e=>{if(null==e||null==e||""==e)return"NA";const n=new Date(e);let t=n.getMonth()+1,l=n.getDate();return t=(t>9?"":"0")+t,l=(l>9?"":"0")+l,l+"/"+t+"/"+n.getFullYear()})(null===(o=i.original)||void 0===o?void 0:o.dueDate);return b(f("INACTIVE"===a?"WS_NA":""+r))}},{Header:f("WS_COMMON_TABLE_COL_ACTION_LABEL"),disableSortBy:!0,Cell:e=>{var n;let{row:t}=e;const l=null===(n=t.original)||void 0===n?void 0:n.due;var o;return b(l||0==l?P(null===(o=t.original)||void 0===o?void 0:o.status,t):f("WS_NA"))}}],[]),R=t.useMemo(()=>[{Header:f("WS_COMMON_TABLE_COL_CONSUMER_NO_LABEL"),disableSortBy:!0,accessor:"connectionNo",Cell:e=>{var t,o,a;let{row:r}=e;return l.createElement("div",null,r.original.connectionNo?l.createElement("span",{className:"link"},l.createElement(i.Link,{to:"/digit-ui/employee/ws/connection-details?applicationNumber="+r.original.connectionNo+"&tenantId="+n+"&service="+(null===(t=r.original)||void 0===t?void 0:t.service)+"&connectionType="+(null===(o=r.original)||void 0===o?void 0:o.connectionType)+"&due="+((null===(a=r.original)||void 0===a?void 0:a.due)||0)+"&from=WS_SEWERAGE_CONNECTION_SEARCH_LABEL"},r.original.connectionNo||"NA")):l.createElement("span",null,f("NA")))}},{Header:f("WS_COMMON_TABLE_COL_applicationNo_LABEL"),disableSortBy:!0,Cell:e=>{let{row:n}=e;return l.createElement("div",null,n.original.applicationNo)}},{Header:f("WS_COMMON_TABLE_COL_propertyId_LABEL"),disableSortBy:!0,Cell:e=>{var n,t;let{row:l}=e;return b(f("WS_"+(null===(n=l.original)||void 0===n||null===(t=n.propertyId)||void 0===t?void 0:t.toUpperCase())))}},{Header:f("WS_COMMON_TABLE_COL_ACTION_LABEL"),disableSortBy:!0,Cell:e=>{let{row:n}=e;return b(w(n))}}],[]),w=e=>l.createElement("div",null,l.createElement("span",{className:"link"},l.createElement("button",{onClick:()=>{W(e)}},f("WS_COMMON_COLLECT_DEMAND")," "))),W=function(e){try{return Promise.resolve(Digit.WSService.WSSewsearchDemandGen({BulkBillCriteria:{tenantId:"pg.citya",consumerCode:e.original.connectionNo}},window.location.href.includes("ws/sewerage/search-demand")?"sw":"ws")).then(function(n){var t,l,o;_({label:""+n}),p.push("/digit-ui/employee/payment/collect/SW/"+encodeURIComponent(null===(t=e.original)||void 0===t?void 0:t.connectionNo)+"/"+(null===(l=e.original)||void 0===l?void 0:l.tenantId)+"?tenantId="+(null===(o=e.original)||void 0===o?void 0:o.tenantId)+"?workflow=WS&ISWSCON")})}catch(e){return Promise.reject(e)}},P=(e,n)=>{var t,o,a,r,u,d,s,c,v;if(!(Digit.UserService.getUser().info.roles.map(e=>e.code).filter(e=>"WS_CEMP"===e||"SW_CEMP"===e).length>0))return null;switch(e){case"Active":return l.createElement("div",null,l.createElement("span",{className:"link"},"WATER"===(null===(t=n.original)||void 0===t?void 0:t.service)?l.createElement(i.Link,{to:{pathname:"/digit-ui/employee/payment/collect/"+("WATER"===(null===(o=n.original)||void 0===o?void 0:o.service)?"WS":"SW")+"/"+encodeURIComponent(null===(a=n.original)||void 0===a?void 0:a.connectionNo)+"/"+(null===(r=n.original)||void 0===r?void 0:r.tenantId)+"?tenantId="+(null===(u=n.original)||void 0===u?void 0:u.tenantId)+"?workflow=WS&ISWSCON"}},f("WS_COMMON_COLLECT_LABEL")," "):l.createElement(i.Link,{to:{pathname:"/digit-ui/employee/payment/collect/"+("WATER"===(null===(d=n.original)||void 0===d?void 0:d.service)?"WS":"SW")+"/"+encodeURIComponent(null===(s=n.original)||void 0===s?void 0:s.connectionNo)+"/"+(null===(c=n.original)||void 0===c?void 0:c.tenantId)+"?tenantId="+(null===(v=n.original)||void 0===v?void 0:v.tenantId)+"?workflow=SW&ISWSCON"}},f("WS_COMMON_COLLECT_LABEL")," ")))}};return l.createElement(t.Fragment,null,l.createElement(a.Header,{styles:{fontSize:"32px"}},window.location.href.includes("water")?f("WS_WATER_SEARCH_CONNECTION_SUB_HEADER"):f("WS_SEWERAGE_SEARCH_CONNECTION_SUB_HEADER")),window.location.href.includes("search-demand")?"":l.createElement(a.SearchForm,{className:"ws-custom-wrapper",onSubmit:u,handleSubmit:N},l.createElement(Hl,{register:g,control:C,reset:T,tenantId:n,t:f})),v?l.createElement(a.Loader,null):null,null!=d&&d.display&&!c?l.createElement(a.Card,{style:{marginTop:20}},f(null==d?void 0:d.display).split("\\n").map((e,n)=>l.createElement("p",{key:n,style:{textAlign:"center"}},e))):c?l.createElement(a.Table,{t:f,data:d,totalRecords:s,columns:L,getCellProps:e=>({style:{minWidth:e.column.Header===f("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:A,currentPage:D("offset")/D("limit"),onNextPage:I,onPrevPage:O,pageSizeLimit:D("limit"),onSort:h,disableSort:!1,sortParams:[{id:D("sortBy"),desc:"DESC"===D("sortOrder")}]}):null,window.location.href.includes("search-demand")?(null==m?void 0:m.length)>0?l.createElement(a.Table,{t:f,data:m,totalRecords:s,columns:R,getCellProps:e=>({style:{minWidth:e.column.Header===f("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:A,currentPage:D("offset")/D("limit"),onNextPage:I,onPrevPage:O,pageSizeLimit:D("limit"),onSort:h,disableSort:!1,sortParams:[{id:D("sortBy"),desc:"DESC"===D("sortOrder")}]}):l.createElement(a.Card,{style:{marginTop:20}},l.createElement("p",{style:{textAlign:"center"}},"No Data Found")):"",(null==S?void 0:S.label)&&l.createElement(a.Toast,{label:null==S?void 0:S.label,onClose:e=>{_(e=>null)}}))},WSBulkBillSearch:e=>{let{tenantId:n,onSubmit:i,data:d,count:s,resultOk:c,businessService:v,isLoading:p}=e;const[m,E]=t.useState(null),[S,_]=t.useState(null),[f,g]=t.useState(null),[C,N]=t.useState(()=>null),[y,D]=t.useState(""),[T,h]=t.useState([]),[A,I]=t.useState([]),[O,b]=t.useState([]),[L,R]=t.useState(!1),{mutate:w}=Digit.Hooks.ws.useBulkMeterReadingCreateAPI(v),W=e=>{if(null==e||null==e||""==e)return"NA";const n=new Date(e);let t=n.getMonth()+1,l=n.getDate();return t=(t>9?"":"0")+t,l=(l>9?"":"0")+l,l+"/"+t+"/"+n.getFullYear()},P=()=>{_(!1)},M=e=>l.createElement("h1",{className:"heading-m"},e.label),x=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),B=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(x,null)),{t:F}=o.useTranslation(),{register:U,control:k,handleSubmit:H,setValue:j,getValues:V,reset:z}=r.useForm({defaultValues:{offset:0,limit:10,sortBy:"consumerNo",sortOrder:"DESC",searchType:"CONNECTION",locality:"",tenantId:""}}),Y=e=>l.createElement("div",{onClick:e.onClick},l.createElement(a.DownloadBtnCommon,null));t.useEffect(()=>{U("offset",0),U("limit",10),U("sortBy","commencementDate"),U("searchType","CONNECTION"),U("sortOrder","DESC"),U("locality",""),U("tenantId","")},[U]);const G=t.useCallback(e=>{0!==e.length&&(j("sortBy",e.id),j("sortOrder",e.desc?"DESC":"ASC"))},[]);function q(e){j("limit",Number(e.target.value)),H(i)()}function K(){j("offset",V("offset")+V("limit")),H(i)()}function X(){j("offset",V("offset")-V("limit")),H(i)()}const Z=()=>{E(null)};if(window.Digit.Utils.browser.isMobile())return l.createElement(zl,{Controller:r.Controller,register:U,control:k,t:F,reset:z,previousPage:X,handleSubmit:H,tenantId:n,data:d,onSubmit:i,setValue:j});const $=e=>l.createElement("span",{className:"cell-text"},e),J=(e,n)=>{if(e.preventDefault(),void 0!==(null==n?void 0:n[0]))return Digit.Download.Excel(n,"Bulk-Bill")},Q=t.useMemo(()=>[{Header:F("BILLING_CYCLE"),disableSortBy:!0,Cell:e=>{var n;let{row:t}=e;return $(null===(n=t.original)||void 0===n?void 0:n.billingPeriod)}},{Header:F("WS_COMMON_TABLE_COL_CONSUMER_NO_LABEL"),disableSortBy:!0,accessor:"connectionNo",Cell:e=>{let{row:n}=e;return l.createElement("div",null,l.createElement("span",null,n.original.connectionNo?n.original.connectionNo||"NA":F("NA")))}},{Header:F("LAST_READING"),disableSortBy:!0,Cell:e=>{var n;let{row:t}=e;return $(null===(n=t.original)||void 0===n?void 0:n.lastReading)}},{Header:F("METER_READING_DATE"),disableSortBy:!0,Cell:e=>{var n;let{row:t}=e;return $(W(null===(n=t.original)||void 0===n?void 0:n.lastReadingDate))}},{Header:F("METER_STATUS"),disableSortBy:!0,Cell:e=>{var n;let{row:t}=e;return $(null===(n=t.original)||void 0===n?void 0:n.meterStatus)}},{Header:F("CURRECT_READING"),disableSortBy:!0,Cell:e=>{var n;let{row:t}=e;return $(null===(n=t.original)||void 0===n?void 0:n.currentReading)}},{Header:F("CURRECT_READING_DATE"),disableSortBy:!0,Cell:e=>{var n;let{row:t}=e;return $(W(null===(n=t.original)||void 0===n?void 0:n.currentReadingDate))}}]),ee=t.useMemo(()=>[{Header:F("BILLING_CYCLE"),disableSortBy:!0,Cell:e=>{var n;let{row:t}=e;return $(null===(n=t.original)||void 0===n?void 0:n.billingPeriod)}},{Header:F("WS_COMMON_TABLE_COL_CONSUMER_NO_LABEL"),disableSortBy:!0,accessor:"connectionNo",Cell:e=>{let{row:n}=e;return l.createElement("div",null,l.createElement("span",null,n.original.connectionNo?n.original.connectionNo||"NA":F("NA")))}},{Header:F("LAST_READING"),disableSortBy:!0,Cell:e=>{var n;let{row:t}=e;return $(null===(n=t.original)||void 0===n?void 0:n.lastReading)}},{Header:F("METER_READING_DATE"),disableSortBy:!0,Cell:e=>{var n;let{row:t}=e;return $(W(null===(n=t.original)||void 0===n?void 0:n.lastReadingDate))}},{Header:F("METER_STATUS"),disableSortBy:!0,Cell:e=>{var n;let{row:t}=e;return $(null===(n=t.original)||void 0===n?void 0:n.meterStatus)}},{Header:F("CURRECT_READING"),disableSortBy:!0,Cell:e=>{var n;let{row:t}=e;return $(null===(n=t.original)||void 0===n?void 0:n.currentReading)}},{Header:F("CURRECT_READING_DATE"),disableSortBy:!0,Cell:e=>{var n;let{row:t}=e;return $(W(null===(n=t.original)||void 0===n?void 0:n.currentReadingDate))}},{Header:F("CURRECT_STATUS"),disableSortBy:!0,Cell:e=>{var n;let{row:t}=e;return $(null===(n=t.original)||void 0===n?void 0:n.status)}}]);return l.createElement(t.Fragment,null,l.createElement(a.Header,{styles:{fontSize:"32px"}},F("WS_WATER_SEARCH_BULK_CONNECTION_SUB_HEADER")),l.createElement(a.SearchForm,{className:"ws-custom-wrapper",onSubmit:i,handleSubmit:H},l.createElement(Yl,{register:U,control:k,reset:z,tenantId:n,t:F,setValue:j})),p?l.createElement(a.Loader,null):null,L&&l.createElement(a.Loader,null),null!=d&&d.display&&!c?l.createElement(a.Card,{style:{marginTop:20}},F(null==d?void 0:d.display).split("\\n").map((e,n)=>l.createElement("p",{key:n,style:{textAlign:"center"}},e))):c?l.createElement("div",{style:{backgroundColor:"white"}},l.createElement("div",{className:"sideContent",style:{float:"right",padding:"10px 30px"}},l.createElement("span",{className:"table-search-wrapper",style:{cursor:"pointer"}},l.createElement(Y,{className:"mrlg cursorPointer",onClick:e=>J(e,d)}))),l.createElement("div",{style:{display:"flex"}},l.createElement("div",{style:{width:"70%"}},l.createElement(a.UploadFile,{id:"Bulk-Bill",extraStyleName:"propertyCreate",message:C?"1 "+F("CS_WS_ACTION_FILEUPLOADED"):F("CS_WS_ACTION_NO_FILEUPLOADED"),accept:".xlsx",onUpload:e=>function(e){e.preventDefault(),D(e.target.files[0]),function(e){try{new Promise((n,t)=>{const l=new FileReader;l.readAsArrayBuffer(e),l.onload=e=>{const t=u.read(e.target.result,{type:"buffer"}),l=u.utils.sheet_to_json(t.Sheets[t.SheetNames[0]]).map(e=>({billingPeriod:e.billingPeriod,currentReading:e.currentReading,currentReadingDate:e.currentReadingDate,lastReading:e.lastReading,lastReadingDate:e.lastReadingDate,connectionNo:e.connectionNo,meterStatus:e.meterStatus,tenantId:"pg.citya"})),o=l.filter(e=>e.currentReading>=e.lastReading&&(e=>{var n;const t=new Date(0).getTimezoneOffset(),l=new Date(0,0,e-1,0,-t,0);return Digit.Utils.pt.convertDateToEpoch(null==l||null===(n=l.toJSON())||void 0===n?void 0:n.split("T")[0])})(null==e?void 0:e.currentReadingDate)>e.lastReadingDate),i=l.filter(e=>!o.includes(e));console.log("reading list",o,i),I(i),n(o,i)},l.onerror=e=>{t(e)}}).then(function(e,n){try{return h(e),Promise.resolve()}catch(e){return Promise.reject(e)}}),Promise.resolve()}catch(e){return Promise.reject(e)}}(e.target.files[0]),N("bulk")}(e),onDelete:e=>{N(null),h([])}})),(null==T?void 0:T.length)>0?l.createElement("div",{style:{top:"5px",left:"10px",position:"relative"}},l.createElement("span",null,l.createElement(a.SubmitBar,{label:F("WS_COMMON_SUBMIT_READING"),onSubmit:()=>{(null==A?void 0:A.length)>0&&_(!0)}}))):""),l.createElement(a.Table,{t:F,data:d,totalRecords:s,columns:Q,getCellProps:e=>({style:{minWidth:e.column.Header===F("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onSort:G,disableSort:!1,sortParams:[{id:V("sortBy"),desc:"DESC"===V("sortOrder")}]})):null,l.createElement("div",null,S&&l.createElement(a.Modal,{headerBarMain:l.createElement(M,{label:F("WS_BULK_READING_REJECT")}),headerBarEnd:l.createElement(B,{onClick:P}),actionCancelLabel:"Cancel",actionCancelOnSubmit:P,actionSaveLabel:"Proceed",actionSaveOnSubmit:()=>{_(!1),function(){try{const e=function(){if(w)return R(!0),Promise.resolve(w({meterReadingList:T},{onError:(e,n)=>{R(!1),E({error:!0,label:null!=e&&e.message?e.message:e}),setTimeout(Z,5e3)},onSuccess:function(e,n){try{return R(!1),console.log("data",e),g(!0),b(e.meterReadings),E({key:"success",label:"WS_METER_READING_ADDED_SUCCESFULLY"}),setTimeout(Z,3e3),Promise.resolve()}catch(e){return Promise.reject(e)}}})).then(function(){})}();Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}()},formId:"modal-action",popupStyles:{width:"auto"}}," ",l.createElement("div",{style:{width:"100%"}},l.createElement(a.Card,null,l.createElement("div",null,l.createElement(a.CardText,null,F("WS_REASON_FOR_REJECT"))),l.createElement("div",null,l.createElement(a.CardText,null,F("WS_SUCCESS_DATA_COUNT")," - ",null==T?void 0:T.length)),l.createElement("div",null,l.createElement(a.CardText,null,F("WS_REJECT_DATA_COUNT")," - ",null==A?void 0:A.length)),l.createElement(a.Table,{t:F,data:A,totalRecords:null==A?void 0:A.length,columns:Q,getCellProps:e=>({style:{minWidth:e.column.Header===F("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:q,currentPage:V("offset")/V("limit"),onNextPage:K,onPrevPage:X,pageSizeLimit:V("limit"),onSort:G,disableSort:!0,sortParams:[{id:V("sortBy"),desc:"DESC"===V("sortOrder")}]})))),f&&l.createElement(a.Modal,{headerBarMain:l.createElement(M,{label:F("WS_BULK_READING_STATUS")}),headerBarEnd:l.createElement(B,{onClick:()=>{g(!1)}}),formId:"modal-action",popupStyles:{width:"auto"}}," ",l.createElement("div",{style:{width:"100%"}},l.createElement(a.Card,null,l.createElement("div",null,l.createElement(a.CardText,null,F("Bulk Meter Reading Status"))),l.createElement("div",{className:"sideContent",style:{float:"right",padding:"10px 30px"}},l.createElement("span",{className:"table-search-wrapper",style:{cursor:"pointer"}},l.createElement(Y,{className:"mrlg cursorPointer",onClick:e=>J(e,O)}))),l.createElement(a.Table,{t:F,data:O,totalRecords:null==O?void 0:O.length,columns:ee,getCellProps:e=>({style:{minWidth:e.column.Header===F("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:q,currentPage:V("offset")/V("limit"),onNextPage:K,onPrevPage:X,pageSizeLimit:V("limit"),onSort:G,disableSort:!0,sortParams:[{id:V("sortBy"),desc:"DESC"===V("sortOrder")}]}))))),(null==m?void 0:m.label)&&l.createElement(a.Toast,{label:null==m?void 0:m.label,onClose:e=>{E(e=>null)}}))},WSCard:()=>{if(!Digit.Utils.wsAccess())return null;const{t:e}=o.useTranslation(),n=Digit.ULBService.getCurrentTenantId(),[i,r]=t.useState(0);sessionStorage.removeItem("Digit.PT_CREATE_EMP_WS_NEW_FORM"),sessionStorage.removeItem("IsDetailsExists");const{isLoading:u,data:d}=Digit.Hooks.ws.useInbox({tenantId:n,filters:v({},{filterForm:{businessService:["NewWS1","ModifyWSConnection","DisconnectWSConnection"],moduleName:"ws-services",locality:[],applicationStatus:[],applicationType:[]},searchForm:{},tableForm:{sortBy:"auditDetails.lastModifiedTime",sortOrder:"DESC"}})});t.useEffect(()=>{u||r(null!=d&&d.totalCount?null==d?void 0:d.totalCount:0)},[d]);let s=[{label:e("WS_APPLY_NEW_CONNECTION_HOME_CARD_LABEL"),link:"/digit-ui/employee/ws/create-application",roles:["WS_CEMP","SW_CEMP"]}];s=s.filter(e=>!e.roles||b(e.roles));const c={Icon:l.createElement(a.WSICon,null),moduleName:e("ACTION_TEST_WATER"),kpis:[{count:u?"-":i,label:e("TOTAL_WS"),link:"/digit-ui/employee/ws/water/inbox"},{count:u?"-":null==d?void 0:d.slaCount,label:e("TOTAL_NEARING_SLA"),link:"/digit-ui/employee/ws/water/inbox"}],links:[{count:u?"-":null==d?void 0:d.totalCount,label:e("WS_INBOX_HEADER"),link:"/digit-ui/employee/ws/water/inbox",roles:["WS_CEMP","WS_APPROVER","WS_FIELD_INSPECTOR","WS_DOC_VERIFIER","WS_CLERK"]},...s,{label:e("WS_WATER_CONNECTION_SEARCH_LABEL"),link:"/digit-ui/employee/ws/water/search-connection",roles:["WS_CEMP","WS_APPROVER","WS_FIELD_INSPECTOR","WS_DOC_VERIFIER","WS_CLERK"]},{label:e("WS_WATER_APPLICATION_SEARCH"),link:"/digit-ui/employee/ws/water/search-application",roles:["WS_CEMP","WS_APPROVER","WS_FIELD_INSPECTOR","WS_DOC_VERIFIER","WS_CLERK"]}]};return l.createElement(a.EmployeeModuleCard,c)},SWCard:()=>{if(!Digit.Utils.swAccess())return null;const{t:e}=o.useTranslation(),n=Digit.ULBService.getCurrentTenantId(),[i,r]=t.useState(0);sessionStorage.removeItem("Digit.PT_CREATE_EMP_WS_NEW_FORM"),sessionStorage.removeItem("IsDetailsExists");const{isLoading:u,data:d}=Digit.Hooks.ws.useInbox({tenantId:n,filters:v({},{filterForm:{businessService:["NewSW1","ModifySWConnection","DisconnectSWConnection"],moduleName:"sw-services",locality:[],applicationStatus:[],applicationType:[]},searchForm:{},tableForm:{sortBy:"auditDetails.lastModifiedTime",sortOrder:"DESC"}})});t.useEffect(()=>{u||r(null!=d&&d.totalCount?null==d?void 0:d.totalCount:0)},[d]);let s=[{label:e("WS_APPLY_NEW_CONNECTION_HOME_CARD_LABEL"),link:"/digit-ui/employee/ws/create-application",roles:["WS_CEMP","SW_CEMP"]}];s=s.filter(e=>!e.roles||b(e.roles));const c={Icon:l.createElement(a.WSICon,null),moduleName:e("ACTION_TEST_SEWERAGE"),kpis:[{count:u?"-":i,label:e("TOTAL_SW"),link:"/digit-ui/employee/ws/sewerage/inbox"},{count:u?"-":null==d?void 0:d.slaCount,label:e("TOTAL_NEARING_SLA"),link:"/digit-ui/employee/ws/sewerage/inbox"}],links:[{count:u?"-":null==d?void 0:d.totalCount,label:e("WS_SEWERAGE_INBOX"),link:"/digit-ui/employee/ws/sewerage/inbox",roles:["SW_CEMP","SW_APPROVER","SW_FIELD_INSPECTOR","SW_DOC_VERIFIER","SW_CLERK"]},...s,{label:e("WS_SEWERAGE_CONNECTION_SEARCH_LABEL"),link:"/digit-ui/employee/ws/sewerage/search-connection",roles:["SW_CEMP","SW_APPROVER","SW_FIELD_INSPECTOR","SW_DOC_VERIFIER","SW_CLERK"]},{label:e("WS_SEWERAGE_APPLICATION_SEARCH"),link:"/digit-ui/employee/ws/sewerage/search-application",roles:["SW_CEMP","SW_APPROVER","SW_FIELD_INSPECTOR","SW_DOC_VERIFIER","SW_CLERK"]}]};return l.createElement(a.EmployeeModuleCard,c)},WSBillIAmendMentInbox:e=>{let{parentRoute:n}=e;const{t:u}=o.useTranslation(),d=Digit.ULBService.getCurrentTenantId(),s=window.location.href.includes("/ws/water/bill-amendment/inbox"),c={mobileNumber:"",applicationNumber:"",consumerCode:""},p={applicationStatus:[],businessService:s?["WS.AMENDMENT"]:["SW.AMENDMENT"],moduleName:s?"bsWs-service":"bsSw-service",locality:[],assignee:"ASSIGNED_TO_ALL"},m={sortBy:"createdTime",limit:window.Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"ASC"};sessionStorage.removeItem("Digit.BILL.AMENDMENT.INBOX");const E=Digit.SessionStorage.get("BILL.AMENDMENT.INBOX"),S=t.useMemo(()=>E||{filterForm:p,searchForm:c,tableForm:m},[Object.values((null==E?void 0:E.filterForm)||{}),Object.values((null==E?void 0:E.searchForm)||{}),Object.values((null==E?void 0:E.tableForm)||{})]),[_,f]=t.useReducer(function(e,n){switch(n.action){case"mutateSearchForm":return Digit.SessionStorage.set("BILL.AMENDMENT.INBOX",v({},e,{searchForm:n.data})),v({},e,{searchForm:n.data});case"mutateFilterForm":return Digit.SessionStorage.set("BILL.AMENDMENT.INBOX",v({},e,{filterForm:n.data})),v({},e,{filterForm:n.data});case"mutateTableForm":return Digit.SessionStorage.set("BILL.AMENDMENT.INBOX",v({},e,{tableForm:n.data})),v({},e,{tableForm:n.data})}},S),{data:g,isLoading:C}=Digit.Hooks.useBoundaryLocalities(d,"revenue",{},u),{isLoading:N,data:{table:y,statuses:D,totalCount:T}={}}=Digit.Hooks.useBillAmendmentInbox({tenantId:d,filters:v({},_),config:{cacheTime:0}}),{data:h}=Digit.Hooks.useApplicationStatusGeneral({businessServices:["WS.AMENDMENT","SW.AMENDMENT"],tenantId:d},{enabled:(null==D?void 0:D.length)>0});null==D||D.map(e=>{var n,t;null==h||null===(n=h.otherRoleStates)||void 0===n||n.map(n=>{(null==n?void 0:n.uuid)===(null==e?void 0:e.statusid)&&(e.applicationstatus=u(null==n?void 0:n.state))}),null==h||null===(t=h.userRoleStates)||void 0===t||t.map(n=>{(null==n?void 0:n.uuid)===(null==e?void 0:e.statusid)&&(e.applicationstatus=u(null==n?void 0:n.state))})});const A={logoIcon:l.createElement(a.CollectionIcon,null),headerText:"ACTION_TEST_BILLAMENDMENT",links:[]},I=t.useCallback(e=>{let{registerRef:n,searchFormState:t}=e;return l.createElement(Gl,{registerRef:n,searchFormState:t,className:"search"})},[]),O=t.useCallback(e=>{let{registerRef:n,controlFilterForm:t,setFilterFormValue:o,getFilterFormValue:i}=e;return l.createElement(ql,{statuses:D,isInboxLoading:N,registerRef:n,controlFilterForm:t,setFilterFormValue:o,filterFormState:null==_?void 0:_.filterForm,getFilterFormValue:i,localitiesForEmployeesCurrentTenant:g,loadingLocalitiesForEmployeesCurrentTenant:C})},[D,N,g,C,h]),b={SearchFormFields:I,onSearchFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),f({action:"mutateTableForm",data:v({},m)}),f({action:"mutateSearchForm",data:e})},searchFormDefaultValues:null==_?void 0:_.searchForm,resetSearchFormDefaultValues:c,onSearchFormReset:e=>{e("mobileNumber",null),e("applicationNo",null),e("consumerCode",null),f({action:"mutateSearchForm",data:c})},className:"search-form-wns-inbox"},L={FilterFormFields:O,onFilterFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),f({action:"mutateTableForm",data:v({},m)}),f({action:"mutateFilterForm",data:e})},filterFormDefaultValues:null==_?void 0:_.filterForm,resetFilterFormDefaultValues:p,onFilterFormReset:e=>{e("moduleName",s?"bsWs-service":"bsSw-service"),e("locality",[]),e("assignee","ASSIGNED_TO_ALL"),e("applicationStatus",[]),f({action:"mutateFilterForm",data:p})}},R=(e=>{var n,a,r,u;let{onPageSizeChange:d,formState:s,totalCount:c,table:p,dispatch:m,onSortingByData:E,inboxStyles:S={},tableStyle:_={}}=e;const{t:f}=o.useTranslation(),g=Digit.ULBService.getCurrentTenantId(),C=e=>l.createElement("span",{className:"cell-text styled-cell"},e),N=t.useMemo(()=>[{Header:f("WS_COMMON_TABLE_COL_SERVICE_LABEL"),disableSortBy:!0,Cell:e=>{var n,t;let{row:l}=e;return C(f("ACTION_TEST_"+(null!=l&&null!==(n=l.original)&&void 0!==n&&null!==(t=n.service)&&void 0!==t&&t.includes("WS")?"WATER":"SEWERAGE")))}},{Header:f("WS_MYCONNECTIONS_APPLICATION_NO"),disableSortBy:!0,Cell:e=>{var n;let{row:t}=e;return l.createElement("div",{style:{display:"flex",flexDirection:"column"}},l.createElement(i.Link,{to:"/digit-ui/employee/ws/generate-note-bill-amendment?applicationNumber="+t.original.applicationNo},l.createElement("span",{className:"link"},t.original.applicationNo)),C(f("BILLAMENDMENT_"+(null==t||null===(n=t.original)||void 0===n?void 0:n.amendmentReason)+"_HEADING")))}},,{Header:f("CORE_COMMON_NAME"),disableSortBy:!0,accessor:"owner"},{Header:f("WS_COMMON_TABLE_COL_ADDRESS"),disableSortBy:!0,accessor:e=>C(f(Digit.Utils.locale.getRevenueLocalityCode(e.address,g)))},{Header:f("WS_COMMON_TABLE_COL_APPLICATION_STATUS"),disableSortBy:!0,accessor:e=>{return"Approved"===(n=f(null==e?void 0:e.status))?l.createElement("span",{style:{color:"#00703C"}},n):"Rejected"===n?l.createElement("span",{style:{color:"#0B0C0C"}},n):"Inworkflow"===n?l.createElement("span",{style:{color:"#E50000"}},n):void 0;var n}},{Header:f("WS_COMMON_TABLE_COL_TASK_OWNER"),disableSortBy:!0,accessor:"taskOwner"}]);return{getCellProps:e=>({style:{padding:"20px 18px",fontSize:"16px"}}),disableSort:!1,autoSort:!1,manualPagination:!0,initSortId:"applicationDate",onPageSizeChange:d,currentPage:(null===(n=s.tableForm)||void 0===n?void 0:n.offset)/(null===(a=s.tableForm)||void 0===a?void 0:a.limit),onNextPage:()=>{var e,n;return m({action:"mutateTableForm",data:v({},s.tableForm,{offset:parseInt(null===(e=s.tableForm)||void 0===e?void 0:e.offset)+parseInt(null===(n=s.tableForm)||void 0===n?void 0:n.limit)})})},onPrevPage:()=>{var e,n;return m({action:"mutateTableForm",data:v({},s.tableForm,{offset:parseInt(null===(e=s.tableForm)||void 0===e?void 0:e.offset)-parseInt(null===(n=s.tableForm)||void 0===n?void 0:n.limit)})})},pageSizeLimit:null===(r=s.tableForm)||void 0===r?void 0:r.limit,onSort:E,totalRecords:c,onSearch:null==s||null===(u=s.searchForm)||void 0===u?void 0:u.message,onLastPage:()=>{var e;return m({action:"mutateTableForm",data:v({},s.tableForm,{offset:10*Math.ceil(c/10)-parseInt(null===(e=s.tableForm)||void 0===e?void 0:e.limit)})})},onFirstPage:()=>m({action:"mutateTableForm",data:v({},s.tableForm,{offset:0})}),data:p,columns:N,inboxStyles:v({},S),tableStyle:v({},_)}})(v({},{parentRoute:n,onPageSizeChange:e=>{f({action:"mutateTableForm",data:v({},_.tableForm,{limit:e.target.value})})},formState:_,totalCount:T,table:y,dispatch:f,onSortingByData:e=>{if(e.length>0){const[{id:n,desc:t}]=e,l=t?"DESC":"ASC";_.tableForm.sortBy===n&&_.tableForm.sortOrder===l||f({action:"mutateTableForm",data:v({},_.tableForm,{sortBy:n,sortOrder:t?"DESC":"ASC"})})}},inboxStyles:{overflowX:"scroll",overflowY:"hidden"},tableStyle:{width:"70%"}})),w=(e=>{let{table:n}=e;const{t:t}=o.useTranslation(),u=(e,n)=>l.createElement("div",{style:{display:"flex",flexDirection:"column"}},l.createElement(i.Link,{to:"/digit-ui/employee/ws/generate-note-bill-amendment?applicationNumber="+e},l.createElement("span",{className:"link"},e)),(e=>l.createElement("span",{className:"cell-text styled-cell"},e))(t("BILLAMENDMENT_"+n+"_HEADING")));return{data:null==n?void 0:n.map(e=>{let{applicationNo:n,address:l,status:o,owner:i,service:a,tenantId:r,amendmentReason:d,taskOwner:s}=e;return{[t("WS_COMMON_TABLE_COL_SERVICE_LABEL")]:t("ACTION_TEST_"+a),[t("WS_MYCONNECTIONS_APPLICATION_NO")]:u(n,d),[t("CORE_COMMON_NAME")]:i,[t("WS_COMMON_TABLE_COL_ADDRESS")]:t(Digit.Utils.locale.getRevenueLocalityCode(l,r)),[t("WS_COMMON_TABLE_COL_APPLICATION_STATUS")]:t(o),[t("WS_COMMON_TABLE_COL_TASK_OWNER")]:s}}),serviceRequestIdKey:t("NOC_APP_NO_LABEL"),MobileSortFormValues:()=>{const e=[{code:"DESC",i18nKey:"ES_COMMON_SORT_BY_DESC"},{code:"ASC",i18nKey:"ES_COMMON_SORT_BY_ASC"}],{control:n}=r.useFormContext();return l.createElement(a.SearchField,null,l.createElement(r.Controller,{name:"sortOrder",control:n,render:n=>{let{onChange:t,value:o}=n;return l.createElement(a.RadioButtons,{onSelect:e=>{t(e.code)},selectedOption:e.filter(e=>e.code===o)[0],optionsKey:"i18nKey",name:"sortOrder",options:e})}}))}}})({parentRoute:n,table:y}),W={onMobileSortOrderData:e=>{const{sortOrder:n}=e;f({action:"mutateTableForm",data:v({},_.tableForm,{sortOrder:n})})},sortFormDefaultValues:null==_?void 0:_.tableForm,onSortFormReset:e=>{e("sortOrder","DESC"),f({action:"mutateTableForm",data:m})}};return l.createElement(t.Fragment,null,l.createElement(a.Header,null,u("ES_COMMON_INBOX"),T?l.createElement("p",{className:"inbox-count"},T):null),l.createElement(a.InboxComposer,v({isInboxLoading:N,PropsForInboxLinks:A},b,L,W,{propsForInboxTable:R,propsForInboxMobileCards:w,formState:_})))},WSCreate:()=>{var e,n,t,a,r,u;const s=d.useQueryClient(),{t:c}=o.useTranslation(),{pathname:p,state:m}=(i.useRouteMatch(),i.useLocation()),E=i.useRouteMatch(),S=i.useHistory(),[_,f,g]=(i.useLocation(),Digit.ULBService.getCurrentTenantId(),Digit.Hooks.useSessionStorage("WS_CREATE",null!=m&&m.edcrNumber?{data:{scrutinyNumber:{edcrNumber:null==m?void 0:m.edcrNumber}}}:{})),C=null===(e=Digit)||void 0===e||null===(n=e.ComponentRegistryService)||void 0===n?void 0:n.getComponent("WSCheckPage"),N=null===(t=Digit)||void 0===t||null===(a=t.ComponentRegistryService)||void 0===a?void 0:a.getComponent("WSAcknowledgement"),y=Digit.ULBService.getStateId();let{data:D}=Digit.Hooks.ws.useWSConfigMDMS.getFormConfig(y,[]),T=window.location.href.includes("/modify-connection/")||window.location.href.includes("/edit-application/");_&&Object.keys(_).length>0&&window.location.href.includes("/citizen/ws/create-application/search-property")&&(g(),s.invalidateQueries("WS_CREATE"));const h=(e,n,t,l)=>{f(l?n:""===e?v({},n):v({},_,{[e]:v({},_[e],n)})),(e=>{var n,t,l,o,i;const a=p.split("/").pop();let{nextStep:r}=I.find(e=>e.route===a),u=I.find(e=>e.route===a&&e);"object"==typeof r&&null!=r&&(!r[sessionStorage.getItem("KnowProperty")]||"search-property"!==r[sessionStorage.getItem("KnowProperty")]&&"create-property"!==r[sessionStorage.getItem("KnowProperty")]||(r=""+r[sessionStorage.getItem("KnowProperty")])),u[sessionStorage.getItem("serviceName")]&&(r=u[sessionStorage.getItem("serviceName")]),(null!=_&&null!==(n=_.cptId)&&void 0!==n&&n.id||null!=_&&null!==(t=_.cpt)&&void 0!==t&&null!==(l=t.details)&&void 0!==l&&l.propertyId||T&&null!=_&&null!==(o=_.cpt)&&void 0!==o&&null!==(i=o.details)&&void 0!==i&&i.propertyId)&&"know-your-property"===r&&(r="property-details"),"docsrequired"===r&&"yes"===sessionStorage.getItem("changePropertySelected")&&(r="property-details");let d=S.push;if(null===r)return d(Xl(E.path,E.params)+"/check");d(Xl(E.path,E.params)+"/"+r)})()},A=()=>{};let I=[];return D=null!==(r=D)&&void 0!==r&&r.WSCreateConfig?null===(u=D)||void 0===u?void 0:u.WSCreateConfig:Kl,D.forEach(e=>{I=I.concat(e.body.filter(e=>!e.hideInCitizen))}),I.indexRoute="search-property",l.createElement(i.Switch,null,I.map((e,n)=>{const{component:t,texts:o,inputs:a,key:r,isSkipEnabled:u}=e,d="string"==typeof t?Digit.ComponentRegistryService.getComponent(t):t;return l.createElement(i.Route,{path:Xl(E.path,E.params)+"/"+e.route,key:n},l.createElement(d,{config:{texts:o,inputs:a,key:r,isSkipEnabled:u},onSelect:h,onSkip:A,t:c,formData:_,userType:"citizen"}))}),l.createElement(i.Route,{path:Xl(E.path,E.params)+"/check"},l.createElement(C,{onSubmit:function(){try{return sessionStorage.setItem("isCreateEnabled","true"),S.push(Xl(E.path,E.params)+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:_})),l.createElement(i.Route,{path:Xl(E.path,E.params)+"/acknowledgement"},l.createElement(N,{data:_,onSuccess:()=>{s.invalidateQueries("WS_CREATE")},clearParams:g})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:Xl(E.path,E.params)+"/"+I.indexRoute})))},WSDisconnection:()=>{var e,n,t;d.useQueryClient();const{t:a}=o.useTranslation(),r=i.useRouteMatch(),u=Digit.ULBService.getStateId();let s=[],{data:c}=Digit.Hooks.ws.useWSConfigMDMS.getFormConfig(u,{});return c=null!==(e=c)&&void 0!==e&&e.WSDisconnectionConfig?null===(n=c)||void 0===n?void 0:n.WSDisconnectionConfig:Zl,c=Zl,null===(t=c.filter(e=>"NEW_DISCONNECTION"===e.head))||void 0===t||t.forEach(e=>{s=s.concat(e.body.filter(e=>!e.hideInCitizen))}),s.indexRoute="docsrequired",l.createElement(i.Switch,null,s.map((e,n)=>{const{component:t,texts:o,inputs:u,key:d,isSkipEnabled:s}=e,c="string"==typeof t?Digit.ComponentRegistryService.getComponent(t):t;return l.createElement(i.Route,{path:$l(r.path,r.params)+"/"+e.route,key:n},l.createElement(c,{config:{texts:o,inputs:u,key:d,isSkipEnabled:s},t:a,userType:"citizen"}))}),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:$l(r.path,r.params)+"/"+s.indexRoute})))},WSRestoration:()=>{var e,n,t;d.useQueryClient();const{t:a}=o.useTranslation(),r=i.useRouteMatch(),u=Digit.ULBService.getStateId();let s=[],{data:c}=Digit.Hooks.ws.useWSConfigMDMS.getFormConfig(u,{});c=null!==(e=c)&&void 0!==e&&e.WSDisconnectionConfig?null===(n=c)||void 0===n?void 0:n.WSDisconnectionConfig:Zl,c=Zl,null===(t=c.filter(e=>"NEW_DISCONNECTION"===e.head))||void 0===t||t.forEach(e=>{s=s.concat(e.body.filter(e=>!e.hideInCitizen))}),s.indexRoute="restoration-application";let v=[{route:"restoration-application",component:"WSRestorationForm",key:"WSRestorationForm",type:"component",withoutLabel:!0,nextStep:"check"},{route:"check",component:"WSRestorationCheckPage",key:"WSRestorationCheckPage",type:"component",isMandatory:!0,withoutLabel:!0,nextStep:"restoration-acknowledge",hideInEmployee:!0},{route:"restoration-acknowledge",component:"WSRestorationAcknowledgement",key:"WSRestorationAcknowledgement",type:"component",isMandatory:!0,withoutLabel:!0,hideInEmployee:!0}];return console.log(v,s),l.createElement(i.Switch,null,v.map((e,n)=>{const{component:t,texts:o,inputs:u,key:d,isSkipEnabled:s}=e,c="string"==typeof t?Digit.ComponentRegistryService.getComponent(t):t;return l.createElement(i.Route,{path:Jl(r.path,r.params)+"/"+e.route,key:n},l.createElement(c,{config:{texts:o,inputs:u,key:d,isSkipEnabled:s},t:a,userType:"citizen"}))}),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:Jl(r.path,r.params)+"/"+s.indexRoute})))},WSSearchConnectionComponent:()=>{const{t:e}=o.useTranslation(),{path:n}=i.useRouteMatch(),a=t.useMemo(()=>Ql.map(n=>{const t={};for(const l in n.texts)t[l]=e(n.texts[l]);return v({},n,{texts:t})},[Ql]));return l.createElement(i.Switch,null,l.createElement(i.Route,{path:""+n,exact:!0},l.createElement(Vo,{config:a[0]})))},WSSearchResultsComponent:()=>{const{t:e}=o.useTranslation(),{path:n}=i.useRouteMatch(),a=t.useMemo(()=>zo.map(n=>{const t={};for(const l in n.texts)t[l]=e(n.texts[l]);return v({},n,{texts:t})},[zo]));return l.createElement(i.Switch,null,l.createElement(i.Route,{path:""+n,exact:!0},l.createElement(Ii,{template:a[0].labels,header:a[0].texts.header,actionButtonLabel:a[0].texts.actionButtonLabel,t:e})))},WSCitizenApplicationDetails:()=>{var e,n,r,u,d,s,c,p,E,_,g,N,y,D,h,A,I,O,b,L,R,w,W,P,M,x,B,F,k,H,V,z,Y,G,q,K,X,$,J,Q,ee,ne,te,le,oe,ie,ae,re,ue,de,se,ce,ve,pe,me,Ee,Se,_e,fe,ge,Ce,Ne,ye,De,Te,he,Ae,Ie,Oe,be,Le,Re,we,We,Pe,Me,xe,Be,Fe,Ue,ke,He,je,Ve,ze,Ye,Ge,qe,Ke,Xe,Ze,$e,Je,Qe,en,nn,tn,ln,on,an,rn,un,dn,sn,cn,vn,pn,mn,En,Sn,_n,fn,gn,Cn,Nn,yn,Dn,Tn,hn,An,In,On,bn,Ln,Rn,wn,Wn,Pn,Mn,xn,Bn,Fn,Un,kn,Hn,jn,Vn,zn,Yn,Gn,qn,Kn,Xn,Zn,$n,Jn,Qn,et,nt,tt,lt,ot,it,at,rt,ut,dt,st,ct,vt,pt,mt,Et,St,_t,ft,gt,Ct,Nt,yt,Dt,Tt,ht,At,It,Ot,bt,Lt,Rt,wt,Wt,Pt,Mt,xt,Bt,Ft,Ut,kt,Ht,jt,Vt,zt,Yt,Gt,qt,Kt,Xt,Zt,$t,Jt,Qt,el,nl,tl,ll,ol,il,al,rl,ul,dl,sl,cl,vl,pl,ml,El,Sl,_l,fl,gl,Cl,Nl,yl,Dl,Tl,hl,Al,Il,Ol,bl,Ll,Rl,wl,Wl,Pl,Ml,xl,Bl,Fl,Ul,kl,Hl,jl,Vl,zl,Yl,Gl,ql,Kl,Xl,Zl,$l,Jl,Ql,eo,no,to,lo,oo,io,ao,ro,uo,so,co,vo,po,mo,Eo,So,_o,fo,go,Co,No,yo,Do,To,ho,Ao,Io,Oo,bo,Lo,Ro,wo,Wo,Po,Mo,xo,Bo,Fo,Uo,ko,Ho,jo,Vo,zo,Yo,Go,qo,Ko,Xo,Zo,$o,Jo,Qo,ei,ni,ti,li,oi,ii,ai,ri,ui,di,si,ci,vi,pi,mi,Ei,Si,_i,fi,gi,Ci,Ni,yi,Di,Ti,hi,Ai,Ii,Oi,Ri,wi,Wi,Pi,Mi,Bi,Fi,Ui,ki,Hi,ji,Vi,zi,Yi,Gi,qi,Ki,Xi,Zi,$i,Ji,Qi,ea,na,ta,la,oa,ia,aa,ra,ua,da,sa,ca,va,pa,ma,Ea,Sa,_a,fa,ga,Ca,Na,ya,Da,Ta,ha,Aa,Ia,Oa,ba,La,Ra,wa,Wa,Pa,Ma,xa,Ba,Fa,Ua,ka,Ha,ja,Va,za;const{t:Ya}=o.useTranslation(),Ga=t.useRef(),qa=Digit.UserService.getUser(),Ka=(null===(e=Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY"))||void 0===e?void 0:e.code)||(null==qa||null===(n=qa.info)||void 0===n?void 0:n.permanentCity)||Digit.ULBService.getCurrentTenantId(),[Xa,Za]=(Digit.ULBService.getStateId(),t.useState(!1)),[$a,Ja]=t.useState(!1),Qa=window.location.href.includes("SW_")?window.location.href.substring(window.location.href.indexOf("SW_")):window.location.href.substring(window.location.href.indexOf("WS_"));let er={tenantId:Ka,applicationNumber:Qa};const{isLoading:nr,data:tr}=Digit.Hooks.ws.useMyApplicationSearch({filters:er,BusinessService:null!=Qa&&Qa.includes("SW")?"SW":"WS"},{filters:er,privacy:Digit.Utils.getPrivacyObject()});Digit.Hooks.useClickOutside(Ga,()=>{Za(!1)},Xa);const lr={consumerCode:null!=Qa&&Qa.includes("DC")?(null==tr||null===(r=tr.WaterConnection)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.connectionNo)||(null==tr||null===(d=tr.SewerageConnections)||void 0===d||null===(s=d[0])||void 0===s?void 0:s.connectionNo):(null==tr||null===(c=tr.WaterConnection)||void 0===c||null===(p=c[0])||void 0===p?void 0:p.applicationNo)||(null==tr||null===(E=tr.SewerageConnections)||void 0===E||null===(_=E[0])||void 0===_?void 0:_.applicationNo)},{data:or}=Digit.Hooks.useCommonMDMS(Ka,"common-masters","ReceiptKey",{select:e=>{var n,t,l;return(null===(n=e["common-masters"])||void 0===n||null===(t=n.uiCommonPay)||void 0===t||null===(l=t.filter(e=>{let{code:n}=e;return"WS.ONE_TIME_FEE".includes(n)})[0])||void 0===l?void 0:l.receiptKey)||"consolidatedreceipt"}}),ir=Digit.Hooks.useFetchBillsForBuissnessService(v({businessService:null!=Qa&&Qa.includes("SW")?null!=Qa&&Qa.includes("DC")?"SW":"SW.ONE_TIME_FEE":null!=Qa&&Qa.includes("DC")?"WS":"WS.ONE_TIME_FEE"},lr,{tenantId:Ka}),{enabled:!!(null!=tr&&null!==(g=tr.WaterConnection)&&void 0!==g&&null!==(N=g[0])&&void 0!==N&&N.applicationNo||null!=tr&&null!==(y=tr.SewerageConnections)&&void 0!==y&&null!==(D=y[0])&&void 0!==D&&D.applicationNo),retry:!1}),{data:ar}=Digit.Hooks.pt.usePropertySearch({filters:{propertyIds:null==tr||null===(h=tr.WaterConnection)||void 0===h||null===(A=h[0])||void 0===A?void 0:A.propertyId}},{filters:{propertyIds:null==tr||null===(I=tr.WaterConnection)||void 0===I||null===(O=I[0])||void 0===O?void 0:O.propertyId},privacy:Digit.Utils.getPrivacyObject()}),rr=Digit.Hooks.ws.useToCheckPrivacyEnablement({privacy:{uuid:null!=Qa&&Qa.includes("WS")?null==tr||null===(b=tr.WaterConnection)||void 0===b||null===(L=b[0])||void 0===L||null===(R=L.connectionHolders)||void 0===R||null===(w=R[0])||void 0===w?void 0:w.uuid:null==tr||null===(W=tr.SewerageConnections)||void 0===W||null===(P=W[0])||void 0===P||null===(M=P.connectionHolders)||void 0===M||null===(x=M[0])||void 0===x?void 0:x.uuid,fieldName:"connectionHoldersMobileNumber",model:"WnSConnectionOwner"}})||!1,ur="CONNECTION_ACTIVATED"===(null==tr||null===(B=tr.WaterConnection)||void 0===B||null===(F=B[0])||void 0===F?void 0:F.applicationStatus)||"PENDING_FOR_CONNECTION_ACTIVATION"===(null==tr||null===(k=tr.WaterConnection)||void 0===k||null===(H=k[0])||void 0===H?void 0:H.applicationStatus)||"CONNECTION_ACTIVATED"===(null==tr||null===(V=tr.SewerageConnections)||void 0===V||null===(z=V[0])||void 0===z?void 0:z.applicationStatus)||"PENDING_FOR_CONNECTION_ACTIVATION"===(null==tr||null===(Y=tr.SewerageConnections)||void 0===Y||null===(G=Y[0])||void 0===G?void 0:G.applicationStatus);if(nr)return l.createElement(a.Loader,null);let dr=[];const sr={order:1,label:Ya("WS_ESTIMATION_NOTICE"),onClick:()=>{var e,n,t,l,o,i,a;return null!=tr&&null!==(e=tr.WaterConnection)&&void 0!==e&&e[0]?T([null==tr||null===(n=tr.WaterConnection)||void 0===n||null===(t=n[0])||void 0===t||null===(l=t.additionalDetails)||void 0===l?void 0:l.estimationFileStoreId],Ka):T([null==tr||null===(o=tr.SewerageConnections)||void 0===o||null===(i=o[0])||void 0===i||null===(a=i.additionalDetails)||void 0===a?void 0:a.estimationFileStoreId],Ka)}},cr={order:2,label:Ya("WS_SANCTION_LETTER"),onClick:()=>{var e,n,t,l,o,i,a;return null!=tr&&null!==(e=tr.WaterConnection)&&void 0!==e&&e[0]?T([null==tr||null===(n=tr.WaterConnection)||void 0===n||null===(t=n[0])||void 0===t||null===(l=t.additionalDetails)||void 0===l?void 0:l.sanctionFileStoreId],Ka):T([null==tr||null===(o=tr.SewerageConnections)||void 0===o||null===(i=o[0])||void 0===i||null===(a=i.additionalDetails)||void 0===a?void 0:a.sanctionFileStoreId],Ka)}},vr={order:3,label:Ya("WS_APPLICATION"),onClick:function(){try{var e,n,t,l,o,i,a;const r=(null==tr||null===(e=tr.WaterConnection)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.tenantId)||(null==tr||null===(t=tr.SewerageConnections)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.tenantId);let u=(null==tr||null===(o=tr.WaterConnection)||void 0===o?void 0:o[0])||(null==tr||null===(i=tr.SewerageConnections)||void 0===i?void 0:i[0]);return Z(v({},u),v({},null==ar||null===(a=ar.Properties)||void 0===a?void 0:a[0]),r,Ya).then(e=>Digit.Utils.pdf.generatev1(e)),Za(!1),Promise.resolve()}catch(e){return Promise.reject(e)}}},pr={order:4,label:Ya("DOWNLOAD_RECEIPT_HEADER"),onClick:function(){try{var e,n,t,l,o,i;const a=Digit.ULBService.getCurrentTenantId(),r=Digit.ULBService.getStateId();let u=null!=tr&&null!==(e=tr.WaterConnection)&&void 0!==e&&e[0]?"WS.ONE_TIME_FEE":"SW.ONE_TIME_FEE";return Promise.resolve(Digit.PaymentService.getReciept(a,u,{consumerCodes:null!=tr&&null!==(n=tr.WaterConnection)&&void 0!==n&&n[0]?null==tr||null===(t=tr.WaterConnection)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.applicationNo:null==tr||null===(o=tr.SewerageConnections)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.applicationNo})).then(function(e){var n;function t(){return Promise.resolve(Digit.PaymentService.printReciept(r,{fileStoreIds:l.filestoreIds[0]})).then(function(e){window.open(e[l.filestoreIds[0]],"_blank")})}let l={filestoreIds:[null===(n=e.Payments[0])||void 0===n?void 0:n.fileStoreId]};const o=function(n){if(null===(n=e.Payments[0])||void 0===n||!n.fileStoreId)return Promise.resolve(Digit.PaymentService.generatePdf(r,{Payments:e.Payments},or)).then(function(e){l=e})}();return o&&o.then?o.then(t):t()})}catch(e){return Promise.reject(e)}}},mr=[{order:1,label:Ya("WS_APPLICATION"),onClick:function(){try{var e,n,t,l,o,i,a;const r=(null==tr||null===(e=tr.WaterConnection)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.tenantId)||(null==tr||null===(t=tr.SewerageConnections)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.tenantId);let u=(null==tr||null===(o=tr.WaterConnection)||void 0===o?void 0:o[0])||(null==tr||null===(i=tr.SewerageConnections)||void 0===i?void 0:i[0]);return xi(v({},u),v({},null==ar||null===(a=ar.Properties)||void 0===a?void 0:a[0]),r,Ya).then(e=>Digit.Utils.pdf.generatev1(e)),Za(!1),Promise.resolve()}catch(e){return Promise.reject(e)}}},{order:2,label:Ya("WS_DISCONNECTION_NOTICE_LABEL"),onClick:()=>function(){try{var e,n,t,l;let u="ws-waterdisconnectionnotice",d={};var o,i,a,r;return null!=Qa&&Qa.includes("WS")?d={WaterConnection:[v({},null==tr||null===(o=tr.WaterConnection)||void 0===o?void 0:o[0],{property:null==ar||null===(i=ar.Properties)||void 0===i?void 0:i[0]})]}:(u="ws-seweragedisconnectionnotice",d={SewerageConnection:[v({},null==tr||null===(a=tr.SewerageConnections)||void 0===a?void 0:a[0],{property:null==ar||null===(r=ar.Properties)||void 0===r?void 0:r[0]})]}),Promise.resolve(Digit.WSService.WSDisconnectionNotice((null==tr||null===(e=tr.WaterConnection)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.tenantId)||(null==tr||null===(t=tr.SewerageConnections)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.tenantId),d,u)).then(function(e){var n,t,l,o;return Promise.resolve(Digit.PaymentService.printReciept((null==tr||null===(n=tr.WaterConnection)||void 0===n||null===(t=n[0])||void 0===t?void 0:t.tenantId)||(null==tr||null===(l=tr.SewerageConnections)||void 0===l||null===(o=l[0])||void 0===o?void 0:o.tenantId),{fileStoreIds:e.filestoreIds[0]})).then(function(n){window.open(n[null==e?void 0:e.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}()}],Er=(null==tr||null===(q=tr.WaterConnection)||void 0===q||null===(K=q[0].applicationType)||void 0===K?void 0:K.includes("DISCONNECT"))||(null==tr||null===(X=tr.SewerageConnections)||void 0===X||null===($=X[0].applicationType)||void 0===$?void 0:$.includes("DISCONNECT"));switch((null==tr||null===(J=tr.WaterConnection)||void 0===J||null===(Q=J[0])||void 0===Q?void 0:Q.applicationStatus)||(null==tr||null===(ee=tr.SewerageConnections)||void 0===ee||null===(ne=ee[0])||void 0===ne?void 0:ne.applicationStatus)){case"PENDING_FOR_DOCUMENT_VERIFICATION":dr=null!=tr&&null!==(te=tr.WaterConnection)&&void 0!==te&&null!==(le=te[0].applicationType)&&void 0!==le&&le.includes("DISCONNECT")||null!=tr&&null!==(oe=tr.SewerageConnections)&&void 0!==oe&&null!==(ie=oe[0].applicationType)&&void 0!==ie&&ie.includes("DISCONNECT")?mr:dr.concat(vr);break;case"PENDING_FOR_CITIZEN_ACTION":case"PENDING_FOR_FIELD_INSPECTION":dr=dr.concat(vr);break;case"PENDING_APPROVAL_FOR_CONNECTION":case"PENDING_FOR_PAYMENT":dr=dr.concat(vr,sr);break;case"PENDING_FOR_CONNECTION_ACTIVATION":case"CONNECTION_ACTIVATED":dr=dr.concat(cr,sr,vr,pr);break;case"REJECTED":dr=dr.concat(vr);break;case"PENDING_FOR_DISCONNECTION_EXECUTION":case"DISCONNECTION_EXECUTED":case"PENDING_FOR_PAYMENT":dr=null!=tr&&null!==(ae=tr.WaterConnection)&&void 0!==ae&&null!==(re=ae[0].applicationType)&&void 0!==re&&re.includes("DISCONNECT")||null!=tr&&null!==(ue=tr.SewerageConnections)&&void 0!==ue&&null!==(de=ue[0].applicationType)&&void 0!==de&&de.includes("DISCONNECT")?mr:dr.concat(vr);break;default:dr=dr.concat(vr)}dr.sort(function(e,n){return e.order-n.order});let Sr=tr&&null!=tr&&null!==(se=tr.WaterConnection)&&void 0!==se&&se[0]?"WATER":"SEWERAGE";return sessionStorage.setItem("ApplicationNoState",Qa),l.createElement(l.Fragment,null,l.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},l.createElement(a.Header,null,Ya("WS_APPLICATION_DETAILS_HEADER")),l.createElement("div",{style:{zIndex:"10",display:"flex",flexDirection:"row-reverse",alignItems:"center",marginTop:"-25px"}},dr&&dr.length>0&&l.createElement("div",{ref:Ga},l.createElement(a.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>Za(!Xa),displayOptions:Xa,options:dr})),l.createElement(a.LinkButton,{label:Ya("VIEW_TIMELINE"),style:{color:"#A52A2A"},onClick:()=>{const e=document.getElementById("timeline");e&&e.scrollIntoView({behavior:"smooth"}),Ja(!0)}}))),rr&&l.createElement(j,{t:Ya}),l.createElement("div",{className:"hide-seperator"},l.createElement(a.Card,null,l.createElement(a.StatusTable,null,l.createElement(a.Row,{className:"border-none",label:Ya("WS_MYCONNECTIONS_APPLICATION_NO"),text:(null==tr||null===(ce=tr.WaterConnection)||void 0===ce||null===(ve=ce[0])||void 0===ve?void 0:ve.applicationNo)||(null==tr||null===(pe=tr.SewerageConnections)||void 0===pe||null===(me=pe[0])||void 0===me?void 0:me.applicationNo),textStyle:{}}),((null==tr||null===(Ee=tr.WaterConnection)||void 0===Ee||null===(Se=Ee[0].applicationType)||void 0===Se?void 0:Se.includes("DISCONNECT"))||(null==tr||null===(_e=tr.SewerageConnections)||void 0===_e||null===(fe=_e[0].applicationType)||void 0===fe?void 0:fe.includes("DISCONNECT")))&&l.createElement(a.Row,{className:"border-none",label:Ya("WS_MYCONNECTIONS_CONSUMER_NO"),text:(null==tr||null===(ge=tr.WaterConnection)||void 0===ge||null===(Ce=ge[0])||void 0===Ce?void 0:Ce.connectionNo)||(null==tr||null===(Ne=tr.SewerageConnections)||void 0===Ne||null===(ye=Ne[0])||void 0===ye?void 0:ye.connectionNo),textStyle:{wordBreak:"break-word"}}),l.createElement(a.Row,{className:"border-none",label:Ya("WS_SERVICE_NAME_LABEL"),text:Ya("WS_APPLICATION_TYPE_"+((null==tr||null===(De=tr.WaterConnection)||void 0===De||null===(Te=De[0])||void 0===Te?void 0:Te.applicationType)||(null==tr||null===(he=tr.SewerageConnections)||void 0===he||null===(Ae=he[0])||void 0===Ae?void 0:Ae.applicationType))),textStyle:{wordBreak:"break-word"}}),l.createElement(a.Row,{className:"border-none",label:Ya("WS_COMMON_TABLE_COL_AMT_DUE_LABEL"),text:null!=ir&&null!==(Ie=ir.data)&&void 0!==Ie&&null!==(Oe=Ie.Bill)&&void 0!==Oe&&null!==(be=Oe[0])&&void 0!==be&&null!==(Le=be.billDetails)&&void 0!==Le&&null!==(Re=Le[0])&&void 0!==Re&&Re.amount?"₹ "+Number(null==ir||null===(we=ir.data)||void 0===we||null===(We=we.Bill)||void 0===We||null===(Pe=We[0])||void 0===Pe||null===(Me=Pe.billDetails)||void 0===Me||null===(xe=Me[0])||void 0===xe?void 0:xe.amount).toFixed(2):Ya("₹0"),textStyle:{whiteSpace:"pre"}}),((null==tr||null===(Be=tr.WaterConnection)||void 0===Be||null===(Fe=Be[0].applicationType)||void 0===Fe?void 0:Fe.includes("DISCONNECT"))||(null==tr||null===(Ue=tr.SewerageConnections)||void 0===Ue||null===(ke=Ue[0].applicationType)||void 0===ke?void 0:ke.includes("DISCONNECT")))&&l.createElement(a.Row,{className:"border-none",label:Ya("WS_DISCONNECTION_PROPOSED_DATE"),text:null!=Qa&&Qa.includes("WS")?f(null==tr||null===(He=tr.WaterConnection)||void 0===He||null===(je=He[0])||void 0===je?void 0:je.dateEffectiveFrom):f(null==tr||null===(Ve=tr.SewerageConnections)||void 0===Ve||null===(ze=Ve[0])||void 0===ze?void 0:ze.dateEffectiveFrom),textStyle:{wordBreak:"break-word"}}),((null==tr||null===(Ye=tr.WaterConnection)||void 0===Ye||null===(Ge=Ye[0].applicationType)||void 0===Ge?void 0:Ge.includes("DISCONNECT"))||(null==tr||null===(qe=tr.SewerageConnections)||void 0===qe||null===(Ke=qe[0].applicationType)||void 0===Ke?void 0:Ke.includes("DISCONNECT")))&&l.createElement(a.Row,{className:"border-none",label:Ya("WS_DISCONNECTION_EXECUTED_DATE"),text:null!=Qa&&Qa.includes("WS")?f(null==tr||null===(Xe=tr.WaterConnection)||void 0===Xe||null===(Ze=Xe[0])||void 0===Ze?void 0:Ze.disconnectionExecutionDate):f(null==tr||null===($e=tr.SewerageConnections)||void 0===$e||null===(Je=$e[0])||void 0===Je?void 0:Je.disconnectionExecutionDate),textStyle:{wordBreak:"break-word"}}),((null==tr||null===(Qe=tr.WaterConnection)||void 0===Qe||null===(en=Qe[0].applicationType)||void 0===en?void 0:en.includes("DISCONNECT"))||(null==tr||null===(nn=tr.SewerageConnections)||void 0===nn||null===(tn=nn[0].applicationType)||void 0===tn?void 0:tn.includes("DISCONNECT")))&&l.createElement(a.Row,{className:"border-none",label:Ya("WS_DISCONNECTION_REASON"),text:null!=(null==tr||null===(ln=tr.WaterConnection)||void 0===ln||null===(on=ln[0])||void 0===on?void 0:on.disconnectionReason)?null==tr||null===(an=tr.WaterConnection)||void 0===an||null===(rn=an[0])||void 0===rn?void 0:rn.disconnectionReason:null!=(null==tr||null===(un=tr.SewerageConnections)||void 0===un||null===(dn=un[0])||void 0===dn?void 0:dn.disconnectionReason)?null==tr||null===(sn=tr.SewerageConnections)||void 0===sn||null===(cn=sn[0])||void 0===cn?void 0:cn.disconnectionReason:Ya("NA"),textStyle:{wordBreak:"break-word"}}))),(null==ir||null===(vn=ir.data)||void 0===vn||null===(pn=vn.Bill)||void 0===pn||null===(mn=pn[0])||void 0===mn||null===(En=mn.billDetails)||void 0===En||null===(Sn=En[0])||void 0===Sn?void 0:Sn.billAccountDetails.length)>0&&l.createElement(a.Card,null,l.createElement(a.CardHeader,{styles:{fontSize:"28px"}},Ya("WS_FEE_DEATAILS_HEADER")),l.createElement(a.StatusTable,null,null==ir||null===(_n=ir.data)||void 0===_n||null===(fn=_n.Bill)||void 0===fn||null===(gn=fn[0])||void 0===gn||null===(Cn=gn.billDetails)||void 0===Cn||null===(Nn=Cn[0])||void 0===Nn?void 0:Nn.billAccountDetails.map(e=>l.createElement(a.Row,{className:"border-none",label:Ya(null==e?void 0:e.taxHeadCode),text:"₹"+Number(null==e?void 0:e.amount).toFixed(2),textStyle:{textAlign:"right"}})),l.createElement(a.Row,{className:"border-none",label:Ya("WS_TOTAL_AMOUNT_DUE"),text:"₹"+Number(ur?0:null==ir||null===(yn=ir.data)||void 0===yn||null===(Dn=yn.Bill)||void 0===Dn||null===(Tn=Dn[0])||void 0===Tn||null===(hn=Tn.billDetails)||void 0===hn||null===(An=hn[0])||void 0===An?void 0:An.amount).toFixed(2),textStyle:{textAlign:"right",fontSize:"18px",fontWeight:"700"}}),l.createElement(a.Row,{className:"border-none",label:Ya("WS_COMMON_TABLE_COL_APPLICATION_STATUS"),text:ur||0==Number(null==ir||null===(In=ir.data)||void 0===In||null===(On=In.Bill)||void 0===On||null===(bn=On[0])||void 0===bn||null===(Ln=bn.billDetails)||void 0===Ln||null===(Rn=Ln[0])||void 0===Rn?void 0:Rn.amount).toFixed(2)?Ya("WS_COMMON_PAID_LABEL"):Ya("WS_COMMON_NOT_PAID"),textStyle:ur||0==Number(null==ir||null===(wn=ir.data)||void 0===wn||null===(Wn=wn.Bill)||void 0===Wn||null===(Pn=Wn[0])||void 0===Pn||null===(Mn=Pn.billDetails)||void 0===Mn||null===(xn=Mn[0])||void 0===xn?void 0:xn.amount).toFixed(2)?{textAlign:"right",color:"darkgreen"}:{textAlign:"right",color:"red"}}))),l.createElement(a.Card,null,l.createElement(a.CardHeader,{styles:{fontSize:"28px"}},Ya("WS_COMMON_PROPERTY_DETAILS")),l.createElement(a.StatusTable,null,l.createElement(a.Row,{className:"border-none",label:Ya("WS_PROPERTY_ID_LABEL"),text:(null==tr||null===(Bn=tr.WaterConnection)||void 0===Bn||null===(Fn=Bn[0])||void 0===Fn?void 0:Fn.propertyId)||(null==tr||null===(Un=tr.SewerageConnections)||void 0===Un||null===(kn=Un[0])||void 0===kn?void 0:kn.propertyId),textStyle:{wordBreak:"break-word"}}),l.createElement(a.Row,{className:"border-none",label:Ya("WS_OWN_DETAIL_OWN_NAME_LABEL"),text:null==ar||null===(Hn=ar.Properties)||void 0===Hn||null===(jn=Hn[0])||void 0===jn||null===(Vn=jn.owners.sort((e,n)=>{var t,l;return(null==e||null===(t=e.additionalDetails)||void 0===t?void 0:t.ownerSequence)-(null==n||null===(l=n.additionalDetails)||void 0===l?void 0:l.ownerSequence)}))||void 0===Vn||null===(zn=Vn[0])||void 0===zn?void 0:zn.name,textStyle:{whiteSpace:"pre"}}),l.createElement(a.Row,{className:"border-none",label:Ya("WS_PROPERTY_ADDRESS"),text:C(null==ar||null===(Yn=ar.Properties)||void 0===Yn||null===(Gn=Yn[0])||void 0===Gn?void 0:Gn.address,Ya)||Ya("CS_NA"),textStyle:{wordBreak:"break-word"},privacy:{uuid:null==ar||null===(qn=ar.Properties)||void 0===qn||null===(Kn=qn[0])||void 0===Kn||null===(Xn=Kn.owners)||void 0===Xn||null===(Zn=Xn[0])||void 0===Zn?void 0:Zn.uuid,fieldName:["doorNo","street","landmark"],model:"Property",hide:!(null!=ar&&null!==($n=ar.Properties)&&void 0!==$n&&null!==(Jn=$n[0])&&void 0!==Jn&&Jn.address),showValue:!0,loadData:{serviceName:"/property-services/property/_search",requestBody:{},requestParam:{tenantId:Ka,propertyIds:(null==tr||null===(Qn=tr.WaterConnection)||void 0===Qn||null===(et=Qn[0])||void 0===et?void 0:et.propertyId)||(null==tr||null===(nt=tr.SewerageConnections)||void 0===nt||null===(tt=nt[0])||void 0===tt?void 0:tt.propertyId)},jsonPath:"Properties[0].address.street",isArray:!1,d:e=>(U.get(e,"Properties[0].address.doorNo")?U.get(e,"Properties[0].address.doorNo")+", ":"")+(U.get(e,"Properties[0].address.street")?U.get(e,"Properties[0].address.street")+", ":"")+(U.get(e,"Properties[0].address.landmark")?""+U.get(e,"Properties[0].address.landmark"):"")}}}),l.createElement(i.Link,{to:"/digit-ui/citizen/commonpt/view-property?propertyId="+((null==tr||null===(lt=tr.WaterConnection)||void 0===lt||null===(ot=lt[0])||void 0===ot?void 0:ot.propertyId)||(null==tr||null===(it=tr.SewerageConnections)||void 0===it||null===(at=it[0])||void 0===at?void 0:at.propertyId))+"&tenantId="+((null==tr||null===(rt=tr.WaterConnection)||void 0===rt||null===(ut=rt[0])||void 0===ut?void 0:ut.tenantId)||(null==tr||null===(dt=tr.SewerageConnections)||void 0===dt||null===(st=dt[0])||void 0===st?void 0:st.tenantId))},l.createElement(a.LinkButton,{style:{textAlign:"left"},label:Ya("WS_VIEW_PROPERTY")})))),(null==tr||null===(ct=tr.WaterConnection)||void 0===ct||null===(vt=ct[0])||void 0===vt||null===(pt=vt.connectionHolders)||void 0===pt?void 0:pt.length)>0||(null==tr||null===(mt=tr.SewerageConnections)||void 0===mt||null===(Et=mt[0])||void 0===Et||null===(St=Et.connectionHolders)||void 0===St?void 0:St.length)>0?l.createElement(a.Card,null,l.createElement(a.CardHeader,{styles:{fontSize:"28px"}},Ya("WS_COMMON_CONNECTION_HOLDER_DETAILS_HEADER")),l.createElement(a.StatusTable,null,l.createElement(a.Row,{className:"border-none",label:Ya("WS_OWN_DETAIL_MOBILE_NO_LABEL"),text:(null==tr||null===(_t=tr.WaterConnection)||void 0===_t||null===(ft=_t[0])||void 0===ft||null===(gt=ft.connectionHolders)||void 0===gt||null===(Ct=gt[0])||void 0===Ct?void 0:Ct.mobileNumber)||(null==tr||null===(Nt=tr.SewerageConnections)||void 0===Nt||null===(yt=Nt[0])||void 0===yt||null===(Dt=yt.connectionHolders)||void 0===Dt||null===(Tt=Dt[0])||void 0===Tt?void 0:Tt.mobileNumber),textStyle:{whiteSpace:"pre"},privacy:{uuid:null!=Qa&&Qa.includes("WS")?null==tr||null===(ht=tr.WaterConnection)||void 0===ht||null===(At=ht[0])||void 0===At||null===(It=At.connectionHolders)||void 0===It||null===(Ot=It[0])||void 0===Ot?void 0:Ot.uuid:null==tr||null===(bt=tr.SewerageConnections)||void 0===bt||null===(Lt=bt[0])||void 0===Lt||null===(Rt=Lt.connectionHolders)||void 0===Rt||null===(wt=Rt[0])||void 0===wt?void 0:wt.uuid,fieldName:"connectionHoldersMobileNumber",model:"WnSConnectionOwner",showValue:!1,loadData:{serviceName:"WATER"===Sr?"/ws-services/wc/_search":"/sw-services/swc/_search",requestBody:{},requestParam:{tenantId:Ka,applicationNumber:Qa},jsonPath:"WATER"===Sr?"WaterConnection[0].connectionHolders[0].mobileNumber":"SewerageConnections[0].connectionHolders[0].mobileNumber",isArray:!1}}}),l.createElement(a.Row,{className:"border-none",label:Ya("WS_OWN_DETAIL_OWN_NAME_LABEL"),text:(null==tr||null===(Wt=tr.WaterConnection)||void 0===Wt||null===(Pt=Wt[0])||void 0===Pt||null===(Mt=Pt.connectionHolders)||void 0===Mt||null===(xt=Mt[0])||void 0===xt?void 0:xt.name)||(null==tr||null===(Bt=tr.SewerageConnections)||void 0===Bt||null===(Ft=Bt[0])||void 0===Ft||null===(Ut=Ft.connectionHolders)||void 0===Ut||null===(kt=Ut[0])||void 0===kt?void 0:kt.name),textStyle:{whiteSpace:"pre"}}),l.createElement(a.Row,{className:"border-none",label:Ya("WS_OWN_DETAIL_GENDER_LABEL"),text:Ya((null==tr||null===(Ht=tr.WaterConnection)||void 0===Ht||null===(jt=Ht[0])||void 0===jt||null===(Vt=jt.connectionHolders)||void 0===Vt||null===(zt=Vt[0])||void 0===zt?void 0:zt.gender)||(null==tr||null===(Yt=tr.SewerageConnections)||void 0===Yt||null===(Gt=Yt[0])||void 0===Gt||null===(qt=Gt.connectionHolders)||void 0===qt||null===(Kt=qt[0])||void 0===Kt?void 0:Kt.gender)),textStyle:{whiteSpace:"pre"},privacy:{uuid:null!=Qa&&Qa.includes("WS")?null==tr||null===(Xt=tr.WaterConnection)||void 0===Xt||null===(Zt=Xt[0])||void 0===Zt||null===($t=Zt.connectionHolders)||void 0===$t||null===(Jt=$t[0])||void 0===Jt?void 0:Jt.uuid:null==tr||null===(Qt=tr.SewerageConnections)||void 0===Qt||null===(el=Qt[0])||void 0===el||null===(nl=el.connectionHolders)||void 0===nl||null===(tl=nl[0])||void 0===tl?void 0:tl.uuid,fieldName:"gender",model:"WnSConnectionOwner",showValue:!1,loadData:{serviceName:"WATER"===Sr?"/ws-services/wc/_search":"/sw-services/swc/_search",requestBody:{},requestParam:{tenantId:Ka,applicationNumber:Qa},jsonPath:"WATER"===Sr?"WaterConnection[0].connectionHolders[0].gender":"SewerageConnections[0].connectionHolders[0].gender",isArray:!1}}}),l.createElement(a.Row,{className:"border-none",label:Ya("WS_OWN_DETAIL_FATHER_OR_HUSBAND_NAME"),text:(null==tr||null===(ll=tr.WaterConnection)||void 0===ll||null===(ol=ll[0])||void 0===ol||null===(il=ol.connectionHolders)||void 0===il||null===(al=il[0])||void 0===al?void 0:al.fatherOrHusbandName)||(null==tr||null===(rl=tr.SewerageConnections)||void 0===rl||null===(ul=rl[0])||void 0===ul||null===(dl=ul.connectionHolders)||void 0===dl||null===(sl=dl[0])||void 0===sl?void 0:sl.fatherOrHusbandName)||Ya("CS_NA"),textStyle:{whiteSpace:"pre"},privacy:{uuid:null!=Qa&&Qa.includes("WS")?null==tr||null===(cl=tr.WaterConnection)||void 0===cl||null===(vl=cl[0])||void 0===vl||null===(pl=vl.connectionHolders)||void 0===pl||null===(ml=pl[0])||void 0===ml?void 0:ml.uuid:null==tr||null===(El=tr.SewerageConnections)||void 0===El||null===(Sl=El[0])||void 0===Sl||null===(_l=Sl.connectionHolders)||void 0===_l||null===(fl=_l[0])||void 0===fl?void 0:fl.uuid,fieldName:"fatherOrHusbandName",model:"WnSConnectionOwner",showValue:!1,loadData:{serviceName:"WATER"===Sr?"/ws-services/wc/_search":"/sw-services/swc/_search",requestBody:{},requestParam:{tenantId:Ka,applicationNumber:Qa},jsonPath:"WATER"===Sr?"WaterConnection[0].connectionHolders[0].fatherOrHusbandName":"SewerageConnections[0].connectionHolders[0].fatherOrHusbandName",isArray:!1}}}),l.createElement(a.Row,{className:"border-none",label:Ya("WS_OWN_DETAIL_RELATION_LABEL"),text:(null==tr||null===(gl=tr.WaterConnection)||void 0===gl||null===(Cl=gl[0])||void 0===Cl||null===(Nl=Cl.connectionHolders)||void 0===Nl||null===(yl=Nl[0])||void 0===yl?void 0:yl.relationship)||(null==tr||null===(Dl=tr.SewerageConnections)||void 0===Dl||null===(Tl=Dl[0])||void 0===Tl||null===(hl=Tl.connectionHolders)||void 0===hl||null===(Al=hl[0])||void 0===Al?void 0:Al.relationship)||Ya("CS_NA"),textStyle:{whiteSpace:"pre"},privacy:{uuid:null!=Qa&&Qa.includes("WS")?null==tr||null===(Il=tr.WaterConnection)||void 0===Il||null===(Ol=Il[0])||void 0===Ol||null===(bl=Ol.connectionHolders)||void 0===bl||null===(Ll=bl[0])||void 0===Ll?void 0:Ll.uuid:null==tr||null===(Rl=tr.SewerageConnections)||void 0===Rl||null===(wl=Rl[0])||void 0===wl||null===(Wl=wl.connectionHolders)||void 0===Wl||null===(Pl=Wl[0])||void 0===Pl?void 0:Pl.uuid,fieldName:"relationship",model:"WnSConnection",showValue:!1,loadData:{serviceName:"WATER"===Sr?"/ws-services/wc/_search":"/sw-services/swc/_search",requestBody:{},requestParam:{tenantId:Ka,applicationNumber:Qa},jsonPath:"WATER"===Sr?"WaterConnection[0].connectionHolders[0].relationship":"SewerageConnections[0].connectionHolders[0].relationship",isArray:!1}}}),l.createElement(a.Row,{className:"border-none",label:Ya("WS_OWN_DETAIL_CROSADD"),text:(null==tr||null===(Ml=tr.WaterConnection)||void 0===Ml||null===(xl=Ml[0])||void 0===xl||null===(Bl=xl.connectionHolders)||void 0===Bl||null===(Fl=Bl[0])||void 0===Fl?void 0:Fl.correspondenceAddress)||(null==tr||null===(Ul=tr.SewerageConnections)||void 0===Ul||null===(kl=Ul[0])||void 0===kl||null===(Hl=kl.connectionHolders)||void 0===Hl||null===(jl=Hl[0])||void 0===jl?void 0:jl.correspondenceAddress)||Ya("CS_NA"),privacy:{uuid:null!=Qa&&Qa.includes("WS")?null==tr||null===(Vl=tr.WaterConnection)||void 0===Vl||null===(zl=Vl[0])||void 0===zl||null===(Yl=zl.connectionHolders)||void 0===Yl||null===(Gl=Yl[0])||void 0===Gl?void 0:Gl.uuid:null==tr||null===(ql=tr.SewerageConnections)||void 0===ql||null===(Kl=ql[0])||void 0===Kl||null===(Xl=Kl.connectionHolders)||void 0===Xl||null===(Zl=Xl[0])||void 0===Zl?void 0:Zl.uuid,fieldName:"correspondenceAddress",model:"WnSConnectionOwner",showValue:!1,loadData:{serviceName:"WATER"===Sr?"/ws-services/wc/_search":"/sw-services/swc/_search",requestBody:{},requestParam:{tenantId:Ka,applicationNumber:Qa},jsonPath:"WATER"===Sr?"WaterConnection[0].connectionHolders[0].correspondenceAddress":"SewerageConnections[0].connectionHolders[0].correspondenceAddress",isArray:!1}}}),l.createElement(a.Row,{className:"border-none",label:Ya("WS_OWN_DETAIL_SPECIAL_APPLICANT_LABEL"),text:(null!=Qa&&Qa.includes("WS")?null!=tr&&null!==($l=tr.WaterConnection)&&void 0!==$l&&null!==(Jl=$l[0])&&void 0!==Jl&&null!==(Ql=Jl.connectionHolders)&&void 0!==Ql&&null!==(eo=Ql[0])&&void 0!==eo&&null!==(no=eo.ownerType)&&void 0!==no&&no.includes("*"):null!=tr&&null!==(to=tr.SewerageConnections)&&void 0!==to&&null!==(lo=to[0])&&void 0!==lo&&null!==(oo=lo.connectionHolders)&&void 0!==oo&&null!==(io=oo[0])&&void 0!==io&&null!==(ao=io.ownerType)&&void 0!==ao&&ao.includes("*"))?null!=Qa&&Qa.includes("WS")?null==tr||null===(So=tr.WaterConnection)||void 0===So||null===(_o=So[0])||void 0===_o||null===(fo=_o.connectionHolders)||void 0===fo||null===(go=fo[0])||void 0===go?void 0:go.ownerType:null==tr||null===(Co=tr.SewerageConnections)||void 0===Co||null===(No=Co[0])||void 0===No||null===(yo=No.connectionHolders)||void 0===yo||null===(Do=yo[0])||void 0===Do?void 0:Do.ownerType:Ya("COMMON_MASTERS_OWNERTYPE_"+(null!=Qa&&Qa.includes("WS")?null==tr||null===(ro=tr.WaterConnection)||void 0===ro||null===(uo=ro[0])||void 0===uo||null===(so=uo.connectionHolders)||void 0===so||null===(co=so[0])||void 0===co?void 0:co.ownerType:null==tr||null===(vo=tr.SewerageConnections)||void 0===vo||null===(po=vo[0])||void 0===po||null===(mo=po.connectionHolders)||void 0===mo||null===(Eo=mo[0])||void 0===Eo?void 0:Eo.ownerType)),textStyle:{whiteSpace:"pre"},privacy:{uuid:null!=Qa&&Qa.includes("WS")?null==tr||null===(To=tr.WaterConnection)||void 0===To||null===(ho=To[0])||void 0===ho||null===(Ao=ho.connectionHolders)||void 0===Ao||null===(Io=Ao[0])||void 0===Io?void 0:Io.uuid:null==tr||null===(Oo=tr.SewerageConnections)||void 0===Oo||null===(bo=Oo[0])||void 0===bo||null===(Lo=bo.connectionHolders)||void 0===Lo||null===(Ro=Lo[0])||void 0===Ro?void 0:Ro.uuid,fieldName:"ownerType",model:"WnSConnection",showValue:!1,loadData:{serviceName:"WATER"===Sr?"/ws-services/wc/_search":"/sw-services/swc/_search",requestBody:{},requestParam:{tenantId:Ka,applicationNumber:Qa},jsonPath:"WATER"===Sr?"WaterConnection[0].connectionHolders[0].ownerType":"SewerageConnections[0].connectionHolders[0].ownerType",isArray:!1,d:e=>{var n,t,l,o,i,a,r,u,d,s,c;return null!=e&&null!==(n=e.WaterConnection)&&void 0!==n&&n[0]?Ya("PROPERTYTAX_OWNERTYPE_"+(null==e||null===(t=e.WaterConnection)||void 0===t||null===(l=t[0])||void 0===l||null===(o=l.connectionHolders)||void 0===o||null===(i=o[0])||void 0===i||null===(a=i.ownerType)||void 0===a?void 0:a.toUpperCase())):Ya("PROPERTYTAX_OWNERTYPE_"+(null==e||null===(r=e.SewerageConnections)||void 0===r||null===(u=r[0])||void 0===u||null===(d=u.connectionHolders)||void 0===d||null===(s=d[0])||void 0===s||null===(c=s.ownerType)||void 0===c?void 0:c.toUpperCase()))}}}}),l.createElement(a.Row,{className:"border-none",label:Ya("WS_OWN_DETAIL_EMAIL_ID_LABEL"),text:(null==tr||null===(wo=tr.WaterConnection)||void 0===wo||null===(Wo=wo[0])||void 0===Wo||null===(Po=Wo.connectionHolders)||void 0===Po||null===(Mo=Po[0])||void 0===Mo?void 0:Mo.emailId)||(null==tr||null===(xo=tr.SewerageConnections)||void 0===xo||null===(Bo=xo[0])||void 0===Bo||null===(Fo=Bo.connectionHolders)||void 0===Fo||null===(Uo=Fo[0])||void 0===Uo?void 0:Uo.emailId)||"NA",textStyle:{whiteSpace:"pre"},privacy:{uuid:null!=Qa&&Qa.includes("WS")?null==tr||null===(ko=tr.WaterConnection)||void 0===ko||null===(Ho=ko[0])||void 0===Ho||null===(jo=Ho.connectionHolders)||void 0===jo||null===(Vo=jo[0])||void 0===Vo?void 0:Vo.uuid:null==tr||null===(zo=tr.SewerageConnections)||void 0===zo||null===(Yo=zo[0])||void 0===Yo||null===(Go=Yo.connectionHolders)||void 0===Go||null===(qo=Go[0])||void 0===qo?void 0:qo.uuid,fieldName:"connectionHoldersEmailId",model:"WnSConnectionOwner",showValue:!1,loadData:{serviceName:"WATER"===Sr?"/ws-services/wc/_search":"/sw-services/swc/_search",requestBody:{},requestParam:{tenantId:Ka,applicationNumber:Qa},jsonPath:"WATER"===Sr?"WaterConnection[0].connectionHolders[0].emailId":"SewerageConnections[0].connectionHolders[0].emailId",isArray:!1}}}))):l.createElement("div",null,l.createElement(a.Card,null,l.createElement(a.CardSubHeader,null,Ya("WS_COMMON_CONNECTION_HOLDER_DETAILS_HEADER")),l.createElement(a.CardText,null,Ya("WS_SAME_AS_PROPERTY_OWNERS")))),Er?null:l.createElement(a.Card,null,l.createElement(a.CardHeader,{styles:{fontSize:"28px"}},Ya("WS_COMMON_CONNECTION_DETAIL")),(null==tr?void 0:tr.WaterConnection)&&(null==tr||null===(Ko=tr.WaterConnection)||void 0===Ko?void 0:Ko.length)>0&&l.createElement(a.StatusTable,null,l.createElement(a.Row,{className:"border-none",label:Ya("WS_TASK_DETAILS_CONN_DETAIL_NO_OF_TAPS_PROPOSED"),text:(null==tr||null===(Xo=tr.WaterConnection)||void 0===Xo||null===(Zo=Xo[0])||void 0===Zo?void 0:Zo.proposedTaps)||Ya("CS_NA"),textStyle:{whiteSpace:"pre"}}),l.createElement(a.Row,{className:"border-none",label:Ya("WS_SERV_DETAIL_PIPE_SIZE"),text:(null==tr||null===($o=tr.WaterConnection)||void 0===$o||null===(Jo=$o[0])||void 0===Jo?void 0:Jo.proposedPipeSize)+" "+Ya("WS_INCHES_LABEL")||Ya("CS_NA"),textStyle:{whiteSpace:"pre"}}),l.createElement(i.Link,{to:"/digit-ui/citizen/ws/connection/additional/"+(null==tr||null===(Qo=tr.WaterConnection)||void 0===Qo||null===(ei=Qo[0])||void 0===ei?void 0:ei.applicationNo)},l.createElement(a.LinkButton,{style:{textAlign:"left"},label:Ya("WS_ADDITIONAL_DETAILS")}))),(null==tr?void 0:tr.SewerageConnections)&&(null==tr||null===(ni=tr.SewerageConnections)||void 0===ni?void 0:ni.length)>0&&l.createElement(a.StatusTable,null,l.createElement(a.Row,{className:"border-none",label:Ya("WS_NO_OF_WATER_CLOSETS_LABEL"),text:null==tr||null===(ti=tr.SewerageConnections)||void 0===ti||null===(li=ti[0])||void 0===li?void 0:li.proposedWaterClosets,textStyle:{whiteSpace:"pre"}}),l.createElement(a.Row,{className:"border-none",label:Ya("WS_SERV_DETAIL_NO_OF_TOILETS"),text:(null==tr||null===(oi=tr.SewerageConnections)||void 0===oi||null===(ii=oi[0])||void 0===ii?void 0:ii.proposedToilets)||Ya("CS_NA"),textStyle:{whiteSpace:"pre"}}),l.createElement(i.Link,{to:"/digit-ui/citizen/ws/connection/additional/"+(null==tr||null===(ai=tr.SewerageConnections)||void 0===ai||null===(ri=ai[0])||void 0===ri?void 0:ri.applicationNo)},l.createElement(a.LinkButton,{style:{textAlign:"left"},label:Ya("WS_ADDITIONAL_DETAILS")})))),l.createElement(a.Card,null,l.createElement(a.CardHeader,{styles:{fontSize:"28px"}},Ya("WS_COMMON_DOCUMENT_DETAILS")),(null==tr||null===(ui=tr.WaterConnection)||void 0===ui||null===(di=ui[0])||void 0===di?void 0:di.documents)&&(null==tr||null===(si=tr.WaterConnection)||void 0===si||null===(ci=si[0])||void 0===ci?void 0:ci.documents.map((e,n)=>{var t,o,i,r,u;return l.createElement("div",{key:"doc-"+n},l.createElement("div",null,l.createElement(a.CardSectionHeader,null,Ya(null==e||null===(t=e.documentType)||void 0===t?void 0:t.split(".").slice(0,2).join("_"))),l.createElement(a.StatusTable,null,l.createElement(Li,{value:null==tr||null===(o=tr.WaterConnection)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.documents,Code:null==e?void 0:e.documentType,index:n}),(null==tr||null===(r=tr.WaterConnection)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.documents.length)!=n+1?l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null)))})),(null==tr||null===(vi=tr.SewerageConnections)||void 0===vi||null===(pi=vi[0])||void 0===pi?void 0:pi.documents)&&(null==tr||null===(mi=tr.SewerageConnections)||void 0===mi||null===(Ei=mi[0])||void 0===Ei?void 0:Ei.documents.map((e,n)=>{var t,o,i,r,u;return l.createElement("div",{key:"doc-"+n},l.createElement("div",null,l.createElement(a.CardSectionHeader,null,Ya(null==e||null===(t=e.documentType)||void 0===t?void 0:t.split(".").slice(0,2).join("_"))),l.createElement(a.StatusTable,null,l.createElement(Li,{value:null==tr||null===(o=tr.SewerageConnections)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.documents,Code:null==e?void 0:e.documentType,index:n}),(null==tr||null===(r=tr.SewerageConnections)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.documents.length)!=n+1?l.createElement("hr",{style:{color:"white",backgroundColor:"white",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null)))}))),l.createElement(a.Card,null,l.createElement("div",{id:"timeline"},l.createElement(bi,{application:(null==tr||null===(Si=tr.WaterConnection)||void 0===Si?void 0:Si[0])||(null==tr||null===(_i=tr.SewerageConnections)||void 0===_i?void 0:_i[0]),id:(null==tr||null===(fi=tr.WaterConnection)||void 0===fi||null===(gi=fi[0])||void 0===gi?void 0:gi.applicationNo)||(null==tr||null===(Ci=tr.SewerageConnections)||void 0===Ci||null===(Ni=Ci[0])||void 0===Ni?void 0:Ni.applicationNo),paymentbuttonenabled:!1})),"PENDING_FOR_PAYMENT"===(null==tr||null===(yi=tr.WaterConnection)||void 0===yi||null===(Di=yi[0])||void 0===Di?void 0:Di.applicationStatus)||"PENDING_FOR_PAYMENT"===(null==tr||null===(Ti=tr.SewerageConnections)||void 0===Ti||null===(hi=Ti[0])||void 0===hi?void 0:hi.applicationStatus)?l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen/payment/my-bills/"+(null==ir||null===(Ai=ir.data)||void 0===Ai||null===(Ii=Ai.Bill)||void 0===Ii||null===(Oi=Ii[0])||void 0===Oi?void 0:Oi.businessService)+"/"+(null!=Qa&&Qa.includes("DC")?m(null==tr||null===(Ri=tr.WaterConnection)||void 0===Ri||null===(wi=Ri[0])||void 0===wi?void 0:wi.connectionNo,"/","+")||m(null==tr||null===(Wi=tr.SewerageConnections)||void 0===Wi||null===(Pi=Wi[0])||void 0===Pi?void 0:Pi.connectionNo,"/","+"):m(null==tr||null===(Mi=tr.WaterConnection)||void 0===Mi||null===(Bi=Mi[0])||void 0===Bi?void 0:Bi.applicationNo,"/","+")||m(null==tr||null===(Fi=tr.SewerageConnections)||void 0===Fi||null===(Ui=Fi[0])||void 0===Ui?void 0:Ui.applicationNo,"/","+"))+"?workflow=WNS&tenantId="+((null==tr||null===(ki=tr.WaterConnection)||void 0===ki||null===(Hi=ki[0])||void 0===Hi?void 0:Hi.tenantId)||(null==tr||null===(ji=tr.SewerageConnections)||void 0===ji||null===(Vi=ji[0])||void 0===Vi?void 0:Vi.tenantId))+"&ConsumerName="+((null==tr||null===(zi=tr.WaterConnection)||void 0===zi||null===(Yi=zi[0])||void 0===Yi||null===(Gi=Yi.connectionHolders)||void 0===Gi?void 0:Gi.map(e=>e.name).join(","))||(null==tr||null===(qi=tr.SewerageConnections)||void 0===qi||null===(Ki=qi[0])||void 0===Ki||null===(Xi=Ki.connectionHolders)||void 0===Xi?void 0:Xi.map(e=>e.name).join(","))||(null==ar||null===(Zi=ar.Properties)||void 0===Zi||null===($i=Zi[0])||void 0===$i||null===(Ji=$i.owners)||void 0===Ji?void 0:Ji.map(e=>e.name).join(",")))+"&isDisoconnectFlow="+!(null==Qa||!Qa.includes("DC")),state:{}}},l.createElement(a.SubmitBar,{label:Ya("MAKE_PAYMENT")})):null,(null==tr||null===(Qi=tr.WaterConnection)||void 0===Qi||null===(ea=Qi[0])||void 0===ea||!ea.applicationType.includes("DISCONNECT"))&&null!=tr&&null!==(na=tr.WaterConnection)&&void 0!==na&&null!==(ta=na[0])&&void 0!==ta&&ta.applicationStatus.includes("PENDING_FOR_CITIZEN_ACTION")||(null==tr||null===(la=tr.SewerageConnections)||void 0===la||null===(oa=la[0])||void 0===oa||!oa.applicationType.includes("DISCONNECT"))&&null!=tr&&null!==(ia=tr.SewerageConnections)&&void 0!==ia&&null!==(aa=ia[0])&&void 0!==aa&&aa.applicationStatus.includes("PENDING_FOR_CITIZEN_ACTION")?l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen/ws/edit-application/"+((null==tr||null===(ra=tr.WaterConnection)||void 0===ra||null===(ua=ra[0])||void 0===ua?void 0:ua.tenantId)||(null==tr||null===(da=tr.SewerageConnections)||void 0===da||null===(sa=da[0])||void 0===sa?void 0:sa.tenantId)),state:{id:""+((null==tr||null===(ca=tr.WaterConnection)||void 0===ca||null===(va=ca[0])||void 0===va?void 0:va.applicationNo)||(null==tr||null===(pa=tr.SewerageConnections)||void 0===pa||null===(ma=pa[0])||void 0===ma?void 0:ma.applicationNo))}}},l.createElement(a.SubmitBar,{label:Ya("COMMON_EDIT")})):null,null!=tr&&null!==(Ea=tr.WaterConnection)&&void 0!==Ea&&null!==(Sa=Ea[0])&&void 0!==Sa&&Sa.applicationType.includes("DISCONNECT")&&null!=tr&&null!==(_a=tr.WaterConnection)&&void 0!==_a&&null!==(fa=_a[0])&&void 0!==fa&&fa.applicationStatus.includes("PENDING_FOR_CITIZEN_ACTION")||null!=tr&&null!==(ga=tr.SewerageConnections)&&void 0!==ga&&null!==(Ca=ga[0])&&void 0!==Ca&&Ca.applicationType.includes("DISCONNECT")&&null!=tr&&null!==(Na=tr.SewerageConnections)&&void 0!==Na&&null!==(ya=Na[0])&&void 0!==ya&&ya.applicationStatus.includes("PENDING_FOR_CITIZEN_ACTION")?l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen/ws/resubmit-disconnect-application",state:{id:""+((null==tr||null===(Da=tr.WaterConnection)||void 0===Da||null===(Ta=Da[0])||void 0===Ta?void 0:Ta.applicationNo)||(null==tr||null===(ha=tr.SewerageConnections)||void 0===ha||null===(Aa=ha[0])||void 0===Aa?void 0:Aa.applicationNo))}}},l.createElement(a.SubmitBar,{label:Ya("RESUBMIT_APPLICATION"),onSubmit:Digit.SessionStorage.set("WS_DISCONNECTION",null!=Qa&&Qa.includes("SW")?{applicationData:null==tr||null===(Ia=tr.SewerageConnections)||void 0===Ia?void 0:Ia[0],serviceType:"SEWERAGE",WSDisconnectionForm:{type:null!=tr&&null!==(Oa=tr.SewerageConnections)&&void 0!==Oa&&null!==(ba=Oa[0])&&void 0!==ba&&ba.isDisconnectionTemporary?{code:"type",value:{name:"Temporary",i18nKey:"WS_DISCONNECTIONTYPE_TEMPORARY",active:!0,code:"Temporary"}}:{code:"type",value:{name:"Permanent",i18nKey:"WS_DISCONNECTIONTYPE_PERMANENT",active:!0,code:"Permanent"}},date:S(null==tr||null===(La=tr.SewerageConnections)||void 0===La||null===(Ra=La[0])||void 0===Ra?void 0:Ra.dateEffectiveFrom,!0),reason:{code:"reason",value:null==tr||null===(wa=tr.SewerageConnections)||void 0===wa||null===(Wa=wa[0])||void 0===Wa?void 0:Wa.disconnectionReason},documents:null==tr||null===(Pa=tr.SewerageConnections)||void 0===Pa||null===(Ma=Pa[0])||void 0===Ma?void 0:Ma.documents}}:{applicationData:null==tr||null===(xa=tr.WaterConnection)||void 0===xa?void 0:xa[0],serviceType:"WATER",WSDisconnectionForm:{type:null!=tr&&null!==(Ba=tr.WaterConnection)&&void 0!==Ba&&null!==(Fa=Ba[0])&&void 0!==Fa&&Fa.isDisconnectionTemporary?{code:"type",value:{name:"Temporary",i18nKey:"WS_DISCONNECTIONTYPE_TEMPORARY",active:!0,code:"Temporary"}}:{code:"type",value:{name:"Permanent",i18nKey:"WS_DISCONNECTIONTYPE_PERMANENT",active:!0,code:"Permanent"}},date:S(null==tr||null===(Ua=tr.WaterConnection)||void 0===Ua||null===(ka=Ua[0])||void 0===ka?void 0:ka.dateEffectiveFrom,!0),reason:{code:"reason",value:null==tr||null===(Ha=tr.WaterConnection)||void 0===Ha||null===(ja=Ha[0])||void 0===ja?void 0:ja.disconnectionReason},documents:null==tr||null===(Va=tr.WaterConnection)||void 0===Va||null===(za=Va[0])||void 0===za?void 0:za.documents}})})):null)))},WSAdditionalDetails:()=>{var e,n,t,i,r,u,d,s,c,v,p,E,S,_,f,g,C,N,y,D,T,h,A,I,O,b,L,R,w,W,P,M,x,B,F,U,k,H,j,V,z,Y,G,q,K,X,Z,$,J,Q,ee,ne,te,le,oe,ie,ae,re,ue,de,se,ce,ve,pe,me,Ee,Se,_e,fe,ge,Ce,Ne,ye,De,Te,he,Ae,Ie,Oe,be,Le,Re,we,We,Pe,Me,xe,Be,Fe,Ue,ke,He,je,Ve,ze,Ye,Ge,qe,Ke,Xe,Ze,$e,Je,Qe,en,nn,tn,ln,on,an,rn,un,dn;const{t:sn}=o.useTranslation(),cn=Digit.UserService.getUser(),vn=Digit.ULBService.getCurrentTenantId()||(null==cn||null===(e=cn.info)||void 0===e?void 0:e.permanentCity),pn=window.location.href.includes("SW_")?window.location.href.substring(window.location.href.indexOf("SW_")):window.location.href.substring(window.location.href.indexOf("WS_"));let mn={tenantId:vn,applicationNumber:pn};const{isLoading:En,data:Sn}=Digit.Hooks.ws.useMyApplicationSearch({filters:mn,BusinessService:null!=pn&&pn.includes("SW")?"SW":"WS"},{filters:mn});return En?l.createElement(a.Loader,null):l.createElement(l.Fragment,null,l.createElement(a.Header,null,sn("WS_COMMON_ADDN_DETAILS")),l.createElement("div",{className:"hide-seperator"},l.createElement(a.Card,null,l.createElement(a.CardSubHeader,null,sn("WS_COMMON_CONNECTION_DETAIL")),l.createElement(a.StatusTable,null,l.createElement(a.Row,{className:"border-none",label:sn("WS_COMMON_TABLE_COL_CONNECTIONTYPE_LABEL"),text:(null==Sn||null===(n=Sn.WaterConnection)||void 0===n||null===(t=n[0])||void 0===t?void 0:t.connectionType)||(null==Sn||null===(i=Sn.SewerageConnections)||void 0===i||null===(r=i[0])||void 0===r?void 0:r.connectionType)||sn("NA"),textStyle:{whiteSpace:"pre"}}),(null==Sn?void 0:Sn.WaterConnection)&&(null==Sn||null===(u=Sn.WaterConnection)||void 0===u?void 0:u.length)>0&&l.createElement("div",null,l.createElement(a.Row,{className:"border-none",label:sn("WS_SERV_DETAIL_NO_OF_TAPS"),text:(null==Sn||null===(d=Sn.WaterConnection)||void 0===d||null===(s=d[0])||void 0===s?void 0:s.noOfTaps)||(null==Sn||null===(c=Sn.SewerageConnections)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.noOfTaps)||sn("CS_NA"),textStyle:{whiteSpace:"pre"}}),l.createElement(a.Row,{className:"border-none",label:sn("WS_PIPE_SIZE_IN_INCHES_LABEL"),text:(null==Sn||null===(p=Sn.WaterConnection)||void 0===p||null===(E=p[0])||void 0===E?void 0:E.pipeSize)||(null==Sn||null===(S=Sn.SewerageConnections)||void 0===S||null===(_=S[0])||void 0===_?void 0:_.pipeSize)||sn("CS_NA"),textStyle:{whiteSpace:"pre"}}),l.createElement(a.Row,{className:"border-none",label:sn("WS_SERV_DETAIL_WATER_SOURCE"),text:sn("WS_SERVICES_MASTERS_WATERSOURCE_"+m(null==Sn||null===(f=Sn.WaterConnection)||void 0===f||null===(g=f[0])||void 0===g||null===(C=g.waterSource)||void 0===C||null===(N=C.split("."))||void 0===N?void 0:N[0],".","_"))||sn("WS_SERVICES_MASTERS_WATERSOURCE_"+m(null==Sn||null===(y=Sn.SewerageConnections)||void 0===y||null===(D=y[0])||void 0===D?void 0:D.waterSource,".","_"))||sn("CS_NA"),textStyle:{whiteSpace:"pre"}}),l.createElement(a.Row,{className:"border-none",label:sn("WS_SERV_DETAIL_WATER_SUB_SOURCE"),text:sn(null==Sn||null===(T=Sn.WaterConnection)||void 0===T||null===(h=T[0])||void 0===h||null===(A=h.waterSource)||void 0===A||null===(I=A.split("."))||void 0===I?void 0:I[1])||sn("CS_NA"),textStyle:{whiteSpace:"pre"}}))),(null==Sn?void 0:Sn.SewerageConnections)&&(null==Sn||null===(O=Sn.SewerageConnections)||void 0===O?void 0:O.length)>0&&l.createElement(a.StatusTable,null,l.createElement(a.Row,{className:"border-none",label:sn("WS_NUMBER_WATER_CLOSETS_LABEL"),text:null==Sn||null===(b=Sn.SewerageConnections)||void 0===b||null===(L=b[0])||void 0===L?void 0:L.proposedWaterClosets,textStyle:{whiteSpace:"pre"}}),l.createElement(a.Row,{className:"border-none",label:sn("WS_SERV_DETAIL_NO_OF_TOILETS"),text:(null==Sn||null===(R=Sn.SewerageConnections)||void 0===R||null===(w=R[0])||void 0===w?void 0:w.proposedToilets)||sn("CS_NA"),textStyle:{whiteSpace:"pre"}}))),l.createElement(a.Card,null,l.createElement(a.CardSubHeader,null,sn("WS_COMMON_PLUMBER_DETAILS")),l.createElement(a.StatusTable,null,l.createElement(a.Row,{className:"border-none",label:sn("WS_ADDN_DETAILS_PLUMBER_PROVIDED_BY"),text:("ULB"===(null==Sn||null===(W=Sn.WaterConnection)||void 0===W||null===(P=W[0])||void 0===P||null===(M=P.additionalDetails)||void 0===M?void 0:M.detailsProvidedBy)?sn("WS_PLUMBER_ULB"):sn("WS_PLUMBER_SELF"))||("ULB"===(null==Sn||null===(x=Sn.SewerageConnections)||void 0===x||null===(B=x[0])||void 0===B||null===(F=B.additionalDetails)||void 0===F?void 0:F.detailsProvidedBy)?sn("WS_PLUMBER_ULB"):sn("WS_PLUMBER_SELF"))||sn("NA"),textStyle:{whiteSpace:"pre"}}),("ULB"===(null==Sn||null===(U=Sn.WaterConnection)||void 0===U||null===(k=U[0])||void 0===k||null===(H=k.additionalDetails)||void 0===H?void 0:H.detailsProvidedBy)||"ULB"===(null==Sn||null===(j=Sn.SewerageConnections)||void 0===j||null===(V=j[0])||void 0===V||null===(z=V.additionalDetails)||void 0===z?void 0:z.detailsProvidedBy))&&l.createElement("div",null,l.createElement(a.Row,{className:"border-none",label:sn("WS_PLUMBER_LIC_NO"),text:(null==Sn||null===(Y=Sn.WaterConnection)||void 0===Y||null===(G=Y[0])||void 0===G||null===(q=G.plumberInfo)||void 0===q||null===(K=q[0])||void 0===K?void 0:K.licenseNo)||(null==Sn||null===(X=Sn.SewerageConnections)||void 0===X||null===(Z=X[0])||void 0===Z||null===($=Z.plumberInfo)||void 0===$?void 0:$.licenseNo)||sn("NA"),textStyle:{whiteSpace:"pre"}}),l.createElement(a.Row,{className:"border-none",label:sn("WS_ADDN_DETAILS_PLUMBER_NAME_LABEL"),text:(null==Sn||null===(J=Sn.WaterConnection)||void 0===J||null===(Q=J[0])||void 0===Q||null===(ee=Q.plumberInfo)||void 0===ee||null===(ne=ee[0])||void 0===ne?void 0:ne.name)||(null==Sn||null===(te=Sn.SewerageConnections)||void 0===te||null===(le=te[0])||void 0===le||null===(oe=le.plumberInfo)||void 0===oe?void 0:oe.name)||"NA",textStyle:{whiteSpace:"pre"}}),l.createElement(a.Row,{className:"border-none",label:sn("WS_PLUMBER_MOB_NO"),text:(null==Sn||null===(ie=Sn.WaterConnection)||void 0===ie||null===(ae=ie[0])||void 0===ae||null===(re=ae.plumberInfo)||void 0===re||null===(ue=re[0])||void 0===ue?void 0:ue.mobileNumber)||(null==Sn||null===(de=Sn.SewerageConnections)||void 0===de||null===(se=de[0])||void 0===se||null===(ce=se.plumberInfo)||void 0===ce?void 0:ce.mobileNumber)||"NA",textStyle:{whiteSpace:"pre"},privacy:{uuid:pn,fieldName:["plumberInfoMobileNumber"],model:"WnSConnectionPlumber",showValue:!1,loadData:{serviceName:null!=pn&&pn.includes("WS")?"/ws-services/wc/_search":"/sw-services/swc/_search",requestBody:{},requestParam:{tenantId:vn,applicationNumber:pn},jsonPath:null!=pn&&pn.includes("WS")?"WaterConnection[0].plumberInfo[0].mobileNumber":"SewerageConnections[0].plumberInfo[0].mobileNumber",isArray:!1}}})))),l.createElement(a.Card,null,l.createElement(a.CardSubHeader,null,sn("WS_ROAD_CUTTING_DETAILS")),l.createElement(a.StatusTable,null,l.createElement(a.Row,{className:"border-none",label:sn("WS_ADDN_DETAIL_ROAD_TYPE"),text:null!=Sn&&null!==(ve=Sn.WaterConnection)&&void 0!==ve&&null!==(pe=ve[0])&&void 0!==pe&&null!==(me=pe.roadCuttingInfo)&&void 0!==me&&null!==(Ee=me[0])&&void 0!==Ee&&Ee.roadType||null!=Sn&&null!==(Se=Sn.SewerageConnections)&&void 0!==Se&&null!==(_e=Se[0])&&void 0!==_e&&null!==(fe=_e.roadCuttingInfo)&&void 0!==fe&&null!==(ge=fe[0])&&void 0!==ge&&ge.roadType?sn("WS_ROADTYPE_"+((null==Sn||null===(Ce=Sn.WaterConnection)||void 0===Ce||null===(Ne=Ce[0])||void 0===Ne||null===(ye=Ne.roadCuttingInfo)||void 0===ye||null===(De=ye[0])||void 0===De?void 0:De.roadType)||(null==Sn||null===(Te=Sn.SewerageConnections)||void 0===Te||null===(he=Te[0])||void 0===he||null===(Ae=he.roadCuttingInfo)||void 0===Ae||null===(Ie=Ae[0])||void 0===Ie?void 0:Ie.roadType))):sn("CS_NA"),textStyle:{whiteSpace:"pre"}}),l.createElement(a.Row,{className:"border-none",label:sn("WS_ADDN_DETAILS_AREA_LABEL"),text:(null==Sn||null===(Oe=Sn.WaterConnection)||void 0===Oe||null===(be=Oe[0])||void 0===be||null===(Le=be.roadCuttingInfo)||void 0===Le||null===(Re=Le[0])||void 0===Re?void 0:Re.roadCuttingArea)||(null==Sn||null===(we=Sn.SewerageConnections)||void 0===we||null===(We=we[0])||void 0===We||null===(Pe=We.roadCuttingInfo)||void 0===Pe||null===(Me=Pe[0])||void 0===Me?void 0:Me.roadCuttingArea)||sn("NA"),textStyle:{whiteSpace:"pre"}}))),l.createElement(a.Card,null,l.createElement(a.CardSubHeader,null,sn("WS_ACTIVATION_DETAILS")),l.createElement(a.StatusTable,null,l.createElement(a.Row,{className:"border-none",label:sn("WS_SERV_DETAIL_CONN_EXECUTION_DATE"),text:null!=Sn&&null!==(xe=Sn.WaterConnection)&&void 0!==xe&&null!==(Be=xe[0])&&void 0!==Be&&Be.connectionExecutionDate||null!=Sn&&null!==(Fe=Sn.SewerageConnections)&&void 0!==Fe&&null!==(Ue=Fe[0])&&void 0!==Ue&&Ue.connectionExecutionDate?Digit.DateUtils.ConvertEpochToDate((null==Sn||null===(ke=Sn.WaterConnection)||void 0===ke||null===(He=ke[0])||void 0===He?void 0:He.connectionExecutionDate)||(null==Sn||null===(je=Sn.SewerageConnections)||void 0===je||null===(Ve=je[0])||void 0===Ve?void 0:Ve.connectionExecutionDate)):sn("NA"),textStyle:{whiteSpace:"pre"}}),(null==Sn?void 0:Sn.WaterConnection)&&(null==Sn||null===(ze=Sn.WaterConnection)||void 0===ze?void 0:ze.length)>0&&l.createElement("div",null,l.createElement(a.Row,{className:"border-none",label:sn("WS_SERV_DETAIL_METER_ID"),text:(null==Sn||null===(Ye=Sn.WaterConnection)||void 0===Ye||null===(Ge=Ye[0])||void 0===Ge?void 0:Ge.meterId)||(null==Sn||null===(qe=Sn.SewerageConnections)||void 0===qe||null===(Ke=qe[0])||void 0===Ke?void 0:Ke.meterId)||sn("NA"),textStyle:{whiteSpace:"pre"}}),l.createElement(a.Row,{className:"border-none",label:sn("WS_ADDN_DETAIL_METER_INSTALL_DATE"),text:null!=Sn&&null!==(Xe=Sn.WaterConnection)&&void 0!==Xe&&null!==(Ze=Xe[0])&&void 0!==Ze&&Ze.meterInstallationDate||null!=Sn&&null!==($e=Sn.SewerageConnections)&&void 0!==$e&&null!==(Je=$e[0])&&void 0!==Je&&Je.meterInstallationDate?Digit.DateUtils.ConvertEpochToDate((null==Sn||null===(Qe=Sn.WaterConnection)||void 0===Qe||null===(en=Qe[0])||void 0===en?void 0:en.meterInstallationDate)||(null==Sn||null===(nn=Sn.SewerageConnections)||void 0===nn||null===(tn=nn[0])||void 0===tn?void 0:tn.meterInstallationDate)):sn("NA"),textStyle:{whiteSpace:"pre"}}),l.createElement(a.Row,{className:"border-none",label:sn("WS_ADDN_DETAILS_INITIAL_METER_READING"),text:(null==Sn||null===(ln=Sn.WaterConnection)||void 0===ln||null===(on=ln[0])||void 0===on||null===(an=on.additionalDetails)||void 0===an?void 0:an.initialMeterReading)||(null==Sn||null===(rn=Sn.SewerageConnections)||void 0===rn||null===(un=rn[0])||void 0===un||null===(dn=un.additionalDetails)||void 0===dn?void 0:dn.initialMeterReading)||"NA",textStyle:{whiteSpace:"pre"}}))))))},WSMyConnections:e=>{var n,t,i,r,u,d,s,c;const{t:p}=o.useTranslation(),m=Digit.UserService.getUser(),E=(null===(n=Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY"))||void 0===n?void 0:n.code)||(null==m||null===(t=m.info)||void 0===t?void 0:t.permanentCity)||Digit.ULBService.getCurrentTenantId();let S=window.location.href.split("/").pop(),_=isNaN(parseInt(S))?{tenantId:E,mobileNumber:null==m||null===(r=m.info)||void 0===r?void 0:r.mobileNumber,searchType:"CONNECTION"}:{tenantId:E,mobileNumber:null==m||null===(i=m.info)||void 0===i?void 0:i.mobileNumber,searchType:"CONNECTION"};const{isLoading:f,data:g}=Digit.Hooks.ws.useMyApplicationSearch({filters:_},{filters:_}),{isLoading:C,data:N}=Digit.Hooks.ws.useMyApplicationSearch({filters:_,BusinessService:"SW"},{filters:_});let y=null==g?void 0:g.WaterConnection.concat(null==N?void 0:N.SewerageConnections),D=g&&(null==g||null===(u=g.WaterConnection)||void 0===u?void 0:u.map(e=>null==e?void 0:e.propertyId).join(","))||"",T=N&&(null==N||null===(d=N.SewerageConnections)||void 0===d?void 0:d.map(e=>null==e?void 0:e.propertyId).join(","))||"",h=D.concat(T);const{isLoading:A,data:I}=Digit.Hooks.pt.usePropertySearch({filters:{propertyIds:h}},{filters:{propertyIds:h},enabled:!!h});return y=y&&y.map(e=>{var n;return v({},e,{property:null==I||null===(n=I.Properties)||void 0===n?void 0:n.filter(n=>(null==n?void 0:n.propertyId)===(null==e?void 0:e.propertyId))[0]})}),f||A||C?l.createElement(a.Loader,null):l.createElement(l.Fragment,null,l.createElement(a.Header,null,p("WS_MYCONNECTIONS_HEADER")+" "+(y?"("+y.length+")":"")),l.createElement(j,{t:p}),l.createElement("div",null,(null===(s=y)||void 0===s?void 0:s.length)>0&&y.map((e,n)=>l.createElement("div",{key:n},l.createElement(Yi,{application:e}))),!(null!==(c=y)&&void 0!==c&&c.length)>0&&l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},p("PT_NO_APPLICATION_FOUND_MSG"))))},WSCitizenConnectionDetails:()=>{var e,n,r,u,d,s,c,p,E,S,_,f,g,C,N,y,D,T,h,A,I,O,b,L,R,w,W,P,M,x,B,F,k,H,V,z,Y,G,q,K,X,Z,$,J,Q,ee,ne,te,le,oe,ie,ae,re,ue,de,se,ce,ve,pe,me,Ee,Se,_e,fe,ge,Ce,Ne,ye,De,Te,he,Ae,Ie,Oe,be,Le,Re,we,We,Pe,Me,xe,Be,Fe,Ue,ke,He,je,Ve,ze,Ye,Ge,qe,Ke,Xe,Ze,$e,Je,Qe,en,nn,tn,ln,on,an,rn,un,dn,sn,cn,vn,pn,mn,En,Sn,_n,fn,gn,Cn,Nn,yn,Dn,Tn,hn,An,In,On,bn,Ln,Rn,wn,Wn,Pn,Mn,xn,Bn,Fn,Un,kn,Hn,jn,Vn,zn,Yn,Gn,qn,Kn,Xn,Zn,$n,Jn,Qn,et,nt,tt,lt,ot,it,at,rt,ut,dt,st,ct,vt,pt,mt,Et,St,_t,ft,gt,Ct,Nt,yt,Dt,Tt,ht,At,It,Ot,bt,Lt,Rt,wt,Wt,Pt,Mt,xt,Bt,Ft,Ut,kt,Ht,jt,Vt,zt,Yt,Gt,qt,Kt,Xt,Zt,$t,Jt,Qt,el,nl,tl,ll,ol,il,al,rl,ul,dl,sl,cl;const{t:vl}=o.useTranslation(),pl=t.useRef(),ml=Digit.UserService.getUser(),El=i.useHistory(),Sl=(null===(e=Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY"))||void 0===e?void 0:e.code)||(null==ml||null===(n=ml.info)||void 0===n?void 0:n.permanentCity)||Digit.ULBService.getCurrentTenantId(),[_l,fl]=t.useState(!1),gl=window.location.href.includes("SW_")?window.location.href.substring(window.location.href.indexOf("SW_")):window.location.href.substring(window.location.href.indexOf("WS_"));let{state:Cl={}}=i.useLocation();const[Nl,yl]=t.useState(!1),[Dl,Tl]=t.useState(null),hl=Digit.Utils.browser.isMobile();let Al={tenantId:Sl,applicationNumber:gl};var{isLoading:Il,data:Ol}=Digit.Hooks.ws.useMyApplicationSearch({filters:Al,BusinessService:null!=gl&&gl.includes("SW")?"SW":"WS"},{filters:Al,privacy:Digit.Utils.getPrivacyObject()},!0);let bl={tenantId:Sl,connectionNumber:null!=gl&&gl.includes("SW")?null==Ol||null===(r=Ol.SewerageConnections)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.connectionNo:null==Ol||null===(d=Ol.WaterConnection)||void 0===d||null===(s=d[0])||void 0===s?void 0:s.connectionNo};var{data:Ll}=Digit.Hooks.ws.useMyApplicationSearch({filters:bl,BusinessService:null!=gl&&gl.includes("SW")?"SW":"WS"},{filters:bl,privacy:Digit.Utils.getPrivacyObject(),enabled:!(null==bl||!bl.connectionNumber)},!0);Cl=(null===(c=Object.keys(Cl))||void 0===c?void 0:c.length)>0?Cl:null!=gl&&gl.includes("WS")?null==Ll||null===(p=Ll.WaterConnection)||void 0===p?void 0:p[0]:null==Ll||null===(E=Ll.SewerageConnections)||void 0===E?void 0:E[0],Digit.Hooks.useClickOutside(pl,()=>{fl(!1)},_l);const{isLoading:Rl,data:wl}=Digit.Hooks.pt.usePropertySearch({filters:{propertyIds:null==Ol||null===(S=Ol.WaterConnection)||void 0===S||null===(_=S[0])||void 0===_?void 0:_.propertyId}},{filters:{propertyIds:null==Ol||null===(f=Ol.WaterConnection)||void 0===f||null===(g=f[0])||void 0===g?void 0:g.propertyId},privacy:Digit.Utils.getPrivacyObject()}),Wl=Digit.Hooks.ws.useToCheckPrivacyEnablement({privacy:{uuid:null!=gl&&gl.includes("WS")?null==Ol||null===(C=Ol.WaterConnection)||void 0===C||null===(N=C[0])||void 0===N||null===(y=N.connectionHolders)||void 0===y||null===(D=y[0])||void 0===D?void 0:D.uuid:null==Ol||null===(T=Ol.SewerageConnections)||void 0===T||null===(h=T[0])||void 0===h||null===(A=h.connectionHolders)||void 0===A||null===(I=A[0])||void 0===I?void 0:I.uuid,fieldName:"connectionHoldersMobileNumber",model:"WnSConnectionOwner"}})||!1,Pl=()=>{Tl(null)};let Ml=null!=gl&&gl.includes("WS")?null==Ll?void 0:Ll.WaterConnection:null==Ll?void 0:Ll.SewerageConnections,xl=!1;if((null==Ml?void 0:Ml.length)>0){const e=null==Ml?void 0:Ml.filter(e=>"DISCONNECTION_EXECUTED"==(null==e?void 0:e.applicationStatus)&&(null==e?void 0:e.applicationType.includes("DISCONNECT")));null!=e&&e.length&&(xl=!0)}Digit.Hooks.useCommonMDMS(Sl,"common-masters","ReceiptKey",{select:e=>{var n,t,l;return(null===(n=e["common-masters"])||void 0===n||null===(t=n.uiCommonPay)||void 0===t||null===(l=t.filter(e=>{let{code:n}=e;return"WS".includes(n)})[0])||void 0===l?void 0:l.receiptKey)||"consolidatedreceipt"}});let Bl=[];Bl.push({order:1,label:vl("WS_CONNECTION_DETAILS"),onClick:()=>function(){try{var e,n,t,l,o,i,a;const r=(null==Ol||null===(e=Ol.WaterConnection)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.tenantId)||(null==Ol||null===(t=Ol.SewerageConnections)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.tenantId);let u=(null==Ol||null===(o=Ol.WaterConnection)||void 0===o?void 0:o[0])||(null==Ol||null===(i=Ol.SewerageConnections)||void 0===i?void 0:i[0]);return Hi(v({},u),v({},null==wl||null===(a=wl.Properties)||void 0===a?void 0:a[0]),r,vl).then(e=>Digit.Utils.pdf.generatev1(e)),fl(!1),Promise.resolve()}catch(e){return Promise.reject(e)}}()}),vl("WS_APPLICATION"),vl("WS_RECEIPT_APPLICATION_FEE"),Bl.sort(function(e,n){return e.order-n.order});const Fl=null===(O=Cl)||void 0===O||null===(b=O.applicationNo)||void 0===b?void 0:b.includes("SW"),Ul={consumerCode:null===(L=Cl)||void 0===L?void 0:L.connectionNo},kl=Digit.Hooks.useFetchBillsForBuissnessService(v({businessService:Fl?"SW":"WS"},Ul,{tenantId:Sl}),{retry:!1}),Hl=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),jl=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Vl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Hl,null));if(Il||Rl)return l.createElement(a.Loader,null);sessionStorage.setItem("ApplicationNoState",null===(R=Cl)||void 0===R?void 0:R.applicationNo);let zl=null!==(w=Cl)&&void 0!==w&&null!==(W=w.applicationType)&&void 0!==W&&W.includes("WATER")?"WATER":"SEWERAGE";return l.createElement(l.Fragment,null,l.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},l.createElement(a.Header,null,vl("WS_COMMON_CONNECTION_DETAIL")),Bl&&Bl.length>0&&l.createElement("div",{ref:pl},l.createElement(a.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>fl(!_l),displayOptions:_l,options:Bl,optionsStyle:{margin:"0px"}}))),Wl&&l.createElement(j,{t:vl}),l.createElement("div",{className:"hide-seperator"},l.createElement(a.Card,null,l.createElement(a.StatusTable,null,l.createElement(a.Row,{className:"border-none",label:vl("WS_MYCONNECTIONS_CONSUMER_NO"),text:null===(P=Cl)||void 0===P?void 0:P.connectionNo}),l.createElement(a.Row,{className:"border-none",label:vl("WS_SERVICE_NAME_LABEL"),text:vl("WS_APPLICATION_TYPE_"+(null===(M=Cl)||void 0===M?void 0:M.applicationType)),textStyle:{wordBreak:"break-word"}}),l.createElement(a.Row,{className:"border-none",label:vl("WS_STATUS"),text:(null===(x=Cl)||void 0===x?void 0:x.status)||"NA",textStyle:{whiteSpace:"pre"}})),l.createElement(a.CardHeader,{styles:{fontSize:"28px"}},vl("WS_COMMON_CONNECTION_DETAIL")),l.createElement(a.StatusTable,null,(null===(B=Cl)||void 0===B||null===(F=B.applicationType)||void 0===F?void 0:F.includes("WATER"))&&l.createElement("div",null,l.createElement(a.Row,{className:"border-none",label:vl("WS_COMMON_TABLE_COL_CONNECTIONTYPE_LABEL"),text:(null===(k=Cl)||void 0===k?void 0:k.connectionType)||vl("NA"),textStyle:{whiteSpace:"pre"}}),l.createElement(a.Row,{className:"border-none",label:vl("WS_SERV_DETAIL_NO_OF_TAPS"),text:null===(H=Cl)||void 0===H?void 0:H.noOfTaps,textStyle:{whiteSpace:"pre"}}),l.createElement(a.Row,{className:"border-none",label:vl("WS_PIPE_SIZE_IN_INCHES_LABEL"),text:(null===(V=Cl)||void 0===V?void 0:V.pipeSize)||"NA",textStyle:{whiteSpace:"pre"}})),(null===(z=Cl)||void 0===z||null===(Y=z.applicationType)||void 0===Y?void 0:Y.includes("SEWERAGE"))&&l.createElement("div",null,l.createElement(a.Row,{className:"border-none",label:vl("WS_CONN_DETAIL_WATER_CLOSETS"),text:null===(G=Cl)||void 0===G?void 0:G.proposedWaterClosets,textStyle:{whiteSpace:"pre"}}),l.createElement(a.Row,{className:"border-none",label:vl("WS_SERV_DETAIL_NO_OF_TOILETS"),text:(null===(q=Cl)||void 0===q?void 0:q.proposedToilets)||vl("CS_NA"),textStyle:{whiteSpace:"pre"}}),l.createElement(a.Row,{className:"border-none",label:vl("WS_SERV_DETAIL_CONN_EXECUTION_DATE"),text:null!==(K=Cl)&&void 0!==K&&K.connectionExecutionDate?Digit.DateUtils.ConvertEpochToDate(null===(X=Cl)||void 0===X?void 0:X.connectionExecutionDate):vl("CS_NA"),textStyle:{whiteSpace:"pre"}})),(null===(Z=Cl)||void 0===Z||null===($=Z.applicationType)||void 0===$?void 0:$.includes("WATER"))&&l.createElement("div",null,l.createElement(a.Row,{className:"border-none",label:vl("WS_SERV_DETAIL_WATER_SOURCE"),text:vl("WS_SERVICES_MASTERS_WATERSOURCE_"+m(null===(J=Cl)||void 0===J||null===(Q=J.waterSource)||void 0===Q||null===(ee=Q.split("."))||void 0===ee?void 0:ee[0],".","_"))||vl("WS_SERVICES_MASTERS_WATERSOURCE_"+m(null===(ne=Cl)||void 0===ne?void 0:ne.waterSource,".","_"))||vl("CS_NA"),textStyle:{whiteSpace:"pre"}}),l.createElement(a.Row,{className:"border-none",label:vl("WS_SERV_DETAIL_WATER_SUB_SOURCE"),text:vl(null===(te=Cl)||void 0===te||null===(le=te.waterSource)||void 0===le||null===(oe=le.split("."))||void 0===oe?void 0:oe[1])||vl("CS_NA"),textStyle:{whiteSpace:"pre"}}),l.createElement(a.Row,{className:"border-none",label:vl("WS_SERV_DETAIL_CONN_EXECUTION_DATE"),text:Digit.DateUtils.ConvertEpochToDate(null===(ie=Cl)||void 0===ie?void 0:ie.connectionExecutionDate)||vl("NA"),textStyle:{whiteSpace:"pre"}}),l.createElement(a.Row,{className:"border-none",label:vl("WS_SERV_DETAIL_METER_ID"),text:null===(ae=Cl)||void 0===ae?void 0:ae.meterId,textStyle:{whiteSpace:"pre"}}),l.createElement(a.Row,{className:"border-none",label:vl("WS_ADDN_DETAIL_METER_INSTALL_DATE"),text:Digit.DateUtils.ConvertEpochToDate(null===(re=Cl)||void 0===re?void 0:re.meterInstallationDate)||"NA",textStyle:{whiteSpace:"pre"}}),l.createElement(a.Row,{className:"border-none",label:vl("WS_ADDN_DETAILS_INITIAL_METER_READING"),text:(null===(ue=Cl)||void 0===ue||null===(de=ue.additionalDetails)||void 0===de?void 0:de.initialMeterReading)||"NA",textStyle:{whiteSpace:"pre"}})),"Metered"===(null===(se=Cl)||void 0===se?void 0:se.connectionType)&&l.createElement(i.Link,{to:"/digit-ui/citizen/ws/consumption/details?applicationNo="+(null===(ce=Cl)||void 0===ce?void 0:ce.connectionNo)},l.createElement(a.LinkButton,{style:{textAlign:"left",marginBottom:"10px",marginTop:"5px"},label:vl("WS_CONNECTION_DETAILS_VIEW_CONSUMPTION_LABEL")}))),l.createElement(a.CardHeader,{styles:{fontSize:"28px"}},vl("WS_COMMON_PROPERTY_DETAILS")),l.createElement(a.StatusTable,null,l.createElement(a.Row,{className:"border-none",label:vl("WS_PROPERTY_ID_LABEL"),text:null===(ve=Cl)||void 0===ve?void 0:ve.propertyId}),l.createElement(a.Row,{className:"border-none",label:vl("WS_OWN_DETAIL_OWN_NAME_LABEL"),text:null===(pe=Cl)||void 0===pe||null===(me=pe.property)||void 0===me||null===(Ee=me.owners)||void 0===Ee?void 0:Ee.map(e=>e.name).join(","),textStyle:{whiteSpace:"pre"}}),l.createElement(a.Row,{className:"border-none",label:vl("WS_OWN_DETAIL_PROPADD"),text:(Yl=null==wl||null===(Se=wl.Properties)||void 0===Se||null===(_e=Se[0])||void 0===_e?void 0:_e.address,(null!=Yl&&Yl.doorNo?(null==Yl?void 0:Yl.doorNo)+", ":"")+(null!=Yl&&Yl.street?(null==Yl?void 0:Yl.street)+", ":"")+(null!=Yl&&Yl.landmark?(null==Yl?void 0:Yl.landmark)+", ":"")+(null!=Yl&&null!==(Gl=Yl.locality)&&void 0!==Gl&&Gl.code?vl("TENANTS_MOHALLA_"+(null==Yl||null===(ql=Yl.locality)||void 0===ql?void 0:ql.code)):"")+(null!=Yl&&null!==(Kl=Yl.city)&&void 0!==Kl&&Kl.code||null!=Yl&&Yl.city?", "+vl((null==Yl?void 0:Yl.city.code)||(null==Yl?void 0:Yl.city)):"")+(null!=Yl&&Yl.pincode?", "+Yl.pincode:" ")||vl("CS_NA")),textStyle:{wordBreak:"break-word"},privacy:{uuid:null==wl||null===(fe=wl.Properties)||void 0===fe||null===(ge=fe[0])||void 0===ge||null===(Ce=ge.owners)||void 0===Ce||null===(Ne=Ce[0])||void 0===Ne?void 0:Ne.uuid,fieldName:["doorNo","street","landmark"],model:"Property",hide:!(null!=wl&&null!==(ye=wl.Properties)&&void 0!==ye&&null!==(De=ye[0])&&void 0!==De&&De.address),showValue:!0,loadData:{serviceName:"/property-services/property/_search",requestBody:{},requestParam:{tenantId:Sl,propertyIds:null===(Te=Cl)||void 0===Te?void 0:Te.propertyId},jsonPath:"Properties[0].address.street",isArray:!1,d:e=>(U.get(e,"Properties[0].address.doorNo")?U.get(e,"Properties[0].address.doorNo")+", ":"")+(U.get(e,"Properties[0].address.street")?U.get(e,"Properties[0].address.street")+", ":"")+(U.get(e,"Properties[0].address.landmark")?""+U.get(e,"Properties[0].address.landmark"):"")}}}),l.createElement(i.Link,{to:"/digit-ui/citizen/commonpt/view-property?propertyId="+(null===(he=Cl)||void 0===he?void 0:he.propertyId)+"&tenantId="+(null===(Ae=Cl)||void 0===Ae?void 0:Ae.tenantId)},l.createElement(a.LinkButton,{style:{textAlign:"left",marginBottom:"10px",marginTop:"5px"},label:vl("WS_VIEW_PROPERTY")}))),l.createElement(a.CardHeader,{styles:{fontSize:"28px"}},vl("WS_COMMON_CONNECTION_HOLDER_DETAILS_HEADER")),null!==(Ie=Cl)&&void 0!==Ie&&Ie.connectionHolders?l.createElement("div",null,l.createElement(a.StatusTable,null,l.createElement(a.Row,{className:"border-none",label:vl("WS_OWN_DETAIL_OWN_NAME_LABEL"),text:null===(Oe=Cl)||void 0===Oe||null===(be=Oe.connectionHolders)||void 0===be||null===(Le=be[0])||void 0===Le?void 0:Le.name,textStyle:{whiteSpace:"pre"}}),l.createElement(a.Row,{className:"border-none",label:vl("WS_OWN_DETAIL_GENDER_LABEL"),text:null!=gl&&gl.includes("WS")?null==Ol||null===(Re=Ol.WaterConnection)||void 0===Re||null===(we=Re[0])||void 0===we||null===(We=we.connectionHolders)||void 0===We||null===(Pe=We[0])||void 0===Pe?void 0:Pe.gender:null==Ol||null===(Me=Ol.SewerageConnections)||void 0===Me||null===(xe=Me[0])||void 0===xe||null===(Be=xe.connectionHolders)||void 0===Be||null===(Fe=Be[0])||void 0===Fe?void 0:Fe.gender,textStyle:{whiteSpace:"pre"},privacy:{uuid:null!=gl&&gl.includes("WS")?null==Ol||null===(Ue=Ol.WaterConnection)||void 0===Ue||null===(ke=Ue[0])||void 0===ke||null===(He=ke.connectionHolders)||void 0===He||null===(je=He[0])||void 0===je?void 0:je.uuid:null==Ol||null===(Ve=Ol.SewerageConnections)||void 0===Ve||null===(ze=Ve[0])||void 0===ze||null===(Ye=ze.connectionHolders)||void 0===Ye||null===(Ge=Ye[0])||void 0===Ge?void 0:Ge.uuid,fieldName:"gender",model:"WnSConnectionOwner",showValue:!1,loadData:{serviceName:"WATER"===zl?"/ws-services/wc/_search":"/sw-services/swc/_search",requestBody:{},requestParam:{tenantId:Sl,applicationNumber:gl},jsonPath:"WATER"===zl?"WaterConnection[0].connectionHolders[0].gender":"SewerageConnections[0].connectionHolders[0].gender",isArray:!1}}}),l.createElement(a.Row,{className:"border-none",label:vl("WS_OWN_DETAIL_MOBILE_NO_LABEL"),text:null!=gl&&gl.includes("WS")?null==Ol||null===(qe=Ol.WaterConnection)||void 0===qe||null===(Ke=qe[0])||void 0===Ke||null===(Xe=Ke.connectionHolders)||void 0===Xe||null===(Ze=Xe[0])||void 0===Ze?void 0:Ze.mobileNumber:null==Ol||null===($e=Ol.SewerageConnections)||void 0===$e||null===(Je=$e[0])||void 0===Je||null===(Qe=Je.connectionHolders)||void 0===Qe||null===(en=Qe[0])||void 0===en?void 0:en.mobileNumber,textStyle:{whiteSpace:"pre"},privacy:{uuid:null!=gl&&gl.includes("WS")?null==Ol||null===(nn=Ol.WaterConnection)||void 0===nn||null===(tn=nn[0])||void 0===tn||null===(ln=tn.connectionHolders)||void 0===ln||null===(on=ln[0])||void 0===on?void 0:on.uuid:null==Ol||null===(an=Ol.SewerageConnections)||void 0===an||null===(rn=an[0])||void 0===rn||null===(un=rn.connectionHolders)||void 0===un||null===(dn=un[0])||void 0===dn?void 0:dn.uuid,fieldName:"connectionHoldersMobileNumber",model:"WnSConnectionOwner",showValue:!1,loadData:{serviceName:"WATER"===zl?"/ws-services/wc/_search":"/sw-services/swc/_search",requestBody:{},requestParam:{tenantId:Sl,applicationNumber:gl},jsonPath:"WATER"===zl?"WaterConnection[0].connectionHolders[0].mobileNumber":"SewerageConnections[0].connectionHolders[0].mobileNumber",isArray:!1}}}),l.createElement(a.Row,{className:"border-none",label:vl("WS_OWN_DETAIL_FATHER_OR_HUSBAND_NAME"),text:null!=gl&&gl.includes("WS")?null==Ol||null===(sn=Ol.WaterConnection)||void 0===sn||null===(cn=sn[0])||void 0===cn||null===(vn=cn.connectionHolders)||void 0===vn||null===(pn=vn[0])||void 0===pn?void 0:pn.fatherOrHusbandName:null==Ol||null===(mn=Ol.SewerageConnections)||void 0===mn||null===(En=mn[0])||void 0===En||null===(Sn=En.connectionHolders)||void 0===Sn||null===(_n=Sn[0])||void 0===_n?void 0:_n.fatherOrHusbandName,textStyle:{whiteSpace:"pre"},privacy:{uuid:null!=gl&&gl.includes("WS")?null==Ol||null===(fn=Ol.WaterConnection)||void 0===fn||null===(gn=fn[0])||void 0===gn||null===(Cn=gn.connectionHolders)||void 0===Cn||null===(Nn=Cn[0])||void 0===Nn?void 0:Nn.uuid:null==Ol||null===(yn=Ol.SewerageConnections)||void 0===yn||null===(Dn=yn[0])||void 0===Dn||null===(Tn=Dn.connectionHolders)||void 0===Tn||null===(hn=Tn[0])||void 0===hn?void 0:hn.uuid,fieldName:"fatherOrHusbandName",model:"WnSConnectionOwner",showValue:!1,loadData:{serviceName:"WATER"===zl?"/ws-services/wc/_search":"/sw-services/swc/_search",requestBody:{},requestParam:{tenantId:Sl,applicationNumber:gl},jsonPath:"WATER"===zl?"WaterConnection[0].connectionHolders[0].fatherOrHusbandName":"SewerageConnections[0].connectionHolders[0].fatherOrHusbandName",isArray:!1}}}),l.createElement(a.Row,{className:"border-none",label:vl("WS_OWN_DETAIL_RELATION_LABEL"),text:null!=gl&&gl.includes("WS")?null==Ol||null===(An=Ol.WaterConnection)||void 0===An||null===(In=An[0])||void 0===In||null===(On=In.connectionHolders)||void 0===On||null===(bn=On[0])||void 0===bn?void 0:bn.relationship:null==Ol||null===(Ln=Ol.SewerageConnections)||void 0===Ln||null===(Rn=Ln[0])||void 0===Rn||null===(wn=Rn.connectionHolders)||void 0===wn||null===(Wn=wn[0])||void 0===Wn?void 0:Wn.relationship,textStyle:{whiteSpace:"pre"},privacy:{uuid:null!=gl&&gl.includes("WS")?null==Ol||null===(Pn=Ol.WaterConnection)||void 0===Pn||null===(Mn=Pn[0])||void 0===Mn||null===(xn=Mn.connectionHolders)||void 0===xn||null===(Bn=xn[0])||void 0===Bn?void 0:Bn.uuid:null==Ol||null===(Fn=Ol.SewerageConnections)||void 0===Fn||null===(Un=Fn[0])||void 0===Un||null===(kn=Un.connectionHolders)||void 0===kn||null===(Hn=kn[0])||void 0===Hn?void 0:Hn.uuid,fieldName:"relationship",model:"WnSConnection",showValue:!1,loadData:{serviceName:"WATER"===zl?"/ws-services/wc/_search":"/sw-services/swc/_search",requestBody:{},requestParam:{tenantId:Sl,applicationNumber:gl},jsonPath:"WATER"===zl?"WaterConnection[0].connectionHolders[0].relationship":"SewerageConnections[0].connectionHolders[0].relationship",isArray:!1}}}),l.createElement(a.Row,{className:"border-none",label:vl("WS_OWN_DETAIL_CROSADD"),text:null!=gl&&gl.includes("WS")?null==Ol||null===(jn=Ol.WaterConnection)||void 0===jn||null===(Vn=jn[0])||void 0===Vn||null===(zn=Vn.connectionHolders)||void 0===zn||null===(Yn=zn[0])||void 0===Yn?void 0:Yn.correspondenceAddress:null==Ol||null===(Gn=Ol.SewerageConnections)||void 0===Gn||null===(qn=Gn[0])||void 0===qn||null===(Kn=qn.connectionHolders)||void 0===Kn||null===(Xn=Kn[0])||void 0===Xn?void 0:Xn.correspondenceAddress,privacy:{uuid:null!=gl&&gl.includes("WS")?null==Ol||null===(Zn=Ol.WaterConnection)||void 0===Zn||null===($n=Zn[0])||void 0===$n||null===(Jn=$n.connectionHolders)||void 0===Jn||null===(Qn=Jn[0])||void 0===Qn?void 0:Qn.uuid:null==Ol||null===(et=Ol.SewerageConnections)||void 0===et||null===(nt=et[0])||void 0===nt||null===(tt=nt.connectionHolders)||void 0===tt||null===(lt=tt[0])||void 0===lt?void 0:lt.uuid,fieldName:"correspondenceAddress",model:"WnSConnectionOwner",hide:!(null!==(ot=Cl)&&void 0!==ot&&ot.connectionHolders),showValue:!1,loadData:{serviceName:"WATER"===zl?"/ws-services/wc/_search":"/sw-services/swc/_search",requestBody:{},requestParam:{tenantId:Sl,applicationNumber:gl},jsonPath:"WATER"===zl?"WaterConnection[0].connectionHolders[0].correspondenceAddress":"SewerageConnections[0].connectionHolders[0].correspondenceAddress",isArray:!1}}}),l.createElement(a.Row,{className:"border-none",label:vl("WS_OWN_DETAIL_SPECIAL_APPLICANT_LABEL"),text:(null!=gl&&gl.includes("WS")?null!=Ol&&null!==(it=Ol.WaterConnection)&&void 0!==it&&null!==(at=it[0])&&void 0!==at&&null!==(rt=at.connectionHolders)&&void 0!==rt&&null!==(ut=rt[0])&&void 0!==ut&&null!==(dt=ut.ownerType)&&void 0!==dt&&dt.includes("*"):null!=Ol&&null!==(st=Ol.SewerageConnections)&&void 0!==st&&null!==(ct=st[0])&&void 0!==ct&&null!==(vt=ct.connectionHolders)&&void 0!==vt&&null!==(pt=vt[0])&&void 0!==pt&&null!==(mt=pt.ownerType)&&void 0!==mt&&mt.includes("*"))?null!=gl&&gl.includes("WS")?null==Ol||null===(Dt=Ol.WaterConnection)||void 0===Dt||null===(Tt=Dt[0])||void 0===Tt||null===(ht=Tt.connectionHolders)||void 0===ht||null===(At=ht[0])||void 0===At?void 0:At.ownerType:null==Ol||null===(It=Ol.SewerageConnections)||void 0===It||null===(Ot=It[0])||void 0===Ot||null===(bt=Ot.connectionHolders)||void 0===bt||null===(Lt=bt[0])||void 0===Lt?void 0:Lt.ownerType:vl("COMMON_MASTERS_OWNERTYPE_"+(null!=gl&&gl.includes("WS")?null==Ol||null===(Et=Ol.WaterConnection)||void 0===Et||null===(St=Et[0])||void 0===St||null===(_t=St.connectionHolders)||void 0===_t||null===(ft=_t[0])||void 0===ft?void 0:ft.ownerType:null==Ol||null===(gt=Ol.SewerageConnections)||void 0===gt||null===(Ct=gt[0])||void 0===Ct||null===(Nt=Ct.connectionHolders)||void 0===Nt||null===(yt=Nt[0])||void 0===yt?void 0:yt.ownerType)),textStyle:{whiteSpace:"pre"},privacy:{uuid:null!=gl&&gl.includes("WS")?null==Ol||null===(Rt=Ol.WaterConnection)||void 0===Rt||null===(wt=Rt[0])||void 0===wt||null===(Wt=wt.connectionHolders)||void 0===Wt||null===(Pt=Wt[0])||void 0===Pt?void 0:Pt.uuid:null==Ol||null===(Mt=Ol.SewerageConnections)||void 0===Mt||null===(xt=Mt[0])||void 0===xt||null===(Bt=xt.connectionHolders)||void 0===Bt||null===(Ft=Bt[0])||void 0===Ft?void 0:Ft.uuid,fieldName:"ownerType",model:"WnSConnection",hide:!(null!==(Ut=Cl)&&void 0!==Ut&&null!==(kt=Ut.connectionHolders)&&void 0!==kt&&null!==(Ht=kt[0])&&void 0!==Ht&&Ht.ownerType),showValue:!1,loadData:{serviceName:"WATER"===zl?"/ws-services/wc/_search":"/sw-services/swc/_search",requestBody:{},requestParam:{tenantId:Sl,applicationNumber:gl},jsonPath:"WATER"===zl?"WaterConnection[0].connectionHolders[0].ownerType":"SewerageConnections[0].connectionHolders[0].ownerType",isArray:!1,d:e=>{var n,t,l,o,i,a,r,u,d,s,c;return null!=e&&null!==(n=e.WaterConnection)&&void 0!==n&&n[0]?vl("PROPERTYTAX_OWNERTYPE_"+(null==e||null===(t=e.WaterConnection)||void 0===t||null===(l=t[0])||void 0===l||null===(o=l.connectionHolders)||void 0===o||null===(i=o[0])||void 0===i||null===(a=i.ownerType)||void 0===a?void 0:a.toUpperCase())):vl("PROPERTYTAX_OWNERTYPE_"+(null==e||null===(r=e.SewerageConnections)||void 0===r||null===(u=r[0])||void 0===u||null===(d=u.connectionHolders)||void 0===d||null===(s=d[0])||void 0===s||null===(c=s.ownerType)||void 0===c?void 0:c.toUpperCase()))}}}}),l.createElement(a.Row,{className:"border-none",label:vl("WS_OWN_EMAIL_IDNO_LABEL"),text:null!=gl&&gl.includes("WS")?null==Ol||null===(jt=Ol.WaterConnection)||void 0===jt||null===(Vt=jt[0])||void 0===Vt||null===(zt=Vt.connectionHolders)||void 0===zt||null===(Yt=zt[0])||void 0===Yt?void 0:Yt.emailId:null==Ol||null===(Gt=Ol.SewerageConnections)||void 0===Gt||null===(qt=Gt[0])||void 0===qt||null===(Kt=qt.connectionHolders)||void 0===Kt||null===(Xt=Kt[0])||void 0===Xt?void 0:Xt.emailId,textStyle:{whiteSpace:"pre"},privacy:{uuid:null!=gl&&gl.includes("WS")?null==Ol||null===(Zt=Ol.WaterConnection)||void 0===Zt||null===($t=Zt[0])||void 0===$t||null===(Jt=$t.connectionHolders)||void 0===Jt||null===(Qt=Jt[0])||void 0===Qt?void 0:Qt.uuid:null==Ol||null===(el=Ol.SewerageConnections)||void 0===el||null===(nl=el[0])||void 0===nl||null===(tl=nl.connectionHolders)||void 0===tl||null===(ll=tl[0])||void 0===ll?void 0:ll.uuid,fieldName:"connectionHoldersEmailId",model:"WnSConnectionOwner",showValue:!1,loadData:{serviceName:"WATER"===zl?"/ws-services/wc/_search":"/sw-services/swc/_search",requestBody:{},requestParam:{tenantId:Sl,applicationNumber:gl},jsonPath:"WATER"===zl?"WaterConnection[0].connectionHolders[0].emailId":"SewerageConnections[0].connectionHolders[0].emailId",isArray:!1}}}))):l.createElement(a.CardText,null,vl("WS_PROPERTY_OWNER_SAME_AS_CONN_HOLDERS")),"inactive"===(null===(ol=Cl)||void 0===ol?void 0:ol.status)&&"Inactive"===(null===(il=Cl)||void 0===il?void 0:il.applicationStatus)&&"INACTIVE"===(null===(al=Cl)||void 0===al?void 0:al.applicationStatus)||xl?"DISCONNECTION_EXECUTED"==(null===(rl=Cl)||void 0===rl?void 0:rl.applicationStatus)&&"Inactive"==(null===(ul=Cl)||void 0===ul?void 0:ul.status)&&(null===(dl=Cl)||void 0===dl?void 0:dl.isDisconnectionTemporary)&&l.createElement(a.ActionBar,{style:{position:"relative",boxShadow:"none",minWidth:"240px",maxWidth:"310px",padding:"0px",marginTop:"15px"}},l.createElement("div",{style:{width:"100%"}},l.createElement(a.SubmitBar,{style:{width:"100%"},label:vl("WS_RECONNECTION_BUTTON"),onSubmit:function(){(()=>{var e,n,t,l,o,i,a,r,u,d,s;if(console.log("getRestorationButton",Ol,!(null!=Ol&&Ol.checkWorkFlow)),console.log("Payment",kl),null!=Ol&&Ol.checkWorkFlow){if(0===(null==kl||null===(e=kl.data)||void 0===e||null===(n=e.Bill)||void 0===n?void 0:n.length)){console.log("Payment",kl);let e="/digit-ui/citizen/ws/restoration-application";Digit.SessionStorage.set("WS_DISCONNECTION",v({},Cl,{serviceType:Fl?"SEWERAGE":"WATER"})),El.push(""+e)}else if((null==kl||null===(t=kl.data)||void 0===t||null===(l=t.Bill)||void 0===l||null===(o=l[0])||void 0===o?void 0:o.totalAmount)<0){let e="/digit-ui/citizen/ws/restore-application/restoration-application";Digit.SessionStorage.set("WS_DISCONNECTION",v({},Cl,{serviceType:Fl?"SEWERAGE":"WATER"})),El.push(""+e)}else if(0!==(null==kl||null===(i=kl.data)||void 0===i||null===(a=i.Bill)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.totalAmount))yl(!0);else if(0==(null==kl||null===(u=kl.data)||void 0===u||null===(d=u.Bill)||void 0===d||null===(s=d[0])||void 0===s?void 0:s.totalAmount)){let e="/digit-ui/citizen/ws/restore-application/restoration-application";Digit.SessionStorage.set("WS_DISCONNECTION",v({},Cl,{serviceType:Fl?"SEWERAGE":"WATER"})),El.push(""+e)}}else Tl({key:"error",label:"CONNECTION_INPROGRESS_LABEL"}),setTimeout(()=>{Pl()},5e3)})()}}))):l.createElement(a.ActionBar,{style:{position:"relative",boxShadow:"none",minWidth:"240px",maxWidth:"310px",padding:"0px",marginTop:"15px"}},l.createElement("div",{style:{width:"100%"}},l.createElement(a.SubmitBar,{style:{width:"100%"},label:vl("WS_DISCONNECTION_BUTTON"),onSubmit:function(){(()=>{var e,n,t,l,o,i,a,r;if(null!=Ol&&Ol.checkWorkFlow)if(0===(null==kl||null===(e=kl.data)||void 0===e||null===(n=e.Bill)||void 0===n?void 0:n.length)){let e="/digit-ui/citizen/ws/disconnect-application";Digit.SessionStorage.set("WS_DISCONNECTION",v({},Cl,{serviceType:Fl?"SEWERAGE":"WATER"})),El.push(""+e)}else if((null==kl||null===(t=kl.data)||void 0===t||null===(l=t.Bill)||void 0===l||null===(o=l[0])||void 0===o?void 0:o.totalAmount)<0){let e="/digit-ui/citizen/ws/disconnect-application";Digit.SessionStorage.set("WS_DISCONNECTION",v({},Cl,{serviceType:Fl?"SEWERAGE":"WATER"})),El.push(""+e)}else 0!==(null==kl||null===(i=kl.data)||void 0===i||null===(a=i.Bill)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.totalAmount)&&yl(!0);else Tl({key:"error",label:"CONNECTION_INPROGRESS_LABEL"}),setTimeout(()=>{Pl()},5e3)})()}}))),Nl?l.createElement(a.Modal,{open:Nl,headerBarMain:l.createElement(jl,{label:vl("WS_PENDING_DUES_LABEL")}),headerBarEnd:l.createElement(Vl,{onClick:()=>yl(!1)}),center:!0,formId:"modal-action",actionSingleLabel:vl("COMMON_MAKE_PAYMENT"),hideSubmit:!0,actionSingleSubmit:()=>{var e,n;El.push("/digit-ui/citizen/payment/collect/"+(Fl?"SW":"WS")+"/"+encodeURIComponent(null===(e=Cl)||void 0===e?void 0:e.connectionNo)+"/"+Sl+"?consumerCode="+(null===(n=Cl)||void 0===n?void 0:n.connectionNo)+"&&tenantId="+Sl+"&&workflow=WNS"),yl(!1)},popupStyles:hl?{width:"720px"}:{},style:hl?{minHeight:"45px",height:"auto",width:"44%"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:hl?{paddingLeft:"5px"}:{}},l.createElement("div",{className:"modal-header-ws"},vl("WS_CLEAR_DUES_DISCONNECTION_SUB_HEADER_LABEL")," "),l.createElement("div",{className:"modal-body-ws"},l.createElement("span",null,vl("WS_COMMON_TABLE_COL_AMT_DUE_LABEL"),": ₹",Number(null==kl||null===(sl=kl.data)||void 0===sl||null===(cl=sl.Bill[0])||void 0===cl?void 0:cl.totalAmount).toFixed(2))," ")):null),Dl&&l.createElement(a.Toast,{style:{bottom:"150px"},error:Dl.key,label:vl(""+Dl.label),onClose:Pl})));var Yl,Gl,ql,Kl},WSCitizenConsumptionDetails:e=>{var n,t;const{t:i}=o.useTranslation(),r=Digit.UserService.getUser(),u=(null===(n=Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY"))||void 0===n?void 0:n.code)||(null==r||null===(t=r.info)||void 0===t?void 0:t.permanentCity)||Digit.ULBService.getCurrentTenantId(),{applicationNo:d}=Digit.Hooks.useQueryParams();let s={tenantId:u,connectionNos:d};const{isLoading:c,data:v}=Digit.Hooks.ws.useWSConsumptionSearch({filters:s},{filters:s});if(c)return l.createElement(a.Loader,null);let{meterReadings:p}=v||{};return l.createElement(l.Fragment,null,l.createElement(a.Header,null,""+i("WS_VIEW_CONSUMPTION")),l.createElement("div",null,(null==p?void 0:p.length)>0&&p.map((e,n)=>{return l.createElement("div",{key:n},l.createElement(a.Card,null,l.createElement(a.StatusTable,null,l.createElement(a.Row,{className:"border-none",label:i("WS_MYCONNECTIONS_CONSUMER_NO"),text:(null==e?void 0:e.connectionNo)||i("NA"),textStyle:{}}),l.createElement(a.Row,{className:"border-none",label:i("WS_VIEW_BILL_BILLING_PERIOD_LABEL"),text:(null==e?void 0:e.billingPeriod)||i("NA"),textStyle:{wordBreak:"break-word"}}),l.createElement(a.Row,{className:"border-none",label:i("WS_CONSUMPTION_DETAILS_METER_STATUS_LABEL"),text:(null==e?void 0:e.meterStatus)||i("NA"),textStyle:{whiteSpace:"pre"}}),l.createElement(a.Row,{className:"border-none",label:i("WS_CONSUMPTION_DETAILS_LAST_READING_LABEL"),text:(null==e?void 0:e.lastReading)||i("NA"),textStyle:{whiteSpace:"pre"}}),l.createElement(a.Row,{className:"border-none",label:i("WS_CONSUMPTION_DETAILS_LAST_READING_DATE_LABEL"),text:Digit.DateUtils.ConvertEpochToDate(null==e?void 0:e.lastReadingDate)||i("NA"),textStyle:{whiteSpace:"pre"}}),l.createElement(a.Row,{className:"border-none",label:i("WS_CONSUMPTION_DETAILS_CURRENT_READING_LABEL"),text:(null==e?void 0:e.currentReading)||i("NA"),textStyle:{whiteSpace:"pre"}}),l.createElement(a.Row,{className:"border-none",label:i("WS_CONSUMPTION_DETAILS_CURRENT_READING_DATE_LABEL"),text:Digit.DateUtils.ConvertEpochToDate(null==e?void 0:e.currentReadingDate)||i("NA"),textStyle:{whiteSpace:"pre"}}),l.createElement(a.Row,{className:"border-none",label:i("WS_CONSUMPTION_DETAILS_CONSUMPTION_LABEL"),text:(t=null==e?void 0:e.currentReading,o=null==e?void 0:e.lastReading,t&&o?Number(t-o):i("NA")),textStyle:{whiteSpace:"pre"}}))));var t,o}),!(null!=p&&p.length)>0&&l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},i("WS_NO_CONSUMPTION_FOUND"))))},WSMyPayments:()=>{var e,n,t,i,r,u,d,s,c,p,m,E,S,_,f,g,C;const{t:N}=o.useTranslation(),y=Digit.UserService.getUser(),D=(null===(e=Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY"))||void 0===e?void 0:e.code)||(null==y||null===(n=y.info)||void 0===n?void 0:n.permanentCity)||Digit.ULBService.getCurrentTenantId();let T=window.location.href.split("/").pop(),h=isNaN(parseInt(T))?{tenantId:D,mobileNumber:null==y||null===(i=y.info)||void 0===i?void 0:i.mobileNumber,searchType:"CONNECTION"}:{tenantId:D,mobileNumber:null==y||null===(t=y.info)||void 0===t?void 0:t.mobileNumber,searchType:"CONNECTION"};const{isLoading:A,data:I}=Digit.Hooks.ws.useMyApplicationSearch({filters:h},{filters:h}),{isLoading:O,data:b}=Digit.Hooks.ws.useMyApplicationSearch({filters:h,BusinessService:"SW"},{filters:h});let L=null==I||null===(r=I.WaterConnection)||void 0===r?void 0:r.concat(null==b?void 0:b.SewerageConnections),R=I&&(null==I||null===(u=I.WaterConnection)||void 0===u?void 0:u.length)>0?null==I||null===(d=I.WaterConnection)||void 0===d?void 0:d.map(e=>e.connectionNo).join(","):null,w=b&&(null==b||null===(s=b.SewerageConnections)||void 0===s?void 0:s.length)>0?null==b||null===(c=b.SewerageConnections)||void 0===c?void 0:c.map(e=>e.connectionNo).join(","):null,W=I&&(null==I||null===(p=I.WaterConnection)||void 0===p?void 0:p.length)>0?null==I||null===(m=I.WaterConnection)||void 0===m?void 0:m.map(e=>e.propertyId).join(","):null,P=b&&(null==b||null===(E=b.SewerageConnections)||void 0===E?void 0:E.length)>0?null==b||null===(S=b.SewerageConnections)||void 0===S?void 0:S.map(e=>e.propertyId).join(","):null,M=W?null==W?void 0:W.concat(",",P):null==P?void 0:P.concat(",",W);const{data:x,isLoading:B}=Digit.Hooks.ws.useMypaymentWS({tenantId:D,filters:{consumerCodes:R},BusinessService:"WS"},{enabled:null!==R}),{data:F,isLoading:U}=Digit.Hooks.ws.useMypaymentWS({tenantId:D,filters:{consumerCodes:w},BusinessService:"SW"},{enabled:null!==w}),{data:k,isLoading:H}=Digit.Hooks.ws.useWaterPropertySearch({tenantId:D,filters:{propertyids:M}},{enabled:null!==w});if(A||B||U||O||H)return l.createElement(a.Loader,null);let V=(x&&(null==x?void 0:x.Payments)||[]).concat(F&&(null==F?void 0:F.Payments)||[]);return V=null===(_=V)||void 0===_?void 0:_.map(e=>{var n;return v({},e,{details:null==L||null===(n=L.filter(n=>{var t,l,o;return(null==n?void 0:n.connectionNo)===(null==e||null===(t=e.paymentDetails)||void 0===t||null===(l=t[0])||void 0===l||null===(o=l.bill)||void 0===o?void 0:o.consumerCode)}))||void 0===n?void 0:n[0]})}),V=null===(f=V)||void 0===f?void 0:f.map(e=>{var n,t;return v({},e,{property:null==k||null===(n=k.Properties)||void 0===n||null===(t=n.filter(n=>{var t;return(null==n?void 0:n.propertyId)===(null==e||null===(t=e.details)||void 0===t?void 0:t.propertyId)}))||void 0===t?void 0:t[0]})}),l.createElement(l.Fragment,null,l.createElement(a.Header,null,N("WS_MY_PAYMENTS_HEADER")+" "+(V?"("+V.length+")":"")),l.createElement(j,{t:N}),l.createElement("div",null,(null===(g=V)||void 0===g?void 0:g.length)>0&&V.map((e,n)=>l.createElement("div",{key:n},l.createElement(ji,{application:e}))),!(null!==(C=V)&&void 0!==C&&C.length)>0&&l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},N("PT_NO_APPLICATION_FOUND_MSG"))))},WSCitizenEditApplication:e=>{var n,r,u,s,c,p,m;const E=d.useQueryClient();let S=i.useRouteMatch();const{t:_}=o.useTranslation();let{tenantId:f}=i.useParams();const{pathname:g,state:C}=i.useLocation(),N=i.useHistory();let y=(null==C?void 0:C.id)||sessionStorage.getItem("ApplicationNoState"),D=[],T={},h={};const[A,I,O]=Digit.Hooks.useSessionStorage("WS_EDIT_APPLICATION",{}),b=Digit.ULBService.getStateId();let{data:L,isLoading:R}=Digit.Hooks.ws.useWSConfigMDMS.getFormConfig(b,{}),w={};y&&(w.applicationNumber=y),f&&(w.tenantId=f);const{data:W}=Digit.Hooks.ws.useWaterSearch({tenantId:f,filters:v({},w,{isInternalCall:!0}),BusinessService:"WS",t:_},{enabled:!(!y||!y.includes("WS"))}),{data:P}=Digit.Hooks.ws.useSewarageSearch({tenantId:f,filters:v({},w,{isInternalCall:!0}),BusinessService:"SW",t:_},{enabled:!(!y||!y.includes("SW"))});let M=window.location.href.includes("/modify-connection/")||window.location.href.includes("/edit-application/");t.useEffect(()=>{var e,n;if(T=W,h=P,(W&&T||P&&h)&&(!(Object.keys(A).length>0)||T&&(null==A?void 0:A.applicationNo)!==(null===(e=T)||void 0===e?void 0:e.applicationNo)||h&&(null==A?void 0:A.applicationNo)!==(null===(n=h)||void 0===n?void 0:n.applicationNo))){T=W,h=P,window.location.href.includes("edit-application")?(T&&(T.isEditApplication=!0,T.isModifyConnection=!1),h&&(h.isEditApplication=!0,h.isModifyConnection=!1)):window.location.href.includes("modify-connection")&&(T&&(T.isModifyConnection=!0,T.isEditApplication=!1),h&&(h.isModifyConnection=!0,h.isEditApplication=!1)),sessionStorage.setItem("WaterInitialObject",JSON.stringify(v({},T))),sessionStorage.setItem("SewerageInitialObject",JSON.stringify(v({},h)));let e=((e,n,t)=>{var l,o,i,a,r,u,d,s,c,p,m,E,S,_,f,g,C,N,y,D,T,h,A,I,O,b,L,R,w,W,P,M,x,B,F,U,k,H,j,V,z,Y,G,q,K,X,Z,$,J,Q,ee,ne,te,le,oe,ie,ae,re,ue,de,se,ce,ve,pe,me;if(e)e.ConnectionHolderDetails=null!=e&&e.connectionHolders?v({},null==e||null===(l=e.connectionHolders)||void 0===l?void 0:l[0],{address:null==e||null===(o=e.connectionHolders)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.correspondenceAddress,documentId:"",documentType:"",filestoreId:null,gender:null!=e&&null!==(a=e.connectionHolders)&&void 0!==a&&null!==(r=a[0])&&void 0!==r&&r.gender?{code:null==e||null===(u=e.connectionHolders)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.gender,i18nKey:"COMMON_GENDER_"+(null==e||null===(s=e.connectionHolders)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.gender)}:null,guardian:null==e||null===(p=e.connectionHolders)||void 0===p||null===(m=p[0])||void 0===m?void 0:m.fatherOrHusbandName,isOwnerSame:!((null==e||null===(E=e.connectionHolders)||void 0===E?void 0:E.length)>0),mobileNumber:null==e||null===(S=e.connectionHolders)||void 0===S||null===(_=S[0])||void 0===_?void 0:_.mobileNumber,name:null==e||null===(f=e.connectionHolders)||void 0===f||null===(g=f[0])||void 0===g?void 0:g.name,relationship:null!=e&&null!==(C=e.connectionHolders)&&void 0!==C&&null!==(N=C[0])&&void 0!==N&&N.relationship?{code:null==e||null===(y=e.connectionHolders)||void 0===y||null===(D=y[0])||void 0===D?void 0:D.relationship,i18nKey:"COMMON_MASTERS_OWNERTYPE_"+(null==e||null===(T=e.connectionHolders)||void 0===T||null===(h=T[0])||void 0===h?void 0:h.relationship)}:null,specialCategoryType:null!=e&&null!==(A=e.connectionHolders)&&void 0!==A&&null!==(I=A[0])&&void 0!==I&&I.ownerType?{code:null==e||null===(O=e.connectionHolders)||void 0===O||null===(b=O[0])||void 0===b?void 0:b.ownerType,i18nKey:"PROPERTYTAX_OWNERTYPE_"+(null==e||null===(L=e.connectionHolders)||void 0===L||null===(R=L[0])||void 0===R?void 0:R.ownerType)}:""}):{address:null==e||null===(w=e.property)||void 0===w||null===(W=w.owners)||void 0===W||null===(P=W[0])||void 0===P?void 0:P.correspondenceAddress,documentId:"",documentType:"",filestoreId:null,gender:null!=e&&null!==(M=e.property)&&void 0!==M&&null!==(x=M.owners)&&void 0!==x&&null!==(B=x[0])&&void 0!==B&&B.gender?{code:null==e||null===(F=e.property)||void 0===F||null===(U=F.owners)||void 0===U||null===(k=U[0])||void 0===k?void 0:k.gender,i18nKey:"COMMON_GENDER_"+(null==e||null===(H=e.property)||void 0===H||null===(j=H.owners)||void 0===j||null===(V=j[0])||void 0===V?void 0:V.gender)}:null,guardian:null==e||null===(z=e.property)||void 0===z||null===(Y=z.owners)||void 0===Y||null===(G=Y[0])||void 0===G?void 0:G.fatherOrHusbandName,isOwnerSame:null==e||!e.connectionHolders,mobileNumber:null==e||null===(q=e.property)||void 0===q||null===(K=q.owners)||void 0===K||null===(X=K[0])||void 0===X?void 0:X.mobileNumber,name:null==e||null===(Z=e.property)||void 0===Z||null===($=Z.owners)||void 0===$||null===(J=$[0])||void 0===J?void 0:J.name,relationship:null!=e&&null!==(Q=e.property)&&void 0!==Q&&null!==(ee=Q.owners)&&void 0!==ee&&null!==(ne=ee[0])&&void 0!==ne&&ne.relationship?{code:null==e||null===(te=e.property)||void 0===te||null===(le=te.owners)||void 0===le||null===(oe=le[0])||void 0===oe?void 0:oe.relationship,i18nKey:"COMMON_MASTERS_OWNERTYPE_"+(null==e||null===(ie=e.property)||void 0===ie||null===(ae=ie.owners)||void 0===ae||null===(re=ae[0])||void 0===re?void 0:re.relationship)}:null,specialCategoryType:null!=e&&null!==(ue=e.connectionHolders)&&void 0!==ue&&null!==(de=ue[0])&&void 0!==de&&de.ownerType?{code:null==e||null===(se=e.connectionHolders)||void 0===se||null===(ce=se[0])||void 0===ce?void 0:ce.ownerType,i18nKey:"PROPERTYTAX_OWNERTYPE_"+(null==e||null===(ve=e.connectionHolders)||void 0===ve||null===(pe=ve[0])||void 0===pe?void 0:pe.ownerType)}:""},e.WaterConnectionResult={WaterConnection:[v({},e)]},e.cpt={details:v({},null==e?void 0:e.property)},e.cptId={id:null==e?void 0:e.propertyId},e.documents={documents:null==e?void 0:e.documents},e.plumberPreference={plumberPreference:{code:"ULB",i18nKey:"WS_I_WOULD_PREFER_FROM_MUNICIPAL_OFFICE"}},e.serviceName=null!=e&&null!==(me=e.applicationType)&&void 0!==me&&me.includes("WATER")?{code:"WATER",i18nKey:"WS_WATER_CONNECTION_ONLY"}:{code:"SEWERAGE",i18nKey:"WS_SEWERAGE_CONNECTION_ONLY"},e.waterConectionDetails={proposedPipeSize:{code:null==e?void 0:e.proposedPipeSize,i18nKey:(null==e?void 0:e.proposedPipeSize)+" "+t("WS_INCHES_LABEL"),size:null==e?void 0:e.proposedPipeSize},proposedTaps:null==e?void 0:e.proposedTaps};else if(n){var Ee,Se,_e,fe,ge,Ce,Ne,ye,De,Te,he,Ae,Ie,Oe,be,Le,Re,we,We,Pe,Me,xe,Be,Fe,Ue,ke,He,je,Ve,ze,Ye,Ge,qe,Ke,Xe,Ze,$e,Je,Qe,en,nn,tn,ln,on,an,rn,un,dn,sn,cn,vn,pn,mn,En,Sn,_n,fn,gn,Cn,Nn,yn,Dn,Tn,hn;n.ConnectionHolderDetails=null!=n&&n.connectionHolders?v({},null==n||null===(Ee=n.connectionHolders)||void 0===Ee?void 0:Ee[0],{address:null==n||null===(Se=n.connectionHolders)||void 0===Se||null===(_e=Se[0])||void 0===_e?void 0:_e.correspondenceAddress,documentId:"",documentType:"",filestoreId:null,gender:null!=n&&null!==(fe=n.connectionHolders)&&void 0!==fe&&null!==(ge=fe[0])&&void 0!==ge&&ge.gender?{code:null==n||null===(Ce=n.connectionHolders)||void 0===Ce||null===(Ne=Ce[0])||void 0===Ne?void 0:Ne.gender,i18nKey:"COMMON_GENDER_"+(null==n||null===(ye=n.connectionHolders)||void 0===ye||null===(De=ye[0])||void 0===De?void 0:De.gender)}:null,guardian:null==n||null===(Te=n.connectionHolders)||void 0===Te||null===(he=Te[0])||void 0===he?void 0:he.fatherOrHusbandName,isOwnerSame:!((null==n||null===(Ae=n.connectionHolders)||void 0===Ae?void 0:Ae.length)>0),mobileNumber:null==n||null===(Ie=n.connectionHolders)||void 0===Ie||null===(Oe=Ie[0])||void 0===Oe?void 0:Oe.mobileNumber,name:null==n||null===(be=n.connectionHolders)||void 0===be||null===(Le=be[0])||void 0===Le?void 0:Le.name,relationship:null!=n&&null!==(Re=n.connectionHolders)&&void 0!==Re&&null!==(we=Re[0])&&void 0!==we&&we.relationship?{code:null==n||null===(We=n.connectionHolders)||void 0===We||null===(Pe=We[0])||void 0===Pe?void 0:Pe.relationship,i18nKey:"COMMON_MASTERS_OWNERTYPE_"+(null==n||null===(Me=n.connectionHolders)||void 0===Me||null===(xe=Me[0])||void 0===xe?void 0:xe.relationship)}:null,specialCategoryType:null!=n&&null!==(Be=n.connectionHolders)&&void 0!==Be&&null!==(Fe=Be[0])&&void 0!==Fe&&Fe.ownerType?{code:null==n||null===(Ue=n.connectionHolders)||void 0===Ue||null===(ke=Ue[0])||void 0===ke?void 0:ke.ownerType,i18nKey:"PROPERTYTAX_OWNERTYPE_"+(null==n||null===(He=n.connectionHolders)||void 0===He||null===(je=He[0])||void 0===je?void 0:je.ownerType)}:""}):{address:null==n||null===(Ve=n.property)||void 0===Ve||null===(ze=Ve.owners)||void 0===ze||null===(Ye=ze[0])||void 0===Ye?void 0:Ye.correspondenceAddress,documentId:"",documentType:"",filestoreId:null,gender:null!=n&&null!==(Ge=n.property)&&void 0!==Ge&&null!==(qe=Ge.owners)&&void 0!==qe&&null!==(Ke=qe[0])&&void 0!==Ke&&Ke.gender?{code:null==n||null===(Xe=n.property)||void 0===Xe||null===(Ze=Xe.owners)||void 0===Ze||null===($e=Ze[0])||void 0===$e?void 0:$e.gender,i18nKey:"COMMON_GENDER_"+(null==n||null===(Je=n.property)||void 0===Je||null===(Qe=Je.owners)||void 0===Qe||null===(en=Qe[0])||void 0===en?void 0:en.gender)}:null,guardian:null==n||null===(nn=n.property)||void 0===nn||null===(tn=nn.owners)||void 0===tn||null===(ln=tn[0])||void 0===ln?void 0:ln.fatherOrHusbandName,isOwnerSame:null==n||!n.connectionHolders,mobileNumber:null==n||null===(on=n.property)||void 0===on||null===(an=on.owners)||void 0===an||null===(rn=an[0])||void 0===rn?void 0:rn.mobileNumber,name:null==n||null===(un=n.property)||void 0===un||null===(dn=un.owners)||void 0===dn||null===(sn=dn[0])||void 0===sn?void 0:sn.name,relationship:null!=n&&null!==(cn=n.property)&&void 0!==cn&&null!==(vn=cn.owners)&&void 0!==vn&&null!==(pn=vn[0])&&void 0!==pn&&pn.relationship?{code:null==n||null===(mn=n.property)||void 0===mn||null===(En=mn.owners)||void 0===En||null===(Sn=En[0])||void 0===Sn?void 0:Sn.relationship,i18nKey:"COMMON_MASTERS_OWNERTYPE_"+(null==n||null===(_n=n.property)||void 0===_n||null===(fn=_n.owners)||void 0===fn||null===(gn=fn[0])||void 0===gn?void 0:gn.relationship)}:null,specialCategoryType:null!=n&&null!==(Cn=n.connectionHolders)&&void 0!==Cn&&null!==(Nn=Cn[0])&&void 0!==Nn&&Nn.ownerType?{code:null==n||null===(yn=n.connectionHolders)||void 0===yn||null===(Dn=yn[0])||void 0===Dn?void 0:Dn.ownerType,i18nKey:"PROPERTYTAX_OWNERTYPE_"+(null==n||null===(Tn=n.connectionHolders)||void 0===Tn||null===(hn=Tn[0])||void 0===hn?void 0:hn.ownerType)}:""},n.SewerageConnectionResult={SewerageConnections:[v({},n)]},n.cpt={details:v({},null==n?void 0:n.property)},n.cptId={id:null==n?void 0:n.propertyId},n.documents={documents:[...null==n?void 0:n.documents]},n.plumberPreference={plumberPreference:{code:"ULB",i18nKey:"WS_I_WOULD_PREFER_FROM_MUNICIPAL_OFFICE"}},n.serviceName=null!=n&&n.applicationType.includes("WATER")?{code:"WATER",i18nKey:"WS_WATER_CONNECTION_ONLY"}:{code:"SEWERAGE",i18nKey:"WS_SEWERAGE_CONNECTION_ONLY"},n.sewerageConnectionDetails={proposedToilets:null==n?void 0:n.proposedToilets,proposedWaterClosets:null==n?void 0:n.proposedWaterClosets}}return v({},e||n)})(T,h,_);I(v({},A,e))}},[W,P]);const x=(e,n,t,l)=>{I(l?n:""===e?v({},n):v({},A,{[e]:v({},A[e],n)})),(e=>{var n,t,l,o,i;const a=g.split("/").pop();let{nextStep:r}=D.find(e=>e.route===a),u=D.find(e=>e.route===a&&e);"object"==typeof r&&null!=r&&(!r[sessionStorage.getItem("KnowProperty")]||"search-property"!==r[sessionStorage.getItem("KnowProperty")]&&"create-property"!==r[sessionStorage.getItem("KnowProperty")]||(r=""+r[sessionStorage.getItem("KnowProperty")])),u[sessionStorage.getItem("serviceName")]&&(r=u[sessionStorage.getItem("serviceName")]),(null!=A&&null!==(n=A.cptId)&&void 0!==n&&n.id||null!=A&&null!==(t=A.cpt)&&void 0!==t&&null!==(l=t.details)&&void 0!==l&&l.propertyId||M&&null!=A&&null!==(o=A.cpt)&&void 0!==o&&null!==(i=o.details)&&void 0!==i&&i.propertyId)&&"know-your-property"===r&&(r="property-details"),"docsrequired"===r&&"yes"===sessionStorage.getItem("changePropertySelected")&&(r="property-details");let d=N.push;if(null===r)return d(Vi(S.path,S.params)+"/check");d(Vi(S.path,S.params)+"/"+r)})()},B=()=>{};if(L=null!==(n=L)&&void 0!==n&&n.WSCreateConfig?null===(r=L)||void 0===r?void 0:r.WSCreateConfig:Kl,null===(u=L)||void 0===u||u.forEach(e=>{D=D.concat(e.body.filter(e=>!e.hideInCitizen))}),D.indexRoute="property-details",(W&&Object.keys(W).length>0||!P)&&null!=W&&W.isLoading||null!=P&&P.isLoading||R)return l.createElement(a.Loader,null);const F=null===(s=Digit)||void 0===s||null===(c=s.ComponentRegistryService)||void 0===c?void 0:c.getComponent("WSCheckPage"),U=null===(p=Digit)||void 0===p||null===(m=p.ComponentRegistryService)||void 0===m?void 0:m.getComponent("WSAcknowledgement");return l.createElement(i.Switch,null,D.map((e,n)=>{const{component:t,texts:o,inputs:a,key:r,isSkipEnabled:u}=e,d="string"==typeof t?Digit.ComponentRegistryService.getComponent(t):t;return l.createElement(i.Route,{path:Vi(S.path,S.params)+"/"+e.route,key:n},l.createElement(d,{config:{texts:o,inputs:a,key:r,isSkipEnabled:u},onSelect:x,onSkip:B,t:_,formData:A,userType:"citizen"}))}),l.createElement(i.Route,{path:Vi(S.path,S.params)+"/check"},l.createElement(F,{onSubmit:function(){try{return N.push(Vi(S.path,S.params)+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:A})),l.createElement(i.Route,{path:Vi(S.path,S.params)+"/acknowledgement"},l.createElement(U,{data:A,onSuccess:()=>{E.invalidateQueries("WS_CREATE")},clearParams:O})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:Vi(S.path,S.params)+"/"+D.indexRoute})))},WSReSubmitDisconnectionApplication:()=>{var e,n,t;d.useQueryClient();const{t:a}=o.useTranslation(),r=i.useRouteMatch(),u=Digit.ULBService.getStateId();let s=[],{data:c}=Digit.Hooks.ws.useWSConfigMDMS.getFormConfig(u,{});return c=null!==(e=c)&&void 0!==e&&e.WSDisconnectionConfig?null===(n=c)||void 0===n?void 0:n.WSDisconnectionConfig:Zl,null===(t=c.filter(e=>"RE_SUBMIT_DISCONNECTION_APPLICATION"===e.head))||void 0===t||t.forEach(e=>{s=s.concat(e.body.filter(e=>!e.hideInCitizen))}),s.indexRoute="application-form",l.createElement(i.Switch,null,s.map((e,n)=>{const{component:t,texts:o,inputs:u,key:d,isSkipEnabled:s}=e,c="string"==typeof t?Digit.ComponentRegistryService.getComponent(t):t;return l.createElement(i.Route,{path:zi(r.path,r.params)+"/"+e.route,key:n},l.createElement(c,{config:{texts:o,inputs:u,key:d,isSkipEnabled:s},t:a,userType:"citizen"}))}),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:zi(r.path,r.params)+"/"+s.indexRoute})))},WNSMyBillsComponent:()=>{const{t:e}=o.useTranslation(),{path:n}=i.useRouteMatch(),a=t.useMemo(()=>Ki.map(n=>{const t={};for(const l in n.texts)t[l]=e(n.texts[l]);return v({},n,{texts:t})},[Ki]));return l.createElement(i.Switch,null,l.createElement(i.Route,{path:""+n,exact:!0},l.createElement(Xi,{template:a[0].labels,header:a[0].texts.header,actionButtonLabel:a[0].texts.actionButtonLabel,t:e})))},WSCheckPage:e=>{var n,t,r,u,d,s,c,v,p,m,E,S,_;let{onSubmit:f,value:g}=e;const{t:C}=o.useTranslation();i.useHistory(),i.useRouteMatch();let N=window.Digit.Utils.browser.isMobile();const{ConnectionHolderDetails:y,serviceName:D,waterConectionDetails:T,sewerageConnectionDetails:h,documents:A,cpt:I}=g;let O="/digit-ui/citizen/ws/create-application";function b(e){location.href=e}window.location.href.includes("/edit-application/")&&(O="/digit-ui/citizen/ws/edit-application/"+(null==g?void 0:g.tenantId));let L=[];var R,w,W,P,M,x,B,F,U,k,H,j,V,z,Y,G,q,K,X,Z,$,J,Q,ee,ne;I&&null!=I&&I.details&&Object.keys(null==I?void 0:I.details).length>0&&(null!=I&&null!==(R=I.details)&&void 0!==R&&null!==(w=R.address)&&void 0!==w&&w.doorNo&&L.push(null==I||null===(V=I.details)||void 0===V||null===(z=V.address)||void 0===z?void 0:z.doorNo),null!=I&&null!==(W=I.details)&&void 0!==W&&null!==(P=W.address)&&void 0!==P&&P.street&&L.push(null==I||null===(Y=I.details)||void 0===Y||null===(G=Y.address)||void 0===G?void 0:G.street),null!=I&&null!==(M=I.details)&&void 0!==M&&null!==(x=M.address)&&void 0!==x&&x.landmark&&L.push(null==I||null===(q=I.details)||void 0===q||null===(K=q.address)||void 0===K?void 0:K.landmark),null!=I&&null!==(B=I.details)&&void 0!==B&&null!==(F=B.address)&&void 0!==F&&null!==(U=F.locality)&&void 0!==U&&U.code&&L.push(C(Digit.Utils.pt.getMohallaLocale(null==I||null===(X=I.details)||void 0===X||null===(Z=X.address)||void 0===Z||null===($=Z.locality)||void 0===$?void 0:$.code,null==I||null===(J=I.details)||void 0===J?void 0:J.tenantId))),null!=I&&null!==(k=I.details)&&void 0!==k&&k.tenantId&&L.push(C(Digit.Utils.pt.getCityLocale(null==I||null===(Q=I.details)||void 0===Q?void 0:Q.tenantId))),null!=I&&null!==(H=I.details)&&void 0!==H&&null!==(j=H.address)&&void 0!==j&&j.pincode&&L.push(null==I||null===(ee=I.details)||void 0===ee||null===(ne=ee.address)||void 0===ne?void 0:ne.pincode));const te=Array.isArray(null==I||null===(n=I.details)||void 0===n?void 0:n.owners)?null==I||null===(t=I.details)||void 0===t?void 0:t.owners.slice().reverse():[];return l.createElement(l.Fragment,null,l.createElement(Te,{currentStep:4}),l.createElement(a.Header,{styles:{fontSize:"32px"}},C("WS_COMMON_SUMMARY")),l.createElement(a.Card,{style:{paddingRight:"16px"}},l.createElement(a.CardHeader,{styles:{fontSize:"28px"}},C("WS_BASIC_DETAILS_HEADER")),l.createElement(a.StatusTable,null,l.createElement(a.Row,{className:"border-none",label:C("WS_PROPERTY_ID_LABEL"),text:null==I||null===(r=I.details)||void 0===r?void 0:r.propertyId}),l.createElement(a.Row,{className:"border-none",label:C("WS_OWNERS_NAME_LABEL"),text:C(null===(u=te[0])||void 0===u?void 0:u.name)}),l.createElement(a.Row,{className:"border-none",label:C("WS_COMMON_TABLE_COL_ADDRESS"),text:L.join(", ")}),l.createElement(a.Row,{className:"border-none",label:C("WS_CONNECTION_DETAILS_STATUS_LABEL"),text:C(null==I||null===(d=I.details)||void 0===d?void 0:d.status)})),l.createElement("div",{style:{textAlign:"left"}},l.createElement(i.Link,{to:"/digit-ui/citizen/commonpt/view-property?propertyId="+(null==I||null===(s=I.details)||void 0===s?void 0:s.propertyId)+"&tenantId="+(null==I||null===(c=I.details)||void 0===c?void 0:c.tenantId)},l.createElement(a.LinkButton,{style:{textAlign:"left"},label:C("PT_VIEW_PROPERTY")})))),l.createElement(a.Card,{style:{paddingRight:"16px"}},l.createElement("div",{style:{position:"relative"}},l.createElement(a.CardHeader,{styles:{fontSize:"28px"}},C("WS_COMMON_CONNECTION_HOLDER_DETAILS_HEADER")),l.createElement(a.LinkButton,{label:l.createElement(a.EditIcon,{style:{marginTop:"-10px",float:"right",position:"relative",bottom:"32px",marginRight:"-10px"}}),style:{width:"100px",display:"inline"},onClick:()=>b(O+"/connection-holder")})),l.createElement(a.StatusTable,null,l.createElement(a.Row,{className:"border-none",textStyle:N?{marginRight:"-5px"}:{},label:C("WS_OWN_MOBILE_NO"),text:null==y?void 0:y.mobileNumber}),l.createElement(a.Row,{className:"border-none",label:C("WS_OWN_DETAIL_NAME"),text:null==y?void 0:y.name}),l.createElement(a.Row,{className:"border-none",label:C("WS_OWN_DETAIL_GENDER_LABEL"),text:C(null==y||null===(v=y.gender)||void 0===v?void 0:v.i18nKey)||C("CS_NA")}),l.createElement(a.Row,{className:"border-none",label:C("WS_FATHERS_HUSBAND_NAME"),text:(null==y?void 0:y.guardian)||C("CS_NA")}),l.createElement(a.Row,{className:"border-none",label:C("WS_CONN_HOLDER_OWN_DETAIL_RELATION_LABEL"),text:C(null==y||null===(p=y.relationship)||void 0===p?void 0:p.i18nKey)||C("CS_NA")}),l.createElement(a.Row,{className:"border-none",label:C("WS_OWN_DETAIL_CROSADD"),text:(null==y?void 0:y.address)||C("CS_NA")}),l.createElement(a.Row,{className:"border-none",label:C("WS_OWN_DETAIL_SPECIAL_APPLICANT_LABEL"),text:C(null==y||null===(m=y.specialCategoryType)||void 0===m?void 0:m.i18nKey)||C("CS_NA")}),l.createElement(a.Row,{className:"border-none",label:C("WS_EMAIL_ID"),text:(null==y?void 0:y.emailId)||C("CS_NA")}))),l.createElement(a.Card,{style:{paddingRight:"16px"}},l.createElement("div",{style:{position:"relative"}},l.createElement(a.CardHeader,{styles:{fontSize:"28px"}},C("WS_COMMON_CONNECTION_DETAIL")),l.createElement(a.LinkButton,{label:l.createElement(a.EditIcon,{style:{marginTop:"-10px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>b(O+"/service-name")})),l.createElement(a.StatusTable,null,l.createElement(a.Row,{className:"border-none",textStyle:N?{marginRight:"-10px"}:{},label:C("WS_SERVICE_NAME_LABEL"),text:C(null==D?void 0:D.i18nKey)}),T&&(null===(E=Object.keys(T))||void 0===E?void 0:E.length)>0&&l.createElement("div",null,l.createElement(a.Row,{className:"border-none",label:C("WS_NO_OF_TAPS_PROPOSED"),text:null==T?void 0:T.proposedTaps}),l.createElement(a.Row,{className:"border-none",label:C("WS_SERV_DETAIL_PIPE_SIZE"),text:C(null==T||null===(S=T.proposedPipeSize)||void 0===S?void 0:S.i18nKey)})),h&&(null===(_=Object.keys(h))||void 0===_?void 0:_.length)>0&&l.createElement("div",null,l.createElement(a.Row,{className:"border-none",label:C("WS_NO_OF_WATER_CLOSETS"),text:null==h?void 0:h.proposedWaterClosets}),l.createElement(a.Row,{className:"border-none",label:C("WS_SERV_DETAIL_NO_OF_TOILETS"),text:null==h?void 0:h.proposedToilets})))),l.createElement(a.Card,{style:{paddingRight:"16px"}},l.createElement("div",{style:{position:"relative"}},l.createElement(a.CardHeader,{styles:{fontSize:"28px"}},C("WS_COMMON_DOCUMENT_DETAILS")),l.createElement(a.LinkButton,{label:l.createElement(a.EditIcon,{style:{marginTop:"-10px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>b(O+"/document-details")})),A&&(null==A?void 0:A.documents.map((e,n)=>{var t;return l.createElement("div",{key:"doc-"+n},l.createElement("div",null,l.createElement(a.CardSectionHeader,null,C(null==e||null===(t=e.documentType)||void 0===t?void 0:t.split(".").slice(0,2).join("_"))),l.createElement(a.StatusTable,null,l.createElement(Li,{value:g,Code:null==e?void 0:e.documentType,index:n}),(null==A?void 0:A.documents.length)!=n+1?l.createElement("hr",{style:{color:"white",backgroundColor:"white",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null)))}))),l.createElement(a.SubmitBar,{label:C("CS_COMMON_SUBMIT"),onSubmit:f,style:{marginLeft:"10px",maxWidth:"95%"}}))},WSAcknowledgement:e=>{var n,r,u,d,s,c,p,m,E,S;let{data:_,onSuccess:f,clearParams:g}=e;const{t:C}=o.useTranslation(),[y,D,T]=Digit.Hooks.useSessionStorage("CITIZEN_TL_MUTATION_HAPPENED",!1),h=(Digit.ULBService.getCurrentTenantId(),Digit.Hooks.ws.useWSUpdateAPI("WATER")),A=Digit.Hooks.ws.useWSUpdateAPI("SEWERAGE");let I=window.location.href.includes("/edit-application/")||window.location.href.includes("/modify-connection/");const{data:O}=Digit.Hooks.useStore.getInitData(),{tenants:b}=O||{};return Digit.ULBService.getStateId(),t.useEffect(()=>{"true"!==sessionStorage.getItem("isCreateEnabled")?window.history.forward():sessionStorage.removeItem("isCreateEnabled")}),t.useEffect(()=>{try{var e,n;let o;if("WATER"===(null==_||null===(e=_.serviceName)||void 0===e?void 0:e.code)||"BOTH"===(null==_||null===(n=_.serviceName)||void 0===n?void 0:n.code)){var t,l;o=(null==_||null===(t=_.cpt)||void 0===t||null===(l=t.details)||void 0===l?void 0:l.tenantId)||o;let e=I?(e=>{var n,t,l,o,i,a,r,u,d,s,c,p,m,E,S,_,f,g,C,y,D,T,h,A,I,O,b,L,R,w,W,P;let M=null==e||null===(n=e.WaterConnectionResult)||void 0===n||null===(t=n.WaterConnection)||void 0===t?void 0:t[0],x={WaterConnection:{id:null!=e&&e.isEditApplication?null==e?void 0:e.id:null==M?void 0:M.id,tenantId:null!=e&&e.isEditApplication?null==e?void 0:e.tenantId:null==M?void 0:M.tenantId,propertyId:null!=e&&e.isEditApplication?null==e?void 0:e.propertyId:null==M?void 0:M.propertyId,applicationNo:null!=e&&e.isEditApplication?null==e?void 0:e.applicationNo:null==M?void 0:M.applicationNo,applicationStatus:null!=e&&e.isEditApplication?null==e?void 0:e.applicationStatus:null==M?void 0:M.applicationStatus,status:null!=e&&e.isEditApplication?null==e?void 0:e.status:null==M?void 0:M.status,connectionNo:(null!=e&&e.isEditApplication?null==e?void 0:e.connectionNo:null==M?void 0:M.connectionNo)||null,oldConnectionNo:null,documents:[...null==e||null===(l=e.documents)||void 0===l?void 0:l.documents],plumberInfo:null!=e&&e.isEditApplication?null==e?void 0:e.plumberInfo:(null==M?void 0:M.plumberInfo)||[],roadType:null,roadCuttingArea:null,roadCuttingInfo:[],connectionExecutionDate:(null!=e&&e.isEditApplication?null==e?void 0:e.connectionExecutionDate:null==M?void 0:M.connectionExecutionDate)||null,connectionCategory:null,connectionType:(null!=e&&e.isEditApplication?null==e?void 0:e.connectionType:null==M?void 0:M.connectionType)||null,additionalDetails:v({},null!=e&&e.isEditApplication?null==e?void 0:e.additionalDetails:null==M?void 0:M.additionalDetails),auditDetails:null!=e&&e.isEditApplication?null==e?void 0:e.auditDetails:null==M?void 0:M.auditDetails,processInstance:null!=e&&e.isEditApplication?v({},null==e?void 0:e.processInstance,{action:"RESUBMIT_APPLICATION"}):v({},null==M?void 0:M.processInstance,{action:"SUBMIT_APPLICATION"}),applicationType:null!=e&&e.isEditApplication?null==e?void 0:e.applicationType:"MODIFY_WATER_CONNECTION",dateEffectiveFrom:N(Date.now()+864e5),connectionHolders:null!=e&&e.isEditApplication?null!=e&&null!==(o=e.ConnectionHolderDetails)&&void 0!==o&&o.isOwnerSame?null:[{correspondenceAddress:(null==e||null===(i=e.ConnectionHolderDetails)||void 0===i?void 0:i.address)||"",fatherOrHusbandName:(null==e||null===(a=e.ConnectionHolderDetails)||void 0===a?void 0:a.guardian)||"",gender:(null==e||null===(r=e.ConnectionHolderDetails)||void 0===r||null===(u=r.gender)||void 0===u?void 0:u.code)||"",mobileNumber:(null==e||null===(d=e.ConnectionHolderDetails)||void 0===d?void 0:d.mobileNumber)||"",name:(null==e||null===(s=e.ConnectionHolderDetails)||void 0===s?void 0:s.name)||"",emailId:(null==e||null===(c=e.ConnectionHolderDetails)||void 0===c?void 0:c.emailId)||"",ownerType:(null==e||null===(p=e.ConnectionHolderDetails)||void 0===p||null===(m=p.specialCategoryType)||void 0===m?void 0:m.code)||"",relationship:(null==e||null===(E=e.ConnectionHolderDetails)||void 0===E||null===(S=E.relationship)||void 0===S?void 0:S.code)||"",sameAsPropertyAddress:null==e||null===(_=e.ConnectionHolderDetails)||void 0===_?void 0:_.sameAsOwnerDetails}]:null==M?void 0:M.connectionHolders,oldApplication:!1,channel:"CITIZEN",waterSource:(null!=e&&e.isEditApplication?null==e?void 0:e.waterSource:null==M?void 0:M.waterSource)||null,meterId:(null!=e&&e.isEditApplication?null==e?void 0:e.meterId:null==M?void 0:M.meterId)||null,meterInstallationDate:(null!=e&&e.isEditApplication?null==e?void 0:e.meterInstallationDate:null==M?void 0:M.meterInstallationDate)||null,proposedPipeSize:null==e||null===(f=e.waterConectionDetails)||void 0===f||null===(g=f.proposedPipeSize)||void 0===g?void 0:g.code,proposedTaps:null==e||null===(C=e.waterConectionDetails)||void 0===C?void 0:C.proposedTaps,pipeSize:(null!=e&&e.isEditApplication?null==e?void 0:e.pipeSize:null==M?void 0:M.pipeSize)||null,noOfTaps:(null!=e&&e.isEditApplication?null==e?void 0:e.noOfTaps:null==M?void 0:M.noOfTaps)||null,waterSourceSubSource:null,waterSubSource:(null!=e&&e.isEditApplication?null==e?void 0:e.waterSubSource:null==M?void 0:M.waterSubSource)||null,property:v({},null!=e&&e.isEditApplication?null==e?void 0:e.property:null==M?void 0:M.property),water:!(null==e||null===(y=e.applicationType)||void 0===y||!y.includes("WATER")),sewerage:!(null==e||null===(D=e.applicationType)||void 0===D||!D.includes("WATER")),service:null!=e&&e.isEditApplication?null==e||null===(T=e.serviceName)||void 0===T?void 0:T.code:null==M||null===(h=M.serviceName)||void 0===h?void 0:h.code,reviewDocData:[...null==e||null===(A=e.documents)||void 0===A?void 0:A.documents],proposedWaterClosets:null==e||null===(I=e.sewerageConnectionDetails)||void 0===I?void 0:I.proposedWaterClosets,proposedToilets:null==e||null===(O=e.sewerageConnectionDetails)||void 0===O?void 0:O.proposedToilets,comment:"",wfDocuments:[],assignee:[],action:null!=e&&e.isEditApplication?"RESUBMIT_APPLICATION":"SUBMIT_APPLICATION",assignes:[]}};return x=null!==(b=Digit)&&void 0!==b&&null!==(L=b.Customizations)&&void 0!==L&&null!==(R=L.WS)&&void 0!==R&&R.customiseEditWSUpdate?null===(w=Digit)||void 0===w||null===(W=w.Customizations)||void 0===W||null===(P=W.WS)||void 0===P?void 0:P.customiseEditWSUpdate(e,x):x,x})(_):(e=>{var n,t,l,o,i,a,r,u,d;let s={WaterConnection:v({},null==e||null===(n=e.WaterConnectionResult)||void 0===n||null===(t=n.WaterConnection)||void 0===t?void 0:t[0],{documents:[...null==e||null===(l=e.documents)||void 0===l?void 0:l.documents],processInstance:{action:"SUBMIT_APPLICATION"}})};return s=null!==(o=Digit)&&void 0!==o&&null!==(i=o.Customizations)&&void 0!==i&&null!==(a=i.WS)&&void 0!==a&&a.customiseWSUpdate?null===(r=Digit)||void 0===r||null===(u=r.Customizations)||void 0===u||null===(d=u.WS)||void 0===d?void 0:d.customiseWSUpdate(e,s):s,s})(_);const n=v({},e,{disconnectRequest:!1,reconnectRequest:!1});h.mutate(n,{onSuccess:f})}}catch(e){}},[_]),t.useEffect(()=>{var e,n;if("SEWERAGE"===(null==_||null===(e=_.serviceName)||void 0===e?void 0:e.code)||"BOTH"===(null==_||null===(n=_.serviceName)||void 0===n?void 0:n.code)&&h.isSuccess){let e=I?(e=>{var n,t,l,o,i,a,r,u,d,s,c,p,m,E,S,_,f,g,C,y,D,T,h,A,I,O,b,L,R,w,W,P;let M=null==e||null===(n=e.SewerageConnectionResult)||void 0===n||null===(t=n.SewerageConnections)||void 0===t?void 0:t[0],x={SewerageConnection:{id:null!=e&&e.isEditApplication?null==e?void 0:e.id:null==M?void 0:M.id,tenantId:null!=e&&e.isEditApplication?null==e?void 0:e.tenantId:null==M?void 0:M.tenantId,propertyId:null!=e&&e.isEditApplication?null==e?void 0:e.propertyId:null==M?void 0:M.propertyId,applicationNo:null!=e&&e.isEditApplication?null==e?void 0:e.applicationNo:null==M?void 0:M.applicationNo,applicationStatus:null!=e&&e.isEditApplication?null==e?void 0:e.applicationStatus:null==M?void 0:M.applicationStatus,status:null!=e&&e.isEditApplication?null==e?void 0:e.status:null==M?void 0:M.status,connectionNo:(null!=e&&e.isEditApplication?null==e?void 0:e.connectionNo:null==M?void 0:M.connectionNo)||null,oldConnectionNo:null,documents:[...null==e||null===(l=e.documents)||void 0===l?void 0:l.documents],plumberInfo:null!=e&&e.isEditApplication?null==e?void 0:e.plumberInfo:(null==M?void 0:M.plumberInfo)||[],roadType:null,roadCuttingArea:null,roadCuttingInfo:[],connectionExecutionDate:(null!=e&&e.isEditApplication?null==e?void 0:e.connectionExecutionDate:null==M?void 0:M.connectionExecutionDate)||null,connectionCategory:null,connectionType:(null!=e&&e.isEditApplication?null==e?void 0:e.connectionType:null==M?void 0:M.connectionType)||null,additionalDetails:v({},null!=e&&e.isEditApplication?null==e?void 0:e.additionalDetails:null==M?void 0:M.additionalDetails),auditDetails:null!=e&&e.isEditApplication?null==e?void 0:e.auditDetails:null==M?void 0:M.auditDetails,processInstance:null!=e&&e.isEditApplication?v({},null==e?void 0:e.processInstance,{action:"RESUBMIT_APPLICATION"}):v({},null==M?void 0:M.processInstance,{action:"SUBMIT_APPLICATION"}),applicationType:null!=e&&e.isEditApplication?null==e?void 0:e.applicationType:"MODIFY_WATER_CONNECTION",dateEffectiveFrom:N(Date.now()+864e5),connectionHolders:null!=e&&e.isEditApplication?null!=e&&null!==(o=e.ConnectionHolderDetails)&&void 0!==o&&o.isOwnerSame?null:[{correspondenceAddress:(null==e||null===(i=e.ConnectionHolderDetails)||void 0===i?void 0:i.address)||"",fatherOrHusbandName:(null==e||null===(a=e.ConnectionHolderDetails)||void 0===a?void 0:a.guardian)||"",gender:(null==e||null===(r=e.ConnectionHolderDetails)||void 0===r||null===(u=r.gender)||void 0===u?void 0:u.code)||"",mobileNumber:(null==e||null===(d=e.ConnectionHolderDetails)||void 0===d?void 0:d.mobileNumber)||"",name:(null==e||null===(s=e.ConnectionHolderDetails)||void 0===s?void 0:s.name)||"",emailId:(null==e||null===(c=e.ConnectionHolderDetails)||void 0===c?void 0:c.emailId)||"",ownerType:(null==e||null===(p=e.ConnectionHolderDetails)||void 0===p||null===(m=p.specialCategoryType)||void 0===m?void 0:m.code)||"",relationship:(null==e||null===(E=e.ConnectionHolderDetails)||void 0===E||null===(S=E.relationship)||void 0===S?void 0:S.code)||"",sameAsPropertyAddress:null==e||null===(_=e.ConnectionHolderDetails)||void 0===_?void 0:_.sameAsOwnerDetails}]:null==M?void 0:M.connectionHolders,oldApplication:!1,channel:"CITIZEN",waterSource:(null!=e&&e.isEditApplication?null==e?void 0:e.waterSource:null==M?void 0:M.waterSource)||null,meterId:(null!=e&&e.isEditApplication?null==e?void 0:e.meterId:null==M?void 0:M.meterId)||null,meterInstallationDate:(null!=e&&e.isEditApplication?null==e?void 0:e.meterInstallationDate:null==M?void 0:M.meterInstallationDate)||null,proposedPipeSize:null==e||null===(f=e.waterConectionDetails)||void 0===f||null===(g=f.proposedPipeSize)||void 0===g?void 0:g.code,proposedTaps:null==e||null===(C=e.waterConectionDetails)||void 0===C?void 0:C.proposedTaps,pipeSize:(null!=e&&e.isEditApplication?null==e?void 0:e.pipeSize:null==M?void 0:M.pipeSize)||null,noOfTaps:(null!=e&&e.isEditApplication?null==e?void 0:e.noOfTaps:null==M?void 0:M.noOfTaps)||null,waterSourceSubSource:null,waterSubSource:(null!=e&&e.isEditApplication?null==e?void 0:e.waterSubSource:null==M?void 0:M.waterSubSource)||null,property:v({},null!=e&&e.isEditApplication?null==e?void 0:e.property:null==M?void 0:M.property),water:!(null==e||null===(y=e.applicationType)||void 0===y||!y.includes("WATER")),sewerage:!(null==e||null===(D=e.applicationType)||void 0===D||!D.includes("WATER")),service:null!=e&&e.isEditApplication?null==e||null===(T=e.serviceName)||void 0===T?void 0:T.code:null==M||null===(h=M.serviceName)||void 0===h?void 0:h.code,reviewDocData:[...null==e||null===(A=e.documents)||void 0===A?void 0:A.documents],proposedWaterClosets:null==e||null===(I=e.sewerageConnectionDetails)||void 0===I?void 0:I.proposedWaterClosets,proposedToilets:null==e||null===(O=e.sewerageConnectionDetails)||void 0===O?void 0:O.proposedToilets,comment:"",wfDocuments:[],assignee:[],action:null!=e&&e.isEditApplication?"RESUBMIT_APPLICATION":"SUBMIT_APPLICATION",assignes:[]}};return x=null!==(b=Digit)&&void 0!==b&&null!==(L=b.Customizations)&&void 0!==L&&null!==(R=L.WS)&&void 0!==R&&R.customiseEditSWUpdate?null===(w=Digit)||void 0===w||null===(W=w.Customizations)||void 0===W||null===(P=W.WS)||void 0===P?void 0:P.customiseEditSWUpdate(e,x):x,x})(_):(e=>{var n,t,l,o,i,a,r,u,d;let s={SewerageConnection:v({},null==e||null===(n=e.SewerageConnectionResult)||void 0===n||null===(t=n.SewerageConnections)||void 0===t?void 0:t[0],{connectionType:"Non Metered",documents:[...null==e||null===(l=e.documents)||void 0===l?void 0:l.documents],processInstance:{action:"SUBMIT_APPLICATION"}})};return s=null!==(o=Digit)&&void 0!==o&&null!==(i=o.Customizations)&&void 0!==i&&null!==(a=i.WS)&&void 0!==a&&a.customiseSWUpdate?null===(r=Digit)||void 0===r||null===(u=r.Customizations)||void 0===u||null===(d=u.WS)||void 0===d?void 0:d.customiseSWUpdate(e,s):s,s})(_);const n=v({},e,{disconnectRequest:!1,reconnectRequest:!1});A.mutate(n,{onSuccess:f})}},[_,h.isSuccess]),("WATER"===(null==_||null===(n=_.serviceName)||void 0===n?void 0:n.code)?h.isLoading||h.isIdle:"SEWERAGE"===(null==_||null===(r=_.serviceName)||void 0===r?void 0:r.code)?A.isLoading||A.isIdle:h.isLoading||h.isIdle||A.isLoading||A.isIdle)?l.createElement(a.Loader,null):l.createElement(a.Card,null,l.createElement(qi,{t:C,clearParams:g,Waterdata:h.data,Seweragedata:A.data,isSuccess:"WATER"===(null==_||null===(u=_.serviceName)||void 0===u?void 0:u.code)?h.isSuccess:A.isSuccess,isLoading:"WATER"===(null==_||null===(d=_.serviceName)||void 0===d?void 0:d.code)?h.isLoading||h.isIdle:"SEWERAGE"===(null==_||null===(s=_.serviceName)||void 0===s?void 0:s.code)?A.isLoading||A.isIdle:h.isLoading||h.isIdle||A.isLoading||A.isIdle}),("WATER"===(null==_||null===(c=_.serviceName)||void 0===c?void 0:c.code)?h.isSuccess:A.isSuccess)&&l.createElement(a.CardText,null,C("WS_FILE_RESPONSE")),("WATER"===(null==_||null===(p=_.serviceName)||void 0===p?void 0:p.code)||"BOTH"===(null==_||null===(m=_.serviceName)||void 0===m?void 0:m.code))&&h.isSuccess&&l.createElement(a.LinkButton,{label:l.createElement("div",{className:"response-download-button"},l.createElement("span",null,l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"#a82227"},l.createElement("path",{d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"}))),l.createElement("span",{className:"download-button"},C("WS_PRINT_WATER_APPLICATION_LABEL"))),onClick:()=>{var e,n,t;const l=null==h||null===(e=h.data)||void 0===e||null===(n=e.WaterConnection)||void 0===n?void 0:n[0],o=b.find(e=>{var n,t;return e.code===(null==_||null===(n=_.cpt)||void 0===n||null===(t=n.details)||void 0===t?void 0:t.tenantId)});Z(v({},l),v({},null==_||null===(t=_.cpt)||void 0===t?void 0:t.details),null==o?void 0:o.code,C).then(e=>Digit.Utils.pdf.generatev1(e))}}),("SEWERAGE"===(null==_||null===(E=_.serviceName)||void 0===E?void 0:E.code)||"BOTH"===(null==_||null===(S=_.serviceName)||void 0===S?void 0:S.code))&&A.isSuccess&&l.createElement(a.LinkButton,{label:l.createElement("div",{className:"response-download-button"},l.createElement("span",null,l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"#a82227"},l.createElement("path",{d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"}))),l.createElement("span",{className:"download-button"},C("WS_PRINT_SEWERAGE_APPLICATION_LABEL"))),onClick:()=>{var e,n,t;const l=null==A||null===(e=A.data)||void 0===e||null===(n=e.SewerageConnections)||void 0===n?void 0:n[0],o=b.find(e=>{var n,t;return e.code===(null==_||null===(n=_.cpt)||void 0===n||null===(t=n.details)||void 0===t?void 0:t.tenantId)});Z(v({},l),v({},null==_||null===(t=_.cpt)||void 0===t?void 0:t.details),null==o?void 0:o.code,C).then(e=>Digit.Utils.pdf.generatev1(e))}}),l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen"}},l.createElement(a.SubmitBar,{label:C("CORE_COMMON_GO_TO_HOME")})))},WSDisconnectionCheckPage:()=>{const{t:e}=o.useTranslation(),n=i.useHistory(),r=(i.useRouteMatch(),Digit.SessionStorage.get("WS_DISCONNECTION")),[u,d]=t.useState(r.WSDisconnectionForm.documents||[]);let s="/digit-ui/citizen/ws/disconnect-application";function c(e){location.href=e}window.location.href.includes("/edit-application/")&&(s="/digit-ui/citizen/ws/edit-disconnect-application");const[p,m]=t.useState(!1),{mutate:E}=Digit.Hooks.ws.useWaterCreateAPI("WATER"),{mutate:S}=Digit.Hooks.ws.useWSApplicationActions("WATER"),{mutate:_}=Digit.Hooks.ws.useWaterCreateAPI("SEWERAGE"),{mutate:g}=Digit.Hooks.ws.useWSApplicationActions("SEWERAGE"),C=()=>{setShowToast(null)};return p?l.createElement(a.Loader,null):l.createElement(l.Fragment,null,l.createElement(a.Header,{styles:{fontSize:"32px"}},e("WS_COMMON_SUMMARY")),l.createElement(Ft,{currentStep:3}),l.createElement(a.Card,{style:{paddingRight:"16px"}},l.createElement("div",{style:{display:"inline"}},l.createElement(a.CardHeader,{styles:{fontSize:"28px"}},e("WS_DISCONNECTION_APPLICATION_DETAILS")),l.createElement(a.LinkButton,{label:l.createElement(a.EditIcon,{style:{marginTop:"-20px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>c(s+"/application-form")})),l.createElement(a.StatusTable,null,l.createElement(a.Row,{className:"border-none",label:e("WS_DISCONNECTION_CONSUMER_NUMBER"),text:r.connectionNo}),l.createElement(a.Row,{className:"border-none",label:e("WS_DISCONNECTION_TYPE"),text:e(r.WSDisconnectionForm.type.value.i18nKey)}),l.createElement(a.Row,{className:"border-none",label:e("WS_DISCONNECTION_PROPOSED_DATE"),text:f(N(r.WSDisconnectionForm.date))}),"Temporary"==r.WSDisconnectionForm.type.value.code?l.createElement(a.Row,{className:"border-none",label:e("WS_DISCONNECTION_PROPOSED_END_DATE"),text:f(N(r.WSDisconnectionForm.endDate))}):"",l.createElement(a.Row,{className:"border-none",label:e("WS_DISCONNECTION_REASON"),text:e(r.WSDisconnectionForm.reason.value.i18nKey)}))),l.createElement(a.Card,{style:{paddingRight:"16px"}},l.createElement("div",{style:{display:"inline"}},l.createElement(a.CardHeader,{styles:{fontSize:"28px"}},e("WS_COMMON_DOCUMENT_DETAILS")),l.createElement(a.LinkButton,{label:l.createElement(a.EditIcon,{style:{marginTop:"-20px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>c(s+"/documents-upload")})),u&&(null==u?void 0:u.map((n,t)=>{var o;return l.createElement("div",{key:"doc-"+t},l.createElement("div",null,l.createElement(a.CardSectionHeader,null,e(null==n||null===(o=n.documentType)||void 0===o?void 0:o.split(".").slice(0,2).join("_"))),l.createElement(a.StatusTable,null,l.createElement(Li,{value:{documents:r.WSDisconnectionForm},Code:null==n?void 0:n.documentType,index:t,showFileName:!0}),(null==u?void 0:u.length)!=t+1?l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null)))})),l.createElement(a.SubmitBar,{label:e("CS_COMMON_SUBMIT"),onSubmit:()=>function(e){try{return Promise.resolve(A(e,{applicationData:r},r.serviceType)).then(function(e){const t=function(t){if(null!=e&&null!==(t=e.WaterConnection)&&void 0!==t&&t.water){var l;null!==(l=e.WaterConnection)&&void 0!==l&&l.isDisconnectionTemporary&&(e.WaterConnection.endDate=N(r.WSDisconnectionForm.endDate)||"");const t=function(){if(E)return m(!0),Promise.resolve(E(e,{onError:(e,n)=>{var t,l,o,i,a,r;m(!1),setError({key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&o[0].message?null==e||null===(i=e.response)||void 0===i||null===(a=i.data)||void 0===a||null===(r=a.Errors)||void 0===r?void 0:r[0].message:e}),setTimeout(C,5e3)},onSuccess:function(e,t){try{var l;return Promise.resolve(I(null==e||null===(l=e.WaterConnection)||void 0===l?void 0:l[0],"WATER")).then(function(e){let t={WaterConnection:e};return t=v({},t,{disconnectRequest:!0}),Promise.resolve(S(t,{onError:(e,n)=>{var t,l,o,i,a,r;m(!1),setError({key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&o[0].message?null==e||null===(i=e.response)||void 0===i||null===(a=i.data)||void 0===a||null===(r=a.Errors)||void 0===r?void 0:r[0].message:e}),setTimeout(C,5e3)},onSuccess:(e,t)=>{var l;Digit.SessionStorage.set("WS_DISCONNECTION",v({},r,{DisconnectionResponse:null==e||null===(l=e.WaterConnection)||void 0===l?void 0:l[0]})),n.push("/digit-ui/citizen/ws/disconnect-acknowledge")}})).then(function(){})})}catch(e){return Promise.reject(e)}}})).then(function(){})}();if(t&&t.then)return t.then(function(){})}else{const t=function(t){if(null!=e&&null!==(t=e.SewerageConnection)&&void 0!==t&&t.sewerage){e.SewerageConnection.isDisconnectionTemporary&&(e.SewerageConnection.endDate=N(r.WSDisconnectionForm.endDate)||"");const t=function(){if(_)return m(!0),Promise.resolve(_(e,{onError:(e,n)=>{var t,l,o,i,a,r;m(!1),setError({key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&o[0].message?null==e||null===(i=e.response)||void 0===i||null===(a=i.data)||void 0===a||null===(r=a.Errors)||void 0===r?void 0:r[0].message:e}),setTimeout(C,5e3)},onSuccess:function(e,t){try{var l;return Promise.resolve(I(null==e||null===(l=e.SewerageConnections)||void 0===l?void 0:l[0],"SEWERAGE")).then(function(e){let t={SewerageConnection:e};return t=v({},t,{disconnectRequest:!0}),Promise.resolve(g(t,{onError:(e,n)=>{var t,l,o,i,a,r;m(!1),setError({key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&o[0].message?null==e||null===(i=e.response)||void 0===i||null===(a=i.data)||void 0===a||null===(r=a.Errors)||void 0===r?void 0:r[0].message:e}),setTimeout(C,5e3)},onSuccess:(e,t)=>{var l;Digit.SessionStorage.set("WS_DISCONNECTION",v({},r,{DisconnectionResponse:null==e||null===(l=e.SewerageConnections)||void 0===l?void 0:l[0]})),n.push("/digit-ui/citizen/ws/disconnect-acknowledge")}})).then(function(){})})}catch(e){return Promise.reject(e)}}})).then(function(){})}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})})}catch(e){return Promise.reject(e)}}(null==r?void 0:r.WSDisconnectionForm)})))},WSRestorationCheckPage:()=>{const{t:e}=o.useTranslation(),n=i.useHistory(),r=(i.useRouteMatch(),Digit.SessionStorage.get("WS_DISCONNECTION")),[u,d]=t.useState(r.WSDisconnectionForm.documents||[]),[s,c]=t.useState(null),[p,m]=t.useState(!1),{mutate:E}=Digit.Hooks.ws.useWaterCreateAPI("WATER"),{mutate:S}=Digit.Hooks.ws.useWSApplicationActions("WATER"),{mutate:_}=Digit.Hooks.ws.useWaterCreateAPI("SEWERAGE"),{mutate:g}=Digit.Hooks.ws.useWSApplicationActions("SEWERAGE"),C=()=>{setShowToast(null)};return p?l.createElement(a.Loader,null):l.createElement(l.Fragment,null,l.createElement(a.Header,{styles:{fontSize:"32px"}},e("WS_COMMON_SUMMARY")),l.createElement(Ft,{currentStep:3}),l.createElement(a.Card,{style:{paddingRight:"16px"}},l.createElement("div",{style:{display:"inline"}},l.createElement(a.CardHeader,{styles:{fontSize:"28px"}},e("WS_RESTORATION_APPLICATION_DETAILS")),l.createElement(a.LinkButton,{label:l.createElement(a.EditIcon,{style:{marginTop:"-20px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>{location.href="/digit-ui/citizen/ws/restoration-application/application-form"}})),l.createElement(a.StatusTable,null,l.createElement(a.Row,{className:"border-none",label:e("WS_RESTORATION_CONSUMER_NUMBER"),text:r.connectionNo}),l.createElement(a.Row,{className:"border-none",label:e("WS_RESTORATION_PROPOSED_DATE"),text:f(N(r.WSDisconnectionForm.date))}),l.createElement(a.Row,{className:"border-none",label:e("WS_RESTORATION_REASON"),text:r.WSDisconnectionForm.reason.value}))),l.createElement(a.Card,{style:{paddingRight:"16px"}},l.createElement(a.SubmitBar,{label:e("CS_COMMON_SUBMIT"),onSubmit:()=>function(e){try{return Promise.resolve(A(e,{applicationData:r},r.serviceType)).then(function(e){const t=function(t){if(null!=e&&null!==(t=e.WaterConnection)&&void 0!==t&&t.water){e.WaterConnection.isdisconnection=!1,e.WaterConnection.reconnectionReason=e.WaterConnection.disconnectionReason,e.WaterConnection.disconnectionReason="",e.WaterConnection.isDisconnectionTemporary=!0,e.reconnectRequest=!0,e.disconnectRequest=!1;const t=function(){if(E)return m(!0),Promise.resolve(E(e,{onError:(e,n)=>{var t,l,o,i,a,r;m(!1),c({key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&o[0].message?null==e||null===(i=e.response)||void 0===i||null===(a=i.data)||void 0===a||null===(r=a.Errors)||void 0===r?void 0:r[0].message:e}),setTimeout(C,5e3)},onSuccess:function(e,t){try{var l;return Promise.resolve(O(null==e||null===(l=e.WaterConnection)||void 0===l?void 0:l[0],"WATER")).then(function(e){let t={WaterConnection:e};return t=v({},t,{disconnectRequest:!1,reconnectRequest:!0}),Promise.resolve(S(t,{onError:(e,n)=>{var t,l,o,i,a,r;m(!1),c({key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&o[0].message?null==e||null===(i=e.response)||void 0===i||null===(a=i.data)||void 0===a||null===(r=a.Errors)||void 0===r?void 0:r[0].message:e}),setTimeout(C,5e3)},onSuccess:(e,t)=>{var l;Digit.SessionStorage.set("WS_DISCONNECTION",v({},r,{DisconnectionResponse:null==e||null===(l=e.WaterConnection)||void 0===l?void 0:l[0]})),n.push("/digit-ui/citizen/ws/restoration-acknowledge")}})).then(function(){})})}catch(e){return Promise.reject(e)}}})).then(function(){})}();if(t&&t.then)return t.then(function(){})}else{const t=function(t){if(null!=e&&null!==(t=e.SewerageConnection)&&void 0!==t&&t.sewerage){e.SewerageConnection.isdisconnection=!1,e.SewerageConnection.reconnectionReason=e.SewerageConnection.disconnectionReason,e.SewerageConnection.disconnectionReason="",e.SewerageConnection.isDisconnectionTemporary=!0,e.reconnectRequest=!0,e.disconnectRequest=!1;const t=function(){if(_)return m(!0),Promise.resolve(_(e,{onError:(e,n)=>{var t,l,o,i,a,r;m(!1),c({key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&o[0].message?null==e||null===(i=e.response)||void 0===i||null===(a=i.data)||void 0===a||null===(r=a.Errors)||void 0===r?void 0:r[0].message:e}),setTimeout(C,5e3)},onSuccess:function(e,t){try{var l;return Promise.resolve(O(null==e||null===(l=e.SewerageConnections)||void 0===l?void 0:l[0],"SEWERAGE")).then(function(e){let t={SewerageConnection:e};return t=v({},t,{disconnectRequest:!1,reconnectRequest:!0}),Promise.resolve(g(t,{onError:(e,n)=>{var t,l,o,i,a,r;m(!1),c({key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&o[0].message?null==e||null===(i=e.response)||void 0===i||null===(a=i.data)||void 0===a||null===(r=a.Errors)||void 0===r?void 0:r[0].message:e}),setTimeout(C,5e3)},onSuccess:(e,t)=>{var l;Digit.SessionStorage.set("WS_DISCONNECTION",v({},r,{DisconnectionResponse:null==e||null===(l=e.SewerageConnections)||void 0===l?void 0:l[0]})),n.push("/digit-ui/citizen/ws/restoration-acknowledge")}})).then(function(){})})}catch(e){return Promise.reject(e)}}})).then(function(){})}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})})}catch(e){return Promise.reject(e)}}(null==r?void 0:r.WSDisconnectionForm)})),s&&l.createElement(a.Toast,{error:"error"===(null==s?void 0:s.key),label:e(null==s?void 0:s.message),onClose:()=>c(null)}))},WSReSubmitDisconnectionCheckPage:()=>{var e;const{t:n}=o.useTranslation(),r=i.useHistory(),u=(i.useRouteMatch(),Digit.SessionStorage.get("WS_DISCONNECTION")),[d,s]=t.useState(u.WSDisconnectionForm.documents||[]);let c="/digit-ui/citizen/ws/resubmit-disconnect-application";function p(e){location.href=e}window.location.href.includes("/resubmit")&&(c="/digit-ui/citizen/ws/resubmit-disconnect-application");const[m,E]=t.useState(!1),{mutate:S}=Digit.Hooks.ws.useWSApplicationActions("WATER"),{mutate:_}=Digit.Hooks.ws.useWSApplicationActions("SEWERAGE"),g=()=>{setShowToast(null)};return m?l.createElement(a.Loader,null):l.createElement(l.Fragment,null,l.createElement(a.Header,{styles:{fontSize:"32px"}},n("WS_COMMON_SUMMARY")),l.createElement(Ft,{currentStep:3}),l.createElement(a.Card,{style:{paddingRight:"16px"}},l.createElement("div",{style:{display:"inline"}},l.createElement(a.CardHeader,{styles:{fontSize:"28px"}},n("WS_DISCONNECTION_APPLICATION_DETAILS")),l.createElement(a.LinkButton,{label:l.createElement(a.EditIcon,{style:{marginTop:"-20px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>p(c+"/application-form")})),l.createElement(a.StatusTable,null,l.createElement(a.Row,{className:"border-none",label:n("WS_DISCONNECTION_CONSUMER_NUMBER"),text:u.connectionNo||(null==u||null===(e=u.applicationData)||void 0===e?void 0:e.connectionNo)}),l.createElement(a.Row,{className:"border-none",label:n("WS_DISCONNECTION_TYPE"),text:n(u.WSDisconnectionForm.type.value.i18nKey)}),l.createElement(a.Row,{className:"border-none",label:n("WS_DISCONNECTION_PROPOSED_DATE"),text:f(N(u.WSDisconnectionForm.date))}),l.createElement(a.Row,{className:"border-none",label:n("WS_DISCONNECTION_REASON"),text:u.WSDisconnectionForm.reason.value}))),l.createElement(a.Card,{style:{paddingRight:"16px"}},l.createElement("div",{style:{display:"inline"}},l.createElement(a.CardHeader,{styles:{fontSize:"28px"}},n("WS_COMMON_DOCUMENT_DETAILS")),l.createElement(a.LinkButton,{label:l.createElement(a.EditIcon,{style:{marginTop:"-20px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>p(c+"/documents-upload")})),d&&(null==d?void 0:d.map((e,t)=>{var o;return l.createElement("div",{key:"doc-"+t},l.createElement("div",null,l.createElement(a.CardSectionHeader,null,n(null==e||null===(o=e.documentType)||void 0===o?void 0:o.split(".").slice(0,2).join("_"))),l.createElement(a.StatusTable,null,l.createElement(Li,{value:{documents:u.WSDisconnectionForm},Code:null==e?void 0:e.documentType,index:t,showFileName:!0}),(null==d?void 0:d.length)!=t+1?l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null)))})),l.createElement(a.SubmitBar,{label:n("CS_COMMON_SUBMIT"),onSubmit:()=>function(e){try{return Promise.resolve(function(e,n,t){try{var l,o,i,a,r,u,d,s,c,p,m,E,S,_;Digit.UserService.getType();let f={WaterConnection:v({},null==n?void 0:n.applicationData,{dateEffectiveFrom:N(null==e?void 0:e.date),isDisconnectionTemporary:"Temporary"===(null==e||null===(l=e.type)||void 0===l||null===(o=l.value)||void 0===o?void 0:o.code),disconnectionReason:null==e||null===(i=e.reason.value)||void 0===i?void 0:i.code,documents:null==e?void 0:e.documents,water:!0,sewerage:!1,service:"Water",processInstance:v({},null==n||null===(a=n.applicationData)||void 0===a?void 0:a.processInstance,{action:"RESUBMIT_APPLICATION"}),channel:"CITIZEN"}),disconnectRequest:!0};n.applicationData.connectionType&&(n.applicationData.meterInstallationDate&&(f.WaterConnection.meterInstallationDate=n.applicationData.meterInstallationDate),n.applicationData.meterId&&(f.WaterConnection.meterId=n.applicationData.meterId));let g={SewerageConnection:v({},null==n?void 0:n.applicationData,{dateEffectiveFrom:N(null==e?void 0:e.date),isdisconnection:!0,isDisconnectionTemporary:"Temporary"===(null==e||null===(r=e.type)||void 0===r||null===(u=r.value)||void 0===u?void 0:u.code),disconnectionReason:null==e||null===(d=e.reason.value)||void 0===d?void 0:d.code,documents:null==e?void 0:e.documents,water:!1,sewerage:!0,service:"Sewerage",processInstance:v({},null==n||null===(s=n.applicationData)||void 0===s?void 0:s.processInstance,{action:"RESUBMIT_APPLICATION"}),channel:"CITIZEN"}),disconnectRequest:!0},C="WATER"===t?f:g;return C=null!==(c=Digit)&&void 0!==c&&null!==(p=c.Customizations)&&void 0!==p&&null!==(m=p.WS)&&void 0!==m&&m.customiseCreatePayloadOfWSReSubmitDisconnection?null===(E=Digit)||void 0===E||null===(S=E.Customizations)||void 0===S||null===(_=S.WS)||void 0===_?void 0:_.customiseCreatePayloadOfWSReSubmitDisconnection(e,C,t):C,Promise.resolve(C)}catch(e){return Promise.reject(e)}}(e,u,u.serviceType)).then(function(e){const n=function(n){if(null!=e&&null!==(n=e.WaterConnection)&&void 0!==n&&n.water){const n=function(){if(S)return E(!0),Promise.resolve(S(e,{onError:(e,n)=>{var t,l,o,i,a,r;E(!1),setError({key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&o[0].message?null==e||null===(i=e.response)||void 0===i||null===(a=i.data)||void 0===a||null===(r=a.Errors)||void 0===r?void 0:r[0].message:e}),setTimeout(g,5e3)},onSuccess:function(e,n){try{var t,l,o;return Digit.SessionStorage.set("WS_DISCONNECTION",v({},null==u?void 0:u.applicationData,null==u?void 0:u.WSDisconnectionForm,{DisconnectionResponse:null==e||null===(t=e.WaterConnection)||void 0===t?void 0:t[0]})),r.push("/digit-ui/citizen/ws/disconnect-acknowledge?applicationNumber="+(null==e||null===(l=e.WaterConnection)||void 0===l||null===(o=l[0])||void 0===o?void 0:o.applicationNo)),Promise.resolve()}catch(e){return Promise.reject(e)}}})).then(function(){})}();if(n&&n.then)return n.then(function(){})}else{const n=function(n){if(null!=e&&null!==(n=e.SewerageConnection)&&void 0!==n&&n.sewerage){const n=function(){if(_)return E(!0),Promise.resolve(_(e,{onError:(e,n)=>{var t,l,o,i,a,r;E(!1),setError({key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&o[0].message?null==e||null===(i=e.response)||void 0===i||null===(a=i.data)||void 0===a||null===(r=a.Errors)||void 0===r?void 0:r[0].message:e}),setTimeout(g,5e3)},onSuccess:function(e,n){try{var t,l,o;return Digit.SessionStorage.set("WS_DISCONNECTION",v({},null==u?void 0:u.applicationData,null==u?void 0:u.WSDisconnectionForm,{DisconnectionResponse:null==e||null===(t=e.SewerageConnections)||void 0===t?void 0:t[0]})),r.push("/digit-ui/citizen/ws/disconnect-acknowledge?applicationNumber="+(null==e||null===(l=e.SewerageConnections)||void 0===l||null===(o=l[0])||void 0===o?void 0:o.applicationNo)),Promise.resolve()}catch(e){return Promise.reject(e)}}})).then(function(){})}();if(n&&n.then)return n.then(function(){})}}();if(n&&n.then)return n.then(function(){})}}();if(n&&n.then)return n.then(function(){})})}catch(e){return Promise.reject(e)}}(null==u?void 0:u.WSDisconnectionForm)})))},WSApplicationBillAmendment:()=>{var e,n,u,d,s,c,m,E,S,_,f,g,C,N,y,D,T,h,A,I,O;const[b,L]=t.useState(null),{t:R}=o.useTranslation(),{connectionNumber:w,tenantId:W,isEdit:P}=Digit.Hooks.useQueryParams(),M=Digit.ULBService.getStateId();let{state:x}=i.useLocation();x=x?"string"==typeof x?JSON.parse(x):x:{};const[B,F]=t.useState(""),[U,k]=t.useState(!1),[H,j]=t.useState(!1);let V=window.Digit.Utils.browser.isMobile(),z=window.location.href.includes("/employee");const{isLoading:Y,data:G}=Digit.Hooks.ws.WSSearchMdmsTypes.useWSMDMSBillAmendment({tenantId:M}),q=w.includes("WS")?"WS":"SW",K={tenantId:W,consumerCode:w,service:q},{data:X,isLoading:Z}=Digit.Hooks.usePaymentSearch(W,K),{data:$}=Digit.Hooks.fsm.useMDMS(M,"DIGIT-UI","WSTaxHeadMaster"),J=null==$||null===(e=$.BillingService)||void 0===e||null===(n=e.TaxHeadMaster)||void 0===n?void 0:n.filter(e=>e.IsBillamend);let Q=null==X?void 0:X.filter(e=>null==J?void 0:J.find(n=>n.code===e.taxHeadCode));null==$||null===(u=$.BillingService)||void 0===u||null===(d=u.TaxHeadMaster)||void 0===d||d.filter(e=>e.code.includes("ADHOC")&&e.IsBillamend&&e.service===q);const ee=r.useForm({defaultValues:v({},null===(s=x)||void 0===s||null===(c=s.data)||void 0===c||null===(m=c.applicationDetails)||void 0===m||null===(E=m.amendment)||void 0===E||null===(S=E.additionalDetails)||void 0===S?void 0:S.editForm)}),{register:ne,control:te,watch:le,setValue:oe,handleSubmit:ie,formState:{errors:ae},getValues:re}=ee,{mutate:ue}=(p(ee.formState,$i),p(ee,Zi),Digit.Hooks.ws.useApplicationActionsBillAmendUpdate()),[de,se]=t.useState(!1),ce=le("effectivefrom"),ve=le("amendmentReason"),pe=le("WS_REDUCED_AMOUNT"),me=le("WS_ADDITIONAL_AMOUNT"),Ee=le("SW_REDUCED_AMOUNT"),Se=le("SW_ADDITIONAL_AMOUNT"),_e=i.useHistory();t.useEffect(()=>ge({type:"updateAmendmentReason",payload:ve}),[ve]);const[fe,ge]=t.useReducer(function(e,n){var t,l;switch(n.type){case"upload":return e.map(e=>e.documentType===n.payload.id?v({},e,{url:n.payload.url}):e);case"remove":return e.map(e=>{let t=e;return e.documentType===n.payload.id&&(delete t.url,delete t.loader),t});case"addLoader":return e.map(e=>e.documentType===n.payload.id?v({},e,{loader:!0}):e);case"removeLoader":return e.map(e=>e.documentType===n.payload.id?v({},e,{loader:!1}):e);case"updateAmendmentReason":return null===(t=n.payload)||void 0===t||null===(l=t.allowedDocuments)||void 0===l?void 0:l.allowedDocs;default:return e}},[]),Ce=e=>{oe(e,{VALUE:!1})},Ne=e=>{var n,t,l,o,i,a,r,u;let d;const s=void 0!==(null==e||null===(n=e[q+"_REDUCED_AMOUNT"])||void 0===n?void 0:n.VALUE)&&null!=e&&null!==(t=e[q+"_REDUCED_AMOUNT"])&&void 0!==t&&t.VALUE||void 0!==(null==e||null===(l=e[q+"_ADDITIONAL_AMOUNT"])||void 0===l?void 0:l.VALUE)&&(null==e||null===(o=e[q+"_ADDITIONAL_AMOUNT"])||void 0===o||!o.VALUE)?"rebate":"penalty";d="WS"===q?JSON.parse(JSON.stringify(null!=e&&null!==(i=e.WS_REDUCED_AMOUNT)&&void 0!==i&&i.VALUE?null==e?void 0:e.WS_REDUCED_AMOUNT:null==e?void 0:e.WS_ADDITIONAL_AMOUNT)):JSON.parse(JSON.stringify(null!=e&&null!==(a=e.SW_REDUCED_AMOUNT)&&void 0!==a&&a.VALUE?null==e?void 0:e.SW_REDUCED_AMOUNT:null==e?void 0:e.SW_ADDITIONAL_AMOUNT)),null===(r=d)||void 0===r||delete r.VALUE;const c=Object.entries(d);return null!=e&&e[q+"_REBATE"]?c.push([q+"_TIME_ADHOC_REBATE",null==e?void 0:e[q+"_REBATE"]]):null!=e&&e[q+"_PENALTY"]&&c.push([q+"_TIME_ADHOC_PENALTY",null==e?void 0:e[q+"_PENALTY"]]),null===(u=c.filter(e=>""!==(null==e?void 0:e[1])))||void 0===u?void 0:u.map(e=>(Q.find(n=>n.taxHeadCode===e[0]),{taxHeadMasterCode:e[0],taxAmount:e[1]?"penalty"!==s?-parseInt(e[1]):parseInt(e[1]):0}))},ye=e=>{var n,t,l,o;const i=null!=e&&null!==(n=e[q+"_REDUCED_AMOUNT"])&&void 0!==n&&n.VALUE?"REBATE":"PENALTY",a={};let r;return Q.map(e=>{a[e.taxHeadCode]=e.amount}),r="WS"===q?JSON.parse(JSON.stringify(null!=e&&null!==(t=e.WS_REDUCED_AMOUNT)&&void 0!==t&&t.VALUE?null==e?void 0:e.WS_REDUCED_AMOUNT:null==e?void 0:e.WS_ADDITIONAL_AMOUNT)):JSON.parse(JSON.stringify(null!=e&&null!==(l=e.SW_REDUCED_AMOUNT)&&void 0!==l&&l.VALUE?null==e?void 0:e.SW_REDUCED_AMOUNT:null==e?void 0:e.SW_ADDITIONAL_AMOUNT)),null===(o=r)||void 0===o||delete o.VALUE,r[q+"_"+i]=null!=e&&e[q+"_"+i]?null==e?void 0:e[q+"_"+i]:0,v({},r,{actionPerformed:r,TOTAL:Object.values(r).reduce((e,n)=>parseInt(e)+parseInt(n),0),originalDemand:a,action:i})},De=()=>{L(null)};t.useEffect(()=>{const e=setTimeout(()=>{var e;de&&(window.location.href=window.location.origin+"/digit-ui/employee/ws/generate-note-bill-amendment?applicationNumber="+(null===(e=x)||void 0===e?void 0:e.data.applicationDetails.amendment.amendmentId))},5e3);return()=>clearTimeout(e)},[de]);let Te=0;return null===(_=Q)||void 0===_||null===(f=_.filter(e=>{var n;return null==e||null===(n=e.taxHeadCode)||void 0===n?void 0:n.includes("ADHOC")}))||void 0===f||f.map(e=>{Te+=null==e?void 0:e.amount}),Q=null===(g=Q)||void 0===g?void 0:g.filter(e=>{var n;return!(null!=e&&null!==(n=e.taxHeadCode)&&void 0!==n&&n.includes("ADHOC"))}),l.createElement("form",{onSubmit:ie(e=>{var n,t;const l={Amendment:{consumerCode:w,tenantId:W,businessService:q,amendmentReason:null==ve?void 0:ve.code,reasonDocumentNumber:null==e?void 0:e.reasonDocumentNumber,effectiveFrom:new Date(null==e?void 0:e.effectiveFrom).getTime(),effectiveTill:new Date(null==e?void 0:e.effectiveTill).getTime(),documents:Object.values(null==e?void 0:e.DOCUMENTS).map(e=>{const n=v({},e,{documentType:null==e?void 0:e.id,fileUrl:null==e?void 0:e.url});return delete n.id,delete n.url,n}),demandDetails:Ne(e),additionalDetails:{searchBillDetails:ye(e),editForm:e}}};if("RE-SUBMIT-APPLICATION"!==(null===(n=x)||void 0===n||null===(t=n.data)||void 0===t?void 0:t.action))_e.push("/digit-ui/employee/ws/response",l);else{var o,i,a,r,u,d,s,c,p,m,E,S,_,f,g,C;const e={businessId:null===(o=x)||void 0===o||null===(i=o.data)||void 0===i||null===(a=i.applicationDetails)||void 0===a||null===(r=a.amendment)||void 0===r?void 0:r.amendmentId,action:"RE-SUBMIT",tenantId:W,businessService:"WATER"===(null===(u=x)||void 0===u||null===(d=u.data)||void 0===d||null===(s=d.applicationDetails)||void 0===s||null===(c=s.applicationData)||void 0===c?void 0:c.serviceType)?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:"WATER"===(null===(p=x)||void 0===p||null===(m=p.data)||void 0===m||null===(E=m.applicationDetails)||void 0===E||null===(S=E.applicationData)||void 0===S?void 0:S.serviceType)?"WS":"SW"},n=v({},null===(_=x)||void 0===_||null===(f=_.data)||void 0===f||null===(g=f.applicationDetails)||void 0===g||null===(C=g.applicationData)||void 0===C?void 0:C.billAmendmentDetails,{workflow:e},null==l?void 0:l.Amendment);ue({AmendmentUpdate:n},{onError:(e,n)=>{L({key:"error",error:e,label:R("CS_WATER_UPDATE_APPLICATION_FAILED")}),setTimeout(De,5e3)},onSuccess:(e,n)=>{var t,l,o;if((null==e||null===(t=e.Amendments)||void 0===t?void 0:t.length)>0)return null!=n&&null!==(l=n.AmendmentUpdate)&&void 0!==l&&null!==(o=l.workflow)&&void 0!==o&&o.action.includes("RE-SUBMIT")&&L({key:"success",label:R("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}),void se(!0)}})}})},l.createElement("div",{style:{marginLeft:"20px"}},l.createElement(a.Header,null,null!==(C=x)&&void 0!==C&&null!==(N=C.data)&&void 0!==N&&N.action?R("WS_APP_FOR_WATER_AND_SEWERAGE_EDIT_LABEL"):R("WS_BILL_AMENDMENT_BUTTON"))),l.createElement(a.Card,null,l.createElement(a.LabelFieldPair,{style:{marginBottom:"20px"}},l.createElement(a.CardLabel,{style:{fontWeight:"500"}},R("WS_ACKNO_CONNECTION_NO_LABEL")),l.createElement(a.CardText,{style:{marginBottom:"0px"}},w)),l.createElement(a.CardSectionHeader,{style:{marginBottom:"16px"}},R("WS_ADJUSTMENT_AMOUNT")),l.createElement(a.CardSectionSubText,{style:{marginBottom:"16px"}},R("WS_ADJUSTMENT_AMOUNT_ADDITION_TEXT")),Z?l.createElement(a.Loader,null):l.createElement("table",{cellPadding:"8px",cellSpacing:"10px"},l.createElement("div",{style:V&&z?{overflow:"scroll",maxWidth:"50%"}:{}},l.createElement("tbody",null,l.createElement("tr",{style:{textAlign:"left"}},l.createElement("th",null,R("WS_TAX_HEADS")),l.createElement("th",{style:{textAlign:"right"}},R("WS_CURRENT_AMOUNT")),l.createElement("th",{style:{paddingLeft:"150px"}},l.createElement(t.Fragment,null,l.createElement(r.Controller,{name:q+"_REDUCED_AMOUNT.VALUE",key:q+"_REDUCED_AMOUNT.VALUE",control:te,rules:{validate:e=>!(!e&&("WS"===q?null==me||!me.VALUE:null==Se||!Se.VALUE))},render:e=>{var n,t,o,i,r,u,d,s,c,v,p,m,E,S;return l.createElement("div",{style:{paddingTop:"20px"}},l.createElement(a.CheckBox,{style:{marginLeft:"35px"},label:R(q+"_REDUCED_AMOUNT"),onChange:n=>{n.target.checked?(e.onChange(!0),k(!0),j(!1),Ce(q+"_ADDITIONAL_AMOUNT")):(k(!1),e.onChange(!1))},disable:!(!P||0!=(null===(n=x)||void 0===n||null===(t=n.data)||void 0===t||null===(o=t.applicationDetails)||void 0===o||null===(i=o.amendment)||void 0===i||null===(r=i.additionalDetails)||void 0===r||null===(u=r.editForm)||void 0===u||null===(d=u.WS_REDUCED_AMOUNT)||void 0===d?void 0:d.VALUE)&&0!=(null===(s=x)||void 0===s||null===(c=s.data)||void 0===c||null===(v=c.applicationDetails)||void 0===v||null===(p=v.amendment)||void 0===p||null===(m=p.additionalDetails)||void 0===m||null===(E=m.editForm)||void 0===E||null===(S=E.SW_REDUCED_AMOUNT)||void 0===S?void 0:S.VALUE)),checked:null==e?void 0:e.value}))}}),null!=ae&&null!==(y=ae.WS_REDUCED_AMOUNT)&&void 0!==y&&y.VALUE&&1==U?l.createElement(a.CardLabelError,null,R("WS_REQUIRED_FIELD")):null)),l.createElement("th",null,l.createElement(t.Fragment,null,l.createElement(r.Controller,{name:q+"_ADDITIONAL_AMOUNT.VALUE",key:q+"_ADDITIONAL_AMOUNT.VALUE",control:te,rules:{validate:e=>!(!e&&("WS"===q?null==pe||!pe.VALUE:null==Ee||!Ee.VALUE))},render:e=>{var n,t,o,i,r,u,d,s,c,v,p,m,E,S;return l.createElement("div",{style:{paddingTop:"17px"}},l.createElement(a.CheckBox,{style:{marginLeft:"35px"},label:R(q+"_ADDITIONAL_AMOUNT"),onChange:n=>{n.target.checked?(e.onChange(!0),j(!0),k(!1),Ce(q+"_REDUCED_AMOUNT")):(j(!1),e.onChange(!1))},disable:!(!P||0!=(null===(n=x)||void 0===n||null===(t=n.data)||void 0===t||null===(o=t.applicationDetails)||void 0===o||null===(i=o.amendment)||void 0===i||null===(r=i.additionalDetails)||void 0===r||null===(u=r.editForm)||void 0===u||null===(d=u.WS_ADDITIONAL_AMOUNT)||void 0===d?void 0:d.VALUE)&&0!=(null===(s=x)||void 0===s||null===(c=s.data)||void 0===c||null===(v=c.applicationDetails)||void 0===v||null===(p=v.amendment)||void 0===p||null===(m=p.additionalDetails)||void 0===m||null===(E=m.editForm)||void 0===E||null===(S=E.WS_ADDITIONAL_AMOUNT)||void 0===S?void 0:S.VALUE)),checked:null==e?void 0:e.value}))}}),null!=ae&&null!==(D=ae.WS_ADDITIONAL_AMOUNT)&&void 0!==D&&D.VALUE&&1==H?l.createElement(a.CardLabelError,null,R("WS_REQUIRED_FIELD")):null))),null===(T=Q)||void 0===T?void 0:T.map(e=>{var n,o,i,r,u,d,s,c,v,p,m;return l.createElement("tr",null,l.createElement("td",{style:{paddingRight:"60px",fontWeight:"700"}},R(""+e.taxHeadCode)),l.createElement("td",{style:{textAlign:"end"}},"₹ ",e.amount),l.createElement("div",null,l.createElement("td",{style:{paddingRight:"60px",paddingLeft:"150px"}},l.createElement(t.Fragment,null,l.createElement(a.TextInput,{disabled:"WS"===q?!(null!=pe&&pe.VALUE):!(null!=Ee&&Ee.VALUE),type:"number",name:q+"_REDUCED_AMOUNT."+e.taxHeadCode,inputRef:ne({max:{value:e.amount,message:R(q+"_ERROR_ENTER_LESS_THAN_MAX_VALUE")},pattern:{value:/^[+]?[1-9]\d*$/,message:R("CS_INVALID_INPUT")}})}))),"WS"===q?(null==ae||null===(n=ae.WS_REDUCED_AMOUNT)||void 0===n?void 0:n[e.taxHeadCode])&&l.createElement(a.CardLabelError,{style:{marginBottom:"-20px",marginTop:"-30px",marginLeft:"150px"}},null==ae||null===(o=ae.WS_REDUCED_AMOUNT)||void 0===o||null===(i=o[e.taxHeadCode])||void 0===i?void 0:i.message):(null==ae||null===(r=ae.SW_REDUCED_AMOUNT)||void 0===r?void 0:r[e.taxHeadCode])&&l.createElement(a.CardLabelError,{style:{marginBottom:"-20px",marginTop:"-30px",marginLeft:"150px"}},null==ae||null===(u=ae.SW_REDUCED_AMOUNT)||void 0===u?void 0:u[e.taxHeadCode].message)),l.createElement("td",{style:{paddingRight:"60px"}},l.createElement(t.Fragment,null,l.createElement(a.TextInput,{disabled:"WS"===q?!(null!=me&&me.VALUE):!(null!=Se&&Se.VALUE),type:"number",name:q+"_ADDITIONAL_AMOUNT."+e.taxHeadCode,inputRef:ne({pattern:{value:/^[+]?[1-9]\d*$/,message:R("CS_INVALID_INPUT")}})})),"WS"===q?(null==ae||null===(d=ae.WS_ADDITIONAL_AMOUNT)||void 0===d?void 0:d[e.taxHeadCode])&&l.createElement(a.CardLabelError,{style:{marginTop:"-19px"}},null==ae||null===(s=ae.WS_ADDITIONAL_AMOUNT)||void 0===s||null===(c=s[e.taxHeadCode])||void 0===c?void 0:c.message):(null==ae||null===(v=ae.SW_ADDITIONAL_AMOUNT)||void 0===v?void 0:v[e.taxHeadCode])&&l.createElement(a.CardLabelError,{style:{marginTop:"-19px"}},null==ae||null===(p=ae.SW_ADDITIONAL_AMOUNT)||void 0===p||null===(m=p[e.taxHeadCode])||void 0===m?void 0:m.message)))}),l.createElement("tr",null,l.createElement("td",{style:{paddingRight:"60px",fontWeight:"700"}},R("WS_REBATE_PENALTY"),l.createElement("div",{className:"tooltip",style:{marginLeft:"10px",marginBottom:"-4px"}},l.createElement(a.InfoBannerIcon,{fill:"#0b0c0c",style:!0}),l.createElement("span",{className:"tooltiptext",style:{whiteSpace:"nowrap",fontSize:"medium"}},"1. "+R("WS_ADHOC_REBATE_TOOLTIP"),l.createElement("br",null),l.createElement("br",null),"2. "+R("WS_ADHOC_PENALTY_TOOLTIP")))),l.createElement("td",{style:{textAlign:"end"}},"₹ ",Te||0),l.createElement("td",{style:{paddingRight:"60px",paddingLeft:"150px"}},l.createElement(t.Fragment,null,l.createElement(a.TextInput,{disabled:"WS"===q?!(null!=pe&&pe.VALUE):!(null!=Ee&&Ee.VALUE),name:q+"_REBATE",inputRef:ne()}))),l.createElement("td",{style:{paddingRight:"60px"}},l.createElement(t.Fragment,null,l.createElement(a.TextInput,{disabled:"WS"===q?!(null!=me&&me.VALUE):!(null!=Se&&Se.VALUE),name:q+"_PENALTY",inputRef:ne()}))))))),Y?l.createElement(a.Loader,null):l.createElement(t.Fragment,null,l.createElement(a.CardSectionHeader,{style:{marginBottom:"16px"}},R("WS_ADD_DEMAND_REVISION_BASIS")),l.createElement(a.CardSectionSubText,{style:{marginBottom:"16px"}},R("WS_SELECT_DEMAND_REVISION")),l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:{fontWeight:"500"}},R("WS_DEMAND_REVISION_BASIS")+" *"),l.createElement(r.Controller,{name:"amendmentReason",control:te,rules:{required:!0},render:e=>l.createElement(a.Dropdown,{style:V&&z?{}:{width:"640px"},option:G,selected:null==e?void 0:e.value,optionKey:"code",t:R,select:null==e?void 0:e.onChange})})),null!=ae&&ae.amendmentReason?l.createElement(a.CardLabelError,{style:{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"}},R("WS_REQUIRED_FIELD")):null,l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:{fontWeight:"500"}},R("COURT_CASE_SETTLEMENT"===(null==ve?void 0:ve.code)?"WS_COURT_ORDER_NO":"ARREAR_WRITE_OFF"===(null==ve?void 0:ve.code)||"ONE_TIME_SETTLEMENT"===(null==ve?void 0:ve.code)?"WS_GOVERNMENT_NOTIFICATION_NUMBER":"WS_DOCUMENT_NO")+" *"),l.createElement("div",{className:"reasonDocumentNumber"},l.createElement(a.TextInput,{style:V&&z?{}:{width:"640px"},name:"reasonDocumentNumber",inputRef:ne({required:!0})}))),null!=ae&&ae.reasonDocumentNumber?l.createElement(a.CardLabelError,{style:{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"}},R("WS_REQUIRED_FIELD")):null,l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:{fontWeight:"500"}},R("WS_BILL_AMEND_EFFECTIVE_FROM")+" *"),l.createElement(r.Controller,{render:e=>l.createElement(a.DatePicker,{style:V&&z?{}:{width:"640px"},date:e.value,disabled:!1,onChange:e.onChange}),name:"effectiveFrom",rules:{required:!0},control:te})),null!=ae&&ae.effectiveFrom?l.createElement(a.CardLabelError,{style:{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"}},R("WS_REQUIRED_FIELD")):null,"COURT_CASE_SETTLEMENT"!==(null==ve?void 0:ve.code)&&l.createElement("div",null,l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:{fontWeight:"500"}},R("WS_BILL_AMEND_EFFECTIVE_TILL")+" *"),l.createElement(r.Controller,{render:e=>l.createElement(a.DatePicker,{style:V&&z?{}:{width:"640px"},date:e.value,disabled:!1,onChange:e.onChange}),name:"effectiveTill",rules:{required:!0,validate:{isValidToDate:e=>new Date(e).getTime()>(ce?new Date(ce).getTime():(new Date).getTime())||"Invalid format"}},control:te})),"required"===(null==ae||null===(h=ae.effectiveTill)||void 0===h?void 0:h.type)&&l.createElement(a.CardLabelError,{style:{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"}},R("WS_REQUIRED_FIELD")),"Invalid format"===(null==ae||null===(A=ae.effectiveTill)||void 0===A?void 0:A.message)&&l.createElement(a.CardLabelError,{style:{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"}},R("ERR_DEFAULT_INPUT_FIELD_MSG")))),ve?l.createElement(a.CardSectionHeader,{style:{marginBottom:"16px"}},R("WS_DOCUMENT_REQUIRED")):null,null==fe?void 0:fe.map(e=>{var n;return l.createElement("div",{style:{marginBottom:"25px"}},l.createElement(a.LabelFieldPair,null,l.createElement(a.CardLabel,{style:{fontWeight:"500"}},R(""+(null==e?void 0:e.documentType)),null!=e&&e.required?"*":null),l.createElement("div",{className:"field"},l.createElement(r.Controller,{name:"DOCUMENTS."+(null==e?void 0:e.documentType),control:te,rules:null!=e&&e.required?{required:!0}:{},render:n=>l.createElement(a.UploadFile,{id:"ws-doc-"+e.documentType,onUpload:t=>function(e,n,t){return Promise.resolve(function(e,n,t){try{return F(""),Promise.resolve(function(l,o){try{var i=he(function(){const l=function(l,o,i,a,r,u){var d,s,c,v;if((null==e||null===(l=e.target)||void 0===l||null===(o=l.files)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.size)<5242880&&/(.*?)(jpg|jpeg|png|pdf)$/i.test(null==e||null===(a=e.target)||void 0===a||null===(r=a.files)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.type))return ge({type:"addLoader",payload:{id:n}}),Promise.resolve(Digit.UploadServices.Filestorage("WS",null==e||null===(d=e.target)||void 0===d?void 0:d.files[0],W)).then(function(l){var o,i,a;const r=null==l||null===(o=l.data)||void 0===o||null===(i=o.files)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.fileStoreId,u=function(){if(r)return Promise.resolve(Digit.UploadServices.Filefetch([r],W)).then(function(l){var o,i,a,u;let{data:d}=l;const s=null==d||null===(o=d.fileStoreIds)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.url;ge({type:"upload",payload:{id:n,url:s}}),t.onChange({id:n,url:s,fileName:null==e||null===(a=e.target)||void 0===a||null===(u=a.files[0])||void 0===u?void 0:u.name,fileStoreId:r,fileStore:r})});alert(R("CS_FILE_UPLOAD_ERROR"))}();if(u&&u.then)return u.then(function(){})});(null==e||null===(s=e.target)||void 0===s||null===(c=s.files)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.size)>5242880?F({message:"FILE_SIZE_EXCEEDED",documentType:n}):F({message:"FILE_TYPE_MISMATCHED",documentType:n})}();if(l&&l.then)return l.then(function(){})},function(){})}catch(e){return o(!0,e)}return i&&i.then?i.then(o.bind(null,!1),o.bind(null,!0)):o(!1,i)}(0,function(e,t){if(ge({type:"removeLoader",payload:{id:n}}),e)throw t;return t}))}catch(e){return Promise.reject(e)}}(e,n,t)).then(function(){})}(t,null==e?void 0:e.documentType,n),onDelete:()=>ge({type:"remove",payload:{id:null==e?void 0:e.documentType}}),style:V&&z?{}:{width:"640px"},message:null!=e&&e.url?"1 "+R("CS_ACTION_FILEUPLOADED"):R("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",textStyles:{width:"100%"},inputStyles:{width:"280px"},error:null==B?void 0:B.message})}))),null!=ae&&null!==(n=ae.DOCUMENTS)&&void 0!==n&&n[null==e?void 0:e.documentType]||B&&(null==B?void 0:B.documentType)===e.documentType?l.createElement(a.CardLabelError,{style:{width:"70%",marginLeft:"30%",fontSize:"12px"}},R(B&&(null==B?void 0:B.documentType)===e.documentType?null==B?void 0:B.message:"WS_NO_FILE_SELECTED")):null)})),b?l.createElement(a.Toast,{isDleteBtn:!0,error:null==b?void 0:b.error,label:null==b?void 0:b.label,onClose:De}):null,l.createElement(a.ActionBar,null,l.createElement(a.SubmitBar,{submit:!0,label:null!==(I=x)&&void 0!==I&&null!==(O=I.data)&&void 0!==O&&O.action?R("WF_CITIZEN_NEWSW1_RESUBMIT_APPLICATION"):R("WS_COMMON_BUTTON_SUBMIT"),disabled:"WS"==q&&U&&(""==re().WS_REDUCED_AMOUNT.WS_CHARGE||null==re().WS_REDUCED_AMOUNT.WS_CHARGE)&&(""==re().WS_REDUCED_AMOUNT.WS_TIME_PENALTY||null==re().WS_REDUCED_AMOUNT.WS_TIME_PENALTY)&&(""==re().WS_REDUCED_AMOUNT.WS_TIME_INTEREST||null==re().WS_REDUCED_AMOUNT.WS_TIME_INTEREST)&&(""==re().WS_REDUCED_AMOUNT.WS_WATER_CESS||null==re().WS_REDUCED_AMOUNT.WS_WATER_CESS)||"SW"==q&&U&&(""==re().SW_REDUCED_AMOUNT.SW_CHARGE||null==re().SW_REDUCED_AMOUNT.SW_CHARGE)&&(""==re().SW_REDUCED_AMOUNT.SW_TIME_PENALTY||null==re().SW_REDUCED_AMOUNT.SW_TIME_PENALTY)&&(""==re().SW_REDUCED_AMOUNT.SW_TIME_INTEREST||null==re().SW_REDUCED_AMOUNT.SW_TIME_INTEREST)&&(""==re().SW_REDUCED_AMOUNT.SW_SEWERAGE_CESS||null==re().SW_REDUCED_AMOUNT.SW_SEWERAGE_CESS)||"WS"==q&&H&&(""==re().WS_ADDITIONAL_AMOUNT.WS_CHARGE||null==re().WS_ADDITIONAL_AMOUNT.WS_CHARGE)&&(""==re().WS_ADDITIONAL_AMOUNT.WS_TIME_PENALTY||null==re().WS_ADDITIONAL_AMOUNT.WS_TIME_PENALTY)&&(""==re().WS_ADDITIONAL_AMOUNT.WS_TIME_INTEREST||null==re().WS_ADDITIONAL_AMOUNT.WS_TIME_INTEREST)&&(""==re().WS_ADDITIONAL_AMOUNT.WS_WATER_CESS||null==re().WS_ADDITIONAL_AMOUNT.WS_WATER_CESS)||"SW"==q&&H&&(""==re().SW_ADDITIONAL_AMOUNT.SW_CHARGE||null==re().SW_ADDITIONAL_AMOUNT.SW_CHARGE)&&(""==re().SW_ADDITIONAL_AMOUNT.SW_TIME_PENALTY||null==re().SW_ADDITIONAL_AMOUNT.SW_TIME_PENALTY)&&(""==re().SW_ADDITIONAL_AMOUNT.SW_TIME_INTEREST||null==re().SW_ADDITIONAL_AMOUNT.SW_TIME_INTEREST)&&(""==re().SW_ADDITIONAL_AMOUNT.SW_SEWERAGE_CESS||null==re().SW_ADDITIONAL_AMOUNT.SW_SEWERAGE_CESS)})))},WSRequiredDocuments:e=>{let{path:n}=e;const{search:r}=i.useLocation();let{state:u}=i.useLocation();u=u?"string"==typeof u?JSON.parse(u):u:{};const d=i.useHistory(),{t:s}=o.useTranslation(),c=Digit.ULBService.getStateId(),v=t.useRef(),{isLoading:p,data:m}=Digit.Hooks.ws.WSSearchMdmsTypes.useWSMDMSBillAmendment({tenantId:c});return l.createElement(t.Fragment,null,l.createElement("div",{ref:v},l.createElement("div",{className:"options"},l.createElement(a.Header,null,s("ES_COMMON_WS_DOCUMENTS_REQUIRED")),l.createElement("div",{className:"mrsm",style:{marginRight:"35px"},onClick:()=>Digit.Download.PDF(v,s("ES_COMMON_WS_DOCUMENTS_REQUIRED"))},l.createElement(a.DownloadIcon,{className:"mrsm"}),s("ES_WS_REQUIRED_DOCS_DOWNLOAD"))),l.createElement(a.Card,{style:{position:"relative"},className:"employeeCard-override"},p?l.createElement(a.Loader,null):null==m?void 0:m.map(e=>l.createElement(t.Fragment,null,l.createElement(a.CardHeader,null,s(e.code).replaceAll("_"," ")),l.createElement(a.CardLabel,null,s("WS_DOCS_REQ_INFO")),e.allowedDocuments.allowedDocs.map((e,n)=>l.createElement(a.CardLabelDesc,null,n+1,". ",s(""+e.documentType))))))),l.createElement(a.ActionBar,null,l.createElement(a.SubmitBar,{label:s("WS_COMMON_BUTTON_APPLY"),onSubmit:()=>{var e;d.push(n+"/bill-amendment"+r,JSON.stringify({data:null===(e=u)||void 0===e?void 0:e.data}))}})))},WSNewApplication:()=>{const{t:e}=o.useTranslation(),n=(i.useLocation(),i.useHistory());g(location.search);const[r,u]=t.useState(!1),[d,s]=t.useState(!1),[c,p]=t.useState(null),[m,E]=t.useState({}),[S,_]=t.useState(null),[f,C]=t.useState({head:"",body:[]});let N=Digit.ULBService.getCurrentTenantId();N||Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY");const y=Digit.ULBService.getStateId();let{data:D,isLoading:T}=Digit.Hooks.ws.useWSConfigMDMS.WSCreateConfig(y,{});const[A,I]=t.useState(new URLSearchParams(i.useLocation().search).get("propertyId")),[O,b,L]=Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM",{}),{data:R}=Digit.Hooks.pt.usePropertySearch({filters:{propertyIds:A},tenantId:N},{filters:{propertyIds:A},tenantId:N,enabled:!(!A||""==A)});t.useEffect(()=>{if(!T){var e;const n=D.find(e=>e.hideInCitizen&&e.isCreate);n.head="WS_APP_FOR_WATER_AND_SEWERAGE_LABEL";let t=[];null==n||null===(e=n.body)||void 0===e||e.forEach(e=>{null!=e&&e.isCreateConnection&&t.push(e)}),n.body=t,C(n)}},[D]),t.useEffect(()=>{var e,n,t,l;!A&&(null==O||null===(e=O.cpt)||void 0===e||null===(n=e.details)||void 0===n?void 0:n.propertyId)&&I(null==O||null===(t=O.cpt)||void 0===t||null===(l=t.details)||void 0===l?void 0:l.propertyId)},[null==O?void 0:O.cpt]),t.useEffect(()=>{var e;b(v({},O,{cpt:{details:null==R||null===(e=R.Properties)||void 0===e?void 0:e[0]}}))},[R]);const{mutate:w}=Digit.Hooks.ws.useWaterCreateAPI("WATER"),{mutate:W}=Digit.Hooks.ws.useWSApplicationActions("WATER"),{mutate:P}=Digit.Hooks.ws.useWaterCreateAPI("SEWERAGE"),{mutate:M}=Digit.Hooks.ws.useWSApplicationActions("SEWERAGE"),x=()=>{p(null)};return d||T?l.createElement(a.Loader,null):l.createElement(l.Fragment,null,l.createElement("div",{style:{marginLeft:"15px"}},l.createElement(a.Header,null,e(f.head))),l.createElement(a.FormComposer,{config:f.body,userType:"employee",onFormValueChange:(e,n,t)=>{var l,o,i,a,r;U.isEqual(O,n)||(b(v({},O,n)),sessionStorage.setItem("FORMSTATE_ERRORS",JSON.stringify(null==t?void 0:t.errors))),Object.keys(t.errors).length>0&&1==Object.keys(t.errors).length&&null!=t&&null!==(l=t.errors)&&void 0!==l&&null!==(o=l.ConnectionHolderDetails)&&void 0!==o&&o.type&&1==(null===(i=Object.keys(null==t||null===(a=t.errors)||void 0===a||null===(r=a.ConnectionHolderDetails)||void 0===r?void 0:r.type))||void 0===i?void 0:i.length)&&t.errors.ConnectionHolderDetails&&Object.values(t.errors.ConnectionHolderDetails.type).filter(e=>{var n;return"required"===e.type&&""!==(null==e||null===(n=e.ref)||void 0===n?void 0:n.value)}).length>0?u(!0):u(!Object.keys(t.errors).length)},label:e("CS_COMMON_SUBMIT"),onSubmit:function(e){try{var t,l,o;if(!(null!=e&&null!==(t=e.cpt)&&void 0!==t&&t.id||null!=R&&null!==(l=R.Properties)&&void 0!==l&&l[0]||null!=e&&null!==(o=e.cpt)&&void 0!==o&&o.details&&R))return p({key:"error",message:"ERR_INVALID_PROPERTY_ID"}),Promise.resolve();const i=sessionStorage.getItem("FORMSTATE_ERRORS"),a="string"==typeof i?JSON.parse(i):{};return Promise.resolve(function(t,l,o){var i,r;if(!(Object.keys(a).length>0)||1==Object.keys(a).length&&null!=a&&null!==(t=a.ConnectionHolderDetails)&&void 0!==t&&t.type&&1==(null===(l=Object.keys(null==a||null===(o=a.ConnectionHolderDetails)||void 0===o?void 0:o.type))||void 0===l?void 0:l.length)&&a.ConnectionHolderDetails&&Object.values(a.ConnectionHolderDetails.type).filter(e=>{var n;return"required"===e.type&&""!==(null==e||null===(n=e.ref)||void 0===n?void 0:n.value)}).length>0)return null!=e&&null!==(i=e.cpt)&&void 0!==i&&i.details||(e.cpt={details:null==R||null===(r=R.Properties)||void 0===r?void 0:r[0]}),Lt(e),Promise.resolve(function(e){try{var n,t,l,o,i,a,r,u,d,s,c,v,p,m,E,S,_,f,g,C,N,y,D,T,h,A,I,O,b,L,R,w,W,P,M,x,B,F,U,k,H,j,V,z,Y,G,q,K,X,Z,$,J,Q,ee,ne,te,le,oe,ie,ae,re,ue,de,se,ce,ve,pe,me,Ee,Se,_e,fe,ge;null==e||null===(n=e.cpt)||void 0===n||null===(t=n.details)||void 0===t||null===(l=t.owners)||void 0===l||l.forEach(e=>{null!=e&&e.permanentAddress&&(e.correspondenceAddress=null==e?void 0:e.permanentAddress)});let Ce={water:null==e||null===(o=e.ConnectionDetails)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.water,sewerage:null==e||null===(a=e.ConnectionDetails)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.sewerage,proposedTaps:(null==e||null===(u=e.ConnectionDetails)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.proposedTaps)&&Number(null==e||null===(s=e.ConnectionDetails)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.proposedTaps),proposedPipeSize:(null==e||null===(v=e.ConnectionDetails)||void 0===v||null===(p=v[0])||void 0===p||null===(m=p.proposedPipeSize)||void 0===m?void 0:m.size)&&Number(null==e||null===(E=e.ConnectionDetails)||void 0===E||null===(S=E[0])||void 0===S||null===(_=S.proposedPipeSize)||void 0===_?void 0:_.size),proposedWaterClosets:(null==e||null===(f=e.ConnectionDetails)||void 0===f||null===(g=f[0])||void 0===g?void 0:g.proposedWaterClosets)&&Number(null==e||null===(C=e.ConnectionDetails)||void 0===C||null===(N=C[0])||void 0===N?void 0:N.proposedWaterClosets),proposedToilets:(null==e||null===(y=e.ConnectionDetails)||void 0===y||null===(D=y[0])||void 0===D?void 0:D.proposedToilets)&&Number(null==e||null===(T=e.ConnectionDetails)||void 0===T||null===(h=T[0])||void 0===h?void 0:h.proposedToilets),connectionHolders:null!=e&&null!==(A=e.ConnectionHolderDetails)&&void 0!==A&&null!==(I=A[0])&&void 0!==I&&I.sameAsOwnerDetails?null:[{correspondenceAddress:(null==e||null===(O=e.ConnectionHolderDetails)||void 0===O||null===(b=O[0])||void 0===b?void 0:b.address)||"",fatherOrHusbandName:(null==e||null===(L=e.ConnectionHolderDetails)||void 0===L||null===(R=L[0])||void 0===R?void 0:R.guardian)||"",gender:(null==e||null===(w=e.ConnectionHolderDetails)||void 0===w||null===(W=w[0])||void 0===W||null===(P=W.gender)||void 0===P?void 0:P.code)||"",mobileNumber:(null==e||null===(M=e.ConnectionHolderDetails)||void 0===M||null===(x=M[0])||void 0===x?void 0:x.mobileNumber)||"",name:(null==e||null===(B=e.ConnectionHolderDetails)||void 0===B||null===(F=B[0])||void 0===F?void 0:F.name)||"",ownerType:(null==e||null===(U=e.ConnectionHolderDetails)||void 0===U||null===(k=U[0])||void 0===k||null===(H=k.ownerType)||void 0===H?void 0:H.code)||"",relationship:(null==e||null===(j=e.ConnectionHolderDetails)||void 0===j||null===(V=j[0])||void 0===V||null===(z=V.relationship)||void 0===z?void 0:z.code)||"",sameAsPropertyAddress:null==e||null===(Y=e.ConnectionHolderDetails)||void 0===Y||null===(G=Y[0])||void 0===G?void 0:G.sameAsOwnerDetails,emailId:(null==e||null===(q=e.ConnectionHolderDetails)||void 0===q?void 0:q[0].emailId)||""}],service:null==e||null===(K=e.ConnectionDetails)||void 0===K||null===(X=K[0])||void 0===X||!X.water||null!=e&&null!==(Z=e.ConnectionDetails)&&void 0!==Z&&null!==($=Z[0])&&void 0!==$&&$.sewerage?null!=e&&null!==(J=e.ConnectionDetails)&&void 0!==J&&null!==(Q=J[0])&&void 0!==Q&&Q.water||null==e||null===(ee=e.ConnectionDetails)||void 0===ee||null===(ne=ee[0])||void 0===ne||!ne.sewerage?"Water And Sewerage":"Sewerage":"Water",property:null==e||null===(te=e.cpt)||void 0===te?void 0:te.details,propertyId:null==e||null===(le=e.cpt)||void 0===le||null===(oe=le.details)||void 0===oe?void 0:oe.propertyId,roadCuttingArea:null,noOfTaps:null,noOfWaterClosets:null,noOfToilets:null,additionalDetails:{initialMeterReading:null,detailsProvidedBy:"",locality:null==e||null===(ie=e.cpt)||void 0===ie||null===(ae=ie.details)||void 0===ae||null===(re=ae.address)||void 0===re||null===(ue=re.locality)||void 0===ue?void 0:ue.code},tenantId:null==e||null===(de=e.cpt)||void 0===de||null===(se=de.details)||void 0===se||null===(ce=se.address)||void 0===ce?void 0:ce.tenantId,processInstance:{action:"INITIATE"},channel:"CFC_COUNTER"};return sessionStorage.setItem("WS_DOCUMENTS_INOF",JSON.stringify(null==e||null===(ve=e.DocumentsRequired)||void 0===ve?void 0:ve.documents)),sessionStorage.setItem("WS_PROPERTY_INOF",JSON.stringify(null==e||null===(pe=e.cpt)||void 0===pe?void 0:pe.details)),Ce=null!==(me=Digit)&&void 0!==me&&null!==(Ee=me.Customizations)&&void 0!==Ee&&null!==(Se=Ee.WS)&&void 0!==Se&&Se.customiseCreatePayloadOfWS?null===(_e=Digit)||void 0===_e||null===(fe=_e.Customizations)||void 0===fe||null===(ge=fe.WS)||void 0===ge?void 0:ge.customiseCreatePayloadOfWS(e,Ce):Ce,Promise.resolve(Ce)}catch(e){return Promise.reject(e)}}(e)).then(function(e){let t=!1;null!=e&&e.water&&null!=e&&e.sewerage&&(t=!0);let l={WaterConnection:e,disconnectRequest:!1,reconnectRequest:!1},o={SewerageConnection:e,disconnectRequest:!1,reconnectRequest:!1};t?(_(!0),sessionStorage.setItem("setWaterAndSewerageBoth",JSON.stringify(!0))):sessionStorage.setItem("setWaterAndSewerageBoth",JSON.stringify(!1));const i=function(){if(null!=e&&e.water&&null!=e&&e.sewerage){const e=function(){if(w&&P)return s(!0),Promise.resolve(w(l,{onError:(e,n)=>{var t,l,o,i,a,r;s(!1),p({key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&o[0].message?null==e||null===(i=e.response)||void 0===i||null===(a=i.data)||void 0===a||null===(r=a.Errors)||void 0===r?void 0:r[0].message:e}),setTimeout(x,5e3)},onSuccess:function(e,t){try{var l;return Promise.resolve(h(null==e||null===(l=e.WaterConnection)||void 0===l?void 0:l[0],"WATER")).then(function(e){W({WaterConnection:e,disconnectRequest:!1,reconnectRequest:!1},{onError:(e,n)=>{var t,l,o,i,a,r;s(!1),p({key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&o[0].message?null==e||null===(i=e.response)||void 0===i||null===(a=i.data)||void 0===a||null===(r=a.Errors)||void 0===r?void 0:r[0].message:e}),setTimeout(x,5e3)},onSuccess:function(e,t){try{var l;return E(v({},m,{waterConnection:null==e||null===(l=e.WaterConnection)||void 0===l?void 0:l[0]})),Promise.resolve(P(o,{onError:(e,n)=>{var t,l,o,i,a,r;s(!1),p({key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&o[0].message?null==e||null===(i=e.response)||void 0===i||null===(a=i.data)||void 0===a||null===(r=a.Errors)||void 0===r?void 0:r[0].message:e}),setTimeout(x,5e3)},onSuccess:function(t,l){try{var o;return Promise.resolve(h(null==t||null===(o=t.SewerageConnections)||void 0===o?void 0:o[0],"SEWERAGE")).then(function(t){return Promise.resolve(M({SewerageConnection:t,disconnectRequest:!1,reconnectRequest:!1},{onError:(e,n)=>{var t,l,o,i,a,r;s(!1),p({key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&o[0].message?null==e||null===(i=e.response)||void 0===i||null===(a=i.data)||void 0===a||null===(r=a.Errors)||void 0===r?void 0:r[0].message:e}),setTimeout(x,5e3)},onSuccess:function(t,l){try{var o,i,a,r,u;return E(v({},m,{sewerageConnection:null==t||null===(o=t.SewerageConnections)||void 0===o?void 0:o[0]})),L(),n.push("/digit-ui/employee/ws/ws-response?applicationNumber="+(null==e||null===(i=e.WaterConnection)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.applicationNo)+"&applicationNumber1="+(null==t||null===(r=t.SewerageConnections)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.applicationNo)),Promise.resolve()}catch(e){return Promise.reject(e)}}})).then(function(){})})}catch(e){return Promise.reject(e)}}})).then(function(){})}catch(e){return Promise.reject(e)}}})})}catch(e){return Promise.reject(e)}}})).then(function(){})}();if(e&&e.then)return e.then(function(){})}else{const t=function(){if(null==e||!e.water||null!=e&&e.sewerage){const t=function(){if(null!=e&&e.sewerage&&(null==e||!e.water)){const e=function(){if(P)return s(!0),Promise.resolve(P(o,{onError:(e,n)=>{var t,l,o,i,a,r;s(!1),p({key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&o[0].message?null==e||null===(i=e.response)||void 0===i||null===(a=i.data)||void 0===a||null===(r=a.Errors)||void 0===r?void 0:r[0].message:e}),setTimeout(x,5e3)},onSuccess:function(e,t){try{var l;return Promise.resolve(h(null==e||null===(l=e.SewerageConnections)||void 0===l?void 0:l[0],"SEWERAGE")).then(function(e){return Promise.resolve(M({SewerageConnection:e},{onError:(e,n)=>{var t,l,o,i,a,r;s(!1),p({key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&o[0].message?null==e||null===(i=e.response)||void 0===i||null===(a=i.data)||void 0===a||null===(r=a.Errors)||void 0===r?void 0:r[0].message:e}),setTimeout(x,5e3)},onSuccess:(e,t)=>{var l,o,i;E(v({},m,{sewerageConnection:null==e||null===(l=e.SewerageConnections)||void 0===l?void 0:l[0]})),L(),n.push("/digit-ui/employee/ws/ws-response?applicationNumber1="+(null==e||null===(o=e.SewerageConnections)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.applicationNo))}})).then(function(){})})}catch(e){return Promise.reject(e)}}})).then(function(){})}();if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}else{const e=function(){if(w)return s(!0),Promise.resolve(w(l,{onError:(e,n)=>{var t,l,o,i,a,r;s(!1),p({key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&o[0].message?null==e||null===(i=e.response)||void 0===i||null===(a=i.data)||void 0===a||null===(r=a.Errors)||void 0===r?void 0:r[0].message:e}),setTimeout(x,5e3)},onSuccess:function(e,t){try{var l;return Promise.resolve(h(null==e||null===(l=e.WaterConnection)||void 0===l?void 0:l[0],"WATER")).then(function(e){W({WaterConnection:e},{onError:(e,n)=>{var t,l,o,i,a,r;s(!1),p({key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&o[0].message?null==e||null===(i=e.response)||void 0===i||null===(a=i.data)||void 0===a||null===(r=a.Errors)||void 0===r?void 0:r[0].message:e}),setTimeout(x,5e3)},onSuccess:(e,t)=>{var l,o,i;E(v({},m,{waterConnection:null==e||null===(l=e.WaterConnection)||void 0===l?void 0:l[0]})),L(),n.push("/digit-ui/employee/ws/ws-response?applicationNumber="+(null==e||null===(o=e.WaterConnection)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.applicationNo))}})})}catch(e){return Promise.reject(e)}}})).then(function(){})}();if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(i&&i.then)return i.then(function(){})});p({warning:!0,message:"PLEASE_FILL_MANDATORY_DETAILS"})}())}catch(e){return Promise.reject(e)}},defaultValues:O}),c&&l.createElement(a.Toast,{isDleteBtn:!0,error:"error"===(null==c?void 0:c.key),warning:null==c?void 0:c.warning,label:e(null==c?void 0:c.message),onClose:()=>{p(null)},isWarning:null==c?void 0:c.isWarning}))},WSApplicationDetails:()=>{var e,n,r,u,d,s,c,p,m,E,S,_,f,C,N,y,D,h,A,I,O,b,R,w,W,P,M,B,F,U,k,H,j,V,z,Y,G,q,K,X,$,J,Q,ee,ne,te,oe,ie,ae,re,ue,de,se,ce,ve,pe,me,Ee,Se,_e;i.useParams();const{t:fe}=o.useTranslation(),ge=Digit.UserService.getUser(),Ce=Digit.ULBService.getCurrentTenantId(),Ne=Digit.ULBService.getStateId(),[ye,De]=t.useState(null),[Te,he]=t.useState(null),[Ae,Ie]=t.useState(!1),[Oe,be]=(i.useHistory(),Digit.ULBService.getStateId(),window.Digit.Utils.browser.isMobile(),t.useState(!1)),[Le,Re]=t.useState(!1);let we=g(location.search);const We=null==we?void 0:we.applicationNumber,Pe=null==we?void 0:we.service,Me=t.useRef();sessionStorage.removeItem("Digit.PT_CREATE_EMP_WS_NEW_FORM"),sessionStorage.removeItem("IsDetailsExists");const[xe,Be,Fe]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[Ue,ke,He]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),{isBillingServiceLoading:je}=Digit.Hooks.obps.useMDMS(Ne,"BillingService",["BusinessService"]),{isCommonmastersLoading:Ve,data:ze}=Digit.Hooks.obps.useMDMS(Ne,"common-masters",["uiCommonPay"]),{isServicesMasterLoading:Ye,data:Ge}=Digit.Hooks.ws.useMDMS(Ne,"ws-services-masters",["WSEditApplicationByConfigUser"]),qe=(null==ze||null===(e=ze["common-masters"])||void 0===e?void 0:e.uiCommonPay)||[],Ke=qe&&qe.findIndex(e=>"WS.ONE_TIME_FEE"==e.code);let Xe="";Xe=Ke>-1?qe[Ke]:qe&&qe.filter(e=>"DEFAULT"===e.code);const Ze=(null===(n=Xe)||void 0===n?void 0:n.receiptKey)||"consolidatedreceipt",{data:$e}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"DataSecurity",[{name:"SecurityPolicy"}],{select:e=>{var n,t;return(null==e||null===(n=e.DataSecurity)||void 0===n||null===(t=n.SecurityPolicy)||void 0===t?void 0:t.find(e=>"User"==(null==e?void 0:e.model)))||{}}});let{isLoading:Je,data:Qe}=Digit.Hooks.ws.useWSDetailsPage(fe,Ce,We,Pe,ge,{privacy:Digit.Utils.getPrivacyObject()}),en=Digit.Hooks.useWorkflowDetails({tenantId:Ce,id:We,moduleCode:null==Qe||null===(r=Qe.processInstancesDetails)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.businessService,config:{enabled:!(null==Qe||null===(d=Qe.processInstancesDetails)||void 0===d||null===(s=d[0])||void 0===s||!s.businessService),privacy:Digit.Utils.getPrivacyObject()}});const{data:nn}=Digit.Hooks.useRecieptSearch({tenantId:Ce,businessService:"WATER"==Pe?"WS.ONE_TIME_FEE":"SW.ONE_TIME_FEE",consumerCodes:null==Qe||null===(c=Qe.applicationData)||void 0===c?void 0:c.applicationNo},{enabled:!(null==Qe||null===(p=Qe.applicationData)||void 0===p||null===(m=p.applicationType)||void 0===m||!m.includes("NEW_")),privacy:Digit.Utils.getPrivacyObject()}),{data:tn}=Digit.Hooks.ws.useOldValue({tenantId:Ce,filters:{connectionNumber:null==Qe||null===(E=Qe.applicationData)||void 0===E?void 0:E.connectionNo,isConnectionSearch:!0},businessService:Pe},{enabled:!(null==Qe||null===(S=Qe.applicationData)||void 0===S||null===(_=S.applicationType)||void 0===_||!_.includes("MODIFY_")),privacy:Digit.Utils.getPrivacyObject()});sessionStorage.removeItem("eyeIconClicked");const ln=[null==tn?void 0:tn.WaterConnection,null==tn?void 0:tn.SewerageConnections],on=null==ln?void 0:ln.filter(e=>e),an=null==Qe?void 0:Qe.applicationData,rn=null===(f=on[0])||void 0===f?void 0:f.flatMap(e=>{const n=Object.entries(e).filter(e=>{let[n,t]=e;return(null==an?void 0:an[n])!==t});return null!=n&&n.length?Object.fromEntries(n):[]}),{mutate:un}=Digit.Hooks.ws.useWSApplicationActions(Pe),dn=()=>{var e,n,t,l;if("WSReconnection"==(null==Qe||null===(e=Qe.processInstancesDetails)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.businessService)||"SWReconnection"==(null==Qe||null===(t=Qe.processInstancesDetails)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.businessService))return!0;{var o,i,a,r,u,d,s,c,v,p,m,E,S;const e=null==Qe||null===(o=Qe.applicationData)||void 0===o?void 0:o.connectionType,n=0===(null==Qe||null===(i=Qe.applicationData)||void 0===i?void 0:i.noOfTaps)?null:null==Qe||null===(a=Qe.applicationData)||void 0===a?void 0:a.noOfTaps,t=0===(null==Qe||null===(r=Qe.applicationData)||void 0===r?void 0:r.pipeSize)?null:null==Qe||null===(u=Qe.applicationData)||void 0===u?void 0:u.pipeSize,l=null==Qe||null===(d=Qe.applicationData)||void 0===d?void 0:d.waterSource,_=0===(null==Qe||null===(s=Qe.applicationData)||void 0===s?void 0:s.noOfWaterClosets)?null:null==Qe||null===(c=Qe.applicationData)||void 0===c?void 0:c.noOfWaterClosets,f=0===(null==Qe||null===(v=Qe.applicationData)||void 0===v?void 0:v.noOfToilets)?null:null==Qe||null===(p=Qe.applicationData)||void 0===p?void 0:p.noOfToilets,g=null==Qe||null===(m=Qe.applicationData)||void 0===m||null===(E=m.additionalDetails)||void 0===E?void 0:E.detailsProvidedBy,C=null==Qe||null===(S=Qe.applicationData)||void 0===S?void 0:S.roadCuttingInfo;return!!(e&&(n&&t&&l||_&&f)&&g&&C)}};let sn=[],cn=(null==Qe||null===(C=Qe.applicationData)||void 0===C?void 0:C.applicationStatus)||"";var vn,pn;null==en||null===(N=en.data)||void 0===N||null===(y=N.actionState)||void 0===y||null===(D=y.nextActions)||void 0===D||D.forEach(e=>{if("ACTIVATE_CONNECTION"===(null==e?void 0:e.action)&&(e.redirectionUrll={action:"ACTIVATE_CONNECTION",pathname:"/digit-ui/employee/ws/activate-connection?applicationNumber="+We+"&service="+Pe+"&action=ACTIVATE_CONNECTION",state:null==Qe?void 0:Qe.applicationData}),"RESUBMIT_APPLICATION"===(null==e?void 0:e.action)){var n,t,l,o;let a="/digit-ui/employee/ws/edit-application?applicationNumber="+We+"&service="+Pe+"&propertyId="+(null==Qe||null===(n=Qe.propertyDetails)||void 0===n?void 0:n.propertyId);const r=(null==Ge||null===(t=Ge["ws-services-masters"])||void 0===t?void 0:t.WSEditApplicationByConfigUser)||[],u=(null==r||null===(l=r[0])||void 0===l?void 0:l.roles)||[],d=null==r||null===(o=r[0])||void 0===o?void 0:o.status;let s=!1;var i;u.every((e,n)=>(s=x(e),!s)),s&&cn===d&&(a="/digit-ui/employee/ws/edit-application-by-config?applicationNumber="+We+"&service="+Pe+"&propertyId="+(null==Qe||null===(i=Qe.propertyDetails)||void 0===i?void 0:i.propertyId)),e.redirectionUrll={action:"ACTIVATE_CONNECTION",pathname:a,state:{applicationDetails:Qe,action:"RESUBMIT_APPLICATION"}}}var a;"SUBMIT_APPLICATION"===(null==e?void 0:e.action)&&(e.redirectionUrll={action:"ACTIVATE_CONNECTION",pathname:"/digit-ui/employee/ws/modify-application-edit?applicationNumber="+We+"&service="+Pe+"&propertyId="+(null==Qe||null===(a=Qe.propertyDetails)||void 0===a?void 0:a.propertyId),state:Qe})}),!((null==en||null===(h=en.data)||void 0===h||null===(A=h.nextActions)||void 0===A?void 0:A.length)>0&&(null==en||null===(I=en.data)||void 0===I||null===(O=I.actionState)||void 0===O||null===(b=O.nextActions)||void 0===b?void 0:b.length)>0)||null!=en&&null!==(R=en.data)&&void 0!==R&&null!==(w=R.actionState)&&void 0!==w&&null!==(W=w.nextActions)&&void 0!==W&&W.find(e=>"EDIT"===e.action)||null!=en&&null!==(P=en.data)&&void 0!==P&&null!==(M=P.actionState)&&void 0!==M&&null!==(B=M.nextActions)&&void 0!==B&&B.find(e=>"RESUBMIT_APPLICATION"===e.action)||null!=en&&null!==(F=en.data)&&void 0!==F&&null!==(U=F.actionState)&&void 0!==U&&null!==(k=U.nextActions)&&void 0!==k&&k.find(e=>"ACTIVATE_CONNECTION"===e.action)||null!=en&&null!==(H=en.data)&&void 0!==H&&null!==(j=H.actionState)&&void 0!==j&&null!==(V=j.nextActions)&&void 0!==V&&V.find(e=>"SUBMIT_APPLICATION"===e.action)||null==en||null===(vn=en.data)||void 0===vn||null===(pn=vn.nextActions)||void 0===pn||pn.forEach(e=>{"EDIT"==e.action&&en.data.actionState.nextActions.push(e)}),null==en||null===(z=en.data)||void 0===z||null===(Y=z.actionState)||void 0===Y||null===(G=Y.nextActions)||void 0===G||G.forEach(e=>{if("EDIT"===(null==e?void 0:e.action)){var n,t,l,o;let a="/digit-ui/employee/ws/edit-application?applicationNumber="+We+"&service="+Pe+"&propertyId="+(null==Qe||null===(n=Qe.propertyDetails)||void 0===n?void 0:n.propertyId);const r=(null==Ge||null===(t=Ge["ws-services-masters"])||void 0===t?void 0:t.WSEditApplicationByConfigUser)||[],u=(null==r||null===(l=r[0])||void 0===l?void 0:l.roles)||[],d=null==r||null===(o=r[0])||void 0===o?void 0:o.status;let s=!1;var i;u.every((e,n)=>(s=x(e),!s)),s&&cn===d&&(a="/digit-ui/employee/ws/edit-application-by-config?applicationNumber="+We+"&service="+Pe+"&propertyId="+(null==Qe||null===(i=Qe.propertyDetails)||void 0===i?void 0:i.propertyId)),e.redirectionUrll={action:"ACTIVATE_CONNECTION",pathname:a,state:{applicationDetails:Qe,action:"VERIFY_AND_FORWARD"}}}}),null==en||null===(q=en.data)||void 0===q||null===(K=q.nextActions)||void 0===K||K.forEach(e=>{"VERIFY_AND_FORWARD"!==(null==e?void 0:e.action)||"PENDING_FOR_FIELD_INSPECTION"!==cn||dn()||(e.isToast=!0,e.toastMessage="MISSING_ADDITIONAL_DETAILS")}),null==en||null===(X=en.data)||void 0===X||null===($=X.actionState)||void 0===$||null===(J=$.nextActions)||void 0===J||J.forEach(e=>{"VERIFY_AND_FORWARD"!==(null==e?void 0:e.action)||"PENDING_FOR_FIELD_INSPECTION"!==cn||dn()||(e.isToast=!0,e.toastMessage="MISSING_ADDITIONAL_DETAILS")}),null==en||null===(Q=en.data)||void 0===Q||null===(ee=Q.nextActions)||void 0===ee||ee.forEach(e=>{var n,t,l,o,i,a;"PAY"===(null==e?void 0:e.action)&&(e.redirectionUrll="WSReconnection"==(null==en||null===(n=en.data)||void 0===n||null===(t=n.processInstances)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.businessService)?{pathname:"WSReconnection/"+(null==Qe?void 0:Qe.applicationNo)+"/"+(null==Qe?void 0:Qe.tenantId)+"?tenantId="+(null==Qe?void 0:Qe.tenantId)+"&ISWSAPP&applicationNumber="+(null==Qe?void 0:Qe.applicationNo),state:null==Qe?void 0:Qe.tenantId}:"SWReconnection"==(null==en||null===(o=en.data)||void 0===o||null===(i=o.processInstances)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.businessService)?{pathname:"SWReconnection/"+(null==Qe?void 0:Qe.applicationNo)+"/"+(null==Qe?void 0:Qe.tenantId)+"?tenantId="+(null==Qe?void 0:Qe.tenantId)+"&ISWSAPP&applicationNumber="+(null==Qe?void 0:Qe.applicationNo),state:null==Qe?void 0:Qe.tenantId}:{pathname:L(we)+"/"+(null==Qe?void 0:Qe.applicationNo)+"/"+(null==Qe?void 0:Qe.tenantId)+"?tenantId="+(null==Qe?void 0:Qe.tenantId)+"&ISWSAPP&applicationNumber="+(null==Qe?void 0:Qe.applicationNo),state:null==Qe?void 0:Qe.tenantId})}),null==en||null===(ne=en.data)||void 0===ne||null===(te=ne.actionState)||void 0===te||null===(oe=te.nextActions)||void 0===oe||oe.forEach(e=>{var n,t,l,o,i,a;console.log("workflowDetails",en),"PAY"===(null==e?void 0:e.action)&&(e.redirectionUrll="WSReconnection"==(null==en||null===(n=en.data)||void 0===n||null===(t=n.processInstances)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.businessService)?{pathname:"WSReconnection/"+(null==Qe?void 0:Qe.applicationNo)+"/"+(null==Qe?void 0:Qe.tenantId)+"?tenantId="+(null==Qe?void 0:Qe.tenantId)+"&ISWSAPP&applicationNumber="+(null==Qe?void 0:Qe.applicationNo),state:null==Qe?void 0:Qe.tenantId}:"SWReconnection"==(null==en||null===(o=en.data)||void 0===o||null===(i=o.processInstances)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.businessService)?{pathname:"SWReconnection/"+(null==Qe?void 0:Qe.applicationNo)+"/"+(null==Qe?void 0:Qe.tenantId)+"?tenantId="+(null==Qe?void 0:Qe.tenantId)+"&ISWSAPP&applicationNumber="+(null==Qe?void 0:Qe.applicationNo),state:null==Qe?void 0:Qe.tenantId}:{pathname:L(we)+"/"+(null==Qe?void 0:Qe.applicationNo)+"/"+(null==Qe?void 0:Qe.tenantId)+"?tenantId="+(null==Qe?void 0:Qe.tenantId)+"&ISWSAPP&applicationNumber="+(null==Qe?void 0:Qe.applicationNo),state:null==Qe?void 0:Qe.tenantId})});const mn="WATER"===Pe?null==tn||null===(ie=tn.WaterConnection)||void 0===ie?void 0:ie[(null==tn||null===(ae=tn.WaterConnection)||void 0===ae?void 0:ae.length)-1]:null==tn||null===(re=tn.SewerageConnections)||void 0===re?void 0:re[(null==tn||null===(ue=tn.SewerageConnections)||void 0===ue?void 0:ue.length)-1],En={order:1,label:fe("WS_ESTIMATION_NOTICE"),onClick:function(){try{const e=function(e,n){if(null!=Qe&&null!==(e=Qe.applicationData)&&void 0!==e&&null!==(n=e.additionalDetails)&&void 0!==n&&n.estimationFileStoreId){var t,l;T([null==Qe||null===(t=Qe.applicationData)||void 0===t||null===(l=t.additionalDetails)||void 0===l?void 0:l.estimationFileStoreId],null==Qe?void 0:Qe.tenantId)}else{const e=sessionStorage.getItem("WARINIG_COUNT")||"0",n=JSON.parse(e),t=function(){if(0==n){const e={applicationNumber:We};return console.log(e,"filters"),Promise.resolve(Digit.WSService.search({tenantId:null==Qe?void 0:Qe.tenantId,filters:v({},e),businessService:"WATER"==Pe?"WS":"SW"})).then(function(e){var t,l,o;let i="WATER"==Pe?null==e||null===(t=e.WaterConnection)||void 0===t?void 0:t[0]:null==e||null===(l=e.SewerageConnections)||void 0===l?void 0:l[0];var a;null!=i&&null!==(o=i.additionalDetails)&&void 0!==o&&o.estimationFileStoreId?T([null==i||null===(a=i.additionalDetails)||void 0===a?void 0:a.estimationFileStoreId],Ce):(sessionStorage.setItem("WARINIG_COUNT",n?n+1:1),setTimeout(()=>{sessionStorage.setItem("WARINIG_COUNT","0")},6e4),he({isError:!1,isWarning:!0,key:"warning",message:fe("WS_WARNING_FILESTOREID_PLEASE_TRY_AGAIN_SOMETIME_LABEL")}))})}Te||he({isError:!1,isWarning:!0,key:"warning",message:fe("WS_WARNING_FILESTOREID_PLEASE_TRY_AGAIN_SOMETIME_LABEL")})}();if(t&&t.then)return t.then(function(){})}}();return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}},Sn={order:2,label:fe("WS_SANCTION_LETTER"),onClick:()=>{var e,n;return T([null==Qe||null===(e=Qe.applicationData)||void 0===e||null===(n=e.additionalDetails)||void 0===n?void 0:n.sanctionFileStoreId],null==Qe?void 0:Qe.tenantId)}},_n={order:3,label:fe("WS_APPLICATION"),onClick:function(){try{var e,n,t;const l=null==Qe||null===(e=Qe.applicationData)||void 0===e?void 0:e.tenantId;let o=null==Qe?void 0:Qe.applicationData;return null!=Qe&&null!==(n=Qe.applicationData)&&void 0!==n&&null!==(t=n.applicationType)&&void 0!==t&&t.includes("MODIFY_")?(le(v({},o),v({},null==Qe?void 0:Qe.propertyDetails),l,fe,mn).then(e=>Digit.Utils.pdf.generateModifyPdf(e)),Promise.resolve()):(Z(v({},o),v({},null==Qe?void 0:Qe.propertyDetails),l,fe).then(e=>Digit.Utils.pdf.generatev1(e)),Promise.resolve())}catch(e){return Promise.reject(e)}}},fn={order:4,label:fe("DOWNLOAD_RECEIPT_HEADER"),onClick:()=>{var e;return function(e,n,t,l){try{let t=null;const o=null!=n&&n.fileStoreId?(t={filestoreIds:[null==n?void 0:n.fileStoreId]},Promise.resolve(Digit.PaymentService.printReciept(e,{fileStoreIds:t.filestoreIds[0]})).then(function(e){window.open(e[t.filestoreIds[0]],"_blank")})):Promise.resolve(Digit.PaymentService.generatePdf(e,{Payments:[v({},n)]},l)).then(function(n){return t=n,Promise.resolve(Digit.PaymentService.printReciept(e,{fileStoreIds:t.filestoreIds[0]})).then(function(e){var n;window.open(e[null===(n=t)||void 0===n?void 0:n.filestoreIds[0]],"_blank")})});return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(Digit.ULBService.getStateId(),null==nn||null===(e=nn.Payments)||void 0===e?void 0:e[0],0,Ze)}};switch(fe("WS_APLICATION_RECEIPT"),cn){case"PENDING_FOR_DOCUMENT_VERIFICATION":case"PENDING_FOR_CITIZEN_ACTION":case"PENDING_FOR_FIELD_INSPECTION":sn=[_n];break;case"PENDING_APPROVAL_FOR_CONNECTION":case"PENDING_FOR_PAYMENT":sn=[_n,En];break;case"PENDING_FOR_CONNECTION_ACTIVATION":case"CONNECTION_ACTIVATED":sn=null!=Qe&&null!==(de=Qe.applicationData)&&void 0!==de&&null!==(se=de.applicationType)&&void 0!==se&&se.includes("NEW_")&&(null==nn||null===(ce=nn.Payments)||void 0===ce?void 0:ce.length)>0?[Sn,En,_n,fn]:[Sn,En,_n];break;case"REJECTED":default:sn=[_n]}return Digit.Hooks.useClickOutside(Me,()=>{be(!1)},Oe),sn.sort(function(e,n){return e.order-n.order}),l.createElement(t.Fragment,null,l.createElement("div",{className:"employee-main-application-details"},l.createElement("div",{className:"employee-application-details",style:{marginBottom:"15px"}},l.createElement(a.Header,{styles:{marginLeft:"0px",paddingTop:"10px",fontSize:"32px"}},fe("CS_TITLE_APPLICATION_DETAILS")),l.createElement("div",{style:{zIndex:"10",display:"flex",flexDirection:"row-reverse",alignItems:"center",marginTop:"-25px"}},l.createElement("div",{style:{zIndex:"10",position:"relative",maxWidth:"100% !important"}},sn&&sn.length>0&&l.createElement(a.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>be(!Oe),displayOptions:Oe,options:sn,downloadBtnClassName:"employee-download-btn-className",optionsClassName:"employee-options-btn-className",ref:Me})),l.createElement(a.LinkButton,{label:fe("VIEW_TIMELINE"),style:{color:"#A52A2A"},onClick:()=>{Re(!0);const e=document.getElementById("timeline");e&&e.scrollIntoView({behavior:"smooth"})}}))),l.createElement(Wr,{applicationDetails:Qe,isLoading:Je||je||Ve||Ye,isDataLoading:Je||je||Ve||Ye,applicationData:null==Qe?void 0:Qe.applicationData,mutate:un,id:"timeline",workflowDetails:en,businessService:null==Qe||null===(ve=Qe.processInstancesDetails)||void 0===ve||null===(pe=ve[0])||void 0===pe||null===(me=pe.businessService)||void 0===me?void 0:me.toUpperCase(),moduleCode:"WS",showToast:ye,setShowToast:De,closeToast:()=>{De(null)},timelineStatusPrefix:"WF_"+(null==Qe||null===(Ee=Qe.processInstancesDetails)||void 0===Ee||null===(Se=Ee[0])||void 0===Se||null===(_e=Se.businessService)||void 0===_e?void 0:_e.toUpperCase())+"_",oldValue:rn,isInfoLabel:!(Je||!Digit.Utils.checkPrivacy($e,{uuid:(null==Qe||null===(gn=Qe.applicationData)||void 0===gn||null===(Cn=gn.connectionHolders)||void 0===Cn?void 0:Cn.uuid)||(null==Qe||null===(Nn=Qe.propertyDetails)||void 0===Nn||null===(yn=Nn.owners)||void 0===yn||null===(Dn=yn[0])||void 0===Dn?void 0:Dn.uuid),fieldName:"mobileNumber",model:"User"})),clearDataDetails:()=>{Fe(),Be({}),ke({}),He()}}),Te&&l.createElement(a.Toast,{style:{zIndex:"10000"},warning:null==Te?void 0:Te.isWarning,error:null==Te||!Te.isWarning,label:fe(null==Te?void 0:Te.message),onClose:()=>{he(null)},isDleteBtn:!0})));var gn,Cn,Nn,yn,Dn},WSGetConnectionDetails:()=>{var e,n,r,u,d,s,c,p,m,E,S,_,f,C,N,y,D,T,h,A,I,O,b,L,R;const{t:w}=o.useTranslation(),W=Digit.ULBService.getCurrentTenantId(),P=i.useHistory(),[M,B]=t.useState(!1),[F,U]=t.useState(null);let k=g(location.search);const H=null==k?void 0:k.applicationNumber,V=null==k?void 0:k.service,z=null==k?void 0:k.due,Y=null==k?void 0:k.tenantId,[G,q]=t.useState(!1),K=Digit.ULBService.getStateId(),X=["MODIFY_CONNECTION_BUTTON","BILL_AMENDMENT_BUTTON","DISCONNECTION_BUTTON"],{isLoading:Z,data:$}=Digit.Hooks.ws.useConnectionDetail(w,W,H,V,{privacy:Digit.Utils.getPrivacyObject()}),J=t.useRef(),Q=t.useRef();sessionStorage.removeItem("IsDetailsExists"),Digit.SessionStorage.del("PT_CREATE_EMP_WS_NEW_FORM");const{data:ee}=Digit.Hooks.useDemandSearch({consumerCode:null==$||null===(e=$.applicationData)||void 0===e?void 0:e.connectionNo,businessService:"WATER"===V?"WS":"SW",tenantId:W},{enabled:!(null==$||null===(n=$.applicationData)||void 0===n||!n.applicationNo)}),[ne,te]=t.useState(!1),[le,oe]=t.useState([]),[ie,ae]=t.useState(null),re=Digit.Hooks.ws.useToCheckPrivacyEnablement({privacy:{uuid:null!=$&&null!==(r=$.applicationData)&&void 0!==r&&null!==(u=r.applicationNo)&&void 0!==u&&u.includes("WS")?null==$||null===(d=$.applicationData)||void 0===d||null===(s=d.WaterConnection)||void 0===s||null===(c=s[0])||void 0===c||null===(p=c.connectionHolders)||void 0===p||null===(m=p[0])||void 0===m?void 0:m.uuid:null==$||null===(E=$.applicationData)||void 0===E||null===(S=E.SewerageConnections)||void 0===S||null===(_=S[0])||void 0===_||null===(f=_.connectionHolders)||void 0===f||null===(C=f[0])||void 0===C?void 0:C.uuid,fieldName:["connectionHoldersMobileNumber"],model:"WnSConnectionOwner"}})||!1,{mutate:ue}=Digit.Hooks.ws.useWSApplicationActions(V),de=Digit.Utils.browser.isMobile(),{data:se}=Digit.Hooks.obps.useMDMS(K,"common-masters",["uiCommonPay"]),ce=(null==se||null===(N=se["common-masters"])||void 0===N?void 0:N.uiCommonPay)||[],ve=ce&&ce.findIndex(e=>"WS.ONE_TIME_FEE"==e.code);let pe="";pe=ve>-1?ce[ve]:ce&&ce.filter(e=>"DEFAULT"===e.code),t.useEffect(function(){try{return Promise.resolve(Digit.PaymentService.searchAmendment(W,{consumerCode:H,businessService:"WATER"===V?"WS":"SW"})).then(function(e){oe(e.Amendments)})}catch(e){return Promise.reject(e)}},[]);const me=()=>{ae(null)};setTimeout(()=>{me()},1e4);const Ee="Active"===(null==$||null===(y=$.applicationData)||void 0===y?void 0:y.status),Se=null==$?void 0:$.isApplicationApproved;function _e(e){var n,t,l,o;"MODIFY_CONNECTION_BUTTON"===e?(()=>{var e,n,t;if(!Ee)return void ae({key:"error",label:"CONN_NOT_ACTIVE"});if((null==$||null===(e=$.fetchBillsData[0])||void 0===e?void 0:e.totalAmount)>0)return void ae({key:"error",label:"WS_DUE_AMOUNT_SHOULD_BE_ZERO"});let l="/digit-ui/employee/ws/modify-application?applicationNumber="+(null==$||null===(n=$.applicationData)||void 0===n?void 0:n.connectionNo)+"&service="+V+"&propertyId="+(null==$||null===(t=$.propertyDetails)||void 0===t?void 0:t.propertyId)+"&from=WS_COMMON_CONNECTION_DETAIL";P.push(""+l,JSON.stringify({data:$}))})():"BILL_AMENDMENT_BUTTON"===e?(()=>{var e,n;let t=!1;null==le||le.map(e=>{"INWORKFLOW"!==(null==e?void 0:e.status)||(t=!0)}),0!==(null==ee||null===(e=ee.Demands)||void 0===e?void 0:e.length)?t?ae({key:"error",label:"WORKFLOW_IN_PROGRESS"}):P.push("/digit-ui/employee/ws/required-documents?connectionNumber="+(null==$||null===(n=$.applicationData)||void 0===n?void 0:n.connectionNo)+"&tenantId="+Y+"&service="+V,JSON.stringify({data:$})):ae({key:"error",label:"No_Bills_Found"})})():"DISCONNECTION_BUTTON"===e?Se?(console.log("due",z,$),"ACTIVE"===(null===(l=le[0])||void 0===l?void 0:l.status)||(null==$||null===(o=$.fetchBillsData)||void 0===o?void 0:o.length)<=0||"0"==z||z<0?(Digit.SessionStorage.set("WS_DISCONNECTION",$),P.push("/digit-ui/employee/ws/new-disconnection")):te(!0)):ae({key:"error",label:"WORKFLOW_IN_PROGRESS"}):"RESTORATION_BUTTON"===e&&(Se?"ACTIVE"===(null===(n=le[0])||void 0===n?void 0:n.status)||(null==$||null===(t=$.fetchBillsData)||void 0===t?void 0:t.length)<=0||"0"===z?(Digit.SessionStorage.set("WS_DISCONNECTION",$),P.push("/digit-ui/employee/ws/new-restoration")):te(!0):ae({key:"error",label:"WORKFLOW_IN_PROGRESS"}))}Digit.Hooks.useClickOutside(J,()=>{q(!1)},G),Digit.Hooks.useClickOutside(Q,()=>{B(!1)},M);const fe="Active"===(null==$||null===(D=$.applicationData)||void 0===D?void 0:D.status)?X:X.filter(e=>"DISCONNECTION_BUTTON"!==e);let ge=[];const Ce={order:1,label:w("WS_COMMON_DOWNLOAD_BILL"),onClick:()=>function(){try{const e=function(e){if((null==$||null===(e=$.fetchBillsData)||void 0===e?void 0:e.length)>0){var n;const e="WATER"===V?"WS":"SW";let t={isConnectionSearch:!0,connectionNumber:null==$||null===(n=$.applicationData)||void 0===n?void 0:n.connectionNo};return Promise.resolve(Digit.WSService.search({tenantId:W,filters:t,businessService:e})).then(function(n){var t,l,o,i,a,r;let u={applicationNumber:"WATER"===V?null==n||null===(t=n.WaterConnection)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.applicationNo:null==n||null===(o=n.SewerageConnections)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.applicationNo,bussinessService:e};var d;((null==n||null===(a=n.WaterConnection)||void 0===a?void 0:a.length)>0||(null==n||null===(r=n.SewerageConnections)||void 0===r?void 0:r.length)>0)&&function(e,n){try{const t=Digit.ULBService.getCurrentTenantId();Promise.resolve(Digit.WSService.generateBillPdf({tenantId:t,filters:n})).then(function(n){const t=parseInt(n.status,10);201!==t&&200!==t||((e,n)=>{if(window.mSewaApp&&window.mSewaApp.isMsewaApp()&&window.mSewaApp.downloadBase64File){var t=new FileReader;t.readAsDataURL(e),t.onloadend=function(){window.mSewaApp.downloadBase64File(t.result,n)}}else{const t=document.createElement("a");t.href=URL.createObjectURL(e),t.download=n,document.body.append(t),t.click(),t.remove(),setTimeout(()=>URL.revokeObjectURL(t.href),7e3)}})(new Blob([n.data],{type:"application/pdf"}),"BILL-"+e+".pdf")})}catch(e){return Promise.reject(e)}}(null==$||null===(d=$.applicationData)||void 0===d?void 0:d.connectionNo,u)})}}();return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}()},Ne={order:2,label:w("WS_CONNECTION_DETAILS"),onClick:()=>function(){try{var e;const n=null==$||null===(e=$.applicationData)||void 0===e?void 0:e.tenantId;return Hi(v({},null==$?void 0:$.applicationData),v({},null==$?void 0:$.propertyDetails),n,w).then(e=>Digit.Utils.pdf.generatev1(e)),Promise.resolve()}catch(e){return Promise.reject(e)}}()};ge=(null==$||null===(T=$.fetchBillsData)||void 0===T?void 0:T.length)>0?[Ce,Ne]:[Ne];const ye=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),De=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Te=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ye,null));return l.createElement(t.Fragment,null,l.createElement("div",null,l.createElement("div",{className:"employee-application-details",style:{marginBottom:"15px"}},l.createElement("style",null,"\n .multilinkWrapper employee-mulitlink-main-divNew {\n max-width:100%;\n maegin-top:-20px\n }"),l.createElement("div",{style:{display:"flex"}},l.createElement("div",{style:{width:"80%"}},l.createElement(a.Header,{styles:{marginLeft:"0px",paddingTop:"10px",fontSize:"32px"}},w("WS_CONNECTION_DETAILS"))),ge&&ge.length>0&&l.createElement("div",{style:{maxWidth:"100% !imnportant",zIndex:"10"}},l.createElement(a.MultiLink,{className:"multilinkWrapper employee-mulitlink-main-divNew",onHeadClick:()=>q(!G),displayOptions:G,options:ge,downloadBtnClassName:"employee-download-btn-className",optionsClassName:"employee-options-btn-className",ref:J,style:{maxWidth:"100%"}})))),l.createElement(Wr,{applicationDetails:$,isLoading:Z,isDataLoading:Z,applicationData:null==$?void 0:$.applicationData,mutate:ue,businessService:null==$||null===(h=$.processInstancesDetails)||void 0===h||null===(A=h[0])||void 0===A?void 0:A.businessService,moduleCode:"WS",showToast:F,setShowToast:U,closeToast:()=>{U(null)},isInfoLabel:re,labelComponent:l.createElement(j,{t:w})}),(!x("WS_CEMP")||!Ee||null!=$&&$.isDisconnectionDone)&&null!=$&&null!==(I=$.applicationData)&&void 0!==I&&I.isDisconnectionTemporary&&"Active"!==(null==$||null===(O=$.applicationData)||void 0===O?void 0:O.status)&&"DISCONNECTION_EXECUTED"==(null==$||null===(b=$.applicationData)||void 0===b?void 0:b.applicationStatus)?l.createElement(a.ActionBar,null,M?l.createElement(a.Menu,{options:["RESTORATION_BUTTON"],localeKeyPrefix:"WS",t:w,onSelect:_e}):null,l.createElement(a.SubmitBar,{ref:Q,label:w("WF_TAKE_ACTION"),onSubmit:()=>B(!M)})):l.createElement(a.ActionBar,null,M?l.createElement(a.Menu,{options:fe,localeKeyPrefix:"WS",t:w,onSelect:_e}):null,l.createElement(a.SubmitBar,{ref:Q,label:w("WF_TAKE_ACTION"),onSubmit:()=>B(!M)})),ne?l.createElement(a.Modal,{open:ne,headerBarMain:l.createElement(De,{label:w("WS_PENDING_DUES_LABEL")}),headerBarEnd:l.createElement(Te,{onClick:()=>te(!1)}),center:!0,formId:"modal-action",actionCancelOnSubmit:()=>te(!1),actionCancelLabel:w("CS_COMMON_CANCEL"),actionSaveLabel:w("WS_COMMON_COLLECT_LABEL"),actionSaveOnSubmit:()=>{P.push("/digit-ui/employee/payment/collect/"+("WATER"===V?"WS":"SW")+"/"+encodeURIComponent(H)+"/"+Y+"?tenantId="+Y+"&ISWSCON"),te(!1)},popupStyles:de?{width:"720px"}:{},style:de?{minHeight:"45px",height:"auto",width:"44%"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:de?{paddingLeft:"5px"}:{}},l.createElement("div",{className:"modal-header-ws"},w("WS_CLEAR_DUES_DISCONNECTION_SUB_HEADER_LABEL")," "),l.createElement("div",{className:"modal-body-ws"},l.createElement("span",null,w("WS_COMMON_TABLE_COL_AMT_DUE_LABEL"),": ₹",z||(null==$||null===(L=$.fetchBillsData)||void 0===L||null===(R=L[0])||void 0===R?void 0:R.totalAmount)))):null,ie&&l.createElement(a.Toast,{error:ie.key,label:w(""+ie.label),onClose:me})))},WSActivateConnection:()=>{var e,n,r,u,d,s,c,p,E,S,_,f,C,N,D,T,h,A,I,O,b,L,R,w,W,P,M,x,B,F,U,k,H,j,V,z,Y,G,q,K,X,Z,$,J,Q,ee,ne,te,le,oe,ie,ae,re,ue,de,se,ce,ve,pe,me,Ee,Se,_e,fe,ge,Ce,Ne,ye,De,Te,he,Ae,Ie,Oe,be,Le,Re,we,We,Pe,Me,xe,Be,Fe;const{t:Ue}=o.useTranslation();let{state:ke}=i.useLocation();ke=ke?JSON.parse(ke):{},i.useHistory();let He=g(location.search);const[je,Ve]=t.useState(!1),[ze,Ye]=t.useState(!1),[Ge,qe]=t.useState(null),[Ke,Xe]=t.useState({}),[Ze,$e]=t.useState(!1),[Je,Qe]=l.useState({head:"",body:[]}),en=Digit.ULBService.getStateId();let nn=Digit.ULBService.getCurrentTenantId();nn||Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY");let{data:tn,isLoading:ln}=Digit.Hooks.ws.useWSConfigMDMS.WSActivationConfig(en,{}),on=Lt(null===(e=ke)||void 0===e?void 0:e.data),{isLoading:an,data:rn}=Digit.Hooks.ws.useWSDetailsPage(Ue,nn,null===(n=on)||void 0===n?void 0:n.applicationNo,null===(r=on)||void 0===r?void 0:r.serviceType,{privacy:Digit.Utils.getPrivacyObject()});on=Lt(rn),ke={data:v({},null==rn?void 0:rn.applicationData)};const{mutate:un}=Digit.Hooks.ws.useWSApplicationActions(null==He?void 0:He.service),dn=null!==(u=ke)&&void 0!==u&&null!==(d=u.data)&&void 0!==d&&d.waterSource?Lt(null===(s=ke)||void 0===s||null===(c=s.data)||void 0===c?void 0:c.waterSource):"",sn=dn?m(null==dn?void 0:dn.toUpperCase()," ","_"):"",cn=sn?m(null==sn?void 0:sn.toUpperCase(),".","_"):"",vn="WATER"===(null==He?void 0:He.service)?{connectionType:null!==(p=ke)&&void 0!==p&&null!==(E=p.data)&&void 0!==E&&E.connectionType?{code:null===(S=ke)||void 0===S||null===(_=S.data)||void 0===_?void 0:_.connectionType,i18nKey:"WS_CONNECTIONTYPE_"+m(null===(f=ke)||void 0===f||null===(C=f.data)||void 0===C||null===(N=C.connectionType)||void 0===N?void 0:N.toUpperCase()," ","_")}:"",waterSource:null!==(D=ke)&&void 0!==D&&null!==(T=D.data)&&void 0!==T&&T.waterSource?{code:null===(h=ke)||void 0===h||null===(A=h.data)||void 0===A?void 0:A.waterSource,i18nKey:"WS_SERVICES_MASTERS_WATERSOURCE_"+m(null===(I=ke)||void 0===I||null===(O=I.data)||void 0===O||null===(b=O.waterSource)||void 0===b||null===(L=b.split(".")[0])||void 0===L?void 0:L.toUpperCase()," ","_")}:"",sourceSubData:null!==(R=ke)&&void 0!==R&&null!==(w=R.data)&&void 0!==w&&w.waterSource?{code:null===(W=ke)||void 0===W||null===(P=W.data)||void 0===P?void 0:P.waterSource,i18nKey:"WS_SERVICES_MASTERS_WATERSOURCE_"+cn}:"",pipeSize:null!==(M=ke)&&void 0!==M&&null!==(x=M.data)&&void 0!==x&&x.pipeSize?{code:null===(B=ke)||void 0===B||null===(F=B.data)||void 0===F?void 0:F.pipeSize,i18nKey:null===(U=ke)||void 0===U||null===(k=U.data)||void 0===k?void 0:k.pipeSize}:"",noOfTaps:(null===(H=ke)||void 0===H||null===(j=H.data)||void 0===j?void 0:j.noOfTaps)||"",formDetails:on}:{noOfWaterClosets:(null===(V=ke)||void 0===V||null===(z=V.data)||void 0===z?void 0:z.noOfWaterClosets)||"",noOfToilets:(null===(Y=ke)||void 0===Y||null===(G=Y.data)||void 0===G?void 0:G.noOfToilets)||"",formDetails:on},pn=[{plumberName:(null===(q=ke)||void 0===q||null===(K=q.data)||void 0===K||null===(X=K.plumberInfo)||void 0===X||null===(Z=X[0])||void 0===Z?void 0:Z.name)||"",plumberMobileNo:(null===($=ke)||void 0===$||null===(J=$.data)||void 0===J||null===(Q=J.plumberInfo)||void 0===Q||null===(ee=Q[0])||void 0===ee?void 0:ee.mobileNumber)||"",plumberLicenseNo:(null===(ne=ke)||void 0===ne||null===(te=ne.data)||void 0===te||null===(le=te.plumberInfo)||void 0===le||null===(oe=le[0])||void 0===oe?void 0:oe.licenseNo)||"",detailsProvidedBy:null!==(ie=ke)&&void 0!==ie&&null!==(ae=ie.data)&&void 0!==ae&&null!==(re=ae.additionalDetails)&&void 0!==re&&re.detailsProvidedBy?{i18nKey:"WS_PLUMBER_"+(null===(ue=ke)||void 0===ue||null===(de=ue.data)||void 0===de||null===(se=de.additionalDetails)||void 0===se||null===(ce=se.detailsProvidedBy)||void 0===ce?void 0:ce.toUpperCase()),code:null===(ve=ke)||void 0===ve||null===(pe=ve.data)||void 0===pe||null===(me=pe.additionalDetails)||void 0===me?void 0:me.detailsProvidedBy}:"",applicationNo:null===(Ee=ke)||void 0===Ee||null===(Se=Ee.data)||void 0===Se?void 0:Se.applicationNo,key:Date.now()}],mn="METERED"===(null===(_e=ke)||void 0===_e||null===(fe=_e.data)||void 0===fe||null===(ge=fe.connectionType)||void 0===ge?void 0:ge.toUpperCase())&&"WATER_RECONNECTION"!==(null===(Ce=ke)||void 0===Ce||null===(Ne=Ce.data)||void 0===Ne?void 0:Ne.applicationType)?[{meterId:(null===(ye=ke)||void 0===ye||null===(De=ye.data)||void 0===De?void 0:De.meterId)||"",meterInstallationDate:null!==(Te=ke)&&void 0!==Te&&null!==(he=Te.data)&&void 0!==he&&he.meterInstallationDate?y(null===(Ae=ke)||void 0===Ae||null===(Ie=Ae.data)||void 0===Ie?void 0:Ie.meterInstallationDate):null,meterInitialReading:(null===(Oe=ke)||void 0===Oe||null===(be=Oe.data)||void 0===be||null===(Le=be.additionalDetails)||void 0===Le?void 0:Le.initialMeterReading)||"",connectionExecutionDate:null!==(Re=ke)&&void 0!==Re&&null!==(we=Re.data)&&void 0!==we&&we.connectionExecutionDate?y(null===(We=ke)||void 0===We||null===(Pe=We.data)||void 0===Pe?void 0:Pe.connectionExecutionDate):null}]:[{connectionExecutionDate:null!==(Me=ke)&&void 0!==Me&&null!==(xe=Me.data)&&void 0!==xe&&xe.connectionExecutionDate?y(null===(Be=ke)||void 0===Be||null===(Fe=Be.data)||void 0===Fe?void 0:Fe.connectionExecutionDate):null}],En={formDetails:on,connectionDetails:[vn],plumberDetails:pn,activationDetails:mn};t.useEffect(()=>{an||Xe(on)},[]),t.useEffect(()=>{if(!ln){const e=tn.find(e=>e.hideInCitizen);Qe(e)}},[tn]),t.useEffect(()=>{const e=setTimeout(()=>{Ze&&(window.location.href=window.location.origin+"/digit-ui/employee/ws/application-details?applicationNumber="+(null==He?void 0:He.applicationNumber)+"&service="+(null==He?void 0:He.service))},3e3);return()=>clearTimeout(e)},[Ze]);const Sn=function(e){try{let n=m(e,"/","-"),t="";return t=n.split("-")[2]>1900?n.split("-")[2]+"-"+n.split("-")[1]+"-"+n.split("-")[0]:n.split("-")[0]+"-"+n.split("-")[2]+"-"+n.split("-")[1],Promise.resolve(function(e,n){void 0===n&&(n="dayend");try{const t=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),l=new Date(Date.UTC(t[1],t[3]-1,t[2]));return l.setMinutes(l.getMinutes()+l.getTimezoneOffset()),"dayend"===n&&(l.setHours(l.getHours()+24),l.setSeconds(l.getSeconds()-1)),l.getTime()}catch(n){return e}}(t))}catch(e){return Promise.reject(e)}},_n=()=>{qe(null)};return ze||ln||an?l.createElement(a.Loader,null):l.createElement(l.Fragment,null,l.createElement("div",{style:{marginLeft:"15px"}},l.createElement(a.Header,null,Ue(Je.head))),l.createElement(a.FormComposer,{config:Je.body,userType:"employee",defaultValues:En,onSubmit:function(e){try{const n=function(){if(je){var n,t,l,o,i,a,r,u,d,s,c,p,m,E,S,_,f,g,C,N,y,D,T,h,A,I,O,b,L,R,w,W,P,M,x,B,F,U,k,H,j,V,z,Y,G,q,K,X,Z,$,J,Q,ee,ne,te,le,oe;function ie(){var n,t,l,o;function i(){var n,t,l,o,i,a,r,u,d,s;re.comment=(null==ae||null===(n=ae.comments)||void 0===n?void 0:n.comments)||"",re.action=null==He?void 0:He.action,re.wfDocuments=null!=e&&null!==(t=e.supportingDocuments)&&void 0!==t&&null!==(l=t[0])&&void 0!==l&&l.fileStoreId?[{documentType:"Document - 1",fileStoreId:null==e||null===(o=e.supportingDocuments)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.fileStoreId}]:[],re.processInstance={action:null==He?void 0:He.action,comment:(null==ae||null===(a=ae.comments)||void 0===a?void 0:a.comments)||"",documents:null!=e&&null!==(r=e.supportingDocuments)&&void 0!==r&&null!==(u=r[0])&&void 0!==u&&u.fileStoreId?[{documentType:"Document - 1",fileStoreId:null==e||null===(d=e.supportingDocuments)||void 0===d||null===(s=d[0])||void 0===s?void 0:s.fileStoreId}]:[]},un&&un("WATER"==(null==He?void 0:He.service)?"WATER_RECONNECTION"===(null==re?void 0:re.applicationType)?{WaterConnection:re,reconnectRequest:!0,disconnectRequest:!1}:{WaterConnection:re}:"SEWERAGE_RECONNECTION"===(null==re?void 0:re.applicationType)?{SewerageConnection:re,reconnectRequest:!0,disconnectRequest:!1}:{SewerageConnection:re},{onError:(e,n)=>{qe({key:"error",message:null!=e&&e.message?e.message:e}),setTimeout(_n,5e3)},onSuccess:(e,n)=>{qe({key:!1,message:"WS_ACTIVATE_SUCCESS_MESSAGE_MAIN"}),$e(!0)}})}null!=ae&&null!==(n=ae.activationDetails)&&void 0!==n&&null!==(t=n[0])&&void 0!==t&&t.meterInitialReading&&(re.additionalDetails.initialMeterReading=null==ae||null===(l=ae.activationDetails)||void 0===l||null===(o=l[0])||void 0===o?void 0:o.meterInitialReading);const a=function(e,n,t,l){if(null!=ae&&null!==(e=ae.activationDetails)&&void 0!==e&&null!==(n=e[0])&&void 0!==n&&n.connectionExecutionDate)return Promise.resolve(Sn(null==ae||null===(t=ae.activationDetails)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.connectionExecutionDate)).then(function(e){re.connectionExecutionDate=e})}();return a&&a.then?a.then(i):i()}const ae=Lt(e),re=(null===(n=Object.keys(Ke))||void 0===n?void 0:n.length)>0?v({},Ke):v({},null===(t=on)||void 0===t?void 0:t.applicationData);null!=ae&&null!==(l=ae.connectionDetails)&&void 0!==l&&null!==(o=l[0])&&void 0!==o&&null!==(i=o.connectionType)&&void 0!==i&&i.code&&(re.connectionType=null==ae||null===(a=ae.connectionDetails)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.connectionType)||void 0===u?void 0:u.code),null!=ae&&null!==(d=ae.connectionDetails)&&void 0!==d&&null!==(s=d[0])&&void 0!==s&&null!==(c=s.waterSource)&&void 0!==c&&c.code&&(re.waterSource=null==ae||null===(p=ae.connectionDetails)||void 0===p||null===(m=p[0])||void 0===m||null===(E=m.sourceSubData)||void 0===E?void 0:E.code),null!=ae&&null!==(S=ae.connectionDetails)&&void 0!==S&&null!==(_=S[0])&&void 0!==_&&null!==(f=_.pipeSize)&&void 0!==f&&f.size&&(re.pipeSize=null==ae||null===(g=ae.connectionDetails)||void 0===g||null===(C=g[0])||void 0===C||null===(N=C.pipeSize)||void 0===N?void 0:N.size),null!=ae&&null!==(y=ae.connectionDetails)&&void 0!==y&&null!==(D=y[0])&&void 0!==D&&D.noOfTaps&&(re.noOfTaps=null==ae||null===(T=ae.connectionDetails)||void 0===T||null===(h=T[0])||void 0===h?void 0:h.noOfTaps),null!=ae&&null!==(A=ae.connectionDetails)&&void 0!==A&&null!==(I=A[0])&&void 0!==I&&I.noOfWaterClosets&&(re.noOfWaterClosets=null==ae||null===(O=ae.connectionDetails)||void 0===O||null===(b=O[0])||void 0===b?void 0:b.noOfWaterClosets),null!=ae&&null!==(L=ae.connectionDetails)&&void 0!==L&&null!==(R=L[0])&&void 0!==R&&R.noOfToilets&&(re.noOfToilets=null==ae||null===(w=ae.connectionDetails)||void 0===w||null===(W=w[0])||void 0===W?void 0:W.noOfToilets),null!=ae&&null!==(P=ae.plumberDetails)&&void 0!==P&&null!==(M=P[0])&&void 0!==M&&null!==(x=M.detailsProvidedBy)&&void 0!==x&&x.code&&(re.additionalDetails.detailsProvidedBy=null==ae||null===(B=ae.plumberDetails)||void 0===B||null===(F=B[0])||void 0===F||null===(U=F.detailsProvidedBy)||void 0===U?void 0:U.code),null!=re&&null!==(k=re.plumberInfo)&&void 0!==k&&k[0]||"ULB"!=(null==ae||null===(H=ae.plumberDetails)||void 0===H||null===(j=H.detailsProvidedBy)||void 0===j?void 0:j.code)||(re.plumberInfo=[{}]),null!=ae&&null!==(V=ae.plumberDetails)&&void 0!==V&&null!==(z=V[0])&&void 0!==z&&z.plumberName&&(re.plumberInfo[0].name=null==ae||null===(Y=ae.plumberDetails)||void 0===Y||null===(G=Y[0])||void 0===G?void 0:G.plumberName),null!=ae&&null!==(q=ae.plumberDetails)&&void 0!==q&&null!==(K=q[0])&&void 0!==K&&K.plumberLicenseNo&&(re.plumberInfo[0].licenseNo=null==ae||null===(X=ae.plumberDetails)||void 0===X||null===(Z=X[0])||void 0===Z?void 0:Z.plumberLicenseNo),null!=ae&&null!==($=ae.plumberDetails)&&void 0!==$&&null!==(J=$[0])&&void 0!==J&&J.plumberMobileNo&&(re.plumberInfo[0].mobileNumber=null==ae||null===(Q=ae.plumberDetails)||void 0===Q||null===(ee=Q[0])||void 0===ee?void 0:ee.plumberMobileNo),null!=ae&&null!==(ne=ae.activationDetails)&&void 0!==ne&&null!==(te=ne[0])&&void 0!==te&&te.meterId&&(re.meterId=null==ae||null===(le=ae.activationDetails)||void 0===le||null===(oe=le[0])||void 0===oe?void 0:oe.meterId);const ue=function(e,n,t,l){if(null!=ae&&null!==(e=ae.activationDetails)&&void 0!==e&&null!==(n=e[0])&&void 0!==n&&n.meterInstallationDate)return Promise.resolve(Sn(null==ae||null===(t=ae.activationDetails)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.meterInstallationDate)).then(function(e){re.meterInstallationDate=e})}();return ue&&ue.then?ue.then(ie):ie()}qe({warning:!0,message:"PLEASE_FILL_MANDATORY_DETAILS"}),setTimeout(()=>{qe(!1)},3e3)}();return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},label:Ue("WF_EMPLOYEE_NEWSW1_ACTIVATE_CONNECTION"),onFormValueChange:(e,n,t)=>{Object.keys(t.errors).length>0&&1==Object.keys(t.errors).length&&t.errors.owners&&0==Object.values(t.errors.owners.type).filter(e=>"required"===e.type).length&&Object.getPrototypeOf(t.errors)===Object.prototype?Ve(!0):Ve(!Object.keys(t.errors).length)}}),Ge&&l.createElement(a.Toast,{error:Ge.key,label:Ue(null==Ge?void 0:Ge.message),warning:null==Ge?void 0:Ge.warning,onClose:()=>{qe(null)}}))},WSApplicationDetailsBillAmendment:()=>{var e,n,i,r,u,d,s,c,v,p,m,E;const{applicationNumber:S}=Digit.Hooks.useQueryParams(),_=Digit.ULBService.getCurrentTenantId(),{t:f}=o.useTranslation();let g="WATER";S.includes("SW")&&(g="SEWERAGE");const[C,N]=t.useState(!1),{isLoading:y,data:D}=Digit.Hooks.ws.useWSApplicationDetailsBillAmendment(f,_,S,g),T=Digit.Hooks.useWorkflowDetails({tenantId:_,id:S,moduleCode:null==D||null===(e=D.processInstancesDetails)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.businessService,config:{enabled:!(null==D||null===(i=D.processInstancesDetails)||void 0===i||null===(r=i[0])||void 0===r||!r.businessService)}});null==T||null===(u=T.data)||void 0===u||null===(d=u.actionState)||void 0===d||null===(s=d.nextActions)||void 0===s||s.forEach(e=>{if("RE-SUBMIT"===(null==e?void 0:e.action)){var n;let t="/digit-ui/employee/ws/bill-amendment?connectionNumber="+(null==D||null===(n=D.applicationData)||void 0===n?void 0:n.connectionNo)+"&tenantId="+_+"&isEdit=true";e.redirectionUrll={action:"RE-SUBMIT-APPLICATION",pathname:t,state:{applicationDetails:D,action:"RE-SUBMIT-APPLICATION"}}}});const{isError:h,error:A,isSuccess:I,mutate:O}=Digit.Hooks.ws.useApplicationActionsBillAmendUpdate();t.useEffect(()=>{C&&setTimeout(()=>N(!1),5e3)},[C]);const[b,L]=t.useState(!1),R=[{order:1,label:f("WS_ACK_PDF"),onClick:()=>function(e,n,t,l,o){try{return ie(e,n,t,l).then(e=>Digit.Utils.pdf.generateBillAmendPDF(e)),Promise.resolve()}catch(e){return Promise.reject(e)}}(null==D?void 0:D.amendment,_,f,null==D?void 0:D.applicationDetails)}];return l.createElement(t.Fragment,null,l.createElement("div",{className:"employee-main-application-details"},l.createElement("div",{className:"employee-application-details",style:{marginBottom:"15px"}},l.createElement(a.Header,{styles:{marginLeft:"0px",paddingTop:"10px",fontSize:"32px"}},f("CS_TITLE_GENERATE_NOTE")),R&&R.length>0&&l.createElement(a.MultiLink,{className:"multilinkWrapper employee-mulitlink-main-div",onHeadClick:()=>L(!b),displayOptions:b,options:R,downloadBtnClassName:"employee-download-btn-className",optionsClassName:"employee-options-btn-className"})),l.createElement(Wr,{applicationDetails:D,isLoading:y,isDataLoading:y,applicationData:null==D?void 0:D.applicationData,mutate:O,workflowDetails:T,businessService:null==D||null===(c=D.processInstancesDetails)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.businessService,moduleCode:"WS",showToast:C,setShowToast:N,closeToast:()=>N(null),timelineStatusPrefix:"WF_"+(null==D||null===(p=D.processInstancesDetails)||void 0===p||null===(m=p[0])||void 0===m||null===(E=m.businessService)||void 0===E?void 0:E.toUpperCase())+"_"})),C?l.createElement(a.Toast,{isDleteBtn:!0,error:h?"WS_APPLICATION_UPDATE_ERROR":null,label:I?null==C?void 0:C.label:null==A?void 0:A.Error}):null)},WSSearch:e=>{const[n,i]=t.useState(!0),{t:r}=o.useTranslation(),u=Digit.ULBService.getCurrentTenantId(),[d,s]=t.useState({}),c=Digit.ComponentRegistryService.getComponent("WSSearchApplication"),p=window.location.pathname.includes("water/search-application")?"WS":"SW",[m,E]=t.useState(null),S={enabled:!!(d&&Object.keys(d).length>0)},_=Digit.Hooks.ws.useSearchWS({tenantId:u,filters:d,config:S,bussinessService:p,t:r,shortAddress:!0}),f=window.Digit.Utils.browser.isMobile();return null!=_&&_.isLoading&&f?l.createElement(a.Loader,null):l.createElement(t.Fragment,null,l.createElement(c,{t:r,tenantId:u,onSubmit:function(e){if(!(""!==e.applicationNumber||""!==e.connectionNumber||""!==e.mobileNumber||e.applicationType||e.applicationStatus||e.fromDate||e.toDate))return E({warning:!0,label:"ERR_PT_FILL_VALID_FIELDS"}),void setTimeout(()=>{E(!1)},3e3);var n=new Date(null==e?void 0:e.fromDate);null==n||n.setSeconds((null==n?void 0:n.getSeconds())-19800);var t=new Date(null==e?void 0:e.toDate);null==t||t.setSeconds((null==t?void 0:t.getSeconds())+86399-19800);const l=v({},e,e.toDate?{toDate:null==t?void 0:t.getTime()}:{},e.fromDate?{fromDate:null==n?void 0:n.getTime()}:{});s(Object.keys(l).filter(e=>l[e]).reduce((e,n)=>v({},e,{[n]:"object"==typeof l[n]?l[n].code:l[n]}),{}))},data:0==(null==_||null===(C=_.data)||void 0===C?void 0:C.length)?{display:"ES_COMMON_NO_DATA"}:(null==_||null===(N=_.data)||void 0===N?void 0:N.length)>0?null==_?void 0:_.data:[],count:null==_?void 0:_.count,resultOk:(null==_||null===(g=_.data)||void 0===g?void 0:g.length)>0,businessService:p,isLoading:null==_?void 0:_.isLoading}),m&&l.createElement(a.Toast,{error:m.error,warning:m.warning,label:r(m.label),onClose:()=>{E(null)}}));var g,C,N},WSSearchWater:e=>{var n;const[i,r]=t.useState(!0),{t:u}=o.useTranslation(),d=Digit.ULBService.getCurrentTenantId(),[s,c]=t.useState({}),[p,m]=t.useState(!1),E=Digit.ComponentRegistryService.getComponent("WSSearchWaterConnection"),S=window.location.pathname.includes("water/search-connection")?"WS":"SW",[_,f]=t.useState(null),g=t.useCallback(e=>{const{connectionNumber:n,oldConnectionNumber:t,mobileNumber:l,propertyId:o}=e;n||t||l||o?c(Object.keys(e).filter(n=>e[n]).reduce((n,t)=>v({},n,{[t]:"object"==typeof e[t]?e[t].code:e[t]}),{})):(f({error:!0,label:"WS_HOME_SEARCH_CONN_RESULTS_DESC"}),setTimeout(()=>{f(!1)},3e3))}),C={enabled:!!(s&&Object.keys(s).length>0)};let N=Digit.Hooks.ws.useSearchWS({tenantId:d,filters:s,config:C,bussinessService:S,t:u,shortAddress:!0});const y=window.Digit.Utils.browser.isMobile();return null!=N&&N.isLoading&&y?l.createElement(a.Loader,null):(null!=N&&N.isLoading||(N.data=null==N||null===(n=N.data)||void 0===n?void 0:n.map(e=>{var n,t;return null!=e&&null!==(n=e.connectionNo)&&void 0!==n&&n.includes("WS")?e.service="WATER":null!=e&&null!==(t=e.connectionNo)&&void 0!==t&&t.includes("SW")&&(e.service="SEWERAGE"),e})),l.createElement(t.Fragment,null,l.createElement(E,{t:u,tenantId:d,onSubmit:g,data:0==(null==N||null===(T=N.data)||void 0===T?void 0:T.length)?{display:"ES_COMMON_NO_DATA"}:(null==N||null===(h=N.data)||void 0===h?void 0:h.length)>0?null==N?void 0:N.data:[],count:null==N?void 0:N.count,resultOk:(null==N||null===(D=N.data)||void 0===D?void 0:D.length)>0,businessService:S,isLoading:null==N?void 0:N.isLoading}),_&&l.createElement(a.Toast,{error:_.error,warning:_.warning,label:u(_.label),onClose:()=>{f(null)}})));var D,T,h},WSEditApplication:()=>{var e,n,r,u,d,s,c,p;const{t:m}=o.useTranslation();let{state:E}=i.useLocation();E=E?"string"==typeof E?JSON.parse(E):E:{},i.useHistory();let S=g(location.search);const[_,f]=t.useState(!1),[C,N]=t.useState(null),[y,D]=t.useState({}),[T,h]=t.useState({head:"",body:[]}),[A,I]=t.useState(!0),[O,b]=t.useState(!1);let L=Digit.ULBService.getCurrentTenantId();L||Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY");const w=JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")),W=(null==S?void 0:S.service)||(null==w||null===(e=w.applicationData)||void 0===e?void 0:e.serviceType);let P=Lt(null===(n=E)||void 0===n||null===(r=n.data)||void 0===r?void 0:r.applicationDetails);const M=Lt(null===(u=E)||void 0===u||null===(d=u.data)||void 0===d?void 0:d.action),x=Digit.ULBService.getStateId();let{data:B,isLoading:F}=Digit.Hooks.ws.useWSConfigMDMS.WSCreateConfig(x,{}),{isLoading:k,data:H}=Digit.Hooks.ws.useWSDetailsPage(m,L,null===(s=P)||void 0===s?void 0:s.applicationNo,null===(c=P)||void 0===c||null===(p=c.applicationData)||void 0===p?void 0:p.serviceType,{privacy:Digit.Utils.getPrivacyObject()});P=H;const[j,V]=t.useState(new URLSearchParams(i.useLocation().search).get("propertyId")),[z,Y,G]=Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM",{}),{data:q}=Digit.Hooks.pt.usePropertySearch({filters:{propertyIds:j},tenantId:L},{filters:{propertyIds:j},tenantId:L,enabled:!(!j||""==j),privacy:Digit.Utils.getPrivacyObject()});t.useEffect(()=>{if(!F){var e;const n=B.find(e=>e.hideInCitizen&&e.isEdit);n.head="WS_APP_FOR_WATER_AND_SEWERAGE_EDIT_LABEL";let t=[];null==n||null===(e=n.body)||void 0===e||e.forEach(e=>{null!=e&&e.isEditConnection&&t.push(e)}),n.body=t,h(n)}},[B]),t.useEffect(()=>{var e,n,t,l;!j&&(null==z||null===(e=z.cpt)||void 0===e||null===(n=e.details)||void 0===n?void 0:n.propertyId)&&V(null==z||null===(t=z.cpt)||void 0===t||null===(l=t.details)||void 0===l?void 0:l.propertyId)},[null==z?void 0:z.cpt]),t.useEffect(function(){try{const e=!!sessionStorage.getItem("IsDetailsExists")&&JSON.parse(sessionStorage.getItem("IsDetailsExists")),n=function(n,t){if(null!==(n=P)&&void 0!==n&&null!==(t=n.applicationData)&&void 0!==t&&t.id&&!e)return sessionStorage.setItem("appData",JSON.stringify(y)),Promise.resolve(R(P,W,!1,!1,m)).then(function(e){Y(v({},z,e)),D(v({},e)),sessionStorage.setItem("IsDetailsExists",JSON.stringify(!0))})}();return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[P,H,null==z?void 0:z.cpt,z,q]),t.useEffect(()=>{var e;Y(v({},z,{cpt:{details:null==q||null===(e=q.Properties)||void 0===e?void 0:e[0]}}))},[q]),t.useEffect(()=>{var e,n,t,l,o,i,a;((null==z||null===(e=z.DocumentsRequired)||void 0===e||null===(n=e.documents)||void 0===n?void 0:n.length)>0||null!=z&&null!==(t=z.ConnectionDetails)&&void 0!==t&&null!==(l=t[0])&&void 0!==l&&l.water||null!=z&&null!==(o=z.ConnectionDetails)&&void 0!==o&&null!==(i=o[0])&&void 0!==i&&i.sewerage||null!=z&&null!==(a=z.cpt)&&void 0!==a&&a.details&&!k)&&I(!1)},[q,z,null==z?void 0:z.cpt]),t.useEffect(()=>{const e=setTimeout(()=>{var e,n,t,l,o;O&&(window.location.href=window.location.origin+"/digit-ui/employee/ws/application-details?applicationNumber="+(null==z||null===(e=z.ConnectionDetails)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.applicationNo)+"&service="+(null==z||null===(t=z.ConnectionDetails)||void 0===t||null===(l=t[0])||void 0===l||null===(o=l.serviceName)||void 0===o?void 0:o.toUpperCase()))},5e3);return()=>clearTimeout(e)},[O]);const{mutate:K}=Digit.Hooks.ws.useWSApplicationActions(W);return A||F?l.createElement(a.Loader,null):l.createElement(l.Fragment,null,l.createElement("div",{style:{marginLeft:"15px"}},l.createElement(a.Header,null,m(T.head))),l.createElement(a.FormComposer,{config:T.body,userType:"employee",onFormValueChange:(e,n,t)=>{var l,o;U.isEqual(z,n)||Y(v({},z,n)),Object.keys(t.errors).length>0&&1==Object.keys(t.errors).length&&t.errors.owners&&0==Object.values(t.errors.owners.type).filter(e=>"required"===e.type).length&&(null==n||null===(l=n.cpt)||void 0===l||null===(o=l.details)||void 0===o||!o.propertyId)?f(!0):f(!Object.keys(t.errors).length)},label:m("CS_COMMON_SUBMIT"),onSubmit:function(e){try{const n=function(){if(_){const n=sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")?JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")):{};return Promise.resolve(function(e,n,t){try{var l,o,i,a,r,u,d,s,c,p,m,E,S,_,f,g,C,N,y,D,T,h,A,I,O,b,L,R,w,W,P,M,x,B,F,U,k,H,j,V,z,Y,G,q,K,X,Z,$,J,Q;null==e||null===(l=e.cpt)||void 0===l||null===(o=l.details)||void 0===o||null===(i=o.owners)||void 0===i||i.forEach(e=>{null!=e&&e.permanentAddress&&(e.correspondenceAddress=null==e?void 0:e.permanentAddress)});let ee=v({},n.applicationData,{propertyId:null==e||null===(a=e.cpt)||void 0===a||null===(r=a.details)||void 0===r?void 0:r.propertyId,proposedTaps:(null==e||null===(u=e.ConnectionDetails)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.proposedTaps)&&Number(null==e||null===(s=e.ConnectionDetails)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.proposedTaps),proposedPipeSize:(null==e||null===(p=e.ConnectionDetails)||void 0===p||null===(m=p[0])||void 0===m||null===(E=m.proposedPipeSize)||void 0===E?void 0:E.size)&&Number(null==e||null===(S=e.ConnectionDetails)||void 0===S||null===(_=S[0])||void 0===_||null===(f=_.proposedPipeSize)||void 0===f?void 0:f.size),proposedWaterClosets:(null==e||null===(g=e.ConnectionDetails)||void 0===g||null===(C=g[0])||void 0===C?void 0:C.proposedWaterClosets)&&Number(null==e||null===(N=e.ConnectionDetails)||void 0===N||null===(y=N[0])||void 0===y?void 0:y.proposedWaterClosets),proposedToilets:(null==e||null===(D=e.ConnectionDetails)||void 0===D||null===(T=D[0])||void 0===T?void 0:T.proposedToilets)&&Number(null==e||null===(h=e.ConnectionDetails)||void 0===h||null===(A=h[0])||void 0===A?void 0:A.proposedToilets),connectionHolders:null!=e&&null!==(I=e.ConnectionHolderDetails)&&void 0!==I&&null!==(O=I[0])&&void 0!==O&&O.sameAsOwnerDetails?null:[v({},null==n||null===(b=n.applicationData)||void 0===b||null===(L=b.connectionHolders)||void 0===L?void 0:L[0],{correspondenceAddress:(null==e||null===(R=e.ConnectionHolderDetails)||void 0===R||null===(w=R[0])||void 0===w?void 0:w.address)||"",fatherOrHusbandName:(null==e||null===(W=e.ConnectionHolderDetails)||void 0===W||null===(P=W[0])||void 0===P?void 0:P.guardian)||"",gender:(null==e||null===(M=e.ConnectionHolderDetails)||void 0===M||null===(x=M[0])||void 0===x||null===(B=x.gender)||void 0===B?void 0:B.code)||"",mobileNumber:(null==e||null===(F=e.ConnectionHolderDetails)||void 0===F||null===(U=F[0])||void 0===U?void 0:U.mobileNumber)||"",name:(null==e||null===(k=e.ConnectionHolderDetails)||void 0===k||null===(H=k[0])||void 0===H?void 0:H.name)||"",emailId:(null==e||null===(j=e.ConnectionHolderDetails)||void 0===j||null===(V=j[0])||void 0===V?void 0:V.emailId)||"",ownerType:(null==e||null===(z=e.ConnectionHolderDetails)||void 0===z||null===(Y=z[0])||void 0===Y||null===(G=Y.ownerType)||void 0===G?void 0:G.code)||"",relationship:(null==e||null===(q=e.ConnectionHolderDetails)||void 0===q||null===(K=q[0])||void 0===K||null===(X=K.relationship)||void 0===X?void 0:X.code)||"",sameAsPropertyAddress:null==e||null===(Z=e.ConnectionHolderDetails)||void 0===Z||null===($=Z[0])||void 0===$?void 0:$.sameAsOwnerDetails})],property:null==e||null===(J=e.cpt)||void 0===J?void 0:J.details,processInstance:{action:t||"RESUBMIT_APPLICATION"},action:t||"RESUBMIT_APPLICATION",documents:null==e||null===(Q=e.DocumentsRequired)||void 0===Q?void 0:Q.documents});return Promise.resolve(ee)}catch(e){return Promise.reject(e)}}(e,n,M)).then(function(t){var l,o,i,a,r,u;const d="WATER"==(null==e||null===(l=e.ConnectionDetails)||void 0===l||null===(o=l[0])||void 0===o?void 0:o.serviceName)?{WaterConnection:t}:{SewerageConnection:t};var s;f(!1),null!=n&&null!==(i=n.processInstancesDetails)&&void 0!==i&&null!==(a=i[0])&&void 0!==a&&null!==(r=a.state)&&void 0!==r&&null!==(u=r.applicationStatus)&&void 0!==u&&u.includes("CITIZEN_ACTION")?K&&K(d,{onError:(e,n)=>{N({key:"error",message:null!=e&&e.message?e.message:e}),setTimeout(closeToastOfError,5e3),f(!0)},onSuccess:(e,n)=>{N({key:!1,message:"WS_APPLICATION_SUBMITTED_SUCCESSFULLY_LABEL"}),b(!0)}}):(sessionStorage.setItem("redirectedfromEDIT",!0),sessionStorage.setItem("WS_SESSION_APPLICATION_DETAILS",JSON.stringify(t)),window.location.assign(""+window.location.origin+(null===(s=E)||void 0===s?void 0:s.url)))})}N({warning:!0,message:"PLEASE_FILL_MANDATORY_DETAILS"}),setTimeout(()=>{N(!1)},3e3)}();return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},defaultValues:z,appData:y}),C&&l.createElement(a.Toast,{error:C.key,label:m(null==C?void 0:C.message),warning:null==C?void 0:C.warning,onClose:()=>{N(null)}}))},WSConsumptionDetails:e=>{var n,i,r,u,d,s,c;const{t:p}=o.useTranslation(),m=Digit.UserService.getUser(),E=(null==m||null===(n=m.info)||void 0===n?void 0:n.tenantId)||Digit.ULBService.getCurrentTenantId();let S=g(location.search);const{applicationNo:_}=Digit.Hooks.useQueryParams(),f=null==S?void 0:S.service;let C={tenantId:E,connectionNos:_};const[N,y]=t.useState(!1),[D,T]=t.useState({}),[h,A]=t.useState({}),I="WATER"===f?"WS":"SW",O=!!Digit.Utils.browser.isMobile(),[b,L]=t.useState(""),[R,w]=t.useState(null),[W,P]=t.useState(null),[M,x]=t.useState(!1),[B,F]=t.useState(""),[U,k]=t.useState(""),[H,j]=t.useState(""),[V,z]=t.useState(!1),Y=Digit.UserService.getUser().info.roles.map(e=>e.code).filter(e=>"WS_CEMP"===e||"SW_CEMP"===e).length>0,{isLoading:G,data:q}=Digit.Hooks.ws.useWSConsumptionSearch({filters:C},{filters:C}),{isLoading:K,data:X}=Digit.Hooks.ws.useGetMeterStatusList(E),{isLoading:Z,data:$}=Digit.Hooks.ws.useGetBillingPeriodValidation(E);let J={connectionNumber:_};const{isLoading:Q,data:ee}=Digit.Hooks.ws.useOldValue({tenantId:E,filters:v({},J),businessService:"WS"===I?"WATER":"SEWERAGE"}),{mutate:ne}=Digit.Hooks.ws.useMeterReadingCreateAPI(I);t.useEffect(()=>{if(!Q){let e="WS"==I?null==ee?void 0:ee.WaterConnection:null==ee?void 0:ee.SewerageConnections,n=null==e?void 0:e.filter(e=>{var n;return null==e||null===(n=e.applicationType)||void 0===n?void 0:n.includes("DISCONNECT")});0==(null==n?void 0:n.length)&&z(!0),null==n||n.map(e=>{z("DISCONNECTION_EXECUTED"!==(null==e?void 0:e.applicationStatus)&&"PENDING_FOR_DISCONNECTION_EXECUTION"!==(null==e?void 0:e.applicationStatus))})}},[ee]);const te=function(e,n){void 0===n&&(n="dayend");try{const t=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),l=new Date(Date.UTC(t[1],t[2]-1,t[3]));return l.setMinutes(l.getMinutes()+l.getTimezoneOffset()),"dayend"===n&&(l.setHours(l.getHours()+24),l.setSeconds(l.getSeconds()-1)),l.getTime()}catch(n){return e}},le=(null==$||null===(i=$.MdmsRes)||void 0===i||null===(r=i["ws-services-masters"])||void 0===r||r.billingPeriod.filter(e=>"Metered"===e.connectionType),()=>{y(!1)}),oe=()=>{w(!1),P(null)};let ie=null==X||null===(u=X.MdmsRes)||void 0===u||null===(d=u["ws-services-calculation"])||void 0===d?void 0:d.MeterStatus.map(e=>({code:e,i18nKey:"WS_SERVICES_CALCULATION_METERSTATUS_"+Digit.Utils.locale.getTransformedLocale(e)})),ae={},re={};const ue=e=>e?new Date(e).getDate()+"/"+(new Date(e).getMonth()+1)+"/"+new Date(e).getFullYear().toString():"NA",de=null==q?void 0:q.meterReadings,se={label:{heading:"WS_CONSUMPTION_BUTTON_METER_READING_LABEL",submit:"CORE_COMMON_SAVE",cancel:"CORE_CHANGE_TENANT_CANCEL"},form:[{body:[{populators:l.createElement(a.StatusTable,null,l.createElement(a.Row,{key:p("WS_VIEW_BILL_BILLING_PERIOD_LABEL"),label:""+p("WS_VIEW_BILL_BILLING_PERIOD_LABEL"),text:H,className:"border-none"}))},{label:""+p("WS_SERV_DETAIL_METER_STAT"),isMandatory:!0,type:"dropdown",populators:l.createElement(a.Dropdown,{option:ie,autoComplete:"off",optionKey:"i18nKey",id:"meterStatus",select:e=>{L(e),k("")},selected:b,t:p})},{populators:l.createElement(a.StatusTable,null,l.createElement(a.Row,{key:p("WS_CONSUMPTION_DETAILS_LAST_READING_LABEL"),label:""+p("WS_CONSUMPTION_DETAILS_LAST_READING_LABEL"),text:null==de||null===(s=de[0])||void 0===s?void 0:s.currentReading,className:"border-none"}))},{populators:l.createElement(a.StatusTable,null,l.createElement(a.Row,{key:p("WS_CONSUMPTION_DETAILS_LAST_READING_DATE_LABEL"),label:""+p("WS_CONSUMPTION_DETAILS_LAST_READING_DATE_LABEL"),text:ue(null==de||null===(c=de[0])||void 0===c?void 0:c.currentReadingDate),className:"border-none"}))},{label:p("WS_CONSUMPTION_DETAILS_CURRENT_READING_LABEL"),isMandatory:"Working"===b.code,disable:"Working"!==b.code,type:"number",populators:v({name:"currentReading"},ae="Working"===b.code?{}:{value:""})},{label:p("WS_CONSUMPTION_DETAILS_CURRENT_READING_DATE_LABEL"),isMandatory:"Working"===b.code,disable:"Working"!==b.code,type:"custom",populators:{name:"currentReadingDate",validation:{required:"Working"===b.code},customProps:{},defaultValue:Digit.Utils.date.getDate(),component:(e,n)=>l.createElement(a.DatePicker,v({onChange:e.onChange,date:e.value},n,{disabled:"Working"!==b.code}))}},{label:p("WS_SERV_DETAIL_CONSUMP"),isMandatory:!1,type:"number",disable:"Working"===b.code,populators:v({},re="Working"===b.code?{name:"consumption",value:U}:{name:"consumption"})}]}]},ce=e=>l.createElement("h1",{className:"heading-m"},e.label),ve=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),pe=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ve,null));if(G||Q)return l.createElement(a.Loader,null);let{meterReadings:me}=q||{};return l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement(a.Header,{styles:{marginLeft:"15px"}},""+p("WS_VIEW_CONSUMPTION")),l.createElement("div",null,(null==me?void 0:me.length)>0&&me.map((e,n)=>{return l.createElement("div",{key:n},l.createElement(a.Card,null,l.createElement(a.StatusTable,null,l.createElement(a.Row,{key:p("WS_MYCONNECTIONS_CONSUMER_NO"),label:""+p("WS_MYCONNECTIONS_CONSUMER_NO"),text:(null==e?void 0:e.connectionNo)||p("NA"),className:"border-none"}),l.createElement(a.Row,{key:p("WS_VIEW_BILL_BILLING_PERIOD_LABEL"),label:""+p("WS_VIEW_BILL_BILLING_PERIOD_LABEL"),text:(null==e?void 0:e.billingPeriod)||p("NA"),className:"border-none"}),l.createElement(a.Row,{key:p("WS_CONSUMPTION_DETAILS_METER_STATUS_LABEL"),label:""+p("WS_CONSUMPTION_DETAILS_METER_STATUS_LABEL"),text:(null==e?void 0:e.meterStatus)||p("NA"),className:"border-none"}),l.createElement(a.Row,{key:p("WS_CONSUMPTION_DETAILS_LAST_READING_LABEL"),label:""+p("WS_CONSUMPTION_DETAILS_LAST_READING_LABEL"),text:(null==e?void 0:e.lastReading)||p("NA"),className:"border-none"}),l.createElement(a.Row,{key:p("WS_CONSUMPTION_DETAILS_LAST_READING_DATE_LABEL"),label:""+p("WS_CONSUMPTION_DETAILS_LAST_READING_DATE_LABEL"),text:null!=e&&e.lastReadingDate?Digit.DateUtils.ConvertEpochToDate(null==e?void 0:e.lastReadingDate):p("NA"),className:"border-none"}),l.createElement(a.Row,{key:p("WS_SERV_DETAIL_CUR_METER_READ"),label:""+p("WS_SERV_DETAIL_CUR_METER_READ"),text:(null==e?void 0:e.currentReading)||p("NA"),className:"border-none"}),l.createElement(a.Row,{key:p("WS_CONSUMPTION_DETAILS_CURRENT_READING_DATE_LABEL"),label:""+p("WS_CONSUMPTION_DETAILS_CURRENT_READING_DATE_LABEL"),text:null!=e&&e.currentReadingDate?Digit.DateUtils.ConvertEpochToDate(null==e?void 0:e.currentReadingDate):p("NA"),className:"border-none"}),l.createElement(a.Row,{key:p("WS_CONSUMPTION_DETAILS_CONSUMPTION_LABEL"),label:""+p("WS_CONSUMPTION_DETAILS_CONSUMPTION_LABEL"),text:(t=null==e?void 0:e.currentReading,o=null==e?void 0:e.lastReading,t&&o?Number(t-o):p("NA")),className:"border-none"}))));var t,o}),!(null!=me&&me.length)>0&&l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},p("WS_NO_CONSUMPTION_FOUND"))),G||K||Z||!Y?null:l.createElement("div",null,V&&l.createElement(a.ActionBar,null,l.createElement(a.SubmitBar,{label:p("WS_CONSUMPTION_BUTTON_METER_READING_LABEL"),onSubmit:()=>{var e,n;y(!0),T(null==q?void 0:q.meterReadings[0]),L({code:null==q||null===(e=q.meterReadings[0])||void 0===e?void 0:e.meterStatus,i18nKey:"WS_SERVICES_CALCULATION_METERSTATUS_"+Digit.Utils.locale.getTransformedLocale(null==q||null===(n=q.meterReadings[0])||void 0===n?void 0:n.meterStatus)}),j(ue(null==D?void 0:D.currentReadingDate)+" - "+ue(te(Digit.Utils.date.getDate())))}})))),N&&l.createElement(a.Modal,{headerBarMain:l.createElement(ce,{label:p(se.label.heading)}),headerBarEnd:l.createElement(pe,{onClick:le}),actionCancelLabel:p(se.label.cancel),actionCancelOnSubmit:le,actionSaveLabel:p(se.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",popupStyles:O?{width:"720px"}:{},popupModuleMianStyles:O?{paddingLeft:"5px"}:{}},M?l.createElement(a.Loader,null):l.createElement(a.FormComposer,{config:se.form,onFormValueChange:(e,n,t)=>{var l,o;"Working"===(null==b?void 0:b.code)?(F(null==n?void 0:n.currentReading),j(ue(null==D?void 0:D.currentReadingDate)+" - "+ue(null==n?void 0:n.currentReadingDate)),parseInt(B)<parseInt(null==de||null===(l=de[0])||void 0===l?void 0:l.lastReading)?(n.consumption="0",k("0")):(n.consumption=""+(parseInt(B)-parseInt(null==de||null===(o=de[0])||void 0===o?void 0:o.currentReading)),k(n.consumption))):k(n.consumption)},cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){try{let t=parseInt(null==D?void 0:D.currentReadingDate),l=parseInt(te(null==e?void 0:e.currentReadingDate)),o=parseInt(te(Digit.Utils.date.getDate()));if("Working"===(null==b?void 0:b.code)){var n;if(null==e||!e.currentReading||null==(null==e?void 0:e.currentReading)||""===(null==e?void 0:e.currentReading))return w({key:"error",message:p("ERR_CURRENT_READING_REQUIRED")}),P(p("ERR_CURRENT_READING_REQUIRED")),setTimeout(oe,5e3),Promise.resolve();if(l<t||l>o)return w({key:"error",message:p("ERR_CURRENT_READING_DATE_SHOULD_NOT_BE_LESS_THAN_FROM_DATE_AND_NOT_GREATER_THAN_TO_DATE")}),P(p("ERR_CURRENT_READING_DATE_SHOULD_NOT_BE_LESS_THAN_FROM_DATE_AND_NOT_GREATER_THAN_TO_DATE")),setTimeout(oe,5e3),Promise.resolve();if((null==e?void 0:e.currentReading)<=(null==de||null===(n=de[0])||void 0===n?void 0:n.currentReading))return w({key:"error",message:p("CURRENT_READING_ERROR")}),P(p("CURRENT_READING_ERROR")),setTimeout(oe,5e3),Promise.resolve()}else e.currentReading=parseInt(null==D?void 0:D.currentReading)+parseInt(null==e?void 0:e.consumption);let i={meterReadings:{billingPeriod:ue(null==D?void 0:D.currentReadingDate)+" - "+ue(null==e?void 0:e.currentReadingDate),connectionNo:null==D?void 0:D.connectionNo,currentReading:null==e?void 0:e.currentReading,currentReadingDate:te(null==e?void 0:e.currentReadingDate),lastReading:null==D?void 0:D.currentReading,lastReadingDate:null==D?void 0:D.currentReadingDate,meterStatus:null==b?void 0:b.code,tenantId:null==D?void 0:D.tenantId}};const a=function(){if(ne)return x(!0),Promise.resolve(ne(i,{onError:(e,n)=>{x(!1),y(!1),w({key:"error",message:null!=e&&e.message?e.message:e}),setTimeout(oe,5e3)},onSuccess:function(e,n){try{return x(!1),y(!1),w({key:"success",message:"WS_METER_READING_ADDED_SUCCESFULLY"}),setTimeout(oe,3e3),setTimeout(()=>{window.location.reload()},4e3),Promise.resolve()}catch(e){return Promise.reject(e)}}})).then(function(){})}();return Promise.resolve(a&&a.then?a.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},defaultValues:h,formId:"modal-action"})),R&&l.createElement(a.Toast,{style:{zIndex:"10000"},error:"error"===(null==R?void 0:R.key),label:p(null==R?void 0:R.message),onClose:oe}))},WSModifyApplication:()=>{var e,n,r,u;const{t:d}=o.useTranslation();let{state:s}=i.useLocation();s=s?"string"==typeof s?JSON.parse(s):s:{};const c=i.useHistory();let p=g(location.search);const[m,E]=t.useState(!1),[S,_]=t.useState(null),[f,C]=t.useState({}),[N,y]=t.useState({head:"",body:[]}),[D,T]=t.useState(!0),[A,I]=t.useState(!1),[O,b]=t.useState(!1);let L=Digit.ULBService.getCurrentTenantId();const w=null==p?void 0:p.service,W=Digit.ULBService.getStateId();let{data:P,isLoading:x}=Digit.Hooks.ws.useWSConfigMDMS.WSCreateConfig(W,{}),B=Lt(null===(e=s)||void 0===e?void 0:e.data),{data:F}=Digit.Hooks.ws.useWSDetailsPage(d,L,null===(n=B)||void 0===n?void 0:n.applicationNo,null===(r=B)||void 0===r||null===(u=r.applicationData)||void 0===u?void 0:u.serviceType,{privacy:Digit.Utils.getPrivacyObject()});B=F;const[k,H]=t.useState(new URLSearchParams(i.useLocation().search).get("propertyId")),[j,V,z]=Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM",{}),{data:Y}=Digit.Hooks.pt.usePropertySearch({filters:{propertyIds:k},tenantId:L},{filters:{propertyIds:k},tenantId:L,enabled:!(!k||""==k),privacy:Digit.Utils.getPrivacyObject()});t.useEffect(()=>{if(!x){var e;const n=P.find(e=>e.hideInCitizen&&e.isModify);n.head="WS_WATER_AND_SEWERAGE_MODIFY_CONNECTION_LABEL";let t=[];null==n||null===(e=n.body)||void 0===e||e.forEach(e=>{null!=e&&e.isModifyConnection&&t.push(e)}),t.forEach(e=>{"WS_COMMON_PROPERTY_DETAILS"==(null==e?void 0:e.head)&&(e.head="")}),n.body=t,y(n)}},[P]),t.useEffect(()=>{var e,n,t,l;!k&&(null==j||null===(e=j.cpt)||void 0===e||null===(n=e.details)||void 0===n?void 0:n.propertyId)&&H(null==j||null===(t=j.cpt)||void 0===t||null===(l=t.details)||void 0===l?void 0:l.propertyId)},[null==j?void 0:j.cpt]),t.useEffect(function(){try{sessionStorage.getItem("IsDetailsExists")&&JSON.parse(sessionStorage.getItem("IsDetailsExists"));const e=function(e,n){if(null!==(e=B)&&void 0!==e&&null!==(n=e.applicationData)&&void 0!==n&&n.id)return Promise.resolve(R(B,w,!0,void 0,d)).then(function(e){V(v({},j,e)),C(v({},e)),sessionStorage.setItem("IsDetailsExists",JSON.stringify(!0))})}();return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[B,F]),t.useEffect(()=>{var e;V(v({},j,{cpt:{details:null==Y||null===(e=Y.Properties)||void 0===e?void 0:e[0]}}))},[Y]),t.useEffect(()=>{var e,n;null!=j&&null!==(e=j.ConnectionDetails)&&void 0!==e&&null!==(n=e[0])&&void 0!==n&&n.applicationNo&&T(!1)},[Y,j,null==j?void 0:j.cpt]),t.useEffect(()=>{const e=setTimeout(()=>{var e,n,t,l,o;A&&(window.location.href=window.location.origin+"/digit-ui/employee/ws/application-details?applicationNumber="+(null==j||null===(e=j.ConnectionDetails)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.applicationNo)+"&service="+(null==j||null===(t=j.ConnectionDetails)||void 0===t||null===(l=t[0])||void 0===l||null===(o=l.serviceName)||void 0===o?void 0:o.toUpperCase()))},3e3);return()=>clearTimeout(e)},[A]);const{mutate:G}=Digit.Hooks.ws.useWaterCreateAPI("WATER"),{mutate:q}=Digit.Hooks.ws.useWSApplicationActions("WATER"),{mutate:K}=Digit.Hooks.ws.useWaterCreateAPI("SEWERAGE"),{mutate:X}=Digit.Hooks.ws.useWSApplicationActions("SEWERAGE");return D||O||x?l.createElement(a.Loader,null):l.createElement(l.Fragment,null,l.createElement("div",{style:{marginLeft:"15px"}},l.createElement(a.Header,null,d(N.head))),l.createElement(a.FormComposer,{config:N.body,userType:"employee",onFormValueChange:(e,n,t)=>{var l,o;U.isEqual(j,n)||V(v({},j,n)),Object.keys(t.errors).length>0&&1==Object.keys(t.errors).length&&t.errors.owners&&0==Object.values(t.errors.owners.type).filter(e=>"required"===e.type).length&&(null==n||null===(l=n.cpt)||void 0===l||null===(o=l.details)||void 0===o||!o.propertyId)?E(!0):E(!Object.keys(t.errors).length)},label:d("CS_COMMON_SUBMIT"),onSubmit:function(e){try{var n,t,l;if(!(null!=e&&null!==(n=e.cpt)&&void 0!==n&&n.id||null!=Y&&null!==(t=Y.Properties)&&void 0!==t&&t[0]||null!=e&&null!==(l=e.cpt)&&void 0!==l&&l.details&&Y))return _({key:"error",message:"ERR_INVALID_PROPERTY_ID"}),Promise.resolve();const o=function(){if(m){var n,t;null!=e&&null!==(n=e.cpt)&&void 0!==n&&n.details||(e.cpt={details:null==Y||null===(t=Y.Properties)||void 0===t?void 0:t[0]});const l=sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")?JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")):{};return Promise.resolve(M(e,l)).then(function(n){var t,l,o,i,a;function r(){const e=function(){if("WATER"!==w){const e=function(){if(K)return b(!0),Promise.resolve(K(u,{onError:(e,n)=>{var t,l,o,i,a,r,u,d;b(!1),_({key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&null!==(i=o[0])&&void 0!==i&&i.message?null==e||null===(a=e.response)||void 0===a||null===(r=a.data)||void 0===r||null===(u=r.Errors)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.message:e}),setTimeout(closeToastOfError,5e3)},onSuccess:function(e,n){try{var t;return Promise.resolve(h(null==e||null===(t=e.SewerageConnections)||void 0===t?void 0:t[0],"SEWERAGE")).then(function(e){return Promise.resolve(X({SewerageConnection:e,reconnectRequest:!1,disconnectRequest:!1},{onError:(e,n)=>{b(!1),_({key:"error",message:null!=e&&e.message?e.message:e}),setTimeout(closeToastOfError,5e3)},onSuccess:(e,n)=>{var t,l;z(),c.push("/digit-ui/employee/ws/ws-response?applicationNumber1="+(null==e||null===(t=e.SewerageConnections)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.applicationNo))}})).then(function(){})})}catch(e){return Promise.reject(e)}}})).then(function(){})}();if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}const u="WATER"==(null==e||null===(t=e.ConnectionDetails)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.serviceName)?"WATER_RECONNECTION"===(null==e||null===(o=e.ConnectionDetails)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.applicationType)?{WaterConnection:n,reconnectRequest:!0,disconnectRequest:!1}:{WaterConnection:n,reconnectRequest:!1,disconnectRequest:!1}:"SEWERAGE_RECONNECTION"===(null===(a=formData)||void 0===a?void 0:a.applicationType)?{SewerageConnection:n,reconnectRequest:!0,disconnectRequest:!1}:{SewerageConnection:n,reconnectRequest:!1,disconnectRequest:!1},d=function(){if("WATER"==w){const e=function(){if(G)return b(!0),Promise.resolve(G(u,{onError:(e,n)=>{var t,l,o,i,a,r;b(!1),_({key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&o[0].message?null==e||null===(i=e.response)||void 0===i||null===(a=i.data)||void 0===a||null===(r=a.Errors)||void 0===r?void 0:r[0].message:e}),setTimeout(closeToastOfError,5e3)},onSuccess:function(e,n){try{var t;return Promise.resolve(h(null==e||null===(t=e.WaterConnection)||void 0===t?void 0:t[0],"WATER")).then(function(e){q({WaterConnection:e,reconnectRequest:!1,disconnectRequest:!1},{onError:(e,n)=>{var t,l,o,i,a,r;b(!1),_({key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&o[0].message?null==e||null===(i=e.response)||void 0===i||null===(a=i.data)||void 0===a||null===(r=a.Errors)||void 0===r?void 0:r[0].message:e}),setTimeout(closeToastOfError,5e3)},onSuccess:(e,n)=>{var t,l;z(),c.push("/digit-ui/employee/ws/ws-response?applicationNumber="+(null==e||null===(t=e.WaterConnection)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.applicationNo))}})})}catch(e){return Promise.reject(e)}}})).then(function(){})}();if(e&&e.then)return e.then(function(){})}}();return d&&d.then?d.then(r):r()})}_({warning:!0,message:"PLEASE_FILL_MANDATORY_DETAILS"}),setTimeout(()=>{_(!1)},3e3)}();return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},defaultValues:j,appData:f}),S&&l.createElement(a.Toast,{isDleteBtn:!0,error:"error"===(null==S?void 0:S.key),label:d(null==S?void 0:S.message),onClose:()=>{_(null)}}))},WSEditModifyApplication:()=>{var e;const{t:n}=o.useTranslation();let{state:r}=i.useLocation();r=r?"string"==typeof r?JSON.parse(r):r:{},i.useHistory();let u=g(location.search);const[d,s]=t.useState(!1),[c,p]=t.useState(null),[m,E]=t.useState({}),[S,_]=t.useState({head:"",body:[]}),[f,C]=t.useState(!0),[N,y]=t.useState(!1),D=Digit.ULBService.getCurrentTenantId(),T=null==u?void 0:u.service,h=Lt(null===(e=r)||void 0===e?void 0:e.data),A=Digit.ULBService.getStateId();let{data:I,isLoading:O}=Digit.Hooks.ws.useWSConfigMDMS.WSCreateConfig(A,{});const[b,L]=t.useState(new URLSearchParams(i.useLocation().search).get("propertyId")),[w,W,P]=Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM",{}),{data:x}=Digit.Hooks.pt.usePropertySearch({filters:{propertyIds:b},tenantId:D},{filters:{propertyIds:b},tenantId:D,enabled:!(!b||""==b)});t.useEffect(()=>{if(!O){var e;const n=I.find(e=>e.hideInCitizen&&e.isModify);n.head="WS_WATER_AND_SEWERAGE_MODIFY_CONNECTION_LABEL";let t=[];null==n||null===(e=n.body)||void 0===e||e.forEach(e=>{null!=e&&e.isModifyConnection&&t.push(e)}),t.forEach(e=>{"WS_COMMON_PROPERTY_DETAILS"==(null==e?void 0:e.head)&&(e.head="")}),n.body=t,_(n)}},[I]),t.useEffect(()=>{var e,n,t,l;!b&&(null==w||null===(e=w.cpt)||void 0===e||null===(n=e.details)||void 0===n?void 0:n.propertyId)&&L(null==w||null===(t=w.cpt)||void 0===t||null===(l=t.details)||void 0===l?void 0:l.propertyId)},[null==w?void 0:w.cpt]),t.useEffect(function(){try{const e=!!sessionStorage.getItem("IsDetailsExists")&&JSON.parse(sessionStorage.getItem("IsDetailsExists")),t=function(t){if(null!=h&&null!==(t=h.applicationData)&&void 0!==t&&t.id&&!e)return Promise.resolve(R(h,T,!0,!1,n)).then(function(e){W(v({},w,e)),E(v({},e)),sessionStorage.setItem("IsDetailsExists",JSON.stringify(!0))})}();return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[x,w,null==w?void 0:w.cpt]),t.useEffect(()=>{var e;W(v({},w,{cpt:{details:null==x||null===(e=x.Properties)||void 0===e?void 0:e[0]}}))},[x]),t.useEffect(()=>{var e,n;null!=w&&null!==(e=w.ConnectionDetails)&&void 0!==e&&null!==(n=e[0])&&void 0!==n&&n.applicationNo&&C(!1)},[x,w,null==w?void 0:w.cpt]),t.useEffect(()=>{const e=setTimeout(()=>{var e,n,t,l,o;N&&(window.location.href=window.location.origin+"/digit-ui/employee/ws/application-details?applicationNumber="+(null==w||null===(e=w.ConnectionDetails)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.applicationNo)+"&service="+(null==w||null===(t=w.ConnectionDetails)||void 0===t||null===(l=t[0])||void 0===l||null===(o=l.serviceName)||void 0===o?void 0:o.toUpperCase())+"&mode=MODIFY")},3e3);return()=>clearTimeout(e)},[N]);const{mutate:B}=Digit.Hooks.ws.useWSApplicationActions(null==u?void 0:u.service);return f||O?l.createElement(a.Loader,null):l.createElement(l.Fragment,null,l.createElement("div",{style:{marginLeft:"15px"}},l.createElement(a.Header,null,n(S.head))),l.createElement(a.FormComposer,{config:S.body,userType:"employee",onFormValueChange:(e,n,t)=>{var l,o;U.isEqual(w,n)||W(v({},w,n)),Object.keys(t.errors).length>0&&1==Object.keys(t.errors).length&&t.errors.owners&&0==Object.values(t.errors.owners.type).filter(e=>"required"===e.type).length&&(null==n||null===(l=n.cpt)||void 0===l||null===(o=l.details)||void 0===o||!o.propertyId)?s(!0):s(!Object.keys(t.errors).length)},label:n("CS_COMMON_SUBMIT"),onSubmit:function(e){try{const n=function(){if(d){const n=sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")?JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")):{};return Promise.resolve(M(e,n,"SUBMIT_APPLICATION")).then(function(n){var t,l;const o="WATER"==(null==e||null===(t=e.ConnectionDetails)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.serviceName)?{WaterConnection:n}:{SewerageConnection:n};B&&B(o,{onError:(e,n)=>{p({key:"error",message:null!=e&&e.message?e.message:e}),setTimeout(closeToastOfError,5e3)},onSuccess:(e,n)=>{p({key:!1,message:"WS_APPLICATION_SUBMITTED_SUCCESSFULLY_LABEL"}),y(!0)}})})}p({warning:!0,message:"PLEASE_FILL_MANDATORY_DETAILS"}),setTimeout(()=>{p(!1)},3e3)}();return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},defaultValues:w}),c&&l.createElement(a.Toast,{error:c.key,label:n(null==c?void 0:c.message),onClose:()=>{p(null)},isDleteBtn:!0}))},WSDisconnectionApplication:()=>{const{t:e}=o.useTranslation(),n=i.useRouteMatch(),t=Digit.ULBService.getStateId();let{data:r,isLoading:u}=Digit.Hooks.ws.useWSConfigMDMS.WSDisconnectionConfig(t,{}),d=[];return!u&&r.length>0?(r.forEach(e=>{d=d.concat(e.body.filter(e=>!e.hideInCitizen))}),d.indexRoute="docsrequired",l.createElement(i.Switch,null,d.map((t,o)=>{const{component:a,texts:r,inputs:u,key:d,isSkipEnabled:s}=t,c="string"==typeof a?Digit.ComponentRegistryService.getComponent(a):a;return l.createElement(i.Route,{path:Fr(n.path,n.params)+"/"+t.route,key:o},l.createElement(c,{config:{texts:r,inputs:u,key:d,isSkipEnabled:s},t:e,userType:"employee"}))}),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:Fr(n.path,n.params)+"/"+d.indexRoute})))):l.createElement(a.Loader,null)},WSRestorationApplication:()=>{const{t:e}=o.useTranslation(),n=i.useRouteMatch(),t=Digit.ULBService.getStateId();let{data:r,isLoading:u}=Digit.Hooks.ws.useWSConfigMDMS.WSDisconnectionConfig(t,{}),d=[];return u?l.createElement(a.Loader,null):(r.forEach(e=>{d=d.concat(e.body.filter(e=>!e.hideInCitizen))}),d.indexRoute="new-restoration",console.log("configconfig",d),l.createElement(i.Switch,null,d.map((t,o)=>{const{texts:a,inputs:r,key:u,isSkipEnabled:d}=t,s=Digit.ComponentRegistryService.getComponent("WSRestorationForm");return l.createElement(i.Route,{path:Ur(n.path,n.params)+"/new-restoration",key:o},l.createElement(s,{config:{texts:a,inputs:r,key:u,isSkipEnabled:d},t:e,userType:"employee"}))}),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:Ur(n.path,n.params)+"/"+d.indexRoute}))))},WSEditApplicationByConfig:()=>{var e,n,r,u,d,s,c,p;const{t:m}=o.useTranslation();let{state:E}=i.useLocation();E=E?"string"==typeof E?JSON.parse(E):E:{},i.useHistory();let S=g(location.search);const[_,f]=t.useState(!1),[C,N]=t.useState(null),[y,D]=t.useState({}),[T,h]=t.useState({head:"",body:[]}),[A,I]=t.useState(!0),[O,b]=t.useState(!1);let L=Digit.ULBService.getCurrentTenantId();L||Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY");const w=JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")),W=(null==S?void 0:S.service)||(null==w||null===(e=w.applicationData)||void 0===e?void 0:e.serviceType),P=Digit.ULBService.getStateId();let{data:M,isLoading:x}=Digit.Hooks.ws.useWSConfigMDMS.WSCreateConfig(P,{}),B=Lt(null===(n=E)||void 0===n||null===(r=n.data)||void 0===r?void 0:r.applicationDetails);Lt(null===(u=E)||void 0===u||null===(d=u.data)||void 0===d?void 0:d.action);let{isLoading:F,data:k}=Digit.Hooks.ws.useWSDetailsPage(m,L,null===(s=B)||void 0===s?void 0:s.applicationNo,null===(c=B)||void 0===c||null===(p=c.applicationData)||void 0===p?void 0:p.serviceType,{privacy:Digit.Utils.getPrivacyObject()});B=k;const[H,j]=t.useState(new URLSearchParams(i.useLocation().search).get("propertyId")),[V,z,Y]=Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM",{}),[G,q,K]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),{data:X}=Digit.Hooks.pt.usePropertySearch({filters:{propertyIds:H},tenantId:L},{filters:{propertyIds:H},tenantId:L,enabled:!(!H||""==H),privacy:Digit.Utils.getPrivacyObject()});return t.useEffect(()=>{if(!x){var e;const n=M.find(e=>e.hideInCitizen&&e.isEditByConfig);n.head="WS_APP_FOR_WATER_AND_SEWERAGE_EDIT_LABEL";let t=[];null==n||null===(e=n.body)||void 0===e||e.forEach(e=>{null!=e&&e.isEditByConfigConnection&&t.push(e)}),n.body=t,h(n)}},[M]),t.useEffect(()=>{var e,n,t,l;!H&&(null==V||null===(e=V.cpt)||void 0===e||null===(n=e.details)||void 0===n?void 0:n.propertyId)&&j(null==V||null===(t=V.cpt)||void 0===t||null===(l=t.details)||void 0===l?void 0:l.propertyId)},[null==V?void 0:V.cpt]),t.useEffect(function(){try{const e=!!sessionStorage.getItem("IsDetailsExists")&&JSON.parse(sessionStorage.getItem("IsDetailsExists")),n=function(n,t){if(null!==(n=B)&&void 0!==n&&null!==(t=n.applicationData)&&void 0!==t&&t.id&&!e)return sessionStorage.setItem("appData",JSON.stringify(y)),Promise.resolve(R(B,W,!1,!1,m)).then(function(e){z(v({},V,e)),D(v({},e)),sessionStorage.setItem("IsDetailsExists",JSON.stringify(!0))})}();return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[B,k,null==V?void 0:V.cpt,V,X]),t.useEffect(()=>{var e;z(v({},V,{cpt:{details:null==X||null===(e=X.Properties)||void 0===e?void 0:e[0]}}))},[X]),t.useEffect(()=>{var e,n,t,l,o,i,a;((null==V||null===(e=V.DocumentsRequired)||void 0===e||null===(n=e.documents)||void 0===n?void 0:n.length)>0||null!=V&&null!==(t=V.ConnectionDetails)&&void 0!==t&&null!==(l=t[0])&&void 0!==l&&l.water||null!=V&&null!==(o=V.ConnectionDetails)&&void 0!==o&&null!==(i=o[0])&&void 0!==i&&i.sewerage||null!=V&&null!==(a=V.cpt)&&void 0!==a&&a.details&&!F)&&I(!1)},[X,V,null==V?void 0:V.cpt]),t.useEffect(()=>{const e=setTimeout(()=>{var e,n,t,l,o;O&&(window.location.href=window.location.origin+"/digit-ui/employee/ws/application-details?applicationNumber="+(null==V||null===(e=V.ConnectionDetails)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.applicationNo)+"&service="+(null==V||null===(t=V.ConnectionDetails)||void 0===t||null===(l=t[0])||void 0===l||null===(o=l.serviceName)||void 0===o?void 0:o.toUpperCase()))},5e3);return()=>clearTimeout(e)},[O]),Digit.Hooks.ws.useWSApplicationActions(W),A||x?l.createElement(a.Loader,null):l.createElement(l.Fragment,null,l.createElement("div",{style:{marginLeft:"15px"}},l.createElement(a.Header,null,m(T.head))),l.createElement(a.FormComposer,{config:T.body,userType:"employee",onFormValueChange:(e,n,t)=>{var l,o,i,a,r,u,d,s,c,p,m,E,S,_,g,C,N,y,D,T,h,A,I,O,b,L,R,w,W,P;U.isEqual(V,n)||z(v({},V,n)),Object.keys(t.errors).length>0&&1==Object.keys(t.errors).length&&t.errors.owners&&0==Object.values(t.errors.owners.type).filter(e=>"required"===e.type).length&&(null==n||null===(l=n.cpt)||void 0===l||null===(o=l.details)||void 0===o||!o.propertyId)?f(!0):null!==(i=n.ConnectionDetails)&&void 0!==i&&null!==(a=i[0])&&void 0!==a&&a.water&&(""==(null===(r=n.roadCuttingDetails)||void 0===r||null===(u=r[0])||void 0===u||null===(d=u.roadType)||void 0===d?void 0:d.code)||""==(null===(s=n.roadCuttingDetails)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.area)||""==(null===(p=n.plumberDetails)||void 0===p||null===(m=p[0])||void 0===m?void 0:m.detailsProvidedBy)||""==(null===(E=n.connectionDetails)||void 0===E||null===(S=E[0])||void 0===S?void 0:S.connectionType)||""==(null===(_=n.connectionDetails)||void 0===_||null===(g=_[0])||void 0===g?void 0:g.waterSource)||""==(null===(C=n.connectionDetails)||void 0===C||null===(N=C[0])||void 0===N?void 0:N.sourceSubData))||null!==(y=n.ConnectionDetails)&&void 0!==y&&null!==(D=y[0])&&void 0!==D&&D.sewerage&&(""==(null===(T=n.roadCuttingDetails)||void 0===T||null===(h=T[0])||void 0===h||null===(A=h.roadType)||void 0===A?void 0:A.code)||""==(null===(I=n.roadCuttingDetails)||void 0===I||null===(O=I[0])||void 0===O?void 0:O.area)||""==(null===(b=n.plumberDetails)||void 0===b||null===(L=b[0])||void 0===L?void 0:L.detailsProvidedBy)||""==(null===(R=n.connectionDetails)||void 0===R||null===(w=R[0])||void 0===w?void 0:w.noOfWaterClosets)||""==(null===(W=n.connectionDetails)||void 0===W||null===(P=W[0])||void 0===P?void 0:P.noOfToilets))?f(!1):f(!Object.keys(t.errors).length)},label:m("CS_COMMON_SUBMIT"),onSubmit:function(e){try{const n=function(){if(_){const n=sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")?JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")):{};return Promise.resolve(((e,n,t)=>{var l,o,i,a,r,u,d,s,c,p,m,E,S,_,f,g,C,N,y,D,T,h,A,I,O,b,L,R,w,W,P,M,x,B,F,U,k,H,j,V,z,Y,G,q,K,X,Z,$,J,Q,ee,ne,te,le,oe,ie,ae,re,ue,de,se,ce,ve,pe,me,Ee,Se,_e,fe,ge,Ce,Ne,ye,De,Te,he,Ae,Ie,Oe,be,Le,Re,we,We,Pe;null==e||null===(l=e.cpt)||void 0===l||null===(o=l.details)||void 0===o||null===(i=o.owners)||void 0===i||i.forEach(e=>{null!=e&&e.permanentAddress&&(e.correspondenceAddress=null==e?void 0:e.permanentAddress)});let Me=v({},n.applicationData,{proposedTaps:(null==e||null===(a=e.ConnectionDetails)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.proposedTaps)&&Number(null==e||null===(u=e.ConnectionDetails)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.proposedTaps),proposedPipeSize:(null==e||null===(s=e.ConnectionDetails)||void 0===s||null===(c=s[0])||void 0===c||null===(p=c.proposedPipeSize)||void 0===p?void 0:p.size)&&Number(null==e||null===(m=e.ConnectionDetails)||void 0===m||null===(E=m[0])||void 0===E||null===(S=E.proposedPipeSize)||void 0===S?void 0:S.size),proposedWaterClosets:(null==e||null===(_=e.ConnectionDetails)||void 0===_||null===(f=_[0])||void 0===f?void 0:f.proposedWaterClosets)&&Number(null==e||null===(g=e.ConnectionDetails)||void 0===g||null===(C=g[0])||void 0===C?void 0:C.proposedWaterClosets),proposedToilets:(null==e||null===(N=e.ConnectionDetails)||void 0===N||null===(y=N[0])||void 0===y?void 0:y.proposedToilets)&&Number(null==e||null===(D=e.ConnectionDetails)||void 0===D||null===(T=D[0])||void 0===T?void 0:T.proposedToilets),connectionHolders:null!=e&&null!==(h=e.ConnectionHolderDetails)&&void 0!==h&&null!==(A=h[0])&&void 0!==A&&A.sameAsOwnerDetails?null:[v({},null==n||null===(I=n.applicationData)||void 0===I||null===(O=I.connectionHolders)||void 0===O?void 0:O[0],{correspondenceAddress:(null==e||null===(b=e.ConnectionHolderDetails)||void 0===b||null===(L=b[0])||void 0===L?void 0:L.address)||"",fatherOrHusbandName:(null==e||null===(R=e.ConnectionHolderDetails)||void 0===R||null===(w=R[0])||void 0===w?void 0:w.guardian)||"",gender:(null==e||null===(W=e.ConnectionHolderDetails)||void 0===W||null===(P=W[0])||void 0===P||null===(M=P.gender)||void 0===M?void 0:M.code)||"",mobileNumber:(null==e||null===(x=e.ConnectionHolderDetails)||void 0===x||null===(B=x[0])||void 0===B?void 0:B.mobileNumber)||"",name:(null==e||null===(F=e.ConnectionHolderDetails)||void 0===F||null===(U=F[0])||void 0===U?void 0:U.name)||"",ownerType:(null==e||null===(k=e.ConnectionHolderDetails)||void 0===k||null===(H=k[0])||void 0===H||null===(j=H.ownerType)||void 0===j?void 0:j.code)||"",relationship:(null==e||null===(V=e.ConnectionHolderDetails)||void 0===V||null===(z=V[0])||void 0===z||null===(Y=z.relationship)||void 0===Y?void 0:Y.code)||"",sameAsPropertyAddress:null==e||null===(G=e.ConnectionHolderDetails)||void 0===G||null===(q=G[0])||void 0===q?void 0:q.sameAsOwnerDetails})],property:null==e||null===(K=e.cpt)||void 0===K?void 0:K.details,propertyId:null==e||null===(X=e.cpt)||void 0===X||null===(Z=X.details)||void 0===Z?void 0:Z.propertyId,processInstance:v({},null==n?void 0:n.processInstance,{action:"VERIFY_AND_FORWARD"}),action:"VERIFY_AND_FORWARD",documents:null==e||null===($=e.DocumentsRequired)||void 0===$?void 0:$.documents,plumberInfo:[{licenseNo:(null==e||null===(J=e.plumberDetails)||void 0===J||null===(Q=J[0])||void 0===Q?void 0:Q.plumberLicenseNo)||(null==n?void 0:n.plumberLicenseNo),name:(null==e||null===(ee=e.plumberDetails)||void 0===ee||null===(ne=ee[0])||void 0===ne?void 0:ne.plumberName)||(null==n?void 0:n.plumberName),mobileNumber:(null==e||null===(te=e.plumberDetails)||void 0===te||null===(le=te[0])||void 0===le?void 0:le.plumberMobileNo)||(null==n?void 0:n.plumberMobileNo)}],roadCuttingInfo:null==e||null===(oe=e.roadCuttingDetails)||void 0===oe?void 0:oe.filter(e=>""!=e.roadType.code).map(e=>{var n,t;return null!=e&&e.id&&null!==(null==e?void 0:e.id)?{id:null==e?void 0:e.id,roadType:null==e||null===(n=e.roadType)||void 0===n?void 0:n.code,roadCuttingArea:null==e?void 0:e.area,status:null==e?void 0:e.status}:{roadType:null==e||null===(t=e.roadType)||void 0===t?void 0:t.code,roadCuttingArea:null==e?void 0:e.area}}),connectionNo:null},"WATER"===t?{connectionType:(null==e||null===(ie=e.connectionDetails)||void 0===ie||null===(ae=ie[0])||void 0===ae||null===(re=ae.connectionType)||void 0===re?void 0:re.code)||(null==n?void 0:n.connectionType),waterSource:(null==e||null===(ue=e.connectionDetails)||void 0===ue||null===(de=ue[0])||void 0===de||null===(se=de.sourceSubData)||void 0===se?void 0:se.code)||(null==n?void 0:n.waterSource),pipeSize:(null==e||null===(ce=e.connectionDetails)||void 0===ce||null===(ve=ce[0])||void 0===ve||null===(pe=ve.pipeSize)||void 0===pe?void 0:pe.size)||(null==n?void 0:n.pipeSize),noOfTaps:(null==e||null===(me=e.connectionDetails)||void 0===me||null===(Ee=me[0])||void 0===Ee?void 0:Ee.noOfTaps)||(null==n?void 0:n.noOfTaps),sourceSubData:(null==e||null===(Se=e.connectionDetails)||void 0===Se||null===(_e=Se[0])||void 0===_e||null===(fe=_e.sourceSubData)||void 0===fe?void 0:fe.code)||(null==n?void 0:n.sourceSubData)}:{connectionType:"Non Metered",noOfWaterClosets:(null==e||null===(ge=e.connectionDetails)||void 0===ge||null===(Ce=ge[0])||void 0===Ce?void 0:Ce.noOfWaterClosets)||(null==n?void 0:n.noOfWaterClosets)||"",noOfToilets:(null==e||null===(Ne=e.connectionDetails)||void 0===Ne||null===(ye=Ne[0])||void 0===ye?void 0:ye.noOfToilets)||(null==n?void 0:n.noOfToilets)||""},{tenantId:null==e||null===(De=e.cpt)||void 0===De||null===(Te=De.details)||void 0===Te?void 0:Te.tenantId});var xe,Be,Fe,Ue,ke,He,je,Ve,ze,Ye,Ge,qe,Ke;return(null!=e&&null!==(he=e.plumberDetails)&&void 0!==he&&null!==(Ae=he[0])&&void 0!==Ae&&null!==(Ie=Ae.detailsProvidedBy)&&void 0!==Ie&&Ie.code||null!=n&&n.detailsProvidedBy)&&(Me.additionalDetails.detailsProvidedBy=(null==e||null===(xe=e.plumberDetails)||void 0===xe||null===(Be=xe[0])||void 0===Be||null===(Fe=Be.detailsProvidedBy)||void 0===Fe?void 0:Fe.code)||(null==n?void 0:n.detailsProvidedBy),Me.additionalDetails.initialMeterReading=null),null!=e&&null!==(Oe=e.cpt)&&void 0!==Oe&&null!==(be=Oe.details)&&void 0!==be&&null!==(Le=be.address)&&void 0!==Le&&null!==(Re=Le.locality)&&void 0!==Re&&Re.code&&(Me.additionalDetails.locality=null==e||null===(Ue=e.cpt)||void 0===Ue||null===(ke=Ue.details)||void 0===ke||null===(He=ke.address)||void 0===He||null===(je=He.locality)||void 0===je?void 0:je.code),"ULB"==(null==e||null===(we=e.plumberDetails)||void 0===we||null===(We=we[0])||void 0===We||null===(Pe=We.detailsProvidedBy)||void 0===Pe?void 0:Pe.code)&&(Me.plumberInfo=[{licenseNo:(null==e||null===(Ve=e.plumberDetails)||void 0===Ve||null===(ze=Ve[0])||void 0===ze?void 0:ze.plumberLicenseNo)||(null==n?void 0:n.plumberLicenseNo),name:(null==e||null===(Ye=e.plumberDetails)||void 0===Ye||null===(Ge=Ye[0])||void 0===Ge?void 0:Ge.plumberName)||(null==n?void 0:n.plumberName),mobileNumber:(null==e||null===(qe=e.plumberDetails)||void 0===qe||null===(Ke=qe[0])||void 0===Ke?void 0:Ke.plumberMobileNo)||(null==n?void 0:n.plumberMobileNo)}]),Me})(e,n,W)).then(function(e){var n;null!=G&&G.adhocPenalty&&(e.additionalDetails.adhocPenalty=parseInt(null==G?void 0:G.adhocPenalty)),null!=G&&G.adhocPenaltyComment&&(e.additionalDetails.adhocPenaltyComment=(null==G?void 0:G.adhocPenaltyComment)||""),null!=G&&G.adhocPenaltyReason&&(e.additionalDetails.adhocPenaltyReason=(null==G?void 0:G.adhocPenaltyReason)||""),null!=G&&G.adhocRebate&&(e.additionalDetails.adhocRebate=parseInt(null==G?void 0:G.adhocRebate)),null!=G&&G.adhocRebateComment&&(e.additionalDetails.adhocRebateComment=(null==G?void 0:G.adhocRebateComment)||""),null!=G&&G.adhocRebateReason&&(e.additionalDetails.adhocRebateReason=(null==G?void 0:G.adhocRebateReason)||""),f(!1),sessionStorage.setItem("redirectedfromEDIT",!0),sessionStorage.setItem("WS_SESSION_APPLICATION_DETAILS",JSON.stringify(e)),window.location.assign(""+window.location.origin+(null===(n=E)||void 0===n?void 0:n.url))})}N({warning:!0,message:"PLEASE_FILL_MANDATORY_DETAILS"}),setTimeout(()=>{N(!1)},3e3)}();return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},defaultValues:V,appData:y}),C&&l.createElement(a.Toast,{error:C.key,label:m(null==C?void 0:C.message),warning:null==C?void 0:C.warning,onClose:()=>{N(null)}}))},WSGetDisconnectionDetails:()=>{var e,n,i,r,u,d,s,c,p,m,E,S,_,f,C,N,y,D,T,h,A,I,O,b,L,R,w,W,P,M,B,F,U,k,H,j,V,z,Y,G,q;const{t:K}=o.useTranslation(),X=t.useRef();let Z=g(location.search);const[$,J]=t.useState(!1),[Q,ee]=t.useState(null),ne=Digit.ULBService.getCurrentTenantId(),te=null==Z?void 0:Z.applicationNumber,le=null==Z?void 0:Z.service,oe=Digit.ULBService.getStateId();sessionStorage.removeItem("Digit.PT_CREATE_EMP_WS_NEW_FORM"),sessionStorage.removeItem("IsDetailsExists"),sessionStorage.setItem("disconnectionURL",JSON.stringify({url:""+(null===(e=location)||void 0===e?void 0:e.pathname)+location.search}));let{isLoading:ie,data:ae}=Digit.Hooks.ws.useDisConnectionDetails(K,ne,te,le,{privacy:Digit.Utils.getPrivacyObject()});const{isServicesMasterLoading:re,data:ue}=Digit.Hooks.ws.useMDMS(oe,"ws-services-masters",["WSEditApplicationByConfigUser"]),de=(null==ae||null===(n=ae.applicationData)||void 0===n?void 0:n.applicationStatus)||"";let se=Digit.Hooks.useWorkflowDetails({tenantId:ne,id:te,moduleCode:null==ae||null===(i=ae.processInstancesDetails)||void 0===i||null===(r=i[0])||void 0===r?void 0:r.businessService},{enabled:!(null==ae||null===(u=ae.processInstancesDetails)||void 0===u||null===(d=u[0])||void 0===d||!d.businessService)});const{mutate:ce}=Digit.Hooks.ws.useWSApplicationActions(le);var ve,pe,me,Ee,Se;Digit.Hooks.useClickOutside(X,()=>{J(!1)},$),Digit.Utils.browser.isMobile(),!((null==se||null===(s=se.data)||void 0===s||null===(c=s.nextActions)||void 0===c?void 0:c.length)>0&&(null==se||null===(p=se.data)||void 0===p||null===(m=p.actionState)||void 0===m||null===(E=m.nextActions)||void 0===E?void 0:E.length)>0)||null!=se&&null!==(S=se.data)&&void 0!==S&&null!==(_=S.actionState)&&void 0!==_&&null!==(f=_.nextActions)&&void 0!==f&&f.find(e=>"EDIT"===e.action)||null!=se&&null!==(C=se.data)&&void 0!==C&&null!==(N=C.actionState)&&void 0!==N&&null!==(y=N.nextActions)&&void 0!==y&&y.find(e=>"RESUBMIT_APPLICATION"===e.action)||null!=se&&null!==(D=se.data)&&void 0!==D&&null!==(T=D.actionState)&&void 0!==T&&null!==(h=T.nextActions)&&void 0!==h&&h.find(e=>"EXECUTE_DISCONNECTION"===e.action)||null!=se&&null!==(A=se.data)&&void 0!==A&&null!==(I=A.actionState)&&void 0!==I&&null!==(O=I.nextActions)&&void 0!==O&&O.find(e=>"SUBMIT_APPLICATION"===e.action)||null!=se&&null!==(b=se.data)&&void 0!==b&&null!==(L=b.actionState)&&void 0!==L&&null!==(R=L.nextActions)&&void 0!==R&&R.find(e=>"DISCONNECTION_EXECUTED"===e.action)||null==se||null===(ve=se.data)||void 0===ve||null===(pe=ve.nextActions)||void 0===pe||pe.forEach(e=>{"EDIT"==e.action&&se.data.actionState.nextActions.push(e)}),"DISCONNECTION_EXECUTED"==(null==ae||null===(w=ae.applicationData)||void 0===w?void 0:w.applicationStatus)&&(null!=se&&null!==(me=se.data)&&void 0!==me&&null!==(Ee=me.actionState)&&void 0!==Ee&&Ee.nextActions&&(se.data.actionState.nextActions=[]),null!=se&&null!==(Se=se.data)&&void 0!==Se&&Se.nextActions&&(se.data.nextActions=[])),null==se||null===(W=se.data)||void 0===W||null===(P=W.nextActions)||void 0===P||P.forEach(e=>{var n,t;"PAY"===(null==e?void 0:e.action)&&(e.redirectionUrll={pathname:("WATER"==le?"WS":"SW")+"/"+(null==ae||null===(n=ae.applicationData)||void 0===n?void 0:n.connectionNo)+"/"+(null==ae?void 0:ae.tenantId)+"?tenantId="+(null==ae?void 0:ae.tenantId)+"&ISWSAPP&applicationNumber="+(null==ae||null===(t=ae.applicationData)||void 0===t?void 0:t.connectionNo)+"&IsDisconnectionFlow="+!0,state:null==ae?void 0:ae.tenantId})}),null==se||null===(M=se.data)||void 0===M||null===(B=M.actionState)||void 0===B||null===(F=B.nextActions)||void 0===F||F.forEach(e=>{var n,t;"PAY"===(null==e?void 0:e.action)&&(e.redirectionUrll={pathname:("WATER"==le?"WS":"SW")+"/"+(null==ae||null===(n=ae.applicationData)||void 0===n?void 0:n.connectionNo)+"/"+(null==ae?void 0:ae.tenantId)+"?tenantId="+(null==ae?void 0:ae.tenantId)+"&ISWSAPP&applicationNumber="+(null==ae||null===(t=ae.applicationData)||void 0===t?void 0:t.connectionNo)+"&IsDisconnectionFlow="+!0,state:null==ae?void 0:ae.tenantId})}),null==se||null===(U=se.data)||void 0===U||null===(k=U.actionState)||void 0===k||null===(H=k.nextActions)||void 0===H||H.forEach(e=>{if("EDIT"===(null==e?void 0:e.action)){var n,t,l;let o="/digit-ui/employee/ws/edit-disconnection-application?applicationNumber="+te+"&service="+le;const i=(null==ue||null===(n=ue["ws-services-masters"])||void 0===n?void 0:n.WSEditApplicationByConfigUser)||[],a=(null==i||null===(t=i[0])||void 0===t?void 0:t.roles)||[],r=null==i||null===(l=i[0])||void 0===l?void 0:l.status;let u=!1;a.every((e,n)=>(u=x(e),!u)),u&&de===r&&(o="/digit-ui/employee/ws/config-by-disconnection-application?applicationNumber="+te+"&service="+le),e.redirectionUrll={action:"ACTIVATE_CONNECTION",pathname:o,state:{applicationDetails:ae,action:"VERIFY_AND_FORWARD"}}}"RESUBMIT_APPLICATION"===(null==e?void 0:e.action)&&(e.redirectionUrll={action:"ACTIVATE_CONNECTION",pathname:"/digit-ui/employee/ws/resubmit-disconnection-application?applicationNumber="+te+"&service="+le,state:{applicationDetails:ae,action:"VERIFY_AND_FORWARD"}})});const _e={order:1,label:K("WS_APPLICATION"),onClick:function(){try{var e;const n=null==ae||null===(e=ae.applicationData)||void 0===e?void 0:e.tenantId;return xi(v({},null==ae?void 0:ae.applicationData),v({},null==ae?void 0:ae.propertyDetails),n,K).then(e=>Digit.Utils.pdf.generatev1(e)),Promise.resolve()}catch(e){return Promise.reject(e)}}},fe={order:2,label:K("WS_DISCONNECTION_NOTICE_LABEL"),onClick:()=>function(){try{var e,n,t;let l="ws-waterdisconnectionnotice",o={WaterConnection:[v({},null==ae?void 0:ae.applicationData,{property:ae.propertyDetails})]};return null!=ae&&null!==(e=ae.applicationData)&&void 0!==e&&null!==(n=e.applicationType)&&void 0!==n&&n.includes("WATER")||(l="ws-seweragedisconnectionnotice",o={SewerageConnection:[v({},null==ae?void 0:ae.applicationData,{property:ae.propertyDetails})]}),Promise.resolve(Digit.WSService.WSDisconnectionNotice(null==ae||null===(t=ae.applicationData)||void 0===t?void 0:t.tenantId,o,l)).then(function(e){var n;return Promise.resolve(Digit.PaymentService.printReciept(null==ae||null===(n=ae.applicationData)||void 0===n?void 0:n.tenantId,{fileStoreIds:e.filestoreIds[0]})).then(function(n){window.open(n[null==e?void 0:e.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}()};let ge=[];switch(de){case"DISCONNECTION_EXECUTED":case"PENDING_FOR_PAYMENT":case"PENDING_FOR_DISCONNECTION_EXECUTION":ge=[_e,fe];break;default:ge=[_e]}return ge.sort(function(e,n){return e.order-n.order}),l.createElement(t.Fragment,null,l.createElement("div",null,l.createElement("div",{className:"employee-application-details",style:{marginBottom:"15px"}},l.createElement("div",{style:{display:"flex"}},l.createElement("div",{style:{width:"70%"}},l.createElement(a.Header,null,K("WS_APPLICATION_DETAILS")," ")),l.createElement("div",{style:{width:"30%",zIndex:"10"}},l.createElement(a.MultiLink,{className:"multilinkWrapper employee-mulitlink-main-divNew",onHeadClick:()=>J(!$),displayOptions:$,options:ge,downloadBtnClassName:"employee-download-btn-className",optionsClassName:"employee-options-btn-className",ref:X})))),l.createElement(Wr,{applicationDetails:ae,isLoading:ie||re,isDataLoading:ie||re,applicationData:null==ae?void 0:ae.applicationData,mutate:ce,workflowDetails:se,businessService:null==ae||null===(j=ae.processInstancesDetails)||void 0===j||null===(V=j[0])||void 0===V||null===(z=V.businessService)||void 0===z?void 0:z.toUpperCase(),moduleCode:"WS",showToast:Q,setShowToast:ee,closeToast:()=>{ee(null)},timelineStatusPrefix:"WF_"+(null==ae||null===(Y=ae.processInstancesDetails)||void 0===Y||null===(G=Y[0])||void 0===G||null===(q=G.businessService)||void 0===q?void 0:q.toUpperCase())+"_",isInfoLabel:"true"===sessionStorage.getItem("isPrivacyEnabled")})))},WSModifyApplicationDetails:()=>{var e,n,i,r,u,d,s,c,p,m,E,S,_,f,C,N,y,D,T,h,A,I,O,b,R,w,W,P,M,B,F,U,k,H,j,V,z,Y,G,q,K,X,Z,$;const{t:J}=o.useTranslation(),Q=Digit.UserService.getUser(),ee=Digit.ULBService.getCurrentTenantId(),[ne,te]=t.useState(null),[oe,ie]=t.useState(!1);let ae=g(location.search);const re=null==ae?void 0:ae.applicationNumber,ue=null==ae?void 0:ae.service,de=Digit.ULBService.getStateId(),se=t.useRef();let{isLoading:ce,data:ve}=Digit.Hooks.ws.useWSModifyDetailsPage(J,ee,re,ue,Q,{privacy:Digit.Utils.getPrivacyObject()});const{isServicesMasterLoading:pe,data:me}=Digit.Hooks.ws.useMDMS(de,"ws-services-masters",["WSEditApplicationByConfigUser"]);let Ee=Digit.Hooks.useWorkflowDetails({tenantId:ee,id:re,moduleCode:null==ve||null===(e=ve.processInstancesDetails)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.businessService,config:{enabled:!(null==ve||null===(i=ve.processInstancesDetails)||void 0===i||null===(r=i[0])||void 0===r||!r.businessService),privacy:Digit.Utils.getPrivacyObject()}});const{mutate:Se}=Digit.Hooks.ws.useWSApplicationActions(ue),_e=()=>{var e,n,t,l,o,i,a,r,u,d,s,c,v;const p=null==ve||null===(e=ve.applicationData)||void 0===e?void 0:e.connectionType,m=0===(null==ve||null===(n=ve.applicationData)||void 0===n?void 0:n.noOfTaps)?null:null==ve||null===(t=ve.applicationData)||void 0===t?void 0:t.noOfTaps,E=0===(null==ve||null===(l=ve.applicationData)||void 0===l?void 0:l.pipeSize)?null:null==ve||null===(o=ve.applicationData)||void 0===o?void 0:o.pipeSize,S=null==ve||null===(i=ve.applicationData)||void 0===i?void 0:i.waterSource,_=0===(null==ve||null===(a=ve.applicationData)||void 0===a?void 0:a.noOfWaterClosets)?null:null==ve||null===(r=ve.applicationData)||void 0===r?void 0:r.noOfWaterClosets,f=0===(null==ve||null===(u=ve.applicationData)||void 0===u?void 0:u.noOfToilets)?null:null==ve||null===(d=ve.applicationData)||void 0===d?void 0:d.noOfToilets,g=null==ve||null===(s=ve.applicationData)||void 0===s||null===(c=s.additionalDetails)||void 0===c?void 0:c.detailsProvidedBy,C=null==ve||null===(v=ve.applicationData)||void 0===v?void 0:v.roadCuttingInfo;return!!(p&&(m&&E&&S||_&&f)&&g&&C)};let fe=[],ge=(null==ve||null===(u=ve.applicationData)||void 0===u?void 0:u.applicationStatus)||"";var Ce,Ne;null==Ee||null===(d=Ee.data)||void 0===d||null===(s=d.actionState)||void 0===s||null===(c=s.nextActions)||void 0===c||c.forEach(e=>{if("ACTIVATE_CONNECTION"===(null==e?void 0:e.action)&&(e.redirectionUrll={action:"ACTIVATE_CONNECTION",pathname:"/digit-ui/employee/ws/activate-connection?applicationNumber="+re+"&service="+ue+"&action=ACTIVATE_CONNECTION",state:null==ve?void 0:ve.applicationData}),"RESUBMIT_APPLICATION"===(null==e?void 0:e.action)){var n,t,l,o;let a="/digit-ui/employee/ws/edit-application?applicationNumber="+re+"&service="+ue+"&propertyId="+(null==ve||null===(n=ve.propertyDetails)||void 0===n?void 0:n.propertyId);const r=(null==me||null===(t=me["ws-services-masters"])||void 0===t?void 0:t.WSEditApplicationByConfigUser)||[],u=(null==r||null===(l=r[0])||void 0===l?void 0:l.roles)||[],d=null==r||null===(o=r[0])||void 0===o?void 0:o.status;let s=!1;var i;u.every((e,n)=>(s=x(e),!s)),s&&ge===d&&(a="/digit-ui/employee/ws/edit-application-by-config?applicationNumber="+re+"&service="+ue+"&propertyId="+(null==ve||null===(i=ve.propertyDetails)||void 0===i?void 0:i.propertyId)),e.redirectionUrll={action:"ACTIVATE_CONNECTION",pathname:a,state:{applicationDetails:ve,action:"RESUBMIT_APPLICATION"}}}var a;"SUBMIT_APPLICATION"===(null==e?void 0:e.action)&&(e.redirectionUrll={action:"ACTIVATE_CONNECTION",pathname:"/digit-ui/employee/ws/modify-application-edit?applicationNumber="+re+"&service="+ue+"&propertyId="+(null==ve||null===(a=ve.propertyDetails)||void 0===a?void 0:a.propertyId),state:ve})}),!((null==Ee||null===(p=Ee.data)||void 0===p||null===(m=p.nextActions)||void 0===m?void 0:m.length)>0&&(null==Ee||null===(E=Ee.data)||void 0===E||null===(S=E.actionState)||void 0===S||null===(_=S.nextActions)||void 0===_?void 0:_.length)>0)||null!=Ee&&null!==(f=Ee.data)&&void 0!==f&&null!==(C=f.actionState)&&void 0!==C&&null!==(N=C.nextActions)&&void 0!==N&&N.find(e=>"EDIT"===e.action)||null!=Ee&&null!==(y=Ee.data)&&void 0!==y&&null!==(D=y.actionState)&&void 0!==D&&null!==(T=D.nextActions)&&void 0!==T&&T.find(e=>"RESUBMIT_APPLICATION"===e.action)||null!=Ee&&null!==(h=Ee.data)&&void 0!==h&&null!==(A=h.actionState)&&void 0!==A&&null!==(I=A.nextActions)&&void 0!==I&&I.find(e=>"ACTIVATE_CONNECTION"===e.action)||null!=Ee&&null!==(O=Ee.data)&&void 0!==O&&null!==(b=O.actionState)&&void 0!==b&&null!==(R=b.nextActions)&&void 0!==R&&R.find(e=>"SUBMIT_APPLICATION"===e.action)||null==Ee||null===(Ce=Ee.data)||void 0===Ce||null===(Ne=Ce.nextActions)||void 0===Ne||Ne.forEach(e=>{"EDIT"==e.action&&Ee.data.actionState.nextActions.push(e)}),null==Ee||null===(w=Ee.data)||void 0===w||null===(W=w.actionState)||void 0===W||null===(P=W.nextActions)||void 0===P||P.forEach(e=>{if("EDIT"===(null==e?void 0:e.action)){var n,t,l,o;let a="/digit-ui/employee/ws/edit-application?applicationNumber="+re+"&service="+ue+"&propertyId="+(null==ve||null===(n=ve.propertyDetails)||void 0===n?void 0:n.propertyId);const r=(null==me||null===(t=me["ws-services-masters"])||void 0===t?void 0:t.WSEditApplicationByConfigUser)||[],u=(null==r||null===(l=r[0])||void 0===l?void 0:l.roles)||[],d=null==r||null===(o=r[0])||void 0===o?void 0:o.status;let s=!1;var i;u.every((e,n)=>(s=x(e),!s)),s&&ge===d&&(a="/digit-ui/employee/ws/edit-application-by-config?applicationNumber="+re+"&service="+ue+"&propertyId="+(null==ve||null===(i=ve.propertyDetails)||void 0===i?void 0:i.propertyId)),e.redirectionUrll={action:"ACTIVATE_CONNECTION",pathname:a,state:{applicationDetails:ve,action:"VERIFY_AND_FORWARD"}}}}),null==Ee||null===(M=Ee.data)||void 0===M||null===(B=M.nextActions)||void 0===B||B.forEach(e=>{"VERIFY_AND_FORWARD"!==(null==e?void 0:e.action)||"PENDING_FOR_FIELD_INSPECTION"!==ge||_e()||(e.isToast=!0,e.toastMessage="MISSING_ADDITIONAL_DETAILS")}),null==Ee||null===(F=Ee.data)||void 0===F||null===(U=F.actionState)||void 0===U||null===(k=U.nextActions)||void 0===k||k.forEach(e=>{"VERIFY_AND_FORWARD"!==(null==e?void 0:e.action)||"PENDING_FOR_FIELD_INSPECTION"!==ge||_e()||(e.isToast=!0,e.toastMessage="MISSING_ADDITIONAL_DETAILS")}),null==Ee||null===(H=Ee.data)||void 0===H||null===(j=H.nextActions)||void 0===j||j.forEach(e=>{"PAY"===(null==e?void 0:e.action)&&(e.redirectionUrll={pathname:L(ae)+"/"+(null==ve?void 0:ve.applicationNo)+"/"+(null==ve?void 0:ve.tenantId)+"?tenantId="+(null==ve?void 0:ve.tenantId)+"&ISWSAPP&applicationNumber="+(null==ve?void 0:ve.applicationNo),state:null==ve?void 0:ve.tenantId})}),null==Ee||null===(V=Ee.data)||void 0===V||null===(z=V.actionState)||void 0===z||null===(Y=z.nextActions)||void 0===Y||Y.forEach(e=>{"PAY"===(null==e?void 0:e.action)&&(e.redirectionUrll={pathname:L(ae)+"/"+(null==ve?void 0:ve.applicationNo)+"/"+(null==ve?void 0:ve.tenantId)+"?tenantId="+(null==ve?void 0:ve.tenantId)+"&ISWSAPP&applicationNumber="+(null==ve?void 0:ve.applicationNo),state:null==ve?void 0:ve.tenantId})});const ye={order:3,label:J("WS_APPLICATION"),onClick:function(){try{var e;const n=null==ve||null===(e=ve.applicationData)||void 0===e?void 0:e.tenantId;let t=null==ve?void 0:ve.oldApplication;return le(v({},null==ve?void 0:ve.applicationData),v({},null==ve?void 0:ve.propertyDetails),n,J,t).then(e=>Digit.Utils.pdf.generateModifyPdf(e)),Promise.resolve()}catch(e){return Promise.reject(e)}}};switch(ge){case"REJECTED":default:fe=[ye]}return Digit.Hooks.useClickOutside(se,()=>{ie(!1)},oe),fe.sort(function(e,n){return e.order-n.order}),l.createElement(t.Fragment,null,l.createElement("div",{className:"employee-main-application-details"},l.createElement("div",{className:"employee-application-details",style:{marginBottom:"15px"}},l.createElement(a.Header,{styles:{marginLeft:"0px",paddingTop:"10px",fontSize:"32px"}},J("CS_TITLE_APPLICATION_DETAILS")),fe&&fe.length>0&&l.createElement(a.MultiLink,{className:"multilinkWrapper employee-mulitlink-main-div",onHeadClick:()=>ie(!oe),displayOptions:oe,options:fe,downloadBtnClassName:"employee-download-btn-className",optionsClassName:"employee-options-btn-className",ref:se})),l.createElement(Wr,{applicationDetails:ve,isLoading:ce||pe,isDataLoading:ce||pe,applicationData:null==ve?void 0:ve.applicationData,mutate:Se,workflowDetails:Ee,businessService:null==ve||null===(G=ve.processInstancesDetails)||void 0===G||null===(q=G[0])||void 0===q||null===(K=q.businessService)||void 0===K?void 0:K.toUpperCase(),moduleCode:"WS",showToast:ne,setShowToast:te,closeToast:()=>{te(null)},timelineStatusPrefix:"WF_"+(null==ve||null===(X=ve.processInstancesDetails)||void 0===X||null===(Z=X[0])||void 0===Z||null===($=Z.businessService)||void 0===$?void 0:$.toUpperCase())+"_",isInfoLabel:"true"===sessionStorage.getItem("isPrivacyEnabled")})))},WSEditDisconnectionApplication:()=>{var e,n,r,u,d,s,c;const{t:p}=o.useTranslation();let{state:m}=i.useLocation();m=m?"string"==typeof m?JSON.parse(m):m:{},g(location.search);const[E,S]=t.useState(!1),[_,f]=t.useState(null),[C,N]=t.useState({}),[y,D]=t.useState({head:"",body:[]});let T=Digit.ULBService.getCurrentTenantId();T||Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY"),JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS"));const h=Digit.ULBService.getStateId();let{data:A,isLoading:I}=Digit.Hooks.ws.useWSConfigMDMS.WSDisconnectionConfig(h,{}),O=Lt(null===(e=m)||void 0===e||null===(n=e.data)||void 0===n?void 0:n.applicationDetails);const b=Lt(null===(r=m)||void 0===r||null===(u=r.data)||void 0===u?void 0:u.action);let{isLoading:L,data:R}=Digit.Hooks.ws.useDisConnectionDetails(p,T,null===(d=O)||void 0===d?void 0:d.applicationNo,null===(s=O)||void 0===s||null===(c=s.applicationData)||void 0===c?void 0:c.serviceType,{privacy:Digit.Utils.getPrivacyObject()});O=R;const[P,M,x]=Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM",{});t.useEffect(()=>{if(!L&&!I){var e;const n=A.find(e=>e.isDisonnectionEdit);n.head="WS_WATER_SEWERAGE_DISCONNECTION_EDIT_LABEL";let t=[];null==n||null===(e=n.body)||void 0===e||e.forEach(e=>{null!=e&&e.isDisonnectionEdit&&t.push(e)}),n.body=t,D(n)}},[R,L,A]),t.useEffect(function(){try{const e=!!sessionStorage.getItem("IsDetailsExists")&&JSON.parse(sessionStorage.getItem("IsDetailsExists")),n=function(n,t){if(null!==(n=O)&&void 0!==n&&null!==(t=n.applicationData)&&void 0!==t&&t.id&&!e)return Promise.resolve(w(O,0,!1)).then(function(e){M(v({},P,e)),N(v({},e)),sessionStorage.setItem("IsDetailsExists",JSON.stringify(!0))})}();return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[O,R,P]);const B=!!sessionStorage.getItem("IsDetailsExists")&&JSON.parse(sessionStorage.getItem("IsDetailsExists"));return L||!B||I?l.createElement(a.Loader,null):l.createElement(l.Fragment,null,l.createElement("div",{style:{marginLeft:"15px"}},l.createElement(a.Header,null,p(y.head))),l.createElement(a.FormComposer,{config:y.body,userType:"employee",onFormValueChange:(e,n,t)=>{var l,o;U.isEqual(P,n)||M(v({},P,n)),Object.keys(t.errors).length>0&&1==Object.keys(t.errors).length&&t.errors.owners&&0==Object.values(t.errors.owners.type).filter(e=>"required"===e.type).length&&(null==n||null===(l=n.cpt)||void 0===l||null===(o=l.details)||void 0===o||!o.propertyId)?S(!0):S(!Object.keys(t.errors).length)},label:p("CS_COMMON_SUBMIT"),onSubmit:function(e){try{const n=function(){if(E){const n=sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")?JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")):{};return Promise.resolve(W(e,n,b)).then(function(e){var n;S(!1),sessionStorage.setItem("redirectedfromEDIT",!0),sessionStorage.setItem("WS_SESSION_APPLICATION_DETAILS",JSON.stringify(e)),window.location.assign(""+window.location.origin+(null===(n=m)||void 0===n?void 0:n.url))})}f({warning:!0,message:"PLEASE_FILL_MANDATORY_DETAILS"}),setTimeout(()=>{f(!1)},3e3)}();return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},defaultValues:P,appData:C,noBreakLine:!0}),_&&l.createElement(a.Toast,{error:_.key,label:p(null==_?void 0:_.message),warning:null==_?void 0:_.warning,onClose:()=>{f(null)}}))},WSEditDisconnectionByConfig:()=>{var e,n,r,u,d,s,c;const{t:p}=o.useTranslation();let{state:m}=i.useLocation();m=m?"string"==typeof m?JSON.parse(m):m:{},g(location.search);const[E,S]=t.useState(!1),[_,f]=t.useState(null),[C,N]=t.useState({}),[y,D]=t.useState({head:"",body:[]});let T=Digit.ULBService.getCurrentTenantId();T||Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY"),JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS"));const h=Digit.ULBService.getStateId();let{data:A,isLoading:I}=Digit.Hooks.ws.useWSConfigMDMS.WSDisconnectionConfig(h,{}),O=Lt(null===(e=m)||void 0===e||null===(n=e.data)||void 0===n?void 0:n.applicationDetails);const b=Lt(null===(r=m)||void 0===r||null===(u=r.data)||void 0===u?void 0:u.action);let{isLoading:L,data:R}=Digit.Hooks.ws.useDisConnectionDetails(p,T,null===(d=O)||void 0===d?void 0:d.applicationNo,null===(s=O)||void 0===s||null===(c=s.applicationData)||void 0===c?void 0:c.serviceType,{privacy:Digit.Utils.getPrivacyObject()});O=R;const[P,M,x]=Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM",{});t.useEffect(()=>{if(!L&&!I){var e;const n=A.find(e=>e.isDisonnectionEdit);n.head="WS_WATER_SEWERAGE_DISCONNECTION_EDIT_LABEL";let t=[];null==n||null===(e=n.body)||void 0===e||e.forEach(e=>{null!=e&&e.isDisonnectionEditByConfig&&t.push(e)}),n.body=t,D(n)}},[R,L,A]),t.useEffect(function(){try{const e=!!sessionStorage.getItem("IsDetailsExists")&&JSON.parse(sessionStorage.getItem("IsDetailsExists")),n=function(n,t){if(null!==(n=O)&&void 0!==n&&null!==(t=n.applicationData)&&void 0!==t&&t.id&&!e)return Promise.resolve(w(O,0,!0)).then(function(e){M(v({},P,e)),N(v({},e)),sessionStorage.setItem("IsDetailsExists",JSON.stringify(!0))})}();return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[O,R,P]);const B=!!sessionStorage.getItem("IsDetailsExists")&&JSON.parse(sessionStorage.getItem("IsDetailsExists"));return L||!B||I?l.createElement(a.Loader,null):l.createElement(l.Fragment,null,l.createElement("div",{style:{marginLeft:"15px"}},l.createElement(a.Header,null,p(y.head))),l.createElement(a.FormComposer,{config:y.body,userType:"employee",onFormValueChange:(e,n,t)=>{var l,o;U.isEqual(P,n)||M(v({},P,n)),Object.keys(t.errors).length>0&&1==Object.keys(t.errors).length&&t.errors.owners&&0==Object.values(t.errors.owners.type).filter(e=>"required"===e.type).length&&(null==n||null===(l=n.cpt)||void 0===l||null===(o=l.details)||void 0===o||!o.propertyId)?S(!0):S(!Object.keys(t.errors).length)},label:p("CS_COMMON_SUBMIT"),onSubmit:function(e){try{const n=function(){if(E){const n=sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")?JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")):{};return Promise.resolve(W(e,n,b)).then(function(e){var n;S(!1),sessionStorage.setItem("redirectedfromEDIT",!0),sessionStorage.setItem("WS_SESSION_APPLICATION_DETAILS",JSON.stringify(e)),window.location.assign(""+window.location.origin+(null===(n=m)||void 0===n?void 0:n.url))})}f({warning:!0,message:"Please fill mandatory details"}),setTimeout(()=>{f(!1)},3e3)}();return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},defaultValues:P,appData:C,noBreakLine:!0}),_&&l.createElement(a.Toast,{error:_.key,label:p(null==_?void 0:_.message),warning:null==_?void 0:_.warning,onClose:()=>{f(null)}}))},WSResubmitDisconnection:()=>{var e,n,r,u,d,s,c,p;const{t:m}=o.useTranslation();let{state:E}=i.useLocation();E=E?"string"==typeof E?JSON.parse(E):E:{};let S=g(location.search);const[_,f]=t.useState(!1),[C,N]=t.useState(null),[y,D]=t.useState({}),[T,h]=t.useState({head:"",body:[]}),[A,I]=t.useState(!1);let O=Digit.ULBService.getCurrentTenantId();O||Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY");const b=Digit.ULBService.getStateId();let{data:L,isLoading:R}=Digit.Hooks.ws.useWSConfigMDMS.WSDisconnectionConfig(b,{});const P=JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")),M=(null==S?void 0:S.service)||(null==P||null===(e=P.applicationData)||void 0===e?void 0:e.serviceType);let x=Lt(null===(n=E)||void 0===n||null===(r=n.data)||void 0===r?void 0:r.applicationDetails);const B=Lt(null===(u=E)||void 0===u||null===(d=u.data)||void 0===d?void 0:d.action);let{isLoading:F,data:k}=Digit.Hooks.ws.useDisConnectionDetails(m,O,null===(s=x)||void 0===s?void 0:s.applicationNo,null===(c=x)||void 0===c||null===(p=c.applicationData)||void 0===p?void 0:p.serviceType,{privacy:Digit.Utils.getPrivacyObject()});x=k;const[H,j,V]=Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM",{}),{mutate:z}=Digit.Hooks.ws.useWSApplicationActions(M);t.useEffect(()=>{if(!F&&!R){var e;const n=L.find(e=>e.isDisonnectionEdit);n.head="WS_WATER_SEWERAGE_DISCONNECTION_EDIT_LABEL";let t=[];null==n||null===(e=n.body)||void 0===e||e.forEach(e=>{null!=e&&e.isDisonnectionEdit&&t.push(e)}),n.body=t,h(n)}},[k,F,L]),t.useEffect(function(){try{const e=!!sessionStorage.getItem("IsDetailsExists")&&JSON.parse(sessionStorage.getItem("IsDetailsExists")),n=function(n,t){if(null!==(n=x)&&void 0!==n&&null!==(t=n.applicationData)&&void 0!==t&&t.id&&!e)return Promise.resolve(w(x,0,!1)).then(function(e){j(v({},H,e)),D(v({},e)),sessionStorage.setItem("IsDetailsExists",JSON.stringify(!0))})}();return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[x,k,H]),t.useEffect(()=>{const e=setTimeout(()=>{const e=sessionStorage.getItem("disconnectionURL"),n=e?JSON.parse(e):{};A&&window.location.assign(""+window.location.origin+(null==n?void 0:n.url))},5e3);return()=>clearTimeout(e)},[A]);const Y=!!sessionStorage.getItem("IsDetailsExists")&&JSON.parse(sessionStorage.getItem("IsDetailsExists"));return F||!Y||R?l.createElement(a.Loader,null):l.createElement(l.Fragment,null,l.createElement("div",{style:{marginLeft:"15px"}},l.createElement(a.Header,null,m(T.head))),l.createElement(a.FormComposer,{config:T.body,userType:"employee",onFormValueChange:(e,n,t)=>{var l,o;U.isEqual(H,n)||j(v({},H,n)),Object.keys(t.errors).length>0&&1==Object.keys(t.errors).length&&t.errors.owners&&0==Object.values(t.errors.owners.type).filter(e=>"required"===e.type).length&&(null==n||null===(l=n.cpt)||void 0===l||null===(o=l.details)||void 0===o||!o.propertyId)?f(!0):f(!Object.keys(t.errors).length)},label:m("CS_COMMON_SUBMIT"),onSubmit:function(e){try{const n=function(){if(_){const n=sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")?JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")):{};return Promise.resolve(W(e,n,B)).then(function(e){f(!1),sessionStorage.setItem("redirectedfromEDIT",!0),sessionStorage.setItem("WS_SESSION_APPLICATION_DETAILS",JSON.stringify(e)),e.processInstance.action="RESUBMIT_APPLICATION";let n="WATER"==e.serviceType?{WaterConnection:e}:{SewerageConnection:e};n.disconnectRequest=!0,z&&z(n,{onError:(e,n)=>{N({key:"error",message:null!=e&&e.message?e.message:e}),f(!0)},onSuccess:(e,n)=>{N({key:!1,message:"WS_APPLICATION_SUBMITTED_SUCCESSFULLY_LABEL"}),I(!0)}})})}N({warning:!0,message:"PLEASE_FILL_MANDATORY_DETAILS"}),setTimeout(()=>{N(!1)},3e3)}();return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},defaultValues:H,appData:y,noBreakLine:!0}),C&&l.createElement(a.Toast,{error:C.key,label:m(null==C?void 0:C.message),warning:null==C?void 0:C.warning,onClose:()=>{N(null)}}))},WSSearchWaterConnectionIntegrated:Hr,WSSearchIntegrated:e=>{const[n,i]=t.useState(!0),{t:r}=o.useTranslation(),u=Digit.ULBService.getCurrentTenantId(),[d,s]=t.useState({}),[c,p]=t.useState(!1),m=Digit.ComponentRegistryService.getComponent("WSSearchWaterConnectionIntegrated"),E=window.location.pathname.includes("water/search")?"WS":"SW",[S,_]=t.useState(null),f=t.useCallback(e=>{const{connectionNumber:n,oldConnectionNumber:t,mobileNumber:l,propertyId:o}=e;n||t||l||o?s(Object.keys(e).filter(n=>e[n]).reduce((n,t)=>v({},n,{[t]:"object"==typeof e[t]?e[t].code:e[t]}),{})):(_({error:!0,label:"WS_HOME_SEARCH_CONN_RESULTS_DESC"}),setTimeout(()=>{_(!1)},3e3))}),g={enabled:!!(d&&Object.keys(d).length>0)};let C=Digit.Hooks.ws.useSearchWS({tenantId:u,filters:d,config:g,bussinessService:"WS",t:r,shortAddress:!0}),N=Digit.Hooks.ws.useSearchWS({tenantId:u,filters:d,config:g,bussinessService:"SW",t:r,shortAddress:!0});return window.Digit.Utils.browser.isMobile(),l.createElement(t.Fragment,null,l.createElement(m,{t:r,tenantId:u,onSubmit:f,data:0==(null==N||null===(T=N.data)||void 0===T?void 0:T.length)&&0==(null==C||null===(h=C.data)||void 0===h?void 0:h.length)?{display:"ES_COMMON_NO_CONNECTION"}:(null==C||null===(A=C.data)||void 0===A?void 0:A.length)>0&&0==(null==N||null===(I=N.data)||void 0===I?void 0:I.length)?null==C?void 0:C.data:(null==N||null===(O=N.data)||void 0===O?void 0:O.length)>0&&0==(null==C||null===(b=C.data)||void 0===b?void 0:b.length)?null==N?void 0:N.data:(null==N||null===(L=N.data)||void 0===L?void 0:L.length)>0&&(null==C||null===(R=C.data)||void 0===R?void 0:R.length)>0?[...N.data,...C.data]:[],count:10,resultOk:(null==C||null===(y=C.data)||void 0===y?void 0:y.length)>0||(null==N||null===(D=N.data)||void 0===D?void 0:D.length)>0,businessService:E}),S&&l.createElement(a.Toast,{error:S.error,warning:S.warning,label:r(S.label),onClose:()=>{_(null)}}));var y,D,T,h,A,I,O,b,L,R},WSSearchWaterConnectionViewIntegrated:e=>{let{data:n,onSubmit:o,count:i,resultOk:a}=e;return l.createElement(t.Fragment,null,l.createElement(Hr,{onSubmit:o,data:n,count:i,resultOk:a}))},WSBulkBillGeneration:e=>{const[n,i]=t.useState(!0),{t:r}=o.useTranslation(),[u,d]=t.useState({}),[s,c]=t.useState(!1),v=Digit.ComponentRegistryService.getComponent("WSBulkBillSearch"),p=Digit.ULBService.getCurrentTenantId(),m=window.location.pathname.includes("water/search-connection")?"WS":"SW",[E,S]=t.useState(null),_={enabled:!!(u&&Object.keys(u).length>0)};let f=Digit.Hooks.ws.useBulkSearchWS({tenantId:p,filters:u,config:_});const g=window.Digit.Utils.browser.isMobile();return null!=f&&f.isLoading&&g?l.createElement(a.Loader,null):l.createElement(t.Fragment,null,l.createElement(v,{t:r,tenantId:p,onSubmit:e=>{var n;d({locality:null==e||null===(n=e.locality)||void 0===n?void 0:n.code})},data:(console.log("result",f),0==(null==f?void 0:f.meterReadings.length)?{display:"ES_COMMON_NO_DATA"}:(null==f?void 0:f.meterReadings.length)>0?null==f?void 0:f.meterReadings.map(e=>({billingPeriod:e.billingPeriod,connectionNo:e.connectionNo,lastReading:e.lastReading,lastReadingDate:e.lastReadingDate,meterStatus:e.meterStatus,currentReadingDate:"",currentReading:""})):[]),count:null==f?void 0:f.count,resultOk:(null==f||null===(C=f.meterReadings)||void 0===C?void 0:C.length)>0,businessService:m,isLoading:null==f?void 0:f.isLoading}),E&&l.createElement(a.Toast,{error:E.error,warning:E.warning,label:r(E.label),onClose:()=>{S(null)}}));var C}};exports.initWSComponents=()=>{Object.entries(jr).forEach(e=>{let[n,t]=e;Digit.ComponentRegistryService.setComponent(n,t)})};
|