@egovernments/digit-ui-module-core 1.5.21 → 1.5.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("@egovernments/digit-ui-react-components"),n=require("react"),r=e(n),i=require("react-i18next"),o=require("react-query"),a=require("react-redux"),l=require("react-router-dom"),c=e(require("react-tooltip")),u=require("redux"),s=e(require("redux-thunk"));function d(){return(d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function m(e,t){return(m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function f(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)t.indexOf(n=o[r])>=0||(i[n]=e[n]);return i}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function p(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return v(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var E={error:{imgUrl:"https://s3.ap-south-1.amazonaws.com/egov-qa-assets/error-image.png",infoMessage:"CORE_SOMETHING_WENT_WRONG",buttonInfo:"ACTION_TEST_HOME"},maintenance:{imgUrl:"https://s3.ap-south-1.amazonaws.com/egov-qa-assets/maintainence-image.png",infoMessage:"CORE_UNDER_MAINTENANCE",buttonInfo:"ACTION_TEST_HOME"},notfound:{imgUrl:"https://s3.ap-south-1.amazonaws.com/egov-qa-assets/PageNotFound.png",infoMessage:"CORE_NOT_FOUND",buttonInfo:"ACTION_TEST_HOME"}},g=function(e){var t=Digit.Hooks.useQueryParams().type,n=E[void 0===t?"error":t],o=i.useTranslation().t;return r.createElement("div",{className:"error-boundary"},r.createElement("div",{className:"error-container"},r.createElement("img",{src:n.imgUrl,alt:"error"}),r.createElement("h1",null,o(n.infoMessage)),r.createElement("button",{onClick:function(){e.goToHome()}},o(n.buttonInfo))))},y=function(){var e,t,n="employee"===Digit.UserService.getType()?"/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/employee/user/error":"/"+(null===(t=window)||void 0===t?void 0:t.contextPath)+"/citizen/error";return window.location.href.includes("employee/user/error")||window.location.href.includes("citizen/error")||"development"===process.env.NODE_ENV||(window.location.href=n),r.createElement("span",null)},h=function(e){var t,n;function i(t){var n;return(n=e.call(this,t)||this).state={error:null,errorStack:null,hasError:!1},n}n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,m(t,n),i.getDerivedStateFromError=function(e){return{error:null==e?void 0:e.message,hasError:!0,errorStack:null==e?void 0:e.stack}};var o=i.prototype;return o.componentDidCatch=function(e,t){this.setState({error:null==e?void 0:e.message,hasError:!0,errorStack:null==e?void 0:e.stack})},o.render=function(){return this.state.hasError?r.createElement("div",{className:"error-boundary"},r.createElement(y,null),r.createElement(g,{initData:this.props.initData})):this.props.children},i}(r.Component),C=function(e,t,n){var r=null==e?void 0:e[""+t];r&&r.map(function(e){e.link=e.navigationURL,e.i18nKey=n(e.name)});var i,o={links:null==r?void 0:r.reverse(),header:Digit.Utils.locale.getTransformedLocale("ACTION_TEST_"+t),iconName:"CITIZEN_"+t+"_ICON"};return"FSM"===t&&[{role:"FSM_DSO",from:"/"+(null===(i=window)||void 0===i?void 0:i.contextPath)+"/citizen/fsm/dso-dashboard",dashoardLink:"CS_LINK_DSO_DASHBOARD",loginLink:"CS_LINK_LOGIN_DSO"}].map(function(e){var t,r,i,a=e.from,l=e.loginLink,c=e.dashoardLink;Digit.UserService.hasAccess(e.role)?null==o||null===(t=o.links)||void 0===t||t.push({link:a,i18nKey:n(c)}):null==o||null===(r=o.links)||void 0===r||r.push({link:"/"+(null===(i=window)||void 0===i?void 0:i.contextPath)+"/citizen/login",state:{role:"FSM_DSO",from:a},i18nKey:n(l)})}),o},O=function(e){var n=e.modules,o=e.getCitizenMenu,a=e.fetchedCitizen,l=e.isLoading,c=n.filter(function(e){return"Payment"===e.code})[0],u=n.filter(function(e){return"Payment"!==e.code}),s=[c].concat(u),d=i.useTranslation().t;return l?r.createElement(t.Loader,null):r.createElement(r.Fragment,null,r.createElement("div",{className:"citizen-all-services-wrapper"},r.createElement(t.BackButton,null),r.createElement("div",{className:"citizenAllServiceGrid"},s.filter(function(e){return e}).map(function(e,n){var i,l,c,u,s,m,f,v=e.code;return a&&(c=a?C(o,v,d):void 0),(null===(i=c)||void 0===i||null===(l=i.links)||void 0===l?void 0:l.length)>0?r.createElement(t.CitizenHomeCard,{header:d(null===(u=c)||void 0===u?void 0:u.header),links:null===(s=c)||void 0===s||null===(m=s.links)||void 0===m||null===(f=m.filter(function(e){return null==e?void 0:e.link}))||void 0===f?void 0:f.sort(function(e,t){return(null==e?void 0:e.orderNumber)-(null==t?void 0:t.orderNumber)}),Icon:function(){return function(e){switch(e){case"PT":return r.createElement(t.PTIcon,{className:"fill-path-primary-main"});case"WS":return r.createElement(t.WSICon,{className:"fill-path-primary-main"});case"FSM":return r.createElement(t.FSMIcon,{className:"fill-path-primary-main"});case"MCollect":return r.createElement(t.MCollectIcon,{className:"fill-path-primary-main"});case"PGR":return r.createElement(t.PGRIcon,{className:"fill-path-primary-main"});case"TL":return r.createElement(t.TLIcon,{className:"fill-path-primary-main"});case"OBPS":return r.createElement(t.OBPSIcon,{className:"fill-path-primary-main"});case"Bills":return r.createElement(t.BillsIcon,{className:"fill-path-primary-main"});default:return r.createElement(t.PTIcon,{className:"fill-path-primary-main"})}}(v)},Info:"OBPS"===v?function(){return r.createElement(t.CitizenInfoLabel,{style:{margin:"0px",padding:"10px"},info:d("CS_FILE_APPLICATION_INFO_LABEL"),text:d("BPA_CITIZEN_HOME_STAKEHOLDER_INCLUDES_INFO_LABEL")})}:null,isInfo:"OBPS"===v}):r.createElement(r.Fragment,null)}))))},b=function(e){return r.createElement("div",{className:"employee-app-container"},r.createElement("div",{className:"ground-container moduleCardWrapper gridModuleWrapper"},e.modules.map(function(e,t){var n=Digit.ComponentRegistryService.getComponent(e.code+"Card")||function(){return r.createElement(r.Fragment,null)};return r.createElement(n,{key:t})})))},S=function(e){var t=e.modules;return"citizen"===e.userType?r.createElement(O,{modules:t,getCitizenMenu:e.getCitizenMenu,fetchedCitizen:e.fetchedCitizen,isLoading:e.isLoading}):r.createElement(b,{modules:t})},N=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;null!==(r=e)&&void 0!==r&&r.includes(t);){var r,i;e=null===(i=e)||void 0===i?void 0:i.replace(t,n)}return e},w=function(e){var i,o=n.useState(null),a=o[0],c=o[1],u=n.useState([]),s=u[0],d=u[1],m=(n.useState([]),l.useHistory());return n.useEffect(function(){var e,t,n=Digit.SessionStorage.get("citizen.userRequestObject"),r=[],i=[];null==n||null===(e=n.info)||void 0===e||null===(t=e.roles)||void 0===t||t.forEach(function(e){return r.push(e.tenantId)});var o=r.filter(function(e,t,n){return n.indexOf(e)===t});null==o||o.forEach(function(e){var t;i.push({label:"TENANT_TENANTS_"+(null===(t=N(e,".","_"))||void 0===t?void 0:t.toUpperCase()),value:e})}),null==i||i.filter(function(e){return e.value==Digit.SessionStorage.get("Employee.tenantId")}),d(i)},[a]),r.createElement("div",{style:null!=e&&e.mobileView?{color:"#767676"}:{}},r.createElement(t.Dropdown,{t:null==e?void 0:e.t,option:s,selected:s.find(function(e){return e.value===(null==a?void 0:a.value)}),optionKey:"label",select:function(e){var t,n,r,i,o=Digit.SessionStorage.get("citizen.userRequestObject"),a=null===(t=Digit.SessionStorage.get("citizen.userRequestObject"))||void 0===t||null===(n=t.info)||void 0===n||null===(r=n.roles)||void 0===r?void 0:r.filter(function(t){return t.tenantId===e.value});if((null==a?void 0:a.length)>0&&(o.info.roles=a,o.info.tenantId=null==e?void 0:e.value),Digit.SessionStorage.set("Employee.tenantId",null==e?void 0:e.value),Digit.UserService.setUser(o),c(e),window.location.href.includes("/"+(null===(i=window)||void 0===i?void 0:i.contextPath)+"/employee/")){var l,u,s=(null===(l=location.state)||void 0===l?void 0:l.from)||"/"+(null===(u=window)||void 0===u?void 0:u.contextPath)+"/employee";m.replace(s)}window.location.reload()},freeze:!0,customSelector:r.createElement("label",{className:"cp"},null==e?void 0:e.t("TENANT_TENANTS_"+(null===(i=N(Digit.SessionStorage.get("Employee.tenantId"),".","_"))||void 0===i?void 0:i.toUpperCase())))}))},I=function(e){var i=e.dropdown||!1,o=Digit.Hooks.useStore.getInitData(),a=o.isLoading,l=o.data||{},c=l.languages,u=l.stateInfo,s=Digit.StoreData.getCurrentLanguage(),d=n.useState(s),m=d[0],f=d[1],v=function(e){f(e.value),Digit.LocalizationService.changeLanguage(e.value,u.code)};return a?null:i?r.createElement("div",null,r.createElement(t.Dropdown,{option:c,selected:c.find(function(e){return e.value===s}),optionKey:"label",select:v,freeze:!0,customSelector:r.createElement("label",{className:"cp"},c.find(function(e){return e.value===m}).label)})):r.createElement(r.Fragment,null,r.createElement("div",{style:{marginBottom:"5px"}},"Language"),r.createElement("div",{className:"language-selector"},c.map(function(e,n){return r.createElement("div",{className:"language-button-container",key:n},r.createElement(t.CustomButton,{selected:e.value===m,text:e.label,onClick:function(){return v(e)}}))})))},_=function(e){var t,n;return r.createElement("span",{className:"user-img-txt",onClick:e.toggleMenu,title:e.name},null==e||null===(t=e.name)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.toUpperCase())},D=function(e){var n,i,o,a,c,u,s,d=e.t,m=e.stateInfo,f=e.toggleSidebar,v=e.handleLogout,p=e.userDetails,E=e.CITIZEN,g=e.cityDetails,y=e.mobileView,h=e.userOptions,C=e.handleUserDropdownSelection,O=e.logoUrl,b=e.showLanguageChange,S=void 0===b||b,N=r.useState(null),D=N[0],T=N[1];r.useEffect(function(){try{var e,t=Digit.ULBService.getCurrentTenantId(),n=null==p||null===(e=p.info)||void 0===e?void 0:e.uuid,r=function(){if(n)return Promise.resolve(Digit.UserService.userSearch(t,{uuid:[n]},{})).then(function(e){if(e&&e.user&&e.user.length){var t,n=e.user[0],r=null==n||null===(t=n.photo)||void 0===t?void 0:t.split(",");T(null==r?void 0:r.at(0))}})}();return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[null!==D,null==p||null===(n=p.info)||void 0===n?void 0:n.uuid]);var L,R,A,P,x,M,k=Digit.ULBService.getCitizenCurrentTenant(!0),U=l.useHistory(),B=l.useLocation().pathname,F=Digit.Hooks.useNotificationCount({tenantId:k,config:{enabled:"EMPLOYEE"!==(null===(L=Digit.UserService)||void 0===L||null===(R=L.getUser())||void 0===R||null===(A=R.info)||void 0===A?void 0:A.type)&&"CITIZEN"===(null===(P=Digit.UserService)||void 0===P||null===(x=P.getUser())||void 0===x||null===(M=x.info)||void 0===M?void 0:M.type)&&!!k}}),j=F.data,V=(void 0===j?{}:j).unreadCount;if(E)return r.createElement("div",null,r.createElement(t.TopBar,{img:null==m?void 0:m.logoUrlWhite,isMobile:!0,toggleSidebar:function(){Digit.clikOusideFired?Digit.clikOusideFired=!1:f(!0)},logoUrl:null==m?void 0:m.logoUrlWhite,onLogout:v,userDetails:p,notificationCount:V<99?V:99,notificationCountLoaded:F.isSuccess,cityOfCitizenShownBesideLogo:d(k),onNotificationIconClick:function(){var e;U.push("/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/citizen/engagement/notifications")},hideNotificationIconOnSomeUrlsWhenNotLoggedIn:function(e){var t,n,r,i;return(null===(t=Digit.UserService)||void 0===t||null===(n=t.getUser())||void 0===n||!n.access_token)&&["/"+(null===(r=window)||void 0===r?void 0:r.contextPath)+"/citizen/select-language","/"+(null===(i=window)||void 0===i?void 0:i.contextPath)+"/citizen/select-location"].includes(e)}(B),changeLanguage:y?null:r.createElement(I,{dropdown:!0})}));var H=!(null==p||!p.access_token);return r.createElement("div",{className:"topbar"},y?r.createElement(t.Hamburger,{handleClick:f,color:"#9E9E9E"}):null,r.createElement("img",{className:"city",src:H?null==g?void 0:g.logoId:null==m?void 0:m.statelogo}),r.createElement("span",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"}},H&&(null!=g&&null!==(i=g.city)&&void 0!==i&&i.ulbGrade?r.createElement("p",{className:"ulb",style:y?{fontSize:"14px",display:"inline-block"}:{}},d(null==g?void 0:g.i18nKey).toUpperCase()," ",d("ULBGRADE_"+(null==g||null===(o=g.city)||void 0===o?void 0:o.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))).toUpperCase()):r.createElement("img",{className:"state",src:O})),!H&&r.createElement("p",{className:"ulb",style:y?{fontSize:"14px",display:"inline-block"}:{}},d("MYCITY_"+(null==m||null===(a=m.code)||void 0===a?void 0:a.toUpperCase())+"_LABEL")," ",d("MYCITY_STATECODE_LABEL")),!y&&r.createElement("div",{className:y?"right":"flex-right right w-80 column-gap-15",style:H?{}:{width:"80%"}},r.createElement("div",{className:"left"},!window.location.href.includes("employee/user/login")&&!window.location.href.includes("employee/user/language-selection")&&r.createElement(w,{dropdown:!0,t:d})),r.createElement("div",{className:"left"},S&&r.createElement(I,{dropdown:!0})),(null==p?void 0:p.access_token)&&r.createElement("div",{className:"left"},r.createElement(t.Dropdown,{option:h,optionKey:"name",select:C,showArrow:!0,freeze:!0,style:y?{right:0}:{},optionCardStyles:{overflow:"revert"},customSelector:null==D?r.createElement(_,{name:(null==p||null===(c=p.info)||void 0===c?void 0:c.name)||(null==p||null===(u=p.info)||void 0===u||null===(s=u.userInfo)||void 0===s?void 0:s.name)||"Employee"}):r.createElement("img",{src:D,style:{height:"48px",width:"48px",borderRadius:"50%"}})})),r.createElement("img",{className:"state",src:O}))))},T=function(e,n,i,o){var a,l;return[{type:"link",element:"HOME",text:e("COMMON_BOTTOM_NAVIGATION_HOME"),link:o?"/"+(null===(a=window)||void 0===a?void 0:a.contextPath)+"/employee":"/"+(null===(l=window)||void 0===l?void 0:l.contextPath)+"/citizen",icon:"HomeIcon",populators:{onClick:n}},{type:"component",element:"LANGUAGE",action:r.createElement(I,null),icon:"LanguageIcon"},{id:"login-btn",element:"LOGIN",text:e("CORE_COMMON_LOGIN"),icon:r.createElement(t.LogoutIcon,{className:"icon"}),populators:{onClick:i}}]},L="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAO4AAADUCAMAAACs0e/bAAAAM1BMVEXK0eL////Dy97GzuD4+fvL0uPg5O7T2efb4OvR1+Xr7vTk5/Df4+37/P3v8fbO1eTt8PUsnq5FAAAGqElEQVR4nO2d25ajIBBFCajgvf//a0eMyZgEjcI5xgt7Hmatme507UaxuJXidiDqjmSgeVIMlB1ZR1WZAf2gbdu0QwixSYzjOJPmHurfEGEfY9XzjNGG9whQCeVAuv5xQEySLtR9hPuIcwj0EeroN5m3D1IbsbgHK0esiQ9MKsqXVr8Hm/a/Pulk6wihpCIXBw3dh7bTvRBt9+dC5NfS1VH3xETdM3MxXRN1T0zUPTNR98xcS1dlV9NNfx3DhkTdM6PKqHteVBF1z0vU5f0sKdpc2zWLKutXrjJjdLvpesRmukqYonauPhXpdsLb6CppmpnltsYIuY2yavi6Mi2/rzAWm1zUfF0limVLqkZyA+mDYevKBS37aGC+L1lX5e7uyU1Cv565uiua9k5LFqbqqrnu2I3m+jJ11ZoLeRtfmdB0Uw/ZDsP0VTxdn7a1VERfmq7XlXyn5D2QWLoq8bZlPoBJumphJjVBw/Ll6CoTZGsTDs4NrGqKbqBth8ZHJUi6cn168QmleSm6GmB7Kxm+6obXlf7PoDHosCwM3QpiS2legi6ocSl3L0G3BdneDDgwQdENfeY+SfDJBkF37ZB+GvwzA6/rMaafAn8143VhPZWdjMWG1oHXhdnemgPoAvLlB/iZyRTfVeF06wPoQhJmlm4bdcOAZRlRN5gcPc5SoPEQR1fDdbOo6wn+uYvXxY0QCLom6gYROKH+Aj5nvphuFXWDiLpRdxl/19LFT95k6CHCrnW7pCDqBn1i1PUFvii2c11oZOJ6usWeH0RRNzC4Zs+6FTi2nevCVwCjbugnXklX5fkfTldL8PEilUB1kfNyN1u9MME2sATr4lbuB7AjfLAuvsRm1A0g6gYRdcPAjvBlje2Z8brI8OC68AcRdlCkwLohx2mcZMjw9q+LzarQurjtnwPYAydX08WecECO/u6Ad0GBdYG7jO5gB4Ap+PwKcA9ZT43dn4/W9TyiPAn4OAJaF7h3uwe8StSCddFdM3jqFa2LvnnB5zzhuuBBAjY4gi50cg694gnXhTYvfMdrjtcFZhrwE9r41gUem8IXWMC3LrBzxh+a0gRd1N1LOK7M0IUUGuggvEmHoStA2/MJh7MpupiDU4TzjhxdzLAoO4ouZvqVURbFMHQlZD6SUeWHoguZsSLUGegrehA+FZFowPdUWTi6iMoZlIpGGUUXkDbjj/9ZOLqAQS/+GIKl5BQOCn/ycqpzkXSDm5dU7ZWkG7wUyGlcmm7g5Ux56AqirgoaJ7BeokPTDbp9CbVunjFxPrl7+HqnkrSq1Da7JX20f3dV8yJi6voO81mX8vV0mx3qUsZCPRfTlVRdz2EvdufYGDvNQvvwqHtmXd+a1ITinwNcXc+lT6JuzdT1XDyBn/x7wtX1HCQQdW9MXc8xArGrirowfLeUEbMqqq6f7TF1lfRdOuGNiGi6SpT+WxY06xUfNN2wBfyE9I4tlm7w5hvOPDNJN3yNiLMipji6gE3chKhouoCtN5x3QlF0EZt8OW/8ougitqJQlk1aii7iFC9l0MvRReyao7xNjKML2Z/PuHlzhi5mFxljiZeiC9rPTEisNEMX9KYAwo5Xhi7qaA3hamboYm7dG+NVrXhdaYDv5zFaQZsYrCtbbAGnjkQDX2+J1FXCwOsqWOpKoIQNTFdqYBWydxqNqUoG0pVpCS+H8kaJaGKErlIaXj7CRRE+gRWuKwW9YZ80oVOUgbpdT0zpnSZJTIiwCtJVelvXntr4P5j6BWfPb5Wcx84C4cq3hb11lco2u2Mdwp6XdJ/Ne3wb8DWdfiRenZaXrhLwOj4e+GQeHroy3YOspS7TlU28Wle2m2QUS0mqdcbrdNW+ZHsSsyK7tBfm0q/dWcv+Z3mytVx3t7KWulqUe6ilunu8jF8pFwgv1FXp3mUt35OtRbr7eM4u4Gs6vUBXgeuHc5kfE/cbvWZtkROLm1DMtLCy80tzsu2PRj0hTI8fvrQuvsjlJkyutszq+m423wHaLTyniy/XuiGZ84LuT+m5ZfNfRxyGs7LXZOvia7VujatUwVTrIt+Q/Csc7Tuhe+BOakT10b4TuoiiJjvgU9emTO42PwEfBa+cuodKkuf42DXr1D3JpXz73Hnn0j10evHKe+nufgfUm+7B84sX9FfdEzXux2DBpWuKokkCqN/5pa/8pmvnL+RGKCddCGmatiPyPB/+ekO/M/q/7uvbt22kTt3zEnXPzCV13T3Gel4/6NduDu66xRvlPNkM1RjjxUdv+4WhGx6TftD19Q/dfzpwcHO+rE3fAAAAAElFTkSuQmCC",R=function(e){return r.createElement("h1",{className:"heading-m"},e.label)},A=function(){return r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},r.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),r.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=function(e){return r.createElement("div",{onClick:null==e?void 0:e.onClick,style:null!=e&&e.isMobileView?{padding:5}:null},null!=e&&e.isMobileView?r.createElement(t.CloseSvg,null):r.createElement("div",{className:"icon-bg-secondary",style:{backgroundColor:"#505A5F"}}," ",r.createElement(A,null)," "))},x=function(e){var n=e.onSelect,o=e.onCancel,a=e.onDismiss,l=i.useTranslation().t,c=r.useState(window.innerWidth<=780),u=c[0],s=c[1],d=function(){window.innerWidth<=780?u||s(!0):u&&s(!1)};return r.useEffect(function(){return window.addEventListener("resize",function(){d()}),function(){window.addEventListener("resize",function(){d()})}}),u?r.createElement(t.Modal,{popupStyles:{height:"174px",maxHeight:"174px",width:"324px",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"},popupModuleActionBarStyles:{display:"flex",flex:1,justifyContent:"flex-start",width:"100%",position:"absolute",left:0,bottom:0,padding:"18px"},style:{flex:1},popupModuleMianStyles:{padding:"18px"},headerBarMain:r.createElement(R,{label:l("CORE_LOGOUT_WEB_HEADER")}),headerBarEnd:r.createElement(P,{onClick:a,isMobileView:u}),actionCancelLabel:l("CORE_LOGOUT_CANCEL"),actionCancelOnSubmit:o,actionSaveLabel:l("CORE_LOGOUT_WEB_YES"),actionSaveOnSubmit:n,formId:"modal-action"},r.createElement("div",null,r.createElement(t.CardText,{style:{margin:0}},l("CORE_LOGOUT_WEB_CONFIRMATION_MESSAGE")+" "))):r.createElement(t.Modal,{popupModuleMianStyles:{paddingTop:"30px"},headerBarMain:r.createElement(R,{label:l("CORE_LOGOUT_WEB_HEADER")}),headerBarEnd:r.createElement(P,{onClick:a,isMobileView:!1}),actionCancelLabel:l("CORE_LOGOUT_CANCEL"),actionCancelOnSubmit:o,actionSaveLabel:l("CORE_LOGOUT_WEB_YES"),actionSaveOnSubmit:n,formId:"modal-action"},r.createElement("div",null,r.createElement(t.CardText,{style:{marginBottom:"54px",marginLeft:"8px",marginRight:"8px"}},l("CORE_LOGOUT_WEB_CONFIRMATION_MESSAGE")+" ",r.createElement("strong",null,l("CORE_LOGOUT_MESSAGE"),"?"))))},M=function(e){var t=e.info,n=e.t;return r.createElement("div",{className:"profile-section"},r.createElement("div",{className:"imageloader imageloader-loaded"},r.createElement("img",{className:"img-responsive img-circle img-Profile",src:L})),r.createElement("div",{id:"profile-name",className:"label-container name-Profile"},r.createElement("div",{className:"label-text"}," ",null==t?void 0:t.name," ")),r.createElement("div",{id:"profile-location",className:"label-container loc-Profile"},r.createElement("div",{className:"label-text"}," ",null==t?void 0:t.mobileNumber," ")),(null==t?void 0:t.emailId)&&r.createElement("div",{id:"profile-emailid",className:"label-container loc-Profile"},r.createElement("div",{className:"label-text"}," ",t.emailId," ")),r.createElement("div",{className:"profile-divider"}),window.location.href.includes("/employee")&&!window.location.href.includes("/employee/user/login")&&!window.location.href.includes("employee/user/language-selection")&&r.createElement(w,{t:n,mobileView:!0}))},k={CommonPTIcon:r.createElement(t.PTIcon,{className:"icon"}),OBPSIcon:r.createElement(t.OBPSIcon,{className:"icon"}),propertyIcon:r.createElement(t.PropertyHouse,{className:"icon"}),TLIcon:r.createElement(t.CaseIcon,{className:"icon"}),PGRIcon:r.createElement(t.PGRIcon,{className:"icon"}),FSMIcon:r.createElement(t.FSMIcon,{className:"icon"}),WSIcon:r.createElement(t.WSICon,{className:"icon"}),MCollectIcon:r.createElement(t.MCollectIcon,{className:"icon"}),BillsIcon:r.createElement(t.CollectionIcon,{className:"icon"}),BirthIcon:r.createElement(t.BirthIcon,{className:"icon"}),DeathIcon:r.createElement(t.DeathIcon,{className:"icon"}),FirenocIcon:r.createElement(t.FirenocIcon,{className:"icon"}),HomeIcon:r.createElement(t.HomeIcon,{className:"icon"}),EditPencilIcon:r.createElement(t.EditPencilIcon,{className:"icon"}),LogoutIcon:r.createElement(t.LogoutIcon,{className:"icon"}),Phone:r.createElement(t.Phone,{className:"icon"})},U=function(e){var o,a,c,u=e.linkData,s=e.islinkDataLoading,m=i.useTranslation().t,f=l.useHistory(),v=l.useLocation().pathname,p=Digit.Hooks.useStore.getInitData(),E=p.data,g=p.isFetched,y=(E||{}).stateInfo,h=Digit.UserService.getUser(),C=window.Digit.Utils.browser.isMobile(),O=n.useState(!1)[0],b=n.useState(!1)[1],S=n.useState(!1),N=S[0],w=S[1],I=function(){w(!1)};if(s)return r.createElement(t.Loader,null);var _=function(){var e;f.push("/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/citizen/user/profile")},D=[].concat(T(m,_,function(){var e;f.push("/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/citizen/login")},O));D=D.filter(function(e){return"LANGUAGE"!==e.element}),Digit.ULBService.getCurrentTenantId();var L,R=function(e){var t,n,i,o=e.item,a=(null==o?void 0:o.icon)||(null===(t=o.icon)||void 0===t||null===(n=t.type)||void 0===n?void 0:n.name),c=a?k[a]:k.BillsIcon;i="component"===o.type?o.action:o.text;var u=function(){return r.createElement("span",d({className:"menu-item"},o.populators),c,r.createElement("div",{className:"menu-label"},i))};return"external-link"===o.type?r.createElement("a",{href:o.link},r.createElement(u,null)):"link"===o.type?r.createElement(l.Link,{to:null==o?void 0:o.link},r.createElement(u,null)):r.createElement(u,null)};return g&&h&&h.access_token&&(L=r.createElement(M,{info:null==h?void 0:h.info,stateName:null==y?void 0:y.name,t:m}),D=D.filter(function(e){return"login-btn"!==(null==e?void 0:e.id)}),D=[].concat(D,[{text:m("EDIT_PROFILE"),element:"PROFILE",icon:"EditPencilIcon",populators:{onClick:_}},{text:m("CORE_COMMON_LOGOUT"),element:"LOGOUT",icon:"LogoutIcon",populators:{onClick:function(){b(!1),w(!0)}}},{text:r.createElement(r.Fragment,null,m("CS_COMMON_HELPLINE"),r.createElement("div",{className:"telephone",style:{marginTop:"-10%"}},null==E?void 0:E.tenants.map(function(e){}),r.createElement("div",{className:"link"},r.createElement("a",{href:"tel:"+(null==E?void 0:E.tenants[0].contactNumber)},null==E?void 0:E.tenants[0].contactNumber)))),element:"Helpline",icon:"Phone"}])),null===(o=Object.keys(u))||void 0===o||null===(a=o.sort(function(e,t){return t.localeCompare(e)}))||void 0===a||a.map(function(e){var t,n,r,i,o,a;(null===(t=u[e][0])||void 0===t?void 0:t.sidebar)===window.contextPath+"-links"&&D.splice(1,0,{type:null!==(n=u[e][0])&&void 0!==n&&null!==(r=n.sidebarURL)&&void 0!==r&&r.includes(null===(i=window)||void 0===i?void 0:i.contextPath)?"link":"external-link",text:m("ACTION_TEST_"+Digit.Utils.locale.getTransformedLocale(e)),links:u[e],icon:null===(o=u[e][0])||void 0===o?void 0:o.leftIcon,link:null===(a=u[e][0])||void 0===a?void 0:a.sidebarURL})}),r.createElement(r.Fragment,null,r.createElement("div",null,r.createElement("div",{style:{height:"100%",width:"100%",top:"0px",backgroundColor:"rgba(0, 0, 0, 0.54)",pointerzevents:"auto"}}),r.createElement("div",{style:{display:"flex",flexDirection:"column",height:C?"calc(100vh - 56px)":"auto",zIndex:"99"}},L,r.createElement("div",{className:"drawer-desktop"},null===(c=D)||void 0===c?void 0:c.map(function(e,t){return r.createElement("div",{className:"sidebar-list "+(v===(null==e?void 0:e.link)||v===(null==e?void 0:e.sidebarURL)?"active":""),key:t},r.createElement(R,{item:e}))}))),r.createElement("div",null,N&&r.createElement(x,{onSelect:function(){Digit.UserService.logout(),w(!1)},onCancel:I,onDismiss:I}))))},B=function(e){var t=e.info,n=e.t,i=r.useState(null),o=i[0],a=i[1];return r.useEffect(function(){try{var e=Digit.ULBService.getCurrentTenantId(),n=null==t?void 0:t.uuid,r=function(){if(n)return Promise.resolve(Digit.UserService.userSearch(e,{uuid:[n]},{})).then(function(e){if(e&&e.user&&e.user.length){var t,n=e.user[0],r=null==n||null===(t=n.photo)||void 0===t?void 0:t.split(",");a(null==r?void 0:r.at(0))}})}();return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[null!==o]),r.createElement("div",{className:"profile-section"},r.createElement("div",{className:"imageloader imageloader-loaded"},r.createElement("img",{className:"img-responsive img-circle img-Profile",src:o||L,style:{objectFit:"cover",objectPosition:"center"}})),r.createElement("div",{id:"profile-name",className:"label-container name-Profile"},r.createElement("div",{className:"label-text"}," ",null==t?void 0:t.name," ")),r.createElement("div",{id:"profile-location",className:"label-container loc-Profile"},r.createElement("div",{className:"label-text"}," ",null==t?void 0:t.mobileNumber," ")),(null==t?void 0:t.emailId)&&r.createElement("div",{id:"profile-emailid",className:"label-container loc-Profile"},r.createElement("div",{className:"label-text"}," ",t.emailId," ")),r.createElement("div",{className:"profile-divider"}),window.location.href.includes("/employee")&&!window.location.href.includes("/employee/user/login")&&!window.location.href.includes("employee/user/language-selection")&&r.createElement(w,{t:n,mobileView:!0}))},F=function(){var e,t,n;return r.createElement("div",{className:"digit-footer",style:{marginBottom:0}},r.createElement("img",{alt:"Powered by DIGIT",src:null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_FOOTER"),style:{cursor:"pointer"},onClick:function(){var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})," ")},j=function(e){var o=e.isOpen,a=e.isMobile,c=void 0!==a&&a,u=e.toggleSidebar,s=e.onLogout,m=e.isEmployee,f=void 0!==m&&m,v=e.linkData,p=e.islinkDataLoading,E=Digit.Hooks.useStore.getInitData(),g=E.data,y=E.isFetched,h=(g||{}).stateInfo,C=Digit.UserService.getUser(),O=n.useState(""),b=O[0],S=O[1],N=i.useTranslation().t,w=l.useHistory(),I=function(){Digit.clikOusideFired=!0,u(!1)},_=Digit.Hooks.useAccessControl(),D=_.isLoading,L=_.data;if(Digit.ULBService.getCurrentTenantId(),p||D)return r.createElement(t.Loader,null);var R,A=[].concat(T(N,I,function(){var e;w.push("/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/citizen/login"),I()},f));y&&C&&C.access_token&&(R=r.createElement(B,{info:null==C?void 0:C.info,stateName:null==h?void 0:h.name,t:N}),A=A.filter(function(e){return"login-btn"!==(null==e?void 0:e.id)}),A=[].concat(A,[{text:N("EDIT_PROFILE"),element:"PROFILE",icon:"EditPencilIcon",populators:{onClick:function(){var e,t,n=f?"/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/employee/user/profile":"/"+(null===(t=window)||void 0===t?void 0:t.contextPath)+"/citizen/user/profile";w.push(n),I()}}},{text:N("CORE_COMMON_LOGOUT"),element:"LOGOUT",icon:"LogoutIcon",populators:{onClick:s}},{text:r.createElement(r.Fragment,null,N("CS_COMMON_HELPLINE"),r.createElement("div",{className:"telephone",style:{marginTop:"-10%"}},null==g?void 0:g.tenants.map(function(e){}),r.createElement("div",{className:"link"},r.createElement("a",{href:"tel:"+(null==g?void 0:g.tenants[0].contactNumber)},null==g?void 0:g.tenants[0].contactNumber)))),element:"Helpline",icon:"Phone"}]));var P={};if(f){var x;null==L||L.actions.filter(function(e){return"url"===e.url&&"Home"!==e.displayName}).forEach(function(e){var t;if(""==b&&""!==e.path){var n=e.path.split(".")[0];"TradeLicense"===n&&(n="Trade License"),P[n]?P[n].push(e):P[n]=[e]}else if(""!==e.path&&null!=e&&null!==(t=e.displayName)&&void 0!==t&&t.toLowerCase().includes(b.toLowerCase())){var r=e.path.split(".")[0];"TradeLicense"===r&&(r="Trade License"),P[r]?P[r].push(e):P[r]=[e]}});for(var M=Object.keys(P),k=function(e){var t,n,r,i,o,a,l,c,u,s,m,f=null===(t=P[M[e]][0])||void 0===t||null===(n=t.displayName)||void 0===n||null===(r=n.toUpperCase())||void 0===r?void 0:r.replace(/[ -]/g,"_"),v=null===(i=M[e])||void 0===i||null===(o=i.toUpperCase())||void 0===o?void 0:o.replace(/[ -]/g,"_");-1===P[M[e]][0].path.indexOf(".")?A.splice(1,0,{type:"link",text:N("ACTION_TEST_"+f),link:null===(a=P[M[e]][0])||void 0===a?void 0:a.navigationURL,icon:null===(l=P[M[e]][0])||void 0===l||null===(c=l.leftIcon)||void 0===c||null===(u=c.split)||void 0===u?void 0:u.call(c,":")[1],populators:{onClick:function(){var t;w.push(null===(t=P[M[e]][0])||void 0===t?void 0:t.navigationURL),I()}}}):A.splice(1,0,{type:"dynamic",moduleName:N("ACTION_TEST_"+v),links:null===(s=P[M[e]])||void 0===s?void 0:s.map(function(e){var t,n;return d({},e,{displayName:N("ACTION_TEST_"+(null==e||null===(t=e.displayName)||void 0===t||null===(n=t.toUpperCase())||void 0===n?void 0:n.replace(/[ -]/g,"_")))})}),icon:null===(m=P[M[e]][1])||void 0===m?void 0:m.leftIcon})},j=0;j<M.length;j++)k(j);var V=A.findIndex(function(e){return"HOME"===e.element}),H=A.splice(V,1),z=A.findIndex(function(e){return"LANGUAGE"===e.element}),G=A.splice(z,(null===(x=A)||void 0===x?void 0:x.length)-z);A.sort(function(e,t){return("dynamic"===(null==e?void 0:e.type)?null==e?void 0:e.moduleName:null==e?void 0:e.text).localeCompare("dynamic"===(null==t?void 0:t.type)?null==t?void 0:t.moduleName:null==t?void 0:t.text)}),(null==H?void 0:H[0])&&A.splice(0,0,H[0]),A=(null==G?void 0:G.length)>0?A.concat(G):A}else{var W,q;null===(W=Object.keys(v))||void 0===W||null===(q=W.sort(function(e,t){return t.localeCompare(e)}))||void 0===q||q.map(function(e){var t,n,r,i,o,a;"digit-ui-links"===(null===(t=v[e][0])||void 0===t?void 0:t.sidebar)&&A.splice(1,0,{type:null!==(n=v[e][0])&&void 0!==n&&null!==(r=n.sidebarURL)&&void 0!==r&&r.includes(null===(i=window)||void 0===i?void 0:i.contextPath)?"link":"external-link",text:N("ACTION_TEST_"+Digit.Utils.locale.getTransformedLocale(e)),links:v[e],icon:null===(o=v[e][0])||void 0===o?void 0:o.leftIcon,link:null===(a=v[e][0])||void 0===a?void 0:a.sidebarURL})})}return w.location.pathname.includes("/openlink")&&(R=r.createElement("span",null),A=A.filter(function(e){return"LANGUAGE"===e.element})),c?r.createElement(t.NavBar,{open:o,toggleSidebar:u,profileItem:R,onClose:I,menuItems:A,Footer:r.createElement(F,null),isEmployee:f,search:b,setSearch:S}):r.createElement(U,{logout:s})},V=function(e){var o,a,u,s,d,m,f,v,p,E,g,y,h=e.item,C=n.useState(!1),O=C[0],b=C[1],S=l.useLocation().pathname,N=i.useTranslation().t,w={home:r.createElement(t.HomeIcon,null),announcement:r.createElement(t.ComplaintIcon,null),business:r.createElement(t.BPAHomeIcon,null),store:r.createElement(t.PropertyHouse,null),assignment:r.createElement(t.CaseIcon,null),receipt:r.createElement(t.ReceiptIcon,null),"business-center":r.createElement(t.PersonIcon,null),description:r.createElement(t.DocumentIconSolid,null),"water-tap":r.createElement(t.DropIcon,null),"collections-bookmark":r.createElement(t.CollectionsBookmarIcons,null),"insert-chart":r.createElement(t.FinanceChartIcon,null),edcr:r.createElement(t.CollectionIcon,null),collections:r.createElement(t.CollectionIcon,null)},I=w[(null==h||null===(o=h.icon)||void 0===o||null===(a=o.leftIcon)||void 0===a||null===(u=a.split)||void 0===u||null===(s=u.call(a,":"))||void 0===s?void 0:s[1])||(null==h||null===(d=h.leftIcon)||void 0===d||null===(m=d.split)||void 0===m?void 0:m.call(d,":")[1])]||w.collections,_=(null==h||null===(f=h.icon)||void 0===f||null===(v=f.leftIcon)||void 0===v||null===(p=v.split)||void 0===p?void 0:p.call(v,":"))||(null==h||null===(E=h.leftIcon)||void 0===E||null===(g=E.split)||void 0===g?void 0:g.call(E,":"));if("dynamic"==(null==_?void 0:_[0])){var D,T=null===(D=require("@egovernments/digit-ui-react-components"))||void 0===D?void 0:D[null==_?void 0:_[1]];I=T?r.createElement(T,null):I}var L,R=null==h||null===(y=h.moduleName)||void 0===y?void 0:y.replace(/[ -]/g,"_"),A=N("ACTION_TEST_"+R),P=N((null==A?void 0:A.length)>20?A.substring(0,20)+"...":A);if("single"===h.type){var x,M,k=window.location.origin;return r.createElement("div",{className:"submenu-container"},r.createElement("div",{className:"sidebar-link "+(S===(null==h?void 0:h.navigationURL)?"active":"")},r.createElement("div",{className:"actions",onClick:function(){return window.location.href=k+"/employee/"+h.navigationURL}},I,-1===(null===(x=h.navigationURL)||void 0===x?void 0:x.indexOf("/"+(null===(M=window)||void 0===M?void 0:M.contextPath)))?r.createElement("a",{"data-tip":"React-tooltip","data-for":"jk-side-"+R,className:"custom-link",href:k+h.navigationURL},r.createElement("span",null," ",P," "),(null==P?void 0:P.includes("..."))&&r.createElement(c,{textColor:"white",backgroundColor:"grey",place:"right",type:"info",effect:"solid",id:"jk-side-"+R},N("ACTION_TEST_"+R))):r.createElement(l.Link,{className:"custom-link",to:h.navigationURL},r.createElement("div",{"data-tip":"React-tooltip","data-for":"jk-side-"+R},r.createElement("span",null," ",P," "),(null==P?void 0:P.includes("..."))&&r.createElement(c,{textColor:"white",backgroundColor:"grey",place:"right",type:"info",effect:"solid",id:"jk-side-"+R},N("ACTION_TEST_"+R)))))))}return r.createElement(r.Fragment,null,r.createElement("div",{className:"submenu-container"},r.createElement("div",{onClick:h.links&&function(){return b(!O)},className:"sidebar-link "+(null!=h&&null!==(L=h.links)&&void 0!==L&&L.some(function(e){return"url"===(null==e?void 0:e.url)&&(null==S?void 0:S.includes(null==e?void 0:e.navigationURL))})?"active":"")},r.createElement("div",{className:"actions"},I,r.createElement("div",{"data-tip":"React-tooltip","data-for":"jk-side-"+R},r.createElement("span",null," ",P," "),(null==P?void 0:P.includes("..."))&&r.createElement(c,{textColor:"white",backgroundColor:"grey",place:"right",type:"info",effect:"solid",id:"jk-side-"+R},N("ACTION_TEST_"+R)))),r.createElement("div",null," ",h.links&&O?r.createElement(t.ArrowVectorDown,null):h.links?r.createElement(t.ArrowForward,null):null," "))),O&&h.links.sort(function(e,t){return e.orderNumber-t.orderNumber}).filter(function(e){return"url"===e.url||""!==e.url}).map(function(e,t){var n,i,o,a=null==e||null===(n=e.displayName)||void 0===n||null===(i=n.toUpperCase())||void 0===i?void 0:i.replace(/[ -]/g,"_"),u=N("ACTION_TEST_"+a),s=N((null==u?void 0:u.length)>20?u.substring(0,20)+"...":u);if(-1===e.navigationURL.indexOf("/"+(null===(o=window)||void 0===o?void 0:o.contextPath))){var d=window.location.origin;return r.createElement("a",{key:t,className:"dropdown-link "+(S===e.link?"active":""),href:d+"/employee/"+e.navigationURL},r.createElement("div",{className:"actions","data-tip":"React-tooltip","data-for":"jk-side-"+t},r.createElement("span",null," ",s," "),(null==s?void 0:s.includes("..."))&&r.createElement(c,{textColor:"white",backgroundColor:"grey",place:"right",type:"info",effect:"solid",id:"jk-side-"+t},N("ACTION_TEST_"+a))))}return r.createElement(l.Link,{to:(null==e?void 0:e.link)||e.navigationURL,key:t,className:"dropdown-link "+(S===(null==e?void 0:e.link)||S===(null==e?void 0:e.navigationURL)?"active":"")},r.createElement("div",{className:"actions","data-tip":"React-tooltip","data-for":"jk-side-"+t},r.createElement("span",null," ",s," "),(null==s?void 0:s.includes("..."))&&r.createElement(c,{textColor:"white",backgroundColor:"grey",place:"right",type:"info",effect:"solid",id:"jk-side-"+t},N("ACTION_TEST_"+a))))}))},H=function(e,t){return void 0===e&&(e=""),void 0===t&&(t=""),e.toLowerCase().includes(t.toLowerCase())},z=function(){var e=n.useRef(null),o=Digit.Hooks.useAccessControl(),a=o.isLoading,l=o.data,c=n.useState(""),u=c[0],s=c[1],d=i.useTranslation().t;n.useEffect(function(){if(a)return r.createElement(t.Loader,null);e.current.style.cursor="pointer",m()},[a]);var m=function(){e.current.style.width="55px",e.current.style.overflow="hidden",e.current.querySelectorAll(".dropdown-link").forEach(function(e){e.style.display="none"}),e.current.querySelectorAll(".actions").forEach(function(e){e.style.padding="0"})},f={};null==l||l.actions.filter(function(e){return"url"===e.url}).forEach(function(e){var t,n,r,i,o=(null==e||null===(t=e.path)||void 0===t||null===(n=t.split("."))||void 0===n?void 0:n[0])||"";(""==u&&""!==e.path||H(d("ACTION_TEST_"+(null===(r=o)||void 0===r||null===(i=r.toUpperCase())||void 0===i?void 0:i.replace(/[ -]/g,"_"))),u)||H(d(Digit.Utils.locale.getTransformedLocale("ACTION_TEST_"+(null==e?void 0:e.displayName))),u))&&(o=e.path.split(".")[0],f[o]?f[o].push(e):f[o]=[e])});var v=[];return a?r.createElement(t.Loader,null):v?r.createElement("div",{className:"sidebar",ref:e,onMouseOver:function(){e.current.style.width="260px",e.current.style.overflow="auto",e.current.querySelectorAll(".dropdown-link").forEach(function(e){e.style.display="flex"})},onMouseLeave:m},r.createElement("div",{className:"submenu-container"},r.createElement("div",{className:"sidebar-link"},r.createElement("div",{className:"actions search-icon-wrapper"},r.createElement(t.SearchIcon,{className:"search-icon"}),r.createElement("input",{className:"employee-search-input",type:"text",placeholder:d("ACTION_TEST_SEARCH"),name:"search",value:u,onChange:function(e){return s(e.target.value)}})))),function(){var e,t=Object.keys(f);t.sort(function(e,t){return e.orderNumber-t.orderNumber});for(var n=0;n<t.length;n++)if(-1===f[t[n]][0].path.indexOf("."))if("Home"===f[t[n]][0].displayName){var i,o="/"+(null===(i=window)||void 0===i?void 0:i.contextPath)+"/employee";v.unshift({moduleName:t[n].toUpperCase(),icon:f[t[n]][0],navigationURL:o,type:"single"})}else{var a;v.push({moduleName:null===(a=f[t[n]][0])||void 0===a?void 0:a.displayName.toUpperCase(),type:"single",icon:f[t[n]][0],navigationURL:f[t[n]][0].navigationURL})}else v.push({moduleName:t[n].toUpperCase(),links:f[t[n]],icon:f[t[n]][0],orderNumber:f[t[n]][0].orderNumber});if(v.find(function(e){return"HOME"===e.moduleName})){var l,c,u=null===(l=v)||void 0===l?void 0:l.filter(function(e){return"HOME"===(null==e?void 0:e.moduleName)}),s=null===(c=v)||void 0===c?void 0:c.filter(function(e){return"HOME"!==(null==e?void 0:e.moduleName)});v=s.sort(function(e,t){return e.moduleName.localeCompare(t.moduleName)}),(null==u?void 0:u[0])&&v.unshift(u[0])}else v.sort(function(e,t){return e.moduleName.localeCompare(t.moduleName)});return null===(e=v)||void 0===e?void 0:e.map(function(e,t){return r.createElement(V,{item:e,key:t+1})})}()):""},G=function(e){var t=e.isSidebarOpen,n=e.toggleSidebar,i=e.handleLogout,o=e.mobileView,a=e.userDetails,l=e.modules;return e.CITIZEN?r.createElement(j,{isOpen:t,isMobile:!0,toggleSidebar:n,onLogout:i,linkData:e.linkData,islinkDataLoading:e.islinkDataLoading}):!o&&null!=a&&a.access_token?r.createElement(z,{mobileView:o,userDetails:a,modules:l}):r.createElement(j,{isOpen:t,isMobile:!0,toggleSidebar:n,onLogout:i,isEmployee:!0})},W=function(e){var i=e.t,o=e.stateInfo,a=e.userDetails,c=e.CITIZEN,u=e.cityDetails,s=e.mobileView,d=e.handleUserDropdownSelection,m=e.logoUrl,f=e.showSidebar,v=void 0===f||f,p=e.showLanguageChange,E=e.linkData,g=e.islinkDataLoading,y=n.useState(!1),h=y[0],C=y[1],O=l.useHistory(),b=n.useState(!1),S=b[0],N=b[1],w=function(){C(!1),N(!0)},I=function(){N(!1)},_=[{name:i("EDIT_PROFILE"),icon:r.createElement(t.EditPencilIcon,{className:"icon"}),func:function(){var e;O.push("/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/employee/user/profile")}},{name:i("CORE_COMMON_LOGOUT"),icon:r.createElement(t.LogoutIcon,{className:"icon"}),func:w}];return r.createElement(r.Fragment,null,r.createElement(D,{t:i,stateInfo:o,toggleSidebar:C,isSidebarOpen:h,handleLogout:w,userDetails:a,CITIZEN:c,cityDetails:u,mobileView:s,userOptions:_,handleUserDropdownSelection:d,logoUrl:m,showLanguageChange:p}),S&&r.createElement(x,{onSelect:function(){Digit.UserService.logout(),N(!1)},onCancel:I,onDismiss:I}),v&&r.createElement(G,{t:i,CITIZEN:c,isSidebarOpen:h,toggleSidebar:C,handleLogout:w,mobileView:s,userDetails:a,linkData:E,islinkDataLoading:g}))},q=function(e){var o=e.question,a=e.answer,l=e.lastIndex,c=n.useState(!1),u=c[0],s=c[1],d=i.useTranslation().t;return r.createElement("div",{className:"faqs border-none",onClick:function(){return s(!u)}},r.createElement("div",{className:"faq-question",style:{justifyContent:"space-between",display:"flex"}},r.createElement("span",null,d(o)),r.createElement("span",{className:u?"faqicon rotate":"faqicon",style:{float:"right"}},r.createElement(t.ArrowForward,null))),r.createElement("div",{className:"faq-answer",style:u?{display:"block"}:{display:"none"}},r.createElement("span",null,d(a))),l?null:r.createElement("div",{className:"cs-box-border"}))},X=function(e){var o,a,l,c=e.module,u=Digit.UserService.getUser(),s=((null==u||null===(o=u.info)||void 0===o?void 0:o.tenantId)||Digit.ULBService.getCurrentTenantId(),i.useTranslation().t),d=Digit.Hooks.useGetFAQsJSON(Digit.ULBService.getStateId()),m=d.data,f=null==m||null===(a=m.MdmsRes["common-masters"])||void 0===a||null===(l=a.faqs[0])||void 0===l?void 0:l[""+c].faqs;return d.isLoading?r.createElement(t.Loader,null):r.createElement(n.Fragment,null,r.createElement("div",{className:"faq-page"},r.createElement(t.BackButton,{style:{marginLeft:"unset"}}),r.createElement("div",{style:{marginBottom:"15px"}},r.createElement(t.Header,{styles:{marginLeft:"0px",paddingTop:"10px",fontSize:"32px"}},s("FAQ_S"))),r.createElement("div",{className:"faq-list"},f.map(function(e,t){return r.createElement(q,{key:"faq_"+t,question:e.question,answer:e.answer,lastIndex:t===(null==f?void 0:f.length)-1})}))))},Z=function(){var e,n,o,a,c,u,s,m,f,v,p,E,g,y,h,C,O,b,S,N,w,I,_,D,T=i.useTranslation().t,L=l.useHistory(),R=Digit.ULBService.getCitizenCurrentTenant(!0),A=Digit.Hooks.useStore.getInitData(),P=A.data,x=(void 0===P?{}:P).uiHomePage,M=A.isLoading,k=window.Digit.Utils.browser.isMobile(),U=function(){var e,t,n,r,i;return"EMPLOYEE"!==(null===(e=Digit.UserService)||void 0===e||null===(t=e.getUser())||void 0===t||null===(n=t.info)||void 0===n?void 0:n.type)&&!(null===(r=Digit.UserService)||void 0===r||null===(i=r.getUser())||void 0===i||!i.access_token)},B=Digit.Hooks.useEvents({tenantId:R,variant:"whats-new",config:{enabled:U()}}),F=B.data,j=B.isLoading;R||L.push("/"+(null===(D=window)||void 0===D?void 0:D.contextPath)+"/citizen/select-language");var V,H,z=null==x?void 0:x.appBannerDesktop,G=null==x?void 0:x.appBannerMobile,W=null==x?void 0:x.citizenServicesCard,q=null==x?void 0:x.informationAndUpdatesCard,X=null==x?void 0:x.whatsAppBannerDesktop,Z=null==x?void 0:x.whatsAppBannerMobile,Y=null==x?void 0:x.whatsNewSection,K=null==x?void 0:x.redirectURL;K&&L.push("/"+(null===(V=window)||void 0===V?void 0:V.contextPath)+"/citizen/"+K),null!==(e=window)&&void 0!==e&&null!==(n=e.location)&&void 0!==n&&null!==(o=n.href)&&void 0!==o&&null!==(a=o.includes)&&void 0!==a&&a.call(o,"sanitation-ui")&&L.push("/"+(null===(H=window)||void 0===H?void 0:H.contextPath)+"/citizen/all-services");var $=function(e){window.open(null==e?void 0:e.navigationUrl)},J={header:T(null==W?void 0:W.headerLabel),sideOption:{name:T(null==W||null===(c=W.sideOption)||void 0===c?void 0:c.name),onClick:function(){var e;return L.push(null==W||null===(e=W.sideOption)||void 0===e?void 0:e.navigationUrl)}},options:[{name:T(null==W||null===(u=W.props)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.label),Icon:r.createElement(t.ComplaintIcon,null),onClick:function(){var e,t;return L.push(null==W||null===(e=W.props)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.navigationUrl)}},{name:T(null==W||null===(m=W.props)||void 0===m||null===(f=m[1])||void 0===f?void 0:f.label),Icon:r.createElement(t.PTIcon,{className:"fill-path-primary-main"}),onClick:function(){var e,t;return L.push(null==W||null===(e=W.props)||void 0===e||null===(t=e[1])||void 0===t?void 0:t.navigationUrl)}},{name:T(null==W||null===(v=W.props)||void 0===v||null===(p=v[2])||void 0===p?void 0:p.label),Icon:r.createElement(t.CaseIcon,{className:"fill-path-primary-main"}),onClick:function(){var e,t;return L.push(null==W||null===(e=W.props)||void 0===e||null===(t=e[2])||void 0===t?void 0:t.navigationUrl)}},{name:T(null==W||null===(E=W.props)||void 0===E||null===(g=E[3])||void 0===g?void 0:g.label),Icon:r.createElement(t.OBPSIcon,null),onClick:function(){var e,t;return L.push(null==W||null===(e=W.props)||void 0===e||null===(t=e[3])||void 0===t?void 0:t.navigationUrl)}}],styles:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start",width:"100%"}},Q={header:T(null==q?void 0:q.headerLabel),sideOption:{name:T(null==q||null===(y=q.sideOption)||void 0===y?void 0:y.name),onClick:function(){var e;return L.push(null==q||null===(e=q.sideOption)||void 0===e?void 0:e.navigationUrl)}},options:[{name:T(null==q||null===(h=q.props)||void 0===h||null===(C=h[0])||void 0===C?void 0:C.label),Icon:r.createElement(t.HomeIcon,null),onClick:function(){var e,t;return L.push(null==q||null===(e=q.props)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.navigationUrl)}},{name:T(null==q||null===(O=q.props)||void 0===O||null===(b=O[1])||void 0===b?void 0:b.label),Icon:r.createElement(t.Calender,null),onClick:function(){var e,t;return L.push(null==q||null===(e=q.props)||void 0===e||null===(t=e[1])||void 0===t?void 0:t.navigationUrl)}},{name:T(null==q||null===(S=q.props)||void 0===S||null===(N=S[2])||void 0===N?void 0:N.label),Icon:r.createElement(t.DocumentIcon,null),onClick:function(){var e,t;return L.push(null==q||null===(e=q.props)||void 0===e||null===(t=e[2])||void 0===t?void 0:t.navigationUrl)}},{name:T(null==q||null===(w=q.props)||void 0===w||null===(I=w[3])||void 0===I?void 0:I.label),Icon:r.createElement(t.DocumentIcon,null),onClick:function(){var e,t;return L.push(null==q||null===(e=q.props)||void 0===e||null===(t=e[3])||void 0===t?void 0:t.navigationUrl)}}],styles:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start",width:"100%"}};return M?r.createElement(t.Loader,null):r.createElement("div",{className:"HomePageContainer"},r.createElement("div",{className:"HomePageWrapper"},r.createElement("div",{className:"BannerWithSearch"},r.createElement("img",k?{src:null==G?void 0:G.bannerUrl}:{src:null==z?void 0:z.bannerUrl}),r.createElement("div",{className:"ServicesSection"},r.createElement(t.CardBasedOptions,d({style:{marginTop:"-30px"}},J)),r.createElement(t.CardBasedOptions,d({style:k?{}:{marginTop:"-30px"}},Q)))),(Z||X)&&r.createElement("div",{className:"WhatsAppBanner"},r.createElement("img",k?{src:null==Z?void 0:Z.bannerUrl,onClick:function(){return $(Z)}}:{src:null==X?void 0:X.bannerUrl,onClick:function(){return $(X)}})),U()?j?r.createElement(t.Loader,null):r.createElement("div",{className:"WhatsNewSection"},r.createElement("div",{className:"headSection"},r.createElement("h2",null,T(null==Y?void 0:Y.headerLabel)),r.createElement("p",{onClick:function(){var e;return L.push(null==Y||null===(e=Y.sideOption)||void 0===e?void 0:e.navigationUrl)}},T(null==Y||null===(_=Y.sideOption)||void 0===_?void 0:_.name))),r.createElement(t.WhatsNewCard,null==F?void 0:F[0])):null))},Y=function(){var e=i.useTranslation().t,o=l.useHistory(),a=Digit.Hooks.useStore.getInitData(),c=a.data,u=void 0===c?{}:c,s=u.languages,d=u.stateInfo,m=a.isLoading,f=Digit.StoreData.getCurrentLanguage(),v=n.useMemo(function(){return{header:e("CS_COMMON_CHOOSE_LANGUAGE"),submitBarLabel:e("CORE_COMMON_CONTINUE")}},[e]),p=n.useMemo(function(){return{options:s,optionsKey:"label",additionalWrapperClass:"reverse-radio-selection-wrapper",onSelect:function(e){return Digit.LocalizationService.changeLanguage(e.value,d.code)},selectedOption:null==s?void 0:s.filter(function(e){return e.value===f})[0]}},[f,s]);return m?r.createElement(t.Loader,null):r.createElement("div",{className:"selection-card-wrapper"},r.createElement(t.PageBasedInput,{texts:v,onSubmit:function(){var e;o.push("/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/citizen/select-location")}},r.createElement(t.CardHeader,null,e("CS_COMMON_CHOOSE_LANGUAGE")),r.createElement(t.RadioButtons,p)))},K=function(){var e=i.useTranslation().t,o=l.useHistory(),a=l.useLocation(),c=Digit.Hooks.useTenants(),u=c.data,s=c.isLoading,m=n.useState(function(){return{code:Digit.ULBService.getCitizenCurrentTenant(!0)}}),f=m[0],v=m[1],p=n.useState(!1),E=p[0],g=p[1],y=n.useMemo(function(){return{header:e("CS_COMMON_CHOOSE_LOCATION"),submitBarLabel:e("CORE_COMMON_CONTINUE")}},[e]);function h(e){v(e),g(!1)}var C=n.useMemo(function(){return{options:u,optionsKey:"i18nKey",additionalWrapperClass:"reverse-radio-selection-wrapper",onSelect:h,selectedOption:f}},[u,e,f]);return s?r.createElement("loader",null):r.createElement("div",{className:"selection-card-wrapper"},r.createElement(t.BackButton,null),r.createElement(t.PageBasedInput,{texts:y,onSubmit:function(){if(f){var e,t;Digit.SessionStorage.set("CITIZEN.COMMON.HOME.CITY",f);var n=null===(e=a.state)||void 0===e?void 0:e.redirectBackTo;n?o.replace(n):o.push("/"+(null===(t=window)||void 0===t?void 0:t.contextPath)+"/citizen")}else g(!0)},className:"location-selection-container"},r.createElement(t.CardHeader,null,e("CS_COMMON_CHOOSE_LOCATION")),r.createElement(t.SearchOnRadioButtons,d({},C,{placeholder:e("COMMON_TABLE_SEARCH")})),E?r.createElement(t.CardLabelError,null,e("CS_COMMON_LOCATION_SELECTION_ERROR")):null))},$=function(){function e(){}return e.prototype.then=function(t,n){var r=new e,i=this.s;if(i){var o=1&i?t:n;if(o){try{J(r,1,o(this.v))}catch(e){J(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?J(r,1,t?t(i):i):n?J(r,1,n(i)):J(r,2,i)}catch(e){J(r,2,e)}},r},e}();function J(e,t,n){if(!e.s){if(n instanceof $){if(!n.s)return void(n.o=J.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(J.bind(null,e,t),J.bind(null,e,2));e.s=t,e.v=n;var r=e.o;r&&r(e)}}function Q(e){return e instanceof $&&1&e.s}var ee="undefined"!=typeof Symbol?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function te(e,t,n){if("function"==typeof e[ee]){var r,i,o,a=e[ee]();if(function e(l){try{for(;!((r=a.next()).done||n&&n());)if((l=t(r.value))&&l.then){if(!Q(l))return void l.then(e,o||(o=J.bind(null,i=new $,2)));l=l.v}i?J(i,1,l):i=l}catch(e){J(i||(i=new $),2,e)}}(),a.return){var l=function(e){try{r.done||a.return()}catch(e){}return e};if(i&&i.then)return i.then(l,function(e){throw l(e)});l()}return i}if(!("length"in e))throw new TypeError("Object is not iterable");for(var c=[],u=0;u<e.length;u++)c.push(e[u]);return function(e,t,n){var r,i,o=-1;return function a(l){try{for(;++o<e.length&&(!n||!n());)if((l=t(o))&&l.then){if(!Q(l))return void l.then(a,i||(i=J.bind(null,r=new $,2)));l=l.v}r?J(r,1,l):r=l}catch(e){J(r||(r=new $),2,e)}}(),r}(c,function(e){return t(c[e])},n)}function ne(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function re(e){var o=e.setProfilePic,a=e.closeDrawer,l=e.userType,c=e.removeProfilePic,u=e.showToast,s=n.useState(null)[1],d=n.useState(""),m=d[0],f=d[1],v=n.useState(null)[1],p=i.useTranslation().t;return n.useEffect(function(){!function(){try{v(null);var e=function(){if(m){var e=function(){if(m.size>=1e6)u("error",p("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED")),v(p("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{var e=ne(function(){return Promise.resolve(Digit.UploadServices.Filestorage(l+"-profile",m,Digit.ULBService.getStateId())).then(function(e){var t,n;if((null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0){var r,i,a=null==e||null===(r=e.data)||void 0===r||null===(i=r.files[0])||void 0===i?void 0:i.fileStoreId;s(a),o(a)}else u("error",p("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR")),v(p("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR"))})},function(){u("error",p("CORE_COMMON_PROFILE_INVALID_FILE_INPUT"))});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)}}()},[m]),r.createElement(r.Fragment,null,r.createElement("div",{style:{position:"fixed",top:"0",left:"0",right:"0",bottom:"0",width:"100%",height:"100vh",backgroundColor:"rgba(0,0,0,.5)"},onClick:function(){return a()}}),r.createElement("div",{style:{width:"100%",justifyContent:"space-between",display:"flex",backgroundColor:"white",alignItems:"center",position:"fixed",left:"0",right:"0",height:"20%",bottom:"citizen"===l?"2.5rem":"0",zIndex:"2"}},r.createElement("div",{style:{display:"flex",flex:"1",flexDirection:"column",width:"100%",justifyContent:"center",alignItems:"center",gap:"8px 0"}},r.createElement("label",{for:"file",style:{cursor:"pointer"}}," ",r.createElement(t.GalleryIcon,null)),r.createElement("label",{style:{cursor:"pointer"}}," Gallery"),r.createElement("input",{type:"file",id:"file",accept:"image/*, .png, .jpeg, .jpg",onChange:function(e){return f(e.target.files[0])},style:{display:"none"}})),r.createElement("div",{style:{display:"flex",flex:"1",width:"100%",justifyContent:"center",alignItems:"center",flexDirection:"column",gap:"8px 0"}},r.createElement("button",{onClick:function(){c(),a()}},r.createElement(t.RemoveIcon,null)),r.createElement("label",{style:{cursor:"pointer"}},"Remove"))))}"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));var ie,oe=function(e){var o,a,c,u,s,m,f,v,p,E,g,y,h=e.stateCode,C=e.userType,O=e.cityDetails,b=(l.useHistory(),i.useTranslation().t),S=window.location.href,N=Digit.ULBService.getStateId(),w=Digit.ULBService.getCurrentTenantId(),I=(null===(o=Digit.UserService.getUser())||void 0===o?void 0:o.info)||{},_=n.useState(null),D=_[0],T=_[1],L=n.useState(null!=I&&I.name?I.name:""),R=L[0],A=L[1],P=n.useState(null!=I&&I.emailId?I.emailId:""),x=P[0],M=P[1],k=n.useState(null==D?void 0:D.gender),U=k[0],B=k[1],F=n.useState(null!=I&&I.permanentCity?I.permanentCity:O.name),j=F[0],V=F[1],H=n.useState(null!=I&&I.mobileNumber?I.mobileNumber:""),z=H[0],G=H[1],W=n.useState(null),q=W[0],X=W[1],Z=n.useState(""),Y=Z[0],K=Z[1],$=n.useState(!1),J=$[0],Q=$[1],ee=n.useState(!1),te=ee[0],ie=ee[1],oe=n.useState(""),ae=oe[0],le=oe[1],ce=n.useState(""),ue=ce[0],se=ce[1],de=n.useState(""),me=de[0],fe=de[1],ve=n.useState(null),pe=ve[0],Ee=ve[1],ge=n.useState(!1),ye=ge[0],he=ge[1],Ce=r.useState(window.innerWidth),Oe=Ce[0],be=Ce[1],Se=r.useState({}),Ne=Se[0],we=Se[1],Ie=window.Digit.Utils.browser.isMobile();r.useEffect(function(){return window.addEventListener("resize",function(){return be(window.innerWidth)}),function(){window.removeEventListener("resize",function(){return be(window.innerWidth)})}}),n.useEffect(function(){var e;he(!0),function(){try{var e=null==I?void 0:I.uuid,t=function(){if(e)return Promise.resolve(Digit.UserService.userSearch(w,{uuid:[e]},{})).then(function(e){e&&e.user&&e.user.length&&T(e.user[0])})}();Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(),B({i18nKey:void 0,code:null==D?void 0:D.gender,value:null==D?void 0:D.gender});var t=null==D||null===(e=D.photo)||void 0===e?void 0:e.split(",");K(null==t?void 0:t.at(0)),he(!1)},[null!==D]);var _e=function(e){return B(e)},De=function(){return Q(!1)},Te=function(e){A(e),!new RegExp(/^[a-zA-Z ]+$/i).test(e)||0===e.length||e.length>50?we(d({},Ne,{userName:{type:"pattern",message:"CORE_COMMON_PROFILE_NAME_INVALID"}})):we(d({},Ne,{userName:null}))},Le=function(e){M(e),!e.length||e.includes("@")&&e.includes(".")?we(d({},Ne,{emailAddress:null})):we(d({},Ne,{emailAddress:{type:"pattern",message:"CORE_COMMON_PROFILE_EMAIL_INVALID"}}))},Re=function(e,t,n){void 0===n&&(n=5e3),Ee({key:e,action:t}),setTimeout(function(){Ee(null)},n)},Ae=function(){try{var e=function(e){if(t)return e;he(!1)},t=!1;he(!0);var n=ne(function(){var e=d({},I,{name:R,gender:null==U?void 0:U.value,emailId:x,photo:q});if(!new RegExp(/^([a-zA-Z ])*$/).test(R)||""===R||R.length>50||R.length<1)throw JSON.stringify({type:"error",message:"CORE_COMMON_PROFILE_NAME_INVALID"});if("employee"===C&&!new RegExp(/^[6-9]{1}[0-9]{9}$/).test(z))throw JSON.stringify({type:"error",message:"CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID"});if(x.length&&(!x.includes("@")||!x.includes(".")))throw JSON.stringify({type:"error",message:"CORE_COMMON_PROFILE_EMAIL_INVALID"});if(ae.length||ue.length||me.length){if(ue!==me)throw JSON.stringify({type:"error",message:"CORE_COMMON_PROFILE_PASSWORD_MISMATCH"});if(!(ae.length&&ue.length&&me.length))throw JSON.stringify({type:"error",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"});if(!new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(ue)&&!new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(me))throw JSON.stringify({type:"error",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"})}return Promise.resolve(Digit.UserService.updateUser(e,h)).then(function(e){var t=e.responseInfo;if(t&&"200"===t.status){var n=Digit.UserService.getUser();n&&Digit.UserService.setUser(d({},n,{info:d({},n.info,{name:R,mobileNumber:z,emailId:x,permanentCity:j})}))}return function(){if(ae.length&&ue.length&&me.length){var e={existingPassword:ae,newPassword:ue,tenantId:w,type:"EMPLOYEE",username:null==I?void 0:I.userName,confirmPassword:me};return function(){if(ue===me)return ne(function(){return Promise.resolve(Digit.UserService.changePassword(e,w)).then(function(e){var t=e.responseInfo;if(null==t||!t.status||"200"!==t.status)throw"";Re("success",b("CORE_COMMON_PROFILE_UPDATE_SUCCESS_WITH_PASSWORD"),5e3)})},function(e){var t,n;throw JSON.stringify({type:"error",message:null!==(t=e.Errors)&&void 0!==t&&null!==(n=t.at(0))&&void 0!==n&&n.description?e.Errors.at(0).description:"CORE_COMMON_PROFILE_UPDATE_ERROR_WITH_PASSWORD"})});throw JSON.stringify({type:"error",message:"CORE_COMMON_PROFILE_ERROR_PASSWORD_NOT_MATCH"})}()}null!=t&&t.status&&"200"===t.status&&Re("success",b("CORE_COMMON_PROFILE_UPDATE_SUCCESS"),5e3)}()})},function(e){var t=JSON.parse(e);Re(t.type,b(t.message),5e3)});return Promise.resolve(n&&n.then?n.then(e):e(n))}catch(e){return Promise.reject(e)}},Pe=[],xe=Digit.Hooks.useGenderMDMS(N,"common-masters","GenderType").data;return xe&&xe.map(function(e){Pe.push({i18nKey:"PT_COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})}),ye?r.createElement(t.Loader,null):r.createElement("div",{className:"user-profile"},r.createElement("section",{style:{margin:"citizen"===C?"8px":"24px"}},"citizen"===C?r.createElement(t.BackButton,null):r.createElement(t.BreadCrumb,{crumbs:[{path:"/"+(null===(a=window)||void 0===a?void 0:a.contextPath)+"/employee",content:b("ES_COMMON_HOME"),show:!0},{path:"/"+(null===(c=window)||void 0===c?void 0:c.contextPath)+"/employee/user/profile",content:b("ES_COMMON_PAGE_1"),show:S.includes("/user/profile")}]})),r.createElement("div",{style:{display:"flex",flex:1,flexDirection:Oe<768||"citizen"===C?"column":"row",margin:"citizen"===C?"8px":"16px",gap:"citizen"===C?"":"0 24px",boxShadow:"citizen"===C?"1px 1px 4px 0px rgba(0,0,0,0.2)":"",background:"citizen"===C?"white":"",borderRadius:"citizen"===C?"4px":"",maxWidth:"citizen"===C?"960px":""}},r.createElement("section",{style:{position:"relative",display:"flex",flex:"citizen"===C?1:2.5,justifyContent:"center",alignItems:"center",maxWidth:"100%",height:"376px",borderRadius:"4px",boxShadow:"citizen"===C?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",border:("citizen"===C?"8px":"24px")+" solid #fff",background:"#EEEEEE",padding:"citizen"===C?"8px":"16px"}},r.createElement("div",{style:{position:"relative",height:"citizen"===C?"114px":"150px",width:"citizen"===C?"114px":"150px",margin:"16px"}},r.createElement("img",{style:{margin:"auto",borderRadius:"300px",justifyContent:"center",height:"100%",width:"100%"},src:Y&&""!==Y?Y:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAO4AAADUCAMAAACs0e/bAAAAM1BMVEXK0eL////Dy97GzuD4+fvL0uPg5O7T2efb4OvR1+Xr7vTk5/Df4+37/P3v8fbO1eTt8PUsnq5FAAAGqElEQVR4nO2d25ajIBBFCajgvf//a0eMyZgEjcI5xgt7Hmatme507UaxuJXidiDqjmSgeVIMlB1ZR1WZAf2gbdu0QwixSYzjOJPmHurfEGEfY9XzjNGG9whQCeVAuv5xQEySLtR9hPuIcwj0EeroN5m3D1IbsbgHK0esiQ9MKsqXVr8Hm/a/Pulk6wihpCIXBw3dh7bTvRBt9+dC5NfS1VH3xETdM3MxXRN1T0zUPTNR98xcS1dlV9NNfx3DhkTdM6PKqHteVBF1z0vU5f0sKdpc2zWLKutXrjJjdLvpesRmukqYonauPhXpdsLb6CppmpnltsYIuY2yavi6Mi2/rzAWm1zUfF0limVLqkZyA+mDYevKBS37aGC+L1lX5e7uyU1Cv565uiua9k5LFqbqqrnu2I3m+jJ11ZoLeRtfmdB0Uw/ZDsP0VTxdn7a1VERfmq7XlXyn5D2QWLoq8bZlPoBJumphJjVBw/Ll6CoTZGsTDs4NrGqKbqBth8ZHJUi6cn168QmleSm6GmB7Kxm+6obXlf7PoDHosCwM3QpiS2legi6ocSl3L0G3BdneDDgwQdENfeY+SfDJBkF37ZB+GvwzA6/rMaafAn8143VhPZWdjMWG1oHXhdnemgPoAvLlB/iZyRTfVeF06wPoQhJmlm4bdcOAZRlRN5gcPc5SoPEQR1fDdbOo6wn+uYvXxY0QCLom6gYROKH+Aj5nvphuFXWDiLpRdxl/19LFT95k6CHCrnW7pCDqBn1i1PUFvii2c11oZOJ6usWeH0RRNzC4Zs+6FTi2nevCVwCjbugnXklX5fkfTldL8PEilUB1kfNyN1u9MME2sATr4lbuB7AjfLAuvsRm1A0g6gYRdcPAjvBlje2Z8brI8OC68AcRdlCkwLohx2mcZMjw9q+LzarQurjtnwPYAydX08WecECO/u6Ad0GBdYG7jO5gB4Ap+PwKcA9ZT43dn4/W9TyiPAn4OAJaF7h3uwe8StSCddFdM3jqFa2LvnnB5zzhuuBBAjY4gi50cg694gnXhTYvfMdrjtcFZhrwE9r41gUem8IXWMC3LrBzxh+a0gRd1N1LOK7M0IUUGuggvEmHoStA2/MJh7MpupiDU4TzjhxdzLAoO4ouZvqVURbFMHQlZD6SUeWHoguZsSLUGegrehA+FZFowPdUWTi6iMoZlIpGGUUXkDbjj/9ZOLqAQS/+GIKl5BQOCn/ycqpzkXSDm5dU7ZWkG7wUyGlcmm7g5Ux56AqirgoaJ7BeokPTDbp9CbVunjFxPrl7+HqnkrSq1Da7JX20f3dV8yJi6voO81mX8vV0mx3qUsZCPRfTlVRdz2EvdufYGDvNQvvwqHtmXd+a1ITinwNcXc+lT6JuzdT1XDyBn/x7wtX1HCQQdW9MXc8xArGrirowfLeUEbMqqq6f7TF1lfRdOuGNiGi6SpT+WxY06xUfNN2wBfyE9I4tlm7w5hvOPDNJN3yNiLMipji6gE3chKhouoCtN5x3QlF0EZt8OW/8ougitqJQlk1aii7iFC9l0MvRReyao7xNjKML2Z/PuHlzhi5mFxljiZeiC9rPTEisNEMX9KYAwo5Xhi7qaA3hamboYm7dG+NVrXhdaYDv5zFaQZsYrCtbbAGnjkQDX2+J1FXCwOsqWOpKoIQNTFdqYBWydxqNqUoG0pVpCS+H8kaJaGKErlIaXj7CRRE+gRWuKwW9YZ80oVOUgbpdT0zpnSZJTIiwCtJVelvXntr4P5j6BWfPb5Wcx84C4cq3hb11lco2u2Mdwp6XdJ/Ne3wb8DWdfiRenZaXrhLwOj4e+GQeHroy3YOspS7TlU28Wle2m2QUS0mqdcbrdNW+ZHsSsyK7tBfm0q/dWcv+Z3mytVx3t7KWulqUe6ilunu8jF8pFwgv1FXp3mUt35OtRbr7eM4u4Gs6vUBXgeuHc5kfE/cbvWZtkROLm1DMtLCy80tzsu2PRj0hTI8fvrQuvsjlJkyutszq+m423wHaLTyniy/XuiGZ84LuT+m5ZfNfRxyGs7LXZOvia7VujatUwVTrIt+Q/Csc7Tuhe+BOakT10b4TuoiiJjvgU9emTO42PwEfBa+cuodKkuf42DXr1D3JpXz73Hnn0j10evHKe+nufgfUm+7B84sX9FfdEzXux2DBpWuKokkCqN/5pa/8pmvnL+RGKCddCGmatiPyPB/+ekO/M/q/7uvbt22kTt3zEnXPzCV13T3Gel4/6NduDu66xRvlPNkM1RjjxUdv+4WhGx6TftD19Q/dfzpwcHO+rE3fAAAAAElFTkSuQmCC"}),r.createElement("button",{style:{position:"absolute",left:"50%",bottom:"-24px",transform:"translateX(-50%)"},onClick:function(){return Q(!J)}},r.createElement(t.CameraIcon,null)))),r.createElement("section",{style:{display:"flex",flexDirection:"column",flex:"citizen"===C?1:7.5,width:"100%",borderRadius:"4px",height:"fit-content",boxShadow:"citizen"===C?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",background:"white",padding:"citizen"===C?"8px":"24px",paddingBottom:"20px"}},"citizen"===C?r.createElement(r.Fragment,null,r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{style:{}},""+b("CORE_COMMON_PROFILE_NAME"),"*"),r.createElement("div",{style:{width:"100%",maxWidth:"960px"}},r.createElement(t.TextInput,d({t:b,style:{width:"100%"},type:"text",isMandatory:!1,name:"name",value:R,onChange:function(e){return Te(e.target.value)}},{isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"tel",title:b("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")},{disable:!1})),(null==Ne?void 0:Ne.userName)&&r.createElement(t.CardLabelError,null," ",null==Ne||null===(u=Ne.userName)||void 0===u?void 0:u.message," "))),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{style:{}},""+b("CORE_COMMON_PROFILE_GENDER")),r.createElement(t.Dropdown,{style:{width:"100%"},className:"form-field",selected:1===(null==U?void 0:U.length)?U[0]:U,disable:1===(null==U?void 0:U.length)||!1,option:Pe,select:_e,value:U,optionKey:"code",t:b,name:"gender"})),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{style:{}},""+b("CORE_COMMON_PROFILE_EMAIL")),r.createElement("div",{style:{width:"100%"}},r.createElement(t.TextInput,{t:b,style:{width:"100%"},type:"email",isMandatory:!1,optionKey:"i18nKey",name:"email",value:x,onChange:function(e){return Le(e.target.value)},disable:!1}),(null==Ne?void 0:Ne.emailAddress)&&r.createElement(t.CardLabelError,null," ",null==Ne||null===(s=Ne.emailAddress)||void 0===s?void 0:s.message," "))),r.createElement("button",{onClick:Ae,style:{marginTop:"24px",backgroundColor:"#F47738",width:"100%",height:"40px",color:"white",maxWidth:Ie?"100%":"240px",borderBottom:"1px solid black"}},b("CORE_COMMON_SAVE"))):r.createElement(r.Fragment,null,r.createElement(t.LabelFieldPair,{style:{display:"flex"}},r.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_NAME"),"*"),r.createElement("div",{style:{width:"100%"}},r.createElement(t.TextInput,d({t:b,type:"text",isMandatory:!1,name:"name",value:R,onChange:function(e){return Te(e.target.value)},placeholder:"Enter Your Name"},{isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"text",title:b("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")},{disable:!1})),(null==Ne?void 0:Ne.userName)&&r.createElement(t.CardLabelError,{style:{margin:0,padding:0}}," ",null==Ne||null===(m=Ne.userName)||void 0===m?void 0:m.message," "))),r.createElement(t.LabelFieldPair,{style:{display:"flex"}},r.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_GENDER")),r.createElement(t.Dropdown,{style:{width:"100%"},selected:1===(null==U?void 0:U.length)?U[0]:U,disable:1===(null==U?void 0:U.length)||!1,option:Pe,select:_e,value:U,optionKey:"code",t:b,name:"gender"})),r.createElement(t.LabelFieldPair,{style:{display:"flex"}},r.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_CITY")),r.createElement("div",{style:{width:"100%"}},r.createElement(t.TextInput,d({t:b,type:"text",isMandatory:!1,name:"city",value:b(Digit.Utils.locale.getTransformedLocale("TENANT_TENANTS_"+w)),onChange:function(e){return V(e.target.value)},placeholder:"Enter Your City Name"},{isRequired:!0,type:"text",title:b("CORE_COMMON_PROFILE_CITY_ERROR_MESSAGE")},{disable:!0})),r.createElement(t.CardLabelError,null))),r.createElement(t.LabelFieldPair,{style:{display:"flex"}},r.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},b("CORE_COMMON_PROFILE_MOBILE_NUMBER")+"*"),r.createElement("div",{style:{width:"100%"}},r.createElement(t.MobileNumber,{value:z,style:{width:"100%"},name:"mobileNumber",placeholder:"Enter a valid Mobile No.",onChange:function(e){return function(e){G(e),"employee"!==C||new RegExp(/^[6-9]{1}[0-9]{9}$/).test(e)?we(d({},Ne,{mobileNumber:null})):we(d({},Ne,{mobileNumber:{type:"pattern",message:"CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID"}}))}(e)},disable:!0,required:!0,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:b("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")}),(null==Ne?void 0:Ne.mobileNumber)&&r.createElement(t.CardLabelError,{style:{margin:0,padding:0}}," ",null==Ne||null===(f=Ne.mobileNumber)||void 0===f?void 0:f.message," "))),r.createElement(t.LabelFieldPair,{style:{display:"flex"}},r.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_EMAIL")),r.createElement("div",{style:{width:"100%"}},r.createElement(t.TextInput,{t:b,type:"email",isMandatory:!1,placeholder:b("EMAIL_VALIDATION"),optionKey:"i18nKey",name:"email",value:x,onChange:function(e){return Le(e.target.value)},disable:!1}),(null==Ne?void 0:Ne.emailAddress)&&r.createElement(t.CardLabelError,null," ",null==Ne||null===(v=Ne.emailAddress)||void 0===v?void 0:v.message," "))),r.createElement(t.LabelFieldPair,null,r.createElement("div",null,r.createElement("a",{style:(p={color:"orange",cursor:"default",marginBottom:"5"},p.cursor="pointer",p),onClick:function(){return ie(!te)}},b("CORE_COMMON_CHANGE_PASSWORD")),te?r.createElement("div",{style:{marginTop:"10px"}},r.createElement(t.LabelFieldPair,{style:{display:"flex"}},r.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_CURRENT_PASSWORD")),r.createElement("div",{style:{width:"100%"}},r.createElement(t.TextInput,{t:b,type:"password",isMandatory:!1,name:"name",pattern:"^([a-zA-Z0-9@#$%])+$",onChange:function(e){return le(t=e.target.value),void(new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(t)?we(d({},Ne,{currentPassword:null})):we(d({},Ne,{currentPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}})));var t},disable:!1}),(null==Ne?void 0:Ne.currentPassword)&&r.createElement(t.CardLabelError,null,null==Ne||null===(E=Ne.currentPassword)||void 0===E?void 0:E.message))),r.createElement(t.LabelFieldPair,{style:{display:"flex"}},r.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_NEW_PASSWORD")),r.createElement("div",{style:{width:"100%"}},r.createElement(t.TextInput,{t:b,type:"password",isMandatory:!1,name:"name",pattern:"^([a-zA-Z0-9@#$%])+$",onChange:function(e){return se(t=e.target.value),void(new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(t)?we(d({},Ne,{newPassword:null})):we(d({},Ne,{newPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}})));var t},disable:!1}),(null==Ne?void 0:Ne.newPassword)&&r.createElement(t.CardLabelError,null,null==Ne||null===(g=Ne.newPassword)||void 0===g?void 0:g.message))),r.createElement(t.LabelFieldPair,{style:{display:"flex"}},r.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_CONFIRM_PASSWORD")),r.createElement("div",{style:{width:"100%"}},r.createElement(t.TextInput,{t:b,type:"password",isMandatory:!1,name:"name",pattern:"^([a-zA-Z0-9@#$%])+$",onChange:function(e){return fe(t=e.target.value),void(new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(t)?we(d({},Ne,{confirmPassword:null})):we(d({},Ne,{confirmPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}})));var t},disable:!1}),(null==Ne?void 0:Ne.confirmPassword)&&r.createElement(t.CardLabelError,null,null==Ne||null===(y=Ne.confirmPassword)||void 0===y?void 0:y.message)))):""))))),"employee"===C?r.createElement("div",{className:"action-bar-wrap"},r.createElement(t.SubmitBar,{t:b,label:"CORE_COMMON_SAVE",onSubmit:Ae})):"",pe&&r.createElement(t.Toast,{error:"error"===pe.key,label:b("success"===pe.key?"CORE_COMMON_PROFILE_UPDATE_SUCCESS":pe.action),onClose:function(){return Ee(null)},style:{maxWidth:"670px"}}),1==J?r.createElement(re,{setProfilePic:function(e){try{var t=function(e){K(null==e?void 0:e.thumbs[0]),De()};return X(e),Promise.resolve(e?Promise.resolve(function(e,t){try{return Promise.resolve(Digit.UploadServices.Filefetch(e,t)).then(function(e){return e.data.fileStoreIds&&0!==e.data.fileStoreIds.length?{thumbs:e.data.fileStoreIds.map(function(e){return e.url.split(",")[3]}),images:e.data.fileStoreIds.map(function(e){return Digit.Utils.getFileUrl(e.url)})}:null})}catch(e){return Promise.reject(e)}}([e],N)).then(t):t(null))}catch(e){return Promise.reject(e)}},closeDrawer:De,userType:C,removeProfilePic:function(){X(null),K(null)},showToast:Re}):"")},ae=function(e){var o,a,l,c=e.module,u=Digit.UserService.getUser(),s=((null==u||null===(o=u.info)||void 0===o?void 0:o.tenantId)||Digit.ULBService.getCurrentTenantId(),i.useTranslation().t),d=Digit.SessionStorage.get("initData").stateInfo,m=Digit.StoreData.getCurrentLanguage(),f=n.useState(m),v=f[0],p=f[1],E=n.useState(!1),g=E[0],y=E[1],h=n.useState(""),C=h[0],O=h[1],b=function(){return r.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.createElement("path",{d:"M12 24C5.38053 24 0 18.6143 0 12C0 5.38054 5.38053 1.90735e-06 12 1.90735e-06C18.6143 1.90735e-06 24 5.38054 24 12C24 18.6143 18.6143 24 12 24ZM16.3488 10.7852L11.3855 7.25251C11.1263 7.0701 10.8238 6.97889 10.5214 6.97889C10.291 6.97889 10.0557 7.03172 9.83976 7.14202C9.34054 7.40118 9.02857 7.91006 9.02857 8.46694L9.02877 15.5323C9.02877 16.0892 9.34076 16.5979 9.83996 16.8572C10.3344 17.1116 10.9296 17.0732 11.3857 16.7467L16.349 13.214C16.7426 12.9356 16.9778 12.4795 16.9778 11.9996C16.9776 11.5197 16.7426 11.0636 16.3489 10.7852L16.3488 10.7852Z",fill:"white"}))},S=Digit.Hooks.useGetHowItWorksJSON(Digit.ULBService.getStateId()),N=S.data,w=null==N||null===(a=N.MdmsRes["common-masters"])||void 0===a||null===(l=a.howItWorks[0])||void 0===l?void 0:l[""+c];return S.isLoading?r.createElement(t.Loader,null):r.createElement(n.Fragment,null,r.createElement("div",{className:"how-it-works-page"},r.createElement(t.BackButton,null),r.createElement("div",{className:"how-it-works-page-header"},r.createElement(t.Header,null,s("HOW_IT_WORKS"))),r.createElement("div",{className:"language-selector",style:{margin:"10px"}},[{label:"ENGLISH",value:"en_IN"},{label:"हिंदी",value:"hi_IN"}].map(function(e,n){return r.createElement("div",{className:"language-button-container",key:n},r.createElement(t.CustomButton,{selected:e.value===v,text:e.label,onClick:function(){return function(e){p(e.value),Digit.LocalizationService.changeLanguage(e.value,d.code)}(e)}}))})),w.videosJson.map(function(e,t){return r.createElement("div",null,r.createElement("div",{className:"WhatsNewCard",style:{float:"left",position:"relative",width:"100%",marginBottom:10}},r.createElement("div",{className:"video-icon",onClick:function(){return t=e,O("hi_IN"===v?t.hi_IN:t.en_IN),void y(!0);var t}},r.createElement("div",{className:"vid-svg"},r.createElement(b,null))),r.createElement("div",{className:"how-it-works-header-description"},r.createElement("h2",null,s(e.headerLabel)),r.createElement("p",null,s(e.description)))))}),r.createElement("div",{className:"WhatsNewCard",style:{position:"relative",width:"100%",marginBottom:10,display:"inline-block"}},r.createElement("div",{className:"how-it-works-pdf-section"},r.createElement("div",{className:"pdf-icon-header-desc"},r.createElement("div",{className:"pdf-icon"},r.createElement(t.PDFSvg,null)),r.createElement("div",{className:"pdf-header-desc"},r.createElement("h2",null,s(w.pdfHeader)),r.createElement("p",null,s(w.pdfDesc)))),r.createElement("div",{className:"download-icon"},r.createElement(t.DownloadImgIcon,null)))),g&&r.createElement("div",{className:"how-it-works-video-play"},r.createElement("div",{className:"close-button"},r.createElement(t.CloseSvg,{onClick:function(){y(!1)}})),r.createElement("video",{width:500,height:500,controls:!0,autoPlay:!0},r.createElement("source",{src:C,type:"video/mp4"})))))},le=[{texts:{header:"CS_LOGIN_PROVIDE_MOBILE_NUMBER",cardText:"CS_LOGIN_TEXT",nextText:"CS_COMMONS_NEXT",submitBarLabel:"CS_COMMONS_NEXT"},inputs:[{label:"CORE_COMMON_MOBILE_NUMBER",type:"text",name:"mobileNumber",error:"ERR_HRMS_INVALID_MOB_NO",validation:{required:!0,minLength:10,maxLength:10}}]},{texts:{header:"CS_LOGIN_OTP",cardText:"CS_LOGIN_OTP_TEXT",nextText:"CS_COMMONS_NEXT",submitBarLabel:"CS_COMMONS_NEXT"}},{texts:{header:"CS_LOGIN_PROVIDE_NAME",cardText:"CS_LOGIN_NAME_TEXT",nextText:"CS_COMMONS_NEXT",submitBarLabel:"CS_COMMONS_NEXT"},inputs:[{label:"CORE_COMMON_NAME",type:"text",name:"name",error:"CORE_COMMON_NAME_VALIDMSG",validation:{required:!0,minLength:1,pattern:/^[^{0-9}^\$\"<>?\\\\~!@#$%^()+={}\[\]*,/_:;“”‘’]{1,50}$/i}}]}],ce=function(e){var n=e.mobileNumber;return r.createElement(t.FormStep,{isDisabled:!(10===n.length&&e.canSubmit),onSelect:e.onSelect,config:e.config,t:e.t,componentInFront:"+91",onChange:e.onMobileChange,value:n})},ue=function(e){return r.createElement(t.FormStep,{config:e.config,onSelect:e.onSelect,t:e.t,isDisabled:e.isDisabled})},se=function(e){var i,o,a,l=e.config,c=e.otp,u=e.onOtpChange,s=e.onResend,d=e.onSelect,m=e.t,f=e.error,v=e.userType,p=void 0===v?"citizen":v,E=e.canSubmit,g=n.useState(30),y=g[0],h=g[1];i=function(){h(y-1)},o=y>0?1e3:null,a=n.useRef(),n.useEffect(function(){a.current=i},[i]),n.useEffect(function(){if(null!==o){var e=setInterval(function(){a.current()},o);return function(){return clearInterval(e)}}},[o]);var C=function(){s(),h(2)};return"employee"===p?r.createElement(n.Fragment,null,r.createElement(t.OTPInput,{length:6,onChange:u,value:c}),y>0?r.createElement(t.CardText,null,m("CS_RESEND_ANOTHER_OTP")+" "+y+" "+m("CS_RESEND_SECONDS")):r.createElement("p",{className:"card-text-button resend-otp",onClick:C},m("CS_RESEND_OTP")),!f&&r.createElement(t.CardLabelError,null,m("CS_INVALID_OTP"))):r.createElement(t.FormStep,{onSelect:d,config:l,t:m,isDisabled:!(6===(null==c?void 0:c.length)&&E)},r.createElement(t.OTPInput,{length:6,onChange:u,value:c}),y>0?r.createElement(t.CardText,null,m("CS_RESEND_ANOTHER_OTP")+" "+y+" "+m("CS_RESEND_SECONDS")):r.createElement("p",{className:"card-text-button",onClick:C},m("CS_RESEND_OTP")),!f&&r.createElement(t.CardLabelError,null,m("CS_INVALID_OTP")))},de=["ResponseInfo","UserRequest"],me=["ResponseInfo","UserRequest"],fe={type:"register"},ve={type:"login"},pe="/"+(null===(ie=window)||void 0===ie?void 0:ie.contextPath)+"/citizen",Ee=function(e,t){return(null==e?void 0:e.from)||(null==t?void 0:t.from)||pe},ge=function(e){var o,a,c=e.stateCode,u=e.isUserRegistered,s=void 0===u||u,m=i.useTranslation().t,v=l.useLocation(),p=l.useRouteMatch().path,E=l.useHistory(),g=n.useState(null),y=g[0],h=g[1],C=n.useState(null),O=C[0],b=C[1],S=n.useState(!0),N=S[0],w=S[1],I=(n.useState(null),n.useState(s?{}:null==v||null===(o=v.state)||void 0===o?void 0:o.data)),_=I[0],D=I[1],T=n.useState(null),L=T[0],R=T[1],A=Digit.Hooks.useQueryParams(),P=n.useState(!1),x=P[0],M=P[1],k=n.useState(!0),U=k[0],B=k[1],F=n.useState(!0),j=F[0],V=F[1];n.useEffect(function(){var e;return O&&(L&&(clearTimeout(L),R(null)),e=setTimeout(function(){b("")},5e3),R(e)),function(){e&&clearTimeout(e)}},[O]),n.useEffect(function(){var e;if(y){var t,n,r,i,o,a;Digit.SessionStorage.set("citizen.userRequestObject",y),Digit.UserService.setUser(y),t=null==y?void 0:y.info,n=null==y?void 0:y.access_token,r=c,a=null===(i=JSON.parse(sessionStorage.getItem("Digit.initData")))||void 0===i||null===(o=i.value)||void 0===o?void 0:o.selectedLanguage,localStorage.setItem("Citizen.tenant-id",r),localStorage.setItem("tenant-id",r),localStorage.setItem("citizen.userRequestObject",JSON.stringify(t)),localStorage.setItem("locale",a),localStorage.setItem("Citizen.locale",a),localStorage.setItem("token",n),localStorage.setItem("Citizen.token",n),localStorage.setItem("user-info",JSON.stringify(t)),localStorage.setItem("Citizen.user-info",JSON.stringify(t));var l,u=(null===(e=v.state)||void 0===e?void 0:e.from)||pe;Digit.ULBService.getCitizenCurrentTenant(!0)?E.replace(u):E.replace("/"+(null===(l=window)||void 0===l?void 0:l.contextPath)+"/citizen/select-location",{redirectBackTo:u})}},[y]);var H=n.useMemo(function(){return le.map(function(e){var t={};for(var n in e.texts)t[n]=m(e.texts[n]);return d({},e,{texts:t})},[le])}),z=function(){return Digit.UserService.getType()},G=function(e){return Promise.resolve(ne(function(){return Promise.resolve(Digit.UserService.sendOtp(e,c)).then(function(e){return[e,null]})},function(e){return[null,e]}))};return r.createElement("div",{className:"citizen-form-wrapper"},r.createElement(l.Switch,null,r.createElement(t.AppContainer,null,r.createElement(t.BackButton,null),r.createElement(l.Route,{path:""+p,exact:!0},r.createElement(ce,{onSelect:function(e){try{V(!1),D(d({},_,e));var t=d({},e,{tenantId:c,userType:z()});return Promise.resolve(s?Promise.resolve(G({otp:d({},t,ve)})).then(function(e){var n,r,i,o;if(!e[1])return V(!0),void E.replace(p+"/otp",{from:Ee(v.state,A),role:null===(r=v.state)||void 0===r?void 0:r.role});V(!0),v.state&&"FSM_DSO"===v.state.role||E.push("/"+(null===(i=window)||void 0===i?void 0:i.contextPath)+"/citizen/register/name",{from:Ee(v.state,A),data:t}),null!==(n=v.state)&&void 0!==n&&n.role&&(V(!0),b("FSM_DSO"===(null===(o=v.state)||void 0===o?void 0:o.role)?m("ES_ERROR_DSO_LOGIN"):"User not registered."))}):Promise.resolve(G({otp:d({},t,fe)})).then(function(e){if(!e[1])return V(!0),void E.replace(p+"/otp",{from:Ee(v.state,A)});V(!0)}))}catch(e){return Promise.reject(e)}},config:H[0],mobileNumber:_.mobileNumber||"",onMobileChange:function(e){D(d({},_,{mobileNumber:e.target.value}))},canSubmit:j,showRegisterLink:s&&!(null!==(a=v.state)&&void 0!==a&&a.role),t:m})),r.createElement(l.Route,{path:p+"/otp"},r.createElement(se,{config:d({},H[1],{texts:d({},H[1].texts,{cardText:H[1].texts.cardText+" "+(_.mobileNumber||"")})}),onOtpChange:function(e){D(d({},_,{otp:e}))},onResend:function(){try{var e={mobileNumber:_.mobileNumber,tenantId:c,userType:z()},t=function(){if(!s)return Promise.resolve(G({otp:d({},e,fe)})).then(function(){});var t=function(){if(s)return Promise.resolve(G({otp:d({},e,ve)})).then(function(){})}();return t&&t.then?t.then(function(){}):void 0}();return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},onSelect:function(){try{return Promise.resolve(ne(function(){w(!0),B(!1);var e=_.mobileNumber,t=_.otp,n=_.name;return function(){if(s){var r={username:e,password:t,tenantId:c,userType:z()};return Promise.resolve(Digit.UserService.authenticate(r)).then(function(e){var t,n,r,i=e.UserRequest,o=f(e,de);if(null!==(t=v.state)&&void 0!==t&&t.role){var a=i.roles.find(function(e){return e.code===v.state.role});if(!a||!a.code)return b(m("ES_ERROR_USER_NOT_PERMITTED")),void setTimeout(function(){return E.replace(pe)},5e3)}null!==(n=window)&&void 0!==n&&null!==(r=n.globalConfigs)&&void 0!==r&&r.getConfig("ENABLE_SINGLEINSTANCE")&&(i.tenantId=Digit.ULBService.getStateId()),h(d({info:i},o))})}var i=function(){if(!s)return Promise.resolve(Digit.UserService.registerUser({name:n,username:e,otpReference:t,tenantId:c},c)).then(function(e){var t,n,r=e.UserRequest,i=f(e,me);null!==(t=window)&&void 0!==t&&null!==(n=t.globalConfigs)&&void 0!==n&&n.getConfig("ENABLE_SINGLEINSTANCE")&&(r.tenantId=Digit.ULBService.getStateId()),h(d({info:r},i))})}();if(i&&i.then)return i.then(function(){})}()},function(){B(!0),w(!1)}))}catch(e){return Promise.reject(e)}},otp:_.otp,error:N,canSubmit:U,t:m})),r.createElement(l.Route,{path:p+"/name"},r.createElement(ue,{config:H[2],onSelect:function(e){try{var t=d({},_,{tenantId:c,userType:z()},e);return D(d({},_,e)),M(!0),Promise.resolve(G({otp:d({},t,fe)})).then(function(e){e[0]?(M(!1),E.replace(p+"/otp",{from:Ee(v.state,A)})):M(!1)})}catch(e){return Promise.reject(e)}},t:m,isDisabled:x})),O&&r.createElement(t.Toast,{error:!0,label:O,onClose:function(){return b(null)}}))))},ye=function(e){return e instanceof HTMLElement},he=function(e){return null==e},Ce=function(e){return"object"==typeof e},Oe=function(e){return!he(e)&&!Array.isArray(e)&&Ce(e)&&!(e instanceof Date)},be=function(e){return/^\w*$/.test(e)},Se=function(e){return e.filter(Boolean)},Ne=function(e){return Se(e.replace(/["|']/g,"").replace(/\[/g,".").replace(/\]/g,"").split("."))};function we(e,t,n){for(var r=-1,i=be(t)?[t]:Ne(t),o=i.length,a=o-1;++r<o;){var l=i[r],c=n;if(r!==a){var u=e[l];c=Oe(u)||Array.isArray(u)?u:isNaN(+i[r+1])?{}:[]}e[l]=c,e=e[l]}return e}var Ie=function(e,t){for(var n in void 0===t&&(t={}),e)be(n)?t[n]=e[n]:we(t,n,e[n]);return t},_e=function(e){return void 0===e},De=function(e,t,n){void 0===e&&(e={});var r=Se(t.split(/[,[\].]+?/)).reduce(function(e,t){return he(e)?e:e[t]},e);return _e(r)||r===e?_e(e[t])?n:e[t]:r},Te=function(e,t){ye(e)&&e.removeEventListener&&(e.removeEventListener("input",t),e.removeEventListener("change",t),e.removeEventListener("blur",t))},Le={isValid:!1,value:null},Re=function(e){return Array.isArray(e)?e.reduce(function(e,t){return t&&t.ref.checked?{isValid:!0,value:t.ref.value}:e},Le):Le},Ae=function(e){return"radio"===e.type},Pe=function(e){return"file"===e.type},xe=function(e){return"checkbox"===e.type},Me=function(e){return"select-multiple"===e.type},ke={value:!1,isValid:!1},Ue={value:!0,isValid:!0},Be=function(e){if(Array.isArray(e)){if(e.length>1){var t=e.filter(function(e){return e&&e.ref.checked}).map(function(e){return e.ref.value});return{value:t,isValid:!!t.length}}var n=e[0].ref,r=n.value,i=n.attributes;return n.checked?i&&!_e(i.value)?_e(r)||""===r?Ue:{value:r,isValid:!0}:Ue:ke}return ke};function Fe(e,t,n,r,i){var o=e.current[t];if(o){var a=o.ref,l=a.value,c=o.ref,u=o.valueAsNumber,s=o.valueAsDate,d=o.setValueAs;if(a.disabled&&r)return;return Pe(c)?c.files:Ae(c)?Re(o.options).value:Me(c)?[].concat(c.options).filter(function(e){return e.selected}).map(function(e){return e.value}):xe(c)?Be(o.options).value:i?l:u?""===l?NaN:+l:s?c.valueAsDate:d?d(l):l}if(n)return De(n.current,t)}function je(e){return!e||e instanceof HTMLElement&&e.nodeType!==Node.DOCUMENT_NODE&&je(e.parentNode)}var Ve=function(e){return Oe(e)&&!Object.keys(e).length},He=function(e){return"boolean"==typeof e};function ze(e,t){var n,r=be(t)?[t]:Ne(t),i=1==r.length?e:function(e,t){for(var n=t.slice(0,-1).length,r=0;r<n;)e=_e(e)?r++:e[t[r++]];return e}(e,r);i&&delete i[r[r.length-1]];for(var o=0;o<r.slice(0,-1).length;o++){var a=-1,l=void 0,c=r.slice(0,-(o+1)),u=c.length-1;for(o>0&&(n=e);++a<c.length;){var s=c[a];l=l?l[s]:e[s],u===a&&(Oe(l)&&Ve(l)||Array.isArray(l)&&!l.filter(function(e){return Oe(e)&&!Ve(e)||He(e)}).length)&&(n?delete n[s]:delete e[s]),n=l}}return e}var Ge=function(e,t){return e&&e.ref===t},We=function(e){return he(e)||!Ce(e)};function qe(e,t){if(We(e)||We(t))return t;for(var n in t){var r=e[n],i=t[n];try{e[n]=Oe(r)&&Oe(i)||Array.isArray(r)&&Array.isArray(i)?qe(r,i):i}catch(e){}}return e}function Xe(e,t,r){if(We(e)||We(t)||e instanceof Date||t instanceof Date)return e===t;if(!n.isValidElement(e)){var i=Object.keys(e),o=Object.keys(t);if(i.length!==o.length)return!1;for(var a=0,l=i;a<l.length;a++){var c=l[a],u=e[c];if(!r||"ref"!==c){var s=t[c];if((Oe(u)||Array.isArray(u))&&(Oe(s)||Array.isArray(s))?!Xe(u,s,r):u!==s)return!1}}}return!0}function Ze(e,t,n,r,i){for(var o=-1;++o<e.length;){for(var a in e[o]){var l;Array.isArray(e[o][a])?(!n[o]&&(n[o]={}),n[o][a]=[],Ze(e[o][a],De(t[o]||{},a,[]),n[o][a],n[o],a)):Xe(De(t[o]||{},a),e[o][a])?we(n[o]||{},a):n[o]=Object.assign(Object.assign({},n[o]),((l={})[a]=!0,l))}r&&!n.length&&delete r[i]}return n}var Ye=function(e){return"string"==typeof e},Ke=function(e,t,n,r,i){var o={},a=function(t){(_e(i)||(Ye(i)?t.startsWith(i):Array.isArray(i)&&i.find(function(e){return t.startsWith(e)})))&&(o[t]=Fe(e,t,void 0,r))};for(var l in e.current)a(l);return n?Ie(o):qe(t,Ie(o))},$e=function(e){return e instanceof RegExp},Je=function(e){return Oe(e)&&!$e(e)?e:{value:e,message:""}},Qe=function(e){return"function"==typeof e},et=function(e){return Ye(e)||n.isValidElement(e)};function tt(e,t,n){if(void 0===n&&(n="validate"),et(e)||He(e)&&!e)return{type:n,message:et(e)?e:"",ref:t}}var nt=function(e,t,n,r,i){var o;return t?Object.assign(Object.assign({},n[e]),{types:Object.assign(Object.assign({},n[e]&&n[e].types?n[e].types:{}),(o={},o[r]=i||!0,o))}):{}},rt=function(e,t,n,r){var i=n.ref,o=n.ref.value,a=n.options,l=n.required,c=n.maxLength,u=n.minLength,s=n.min,d=n.max,m=n.pattern,f=n.validate;try{var v=!1,p=i.name,E={},g=Ae(i),y=xe(i),h=g||y,C=""===o,O=nt.bind(null,p,t,E),b=function(e,t,n,r,o){void 0===r&&(r="maxLength"),void 0===o&&(o="minLength");var a=e?t:n;E[p]=Object.assign({type:e?r:o,message:a,ref:i},O(e?r:o,a))};if(l&&(!g&&!y&&(C||he(o))||He(o)&&!o||y&&!Be(a).isValid||g&&!Re(a).isValid)){var S=et(l)?{value:!!l,message:l}:Je(l),N=S.message;if(S.value&&(E[p]=Object.assign({type:"required",message:N,ref:h?((e.current[p].options||[])[0]||{}).ref:i},O("required",N)),!t))return Promise.resolve(E)}if(!(he(s)&&he(d)||""===o)){var w,I,_=Je(d),D=Je(s);if(isNaN(o)){var T=i.valueAsDate||new Date(o);Ye(_.value)&&(w=T>new Date(_.value)),Ye(D.value)&&(I=T<new Date(D.value))}else{var L=i.valueAsNumber||parseFloat(o);he(_.value)||(w=L>_.value),he(D.value)||(I=L<D.value)}if((w||I)&&(b(!!w,_.message,D.message,"max","min"),!t))return Promise.resolve(E)}if(Ye(o)&&!C&&(c||u)){var R=Je(c),A=Je(u),P=!he(R.value)&&o.length>R.value,x=!he(A.value)&&o.length<A.value;if((P||x)&&(b(P,R.message,A.message),!t))return Promise.resolve(E)}if(Ye(o)&&m&&!C){var M=Je(m),k=M.value,U=M.message;if($e(k)&&!k.test(o)&&(E[p]=Object.assign({type:"pattern",message:U,ref:i},O("pattern",U)),!t))return Promise.resolve(E)}var B=function(){if(f){var n=Fe(e,p,r,!1,!0),o=h&&a?a[0].ref:i;return Qe(f)?Promise.resolve(f(n)).then(function(e){var n=tt(e,o);if(n&&(E[p]=Object.assign(Object.assign({},n),O("validate",n.message)),!t))return v=!0,E}):function(){if(Oe(f)){var e=function(){if(!Ve(i)&&(E[p]=Object.assign({ref:o},i),!t))return v=!0,E},r=!1,i={},a=te(Object.entries(f),function(e){var a=e[0],l=e[1];if(Ve(i)||t)return Promise.resolve(l(n)).then(function(e){var n=tt(e,o,a);n&&(i=Object.assign(Object.assign({},n),O(a,n.message)),t&&(E[p]=i))});r=!0},function(){return r});return a&&a.then?a.then(e):e()}}()}}();return Promise.resolve(B&&B.then?B.then(function(e){return v?e:E}):v?B:E)}catch(e){return Promise.reject(e)}},it=function e(t,n,r){for(var i in void 0===r&&(r=[]),n){var o=t+(Oe(n)?"."+i:"["+i+"]");We(n[i])?r.push(o):e(o,n[i],r)}return r},ot=function(e,t,n,r,i){var o=void 0;return n.add(t),Ve(e)||(o=De(e,t),(Oe(o)||Array.isArray(o))&&it(t,o).forEach(function(e){return n.add(e)})),_e(o)?i?r:De(r,t):o},at=function(e){var t=e.isBlurEvent,n=e.isSubmitted;return!e.isOnAll&&(!n&&e.isOnTouch?!(e.isTouched||t):(n?e.isReValidateOnBlur:e.isOnBlur)?!t:!(n?e.isReValidateOnChange:e.isOnChange)||t)},lt=function(e){return e.substring(0,e.indexOf("["))},ct=function(e,t){return[].concat(e).some(function(e){return function(e,t){return RegExp(("^"+t+"([|.)\\d+").replace(/\[/g,"\\[").replace(/\]/g,"\\]")).test(e)}(t,e)})},ut="undefined"!=typeof window&&"undefined"!=typeof document;function st(e){var t,n;if(We(e)||ut&&(e instanceof File||ye(e)))return e;if(!["Set","Map","Object","Date","Array"].includes(null===(t=e.constructor)||void 0===t?void 0:t.name))return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof Set){n=new Set;for(var r,i=p(e);!(r=i()).done;)n.add(r.value);return n}if(e instanceof Map){n=new Map;for(var o,a=p(e.keys());!(o=a()).done;){var l=o.value;n.set(l,st(e.get(l)))}return n}for(var c in n=Array.isArray(e)?[]:{},e)n[c]=st(e[c]);return n}var dt=function(e){return{isOnSubmit:!e||"onSubmit"===e,isOnBlur:"onBlur"===e,isOnChange:"onChange"===e,isOnAll:"all"===e,isOnTouch:"onTouched"===e}},mt=function(e){return Ae(e)||xe(e)},ft="undefined"==typeof window,vt=ut?"Proxy"in window:"undefined"!=typeof Proxy,pt=n.createContext(null);pt.displayName="RHFContext";var Et,gt,yt,ht,Ct,Ot=function(e){var t=e.as,r=e.render,i=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["rules","as","render","defaultValue","control","onFocus"]),o=function(e){var t=e.name,r=e.rules,i=e.defaultValue,o=e.control,a=e.onFocus,l=n.useContext(pt);if("production"!==process.env.NODE_ENV&&!o&&!l)throw new Error("📋 Controller is missing `control` prop. https://react-hook-form.com/api#Controller");var c=o||l.control,u=c.defaultValuesRef,s=c.setValue,d=c.register,m=c.unregister,f=c.trigger,v=c.mode,p=c.reValidateMode,E=p.isReValidateOnBlur,g=p.isReValidateOnChange,y=c.formState,h=c.formStateRef.current,C=h.isSubmitted,O=h.touched,b=h.errors,S=c.updateFormState,N=c.readFormStateRef,w=c.fieldsRef,I=c.shallowFieldsStateRef,_=!ct(c.fieldArrayNamesRef.current,t),D=function(){return!_e(De(I.current,t))&&_?De(I.current,t):_e(i)?De(u.current,t):i},T=n.useState(D()),L=T[0],R=T[1],A=n.useRef(L),P=n.useRef({focus:function(){return null}}),x=n.useRef(a||function(){Qe(P.current.focus)&&P.current.focus(),"production"!==process.env.NODE_ENV&&(Qe(P.current.focus)||console.warn("📋 'ref' from Controller render prop must be attached to a React component or a DOM Element whose ref provides a 'focus()' method"))}),M=n.useCallback(function(e){return!at(Object.assign({isBlurEvent:e,isReValidateOnBlur:E,isReValidateOnChange:g,isSubmitted:C,isTouched:!!De(O,t)},v))},[E,g,C,O,t,v]),k=n.useCallback(function(e){var t,n=We(t=e[0])||!Oe(t.target)||Oe(t.target)&&!t.type?t:_e(t.target.value)?t.target.checked:t.target.value;return R(n),A.current=n,n},[]),U=n.useCallback(function(e){if("production"!==process.env.NODE_ENV&&!t)return console.warn("📋 Field is missing `name` prop. https://react-hook-form.com/api#Controller");w.current[t]?w.current[t]=Object.assign({ref:w.current[t].ref},r):(d(Object.defineProperties({name:t,focus:x.current},{value:{set:function(e){R(e),A.current=e},get:function(){return A.current}}}),r),e=_e(De(u.current,t))),e&&_&&R(D())},[r,t,d]);n.useEffect(function(){return function(){return m(t)}},[t]),n.useEffect(function(){"production"!==process.env.NODE_ENV&&(_e(L)&&console.warn("📋 "+t+" is missing in the 'defaultValue' prop of either its Controller (https://react-hook-form.com/api#Controller) or useForm (https://react-hook-form.com/api#useForm)"),!_&&_e(i)&&console.warn("📋 Controller is missing `defaultValue` prop when using `useFieldArray`. https://react-hook-form.com/api#Controller")),U()},[U]),n.useEffect(function(){!w.current[t]&&U(!0)});var B=n.useCallback(function(){N.current.touched&&!De(O,t)&&(we(O,t,!0),S({touched:O})),M(!0)&&f(t)},[t,S,M,f,N]);return{field:{onChange:n.useCallback(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return s(t,k(n),{shouldValidate:M(),shouldDirty:!0})},[s,t,M]),onBlur:B,name:t,value:L,ref:P},meta:Object.defineProperties({invalid:!!De(b,t)},{isDirty:{get:function(){return!!De(y.dirtyFields,t)}},isTouched:{get:function(){return!!De(y.touched,t)}}})}}(e),a=o.field,l=o.meta,c=Object.assign(Object.assign({},i),a);return t?n.isValidElement(t)?n.cloneElement(t,c):n.createElement(t,c):r?r(a,l):null},bt=function(e){var n=e.control,i=e.t,o=window.Digit.Utils.browser.isMobile();return r.createElement(Fragment,null,r.createElement(t.SearchField,{className:"pt-form-field"},r.createElement("label",null,i("AUDIT_FROM_DATE_LABEL")),r.createElement(Ot,{render:function(e){return r.createElement(t.DatePicker,{date:e.value,onChange:e.onChange})},name:"fromDate",control:n})),r.createElement(t.SearchField,{className:"pt-form-field"},r.createElement("label",null,i("AUDIT_TO_DATE_LABEL")),r.createElement(Ot,{render:function(e){return r.createElement(t.DatePicker,{date:e.value,onChange:e.onChange})},name:"toDate",control:n})),r.createElement(t.SearchField,{className:"pt-search-action-submit"},r.createElement(t.SubmitBar,{style:{marginTop:o?"510px":"25px",marginLeft:o?"0":"-30px",maxWidth:o?"100%":"240px"},label:i("ES_COMMON_APPLY"),submit:!0})))},St=["currentlyActiveMobileModal","searchFormFieldsComponentProps","tenantId"],Nt=["currentlyActiveMobileModal","searchFormFieldsComponentProps","tenantId"],wt=function(e){var i,o=e.Controller,a=e.register,l=e.control,c=e.t,u=e.reset,s=e.previousPage,m=e.handleSubmit,v=e.tenantId,p=e.data,E=e.onSubmit,g=e.isLoading,y=n.useState([]),h=y[0],C=y[1],O=function(e){return r.createElement("div",{onClick:e.onClick},r.createElement(t.DownloadBtnCommon,null))};n.useEffect(function(){(null==p?void 0:p.length)>0&&C([null==p?void 0:p.map(function(e){var t={};return t[c("AUDIT_DATE_LABEL")]=b(null==e?void 0:e.timestamp),t[c("AUDIT_TIME_LABEL")]=S(null==e?void 0:e.timestamp),t[c("AUDIT_DATAVIEWED_LABEL")]=(null==e?void 0:e.dataView[0])+","+(null==e?void 0:e.dataView[1]),t[c("AUDIT_DATAVIEWED_BY_LABEL")]=null==e?void 0:e.dataViewedBy,t[c("AUDIT_ROLE_LABEL")]=null==e?void 0:e.roles.map(function(e){return e.name}).join(","),d({},t)})])},[p]);var b=function(e){if(null==e||null==e||""==e)return"NA";var t=new Date(e),n=t.getMonth()+1,r=t.getDate();return(r=(r>9?"":"0")+r)+"/"+(n=(n>9?"":"0")+n)+"/"+t.getFullYear()},S=function(e){if(null==e||null==e||""==e)return"NA";var t=new Date(e),n=t.getHours(),r=t.getMinutes(),i=n>12?"PM":"AM";return(n=((n=n>12?n-12:n)>9?"":"0")+n)+":"+(r=(r>9?"":"0")+r)+" "+i},N=n.useReducer(function(e,t){switch(t.type){case"set":return t.payload;case"remove":return!1}},!1),w=N[0],I=N[1],_=function(){I({type:"remove"})},D=function(){return r.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:_},r.createElement(t.CloseSvg,null))},T={Controller:o,register:a,control:l,t:c,reset:u,previousPage:s},L=n.useCallback(function(e){return function(e){var n=e.currentlyActiveMobileModal,i=e.searchFormFieldsComponentProps,o=e.tenantId,a=f(e,St),l=a.closeMobilePopupModal;switch(n){case"SearchFormComponent":return r.createElement(t.SearchForm,a,r.createElement(D,null),r.createElement("div",{className:"MobilePopupHeadingWrapper"},r.createElement("h2",null,c("PRIVACY_AUDIT_REPORT"),":")),r.createElement(bt,d({},i,{closeMobilePopupModal:l,tenantId:o,t:c})));default:return r.createElement("span",null)}}(d({currentlyActiveMobileModal:e.currentlyActiveMobileModal,searchFormFieldsComponentProps:e.searchFormFieldsComponentProps,tenantId:e.tenantId},f(e,Nt)))},[w]);null==p||null===(i=p.roles)||void 0===i||i.forEach(function(e){});var R=n.useMemo(function(){return null!=p&&p.display||""===p?[]:null==p?void 0:p.map(function(e){var t,n;return(n={})[c("AUDIT_DATE_LABEL")]=b(e.timestamp),n[c("AUDIT_TIME_LABEL")]=S(e.timestamp),n[c("AUDIT_DATAVIEWED_LABEL")]=e.dataView[0]+","+e.dataView[1],n[c("AUDIT_DATAVIEWED_BY_LABEL")]=e.dataViewedBy,n[c("AUDIT_ROLE_LABEL")]=null===(t=e.roles.slice(0,3))||void 0===t?void 0:t.map(function(e){return e.name}).join(","),n})},[p]);return r.createElement(r.Fragment,null,r.createElement(t.BackButton,null),r.createElement("div",{className:"sideContent",style:{marginLeft:"70%",marginTop:"-12%"}},r.createElement(O,{className:"mrlg cursorPointer",onClick:function(){return function(e){if(void 0!==(null==e?void 0:e[0]))return Digit.Download.Excel(null==e?void 0:e[0],"AuditReport")}(h)}})),r.createElement(t.Header,null,c("PRIVACY_AUDIT_REPORT"),":"),r.createElement("div",{className:"searchBox"},r.createElement(t.SearchAction,{text:c("ES_COMMON_SEARCH"),handleActionClick:function(){return I({type:"set",payload:"SearchFormComponent"})},tenantId:v,t:c})),w?r.createElement(t.PopUp,null,r.createElement(L,{onSubmit:function(e){I({type:"remove"}),E(e)},handleSubmit:m,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",searchFormFieldsComponentProps:T,currentlyActiveMobileModal:w,closeMobilePopupModal:_,tenantId:v})):null,g&&r.createElement(t.Loader,null),r.createElement(t.DetailsCard,{data:R}))},It=function(e){var i=e.tenantId,o=e.t,a=e.onSubmit,l=e.data,c=e.count,u=function(e){var t=void 0===e?{}:e,r=t.mode,i=void 0===r?"onSubmit":r,o=t.reValidateMode,a=void 0===o?"onChange":o,l=t.resolver,c=t.context,u=t.defaultValues,s=void 0===u?{}:u,d=t.shouldFocusError,m=void 0===d||d,f=t.shouldUnregister,v=void 0===f||f,E=t.criteriaMode,g=n.useRef({}),y=n.useRef({}),h=n.useRef({}),C=n.useRef(new Set),O=n.useRef({}),b=n.useRef({}),S=n.useRef({}),N=n.useRef({}),w=n.useRef(s),I=n.useRef(!1),_=n.useRef(!1),D=n.useRef(),T=n.useRef({}),L=n.useRef({}),R=n.useRef(c),A=n.useRef(l),P=n.useRef(new Set),x=n.useRef(dt(i)),M=x.current,k=M.isOnSubmit,U=M.isOnTouch,B="all"===E,F=n.useState({isDirty:!1,isValidating:!1,dirtyFields:{},isSubmitted:!1,submitCount:0,touched:{},isSubmitting:!1,isSubmitSuccessful:!1,isValid:!k,errors:{}}),j=F[0],V=F[1],H=n.useRef({isDirty:!vt,dirtyFields:!vt,touched:!vt||U,isValidating:!vt,isSubmitting:!vt,isValid:!vt}),z=n.useRef(j),G=n.useRef(),W=n.useRef(dt(a)).current,q=W.isOnBlur,X=W.isOnChange;R.current=c,A.current=l,z.current=j,T.current=v?{}:Ve(T.current)?st(s):T.current;var Z=n.useCallback(function(e){void 0===e&&(e={}),I.current||(z.current=Object.assign(Object.assign({},z.current),e),V(z.current))},[]),Y=function(){return H.current.isValidating&&Z({isValidating:!0})},K=n.useCallback(function(e,t,n,r,i){void 0===n&&(n=!1),void 0===r&&(r={});var o=n||function(e){var t=e.errors,n=e.name,r=e.error,i=e.validFields,o=e.fieldsWithValidation,a=_e(r),l=De(t,n);return a&&!!l||!a&&!Xe(l,r,!0)||a&&De(o,n)&&!De(i,n)}({errors:z.current.errors,error:t,name:e,validFields:N.current,fieldsWithValidation:S.current}),a=De(z.current.errors,e);t?(ze(N.current,e),o=o||!a||!Xe(a,t,!0),we(z.current.errors,e,t)):((De(S.current,e)||A.current)&&(we(N.current,e,!0),o=o||a),ze(z.current.errors,e)),(o&&!he(n)||!Ve(r)||H.current.isValidating)&&Z(Object.assign(Object.assign(Object.assign({},r),A.current?{isValid:!!i}:{}),{isValidating:!1}))},[]),$=n.useCallback(function(e,t){var n=g.current[e],r=n.ref,i=n.options,o=ut&&ye(r)&&he(t)?"":t;Ae(r)?(i||[]).forEach(function(e){var t=e.ref;return t.checked=t.value===o}):Pe(r)&&!Ye(o)?r.files=o:Me(r)?[].concat(r.options).forEach(function(e){return e.selected=o.includes(e.value)}):xe(r)&&i?i.length>1?i.forEach(function(e){var t=e.ref;return t.checked=Array.isArray(o)?!!o.find(function(e){return e===t.value}):o===t.value}):i[0].ref.checked=!!o:r.value=o},[]),J=n.useCallback(function(e,t){if(H.current.isDirty){var n=ue();return e&&t&&we(n,e,t),!Xe(n,w.current)}return!1},[]),Q=n.useCallback(function(e,t){if(void 0===t&&(t=!0),H.current.isDirty||H.current.dirtyFields){var n=!Xe(De(w.current,e),Fe(g,e,T)),r=De(z.current.dirtyFields,e),i=z.current.isDirty;n?we(z.current.dirtyFields,e,!0):ze(z.current.dirtyFields,e);var o={isDirty:J(),dirtyFields:z.current.dirtyFields},a=H.current.isDirty&&i!==o.isDirty||H.current.dirtyFields&&r!==De(z.current.dirtyFields,e);return a&&t&&Z(o),a?o:{}}return{}},[]),ee=n.useCallback(function(e,t){try{return"production"===process.env.NODE_ENV||g.current[e]?Promise.resolve(rt(g,B,g.current[e],T)).then(function(n){var r=n[e];return K(e,r,t),_e(r)}):(console.warn("📋 Field is missing with `name` attribute: ",e),Promise.resolve(!1))}catch(e){return Promise.reject(e)}},[K,B]),ne=n.useCallback(function(e){try{return Promise.resolve(A.current(ue(),R.current,B)).then(function(t){var n=t.errors,r=z.current.isValid;if(Array.isArray(e)){var i=e.map(function(e){var t=De(n,e);return t?we(z.current.errors,e,t):ze(z.current.errors,e),!t}).every(Boolean);return Z({isValid:Ve(n),isValidating:!1}),i}var o=De(n,e);return K(e,o,r!==Ve(n),{},Ve(n)),!o})}catch(e){return Promise.reject(e)}},[K,B]),re=n.useCallback(function(e){try{var t=function(e){return n?e:Promise.resolve(ee(r))},n=!1,r=e||Object.keys(g.current);if(Y(),A.current)return Promise.resolve(ne(r));var i=function(){if(Array.isArray(r))return!e&&(z.current.errors={}),Promise.resolve(Promise.all(r.map(function(e){try{return Promise.resolve(ee(e,null))}catch(e){return Promise.reject(e)}}))).then(function(e){Z({isValidating:!1});var t=e.every(Boolean);return n=!0,t})}();return Promise.resolve(i&&i.then?i.then(t):t(i))}catch(e){return Promise.reject(e)}},[ne,ee]),ie=n.useCallback(function(e,t,n){var r=n.shouldDirty,i=n.shouldValidate,o={};we(o,e,t);for(var a,l=p(it(e,t));!(a=l()).done;){var c=a.value;g.current[c]&&($(c,De(o,c)),r&&Q(c),i&&re(c))}},[re,$,Q]),oe=n.useCallback(function(e,t,n){if(!v&&!We(t)&&we(T.current,e,Array.isArray(t)?[].concat(t):Object.assign({},t)),g.current[e])$(e,t),n.shouldDirty&&Q(e),n.shouldValidate&&re(e);else if(!We(t)&&(ie(e,t,n),P.current.has(e))){var r,i,o=lt(e)||e;we(y.current,e,t),L.current[o](((r={})[o]=De(y.current,o),r)),(H.current.isDirty||H.current.dirtyFields)&&n.shouldDirty&&(we(z.current.dirtyFields,e,function(e,t,n){return qe(Ze(e,t,n.slice(0,e.length)),Ze(t,e,n.slice(0,e.length)))}(t,De(w.current,e,[]),De(z.current.dirtyFields,e,[]))),Z({isDirty:!Xe(Object.assign(Object.assign({},ue()),(i={},i[e]=t,i)),w.current)}))}!v&&we(T.current,e,t)},[Q,$,ie]),ae=function(e){return _.current||C.current.has(e)||C.current.has((e.match(/\w+/)||[])[0])},le=function(e){var t=!0;if(!Ve(O.current))for(var n in O.current)e&&O.current[n].size&&!O.current[n].has(e)&&!O.current[n].has(lt(e))||(b.current[n](),t=!1);return t};function ce(e){if(!v){for(var t,n=st(e),r=p(P.current);!(t=r()).done;){var i,o=t.value;be(o)&&!n[o]&&(n=Object.assign(Object.assign({},n),((i={})[o]=[],i)))}return n}return e}function ue(e){if(Ye(e))return Fe(g,e,T);if(Array.isArray(e)){for(var t,n={},r=p(e);!(t=r()).done;){var i=t.value;we(n,i,Fe(g,i,T))}return n}return ce(Ke(g,st(T.current),v))}D.current=D.current?D.current:function(e){var t=e.type,n=e.target;try{var r,i,o=n.name,a=g.current[o];return Promise.resolve(function(){if(a){var e=function(){!l&&le(o),K(o,r,s,u,i)},l="blur"===t,c=at(Object.assign({isBlurEvent:l,isReValidateOnChange:X,isReValidateOnBlur:q,isTouched:!!De(z.current.touched,o),isSubmitted:z.current.isSubmitted},x.current)),u=Q(o,!1),s=!Ve(u)||!l&&ae(o);if(l&&!De(z.current.touched,o)&&H.current.touched&&(we(z.current.touched,o,!0),u=Object.assign(Object.assign({},u),{touched:z.current.touched})),!v&&xe(n)&&we(T.current,o,Fe(g,o)),c)return!l&&le(o),(!Ve(u)||s&&Ve(u))&&Z(u);Y();var d=A.current?Promise.resolve(A.current(ue(),R.current,B)).then(function(e){var t=e.errors,a=z.current.isValid;if(r=De(t,o),xe(n)&&!r&&A.current){var l=lt(o),c=De(t,l,{});c.type&&c.message&&(r=c),l&&(c||De(z.current.errors,l))&&(o=l)}a!==(i=Ve(t))&&(s=!0)}):Promise.resolve(rt(g,B,a,T)).then(function(e){r=e[o]});return d&&d.then?d.then(e):e()}}())}catch(e){return Promise.reject(e)}};var se=n.useCallback(function(e){void 0===e&&(e={});try{var t=Ve(g.current)?w.current:{};return Promise.resolve(A.current(Object.assign(Object.assign(Object.assign({},t),ue()),e),R.current,B)).then(function(e){var t=Ve(e.errors);z.current.isValid!==t&&Z({isValid:t})})}catch(e){return Promise.reject(e)}},[B]),de=n.useCallback(function(e,t){!function(e,t,n,r,i,o){var a=n.ref,l=n.ref.name,c=e.current[l];if(!i){var u=Fe(e,l,r);!_e(u)&&we(r.current,l,u)}a.type&&c?Ae(a)||xe(a)?Array.isArray(c.options)&&c.options.length?(Se(c.options).forEach(function(e,n){void 0===e&&(e={}),(je(e.ref)&&Ge(e,e.ref)||o)&&(Te(e.ref,t),ze(c.options,"["+n+"]"))}),c.options&&!Se(c.options).length&&delete e.current[l]):delete e.current[l]:(je(a)&&Ge(c,a)||o)&&(Te(a,t),delete e.current[l]):delete e.current[l]}(g,D.current,e,T,v,t),v&&(ze(N.current,e.ref.name),ze(S.current,e.ref.name))},[v]),me=n.useCallback(function(e){if(_.current)Z();else{for(var t,n=p(C.current);!(t=n()).done;)if(t.value.startsWith(e)){Z();break}le(e)}},[]),fe=n.useCallback(function(e,t){e&&(de(e,t),v&&!Se(e.options||[]).length&&(ze(z.current.errors,e.ref.name),we(z.current.dirtyFields,e.ref.name,!0),Z({isDirty:J()}),H.current.isValid&&A.current&&se(),me(e.ref.name)))},[se,de]),ve=n.useCallback(function(e,t,n){var r=n?O.current[n]:C.current,i=Ke(g,st(T.current),v,!1,e);if(Ye(e)){var o=lt(e)||e;return P.current.has(o)&&(i=Object.assign(Object.assign({},h.current),i)),ot(i,e,r,_e(De(w.current,e))?t:De(w.current,e),!0)}var a=_e(t)?w.current:t;return Array.isArray(e)?e.reduce(function(e,t){var n;return Object.assign(Object.assign({},e),((n={})[t]=ot(i,t,r,a),n))},{}):(_.current=_e(n),Ie(!Ve(i)&&i||a))},[]);function pe(e,t){if(void 0===t&&(t={}),"production"!==process.env.NODE_ENV){if(!e.name)return console.warn("📋 Field is missing `name` attribute",e,"https://react-hook-form.com/api#useForm");if(P.current.has(e.name.split(/\[\d+\]$/)[0])&&!RegExp(("^"+e.name.split(/\[\d+\]$/)[0]+"[\\d+].\\w+").replace(/\[/g,"\\[").replace(/\]/g,"\\]")).test(e.name))return console.warn('📋 `name` prop should be in object shape: name="test[index].name"',e,"https://react-hook-form.com/api#useFieldArray")}var n,r=e.name,i=e.type,o=e.value,a=Object.assign({ref:e},t),l=g.current,c=mt(e),u=ct(P.current,r),s=function(t){return ut&&(!ye(e)||t===e)},d=l[r],m=!0;if(d&&(c?Array.isArray(d.options)&&Se(d.options).find(function(e){return o===e.ref.value&&s(e.ref)}):s(d.ref)))l[r]=Object.assign(Object.assign({},d),t);else{d=i?c?Object.assign({options:[].concat(Se(d&&d.options||[]),[{ref:e}]),ref:{type:i,name:r}},t):Object.assign({},a):a,l[r]=d;var f=_e(De(T.current,r));Ve(w.current)&&f||(n=De(f?w.current:T.current,r),(m=_e(n))||u||$(r,n)),Ve(t)||(we(S.current,r,!0),!k&&H.current.isValid&&rt(g,B,d,T).then(function(e){var t=z.current.isValid;Ve(e)?we(N.current,r,!0):ze(N.current,r),t!==Ve(e)&&Z()})),!v||u&&m||!u&&ze(z.current.dirtyFields,r),i&&function(e,t,n){var r=e.ref;ye(r)&&n&&(r.addEventListener(t?"change":"input",n),r.addEventListener("blur",n))}(c&&d.options?d.options[d.options.length-1]:d,c||"select-one"===e.type,D.current)}}var Ee=n.useCallback(function(e,t){return function(n){try{n&&n.preventDefault&&(n.preventDefault(),n.persist());var r={},i=ce(Ke(g,st(T.current),v,!0));return H.current.isSubmitting&&Z({isSubmitting:!0}),Promise.resolve(function(o,a){try{var l=function(){function o(){var o=function(){if(Ve(r)&&Object.keys(z.current.errors).every(function(e){return e in g.current}))return Z({errors:{},isSubmitting:!0}),Promise.resolve(e(i,n)).then(function(){});var o=function(e){m&&function(e,t){for(var n in e)if(De(t,n)){var r=e[n];if(r){if(r.ref.focus&&_e(r.ref.focus()))break;if(r.options){r.options[0].ref.focus();break}}}}(g.current,z.current.errors)};return z.current.errors=Object.assign(Object.assign({},z.current.errors),r),t?Promise.resolve(t(z.current.errors,n)).then(o):o()}();if(o&&o.then)return o.then(function(){})}var a=A.current?Promise.resolve(A.current(i,R.current,B)).then(function(e){var t=e.values;z.current.errors=r=e.errors,i=t}):te(Object.values(g.current),function(e){var t=function(){if(e){var t=e.ref.name;return Promise.resolve(rt(g,B,e,T)).then(function(e){e[t]?(we(r,t,e[t]),ze(N.current,t)):De(S.current,t)&&(ze(z.current.errors,t),we(N.current,t,!0))})}}();if(t&&t.then)return t.then(function(){})});return a&&a.then?a.then(o):o()}()}catch(e){return a(!0,e)}return l&&l.then?l.then(a.bind(null,!1),a.bind(null,!0)):a(!1,l)}(0,function(e,t){if(z.current.isSubmitting=!1,Z({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Ve(z.current.errors),submitCount:z.current.submitCount+1}),e)throw t;return t}))}catch(n){return Promise.reject(n)}}},[m,B]);n.useEffect(function(){l&&H.current.isValid&&se(),G.current=G.current||!ut?G.current:function(e,t){var n=new MutationObserver(function(){for(var n=0,r=Object.values(e.current);n<r.length;n++){var i=r[n];if(i&&i.options)for(var o,a=p(i.options);!(o=a()).done;){var l=o.value;l&&l.ref&&je(l.ref)&&t(i)}else i&&je(i.ref)&&t(i)}});return n.observe(window.document,{childList:!0,subtree:!0}),n}(g,fe)},[fe,w.current]),n.useEffect(function(){return function(){G.current&&G.current.disconnect(),I.current=!0,"production"===process.env.NODE_ENV&&Object.values(g.current).forEach(function(e){return fe(e,!0)})}},[]),!l&&H.current.isValid&&(j.isValid=Xe(N.current,S.current)&&Ve(z.current.errors));var ge={trigger:re,setValue:n.useCallback(function(e,t,n){oe(e,t,n||{}),ae(e)&&Z(),le(e)},[oe,re]),getValues:n.useCallback(ue,[]),register:n.useCallback(function(e,t){if(!ft)if(Ye(e))pe({name:e},t);else{if(!Oe(e)||!("name"in e))return function(t){return t&&pe(t,e)};pe(e,t)}},[w.current]),unregister:n.useCallback(function(e){for(var t,n=p(Array.isArray(e)?e:[e]);!(t=n()).done;)fe(g.current[t.value],!0)},[]),formState:vt?new Proxy(j,{get:function(e,t){if("production"!==process.env.NODE_ENV&&"isValid"===t&&k&&console.warn("📋 `formState.isValid` is applicable with `onTouched`, `onChange` or `onBlur` mode. https://react-hook-form.com/api#formState"),t in e)return H.current[t]=!0,e[t]}}):j},Ce=n.useMemo(function(){return Object.assign({isFormDirty:J,updateWatchedValue:me,shouldUnregister:v,updateFormState:Z,removeFieldEventListener:de,watchInternal:ve,mode:x.current,reValidateMode:{isReValidateOnBlur:q,isReValidateOnChange:X},validateResolver:l?se:void 0,fieldsRef:g,resetFieldArrayFunctionRef:L,useWatchFieldsRef:O,useWatchRenderFunctionsRef:b,fieldArrayDefaultValuesRef:y,validFieldsRef:N,fieldsWithValidationRef:S,fieldArrayNamesRef:P,readFormStateRef:H,formStateRef:z,defaultValuesRef:w,shallowFieldsStateRef:T,fieldArrayValuesRef:h},ge)},[w.current,me,v,de,ve]);return Object.assign({watch:function(e,t){return ve(e,t)},control:Ce,handleSubmit:Ee,reset:n.useCallback(function(e,t){if(void 0===t&&(t={}),ut)for(var n=0,r=Object.values(g.current);n<r.length;n++){var i=r[n];if(i){var o=i.ref,a=i.options,l=mt(o)&&Array.isArray(a)?a[0].ref:o;if(ye(l))try{l.closest("form").reset();break}catch(e){}}}var c,u,s,d,m,f,p,E;g.current={},w.current=Object.assign({},e||w.current),e&&le(""),Object.values(L.current).forEach(function(e){return Qe(e)&&e()}),T.current=v?{}:st(e||w.current),u=(c=t).errors,s=c.isDirty,d=c.isSubmitted,m=c.touched,p=c.submitCount,E=c.dirtyFields,(f=c.isValid)||(N.current={},S.current={}),y.current={},C.current=new Set,_.current=!1,Z({submitCount:p?z.current.submitCount:0,isDirty:!!s&&z.current.isDirty,isSubmitted:!!d&&z.current.isSubmitted,isValid:!!f&&z.current.isValid,dirtyFields:E?z.current.dirtyFields:{},touched:m?z.current.touched:{},errors:u?z.current.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})},[]),clearErrors:n.useCallback(function(e){e&&(Array.isArray(e)?e:[e]).forEach(function(e){return g.current[e]&&be(e)?delete z.current.errors[e]:ze(z.current.errors,e)}),Z({errors:e?z.current.errors:{}})},[]),setError:n.useCallback(function(e,t){var n=(g.current[e]||{}).ref;we(z.current.errors,e,Object.assign(Object.assign({},t),{ref:n})),Z({isValid:!1}),t.shouldFocus&&n&&n.focus&&n.focus()},[]),errors:j.errors},ge)}({defaultValues:Digit.SessionStorage.get("AUDIT_APPLICATION_DETAIL")||{offset:0,limit:5,sortOrder:"DESC"}}),s=u.register,m=u.control,f=u.handleSubmit,v=u.setValue,E=u.getValues,g=u.reset,y=function(e){if(null==e||null==e||""==e)return"NA";var t=new Date(e),n=t.getMonth()+1,r=t.getDate();return(r=(r>9?"":"0")+r)+"/"+(n=(n>9?"":"0")+n)+"/"+t.getFullYear()},h=function(e){if(null==e||null==e||""==e)return"NA";var t=new Date(e),n=t.getHours(),r=t.getMinutes(),i=n>12?"PM":"AM";return(n=((n=n>12?n-12:n)>9?"":"0")+n)+":"+(r=(r>9?"":"0")+r)+" "+i},C=n.useState([]),O=C[0],b=C[1],S=function(e){return r.createElement("div",{onClick:e.onClick},r.createElement(t.DownloadBtnCommon,null))};n.useEffect(function(){s("offset",0),s("limit",5),s("sortOrder","DESC")},[s]),n.useEffect(function(){(null==l?void 0:l.length)>0&&b([null==l?void 0:l.map(function(e){var t={};return t[o("AUDIT_DATE_LABEL")]=y(null==e?void 0:e.timestamp),t[o("AUDIT_TIME_LABEL")]=h(null==e?void 0:e.timestamp),t[o("AUDIT_DATAVIEWED_LABEL")]=(null==e?void 0:e.dataView[0])+","+(null==e?void 0:e.dataView[1]),t[o("AUDIT_DATAVIEWED_BY_LABEL")]=null==e?void 0:e.dataViewedBy,t[o("AUDIT_ROLE_LABEL")]=null==e?void 0:e.roles.map(function(e){return e.name}).join(","),d({},t)})])},[l]);var N=n.useCallback(function(e){0!==e.length&&(v("sortBy",e.id),v("sortOrder",e.desc?"DESC":"ASC"))},[]);function w(){v("offset",E("offset")-E("limit")),f(a)()}var I=window.Digit.Utils.browser.isMobile();if(I)return r.createElement(wt,{Controller:Ot,register:s,control:m,t:o,reset:g,previousPage:w,handleSubmit:f,tenantId:i,data:l,onSubmit:a});var _=function(e){return r.createElement("span",{className:"cell-text"},e)},D=n.useMemo(function(){return[{Header:o("AUDIT_DATE_LABEL"),disableSortBy:!0,accessor:function(e){var t="NA"===e.timestamp?o("WS_NA"):y(e.timestamp);return _(""+t)}},{Header:o("AUDIT_TIME_LABEL"),disableSortBy:!0,accessor:function(e){var t="NA"===e.timestamp?o("WS_NA"):h(e.timestamp);return _(""+t)}},{Header:o(I?"AUDIT_DATAVIEWED_LABEL":"AUDIT_DATAVIEWED_PRIVACY"),disableSortBy:!0,accessor:function(e){return _(""+(null==e?void 0:e.dataView))}},{Header:o(I?"AUDIT_DATAVIEWED_BY_LABEL":"AUDIT_DATAVIEWED_BY_PRIVACY"),disableSortBy:!0,accessor:function(e){return _(""+(null==e?void 0:e.dataViewedBy))}},{Header:o("AUDIT_ROLE_LABEL"),disableSortBy:!0,accessor:function(e){var t;return _(""+(null==e||null===(t=e.roles.slice(0,3))||void 0===t?void 0:t.map(function(e){return e.name})))}}]},[]);return r.createElement(r.Fragment,null,r.createElement("div",{style:{marginRight:"-70px"}}," ",r.createElement(t.BackButton,null)," "),r.createElement("div",{style:{marginTop:"30px",marginLeft:"30px"}}," ",r.createElement(t.Header,null,o("PRIVACY_AUDIT_REPORT"))," "),r.createElement(t.SearchForm,{className:"audit-card",onSubmit:a,handleSubmit:f},r.createElement(bt,{register:s,control:m,reset:g,tenantId:i,t:o,previousPage:w})),r.createElement("div",{style:{marginTop:"240px",marginLeft:"-55%",maxWidth:"80%",marginRight:"52px"}},null!=l&&l.display?r.createElement("div",{style:{marginTop:"20x",width:"1025px",marginLeft:"25px",backgroundColor:"white",height:"60px"}},o(l.display).split("\\n").map(function(e,t){return r.createElement("p",{key:t,style:{textAlign:"center"}},e)})):""!==l?r.createElement("div",{style:{backgroundColor:"white",marginRight:"-30px",marginLeft:"30px"}},r.createElement("div",{className:"sideContent",style:{float:"right",padding:"10px 30px"}},r.createElement(S,{className:"mrlg cursorPointer",onClick:function(){return function(e){if(void 0!==(null==e?void 0:e[0]))return Digit.Download.Excel(null==e?void 0:e[0],"AuditReport")}(O)}})),r.createElement(t.Table,{t:o,data:l,totalRecords:c,columns:D,getCellProps:function(e){return{style:{minWidth:e.column.Header===o("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}},onPageSizeChange:function(e){v("limit",Number(e.target.value)),f(a)()},currentPage:E("offset")/E("limit"),onNextPage:function(){v("offset",E("offset")+E("limit")),f(a)()},onPrevPage:w,manualPagination:!1,pageSizeLimit:E("limit"),onSort:N,disableSort:!1,sortParams:[{id:E("sortBy"),desc:"DESC"===E("sortOrder")}]})):r.createElement(t.Loader,null)))},_t=function(e){var t,o,a=i.useTranslation().t,l=Digit.ULBService.getCitizenCurrentTenant(),c=n.useState({}),u=c[0],s=c[1],m=function(e,t){void 0===t&&(t="dayend");try{var n=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),r=new Date(Date.UTC(n[1],n[2]-1,n[3]));return r.setMinutes(r.getMinutes()+r.getTimezoneOffset()),"dayend"===t&&(r.setHours(r.getHours()+24),r.setSeconds(r.getSeconds()-1)),r.getTime()}catch(t){return e}};n.useEffect(function(){var e=Digit.SessionStorage.get("AUDIT_APPLICATION_DETAIL")||{};if(e){var t=d({},e);s(Object.keys(t).filter(function(e){return t[e]}).reduce(function(e,n){var r;return d({},e,((r={})[n]="object"==typeof t[n]?t[n].code:t[n],r))},{}))}},[]);var f={enabled:!!(u&&Object.keys(u).length>0)},v=d({},u),p=Digit.Hooks.useAudit({tenantId:l,filters:d({},v),config:f}),E=p.data;return r.createElement(It,{t:a,tenantId:l,onSubmit:function(e){Digit.SessionStorage.set("AUDIT_APPLICATION_DETAIL",{offset:0,limit:5,sortBy:"commencementDate",sortOrder:"DESC"});var t=d({},e,{fromDate:m(null==e?void 0:e.fromDate),toDate:m(null==e?void 0:e.toDate)});s(Object.keys(t).filter(function(e){return t[e]}).reduce(function(e,n){var r;return d({},e,((r={})[n]=t[n],r))},{}))},data:p.isLoading?"":(null==E||null===(t=E.ElasticSearchData)||void 0===t?void 0:t.length)>0?null==E?void 0:E.ElasticSearchData:{display:"ES_COMMON_NO_DATA"},count:null==E||null===(o=E.ElasticSearchData)||void 0===o?void 0:o.length})},Dt=function(e){var n,o,a,l,c,u,s,d,m,f,v,p,E,g,y,h,C=e.moduleCode,O=i.useTranslation().t,b=Digit.ULBService.getCitizenCurrentTenant(),S=Digit.Hooks.useStaticData(Digit.ULBService.getStateId()),N=S.isLoading,w=S.data,I=Digit.Hooks.useDynamicData({moduleCode:C,tenantId:b,filters:{},t:O}),_=I.error,D=I.data,T=function(e){var n=e.styles;switch(e.module){case"TL":return r.createElement(t.CaseIcon,{className:"fill-path-primary-main",styles:n});case"PT":return r.createElement(t.PTIcon,{className:"fill-path-primary-main",styles:n});case"MCOLLECT":return r.createElement(t.MCollectIcon,{className:"fill-path-primary-main",styles:n});case"PGR":return r.createElement(t.ComplaintIcon,{className:"fill-path-primary-main",styles:n});default:return r.createElement(t.CaseIcon,{className:"fill-path-primary-main",styles:n})}},L=null==w||null===(n=w.MdmsRes["common-masters"])||void 0===n||null===(o=n.StaticData[0])||void 0===o?void 0:o[""+C],R=function(e){switch(e.module){case"PT":case"WS":return r.createElement("span",{className:"timerIcon"},r.createElement(t.TimerIcon,null));default:return null}},A=function(e){switch(e.module){case"PT":return r.createElement("span",{className:"rupeeSymbol"},r.createElement(t.RupeeSymbol,null));case"WS":return r.createElement("span",{className:"timerIcon"},r.createElement(t.TimerIcon,null));default:return null}},P=function(e){switch(e){case"TL":case"PT":case"MCOLLECT":return{staticCommonContent:O("COMMON_VALIDITY"),validity:(null==L?void 0:L.validity)+O("1"===(null==L?void 0:L.validity)?"COMMON_DAY":"COMMON_DAYS")};case"PGR":return{staticCommonContent:O("ACTION_TEST_COMPLAINT_TYPES")};case"OBPS":return{staticCommonContent:O("BUILDING_PLAN_PERMIT_VALIDITY"),validity:(null==L?void 0:L.validity)+" "+O("1"===(null==L?void 0:L.validity)?"COMMON_DAY":"COMMON_DAYS")};default:return{staticCommonContent:""}}},x=function(e){switch(e){case"PT":return{staticDataOne:(null==L?void 0:L.staticDataOne)+" "+O("COMMON_DAYS"),staticDataOneHeader:O("APPLICATION_PROCESSING_TIME"),staticDataTwo:null==L?void 0:L.staticDataTwo,staticDataTwoHeader:O("APPLICATION_PROCESSING_FEE")};case"WS":return{staticDataOne:"",staticDataOneHeader:O("PAY_WATER_CHARGES_BY")+" "+(null==L?void 0:L.staticDataOne)+" "+O("COMMON_DAYS")+" "+O("OF_BILL_GEN_TO_AVOID_LATE_FEE"),staticDataTwo:(null==L?void 0:L.staticDataTwo)+" "+O("COMMON_DAYS"),staticDataTwoHeader:O("APPLICATION_PROCESSING_TIME")};default:return{}}};return N||I.isLoading?r.createElement(t.Loader,null):L?r.createElement(r.Fragment,null,L&&null!=L&&L.payViaWhatsApp?r.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},r.createElement("div",{className:"pay-whatsapp-card",onClick:function(){window.open(null==L?void 0:L.payViaWhatsApp)}},r.createElement("div",{className:"pay-whatsapp-text"},O("PAY_VIA_WHATSAPP")),r.createElement("div",{className:"whatsAppIconG"},r.createElement(t.WhatsappIconGreen,null)))):null,L&&null!=L&&L.helpline?r.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},r.createElement("div",{className:"static-home-Card"},r.createElement("div",{className:"static-home-Card-header"},O("CALL_CENTER_HELPLINE")),r.createElement("div",{className:"helplineIcon"},r.createElement(t.HelpLineIcon,null))),r.createElement("div",{className:"call-center-card-text"},null!=L&&null!==(a=L.helpline)&&void 0!==a&&a.contactOne?r.createElement("div",{className:"call-center-card-content"},r.createElement("a",{href:"tel:"+(null==L||null===(l=L.helpline)||void 0===l?void 0:l.contactOne)},null==L||null===(c=L.helpline)||void 0===c?void 0:c.contactOne)):null,null!=L&&null!==(u=L.helpline)&&void 0!==u&&u.contactTwo?r.createElement("div",{className:"call-center-card-content"},r.createElement("a",{href:"tel:"+(null==L||null===(s=L.helpline)||void 0===s?void 0:s.contactTwo)},null==L||null===(d=L.helpline)||void 0===d?void 0:d.contactTwo)):null)):null,L&&null!=L&&L.serviceCenter?r.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},r.createElement("div",{className:"static-home-Card"},r.createElement("div",{className:"static-home-Card-header"},O("CITIZEN_SERVICE_CENTER")),r.createElement("div",{className:"serviceCentrIcon"},r.createElement(t.ServiceCenterIcon,null))),r.createElement("div",{className:"service-center-details-card"},r.createElement("div",{className:"service-center-details-text"},null==L?void 0:L.serviceCenter)),null!=L&&L.viewMapLocation?r.createElement("div",{className:"link"},r.createElement("a",{href:null==L?void 0:L.viewMapLocation},O("VIEW_ON_MAP"))):null):r.createElement("div",null),r.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},_||null==D||null===(null==D?void 0:D.dynamicDataOne)?r.createElement("div",null):r.createElement("div",{className:"dynamicDataCard"},r.createElement("div",{className:"dynamicData"},r.createElement(T,{module:C,styles:{width:"24px",height:"24px"}}),r.createElement("span",{className:"dynamicData-content"},null==D?void 0:D.dynamicDataOne))),_||null==D||null===(null==D?void 0:D.dynamicDataTwo)?r.createElement("div",null):r.createElement("div",{className:"dynamicDataCard"},r.createElement("div",{className:"dynamicData"},r.createElement(T,{module:C,styles:{width:"24px",height:"24px"}}),r.createElement("span",{className:"dynamicData-content"},null==D?void 0:D.dynamicDataTwo))),L&&null!=L&&L.staticDataOne?r.createElement("div",{className:"staticDataCard"},r.createElement("div",{className:"staticData"},r.createElement(R,{module:C}),r.createElement("span",{className:"static-data-content"},r.createElement("span",{className:"static-data-content-first",style:{marginTop:""===(null===(m=x(C))||void 0===m?void 0:m.staticDataOne)?"8px":"unset"}},null===(f=x(C))||void 0===f?void 0:f.staticDataOneHeader),r.createElement("span",{className:"static-data-content-second"},""+(null===(v=x(C))||void 0===v?void 0:v.staticDataOne))))):r.createElement("div",null),L&&null!=L&&L.staticDataTwo?r.createElement("div",{className:"staticDataCard"},r.createElement("div",{className:"staticData"},r.createElement(A,{module:C}),r.createElement("span",{className:"static-data-content"},r.createElement("span",{className:"static-data-content-first"},null===(p=x(C))||void 0===p?void 0:p.staticDataTwoHeader),r.createElement("span",{className:"static-data-content-second"},null===(E=x(C))||void 0===E?void 0:E.staticDataTwo)))):r.createElement("div",null),L&&null!=L&&L.validity?r.createElement("div",{className:"staticDataCard"},r.createElement("div",{className:"staticData"},r.createElement("span",{className:"validityIcon"},r.createElement(t.ValidityTimeIcon,null)),r.createElement("span",{className:"static-data-content"},r.createElement("span",{className:"static-data-content-first"},null===(g=P(C))||void 0===g?void 0:g.staticCommonContent),r.createElement("span",{className:"static-data-content-second"},null===(y=P(C))||void 0===y?void 0:y.validity)))):r.createElement("div",null),_||null==D||null==D||!D.staticData||null===(null==D?void 0:D.staticData)?r.createElement("div",null):r.createElement("div",{className:"staticDataCard"},r.createElement("div",{className:"staticData"},"PGR"===C?r.createElement(T,{module:C,styles:{width:"24px",height:"24px",marginLeft:"13px",marginTop:"12px"}}):r.createElement("span",{className:"validityIcon"},r.createElement(t.ValidityTimeIcon,null)),r.createElement("span",{className:"static-data-content"},r.createElement("span",{className:"static-data-content-first"},null===(h=P(C))||void 0===h?void 0:h.staticCommonContent),r.createElement("span",{className:"static-data-content-second"},null==D?void 0:D.staticData)))))):r.createElement(r.Fragment,null)},Tt=[(null===(Et=window)||void 0===Et?void 0:Et.contextPath)+"/citizen/register/name","/"+(null===(gt=window)||void 0===gt?void 0:gt.contextPath)+"/citizen/select-language","/"+(null===(yt=window)||void 0===yt?void 0:yt.contextPath)+"/citizen/select-location","/"+(null===(ht=window)||void 0===ht?void 0:ht.contextPath)+"/citizen/login","/"+(null===(Ct=window)||void 0===Ct?void 0:Ct.contextPath)+"/citizen/register/otp"],Lt=function(e,t){return t.filter(function(t){return e.map(function(e){return e.code}).includes(t.code)})},Rt=function(e){var n,o,a,c=e.stateInfo,u=e.userDetails,s=e.CITIZEN,d=e.cityDetails,m=e.mobileView,f=e.handleUserDropdownSelection,v=e.logoUrl,p=e.stateCode,E=e.modules,y=e.appTenants,O=e.pathname,b=e.initData,N=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"ACCESSCONTROL-ACTIONS-TEST",[{name:"actions-test",filter:"[?(@.url == '"+window.contextPath+"-card')]"}],{select:function(e){var t,n;return null==e||null===(t=e["ACCESSCONTROL-ACTIONS-TEST"])||void 0===t||null===(n=t["actions-test"])||void 0===n?void 0:n.filter(function(e){return!0===e.enabled}).reduce(function(e,t){var n;return e[t.parentModule]=(null===(n=e[t.parentModule])||void 0===n?void 0:n.length)>0?[t].concat(e[t.parentModule]):[t],e},{})}}),w=N.isLoading,I=N.data,_=N.isFetched,D=Digit.Hooks.useRouteSubscription(O),T=i.useTranslation().t,L=l.useRouteMatch().path,R=l.useHistory(),A=Tt.some(function(e){return window.location.href.includes(e)}),P=E.map(function(e,t){var n=e.code,i=e.tenants,o=Digit.ComponentRegistryService.getComponent(n+"Module");return o?r.createElement(l.Route,{key:t,path:L+"/"+n.toLowerCase()},r.createElement(o,{stateCode:p,moduleCode:n,userType:"citizen",tenants:Lt(i,y)})):null}),x=E.map(function(e,n){var i=e.code,o=e.bannerImage,a=(Digit.ComponentRegistryService.getComponent(i+"Links"),_?C(I,i,T):void 0);return"ACTION_TEST_WS"===(null==a?void 0:a.header)&&(null==a||a.links.sort(function(e,t){return t.orderNumber-e.orderNumber})),r.createElement(r.Fragment,null,r.createElement(l.Route,{key:n,path:L+"/"+i.toLowerCase()+"-home"},r.createElement("div",{className:"moduleLinkHomePage"},r.createElement("img",{src:o||(null==c?void 0:c.bannerUrl),alt:"noimagefound"}),r.createElement(t.BackButton,{className:"moduleLinkHomePageBackButton"}),r.createElement("h1",null,T("MODULE_"+i.toUpperCase())),r.createElement("div",{className:"moduleLinkHomePageModuleLinks"},a&&r.createElement(t.CitizenHomeCard,{header:T(null==a?void 0:a.header),links:null==a?void 0:a.links,Icon:function(){return r.createElement("span",null)},Info:"OBPS"===i?function(){return r.createElement(t.CitizenInfoLabel,{style:{margin:"0px",padding:"10px"},info:T("CS_FILE_APPLICATION_INFO_LABEL"),text:T("BPA_CITIZEN_HOME_STAKEHOLDER_INCLUDES_INFO_LABEL")})}:null,isInfo:"OBPS"===i})),r.createElement(Dt,{moduleCode:null==i?void 0:i.toUpperCase()}))),r.createElement(l.Route,{key:"faq"+n,path:L+"/"+i.toLowerCase()+"-faq"},r.createElement(X,{module:null==i?void 0:i.toUpperCase()})),r.createElement(l.Route,{key:"hiw"+n,path:L+"/"+i.toLowerCase()+"-how-it-works"},r.createElement(ae,{module:null==i?void 0:i.toUpperCase()})))});return r.createElement("div",{className:D},r.createElement(W,{t:T,stateInfo:c,userDetails:u,CITIZEN:s,cityDetails:d,mobileView:m,handleUserDropdownSelection:f,logoUrl:v,showSidebar:!0,linkData:I,islinkDataLoading:w}),r.createElement("div",{className:"main center-container citizen-home-container mb-25"},A?null:r.createElement("div",{className:"SideBarStatic"},r.createElement(U,{linkData:I,islinkDataLoading:w})),r.createElement(l.Switch,null,r.createElement(l.Route,{exact:!0,path:L},r.createElement(Z,null)),r.createElement(l.Route,{exact:!0,path:L+"/select-language"},r.createElement(Y,null)),r.createElement(l.Route,{exact:!0,path:L+"/select-location"},r.createElement(K,null)),r.createElement(l.Route,{path:L+"/error"},r.createElement(g,{initData:b,goToHome:function(){var e;R.push("/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/citizen")}})),r.createElement(l.Route,{path:L+"/all-services"},r.createElement(S,{userType:"citizen",modules:E,getCitizenMenu:I,fetchedCitizen:_,isLoading:w})),r.createElement(l.Route,{path:L+"/login"},r.createElement(ge,{stateCode:p})),r.createElement(l.Route,{path:L+"/register"},r.createElement(ge,{stateCode:p,isUserRegistered:!1})),r.createElement(l.Route,{path:L+"/user/profile"},r.createElement(oe,{stateCode:p,userType:"citizen",cityDetails:d})),r.createElement(l.Route,{path:L+"/Audit"},r.createElement(_t,null)),r.createElement(h,{initData:b},P,x))),r.createElement("div",{className:"citizen-home-footer",style:window.location.href.includes("citizen/obps")?{zIndex:"-1"}:{}},r.createElement("img",{alt:"Powered by DIGIT",src:null===(n=window)||void 0===n||null===(o=n.globalConfigs)||void 0===o||null===(a=o.getConfig)||void 0===a?void 0:a.call(o,"DIGIT_FOOTER"),style:{height:"1.2em",cursor:"pointer"},onClick:function(){var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})))};function At(e,t){return e(t={exports:{}},t.exports),t.exports}var Pt="function"==typeof Symbol&&Symbol.for,xt=Pt?Symbol.for("react.element"):60103,Mt=Pt?Symbol.for("react.portal"):60106,kt=Pt?Symbol.for("react.fragment"):60107,Ut=Pt?Symbol.for("react.strict_mode"):60108,Bt=Pt?Symbol.for("react.profiler"):60114,Ft=Pt?Symbol.for("react.provider"):60109,jt=Pt?Symbol.for("react.context"):60110,Vt=Pt?Symbol.for("react.async_mode"):60111,Ht=Pt?Symbol.for("react.concurrent_mode"):60111,zt=Pt?Symbol.for("react.forward_ref"):60112,Gt=Pt?Symbol.for("react.suspense"):60113,Wt=Pt?Symbol.for("react.suspense_list"):60120,qt=Pt?Symbol.for("react.memo"):60115,Xt=Pt?Symbol.for("react.lazy"):60116,Zt=Pt?Symbol.for("react.block"):60121,Yt=Pt?Symbol.for("react.fundamental"):60117,Kt=Pt?Symbol.for("react.responder"):60118,$t=Pt?Symbol.for("react.scope"):60119;function Jt(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case xt:switch(e=e.type){case Vt:case Ht:case kt:case Bt:case Ut:case Gt:return e;default:switch(e=e&&e.$$typeof){case jt:case zt:case Xt:case qt:case Ft:return e;default:return t}}case Mt:return t}}}function Qt(e){return Jt(e)===Ht}var en={AsyncMode:Vt,ConcurrentMode:Ht,ContextConsumer:jt,ContextProvider:Ft,Element:xt,ForwardRef:zt,Fragment:kt,Lazy:Xt,Memo:qt,Portal:Mt,Profiler:Bt,StrictMode:Ut,Suspense:Gt,isAsyncMode:function(e){return Qt(e)||Jt(e)===Vt},isConcurrentMode:Qt,isContextConsumer:function(e){return Jt(e)===jt},isContextProvider:function(e){return Jt(e)===Ft},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===xt},isForwardRef:function(e){return Jt(e)===zt},isFragment:function(e){return Jt(e)===kt},isLazy:function(e){return Jt(e)===Xt},isMemo:function(e){return Jt(e)===qt},isPortal:function(e){return Jt(e)===Mt},isProfiler:function(e){return Jt(e)===Bt},isStrictMode:function(e){return Jt(e)===Ut},isSuspense:function(e){return Jt(e)===Gt},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===kt||e===Ht||e===Bt||e===Ut||e===Gt||e===Wt||"object"==typeof e&&null!==e&&(e.$$typeof===Xt||e.$$typeof===qt||e.$$typeof===Ft||e.$$typeof===jt||e.$$typeof===zt||e.$$typeof===Yt||e.$$typeof===Kt||e.$$typeof===$t||e.$$typeof===Zt)},typeOf:Jt},tn=At(function(e,t){"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,i=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,s=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,m=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,v=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,E=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,h=e?Symbol.for("react.scope"):60119;function C(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:var f=e.type;switch(f){case u:case s:case i:case a:case o:case m:return f;default:var E=f&&f.$$typeof;switch(E){case c:case d:case p:case v:case l:return E;default:return t}}case r:return t}}}var O=s,b=c,S=l,N=n,w=d,I=i,_=p,D=v,T=r,L=a,R=o,A=m,P=!1;function x(e){return C(e)===s}t.AsyncMode=u,t.ConcurrentMode=O,t.ContextConsumer=b,t.ContextProvider=S,t.Element=N,t.ForwardRef=w,t.Fragment=I,t.Lazy=_,t.Memo=D,t.Portal=T,t.Profiler=L,t.StrictMode=R,t.Suspense=A,t.isAsyncMode=function(e){return P||(P=!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.")),x(e)||C(e)===u},t.isConcurrentMode=x,t.isContextConsumer=function(e){return C(e)===c},t.isContextProvider=function(e){return C(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return C(e)===d},t.isFragment=function(e){return C(e)===i},t.isLazy=function(e){return C(e)===p},t.isMemo=function(e){return C(e)===v},t.isPortal=function(e){return C(e)===r},t.isProfiler=function(e){return C(e)===a},t.isStrictMode=function(e){return C(e)===o},t.isSuspense=function(e){return C(e)===m},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===s||e===a||e===o||e===m||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===v||e.$$typeof===l||e.$$typeof===c||e.$$typeof===d||e.$$typeof===g||e.$$typeof===y||e.$$typeof===h||e.$$typeof===E)},t.typeOf=C}()}),nn=At(function(e){e.exports="production"===process.env.NODE_ENV?en:tn}),rn=Object.getOwnPropertySymbols,on=Object.prototype.hasOwnProperty,an=Object.prototype.propertyIsEnumerable;function ln(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var cn=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 t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,r,i=ln(e),o=1;o<arguments.length;o++){for(var a in n=Object(arguments[o]))on.call(n,a)&&(i[a]=n[a]);if(rn){r=rn(n);for(var l=0;l<r.length;l++)an.call(n,r[l])&&(i[r[l]]=n[r[l]])}}return i},un="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",sn=Function.call.bind(Object.prototype.hasOwnProperty),dn=function(){};if("production"!==process.env.NODE_ENV){var mn=un,fn={},vn=sn;dn=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function pn(e,t,n,r,i){if("production"!==process.env.NODE_ENV)for(var o in e)if(vn(e,o)){var a;try{if("function"!=typeof e[o]){var l=Error((r||"React class")+": "+n+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw l.name="Invariant Violation",l}a=e[o](t,o,r,n,null,mn)}catch(e){a=e}if(!a||a instanceof Error||dn((r||"React class")+": type specification of "+n+" `"+o+"` 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 fn)){fn[a.message]=!0;var c=i?i():"";dn("Failed "+n+" type: "+a.message+(null!=c?c:""))}}}pn.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(fn={})};var En=pn,gn=function(){};function yn(){return null}function hn(){}function Cn(){}"production"!==process.env.NODE_ENV&&(gn=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),Cn.resetWarningCache=hn;var On=At(function(e){e.exports="production"!==process.env.NODE_ENV?function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,r={array:l("array"),bigint:l("bigint"),bool:l("boolean"),func:l("function"),number:l("number"),object:l("object"),string:l("string"),symbol:l("symbol"),any:a(yn),arrayOf:function(e){return a(function(t,n,r,i,a){if("function"!=typeof e)return new o("Property `"+a+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var l=t[n];if(!Array.isArray(l))return new o("Invalid "+i+" `"+a+"` of type `"+s(l)+"` supplied to `"+r+"`, expected an array.");for(var c=0;c<l.length;c++){var u=e(l,c,r,i,a+"["+c+"]",un);if(u instanceof Error)return u}return null})},element:a(function(t,n,r,i,a){var l=t[n];return e(l)?null:new o("Invalid "+i+" `"+a+"` of type `"+s(l)+"` supplied to `"+r+"`, expected a single ReactElement.")}),elementType:a(function(e,t,n,r,i){var a=e[t];return nn.isValidElementType(a)?null:new o("Invalid "+r+" `"+i+"` of type `"+s(a)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return a(function(t,n,r,i,a){var l;return t[n]instanceof e?null:new o("Invalid "+i+" `"+a+"` of type `"+((l=t[n]).constructor&&l.constructor.name?l.constructor.name:"<<anonymous>>")+"` supplied to `"+r+"`, expected instance of `"+(e.name||"<<anonymous>>")+"`.")})},node:a(function(e,t,n,r,i){return u(e[t])?null:new o("Invalid "+r+" `"+i+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return a(function(t,n,r,i,a){if("function"!=typeof e)return new o("Property `"+a+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var l=t[n],c=s(l);if("object"!==c)return new o("Invalid "+i+" `"+a+"` of type `"+c+"` supplied to `"+r+"`, expected an object.");for(var u in l)if(sn(l,u)){var d=e(l,u,r,i,a+"."+u,un);if(d instanceof Error)return d}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&gn(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."),yn;function t(t,n,r,a,l){for(var c=t[n],u=0;u<e.length;u++)if(i(c,e[u]))return null;var s=JSON.stringify(e,function(e,t){return"symbol"===d(t)?String(t):t});return new o("Invalid "+a+" `"+l+"` of value `"+String(c)+"` supplied to `"+r+"`, expected one of "+s+".")}return a(t)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&gn("Invalid argument supplied to oneOfType, expected an instance of array."),yn;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return gn("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+m(n)+" at index "+t+"."),yn}return a(function(t,n,r,i,a){for(var l=[],c=0;c<e.length;c++){var u=(0,e[c])(t,n,r,i,a,un);if(null==u)return null;u.data&&sn(u.data,"expectedType")&&l.push(u.data.expectedType)}return new o("Invalid "+i+" `"+a+"` supplied to `"+r+"`"+(l.length>0?", expected one of type ["+l.join(", ")+"]":"")+".")})},shape:function(e){return a(function(t,n,r,i,a){var l=t[n],u=s(l);if("object"!==u)return new o("Invalid "+i+" `"+a+"` of type `"+u+"` supplied to `"+r+"`, expected `object`.");for(var m in e){var f=e[m];if("function"!=typeof f)return c(r,i,a,m,d(f));var v=f(l,m,r,i,a+"."+m,un);if(v)return v}return null})},exact:function(e){return a(function(t,n,r,i,a){var l=t[n],u=s(l);if("object"!==u)return new o("Invalid "+i+" `"+a+"` of type `"+u+"` supplied to `"+r+"`, expected `object`.");var m=cn({},t[n],e);for(var f in m){var v=e[f];if(sn(e,f)&&"function"!=typeof v)return c(r,i,a,f,d(v));if(!v)return new o("Invalid "+i+" `"+a+"` key `"+f+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var p=v(l,f,r,i,a+"."+f,un);if(p)return p}return null})}};function i(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function o(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function a(e){function t(t,n,r,i,a,l,c){if(i=i||"<<anonymous>>",l=l||r,c!==un){var u=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 u.name="Invariant Violation",u}return null==n[r]?t?new o(null===n[r]?"The "+a+" `"+l+"` is marked as required in `"+i+"`, but its value is `null`.":"The "+a+" `"+l+"` is marked as required in `"+i+"`, but its value is `undefined`."):null:e(n,r,i,a,l)}process;var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function l(e){return a(function(t,n,r,i,a,l){var c=t[n];return s(c)!==e?new o("Invalid "+i+" `"+a+"` of type `"+d(c)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null})}function c(e,t,n,r,i){return new o((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+i+"`.")}function u(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(u);if(null===t||e(t))return!0;var r=function(e){var t=e&&(n&&e[n]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!r)return!1;var i,o=r.call(t);if(r!==t.entries){for(;!(i=o.next()).done;)if(!u(i.value))return!1}else for(;!(i=o.next()).done;){var a=i.value;if(a&&!u(a[1]))return!1}return!0;default:return!1}}function s(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function d(e){if(null==e)return""+e;var t=s(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function m(e){var t=d(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return o.prototype=Error.prototype,r.checkPropTypes=En,r.resetWarningCache=En.resetWarningCache,r.PropTypes=r,r}(nn.isElement):function(){function e(e,t,n,r,i,o){if(o!==un){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 t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Cn,resetWarningCache:hn};return n.PropTypes=n,n}()}),bn=function(e){return r.createElement("div",{className:"banner banner-container"},e.children)},Sn=function(){var e=Digit.Hooks.useStore.getInitData(),n=e.isLoading,o=(e.data||{}).stateInfo,a=i.useTranslation().t;return n?r.createElement(t.Loader,null):r.createElement("div",{className:"bannerHeader"},r.createElement("img",{className:"bannerLogo",src:null==o?void 0:o.logoUrl}),r.createElement("p",null,a("TENANT_TENANTS_"+(null==o?void 0:o.code.toUpperCase()))))},Nn=function(e){var i,o,a,c=e.config,u=e.t,s=n.useState(null)[0],m=Digit.Hooks.useQueryParams(),f=m.mobile_number,v=m.tenantId,p=l.useHistory(),E=n.useState(""),g=E[0],y=E[1],h=n.useState(!0)[0],C=n.useState(null),O=C[0],b=C[1],S=function(){return Digit.UserService.getType()};n.useEffect(function(){var e,t;if(s){Digit.UserService.setUser(s);var n=(null===(e=location.state)||void 0===e?void 0:e.from)||"/"+(null===(t=window)||void 0===t?void 0:t.contextPath)+"/employee";p.replace(n)}else Digit.UserService.setType("employee")},[s]);var N=function(){b(null)},w=c.inputs,I=w[0],_=w[1],D=w[2],T=[{body:[{label:u(I.label),type:I.type,populators:{name:I.name},isMandatory:!0},{label:u(_.label),type:_.type,populators:{name:_.name},isMandatory:!0},{label:u(D.label),type:D.type,populators:{name:D.name},isMandatory:!0}]}];return r.createElement(bn,null,r.createElement("div",{className:"employeeBackbuttonAlign"},r.createElement(t.BackButton,{variant:"white",style:{borderBottom:"none"}})),r.createElement(t.FormComposer,{onSubmit:function(e){try{return Promise.resolve(ne(function(){if(e.newPassword!==e.confirmPassword)return b(u("ERR_PASSWORD_DO_NOT_MATCH"));var t=d({},e,{otpReference:g,tenantId:v,type:S().toUpperCase()});return Promise.resolve(Digit.UserService.changePassword(t,v)).then(function(e){!function(){var e;p.replace("/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/employee/user/login")}()})},function(e){var t,n,r,i,o;b((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(r=n.error)||void 0===r||null===(i=r.fields)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.message)||u("ES_SOMETHING_WRONG")),setTimeout(N,5e3)}))}catch(e){return Promise.reject(e)}},noBoxShadow:!0,inline:!0,submitInForm:!0,config:T,label:c.texts.submitButtonLabel,cardStyle:{maxWidth:"408px",margin:"auto"},className:"employeeChangePassword"},r.createElement(Sn,null),r.createElement(t.CardSubHeader,{style:{textAlign:"center"}}," ",c.texts.header," "),r.createElement(t.CardText,null,u("CS_LOGIN_OTP_TEXT")+" ",r.createElement("b",null," ",""+u("+ 91 - ")," ",f)),r.createElement(se,{t:u,userType:"employee",otp:g,onOtpChange:y,error:h,onResend:function(){try{var e=function(){setTimeout(N,5e3)},t={otp:{mobileNumber:f,userType:S().toUpperCase(),type:"passwordreset",tenantId:v}},n=ne(function(){return Promise.resolve(Digit.UserService.sendOtp(t,v)).then(function(){b(u("ES_OTP_RESEND"))})},function(e){var t,n;b((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error_description)||u("ES_INVALID_LOGIN_CREDENTIALS"))});return Promise.resolve(n&&n.then?n.then(e):e())}catch(e){return Promise.reject(e)}}})),O&&r.createElement(t.Toast,{error:!0,label:u(O),onClose:N}),r.createElement("div",{className:"EmployeeLoginFooter"},r.createElement("img",{alt:"Powered by DIGIT",src:null===(i=window)||void 0===i||null===(o=i.globalConfigs)||void 0===o||null===(a=o.getConfig)||void 0===a?void 0:a.call(o,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:function(){var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})," "))};Nn.propTypes={loginParams:On.any},Nn.defaultProps={loginParams:null};var wn=[{texts:{header:"CORE_COMMON_RESET_PASSWORD_LABEL",submitButtonLabel:"CORE_COMMON_CHANGE_PASSWORD"},inputs:[{label:"CORE_LOGIN_USERNAME",type:"text",name:"userName",error:"ERR_HRMS_INVALID_USERNAME"},{label:"CORE_LOGIN_NEW_PASSWORD",type:"password",name:"newPassword",error:"CORE_COMMON_REQUIRED_ERRMSG"},{label:"CORE_LOGIN_CONFIRM_NEW_PASSWORD",type:"password",name:"confirmPassword",error:"CORE_COMMON_REQUIRED_ERRMSG"}]}],In=function(){var e=i.useTranslation().t,t=l.useRouteMatch().path,o=n.useMemo(function(){return wn.map(function(t){var n={};for(var r in t.texts)n[r]=e(t.texts[r]);return d({},t,{texts:n})},[wn])});return r.createElement(l.Switch,null,r.createElement(l.Route,{path:""+t,exact:!0},r.createElement(Nn,{config:o[0],t:e})))},_n=[{texts:{header:"CORE_COMMON_FORGOT_PASSWORD_LABEL",description:"ES_FORGOT_PASSWORD_DESC",submitButtonLabel:"CORE_COMMON_CONTINUE"},inputs:[{label:"CORE_COMMON_MOBILE_NUMBER",type:"text",name:"mobileNumber",error:"ERR_HRMS_INVALID_MOBILE_NUMBER"},{label:"CORE_COMMON_CITY",type:"custom",name:"city",error:"ERR_HRMS_INVALID_CITY"}]}],Dn=function(e){var i,o,a,c=e.config,u=e.t,s=Digit.Hooks.useTenants(),m=s.data,f=s.isLoading,v=n.useState(null)[0],p=l.useHistory(),E=n.useState(null),g=E[0],y=E[1];n.useEffect(function(){var e,t;if(v){Digit.UserService.setUser(v);var n=(null===(e=location.state)||void 0===e?void 0:e.from)||"/"+(null===(t=window)||void 0===t?void 0:t.contextPath)+"/employee";p.replace(n)}else Digit.UserService.setType("employee")},[v]);var h=function(){y(null)},C=c.inputs,O=C[0],b=C[1],S=[{body:[{label:u(O.label),type:O.type,populators:{name:O.name,componentInFront:"+91"},isMandatory:!0},{label:u(b.label),type:b.type,populators:{name:b.name,customProps:{},component:function(e,n){return r.createElement(t.Dropdown,d({option:m,optionKey:"name",id:b.name,className:"login-city-dd",select:function(t){e.onChange(t)}},n))}},isMandatory:!0}]}];return f?r.createElement(t.Loader,null):r.createElement(bn,null,r.createElement("div",{className:"employeeBackbuttonAlign"},r.createElement(t.BackButton,{variant:"white",style:{borderBottom:"none"}})),r.createElement(t.FormComposer,{onSubmit:function(e){try{if(!e.city)return alert("Please Select City!"),Promise.resolve();var t={otp:{mobileNumber:e.mobileNumber,userType:Digit.UserService.getType().toUpperCase(),type:"passwordreset",tenantId:e.city.code}},n=ne(function(){return Promise.resolve(Digit.UserService.sendOtp(t,e.city.code)).then(function(){var t;p.push("/"+(null===(t=window)||void 0===t?void 0:t.contextPath)+"/employee/user/change-password?mobile_number="+e.mobileNumber+"&tenantId="+e.city.code)})},function(e){var t,n,r,i,o;y((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(r=n.error)||void 0===r||null===(i=r.fields)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.message)||"Invalid login credentials!"),setTimeout(h,5e3)});return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},noBoxShadow:!0,inline:!0,submitInForm:!0,config:S,label:c.texts.submitButtonLabel,secondaryActionLabel:c.texts.secondaryButtonLabel,onSecondayActionClick:function(){var e;p.replace("/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/employee/login")},heading:c.texts.header,description:c.texts.description,headingStyle:{textAlign:"center"},cardStyle:{maxWidth:"408px",margin:"auto"},className:"employeeForgotPassword"},r.createElement(Sn,null)),g&&r.createElement(t.Toast,{error:!0,label:u(g),onClose:h}),r.createElement("div",{className:"EmployeeLoginFooter"},r.createElement("img",{alt:"Powered by DIGIT",src:null===(i=window)||void 0===i||null===(o=i.globalConfigs)||void 0===o||null===(a=o.getConfig)||void 0===a?void 0:a.call(o,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:function(){var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})," "))};Dn.propTypes={loginParams:On.any},Dn.defaultProps={loginParams:null};var Tn=function(){var e=i.useTranslation().t,t=l.useRouteMatch().path,o=n.useMemo(function(){return _n.map(function(t){var n={};for(var r in t.texts)n[r]=e(t.texts[r]);return d({},t,{texts:n})},[_n])});return r.createElement(l.Switch,null,r.createElement(l.Route,{path:""+t,exact:!0},r.createElement(Dn,{config:o[0],t:e})))},Ln=function(e,t){return t.filter(function(t){var n;return null==e||null===(n=e.map)||void 0===n?void 0:n.call(e,function(e){return e.code}).includes(t.code)})},Rn=function(e){var t,n,i=e.stateCode,o=e.userType,a=e.modules,c=e.appTenants,u=(Digit,l.useRouteMatch().path),s=l.useLocation(),d=Digit.UserService.getUser();if(!d||null==d||!d.access_token||null==d||!d.info)return r.createElement(l.Redirect,{to:{pathname:"/"+(null===(n=window)||void 0===n?void 0:n.contextPath)+"/employee/user/login",state:{from:s.pathname+s.search}}});var m=a.map(function(e,t){var n,a=e.code,d=e.tenants,m=Digit.ComponentRegistryService.getComponent(a+"Module");return r.createElement(l.Route,{key:t,path:u+"/"+a.toLowerCase()},m?r.createElement(m,{stateCode:i,moduleCode:a,userType:o,tenants:Ln(d,c)}):r.createElement(l.Redirect,{to:{pathname:"/"+(null===(n=window)||void 0===n?void 0:n.contextPath)+"/employee/user/error?type=notfound",state:{from:s.pathname+s.search}}}))});return r.createElement("div",{className:"ground-container"},r.createElement(l.Switch,null,m,r.createElement(l.Route,{path:u+"/login"},r.createElement(l.Redirect,{to:{pathname:"/"+(null===(t=window)||void 0===t?void 0:t.contextPath)+"/employee/user/login",state:{from:s.pathname+s.search}}})),r.createElement(l.Route,{path:u+"/forgot-password"},r.createElement(Tn,null)),r.createElement(l.Route,{path:u+"/change-password"},r.createElement(In,null)),r.createElement(l.Route,null,r.createElement(S,{userType:o,modules:a}))))},An=function(){var e,o,a,c=Digit.Hooks.useStore.getInitData(),u=c.data,s=c.isLoading,d=i.useTranslation().t,m=l.useHistory(),f=u||{},v=f.languages,p=f.stateInfo,E=Digit.StoreData.getCurrentLanguage(),g=n.useState(E),y=g[0],h=g[1];return s?null:r.createElement(bn,null,r.createElement(t.Card,{className:"bannerCard removeBottomMargin"},r.createElement("div",{className:"bannerHeader"},r.createElement("img",{className:"bannerLogo",src:null==p?void 0:p.logoUrl,alt:"Digit"}),r.createElement("p",null,d("TENANT_TENANTS_"+(null==p?void 0:p.code.toUpperCase())))),r.createElement("div",{className:"language-selector",style:{justifyContent:"space-around",marginBottom:"24px",padding:"0 5%"}},v.map(function(e,n){return r.createElement("div",{className:"language-button-container",key:n},r.createElement(t.CustomButton,{selected:e.value===y,text:e.label,onClick:function(){return function(e){h(e.value),Digit.LocalizationService.changeLanguage(e.value,p.code)}(e)}}))})),r.createElement(t.SubmitBar,{style:{width:"100%"},label:d("CORE_COMMON_CONTINUE"),onSubmit:function(e){var t;m.push("/"+(null===(t=window)||void 0===t?void 0:t.contextPath)+"/employee/user/login")}})),r.createElement("div",{className:"EmployeeLoginFooter"},r.createElement("img",{alt:"Powered by DIGIT",src:null===(e=window)||void 0===e||null===(o=e.globalConfigs)||void 0===o||null===(a=o.getConfig)||void 0===a?void 0:a.call(o,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:function(){var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})," "))},Pn=[{texts:{header:"CORE_COMMON_LOGIN",submitButtonLabel:"CORE_COMMON_CONTINUE",secondaryButtonLabel:"CORE_COMMON_FORGOT_PASSWORD"},inputs:[{label:"CORE_LOGIN_USERNAME",type:"text",name:"username",error:"ERR_HRMS_INVALID_USER_ID"},{label:"CORE_LOGIN_PASSWORD",type:"password",name:"password",error:"ERR_HRMS_WRONG_PASSWORD"},{label:"CORE_COMMON_CITY",type:"custom",name:"city",error:"ERR_HRMS_INVALID_CITY"}]}],xn=["UserRequest"],Mn=function(e){var i,o,a,c=e.config,u=e.t,s=e.isDisabled,m=Digit.Hooks.useTenants(),v=m.data,p=m.isLoading,E=Digit.Hooks.useStore.getInitData().isLoading,g=n.useState(null),y=g[0],h=g[1],C=n.useState(null),O=C[0],b=C[1],S=n.useState(!1),N=S[0],w=S[1],I=l.useHistory();n.useEffect(function(){var e,t,n,r,i,o,a,l,c,u,s,d,m,f;if(y){Digit.SessionStorage.set("citizen.userRequestObject",y);var v,p,E,g,h=null==y||null===(e=y.info)||void 0===e||null===(t=e.roles)||void 0===t?void 0:t.filter(function(e){return e.tenantId===Digit.SessionStorage.get("Employee.tenantId")});(null==y||null===(n=y.info)||void 0===n||null===(r=n.roles)||void 0===r?void 0:r.length)>0&&(y.info.roles=h),Digit.UserService.setUser(y),v=null==y?void 0:y.info,p=null==y?void 0:y.access_token,g=(null===(E=JSON.parse(sessionStorage.getItem("Digit.locale")))||void 0===E?void 0:E.value)||"en_IN",localStorage.setItem("Employee.tenant-id",null==v?void 0:v.tenantId),localStorage.setItem("tenant-id",null==v?void 0:v.tenantId),localStorage.setItem("citizen.userRequestObject",JSON.stringify(v)),localStorage.setItem("locale",g),localStorage.setItem("Employee.locale",g),localStorage.setItem("token",p),localStorage.setItem("Employee.token",p),localStorage.setItem("user-info",JSON.stringify(v)),localStorage.setItem("Employee.user-info",JSON.stringify(v));var C,O,b,S,N,w,_,D="/"+(null===(i=window)||void 0===i?void 0:i.contextPath)+"/employee";null!==(o=window)&&void 0!==o&&null!==(a=o.location)&&void 0!==a&&null!==(l=a.href)&&void 0!==l&&l.includes("from=")&&(D=decodeURIComponent(null===(C=window)||void 0===C||null===(O=C.location)||void 0===O||null===(b=O.href)||void 0===b||null===(S=b.split("from="))||void 0===S?void 0:S[1])||"/"+(null===(N=window)||void 0===N?void 0:N.contextPath)+"/employee"),null!=y&&null!==(c=y.info)&&void 0!==c&&c.roles&&null!=y&&null!==(u=y.info)&&void 0!==u&&null!==(s=u.roles)&&void 0!==s&&s.every(function(e){return"NATADMIN"===e.code})&&(D="/"+(null===(w=window)||void 0===w?void 0:w.contextPath)+"/employee/dss/landing/NURT_DASHBOARD"),null!=y&&null!==(d=y.info)&&void 0!==d&&d.roles&&null!=y&&null!==(m=y.info)&&void 0!==m&&null!==(f=m.roles)&&void 0!==f&&f.every(function(e){return"STADMIN"===e.code})&&(D="/"+(null===(_=window)||void 0===_?void 0:_.contextPath)+"/employee/dss/landing/home"),I.replace(D)}},[y]);var _=function(){b(null)},D=c.inputs,T=D[0],L=D[1],R=D[2],A=[{body:[{label:u(T.label),type:T.type,populators:{name:T.name},isMandatory:!0},{label:u(L.label),type:L.type,populators:{name:L.name},isMandatory:!0},{label:u(R.label),type:R.type,populators:{name:R.name,customProps:{},component:function(e,n){return r.createElement(t.Dropdown,d({option:v,className:"login-city-dd",optionKey:"i18nKey",select:function(t){e.onChange(t)},t:u},n))}},isMandatory:!0}]}];return p||E?r.createElement(t.Loader,null):r.createElement(bn,null,r.createElement("div",{className:"employeeBackbuttonAlign"},r.createElement(t.BackButton,{variant:"white",style:{borderBottom:"none"}})),r.createElement(t.FormComposer,{onSubmit:function(e){try{var t=function(){w(!1)};if(!e.city)return alert("Please Select City!"),Promise.resolve();w(!0);var n=d({},e,{userType:"EMPLOYEE"});n.tenantId=e.city.code,delete n.city;var r=ne(function(){return Promise.resolve(Digit.UserService.authenticate(n)).then(function(e){var t=e.UserRequest,n=f(e,xn);Digit.SessionStorage.set("Employee.tenantId",null==t?void 0:t.tenantId),h(d({info:t},n))})},function(e){var t,n;b((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error_description)||"ES_ERROR_USER_NOT_PERMITTED"==(null==e?void 0:e.message)&&u("ES_ERROR_USER_NOT_PERMITTED")||u("INVALID_LOGIN_CREDENTIALS")),setTimeout(_,5e3)});return Promise.resolve(r&&r.then?r.then(t):t())}catch(e){return Promise.reject(e)}},isDisabled:s||N,noBoxShadow:!0,inline:!0,submitInForm:!0,config:A,label:c.texts.submitButtonLabel,secondaryActionLabel:c.texts.secondaryButtonLabel,onSecondayActionClick:function(){var e;I.push("/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/employee/user/forgot-password")},heading:c.texts.header,headingStyle:{textAlign:"center"},cardStyle:{margin:"auto",minWidth:"408px"},className:"loginFormStyleEmployee",buttonStyle:{maxWidth:"100%",width:"100%"}},r.createElement(Sn,null)),O&&r.createElement(t.Toast,{error:!0,label:u(O),onClose:_}),r.createElement("div",{className:"employee-login-home-footer",style:{backgroundColor:"unset"}},r.createElement("img",{alt:"Powered by DIGIT",src:null===(i=window)||void 0===i||null===(o=i.globalConfigs)||void 0===o||null===(a=o.getConfig)||void 0===a?void 0:a.call(o,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:function(){var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})," "))};Mn.propTypes={loginParams:On.any},Mn.defaultProps={loginParams:null};var kn=function(){var e=i.useTranslation().t,t=l.useRouteMatch().path,o=n.useMemo(function(){return Pn.map(function(t){var n={};for(var r in t.texts)n[r]=e(t.texts[r]);return d({},t,{texts:n})},[Pn])});return r.createElement(l.Switch,null,r.createElement(l.Route,{path:""+t,exact:!0},r.createElement(Mn,{config:o[0],t:e})))},Un=["user/profile","user/error"],Bn=function(e){var t,o,a,c,u=e.stateInfo,s=e.userDetails,d=e.CITIZEN,m=e.cityDetails,f=e.mobileView,v=e.handleUserDropdownSelection,p=e.logoUrl,E=e.DSO,y=e.stateCode,C=e.modules,O=e.appTenants,b=e.initData,S=l.useHistory(),N=i.useTranslation().t,w=l.useRouteMatch().path,I=l.useLocation(),_=null==I||null===(t=I.pathname)||void 0===t?void 0:t.includes("language-selection"),D=Un.some(function(e){var t;return null==I||null===(t=I.pathname)||void 0===t?void 0:t.includes(e)});return n.useEffect(function(){Digit.UserService.setType("employee")},[]),r.createElement("div",{className:"employee"},r.createElement(l.Switch,null,r.createElement(l.Route,{path:w+"/user"},D&&r.createElement(W,{t:N,stateInfo:u,userDetails:s,CITIZEN:d,cityDetails:m,mobileView:f,handleUserDropdownSelection:v,logoUrl:p,showSidebar:!!D,showLanguageChange:!_}),r.createElement("div",{className:D?"grounded-container":"loginContainer",style:D?{padding:0,paddingTop:"80px",marginLeft:f?"":"64px"}:{"--banner-url":"url("+(null==u?void 0:u.bannerUrl)+")",padding:"0px"}},r.createElement(l.Switch,null,r.createElement(l.Route,{path:w+"/user/login"},r.createElement(kn,null)),r.createElement(l.Route,{path:w+"/user/forgot-password"},r.createElement(Tn,null)),r.createElement(l.Route,{path:w+"/user/change-password"},r.createElement(In,null)),r.createElement(l.Route,{path:w+"/user/profile"},r.createElement(oe,{stateCode:y,userType:"employee",cityDetails:m})),r.createElement(l.Route,{path:w+"/user/error"},r.createElement(g,{initData:b,goToHome:function(){var e;S.push("/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/employee")}})),r.createElement(l.Route,{path:w+"/user/language-selection"},r.createElement(An,null)),r.createElement(l.Route,null,r.createElement(l.Redirect,{to:w+"/user/language-selection"}))))),r.createElement(l.Route,null,r.createElement(W,{t:N,stateInfo:u,userDetails:s,CITIZEN:d,cityDetails:m,mobileView:f,handleUserDropdownSelection:v,logoUrl:p,modules:C}),r.createElement("div",{className:"main "+(E?"m-auto":"")},r.createElement("div",{className:"employee-app-wrapper"},r.createElement(h,{initData:b},r.createElement(Rn,{stateCode:y,userType:"employee",modules:C,appTenants:O}))),r.createElement("div",{className:"employee-home-footer"},r.createElement("img",{alt:"Powered by DIGIT",src:null===(o=window)||void 0===o||null===(a=o.globalConfigs)||void 0===a||null===(c=a.getConfig)||void 0===c?void 0:c.call(a,"DIGIT_FOOTER"),style:{height:"1.1em",cursor:"pointer"},onClick:function(){var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})))),r.createElement(l.Route,null,r.createElement(l.Redirect,{to:w+"/user/language-selection"}))))},Fn=function(e){var t,i,o,a,c=e.stateCode,u=e.modules,s=e.appTenants,d=e.logoUrl,m=e.initData,f=e.defaultLanding,v=void 0===f?"citizen":f,p=l.useHistory(),E=l.useLocation().pathname,g=window.innerWidth,y=Digit.ULBService.getCurrentUlb(),h=Digit.UserService.getUser(),C=(Digit.Hooks.useStore.getInitData().data||{}).stateInfo,O=Digit.UserService.hasAccess(["FSM_DSO"]),b="CITIZEN"===(null==h||null===(t=h.info)||void 0===t?void 0:t.type)||!window.location.pathname.split("/").includes("employee");window.location.pathname.split("/").includes("employee")&&(b=!1),n.useEffect(function(){var e,t,n;null!=E&&E.includes("application-details")||(null!=E&&E.includes("inbox")||Digit.SessionStorage.del("fsm/inbox/searchParams"),null!=E&&E.includes("search")&&Digit.SessionStorage.del("fsm/search/searchParams")),null!=E&&E.includes("dss")||Digit.SessionStorage.del("DSS_FILTERS"),(null==E?void 0:E.toString())==="/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/employee"&&(Digit.SessionStorage.del("SEARCH_APPLICATION_DETAIL"),Digit.SessionStorage.del("WS_EDIT_APPLICATION_DETAILS")),(null==E?void 0:E.toString())!=="/"+(null===(t=window)||void 0===t?void 0:t.contextPath)+"/citizen"&&(null==E?void 0:E.toString())!=="/"+(null===(n=window)||void 0===n?void 0:n.contextPath)+"/employee"||Digit.SessionStorage.del("WS_DISCONNECTION")},[E]),p.listen(function(){var e;null===(e=window)||void 0===e||e.scrollTo({top:0,left:0,behavior:"smooth"})});var S={stateInfo:C,userDetails:h,CITIZEN:b,cityDetails:y,mobileView:g<=640,handleUserDropdownSelection:function(e){e.func()},logoUrl:d,DSO:O,stateCode:c,modules:u,appTenants:s,sourceUrl:window.location.origin+"/citizen",pathname:E,initData:m};return r.createElement(l.Switch,null,r.createElement(l.Route,{path:"/"+(null===(i=window)||void 0===i?void 0:i.contextPath)+"/employee"},r.createElement(Bn,S)),r.createElement(l.Route,{path:"/"+(null===(o=window)||void 0===o?void 0:o.contextPath)+"/citizen"},r.createElement(Rt,S)),r.createElement(l.Route,null,r.createElement(l.Redirect,{to:"/"+(null===(a=window)||void 0===a?void 0:a.contextPath)+"/"+v})))},jn=[s],Vn=("object"==typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}):u.compose)(u.applyMiddleware.apply(void 0,jn)),Hn=function(e,t){return void 0===t&&(t={}),u.createStore(function(e,t){return u.combineReducers(d({common:(n=e,function(e,t){switch(void 0===e&&(e=n),t.type){case"LANGUAGE_SELECT":return d({},e,{selectedLanguage:t.payload});default:return e}})},t));var n}(e,t),Vn)},zn=function(e){var n,o=e.stateCode,c=e.moduleReducers,u=e.defaultLanding,s=Digit.Hooks.useInitStore(o,e.enabledModules),d=s.data;return s.isLoading?r.createElement(t.Loader,{page:!0}):(i.getI18n(),r.createElement(a.Provider,{store:Hn(d,c(d))},r.createElement(l.BrowserRouter,null,r.createElement(t.Body,null,r.createElement(Fn,{initData:d,stateCode:o,modules:null==d?void 0:d.modules,appTenants:d.tenants,logoUrl:null==d||null===(n=d.stateInfo)||void 0===n?void 0:n.logoUrl,defaultLanding:u})))))},Gn={SelectOtp:se};exports.DigitUI=function(e){var t=e.stateCode,i=e.registry,a=e.enabledModules,l=e.moduleReducers,c=e.defaultLanding,u=n.useState(Digit.Utils.getPrivacyObject()||{}),s=u[0],m=u[1],f=(Digit.UserService.getType(),new o.QueryClient({defaultOptions:{queries:{staleTime:9e5,cacheTime:3e6,retry:!1,retryDelay:function(e){return Infinity}}}})),v=Digit.Contexts.ComponentProvider,p=Digit.Contexts.PrivacyProvider;return Digit.UserService.hasAccess(["FSM_DSO"]),r.createElement("div",null,r.createElement(h,null,r.createElement(o.QueryClientProvider,{client:f},r.createElement(v.Provider,{value:i},r.createElement(p.Provider,{value:{privacy:null==s?void 0:s[window.location.pathname],resetPrivacy:function(e){Digit.Utils.setPrivacyObject({}),m({})},getPrivacy:function(){var e=Digit.Utils.getPrivacyObject();return m(e),e},updatePrivacyDescoped:function(e){var t,n=Digit.Utils.getAllPrivacyObject(),r=d({},n,((t={})[window.location.pathname]=e,t));Digit.Utils.setPrivacyObject(d({},r)),m((null==n?void 0:n[window.location.pathname])||{})},updatePrivacy:function(e,t){m(Digit.Utils.updatePrivacy(e,t)||{})}}},r.createElement(zn,{stateCode:t,enabledModules:a,moduleReducers:l,defaultLanding:c}))))))},exports.initCoreComponents=function(){Object.entries(Gn).forEach(function(e){Digit.ComponentRegistryService.setComponent(e[0],e[1])})};
1
+ function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("@egovernments/digit-ui-react-components"),n=require("react"),r=e(n),i=require("react-i18next"),o=require("react-query"),a=require("react-redux"),l=require("react-router-dom"),c=e(require("react-tooltip")),u=require("redux"),s=e(require("redux-thunk"));function d(){return(d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function m(e,t){return(m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function f(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)t.indexOf(n=o[r])>=0||(i[n]=e[n]);return i}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function p(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return v(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var E={error:{imgUrl:"https://s3.ap-south-1.amazonaws.com/egov-qa-assets/error-image.png",infoMessage:"CORE_SOMETHING_WENT_WRONG",buttonInfo:"ACTION_TEST_HOME"},maintenance:{imgUrl:"https://s3.ap-south-1.amazonaws.com/egov-qa-assets/maintainence-image.png",infoMessage:"CORE_UNDER_MAINTENANCE",buttonInfo:"ACTION_TEST_HOME"},notfound:{imgUrl:"https://s3.ap-south-1.amazonaws.com/egov-qa-assets/PageNotFound.png",infoMessage:"CORE_NOT_FOUND",buttonInfo:"ACTION_TEST_HOME"}},g=function(e){var t=Digit.Hooks.useQueryParams().type,n=E[void 0===t?"error":t],o=i.useTranslation().t;return r.createElement("div",{className:"error-boundary"},r.createElement("div",{className:"error-container"},r.createElement("img",{src:n.imgUrl,alt:"error"}),r.createElement("h1",null,o(n.infoMessage)),r.createElement("button",{onClick:function(){e.goToHome()}},o(n.buttonInfo))))},y=function(){var e,t,n="employee"===Digit.UserService.getType()?"/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/employee/user/error":"/"+(null===(t=window)||void 0===t?void 0:t.contextPath)+"/citizen/error";return window.location.href.includes("employee/user/error")||window.location.href.includes("citizen/error")||"development"===process.env.NODE_ENV||(window.location.href=n),r.createElement("span",null)},h=function(e){var t,n;function i(t){var n;return(n=e.call(this,t)||this).state={error:null,errorStack:null,hasError:!1},n}n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,m(t,n),i.getDerivedStateFromError=function(e){return{error:null==e?void 0:e.message,hasError:!0,errorStack:null==e?void 0:e.stack}};var o=i.prototype;return o.componentDidCatch=function(e,t){this.setState({error:null==e?void 0:e.message,hasError:!0,errorStack:null==e?void 0:e.stack})},o.render=function(){return this.state.hasError?r.createElement("div",{className:"error-boundary"},r.createElement(y,null),r.createElement(g,{initData:this.props.initData})):this.props.children},i}(r.Component),C=function(e,t,n){var r=null==e?void 0:e[""+t];r&&r.map(function(e){e.link=e.navigationURL,e.i18nKey=n(e.name)});var i,o={links:null==r?void 0:r.reverse(),header:Digit.Utils.locale.getTransformedLocale("ACTION_TEST_"+t),iconName:"CITIZEN_"+t+"_ICON"};return"FSM"===t&&[{role:"FSM_DSO",from:"/"+(null===(i=window)||void 0===i?void 0:i.contextPath)+"/citizen/fsm/dso-dashboard",dashoardLink:"CS_LINK_DSO_DASHBOARD",loginLink:"CS_LINK_LOGIN_DSO"}].map(function(e){var t,r,i,a=e.from,l=e.loginLink,c=e.dashoardLink;Digit.UserService.hasAccess(e.role)?null==o||null===(t=o.links)||void 0===t||t.push({link:a,i18nKey:n(c)}):null==o||null===(r=o.links)||void 0===r||r.push({link:"/"+(null===(i=window)||void 0===i?void 0:i.contextPath)+"/citizen/login",state:{role:"FSM_DSO",from:a},i18nKey:n(l)})}),o},O=function(e){var n=e.modules,o=e.getCitizenMenu,a=e.fetchedCitizen,l=e.isLoading,c=n.filter(function(e){return"Payment"===e.code})[0],u=n.filter(function(e){return"Payment"!==e.code}),s=[c].concat(u),d=i.useTranslation().t;return l?r.createElement(t.Loader,null):r.createElement(r.Fragment,null,r.createElement("div",{className:"citizen-all-services-wrapper"},r.createElement(t.BackButton,null),r.createElement("div",{className:"citizenAllServiceGrid"},s.filter(function(e){return e}).map(function(e,n){var i,l,c,u,s,m,f,v=e.code;return a&&(c=a?C(o,v,d):void 0),(null===(i=c)||void 0===i||null===(l=i.links)||void 0===l?void 0:l.length)>0?r.createElement(t.CitizenHomeCard,{header:d(null===(u=c)||void 0===u?void 0:u.header),links:null===(s=c)||void 0===s||null===(m=s.links)||void 0===m||null===(f=m.filter(function(e){return null==e?void 0:e.link}))||void 0===f?void 0:f.sort(function(e,t){return(null==e?void 0:e.orderNumber)-(null==t?void 0:t.orderNumber)}),Icon:function(){return function(e){switch(e){case"PT":return r.createElement(t.PTIcon,{className:"fill-path-primary-main"});case"WS":return r.createElement(t.WSICon,{className:"fill-path-primary-main"});case"FSM":return r.createElement(t.FSMIcon,{className:"fill-path-primary-main"});case"MCollect":return r.createElement(t.MCollectIcon,{className:"fill-path-primary-main"});case"PGR":return r.createElement(t.PGRIcon,{className:"fill-path-primary-main"});case"TL":return r.createElement(t.TLIcon,{className:"fill-path-primary-main"});case"OBPS":return r.createElement(t.OBPSIcon,{className:"fill-path-primary-main"});case"Bills":return r.createElement(t.BillsIcon,{className:"fill-path-primary-main"});default:return r.createElement(t.PTIcon,{className:"fill-path-primary-main"})}}(v)},Info:"OBPS"===v?function(){return r.createElement(t.CitizenInfoLabel,{style:{margin:"0px",padding:"10px"},info:d("CS_FILE_APPLICATION_INFO_LABEL"),text:d("BPA_CITIZEN_HOME_STAKEHOLDER_INCLUDES_INFO_LABEL")})}:null,isInfo:"OBPS"===v}):r.createElement(r.Fragment,null)}))))},b=function(e){return r.createElement("div",{className:"employee-app-container"},r.createElement("div",{className:"ground-container moduleCardWrapper gridModuleWrapper"},e.modules.map(function(e,t){var n=Digit.ComponentRegistryService.getComponent(e.code+"Card")||function(){return r.createElement(r.Fragment,null)};return r.createElement(n,{key:t})})))},S=function(e){var t=e.modules;return"citizen"===e.userType?r.createElement(O,{modules:t,getCitizenMenu:e.getCitizenMenu,fetchedCitizen:e.fetchedCitizen,isLoading:e.isLoading}):r.createElement(b,{modules:t})},N=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;null!==(r=e)&&void 0!==r&&r.includes(t);){var r,i;e=null===(i=e)||void 0===i?void 0:i.replace(t,n)}return e},w=function(e){var i,o=n.useState(null),a=o[0],c=o[1],u=n.useState([]),s=u[0],d=u[1],m=(n.useState([]),l.useHistory());return n.useEffect(function(){var e,t,n=Digit.SessionStorage.get("citizen.userRequestObject"),r=[],i=[];null==n||null===(e=n.info)||void 0===e||null===(t=e.roles)||void 0===t||t.forEach(function(e){return r.push(e.tenantId)});var o=r.filter(function(e,t,n){return n.indexOf(e)===t});null==o||o.forEach(function(e){var t;i.push({label:"TENANT_TENANTS_"+(null===(t=N(e,".","_"))||void 0===t?void 0:t.toUpperCase()),value:e})}),null==i||i.filter(function(e){return e.value==Digit.SessionStorage.get("Employee.tenantId")}),d(i)},[a]),r.createElement("div",{style:null!=e&&e.mobileView?{color:"#767676"}:{}},r.createElement(t.Dropdown,{t:null==e?void 0:e.t,option:s,selected:s.find(function(e){return e.value===(null==a?void 0:a.value)}),optionKey:"label",select:function(e){var t,n,r,i,o=Digit.SessionStorage.get("citizen.userRequestObject"),a=null===(t=Digit.SessionStorage.get("citizen.userRequestObject"))||void 0===t||null===(n=t.info)||void 0===n||null===(r=n.roles)||void 0===r?void 0:r.filter(function(t){return t.tenantId===e.value});if((null==a?void 0:a.length)>0&&(o.info.roles=a,o.info.tenantId=null==e?void 0:e.value),Digit.SessionStorage.set("Employee.tenantId",null==e?void 0:e.value),Digit.UserService.setUser(o),c(e),window.location.href.includes("/"+(null===(i=window)||void 0===i?void 0:i.contextPath)+"/employee/")){var l,u,s=(null===(l=location.state)||void 0===l?void 0:l.from)||"/"+(null===(u=window)||void 0===u?void 0:u.contextPath)+"/employee";m.replace(s)}window.location.reload()},freeze:!0,customSelector:r.createElement("label",{className:"cp"},null==e?void 0:e.t("TENANT_TENANTS_"+(null===(i=N(Digit.SessionStorage.get("Employee.tenantId"),".","_"))||void 0===i?void 0:i.toUpperCase())))}))},I=function(e){var i=e.dropdown||!1,o=Digit.Hooks.useStore.getInitData(),a=o.isLoading,l=o.data||{},c=l.languages,u=l.stateInfo,s=Digit.StoreData.getCurrentLanguage(),d=n.useState(s),m=d[0],f=d[1],v=function(e){f(e.value),Digit.LocalizationService.changeLanguage(e.value,u.code)};return a?null:i?r.createElement("div",null,r.createElement(t.Dropdown,{option:c,selected:c.find(function(e){return e.value===s}),optionKey:"label",select:v,freeze:!0,customSelector:r.createElement("label",{className:"cp"},c.find(function(e){return e.value===m}).label)})):r.createElement(r.Fragment,null,r.createElement("div",{style:{marginBottom:"5px"}},"Language"),r.createElement("div",{className:"language-selector"},c.map(function(e,n){return r.createElement("div",{className:"language-button-container",key:n},r.createElement(t.CustomButton,{selected:e.value===m,text:e.label,onClick:function(){return v(e)}}))})))},_=function(e){var t,n;return r.createElement("span",{className:"user-img-txt",onClick:e.toggleMenu,title:e.name},null==e||null===(t=e.name)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.toUpperCase())},D=function(e){var n,i,o,a,c,u,s,d=e.t,m=e.stateInfo,f=e.toggleSidebar,v=e.handleLogout,p=e.userDetails,E=e.CITIZEN,g=e.cityDetails,y=e.mobileView,h=e.userOptions,C=e.handleUserDropdownSelection,O=e.logoUrl,b=e.showLanguageChange,S=void 0===b||b,N=r.useState(null),D=N[0],T=N[1];r.useEffect(function(){try{var e,t=Digit.ULBService.getCurrentTenantId(),n=null==p||null===(e=p.info)||void 0===e?void 0:e.uuid,r=function(){if(n)return Promise.resolve(Digit.UserService.userSearch(t,{uuid:[n]},{})).then(function(e){if(e&&e.user&&e.user.length){var t,n=e.user[0],r=null==n||null===(t=n.photo)||void 0===t?void 0:t.split(",");T(null==r?void 0:r.at(0))}})}();return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[null!==D,null==p||null===(n=p.info)||void 0===n?void 0:n.uuid]);var L,R,A,P,x,M,k=Digit.ULBService.getCitizenCurrentTenant(!0),U=l.useHistory(),B=l.useLocation().pathname,F=Digit.Hooks.useNotificationCount({tenantId:k,config:{enabled:"EMPLOYEE"!==(null===(L=Digit.UserService)||void 0===L||null===(R=L.getUser())||void 0===R||null===(A=R.info)||void 0===A?void 0:A.type)&&"CITIZEN"===(null===(P=Digit.UserService)||void 0===P||null===(x=P.getUser())||void 0===x||null===(M=x.info)||void 0===M?void 0:M.type)&&!!k}}),j=F.data,V=(void 0===j?{}:j).unreadCount;if(E)return r.createElement("div",null,r.createElement(t.TopBar,{img:null==m?void 0:m.logoUrlWhite,isMobile:!0,toggleSidebar:function(){Digit.clikOusideFired?Digit.clikOusideFired=!1:f(!0)},logoUrl:null==m?void 0:m.logoUrlWhite,onLogout:v,userDetails:p,notificationCount:V<99?V:99,notificationCountLoaded:F.isSuccess,cityOfCitizenShownBesideLogo:d(k),onNotificationIconClick:function(){var e;U.push("/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/citizen/engagement/notifications")},hideNotificationIconOnSomeUrlsWhenNotLoggedIn:function(e){var t,n,r,i;return(null===(t=Digit.UserService)||void 0===t||null===(n=t.getUser())||void 0===n||!n.access_token)&&["/"+(null===(r=window)||void 0===r?void 0:r.contextPath)+"/citizen/select-language","/"+(null===(i=window)||void 0===i?void 0:i.contextPath)+"/citizen/select-location"].includes(e)}(B),changeLanguage:y?null:r.createElement(I,{dropdown:!0})}));var H=!(null==p||!p.access_token);return r.createElement("div",{className:"topbar"},y?r.createElement(t.Hamburger,{handleClick:f,color:"#9E9E9E"}):null,r.createElement("img",{className:"city",src:H?null==g?void 0:g.logoId:null==m?void 0:m.statelogo}),r.createElement("span",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"}},H&&(null!=g&&null!==(i=g.city)&&void 0!==i&&i.ulbGrade?r.createElement("p",{className:"ulb",style:y?{fontSize:"14px",display:"inline-block"}:{}},d(null==g?void 0:g.i18nKey).toUpperCase()," ",d("ULBGRADE_"+(null==g||null===(o=g.city)||void 0===o?void 0:o.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))).toUpperCase()):r.createElement("img",{className:"state",src:O})),!H&&r.createElement("p",{className:"ulb",style:y?{fontSize:"14px",display:"inline-block"}:{}},d("MYCITY_"+(null==m||null===(a=m.code)||void 0===a?void 0:a.toUpperCase())+"_LABEL")," ",d("MYCITY_STATECODE_LABEL")),!y&&r.createElement("div",{className:y?"right":"flex-right right w-80 column-gap-15",style:H?{}:{width:"80%"}},r.createElement("div",{className:"left"},!window.location.href.includes("employee/user/login")&&!window.location.href.includes("employee/user/language-selection")&&r.createElement(w,{dropdown:!0,t:d})),r.createElement("div",{className:"left"},S&&r.createElement(I,{dropdown:!0})),(null==p?void 0:p.access_token)&&r.createElement("div",{className:"left"},r.createElement(t.Dropdown,{option:h,optionKey:"name",select:C,showArrow:!0,freeze:!0,style:y?{right:0}:{},optionCardStyles:{overflow:"revert"},customSelector:null==D?r.createElement(_,{name:(null==p||null===(c=p.info)||void 0===c?void 0:c.name)||(null==p||null===(u=p.info)||void 0===u||null===(s=u.userInfo)||void 0===s?void 0:s.name)||"Employee"}):r.createElement("img",{src:D,style:{height:"48px",width:"48px",borderRadius:"50%"}})})),r.createElement("img",{className:"state",src:O}))))},T=function(e,n,i,o){var a,l;return[{type:"link",element:"HOME",text:e("COMMON_BOTTOM_NAVIGATION_HOME"),link:o?"/"+(null===(a=window)||void 0===a?void 0:a.contextPath)+"/employee":"/"+(null===(l=window)||void 0===l?void 0:l.contextPath)+"/citizen",icon:"HomeIcon",populators:{onClick:n}},{type:"component",element:"LANGUAGE",action:r.createElement(I,null),icon:"LanguageIcon"},{id:"login-btn",element:"LOGIN",text:e("CORE_COMMON_LOGIN"),icon:r.createElement(t.LogoutIcon,{className:"icon"}),populators:{onClick:i}}]},L="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAO4AAADUCAMAAACs0e/bAAAAM1BMVEXK0eL////Dy97GzuD4+fvL0uPg5O7T2efb4OvR1+Xr7vTk5/Df4+37/P3v8fbO1eTt8PUsnq5FAAAGqElEQVR4nO2d25ajIBBFCajgvf//a0eMyZgEjcI5xgt7Hmatme507UaxuJXidiDqjmSgeVIMlB1ZR1WZAf2gbdu0QwixSYzjOJPmHurfEGEfY9XzjNGG9whQCeVAuv5xQEySLtR9hPuIcwj0EeroN5m3D1IbsbgHK0esiQ9MKsqXVr8Hm/a/Pulk6wihpCIXBw3dh7bTvRBt9+dC5NfS1VH3xETdM3MxXRN1T0zUPTNR98xcS1dlV9NNfx3DhkTdM6PKqHteVBF1z0vU5f0sKdpc2zWLKutXrjJjdLvpesRmukqYonauPhXpdsLb6CppmpnltsYIuY2yavi6Mi2/rzAWm1zUfF0limVLqkZyA+mDYevKBS37aGC+L1lX5e7uyU1Cv565uiua9k5LFqbqqrnu2I3m+jJ11ZoLeRtfmdB0Uw/ZDsP0VTxdn7a1VERfmq7XlXyn5D2QWLoq8bZlPoBJumphJjVBw/Ll6CoTZGsTDs4NrGqKbqBth8ZHJUi6cn168QmleSm6GmB7Kxm+6obXlf7PoDHosCwM3QpiS2legi6ocSl3L0G3BdneDDgwQdENfeY+SfDJBkF37ZB+GvwzA6/rMaafAn8143VhPZWdjMWG1oHXhdnemgPoAvLlB/iZyRTfVeF06wPoQhJmlm4bdcOAZRlRN5gcPc5SoPEQR1fDdbOo6wn+uYvXxY0QCLom6gYROKH+Aj5nvphuFXWDiLpRdxl/19LFT95k6CHCrnW7pCDqBn1i1PUFvii2c11oZOJ6usWeH0RRNzC4Zs+6FTi2nevCVwCjbugnXklX5fkfTldL8PEilUB1kfNyN1u9MME2sATr4lbuB7AjfLAuvsRm1A0g6gYRdcPAjvBlje2Z8brI8OC68AcRdlCkwLohx2mcZMjw9q+LzarQurjtnwPYAydX08WecECO/u6Ad0GBdYG7jO5gB4Ap+PwKcA9ZT43dn4/W9TyiPAn4OAJaF7h3uwe8StSCddFdM3jqFa2LvnnB5zzhuuBBAjY4gi50cg694gnXhTYvfMdrjtcFZhrwE9r41gUem8IXWMC3LrBzxh+a0gRd1N1LOK7M0IUUGuggvEmHoStA2/MJh7MpupiDU4TzjhxdzLAoO4ouZvqVURbFMHQlZD6SUeWHoguZsSLUGegrehA+FZFowPdUWTi6iMoZlIpGGUUXkDbjj/9ZOLqAQS/+GIKl5BQOCn/ycqpzkXSDm5dU7ZWkG7wUyGlcmm7g5Ux56AqirgoaJ7BeokPTDbp9CbVunjFxPrl7+HqnkrSq1Da7JX20f3dV8yJi6voO81mX8vV0mx3qUsZCPRfTlVRdz2EvdufYGDvNQvvwqHtmXd+a1ITinwNcXc+lT6JuzdT1XDyBn/x7wtX1HCQQdW9MXc8xArGrirowfLeUEbMqqq6f7TF1lfRdOuGNiGi6SpT+WxY06xUfNN2wBfyE9I4tlm7w5hvOPDNJN3yNiLMipji6gE3chKhouoCtN5x3QlF0EZt8OW/8ougitqJQlk1aii7iFC9l0MvRReyao7xNjKML2Z/PuHlzhi5mFxljiZeiC9rPTEisNEMX9KYAwo5Xhi7qaA3hamboYm7dG+NVrXhdaYDv5zFaQZsYrCtbbAGnjkQDX2+J1FXCwOsqWOpKoIQNTFdqYBWydxqNqUoG0pVpCS+H8kaJaGKErlIaXj7CRRE+gRWuKwW9YZ80oVOUgbpdT0zpnSZJTIiwCtJVelvXntr4P5j6BWfPb5Wcx84C4cq3hb11lco2u2Mdwp6XdJ/Ne3wb8DWdfiRenZaXrhLwOj4e+GQeHroy3YOspS7TlU28Wle2m2QUS0mqdcbrdNW+ZHsSsyK7tBfm0q/dWcv+Z3mytVx3t7KWulqUe6ilunu8jF8pFwgv1FXp3mUt35OtRbr7eM4u4Gs6vUBXgeuHc5kfE/cbvWZtkROLm1DMtLCy80tzsu2PRj0hTI8fvrQuvsjlJkyutszq+m423wHaLTyniy/XuiGZ84LuT+m5ZfNfRxyGs7LXZOvia7VujatUwVTrIt+Q/Csc7Tuhe+BOakT10b4TuoiiJjvgU9emTO42PwEfBa+cuodKkuf42DXr1D3JpXz73Hnn0j10evHKe+nufgfUm+7B84sX9FfdEzXux2DBpWuKokkCqN/5pa/8pmvnL+RGKCddCGmatiPyPB/+ekO/M/q/7uvbt22kTt3zEnXPzCV13T3Gel4/6NduDu66xRvlPNkM1RjjxUdv+4WhGx6TftD19Q/dfzpwcHO+rE3fAAAAAElFTkSuQmCC",R=function(e){return r.createElement("h1",{className:"heading-m"},e.label)},A=function(){return r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},r.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),r.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=function(e){return r.createElement("div",{onClick:null==e?void 0:e.onClick,style:null!=e&&e.isMobileView?{padding:5}:null},null!=e&&e.isMobileView?r.createElement(t.CloseSvg,null):r.createElement("div",{className:"icon-bg-secondary",style:{backgroundColor:"#505A5F"}}," ",r.createElement(A,null)," "))},x=function(e){var n=e.onSelect,o=e.onCancel,a=e.onDismiss,l=i.useTranslation().t,c=r.useState(window.innerWidth<=780),u=c[0],s=c[1],d=function(){window.innerWidth<=780?u||s(!0):u&&s(!1)};return r.useEffect(function(){return window.addEventListener("resize",function(){d()}),function(){window.addEventListener("resize",function(){d()})}}),u?r.createElement(t.Modal,{popupStyles:{height:"174px",maxHeight:"174px",width:"324px",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"},popupModuleActionBarStyles:{display:"flex",flex:1,justifyContent:"flex-start",width:"100%",position:"absolute",left:0,bottom:0,padding:"18px"},style:{flex:1},popupModuleMianStyles:{padding:"18px"},headerBarMain:r.createElement(R,{label:l("CORE_LOGOUT_WEB_HEADER")}),headerBarEnd:r.createElement(P,{onClick:a,isMobileView:u}),actionCancelLabel:l("CORE_LOGOUT_CANCEL"),actionCancelOnSubmit:o,actionSaveLabel:l("CORE_LOGOUT_WEB_YES"),actionSaveOnSubmit:n,formId:"modal-action"},r.createElement("div",null,r.createElement(t.CardText,{style:{margin:0}},l("CORE_LOGOUT_WEB_CONFIRMATION_MESSAGE")+" "))):r.createElement(t.Modal,{popupModuleMianStyles:{paddingTop:"30px"},headerBarMain:r.createElement(R,{label:l("CORE_LOGOUT_WEB_HEADER")}),headerBarEnd:r.createElement(P,{onClick:a,isMobileView:!1}),actionCancelLabel:l("CORE_LOGOUT_CANCEL"),actionCancelOnSubmit:o,actionSaveLabel:l("CORE_LOGOUT_WEB_YES"),actionSaveOnSubmit:n,formId:"modal-action"},r.createElement("div",null,r.createElement(t.CardText,{style:{marginBottom:"54px",marginLeft:"8px",marginRight:"8px"}},l("CORE_LOGOUT_WEB_CONFIRMATION_MESSAGE")+" ",r.createElement("strong",null,l("CORE_LOGOUT_MESSAGE"),"?"))))},M=function(e){var t=e.info,n=e.t;return r.createElement("div",{className:"profile-section"},r.createElement("div",{className:"imageloader imageloader-loaded"},r.createElement("img",{className:"img-responsive img-circle img-Profile",src:L})),r.createElement("div",{id:"profile-name",className:"label-container name-Profile"},r.createElement("div",{className:"label-text"}," ",null==t?void 0:t.name," ")),r.createElement("div",{id:"profile-location",className:"label-container loc-Profile"},r.createElement("div",{className:"label-text"}," ",null==t?void 0:t.mobileNumber," ")),(null==t?void 0:t.emailId)&&r.createElement("div",{id:"profile-emailid",className:"label-container loc-Profile"},r.createElement("div",{className:"label-text"}," ",t.emailId," ")),r.createElement("div",{className:"profile-divider"}),window.location.href.includes("/employee")&&!window.location.href.includes("/employee/user/login")&&!window.location.href.includes("employee/user/language-selection")&&r.createElement(w,{t:n,mobileView:!0}))},k={CommonPTIcon:r.createElement(t.PTIcon,{className:"icon"}),OBPSIcon:r.createElement(t.OBPSIcon,{className:"icon"}),propertyIcon:r.createElement(t.PropertyHouse,{className:"icon"}),TLIcon:r.createElement(t.CaseIcon,{className:"icon"}),PGRIcon:r.createElement(t.PGRIcon,{className:"icon"}),FSMIcon:r.createElement(t.FSMIcon,{className:"icon"}),WSIcon:r.createElement(t.WSICon,{className:"icon"}),MCollectIcon:r.createElement(t.MCollectIcon,{className:"icon"}),BillsIcon:r.createElement(t.CollectionIcon,{className:"icon"}),BirthIcon:r.createElement(t.BirthIcon,{className:"icon"}),DeathIcon:r.createElement(t.DeathIcon,{className:"icon"}),FirenocIcon:r.createElement(t.FirenocIcon,{className:"icon"}),HomeIcon:r.createElement(t.HomeIcon,{className:"icon"}),EditPencilIcon:r.createElement(t.EditPencilIcon,{className:"icon"}),LogoutIcon:r.createElement(t.LogoutIcon,{className:"icon"}),Phone:r.createElement(t.Phone,{className:"icon"})},U=function(e){var o,a,c,u=e.linkData,s=e.islinkDataLoading,m=i.useTranslation().t,f=l.useHistory(),v=l.useLocation().pathname,p=Digit.Hooks.useStore.getInitData(),E=p.data,g=p.isFetched,y=(E||{}).stateInfo,h=Digit.UserService.getUser(),C=window.Digit.Utils.browser.isMobile(),O=n.useState(!1)[0],b=n.useState(!1)[1],S=n.useState(!1),N=S[0],w=S[1],I=function(){w(!1)};if(s)return r.createElement(t.Loader,null);var _=function(){var e;f.push("/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/citizen/user/profile")},D=[].concat(T(m,_,function(){var e;f.push("/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/citizen/login")},O));D=D.filter(function(e){return"LANGUAGE"!==e.element}),Digit.ULBService.getCurrentTenantId();var L,R=function(e){var t,n,i,o=e.item,a=(null==o?void 0:o.icon)||(null===(t=o.icon)||void 0===t||null===(n=t.type)||void 0===n?void 0:n.name),c=a?k[a]:k.BillsIcon;i="component"===o.type?o.action:o.text;var u=function(){return r.createElement("span",d({className:"menu-item"},o.populators),c,r.createElement("div",{className:"menu-label"},i))};return"external-link"===o.type?r.createElement("a",{href:o.link},r.createElement(u,null)):"link"===o.type?r.createElement(l.Link,{to:null==o?void 0:o.link},r.createElement(u,null)):r.createElement(u,null)};return g&&h&&h.access_token&&(L=r.createElement(M,{info:null==h?void 0:h.info,stateName:null==y?void 0:y.name,t:m}),D=D.filter(function(e){return"login-btn"!==(null==e?void 0:e.id)}),D=[].concat(D,[{text:m("EDIT_PROFILE"),element:"PROFILE",icon:"EditPencilIcon",populators:{onClick:_}},{text:m("CORE_COMMON_LOGOUT"),element:"LOGOUT",icon:"LogoutIcon",populators:{onClick:function(){b(!1),w(!0)}}},{text:r.createElement(r.Fragment,null,m("CS_COMMON_HELPLINE"),r.createElement("div",{className:"telephone",style:{marginTop:"-10%"}},null==E?void 0:E.tenants.map(function(e){}),r.createElement("div",{className:"link"},r.createElement("a",{href:"tel:"+(null==E?void 0:E.tenants[0].contactNumber)},null==E?void 0:E.tenants[0].contactNumber)))),element:"Helpline",icon:"Phone"}])),null===(o=Object.keys(u))||void 0===o||null===(a=o.sort(function(e,t){return t.localeCompare(e)}))||void 0===a||a.map(function(e){var t,n,r,i,o,a;(null===(t=u[e][0])||void 0===t?void 0:t.sidebar)===window.contextPath+"-links"&&D.splice(1,0,{type:null!==(n=u[e][0])&&void 0!==n&&null!==(r=n.sidebarURL)&&void 0!==r&&r.includes(null===(i=window)||void 0===i?void 0:i.contextPath)?"link":"external-link",text:m("ACTION_TEST_"+Digit.Utils.locale.getTransformedLocale(e)),links:u[e],icon:null===(o=u[e][0])||void 0===o?void 0:o.leftIcon,link:null===(a=u[e][0])||void 0===a?void 0:a.sidebarURL})}),r.createElement(r.Fragment,null,r.createElement("div",null,r.createElement("div",{style:{height:"100%",width:"100%",top:"0px",backgroundColor:"rgba(0, 0, 0, 0.54)",pointerzevents:"auto"}}),r.createElement("div",{style:{display:"flex",flexDirection:"column",height:C?"calc(100vh - 56px)":"auto",zIndex:"99"}},L,r.createElement("div",{className:"drawer-desktop"},null===(c=D)||void 0===c?void 0:c.map(function(e,t){return r.createElement("div",{className:"sidebar-list "+(v===(null==e?void 0:e.link)||v===(null==e?void 0:e.sidebarURL)?"active":""),key:t},r.createElement(R,{item:e}))}))),r.createElement("div",null,N&&r.createElement(x,{onSelect:function(){Digit.UserService.logout(),w(!1)},onCancel:I,onDismiss:I}))))},B=function(e){var t=e.info,n=e.t,i=r.useState(null),o=i[0],a=i[1];return r.useEffect(function(){try{var e=Digit.ULBService.getCurrentTenantId(),n=null==t?void 0:t.uuid,r=function(){if(n)return Promise.resolve(Digit.UserService.userSearch(e,{uuid:[n]},{})).then(function(e){if(e&&e.user&&e.user.length){var t,n=e.user[0],r=null==n||null===(t=n.photo)||void 0===t?void 0:t.split(",");a(null==r?void 0:r.at(0))}})}();return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[null!==o]),r.createElement("div",{className:"profile-section"},r.createElement("div",{className:"imageloader imageloader-loaded"},r.createElement("img",{className:"img-responsive img-circle img-Profile",src:o||L,style:{objectFit:"cover",objectPosition:"center"}})),r.createElement("div",{id:"profile-name",className:"label-container name-Profile"},r.createElement("div",{className:"label-text"}," ",null==t?void 0:t.name," ")),r.createElement("div",{id:"profile-location",className:"label-container loc-Profile"},r.createElement("div",{className:"label-text"}," ",null==t?void 0:t.mobileNumber," ")),(null==t?void 0:t.emailId)&&r.createElement("div",{id:"profile-emailid",className:"label-container loc-Profile"},r.createElement("div",{className:"label-text"}," ",t.emailId," ")),r.createElement("div",{className:"profile-divider"}),window.location.href.includes("/employee")&&!window.location.href.includes("/employee/user/login")&&!window.location.href.includes("employee/user/language-selection")&&r.createElement(w,{t:n,mobileView:!0}))},F=function(){var e,t,n;return r.createElement("div",{className:"digit-footer",style:{marginBottom:0}},r.createElement("img",{alt:"Powered by DIGIT",src:null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_FOOTER"),style:{cursor:"pointer"},onClick:function(){var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})," ")},j=function(e){var o=e.isOpen,a=e.isMobile,c=void 0!==a&&a,u=e.toggleSidebar,s=e.onLogout,m=e.isEmployee,f=void 0!==m&&m,v=e.linkData,p=e.islinkDataLoading,E=Digit.Hooks.useStore.getInitData(),g=E.data,y=E.isFetched,h=(g||{}).stateInfo,C=Digit.UserService.getUser(),O=n.useState(""),b=O[0],S=O[1],N=i.useTranslation().t,w=l.useHistory(),I=function(){Digit.clikOusideFired=!0,u(!1)},_=Digit.Hooks.useAccessControl(),D=_.isLoading,L=_.data;if(Digit.ULBService.getCurrentTenantId(),p||D)return r.createElement(t.Loader,null);var R,A=[].concat(T(N,I,function(){var e;w.push("/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/citizen/login"),I()},f));y&&C&&C.access_token&&(R=r.createElement(B,{info:null==C?void 0:C.info,stateName:null==h?void 0:h.name,t:N}),A=A.filter(function(e){return"login-btn"!==(null==e?void 0:e.id)}),A=[].concat(A,[{text:N("EDIT_PROFILE"),element:"PROFILE",icon:"EditPencilIcon",populators:{onClick:function(){var e,t,n=f?"/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/employee/user/profile":"/"+(null===(t=window)||void 0===t?void 0:t.contextPath)+"/citizen/user/profile";w.push(n),I()}}},{text:N("CORE_COMMON_LOGOUT"),element:"LOGOUT",icon:"LogoutIcon",populators:{onClick:s}},{text:r.createElement(r.Fragment,null,N("CS_COMMON_HELPLINE"),r.createElement("div",{className:"telephone",style:{marginTop:"-10%"}},null==g?void 0:g.tenants.map(function(e){}),r.createElement("div",{className:"link"},r.createElement("a",{href:"tel:"+(null==g?void 0:g.tenants[0].contactNumber)},null==g?void 0:g.tenants[0].contactNumber)))),element:"Helpline",icon:"Phone"}]));var P={};if(f){var x;null==L||L.actions.filter(function(e){return"url"===e.url&&"Home"!==e.displayName}).forEach(function(e){var t;if(""==b&&""!==e.path){var n=e.path.split(".")[0];"TradeLicense"===n&&(n="Trade License"),P[n]?P[n].push(e):P[n]=[e]}else if(""!==e.path&&null!=e&&null!==(t=e.displayName)&&void 0!==t&&t.toLowerCase().includes(b.toLowerCase())){var r=e.path.split(".")[0];"TradeLicense"===r&&(r="Trade License"),P[r]?P[r].push(e):P[r]=[e]}});for(var M=Object.keys(P),k=function(e){var t,n,r,i,o,a,l,c,u,s,m,f=null===(t=P[M[e]][0])||void 0===t||null===(n=t.displayName)||void 0===n||null===(r=n.toUpperCase())||void 0===r?void 0:r.replace(/[ -]/g,"_"),v=null===(i=M[e])||void 0===i||null===(o=i.toUpperCase())||void 0===o?void 0:o.replace(/[ -]/g,"_");-1===P[M[e]][0].path.indexOf(".")?A.splice(1,0,{type:"link",text:N("ACTION_TEST_"+f),link:null===(a=P[M[e]][0])||void 0===a?void 0:a.navigationURL,icon:null===(l=P[M[e]][0])||void 0===l||null===(c=l.leftIcon)||void 0===c||null===(u=c.split)||void 0===u?void 0:u.call(c,":")[1],populators:{onClick:function(){var t;w.push(null===(t=P[M[e]][0])||void 0===t?void 0:t.navigationURL),I()}}}):A.splice(1,0,{type:"dynamic",moduleName:N("ACTION_TEST_"+v),links:null===(s=P[M[e]])||void 0===s?void 0:s.map(function(e){var t,n;return d({},e,{displayName:N("ACTION_TEST_"+(null==e||null===(t=e.displayName)||void 0===t||null===(n=t.toUpperCase())||void 0===n?void 0:n.replace(/[ -]/g,"_")))})}),icon:null===(m=P[M[e]][1])||void 0===m?void 0:m.leftIcon})},j=0;j<M.length;j++)k(j);var V=A.findIndex(function(e){return"HOME"===e.element}),H=A.splice(V,1),z=A.findIndex(function(e){return"LANGUAGE"===e.element}),G=A.splice(z,(null===(x=A)||void 0===x?void 0:x.length)-z);A.sort(function(e,t){return("dynamic"===(null==e?void 0:e.type)?null==e?void 0:e.moduleName:null==e?void 0:e.text).localeCompare("dynamic"===(null==t?void 0:t.type)?null==t?void 0:t.moduleName:null==t?void 0:t.text)}),(null==H?void 0:H[0])&&A.splice(0,0,H[0]),A=(null==G?void 0:G.length)>0?A.concat(G):A}else{var W,q;null===(W=Object.keys(v))||void 0===W||null===(q=W.sort(function(e,t){return t.localeCompare(e)}))||void 0===q||q.map(function(e){var t,n,r,i,o,a;"digit-ui-links"===(null===(t=v[e][0])||void 0===t?void 0:t.sidebar)&&A.splice(1,0,{type:null!==(n=v[e][0])&&void 0!==n&&null!==(r=n.sidebarURL)&&void 0!==r&&r.includes(null===(i=window)||void 0===i?void 0:i.contextPath)?"link":"external-link",text:N("ACTION_TEST_"+Digit.Utils.locale.getTransformedLocale(e)),links:v[e],icon:null===(o=v[e][0])||void 0===o?void 0:o.leftIcon,link:null===(a=v[e][0])||void 0===a?void 0:a.sidebarURL})})}return w.location.pathname.includes("/openlink")&&(R=r.createElement("span",null),A=A.filter(function(e){return"LANGUAGE"===e.element})),c?r.createElement(t.NavBar,{open:o,toggleSidebar:u,profileItem:R,onClose:I,menuItems:A,Footer:r.createElement(F,null),isEmployee:f,search:b,setSearch:S}):r.createElement(U,{logout:s})},V=function(e){var o,a,u,s,d,m,f,v,p,E,g,y,h=e.item,C=n.useState(!1),O=C[0],b=C[1],S=l.useLocation().pathname,N=i.useTranslation().t,w={home:r.createElement(t.HomeIcon,null),announcement:r.createElement(t.ComplaintIcon,null),business:r.createElement(t.BPAHomeIcon,null),store:r.createElement(t.PropertyHouse,null),assignment:r.createElement(t.CaseIcon,null),receipt:r.createElement(t.ReceiptIcon,null),"business-center":r.createElement(t.PersonIcon,null),description:r.createElement(t.DocumentIconSolid,null),"water-tap":r.createElement(t.DropIcon,null),"collections-bookmark":r.createElement(t.CollectionsBookmarIcons,null),"insert-chart":r.createElement(t.FinanceChartIcon,null),edcr:r.createElement(t.CollectionIcon,null),collections:r.createElement(t.CollectionIcon,null)},I=w[(null==h||null===(o=h.icon)||void 0===o||null===(a=o.leftIcon)||void 0===a||null===(u=a.split)||void 0===u||null===(s=u.call(a,":"))||void 0===s?void 0:s[1])||(null==h||null===(d=h.leftIcon)||void 0===d||null===(m=d.split)||void 0===m?void 0:m.call(d,":")[1])]||w.collections,_=(null==h||null===(f=h.icon)||void 0===f||null===(v=f.leftIcon)||void 0===v||null===(p=v.split)||void 0===p?void 0:p.call(v,":"))||(null==h||null===(E=h.leftIcon)||void 0===E||null===(g=E.split)||void 0===g?void 0:g.call(E,":"));if("dynamic"==(null==_?void 0:_[0])){var D,T=null===(D=require("@egovernments/digit-ui-react-components"))||void 0===D?void 0:D[null==_?void 0:_[1]];I=T?r.createElement(T,null):I}var L,R=null==h||null===(y=h.moduleName)||void 0===y?void 0:y.replace(/[ -]/g,"_"),A=N("ACTION_TEST_"+R),P=N((null==A?void 0:A.length)>20?A.substring(0,20)+"...":A);if("single"===h.type){var x,M,k=window.location.origin;return r.createElement("div",{className:"submenu-container"},r.createElement("div",{className:"sidebar-link "+(S===(null==h?void 0:h.navigationURL)?"active":"")},r.createElement("div",{className:"actions",onClick:function(){return window.location.href=""+(k+h.navigationURL)}},I,-1===(null===(x=h.navigationURL)||void 0===x?void 0:x.indexOf("/"+(null===(M=window)||void 0===M?void 0:M.contextPath)))?r.createElement("a",{"data-tip":"React-tooltip","data-for":"jk-side-"+R,className:"custom-link",href:k+"/employee/"+h.navigationURL},r.createElement("span",null," ",P," "),(null==P?void 0:P.includes("..."))&&r.createElement(c,{textColor:"white",backgroundColor:"grey",place:"right",type:"info",effect:"solid",id:"jk-side-"+R},N("ACTION_TEST_"+R))):r.createElement(l.Link,{className:"custom-link",to:h.navigationURL},r.createElement("div",{"data-tip":"React-tooltip","data-for":"jk-side-"+R},r.createElement("span",null," ",P," "),(null==P?void 0:P.includes("..."))&&r.createElement(c,{textColor:"white",backgroundColor:"grey",place:"right",type:"info",effect:"solid",id:"jk-side-"+R},N("ACTION_TEST_"+R)))))))}return r.createElement(r.Fragment,null,r.createElement("div",{className:"submenu-container"},r.createElement("div",{onClick:h.links&&function(){return b(!O)},className:"sidebar-link "+(null!=h&&null!==(L=h.links)&&void 0!==L&&L.some(function(e){return"url"===(null==e?void 0:e.url)&&(null==S?void 0:S.includes(null==e?void 0:e.navigationURL))})?"active":"")},r.createElement("div",{className:"actions"},I,r.createElement("div",{"data-tip":"React-tooltip","data-for":"jk-side-"+R},r.createElement("span",null," ",P," "),(null==P?void 0:P.includes("..."))&&r.createElement(c,{textColor:"white",backgroundColor:"grey",place:"right",type:"info",effect:"solid",id:"jk-side-"+R},N("ACTION_TEST_"+R)))),r.createElement("div",null," ",h.links&&O?r.createElement(t.ArrowVectorDown,null):h.links?r.createElement(t.ArrowForward,null):null," "))),O&&h.links.sort(function(e,t){return e.orderNumber-t.orderNumber}).filter(function(e){return"url"===e.url||""!==e.url}).map(function(e,t){var n,i,o,a=null==e||null===(n=e.displayName)||void 0===n||null===(i=n.toUpperCase())||void 0===i?void 0:i.replace(/[ -]/g,"_"),u=N("ACTION_TEST_"+a),s=N((null==u?void 0:u.length)>20?u.substring(0,20)+"...":u);if(-1===e.navigationURL.indexOf("/"+(null===(o=window)||void 0===o?void 0:o.contextPath))){var d=window.location.origin;return r.createElement("a",{key:t,className:"dropdown-link "+(S===e.link?"active":""),href:d+"/employee/"+e.navigationURL},r.createElement("div",{className:"actions","data-tip":"React-tooltip","data-for":"jk-side-"+t},r.createElement("span",null," ",s," "),(null==s?void 0:s.includes("..."))&&r.createElement(c,{textColor:"white",backgroundColor:"grey",place:"right",type:"info",effect:"solid",id:"jk-side-"+t},N("ACTION_TEST_"+a))))}return r.createElement(l.Link,{to:(null==e?void 0:e.link)||e.navigationURL,key:t,className:"dropdown-link "+(S===(null==e?void 0:e.link)||S===(null==e?void 0:e.navigationURL)?"active":"")},r.createElement("div",{className:"actions","data-tip":"React-tooltip","data-for":"jk-side-"+t},r.createElement("span",null," ",s," "),(null==s?void 0:s.includes("..."))&&r.createElement(c,{textColor:"white",backgroundColor:"grey",place:"right",type:"info",effect:"solid",id:"jk-side-"+t},N("ACTION_TEST_"+a))))}))},H=function(e,t){return void 0===e&&(e=""),void 0===t&&(t=""),e.toLowerCase().includes(t.toLowerCase())},z=function(){var e=n.useRef(null),o=Digit.Hooks.useAccessControl(),a=o.isLoading,l=o.data,c=n.useState(""),u=c[0],s=c[1],d=i.useTranslation().t;n.useEffect(function(){if(a)return r.createElement(t.Loader,null);e.current.style.cursor="pointer",m()},[a]);var m=function(){e.current.style.width="55px",e.current.style.overflow="hidden",e.current.querySelectorAll(".dropdown-link").forEach(function(e){e.style.display="none"}),e.current.querySelectorAll(".actions").forEach(function(e){e.style.padding="0"})},f={};null==l||l.actions.filter(function(e){return"url"===e.url}).forEach(function(e){var t,n,r,i,o=(null==e||null===(t=e.path)||void 0===t||null===(n=t.split("."))||void 0===n?void 0:n[0])||"";(""==u&&""!==e.path||H(d("ACTION_TEST_"+(null===(r=o)||void 0===r||null===(i=r.toUpperCase())||void 0===i?void 0:i.replace(/[ -]/g,"_"))),u)||H(d(Digit.Utils.locale.getTransformedLocale("ACTION_TEST_"+(null==e?void 0:e.displayName))),u))&&(o=e.path.split(".")[0],f[o]?f[o].push(e):f[o]=[e])});var v=[];return a?r.createElement(t.Loader,null):v?r.createElement("div",{className:"sidebar",ref:e,onMouseOver:function(){e.current.style.width="260px",e.current.style.overflow="auto",e.current.querySelectorAll(".dropdown-link").forEach(function(e){e.style.display="flex"})},onMouseLeave:m},r.createElement("div",{className:"submenu-container"},r.createElement("div",{className:"sidebar-link"},r.createElement("div",{className:"actions search-icon-wrapper"},r.createElement(t.SearchIcon,{className:"search-icon"}),r.createElement("input",{className:"employee-search-input",type:"text",placeholder:d("ACTION_TEST_SEARCH"),name:"search",value:u,onChange:function(e){return s(e.target.value)}})))),function(){var e,t=Object.keys(f);t.sort(function(e,t){return e.orderNumber-t.orderNumber});for(var n=0;n<t.length;n++)if(-1===f[t[n]][0].path.indexOf("."))if("Home"===f[t[n]][0].displayName){var i,o="/"+(null===(i=window)||void 0===i?void 0:i.contextPath)+"/employee";v.unshift({moduleName:t[n].toUpperCase(),icon:f[t[n]][0],navigationURL:o,type:"single"})}else{var a;v.push({moduleName:null===(a=f[t[n]][0])||void 0===a?void 0:a.displayName.toUpperCase(),type:"single",icon:f[t[n]][0],navigationURL:f[t[n]][0].navigationURL})}else v.push({moduleName:t[n].toUpperCase(),links:f[t[n]],icon:f[t[n]][0],orderNumber:f[t[n]][0].orderNumber});if(v.find(function(e){return"HOME"===e.moduleName})){var l,c,u=null===(l=v)||void 0===l?void 0:l.filter(function(e){return"HOME"===(null==e?void 0:e.moduleName)}),s=null===(c=v)||void 0===c?void 0:c.filter(function(e){return"HOME"!==(null==e?void 0:e.moduleName)});v=s.sort(function(e,t){return e.moduleName.localeCompare(t.moduleName)}),(null==u?void 0:u[0])&&v.unshift(u[0])}else v.sort(function(e,t){return e.moduleName.localeCompare(t.moduleName)});return null===(e=v)||void 0===e?void 0:e.map(function(e,t){return r.createElement(V,{item:e,key:t+1})})}()):""},G=function(e){var t=e.isSidebarOpen,n=e.toggleSidebar,i=e.handleLogout,o=e.mobileView,a=e.userDetails,l=e.modules;return e.CITIZEN?r.createElement(j,{isOpen:t,isMobile:!0,toggleSidebar:n,onLogout:i,linkData:e.linkData,islinkDataLoading:e.islinkDataLoading}):!o&&null!=a&&a.access_token?r.createElement(z,{mobileView:o,userDetails:a,modules:l}):r.createElement(j,{isOpen:t,isMobile:!0,toggleSidebar:n,onLogout:i,isEmployee:!0})},W=function(e){var i=e.t,o=e.stateInfo,a=e.userDetails,c=e.CITIZEN,u=e.cityDetails,s=e.mobileView,d=e.handleUserDropdownSelection,m=e.logoUrl,f=e.showSidebar,v=void 0===f||f,p=e.showLanguageChange,E=e.linkData,g=e.islinkDataLoading,y=n.useState(!1),h=y[0],C=y[1],O=l.useHistory(),b=n.useState(!1),S=b[0],N=b[1],w=function(){C(!1),N(!0)},I=function(){N(!1)},_=[{name:i("EDIT_PROFILE"),icon:r.createElement(t.EditPencilIcon,{className:"icon"}),func:function(){var e;O.push("/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/employee/user/profile")}},{name:i("CORE_COMMON_LOGOUT"),icon:r.createElement(t.LogoutIcon,{className:"icon"}),func:w}];return r.createElement(r.Fragment,null,r.createElement(D,{t:i,stateInfo:o,toggleSidebar:C,isSidebarOpen:h,handleLogout:w,userDetails:a,CITIZEN:c,cityDetails:u,mobileView:s,userOptions:_,handleUserDropdownSelection:d,logoUrl:m,showLanguageChange:p}),S&&r.createElement(x,{onSelect:function(){Digit.UserService.logout(),N(!1)},onCancel:I,onDismiss:I}),v&&r.createElement(G,{t:i,CITIZEN:c,isSidebarOpen:h,toggleSidebar:C,handleLogout:w,mobileView:s,userDetails:a,linkData:E,islinkDataLoading:g}))},q=function(e){var o=e.question,a=e.answer,l=e.lastIndex,c=n.useState(!1),u=c[0],s=c[1],d=i.useTranslation().t;return r.createElement("div",{className:"faqs border-none",onClick:function(){return s(!u)}},r.createElement("div",{className:"faq-question",style:{justifyContent:"space-between",display:"flex"}},r.createElement("span",null,d(o)),r.createElement("span",{className:u?"faqicon rotate":"faqicon",style:{float:"right"}},r.createElement(t.ArrowForward,null))),r.createElement("div",{className:"faq-answer",style:u?{display:"block"}:{display:"none"}},r.createElement("span",null,d(a))),l?null:r.createElement("div",{className:"cs-box-border"}))},X=function(e){var o,a,l,c=e.module,u=Digit.UserService.getUser(),s=((null==u||null===(o=u.info)||void 0===o?void 0:o.tenantId)||Digit.ULBService.getCurrentTenantId(),i.useTranslation().t),d=Digit.Hooks.useGetFAQsJSON(Digit.ULBService.getStateId()),m=d.data,f=null==m||null===(a=m.MdmsRes["common-masters"])||void 0===a||null===(l=a.faqs[0])||void 0===l?void 0:l[""+c].faqs;return d.isLoading?r.createElement(t.Loader,null):r.createElement(n.Fragment,null,r.createElement("div",{className:"faq-page"},r.createElement(t.BackButton,{style:{marginLeft:"unset"}}),r.createElement("div",{style:{marginBottom:"15px"}},r.createElement(t.Header,{styles:{marginLeft:"0px",paddingTop:"10px",fontSize:"32px"}},s("FAQ_S"))),r.createElement("div",{className:"faq-list"},f.map(function(e,t){return r.createElement(q,{key:"faq_"+t,question:e.question,answer:e.answer,lastIndex:t===(null==f?void 0:f.length)-1})}))))},Z=function(){var e,n,o,a,c,u,s,m,f,v,p,E,g,y,h,C,O,b,S,N,w,I,_,D,T=i.useTranslation().t,L=l.useHistory(),R=Digit.ULBService.getCitizenCurrentTenant(!0),A=Digit.Hooks.useStore.getInitData(),P=A.data,x=(void 0===P?{}:P).uiHomePage,M=A.isLoading,k=window.Digit.Utils.browser.isMobile(),U=function(){var e,t,n,r,i;return"EMPLOYEE"!==(null===(e=Digit.UserService)||void 0===e||null===(t=e.getUser())||void 0===t||null===(n=t.info)||void 0===n?void 0:n.type)&&!(null===(r=Digit.UserService)||void 0===r||null===(i=r.getUser())||void 0===i||!i.access_token)},B=Digit.Hooks.useEvents({tenantId:R,variant:"whats-new",config:{enabled:U()}}),F=B.data,j=B.isLoading;R||L.push("/"+(null===(D=window)||void 0===D?void 0:D.contextPath)+"/citizen/select-language");var V,H,z=null==x?void 0:x.appBannerDesktop,G=null==x?void 0:x.appBannerMobile,W=null==x?void 0:x.citizenServicesCard,q=null==x?void 0:x.informationAndUpdatesCard,X=null==x?void 0:x.whatsAppBannerDesktop,Z=null==x?void 0:x.whatsAppBannerMobile,Y=null==x?void 0:x.whatsNewSection,K=null==x?void 0:x.redirectURL;K&&L.push("/"+(null===(V=window)||void 0===V?void 0:V.contextPath)+"/citizen/"+K),null!==(e=window)&&void 0!==e&&null!==(n=e.location)&&void 0!==n&&null!==(o=n.href)&&void 0!==o&&null!==(a=o.includes)&&void 0!==a&&a.call(o,"sanitation-ui")&&L.push("/"+(null===(H=window)||void 0===H?void 0:H.contextPath)+"/citizen/all-services");var $=function(e){window.open(null==e?void 0:e.navigationUrl)},J={header:T(null==W?void 0:W.headerLabel),sideOption:{name:T(null==W||null===(c=W.sideOption)||void 0===c?void 0:c.name),onClick:function(){var e;return L.push(null==W||null===(e=W.sideOption)||void 0===e?void 0:e.navigationUrl)}},options:[{name:T(null==W||null===(u=W.props)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.label),Icon:r.createElement(t.ComplaintIcon,null),onClick:function(){var e,t;return L.push(null==W||null===(e=W.props)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.navigationUrl)}},{name:T(null==W||null===(m=W.props)||void 0===m||null===(f=m[1])||void 0===f?void 0:f.label),Icon:r.createElement(t.PTIcon,{className:"fill-path-primary-main"}),onClick:function(){var e,t;return L.push(null==W||null===(e=W.props)||void 0===e||null===(t=e[1])||void 0===t?void 0:t.navigationUrl)}},{name:T(null==W||null===(v=W.props)||void 0===v||null===(p=v[2])||void 0===p?void 0:p.label),Icon:r.createElement(t.CaseIcon,{className:"fill-path-primary-main"}),onClick:function(){var e,t;return L.push(null==W||null===(e=W.props)||void 0===e||null===(t=e[2])||void 0===t?void 0:t.navigationUrl)}},{name:T(null==W||null===(E=W.props)||void 0===E||null===(g=E[3])||void 0===g?void 0:g.label),Icon:r.createElement(t.OBPSIcon,null),onClick:function(){var e,t;return L.push(null==W||null===(e=W.props)||void 0===e||null===(t=e[3])||void 0===t?void 0:t.navigationUrl)}}],styles:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start",width:"100%"}},Q={header:T(null==q?void 0:q.headerLabel),sideOption:{name:T(null==q||null===(y=q.sideOption)||void 0===y?void 0:y.name),onClick:function(){var e;return L.push(null==q||null===(e=q.sideOption)||void 0===e?void 0:e.navigationUrl)}},options:[{name:T(null==q||null===(h=q.props)||void 0===h||null===(C=h[0])||void 0===C?void 0:C.label),Icon:r.createElement(t.HomeIcon,null),onClick:function(){var e,t;return L.push(null==q||null===(e=q.props)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.navigationUrl)}},{name:T(null==q||null===(O=q.props)||void 0===O||null===(b=O[1])||void 0===b?void 0:b.label),Icon:r.createElement(t.Calender,null),onClick:function(){var e,t;return L.push(null==q||null===(e=q.props)||void 0===e||null===(t=e[1])||void 0===t?void 0:t.navigationUrl)}},{name:T(null==q||null===(S=q.props)||void 0===S||null===(N=S[2])||void 0===N?void 0:N.label),Icon:r.createElement(t.DocumentIcon,null),onClick:function(){var e,t;return L.push(null==q||null===(e=q.props)||void 0===e||null===(t=e[2])||void 0===t?void 0:t.navigationUrl)}},{name:T(null==q||null===(w=q.props)||void 0===w||null===(I=w[3])||void 0===I?void 0:I.label),Icon:r.createElement(t.DocumentIcon,null),onClick:function(){var e,t;return L.push(null==q||null===(e=q.props)||void 0===e||null===(t=e[3])||void 0===t?void 0:t.navigationUrl)}}],styles:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start",width:"100%"}};return M?r.createElement(t.Loader,null):r.createElement("div",{className:"HomePageContainer"},r.createElement("div",{className:"HomePageWrapper"},r.createElement("div",{className:"BannerWithSearch"},r.createElement("img",k?{src:null==G?void 0:G.bannerUrl}:{src:null==z?void 0:z.bannerUrl}),r.createElement("div",{className:"ServicesSection"},r.createElement(t.CardBasedOptions,d({style:{marginTop:"-30px"}},J)),r.createElement(t.CardBasedOptions,d({style:k?{}:{marginTop:"-30px"}},Q)))),(Z||X)&&r.createElement("div",{className:"WhatsAppBanner"},r.createElement("img",k?{src:null==Z?void 0:Z.bannerUrl,onClick:function(){return $(Z)}}:{src:null==X?void 0:X.bannerUrl,onClick:function(){return $(X)}})),U()?j?r.createElement(t.Loader,null):r.createElement("div",{className:"WhatsNewSection"},r.createElement("div",{className:"headSection"},r.createElement("h2",null,T(null==Y?void 0:Y.headerLabel)),r.createElement("p",{onClick:function(){var e;return L.push(null==Y||null===(e=Y.sideOption)||void 0===e?void 0:e.navigationUrl)}},T(null==Y||null===(_=Y.sideOption)||void 0===_?void 0:_.name))),r.createElement(t.WhatsNewCard,null==F?void 0:F[0])):null))},Y=function(){var e=i.useTranslation().t,o=l.useHistory(),a=Digit.Hooks.useStore.getInitData(),c=a.data,u=void 0===c?{}:c,s=u.languages,d=u.stateInfo,m=a.isLoading,f=Digit.StoreData.getCurrentLanguage(),v=n.useMemo(function(){return{header:e("CS_COMMON_CHOOSE_LANGUAGE"),submitBarLabel:e("CORE_COMMON_CONTINUE")}},[e]),p=n.useMemo(function(){return{options:s,optionsKey:"label",additionalWrapperClass:"reverse-radio-selection-wrapper",onSelect:function(e){return Digit.LocalizationService.changeLanguage(e.value,d.code)},selectedOption:null==s?void 0:s.filter(function(e){return e.value===f})[0]}},[f,s]);return m?r.createElement(t.Loader,null):r.createElement("div",{className:"selection-card-wrapper"},r.createElement(t.PageBasedInput,{texts:v,onSubmit:function(){var e;o.push("/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/citizen/select-location")}},r.createElement(t.CardHeader,null,e("CS_COMMON_CHOOSE_LANGUAGE")),r.createElement(t.RadioButtons,p)))},K=function(){var e=i.useTranslation().t,o=l.useHistory(),a=l.useLocation(),c=Digit.Hooks.useTenants(),u=c.data,s=c.isLoading,m=n.useState(function(){return{code:Digit.ULBService.getCitizenCurrentTenant(!0)}}),f=m[0],v=m[1],p=n.useState(!1),E=p[0],g=p[1],y=n.useMemo(function(){return{header:e("CS_COMMON_CHOOSE_LOCATION"),submitBarLabel:e("CORE_COMMON_CONTINUE")}},[e]);function h(e){v(e),g(!1)}var C=n.useMemo(function(){return{options:u,optionsKey:"i18nKey",additionalWrapperClass:"reverse-radio-selection-wrapper",onSelect:h,selectedOption:f}},[u,e,f]);return s?r.createElement("loader",null):r.createElement("div",{className:"selection-card-wrapper"},r.createElement(t.BackButton,null),r.createElement(t.PageBasedInput,{texts:y,onSubmit:function(){if(f){var e,t;Digit.SessionStorage.set("CITIZEN.COMMON.HOME.CITY",f);var n=null===(e=a.state)||void 0===e?void 0:e.redirectBackTo;n?o.replace(n):o.push("/"+(null===(t=window)||void 0===t?void 0:t.contextPath)+"/citizen")}else g(!0)},className:"location-selection-container"},r.createElement(t.CardHeader,null,e("CS_COMMON_CHOOSE_LOCATION")),r.createElement(t.SearchOnRadioButtons,d({},C,{placeholder:e("COMMON_TABLE_SEARCH")})),E?r.createElement(t.CardLabelError,null,e("CS_COMMON_LOCATION_SELECTION_ERROR")):null))},$=function(){function e(){}return e.prototype.then=function(t,n){var r=new e,i=this.s;if(i){var o=1&i?t:n;if(o){try{J(r,1,o(this.v))}catch(e){J(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?J(r,1,t?t(i):i):n?J(r,1,n(i)):J(r,2,i)}catch(e){J(r,2,e)}},r},e}();function J(e,t,n){if(!e.s){if(n instanceof $){if(!n.s)return void(n.o=J.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(J.bind(null,e,t),J.bind(null,e,2));e.s=t,e.v=n;var r=e.o;r&&r(e)}}function Q(e){return e instanceof $&&1&e.s}var ee="undefined"!=typeof Symbol?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function te(e,t,n){if("function"==typeof e[ee]){var r,i,o,a=e[ee]();if(function e(l){try{for(;!((r=a.next()).done||n&&n());)if((l=t(r.value))&&l.then){if(!Q(l))return void l.then(e,o||(o=J.bind(null,i=new $,2)));l=l.v}i?J(i,1,l):i=l}catch(e){J(i||(i=new $),2,e)}}(),a.return){var l=function(e){try{r.done||a.return()}catch(e){}return e};if(i&&i.then)return i.then(l,function(e){throw l(e)});l()}return i}if(!("length"in e))throw new TypeError("Object is not iterable");for(var c=[],u=0;u<e.length;u++)c.push(e[u]);return function(e,t,n){var r,i,o=-1;return function a(l){try{for(;++o<e.length&&(!n||!n());)if((l=t(o))&&l.then){if(!Q(l))return void l.then(a,i||(i=J.bind(null,r=new $,2)));l=l.v}r?J(r,1,l):r=l}catch(e){J(r||(r=new $),2,e)}}(),r}(c,function(e){return t(c[e])},n)}function ne(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function re(e){var o=e.setProfilePic,a=e.closeDrawer,l=e.userType,c=e.removeProfilePic,u=e.showToast,s=n.useState(null)[1],d=n.useState(""),m=d[0],f=d[1],v=n.useState(null)[1],p=i.useTranslation().t;return n.useEffect(function(){!function(){try{v(null);var e=function(){if(m){var e=function(){if(m.size>=1e6)u("error",p("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED")),v(p("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{var e=ne(function(){return Promise.resolve(Digit.UploadServices.Filestorage(l+"-profile",m,Digit.ULBService.getStateId())).then(function(e){var t,n;if((null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0){var r,i,a=null==e||null===(r=e.data)||void 0===r||null===(i=r.files[0])||void 0===i?void 0:i.fileStoreId;s(a),o(a)}else u("error",p("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR")),v(p("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR"))})},function(){u("error",p("CORE_COMMON_PROFILE_INVALID_FILE_INPUT"))});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)}}()},[m]),r.createElement(r.Fragment,null,r.createElement("div",{style:{position:"fixed",top:"0",left:"0",right:"0",bottom:"0",width:"100%",height:"100vh",backgroundColor:"rgba(0,0,0,.5)"},onClick:function(){return a()}}),r.createElement("div",{style:{width:"100%",justifyContent:"space-between",display:"flex",backgroundColor:"white",alignItems:"center",position:"fixed",left:"0",right:"0",height:"20%",bottom:"citizen"===l?"2.5rem":"0",zIndex:"2"}},r.createElement("div",{style:{display:"flex",flex:"1",flexDirection:"column",width:"100%",justifyContent:"center",alignItems:"center",gap:"8px 0"}},r.createElement("label",{for:"file",style:{cursor:"pointer"}}," ",r.createElement(t.GalleryIcon,null)),r.createElement("label",{style:{cursor:"pointer"}}," Gallery"),r.createElement("input",{type:"file",id:"file",accept:"image/*, .png, .jpeg, .jpg",onChange:function(e){return f(e.target.files[0])},style:{display:"none"}})),r.createElement("div",{style:{display:"flex",flex:"1",width:"100%",justifyContent:"center",alignItems:"center",flexDirection:"column",gap:"8px 0"}},r.createElement("button",{onClick:function(){c(),a()}},r.createElement(t.RemoveIcon,null)),r.createElement("label",{style:{cursor:"pointer"}},"Remove"))))}"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));var ie,oe=function(e){var o,a,c,u,s,m,f,v,p,E,g,y,h=e.stateCode,C=e.userType,O=e.cityDetails,b=(l.useHistory(),i.useTranslation().t),S=window.location.href,N=Digit.ULBService.getStateId(),w=Digit.ULBService.getCurrentTenantId(),I=(null===(o=Digit.UserService.getUser())||void 0===o?void 0:o.info)||{},_=n.useState(null),D=_[0],T=_[1],L=n.useState(null!=I&&I.name?I.name:""),R=L[0],A=L[1],P=n.useState(null!=I&&I.emailId?I.emailId:""),x=P[0],M=P[1],k=n.useState(null==D?void 0:D.gender),U=k[0],B=k[1],F=n.useState(null!=I&&I.permanentCity?I.permanentCity:O.name),j=F[0],V=F[1],H=n.useState(null!=I&&I.mobileNumber?I.mobileNumber:""),z=H[0],G=H[1],W=n.useState(null),q=W[0],X=W[1],Z=n.useState(""),Y=Z[0],K=Z[1],$=n.useState(!1),J=$[0],Q=$[1],ee=n.useState(!1),te=ee[0],ie=ee[1],oe=n.useState(""),ae=oe[0],le=oe[1],ce=n.useState(""),ue=ce[0],se=ce[1],de=n.useState(""),me=de[0],fe=de[1],ve=n.useState(null),pe=ve[0],Ee=ve[1],ge=n.useState(!1),ye=ge[0],he=ge[1],Ce=r.useState(window.innerWidth),Oe=Ce[0],be=Ce[1],Se=r.useState({}),Ne=Se[0],we=Se[1],Ie=window.Digit.Utils.browser.isMobile();r.useEffect(function(){return window.addEventListener("resize",function(){return be(window.innerWidth)}),function(){window.removeEventListener("resize",function(){return be(window.innerWidth)})}}),n.useEffect(function(){var e;he(!0),function(){try{var e=null==I?void 0:I.uuid,t=function(){if(e)return Promise.resolve(Digit.UserService.userSearch(w,{uuid:[e]},{})).then(function(e){e&&e.user&&e.user.length&&T(e.user[0])})}();Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(),B({i18nKey:void 0,code:null==D?void 0:D.gender,value:null==D?void 0:D.gender});var t=null==D||null===(e=D.photo)||void 0===e?void 0:e.split(",");K(null==t?void 0:t.at(0)),he(!1)},[null!==D]);var _e=function(e){return B(e)},De=function(){return Q(!1)},Te=function(e){A(e),!new RegExp(/^[a-zA-Z ]+$/i).test(e)||0===e.length||e.length>50?we(d({},Ne,{userName:{type:"pattern",message:"CORE_COMMON_PROFILE_NAME_INVALID"}})):we(d({},Ne,{userName:null}))},Le=function(e){M(e),!e.length||e.includes("@")&&e.includes(".")?we(d({},Ne,{emailAddress:null})):we(d({},Ne,{emailAddress:{type:"pattern",message:"CORE_COMMON_PROFILE_EMAIL_INVALID"}}))},Re=function(e,t,n){void 0===n&&(n=5e3),Ee({key:e,action:t}),setTimeout(function(){Ee(null)},n)},Ae=function(){try{var e=function(e){if(t)return e;he(!1)},t=!1;he(!0);var n=ne(function(){var e=d({},I,{name:R,gender:null==U?void 0:U.value,emailId:x,photo:q});if(!new RegExp(/^([a-zA-Z ])*$/).test(R)||""===R||R.length>50||R.length<1)throw JSON.stringify({type:"error",message:"CORE_COMMON_PROFILE_NAME_INVALID"});if("employee"===C&&!new RegExp(/^[6-9]{1}[0-9]{9}$/).test(z))throw JSON.stringify({type:"error",message:"CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID"});if(x.length&&(!x.includes("@")||!x.includes(".")))throw JSON.stringify({type:"error",message:"CORE_COMMON_PROFILE_EMAIL_INVALID"});if(ae.length||ue.length||me.length){if(ue!==me)throw JSON.stringify({type:"error",message:"CORE_COMMON_PROFILE_PASSWORD_MISMATCH"});if(!(ae.length&&ue.length&&me.length))throw JSON.stringify({type:"error",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"});if(!new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(ue)&&!new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(me))throw JSON.stringify({type:"error",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"})}return Promise.resolve(Digit.UserService.updateUser(e,h)).then(function(e){var t=e.responseInfo;if(t&&"200"===t.status){var n=Digit.UserService.getUser();n&&Digit.UserService.setUser(d({},n,{info:d({},n.info,{name:R,mobileNumber:z,emailId:x,permanentCity:j})}))}return function(){if(ae.length&&ue.length&&me.length){var e={existingPassword:ae,newPassword:ue,tenantId:w,type:"EMPLOYEE",username:null==I?void 0:I.userName,confirmPassword:me};return function(){if(ue===me)return ne(function(){return Promise.resolve(Digit.UserService.changePassword(e,w)).then(function(e){var t=e.responseInfo;if(null==t||!t.status||"200"!==t.status)throw"";Re("success",b("CORE_COMMON_PROFILE_UPDATE_SUCCESS_WITH_PASSWORD"),5e3)})},function(e){var t,n;throw JSON.stringify({type:"error",message:null!==(t=e.Errors)&&void 0!==t&&null!==(n=t.at(0))&&void 0!==n&&n.description?e.Errors.at(0).description:"CORE_COMMON_PROFILE_UPDATE_ERROR_WITH_PASSWORD"})});throw JSON.stringify({type:"error",message:"CORE_COMMON_PROFILE_ERROR_PASSWORD_NOT_MATCH"})}()}null!=t&&t.status&&"200"===t.status&&Re("success",b("CORE_COMMON_PROFILE_UPDATE_SUCCESS"),5e3)}()})},function(e){var t=JSON.parse(e);Re(t.type,b(t.message),5e3)});return Promise.resolve(n&&n.then?n.then(e):e(n))}catch(e){return Promise.reject(e)}},Pe=[],xe=Digit.Hooks.useGenderMDMS(N,"common-masters","GenderType").data;return xe&&xe.map(function(e){Pe.push({i18nKey:"PT_COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})}),ye?r.createElement(t.Loader,null):r.createElement("div",{className:"user-profile"},r.createElement("section",{style:{margin:"citizen"===C?"8px":"24px"}},"citizen"===C?r.createElement(t.BackButton,null):r.createElement(t.BreadCrumb,{crumbs:[{path:"/"+(null===(a=window)||void 0===a?void 0:a.contextPath)+"/employee",content:b("ES_COMMON_HOME"),show:!0},{path:"/"+(null===(c=window)||void 0===c?void 0:c.contextPath)+"/employee/user/profile",content:b("ES_COMMON_PAGE_1"),show:S.includes("/user/profile")}]})),r.createElement("div",{style:{display:"flex",flex:1,flexDirection:Oe<768||"citizen"===C?"column":"row",margin:"citizen"===C?"8px":"16px",gap:"citizen"===C?"":"0 24px",boxShadow:"citizen"===C?"1px 1px 4px 0px rgba(0,0,0,0.2)":"",background:"citizen"===C?"white":"",borderRadius:"citizen"===C?"4px":"",maxWidth:"citizen"===C?"960px":""}},r.createElement("section",{style:{position:"relative",display:"flex",flex:"citizen"===C?1:2.5,justifyContent:"center",alignItems:"center",maxWidth:"100%",height:"376px",borderRadius:"4px",boxShadow:"citizen"===C?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",border:("citizen"===C?"8px":"24px")+" solid #fff",background:"#EEEEEE",padding:"citizen"===C?"8px":"16px"}},r.createElement("div",{style:{position:"relative",height:"citizen"===C?"114px":"150px",width:"citizen"===C?"114px":"150px",margin:"16px"}},r.createElement("img",{style:{margin:"auto",borderRadius:"300px",justifyContent:"center",height:"100%",width:"100%"},src:Y&&""!==Y?Y:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAO4AAADUCAMAAACs0e/bAAAAM1BMVEXK0eL////Dy97GzuD4+fvL0uPg5O7T2efb4OvR1+Xr7vTk5/Df4+37/P3v8fbO1eTt8PUsnq5FAAAGqElEQVR4nO2d25ajIBBFCajgvf//a0eMyZgEjcI5xgt7Hmatme507UaxuJXidiDqjmSgeVIMlB1ZR1WZAf2gbdu0QwixSYzjOJPmHurfEGEfY9XzjNGG9whQCeVAuv5xQEySLtR9hPuIcwj0EeroN5m3D1IbsbgHK0esiQ9MKsqXVr8Hm/a/Pulk6wihpCIXBw3dh7bTvRBt9+dC5NfS1VH3xETdM3MxXRN1T0zUPTNR98xcS1dlV9NNfx3DhkTdM6PKqHteVBF1z0vU5f0sKdpc2zWLKutXrjJjdLvpesRmukqYonauPhXpdsLb6CppmpnltsYIuY2yavi6Mi2/rzAWm1zUfF0limVLqkZyA+mDYevKBS37aGC+L1lX5e7uyU1Cv565uiua9k5LFqbqqrnu2I3m+jJ11ZoLeRtfmdB0Uw/ZDsP0VTxdn7a1VERfmq7XlXyn5D2QWLoq8bZlPoBJumphJjVBw/Ll6CoTZGsTDs4NrGqKbqBth8ZHJUi6cn168QmleSm6GmB7Kxm+6obXlf7PoDHosCwM3QpiS2legi6ocSl3L0G3BdneDDgwQdENfeY+SfDJBkF37ZB+GvwzA6/rMaafAn8143VhPZWdjMWG1oHXhdnemgPoAvLlB/iZyRTfVeF06wPoQhJmlm4bdcOAZRlRN5gcPc5SoPEQR1fDdbOo6wn+uYvXxY0QCLom6gYROKH+Aj5nvphuFXWDiLpRdxl/19LFT95k6CHCrnW7pCDqBn1i1PUFvii2c11oZOJ6usWeH0RRNzC4Zs+6FTi2nevCVwCjbugnXklX5fkfTldL8PEilUB1kfNyN1u9MME2sATr4lbuB7AjfLAuvsRm1A0g6gYRdcPAjvBlje2Z8brI8OC68AcRdlCkwLohx2mcZMjw9q+LzarQurjtnwPYAydX08WecECO/u6Ad0GBdYG7jO5gB4Ap+PwKcA9ZT43dn4/W9TyiPAn4OAJaF7h3uwe8StSCddFdM3jqFa2LvnnB5zzhuuBBAjY4gi50cg694gnXhTYvfMdrjtcFZhrwE9r41gUem8IXWMC3LrBzxh+a0gRd1N1LOK7M0IUUGuggvEmHoStA2/MJh7MpupiDU4TzjhxdzLAoO4ouZvqVURbFMHQlZD6SUeWHoguZsSLUGegrehA+FZFowPdUWTi6iMoZlIpGGUUXkDbjj/9ZOLqAQS/+GIKl5BQOCn/ycqpzkXSDm5dU7ZWkG7wUyGlcmm7g5Ux56AqirgoaJ7BeokPTDbp9CbVunjFxPrl7+HqnkrSq1Da7JX20f3dV8yJi6voO81mX8vV0mx3qUsZCPRfTlVRdz2EvdufYGDvNQvvwqHtmXd+a1ITinwNcXc+lT6JuzdT1XDyBn/x7wtX1HCQQdW9MXc8xArGrirowfLeUEbMqqq6f7TF1lfRdOuGNiGi6SpT+WxY06xUfNN2wBfyE9I4tlm7w5hvOPDNJN3yNiLMipji6gE3chKhouoCtN5x3QlF0EZt8OW/8ougitqJQlk1aii7iFC9l0MvRReyao7xNjKML2Z/PuHlzhi5mFxljiZeiC9rPTEisNEMX9KYAwo5Xhi7qaA3hamboYm7dG+NVrXhdaYDv5zFaQZsYrCtbbAGnjkQDX2+J1FXCwOsqWOpKoIQNTFdqYBWydxqNqUoG0pVpCS+H8kaJaGKErlIaXj7CRRE+gRWuKwW9YZ80oVOUgbpdT0zpnSZJTIiwCtJVelvXntr4P5j6BWfPb5Wcx84C4cq3hb11lco2u2Mdwp6XdJ/Ne3wb8DWdfiRenZaXrhLwOj4e+GQeHroy3YOspS7TlU28Wle2m2QUS0mqdcbrdNW+ZHsSsyK7tBfm0q/dWcv+Z3mytVx3t7KWulqUe6ilunu8jF8pFwgv1FXp3mUt35OtRbr7eM4u4Gs6vUBXgeuHc5kfE/cbvWZtkROLm1DMtLCy80tzsu2PRj0hTI8fvrQuvsjlJkyutszq+m423wHaLTyniy/XuiGZ84LuT+m5ZfNfRxyGs7LXZOvia7VujatUwVTrIt+Q/Csc7Tuhe+BOakT10b4TuoiiJjvgU9emTO42PwEfBa+cuodKkuf42DXr1D3JpXz73Hnn0j10evHKe+nufgfUm+7B84sX9FfdEzXux2DBpWuKokkCqN/5pa/8pmvnL+RGKCddCGmatiPyPB/+ekO/M/q/7uvbt22kTt3zEnXPzCV13T3Gel4/6NduDu66xRvlPNkM1RjjxUdv+4WhGx6TftD19Q/dfzpwcHO+rE3fAAAAAElFTkSuQmCC"}),r.createElement("button",{style:{position:"absolute",left:"50%",bottom:"-24px",transform:"translateX(-50%)"},onClick:function(){return Q(!J)}},r.createElement(t.CameraIcon,null)))),r.createElement("section",{style:{display:"flex",flexDirection:"column",flex:"citizen"===C?1:7.5,width:"100%",borderRadius:"4px",height:"fit-content",boxShadow:"citizen"===C?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",background:"white",padding:"citizen"===C?"8px":"24px",paddingBottom:"20px"}},"citizen"===C?r.createElement(r.Fragment,null,r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{style:{}},""+b("CORE_COMMON_PROFILE_NAME"),"*"),r.createElement("div",{style:{width:"100%",maxWidth:"960px"}},r.createElement(t.TextInput,d({t:b,style:{width:"100%"},type:"text",isMandatory:!1,name:"name",value:R,onChange:function(e){return Te(e.target.value)}},{isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"tel",title:b("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")},{disable:!1})),(null==Ne?void 0:Ne.userName)&&r.createElement(t.CardLabelError,null," ",null==Ne||null===(u=Ne.userName)||void 0===u?void 0:u.message," "))),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{style:{}},""+b("CORE_COMMON_PROFILE_GENDER")),r.createElement(t.Dropdown,{style:{width:"100%"},className:"form-field",selected:1===(null==U?void 0:U.length)?U[0]:U,disable:1===(null==U?void 0:U.length)||!1,option:Pe,select:_e,value:U,optionKey:"code",t:b,name:"gender"})),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{style:{}},""+b("CORE_COMMON_PROFILE_EMAIL")),r.createElement("div",{style:{width:"100%"}},r.createElement(t.TextInput,{t:b,style:{width:"100%"},type:"email",isMandatory:!1,optionKey:"i18nKey",name:"email",value:x,onChange:function(e){return Le(e.target.value)},disable:!1}),(null==Ne?void 0:Ne.emailAddress)&&r.createElement(t.CardLabelError,null," ",null==Ne||null===(s=Ne.emailAddress)||void 0===s?void 0:s.message," "))),r.createElement("button",{onClick:Ae,style:{marginTop:"24px",backgroundColor:"#F47738",width:"100%",height:"40px",color:"white",maxWidth:Ie?"100%":"240px",borderBottom:"1px solid black"}},b("CORE_COMMON_SAVE"))):r.createElement(r.Fragment,null,r.createElement(t.LabelFieldPair,{style:{display:"flex"}},r.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_NAME"),"*"),r.createElement("div",{style:{width:"100%"}},r.createElement(t.TextInput,d({t:b,type:"text",isMandatory:!1,name:"name",value:R,onChange:function(e){return Te(e.target.value)},placeholder:"Enter Your Name"},{isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"text",title:b("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")},{disable:!1})),(null==Ne?void 0:Ne.userName)&&r.createElement(t.CardLabelError,{style:{margin:0,padding:0}}," ",null==Ne||null===(m=Ne.userName)||void 0===m?void 0:m.message," "))),r.createElement(t.LabelFieldPair,{style:{display:"flex"}},r.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_GENDER")),r.createElement(t.Dropdown,{style:{width:"100%"},selected:1===(null==U?void 0:U.length)?U[0]:U,disable:1===(null==U?void 0:U.length)||!1,option:Pe,select:_e,value:U,optionKey:"code",t:b,name:"gender"})),r.createElement(t.LabelFieldPair,{style:{display:"flex"}},r.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_CITY")),r.createElement("div",{style:{width:"100%"}},r.createElement(t.TextInput,d({t:b,type:"text",isMandatory:!1,name:"city",value:b(Digit.Utils.locale.getTransformedLocale("TENANT_TENANTS_"+w)),onChange:function(e){return V(e.target.value)},placeholder:"Enter Your City Name"},{isRequired:!0,type:"text",title:b("CORE_COMMON_PROFILE_CITY_ERROR_MESSAGE")},{disable:!0})),r.createElement(t.CardLabelError,null))),r.createElement(t.LabelFieldPair,{style:{display:"flex"}},r.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},b("CORE_COMMON_PROFILE_MOBILE_NUMBER")+"*"),r.createElement("div",{style:{width:"100%"}},r.createElement(t.MobileNumber,{value:z,style:{width:"100%"},name:"mobileNumber",placeholder:"Enter a valid Mobile No.",onChange:function(e){return function(e){G(e),"employee"!==C||new RegExp(/^[6-9]{1}[0-9]{9}$/).test(e)?we(d({},Ne,{mobileNumber:null})):we(d({},Ne,{mobileNumber:{type:"pattern",message:"CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID"}}))}(e)},disable:!0,required:!0,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:b("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")}),(null==Ne?void 0:Ne.mobileNumber)&&r.createElement(t.CardLabelError,{style:{margin:0,padding:0}}," ",null==Ne||null===(f=Ne.mobileNumber)||void 0===f?void 0:f.message," "))),r.createElement(t.LabelFieldPair,{style:{display:"flex"}},r.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_EMAIL")),r.createElement("div",{style:{width:"100%"}},r.createElement(t.TextInput,{t:b,type:"email",isMandatory:!1,placeholder:b("EMAIL_VALIDATION"),optionKey:"i18nKey",name:"email",value:x,onChange:function(e){return Le(e.target.value)},disable:!1}),(null==Ne?void 0:Ne.emailAddress)&&r.createElement(t.CardLabelError,null," ",null==Ne||null===(v=Ne.emailAddress)||void 0===v?void 0:v.message," "))),r.createElement(t.LabelFieldPair,null,r.createElement("div",null,r.createElement("a",{style:(p={color:"orange",cursor:"default",marginBottom:"5"},p.cursor="pointer",p),onClick:function(){return ie(!te)}},b("CORE_COMMON_CHANGE_PASSWORD")),te?r.createElement("div",{style:{marginTop:"10px"}},r.createElement(t.LabelFieldPair,{style:{display:"flex"}},r.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_CURRENT_PASSWORD")),r.createElement("div",{style:{width:"100%"}},r.createElement(t.TextInput,{t:b,type:"password",isMandatory:!1,name:"name",pattern:"^([a-zA-Z0-9@#$%])+$",onChange:function(e){return le(t=e.target.value),void(new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(t)?we(d({},Ne,{currentPassword:null})):we(d({},Ne,{currentPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}})));var t},disable:!1}),(null==Ne?void 0:Ne.currentPassword)&&r.createElement(t.CardLabelError,null,null==Ne||null===(E=Ne.currentPassword)||void 0===E?void 0:E.message))),r.createElement(t.LabelFieldPair,{style:{display:"flex"}},r.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_NEW_PASSWORD")),r.createElement("div",{style:{width:"100%"}},r.createElement(t.TextInput,{t:b,type:"password",isMandatory:!1,name:"name",pattern:"^([a-zA-Z0-9@#$%])+$",onChange:function(e){return se(t=e.target.value),void(new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(t)?we(d({},Ne,{newPassword:null})):we(d({},Ne,{newPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}})));var t},disable:!1}),(null==Ne?void 0:Ne.newPassword)&&r.createElement(t.CardLabelError,null,null==Ne||null===(g=Ne.newPassword)||void 0===g?void 0:g.message))),r.createElement(t.LabelFieldPair,{style:{display:"flex"}},r.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_CONFIRM_PASSWORD")),r.createElement("div",{style:{width:"100%"}},r.createElement(t.TextInput,{t:b,type:"password",isMandatory:!1,name:"name",pattern:"^([a-zA-Z0-9@#$%])+$",onChange:function(e){return fe(t=e.target.value),void(new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(t)?we(d({},Ne,{confirmPassword:null})):we(d({},Ne,{confirmPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}})));var t},disable:!1}),(null==Ne?void 0:Ne.confirmPassword)&&r.createElement(t.CardLabelError,null,null==Ne||null===(y=Ne.confirmPassword)||void 0===y?void 0:y.message)))):""))))),"employee"===C?r.createElement("div",{className:"action-bar-wrap"},r.createElement(t.SubmitBar,{t:b,label:"CORE_COMMON_SAVE",onSubmit:Ae})):"",pe&&r.createElement(t.Toast,{error:"error"===pe.key,label:b("success"===pe.key?"CORE_COMMON_PROFILE_UPDATE_SUCCESS":pe.action),onClose:function(){return Ee(null)},style:{maxWidth:"670px"}}),1==J?r.createElement(re,{setProfilePic:function(e){try{var t=function(e){K(null==e?void 0:e.thumbs[0]),De()};return X(e),Promise.resolve(e?Promise.resolve(function(e,t){try{return Promise.resolve(Digit.UploadServices.Filefetch(e,t)).then(function(e){return e.data.fileStoreIds&&0!==e.data.fileStoreIds.length?{thumbs:e.data.fileStoreIds.map(function(e){return e.url.split(",")[3]}),images:e.data.fileStoreIds.map(function(e){return Digit.Utils.getFileUrl(e.url)})}:null})}catch(e){return Promise.reject(e)}}([e],N)).then(t):t(null))}catch(e){return Promise.reject(e)}},closeDrawer:De,userType:C,removeProfilePic:function(){X(null),K(null)},showToast:Re}):"")},ae=function(e){var o,a,l,c=e.module,u=Digit.UserService.getUser(),s=((null==u||null===(o=u.info)||void 0===o?void 0:o.tenantId)||Digit.ULBService.getCurrentTenantId(),i.useTranslation().t),d=Digit.SessionStorage.get("initData").stateInfo,m=Digit.StoreData.getCurrentLanguage(),f=n.useState(m),v=f[0],p=f[1],E=n.useState(!1),g=E[0],y=E[1],h=n.useState(""),C=h[0],O=h[1],b=function(){return r.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.createElement("path",{d:"M12 24C5.38053 24 0 18.6143 0 12C0 5.38054 5.38053 1.90735e-06 12 1.90735e-06C18.6143 1.90735e-06 24 5.38054 24 12C24 18.6143 18.6143 24 12 24ZM16.3488 10.7852L11.3855 7.25251C11.1263 7.0701 10.8238 6.97889 10.5214 6.97889C10.291 6.97889 10.0557 7.03172 9.83976 7.14202C9.34054 7.40118 9.02857 7.91006 9.02857 8.46694L9.02877 15.5323C9.02877 16.0892 9.34076 16.5979 9.83996 16.8572C10.3344 17.1116 10.9296 17.0732 11.3857 16.7467L16.349 13.214C16.7426 12.9356 16.9778 12.4795 16.9778 11.9996C16.9776 11.5197 16.7426 11.0636 16.3489 10.7852L16.3488 10.7852Z",fill:"white"}))},S=Digit.Hooks.useGetHowItWorksJSON(Digit.ULBService.getStateId()),N=S.data,w=null==N||null===(a=N.MdmsRes["common-masters"])||void 0===a||null===(l=a.howItWorks[0])||void 0===l?void 0:l[""+c];return S.isLoading?r.createElement(t.Loader,null):r.createElement(n.Fragment,null,r.createElement("div",{className:"how-it-works-page"},r.createElement(t.BackButton,null),r.createElement("div",{className:"how-it-works-page-header"},r.createElement(t.Header,null,s("HOW_IT_WORKS"))),r.createElement("div",{className:"language-selector",style:{margin:"10px"}},[{label:"ENGLISH",value:"en_IN"},{label:"हिंदी",value:"hi_IN"}].map(function(e,n){return r.createElement("div",{className:"language-button-container",key:n},r.createElement(t.CustomButton,{selected:e.value===v,text:e.label,onClick:function(){return function(e){p(e.value),Digit.LocalizationService.changeLanguage(e.value,d.code)}(e)}}))})),w.videosJson.map(function(e,t){return r.createElement("div",null,r.createElement("div",{className:"WhatsNewCard",style:{float:"left",position:"relative",width:"100%",marginBottom:10}},r.createElement("div",{className:"video-icon",onClick:function(){return t=e,O("hi_IN"===v?t.hi_IN:t.en_IN),void y(!0);var t}},r.createElement("div",{className:"vid-svg"},r.createElement(b,null))),r.createElement("div",{className:"how-it-works-header-description"},r.createElement("h2",null,s(e.headerLabel)),r.createElement("p",null,s(e.description)))))}),r.createElement("div",{className:"WhatsNewCard",style:{position:"relative",width:"100%",marginBottom:10,display:"inline-block"}},r.createElement("div",{className:"how-it-works-pdf-section"},r.createElement("div",{className:"pdf-icon-header-desc"},r.createElement("div",{className:"pdf-icon"},r.createElement(t.PDFSvg,null)),r.createElement("div",{className:"pdf-header-desc"},r.createElement("h2",null,s(w.pdfHeader)),r.createElement("p",null,s(w.pdfDesc)))),r.createElement("div",{className:"download-icon"},r.createElement(t.DownloadImgIcon,null)))),g&&r.createElement("div",{className:"how-it-works-video-play"},r.createElement("div",{className:"close-button"},r.createElement(t.CloseSvg,{onClick:function(){y(!1)}})),r.createElement("video",{width:500,height:500,controls:!0,autoPlay:!0},r.createElement("source",{src:C,type:"video/mp4"})))))},le=[{texts:{header:"CS_LOGIN_PROVIDE_MOBILE_NUMBER",cardText:"CS_LOGIN_TEXT",nextText:"CS_COMMONS_NEXT",submitBarLabel:"CS_COMMONS_NEXT"},inputs:[{label:"CORE_COMMON_MOBILE_NUMBER",type:"text",name:"mobileNumber",error:"ERR_HRMS_INVALID_MOB_NO",validation:{required:!0,minLength:10,maxLength:10}}]},{texts:{header:"CS_LOGIN_OTP",cardText:"CS_LOGIN_OTP_TEXT",nextText:"CS_COMMONS_NEXT",submitBarLabel:"CS_COMMONS_NEXT"}},{texts:{header:"CS_LOGIN_PROVIDE_NAME",cardText:"CS_LOGIN_NAME_TEXT",nextText:"CS_COMMONS_NEXT",submitBarLabel:"CS_COMMONS_NEXT"},inputs:[{label:"CORE_COMMON_NAME",type:"text",name:"name",error:"CORE_COMMON_NAME_VALIDMSG",validation:{required:!0,minLength:1,pattern:/^[^{0-9}^\$\"<>?\\\\~!@#$%^()+={}\[\]*,/_:;“”‘’]{1,50}$/i}}]}],ce=function(e){var n=e.mobileNumber;return r.createElement(t.FormStep,{isDisabled:!(10===n.length&&e.canSubmit),onSelect:e.onSelect,config:e.config,t:e.t,componentInFront:"+91",onChange:e.onMobileChange,value:n})},ue=function(e){return r.createElement(t.FormStep,{config:e.config,onSelect:e.onSelect,t:e.t,isDisabled:e.isDisabled})},se=function(e){var i,o,a,l=e.config,c=e.otp,u=e.onOtpChange,s=e.onResend,d=e.onSelect,m=e.t,f=e.error,v=e.userType,p=void 0===v?"citizen":v,E=e.canSubmit,g=n.useState(30),y=g[0],h=g[1];i=function(){h(y-1)},o=y>0?1e3:null,a=n.useRef(),n.useEffect(function(){a.current=i},[i]),n.useEffect(function(){if(null!==o){var e=setInterval(function(){a.current()},o);return function(){return clearInterval(e)}}},[o]);var C=function(){s(),h(2)};return"employee"===p?r.createElement(n.Fragment,null,r.createElement(t.OTPInput,{length:6,onChange:u,value:c}),y>0?r.createElement(t.CardText,null,m("CS_RESEND_ANOTHER_OTP")+" "+y+" "+m("CS_RESEND_SECONDS")):r.createElement("p",{className:"card-text-button resend-otp",onClick:C},m("CS_RESEND_OTP")),!f&&r.createElement(t.CardLabelError,null,m("CS_INVALID_OTP"))):r.createElement(t.FormStep,{onSelect:d,config:l,t:m,isDisabled:!(6===(null==c?void 0:c.length)&&E)},r.createElement(t.OTPInput,{length:6,onChange:u,value:c}),y>0?r.createElement(t.CardText,null,m("CS_RESEND_ANOTHER_OTP")+" "+y+" "+m("CS_RESEND_SECONDS")):r.createElement("p",{className:"card-text-button",onClick:C},m("CS_RESEND_OTP")),!f&&r.createElement(t.CardLabelError,null,m("CS_INVALID_OTP")))},de=["ResponseInfo","UserRequest"],me=["ResponseInfo","UserRequest"],fe={type:"register"},ve={type:"login"},pe="/"+(null===(ie=window)||void 0===ie?void 0:ie.contextPath)+"/citizen",Ee=function(e,t){return(null==e?void 0:e.from)||(null==t?void 0:t.from)||pe},ge=function(e){var o,a,c=e.stateCode,u=e.isUserRegistered,s=void 0===u||u,m=i.useTranslation().t,v=l.useLocation(),p=l.useRouteMatch().path,E=l.useHistory(),g=n.useState(null),y=g[0],h=g[1],C=n.useState(null),O=C[0],b=C[1],S=n.useState(!0),N=S[0],w=S[1],I=(n.useState(null),n.useState(s?{}:null==v||null===(o=v.state)||void 0===o?void 0:o.data)),_=I[0],D=I[1],T=n.useState(null),L=T[0],R=T[1],A=Digit.Hooks.useQueryParams(),P=n.useState(!1),x=P[0],M=P[1],k=n.useState(!0),U=k[0],B=k[1],F=n.useState(!0),j=F[0],V=F[1];n.useEffect(function(){var e;return O&&(L&&(clearTimeout(L),R(null)),e=setTimeout(function(){b("")},5e3),R(e)),function(){e&&clearTimeout(e)}},[O]),n.useEffect(function(){var e;if(y){var t,n,r,i,o,a;Digit.SessionStorage.set("citizen.userRequestObject",y),Digit.UserService.setUser(y),t=null==y?void 0:y.info,n=null==y?void 0:y.access_token,r=c,a=null===(i=JSON.parse(sessionStorage.getItem("Digit.initData")))||void 0===i||null===(o=i.value)||void 0===o?void 0:o.selectedLanguage,localStorage.setItem("Citizen.tenant-id",r),localStorage.setItem("tenant-id",r),localStorage.setItem("citizen.userRequestObject",JSON.stringify(t)),localStorage.setItem("locale",a),localStorage.setItem("Citizen.locale",a),localStorage.setItem("token",n),localStorage.setItem("Citizen.token",n),localStorage.setItem("user-info",JSON.stringify(t)),localStorage.setItem("Citizen.user-info",JSON.stringify(t));var l,u=(null===(e=v.state)||void 0===e?void 0:e.from)||pe;Digit.ULBService.getCitizenCurrentTenant(!0)?E.replace(u):E.replace("/"+(null===(l=window)||void 0===l?void 0:l.contextPath)+"/citizen/select-location",{redirectBackTo:u})}},[y]);var H=n.useMemo(function(){return le.map(function(e){var t={};for(var n in e.texts)t[n]=m(e.texts[n]);return d({},e,{texts:t})},[le])}),z=function(){return Digit.UserService.getType()},G=function(e){return Promise.resolve(ne(function(){return Promise.resolve(Digit.UserService.sendOtp(e,c)).then(function(e){return[e,null]})},function(e){return[null,e]}))};return r.createElement("div",{className:"citizen-form-wrapper"},r.createElement(l.Switch,null,r.createElement(t.AppContainer,null,r.createElement(t.BackButton,null),r.createElement(l.Route,{path:""+p,exact:!0},r.createElement(ce,{onSelect:function(e){try{V(!1),D(d({},_,e));var t=d({},e,{tenantId:c,userType:z()});return Promise.resolve(s?Promise.resolve(G({otp:d({},t,ve)})).then(function(e){var n,r,i,o;if(!e[1])return V(!0),void E.replace(p+"/otp",{from:Ee(v.state,A),role:null===(r=v.state)||void 0===r?void 0:r.role});V(!0),v.state&&"FSM_DSO"===v.state.role||E.push("/"+(null===(i=window)||void 0===i?void 0:i.contextPath)+"/citizen/register/name",{from:Ee(v.state,A),data:t}),null!==(n=v.state)&&void 0!==n&&n.role&&(V(!0),b("FSM_DSO"===(null===(o=v.state)||void 0===o?void 0:o.role)?m("ES_ERROR_DSO_LOGIN"):"User not registered."))}):Promise.resolve(G({otp:d({},t,fe)})).then(function(e){if(!e[1])return V(!0),void E.replace(p+"/otp",{from:Ee(v.state,A)});V(!0)}))}catch(e){return Promise.reject(e)}},config:H[0],mobileNumber:_.mobileNumber||"",onMobileChange:function(e){D(d({},_,{mobileNumber:e.target.value}))},canSubmit:j,showRegisterLink:s&&!(null!==(a=v.state)&&void 0!==a&&a.role),t:m})),r.createElement(l.Route,{path:p+"/otp"},r.createElement(se,{config:d({},H[1],{texts:d({},H[1].texts,{cardText:H[1].texts.cardText+" "+(_.mobileNumber||"")})}),onOtpChange:function(e){D(d({},_,{otp:e}))},onResend:function(){try{var e={mobileNumber:_.mobileNumber,tenantId:c,userType:z()},t=function(){if(!s)return Promise.resolve(G({otp:d({},e,fe)})).then(function(){});var t=function(){if(s)return Promise.resolve(G({otp:d({},e,ve)})).then(function(){})}();return t&&t.then?t.then(function(){}):void 0}();return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},onSelect:function(){try{return Promise.resolve(ne(function(){w(!0),B(!1);var e=_.mobileNumber,t=_.otp,n=_.name;return function(){if(s){var r={username:e,password:t,tenantId:c,userType:z()};return Promise.resolve(Digit.UserService.authenticate(r)).then(function(e){var t,n,r,i=e.UserRequest,o=f(e,de);if(null!==(t=v.state)&&void 0!==t&&t.role){var a=i.roles.find(function(e){return e.code===v.state.role});if(!a||!a.code)return b(m("ES_ERROR_USER_NOT_PERMITTED")),void setTimeout(function(){return E.replace(pe)},5e3)}null!==(n=window)&&void 0!==n&&null!==(r=n.globalConfigs)&&void 0!==r&&r.getConfig("ENABLE_SINGLEINSTANCE")&&(i.tenantId=Digit.ULBService.getStateId()),h(d({info:i},o))})}var i=function(){if(!s)return Promise.resolve(Digit.UserService.registerUser({name:n,username:e,otpReference:t,tenantId:c},c)).then(function(e){var t,n,r=e.UserRequest,i=f(e,me);null!==(t=window)&&void 0!==t&&null!==(n=t.globalConfigs)&&void 0!==n&&n.getConfig("ENABLE_SINGLEINSTANCE")&&(r.tenantId=Digit.ULBService.getStateId()),h(d({info:r},i))})}();if(i&&i.then)return i.then(function(){})}()},function(){B(!0),w(!1)}))}catch(e){return Promise.reject(e)}},otp:_.otp,error:N,canSubmit:U,t:m})),r.createElement(l.Route,{path:p+"/name"},r.createElement(ue,{config:H[2],onSelect:function(e){try{var t=d({},_,{tenantId:c,userType:z()},e);return D(d({},_,e)),M(!0),Promise.resolve(G({otp:d({},t,fe)})).then(function(e){e[0]?(M(!1),E.replace(p+"/otp",{from:Ee(v.state,A)})):M(!1)})}catch(e){return Promise.reject(e)}},t:m,isDisabled:x})),O&&r.createElement(t.Toast,{error:!0,label:O,onClose:function(){return b(null)}}))))},ye=function(e){return e instanceof HTMLElement},he=function(e){return null==e},Ce=function(e){return"object"==typeof e},Oe=function(e){return!he(e)&&!Array.isArray(e)&&Ce(e)&&!(e instanceof Date)},be=function(e){return/^\w*$/.test(e)},Se=function(e){return e.filter(Boolean)},Ne=function(e){return Se(e.replace(/["|']/g,"").replace(/\[/g,".").replace(/\]/g,"").split("."))};function we(e,t,n){for(var r=-1,i=be(t)?[t]:Ne(t),o=i.length,a=o-1;++r<o;){var l=i[r],c=n;if(r!==a){var u=e[l];c=Oe(u)||Array.isArray(u)?u:isNaN(+i[r+1])?{}:[]}e[l]=c,e=e[l]}return e}var Ie=function(e,t){for(var n in void 0===t&&(t={}),e)be(n)?t[n]=e[n]:we(t,n,e[n]);return t},_e=function(e){return void 0===e},De=function(e,t,n){void 0===e&&(e={});var r=Se(t.split(/[,[\].]+?/)).reduce(function(e,t){return he(e)?e:e[t]},e);return _e(r)||r===e?_e(e[t])?n:e[t]:r},Te=function(e,t){ye(e)&&e.removeEventListener&&(e.removeEventListener("input",t),e.removeEventListener("change",t),e.removeEventListener("blur",t))},Le={isValid:!1,value:null},Re=function(e){return Array.isArray(e)?e.reduce(function(e,t){return t&&t.ref.checked?{isValid:!0,value:t.ref.value}:e},Le):Le},Ae=function(e){return"radio"===e.type},Pe=function(e){return"file"===e.type},xe=function(e){return"checkbox"===e.type},Me=function(e){return"select-multiple"===e.type},ke={value:!1,isValid:!1},Ue={value:!0,isValid:!0},Be=function(e){if(Array.isArray(e)){if(e.length>1){var t=e.filter(function(e){return e&&e.ref.checked}).map(function(e){return e.ref.value});return{value:t,isValid:!!t.length}}var n=e[0].ref,r=n.value,i=n.attributes;return n.checked?i&&!_e(i.value)?_e(r)||""===r?Ue:{value:r,isValid:!0}:Ue:ke}return ke};function Fe(e,t,n,r,i){var o=e.current[t];if(o){var a=o.ref,l=a.value,c=o.ref,u=o.valueAsNumber,s=o.valueAsDate,d=o.setValueAs;if(a.disabled&&r)return;return Pe(c)?c.files:Ae(c)?Re(o.options).value:Me(c)?[].concat(c.options).filter(function(e){return e.selected}).map(function(e){return e.value}):xe(c)?Be(o.options).value:i?l:u?""===l?NaN:+l:s?c.valueAsDate:d?d(l):l}if(n)return De(n.current,t)}function je(e){return!e||e instanceof HTMLElement&&e.nodeType!==Node.DOCUMENT_NODE&&je(e.parentNode)}var Ve=function(e){return Oe(e)&&!Object.keys(e).length},He=function(e){return"boolean"==typeof e};function ze(e,t){var n,r=be(t)?[t]:Ne(t),i=1==r.length?e:function(e,t){for(var n=t.slice(0,-1).length,r=0;r<n;)e=_e(e)?r++:e[t[r++]];return e}(e,r);i&&delete i[r[r.length-1]];for(var o=0;o<r.slice(0,-1).length;o++){var a=-1,l=void 0,c=r.slice(0,-(o+1)),u=c.length-1;for(o>0&&(n=e);++a<c.length;){var s=c[a];l=l?l[s]:e[s],u===a&&(Oe(l)&&Ve(l)||Array.isArray(l)&&!l.filter(function(e){return Oe(e)&&!Ve(e)||He(e)}).length)&&(n?delete n[s]:delete e[s]),n=l}}return e}var Ge=function(e,t){return e&&e.ref===t},We=function(e){return he(e)||!Ce(e)};function qe(e,t){if(We(e)||We(t))return t;for(var n in t){var r=e[n],i=t[n];try{e[n]=Oe(r)&&Oe(i)||Array.isArray(r)&&Array.isArray(i)?qe(r,i):i}catch(e){}}return e}function Xe(e,t,r){if(We(e)||We(t)||e instanceof Date||t instanceof Date)return e===t;if(!n.isValidElement(e)){var i=Object.keys(e),o=Object.keys(t);if(i.length!==o.length)return!1;for(var a=0,l=i;a<l.length;a++){var c=l[a],u=e[c];if(!r||"ref"!==c){var s=t[c];if((Oe(u)||Array.isArray(u))&&(Oe(s)||Array.isArray(s))?!Xe(u,s,r):u!==s)return!1}}}return!0}function Ze(e,t,n,r,i){for(var o=-1;++o<e.length;){for(var a in e[o]){var l;Array.isArray(e[o][a])?(!n[o]&&(n[o]={}),n[o][a]=[],Ze(e[o][a],De(t[o]||{},a,[]),n[o][a],n[o],a)):Xe(De(t[o]||{},a),e[o][a])?we(n[o]||{},a):n[o]=Object.assign(Object.assign({},n[o]),((l={})[a]=!0,l))}r&&!n.length&&delete r[i]}return n}var Ye=function(e){return"string"==typeof e},Ke=function(e,t,n,r,i){var o={},a=function(t){(_e(i)||(Ye(i)?t.startsWith(i):Array.isArray(i)&&i.find(function(e){return t.startsWith(e)})))&&(o[t]=Fe(e,t,void 0,r))};for(var l in e.current)a(l);return n?Ie(o):qe(t,Ie(o))},$e=function(e){return e instanceof RegExp},Je=function(e){return Oe(e)&&!$e(e)?e:{value:e,message:""}},Qe=function(e){return"function"==typeof e},et=function(e){return Ye(e)||n.isValidElement(e)};function tt(e,t,n){if(void 0===n&&(n="validate"),et(e)||He(e)&&!e)return{type:n,message:et(e)?e:"",ref:t}}var nt=function(e,t,n,r,i){var o;return t?Object.assign(Object.assign({},n[e]),{types:Object.assign(Object.assign({},n[e]&&n[e].types?n[e].types:{}),(o={},o[r]=i||!0,o))}):{}},rt=function(e,t,n,r){var i=n.ref,o=n.ref.value,a=n.options,l=n.required,c=n.maxLength,u=n.minLength,s=n.min,d=n.max,m=n.pattern,f=n.validate;try{var v=!1,p=i.name,E={},g=Ae(i),y=xe(i),h=g||y,C=""===o,O=nt.bind(null,p,t,E),b=function(e,t,n,r,o){void 0===r&&(r="maxLength"),void 0===o&&(o="minLength");var a=e?t:n;E[p]=Object.assign({type:e?r:o,message:a,ref:i},O(e?r:o,a))};if(l&&(!g&&!y&&(C||he(o))||He(o)&&!o||y&&!Be(a).isValid||g&&!Re(a).isValid)){var S=et(l)?{value:!!l,message:l}:Je(l),N=S.message;if(S.value&&(E[p]=Object.assign({type:"required",message:N,ref:h?((e.current[p].options||[])[0]||{}).ref:i},O("required",N)),!t))return Promise.resolve(E)}if(!(he(s)&&he(d)||""===o)){var w,I,_=Je(d),D=Je(s);if(isNaN(o)){var T=i.valueAsDate||new Date(o);Ye(_.value)&&(w=T>new Date(_.value)),Ye(D.value)&&(I=T<new Date(D.value))}else{var L=i.valueAsNumber||parseFloat(o);he(_.value)||(w=L>_.value),he(D.value)||(I=L<D.value)}if((w||I)&&(b(!!w,_.message,D.message,"max","min"),!t))return Promise.resolve(E)}if(Ye(o)&&!C&&(c||u)){var R=Je(c),A=Je(u),P=!he(R.value)&&o.length>R.value,x=!he(A.value)&&o.length<A.value;if((P||x)&&(b(P,R.message,A.message),!t))return Promise.resolve(E)}if(Ye(o)&&m&&!C){var M=Je(m),k=M.value,U=M.message;if($e(k)&&!k.test(o)&&(E[p]=Object.assign({type:"pattern",message:U,ref:i},O("pattern",U)),!t))return Promise.resolve(E)}var B=function(){if(f){var n=Fe(e,p,r,!1,!0),o=h&&a?a[0].ref:i;return Qe(f)?Promise.resolve(f(n)).then(function(e){var n=tt(e,o);if(n&&(E[p]=Object.assign(Object.assign({},n),O("validate",n.message)),!t))return v=!0,E}):function(){if(Oe(f)){var e=function(){if(!Ve(i)&&(E[p]=Object.assign({ref:o},i),!t))return v=!0,E},r=!1,i={},a=te(Object.entries(f),function(e){var a=e[0],l=e[1];if(Ve(i)||t)return Promise.resolve(l(n)).then(function(e){var n=tt(e,o,a);n&&(i=Object.assign(Object.assign({},n),O(a,n.message)),t&&(E[p]=i))});r=!0},function(){return r});return a&&a.then?a.then(e):e()}}()}}();return Promise.resolve(B&&B.then?B.then(function(e){return v?e:E}):v?B:E)}catch(e){return Promise.reject(e)}},it=function e(t,n,r){for(var i in void 0===r&&(r=[]),n){var o=t+(Oe(n)?"."+i:"["+i+"]");We(n[i])?r.push(o):e(o,n[i],r)}return r},ot=function(e,t,n,r,i){var o=void 0;return n.add(t),Ve(e)||(o=De(e,t),(Oe(o)||Array.isArray(o))&&it(t,o).forEach(function(e){return n.add(e)})),_e(o)?i?r:De(r,t):o},at=function(e){var t=e.isBlurEvent,n=e.isSubmitted;return!e.isOnAll&&(!n&&e.isOnTouch?!(e.isTouched||t):(n?e.isReValidateOnBlur:e.isOnBlur)?!t:!(n?e.isReValidateOnChange:e.isOnChange)||t)},lt=function(e){return e.substring(0,e.indexOf("["))},ct=function(e,t){return[].concat(e).some(function(e){return function(e,t){return RegExp(("^"+t+"([|.)\\d+").replace(/\[/g,"\\[").replace(/\]/g,"\\]")).test(e)}(t,e)})},ut="undefined"!=typeof window&&"undefined"!=typeof document;function st(e){var t,n;if(We(e)||ut&&(e instanceof File||ye(e)))return e;if(!["Set","Map","Object","Date","Array"].includes(null===(t=e.constructor)||void 0===t?void 0:t.name))return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof Set){n=new Set;for(var r,i=p(e);!(r=i()).done;)n.add(r.value);return n}if(e instanceof Map){n=new Map;for(var o,a=p(e.keys());!(o=a()).done;){var l=o.value;n.set(l,st(e.get(l)))}return n}for(var c in n=Array.isArray(e)?[]:{},e)n[c]=st(e[c]);return n}var dt=function(e){return{isOnSubmit:!e||"onSubmit"===e,isOnBlur:"onBlur"===e,isOnChange:"onChange"===e,isOnAll:"all"===e,isOnTouch:"onTouched"===e}},mt=function(e){return Ae(e)||xe(e)},ft="undefined"==typeof window,vt=ut?"Proxy"in window:"undefined"!=typeof Proxy,pt=n.createContext(null);pt.displayName="RHFContext";var Et,gt,yt,ht,Ct,Ot=function(e){var t=e.as,r=e.render,i=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["rules","as","render","defaultValue","control","onFocus"]),o=function(e){var t=e.name,r=e.rules,i=e.defaultValue,o=e.control,a=e.onFocus,l=n.useContext(pt);if("production"!==process.env.NODE_ENV&&!o&&!l)throw new Error("📋 Controller is missing `control` prop. https://react-hook-form.com/api#Controller");var c=o||l.control,u=c.defaultValuesRef,s=c.setValue,d=c.register,m=c.unregister,f=c.trigger,v=c.mode,p=c.reValidateMode,E=p.isReValidateOnBlur,g=p.isReValidateOnChange,y=c.formState,h=c.formStateRef.current,C=h.isSubmitted,O=h.touched,b=h.errors,S=c.updateFormState,N=c.readFormStateRef,w=c.fieldsRef,I=c.shallowFieldsStateRef,_=!ct(c.fieldArrayNamesRef.current,t),D=function(){return!_e(De(I.current,t))&&_?De(I.current,t):_e(i)?De(u.current,t):i},T=n.useState(D()),L=T[0],R=T[1],A=n.useRef(L),P=n.useRef({focus:function(){return null}}),x=n.useRef(a||function(){Qe(P.current.focus)&&P.current.focus(),"production"!==process.env.NODE_ENV&&(Qe(P.current.focus)||console.warn("📋 'ref' from Controller render prop must be attached to a React component or a DOM Element whose ref provides a 'focus()' method"))}),M=n.useCallback(function(e){return!at(Object.assign({isBlurEvent:e,isReValidateOnBlur:E,isReValidateOnChange:g,isSubmitted:C,isTouched:!!De(O,t)},v))},[E,g,C,O,t,v]),k=n.useCallback(function(e){var t,n=We(t=e[0])||!Oe(t.target)||Oe(t.target)&&!t.type?t:_e(t.target.value)?t.target.checked:t.target.value;return R(n),A.current=n,n},[]),U=n.useCallback(function(e){if("production"!==process.env.NODE_ENV&&!t)return console.warn("📋 Field is missing `name` prop. https://react-hook-form.com/api#Controller");w.current[t]?w.current[t]=Object.assign({ref:w.current[t].ref},r):(d(Object.defineProperties({name:t,focus:x.current},{value:{set:function(e){R(e),A.current=e},get:function(){return A.current}}}),r),e=_e(De(u.current,t))),e&&_&&R(D())},[r,t,d]);n.useEffect(function(){return function(){return m(t)}},[t]),n.useEffect(function(){"production"!==process.env.NODE_ENV&&(_e(L)&&console.warn("📋 "+t+" is missing in the 'defaultValue' prop of either its Controller (https://react-hook-form.com/api#Controller) or useForm (https://react-hook-form.com/api#useForm)"),!_&&_e(i)&&console.warn("📋 Controller is missing `defaultValue` prop when using `useFieldArray`. https://react-hook-form.com/api#Controller")),U()},[U]),n.useEffect(function(){!w.current[t]&&U(!0)});var B=n.useCallback(function(){N.current.touched&&!De(O,t)&&(we(O,t,!0),S({touched:O})),M(!0)&&f(t)},[t,S,M,f,N]);return{field:{onChange:n.useCallback(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return s(t,k(n),{shouldValidate:M(),shouldDirty:!0})},[s,t,M]),onBlur:B,name:t,value:L,ref:P},meta:Object.defineProperties({invalid:!!De(b,t)},{isDirty:{get:function(){return!!De(y.dirtyFields,t)}},isTouched:{get:function(){return!!De(y.touched,t)}}})}}(e),a=o.field,l=o.meta,c=Object.assign(Object.assign({},i),a);return t?n.isValidElement(t)?n.cloneElement(t,c):n.createElement(t,c):r?r(a,l):null},bt=function(e){var n=e.control,i=e.t,o=window.Digit.Utils.browser.isMobile();return r.createElement(Fragment,null,r.createElement(t.SearchField,{className:"pt-form-field"},r.createElement("label",null,i("AUDIT_FROM_DATE_LABEL")),r.createElement(Ot,{render:function(e){return r.createElement(t.DatePicker,{date:e.value,onChange:e.onChange})},name:"fromDate",control:n})),r.createElement(t.SearchField,{className:"pt-form-field"},r.createElement("label",null,i("AUDIT_TO_DATE_LABEL")),r.createElement(Ot,{render:function(e){return r.createElement(t.DatePicker,{date:e.value,onChange:e.onChange})},name:"toDate",control:n})),r.createElement(t.SearchField,{className:"pt-search-action-submit"},r.createElement(t.SubmitBar,{style:{marginTop:o?"510px":"25px",marginLeft:o?"0":"-30px",maxWidth:o?"100%":"240px"},label:i("ES_COMMON_APPLY"),submit:!0})))},St=["currentlyActiveMobileModal","searchFormFieldsComponentProps","tenantId"],Nt=["currentlyActiveMobileModal","searchFormFieldsComponentProps","tenantId"],wt=function(e){var i,o=e.Controller,a=e.register,l=e.control,c=e.t,u=e.reset,s=e.previousPage,m=e.handleSubmit,v=e.tenantId,p=e.data,E=e.onSubmit,g=e.isLoading,y=n.useState([]),h=y[0],C=y[1],O=function(e){return r.createElement("div",{onClick:e.onClick},r.createElement(t.DownloadBtnCommon,null))};n.useEffect(function(){(null==p?void 0:p.length)>0&&C([null==p?void 0:p.map(function(e){var t={};return t[c("AUDIT_DATE_LABEL")]=b(null==e?void 0:e.timestamp),t[c("AUDIT_TIME_LABEL")]=S(null==e?void 0:e.timestamp),t[c("AUDIT_DATAVIEWED_LABEL")]=(null==e?void 0:e.dataView[0])+","+(null==e?void 0:e.dataView[1]),t[c("AUDIT_DATAVIEWED_BY_LABEL")]=null==e?void 0:e.dataViewedBy,t[c("AUDIT_ROLE_LABEL")]=null==e?void 0:e.roles.map(function(e){return e.name}).join(","),d({},t)})])},[p]);var b=function(e){if(null==e||null==e||""==e)return"NA";var t=new Date(e),n=t.getMonth()+1,r=t.getDate();return(r=(r>9?"":"0")+r)+"/"+(n=(n>9?"":"0")+n)+"/"+t.getFullYear()},S=function(e){if(null==e||null==e||""==e)return"NA";var t=new Date(e),n=t.getHours(),r=t.getMinutes(),i=n>12?"PM":"AM";return(n=((n=n>12?n-12:n)>9?"":"0")+n)+":"+(r=(r>9?"":"0")+r)+" "+i},N=n.useReducer(function(e,t){switch(t.type){case"set":return t.payload;case"remove":return!1}},!1),w=N[0],I=N[1],_=function(){I({type:"remove"})},D=function(){return r.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:_},r.createElement(t.CloseSvg,null))},T={Controller:o,register:a,control:l,t:c,reset:u,previousPage:s},L=n.useCallback(function(e){return function(e){var n=e.currentlyActiveMobileModal,i=e.searchFormFieldsComponentProps,o=e.tenantId,a=f(e,St),l=a.closeMobilePopupModal;switch(n){case"SearchFormComponent":return r.createElement(t.SearchForm,a,r.createElement(D,null),r.createElement("div",{className:"MobilePopupHeadingWrapper"},r.createElement("h2",null,c("PRIVACY_AUDIT_REPORT"),":")),r.createElement(bt,d({},i,{closeMobilePopupModal:l,tenantId:o,t:c})));default:return r.createElement("span",null)}}(d({currentlyActiveMobileModal:e.currentlyActiveMobileModal,searchFormFieldsComponentProps:e.searchFormFieldsComponentProps,tenantId:e.tenantId},f(e,Nt)))},[w]);null==p||null===(i=p.roles)||void 0===i||i.forEach(function(e){});var R=n.useMemo(function(){return null!=p&&p.display||""===p?[]:null==p?void 0:p.map(function(e){var t,n;return(n={})[c("AUDIT_DATE_LABEL")]=b(e.timestamp),n[c("AUDIT_TIME_LABEL")]=S(e.timestamp),n[c("AUDIT_DATAVIEWED_LABEL")]=e.dataView[0]+","+e.dataView[1],n[c("AUDIT_DATAVIEWED_BY_LABEL")]=e.dataViewedBy,n[c("AUDIT_ROLE_LABEL")]=null===(t=e.roles.slice(0,3))||void 0===t?void 0:t.map(function(e){return e.name}).join(","),n})},[p]);return r.createElement(r.Fragment,null,r.createElement(t.BackButton,null),r.createElement("div",{className:"sideContent",style:{marginLeft:"70%",marginTop:"-12%"}},r.createElement(O,{className:"mrlg cursorPointer",onClick:function(){return function(e){if(void 0!==(null==e?void 0:e[0]))return Digit.Download.Excel(null==e?void 0:e[0],"AuditReport")}(h)}})),r.createElement(t.Header,null,c("PRIVACY_AUDIT_REPORT"),":"),r.createElement("div",{className:"searchBox"},r.createElement(t.SearchAction,{text:c("ES_COMMON_SEARCH"),handleActionClick:function(){return I({type:"set",payload:"SearchFormComponent"})},tenantId:v,t:c})),w?r.createElement(t.PopUp,null,r.createElement(L,{onSubmit:function(e){I({type:"remove"}),E(e)},handleSubmit:m,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",searchFormFieldsComponentProps:T,currentlyActiveMobileModal:w,closeMobilePopupModal:_,tenantId:v})):null,g&&r.createElement(t.Loader,null),r.createElement(t.DetailsCard,{data:R}))},It=function(e){var i=e.tenantId,o=e.t,a=e.onSubmit,l=e.data,c=e.count,u=function(e){var t=void 0===e?{}:e,r=t.mode,i=void 0===r?"onSubmit":r,o=t.reValidateMode,a=void 0===o?"onChange":o,l=t.resolver,c=t.context,u=t.defaultValues,s=void 0===u?{}:u,d=t.shouldFocusError,m=void 0===d||d,f=t.shouldUnregister,v=void 0===f||f,E=t.criteriaMode,g=n.useRef({}),y=n.useRef({}),h=n.useRef({}),C=n.useRef(new Set),O=n.useRef({}),b=n.useRef({}),S=n.useRef({}),N=n.useRef({}),w=n.useRef(s),I=n.useRef(!1),_=n.useRef(!1),D=n.useRef(),T=n.useRef({}),L=n.useRef({}),R=n.useRef(c),A=n.useRef(l),P=n.useRef(new Set),x=n.useRef(dt(i)),M=x.current,k=M.isOnSubmit,U=M.isOnTouch,B="all"===E,F=n.useState({isDirty:!1,isValidating:!1,dirtyFields:{},isSubmitted:!1,submitCount:0,touched:{},isSubmitting:!1,isSubmitSuccessful:!1,isValid:!k,errors:{}}),j=F[0],V=F[1],H=n.useRef({isDirty:!vt,dirtyFields:!vt,touched:!vt||U,isValidating:!vt,isSubmitting:!vt,isValid:!vt}),z=n.useRef(j),G=n.useRef(),W=n.useRef(dt(a)).current,q=W.isOnBlur,X=W.isOnChange;R.current=c,A.current=l,z.current=j,T.current=v?{}:Ve(T.current)?st(s):T.current;var Z=n.useCallback(function(e){void 0===e&&(e={}),I.current||(z.current=Object.assign(Object.assign({},z.current),e),V(z.current))},[]),Y=function(){return H.current.isValidating&&Z({isValidating:!0})},K=n.useCallback(function(e,t,n,r,i){void 0===n&&(n=!1),void 0===r&&(r={});var o=n||function(e){var t=e.errors,n=e.name,r=e.error,i=e.validFields,o=e.fieldsWithValidation,a=_e(r),l=De(t,n);return a&&!!l||!a&&!Xe(l,r,!0)||a&&De(o,n)&&!De(i,n)}({errors:z.current.errors,error:t,name:e,validFields:N.current,fieldsWithValidation:S.current}),a=De(z.current.errors,e);t?(ze(N.current,e),o=o||!a||!Xe(a,t,!0),we(z.current.errors,e,t)):((De(S.current,e)||A.current)&&(we(N.current,e,!0),o=o||a),ze(z.current.errors,e)),(o&&!he(n)||!Ve(r)||H.current.isValidating)&&Z(Object.assign(Object.assign(Object.assign({},r),A.current?{isValid:!!i}:{}),{isValidating:!1}))},[]),$=n.useCallback(function(e,t){var n=g.current[e],r=n.ref,i=n.options,o=ut&&ye(r)&&he(t)?"":t;Ae(r)?(i||[]).forEach(function(e){var t=e.ref;return t.checked=t.value===o}):Pe(r)&&!Ye(o)?r.files=o:Me(r)?[].concat(r.options).forEach(function(e){return e.selected=o.includes(e.value)}):xe(r)&&i?i.length>1?i.forEach(function(e){var t=e.ref;return t.checked=Array.isArray(o)?!!o.find(function(e){return e===t.value}):o===t.value}):i[0].ref.checked=!!o:r.value=o},[]),J=n.useCallback(function(e,t){if(H.current.isDirty){var n=ue();return e&&t&&we(n,e,t),!Xe(n,w.current)}return!1},[]),Q=n.useCallback(function(e,t){if(void 0===t&&(t=!0),H.current.isDirty||H.current.dirtyFields){var n=!Xe(De(w.current,e),Fe(g,e,T)),r=De(z.current.dirtyFields,e),i=z.current.isDirty;n?we(z.current.dirtyFields,e,!0):ze(z.current.dirtyFields,e);var o={isDirty:J(),dirtyFields:z.current.dirtyFields},a=H.current.isDirty&&i!==o.isDirty||H.current.dirtyFields&&r!==De(z.current.dirtyFields,e);return a&&t&&Z(o),a?o:{}}return{}},[]),ee=n.useCallback(function(e,t){try{return"production"===process.env.NODE_ENV||g.current[e]?Promise.resolve(rt(g,B,g.current[e],T)).then(function(n){var r=n[e];return K(e,r,t),_e(r)}):(console.warn("📋 Field is missing with `name` attribute: ",e),Promise.resolve(!1))}catch(e){return Promise.reject(e)}},[K,B]),ne=n.useCallback(function(e){try{return Promise.resolve(A.current(ue(),R.current,B)).then(function(t){var n=t.errors,r=z.current.isValid;if(Array.isArray(e)){var i=e.map(function(e){var t=De(n,e);return t?we(z.current.errors,e,t):ze(z.current.errors,e),!t}).every(Boolean);return Z({isValid:Ve(n),isValidating:!1}),i}var o=De(n,e);return K(e,o,r!==Ve(n),{},Ve(n)),!o})}catch(e){return Promise.reject(e)}},[K,B]),re=n.useCallback(function(e){try{var t=function(e){return n?e:Promise.resolve(ee(r))},n=!1,r=e||Object.keys(g.current);if(Y(),A.current)return Promise.resolve(ne(r));var i=function(){if(Array.isArray(r))return!e&&(z.current.errors={}),Promise.resolve(Promise.all(r.map(function(e){try{return Promise.resolve(ee(e,null))}catch(e){return Promise.reject(e)}}))).then(function(e){Z({isValidating:!1});var t=e.every(Boolean);return n=!0,t})}();return Promise.resolve(i&&i.then?i.then(t):t(i))}catch(e){return Promise.reject(e)}},[ne,ee]),ie=n.useCallback(function(e,t,n){var r=n.shouldDirty,i=n.shouldValidate,o={};we(o,e,t);for(var a,l=p(it(e,t));!(a=l()).done;){var c=a.value;g.current[c]&&($(c,De(o,c)),r&&Q(c),i&&re(c))}},[re,$,Q]),oe=n.useCallback(function(e,t,n){if(!v&&!We(t)&&we(T.current,e,Array.isArray(t)?[].concat(t):Object.assign({},t)),g.current[e])$(e,t),n.shouldDirty&&Q(e),n.shouldValidate&&re(e);else if(!We(t)&&(ie(e,t,n),P.current.has(e))){var r,i,o=lt(e)||e;we(y.current,e,t),L.current[o](((r={})[o]=De(y.current,o),r)),(H.current.isDirty||H.current.dirtyFields)&&n.shouldDirty&&(we(z.current.dirtyFields,e,function(e,t,n){return qe(Ze(e,t,n.slice(0,e.length)),Ze(t,e,n.slice(0,e.length)))}(t,De(w.current,e,[]),De(z.current.dirtyFields,e,[]))),Z({isDirty:!Xe(Object.assign(Object.assign({},ue()),(i={},i[e]=t,i)),w.current)}))}!v&&we(T.current,e,t)},[Q,$,ie]),ae=function(e){return _.current||C.current.has(e)||C.current.has((e.match(/\w+/)||[])[0])},le=function(e){var t=!0;if(!Ve(O.current))for(var n in O.current)e&&O.current[n].size&&!O.current[n].has(e)&&!O.current[n].has(lt(e))||(b.current[n](),t=!1);return t};function ce(e){if(!v){for(var t,n=st(e),r=p(P.current);!(t=r()).done;){var i,o=t.value;be(o)&&!n[o]&&(n=Object.assign(Object.assign({},n),((i={})[o]=[],i)))}return n}return e}function ue(e){if(Ye(e))return Fe(g,e,T);if(Array.isArray(e)){for(var t,n={},r=p(e);!(t=r()).done;){var i=t.value;we(n,i,Fe(g,i,T))}return n}return ce(Ke(g,st(T.current),v))}D.current=D.current?D.current:function(e){var t=e.type,n=e.target;try{var r,i,o=n.name,a=g.current[o];return Promise.resolve(function(){if(a){var e=function(){!l&&le(o),K(o,r,s,u,i)},l="blur"===t,c=at(Object.assign({isBlurEvent:l,isReValidateOnChange:X,isReValidateOnBlur:q,isTouched:!!De(z.current.touched,o),isSubmitted:z.current.isSubmitted},x.current)),u=Q(o,!1),s=!Ve(u)||!l&&ae(o);if(l&&!De(z.current.touched,o)&&H.current.touched&&(we(z.current.touched,o,!0),u=Object.assign(Object.assign({},u),{touched:z.current.touched})),!v&&xe(n)&&we(T.current,o,Fe(g,o)),c)return!l&&le(o),(!Ve(u)||s&&Ve(u))&&Z(u);Y();var d=A.current?Promise.resolve(A.current(ue(),R.current,B)).then(function(e){var t=e.errors,a=z.current.isValid;if(r=De(t,o),xe(n)&&!r&&A.current){var l=lt(o),c=De(t,l,{});c.type&&c.message&&(r=c),l&&(c||De(z.current.errors,l))&&(o=l)}a!==(i=Ve(t))&&(s=!0)}):Promise.resolve(rt(g,B,a,T)).then(function(e){r=e[o]});return d&&d.then?d.then(e):e()}}())}catch(e){return Promise.reject(e)}};var se=n.useCallback(function(e){void 0===e&&(e={});try{var t=Ve(g.current)?w.current:{};return Promise.resolve(A.current(Object.assign(Object.assign(Object.assign({},t),ue()),e),R.current,B)).then(function(e){var t=Ve(e.errors);z.current.isValid!==t&&Z({isValid:t})})}catch(e){return Promise.reject(e)}},[B]),de=n.useCallback(function(e,t){!function(e,t,n,r,i,o){var a=n.ref,l=n.ref.name,c=e.current[l];if(!i){var u=Fe(e,l,r);!_e(u)&&we(r.current,l,u)}a.type&&c?Ae(a)||xe(a)?Array.isArray(c.options)&&c.options.length?(Se(c.options).forEach(function(e,n){void 0===e&&(e={}),(je(e.ref)&&Ge(e,e.ref)||o)&&(Te(e.ref,t),ze(c.options,"["+n+"]"))}),c.options&&!Se(c.options).length&&delete e.current[l]):delete e.current[l]:(je(a)&&Ge(c,a)||o)&&(Te(a,t),delete e.current[l]):delete e.current[l]}(g,D.current,e,T,v,t),v&&(ze(N.current,e.ref.name),ze(S.current,e.ref.name))},[v]),me=n.useCallback(function(e){if(_.current)Z();else{for(var t,n=p(C.current);!(t=n()).done;)if(t.value.startsWith(e)){Z();break}le(e)}},[]),fe=n.useCallback(function(e,t){e&&(de(e,t),v&&!Se(e.options||[]).length&&(ze(z.current.errors,e.ref.name),we(z.current.dirtyFields,e.ref.name,!0),Z({isDirty:J()}),H.current.isValid&&A.current&&se(),me(e.ref.name)))},[se,de]),ve=n.useCallback(function(e,t,n){var r=n?O.current[n]:C.current,i=Ke(g,st(T.current),v,!1,e);if(Ye(e)){var o=lt(e)||e;return P.current.has(o)&&(i=Object.assign(Object.assign({},h.current),i)),ot(i,e,r,_e(De(w.current,e))?t:De(w.current,e),!0)}var a=_e(t)?w.current:t;return Array.isArray(e)?e.reduce(function(e,t){var n;return Object.assign(Object.assign({},e),((n={})[t]=ot(i,t,r,a),n))},{}):(_.current=_e(n),Ie(!Ve(i)&&i||a))},[]);function pe(e,t){if(void 0===t&&(t={}),"production"!==process.env.NODE_ENV){if(!e.name)return console.warn("📋 Field is missing `name` attribute",e,"https://react-hook-form.com/api#useForm");if(P.current.has(e.name.split(/\[\d+\]$/)[0])&&!RegExp(("^"+e.name.split(/\[\d+\]$/)[0]+"[\\d+].\\w+").replace(/\[/g,"\\[").replace(/\]/g,"\\]")).test(e.name))return console.warn('📋 `name` prop should be in object shape: name="test[index].name"',e,"https://react-hook-form.com/api#useFieldArray")}var n,r=e.name,i=e.type,o=e.value,a=Object.assign({ref:e},t),l=g.current,c=mt(e),u=ct(P.current,r),s=function(t){return ut&&(!ye(e)||t===e)},d=l[r],m=!0;if(d&&(c?Array.isArray(d.options)&&Se(d.options).find(function(e){return o===e.ref.value&&s(e.ref)}):s(d.ref)))l[r]=Object.assign(Object.assign({},d),t);else{d=i?c?Object.assign({options:[].concat(Se(d&&d.options||[]),[{ref:e}]),ref:{type:i,name:r}},t):Object.assign({},a):a,l[r]=d;var f=_e(De(T.current,r));Ve(w.current)&&f||(n=De(f?w.current:T.current,r),(m=_e(n))||u||$(r,n)),Ve(t)||(we(S.current,r,!0),!k&&H.current.isValid&&rt(g,B,d,T).then(function(e){var t=z.current.isValid;Ve(e)?we(N.current,r,!0):ze(N.current,r),t!==Ve(e)&&Z()})),!v||u&&m||!u&&ze(z.current.dirtyFields,r),i&&function(e,t,n){var r=e.ref;ye(r)&&n&&(r.addEventListener(t?"change":"input",n),r.addEventListener("blur",n))}(c&&d.options?d.options[d.options.length-1]:d,c||"select-one"===e.type,D.current)}}var Ee=n.useCallback(function(e,t){return function(n){try{n&&n.preventDefault&&(n.preventDefault(),n.persist());var r={},i=ce(Ke(g,st(T.current),v,!0));return H.current.isSubmitting&&Z({isSubmitting:!0}),Promise.resolve(function(o,a){try{var l=function(){function o(){var o=function(){if(Ve(r)&&Object.keys(z.current.errors).every(function(e){return e in g.current}))return Z({errors:{},isSubmitting:!0}),Promise.resolve(e(i,n)).then(function(){});var o=function(e){m&&function(e,t){for(var n in e)if(De(t,n)){var r=e[n];if(r){if(r.ref.focus&&_e(r.ref.focus()))break;if(r.options){r.options[0].ref.focus();break}}}}(g.current,z.current.errors)};return z.current.errors=Object.assign(Object.assign({},z.current.errors),r),t?Promise.resolve(t(z.current.errors,n)).then(o):o()}();if(o&&o.then)return o.then(function(){})}var a=A.current?Promise.resolve(A.current(i,R.current,B)).then(function(e){var t=e.values;z.current.errors=r=e.errors,i=t}):te(Object.values(g.current),function(e){var t=function(){if(e){var t=e.ref.name;return Promise.resolve(rt(g,B,e,T)).then(function(e){e[t]?(we(r,t,e[t]),ze(N.current,t)):De(S.current,t)&&(ze(z.current.errors,t),we(N.current,t,!0))})}}();if(t&&t.then)return t.then(function(){})});return a&&a.then?a.then(o):o()}()}catch(e){return a(!0,e)}return l&&l.then?l.then(a.bind(null,!1),a.bind(null,!0)):a(!1,l)}(0,function(e,t){if(z.current.isSubmitting=!1,Z({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Ve(z.current.errors),submitCount:z.current.submitCount+1}),e)throw t;return t}))}catch(n){return Promise.reject(n)}}},[m,B]);n.useEffect(function(){l&&H.current.isValid&&se(),G.current=G.current||!ut?G.current:function(e,t){var n=new MutationObserver(function(){for(var n=0,r=Object.values(e.current);n<r.length;n++){var i=r[n];if(i&&i.options)for(var o,a=p(i.options);!(o=a()).done;){var l=o.value;l&&l.ref&&je(l.ref)&&t(i)}else i&&je(i.ref)&&t(i)}});return n.observe(window.document,{childList:!0,subtree:!0}),n}(g,fe)},[fe,w.current]),n.useEffect(function(){return function(){G.current&&G.current.disconnect(),I.current=!0,"production"===process.env.NODE_ENV&&Object.values(g.current).forEach(function(e){return fe(e,!0)})}},[]),!l&&H.current.isValid&&(j.isValid=Xe(N.current,S.current)&&Ve(z.current.errors));var ge={trigger:re,setValue:n.useCallback(function(e,t,n){oe(e,t,n||{}),ae(e)&&Z(),le(e)},[oe,re]),getValues:n.useCallback(ue,[]),register:n.useCallback(function(e,t){if(!ft)if(Ye(e))pe({name:e},t);else{if(!Oe(e)||!("name"in e))return function(t){return t&&pe(t,e)};pe(e,t)}},[w.current]),unregister:n.useCallback(function(e){for(var t,n=p(Array.isArray(e)?e:[e]);!(t=n()).done;)fe(g.current[t.value],!0)},[]),formState:vt?new Proxy(j,{get:function(e,t){if("production"!==process.env.NODE_ENV&&"isValid"===t&&k&&console.warn("📋 `formState.isValid` is applicable with `onTouched`, `onChange` or `onBlur` mode. https://react-hook-form.com/api#formState"),t in e)return H.current[t]=!0,e[t]}}):j},Ce=n.useMemo(function(){return Object.assign({isFormDirty:J,updateWatchedValue:me,shouldUnregister:v,updateFormState:Z,removeFieldEventListener:de,watchInternal:ve,mode:x.current,reValidateMode:{isReValidateOnBlur:q,isReValidateOnChange:X},validateResolver:l?se:void 0,fieldsRef:g,resetFieldArrayFunctionRef:L,useWatchFieldsRef:O,useWatchRenderFunctionsRef:b,fieldArrayDefaultValuesRef:y,validFieldsRef:N,fieldsWithValidationRef:S,fieldArrayNamesRef:P,readFormStateRef:H,formStateRef:z,defaultValuesRef:w,shallowFieldsStateRef:T,fieldArrayValuesRef:h},ge)},[w.current,me,v,de,ve]);return Object.assign({watch:function(e,t){return ve(e,t)},control:Ce,handleSubmit:Ee,reset:n.useCallback(function(e,t){if(void 0===t&&(t={}),ut)for(var n=0,r=Object.values(g.current);n<r.length;n++){var i=r[n];if(i){var o=i.ref,a=i.options,l=mt(o)&&Array.isArray(a)?a[0].ref:o;if(ye(l))try{l.closest("form").reset();break}catch(e){}}}var c,u,s,d,m,f,p,E;g.current={},w.current=Object.assign({},e||w.current),e&&le(""),Object.values(L.current).forEach(function(e){return Qe(e)&&e()}),T.current=v?{}:st(e||w.current),u=(c=t).errors,s=c.isDirty,d=c.isSubmitted,m=c.touched,p=c.submitCount,E=c.dirtyFields,(f=c.isValid)||(N.current={},S.current={}),y.current={},C.current=new Set,_.current=!1,Z({submitCount:p?z.current.submitCount:0,isDirty:!!s&&z.current.isDirty,isSubmitted:!!d&&z.current.isSubmitted,isValid:!!f&&z.current.isValid,dirtyFields:E?z.current.dirtyFields:{},touched:m?z.current.touched:{},errors:u?z.current.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})},[]),clearErrors:n.useCallback(function(e){e&&(Array.isArray(e)?e:[e]).forEach(function(e){return g.current[e]&&be(e)?delete z.current.errors[e]:ze(z.current.errors,e)}),Z({errors:e?z.current.errors:{}})},[]),setError:n.useCallback(function(e,t){var n=(g.current[e]||{}).ref;we(z.current.errors,e,Object.assign(Object.assign({},t),{ref:n})),Z({isValid:!1}),t.shouldFocus&&n&&n.focus&&n.focus()},[]),errors:j.errors},ge)}({defaultValues:Digit.SessionStorage.get("AUDIT_APPLICATION_DETAIL")||{offset:0,limit:5,sortOrder:"DESC"}}),s=u.register,m=u.control,f=u.handleSubmit,v=u.setValue,E=u.getValues,g=u.reset,y=function(e){if(null==e||null==e||""==e)return"NA";var t=new Date(e),n=t.getMonth()+1,r=t.getDate();return(r=(r>9?"":"0")+r)+"/"+(n=(n>9?"":"0")+n)+"/"+t.getFullYear()},h=function(e){if(null==e||null==e||""==e)return"NA";var t=new Date(e),n=t.getHours(),r=t.getMinutes(),i=n>12?"PM":"AM";return(n=((n=n>12?n-12:n)>9?"":"0")+n)+":"+(r=(r>9?"":"0")+r)+" "+i},C=n.useState([]),O=C[0],b=C[1],S=function(e){return r.createElement("div",{onClick:e.onClick},r.createElement(t.DownloadBtnCommon,null))};n.useEffect(function(){s("offset",0),s("limit",5),s("sortOrder","DESC")},[s]),n.useEffect(function(){(null==l?void 0:l.length)>0&&b([null==l?void 0:l.map(function(e){var t={};return t[o("AUDIT_DATE_LABEL")]=y(null==e?void 0:e.timestamp),t[o("AUDIT_TIME_LABEL")]=h(null==e?void 0:e.timestamp),t[o("AUDIT_DATAVIEWED_LABEL")]=(null==e?void 0:e.dataView[0])+","+(null==e?void 0:e.dataView[1]),t[o("AUDIT_DATAVIEWED_BY_LABEL")]=null==e?void 0:e.dataViewedBy,t[o("AUDIT_ROLE_LABEL")]=null==e?void 0:e.roles.map(function(e){return e.name}).join(","),d({},t)})])},[l]);var N=n.useCallback(function(e){0!==e.length&&(v("sortBy",e.id),v("sortOrder",e.desc?"DESC":"ASC"))},[]);function w(){v("offset",E("offset")-E("limit")),f(a)()}var I=window.Digit.Utils.browser.isMobile();if(I)return r.createElement(wt,{Controller:Ot,register:s,control:m,t:o,reset:g,previousPage:w,handleSubmit:f,tenantId:i,data:l,onSubmit:a});var _=function(e){return r.createElement("span",{className:"cell-text"},e)},D=n.useMemo(function(){return[{Header:o("AUDIT_DATE_LABEL"),disableSortBy:!0,accessor:function(e){var t="NA"===e.timestamp?o("WS_NA"):y(e.timestamp);return _(""+t)}},{Header:o("AUDIT_TIME_LABEL"),disableSortBy:!0,accessor:function(e){var t="NA"===e.timestamp?o("WS_NA"):h(e.timestamp);return _(""+t)}},{Header:o(I?"AUDIT_DATAVIEWED_LABEL":"AUDIT_DATAVIEWED_PRIVACY"),disableSortBy:!0,accessor:function(e){return _(""+(null==e?void 0:e.dataView))}},{Header:o(I?"AUDIT_DATAVIEWED_BY_LABEL":"AUDIT_DATAVIEWED_BY_PRIVACY"),disableSortBy:!0,accessor:function(e){return _(""+(null==e?void 0:e.dataViewedBy))}},{Header:o("AUDIT_ROLE_LABEL"),disableSortBy:!0,accessor:function(e){var t;return _(""+(null==e||null===(t=e.roles.slice(0,3))||void 0===t?void 0:t.map(function(e){return e.name})))}}]},[]);return r.createElement(r.Fragment,null,r.createElement("div",{style:{marginRight:"-70px"}}," ",r.createElement(t.BackButton,null)," "),r.createElement("div",{style:{marginTop:"30px",marginLeft:"30px"}}," ",r.createElement(t.Header,null,o("PRIVACY_AUDIT_REPORT"))," "),r.createElement(t.SearchForm,{className:"audit-card",onSubmit:a,handleSubmit:f},r.createElement(bt,{register:s,control:m,reset:g,tenantId:i,t:o,previousPage:w})),r.createElement("div",{style:{marginTop:"240px",marginLeft:"-55%",maxWidth:"80%",marginRight:"52px"}},null!=l&&l.display?r.createElement("div",{style:{marginTop:"20x",width:"1025px",marginLeft:"25px",backgroundColor:"white",height:"60px"}},o(l.display).split("\\n").map(function(e,t){return r.createElement("p",{key:t,style:{textAlign:"center"}},e)})):""!==l?r.createElement("div",{style:{backgroundColor:"white",marginRight:"-30px",marginLeft:"30px"}},r.createElement("div",{className:"sideContent",style:{float:"right",padding:"10px 30px"}},r.createElement(S,{className:"mrlg cursorPointer",onClick:function(){return function(e){if(void 0!==(null==e?void 0:e[0]))return Digit.Download.Excel(null==e?void 0:e[0],"AuditReport")}(O)}})),r.createElement(t.Table,{t:o,data:l,totalRecords:c,columns:D,getCellProps:function(e){return{style:{minWidth:e.column.Header===o("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}},onPageSizeChange:function(e){v("limit",Number(e.target.value)),f(a)()},currentPage:E("offset")/E("limit"),onNextPage:function(){v("offset",E("offset")+E("limit")),f(a)()},onPrevPage:w,manualPagination:!1,pageSizeLimit:E("limit"),onSort:N,disableSort:!1,sortParams:[{id:E("sortBy"),desc:"DESC"===E("sortOrder")}]})):r.createElement(t.Loader,null)))},_t=function(e){var t,o,a=i.useTranslation().t,l=Digit.ULBService.getCitizenCurrentTenant(),c=n.useState({}),u=c[0],s=c[1],m=function(e,t){void 0===t&&(t="dayend");try{var n=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),r=new Date(Date.UTC(n[1],n[2]-1,n[3]));return r.setMinutes(r.getMinutes()+r.getTimezoneOffset()),"dayend"===t&&(r.setHours(r.getHours()+24),r.setSeconds(r.getSeconds()-1)),r.getTime()}catch(t){return e}};n.useEffect(function(){var e=Digit.SessionStorage.get("AUDIT_APPLICATION_DETAIL")||{};if(e){var t=d({},e);s(Object.keys(t).filter(function(e){return t[e]}).reduce(function(e,n){var r;return d({},e,((r={})[n]="object"==typeof t[n]?t[n].code:t[n],r))},{}))}},[]);var f={enabled:!!(u&&Object.keys(u).length>0)},v=d({},u),p=Digit.Hooks.useAudit({tenantId:l,filters:d({},v),config:f}),E=p.data;return r.createElement(It,{t:a,tenantId:l,onSubmit:function(e){Digit.SessionStorage.set("AUDIT_APPLICATION_DETAIL",{offset:0,limit:5,sortBy:"commencementDate",sortOrder:"DESC"});var t=d({},e,{fromDate:m(null==e?void 0:e.fromDate),toDate:m(null==e?void 0:e.toDate)});s(Object.keys(t).filter(function(e){return t[e]}).reduce(function(e,n){var r;return d({},e,((r={})[n]=t[n],r))},{}))},data:p.isLoading?"":(null==E||null===(t=E.ElasticSearchData)||void 0===t?void 0:t.length)>0?null==E?void 0:E.ElasticSearchData:{display:"ES_COMMON_NO_DATA"},count:null==E||null===(o=E.ElasticSearchData)||void 0===o?void 0:o.length})},Dt=function(e){var n,o,a,l,c,u,s,d,m,f,v,p,E,g,y,h,C=e.moduleCode,O=i.useTranslation().t,b=Digit.ULBService.getCitizenCurrentTenant(),S=Digit.Hooks.useStaticData(Digit.ULBService.getStateId()),N=S.isLoading,w=S.data,I=Digit.Hooks.useDynamicData({moduleCode:C,tenantId:b,filters:{},t:O}),_=I.error,D=I.data,T=function(e){var n=e.styles;switch(e.module){case"TL":return r.createElement(t.CaseIcon,{className:"fill-path-primary-main",styles:n});case"PT":return r.createElement(t.PTIcon,{className:"fill-path-primary-main",styles:n});case"MCOLLECT":return r.createElement(t.MCollectIcon,{className:"fill-path-primary-main",styles:n});case"PGR":return r.createElement(t.ComplaintIcon,{className:"fill-path-primary-main",styles:n});default:return r.createElement(t.CaseIcon,{className:"fill-path-primary-main",styles:n})}},L=null==w||null===(n=w.MdmsRes["common-masters"])||void 0===n||null===(o=n.StaticData[0])||void 0===o?void 0:o[""+C],R=function(e){switch(e.module){case"PT":case"WS":return r.createElement("span",{className:"timerIcon"},r.createElement(t.TimerIcon,null));default:return null}},A=function(e){switch(e.module){case"PT":return r.createElement("span",{className:"rupeeSymbol"},r.createElement(t.RupeeSymbol,null));case"WS":return r.createElement("span",{className:"timerIcon"},r.createElement(t.TimerIcon,null));default:return null}},P=function(e){switch(e){case"TL":case"PT":case"MCOLLECT":return{staticCommonContent:O("COMMON_VALIDITY"),validity:(null==L?void 0:L.validity)+O("1"===(null==L?void 0:L.validity)?"COMMON_DAY":"COMMON_DAYS")};case"PGR":return{staticCommonContent:O("ACTION_TEST_COMPLAINT_TYPES")};case"OBPS":return{staticCommonContent:O("BUILDING_PLAN_PERMIT_VALIDITY"),validity:(null==L?void 0:L.validity)+" "+O("1"===(null==L?void 0:L.validity)?"COMMON_DAY":"COMMON_DAYS")};default:return{staticCommonContent:""}}},x=function(e){switch(e){case"PT":return{staticDataOne:(null==L?void 0:L.staticDataOne)+" "+O("COMMON_DAYS"),staticDataOneHeader:O("APPLICATION_PROCESSING_TIME"),staticDataTwo:null==L?void 0:L.staticDataTwo,staticDataTwoHeader:O("APPLICATION_PROCESSING_FEE")};case"WS":return{staticDataOne:"",staticDataOneHeader:O("PAY_WATER_CHARGES_BY")+" "+(null==L?void 0:L.staticDataOne)+" "+O("COMMON_DAYS")+" "+O("OF_BILL_GEN_TO_AVOID_LATE_FEE"),staticDataTwo:(null==L?void 0:L.staticDataTwo)+" "+O("COMMON_DAYS"),staticDataTwoHeader:O("APPLICATION_PROCESSING_TIME")};default:return{}}};return N||I.isLoading?r.createElement(t.Loader,null):L?r.createElement(r.Fragment,null,L&&null!=L&&L.payViaWhatsApp?r.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},r.createElement("div",{className:"pay-whatsapp-card",onClick:function(){window.open(null==L?void 0:L.payViaWhatsApp)}},r.createElement("div",{className:"pay-whatsapp-text"},O("PAY_VIA_WHATSAPP")),r.createElement("div",{className:"whatsAppIconG"},r.createElement(t.WhatsappIconGreen,null)))):null,L&&null!=L&&L.helpline?r.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},r.createElement("div",{className:"static-home-Card"},r.createElement("div",{className:"static-home-Card-header"},O("CALL_CENTER_HELPLINE")),r.createElement("div",{className:"helplineIcon"},r.createElement(t.HelpLineIcon,null))),r.createElement("div",{className:"call-center-card-text"},null!=L&&null!==(a=L.helpline)&&void 0!==a&&a.contactOne?r.createElement("div",{className:"call-center-card-content"},r.createElement("a",{href:"tel:"+(null==L||null===(l=L.helpline)||void 0===l?void 0:l.contactOne)},null==L||null===(c=L.helpline)||void 0===c?void 0:c.contactOne)):null,null!=L&&null!==(u=L.helpline)&&void 0!==u&&u.contactTwo?r.createElement("div",{className:"call-center-card-content"},r.createElement("a",{href:"tel:"+(null==L||null===(s=L.helpline)||void 0===s?void 0:s.contactTwo)},null==L||null===(d=L.helpline)||void 0===d?void 0:d.contactTwo)):null)):null,L&&null!=L&&L.serviceCenter?r.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},r.createElement("div",{className:"static-home-Card"},r.createElement("div",{className:"static-home-Card-header"},O("CITIZEN_SERVICE_CENTER")),r.createElement("div",{className:"serviceCentrIcon"},r.createElement(t.ServiceCenterIcon,null))),r.createElement("div",{className:"service-center-details-card"},r.createElement("div",{className:"service-center-details-text"},null==L?void 0:L.serviceCenter)),null!=L&&L.viewMapLocation?r.createElement("div",{className:"link"},r.createElement("a",{href:null==L?void 0:L.viewMapLocation},O("VIEW_ON_MAP"))):null):r.createElement("div",null),r.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},_||null==D||null===(null==D?void 0:D.dynamicDataOne)?r.createElement("div",null):r.createElement("div",{className:"dynamicDataCard"},r.createElement("div",{className:"dynamicData"},r.createElement(T,{module:C,styles:{width:"24px",height:"24px"}}),r.createElement("span",{className:"dynamicData-content"},null==D?void 0:D.dynamicDataOne))),_||null==D||null===(null==D?void 0:D.dynamicDataTwo)?r.createElement("div",null):r.createElement("div",{className:"dynamicDataCard"},r.createElement("div",{className:"dynamicData"},r.createElement(T,{module:C,styles:{width:"24px",height:"24px"}}),r.createElement("span",{className:"dynamicData-content"},null==D?void 0:D.dynamicDataTwo))),L&&null!=L&&L.staticDataOne?r.createElement("div",{className:"staticDataCard"},r.createElement("div",{className:"staticData"},r.createElement(R,{module:C}),r.createElement("span",{className:"static-data-content"},r.createElement("span",{className:"static-data-content-first",style:{marginTop:""===(null===(m=x(C))||void 0===m?void 0:m.staticDataOne)?"8px":"unset"}},null===(f=x(C))||void 0===f?void 0:f.staticDataOneHeader),r.createElement("span",{className:"static-data-content-second"},""+(null===(v=x(C))||void 0===v?void 0:v.staticDataOne))))):r.createElement("div",null),L&&null!=L&&L.staticDataTwo?r.createElement("div",{className:"staticDataCard"},r.createElement("div",{className:"staticData"},r.createElement(A,{module:C}),r.createElement("span",{className:"static-data-content"},r.createElement("span",{className:"static-data-content-first"},null===(p=x(C))||void 0===p?void 0:p.staticDataTwoHeader),r.createElement("span",{className:"static-data-content-second"},null===(E=x(C))||void 0===E?void 0:E.staticDataTwo)))):r.createElement("div",null),L&&null!=L&&L.validity?r.createElement("div",{className:"staticDataCard"},r.createElement("div",{className:"staticData"},r.createElement("span",{className:"validityIcon"},r.createElement(t.ValidityTimeIcon,null)),r.createElement("span",{className:"static-data-content"},r.createElement("span",{className:"static-data-content-first"},null===(g=P(C))||void 0===g?void 0:g.staticCommonContent),r.createElement("span",{className:"static-data-content-second"},null===(y=P(C))||void 0===y?void 0:y.validity)))):r.createElement("div",null),_||null==D||null==D||!D.staticData||null===(null==D?void 0:D.staticData)?r.createElement("div",null):r.createElement("div",{className:"staticDataCard"},r.createElement("div",{className:"staticData"},"PGR"===C?r.createElement(T,{module:C,styles:{width:"24px",height:"24px",marginLeft:"13px",marginTop:"12px"}}):r.createElement("span",{className:"validityIcon"},r.createElement(t.ValidityTimeIcon,null)),r.createElement("span",{className:"static-data-content"},r.createElement("span",{className:"static-data-content-first"},null===(h=P(C))||void 0===h?void 0:h.staticCommonContent),r.createElement("span",{className:"static-data-content-second"},null==D?void 0:D.staticData)))))):r.createElement(r.Fragment,null)},Tt=[(null===(Et=window)||void 0===Et?void 0:Et.contextPath)+"/citizen/register/name","/"+(null===(gt=window)||void 0===gt?void 0:gt.contextPath)+"/citizen/select-language","/"+(null===(yt=window)||void 0===yt?void 0:yt.contextPath)+"/citizen/select-location","/"+(null===(ht=window)||void 0===ht?void 0:ht.contextPath)+"/citizen/login","/"+(null===(Ct=window)||void 0===Ct?void 0:Ct.contextPath)+"/citizen/register/otp"],Lt=function(e,t){return t.filter(function(t){return e.map(function(e){return e.code}).includes(t.code)})},Rt=function(e){var n,o,a,c=e.stateInfo,u=e.userDetails,s=e.CITIZEN,d=e.cityDetails,m=e.mobileView,f=e.handleUserDropdownSelection,v=e.logoUrl,p=e.stateCode,E=e.modules,y=e.appTenants,O=e.pathname,b=e.initData,N=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"ACCESSCONTROL-ACTIONS-TEST",[{name:"actions-test",filter:"[?(@.url == '"+window.contextPath+"-card')]"}],{select:function(e){var t,n;return null==e||null===(t=e["ACCESSCONTROL-ACTIONS-TEST"])||void 0===t||null===(n=t["actions-test"])||void 0===n?void 0:n.filter(function(e){return!0===e.enabled}).reduce(function(e,t){var n;return e[t.parentModule]=(null===(n=e[t.parentModule])||void 0===n?void 0:n.length)>0?[t].concat(e[t.parentModule]):[t],e},{})}}),w=N.isLoading,I=N.data,_=N.isFetched,D=Digit.Hooks.useRouteSubscription(O),T=i.useTranslation().t,L=l.useRouteMatch().path,R=l.useHistory(),A=Tt.some(function(e){return window.location.href.includes(e)}),P=E.map(function(e,t){var n=e.code,i=e.tenants,o=Digit.ComponentRegistryService.getComponent(n+"Module");return o?r.createElement(l.Route,{key:t,path:L+"/"+n.toLowerCase()},r.createElement(o,{stateCode:p,moduleCode:n,userType:"citizen",tenants:Lt(i,y)})):null}),x=E.map(function(e,n){var i=e.code,o=e.bannerImage,a=(Digit.ComponentRegistryService.getComponent(i+"Links"),_?C(I,i,T):void 0);return"ACTION_TEST_WS"===(null==a?void 0:a.header)&&(null==a||a.links.sort(function(e,t){return t.orderNumber-e.orderNumber})),r.createElement(r.Fragment,null,r.createElement(l.Route,{key:n,path:L+"/"+i.toLowerCase()+"-home"},r.createElement("div",{className:"moduleLinkHomePage"},r.createElement("img",{src:o||(null==c?void 0:c.bannerUrl),alt:"noimagefound"}),r.createElement(t.BackButton,{className:"moduleLinkHomePageBackButton"}),r.createElement("h1",null,T("MODULE_"+i.toUpperCase())),r.createElement("div",{className:"moduleLinkHomePageModuleLinks"},a&&r.createElement(t.CitizenHomeCard,{header:T(null==a?void 0:a.header),links:null==a?void 0:a.links,Icon:function(){return r.createElement("span",null)},Info:"OBPS"===i?function(){return r.createElement(t.CitizenInfoLabel,{style:{margin:"0px",padding:"10px"},info:T("CS_FILE_APPLICATION_INFO_LABEL"),text:T("BPA_CITIZEN_HOME_STAKEHOLDER_INCLUDES_INFO_LABEL")})}:null,isInfo:"OBPS"===i})),r.createElement(Dt,{moduleCode:null==i?void 0:i.toUpperCase()}))),r.createElement(l.Route,{key:"faq"+n,path:L+"/"+i.toLowerCase()+"-faq"},r.createElement(X,{module:null==i?void 0:i.toUpperCase()})),r.createElement(l.Route,{key:"hiw"+n,path:L+"/"+i.toLowerCase()+"-how-it-works"},r.createElement(ae,{module:null==i?void 0:i.toUpperCase()})))});return r.createElement("div",{className:D},r.createElement(W,{t:T,stateInfo:c,userDetails:u,CITIZEN:s,cityDetails:d,mobileView:m,handleUserDropdownSelection:f,logoUrl:v,showSidebar:!0,linkData:I,islinkDataLoading:w}),r.createElement("div",{className:"main center-container citizen-home-container mb-25"},A?null:r.createElement("div",{className:"SideBarStatic"},r.createElement(U,{linkData:I,islinkDataLoading:w})),r.createElement(l.Switch,null,r.createElement(l.Route,{exact:!0,path:L},r.createElement(Z,null)),r.createElement(l.Route,{exact:!0,path:L+"/select-language"},r.createElement(Y,null)),r.createElement(l.Route,{exact:!0,path:L+"/select-location"},r.createElement(K,null)),r.createElement(l.Route,{path:L+"/error"},r.createElement(g,{initData:b,goToHome:function(){var e;R.push("/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/citizen")}})),r.createElement(l.Route,{path:L+"/all-services"},r.createElement(S,{userType:"citizen",modules:E,getCitizenMenu:I,fetchedCitizen:_,isLoading:w})),r.createElement(l.Route,{path:L+"/login"},r.createElement(ge,{stateCode:p})),r.createElement(l.Route,{path:L+"/register"},r.createElement(ge,{stateCode:p,isUserRegistered:!1})),r.createElement(l.Route,{path:L+"/user/profile"},r.createElement(oe,{stateCode:p,userType:"citizen",cityDetails:d})),r.createElement(l.Route,{path:L+"/Audit"},r.createElement(_t,null)),r.createElement(h,{initData:b},P,x))),r.createElement("div",{className:"citizen-home-footer",style:window.location.href.includes("citizen/obps")?{zIndex:"-1"}:{}},r.createElement("img",{alt:"Powered by DIGIT",src:null===(n=window)||void 0===n||null===(o=n.globalConfigs)||void 0===o||null===(a=o.getConfig)||void 0===a?void 0:a.call(o,"DIGIT_FOOTER"),style:{height:"1.2em",cursor:"pointer"},onClick:function(){var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})))};function At(e,t){return e(t={exports:{}},t.exports),t.exports}var Pt="function"==typeof Symbol&&Symbol.for,xt=Pt?Symbol.for("react.element"):60103,Mt=Pt?Symbol.for("react.portal"):60106,kt=Pt?Symbol.for("react.fragment"):60107,Ut=Pt?Symbol.for("react.strict_mode"):60108,Bt=Pt?Symbol.for("react.profiler"):60114,Ft=Pt?Symbol.for("react.provider"):60109,jt=Pt?Symbol.for("react.context"):60110,Vt=Pt?Symbol.for("react.async_mode"):60111,Ht=Pt?Symbol.for("react.concurrent_mode"):60111,zt=Pt?Symbol.for("react.forward_ref"):60112,Gt=Pt?Symbol.for("react.suspense"):60113,Wt=Pt?Symbol.for("react.suspense_list"):60120,qt=Pt?Symbol.for("react.memo"):60115,Xt=Pt?Symbol.for("react.lazy"):60116,Zt=Pt?Symbol.for("react.block"):60121,Yt=Pt?Symbol.for("react.fundamental"):60117,Kt=Pt?Symbol.for("react.responder"):60118,$t=Pt?Symbol.for("react.scope"):60119;function Jt(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case xt:switch(e=e.type){case Vt:case Ht:case kt:case Bt:case Ut:case Gt:return e;default:switch(e=e&&e.$$typeof){case jt:case zt:case Xt:case qt:case Ft:return e;default:return t}}case Mt:return t}}}function Qt(e){return Jt(e)===Ht}var en={AsyncMode:Vt,ConcurrentMode:Ht,ContextConsumer:jt,ContextProvider:Ft,Element:xt,ForwardRef:zt,Fragment:kt,Lazy:Xt,Memo:qt,Portal:Mt,Profiler:Bt,StrictMode:Ut,Suspense:Gt,isAsyncMode:function(e){return Qt(e)||Jt(e)===Vt},isConcurrentMode:Qt,isContextConsumer:function(e){return Jt(e)===jt},isContextProvider:function(e){return Jt(e)===Ft},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===xt},isForwardRef:function(e){return Jt(e)===zt},isFragment:function(e){return Jt(e)===kt},isLazy:function(e){return Jt(e)===Xt},isMemo:function(e){return Jt(e)===qt},isPortal:function(e){return Jt(e)===Mt},isProfiler:function(e){return Jt(e)===Bt},isStrictMode:function(e){return Jt(e)===Ut},isSuspense:function(e){return Jt(e)===Gt},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===kt||e===Ht||e===Bt||e===Ut||e===Gt||e===Wt||"object"==typeof e&&null!==e&&(e.$$typeof===Xt||e.$$typeof===qt||e.$$typeof===Ft||e.$$typeof===jt||e.$$typeof===zt||e.$$typeof===Yt||e.$$typeof===Kt||e.$$typeof===$t||e.$$typeof===Zt)},typeOf:Jt},tn=At(function(e,t){"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,i=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,s=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,m=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,v=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,E=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,h=e?Symbol.for("react.scope"):60119;function C(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:var f=e.type;switch(f){case u:case s:case i:case a:case o:case m:return f;default:var E=f&&f.$$typeof;switch(E){case c:case d:case p:case v:case l:return E;default:return t}}case r:return t}}}var O=s,b=c,S=l,N=n,w=d,I=i,_=p,D=v,T=r,L=a,R=o,A=m,P=!1;function x(e){return C(e)===s}t.AsyncMode=u,t.ConcurrentMode=O,t.ContextConsumer=b,t.ContextProvider=S,t.Element=N,t.ForwardRef=w,t.Fragment=I,t.Lazy=_,t.Memo=D,t.Portal=T,t.Profiler=L,t.StrictMode=R,t.Suspense=A,t.isAsyncMode=function(e){return P||(P=!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.")),x(e)||C(e)===u},t.isConcurrentMode=x,t.isContextConsumer=function(e){return C(e)===c},t.isContextProvider=function(e){return C(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return C(e)===d},t.isFragment=function(e){return C(e)===i},t.isLazy=function(e){return C(e)===p},t.isMemo=function(e){return C(e)===v},t.isPortal=function(e){return C(e)===r},t.isProfiler=function(e){return C(e)===a},t.isStrictMode=function(e){return C(e)===o},t.isSuspense=function(e){return C(e)===m},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===s||e===a||e===o||e===m||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===v||e.$$typeof===l||e.$$typeof===c||e.$$typeof===d||e.$$typeof===g||e.$$typeof===y||e.$$typeof===h||e.$$typeof===E)},t.typeOf=C}()}),nn=At(function(e){e.exports="production"===process.env.NODE_ENV?en:tn}),rn=Object.getOwnPropertySymbols,on=Object.prototype.hasOwnProperty,an=Object.prototype.propertyIsEnumerable;function ln(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var cn=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 t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,r,i=ln(e),o=1;o<arguments.length;o++){for(var a in n=Object(arguments[o]))on.call(n,a)&&(i[a]=n[a]);if(rn){r=rn(n);for(var l=0;l<r.length;l++)an.call(n,r[l])&&(i[r[l]]=n[r[l]])}}return i},un="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",sn=Function.call.bind(Object.prototype.hasOwnProperty),dn=function(){};if("production"!==process.env.NODE_ENV){var mn=un,fn={},vn=sn;dn=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function pn(e,t,n,r,i){if("production"!==process.env.NODE_ENV)for(var o in e)if(vn(e,o)){var a;try{if("function"!=typeof e[o]){var l=Error((r||"React class")+": "+n+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw l.name="Invariant Violation",l}a=e[o](t,o,r,n,null,mn)}catch(e){a=e}if(!a||a instanceof Error||dn((r||"React class")+": type specification of "+n+" `"+o+"` 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 fn)){fn[a.message]=!0;var c=i?i():"";dn("Failed "+n+" type: "+a.message+(null!=c?c:""))}}}pn.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(fn={})};var En=pn,gn=function(){};function yn(){return null}function hn(){}function Cn(){}"production"!==process.env.NODE_ENV&&(gn=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),Cn.resetWarningCache=hn;var On=At(function(e){e.exports="production"!==process.env.NODE_ENV?function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,r={array:l("array"),bigint:l("bigint"),bool:l("boolean"),func:l("function"),number:l("number"),object:l("object"),string:l("string"),symbol:l("symbol"),any:a(yn),arrayOf:function(e){return a(function(t,n,r,i,a){if("function"!=typeof e)return new o("Property `"+a+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var l=t[n];if(!Array.isArray(l))return new o("Invalid "+i+" `"+a+"` of type `"+s(l)+"` supplied to `"+r+"`, expected an array.");for(var c=0;c<l.length;c++){var u=e(l,c,r,i,a+"["+c+"]",un);if(u instanceof Error)return u}return null})},element:a(function(t,n,r,i,a){var l=t[n];return e(l)?null:new o("Invalid "+i+" `"+a+"` of type `"+s(l)+"` supplied to `"+r+"`, expected a single ReactElement.")}),elementType:a(function(e,t,n,r,i){var a=e[t];return nn.isValidElementType(a)?null:new o("Invalid "+r+" `"+i+"` of type `"+s(a)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return a(function(t,n,r,i,a){var l;return t[n]instanceof e?null:new o("Invalid "+i+" `"+a+"` of type `"+((l=t[n]).constructor&&l.constructor.name?l.constructor.name:"<<anonymous>>")+"` supplied to `"+r+"`, expected instance of `"+(e.name||"<<anonymous>>")+"`.")})},node:a(function(e,t,n,r,i){return u(e[t])?null:new o("Invalid "+r+" `"+i+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return a(function(t,n,r,i,a){if("function"!=typeof e)return new o("Property `"+a+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var l=t[n],c=s(l);if("object"!==c)return new o("Invalid "+i+" `"+a+"` of type `"+c+"` supplied to `"+r+"`, expected an object.");for(var u in l)if(sn(l,u)){var d=e(l,u,r,i,a+"."+u,un);if(d instanceof Error)return d}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&gn(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."),yn;function t(t,n,r,a,l){for(var c=t[n],u=0;u<e.length;u++)if(i(c,e[u]))return null;var s=JSON.stringify(e,function(e,t){return"symbol"===d(t)?String(t):t});return new o("Invalid "+a+" `"+l+"` of value `"+String(c)+"` supplied to `"+r+"`, expected one of "+s+".")}return a(t)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&gn("Invalid argument supplied to oneOfType, expected an instance of array."),yn;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return gn("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+m(n)+" at index "+t+"."),yn}return a(function(t,n,r,i,a){for(var l=[],c=0;c<e.length;c++){var u=(0,e[c])(t,n,r,i,a,un);if(null==u)return null;u.data&&sn(u.data,"expectedType")&&l.push(u.data.expectedType)}return new o("Invalid "+i+" `"+a+"` supplied to `"+r+"`"+(l.length>0?", expected one of type ["+l.join(", ")+"]":"")+".")})},shape:function(e){return a(function(t,n,r,i,a){var l=t[n],u=s(l);if("object"!==u)return new o("Invalid "+i+" `"+a+"` of type `"+u+"` supplied to `"+r+"`, expected `object`.");for(var m in e){var f=e[m];if("function"!=typeof f)return c(r,i,a,m,d(f));var v=f(l,m,r,i,a+"."+m,un);if(v)return v}return null})},exact:function(e){return a(function(t,n,r,i,a){var l=t[n],u=s(l);if("object"!==u)return new o("Invalid "+i+" `"+a+"` of type `"+u+"` supplied to `"+r+"`, expected `object`.");var m=cn({},t[n],e);for(var f in m){var v=e[f];if(sn(e,f)&&"function"!=typeof v)return c(r,i,a,f,d(v));if(!v)return new o("Invalid "+i+" `"+a+"` key `"+f+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var p=v(l,f,r,i,a+"."+f,un);if(p)return p}return null})}};function i(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function o(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function a(e){function t(t,n,r,i,a,l,c){if(i=i||"<<anonymous>>",l=l||r,c!==un){var u=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 u.name="Invariant Violation",u}return null==n[r]?t?new o(null===n[r]?"The "+a+" `"+l+"` is marked as required in `"+i+"`, but its value is `null`.":"The "+a+" `"+l+"` is marked as required in `"+i+"`, but its value is `undefined`."):null:e(n,r,i,a,l)}process;var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function l(e){return a(function(t,n,r,i,a,l){var c=t[n];return s(c)!==e?new o("Invalid "+i+" `"+a+"` of type `"+d(c)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null})}function c(e,t,n,r,i){return new o((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+i+"`.")}function u(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(u);if(null===t||e(t))return!0;var r=function(e){var t=e&&(n&&e[n]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!r)return!1;var i,o=r.call(t);if(r!==t.entries){for(;!(i=o.next()).done;)if(!u(i.value))return!1}else for(;!(i=o.next()).done;){var a=i.value;if(a&&!u(a[1]))return!1}return!0;default:return!1}}function s(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function d(e){if(null==e)return""+e;var t=s(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function m(e){var t=d(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return o.prototype=Error.prototype,r.checkPropTypes=En,r.resetWarningCache=En.resetWarningCache,r.PropTypes=r,r}(nn.isElement):function(){function e(e,t,n,r,i,o){if(o!==un){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 t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Cn,resetWarningCache:hn};return n.PropTypes=n,n}()}),bn=function(e){return r.createElement("div",{className:"banner banner-container"},e.children)},Sn=function(){var e=Digit.Hooks.useStore.getInitData(),n=e.isLoading,o=(e.data||{}).stateInfo,a=i.useTranslation().t;return n?r.createElement(t.Loader,null):r.createElement("div",{className:"bannerHeader"},r.createElement("img",{className:"bannerLogo",src:null==o?void 0:o.logoUrl}),r.createElement("p",null,a("TENANT_TENANTS_"+(null==o?void 0:o.code.toUpperCase()))))},Nn=function(e){var i,o,a,c=e.config,u=e.t,s=n.useState(null)[0],m=Digit.Hooks.useQueryParams(),f=m.mobile_number,v=m.tenantId,p=l.useHistory(),E=n.useState(""),g=E[0],y=E[1],h=n.useState(!0)[0],C=n.useState(null),O=C[0],b=C[1],S=function(){return Digit.UserService.getType()};n.useEffect(function(){var e,t;if(s){Digit.UserService.setUser(s);var n=(null===(e=location.state)||void 0===e?void 0:e.from)||"/"+(null===(t=window)||void 0===t?void 0:t.contextPath)+"/employee";p.replace(n)}else Digit.UserService.setType("employee")},[s]);var N=function(){b(null)},w=c.inputs,I=w[0],_=w[1],D=w[2],T=[{body:[{label:u(I.label),type:I.type,populators:{name:I.name},isMandatory:!0},{label:u(_.label),type:_.type,populators:{name:_.name},isMandatory:!0},{label:u(D.label),type:D.type,populators:{name:D.name},isMandatory:!0}]}];return r.createElement(bn,null,r.createElement("div",{className:"employeeBackbuttonAlign"},r.createElement(t.BackButton,{variant:"white",style:{borderBottom:"none"}})),r.createElement(t.FormComposer,{onSubmit:function(e){try{return Promise.resolve(ne(function(){if(e.newPassword!==e.confirmPassword)return b(u("ERR_PASSWORD_DO_NOT_MATCH"));var t=d({},e,{otpReference:g,tenantId:v,type:S().toUpperCase()});return Promise.resolve(Digit.UserService.changePassword(t,v)).then(function(e){!function(){var e;p.replace("/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/employee/user/login")}()})},function(e){var t,n,r,i,o;b((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(r=n.error)||void 0===r||null===(i=r.fields)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.message)||u("ES_SOMETHING_WRONG")),setTimeout(N,5e3)}))}catch(e){return Promise.reject(e)}},noBoxShadow:!0,inline:!0,submitInForm:!0,config:T,label:c.texts.submitButtonLabel,cardStyle:{maxWidth:"408px",margin:"auto"},className:"employeeChangePassword"},r.createElement(Sn,null),r.createElement(t.CardSubHeader,{style:{textAlign:"center"}}," ",c.texts.header," "),r.createElement(t.CardText,null,u("CS_LOGIN_OTP_TEXT")+" ",r.createElement("b",null," ",""+u("+ 91 - ")," ",f)),r.createElement(se,{t:u,userType:"employee",otp:g,onOtpChange:y,error:h,onResend:function(){try{var e=function(){setTimeout(N,5e3)},t={otp:{mobileNumber:f,userType:S().toUpperCase(),type:"passwordreset",tenantId:v}},n=ne(function(){return Promise.resolve(Digit.UserService.sendOtp(t,v)).then(function(){b(u("ES_OTP_RESEND"))})},function(e){var t,n;b((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error_description)||u("ES_INVALID_LOGIN_CREDENTIALS"))});return Promise.resolve(n&&n.then?n.then(e):e())}catch(e){return Promise.reject(e)}}})),O&&r.createElement(t.Toast,{error:!0,label:u(O),onClose:N}),r.createElement("div",{className:"EmployeeLoginFooter"},r.createElement("img",{alt:"Powered by DIGIT",src:null===(i=window)||void 0===i||null===(o=i.globalConfigs)||void 0===o||null===(a=o.getConfig)||void 0===a?void 0:a.call(o,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:function(){var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})," "))};Nn.propTypes={loginParams:On.any},Nn.defaultProps={loginParams:null};var wn=[{texts:{header:"CORE_COMMON_RESET_PASSWORD_LABEL",submitButtonLabel:"CORE_COMMON_CHANGE_PASSWORD"},inputs:[{label:"CORE_LOGIN_USERNAME",type:"text",name:"userName",error:"ERR_HRMS_INVALID_USERNAME"},{label:"CORE_LOGIN_NEW_PASSWORD",type:"password",name:"newPassword",error:"CORE_COMMON_REQUIRED_ERRMSG"},{label:"CORE_LOGIN_CONFIRM_NEW_PASSWORD",type:"password",name:"confirmPassword",error:"CORE_COMMON_REQUIRED_ERRMSG"}]}],In=function(){var e=i.useTranslation().t,t=l.useRouteMatch().path,o=n.useMemo(function(){return wn.map(function(t){var n={};for(var r in t.texts)n[r]=e(t.texts[r]);return d({},t,{texts:n})},[wn])});return r.createElement(l.Switch,null,r.createElement(l.Route,{path:""+t,exact:!0},r.createElement(Nn,{config:o[0],t:e})))},_n=[{texts:{header:"CORE_COMMON_FORGOT_PASSWORD_LABEL",description:"ES_FORGOT_PASSWORD_DESC",submitButtonLabel:"CORE_COMMON_CONTINUE"},inputs:[{label:"CORE_COMMON_MOBILE_NUMBER",type:"text",name:"mobileNumber",error:"ERR_HRMS_INVALID_MOBILE_NUMBER"},{label:"CORE_COMMON_CITY",type:"custom",name:"city",error:"ERR_HRMS_INVALID_CITY"}]}],Dn=function(e){var i,o,a,c=e.config,u=e.t,s=Digit.Hooks.useTenants(),m=s.data,f=s.isLoading,v=n.useState(null)[0],p=l.useHistory(),E=n.useState(null),g=E[0],y=E[1];n.useEffect(function(){var e,t;if(v){Digit.UserService.setUser(v);var n=(null===(e=location.state)||void 0===e?void 0:e.from)||"/"+(null===(t=window)||void 0===t?void 0:t.contextPath)+"/employee";p.replace(n)}else Digit.UserService.setType("employee")},[v]);var h=function(){y(null)},C=c.inputs,O=C[0],b=C[1],S=[{body:[{label:u(O.label),type:O.type,populators:{name:O.name,componentInFront:"+91"},isMandatory:!0},{label:u(b.label),type:b.type,populators:{name:b.name,customProps:{},component:function(e,n){return r.createElement(t.Dropdown,d({option:m,optionKey:"name",id:b.name,className:"login-city-dd",select:function(t){e.onChange(t)}},n))}},isMandatory:!0}]}];return f?r.createElement(t.Loader,null):r.createElement(bn,null,r.createElement("div",{className:"employeeBackbuttonAlign"},r.createElement(t.BackButton,{variant:"white",style:{borderBottom:"none"}})),r.createElement(t.FormComposer,{onSubmit:function(e){try{if(!e.city)return alert("Please Select City!"),Promise.resolve();var t={otp:{mobileNumber:e.mobileNumber,userType:Digit.UserService.getType().toUpperCase(),type:"passwordreset",tenantId:e.city.code}},n=ne(function(){return Promise.resolve(Digit.UserService.sendOtp(t,e.city.code)).then(function(){var t;p.push("/"+(null===(t=window)||void 0===t?void 0:t.contextPath)+"/employee/user/change-password?mobile_number="+e.mobileNumber+"&tenantId="+e.city.code)})},function(e){var t,n,r,i,o;y((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(r=n.error)||void 0===r||null===(i=r.fields)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.message)||"Invalid login credentials!"),setTimeout(h,5e3)});return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},noBoxShadow:!0,inline:!0,submitInForm:!0,config:S,label:c.texts.submitButtonLabel,secondaryActionLabel:c.texts.secondaryButtonLabel,onSecondayActionClick:function(){var e;p.replace("/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/employee/login")},heading:c.texts.header,description:c.texts.description,headingStyle:{textAlign:"center"},cardStyle:{maxWidth:"408px",margin:"auto"},className:"employeeForgotPassword"},r.createElement(Sn,null)),g&&r.createElement(t.Toast,{error:!0,label:u(g),onClose:h}),r.createElement("div",{className:"EmployeeLoginFooter"},r.createElement("img",{alt:"Powered by DIGIT",src:null===(i=window)||void 0===i||null===(o=i.globalConfigs)||void 0===o||null===(a=o.getConfig)||void 0===a?void 0:a.call(o,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:function(){var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})," "))};Dn.propTypes={loginParams:On.any},Dn.defaultProps={loginParams:null};var Tn=function(){var e=i.useTranslation().t,t=l.useRouteMatch().path,o=n.useMemo(function(){return _n.map(function(t){var n={};for(var r in t.texts)n[r]=e(t.texts[r]);return d({},t,{texts:n})},[_n])});return r.createElement(l.Switch,null,r.createElement(l.Route,{path:""+t,exact:!0},r.createElement(Dn,{config:o[0],t:e})))},Ln=function(e,t){return t.filter(function(t){var n;return null==e||null===(n=e.map)||void 0===n?void 0:n.call(e,function(e){return e.code}).includes(t.code)})},Rn=function(e){var t,n,i=e.stateCode,o=e.userType,a=e.modules,c=e.appTenants,u=(Digit,l.useRouteMatch().path),s=l.useLocation(),d=Digit.UserService.getUser();if(!d||null==d||!d.access_token||null==d||!d.info)return r.createElement(l.Redirect,{to:{pathname:"/"+(null===(n=window)||void 0===n?void 0:n.contextPath)+"/employee/user/login",state:{from:s.pathname+s.search}}});var m=a.map(function(e,t){var n,a=e.code,d=e.tenants,m=Digit.ComponentRegistryService.getComponent(a+"Module");return r.createElement(l.Route,{key:t,path:u+"/"+a.toLowerCase()},m?r.createElement(m,{stateCode:i,moduleCode:a,userType:o,tenants:Ln(d,c)}):r.createElement(l.Redirect,{to:{pathname:"/"+(null===(n=window)||void 0===n?void 0:n.contextPath)+"/employee/user/error?type=notfound",state:{from:s.pathname+s.search}}}))});return r.createElement("div",{className:"ground-container"},r.createElement(l.Switch,null,m,r.createElement(l.Route,{path:u+"/login"},r.createElement(l.Redirect,{to:{pathname:"/"+(null===(t=window)||void 0===t?void 0:t.contextPath)+"/employee/user/login",state:{from:s.pathname+s.search}}})),r.createElement(l.Route,{path:u+"/forgot-password"},r.createElement(Tn,null)),r.createElement(l.Route,{path:u+"/change-password"},r.createElement(In,null)),r.createElement(l.Route,null,r.createElement(S,{userType:o,modules:a}))))},An=function(){var e,o,a,c=Digit.Hooks.useStore.getInitData(),u=c.data,s=c.isLoading,d=i.useTranslation().t,m=l.useHistory(),f=u||{},v=f.languages,p=f.stateInfo,E=Digit.StoreData.getCurrentLanguage(),g=n.useState(E),y=g[0],h=g[1];return s?null:r.createElement(bn,null,r.createElement(t.Card,{className:"bannerCard removeBottomMargin"},r.createElement("div",{className:"bannerHeader"},r.createElement("img",{className:"bannerLogo",src:null==p?void 0:p.logoUrl,alt:"Digit"}),r.createElement("p",null,d("TENANT_TENANTS_"+(null==p?void 0:p.code.toUpperCase())))),r.createElement("div",{className:"language-selector",style:{justifyContent:"space-around",marginBottom:"24px",padding:"0 5%"}},v.map(function(e,n){return r.createElement("div",{className:"language-button-container",key:n},r.createElement(t.CustomButton,{selected:e.value===y,text:e.label,onClick:function(){return function(e){h(e.value),Digit.LocalizationService.changeLanguage(e.value,p.code)}(e)}}))})),r.createElement(t.SubmitBar,{style:{width:"100%"},label:d("CORE_COMMON_CONTINUE"),onSubmit:function(e){var t;m.push("/"+(null===(t=window)||void 0===t?void 0:t.contextPath)+"/employee/user/login")}})),r.createElement("div",{className:"EmployeeLoginFooter"},r.createElement("img",{alt:"Powered by DIGIT",src:null===(e=window)||void 0===e||null===(o=e.globalConfigs)||void 0===o||null===(a=o.getConfig)||void 0===a?void 0:a.call(o,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:function(){var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})," "))},Pn=[{texts:{header:"CORE_COMMON_LOGIN",submitButtonLabel:"CORE_COMMON_CONTINUE",secondaryButtonLabel:"CORE_COMMON_FORGOT_PASSWORD"},inputs:[{label:"CORE_LOGIN_USERNAME",type:"text",name:"username",error:"ERR_HRMS_INVALID_USER_ID"},{label:"CORE_LOGIN_PASSWORD",type:"password",name:"password",error:"ERR_HRMS_WRONG_PASSWORD"},{label:"CORE_COMMON_CITY",type:"custom",name:"city",error:"ERR_HRMS_INVALID_CITY"}]}],xn=["UserRequest"],Mn=function(e){var i,o,a,c=e.config,u=e.t,s=e.isDisabled,m=Digit.Hooks.useTenants(),v=m.data,p=m.isLoading,E=Digit.Hooks.useStore.getInitData().isLoading,g=n.useState(null),y=g[0],h=g[1],C=n.useState(null),O=C[0],b=C[1],S=n.useState(!1),N=S[0],w=S[1],I=l.useHistory();n.useEffect(function(){var e,t,n,r,i,o,a,l,c,u,s,d,m,f;if(y){Digit.SessionStorage.set("citizen.userRequestObject",y);var v,p,E,g,h=null==y||null===(e=y.info)||void 0===e||null===(t=e.roles)||void 0===t?void 0:t.filter(function(e){return e.tenantId===Digit.SessionStorage.get("Employee.tenantId")});(null==y||null===(n=y.info)||void 0===n||null===(r=n.roles)||void 0===r?void 0:r.length)>0&&(y.info.roles=h),Digit.UserService.setUser(y),v=null==y?void 0:y.info,p=null==y?void 0:y.access_token,g=(null===(E=JSON.parse(sessionStorage.getItem("Digit.locale")))||void 0===E?void 0:E.value)||"en_IN",localStorage.setItem("Employee.tenant-id",null==v?void 0:v.tenantId),localStorage.setItem("tenant-id",null==v?void 0:v.tenantId),localStorage.setItem("citizen.userRequestObject",JSON.stringify(v)),localStorage.setItem("locale",g),localStorage.setItem("Employee.locale",g),localStorage.setItem("token",p),localStorage.setItem("Employee.token",p),localStorage.setItem("user-info",JSON.stringify(v)),localStorage.setItem("Employee.user-info",JSON.stringify(v));var C,O,b,S,N,w,_,D="/"+(null===(i=window)||void 0===i?void 0:i.contextPath)+"/employee";null!==(o=window)&&void 0!==o&&null!==(a=o.location)&&void 0!==a&&null!==(l=a.href)&&void 0!==l&&l.includes("from=")&&(D=decodeURIComponent(null===(C=window)||void 0===C||null===(O=C.location)||void 0===O||null===(b=O.href)||void 0===b||null===(S=b.split("from="))||void 0===S?void 0:S[1])||"/"+(null===(N=window)||void 0===N?void 0:N.contextPath)+"/employee"),null!=y&&null!==(c=y.info)&&void 0!==c&&c.roles&&null!=y&&null!==(u=y.info)&&void 0!==u&&null!==(s=u.roles)&&void 0!==s&&s.every(function(e){return"NATADMIN"===e.code})&&(D="/"+(null===(w=window)||void 0===w?void 0:w.contextPath)+"/employee/dss/landing/NURT_DASHBOARD"),null!=y&&null!==(d=y.info)&&void 0!==d&&d.roles&&null!=y&&null!==(m=y.info)&&void 0!==m&&null!==(f=m.roles)&&void 0!==f&&f.every(function(e){return"STADMIN"===e.code})&&(D="/"+(null===(_=window)||void 0===_?void 0:_.contextPath)+"/employee/dss/landing/home"),I.replace(D)}},[y]);var _=function(){b(null)},D=c.inputs,T=D[0],L=D[1],R=D[2],A=[{body:[{label:u(T.label),type:T.type,populators:{name:T.name},isMandatory:!0},{label:u(L.label),type:L.type,populators:{name:L.name},isMandatory:!0},{label:u(R.label),type:R.type,populators:{name:R.name,customProps:{},component:function(e,n){return r.createElement(t.Dropdown,d({option:v,className:"login-city-dd",optionKey:"i18nKey",select:function(t){e.onChange(t)},t:u},n))}},isMandatory:!0}]}];return p||E?r.createElement(t.Loader,null):r.createElement(bn,null,r.createElement("div",{className:"employeeBackbuttonAlign"},r.createElement(t.BackButton,{variant:"white",style:{borderBottom:"none"}})),r.createElement(t.FormComposer,{onSubmit:function(e){try{var t=function(){w(!1)};if(!e.city)return alert("Please Select City!"),Promise.resolve();w(!0);var n=d({},e,{userType:"EMPLOYEE"});n.tenantId=e.city.code,delete n.city;var r=ne(function(){return Promise.resolve(Digit.UserService.authenticate(n)).then(function(e){var t=e.UserRequest,n=f(e,xn);Digit.SessionStorage.set("Employee.tenantId",null==t?void 0:t.tenantId),h(d({info:t},n))})},function(e){var t,n;b((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error_description)||"ES_ERROR_USER_NOT_PERMITTED"==(null==e?void 0:e.message)&&u("ES_ERROR_USER_NOT_PERMITTED")||u("INVALID_LOGIN_CREDENTIALS")),setTimeout(_,5e3)});return Promise.resolve(r&&r.then?r.then(t):t())}catch(e){return Promise.reject(e)}},isDisabled:s||N,noBoxShadow:!0,inline:!0,submitInForm:!0,config:A,label:c.texts.submitButtonLabel,secondaryActionLabel:c.texts.secondaryButtonLabel,onSecondayActionClick:function(){var e;I.push("/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/employee/user/forgot-password")},heading:c.texts.header,headingStyle:{textAlign:"center"},cardStyle:{margin:"auto",minWidth:"408px"},className:"loginFormStyleEmployee",buttonStyle:{maxWidth:"100%",width:"100%"}},r.createElement(Sn,null)),O&&r.createElement(t.Toast,{error:!0,label:u(O),onClose:_}),r.createElement("div",{className:"employee-login-home-footer",style:{backgroundColor:"unset"}},r.createElement("img",{alt:"Powered by DIGIT",src:null===(i=window)||void 0===i||null===(o=i.globalConfigs)||void 0===o||null===(a=o.getConfig)||void 0===a?void 0:a.call(o,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:function(){var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})," "))};Mn.propTypes={loginParams:On.any},Mn.defaultProps={loginParams:null};var kn=function(){var e=i.useTranslation().t,t=l.useRouteMatch().path,o=n.useMemo(function(){return Pn.map(function(t){var n={};for(var r in t.texts)n[r]=e(t.texts[r]);return d({},t,{texts:n})},[Pn])});return r.createElement(l.Switch,null,r.createElement(l.Route,{path:""+t,exact:!0},r.createElement(Mn,{config:o[0],t:e})))},Un=["user/profile","user/error"],Bn=function(e){var t,o,a,c,u=e.stateInfo,s=e.userDetails,d=e.CITIZEN,m=e.cityDetails,f=e.mobileView,v=e.handleUserDropdownSelection,p=e.logoUrl,E=e.DSO,y=e.stateCode,C=e.modules,O=e.appTenants,b=e.initData,S=l.useHistory(),N=i.useTranslation().t,w=l.useRouteMatch().path,I=l.useLocation(),_=null==I||null===(t=I.pathname)||void 0===t?void 0:t.includes("language-selection"),D=Un.some(function(e){var t;return null==I||null===(t=I.pathname)||void 0===t?void 0:t.includes(e)});return n.useEffect(function(){Digit.UserService.setType("employee")},[]),r.createElement("div",{className:"employee"},r.createElement(l.Switch,null,r.createElement(l.Route,{path:w+"/user"},D&&r.createElement(W,{t:N,stateInfo:u,userDetails:s,CITIZEN:d,cityDetails:m,mobileView:f,handleUserDropdownSelection:v,logoUrl:p,showSidebar:!!D,showLanguageChange:!_}),r.createElement("div",{className:D?"grounded-container":"loginContainer",style:D?{padding:0,paddingTop:"80px",marginLeft:f?"":"64px"}:{"--banner-url":"url("+(null==u?void 0:u.bannerUrl)+")",padding:"0px"}},r.createElement(l.Switch,null,r.createElement(l.Route,{path:w+"/user/login"},r.createElement(kn,null)),r.createElement(l.Route,{path:w+"/user/forgot-password"},r.createElement(Tn,null)),r.createElement(l.Route,{path:w+"/user/change-password"},r.createElement(In,null)),r.createElement(l.Route,{path:w+"/user/profile"},r.createElement(oe,{stateCode:y,userType:"employee",cityDetails:m})),r.createElement(l.Route,{path:w+"/user/error"},r.createElement(g,{initData:b,goToHome:function(){var e;S.push("/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/employee")}})),r.createElement(l.Route,{path:w+"/user/language-selection"},r.createElement(An,null)),r.createElement(l.Route,null,r.createElement(l.Redirect,{to:w+"/user/language-selection"}))))),r.createElement(l.Route,null,r.createElement(W,{t:N,stateInfo:u,userDetails:s,CITIZEN:d,cityDetails:m,mobileView:f,handleUserDropdownSelection:v,logoUrl:p,modules:C}),r.createElement("div",{className:"main "+(E?"m-auto":"")},r.createElement("div",{className:"employee-app-wrapper"},r.createElement(h,{initData:b},r.createElement(Rn,{stateCode:y,userType:"employee",modules:C,appTenants:O}))),r.createElement("div",{className:"employee-home-footer"},r.createElement("img",{alt:"Powered by DIGIT",src:null===(o=window)||void 0===o||null===(a=o.globalConfigs)||void 0===a||null===(c=a.getConfig)||void 0===c?void 0:c.call(a,"DIGIT_FOOTER"),style:{height:"1.1em",cursor:"pointer"},onClick:function(){var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})))),r.createElement(l.Route,null,r.createElement(l.Redirect,{to:w+"/user/language-selection"}))))},Fn=function(e){var t,i,o,a,c=e.stateCode,u=e.modules,s=e.appTenants,d=e.logoUrl,m=e.initData,f=e.defaultLanding,v=void 0===f?"citizen":f,p=l.useHistory(),E=l.useLocation().pathname,g=window.innerWidth,y=Digit.ULBService.getCurrentUlb(),h=Digit.UserService.getUser(),C=(Digit.Hooks.useStore.getInitData().data||{}).stateInfo,O=Digit.UserService.hasAccess(["FSM_DSO"]),b="CITIZEN"===(null==h||null===(t=h.info)||void 0===t?void 0:t.type)||!window.location.pathname.split("/").includes("employee");window.location.pathname.split("/").includes("employee")&&(b=!1),n.useEffect(function(){var e,t,n;null!=E&&E.includes("application-details")||(null!=E&&E.includes("inbox")||Digit.SessionStorage.del("fsm/inbox/searchParams"),null!=E&&E.includes("search")&&Digit.SessionStorage.del("fsm/search/searchParams")),null!=E&&E.includes("dss")||Digit.SessionStorage.del("DSS_FILTERS"),(null==E?void 0:E.toString())==="/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/employee"&&(Digit.SessionStorage.del("SEARCH_APPLICATION_DETAIL"),Digit.SessionStorage.del("WS_EDIT_APPLICATION_DETAILS")),(null==E?void 0:E.toString())!=="/"+(null===(t=window)||void 0===t?void 0:t.contextPath)+"/citizen"&&(null==E?void 0:E.toString())!=="/"+(null===(n=window)||void 0===n?void 0:n.contextPath)+"/employee"||Digit.SessionStorage.del("WS_DISCONNECTION")},[E]),p.listen(function(){var e;null===(e=window)||void 0===e||e.scrollTo({top:0,left:0,behavior:"smooth"})});var S={stateInfo:C,userDetails:h,CITIZEN:b,cityDetails:y,mobileView:g<=640,handleUserDropdownSelection:function(e){e.func()},logoUrl:d,DSO:O,stateCode:c,modules:u,appTenants:s,sourceUrl:window.location.origin+"/citizen",pathname:E,initData:m};return r.createElement(l.Switch,null,r.createElement(l.Route,{path:"/"+(null===(i=window)||void 0===i?void 0:i.contextPath)+"/employee"},r.createElement(Bn,S)),r.createElement(l.Route,{path:"/"+(null===(o=window)||void 0===o?void 0:o.contextPath)+"/citizen"},r.createElement(Rt,S)),r.createElement(l.Route,null,r.createElement(l.Redirect,{to:"/"+(null===(a=window)||void 0===a?void 0:a.contextPath)+"/"+v})))},jn=[s],Vn=("object"==typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}):u.compose)(u.applyMiddleware.apply(void 0,jn)),Hn=function(e,t){return void 0===t&&(t={}),u.createStore(function(e,t){return u.combineReducers(d({common:(n=e,function(e,t){switch(void 0===e&&(e=n),t.type){case"LANGUAGE_SELECT":return d({},e,{selectedLanguage:t.payload});default:return e}})},t));var n}(e,t),Vn)},zn=function(e){var n,o=e.stateCode,c=e.moduleReducers,u=e.defaultLanding,s=Digit.Hooks.useInitStore(o,e.enabledModules),d=s.data;return s.isLoading?r.createElement(t.Loader,{page:!0}):(i.getI18n(),r.createElement(a.Provider,{store:Hn(d,c(d))},r.createElement(l.BrowserRouter,null,r.createElement(t.Body,null,r.createElement(Fn,{initData:d,stateCode:o,modules:null==d?void 0:d.modules,appTenants:d.tenants,logoUrl:null==d||null===(n=d.stateInfo)||void 0===n?void 0:n.logoUrl,defaultLanding:u})))))},Gn={SelectOtp:se};exports.DigitUI=function(e){var t=e.stateCode,i=e.registry,a=e.enabledModules,l=e.moduleReducers,c=e.defaultLanding,u=n.useState(Digit.Utils.getPrivacyObject()||{}),s=u[0],m=u[1],f=(Digit.UserService.getType(),new o.QueryClient({defaultOptions:{queries:{staleTime:9e5,cacheTime:3e6,retry:!1,retryDelay:function(e){return Infinity}}}})),v=Digit.Contexts.ComponentProvider,p=Digit.Contexts.PrivacyProvider;return Digit.UserService.hasAccess(["FSM_DSO"]),r.createElement("div",null,r.createElement(h,null,r.createElement(o.QueryClientProvider,{client:f},r.createElement(v.Provider,{value:i},r.createElement(p.Provider,{value:{privacy:null==s?void 0:s[window.location.pathname],resetPrivacy:function(e){Digit.Utils.setPrivacyObject({}),m({})},getPrivacy:function(){var e=Digit.Utils.getPrivacyObject();return m(e),e},updatePrivacyDescoped:function(e){var t,n=Digit.Utils.getAllPrivacyObject(),r=d({},n,((t={})[window.location.pathname]=e,t));Digit.Utils.setPrivacyObject(d({},r)),m((null==n?void 0:n[window.location.pathname])||{})},updatePrivacy:function(e,t){m(Digit.Utils.updatePrivacy(e,t)||{})}}},r.createElement(zn,{stateCode:t,enabledModules:a,moduleReducers:l,defaultLanding:c}))))))},exports.initCoreComponents=function(){Object.entries(Gn).forEach(function(e){Digit.ComponentRegistryService.setComponent(e[0],e[1])})};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@egovernments/digit-ui-module-core",
3
- "version": "1.5.21",
3
+ "version": "1.5.22",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.modern.js",